@acorex/components 22.1.0-next.0 → 22.1.0-next.2
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 +12 -3
- package/fesm2022/acorex-components-action-sheet.mjs +1 -0
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +2 -2
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-combo-box.mjs +372 -30
- package/fesm2022/acorex-components-combo-box.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +2 -2
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +19 -3
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +4 -2
- 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 +2 -2
- package/fesm2022/acorex-components-fab.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-lookup.mjs +724 -175
- package/fesm2022/acorex-components-lookup.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +2 -2
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +26 -6
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +9 -2
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +1 -1
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +7 -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-scheduler.mjs +6 -6
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +19 -9
- package/fesm2022/acorex-components-select-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/lookup/README.md +13 -8
- package/package.json +3 -3
- 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 +147 -18
- package/types/acorex-components-decorators.d.ts +1 -0
- package/types/acorex-components-dialog.d.ts +9 -0
- package/types/acorex-components-lookup.d.ts +260 -90
- package/types/acorex-components-menu.d.ts +2 -0
- package/types/acorex-components-notification.d.ts +11 -1
- package/types/acorex-components-popover.d.ts +4 -1
- package/types/acorex-components-popup.d.ts +9 -1
- package/types/acorex-components-select-box.d.ts +10 -4
- package/types/acorex-components-toast.d.ts +10 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { NXComponent, AXStyleLookType, AXValueChangedEvent, AXFocusEvent, AXItemClickEvent, AXItemSelectedEvent, AXEvent } from '@acorex/cdk/common';
|
|
3
4
|
import { AXPopoverComponent } from '@acorex/components/popover';
|
|
4
5
|
import { Combobox } from '@angular/aria/combobox';
|
|
5
6
|
import { Listbox } from '@angular/aria/listbox';
|
|
7
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* An item in the combo box list.
|
|
@@ -16,19 +18,33 @@ interface AXComboBoxItem {
|
|
|
16
18
|
text: string;
|
|
17
19
|
value: string | number;
|
|
18
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The combo box model value: a scalar (or `null`) in single-select mode,
|
|
23
|
+
* or an array of scalars in multi-select mode.
|
|
24
|
+
*/
|
|
25
|
+
type AXComboBoxValue = string | number | (string | number)[] | null;
|
|
19
26
|
|
|
20
27
|
/**
|
|
21
|
-
* A minimal combo box for selecting
|
|
28
|
+
* A minimal combo box for selecting one or more values from a list of items.
|
|
22
29
|
*
|
|
23
30
|
* Built on top of the `@angular/aria/combobox` directives, it supports two behaviors:
|
|
24
31
|
* - `searchable="true"` (default): an input with typeahead filtering (matches `id`).
|
|
25
|
-
* - `searchable="false"`: a select-like trigger (same input
|
|
32
|
+
* - `searchable="false"`: a select-like, non-editable trigger (same input; typing blocked without
|
|
33
|
+
* Combobox `readonly`, so Tab focus and keyboard open/select keep working).
|
|
34
|
+
*
|
|
35
|
+
* With `multiple="true"`, selected values are shown as chips in the trigger and the popup stays
|
|
36
|
+
* open while toggling items (same interaction model as `ax-lookup` multi-select).
|
|
37
|
+
*
|
|
38
|
+
* With `adaptivityEnabled` (default `true`), the list opens as a bottom actionsheet on small
|
|
39
|
+
* screens instead of an anchored dropdown — the same alternate presentation as `ax-select-box`.
|
|
26
40
|
*
|
|
27
41
|
* Items use `text` for display, `id` for search/identity, and `value` as the submitted model value.
|
|
42
|
+
* Implements {@link FormValueControl} so `[(ngModel)]` / signal forms work via the `value` model
|
|
43
|
+
* (no `ControlValueAccessor`).
|
|
28
44
|
*
|
|
29
45
|
* @category Components
|
|
30
46
|
*/
|
|
31
|
-
declare class AXComboBoxComponent extends NXComponent {
|
|
47
|
+
declare class AXComboBoxComponent extends NXComponent implements FormValueControl<AXComboBoxValue> {
|
|
32
48
|
#private;
|
|
33
49
|
/**
|
|
34
50
|
* The list of items the user can select from.
|
|
@@ -37,33 +53,91 @@ declare class AXComboBoxComponent extends NXComponent {
|
|
|
37
53
|
items: _angular_core.InputSignal<AXComboBoxItem[]>;
|
|
38
54
|
/**
|
|
39
55
|
* Whether the combo box accepts typing and filters the list (`true`),
|
|
40
|
-
* or is a select-like,
|
|
56
|
+
* or is a select-like, non-editable trigger (`false`).
|
|
41
57
|
*/
|
|
42
58
|
searchable: _angular_core.InputSignal<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* When `true`, multiple items can be selected. Selected values are shown as chips and the
|
|
61
|
+
* popup stays open while toggling. The model value is an array (`[]` when empty).
|
|
62
|
+
*/
|
|
63
|
+
multiple: _angular_core.InputSignal<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* When `true` (default), the popup list uses the alternate actionsheet presentation on small
|
|
66
|
+
* screens (`SM`). When `false`, the list always opens as an anchored dropdown.
|
|
67
|
+
*/
|
|
68
|
+
adaptivityEnabled: _angular_core.InputSignal<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Title shown in the actionsheet header on small screens. Falls back to `placeholder`.
|
|
71
|
+
*/
|
|
72
|
+
caption: _angular_core.InputSignal<string>;
|
|
73
|
+
/**
|
|
74
|
+
* When `true`, list rows use alternating background colors for easier scanning.
|
|
75
|
+
*/
|
|
76
|
+
alternate: _angular_core.InputSignal<boolean>;
|
|
43
77
|
/**
|
|
44
78
|
* The placeholder text shown when no value is selected.
|
|
45
79
|
*/
|
|
46
80
|
placeholder: _angular_core.InputSignal<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Placeholder for the trigger search input when items are already selected (multi-select).
|
|
83
|
+
* Falls back to `placeholder` when the selection is empty.
|
|
84
|
+
*/
|
|
85
|
+
searchPlaceholder: _angular_core.InputSignal<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Custom template rendered when the filtered list has no items.
|
|
88
|
+
* When omitted, a default "no result found" message is shown.
|
|
89
|
+
*/
|
|
90
|
+
emptyTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
|
|
91
|
+
/**
|
|
92
|
+
* Custom template rendered for each item in the popup list.
|
|
93
|
+
* Context: `{ $implicit: AXComboBoxItem }`.
|
|
94
|
+
*/
|
|
95
|
+
itemTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
|
|
96
|
+
/**
|
|
97
|
+
* Custom template rendered for the selected value in the trigger.
|
|
98
|
+
* Context: `{ $implicit: AXComboBoxItem }`.
|
|
99
|
+
* When `searchable` is true, the template is shown while the popup is closed and the input
|
|
100
|
+
* still reflects the selected text; typing/opening falls back to the plain input.
|
|
101
|
+
* In multi-select mode, the template replaces the chip text for each selected item.
|
|
102
|
+
*/
|
|
103
|
+
selectedTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
|
|
47
104
|
/**
|
|
48
105
|
* Whether the combo box is disabled.
|
|
49
106
|
*/
|
|
50
|
-
disabled: _angular_core.
|
|
107
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
51
108
|
/**
|
|
52
109
|
* Whether the combo box is readonly.
|
|
53
110
|
*/
|
|
54
|
-
readonly: _angular_core.
|
|
111
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
55
112
|
/**
|
|
56
113
|
* Predefined look scheme of the editor container. Same looks as other editor components like ax-text-box.
|
|
57
114
|
*/
|
|
58
115
|
look: _angular_core.ModelSignal<AXStyleLookType>;
|
|
59
116
|
/**
|
|
60
|
-
* The selected item
|
|
117
|
+
* The selected item `value`(s). Scalar (or `null`) in single mode; an array in multi mode.
|
|
118
|
+
* Supports `[(value)]`, `[(ngModel)]`, and signal forms via {@link FormValueControl}.
|
|
61
119
|
*/
|
|
62
|
-
value: _angular_core.ModelSignal<
|
|
120
|
+
readonly value: _angular_core.ModelSignal<AXComboBoxValue>;
|
|
63
121
|
/**
|
|
64
122
|
* Emitted when the selected value changes.
|
|
65
123
|
*/
|
|
66
|
-
onValueChanged: _angular_core.OutputEmitterRef<AXValueChangedEvent<
|
|
124
|
+
onValueChanged: _angular_core.OutputEmitterRef<AXValueChangedEvent<AXComboBoxValue>>;
|
|
125
|
+
/**
|
|
126
|
+
* Emitted when the trigger receives focus.
|
|
127
|
+
*/
|
|
128
|
+
onFocus: _angular_core.OutputEmitterRef<AXFocusEvent>;
|
|
129
|
+
/**
|
|
130
|
+
* Emitted when the trigger loses focus.
|
|
131
|
+
*/
|
|
132
|
+
onBlur: _angular_core.OutputEmitterRef<AXFocusEvent>;
|
|
133
|
+
/**
|
|
134
|
+
* Emitted when a list item is clicked.
|
|
135
|
+
*/
|
|
136
|
+
onItemClick: _angular_core.OutputEmitterRef<AXItemClickEvent<AXComboBoxItem>>;
|
|
137
|
+
/**
|
|
138
|
+
* Emitted when a list item is selected (click or keyboard).
|
|
139
|
+
*/
|
|
140
|
+
onItemSelected: _angular_core.OutputEmitterRef<AXItemSelectedEvent<AXComboBoxItem>>;
|
|
67
141
|
/**
|
|
68
142
|
* Emitted when the popup list opens.
|
|
69
143
|
*/
|
|
@@ -74,13 +148,28 @@ declare class AXComboBoxComponent extends NXComponent {
|
|
|
74
148
|
onClosed: _angular_core.OutputEmitterRef<AXEvent>;
|
|
75
149
|
/** Whether the popup is expanded. */
|
|
76
150
|
protected expanded: _angular_core.WritableSignal<boolean>;
|
|
77
|
-
/**
|
|
151
|
+
/** Whether the list is currently shown as a bottom actionsheet (small screens + adaptivity). */
|
|
152
|
+
protected isActionsheetStyle: _angular_core.WritableSignal<boolean>;
|
|
153
|
+
/** The current selection normalized to an array of submitted values. */
|
|
154
|
+
protected selectedValues: _angular_core.Signal<(string | number)[]>;
|
|
155
|
+
/** Whether there is at least one selected value. */
|
|
156
|
+
protected hasSelection: _angular_core.Signal<boolean>;
|
|
157
|
+
/** Resolved selected items for the current model value(s). */
|
|
158
|
+
protected selectedItems: _angular_core.Signal<AXComboBoxItem[]>;
|
|
159
|
+
/** The item whose `value` matches the current model value (single-select). */
|
|
78
160
|
protected selectedItem: _angular_core.Signal<AXComboBoxItem>;
|
|
79
|
-
/** Display text shown in the trigger / used as the searchable input baseline. */
|
|
161
|
+
/** Display text shown in the trigger / used as the searchable input baseline (single-select). */
|
|
80
162
|
protected displayText: _angular_core.Signal<string>;
|
|
81
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* The text typed in the searchable input.
|
|
165
|
+
* Multi-select starts empty; single mode syncs from the selected display text.
|
|
166
|
+
*/
|
|
82
167
|
protected searchText: _angular_core.WritableSignal<string>;
|
|
83
|
-
/**
|
|
168
|
+
/** Whether the trigger should render `selectedTemplate` instead of the plain input text. */
|
|
169
|
+
protected showSelectedTemplate: _angular_core.Signal<boolean>;
|
|
170
|
+
/** Placeholder for the editable trigger search input in multi-select. */
|
|
171
|
+
protected triggerSearchPlaceholder: _angular_core.Signal<string>;
|
|
172
|
+
/** The listbox selection (item ids), kept in sync with the selected value(s). */
|
|
84
173
|
protected selection: _angular_core.WritableSignal<string[]>;
|
|
85
174
|
/** Items filtered by typed query against `id` when the combo box is searchable. */
|
|
86
175
|
protected filteredItems: _angular_core.Signal<AXComboBoxItem[]>;
|
|
@@ -88,20 +177,60 @@ declare class AXComboBoxComponent extends NXComponent {
|
|
|
88
177
|
protected listboxRef: _angular_core.Signal<Listbox<any>>;
|
|
89
178
|
protected popoverRef: _angular_core.Signal<AXPopoverComponent>;
|
|
90
179
|
constructor();
|
|
180
|
+
/** Stable unique key for `@for` — avoids NG0955 when `id` is missing or duplicated. */
|
|
181
|
+
protected trackItemKey(index: number, item: AXComboBoxItem): string;
|
|
182
|
+
/** Whether the given item is currently selected. */
|
|
183
|
+
protected isItemSelected(item: AXComboBoxItem): boolean;
|
|
91
184
|
/**
|
|
92
185
|
* Opens (searchable) or toggles (non-searchable) the popup on trigger click.
|
|
93
186
|
*/
|
|
94
187
|
protected onTriggerClick(): void;
|
|
188
|
+
/**
|
|
189
|
+
* Keyboard handling on the trigger:
|
|
190
|
+
* - Non-searchable: open with Enter/Space when collapsed; commit with Space when expanded.
|
|
191
|
+
* - Multi-select: Backspace removes the last chip when the search input is empty.
|
|
192
|
+
*/
|
|
193
|
+
protected onTriggerKeydown(event: KeyboardEvent): void;
|
|
194
|
+
/** Blocks typing in non-searchable mode without Combobox `readonly` (keeps Tab/keyboard working). */
|
|
195
|
+
protected onBeforeInput(event: Event): void;
|
|
95
196
|
/**
|
|
96
197
|
* Keeps the combobox expanded state in sync when the popover closes (e.g. click outside).
|
|
97
198
|
*/
|
|
98
199
|
protected onPopoverClosed(): void;
|
|
99
200
|
/**
|
|
100
|
-
*
|
|
201
|
+
* Removes a single chip from the multi selection.
|
|
202
|
+
*/
|
|
203
|
+
protected removeChip(event: Event, item: AXComboBoxItem): void;
|
|
204
|
+
/**
|
|
205
|
+
* Clears the selected value(s) and closes the popup.
|
|
206
|
+
* Sets `null` in single mode and `[]` in multi mode. Used by projected `ax-clear-button`.
|
|
207
|
+
*
|
|
208
|
+
* @param isUserInteraction - Whether the clear was triggered by the user.
|
|
209
|
+
*/
|
|
210
|
+
reset(isUserInteraction?: boolean): void;
|
|
211
|
+
/**
|
|
212
|
+
* Closes the popup list.
|
|
213
|
+
*/
|
|
214
|
+
close(): void;
|
|
215
|
+
/**
|
|
216
|
+
* Closes the popup list (alias for {@link close}, required by `AXClosableComponent`).
|
|
217
|
+
*/
|
|
218
|
+
closeAll(): void;
|
|
219
|
+
/**
|
|
220
|
+
* Commits the highlighted (active) or clicked list item as the component value.
|
|
221
|
+
*
|
|
222
|
+
* With `selectionMode="explicit"`, arrow keys only move the active item; Enter/Space must resolve
|
|
223
|
+
* that option. Clicks resolve from the event target so we do not depend on listener order vs ngListbox.
|
|
224
|
+
*
|
|
225
|
+
* In multi-select mode the item is toggled and the popup stays open.
|
|
101
226
|
*/
|
|
102
|
-
protected commit(): void;
|
|
227
|
+
protected commit(event?: Event): void;
|
|
228
|
+
/** Forwards native focus from the trigger input. */
|
|
229
|
+
protected emitOnFocus(e: FocusEvent): void;
|
|
230
|
+
/** Forwards native blur from the trigger input. */
|
|
231
|
+
protected emitOnBlur(e: FocusEvent): void;
|
|
103
232
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXComboBoxComponent, never>;
|
|
104
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXComboBoxComponent, "ax-combo-box", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "
|
|
233
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXComboBoxComponent, "ax-combo-box", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "adaptivityEnabled": { "alias": "adaptivityEnabled"; "required": false; "isSignal": true; }; "caption": { "alias": "caption"; "required": false; "isSignal": true; }; "alternate": { "alias": "alternate"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; "selectedTemplate": { "alias": "selectedTemplate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "look": "lookChange"; "value": "valueChange"; "onValueChanged": "onValueChanged"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onItemClick": "onItemClick"; "onItemSelected": "onItemSelected"; "onOpened": "onOpened"; "onClosed": "onClosed"; }, never, ["ax-prefix", "ax-clear-button", "ax-suffix", "ax-header", "ax-footer"], true, never>;
|
|
105
234
|
}
|
|
106
235
|
|
|
107
236
|
declare class AXComboBoxModule {
|
|
@@ -111,4 +240,4 @@ declare class AXComboBoxModule {
|
|
|
111
240
|
}
|
|
112
241
|
|
|
113
242
|
export { AXComboBoxComponent, AXComboBoxModule };
|
|
114
|
-
export type { AXComboBoxItem };
|
|
243
|
+
export type { AXComboBoxItem, AXComboBoxValue };
|
|
@@ -2,6 +2,7 @@ import * as i2 from '@acorex/cdk/common';
|
|
|
2
2
|
import { AXStyleColorType, AXStyleLookType, AXHotKeyAction, MXBaseComponent } from '@acorex/cdk/common';
|
|
3
3
|
import { AXOverlayRef } from '@acorex/cdk/overlay';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
+
import { ElementRef } from '@angular/core';
|
|
5
6
|
import * as i1 from '@angular/common';
|
|
6
7
|
import * as i3 from '@angular/cdk/drag-drop';
|
|
7
8
|
import * as i4 from '@angular/cdk/a11y';
|
|
@@ -34,6 +35,14 @@ interface AXDialogConfig {
|
|
|
34
35
|
icon?: string | 'none';
|
|
35
36
|
draggable?: boolean;
|
|
36
37
|
direction?: 'rtl' | 'ltr';
|
|
38
|
+
/**
|
|
39
|
+
* Element used to resolve inherited visual context for overlays rendered
|
|
40
|
+
* outside the originating DOM subtree.
|
|
41
|
+
*
|
|
42
|
+
* This affects Appearance, Light/Dark theme, Contrast, Size, and supported
|
|
43
|
+
* Density context. It does not affect overlay positioning.
|
|
44
|
+
*/
|
|
45
|
+
contextElement?: HTMLElement | ElementRef<HTMLElement>;
|
|
37
46
|
}
|
|
38
47
|
interface AXDialogRef {
|
|
39
48
|
close(): void;
|