ui-core-abv 0.8.7 → 0.8.8

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.
@@ -3363,13 +3363,15 @@ class UicTimePickerComponent extends base$3 {
3363
3363
  });
3364
3364
  const portal = new TemplatePortal(this.overlayTemplate, this.vcr);
3365
3365
  this.overlayRef.attach(portal);
3366
- this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());
3366
+ this.overlayRef.backdropClick().subscribe(() => this.closeOverlay(true));
3367
3367
  this.syncSelectionFromValue();
3368
3368
  setTimeout(() => this.scrollToSelection(), 0);
3369
3369
  }
3370
- closeOverlay() {
3370
+ closeOverlay(commitSelection = false) {
3371
3371
  if (this.overlayRef) {
3372
- this.onTouched();
3372
+ if (commitSelection) {
3373
+ this.commitOverlaySelection();
3374
+ }
3373
3375
  this.overlayRef.dispose();
3374
3376
  this.overlayRef = null;
3375
3377
  this.isOverlayOpen = false;
@@ -3380,25 +3382,27 @@ class UicTimePickerComponent extends base$3 {
3380
3382
  * Comitea la selección actual antes de cerrar.
3381
3383
  */
3382
3384
  confirmAndClose() {
3383
- this.commitOverlaySelection();
3384
- this.closeOverlay();
3385
+ this.closeOverlay(true);
3385
3386
  }
3386
3387
  // Selecciones desde overlay
3387
3388
  pickHour(hour) {
3388
3389
  this.selectedHour12 = hour;
3389
- this.commitOverlaySelection();
3390
3390
  }
3391
3391
  pickMinute(minute) {
3392
3392
  this.selectedMinute = minute;
3393
- this.commitOverlaySelection();
3394
3393
  }
3395
3394
  pickMeridiem(meridiem) {
3396
3395
  this.selectedMeridiem = meridiem;
3397
- this.commitOverlaySelection();
3398
3396
  }
3399
3397
  commitOverlaySelection() {
3400
- const base = this.parseDisplay(this.displayValue) ||
3401
- this.parseValue(this.value) || {
3398
+ const current = this.parseDisplay(this.displayValue) || this.parseValue(this.value);
3399
+ const hasOverlaySelection = this.selectedHour12 !== null || this.selectedMinute !== null || this.selectedMeridiem !== null;
3400
+ if (!current && !hasOverlaySelection) {
3401
+ this.displayValue = '';
3402
+ this.notifyChange(null);
3403
+ return;
3404
+ }
3405
+ const base = current || {
3402
3406
  hour12: 12,
3403
3407
  minute: 0,
3404
3408
  meridiem: 'am',