forked from NationalBankBelgium/stark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stark-ui): date-picker - add support for ControlValueAccessor, M…
…atFormFieldControl, Validator and starkTimestampMask directive ISSUES CLOSED: #1146, #1180 BREAKING CHANGE: stark-date-picker now integrates ControlValueAccessor and Validator: - The following Input have been changed: - **date** is now **value** - **maxDate** is now **max** - **minDate** is now **min** - **label** is now **placeholder** - **isDisabled** is now **disabled** - The output **dateChanged** is now **dateChange** - **dateInput** Output has been added and now the date-picker Input/Output are similar to the ones of MatDatepicker component - We respect now the Constraint validation standards. See: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes
- Loading branch information
1 parent
453d092
commit 33fdd2c
Showing
31 changed files
with
1,140 additions
and
296 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
13 changes: 11 additions & 2 deletions
13
packages/stark-ui/src/modules/date-picker/components/date-format.constants.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
37 changes: 21 additions & 16 deletions
37
packages/stark-ui/src/modules/date-picker/components/date-picker.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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
<mat-form-field [id]="pickerId"> | ||
<input | ||
matInput | ||
[disabled]="isDisabled" | ||
[id]="pickerId + '-input'" | ||
[matDatepicker]="picker" | ||
[placeholder]="label | translate" | ||
[matDatepickerFilter]="dateFilterFnWrapper" | ||
[min]="minDate" | ||
[max]="maxDate" | ||
[name]="pickerName" | ||
[value]="date" | ||
(dateChange)="onDateChange($event)" | ||
/> | ||
<input | ||
matInput | ||
[id]="pickerId + '-input'" | ||
[matDatepicker]="picker" | ||
[value]="value" | ||
(dateInput)="onDateInput($event)" | ||
(dateChange)="onDateChange($event)" | ||
[matDatepickerFilter]="dateFilterFnWrapper" | ||
[min]="min" | ||
[disabled]="disabled" | ||
[max]="max" | ||
[name]="pickerName" | ||
[required]="required" | ||
(focus)="onFocus($event)" | ||
(blur)="onBlur()" | ||
[starkTimestampMask]="getTimestampMaskConfig()" | ||
/> | ||
<mat-datepicker [id]="pickerId" #picker></mat-datepicker> | ||
<!-- This class is necessary to apply the mat-form-field styles on the `mat-datepicker-toggle` element. --> | ||
<div class="mat-form-field-suffix"> | ||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> | ||
<mat-datepicker [id]="pickerId" #picker></mat-datepicker> | ||
</mat-form-field> | ||
</div> |
Oops, something went wrong.