@kris701/ez-ui 1.1.1 → 1.1.2

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.
@@ -43,7 +43,7 @@ class EzUIDateInput {
43
43
  ngOnChanges(changes) {
44
44
  if (changes['value'] && changes['value'].currentValue != changes['value'].previousValue) {
45
45
  this.value = changes['value'].currentValue;
46
- this.internalValue.set(this.toTuiDate(this.value));
46
+ this.internalValue.set(this.toTuiDate(this.toDateOrNull(this.value)));
47
47
  }
48
48
  }
49
49
  updateValue() {
@@ -63,13 +63,18 @@ class EzUIDateInput {
63
63
  }
64
64
  return null;
65
65
  }
66
+ toDateOrNull(value) {
67
+ if (value)
68
+ return new Date(value);
69
+ return null;
70
+ }
66
71
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUIDateInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
72
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUIDateInput, isStandalone: true, selector: "ezui-dateinput", inputs: { icon: "icon", label: "label", size: "size", disabled: "disabled", min: "min", max: "max", value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: `
68
73
  <tui-textfield [tuiTextfieldSize]="size" [iconStart]="icon" tuiDropdownSheet>
69
74
  @if(label){
70
75
  <label tuiLabel>{{label}}</label>
71
76
  }
72
- <input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(min)" [max]="toTuiDate(max)"/>
77
+ <input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(toDateOrNull(min))" [max]="toTuiDate(toDateOrNull(max))"/>
73
78
  <tui-calendar *tuiDropdown />
74
79
  </tui-textfield>
75
80
  `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i4$1.TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "component", type: i6.TuiCalendar, selector: "tui-calendar:not([new])", inputs: ["minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "directive", type: TuiDropdownSheet, selector: "[tuiDropdownSheet]", inputs: ["tuiDropdownSheet"] }] });
@@ -86,7 +91,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
86
91
  @if(label){
87
92
  <label tuiLabel>{{label}}</label>
88
93
  }
89
- <input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(min)" [max]="toTuiDate(max)"/>
94
+ <input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(toDateOrNull(min))" [max]="toTuiDate(toDateOrNull(max))"/>
90
95
  <tui-calendar *tuiDropdown />
91
96
  </tui-textfield>
92
97
  ` }]
@@ -126,7 +131,7 @@ class EzUIDateTimeInput {
126
131
  ngOnChanges(changes) {
127
132
  if (changes['value'] && changes['value'].currentValue != changes['value'].previousValue) {
128
133
  this.value = changes['value'].currentValue;
129
- this.internalValue.set(this.toTuiDateTime(this.value));
134
+ this.internalValue.set(this.toTuiDateTime(this.toDateOrNull(this.value)));
130
135
  const internal = this.internalValue();
131
136
  if (!internal || !internal[1])
132
137
  this.showDate.set(true);
@@ -186,13 +191,18 @@ class EzUIDateTimeInput {
186
191
  this.updateValue();
187
192
  }
188
193
  }
194
+ toDateOrNull(value) {
195
+ if (value)
196
+ return new Date(value);
197
+ return null;
198
+ }
189
199
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUIDateTimeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
190
200
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUIDateTimeInput, isStandalone: true, selector: "ezui-datetimeinput", inputs: { icon: "icon", label: "label", size: "size", disabled: "disabled", min: "min", max: "max", value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: `
191
201
  <tui-textfield [tuiTextfieldSize]="size" [iconStart]="icon" tuiDropdownSheet>>
192
202
  @if(label){
193
203
  <label tuiLabel>{{label}}</label>
194
204
  }
195
- <input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(min)" [max]="toTuiDateTime(max)"/>
205
+ <input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(toDateOrNull(min))" [max]="toTuiDateTime(toDateOrNull(max))"/>
196
206
  <section *tuiDropdown class="datetime-dropdown">
197
207
  @let internal = internalValue();
198
208
  @if(showDate()){
@@ -238,7 +248,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
238
248
  @if(label){
239
249
  <label tuiLabel>{{label}}</label>
240
250
  }
241
- <input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(min)" [max]="toTuiDateTime(max)"/>
251
+ <input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(toDateOrNull(min))" [max]="toTuiDateTime(toDateOrNull(max))"/>
242
252
  <section *tuiDropdown class="datetime-dropdown">
243
253
  @let internal = internalValue();
244
254
  @if(showDate()){