@gloww/gloww 20.0.0-beta.25 → 20.0.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, Ma
10
10
  import { CdkScrollable } from '@angular/cdk/scrolling';
11
11
  import * as i2 from '@angular/router';
12
12
  import { NavigationEnd, RouterLink, RouterModule } from '@angular/router';
13
- import * as i1$5 from '@angular/material/button';
13
+ import * as i2$1 from '@angular/material/button';
14
14
  import { MatButton, MatButtonModule } from '@angular/material/button';
15
15
  import * as i1$1 from '@angular/platform-browser';
16
16
  import * as i5 from '@kolkov/angular-editor';
@@ -26,10 +26,10 @@ import { MatError, MatFormField, MatInput, MatLabel, MatInputModule, MatSuffix }
26
26
  import * as i4 from '@ctrl/ngx-codemirror';
27
27
  import { CodemirrorModule, CodemirrorComponent } from '@ctrl/ngx-codemirror';
28
28
  import * as i1$3 from '@angular/forms';
29
- import { NG_VALUE_ACCESSOR, FormsModule, UntypedFormControl, ReactiveFormsModule, Validators } from '@angular/forms';
29
+ import { NG_VALUE_ACCESSOR, FormsModule, UntypedFormControl, ReactiveFormsModule, Validators, FormControl } from '@angular/forms';
30
30
  import { MatProgressBar, MatProgressBarModule } from '@angular/material/progress-bar';
31
31
  import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker, MatDatepickerModule } from '@angular/material/datepicker';
32
- import * as i2$1 from 'ngx-mat-datetime-picker-v2';
32
+ import * as i3$1 from 'ngx-mat-datetime-picker-v2';
33
33
  import { NgxMatDatetimePickerModule, NgxMatNativeDateModule, NgxMatTimepickerComponent } from 'ngx-mat-datetime-picker-v2';
34
34
  import * as i1$4 from '@ngx-translate/core';
35
35
  import { TranslateDefaultParser } from '@ngx-translate/core';
@@ -3624,8 +3624,17 @@ class DatetimeComponent {
3624
3624
  this.showSeconds = false;
3625
3625
  this.disableMinute = false;
3626
3626
  this.touchUi = false;
3627
+ this.dateControl = new FormControl(null);
3627
3628
  this.onChange = () => { };
3628
3629
  this.onTouched = () => { };
3630
+ this.dateControl.valueChanges.subscribe(value => {
3631
+ const normalized = this.normalizeDateValue(value);
3632
+ if (value !== normalized) {
3633
+ this.dateControl.setValue(normalized, { emitEvent: false });
3634
+ }
3635
+ this._value = normalized;
3636
+ this.onChange(normalized);
3637
+ });
3629
3638
  }
3630
3639
  get value() {
3631
3640
  return this._value;
@@ -3634,7 +3643,9 @@ class DatetimeComponent {
3634
3643
  this.updateValue(val);
3635
3644
  }
3636
3645
  writeValue(obj) {
3637
- this._value = this.normalizeDateValue(obj);
3646
+ const normalized = this.normalizeDateValue(obj);
3647
+ this._value = normalized;
3648
+ this.dateControl.setValue(normalized, { emitEvent: false });
3638
3649
  }
3639
3650
  registerOnChange(fn) {
3640
3651
  this.onChange = fn;
@@ -3643,7 +3654,12 @@ class DatetimeComponent {
3643
3654
  this.onTouched = fn;
3644
3655
  }
3645
3656
  setDisabledState(isDisabled) {
3646
- //throw new Error('Method not implemented.');
3657
+ if (isDisabled) {
3658
+ this.dateControl.disable({ emitEvent: false });
3659
+ }
3660
+ else {
3661
+ this.dateControl.enable({ emitEvent: false });
3662
+ }
3647
3663
  }
3648
3664
  get resolvedCancelLabel() {
3649
3665
  if (this.cancelLabel) {
@@ -3657,11 +3673,11 @@ class DatetimeComponent {
3657
3673
  }
3658
3674
  return 'OK';
3659
3675
  }
3660
- onDateInput(value) {
3661
- this.updateValue(value);
3676
+ onDateInput() {
3677
+ this.markTouched();
3662
3678
  }
3663
- onDateChange(value) {
3664
- this.updateValue(value);
3679
+ onDateChange() {
3680
+ this.markTouched();
3665
3681
  }
3666
3682
  normalizeDateValue(value) {
3667
3683
  if (value === undefined || value === null || value === '') {
@@ -3689,8 +3705,13 @@ class DatetimeComponent {
3689
3705
  return null;
3690
3706
  }
3691
3707
  updateValue(value) {
3692
- this._value = this.normalizeDateValue(value);
3693
- this.onChange(this._value);
3708
+ const normalized = this.normalizeDateValue(value);
3709
+ this._value = normalized;
3710
+ this.dateControl.setValue(normalized, { emitEvent: false });
3711
+ this.onChange(normalized);
3712
+ this.markTouched();
3713
+ }
3714
+ markTouched() {
3694
3715
  this.onTouched();
3695
3716
  }
3696
3717
  get isFrenchLocale() {
@@ -3703,7 +3724,7 @@ class DatetimeComponent {
3703
3724
  multi: true,
3704
3725
  useExisting: DatetimeComponent
3705
3726
  }
3706
- ], ngImport: i0, template: "<div style=\"width:100%\">\n @if (mode==='date') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [placeholder]=\"placeHolder\" [value]=\"value\" (dateInput)=\"onDateInput($event.value)\" (dateChange)=\"onDateChange($event.value)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n }\n\n @if (mode==='datetime') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [ngxMatDatetimePicker]=\"pickerDT\" [placeholder]=\"placeHolder\" [value]=\"value\" (dateInput)=\"onDateInput($event.value)\" (dateChange)=\"onDateChange($event.value)\" readonly>\n <mat-datepicker-toggle matSuffix [for]=\"$any(pickerDT)\"></mat-datepicker-toggle>\n <ngx-mat-datetime-picker #pickerDT [showSpinners]=\"showSpinners\" [showSeconds]=\"showSeconds\" [touchUi]=\"touchUi\" [disableMinute]=\"disableMinute\">\n <ngx-mat-datepicker-actions>\n <button mat-button ngxMatDatepickerCancel>{{ resolvedCancelLabel }}</button>\n <button mat-raised-button color=\"primary\" ngxMatDatepickerApply>{{ resolvedApplyLabel }}</button>\n </ngx-mat-datepicker-actions>\n </ngx-mat-datetime-picker>\n </mat-form-field>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$5.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: NgxMatDatetimePickerModule }, { kind: "component", type: i2$1.NgxMatDatetimepicker, selector: "ngx-mat-datetime-picker", exportAs: ["ngxMatDatetimePicker"] }, { kind: "directive", type: i2$1.NgxMatDatepickerInput, selector: "input[ngxMatDatetimePicker]", inputs: ["ngxMatDatetimePicker", "min", "max", "matDatepickerFilter"], exportAs: ["ngxMatDatepickerInput"] }, { kind: "component", type: i2$1.NgxMatDatepickerActions, selector: "ngx-mat-datepicker-actions, ngx-mat-date-range-picker-actions" }, { kind: "directive", type: i2$1.NgxMatDatepickerCancel, selector: "[ngxMatDatepickerCancel], [ngxMatDateRangePickerCancel]" }, { kind: "directive", type: i2$1.NgxMatDatepickerApply, selector: "[ngxMatDatepickerApply], [ngxMatDateRangePickerApply]" }, { kind: "ngmodule", type: NgxMatNativeDateModule }] }); }
3727
+ ], ngImport: i0, template: "<div style=\"width:100%\">\n @if (mode==='date') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [placeholder]=\"placeHolder\" [formControl]=\"dateControl\" (dateInput)=\"onDateInput()\" (dateChange)=\"onDateChange()\" (blur)=\"markTouched()\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n }\n\n @if (mode==='datetime') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [ngxMatDatetimePicker]=\"pickerDT\" [placeholder]=\"placeHolder\" [formControl]=\"dateControl\" (dateInput)=\"onDateInput()\" (dateChange)=\"onDateChange()\" (blur)=\"markTouched()\">\n <mat-datepicker-toggle matSuffix [for]=\"$any(pickerDT)\"></mat-datepicker-toggle>\n <ngx-mat-datetime-picker #pickerDT [showSpinners]=\"showSpinners\" [showSeconds]=\"showSeconds\" [touchUi]=\"touchUi\" [disableMinute]=\"disableMinute\">\n <ngx-mat-datepicker-actions>\n <button mat-button ngxMatDatepickerCancel>{{ resolvedCancelLabel }}</button>\n <button mat-raised-button color=\"primary\" ngxMatDatepickerApply>{{ resolvedApplyLabel }}</button>\n </ngx-mat-datepicker-actions>\n </ngx-mat-datetime-picker>\n </mat-form-field>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: NgxMatDatetimePickerModule }, { kind: "component", type: i3$1.NgxMatDatetimepicker, selector: "ngx-mat-datetime-picker", exportAs: ["ngxMatDatetimePicker"] }, { kind: "directive", type: i3$1.NgxMatDatepickerInput, selector: "input[ngxMatDatetimePicker]", inputs: ["ngxMatDatetimePicker", "min", "max", "matDatepickerFilter"], exportAs: ["ngxMatDatepickerInput"] }, { kind: "component", type: i3$1.NgxMatDatepickerActions, selector: "ngx-mat-datepicker-actions, ngx-mat-date-range-picker-actions" }, { kind: "directive", type: i3$1.NgxMatDatepickerCancel, selector: "[ngxMatDatepickerCancel], [ngxMatDateRangePickerCancel]" }, { kind: "directive", type: i3$1.NgxMatDatepickerApply, selector: "[ngxMatDatepickerApply], [ngxMatDateRangePickerApply]" }, { kind: "ngmodule", type: NgxMatNativeDateModule }] }); }
3707
3728
  }
3708
3729
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DatetimeComponent, decorators: [{
3709
3730
  type: Component,
@@ -3713,7 +3734,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
3713
3734
  multi: true,
3714
3735
  useExisting: DatetimeComponent
3715
3736
  }
3716
- ], imports: [MatFormField, MatLabel, MatInput, MatDatepickerInput, FormsModule, MatDatepickerToggle, MatSuffix, MatDatepicker, MatButtonModule, NgxMatDatetimePickerModule, NgxMatNativeDateModule], template: "<div style=\"width:100%\">\n @if (mode==='date') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [placeholder]=\"placeHolder\" [value]=\"value\" (dateInput)=\"onDateInput($event.value)\" (dateChange)=\"onDateChange($event.value)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n }\n\n @if (mode==='datetime') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [ngxMatDatetimePicker]=\"pickerDT\" [placeholder]=\"placeHolder\" [value]=\"value\" (dateInput)=\"onDateInput($event.value)\" (dateChange)=\"onDateChange($event.value)\" readonly>\n <mat-datepicker-toggle matSuffix [for]=\"$any(pickerDT)\"></mat-datepicker-toggle>\n <ngx-mat-datetime-picker #pickerDT [showSpinners]=\"showSpinners\" [showSeconds]=\"showSeconds\" [touchUi]=\"touchUi\" [disableMinute]=\"disableMinute\">\n <ngx-mat-datepicker-actions>\n <button mat-button ngxMatDatepickerCancel>{{ resolvedCancelLabel }}</button>\n <button mat-raised-button color=\"primary\" ngxMatDatepickerApply>{{ resolvedApplyLabel }}</button>\n </ngx-mat-datepicker-actions>\n </ngx-mat-datetime-picker>\n </mat-form-field>\n }\n</div>\n" }]
3737
+ ], imports: [MatFormField, MatLabel, MatInput, MatDatepickerInput, FormsModule, ReactiveFormsModule, MatDatepickerToggle, MatSuffix, MatDatepicker, MatButtonModule, NgxMatDatetimePickerModule, NgxMatNativeDateModule], template: "<div style=\"width:100%\">\n @if (mode==='date') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [placeholder]=\"placeHolder\" [formControl]=\"dateControl\" (dateInput)=\"onDateInput()\" (dateChange)=\"onDateChange()\" (blur)=\"markTouched()\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n }\n\n @if (mode==='datetime') {\n <mat-form-field>\n <mat-label>{{display}}</mat-label>\n <input matInput [ngxMatDatetimePicker]=\"pickerDT\" [placeholder]=\"placeHolder\" [formControl]=\"dateControl\" (dateInput)=\"onDateInput()\" (dateChange)=\"onDateChange()\" (blur)=\"markTouched()\">\n <mat-datepicker-toggle matSuffix [for]=\"$any(pickerDT)\"></mat-datepicker-toggle>\n <ngx-mat-datetime-picker #pickerDT [showSpinners]=\"showSpinners\" [showSeconds]=\"showSeconds\" [touchUi]=\"touchUi\" [disableMinute]=\"disableMinute\">\n <ngx-mat-datepicker-actions>\n <button mat-button ngxMatDatepickerCancel>{{ resolvedCancelLabel }}</button>\n <button mat-raised-button color=\"primary\" ngxMatDatepickerApply>{{ resolvedApplyLabel }}</button>\n </ngx-mat-datepicker-actions>\n </ngx-mat-datetime-picker>\n </mat-form-field>\n }\n</div>\n" }]
3717
3738
  }], ctorParameters: () => [{ type: undefined, decorators: [{
3718
3739
  type: Optional
3719
3740
  }, {