@vsn-ux/ngx-gaia 0.9.13 → 0.9.15

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, HostAttributeToken, input, numberAttribute, computed, ViewEncapsulation, Component, NgModule, Injectable, booleanAttribute, ChangeDetectionStrategy, output, contentChild, Directive, linkedSignal, signal, Injector, DestroyRef, effect, isSignal, forwardRef, LOCALE_ID, model, Renderer2, Attribute, untracked, HostListener, viewChild, TemplateRef, contentChildren, NgZone, HostBinding, Input, DOCUMENT, afterNextRender, afterEveryRender } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, HostAttributeToken, input, numberAttribute, computed, ViewEncapsulation, Component, NgModule, Injectable, booleanAttribute, ChangeDetectionStrategy, output, contentChild, Directive, linkedSignal, signal, Injector, DestroyRef, effect, isSignal, forwardRef, LOCALE_ID, model, Renderer2, Attribute, untracked, HostListener, viewChild, TemplateRef, contentChildren, NgZone, HostBinding, Input, DOCUMENT, afterNextRender, afterEveryRender, viewChildren, isDevMode } from '@angular/core';
3
3
  import * as i1 from 'lucide-angular';
4
4
  import { LucideAngularModule, X, CircleCheck, TriangleAlert, OctagonAlert, Info, Check, Minus, ChevronDown, ChevronUp, ChevronRight, ChevronLeft, CalendarDays, CircleX } from 'lucide-angular';
5
5
  import { NgForm, ControlContainer, NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, CheckboxRequiredValidator, RequiredValidator } from '@angular/forms';
@@ -368,7 +368,7 @@ function provideGaAlertI18n(value) {
368
368
  ]);
369
369
  }
370
370
 
371
- let nextUniqueId$9 = 0;
371
+ let nextUniqueId$a = 0;
372
372
  class GaAlertComponent {
373
373
  i18n = inject(GaAlertI18n);
374
374
  dismissIcon = X;
@@ -396,7 +396,7 @@ class GaAlertComponent {
396
396
  return null;
397
397
  });
398
398
  title = contentChild(GaAlertTitleComponent);
399
- progressId = `ga-alert-progress-${++nextUniqueId$9}`;
399
+ progressId = `ga-alert-progress-${++nextUniqueId$a}`;
400
400
  variantClass = computed(() => {
401
401
  return `ga-notification ga-notification--${this.variant()}`;
402
402
  });
@@ -657,10 +657,10 @@ const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
657
657
  };
658
658
  // Increasing integer for generating unique ids for checkbox components.
659
659
  // Inspired by @angular/components
660
- let nextUniqueId$8 = 0;
660
+ let nextUniqueId$9 = 0;
661
661
  class GaCheckboxComponent {
662
662
  /** @ignore */
663
- _uniqueId = `ga-checkbox-${++nextUniqueId$8}`;
663
+ _uniqueId = `ga-checkbox-${++nextUniqueId$9}`;
664
664
  /** @ignore */
665
665
  implicitNgControlState = injectNgControlState();
666
666
  /** @ignore */
@@ -1262,9 +1262,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
1262
1262
  type: Injectable
1263
1263
  }] });
1264
1264
 
1265
- let nextUniqueId$7 = 0;
1265
+ let nextUniqueId$8 = 0;
1266
1266
  class GaInputDirective {
1267
- uniqueId = `ga-input-${++nextUniqueId$7}`;
1267
+ uniqueId = `ga-input-${++nextUniqueId$8}`;
1268
1268
  formFieldConnector = inject(GaFormFieldConnector, {
1269
1269
  optional: true,
1270
1270
  });
@@ -1734,8 +1734,9 @@ class GaDatepickerInputDirective {
1734
1734
  this.formatValue();
1735
1735
  }
1736
1736
  if (emitToNgModel) {
1737
- this.onNgTouchedFn?.();
1738
1737
  this.onNgChangeFn?.(value);
1738
+ // NOTE: ngTouched must be called after ngChange to work with `updateOn: 'blur'` strategy
1739
+ this.onNgTouchedFn?.();
1739
1740
  this.dateInput.emit(value);
1740
1741
  this.dateChange.emit(value);
1741
1742
  }
@@ -2185,7 +2186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2185
2186
 
2186
2187
  const GA_FORM_FIELD_ID = new InjectionToken('ga-form-field-id');
2187
2188
 
2188
- let nextUniqueId$6 = 0;
2189
+ let nextUniqueId$7 = 0;
2189
2190
  class GaFormFieldComponent {
2190
2191
  uniqueId = inject(GA_FORM_FIELD_ID);
2191
2192
  formFieldConnector = inject(GaFormFieldConnector);
@@ -2203,7 +2204,7 @@ class GaFormFieldComponent {
2203
2204
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.4", type: GaFormFieldComponent, isStandalone: true, selector: "ga-form-field", inputs: { disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ga-form-field" }, providers: [
2204
2205
  {
2205
2206
  provide: GA_FORM_FIELD_ID,
2206
- useFactory: () => `ga-form-field-${++nextUniqueId$6}`,
2207
+ useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2207
2208
  },
2208
2209
  GaFormFieldConnector,
2209
2210
  ], queries: [{ propertyName: "fieldInfo", first: true, predicate: GaFieldInfoComponent, descendants: true, isSignal: true }, { propertyName: "fieldErrors", predicate: GaFieldErrorDirective, isSignal: true }], exportAs: ["gaFormField"], ngImport: i0, template: "<ng-content select=\"ga-label\" />\n<ng-content />\n<ga-field-callout />\n", dependencies: [{ kind: "component", type: GaFieldCalloutComponent, selector: "ga-field-callout" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -2215,13 +2216,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
2215
2216
  }, providers: [
2216
2217
  {
2217
2218
  provide: GA_FORM_FIELD_ID,
2218
- useFactory: () => `ga-form-field-${++nextUniqueId$6}`,
2219
+ useFactory: () => `ga-form-field-${++nextUniqueId$7}`,
2219
2220
  },
2220
2221
  GaFormFieldConnector,
2221
2222
  ], template: "<ng-content select=\"ga-label\" />\n<ng-content />\n<ga-field-callout />\n" }]
2222
2223
  }] });
2223
2224
 
2224
- let nextUniqueId$5 = 0;
2225
+ let nextUniqueId$6 = 0;
2225
2226
  /**
2226
2227
  * Internal tooltip component used by the gaTooltip directive.
2227
2228
  * This component is not intended for direct use in templates.
@@ -2229,7 +2230,7 @@ let nextUniqueId$5 = 0;
2229
2230
  * @internal
2230
2231
  */
2231
2232
  class GaTooltipComponent {
2232
- uniqueId = `ga-tooltip-${++nextUniqueId$5}`;
2233
+ uniqueId = `ga-tooltip-${++nextUniqueId$6}`;
2233
2234
  mouseLeaveSubject = new Subject();
2234
2235
  afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
2235
2236
  mouseOver = signal(false);
@@ -3529,10 +3530,10 @@ const RADIO_CONTROL_VALUE_ACCESSOR = {
3529
3530
  multi: true,
3530
3531
  };
3531
3532
  // Increasing integer for generating unique ids for radio components.
3532
- let nextUniqueId$4 = 0;
3533
+ let nextUniqueId$5 = 0;
3533
3534
  class GaRadioGroupComponent {
3534
3535
  /** Name of the radio button group. All radio buttons inside this group will use this name. */
3535
- name = input(`ga-radio-group-${nextUniqueId$4++}`);
3536
+ name = input(`ga-radio-group-${nextUniqueId$5++}`);
3536
3537
  /**
3537
3538
  * Value for the radio-group. Should equal the value of the selected radio button if there is
3538
3539
  * a corresponding radio button with a matching value. If there is not such a corresponding
@@ -3591,7 +3592,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3591
3592
  }] });
3592
3593
 
3593
3594
  // Increasing integer for generating unique ids for radio button components.
3594
- let nextUniqueId$3 = 0;
3595
+ let nextUniqueId$4 = 0;
3595
3596
  class GaRadioButtonComponent {
3596
3597
  radioGroup = inject(GaRadioGroupComponent, {
3597
3598
  optional: true,
@@ -3600,7 +3601,7 @@ class GaRadioButtonComponent {
3600
3601
  optional: true,
3601
3602
  });
3602
3603
  implicitNgControlState = injectNgControlState();
3603
- _uniqueId = `ga-radio-button-${++nextUniqueId$3}`;
3604
+ _uniqueId = `ga-radio-button-${++nextUniqueId$4}`;
3604
3605
  /** The value attribute of the native input element */
3605
3606
  value = input(null);
3606
3607
  inputId = input(null, { alias: 'id' });
@@ -3805,7 +3806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3805
3806
  class GaSelectI18nDefault extends GaSelectI18n {
3806
3807
  /** A label for the clear button */
3807
3808
  clearLabel = 'Clear';
3808
- /** A default label for the search input, unless placeholder is set */
3809
+ /** A default label for the search input */
3809
3810
  defaultSearchInputLabel = 'Search';
3810
3811
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSelectI18nDefault, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
3811
3812
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSelectI18nDefault });
@@ -3866,9 +3867,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
3866
3867
  }, template: "@if (loading()) {\n <ga-select-dropdown-spinner />\n} @else {\n <ng-content />\n}\n" }]
3867
3868
  }] });
3868
3869
 
3869
- let nextUniqueId$2 = 0;
3870
+ let nextUniqueId$3 = 0;
3870
3871
  class GaSelectComponent {
3871
- _uniqueId = `ga-select-${++nextUniqueId$2}`;
3872
+ _uniqueId = `ga-select-${++nextUniqueId$3}`;
3872
3873
  icons = { CircleX };
3873
3874
  _onTouched;
3874
3875
  _onModelChanged;
@@ -3915,6 +3916,7 @@ class GaSelectComponent {
3915
3916
  shouldRecoverFocus = false;
3916
3917
  value = model(null);
3917
3918
  placeholder = input('');
3919
+ searchInputLabel = input(null);
3918
3920
  disabledInput = input(false, {
3919
3921
  alias: 'disabled',
3920
3922
  transform: booleanAttribute,
@@ -4240,13 +4242,13 @@ class GaSelectComponent {
4240
4242
  }, { injector: this.injector });
4241
4243
  }
4242
4244
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4243
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaSelectComponent, isStandalone: true, selector: "ga-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearableLabel: { classPropertyName: "clearableLabel", publicName: "clearableLabel", isSignal: true, isRequired: false, transformFunction: null }, canSelectNullable: { classPropertyName: "canSelectNullable", publicName: "canSelectNullable", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", textValue: "textValueChange", opened: "opened", closed: "closed" }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "click": "toggle()", "keydown.arrowdown": "open(); $event.preventDefault()", "keydown.space": "open(); $event.preventDefault()", "keydown.enter": "open(); $event.preventDefault()", "keydown.backspace": "clearValue(); $event.preventDefault()" }, properties: { "attr.id": "id()", "class.ga-select--multi": "multiple()", "class.ga-select--expanded": "isOpen()", "class.ga-select--disabled": "disabled()", "class.ga-select--invalid": "invalid()", "class.ga-select--empty": "!hasValue()", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? cdkListbox().id : null", "attr.aria-invalid": "invalid()", "attr.aria-disabled": "disabled()", "attr.aria-owns": "isOpen() && searchable() ? cdkListbox().id : null", "attr.aria-activedescendant": "isOpen() && !searchable() ? activeDescendantId() : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "ga-select" }, providers: [
4245
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaSelectComponent, isStandalone: true, selector: "ga-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchInputLabel: { classPropertyName: "searchInputLabel", publicName: "searchInputLabel", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearableLabel: { classPropertyName: "clearableLabel", publicName: "clearableLabel", isSignal: true, isRequired: false, transformFunction: null }, canSelectNullable: { classPropertyName: "canSelectNullable", publicName: "canSelectNullable", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", textValue: "textValueChange", opened: "opened", closed: "closed" }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "click": "toggle()", "keydown.arrowdown": "open(); $event.preventDefault()", "keydown.space": "open(); $event.preventDefault()", "keydown.enter": "open(); $event.preventDefault()", "keydown.backspace": "clearValue(); $event.preventDefault()" }, properties: { "attr.id": "id()", "class.ga-select--multi": "multiple()", "class.ga-select--expanded": "isOpen()", "class.ga-select--disabled": "disabled()", "class.ga-select--invalid": "invalid()", "class.ga-select--empty": "!hasValue()", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? cdkListbox().id : null", "attr.aria-invalid": "invalid()", "attr.aria-disabled": "disabled()", "attr.aria-owns": "isOpen() && searchable() ? cdkListbox().id : null", "attr.aria-activedescendant": "isOpen() && !searchable() ? activeDescendantId() : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "ga-select" }, providers: [
4244
4246
  {
4245
4247
  provide: NG_VALUE_ACCESSOR,
4246
4248
  useExisting: forwardRef(() => GaSelectComponent),
4247
4249
  multi: true,
4248
4250
  },
4249
- ], queries: [{ propertyName: "gaOptions", predicate: GaOptionComponent, descendants: true, read: GaOptionComponent, isSignal: true }, { propertyName: "cdkListbox", first: true, predicate: CdkListbox, descendants: true, isSignal: true }, { propertyName: "gaDropdown", first: true, predicate: GaSelectDropdownComponent, descendants: true, isSignal: true }, { propertyName: "customSelectValue", first: true, predicate: GaSelectValueComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["ngContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "connectedOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkOverlayOrigin }, { directive: GaLabelledByFormFieldDirective, inputs: ["aria-labelledby", "aria-labelledby"] }], ngImport: i0, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox().id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"placeholder() || i18n.defaultSearchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "ngmodule", type: GaButtonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: GaSelectDefaultValueComponent, selector: "ga-select-default-value" }] });
4251
+ ], queries: [{ propertyName: "gaOptions", predicate: GaOptionComponent, descendants: true, read: GaOptionComponent, isSignal: true }, { propertyName: "cdkListbox", first: true, predicate: CdkListbox, descendants: true, isSignal: true }, { propertyName: "gaDropdown", first: true, predicate: GaSelectDropdownComponent, descendants: true, isSignal: true }, { propertyName: "customSelectValue", first: true, predicate: GaSelectValueComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["ngContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "connectedOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkOverlayOrigin }, { directive: GaLabelledByFormFieldDirective, inputs: ["aria-labelledby", "aria-labelledby"] }], ngImport: i0, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox().id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"searchInputLabel() ?? i18n.defaultSearchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "ngmodule", type: GaButtonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: GaSelectDefaultValueComponent, selector: "ga-select-default-value" }] });
4250
4252
  }
4251
4253
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSelectComponent, decorators: [{
4252
4254
  type: Component,
@@ -4289,7 +4291,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
4289
4291
  '(keydown.space)': 'open(); $event.preventDefault()',
4290
4292
  '(keydown.enter)': 'open(); $event.preventDefault()',
4291
4293
  '(keydown.backspace)': 'clearValue(); $event.preventDefault()',
4292
- }, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox().id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"placeholder() || i18n.defaultSearchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n" }]
4294
+ }, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox().id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"searchInputLabel() ?? i18n.defaultSearchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n" }]
4293
4295
  }], ctorParameters: () => [] });
4294
4296
 
4295
4297
  class GaOptgroupComponent {
@@ -4384,6 +4386,933 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
4384
4386
  }]
4385
4387
  }] });
4386
4388
 
4389
+ class GaDataOptionComponent {
4390
+ _isSelected = signal(false);
4391
+ _isActive = signal(false);
4392
+ selectComponent = inject(GaDataSelectComponent);
4393
+ cdkOption = inject(CdkOption, { self: true });
4394
+ value = input(null);
4395
+ disabled = input(false, { transform: booleanAttribute });
4396
+ withInput = input(this.selectComponent.multiple(), {
4397
+ transform: booleanAttribute,
4398
+ });
4399
+ selected = computed(() => {
4400
+ if (!this._isSelected()) {
4401
+ return false;
4402
+ }
4403
+ if (this.cdkOption.value !== undefined &&
4404
+ this.cdkOption.value !== null &&
4405
+ this.cdkOption.value !== '') {
4406
+ return true;
4407
+ }
4408
+ return this.selectComponent.canSelectNullable();
4409
+ });
4410
+ active = this._isActive.asReadonly();
4411
+ constructor() {
4412
+ // NOTE: this is a workaround to set the default empty value (null) for cdkOption
4413
+ if (this.value() !== this.cdkOption.value &&
4414
+ this.cdkOption.value === undefined) {
4415
+ this.cdkOption.value = this.value();
4416
+ }
4417
+ afterEveryRender({
4418
+ read: () => {
4419
+ // NOTE: currently there is no other reliable way to track the selected state,
4420
+ // refactor once cdk will be based on signals or more appropriate events introduced
4421
+ this._isSelected.set(this.cdkOption.isSelected());
4422
+ this._isActive.set(this.cdkOption.isActive());
4423
+ },
4424
+ });
4425
+ }
4426
+ autoClose(event) {
4427
+ if (this.cdkOption.isSelected()) {
4428
+ // if already selected, auto close
4429
+ this.selectComponent.autoClose();
4430
+ event?.preventDefault();
4431
+ }
4432
+ }
4433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4434
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaDataOptionComponent, isStandalone: true, selector: "ga-data-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withInput: { classPropertyName: "withInput", publicName: "withInput", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.enter": "autoClose($event);", "keydown.space": "autoClose($event);", "click": "autoClose();" }, properties: { "class.ga-dropdown__item--selected": "selected()", "class.ga-dropdown__item--disabled": "cdkOption.disabled", "class.ga-dropdown__item--active": "active() && !cdkOption.disabled" }, classAttribute: "ga-dropdown__item" }, hostDirectives: [{ directive: i1$5.CdkOption, inputs: ["cdkOption", "value", "cdkOptionDisabled", "disabled", "cdkOptionTypeaheadLabel", "typeaheadLabel"] }], ngImport: i0, template: "@if (withInput()) {\n @if (selectComponent.multiple()) {\n <ga-checkbox\n [checked]=\"selected()\"\n [disabled]=\"disabled()\"\n aria-hidden=\"true\"\n style=\"pointer-events: none\"\n tabindex=\"-1\"\n />\n } @else {\n <ga-radio-button\n [checked]=\"selected()\"\n [disabled]=\"disabled()\"\n aria-hidden=\"true\"\n style=\"pointer-events: none\"\n tabindex=\"-1\"\n />\n }\n}\n<div class=\"ga-dropdown__item-label\"><ng-content /></div>\n", dependencies: [{ kind: "ngmodule", type: GaCheckboxModule }, { kind: "component", type: GaCheckboxComponent, selector: "ga-checkbox", inputs: ["value", "disabled", "checked", "name", "id", "indeterminate", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "aria-errormessage", "required"], outputs: ["change", "indeterminateChange"] }, { kind: "ngmodule", type: GaRadioModule }, { kind: "component", type: GaRadioButtonComponent, selector: "ga-radio-button", inputs: ["value", "id", "name", "checked", "disabled", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "aria-errormessage"], outputs: ["change"] }] });
4435
+ }
4436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataOptionComponent, decorators: [{
4437
+ type: Component,
4438
+ args: [{ selector: 'ga-data-option', imports: [GaCheckboxModule, GaRadioModule], hostDirectives: [
4439
+ {
4440
+ directive: CdkOption,
4441
+ inputs: [
4442
+ 'cdkOption: value',
4443
+ 'cdkOptionDisabled: disabled',
4444
+ 'cdkOptionTypeaheadLabel: typeaheadLabel',
4445
+ ],
4446
+ },
4447
+ ], host: {
4448
+ class: 'ga-dropdown__item',
4449
+ '[class.ga-dropdown__item--selected]': 'selected()',
4450
+ '[class.ga-dropdown__item--disabled]': 'cdkOption.disabled',
4451
+ '[class.ga-dropdown__item--active]': 'active() && !cdkOption.disabled',
4452
+ '(keydown.enter)': 'autoClose($event);',
4453
+ '(keydown.space)': 'autoClose($event);',
4454
+ '(click)': 'autoClose();',
4455
+ }, template: "@if (withInput()) {\n @if (selectComponent.multiple()) {\n <ga-checkbox\n [checked]=\"selected()\"\n [disabled]=\"disabled()\"\n aria-hidden=\"true\"\n style=\"pointer-events: none\"\n tabindex=\"-1\"\n />\n } @else {\n <ga-radio-button\n [checked]=\"selected()\"\n [disabled]=\"disabled()\"\n aria-hidden=\"true\"\n style=\"pointer-events: none\"\n tabindex=\"-1\"\n />\n }\n}\n<div class=\"ga-dropdown__item-label\"><ng-content /></div>\n" }]
4456
+ }], ctorParameters: () => [] });
4457
+
4458
+ class GaDataSelectValueComponent {
4459
+ selectComponent = inject(GaDataSelectComponent);
4460
+ icons = { X };
4461
+ customValueTemplate = input();
4462
+ customValueTemplateContext = (item) => {
4463
+ if (!item) {
4464
+ return { $implicit: '', value: null, item: null };
4465
+ }
4466
+ return {
4467
+ $implicit: this.selectComponent.getItemLabel(item),
4468
+ value: this.selectComponent.getItemValue(item),
4469
+ item,
4470
+ };
4471
+ };
4472
+ singleViewValue = computed(() => {
4473
+ if (!this.selectComponent.hasValue()) {
4474
+ return '';
4475
+ }
4476
+ const selectValue = this.selectComponent.value();
4477
+ if (!this.selectComponent.bindValue()) {
4478
+ return this.selectComponent.getItemLabel(selectValue);
4479
+ }
4480
+ const item = this.selectComponent
4481
+ .items()
4482
+ .find((item) => this.selectComponent.compareFn()(this.selectComponent.getItemValue(item), selectValue));
4483
+ return this.selectComponent.getItemLabel(item);
4484
+ });
4485
+ selectedItems = computed(() => {
4486
+ const value = this.selectComponent.value();
4487
+ if (!this.selectComponent.hasValue() || !Array.isArray(value)) {
4488
+ return [];
4489
+ }
4490
+ if (!this.selectComponent.bindValue()) {
4491
+ return value;
4492
+ }
4493
+ return this.selectComponent
4494
+ .items()
4495
+ .filter((item) => value.some((v) => this.selectComponent.compareFn()(this.selectComponent.getItemValue(item), v)));
4496
+ });
4497
+ deselectOption(value) {
4498
+ this.selectComponent.deselectValue(value);
4499
+ }
4500
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4501
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaDataSelectValueComponent, isStandalone: true, selector: "ga-data-select-value", inputs: { customValueTemplate: { classPropertyName: "customValueTemplate", publicName: "customValueTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ga-select__value" }, ngImport: i0, template: "@if (selectComponent.multiple()) {\n @for (\n selectedItem of selectedItems();\n track selectComponent.getItemValue(selectedItem)\n ) {\n <div\n class=\"ga-tag\"\n [class.ga-tag--interactive-selected]=\"!selectComponent.disabled()\"\n [class.ga-tag--interactive-selected-disabled]=\"selectComponent.disabled()\"\n >\n <span class=\"ga-tag__label\">\n @if (customValueTemplate(); as templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"customValueTemplateContext(selectedItem)\"\n />\n } @else {\n {{ selectComponent.getItemLabel(selectedItem) }}\n }\n </span>\n @if (!selectComponent.disabled()) {\n <div class=\"ga-tag__separator\"></div>\n <ga-icon\n [icon]=\"icons.X\"\n size=\"16\"\n class=\"ga-tag__icon\"\n (click)=\"\n deselectOption(selectComponent.getItemValue(selectedItem));\n $event.stopPropagation()\n \"\n />\n }\n </div>\n }\n} @else {\n @if (customValueTemplate(); as templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"\n customValueTemplateContext(selectComponent.selectedItem())\n \"\n />\n } @else {\n {{ singleViewValue() }}\n }\n}\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
4502
+ }
4503
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectValueComponent, decorators: [{
4504
+ type: Component,
4505
+ args: [{ selector: 'ga-data-select-value', imports: [GaIconModule, NgTemplateOutlet], host: {
4506
+ class: 'ga-select__value',
4507
+ }, template: "@if (selectComponent.multiple()) {\n @for (\n selectedItem of selectedItems();\n track selectComponent.getItemValue(selectedItem)\n ) {\n <div\n class=\"ga-tag\"\n [class.ga-tag--interactive-selected]=\"!selectComponent.disabled()\"\n [class.ga-tag--interactive-selected-disabled]=\"selectComponent.disabled()\"\n >\n <span class=\"ga-tag__label\">\n @if (customValueTemplate(); as templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"customValueTemplateContext(selectedItem)\"\n />\n } @else {\n {{ selectComponent.getItemLabel(selectedItem) }}\n }\n </span>\n @if (!selectComponent.disabled()) {\n <div class=\"ga-tag__separator\"></div>\n <ga-icon\n [icon]=\"icons.X\"\n size=\"16\"\n class=\"ga-tag__icon\"\n (click)=\"\n deselectOption(selectComponent.getItemValue(selectedItem));\n $event.stopPropagation()\n \"\n />\n }\n </div>\n }\n} @else {\n @if (customValueTemplate(); as templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"templateRef\"\n [ngTemplateOutletContext]=\"\n customValueTemplateContext(selectComponent.selectedItem())\n \"\n />\n } @else {\n {{ singleViewValue() }}\n }\n}\n" }]
4508
+ }] });
4509
+
4510
+ function GA_DATA_SELECT_I18N_FACTORY() {
4511
+ return new GaDataSelectI18nDefault();
4512
+ }
4513
+ class GaDataSelectI18n {
4514
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18n, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4515
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18n, providedIn: 'root', useFactory: GA_DATA_SELECT_I18N_FACTORY });
4516
+ }
4517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18n, decorators: [{
4518
+ type: Injectable,
4519
+ args: [{
4520
+ providedIn: 'root',
4521
+ useFactory: GA_DATA_SELECT_I18N_FACTORY,
4522
+ }]
4523
+ }] });
4524
+ class GaDataSelectI18nDefault extends GaDataSelectI18n {
4525
+ /** A label for the clear button */
4526
+ clearLabel = 'Clear';
4527
+ /** A label for the search input */
4528
+ searchInputLabel = 'Search';
4529
+ /** A label shown when there are no options to display */
4530
+ noOptionsLabel = 'No options';
4531
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18nDefault, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
4532
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18nDefault });
4533
+ }
4534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectI18nDefault, decorators: [{
4535
+ type: Injectable
4536
+ }] });
4537
+ function provideGaDataSelectI18n(value) {
4538
+ return makeEnvironmentProviders([
4539
+ typeof value === 'function'
4540
+ ? { provide: GaDataSelectI18n, useFactory: value }
4541
+ : { provide: GaDataSelectI18n, useValue: value },
4542
+ ]);
4543
+ }
4544
+
4545
+ class GaDataSelectDropdownSpinnerComponent {
4546
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectDropdownSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4547
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.4", type: GaDataSelectDropdownSpinnerComponent, isStandalone: true, selector: "ga-data-select-dropdown-spinner", host: { classAttribute: "ga-dropdown__spinner" }, ngImport: i0, template: `<ga-spinner size="16" />`, isInline: true, dependencies: [{ kind: "ngmodule", type: GaSpinnerModule }, { kind: "component", type: GaSpinnerComponent, selector: "ga-spinner", inputs: ["size"] }] });
4548
+ }
4549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectDropdownSpinnerComponent, decorators: [{
4550
+ type: Component,
4551
+ args: [{
4552
+ selector: 'ga-data-select-dropdown-spinner',
4553
+ template: `<ga-spinner size="16" />`,
4554
+ imports: [GaSpinnerModule],
4555
+ host: {
4556
+ class: 'ga-dropdown__spinner',
4557
+ },
4558
+ }]
4559
+ }] });
4560
+
4561
+ class GaDataSelectDropdownComponent {
4562
+ elementRef = inject(ElementRef);
4563
+ cdkListbox = inject(CdkListbox, { self: true });
4564
+ loading = input(false, { transform: booleanAttribute });
4565
+ resetScroll() {
4566
+ this.elementRef.nativeElement.scrollTo(0, 0);
4567
+ }
4568
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4569
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaDataSelectDropdownComponent, isStandalone: true, selector: "ga-data-select-dropdown", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ga-dropdown ga-dropdown__content" }, hostDirectives: [{ directive: i1$5.CdkListbox, inputs: ["cdkListboxMultiple", "multiple", "cdkListboxUseActiveDescendant", "useActiveDescendant", "cdkListboxNavigationWrapDisabled", "navigationWrapDisabled", "cdkListboxCompareWith", "compareWith"] }], ngImport: i0, template: "<ng-content />\n\n@if (loading()) {\n <ga-data-select-dropdown-spinner />\n}\n", dependencies: [{ kind: "component", type: GaDataSelectDropdownSpinnerComponent, selector: "ga-data-select-dropdown-spinner" }] });
4570
+ }
4571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectDropdownComponent, decorators: [{
4572
+ type: Component,
4573
+ args: [{ selector: 'ga-data-select-dropdown', imports: [GaDataSelectDropdownSpinnerComponent], hostDirectives: [
4574
+ {
4575
+ directive: CdkListbox,
4576
+ inputs: [
4577
+ 'cdkListboxMultiple: multiple',
4578
+ 'cdkListboxUseActiveDescendant: useActiveDescendant',
4579
+ 'cdkListboxNavigationWrapDisabled: navigationWrapDisabled',
4580
+ 'cdkListboxCompareWith: compareWith',
4581
+ ],
4582
+ },
4583
+ ], host: {
4584
+ class: 'ga-dropdown ga-dropdown__content',
4585
+ }, template: "<ng-content />\n\n@if (loading()) {\n <ga-data-select-dropdown-spinner />\n}\n" }]
4586
+ }] });
4587
+
4588
+ class GaDataOptgroupComponent {
4589
+ label = input();
4590
+ customLabelTemplate = input();
4591
+ customLabelContext = input();
4592
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataOptgroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4593
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaDataOptgroupComponent, isStandalone: true, selector: "ga-data-optgroup", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, customLabelTemplate: { classPropertyName: "customLabelTemplate", publicName: "customLabelTemplate", isSignal: true, isRequired: false, transformFunction: null }, customLabelContext: { classPropertyName: "customLabelContext", publicName: "customLabelContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" } }, ngImport: i0, template: `
4594
+ @if (customLabelTemplate(); as templateRef) {
4595
+ <div class="ga-dropdown__caption">
4596
+ <ng-container
4597
+ [ngTemplateOutlet]="templateRef"
4598
+ [ngTemplateOutletContext]="customLabelContext()"
4599
+ />
4600
+ </div>
4601
+ } @else if (label()) {
4602
+ <div class="ga-dropdown__caption">{{ label() }}</div>
4603
+ }
4604
+ <ng-content />
4605
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
4606
+ }
4607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataOptgroupComponent, decorators: [{
4608
+ type: Component,
4609
+ args: [{
4610
+ selector: 'ga-data-optgroup',
4611
+ imports: [NgTemplateOutlet],
4612
+ template: `
4613
+ @if (customLabelTemplate(); as templateRef) {
4614
+ <div class="ga-dropdown__caption">
4615
+ <ng-container
4616
+ [ngTemplateOutlet]="templateRef"
4617
+ [ngTemplateOutletContext]="customLabelContext()"
4618
+ />
4619
+ </div>
4620
+ } @else if (label()) {
4621
+ <div class="ga-dropdown__caption">{{ label() }}</div>
4622
+ }
4623
+ <ng-content />
4624
+ `,
4625
+ host: {
4626
+ role: 'group',
4627
+ },
4628
+ }]
4629
+ }] });
4630
+
4631
+ class GaDataSelectValueDirective {
4632
+ templateRef = inject(TemplateRef, { self: true });
4633
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectValueDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4634
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaDataSelectValueDirective, isStandalone: true, selector: "[gaDataSelectValueTpl]", ngImport: i0 });
4635
+ }
4636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectValueDirective, decorators: [{
4637
+ type: Directive,
4638
+ args: [{
4639
+ selector: '[gaDataSelectValueTpl]',
4640
+ }]
4641
+ }] });
4642
+
4643
+ class GaDataSelectOptionLabelDirective {
4644
+ templateRef = inject(TemplateRef, { self: true });
4645
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectOptionLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4646
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaDataSelectOptionLabelDirective, isStandalone: true, selector: "[gaDataSelectOptionTpl]", ngImport: i0 });
4647
+ }
4648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectOptionLabelDirective, decorators: [{
4649
+ type: Directive,
4650
+ args: [{
4651
+ selector: '[gaDataSelectOptionTpl]',
4652
+ }]
4653
+ }] });
4654
+
4655
+ class GaDataSelectOptgroupLabelDirective {
4656
+ templateRef = inject(TemplateRef, { self: true });
4657
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectOptgroupLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4658
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaDataSelectOptgroupLabelDirective, isStandalone: true, selector: "[gaDataSelectOptgroupLabelTpl]", ngImport: i0 });
4659
+ }
4660
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectOptgroupLabelDirective, decorators: [{
4661
+ type: Directive,
4662
+ args: [{
4663
+ selector: '[gaDataSelectOptgroupLabelTpl]',
4664
+ }]
4665
+ }] });
4666
+
4667
+ class GaIntersectionTriggerComponent {
4668
+ observer;
4669
+ anchor = inject(ElementRef);
4670
+ rootElement = input();
4671
+ rootMargin = input('0px');
4672
+ parentAsRoot = input(false, { transform: booleanAttribute });
4673
+ trigger = output();
4674
+ root = computed(() => {
4675
+ return this.parentAsRoot()
4676
+ ? this.anchor.nativeElement.parentElement
4677
+ : this.rootElement()?.nativeElement;
4678
+ });
4679
+ constructor() {
4680
+ afterNextRender(() => {
4681
+ this.observer = new IntersectionObserver(([entry]) => {
4682
+ if (entry.isIntersecting) {
4683
+ this.trigger.emit();
4684
+ }
4685
+ }, {
4686
+ root: this.root(),
4687
+ rootMargin: this.rootMargin(),
4688
+ threshold: 0,
4689
+ });
4690
+ this.observer.observe(this.anchor.nativeElement);
4691
+ });
4692
+ }
4693
+ ngOnDestroy() {
4694
+ this.observer?.disconnect();
4695
+ }
4696
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaIntersectionTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4697
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaIntersectionTriggerComponent, isStandalone: true, selector: "ga-intersection-trigger", inputs: { rootElement: { classPropertyName: "rootElement", publicName: "rootElement", isSignal: true, isRequired: false, transformFunction: null }, rootMargin: { classPropertyName: "rootMargin", publicName: "rootMargin", isSignal: true, isRequired: false, transformFunction: null }, parentAsRoot: { classPropertyName: "parentAsRoot", publicName: "parentAsRoot", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { trigger: "trigger" }, ngImport: i0, template: ``, isInline: true, styles: [":host{height:0px;display:block;flex-shrink:0}\n"] });
4698
+ }
4699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaIntersectionTriggerComponent, decorators: [{
4700
+ type: Component,
4701
+ args: [{ selector: 'ga-intersection-trigger', template: ``, styles: [":host{height:0px;display:block;flex-shrink:0}\n"] }]
4702
+ }], ctorParameters: () => [] });
4703
+
4704
+ let nextUniqueId$2 = 0;
4705
+ class GaDataSelectComponent {
4706
+ _uniqueId = `ga-data-select-${++nextUniqueId$2}`;
4707
+ icons = { CircleX };
4708
+ _onTouched;
4709
+ _onModelChanged;
4710
+ positions = [
4711
+ {
4712
+ originX: 'end',
4713
+ originY: 'bottom',
4714
+ overlayX: 'end',
4715
+ overlayY: 'top',
4716
+ offsetY: 8,
4717
+ },
4718
+ {
4719
+ originX: 'end',
4720
+ originY: 'top',
4721
+ overlayX: 'end',
4722
+ overlayY: 'bottom',
4723
+ offsetY: -8,
4724
+ },
4725
+ {
4726
+ originX: 'start',
4727
+ originY: 'bottom',
4728
+ overlayX: 'start',
4729
+ overlayY: 'top',
4730
+ offsetY: 8,
4731
+ },
4732
+ {
4733
+ originX: 'start',
4734
+ originY: 'top',
4735
+ overlayX: 'start',
4736
+ overlayY: 'bottom',
4737
+ offsetY: -8,
4738
+ },
4739
+ ];
4740
+ injector = inject(Injector);
4741
+ elementRef = inject((ElementRef));
4742
+ formFieldConnector = inject(GaFormFieldConnector, {
4743
+ optional: true,
4744
+ });
4745
+ i18n = inject(GaDataSelectI18n);
4746
+ overlayOrigin = inject(CdkOverlayOrigin);
4747
+ repositionScrollStrategy = createRepositionScrollStrategy(this.injector);
4748
+ implicitNgControlState = injectNgControlState();
4749
+ _isOpen = signal(false);
4750
+ shouldRecoverFocus = false;
4751
+ searchValue = signal(null);
4752
+ multiple = input(false, { transform: booleanAttribute });
4753
+ value = model(null);
4754
+ placeholder = input('');
4755
+ disabledInput = input(false, {
4756
+ alias: 'disabled',
4757
+ transform: booleanAttribute,
4758
+ });
4759
+ invalidInput = input(null, {
4760
+ alias: 'invalid',
4761
+ transform: booleanAttribute,
4762
+ });
4763
+ compareFn = input((a, b) => a === b);
4764
+ searchable = input(false, { transform: booleanAttribute });
4765
+ customFilter = input(false, { transform: booleanAttribute });
4766
+ clearable = input(false, { transform: booleanAttribute });
4767
+ clearableLabel = input();
4768
+ noOptionsLabel = input();
4769
+ canSelectNullable = input(false, {
4770
+ transform: booleanAttribute,
4771
+ });
4772
+ leftIcon = input();
4773
+ idInput = input(null, { alias: 'id' });
4774
+ items = input([]);
4775
+ bindValue = input();
4776
+ bindLabel = input();
4777
+ groupBy = input();
4778
+ loading = input(false, { transform: booleanAttribute });
4779
+ withOptionInput = input(null, { transform: booleanAttribute });
4780
+ searchValueChange = output();
4781
+ opened = output();
4782
+ closed = output();
4783
+ optionsEndReached = output();
4784
+ dropdownElRef = viewChild('selectDropdown', {
4785
+ read: ElementRef,
4786
+ });
4787
+ gaOptions = viewChildren(GaDataOptionComponent);
4788
+ cdkListbox = viewChild(CdkListbox);
4789
+ gaDropdown = viewChild(GaDataSelectDropdownComponent);
4790
+ customValueTemplate = contentChild(GaDataSelectValueDirective);
4791
+ customOptionLabelTemplate = contentChild(GaDataSelectOptionLabelDirective);
4792
+ customOptgroupLabelTemplate = contentChild(GaDataSelectOptgroupLabelDirective);
4793
+ inputSearch = viewChild('inputSearch');
4794
+ connectedOverlay = viewChild(CdkConnectedOverlay);
4795
+ id = computed(() => {
4796
+ return this.idInput() ?? this._uniqueId;
4797
+ });
4798
+ isOpen = this._isOpen.asReadonly();
4799
+ disabled = linkedSignal(() => this.disabledInput());
4800
+ menuStatusIcon = computed(() => {
4801
+ return this._isOpen() ? ChevronUp : ChevronDown;
4802
+ });
4803
+ selectedItem = computed(() => {
4804
+ if (!this.bindValue()) {
4805
+ return this.value();
4806
+ }
4807
+ return this.items().find((item) => this.compareFn()(this.getItemValue(item), this.value()));
4808
+ });
4809
+ // Selected items for multi-select
4810
+ selectedItems = computed(() => {
4811
+ const value = this.value();
4812
+ if (!this.hasValue() || !Array.isArray(value)) {
4813
+ return [];
4814
+ }
4815
+ return this.items().filter((item) => value.some((v) => this.compareFn()(this.getItemValue(item), v)));
4816
+ });
4817
+ // Template context factory for option labels
4818
+ getOptionLabelTemplateContext(item) {
4819
+ return {
4820
+ $implicit: this.getItemLabel(item),
4821
+ value: this.getItemValue(item),
4822
+ item: item,
4823
+ };
4824
+ }
4825
+ // Template context factory for optgroup labels
4826
+ getOptgroupLabelTemplateContext(group) {
4827
+ return {
4828
+ $implicit: group.label,
4829
+ label: group.label,
4830
+ items: group.items,
4831
+ };
4832
+ }
4833
+ filteredItems = computed(() => {
4834
+ const searchText = this.searchValue()?.toLowerCase() ?? '';
4835
+ if (!searchText || !this.searchable() || this.customFilter()) {
4836
+ return this.items();
4837
+ }
4838
+ return this.items().filter((item) => {
4839
+ const label = this.getItemLabel(item);
4840
+ return label.toLowerCase().includes(searchText);
4841
+ });
4842
+ });
4843
+ // Returns selected values not in filtered items, ensuring cdkListbox maintains state during filtering
4844
+ virtualItems = computed(() => {
4845
+ const value = this.value();
4846
+ if (this.bindValue() || !Array.isArray(value)) {
4847
+ return [];
4848
+ }
4849
+ return value.filter((val) => {
4850
+ return !this.filteredItems().some((item) => this.compareFn()(this.getItemValue(item), val));
4851
+ });
4852
+ });
4853
+ groupedItems = computed(() => {
4854
+ const items = this.filteredItems();
4855
+ const groupByKey = this.groupBy();
4856
+ if (!groupByKey) {
4857
+ return [{ label: null, items }];
4858
+ }
4859
+ const groups = new Map();
4860
+ items.forEach((item) => {
4861
+ const groupLabel = typeof groupByKey === 'function'
4862
+ ? groupByKey(item)
4863
+ : this.getNestedValue(item, groupByKey);
4864
+ if (!groups.has(groupLabel)) {
4865
+ groups.set(groupLabel, []);
4866
+ }
4867
+ groups.get(groupLabel).push(item);
4868
+ });
4869
+ return Array.from(groups.entries()).map(([label, items]) => ({
4870
+ label,
4871
+ items,
4872
+ }));
4873
+ });
4874
+ hasNoOptions = computed(() => {
4875
+ return this.filteredItems().length === 0;
4876
+ });
4877
+ activeDescendantId = computed(() => {
4878
+ const activeOption = this.gaOptions().find((option) => option.active());
4879
+ return activeOption?.cdkOption.id;
4880
+ });
4881
+ hasValue = computed(() => {
4882
+ const value = this.value();
4883
+ if (!this.multiple() && (value === null || value === undefined)) {
4884
+ return this.canSelectNullable();
4885
+ }
4886
+ if (Array.isArray(value)) {
4887
+ return value.length > 0;
4888
+ }
4889
+ return true;
4890
+ });
4891
+ invalid = computed(() => {
4892
+ return this.invalidInput() ?? this.implicitNgControlState.inError();
4893
+ });
4894
+ listboxCompareWith = computed(() => {
4895
+ return (o1, o2) => {
4896
+ if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
4897
+ // for some reason cdkListbox compareWith is sometimes called with null/undefined values
4898
+ // in that case, use strict equality to avoid null reference issues
4899
+ return o1 === o2;
4900
+ }
4901
+ return this.compareFn()(o1, o2);
4902
+ };
4903
+ });
4904
+ // Helper method to get the label for an item
4905
+ getItemLabel(item) {
4906
+ const bindLabel = this.bindLabel();
4907
+ if (!bindLabel) {
4908
+ return String(item);
4909
+ }
4910
+ return String(this.getNestedValue(item, bindLabel));
4911
+ }
4912
+ // Helper method to get the value for an item
4913
+ getItemValue(item) {
4914
+ const bindValue = this.bindValue();
4915
+ if (!bindValue) {
4916
+ return item;
4917
+ }
4918
+ if (this.searchable()) {
4919
+ return item;
4920
+ }
4921
+ return this.getNestedValue(item, bindValue);
4922
+ }
4923
+ // Helper method to check if an item is disabled
4924
+ getItemDisabled(item) {
4925
+ return item?.$disabled === true;
4926
+ }
4927
+ // Helper method to get the typeahead label for an item
4928
+ getItemTypeaheadLabel(item) {
4929
+ return item?.$typeaheadLabel;
4930
+ }
4931
+ // Helper method to get nested property value
4932
+ getNestedValue(obj, path) {
4933
+ return path.split('.').reduce((current, prop) => current?.[prop], obj);
4934
+ }
4935
+ constructor() {
4936
+ effect(() => {
4937
+ // if the select became disabled while open, close it
4938
+ if (this.disabled() && this._isOpen()) {
4939
+ this.close();
4940
+ }
4941
+ });
4942
+ if (isDevMode()) {
4943
+ effect(() => {
4944
+ if (this.bindValue() && this.searchable()) {
4945
+ console.warn('GaDataSelectComponent: `bindValue` is ignored with `searchable` mode, value and item must be of the same type. See docs for more details.');
4946
+ }
4947
+ });
4948
+ }
4949
+ const formFieldConnector = this.formFieldConnector;
4950
+ if (formFieldConnector) {
4951
+ effect(() => formFieldConnector.controlDisabled.set(this.disabled()));
4952
+ }
4953
+ effect(() => {
4954
+ // emit search value changes
4955
+ this.searchValueChange.emit(this.searchValue());
4956
+ });
4957
+ effect(() => {
4958
+ // update the overlayPosition since it may change size when selecting/deselecting options
4959
+ this.value();
4960
+ untracked(() => {
4961
+ if (this.multiple()) {
4962
+ setTimeout(() => {
4963
+ this.connectedOverlay()?.overlayRef?.updatePosition();
4964
+ });
4965
+ }
4966
+ });
4967
+ });
4968
+ effect(() => {
4969
+ // sync cdkListbox inputs & value (push)
4970
+ const cdkListbox = this.cdkListbox();
4971
+ if (cdkListbox) {
4972
+ cdkListbox.value = this.multiple()
4973
+ ? this.value()
4974
+ : [this.value()];
4975
+ }
4976
+ });
4977
+ effect(() => {
4978
+ // when options change, ensure there is an active option selected and correct overlay position
4979
+ const options = this.gaOptions();
4980
+ untracked(() => {
4981
+ if (!this.isOpen()) {
4982
+ return;
4983
+ }
4984
+ if (!options.some((option) => option.cdkOption.isActive())) {
4985
+ const firstOption = options.find((option) => !option.cdkOption.disabled);
4986
+ const selectedOption = options.find((option) => option.cdkOption.isSelected());
4987
+ if (selectedOption && !this.searchValue()) {
4988
+ this.cdkListbox()?._setActiveOption(selectedOption.cdkOption);
4989
+ }
4990
+ else if (firstOption) {
4991
+ // if no active option, set the first enabled as active
4992
+ this.cdkListbox()?._setActiveOption(firstOption.cdkOption);
4993
+ }
4994
+ }
4995
+ this.connectedOverlay()?.overlayRef?.updatePosition();
4996
+ });
4997
+ });
4998
+ effect(() => {
4999
+ // sync cdkListbox value changes (pull)
5000
+ const cdkListbox = this.cdkListbox();
5001
+ if (cdkListbox) {
5002
+ untracked(() => {
5003
+ cdkListbox.valueChange.subscribe(({ value }) => {
5004
+ if (!this.multiple()) {
5005
+ [value] = value;
5006
+ }
5007
+ this.value.set(value);
5008
+ this._onModelChanged?.(value);
5009
+ this.autoClose();
5010
+ });
5011
+ });
5012
+ }
5013
+ });
5014
+ }
5015
+ ngOnInit() {
5016
+ // initialize proper default value for multiple select
5017
+ if (this.multiple() && this.value() === null) {
5018
+ this.value.set([]);
5019
+ }
5020
+ }
5021
+ writeValue(value) {
5022
+ this.value.set(value);
5023
+ }
5024
+ registerOnChange(fn) {
5025
+ this._onModelChanged = fn;
5026
+ }
5027
+ registerOnTouched(fn) {
5028
+ this._onTouched = fn;
5029
+ }
5030
+ setDisabledState(disabled) {
5031
+ this.disabled.set(disabled);
5032
+ }
5033
+ toggle() {
5034
+ if (this._isOpen()) {
5035
+ this.close();
5036
+ }
5037
+ else {
5038
+ this.open();
5039
+ }
5040
+ }
5041
+ open() {
5042
+ if (this.disabled() || this._isOpen()) {
5043
+ return;
5044
+ }
5045
+ this._isOpen.set(true);
5046
+ }
5047
+ close() {
5048
+ if (!this._isOpen()) {
5049
+ return;
5050
+ }
5051
+ this._isOpen.set(false);
5052
+ }
5053
+ autoClose() {
5054
+ // close that was initiated by clicking the option
5055
+ if (!this.multiple()) {
5056
+ this.shouldRecoverFocus = true;
5057
+ this.close();
5058
+ }
5059
+ }
5060
+ focusListbox() {
5061
+ this.cdkListbox().focus();
5062
+ }
5063
+ setActiveItemAsSelected() {
5064
+ const options = this.gaOptions();
5065
+ let activeOption = options.find((option) => option.cdkOption.isActive());
5066
+ if (!activeOption && options.length > 0) {
5067
+ activeOption = options[0];
5068
+ }
5069
+ if (activeOption) {
5070
+ const { cdkOption } = activeOption;
5071
+ if (!this.multiple() && cdkOption.isSelected()) {
5072
+ // if single select and the active option is already selected, do nothing
5073
+ return;
5074
+ }
5075
+ this.cdkListbox().toggle(cdkOption);
5076
+ this.syncValue();
5077
+ }
5078
+ }
5079
+ onOverlayKeydown(event) {
5080
+ if (event.code === 'Escape') {
5081
+ this.shouldRecoverFocus = true;
5082
+ }
5083
+ else if (event.code === 'Tab') {
5084
+ this.close();
5085
+ }
5086
+ }
5087
+ clearValue() {
5088
+ if (!this.clearable()) {
5089
+ return;
5090
+ }
5091
+ if (this.elementRef.nativeElement !== document.activeElement &&
5092
+ this.inputSearch()?.nativeElement !== document.activeElement) {
5093
+ this._onTouched?.();
5094
+ }
5095
+ const value = this.multiple() ? [] : null;
5096
+ this.value.set(value);
5097
+ this._onModelChanged?.(value);
5098
+ this.autoClose();
5099
+ }
5100
+ onInputKeyDown(event) {
5101
+ switch (event.code) {
5102
+ case 'ArrowDown':
5103
+ case 'ArrowUp':
5104
+ case 'Enter': {
5105
+ // redirect the event to the cdkListbox
5106
+ event.preventDefault();
5107
+ event.stopPropagation();
5108
+ const eventClone = new KeyboardEvent(event.type, event);
5109
+ this.dropdownElRef()?.nativeElement.dispatchEvent(eventClone);
5110
+ if (event.code === 'Enter' && this.isOpen()) {
5111
+ // if the value wasn't changed via cdkListbox valueChange, close the dropdown manually
5112
+ this.autoClose();
5113
+ }
5114
+ break;
5115
+ }
5116
+ case 'Space':
5117
+ event.stopPropagation();
5118
+ break;
5119
+ case 'Tab':
5120
+ this.close();
5121
+ break;
5122
+ case 'Backspace':
5123
+ if (this.searchValue() === '') {
5124
+ this.clearValue();
5125
+ }
5126
+ event.stopPropagation();
5127
+ break;
5128
+ }
5129
+ }
5130
+ onOverlayAttach() {
5131
+ this.shouldRecoverFocus = false;
5132
+ this._isOpen.set(true);
5133
+ if (this.searchable()) {
5134
+ this.inputSearch().nativeElement.focus();
5135
+ }
5136
+ else {
5137
+ this.focusListbox();
5138
+ }
5139
+ this.searchValue.set('');
5140
+ afterNextRender({
5141
+ mixedReadWrite: () => {
5142
+ if (!this.multiple()) {
5143
+ this.markSelectedOptionAsActive();
5144
+ }
5145
+ this.scrollActiveOptionIntoView();
5146
+ },
5147
+ }, { injector: this.injector });
5148
+ this.opened.emit();
5149
+ }
5150
+ onOverlayDetach() {
5151
+ this._isOpen.set(false);
5152
+ if (this.inputSearch()?.nativeElement === document.activeElement ||
5153
+ this.shouldRecoverFocus) {
5154
+ this.elementRef.nativeElement.focus();
5155
+ }
5156
+ this.searchValue.set(null);
5157
+ this._onTouched?.();
5158
+ this.closed.emit();
5159
+ }
5160
+ deselectValue(value) {
5161
+ const comboboxValue = this.value();
5162
+ if (Array.isArray(comboboxValue)) {
5163
+ this.value.update((v) => v.filter((item) => !this.compareFn()(item, value)));
5164
+ }
5165
+ else {
5166
+ this.value.set(null);
5167
+ }
5168
+ this._onModelChanged?.(this.value());
5169
+ }
5170
+ endReached() {
5171
+ const dropdownEl = this.dropdownElRef()?.nativeElement;
5172
+ if (!dropdownEl) {
5173
+ return;
5174
+ }
5175
+ if (dropdownEl.scrollHeight > dropdownEl.clientHeight) {
5176
+ this.optionsEndReached.emit();
5177
+ }
5178
+ }
5179
+ syncValue() {
5180
+ let { value } = this.cdkListbox();
5181
+ if (!this.multiple()) {
5182
+ [value] = value;
5183
+ }
5184
+ this.value.set(value);
5185
+ }
5186
+ markSelectedOptionAsActive() {
5187
+ const selectedOption = this.gaOptions().find((option) => option.cdkOption.isSelected());
5188
+ if (selectedOption) {
5189
+ this.cdkListbox()?._setActiveOption(selectedOption.cdkOption);
5190
+ }
5191
+ }
5192
+ scrollActiveOptionIntoView() {
5193
+ const activeOption = this.gaOptions().find((option) => option.cdkOption.isActive());
5194
+ if (activeOption) {
5195
+ activeOption.cdkOption.element.scrollIntoView({
5196
+ block: 'center',
5197
+ inline: 'nearest',
5198
+ });
5199
+ }
5200
+ }
5201
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5202
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: GaDataSelectComponent, isStandalone: true, selector: "ga-data-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, compareFn: { classPropertyName: "compareFn", publicName: "compareFn", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, customFilter: { classPropertyName: "customFilter", publicName: "customFilter", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearableLabel: { classPropertyName: "clearableLabel", publicName: "clearableLabel", isSignal: true, isRequired: false, transformFunction: null }, noOptionsLabel: { classPropertyName: "noOptionsLabel", publicName: "noOptionsLabel", isSignal: true, isRequired: false, transformFunction: null }, canSelectNullable: { classPropertyName: "canSelectNullable", publicName: "canSelectNullable", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, withOptionInput: { classPropertyName: "withOptionInput", publicName: "withOptionInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", searchValueChange: "searchValueChange", opened: "opened", closed: "closed", optionsEndReached: "optionsEndReached" }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "click": "toggle()", "keydown.arrowdown": "open(); $event.preventDefault()", "keydown.space": "open(); $event.preventDefault()", "keydown.enter": "open(); $event.preventDefault()", "keydown.backspace": "clearValue(); $event.preventDefault()" }, properties: { "attr.id": "id()", "class.ga-select--multi": "multiple()", "class.ga-select--expanded": "isOpen()", "class.ga-select--disabled": "disabled()", "class.ga-select--invalid": "invalid()", "class.ga-select--empty": "!hasValue()", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? cdkListbox()?.id : null", "attr.aria-invalid": "invalid()", "attr.aria-disabled": "disabled()", "attr.aria-owns": "isOpen() && searchable() ? cdkListbox()?.id : null", "attr.aria-activedescendant": "isOpen() && !searchable() ? activeDescendantId() : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "ga-select" }, providers: [
5203
+ {
5204
+ provide: NG_VALUE_ACCESSOR,
5205
+ useExisting: forwardRef(() => GaDataSelectComponent),
5206
+ multi: true,
5207
+ },
5208
+ ], queries: [{ propertyName: "customValueTemplate", first: true, predicate: GaDataSelectValueDirective, descendants: true, isSignal: true }, { propertyName: "customOptionLabelTemplate", first: true, predicate: GaDataSelectOptionLabelDirective, descendants: true, isSignal: true }, { propertyName: "customOptgroupLabelTemplate", first: true, predicate: GaDataSelectOptgroupLabelDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dropdownElRef", first: true, predicate: ["selectDropdown"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "gaOptions", predicate: GaDataOptionComponent, descendants: true, isSignal: true }, { propertyName: "cdkListbox", first: true, predicate: CdkListbox, descendants: true, isSignal: true }, { propertyName: "gaDropdown", first: true, predicate: GaDataSelectDropdownComponent, descendants: true, isSignal: true }, { propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "connectedOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkOverlayOrigin }, { directive: GaLabelledByFormFieldDirective, inputs: ["aria-labelledby", "aria-labelledby"] }], ngImport: i0, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!searchValue() || multiple())) {\n <ga-data-select-value\n [customValueTemplate]=\"customValueTemplate()?.templateRef\"\n />\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"searchValue() ?? ''\"\n (input)=\"open(); searchValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox()?.id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"i18n.searchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ga-data-select-dropdown\n [multiple]=\"multiple()\"\n [useActiveDescendant]=\"searchable()\"\n [navigationWrapDisabled]=\"loading()\"\n [compareWith]=\"listboxCompareWith()\"\n [loading]=\"loading()\"\n #selectDropdown\n >\n @if (hasNoOptions() && !loading()) {\n <div class=\"ga-dropdown__caption\">\n {{ noOptionsLabel() ?? i18n.noOptionsLabel }}\n </div>\n }\n\n @for (group of groupedItems(); track group.label) {\n @if (group.label) {\n <ga-data-optgroup\n [label]=\"group.label\"\n [customLabelTemplate]=\"customOptgroupLabelTemplate()?.templateRef\"\n [customLabelContext]=\"getOptgroupLabelTemplateContext(group)\"\n >\n @for (item of group.items; track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput()\"\n [disabled]=\"getItemDisabled(item)\"\n [typeaheadLabel]=\"getItemTypeaheadLabel(item)\"\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"\n getOptionLabelTemplateContext(item)\n \"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n </ga-data-optgroup>\n } @else {\n @for (item of group.items; track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput() ?? multiple()\"\n [disabled]=\"getItemDisabled(item)\"\n [typeaheadLabel]=\"getItemTypeaheadLabel(item)\"\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"getOptionLabelTemplateContext(item)\"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n }\n }\n\n <!--\n Virtual items: Render hidden disabled options for all selected values.\n This ensures cdkListbox maintains state when filtering occurs - even when\n selected values don't match the currently visible filtered options, they\n remain valid options in the listbox, preventing state loss.\n -->\n @for (item of virtualItems(); track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput() ?? multiple()\"\n disabled\n hidden\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"getOptionLabelTemplateContext(item)\"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n\n <ga-intersection-trigger\n parentAsRoot\n rootMargin=\"0% 0% 20px 0%\"\n (trigger)=\"endReached()\"\n />\n </ga-data-select-dropdown>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "ngmodule", type: GaButtonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: GaDataSelectValueComponent, selector: "ga-data-select-value", inputs: ["customValueTemplate"] }, { kind: "component", type: GaDataSelectDropdownComponent, selector: "ga-data-select-dropdown", inputs: ["loading"] }, { kind: "component", type: GaDataOptionComponent, selector: "ga-data-option", inputs: ["value", "disabled", "withInput"] }, { kind: "component", type: GaDataOptgroupComponent, selector: "ga-data-optgroup", inputs: ["label", "customLabelTemplate", "customLabelContext"] }, { kind: "component", type: GaIntersectionTriggerComponent, selector: "ga-intersection-trigger", inputs: ["rootElement", "rootMargin", "parentAsRoot"], outputs: ["trigger"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
5209
+ }
5210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectComponent, decorators: [{
5211
+ type: Component,
5212
+ args: [{ selector: 'ga-data-select', imports: [
5213
+ GaIconModule,
5214
+ GaButtonModule,
5215
+ OverlayModule,
5216
+ GaDataSelectValueComponent,
5217
+ GaDataSelectDropdownComponent,
5218
+ GaDataOptionComponent,
5219
+ GaDataOptgroupComponent,
5220
+ GaIntersectionTriggerComponent,
5221
+ NgTemplateOutlet,
5222
+ ], hostDirectives: [
5223
+ CdkOverlayOrigin,
5224
+ {
5225
+ directive: GaLabelledByFormFieldDirective,
5226
+ inputs: ['aria-labelledby'],
5227
+ },
5228
+ ], providers: [
5229
+ {
5230
+ provide: NG_VALUE_ACCESSOR,
5231
+ useExisting: forwardRef(() => GaDataSelectComponent),
5232
+ multi: true,
5233
+ },
5234
+ ], host: {
5235
+ role: 'combobox',
5236
+ '[attr.id]': 'id()',
5237
+ class: 'ga-select',
5238
+ '[class.ga-select--multi]': 'multiple()',
5239
+ '[class.ga-select--expanded]': 'isOpen()',
5240
+ '[class.ga-select--disabled]': 'disabled()',
5241
+ '[class.ga-select--invalid]': 'invalid()',
5242
+ '[class.ga-select--empty]': '!hasValue()',
5243
+ 'aria-haspopup': 'listbox',
5244
+ '[attr.aria-expanded]': 'isOpen()',
5245
+ '[attr.aria-controls]': 'isOpen() ? cdkListbox()?.id : null',
5246
+ '[attr.aria-invalid]': 'invalid()',
5247
+ '[attr.aria-disabled]': 'disabled()',
5248
+ '[attr.aria-owns]': 'isOpen() && searchable() ? cdkListbox()?.id : null',
5249
+ '[attr.aria-activedescendant]': 'isOpen() && !searchable() ? activeDescendantId() : null',
5250
+ '[attr.tabindex]': 'disabled() ? -1 : 0',
5251
+ '(click)': 'toggle()',
5252
+ '(keydown.arrowdown)': 'open(); $event.preventDefault()',
5253
+ '(keydown.space)': 'open(); $event.preventDefault()',
5254
+ '(keydown.enter)': 'open(); $event.preventDefault()',
5255
+ '(keydown.backspace)': 'clearValue(); $event.preventDefault()',
5256
+ }, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!searchValue() || multiple())) {\n <ga-data-select-value\n [customValueTemplate]=\"customValueTemplate()?.templateRef\"\n />\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"searchValue() ?? ''\"\n (input)=\"open(); searchValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-controls]=\"isOpen() ? cdkListbox()?.id : null\"\n [attr.aria-activedescendant]=\"isOpen() ? activeDescendantId() : null\"\n [attr.aria-label]=\"i18n.searchInputLabel\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n [disabled]=\"disabled()\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n @if (clearable() && hasValue()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"clearValue(); $event.stopPropagation()\"\n [attr.aria-label]=\"clearableLabel() ?? i18n.clearLabel\"\n style=\"font-size: 0\"\n >\n <ga-icon [icon]=\"icons.CircleX\" size=\"16\" />\n </button>\n }\n\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"repositionScrollStrategy\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n (overlayKeydown)=\"onOverlayKeydown($event)\"\n>\n <ga-data-select-dropdown\n [multiple]=\"multiple()\"\n [useActiveDescendant]=\"searchable()\"\n [navigationWrapDisabled]=\"loading()\"\n [compareWith]=\"listboxCompareWith()\"\n [loading]=\"loading()\"\n #selectDropdown\n >\n @if (hasNoOptions() && !loading()) {\n <div class=\"ga-dropdown__caption\">\n {{ noOptionsLabel() ?? i18n.noOptionsLabel }}\n </div>\n }\n\n @for (group of groupedItems(); track group.label) {\n @if (group.label) {\n <ga-data-optgroup\n [label]=\"group.label\"\n [customLabelTemplate]=\"customOptgroupLabelTemplate()?.templateRef\"\n [customLabelContext]=\"getOptgroupLabelTemplateContext(group)\"\n >\n @for (item of group.items; track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput()\"\n [disabled]=\"getItemDisabled(item)\"\n [typeaheadLabel]=\"getItemTypeaheadLabel(item)\"\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"\n getOptionLabelTemplateContext(item)\n \"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n </ga-data-optgroup>\n } @else {\n @for (item of group.items; track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput() ?? multiple()\"\n [disabled]=\"getItemDisabled(item)\"\n [typeaheadLabel]=\"getItemTypeaheadLabel(item)\"\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"getOptionLabelTemplateContext(item)\"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n }\n }\n\n <!--\n Virtual items: Render hidden disabled options for all selected values.\n This ensures cdkListbox maintains state when filtering occurs - even when\n selected values don't match the currently visible filtered options, they\n remain valid options in the listbox, preventing state loss.\n -->\n @for (item of virtualItems(); track getItemValue(item)) {\n <ga-data-option\n [value]=\"getItemValue(item)\"\n [withInput]=\"withOptionInput() ?? multiple()\"\n disabled\n hidden\n >\n @if (customOptionLabelTemplate(); as labelTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate.templateRef\"\n [ngTemplateOutletContext]=\"getOptionLabelTemplateContext(item)\"\n />\n } @else {\n {{ getItemLabel(item) }}\n }\n </ga-data-option>\n }\n\n <ga-intersection-trigger\n parentAsRoot\n rootMargin=\"0% 0% 20px 0%\"\n (trigger)=\"endReached()\"\n />\n </ga-data-select-dropdown>\n</ng-template>\n" }]
5257
+ }], ctorParameters: () => [] });
5258
+
5259
+ /**
5260
+ * @internal - Internal validator provider for ga-data-select required validation
5261
+ */
5262
+ const GA_DATA_SELECT_REQUIRED_VALIDATOR = {
5263
+ provide: NG_VALIDATORS,
5264
+ useExisting: forwardRef(() => GaDataSelectRequiredValidator),
5265
+ multi: true,
5266
+ };
5267
+ /**
5268
+ * @internal - Internal directive for ga-data-select required validation
5269
+ */
5270
+ class GaDataSelectRequiredValidator extends RequiredValidator {
5271
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
5272
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: GaDataSelectRequiredValidator, isStandalone: true, selector: "ga-data-select[required][formControlName], ga-data-select[required][formControl], ga-data-select[required][ngModel]", providers: [GA_DATA_SELECT_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
5273
+ }
5274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectRequiredValidator, decorators: [{
5275
+ type: Directive,
5276
+ args: [{
5277
+ // eslint-disable-next-line @angular-eslint/directive-selector
5278
+ selector: `ga-data-select[required][formControlName], ga-data-select[required][formControl], ga-data-select[required][ngModel]`,
5279
+ providers: [GA_DATA_SELECT_REQUIRED_VALIDATOR],
5280
+ }]
5281
+ }] });
5282
+
5283
+ class GaDataSelectModule {
5284
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5285
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectModule, imports: [GaDataSelectComponent,
5286
+ GaDataSelectRequiredValidator,
5287
+ GaDataSelectValueDirective,
5288
+ GaDataSelectOptionLabelDirective,
5289
+ GaDataSelectOptgroupLabelDirective], exports: [GaDataSelectComponent,
5290
+ GaDataSelectRequiredValidator,
5291
+ GaDataSelectValueDirective,
5292
+ GaDataSelectOptionLabelDirective,
5293
+ GaDataSelectOptgroupLabelDirective] });
5294
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectModule, imports: [GaDataSelectComponent] });
5295
+ }
5296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaDataSelectModule, decorators: [{
5297
+ type: NgModule,
5298
+ args: [{
5299
+ imports: [
5300
+ GaDataSelectComponent,
5301
+ GaDataSelectRequiredValidator,
5302
+ GaDataSelectValueDirective,
5303
+ GaDataSelectOptionLabelDirective,
5304
+ GaDataSelectOptgroupLabelDirective,
5305
+ ],
5306
+ exports: [
5307
+ GaDataSelectComponent,
5308
+ GaDataSelectRequiredValidator,
5309
+ GaDataSelectValueDirective,
5310
+ GaDataSelectOptionLabelDirective,
5311
+ GaDataSelectOptgroupLabelDirective,
5312
+ ],
5313
+ }]
5314
+ }] });
5315
+
4387
5316
  const SWITCH_CONTROL_VALUE_ACCESSOR = {
4388
5317
  provide: NG_VALUE_ACCESSOR,
4389
5318
  useExisting: forwardRef(() => GaSwitchComponent),
@@ -4747,5 +5676,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
4747
5676
  * Generated bundle index. Do not edit.
4748
5677
  */
4749
5678
 
4750
- export { CHECKBOX_CONTROL_VALUE_ACCESSOR, DEFAULT_MODAL_OPTIONS, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_BUTTON_I18N_FACTORY, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_DATEPICKER_I18N_FACTORY, GA_DATEPICKER_PARSER_FORMATTER_FACTORY, GA_DATEPICKER_VALUE_ADAPTER_FACTORY, GA_DATE_PARSER_FORMATTER_CONFIG, GA_DEFAULT_DATEPICKER_FORMATS, GA_FORM_CONTROL_ADAPTER, GA_FORM_ERRORS, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_I18N_FACTORY, GA_SELECT_I18N_FACTORY, GA_SELECT_REQUIRED_VALIDATOR, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertI18n, GaAlertI18nDefault, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonI18n, GaButtonI18nDefault, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaChipComponent, GaChipListboxComponent, GaChipModule, GaDatepickerComponent, GaDatepickerI18n, GaDatepickerI18nDefault, GaDatepickerInputDirective, GaDatepickerModule, GaDatepickerNativeUtcIsoValueAdapter, GaDatepickerNativeUtcValueAdapter, GaDatepickerParserFormatter, GaDatepickerParserFormatterDefault, GaDatepickerStructValueAdapter, GaDatepickerToggleComponent, GaDatepickerValueAdapter, GaFieldErrorDirective, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormControlErrorsDirective, GaFormFieldComponent, GaFormFieldConnector, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaLabelledByFormFieldDirective, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaModalActionsComponent, GaModalCloseDirective, GaModalComponent, GaModalContentComponent, GaModalDescriptionComponent, GaModalDescriptionDirective, GaModalHeaderComponent, GaModalI18n, GaModalI18nDefault, GaModalLabelDirective, GaModalModule, GaModalOptions, GaModalRef, GaModalService, GaModalTitleDirective, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectI18n, GaSelectI18nDefault, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaSwitchComponent, GaSwitchModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, compareStructs, extendGaDateParserFormatter, injectNgControlState, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaDatepickerI18n, provideGaDatepickerParserFormatter, provideGaDatepickerValueAdapter, provideGaFormErrors, provideGaModalI18n, provideGaModalOptions, provideGaSelectI18n };
5679
+ export { CHECKBOX_CONTROL_VALUE_ACCESSOR, DEFAULT_MODAL_OPTIONS, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_BUTTON_I18N_FACTORY, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_DATA_SELECT_I18N_FACTORY, GA_DATA_SELECT_REQUIRED_VALIDATOR, GA_DATEPICKER_I18N_FACTORY, GA_DATEPICKER_PARSER_FORMATTER_FACTORY, GA_DATEPICKER_VALUE_ADAPTER_FACTORY, GA_DATE_PARSER_FORMATTER_CONFIG, GA_DEFAULT_DATEPICKER_FORMATS, GA_FORM_CONTROL_ADAPTER, GA_FORM_ERRORS, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_I18N_FACTORY, GA_SELECT_I18N_FACTORY, GA_SELECT_REQUIRED_VALIDATOR, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertI18n, GaAlertI18nDefault, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonI18n, GaButtonI18nDefault, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaChipComponent, GaChipListboxComponent, GaChipModule, GaDataSelectComponent, GaDataSelectI18n, GaDataSelectI18nDefault, GaDataSelectModule, GaDataSelectOptgroupLabelDirective, GaDataSelectOptionLabelDirective, GaDataSelectRequiredValidator, GaDataSelectValueDirective, GaDatepickerComponent, GaDatepickerI18n, GaDatepickerI18nDefault, GaDatepickerInputDirective, GaDatepickerModule, GaDatepickerNativeUtcIsoValueAdapter, GaDatepickerNativeUtcValueAdapter, GaDatepickerParserFormatter, GaDatepickerParserFormatterDefault, GaDatepickerStructValueAdapter, GaDatepickerToggleComponent, GaDatepickerValueAdapter, GaFieldErrorDirective, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormControlErrorsDirective, GaFormFieldComponent, GaFormFieldConnector, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaLabelledByFormFieldDirective, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaModalActionsComponent, GaModalCloseDirective, GaModalComponent, GaModalContentComponent, GaModalDescriptionComponent, GaModalDescriptionDirective, GaModalHeaderComponent, GaModalI18n, GaModalI18nDefault, GaModalLabelDirective, GaModalModule, GaModalOptions, GaModalRef, GaModalService, GaModalTitleDirective, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectI18n, GaSelectI18nDefault, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaSwitchComponent, GaSwitchModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, compareStructs, extendGaDateParserFormatter, injectNgControlState, provideGaAlertI18n, provideGaBaseFontSize, provideGaButtonI18n, provideGaDataSelectI18n, provideGaDatepickerI18n, provideGaDatepickerParserFormatter, provideGaDatepickerValueAdapter, provideGaFormErrors, provideGaModalI18n, provideGaModalOptions, provideGaSelectI18n };
4751
5680
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map