-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
318 additions
and
32 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
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
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
101 changes: 101 additions & 0 deletions
101
projects/demo-app/src/app/time-picker/time-picker-demo.component.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,101 @@ | ||
<mat-tab-group [selectedIndex]="tabIndex" (selectedTabChange)="tabIndex = $event.index"> | ||
<mat-tab label="API REFERENCE"></mat-tab> | ||
<mat-tab label="EXAMPLES"></mat-tab> | ||
</mat-tab-group> | ||
|
||
<mat-card class="demo-card demo-basic" *ngIf="tabIndex === 0"> | ||
<!-- <markdown [url]="'https://raw.githubusercontent.com/DSI-HUG/dejajs-components/develop/projects/deja-js/component/time-picker/readme.md'"></markdown> --> | ||
</mat-card> | ||
|
||
<div *ngIf="tabIndex === 1"> | ||
<mat-card class="demo-card"> | ||
<mat-toolbar color="primary">Basic Time Picker with ngModel and ngModelChange event</mat-toolbar> | ||
<mat-card-content> | ||
<div class="flex-layout"> | ||
<div> | ||
<h3>Without initial hours and minutes (null)</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker [ngModel]="date0" (ngModelChange)="date0Changed($event)" mode="fullTime"></time-picker> | ||
</div> | ||
<p>Selected : {{ date0 | date: 'HH:mm' }}</p> | ||
</div> | ||
<div> | ||
<h3>With initial hours and minutes (09:05)</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker appearance="legacy" [ngModel]="date1" (ngModelChange)="date1Changed($event)" mode="fullTime"></time-picker> | ||
</div> | ||
<p>Selected : {{ date1 | date: 'HH:mm' }}</p> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
<mat-card class="demo-card"> | ||
<mat-toolbar color="primary">Time Picker modes</mat-toolbar> | ||
<mat-card-content> | ||
<div class="flex-layout"> | ||
<div> | ||
<h3>With hours disabled</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker [ngModel]="date2" (ngModelChange)="date2Changed($event)" [step]="5" mode="fullTimeWithHoursDisabled"></time-picker> | ||
</div> | ||
<p>Selected date : {{ date2 | date: 'HH:mm' }}</p> | ||
</div> | ||
<div> | ||
<h3>With minutes disabled</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker [ngModel]="date3" (ngModelChange)="date3Changed($event)" mode="fullTimeWithMinutesDisabled"></time-picker> | ||
</div> | ||
<p>Selected date : {{ date3 | date: 'HH:mm' }}</p> | ||
</div> | ||
<div> | ||
<h3>With hours displayed only</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker [ngModel]="date4" (ngModelChange)="date4Changed($event)" mode="hoursOnly"></time-picker> | ||
</div> | ||
<p>Selected date : {{ date4 | date: 'HH:mm' }}</p> | ||
</div> | ||
<div> | ||
<h3>With minutes displayed only inline in a form</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker inform [ngModel]="date5" (ngModelChange)="date5Changed($event)" mode="minutesOnly"></time-picker> | ||
<mat-form-field appearance="outline"> | ||
<input matInput name="fakeInput" [(ngModel)]="fakeInput" /> | ||
</mat-form-field> | ||
</div> | ||
<p>Selected date : {{ date5 | date: 'HH:mm' }}</p> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
<mat-card class="demo-card"> | ||
<mat-toolbar color="primary">Time Picker disable</mat-toolbar> | ||
<mat-card-content> | ||
<div class="flex-layout"> | ||
<div> | ||
<h3>Time Picker disabled</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker [ngModel]="date6" (ngModelChange)="date6Changed($event)" [disabled]="disable6"></time-picker> | ||
</div> | ||
<p> | ||
<mat-checkbox name="disable-checkbox" [(ngModel)]="disable6">Disable time-picker</mat-checkbox> | ||
</p> | ||
<p>Selected date : {{ date6 | date: 'HH:mm' }}</p> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
<mat-card class="demo-card"> | ||
<mat-toolbar color="primary">Time Picker form control</mat-toolbar> | ||
<mat-card-content> | ||
<div class="flex-layout"> | ||
<form [formGroup]="dateForm"> | ||
<h3>Time Picker form control</h3> | ||
<div class="flex-layout-center"> | ||
<time-picker formControlName="date7"></time-picker> | ||
</div> | ||
<p>Selected date : {{ dateForm.controls.date7.value | date: 'HH:mm' }}</p> | ||
</form> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> |
42 changes: 42 additions & 0 deletions
42
projects/demo-app/src/app/time-picker/time-picker-demo.component.scss
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,42 @@ | ||
app-time-picker-demo { | ||
.flex-layout { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
|
||
> div, | ||
> form { | ||
flex: 1 1 auto; | ||
} | ||
} | ||
|
||
.flex-layout-center { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.time-picker-actions { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-evenly; | ||
} | ||
|
||
/* Override Material datepicker style */ | ||
.mat-calendar-body-cell-content.mat-focus-indicator { | ||
position: absolute !important; | ||
} | ||
|
||
.mat-datepicker-content-container { | ||
flex-direction: row !important; | ||
} | ||
|
||
.mat-datepicker-actions { | ||
margin-left: 64px !important; | ||
} | ||
|
||
time-picker[inform] { | ||
padding-right: 1rem; | ||
} | ||
} |
Oops, something went wrong.