@acorex/components 22.0.0-next.9 → 22.0.1
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.
- package/combo-box/README.md +35 -0
- package/fesm2022/acorex-components-accordion.mjs +2 -2
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +1 -0
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +2 -2
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +4 -4
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +10 -12
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +2 -2
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-combo-box.mjs +783 -0
- package/fesm2022/acorex-components-combo-box.mjs.map +1 -0
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs +50 -0
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs → acorex-components-conversation-open-composer-picker-for-files-DnSW908R.mjs} +7 -20
- package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-DnSW908R.mjs.map +1 -0
- package/fesm2022/acorex-components-conversation.mjs +8966 -16359
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +188 -64
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +14 -16
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +61 -32
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +21 -5
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +7 -4
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +2 -2
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +4 -4
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-fab.mjs +5 -5
- package/fesm2022/acorex-components-fab.mjs.map +1 -1
- package/fesm2022/acorex-components-file-viewer.mjs +27 -27
- package/fesm2022/acorex-components-file-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +21 -5
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +238 -36
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +2 -2
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +2 -2
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +59 -42
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-lookup.mjs +2897 -0
- package/fesm2022/acorex-components-lookup.mjs.map +1 -0
- package/fesm2022/acorex-components-map.mjs +2 -2
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +238 -75
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +13 -6
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +30 -29
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +3 -3
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +40 -6
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +4 -2
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +2 -2
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +2 -2
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +12 -22
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +55 -18
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +2 -2
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +2 -2
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +2 -2
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +2 -2
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +2 -2
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +9 -2
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +2 -2
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +40 -3
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/lookup/README.md +74 -0
- package/package.json +12 -7
- package/select-box/README.md +5 -0
- package/types/acorex-components-action-sheet.d.ts +9 -1
- package/types/acorex-components-combo-box.d.ts +280 -0
- package/types/acorex-components-conversation.d.ts +947 -1354
- package/types/acorex-components-data-table.d.ts +47 -5
- package/types/acorex-components-datetime-box.d.ts +2 -0
- package/types/acorex-components-datetime-input.d.ts +24 -5
- package/types/acorex-components-decorators.d.ts +1 -0
- package/types/acorex-components-dialog.d.ts +9 -0
- package/types/acorex-components-grid-layout-builder.d.ts +34 -2
- package/types/acorex-components-loading-dialog.d.ts +12 -4
- package/types/acorex-components-lookup.d.ts +831 -0
- package/types/acorex-components-menu.d.ts +28 -4
- package/types/acorex-components-notification.d.ts +11 -1
- package/types/acorex-components-number-box.d.ts +3 -1
- package/types/acorex-components-popover.d.ts +12 -1
- package/types/acorex-components-popup.d.ts +9 -1
- package/types/acorex-components-scheduler.d.ts +2 -4
- package/types/acorex-components-select-box.d.ts +21 -4
- package/types/acorex-components-toast.d.ts +10 -1
- package/types/acorex-components-tree-view.d.ts +9 -1
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs +0 -106
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs.map +0 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +0 -168
- package/fesm2022/acorex-components-selection-list-2.mjs.map +0 -1
- package/selection-list-2/README.md +0 -3
- package/types/acorex-components-selection-list-2.d.ts +0 -52
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
import { NXValueComponent, AXComponent, AXClearableComponent, AXClosableComponent, AXValuableComponent } from '@acorex/cdk/common';
|
|
2
|
+
import { AXButtonComponent } from '@acorex/components/button';
|
|
3
|
+
import { AXCheckBoxComponent } from '@acorex/components/check-box';
|
|
4
|
+
import { AXChipsComponent } from '@acorex/components/chips';
|
|
5
|
+
import * as i1 from '@acorex/components/decorators';
|
|
6
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
7
|
+
import { AXPopoverComponent } from '@acorex/components/popover';
|
|
8
|
+
import { AXSearchBoxComponent } from '@acorex/components/search-box';
|
|
9
|
+
import { AXPlatform } from '@acorex/core/platform';
|
|
10
|
+
import { AXTranslatorPipe } from '@acorex/core/translation';
|
|
11
|
+
import { Combobox, ComboboxPopup, ComboboxWidget } from '@angular/aria/combobox';
|
|
12
|
+
import { Listbox, Option } from '@angular/aria/listbox';
|
|
13
|
+
import { DOCUMENT, NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
14
|
+
import * as i0 from '@angular/core';
|
|
15
|
+
import { inject, DestroyRef, input, model, output, signal, computed, linkedSignal, viewChild, effect, untracked, afterRenderEffect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
16
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A minimal combo box for selecting one or more values from a list of items.
|
|
20
|
+
*
|
|
21
|
+
* Built on top of the `@angular/aria/combobox` directives, it supports two behaviors:
|
|
22
|
+
* - `searchable="true"` (default): an input with typeahead filtering (matches `id`). On small
|
|
23
|
+
* screens with `adaptivityEnabled`, the trigger is select-like and search moves into the actionsheet.
|
|
24
|
+
* - `searchable="false"`: a select-like, non-editable trigger (same input; typing blocked without
|
|
25
|
+
* Combobox `readonly`, so Tab focus and keyboard open/select keep working).
|
|
26
|
+
*
|
|
27
|
+
* With `multiple="true"`, selected values are shown as chips in the trigger and the popup stays
|
|
28
|
+
* open while toggling items (same interaction model as `ax-lookup` multi-select).
|
|
29
|
+
*
|
|
30
|
+
* With `adaptivityEnabled` (default `true`), the list opens as a bottom actionsheet on small
|
|
31
|
+
* screens instead of an anchored dropdown — the same alternate presentation as `ax-select-box`.
|
|
32
|
+
*
|
|
33
|
+
* Items use `text` for display, `id` for search/identity, and `value` as the submitted model value.
|
|
34
|
+
* Implements {@link FormValueControl} so `[(ngModel)]` / signal forms work via the `value` model
|
|
35
|
+
* (no `ControlValueAccessor`).
|
|
36
|
+
*
|
|
37
|
+
* @category Components
|
|
38
|
+
*/
|
|
39
|
+
class AXComboBoxComponent extends NXValueComponent {
|
|
40
|
+
#platform;
|
|
41
|
+
#destroyRef;
|
|
42
|
+
#document;
|
|
43
|
+
#isUserInteraction;
|
|
44
|
+
#lastValue;
|
|
45
|
+
#lastExpanded;
|
|
46
|
+
#sheetSearchFocused;
|
|
47
|
+
constructor() {
|
|
48
|
+
super();
|
|
49
|
+
this.#platform = inject(AXPlatform);
|
|
50
|
+
this.#destroyRef = inject(DestroyRef);
|
|
51
|
+
/**
|
|
52
|
+
* The name of the form field, used by validation rules and `ax-form.validate(names)`.
|
|
53
|
+
*/
|
|
54
|
+
this.name = input('', /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/**
|
|
57
|
+
* The list of items the user can select from.
|
|
58
|
+
* Each item has `id` (search/identity), `text` (display), and `value` (submitted).
|
|
59
|
+
*/
|
|
60
|
+
this.items = input([], /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
62
|
+
/**
|
|
63
|
+
* Whether the combo box accepts typing and filters the list (`true`),
|
|
64
|
+
* or is a select-like, non-editable trigger (`false`).
|
|
65
|
+
* On small screens with `adaptivityEnabled`, search is typed in the actionsheet instead of the trigger.
|
|
66
|
+
*/
|
|
67
|
+
this.searchable = input(true, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
69
|
+
/**
|
|
70
|
+
* When `true`, multiple items can be selected. Selected values are shown as chips and the
|
|
71
|
+
* popup stays open while toggling. The model value is an array (`[]` when empty).
|
|
72
|
+
*/
|
|
73
|
+
this.multiple = input(false, /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
75
|
+
/**
|
|
76
|
+
* When `true` (default), the popup list uses the alternate actionsheet presentation on small
|
|
77
|
+
* screens (`SM`). Searchable mode then shows a search field inside the sheet. When `false`,
|
|
78
|
+
* the list always opens as an anchored dropdown.
|
|
79
|
+
*/
|
|
80
|
+
this.adaptivityEnabled = input(true, /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "adaptivityEnabled" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/**
|
|
83
|
+
* Title shown in the actionsheet header on small screens. Falls back to `placeholder`.
|
|
84
|
+
*/
|
|
85
|
+
this.caption = input('', /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/**
|
|
88
|
+
* When `true`, list rows use alternating background colors for easier scanning.
|
|
89
|
+
*/
|
|
90
|
+
this.alternate = input(false, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "alternate" }] : /* istanbul ignore next */ []));
|
|
92
|
+
/**
|
|
93
|
+
* The placeholder text shown when no value is selected.
|
|
94
|
+
*/
|
|
95
|
+
this.placeholder = input('', /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
97
|
+
/**
|
|
98
|
+
* Placeholder for the trigger search input when items are already selected (multi-select),
|
|
99
|
+
* and for the in-sheet search field on small screens. Falls back to `placeholder` when the
|
|
100
|
+
* selection is empty on desktop.
|
|
101
|
+
*/
|
|
102
|
+
this.searchPlaceholder = input('Search...', /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
104
|
+
/**
|
|
105
|
+
* Custom template rendered when the filtered list has no items.
|
|
106
|
+
* When omitted, a default "no result found" message is shown.
|
|
107
|
+
*/
|
|
108
|
+
this.emptyTemplate = input(undefined, /* @ts-ignore */
|
|
109
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
110
|
+
/**
|
|
111
|
+
* Custom template rendered for each item in the popup list.
|
|
112
|
+
* Context: `{ $implicit: AXComboBoxItem }`.
|
|
113
|
+
*/
|
|
114
|
+
this.itemTemplate = input(undefined, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/**
|
|
117
|
+
* Custom template rendered for the selected value in the trigger.
|
|
118
|
+
* Context: `{ $implicit: AXComboBoxItem }`.
|
|
119
|
+
* When `searchable` is true, the template is shown while the popup is closed and the input
|
|
120
|
+
* still reflects the selected text; typing/opening falls back to the plain input.
|
|
121
|
+
* In multi-select mode, the template replaces the chip text for each selected item.
|
|
122
|
+
*/
|
|
123
|
+
this.selectedTemplate = input(undefined, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []));
|
|
125
|
+
/**
|
|
126
|
+
* Whether the combo box is disabled.
|
|
127
|
+
*/
|
|
128
|
+
this.disabled = input(false, /* @ts-ignore */
|
|
129
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
130
|
+
/**
|
|
131
|
+
* Whether the combo box is readonly.
|
|
132
|
+
*/
|
|
133
|
+
this.readonly = input(false, /* @ts-ignore */
|
|
134
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
135
|
+
/**
|
|
136
|
+
* Predefined look scheme of the editor container. Same looks as other editor components like ax-text-box.
|
|
137
|
+
*/
|
|
138
|
+
this.look = model('solid', /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
|
|
140
|
+
/**
|
|
141
|
+
* The selected item `value`(s). Scalar (or `null`) in single mode; an array in multi mode.
|
|
142
|
+
* Supports `[(value)]`, `[(ngModel)]`, and signal forms via {@link FormValueControl}.
|
|
143
|
+
*/
|
|
144
|
+
this.value = model(null, /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
146
|
+
/**
|
|
147
|
+
* Emitted when the selected value changes.
|
|
148
|
+
*/
|
|
149
|
+
this.onValueChanged = output();
|
|
150
|
+
/**
|
|
151
|
+
* Emitted when the trigger receives focus.
|
|
152
|
+
*/
|
|
153
|
+
this.onFocus = output();
|
|
154
|
+
/**
|
|
155
|
+
* Emitted when the trigger loses focus.
|
|
156
|
+
*/
|
|
157
|
+
this.onBlur = output();
|
|
158
|
+
/**
|
|
159
|
+
* Emitted when a list item is clicked.
|
|
160
|
+
*/
|
|
161
|
+
this.onItemClick = output();
|
|
162
|
+
/**
|
|
163
|
+
* Emitted when a list item is selected (click or keyboard).
|
|
164
|
+
*/
|
|
165
|
+
this.onItemSelected = output();
|
|
166
|
+
/**
|
|
167
|
+
* Emitted when the popup list opens.
|
|
168
|
+
*/
|
|
169
|
+
this.onOpened = output();
|
|
170
|
+
/**
|
|
171
|
+
* Emitted when the popup list closes.
|
|
172
|
+
*/
|
|
173
|
+
this.onClosed = output();
|
|
174
|
+
/** Whether the popup is expanded. */
|
|
175
|
+
this.expanded = signal(false, /* @ts-ignore */
|
|
176
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
177
|
+
/** Whether the list is currently shown as a bottom actionsheet (small screens + adaptivity). */
|
|
178
|
+
this.isActionsheetStyle = signal(false, /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "isActionsheetStyle" }] : /* istanbul ignore next */ []));
|
|
180
|
+
/** Whether the trigger input is writable and filters as you type (desktop searchable only). */
|
|
181
|
+
this.isEditableTrigger = computed(() => this.searchable() && !this.isActionsheetStyle(), /* @ts-ignore */
|
|
182
|
+
...(ngDevMode ? [{ debugName: "isEditableTrigger" }] : /* istanbul ignore next */ []));
|
|
183
|
+
/** Whether search is typed in the actionsheet instead of the trigger. */
|
|
184
|
+
this.isSheetSearchEnabled = computed(() => this.searchable() && this.isActionsheetStyle(), /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "isSheetSearchEnabled" }] : /* istanbul ignore next */ []));
|
|
186
|
+
/** Query typed in the actionsheet search field (independent of the trigger display text). */
|
|
187
|
+
this.sheetSearchText = signal('', /* @ts-ignore */
|
|
188
|
+
...(ngDevMode ? [{ debugName: "sheetSearchText" }] : /* istanbul ignore next */ []));
|
|
189
|
+
/** The current selection normalized to an array of submitted values. */
|
|
190
|
+
this.selectedValues = computed(() => {
|
|
191
|
+
const value = this.value();
|
|
192
|
+
if (value == null) {
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
195
|
+
return Array.isArray(value) ? value : [value];
|
|
196
|
+
}, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
198
|
+
/** Whether there is at least one selected value. */
|
|
199
|
+
this.hasSelection = computed(() => this.selectedValues().length > 0, /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "hasSelection" }] : /* istanbul ignore next */ []));
|
|
201
|
+
/** Resolved selected items for the current model value(s). */
|
|
202
|
+
this.selectedItems = computed(() => {
|
|
203
|
+
const values = new Set(this.selectedValues());
|
|
204
|
+
return this.items().filter((item) => values.has(item.value));
|
|
205
|
+
}, /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
|
|
207
|
+
/** The item whose `value` matches the current model value (single-select). */
|
|
208
|
+
this.selectedItem = computed(() => (this.multiple() ? null : (this.selectedItems()[0] ?? null)), /* @ts-ignore */
|
|
209
|
+
...(ngDevMode ? [{ debugName: "selectedItem" }] : /* istanbul ignore next */ []));
|
|
210
|
+
/** Display text shown in the trigger / used as the searchable input baseline (single-select). */
|
|
211
|
+
this.displayText = computed(() => this.selectedItem()?.text ?? '', /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
|
|
213
|
+
/**
|
|
214
|
+
* The text typed in the searchable input.
|
|
215
|
+
* Multi-select starts empty; single mode syncs from the selected display text.
|
|
216
|
+
*/
|
|
217
|
+
this.searchText = linkedSignal(() => (this.multiple() ? '' : this.displayText()), /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
219
|
+
/** Whether the trigger should render `selectedTemplate` instead of the plain input text. */
|
|
220
|
+
this.showSelectedTemplate = computed(() => {
|
|
221
|
+
if (this.multiple() || !this.selectedTemplate() || !this.selectedItem()) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
if (!this.isEditableTrigger()) {
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
return !this.expanded() && this.searchText() === this.displayText();
|
|
228
|
+
}, /* @ts-ignore */
|
|
229
|
+
...(ngDevMode ? [{ debugName: "showSelectedTemplate" }] : /* istanbul ignore next */ []));
|
|
230
|
+
/** Placeholder for the editable trigger search input in multi-select. */
|
|
231
|
+
this.triggerSearchPlaceholder = computed(() => {
|
|
232
|
+
if (this.isActionsheetStyle()) {
|
|
233
|
+
return this.multiple() && this.selectedItems().length > 0 ? '' : this.placeholder();
|
|
234
|
+
}
|
|
235
|
+
if (this.multiple() && this.selectedItems().length > 0) {
|
|
236
|
+
return this.searchPlaceholder();
|
|
237
|
+
}
|
|
238
|
+
return this.placeholder();
|
|
239
|
+
}, /* @ts-ignore */
|
|
240
|
+
...(ngDevMode ? [{ debugName: "triggerSearchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
241
|
+
/** The listbox selection (item ids), kept in sync with the selected value(s). */
|
|
242
|
+
this.selection = linkedSignal(() => this.selectedItems().map((item) => item.id), /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
244
|
+
/** Items filtered by typed query against `id` when the combo box is searchable. */
|
|
245
|
+
this.filteredItems = computed(() => {
|
|
246
|
+
const items = this.items();
|
|
247
|
+
if (!this.searchable()) {
|
|
248
|
+
return items;
|
|
249
|
+
}
|
|
250
|
+
const inSheet = this.isActionsheetStyle();
|
|
251
|
+
const query = (inSheet ? this.sheetSearchText() : this.searchText()).trim().toLowerCase();
|
|
252
|
+
if (!query) {
|
|
253
|
+
return items;
|
|
254
|
+
}
|
|
255
|
+
// Desktop single-select: the trigger shows the selected label, which is not a filter.
|
|
256
|
+
if (!inSheet && !this.multiple()) {
|
|
257
|
+
const selectedId = (this.selectedItem()?.id ?? '').toLowerCase();
|
|
258
|
+
if (query === selectedId || query === this.displayText().trim().toLowerCase()) {
|
|
259
|
+
return items;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return items.filter((item) => {
|
|
263
|
+
const idMatch = item.id.toLowerCase().includes(query);
|
|
264
|
+
return idMatch || (inSheet && (item.text ?? '').toLowerCase().includes(query));
|
|
265
|
+
});
|
|
266
|
+
}, /* @ts-ignore */
|
|
267
|
+
...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
|
|
268
|
+
/** Whether the filtered list is empty (empty-state vs hidden listbox). */
|
|
269
|
+
this.hasNoMatches = computed(() => this.filteredItems().length === 0, /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "hasNoMatches" }] : /* istanbul ignore next */ []));
|
|
271
|
+
this.comboboxRef = viewChild(Combobox, /* @ts-ignore */
|
|
272
|
+
...(ngDevMode ? [{ debugName: "comboboxRef" }] : /* istanbul ignore next */ []));
|
|
273
|
+
this.listboxRef = viewChild(Listbox, /* @ts-ignore */
|
|
274
|
+
...(ngDevMode ? [{ debugName: "listboxRef" }] : /* istanbul ignore next */ []));
|
|
275
|
+
this.popoverRef = viewChild(AXPopoverComponent, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "popoverRef" }] : /* istanbul ignore next */ []));
|
|
277
|
+
this.originRef = viewChild('origin', /* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [{ debugName: "originRef" }] : /* istanbul ignore next */ []));
|
|
279
|
+
this.popupRef = viewChild('popup', /* @ts-ignore */
|
|
280
|
+
...(ngDevMode ? [{ debugName: "popupRef" }] : /* istanbul ignore next */ []));
|
|
281
|
+
this.sheetSearchRef = viewChild('sheetSearch', /* @ts-ignore */
|
|
282
|
+
...(ngDevMode ? [{ debugName: "sheetSearchRef" }] : /* istanbul ignore next */ []));
|
|
283
|
+
this.#document = inject(DOCUMENT);
|
|
284
|
+
this.#isUserInteraction = false;
|
|
285
|
+
this.#lastValue = undefined;
|
|
286
|
+
this.#lastExpanded = undefined;
|
|
287
|
+
this.#sheetSearchFocused = false;
|
|
288
|
+
effect(() => this.#emitValueChanged(this.value()));
|
|
289
|
+
effect(() => this.#emitOpenedOrClosed(this.expanded()));
|
|
290
|
+
effect(() => {
|
|
291
|
+
this.adaptivityEnabled();
|
|
292
|
+
untracked(() => this.#syncActionsheetStyle());
|
|
293
|
+
});
|
|
294
|
+
this.#platform.resize.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
295
|
+
this.#syncActionsheetStyle();
|
|
296
|
+
// Match dropdown-box: close anchored dropdowns on resize; keep actionsheet open.
|
|
297
|
+
if (this.expanded() && !this.isActionsheetStyle()) {
|
|
298
|
+
this.close();
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
// Seed the actionsheet flag once.
|
|
302
|
+
this.#syncActionsheetStyle();
|
|
303
|
+
// Keep the popover in sync with the expanded state.
|
|
304
|
+
effect(() => {
|
|
305
|
+
const expanded = this.expanded();
|
|
306
|
+
const popover = this.popoverRef();
|
|
307
|
+
if (!popover) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
untracked(() => {
|
|
311
|
+
if (expanded && !popover.isOpen) {
|
|
312
|
+
void popover.open();
|
|
313
|
+
}
|
|
314
|
+
else if (!expanded && popover.isOpen) {
|
|
315
|
+
popover.close();
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
afterRenderEffect(() => {
|
|
320
|
+
if (!this.expanded()) {
|
|
321
|
+
this.#sheetSearchFocused = false;
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this.listboxRef()?.scrollActiveItemIntoView();
|
|
325
|
+
this.#tryFocusSheetSearch();
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
#syncActionsheetStyle() {
|
|
329
|
+
this.isActionsheetStyle.set(this.adaptivityEnabled() && this.#platform.is('SM'));
|
|
330
|
+
}
|
|
331
|
+
/** Stable unique key for `@for` — avoids NG0955 when `id` is missing or duplicated. */
|
|
332
|
+
trackItemKey(index, item) {
|
|
333
|
+
const id = item?.id?.trim();
|
|
334
|
+
return id ? id : `item-${index}`;
|
|
335
|
+
}
|
|
336
|
+
/** Whether the given item is currently selected. */
|
|
337
|
+
isItemSelected(item) {
|
|
338
|
+
return this.selectedValues().some((value) => value === item.value);
|
|
339
|
+
}
|
|
340
|
+
/** Emits onValueChanged when the value actually changes (skips the initial value). */
|
|
341
|
+
#emitValueChanged(value) {
|
|
342
|
+
const previous = this.#lastValue;
|
|
343
|
+
this.#lastValue = value;
|
|
344
|
+
if (previous === undefined || this.#valuesEqual(previous, value)) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
this.onValueChanged.emit({
|
|
348
|
+
component: this,
|
|
349
|
+
htmlElement: this.nativeElement,
|
|
350
|
+
name: 'value',
|
|
351
|
+
value,
|
|
352
|
+
oldValue: previous,
|
|
353
|
+
isUserInteraction: this.#isUserInteraction,
|
|
354
|
+
});
|
|
355
|
+
this.#isUserInteraction = false;
|
|
356
|
+
}
|
|
357
|
+
#valuesEqual(a, b) {
|
|
358
|
+
if (a === b) {
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
362
|
+
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
363
|
+
}
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
/** Emits onOpened/onClosed when the expanded state actually changes (skips the initial state). */
|
|
367
|
+
#emitOpenedOrClosed(expanded) {
|
|
368
|
+
const previous = this.#lastExpanded;
|
|
369
|
+
this.#lastExpanded = expanded;
|
|
370
|
+
if (previous === undefined || previous === expanded) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const event = {
|
|
374
|
+
component: this,
|
|
375
|
+
htmlElement: this.nativeElement,
|
|
376
|
+
isUserInteraction: true,
|
|
377
|
+
};
|
|
378
|
+
expanded ? this.onOpened.emit(event) : this.onClosed.emit(event);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Opens (searchable) or toggles (non-searchable) the popup on trigger click.
|
|
382
|
+
*/
|
|
383
|
+
onTriggerClick() {
|
|
384
|
+
if (this.disabled() || this.readonly()) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (this.searchable()) {
|
|
388
|
+
this.expanded.set(true);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
this.expanded.update((open) => !open);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Keyboard handling on the trigger:
|
|
395
|
+
* - Searchable: Enter never submits the form; with no matches the value is cleared (`null`).
|
|
396
|
+
* - Non-searchable: open with Enter/Space when collapsed; commit with Space when expanded.
|
|
397
|
+
* - Multi-select: Backspace removes the last chip when the search input is empty.
|
|
398
|
+
*/
|
|
399
|
+
onTriggerKeydown(event) {
|
|
400
|
+
if (this.disabled() || this.readonly()) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (event.key === 'Escape' && this.expanded()) {
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
this.close();
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
if (this.multiple() && event.key === 'Backspace' && !this.searchText()) {
|
|
409
|
+
const items = this.selectedItems();
|
|
410
|
+
if (items.length > 0) {
|
|
411
|
+
event.preventDefault();
|
|
412
|
+
this.removeChip(event, items[items.length - 1]);
|
|
413
|
+
}
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (event.key === 'Enter') {
|
|
417
|
+
this.#onSearchEnter(event);
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (this.searchable()) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (event.key !== ' ') {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (!this.expanded()) {
|
|
427
|
+
event.preventDefault();
|
|
428
|
+
this.expanded.set(true);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
event.preventDefault();
|
|
432
|
+
this.commit();
|
|
433
|
+
}
|
|
434
|
+
/** Handles Enter in the actionsheet search field (no form submit; clear on no matches). */
|
|
435
|
+
onSheetSearchKeydown(e) {
|
|
436
|
+
const event = e.nativeEvent;
|
|
437
|
+
if (!event || event.key !== 'Enter') {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
this.#onSearchEnter(event);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Enter in search never submits the surrounding form. When the query has no matches,
|
|
444
|
+
* single-select value is cleared (`null`). With matches, the highlighted item is committed.
|
|
445
|
+
*/
|
|
446
|
+
#onSearchEnter(event) {
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
event.stopPropagation();
|
|
449
|
+
event.stopImmediatePropagation();
|
|
450
|
+
if (this.#shouldClearOnEmptyEnter()) {
|
|
451
|
+
if (!this.multiple()) {
|
|
452
|
+
this.reset(true);
|
|
453
|
+
}
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (this.searchable()) {
|
|
457
|
+
if (this.expanded()) {
|
|
458
|
+
this.commit();
|
|
459
|
+
}
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (!this.expanded()) {
|
|
463
|
+
this.expanded.set(true);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
#currentSearchQuery() {
|
|
467
|
+
return (this.isSheetSearchEnabled() ? this.sheetSearchText() : this.searchText()).trim();
|
|
468
|
+
}
|
|
469
|
+
#isTypedFilterQuery() {
|
|
470
|
+
const query = this.#currentSearchQuery();
|
|
471
|
+
if (!query) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
if (!this.isSheetSearchEnabled() && !this.multiple()) {
|
|
475
|
+
const selectedId = (this.selectedItem()?.id ?? '').toLowerCase();
|
|
476
|
+
const display = this.displayText().trim().toLowerCase();
|
|
477
|
+
const normalized = query.toLowerCase();
|
|
478
|
+
if (normalized === selectedId || normalized === display) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
#shouldClearOnEmptyEnter() {
|
|
485
|
+
return this.searchable() && this.#isTypedFilterQuery() && this.hasNoMatches();
|
|
486
|
+
}
|
|
487
|
+
/** Blocks typing when the trigger is not editable (keeps Tab / keyboard open working). */
|
|
488
|
+
onBeforeInput(event) {
|
|
489
|
+
if (!this.isEditableTrigger() || this.readonly()) {
|
|
490
|
+
event.preventDefault();
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Combobox `expanded` two-way binding. On actionsheet with in-sheet search, ignore collapse
|
|
495
|
+
* so focusing the search field (Aria combobox blur) does not close the popup. Dismiss is owned
|
|
496
|
+
* by the header Apply/close button, `commit()`, and Escape. On desktop, outside click also closes.
|
|
497
|
+
*/
|
|
498
|
+
onExpandedChange(open) {
|
|
499
|
+
if (!open && this.isSheetSearchEnabled()) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
this.expanded.set(open);
|
|
503
|
+
}
|
|
504
|
+
/** Filters the list from the actionsheet search field (reads the input so delayed ngModel cannot block typing). */
|
|
505
|
+
onSheetSearchInput() {
|
|
506
|
+
this.sheetSearchText.set(this.#sheetSearchInputValue());
|
|
507
|
+
}
|
|
508
|
+
#sheetSearchInputValue() {
|
|
509
|
+
return this.sheetSearchRef()?.getHostElement()?.querySelector('input')?.value ?? '';
|
|
510
|
+
}
|
|
511
|
+
#tryFocusSheetSearch() {
|
|
512
|
+
if (!this.isSheetSearchEnabled() || this.#sheetSearchFocused) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const search = this.sheetSearchRef();
|
|
516
|
+
if (!search) {
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
this.#sheetSearchFocused = true;
|
|
520
|
+
search.focus();
|
|
521
|
+
}
|
|
522
|
+
#clearSheetSearch() {
|
|
523
|
+
this.sheetSearchText.set('');
|
|
524
|
+
this.sheetSearchRef()?.commitValue('', false);
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Keeps the combobox expanded state in sync when the popover closes (e.g. click outside).
|
|
528
|
+
*/
|
|
529
|
+
onPopoverClosed() {
|
|
530
|
+
this.#sheetSearchFocused = false;
|
|
531
|
+
this.expanded.set(false);
|
|
532
|
+
this.searchText.set(this.multiple() ? '' : this.displayText());
|
|
533
|
+
this.#clearSheetSearch();
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Removes a single chip from the multi selection.
|
|
537
|
+
*/
|
|
538
|
+
removeChip(event, item) {
|
|
539
|
+
event.stopPropagation();
|
|
540
|
+
if (this.disabled() || this.readonly() || !this.multiple()) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
this.#isUserInteraction = true;
|
|
544
|
+
this.value.set(this.selectedValues().filter((value) => value !== item.value));
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Clears the selected value(s) and closes the popup.
|
|
548
|
+
* Sets `null` in single mode and `[]` in multi mode. Used by projected `ax-clear-button`.
|
|
549
|
+
*
|
|
550
|
+
* @param isUserInteraction - Whether the clear was triggered by the user.
|
|
551
|
+
*/
|
|
552
|
+
reset(isUserInteraction = false) {
|
|
553
|
+
if (this.disabled() || this.readonly()) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
const next = this.multiple() ? [] : null;
|
|
557
|
+
const current = this.value();
|
|
558
|
+
if (this.multiple()) {
|
|
559
|
+
if (Array.isArray(current) && current.length === 0) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (current == null) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
else if (current == null) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
this.#isUserInteraction = isUserInteraction;
|
|
570
|
+
this.value.set(next);
|
|
571
|
+
this.selection.set([]);
|
|
572
|
+
this.expanded.set(false);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Closes the popup list.
|
|
576
|
+
*/
|
|
577
|
+
close() {
|
|
578
|
+
this.expanded.set(false);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Closes the popup list (alias for {@link close}, required by `AXClosableComponent`).
|
|
582
|
+
*/
|
|
583
|
+
closeAll() {
|
|
584
|
+
this.close();
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Commits the highlighted (active) or clicked list item as the component value.
|
|
588
|
+
*
|
|
589
|
+
* With `selectionMode="explicit"`, arrow keys only move the active item; Enter/Space must resolve
|
|
590
|
+
* that option. Clicks resolve from the event target so we do not depend on listener order vs ngListbox.
|
|
591
|
+
*
|
|
592
|
+
* In multi-select mode the item is toggled and the popup stays open.
|
|
593
|
+
* When the user typed a query with no matches, Enter clears single-select to `null`.
|
|
594
|
+
*/
|
|
595
|
+
onListEnter(event) {
|
|
596
|
+
event.preventDefault();
|
|
597
|
+
event.stopPropagation();
|
|
598
|
+
this.commit();
|
|
599
|
+
}
|
|
600
|
+
commit(event) {
|
|
601
|
+
if (event?.type !== 'click' && this.#shouldClearOnEmptyEnter()) {
|
|
602
|
+
if (!this.multiple()) {
|
|
603
|
+
this.reset(true);
|
|
604
|
+
}
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const listbox = this.listboxRef();
|
|
608
|
+
let selectedId;
|
|
609
|
+
if (event?.type === 'click' && event.target instanceof Element) {
|
|
610
|
+
const optionEl = event.target.closest('[role="option"]');
|
|
611
|
+
const match = listbox?._pattern.inputs.items().find((item) => item.element() === optionEl);
|
|
612
|
+
const value = match?.value();
|
|
613
|
+
selectedId = typeof value === 'string' ? value : undefined;
|
|
614
|
+
}
|
|
615
|
+
else {
|
|
616
|
+
const activeValue = listbox?._pattern.inputs.activeItem()?.value();
|
|
617
|
+
selectedId = typeof activeValue === 'string' ? activeValue : this.selection()[0];
|
|
618
|
+
}
|
|
619
|
+
const item = selectedId != null ? this.items().find((i) => i.id === selectedId) : undefined;
|
|
620
|
+
if (item == null) {
|
|
621
|
+
if (!this.multiple()) {
|
|
622
|
+
this.expanded.set(false);
|
|
623
|
+
}
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
this.#commitItem(item, event);
|
|
627
|
+
}
|
|
628
|
+
#commitItem(item, event) {
|
|
629
|
+
if (event?.type === 'click') {
|
|
630
|
+
this.onItemClick.emit({
|
|
631
|
+
component: this,
|
|
632
|
+
item,
|
|
633
|
+
htmlElement: this.nativeElement,
|
|
634
|
+
isUserInteraction: true,
|
|
635
|
+
nativeEvent: event,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
if (this.multiple()) {
|
|
639
|
+
const current = this.selectedValues();
|
|
640
|
+
const exists = current.some((value) => value === item.value);
|
|
641
|
+
if (!exists) {
|
|
642
|
+
this.onItemSelected.emit({
|
|
643
|
+
component: this,
|
|
644
|
+
item,
|
|
645
|
+
htmlElement: this.nativeElement,
|
|
646
|
+
isUserInteraction: true,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
const next = exists ? current.filter((value) => value !== item.value) : [...current, item.value];
|
|
650
|
+
this.#isUserInteraction = true;
|
|
651
|
+
this.value.set(next);
|
|
652
|
+
this.selection.set(next.map((value) => this.items().find((i) => i.value === value)?.id).filter((id) => id != null));
|
|
653
|
+
if (this.searchable() && this.searchText()) {
|
|
654
|
+
this.searchText.set('');
|
|
655
|
+
}
|
|
656
|
+
if (this.sheetSearchText()) {
|
|
657
|
+
this.#clearSheetSearch();
|
|
658
|
+
}
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
this.onItemSelected.emit({
|
|
662
|
+
component: this,
|
|
663
|
+
item,
|
|
664
|
+
htmlElement: this.nativeElement,
|
|
665
|
+
isUserInteraction: true,
|
|
666
|
+
});
|
|
667
|
+
if (item.value !== this.value()) {
|
|
668
|
+
this.#isUserInteraction = true;
|
|
669
|
+
this.value.set(item.value);
|
|
670
|
+
this.selection.set([item.id]);
|
|
671
|
+
}
|
|
672
|
+
this.expanded.set(false);
|
|
673
|
+
this.comboboxRef()?.element.focus();
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Focuses the combo box trigger input.
|
|
677
|
+
*/
|
|
678
|
+
focus(options) {
|
|
679
|
+
if (this.disabled()) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
this.comboboxRef()?.element.focus(options);
|
|
683
|
+
}
|
|
684
|
+
/** Forwards native focus from the trigger input. */
|
|
685
|
+
emitOnFocus(e) {
|
|
686
|
+
this.onFocus.emit({
|
|
687
|
+
component: this,
|
|
688
|
+
htmlElement: this.nativeElement,
|
|
689
|
+
nativeEvent: e,
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
/** Forwards native blur from the trigger input. */
|
|
693
|
+
emitOnBlur(e) {
|
|
694
|
+
this.onBlur.emit({
|
|
695
|
+
component: this,
|
|
696
|
+
htmlElement: this.nativeElement,
|
|
697
|
+
nativeEvent: e,
|
|
698
|
+
});
|
|
699
|
+
this.#scheduleCloseOnTriggerBlur(e);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Closes the popup when the trigger input loses focus, unless focus moved into the
|
|
703
|
+
* popover panel or another part of the trigger (e.g. sheet search or list navigation).
|
|
704
|
+
*/
|
|
705
|
+
#scheduleCloseOnTriggerBlur(e) {
|
|
706
|
+
if (!this.expanded()) {
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
const related = e.relatedTarget;
|
|
710
|
+
if (related instanceof Node && this.#isFocusWithinPopupOrTrigger(related)) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
queueMicrotask(() => {
|
|
714
|
+
if (!this.expanded()) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
const active = this.#document.activeElement;
|
|
718
|
+
if (active instanceof Node && this.#isFocusWithinPopupOrTrigger(active)) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
this.close();
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
#isFocusWithinPopupOrTrigger(node) {
|
|
725
|
+
const popup = this.popupRef()?.nativeElement;
|
|
726
|
+
if (popup?.contains(node)) {
|
|
727
|
+
return true;
|
|
728
|
+
}
|
|
729
|
+
const origin = this.originRef()?.nativeElement;
|
|
730
|
+
return Boolean(origin?.contains(node));
|
|
731
|
+
}
|
|
732
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
733
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXComboBoxComponent, isStandalone: true, selector: "ax-combo-box", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, adaptivityEnabled: { classPropertyName: "adaptivityEnabled", publicName: "adaptivityEnabled", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, alternate: { classPropertyName: "alternate", publicName: "alternate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, selectedTemplate: { classPropertyName: "selectedTemplate", publicName: "selectedTemplate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { look: "lookChange", value: "valueChange", onValueChanged: "onValueChanged", onFocus: "onFocus", onBlur: "onBlur", onItemClick: "onItemClick", onItemSelected: "onItemSelected", onOpened: "onOpened", onClosed: "onClosed" }, providers: [
|
|
734
|
+
{ provide: AXComponent, useExisting: AXComboBoxComponent },
|
|
735
|
+
{ provide: AXClearableComponent, useExisting: AXComboBoxComponent },
|
|
736
|
+
{ provide: AXClosableComponent, useExisting: AXComboBoxComponent },
|
|
737
|
+
{ provide: AXValuableComponent, useExisting: AXComboBoxComponent },
|
|
738
|
+
], viewQueries: [{ propertyName: "comboboxRef", first: true, predicate: Combobox, descendants: true, isSignal: true }, { propertyName: "listboxRef", first: true, predicate: Listbox, descendants: true, isSignal: true }, { propertyName: "popoverRef", first: true, predicate: AXPopoverComponent, descendants: true, isSignal: true }, { propertyName: "originRef", first: true, predicate: ["origin"], descendants: true, isSignal: true }, { propertyName: "popupRef", first: true, predicate: ["popup"], descendants: true, isSignal: true }, { propertyName: "sheetSearchRef", first: true, predicate: ["sheetSearch"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #origin\n class=\"ax-editor-container ax-{{ look() }} ax-default\"\n [class.ax-combo-box-trigger]=\"!isEditableTrigger()\"\n [class.ax-combo-box-trigger-multiple]=\"multiple()\"\n [class.ax-state-disabled]=\"disabled()\"\n [class.ax-state-readonly]=\"readonly()\"\n>\n <ng-content select=\"ax-prefix\"></ng-content>\n\n <div class=\"ax-combo-box-value\" [class.ax-combo-box-chips]=\"multiple()\">\n @if (multiple()) {\n @for (item of selectedItems(); track item.id) {\n <ax-chips class=\"ax-sm\" look=\"fill\" [text]=\"selectedTemplate() ? '' : item.text\">\n @if (selectedTemplate()) {\n <ax-prefix>\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </ax-prefix>\n }\n @if (!disabled() && !readonly()) {\n <ax-suffix>\n <button type=\"button\" tabindex=\"-1\" (click)=\"removeChip($event, item)\">\n <span class=\"ax-icon ax-icon-close\"></span>\n </button>\n </ax-suffix>\n }\n </ax-chips>\n }\n } @else if (showSelectedTemplate()) {\n <div class=\"ax-combo-box-selected-content\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedItem() }\"\n />\n </div>\n }\n\n <input\n ngCombobox\n #combobox=\"ngCombobox\"\n type=\"text\"\n class=\"ax-input\"\n [class.ax-combo-box-trigger-search]=\"multiple()\"\n [class.ax-combo-box-select-input]=\"!isEditableTrigger()\"\n [class.ax-combo-box-input-overlay]=\"!multiple() && showSelectedTemplate()\"\n [placeholder]=\"multiple() ? triggerSearchPlaceholder() : placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [(value)]=\"searchText\"\n [expanded]=\"expanded()\"\n (expandedChange)=\"onExpandedChange($event)\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n\n @if (hasSelection() && !disabled() && !readonly()) {\n <ng-content select=\"ax-clear-button\"></ng-content>\n }\n\n <button\n type=\"button\"\n class=\"ax-general-button-icon\"\n tabindex=\"-1\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"onTriggerClick()\"\n >\n <span class=\"ax-icon\" [class.ax-icon-chevron-down]=\"!expanded()\" [class.ax-icon-chevron-up]=\"expanded()\"></span>\n </button>\n <ng-content select=\"ax-suffix\"></ng-content>\n</div>\n\n<ax-popover\n [target]=\"origin\"\n [openOn]=\"'manual'\"\n [closeOn]=\"isActionsheetStyle() ? 'manual' : 'clickOut'\"\n [closeOnScroll]=\"!isActionsheetStyle()\"\n [placement]=\"'bottom-start'\"\n [width]=\"isActionsheetStyle() ? '100%' : origin.offsetWidth + 'px'\"\n [adaptivityEnabled]=\"isActionsheetStyle()\"\n [disabled]=\"disabled() || readonly()\"\n (onClosed)=\"onPopoverClosed()\"\n>\n <div\n #popup\n class=\"ax-combo-box-popup\"\n [class.ax-is-empty]=\"hasNoMatches()\"\n [class.ax-is-actionsheet]=\"isActionsheetStyle()\"\n (keydown.escape)=\"close()\"\n >\n @if (isActionsheetStyle()) {\n <ax-header class=\"ax-solid\">\n <ax-title>{{ caption() || placeholder() || ('@acorex:selectbox.popover.title' | translate | async) }}</ax-title>\n @if (multiple()) {\n <ax-button\n class=\"ax-sm\"\n color=\"primary\"\n look=\"solid\"\n text=\"@acorex:common.actions.apply\"\n (onClick)=\"close()\"\n ></ax-button>\n } @else {\n <ax-close-button></ax-close-button>\n }\n </ax-header>\n }\n @if (isSheetSearchEnabled()) {\n <div class=\"ax-combo-box-sheet-search\">\n <ax-search-box\n #sheetSearch\n class=\"ax-sm\"\n look=\"fill\"\n [autoSearch]=\"false\"\n [delayTime]=\"0\"\n [placeholder]=\"searchPlaceholder()\"\n (onValueChanged)=\"onSheetSearchInput()\"\n (onKeyUp)=\"onSheetSearchInput()\"\n (onKeyDown)=\"onSheetSearchKeydown($event)\"\n >\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n }\n <ng-content select=\"ax-header\"></ng-content>\n @if (expanded()) {\n @if (hasNoMatches()) {\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\" />\n } @else {\n <div class=\"ax-combo-box-empty\">{{ '@acorex:common.general.no-result-found' | translate | async }}</div>\n }\n }\n @if (isActionsheetStyle()) {\n <div\n ngListbox\n class=\"ax-combo-box-listbox\"\n [class.ax-hidden]=\"hasNoMatches()\"\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"multiple()\"\n [tabindex]=\"-1\"\n [(value)]=\"selection\"\n (click)=\"commit($event)\"\n >\n @for (item of filteredItems(); track trackItemKey($index, item); let odd = $odd) {\n <div\n ngOption\n class=\"ax-combo-box-option-host\"\n [class.ax-combo-box-option]=\"!itemTemplate()\"\n [class.ax-combo-box-option-multiple]=\"multiple()\"\n [class.ax-state-alternate]=\"alternate() && odd\"\n [value]=\"item.id\"\n [label]=\"item.text\"\n >\n <ng-container [ngTemplateOutlet]=\"optionContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <div\n ngListbox\n ngComboboxWidget\n #listbox=\"ngListbox\"\n class=\"ax-combo-box-listbox\"\n [class.ax-hidden]=\"hasNoMatches()\"\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"multiple()\"\n [tabindex]=\"-1\"\n [activeDescendant]=\"listbox.activeDescendant()\"\n [(value)]=\"selection\"\n (click)=\"commit($event)\"\n (keydown.enter)=\"onListEnter($event)\"\n (keydown.space)=\"commit()\"\n >\n @for (item of filteredItems(); track trackItemKey($index, item); let odd = $odd) {\n <div\n ngOption\n class=\"ax-combo-box-option-host\"\n [class.ax-combo-box-option]=\"!itemTemplate()\"\n [class.ax-combo-box-option-multiple]=\"multiple()\"\n [class.ax-state-alternate]=\"alternate() && odd\"\n [value]=\"item.id\"\n [label]=\"item.text\"\n >\n <ng-container [ngTemplateOutlet]=\"optionContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </div>\n }\n </div>\n </ng-template>\n }\n }\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n</ax-popover>\n<ng-template #optionContent let-item>\n @if (multiple()) {\n <ax-check-box\n class=\"ax-combo-box-checkbox\"\n [tabIndex]=\"-1\"\n [value]=\"isItemSelected(item)\"\n ></ax-check-box>\n }\n @if (itemTemplate()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate()!\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <span class=\"ax-combo-box-option-label\">{{ item.text }}</span>\n @if (!multiple() && isItemSelected(item)) {\n <ax-icon class=\"ax-combo-box-option-check ax-icon ax-icon-check\" aria-hidden=\"true\"></ax-icon>\n }\n }\n</ng-template>\n<ng-content select=\"ax-validation-rule\"></ng-content>\n", styles: ["@layer properties;@layer components{ax-combo-box{display:block;width:100%}ax-combo-box .ax-editor-container{justify-content:flex-start;gap:calc(var(--spacing, .25rem) * 1)}ax-combo-box .ax-combo-box-trigger{cursor:pointer;-webkit-user-select:none;user-select:none}ax-combo-box .ax-combo-box-trigger-multiple{height:auto!important;min-height:var(--ax-comp-editor-height);padding-block:calc(var(--spacing, .25rem) * 1)}ax-combo-box .ax-combo-box-value{position:relative;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-combo-box .ax-combo-box-chips{display:flex;flex-wrap:wrap;align-content:center;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow:visible}ax-combo-box .ax-combo-box-trigger-search{margin:calc(var(--spacing, .25rem) * 0)!important;height:calc(var(--spacing, .25rem) * 7.5);width:auto!important;min-width:calc(var(--spacing, .25rem) * 16);flex:1;flex-basis:calc(var(--spacing, .25rem) * 16)}ax-combo-box .ax-combo-box-selected-content{pointer-events:none;position:relative;z-index:0;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-combo-box .ax-combo-box-select-input{cursor:pointer;caret-color:transparent;-webkit-user-select:none;user-select:none}ax-combo-box .ax-combo-box-input-overlay{position:absolute;inset:calc(var(--spacing, .25rem) * 0);z-index:10;margin:calc(var(--spacing, .25rem) * 0)!important;height:100%;width:100%;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)!important;color:transparent;caret-color:transparent}ax-combo-box ax-chips ax-prefix,ax-combo-box ax-chips ax-suffix{padding:calc(var(--spacing, .25rem) * 0)!important}ax-combo-box ax-chips ax-suffix button{display:flex;cursor:pointer;align-items:center;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)}.ax-combo-box-popup{--ax-comp-combo-box-popup-max-height: 15rem;box-sizing:border-box;display:flex;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;overflow:hidden;border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-combo-box-popup:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-darkest-surface))}.ax-combo-box-popup.ax-is-empty{min-height:calc(var(--spacing, .25rem) * 12)}.ax-combo-box-popup.ax-is-actionsheet{--ax-comp-combo-box-popup-max-height: none;height:100dvh;max-height:100dvh;min-height:100dvh;border-bottom-right-radius:0;border-bottom-left-radius:0;--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-combo-box-popup.ax-is-actionsheet.ax-is-empty{min-height:100dvh}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid ax-title{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500)}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid ax-button{flex-shrink:0}.ax-combo-box-popup.ax-is-actionsheet .ax-combo-box-listbox{min-height:calc(var(--spacing, .25rem) * 0);flex:1;max-height:none}.ax-combo-box-popup.ax-is-actionsheet .ax-combo-box-empty{display:flex;flex:1;align-items:center;justify-content:center}.ax-combo-box-popup .ax-combo-box-sheet-search{flex-shrink:0;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-popup>ax-header:not(.ax-solid),.ax-combo-box-popup>ax-footer{flex-shrink:0;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-combo-box-popup>ax-header:not(.ax-solid){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ax-combo-box-popup>ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px}.ax-combo-box-listbox{display:flex;max-height:var(--ax-comp-combo-box-popup-max-height);min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;overflow-x:hidden;overflow-y:auto;--tw-outline-style: none;outline-style:none}.ax-combo-box-listbox.ax-hidden{display:none}.ax-combo-box-empty{width:100%;padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 3);text-align:center;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 60%,transparent)}}.ax-combo-box-option-host{box-sizing:border-box;cursor:pointer;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;--tw-outline-style: none;outline-style:none}.ax-combo-box-option-host.ax-state-alternate{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host.ax-state-alternate{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 5%,transparent)}}.ax-combo-box-option-host:hover,.ax-combo-box-option-host[data-active=true]{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host:hover,.ax-combo-box-option-host[data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}.ax-combo-box-option-host.ax-state-alternate:hover,.ax-combo-box-option-host.ax-state-alternate[data-active=true]{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host.ax-state-alternate:hover,.ax-combo-box-option-host.ax-state-alternate[data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}:is(.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-primary-darkest-surface))}@supports (color: color-mix(in lab,red,red)){:is(.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-darkest-surface)) 25%,transparent)}}.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-lightest-surface)) 80%,transparent)}}:is(.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-primary-darkest-surface))}@supports (color: color-mix(in lab,red,red)){:is(.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-darkest-surface)) 40%,transparent)}}.ax-combo-box-option-host.ax-combo-box-option-multiple{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-option-host.ax-combo-box-option-multiple:not(.ax-combo-box-option){padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-option-host .ax-combo-box-checkbox{pointer-events:none;display:inline-flex;flex-shrink:0;align-items:center}.ax-combo-box-option{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-on-surface))}.ax-combo-box-option[aria-selected=true]{color:rgba(var(--ax-sys-color-primary-surface))}.ax-combo-box-option.ax-combo-box-option-multiple{justify-content:flex-start}.ax-combo-box-option .ax-combo-box-option-label{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-combo-box-option .ax-combo-box-option-check{flex-shrink:0;color:rgba(var(--ax-sys-color-primary-surface))}}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive{background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);border-color:rgba(var(--ax-sys-color-border-surface))}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){border-color:rgba(var(--ax-sys-color-border-light-surface))}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:not(.ax-state-disabled):hover{background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:not(.ax-state-disabled):hover:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-light);color:var(--color-on-light);border-color:var(--color-border-light)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-leading: initial;--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "component", type: AXChipsComponent, selector: "ax-chips", inputs: ["tabIndex", "color", "look", "text"], outputs: ["textChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i1.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "component", type: i1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "directive", type: Combobox, selector: "[ngCombobox]", inputs: ["disabled", "readonly", "softDisabled", "alwaysExpanded", "tabindex", "expanded", "value", "inlineSuggestion"], outputs: ["expandedChange", "valueChange"], exportAs: ["ngCombobox"] }, { kind: "directive", type: ComboboxPopup, selector: "ng-template[ngComboboxPopup]", inputs: ["combobox", "popupType"], exportAs: ["ngComboboxPopup"] }, { kind: "directive", type: ComboboxWidget, selector: "[ngComboboxWidget]", inputs: ["activeDescendant"], exportAs: ["ngComboboxWidget"] }, { kind: "directive", type: Listbox, selector: "[ngListbox]", inputs: ["id", "orientation", "multi", "wrap", "softDisabled", "focusMode", "selectionMode", "typeaheadDelay", "disabled", "readonly", "tabindex", "value"], outputs: ["valueChange"], exportAs: ["ngListbox"] }, { kind: "directive", type: Option, selector: "[ngOption]", inputs: ["id", "value", "disabled", "label"], exportAs: ["ngOption"] }, { kind: "component", type: AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "visualContextScope", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "closeOnScroll", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
739
|
+
}
|
|
740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxComponent, decorators: [{
|
|
741
|
+
type: Component,
|
|
742
|
+
args: [{ selector: 'ax-combo-box', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
743
|
+
AXButtonComponent,
|
|
744
|
+
AXCheckBoxComponent,
|
|
745
|
+
AXChipsComponent,
|
|
746
|
+
AXDecoratorModule,
|
|
747
|
+
Combobox,
|
|
748
|
+
ComboboxPopup,
|
|
749
|
+
ComboboxWidget,
|
|
750
|
+
Listbox,
|
|
751
|
+
Option,
|
|
752
|
+
AXPopoverComponent,
|
|
753
|
+
AXSearchBoxComponent,
|
|
754
|
+
AXTranslatorPipe,
|
|
755
|
+
AsyncPipe,
|
|
756
|
+
NgTemplateOutlet,
|
|
757
|
+
], providers: [
|
|
758
|
+
{ provide: AXComponent, useExisting: AXComboBoxComponent },
|
|
759
|
+
{ provide: AXClearableComponent, useExisting: AXComboBoxComponent },
|
|
760
|
+
{ provide: AXClosableComponent, useExisting: AXComboBoxComponent },
|
|
761
|
+
{ provide: AXValuableComponent, useExisting: AXComboBoxComponent },
|
|
762
|
+
], template: "<div\n #origin\n class=\"ax-editor-container ax-{{ look() }} ax-default\"\n [class.ax-combo-box-trigger]=\"!isEditableTrigger()\"\n [class.ax-combo-box-trigger-multiple]=\"multiple()\"\n [class.ax-state-disabled]=\"disabled()\"\n [class.ax-state-readonly]=\"readonly()\"\n>\n <ng-content select=\"ax-prefix\"></ng-content>\n\n <div class=\"ax-combo-box-value\" [class.ax-combo-box-chips]=\"multiple()\">\n @if (multiple()) {\n @for (item of selectedItems(); track item.id) {\n <ax-chips class=\"ax-sm\" look=\"fill\" [text]=\"selectedTemplate() ? '' : item.text\">\n @if (selectedTemplate()) {\n <ax-prefix>\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </ax-prefix>\n }\n @if (!disabled() && !readonly()) {\n <ax-suffix>\n <button type=\"button\" tabindex=\"-1\" (click)=\"removeChip($event, item)\">\n <span class=\"ax-icon ax-icon-close\"></span>\n </button>\n </ax-suffix>\n }\n </ax-chips>\n }\n } @else if (showSelectedTemplate()) {\n <div class=\"ax-combo-box-selected-content\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedItem() }\"\n />\n </div>\n }\n\n <input\n ngCombobox\n #combobox=\"ngCombobox\"\n type=\"text\"\n class=\"ax-input\"\n [class.ax-combo-box-trigger-search]=\"multiple()\"\n [class.ax-combo-box-select-input]=\"!isEditableTrigger()\"\n [class.ax-combo-box-input-overlay]=\"!multiple() && showSelectedTemplate()\"\n [placeholder]=\"multiple() ? triggerSearchPlaceholder() : placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [(value)]=\"searchText\"\n [expanded]=\"expanded()\"\n (expandedChange)=\"onExpandedChange($event)\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n\n @if (hasSelection() && !disabled() && !readonly()) {\n <ng-content select=\"ax-clear-button\"></ng-content>\n }\n\n <button\n type=\"button\"\n class=\"ax-general-button-icon\"\n tabindex=\"-1\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"onTriggerClick()\"\n >\n <span class=\"ax-icon\" [class.ax-icon-chevron-down]=\"!expanded()\" [class.ax-icon-chevron-up]=\"expanded()\"></span>\n </button>\n <ng-content select=\"ax-suffix\"></ng-content>\n</div>\n\n<ax-popover\n [target]=\"origin\"\n [openOn]=\"'manual'\"\n [closeOn]=\"isActionsheetStyle() ? 'manual' : 'clickOut'\"\n [closeOnScroll]=\"!isActionsheetStyle()\"\n [placement]=\"'bottom-start'\"\n [width]=\"isActionsheetStyle() ? '100%' : origin.offsetWidth + 'px'\"\n [adaptivityEnabled]=\"isActionsheetStyle()\"\n [disabled]=\"disabled() || readonly()\"\n (onClosed)=\"onPopoverClosed()\"\n>\n <div\n #popup\n class=\"ax-combo-box-popup\"\n [class.ax-is-empty]=\"hasNoMatches()\"\n [class.ax-is-actionsheet]=\"isActionsheetStyle()\"\n (keydown.escape)=\"close()\"\n >\n @if (isActionsheetStyle()) {\n <ax-header class=\"ax-solid\">\n <ax-title>{{ caption() || placeholder() || ('@acorex:selectbox.popover.title' | translate | async) }}</ax-title>\n @if (multiple()) {\n <ax-button\n class=\"ax-sm\"\n color=\"primary\"\n look=\"solid\"\n text=\"@acorex:common.actions.apply\"\n (onClick)=\"close()\"\n ></ax-button>\n } @else {\n <ax-close-button></ax-close-button>\n }\n </ax-header>\n }\n @if (isSheetSearchEnabled()) {\n <div class=\"ax-combo-box-sheet-search\">\n <ax-search-box\n #sheetSearch\n class=\"ax-sm\"\n look=\"fill\"\n [autoSearch]=\"false\"\n [delayTime]=\"0\"\n [placeholder]=\"searchPlaceholder()\"\n (onValueChanged)=\"onSheetSearchInput()\"\n (onKeyUp)=\"onSheetSearchInput()\"\n (onKeyDown)=\"onSheetSearchKeydown($event)\"\n >\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n }\n <ng-content select=\"ax-header\"></ng-content>\n @if (expanded()) {\n @if (hasNoMatches()) {\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\" />\n } @else {\n <div class=\"ax-combo-box-empty\">{{ '@acorex:common.general.no-result-found' | translate | async }}</div>\n }\n }\n @if (isActionsheetStyle()) {\n <div\n ngListbox\n class=\"ax-combo-box-listbox\"\n [class.ax-hidden]=\"hasNoMatches()\"\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"multiple()\"\n [tabindex]=\"-1\"\n [(value)]=\"selection\"\n (click)=\"commit($event)\"\n >\n @for (item of filteredItems(); track trackItemKey($index, item); let odd = $odd) {\n <div\n ngOption\n class=\"ax-combo-box-option-host\"\n [class.ax-combo-box-option]=\"!itemTemplate()\"\n [class.ax-combo-box-option-multiple]=\"multiple()\"\n [class.ax-state-alternate]=\"alternate() && odd\"\n [value]=\"item.id\"\n [label]=\"item.text\"\n >\n <ng-container [ngTemplateOutlet]=\"optionContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </div>\n }\n </div>\n } @else {\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <div\n ngListbox\n ngComboboxWidget\n #listbox=\"ngListbox\"\n class=\"ax-combo-box-listbox\"\n [class.ax-hidden]=\"hasNoMatches()\"\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"multiple()\"\n [tabindex]=\"-1\"\n [activeDescendant]=\"listbox.activeDescendant()\"\n [(value)]=\"selection\"\n (click)=\"commit($event)\"\n (keydown.enter)=\"onListEnter($event)\"\n (keydown.space)=\"commit()\"\n >\n @for (item of filteredItems(); track trackItemKey($index, item); let odd = $odd) {\n <div\n ngOption\n class=\"ax-combo-box-option-host\"\n [class.ax-combo-box-option]=\"!itemTemplate()\"\n [class.ax-combo-box-option-multiple]=\"multiple()\"\n [class.ax-state-alternate]=\"alternate() && odd\"\n [value]=\"item.id\"\n [label]=\"item.text\"\n >\n <ng-container [ngTemplateOutlet]=\"optionContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </div>\n }\n </div>\n </ng-template>\n }\n }\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n</ax-popover>\n<ng-template #optionContent let-item>\n @if (multiple()) {\n <ax-check-box\n class=\"ax-combo-box-checkbox\"\n [tabIndex]=\"-1\"\n [value]=\"isItemSelected(item)\"\n ></ax-check-box>\n }\n @if (itemTemplate()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate()!\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <span class=\"ax-combo-box-option-label\">{{ item.text }}</span>\n @if (!multiple() && isItemSelected(item)) {\n <ax-icon class=\"ax-combo-box-option-check ax-icon ax-icon-check\" aria-hidden=\"true\"></ax-icon>\n }\n }\n</ng-template>\n<ng-content select=\"ax-validation-rule\"></ng-content>\n", styles: ["@layer properties;@layer components{ax-combo-box{display:block;width:100%}ax-combo-box .ax-editor-container{justify-content:flex-start;gap:calc(var(--spacing, .25rem) * 1)}ax-combo-box .ax-combo-box-trigger{cursor:pointer;-webkit-user-select:none;user-select:none}ax-combo-box .ax-combo-box-trigger-multiple{height:auto!important;min-height:var(--ax-comp-editor-height);padding-block:calc(var(--spacing, .25rem) * 1)}ax-combo-box .ax-combo-box-value{position:relative;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-combo-box .ax-combo-box-chips{display:flex;flex-wrap:wrap;align-content:center;align-items:center;gap:calc(var(--spacing, .25rem) * 1);overflow:visible}ax-combo-box .ax-combo-box-trigger-search{margin:calc(var(--spacing, .25rem) * 0)!important;height:calc(var(--spacing, .25rem) * 7.5);width:auto!important;min-width:calc(var(--spacing, .25rem) * 16);flex:1;flex-basis:calc(var(--spacing, .25rem) * 16)}ax-combo-box .ax-combo-box-selected-content{pointer-events:none;position:relative;z-index:0;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-combo-box .ax-combo-box-select-input{cursor:pointer;caret-color:transparent;-webkit-user-select:none;user-select:none}ax-combo-box .ax-combo-box-input-overlay{position:absolute;inset:calc(var(--spacing, .25rem) * 0);z-index:10;margin:calc(var(--spacing, .25rem) * 0)!important;height:100%;width:100%;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)!important;color:transparent;caret-color:transparent}ax-combo-box ax-chips ax-prefix,ax-combo-box ax-chips ax-suffix{padding:calc(var(--spacing, .25rem) * 0)!important}ax-combo-box ax-chips ax-suffix button{display:flex;cursor:pointer;align-items:center;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)}.ax-combo-box-popup{--ax-comp-combo-box-popup-max-height: 15rem;box-sizing:border-box;display:flex;width:100%;max-width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;overflow:hidden;border-radius:var(--ax-sys-border-radius);border-style:var(--tw-border-style);border-width:1px;border-color:rgba(var(--ax-sys-color-border-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-combo-box-popup:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-darkest-surface))}.ax-combo-box-popup.ax-is-empty{min-height:calc(var(--spacing, .25rem) * 12)}.ax-combo-box-popup.ax-is-actionsheet{--ax-comp-combo-box-popup-max-height: none;height:100dvh;max-height:100dvh;min-height:100dvh;border-bottom-right-radius:0;border-bottom-left-radius:0;--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ax-combo-box-popup.ax-is-actionsheet.ax-is-empty{min-height:100dvh}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid ax-title{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500)}.ax-combo-box-popup.ax-is-actionsheet>ax-header.ax-solid ax-button{flex-shrink:0}.ax-combo-box-popup.ax-is-actionsheet .ax-combo-box-listbox{min-height:calc(var(--spacing, .25rem) * 0);flex:1;max-height:none}.ax-combo-box-popup.ax-is-actionsheet .ax-combo-box-empty{display:flex;flex:1;align-items:center;justify-content:center}.ax-combo-box-popup .ax-combo-box-sheet-search{flex-shrink:0;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:rgba(var(--ax-sys-color-border-lightest-surface));padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-popup>ax-header:not(.ax-solid),.ax-combo-box-popup>ax-footer{flex-shrink:0;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-combo-box-popup>ax-header:not(.ax-solid){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ax-combo-box-popup>ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px}.ax-combo-box-listbox{display:flex;max-height:var(--ax-comp-combo-box-popup-max-height);min-width:calc(var(--spacing, .25rem) * 0);flex-direction:column;overflow-x:hidden;overflow-y:auto;--tw-outline-style: none;outline-style:none}.ax-combo-box-listbox.ax-hidden{display:none}.ax-combo-box-empty{width:100%;padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 3);text-align:center;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 60%,transparent)}}.ax-combo-box-option-host{box-sizing:border-box;cursor:pointer;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;--tw-outline-style: none;outline-style:none}.ax-combo-box-option-host.ax-state-alternate{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host.ax-state-alternate{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 5%,transparent)}}.ax-combo-box-option-host:hover,.ax-combo-box-option-host[data-active=true]{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host:hover,.ax-combo-box-option-host[data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}.ax-combo-box-option-host.ax-state-alternate:hover,.ax-combo-box-option-host.ax-state-alternate[data-active=true]{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host.ax-state-alternate:hover,.ax-combo-box-option-host.ax-state-alternate[data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}:is(.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-primary-darkest-surface))}@supports (color: color-mix(in lab,red,red)){:is(.ax-combo-box-option-host[aria-selected=true],.ax-combo-box-option-host[aria-selected=true]:hover,.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true]:hover,.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-darkest-surface)) 25%,transparent)}}.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}@supports (color: color-mix(in lab,red,red)){.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-lightest-surface)) 80%,transparent)}}:is(.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-primary-darkest-surface))}@supports (color: color-mix(in lab,red,red)){:is(.ax-combo-box-option-host[aria-selected=true][data-active=true],.ax-combo-box-option-host.ax-state-alternate[aria-selected=true][data-active=true]):where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-darkest-surface)) 40%,transparent)}}.ax-combo-box-option-host.ax-combo-box-option-multiple{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-option-host.ax-combo-box-option-multiple:not(.ax-combo-box-option){padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2)}.ax-combo-box-option-host .ax-combo-box-checkbox{pointer-events:none;display:inline-flex;flex-shrink:0;align-items:center}.ax-combo-box-option{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgba(var(--ax-sys-color-on-surface))}.ax-combo-box-option[aria-selected=true]{color:rgba(var(--ax-sys-color-primary-surface))}.ax-combo-box-option.ax-combo-box-option-multiple{justify-content:flex-start}.ax-combo-box-option .ax-combo-box-option-label{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-combo-box-option .ax-combo-box-option-check{flex-shrink:0;color:rgba(var(--ax-sys-color-primary-surface))}}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive{background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);border-color:rgba(var(--ax-sys-color-border-surface))}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){border-color:rgba(var(--ax-sys-color-border-light-surface))}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:not(.ax-state-disabled):hover{background-color:var(--color-lighter);color:var(--color-on-lighter);border-color:var(--color-border-lighter)}ax-combo-box .ax-editor-container.ax-fill ax-chips.ax-default.ax-fill-interactive:not(.ax-state-disabled):hover:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:var(--color-light);color:var(--color-on-light);border-color:var(--color-border-light)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-leading: initial;--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
763
|
+
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], adaptivityEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "adaptivityEnabled", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], alternate: [{ type: i0.Input, args: [{ isSignal: true, alias: "alternate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], selectedTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedTemplate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }, { type: i0.Output, args: ["lookChange"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], onValueChanged: [{ type: i0.Output, args: ["onValueChanged"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], onItemSelected: [{ type: i0.Output, args: ["onItemSelected"] }], onOpened: [{ type: i0.Output, args: ["onOpened"] }], onClosed: [{ type: i0.Output, args: ["onClosed"] }], comboboxRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Combobox), { isSignal: true }] }], listboxRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Listbox), { isSignal: true }] }], popoverRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXPopoverComponent), { isSignal: true }] }], originRef: [{ type: i0.ViewChild, args: ['origin', { isSignal: true }] }], popupRef: [{ type: i0.ViewChild, args: ['popup', { isSignal: true }] }], sheetSearchRef: [{ type: i0.ViewChild, args: ['sheetSearch', { isSignal: true }] }] } });
|
|
764
|
+
|
|
765
|
+
class AXComboBoxModule {
|
|
766
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
767
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxModule, imports: [AXComboBoxComponent], exports: [AXComboBoxComponent] }); }
|
|
768
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxModule, imports: [AXComboBoxComponent] }); }
|
|
769
|
+
}
|
|
770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXComboBoxModule, decorators: [{
|
|
771
|
+
type: NgModule,
|
|
772
|
+
args: [{
|
|
773
|
+
imports: [AXComboBoxComponent],
|
|
774
|
+
exports: [AXComboBoxComponent],
|
|
775
|
+
}]
|
|
776
|
+
}] });
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Generated bundle index. Do not edit.
|
|
780
|
+
*/
|
|
781
|
+
|
|
782
|
+
export { AXComboBoxComponent, AXComboBoxModule };
|
|
783
|
+
//# sourceMappingURL=acorex-components-combo-box.mjs.map
|