ui-core-abv 0.8.7 → 0.8.9

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',
@@ -9802,6 +9806,7 @@ const EXTRA_FORM_FIELDS = [
9802
9806
  internalIcon: 'ri-database-2-line',
9803
9807
  tip: 'form_builder.extra.optionsSourceKey_tip',
9804
9808
  type: 'text',
9809
+ selectNullable: true,
9805
9810
  selectSearchEnabled: true,
9806
9811
  showSubtitle: true
9807
9812
  },
@@ -10500,6 +10505,7 @@ class FieldEditorComponent {
10500
10505
  }
10501
10506
  updateFieldValues(fr) {
10502
10507
  const current = this.localField();
10508
+ const hadExternalOptionsSource = !!current.optionsSource?.key;
10503
10509
  const isAutoName = /^(field|sf)_\d+$/.test(current.name ?? '');
10504
10510
  const isNameManuallySet = this.config().nameManuallySet ?? false;
10505
10511
  if (fr['name'] !== undefined && fr['name'] !== current.name) {
@@ -10515,6 +10521,10 @@ class FieldEditorComponent {
10515
10521
  ...fr,
10516
10522
  ...(derivedName !== undefined ? { name: derivedName } : {})
10517
10523
  };
10524
+ const hasExternalOptionsSource = !!updatedField.optionsSource?.key;
10525
+ if (!hadExternalOptionsSource && hasExternalOptionsSource && this.hasOptions()) {
10526
+ updatedField.options = [];
10527
+ }
10518
10528
  this.localField.set(updatedField);
10519
10529
  this.fieldChange.emit(updatedField);
10520
10530
  }
@@ -11415,8 +11425,9 @@ class UicUserFormbuilderComponent {
11415
11425
  const { optionsSource: _optionsSource, ...restFieldData } = cleanFieldData;
11416
11426
  return this.cleanExternalValidationConfig(restFieldData, externalValidation);
11417
11427
  }
11428
+ const { options: _manualOptions, ...fieldDataWithoutManualOptions } = cleanFieldData;
11418
11429
  return this.cleanExternalValidationConfig({
11419
- ...cleanFieldData,
11430
+ ...fieldDataWithoutManualOptions,
11420
11431
  optionsSource: cleanOptionsSource
11421
11432
  }, externalValidation);
11422
11433
  }