@ascentgl/ads-ui 21.66.0 → 21.68.0

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.
@@ -4129,6 +4129,18 @@ class AdsSearchDropdownComponent extends AbstractDropdownComponent {
4129
4129
  }, 0);
4130
4130
  }
4131
4131
  }
4132
+ /** @ignore - Detect value changes when setValue is called with emitEvent: false */
4133
+ ngDoCheck() {
4134
+ // Check if valueControl value has changed (handles emitEvent: false cases)
4135
+ const currentValue = this.valueControl?.value;
4136
+ if (currentValue !== this.previousValueControlValue) {
4137
+ this.previousValueControlValue = currentValue;
4138
+ // Only sync if not set internally and component is initialized
4139
+ if (!this.isInternalValueSet && this.valueControl) {
4140
+ this.controlValueToDisplayedControlValue();
4141
+ }
4142
+ }
4143
+ }
4132
4144
  /** @ignore */
4133
4145
  ngOnDestroy() {
4134
4146
  if (this.unsubscribeFromScroll)
@@ -4572,11 +4584,27 @@ class AdsSearchDropdownComponent extends AbstractDropdownComponent {
4572
4584
  */
4573
4585
  const displayedValue = this.valueControl.value
4574
4586
  ? this.getDisplayedValue(this.valueControl.value)
4575
- : this.valueControl.value;
4587
+ : null;
4576
4588
  /**
4577
4589
  * use it to build displayedControl value
4578
4590
  */
4579
- this.displayControl.setValue(displayedValue ? { key: this.valueControl.value, value: displayedValue } : this.valueControl.value, { emitEvent: false });
4591
+ this.displayControl.setValue(displayedValue ? { key: this.valueControl.value, value: displayedValue } : null, { emitEvent: false });
4592
+ // When value is cleared, also clear the input element directly and reset state
4593
+ if (!this.valueControl.value) {
4594
+ this.hasSearched = false;
4595
+ this.previousControlValue = '';
4596
+ // Clear displayed options when value is cleared
4597
+ if (!this.staticOptions) {
4598
+ this.displayedOptions = new Map();
4599
+ this.allOptions = new Map();
4600
+ }
4601
+ // Directly clear the input element to ensure UI reflects the cleared state
4602
+ if (this.input?.nativeElement) {
4603
+ this.input.nativeElement.value = '';
4604
+ }
4605
+ }
4606
+ // Trigger change detection to update UI
4607
+ this.cdr.detectChanges();
4580
4608
  // Trigger textarea resize after DOM updates to avoid ExpressionChangedAfterItHasBeenCheckedError
4581
4609
  if (this.wrapOptionText && this.input?.nativeElement instanceof HTMLTextAreaElement) {
4582
4610
  Promise.resolve().then(() => {
@@ -9882,6 +9910,10 @@ class AdsTimeFieldComponent extends AdsInputDropdownComponent {
9882
9910
  this.subscription = Subscription.EMPTY;
9883
9911
  }
9884
9912
  /** @ignore */
9913
+ get mergedErrorMessages() {
9914
+ return { ...this.defaultErrorMessages, ...this.errorMessages };
9915
+ }
9916
+ /** @ignore */
9885
9917
  ngOnChanges(changes) {
9886
9918
  super.ngOnChanges(changes);
9887
9919
  // When validation-suppression is turned off, revalidate internal controls too.
@@ -9974,11 +10006,11 @@ class AdsTimeFieldComponent extends AdsInputDropdownComponent {
9974
10006
  }
9975
10007
  }
9976
10008
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsTimeFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
9977
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AdsTimeFieldComponent, isStandalone: false, selector: "ads-time-field", inputs: { militaryTime: { classPropertyName: "militaryTime", publicName: "militaryTime", isSignal: true, isRequired: false, transformFunction: null }, hideClockIcon: { classPropertyName: "hideClockIcon", publicName: "hideClockIcon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if (militaryTime()) {\n <ads-input\n [control]=\"valueControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n mask=\"Hh:m0\"\n [onBlur]=\"onBlurUpdateTime\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [label]=\"label\"\n [errorMessages]=\"errorMessages\"\n [width]=\"width\"\n [showClockIcon]=\"!hideClockIcon()\"\n [showClearButton]=\"showClearButton\"\n />\n} @else {\n <ads-input-dropdown\n [width]=\"width\"\n [label]=\"label\"\n [options]=\"periodOptions\"\n [hasEmptyValue]=\"false\"\n [control]=\"timeControl\"\n [dropdownControl]=\"periodControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n [placeholder]=\"placeholder\"\n [id]=\"id\"\n [dropdownId]=\"dropdownId\"\n [dropdownLabel]=\"'AM/PM'\"\n [dropdownPlaceholder]=\"dropdownPlaceholder\"\n [dropdownWidth]=\"'128px'\"\n [inputWidth]=\"inputWidth\"\n [tooltip]=\"tooltip\"\n [size]=\"size\"\n [successMessage]=\"successMessage\"\n [errorMessages]=\"errorMessages\"\n [showExclamationOnError]=\"showExclamationOnError\"\n [showClearButton]=\"showClearButton\"\n [immediateValidation]=\"immediateValidation\"\n mask=\"Hh:m0\"\n />\n}\n", styles: [":host::ng-deep .mdc-floating-label{max-width:100%!important}\n", ".footer-container{min-height:20px;overflow:hidden}.footer-container.dynamic{min-height:0;max-height:0;opacity:0;transition:max-height .3s ease-in-out,opacity .2s ease-in-out,min-height .3s ease-in-out}.footer-container.dynamic.has-content{min-height:20px;max-height:100px;opacity:1;transition:max-height .3s ease-in-out,opacity .3s ease-in-out .1s,min-height .3s ease-in-out}::ng-deep .mat-mdc-form-field{--mat-form-field-filled-input-text-placeholder-color: var(--color-medium) !important}::ng-deep .spinner{animation:spin 1s linear infinite;transform-origin:50% 50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: AdsInputDropdownComponent, selector: "ads-input-dropdown", inputs: ["maxlength", "type", "pattern", "dropdownControl", "dropdownId", "dropdownLabel", "dropdownPlaceholder", "inputWidth", "dropdownWidth", "autoSelectSingleDropdownOption", "options", "displayValueKey", "hasEmptyValue", "fitContent", "mask", "suffix", "prefix", "dropSpecialCharacters", "thousandSeparator", "decimalMarker", "showTooltip", "closeOnOutOfView", "outOfViewRootMargin"] }, { kind: "component", type: AdsInputComponent, selector: "ads-input", inputs: ["maxlength", "type", "pattern", "defaultValue", "isPasswordField", "showClockIcon", "mask", "suffix", "prefix", "dropSpecialCharacters", "thousandSeparator", "decimalMarker", "matAutocomplete", "showSearchIcon", "onFocus", "onBlur", "rightHint"] }] }); }
10009
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AdsTimeFieldComponent, isStandalone: false, selector: "ads-time-field", inputs: { militaryTime: { classPropertyName: "militaryTime", publicName: "militaryTime", isSignal: true, isRequired: false, transformFunction: null }, hideClockIcon: { classPropertyName: "hideClockIcon", publicName: "hideClockIcon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if (militaryTime()) {\n <ads-input\n [control]=\"valueControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n mask=\"Hh:m0\"\n [onBlur]=\"onBlurUpdateTime\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [label]=\"label\"\n [errorMessages]=\"mergedErrorMessages\"\n [width]=\"width\"\n [showClockIcon]=\"!hideClockIcon()\"\n [showClearButton]=\"showClearButton\"\n />\n} @else {\n <ads-input-dropdown\n [width]=\"width\"\n [label]=\"label\"\n [options]=\"periodOptions\"\n [hasEmptyValue]=\"false\"\n [control]=\"timeControl\"\n [dropdownControl]=\"periodControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n [placeholder]=\"placeholder\"\n [id]=\"id\"\n [dropdownId]=\"dropdownId\"\n [dropdownLabel]=\"'AM/PM'\"\n [dropdownPlaceholder]=\"dropdownPlaceholder\"\n [dropdownWidth]=\"'128px'\"\n [inputWidth]=\"inputWidth\"\n [tooltip]=\"tooltip\"\n [size]=\"size\"\n [successMessage]=\"successMessage\"\n [errorMessages]=\"mergedErrorMessages\"\n [showExclamationOnError]=\"showExclamationOnError\"\n [showClearButton]=\"showClearButton\"\n [immediateValidation]=\"immediateValidation\"\n mask=\"Hh:m0\"\n />\n}\n", styles: [":host::ng-deep .mdc-floating-label{max-width:100%!important}\n", ".footer-container{min-height:20px;overflow:hidden}.footer-container.dynamic{min-height:0;max-height:0;opacity:0;transition:max-height .3s ease-in-out,opacity .2s ease-in-out,min-height .3s ease-in-out}.footer-container.dynamic.has-content{min-height:20px;max-height:100px;opacity:1;transition:max-height .3s ease-in-out,opacity .3s ease-in-out .1s,min-height .3s ease-in-out}::ng-deep .mat-mdc-form-field{--mat-form-field-filled-input-text-placeholder-color: var(--color-medium) !important}::ng-deep .spinner{animation:spin 1s linear infinite;transform-origin:50% 50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: AdsInputDropdownComponent, selector: "ads-input-dropdown", inputs: ["maxlength", "type", "pattern", "dropdownControl", "dropdownId", "dropdownLabel", "dropdownPlaceholder", "inputWidth", "dropdownWidth", "autoSelectSingleDropdownOption", "options", "displayValueKey", "hasEmptyValue", "fitContent", "mask", "suffix", "prefix", "dropSpecialCharacters", "thousandSeparator", "decimalMarker", "showTooltip", "closeOnOutOfView", "outOfViewRootMargin"] }, { kind: "component", type: AdsInputComponent, selector: "ads-input", inputs: ["maxlength", "type", "pattern", "defaultValue", "isPasswordField", "showClockIcon", "mask", "suffix", "prefix", "dropSpecialCharacters", "thousandSeparator", "decimalMarker", "matAutocomplete", "showSearchIcon", "onFocus", "onBlur", "rightHint"] }] }); }
9978
10010
  }
9979
10011
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsTimeFieldComponent, decorators: [{
9980
10012
  type: Component,
9981
- args: [{ selector: 'ads-time-field', standalone: false, template: "@if (militaryTime()) {\n <ads-input\n [control]=\"valueControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n mask=\"Hh:m0\"\n [onBlur]=\"onBlurUpdateTime\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [label]=\"label\"\n [errorMessages]=\"errorMessages\"\n [width]=\"width\"\n [showClockIcon]=\"!hideClockIcon()\"\n [showClearButton]=\"showClearButton\"\n />\n} @else {\n <ads-input-dropdown\n [width]=\"width\"\n [label]=\"label\"\n [options]=\"periodOptions\"\n [hasEmptyValue]=\"false\"\n [control]=\"timeControl\"\n [dropdownControl]=\"periodControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n [placeholder]=\"placeholder\"\n [id]=\"id\"\n [dropdownId]=\"dropdownId\"\n [dropdownLabel]=\"'AM/PM'\"\n [dropdownPlaceholder]=\"dropdownPlaceholder\"\n [dropdownWidth]=\"'128px'\"\n [inputWidth]=\"inputWidth\"\n [tooltip]=\"tooltip\"\n [size]=\"size\"\n [successMessage]=\"successMessage\"\n [errorMessages]=\"errorMessages\"\n [showExclamationOnError]=\"showExclamationOnError\"\n [showClearButton]=\"showClearButton\"\n [immediateValidation]=\"immediateValidation\"\n mask=\"Hh:m0\"\n />\n}\n", styles: [":host::ng-deep .mdc-floating-label{max-width:100%!important}\n", ".footer-container{min-height:20px;overflow:hidden}.footer-container.dynamic{min-height:0;max-height:0;opacity:0;transition:max-height .3s ease-in-out,opacity .2s ease-in-out,min-height .3s ease-in-out}.footer-container.dynamic.has-content{min-height:20px;max-height:100px;opacity:1;transition:max-height .3s ease-in-out,opacity .3s ease-in-out .1s,min-height .3s ease-in-out}::ng-deep .mat-mdc-form-field{--mat-form-field-filled-input-text-placeholder-color: var(--color-medium) !important}::ng-deep .spinner{animation:spin 1s linear infinite;transform-origin:50% 50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
10013
+ args: [{ selector: 'ads-time-field', standalone: false, template: "@if (militaryTime()) {\n <ads-input\n [control]=\"valueControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n mask=\"Hh:m0\"\n [onBlur]=\"onBlurUpdateTime\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [label]=\"label\"\n [errorMessages]=\"mergedErrorMessages\"\n [width]=\"width\"\n [showClockIcon]=\"!hideClockIcon()\"\n [showClearButton]=\"showClearButton\"\n />\n} @else {\n <ads-input-dropdown\n [width]=\"width\"\n [label]=\"label\"\n [options]=\"periodOptions\"\n [hasEmptyValue]=\"false\"\n [control]=\"timeControl\"\n [dropdownControl]=\"periodControl\"\n [skipValidationWhenEmpty]=\"skipValidationWhenEmpty\"\n [placeholder]=\"placeholder\"\n [id]=\"id\"\n [dropdownId]=\"dropdownId\"\n [dropdownLabel]=\"'AM/PM'\"\n [dropdownPlaceholder]=\"dropdownPlaceholder\"\n [dropdownWidth]=\"'128px'\"\n [inputWidth]=\"inputWidth\"\n [tooltip]=\"tooltip\"\n [size]=\"size\"\n [successMessage]=\"successMessage\"\n [errorMessages]=\"mergedErrorMessages\"\n [showExclamationOnError]=\"showExclamationOnError\"\n [showClearButton]=\"showClearButton\"\n [immediateValidation]=\"immediateValidation\"\n mask=\"Hh:m0\"\n />\n}\n", styles: [":host::ng-deep .mdc-floating-label{max-width:100%!important}\n", ".footer-container{min-height:20px;overflow:hidden}.footer-container.dynamic{min-height:0;max-height:0;opacity:0;transition:max-height .3s ease-in-out,opacity .2s ease-in-out,min-height .3s ease-in-out}.footer-container.dynamic.has-content{min-height:20px;max-height:100px;opacity:1;transition:max-height .3s ease-in-out,opacity .3s ease-in-out .1s,min-height .3s ease-in-out}::ng-deep .mat-mdc-form-field{--mat-form-field-filled-input-text-placeholder-color: var(--color-medium) !important}::ng-deep .spinner{animation:spin 1s linear infinite;transform-origin:50% 50%}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
9982
10014
  }], propDecorators: { militaryTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "militaryTime", required: false }] }], hideClockIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideClockIcon", required: false }] }] } });
9983
10015
 
9984
10016
  class AdsTimeFieldModule {