-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(timepicker): new timepicker implementation testing
- Loading branch information
Showing
16 changed files
with
448 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
demo/src/app/components/+timepicker/demos/custom-validation/custom-validation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<p>Illustrates custom validation, you have to select time between 11:00 and 12:59</p> | ||
|
||
<div class="form-group" [class.has-success]="ctrl.valid" [class.has-danger]="!ctrl.valid"> | ||
<timepicker [(ngModel)]="myTime" [formControl]="ctrl" required></timepicker> | ||
</div> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime}}</pre> |
14 changes: 14 additions & 0 deletions
14
demo/src/app/components/+timepicker/demos/custom-validation/custom-validation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component } from '@angular/core'; | ||
import { FormControl } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'demo-timepicker-custom-validation', | ||
templateUrl: './custom-validation.html' | ||
}) | ||
export class DemoTimepickerCustomValidationComponent { | ||
public myTime: Date; | ||
|
||
public ctrl = new FormControl('', (control: FormControl) => { | ||
const value = control.value; | ||
console.log('control', control); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
demo/src/app/components/+timepicker/demos/min-max/min-max.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<timepicker [(ngModel)]="myTime" [min]="minTime" [max]="maxTime"></timepicker> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime}}</pre> |
18 changes: 18 additions & 0 deletions
18
demo/src/app/components/+timepicker/demos/min-max/min-max.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-timepicker-min-max', | ||
templateUrl: './min-max.html' | ||
}) | ||
export class DemoTimepickerMinMaxComponent { | ||
public myTime: Date = new Date(); | ||
public minTime: Date = new Date(); | ||
public maxTime: Date = new Date(); | ||
|
||
constructor() { | ||
this.minTime.setHours(8); | ||
this.minTime.setMinutes(0); | ||
this.maxTime.setHours(17); | ||
this.maxTime.setMinutes(0); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
demo/src/app/components/+timepicker/demos/mousewheel-arrowkeys/mousewheel-arrowkeys.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<p>Without mousewheel</p> | ||
|
||
<timepicker [(ngModel)]="myTime1" [mousewheel]="false"></timepicker> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime1}}</pre> | ||
|
||
<p>Without arrowkeys</p> | ||
|
||
<timepicker [(ngModel)]="myTime2" [arrowkeys]="false" (change)="changed()"></timepicker> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime2}}</pre> |
10 changes: 10 additions & 0 deletions
10
demo/src/app/components/+timepicker/demos/mousewheel-arrowkeys/mousewheel-arrowkeys.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-timepicker-mousewheel-arrowkeys', | ||
templateUrl: './mousewheel-arrowkeys.html' | ||
}) | ||
export class DemoTimepickerMousewheelArrowkeysComponent { | ||
public myTime1: Date = new Date(); | ||
public myTime2: Date = new Date(); | ||
} |
3 changes: 3 additions & 0 deletions
3
demo/src/app/components/+timepicker/demos/seconds/seconds.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<timepicker [(ngModel)]="myTime" [showSeconds]="showSec"></timepicker> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime}}</pre> |
10 changes: 10 additions & 0 deletions
10
demo/src/app/components/+timepicker/demos/seconds/seconds.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-timepicker-seconds', | ||
templateUrl: './seconds.html' | ||
}) | ||
export class DemoTimepickerSecondsComponent { | ||
public myTime: Date = new Date(); | ||
public showSec: boolean = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.