@fuentis/phoenix-ui 0.0.9-alpha.579 → 0.0.9-alpha.580

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.
@@ -5744,6 +5744,223 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
5744
5744
  ] }]
5745
5745
  }], ctorParameters: () => [] });
5746
5746
 
5747
+ class MetaStartDueDateComponent {
5748
+ control;
5749
+ parentForm;
5750
+ ctrl;
5751
+ dr = inject(DestroyRef);
5752
+ startDate = null;
5753
+ endDate = null;
5754
+ onChanged = () => { };
5755
+ onTouched = () => { };
5756
+ ngOnInit() {
5757
+ this.ctrl = this.parentForm.get(this.control.configuration.key);
5758
+ if (this.control.mandatory)
5759
+ this.ctrl?.setValidators(this.ctrl?.validator);
5760
+ this.parentForm
5761
+ .get(this.control.configuration.key)
5762
+ ?.valueChanges.pipe(takeUntilDestroyed(this.dr))
5763
+ .subscribe(() => this.validateDates());
5764
+ this.validateDates();
5765
+ }
5766
+ normalizeDateOnly(v) {
5767
+ if (!v)
5768
+ return null;
5769
+ const d = v instanceof Date ? v : new Date(v);
5770
+ if (isNaN(d.getTime()))
5771
+ return null;
5772
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 12, 0, 0, 0);
5773
+ }
5774
+ writeValue(obj) {
5775
+ if (obj) {
5776
+ this.startDate = this.normalizeDateOnly(obj.startDate);
5777
+ this.endDate = this.normalizeDateOnly(obj.endDate);
5778
+ }
5779
+ else {
5780
+ this.startDate = null;
5781
+ this.endDate = null;
5782
+ }
5783
+ this.validateDates();
5784
+ }
5785
+ // Handle start date selection
5786
+ onStartDateSelect(event) {
5787
+ this.startDate = this.normalizeDateOnly(event);
5788
+ this.onChanged({ startDate: this.startDate, endDate: this.endDate });
5789
+ this.validateDates();
5790
+ }
5791
+ // Handle end date selection
5792
+ onEndDateSelect(event) {
5793
+ this.endDate = this.normalizeDateOnly(event);
5794
+ this.onChanged({ startDate: this.startDate, endDate: this.endDate });
5795
+ this.validateDates();
5796
+ }
5797
+ // Handle start date clear value
5798
+ onStartDateClear() {
5799
+ this.startDate = null;
5800
+ this.onChanged({ startDate: this.startDate, endDate: this.endDate });
5801
+ this.validateDates();
5802
+ }
5803
+ // Handle end date clear value
5804
+ onEndDateClear() {
5805
+ this.endDate = null;
5806
+ this.onChanged({ startDate: this.startDate, endDate: this.endDate });
5807
+ this.validateDates();
5808
+ }
5809
+ validateDates() {
5810
+ const c = this.parentForm.get(this.control.configuration.key);
5811
+ if (!c)
5812
+ return;
5813
+ // clear previous errors
5814
+ c.setErrors(null);
5815
+ // Both dates are mandatory
5816
+ if (this.control.mandatory && (!this.startDate || !this.endDate)) {
5817
+ c.setErrors({ required: true });
5818
+ return;
5819
+ }
5820
+ if (this.startDate && this.endDate) {
5821
+ const s = new Date(this.startDate.getFullYear(), this.startDate.getMonth(), this.startDate.getDate(), 12, 0, 0, 0).getTime();
5822
+ const e = new Date(this.endDate.getFullYear(), this.endDate.getMonth(), this.endDate.getDate(), 12, 0, 0, 0).getTime();
5823
+ if (s > e) {
5824
+ c.setErrors({ dueDate: true });
5825
+ return;
5826
+ }
5827
+ }
5828
+ }
5829
+ registerOnChange(fn) {
5830
+ this.onChanged = fn;
5831
+ }
5832
+ registerOnTouched(fn) {
5833
+ this.onTouched = fn;
5834
+ }
5835
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaStartDueDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5836
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MetaStartDueDateComponent, isStandalone: true, selector: "phoenix-meta-start-due-date", inputs: { control: "control", parentForm: "parentForm" }, providers: [
5837
+ {
5838
+ provide: NG_VALUE_ACCESSOR,
5839
+ useExisting: forwardRef(() => MetaStartDueDateComponent),
5840
+ multi: true,
5841
+ },
5842
+ ], ngImport: i0, template: `
5843
+ <div [hidden]="control?.hidden">
5844
+ <phoenix-meta-label [control]="control"></phoenix-meta-label>
5845
+
5846
+ <div class="flex align-items-center gap-2 w-full">
5847
+ <!-- START -->
5848
+ <div class="flex-1" style="min-width: 0;">
5849
+ <p-datepicker
5850
+ class="w-full"
5851
+ [inputStyle]="{ width: '100%' }"
5852
+ [attr.data-cy]="'start-date-' + control?.id"
5853
+ (onSelect)="onStartDateSelect($event)"
5854
+ (onClearClick)="onStartDateClear()"
5855
+ [(ngModel)]="startDate"
5856
+ [ngModelOptions]="{ standalone: true }"
5857
+ [readonlyInput]="true"
5858
+ [showButtonBar]="true"
5859
+ [showIcon]="true"
5860
+ [placeholder]="'LABELS.PLANNED_START' | translate"
5861
+ appendTo="body"
5862
+ ></p-datepicker>
5863
+ </div>
5864
+
5865
+ <!-- ARROW -->
5866
+ <div class="flex align-items-center justify-content-center" style="flex: 0 0 18px;">
5867
+ <i class="pi pi-arrow-right text-sm" style="color: var(--surface-600)"></i>
5868
+ </div>
5869
+
5870
+ <!-- DUE -->
5871
+ <div class="flex-1" style="min-width: 0;">
5872
+ <p-datepicker
5873
+ class="w-full"
5874
+ [inputStyle]="{ width: '100%' }"
5875
+ [attr.data-cy]="'due-date-' + control?.id"
5876
+ (onSelect)="onEndDateSelect($event)"
5877
+ (onClearClick)="onEndDateClear()"
5878
+ [(ngModel)]="endDate"
5879
+ [ngModelOptions]="{ standalone: true }"
5880
+ [readonlyInput]="true"
5881
+ [showButtonBar]="true"
5882
+ [showIcon]="true"
5883
+ [placeholder]="'LABELS.PLANNED_END' | translate"
5884
+ appendTo="body"
5885
+ ></p-datepicker>
5886
+ </div>
5887
+ </div>
5888
+
5889
+ <phoenix-inline-field-error [ctrl]="ctrl"></phoenix-inline-field-error>
5890
+ </div>
5891
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2$6.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: InlineFieldError, selector: "phoenix-inline-field-error", inputs: ["ctrl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MetaLabelComponent, selector: "phoenix-meta-label", inputs: ["control"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
5892
+ }
5893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaStartDueDateComponent, decorators: [{
5894
+ type: Component,
5895
+ args: [{ selector: 'phoenix-meta-start-due-date', standalone: true, imports: [
5896
+ DatePickerModule,
5897
+ InlineFieldError,
5898
+ ReactiveFormsModule,
5899
+ FormsModule,
5900
+ MetaLabelComponent,
5901
+ TranslateModule,
5902
+ ], template: `
5903
+ <div [hidden]="control?.hidden">
5904
+ <phoenix-meta-label [control]="control"></phoenix-meta-label>
5905
+
5906
+ <div class="flex align-items-center gap-2 w-full">
5907
+ <!-- START -->
5908
+ <div class="flex-1" style="min-width: 0;">
5909
+ <p-datepicker
5910
+ class="w-full"
5911
+ [inputStyle]="{ width: '100%' }"
5912
+ [attr.data-cy]="'start-date-' + control?.id"
5913
+ (onSelect)="onStartDateSelect($event)"
5914
+ (onClearClick)="onStartDateClear()"
5915
+ [(ngModel)]="startDate"
5916
+ [ngModelOptions]="{ standalone: true }"
5917
+ [readonlyInput]="true"
5918
+ [showButtonBar]="true"
5919
+ [showIcon]="true"
5920
+ [placeholder]="'LABELS.PLANNED_START' | translate"
5921
+ appendTo="body"
5922
+ ></p-datepicker>
5923
+ </div>
5924
+
5925
+ <!-- ARROW -->
5926
+ <div class="flex align-items-center justify-content-center" style="flex: 0 0 18px;">
5927
+ <i class="pi pi-arrow-right text-sm" style="color: var(--surface-600)"></i>
5928
+ </div>
5929
+
5930
+ <!-- DUE -->
5931
+ <div class="flex-1" style="min-width: 0;">
5932
+ <p-datepicker
5933
+ class="w-full"
5934
+ [inputStyle]="{ width: '100%' }"
5935
+ [attr.data-cy]="'due-date-' + control?.id"
5936
+ (onSelect)="onEndDateSelect($event)"
5937
+ (onClearClick)="onEndDateClear()"
5938
+ [(ngModel)]="endDate"
5939
+ [ngModelOptions]="{ standalone: true }"
5940
+ [readonlyInput]="true"
5941
+ [showButtonBar]="true"
5942
+ [showIcon]="true"
5943
+ [placeholder]="'LABELS.PLANNED_END' | translate"
5944
+ appendTo="body"
5945
+ ></p-datepicker>
5946
+ </div>
5947
+ </div>
5948
+
5949
+ <phoenix-inline-field-error [ctrl]="ctrl"></phoenix-inline-field-error>
5950
+ </div>
5951
+ `, providers: [
5952
+ {
5953
+ provide: NG_VALUE_ACCESSOR,
5954
+ useExisting: forwardRef(() => MetaStartDueDateComponent),
5955
+ multi: true,
5956
+ },
5957
+ ] }]
5958
+ }], propDecorators: { control: [{
5959
+ type: Input
5960
+ }], parentForm: [{
5961
+ type: Input
5962
+ }] } });
5963
+
5747
5964
  class MetaSwitchComponent extends BaseMetaField {
5748
5965
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaSwitchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5749
5966
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MetaSwitchComponent, isStandalone: true, selector: "phoenix-meta-switch", providers: [
@@ -7223,208 +7440,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
7223
7440
  args: ['fileInput']
7224
7441
  }] } });
7225
7442
 
7226
- class MetaStartDueDateComponent {
7227
- control;
7228
- parentForm;
7229
- ctrl;
7230
- dr = inject(DestroyRef);
7231
- startDate;
7232
- endDate;
7233
- onChanged;
7234
- onTouched;
7235
- constructor() { }
7236
- ngOnInit() {
7237
- this.ctrl = this.parentForm.get(this.control.configuration.key);
7238
- this.ctrl = this.parentForm.get(this.control.configuration.key);
7239
- if (this.control.mandatory)
7240
- this.ctrl.setValidators(this.ctrl.validator);
7241
- this.parentForm
7242
- .get(this.control.configuration.key)
7243
- ?.valueChanges.pipe(takeUntilDestroyed(this.dr))
7244
- .subscribe((r) => {
7245
- this.validateDates();
7246
- });
7247
- this.validateDates();
7248
- }
7249
- writeValue(obj) {
7250
- if (obj) {
7251
- this.startDate = obj.startDate;
7252
- this.endDate = obj.endDate;
7253
- }
7254
- else {
7255
- this.startDate = null;
7256
- this.endDate = null;
7257
- }
7258
- }
7259
- // Handle start date selection
7260
- onStartDateSelect(event) {
7261
- this.startDate = event;
7262
- this.onChanged({ startDate: this.startDate, endDate: this.endDate });
7263
- this.validateDates();
7264
- }
7265
- // Handle end date selection
7266
- onEndDateSelect(event) {
7267
- this.endDate = event;
7268
- this.onChanged({ startDate: this.startDate, endDate: this.endDate });
7269
- this.validateDates();
7270
- }
7271
- // Handle start date clear value
7272
- onStartDateClear() {
7273
- this.startDate = null;
7274
- this.onChanged({ startDate: this.startDate, endDate: this.endDate });
7275
- this.validateDates();
7276
- }
7277
- // Handle end date clear value
7278
- onEndDateClear() {
7279
- this.endDate = null;
7280
- this.onChanged({ startDate: this.startDate, endDate: this.endDate });
7281
- this.validateDates();
7282
- }
7283
- validateDates() {
7284
- //Both dates are mandatory
7285
- if (this.control.mandatory && (!this.startDate || !this.endDate)) {
7286
- this.parentForm
7287
- .get(this.control.configuration.key)
7288
- ?.setErrors({ required: true });
7289
- }
7290
- else {
7291
- this.parentForm.get(this.control.configuration.key)?.setErrors(null);
7292
- }
7293
- // End date must be after start date
7294
- if (this.startDate &&
7295
- this.endDate &&
7296
- this.startDate.setHours(0, 0, 0, 0) > this.endDate.setHours(0, 0, 0, 0)) {
7297
- this.parentForm
7298
- .get(this.control.configuration.key)
7299
- ?.setErrors({ dueDate: true });
7300
- }
7301
- //TBD: Scenario if only one date is mandatory
7302
- }
7303
- registerOnChange(fn) {
7304
- this.onChanged = fn;
7305
- }
7306
- registerOnTouched(fn) {
7307
- this.onTouched = fn;
7308
- }
7309
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaStartDueDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7310
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MetaStartDueDateComponent, isStandalone: true, selector: "phoenix-meta-start-due-date", inputs: { control: "control", parentForm: "parentForm" }, providers: [
7311
- {
7312
- provide: NG_VALUE_ACCESSOR,
7313
- useExisting: forwardRef(() => MetaStartDueDateComponent),
7314
- multi: true,
7315
- },
7316
- ], ngImport: i0, template: `
7317
- <div [hidden]="control?.hidden">
7318
- <phoenix-meta-label [control]="control"></phoenix-meta-label>
7319
-
7320
- <div class="flex align-items-center gap-2">
7321
- <div class="flex-1">
7322
- <p-datepicker
7323
- [attr.data-cy]="'start-date-' + control?.id"
7324
- (onSelect)="onStartDateSelect($event)"
7325
- (onClearClick)="onStartDateClear()"
7326
- [style]="{ width: '100%' }"
7327
- [(ngModel)]="startDate"
7328
- [ngModelOptions]="{ standalone: true }"
7329
- [readonlyInput]="true"
7330
- [showButtonBar]="true"
7331
- [showIcon]="true"
7332
- [placeholder]="'LABELS.PLANNED_START' | translate"
7333
- appendTo="body"
7334
- ></p-datepicker>
7335
- </div>
7336
-
7337
- <div class="flex align-items-center justify-content-center px-2" style="flex: 0 0 24px;">
7338
- <i class="pi pi-arrow-right text-sm" style="color: var(--surface-600)"></i>
7339
- </div>
7340
-
7341
- <div class="flex-1">
7342
- <p-datepicker
7343
- [attr.data-cy]="'due-date-' + control?.id"
7344
- (onSelect)="onEndDateSelect($event)"
7345
- (onClearClick)="onEndDateClear()"
7346
- [style]="{ width: '100%' }"
7347
- [(ngModel)]="endDate"
7348
- [ngModelOptions]="{ standalone: true }"
7349
- [readonlyInput]="true"
7350
- [showButtonBar]="true"
7351
- [showIcon]="true"
7352
- [placeholder]="'LABELS.PLANNED_END' | translate"
7353
- appendTo="body"
7354
- ></p-datepicker>
7355
- </div>
7356
- </div>
7357
-
7358
- <phoenix-inline-field-error [ctrl]="ctrl"></phoenix-inline-field-error>
7359
- </div>
7360
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2$6.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: InlineFieldError, selector: "phoenix-inline-field-error", inputs: ["ctrl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MetaLabelComponent, selector: "phoenix-meta-label", inputs: ["control"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
7361
- }
7362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaStartDueDateComponent, decorators: [{
7363
- type: Component,
7364
- args: [{ selector: 'phoenix-meta-start-due-date', standalone: true, imports: [
7365
- DatePickerModule,
7366
- InlineFieldError,
7367
- ReactiveFormsModule,
7368
- FormsModule,
7369
- MetaLabelComponent,
7370
- TranslateModule,
7371
- ], template: `
7372
- <div [hidden]="control?.hidden">
7373
- <phoenix-meta-label [control]="control"></phoenix-meta-label>
7374
-
7375
- <div class="flex align-items-center gap-2">
7376
- <div class="flex-1">
7377
- <p-datepicker
7378
- [attr.data-cy]="'start-date-' + control?.id"
7379
- (onSelect)="onStartDateSelect($event)"
7380
- (onClearClick)="onStartDateClear()"
7381
- [style]="{ width: '100%' }"
7382
- [(ngModel)]="startDate"
7383
- [ngModelOptions]="{ standalone: true }"
7384
- [readonlyInput]="true"
7385
- [showButtonBar]="true"
7386
- [showIcon]="true"
7387
- [placeholder]="'LABELS.PLANNED_START' | translate"
7388
- appendTo="body"
7389
- ></p-datepicker>
7390
- </div>
7391
-
7392
- <div class="flex align-items-center justify-content-center px-2" style="flex: 0 0 24px;">
7393
- <i class="pi pi-arrow-right text-sm" style="color: var(--surface-600)"></i>
7394
- </div>
7395
-
7396
- <div class="flex-1">
7397
- <p-datepicker
7398
- [attr.data-cy]="'due-date-' + control?.id"
7399
- (onSelect)="onEndDateSelect($event)"
7400
- (onClearClick)="onEndDateClear()"
7401
- [style]="{ width: '100%' }"
7402
- [(ngModel)]="endDate"
7403
- [ngModelOptions]="{ standalone: true }"
7404
- [readonlyInput]="true"
7405
- [showButtonBar]="true"
7406
- [showIcon]="true"
7407
- [placeholder]="'LABELS.PLANNED_END' | translate"
7408
- appendTo="body"
7409
- ></p-datepicker>
7410
- </div>
7411
- </div>
7412
-
7413
- <phoenix-inline-field-error [ctrl]="ctrl"></phoenix-inline-field-error>
7414
- </div>
7415
- `, providers: [
7416
- {
7417
- provide: NG_VALUE_ACCESSOR,
7418
- useExisting: forwardRef(() => MetaStartDueDateComponent),
7419
- multi: true,
7420
- },
7421
- ] }]
7422
- }], ctorParameters: () => [], propDecorators: { control: [{
7423
- type: Input
7424
- }], parentForm: [{
7425
- type: Input
7426
- }] } });
7427
-
7428
7443
  class MetaFormComponent extends MetaFormAbstract {
7429
7444
  constructor(fb, metaService, translateService, http
7430
7445
  // env: EnvService
@@ -8754,8 +8769,8 @@ class MetaStartDueDateV2Component {
8754
8769
  * NOTE: "YYYY-MM-DD" strings are parsed as local dates to avoid timezone day-shifts.
8755
8770
  */
8756
8771
  writeValue(v) {
8757
- this.startDate = this.parseToDate(v?.startDate ?? null);
8758
- this.endDate = this.parseToDate(v?.endDate ?? null);
8772
+ this.startDate = this.normalizeDateOnly(this.parseToDate(v?.startDate ?? null));
8773
+ this.endDate = this.normalizeDateOnly(this.parseToDate(v?.endDate ?? null));
8759
8774
  // OnPush: ensure UI reflects external value writes (patchValue/setValue)
8760
8775
  this.cdr.markForCheck();
8761
8776
  }
@@ -8795,7 +8810,7 @@ class MetaStartDueDateV2Component {
8795
8810
  onStartChange(d) {
8796
8811
  if (this.disabled)
8797
8812
  return;
8798
- this.startDate = d ?? null;
8813
+ this.startDate = this.normalizeDateOnly(d ?? null);
8799
8814
  this.emitChange();
8800
8815
  }
8801
8816
  /**
@@ -8805,7 +8820,7 @@ class MetaStartDueDateV2Component {
8805
8820
  onEndChange(d) {
8806
8821
  if (this.disabled)
8807
8822
  return;
8808
- this.endDate = d ?? null;
8823
+ this.endDate = this.normalizeDateOnly(d ?? null);
8809
8824
  this.emitChange();
8810
8825
  }
8811
8826
  /**
@@ -8844,13 +8859,20 @@ class MetaStartDueDateV2Component {
8844
8859
  const y = Number(m[1]);
8845
8860
  const mo = Number(m[2]) - 1;
8846
8861
  const d = Number(m[3]);
8847
- const local = new Date(y, mo, d);
8862
+ const local = new Date(y, mo, d, 12, 0, 0, 0);
8848
8863
  return isNaN(local.getTime()) ? null : local;
8849
8864
  }
8850
8865
  // ISO / other -> fallback
8851
8866
  const dt = new Date(s);
8852
8867
  return isNaN(dt.getTime()) ? null : dt;
8853
8868
  }
8869
+ normalizeDateOnly(d) {
8870
+ if (!d)
8871
+ return null;
8872
+ if (isNaN(d.getTime()))
8873
+ return null;
8874
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 12, 0, 0, 0);
8875
+ }
8854
8876
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MetaStartDueDateV2Component, deps: [], target: i0.ɵɵFactoryTarget.Component });
8855
8877
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MetaStartDueDateV2Component, isStandalone: true, selector: "phoenix-meta-start-due-date-v2", inputs: { dataCy: "dataCy", disable: "disable" }, providers: [
8856
8878
  {