Skip to content

Commit b479f48

Browse files
authored
Merge pull request #15 from qianmoQ/1.2.0-SNAPSHOT
1.2.0 snapshot
2 parents 4756eb6 + 08b85e0 commit b479f48

File tree

14 files changed

+205
-2
lines changed

14 files changed

+205
-2
lines changed

src/renderer/app/layout/layout.routing.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ const LAYOUT_ROUTES: Routes = [
7878
{
7979
path: 'toasty',
8080
loadChildren: () => import('../pages/component/toasty/toasty.module').then(m => m.ToastyComponentModule)
81+
},
82+
{
83+
path: 'typeahead',
84+
loadChildren: () => import('../pages/component/typeahead/typeahead.module').then(m => m.TypeaheadComponentModule)
85+
},
86+
{
87+
path: 'timepicker',
88+
loadChildren: () => import('../pages/component/timepicker/timepicker.module').then(m => m.TimepickerComponentModule)
8189
}
8290
]
8391
},

src/renderer/app/layout/navigation/navigation.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
<li routerLinkActive="navigation__active">
5454
<a [routerLink]="['/component/toasty']"><i class="fa fa-newspaper-o"></i> Toasty</a>
5555
</li>
56+
<li routerLinkActive="navigation__active">
57+
<a [routerLink]="['/component/typeahead']"><i class="fa fa-tty"></i> Typeahead</a>
58+
</li>
59+
<li routerLinkActive="navigation__active">
60+
<a [routerLink]="['/component/timepicker']"><i class="fa fa-times-circle"></i> Timepicker</a>
61+
</li>
5662
</ul>
5763
</li>
5864
<li routerLinkActive="navigation__sub--active" class="navigation__sub">
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<section class="content--row">
2+
<header class="content__title">
3+
<h1>Timepicker</h1>
4+
<small>This template is built using <code>ngx-bootstrap/timepicker</code> and provides some usage examples</small>
5+
</header>
6+
<div class="row">
7+
<div class="col-md-4">
8+
<div class="card">
9+
<div class="card-body">
10+
<h4 class="card-title">Timepicker</h4>
11+
<timepicker [(ngModel)]="timePickerValue" [readonlyInput]="!isTimePickerEnabled"
12+
class="timepicker"></timepicker>
13+
<div class="form-group mt-4">
14+
<input type="text" value="{{timePickerValue | date:'shortTime'}}" class="form-control">
15+
<i class="form-group__bar"></i>
16+
</div>
17+
</div>
18+
</div>
19+
</div>
20+
<div class="col-md-4">
21+
<div class="card">
22+
<div class="card-body">
23+
<h4 class="card-title">24 hours Timepicker</h4>
24+
<timepicker [(ngModel)]="timePickerMeridianValue" [readonlyInput]="!isTimePickerEnabled" class="timepicker"
25+
[showMeridian]="false"></timepicker>
26+
<div class="form-group mt-4">
27+
<input type="text" value="{{timePickerMeridianValue | date: 'HH:mm'}}" class="form-control">
28+
<i class="form-group__bar"></i>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
<div class="col-md-4">
34+
<div class="card">
35+
<div class="card-body">
36+
<h4 class="card-title">Custom Timepicker</h4>
37+
<timepicker [(ngModel)]="timePickerValue" [readonlyInput]="!isTimePickerEnabled" [hourStep]="2"
38+
[minuteStep]="1" class="timepicker"></timepicker>
39+
<div class="form-group mt-4">
40+
<input type="text" value="{{timePickerValue | date:'shortTime'}}" class="form-control">
41+
<i class="form-group__bar"></i>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
<button class="btn btn-primary" (click)="isTimePickerEnabled=!isTimePickerEnabled">Enabling/Disabling</button>
48+
</section>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-component-timepicker',
5+
templateUrl: './timepicker.component.html'
6+
})
7+
export class TimePickerComponent implements OnInit {
8+
isTimePickerEnabled = true;
9+
timePickerValue: Date = new Date();
10+
timePickerMeridianValue: Date = new Date();
11+
12+
constructor() {
13+
}
14+
15+
ngOnInit() {
16+
}
17+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
4+
import { RouterModule } from '@angular/router';
5+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
6+
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
7+
import { TimePickerComponent } from './timepicker.component';
8+
9+
const TIMEPICKER_COMPONENT_ROUTES = [
10+
{path: '', component: TimePickerComponent}
11+
];
12+
13+
@NgModule({
14+
declarations: [
15+
TimePickerComponent
16+
],
17+
imports: [
18+
CommonModule,
19+
FormsModule,
20+
BsDropdownModule.forRoot(),
21+
TimepickerModule.forRoot(),
22+
RouterModule.forChild(TIMEPICKER_COMPONENT_ROUTES)
23+
]
24+
})
25+
export class TimepickerComponentModule {
26+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<section class="content--row">
2+
<header class="content__title">
3+
<h1>Typeahead</h1>
4+
<small>This template is built using <code>ngx-bootstrap/typeahead</code> and provides some usage examples</small>
5+
</header>
6+
<div class="row">
7+
<div class="col-sm-6">
8+
<div class="card">
9+
<div class="card-body">
10+
<h4 class="card-title">Typeahead</h4>
11+
<div class="form-group">
12+
<input [(ngModel)]="selected" [typeahead]="states" class="form-control" placeholder="Enter S here">
13+
<i class="form-group__bar"></i>
14+
</div>
15+
<pre>Selected data: {{selected | json}}</pre>
16+
</div>
17+
</div>
18+
</div>
19+
</div>
20+
</section>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { AfterViewInit, Component } from '@angular/core';
2+
import { TypeaheadService } from '@renderer/services/component/typeahead.service';
3+
4+
@Component({
5+
selector: 'app-component-typeahead',
6+
templateUrl: './typeahead.component.html'
7+
})
8+
export class TypeaheadComponent implements AfterViewInit {
9+
selected: string;
10+
states: string[];
11+
12+
constructor(private typeaheadService: TypeaheadService) {
13+
}
14+
15+
ngAfterViewInit() {
16+
this.states = this.typeaheadService.states;
17+
}
18+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
4+
import { RouterModule } from '@angular/router';
5+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
6+
import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
7+
import { TypeaheadComponent } from './typeahead.component';
8+
import { TypeaheadService } from '@renderer/services/component/typeahead.service';
9+
10+
const TYPEAHEAD_ROUTES = [
11+
{path: '', component: TypeaheadComponent}
12+
];
13+
14+
@NgModule({
15+
declarations: [
16+
TypeaheadComponent
17+
],
18+
imports: [
19+
CommonModule,
20+
FormsModule,
21+
BsDropdownModule.forRoot(),
22+
TypeaheadModule.forRoot(),
23+
RouterModule.forChild(TYPEAHEAD_ROUTES)
24+
],
25+
providers: [
26+
TypeaheadService
27+
]
28+
})
29+
export class TypeaheadComponentModule {
30+
}

src/renderer/app/pages/directive/contribution/contribution.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section class="content--row">
22
<header class="content__title">
3-
<h1>Contribution Charts <code>1.0.0</code></h1>
3+
<h1>Contribution Charts <code>{{version}}</code></h1>
44
<small>Use <code>d3.js</code> to plot contribution charts for high customization.</small>
55
</header>
66
<h4 class="card-title">Contribution</h4>

src/renderer/app/pages/directive/contribution/contribution.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import * as moment from 'moment';
33
import * as d3 from 'd3';
4+
import { PackageUtils } from '@renderer/utils/package.utils';
45

56
@Component({
67
selector: 'app-root',
@@ -9,8 +10,10 @@ import * as d3 from 'd3';
910
})
1011
export class DirectiveContributionComponent implements OnInit {
1112
public data;
13+
public version: string;
1214

1315
constructor() {
16+
this.version = PackageUtils.get('version');
1417
}
1518

1619
ngOnInit(): void {

0 commit comments

Comments
 (0)