@acorex/components 22.0.0-next.24 → 22.0.0-next.27

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.
Files changed (49) hide show
  1. package/combo-box/README.md +24 -1
  2. package/fesm2022/acorex-components-calendar.mjs +2 -2
  3. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  4. package/fesm2022/acorex-components-color-palette.mjs +2 -2
  5. package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
  6. package/fesm2022/acorex-components-combo-box.mjs +177 -609
  7. package/fesm2022/acorex-components-combo-box.mjs.map +1 -1
  8. package/fesm2022/acorex-components-conversation.mjs +937 -670
  9. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  10. package/fesm2022/acorex-components-cron-job.mjs +12 -12
  11. package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
  12. package/fesm2022/acorex-components-data-table.mjs +42 -36
  13. package/fesm2022/acorex-components-data-table.mjs.map +1 -1
  14. package/fesm2022/acorex-components-datetime-box.mjs +2 -2
  15. package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
  16. package/fesm2022/acorex-components-dialog.mjs +3 -2
  17. package/fesm2022/acorex-components-dialog.mjs.map +1 -1
  18. package/fesm2022/acorex-components-form.mjs +3 -4
  19. package/fesm2022/acorex-components-form.mjs.map +1 -1
  20. package/fesm2022/acorex-components-list.mjs +19 -265
  21. package/fesm2022/acorex-components-list.mjs.map +1 -1
  22. package/fesm2022/acorex-components-number-box.mjs +30 -29
  23. package/fesm2022/acorex-components-number-box.mjs.map +1 -1
  24. package/fesm2022/acorex-components-phone-box.mjs +6 -6
  25. package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
  26. package/fesm2022/acorex-components-query-builder.mjs +2 -6
  27. package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
  28. package/fesm2022/acorex-components-rest-api-generator.mjs +2 -2
  29. package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
  30. package/fesm2022/acorex-components-rrule.mjs +2 -2
  31. package/fesm2022/acorex-components-rrule.mjs.map +1 -1
  32. package/fesm2022/acorex-components-scheduler-picker.mjs +16 -16
  33. package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
  34. package/fesm2022/acorex-components-scheduler.mjs +2 -2
  35. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  36. package/fesm2022/acorex-components-select-box.mjs +451 -176
  37. package/fesm2022/acorex-components-select-box.mjs.map +1 -1
  38. package/fesm2022/acorex-components-selection-list.mjs +4 -0
  39. package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
  40. package/package.json +3 -3
  41. package/select-box/README.md +0 -2
  42. package/types/acorex-components-combo-box.d.ts +74 -162
  43. package/types/acorex-components-conversation.d.ts +126 -32
  44. package/types/acorex-components-list.d.ts +3 -65
  45. package/types/acorex-components-number-box.d.ts +3 -1
  46. package/types/acorex-components-phone-box.d.ts +2 -2
  47. package/types/acorex-components-query-builder.d.ts +9 -10
  48. package/types/acorex-components-select-box.d.ts +147 -36
  49. package/types/acorex-components-selection-list.d.ts +2 -1
@@ -1,202 +1,114 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnDestroy, TemplateRef, ElementRef } from '@angular/core';
3
- import * as polytype from 'polytype';
4
- import * as i2 from '@acorex/cdk/common';
5
- import { MXSelectionValueComponent, MXLookComponent, AXDataSource, MXSelectionBridgeService, AXEvent, AXValueChangedEvent, AXItemClickEvent, AXItemSelectedEvent } from '@acorex/cdk/common';
6
- import * as i12 from '@acorex/components/dropdown';
7
- import { MXDropdownBoxBaseComponent, AXDropdownBoxComponent } from '@acorex/components/dropdown';
8
- import * as i13 from '@acorex/components/list';
9
- import { AXListComponent } from '@acorex/components/list';
10
- import { AXSearchBoxComponent } from '@acorex/components/search-box';
11
- import { Observable } from 'rxjs';
12
- import * as i1 from '@angular/common';
13
- import * as i3 from '@angular/forms';
14
- import * as i4 from '@acorex/components/check-box';
15
- import * as i5 from '@acorex/components/badge';
16
- import * as i6 from '@acorex/components/decorators';
17
- import * as i7 from '@acorex/core/translation';
18
- import * as i8 from '@acorex/components/popover';
19
- import * as i9 from '@acorex/components/loading';
20
- import * as i10 from '@angular/cdk/a11y';
21
- import * as i11 from '@acorex/components/text-box';
2
+ import { NXComponent, AXStyleLookType, AXValueChangedEvent, AXEvent } from '@acorex/cdk/common';
3
+ import { AXPopoverComponent } from '@acorex/components/popover';
4
+ import { Combobox } from '@angular/aria/combobox';
5
+ import { Listbox } from '@angular/aria/listbox';
22
6
 
23
- declare const AXComboBoxComponent_base: polytype.Polytype.ClusteredConstructor<[typeof MXDropdownBoxBaseComponent, typeof MXSelectionValueComponent, typeof MXLookComponent]>;
24
7
  /**
25
- * The ComboBox is a component which supports static arrays and advanced AXDataSource with lazy loading.
26
- * @category
8
+ * An item in the combo box list.
9
+ *
10
+ * - `id` — unique key used for filtering/search and list identity
11
+ * - `text` — label shown in the list and in the trigger/input
12
+ * - `value` — value written to the component model when the item is selected
27
13
  */
28
- declare class AXComboBoxComponent extends AXComboBoxComponent_base implements OnDestroy {
14
+ interface AXComboBoxItem {
15
+ id: string;
16
+ text: string;
17
+ value: string | number;
18
+ }
19
+
20
+ /**
21
+ * A minimal combo box for selecting a single value from a list of items.
22
+ *
23
+ * Built on top of the `@angular/aria/combobox` directives, it supports two behaviors:
24
+ * - `editable="true"` (default): an editable input with typeahead filtering (matches `id`).
25
+ * - `editable="false"`: a non-editable, select-like trigger (same input, read-only).
26
+ *
27
+ * Items use `text` for display, `id` for search/identity, and `value` as the submitted model value.
28
+ *
29
+ * @category Components
30
+ */
31
+ declare class AXComboBoxComponent extends NXComponent {
29
32
  #private;
30
33
  /**
31
- * Determines if an item is truncated.
32
- *
33
- * @defaultValue true
34
- */
35
- readonly isItemTruncated: _angular_core.InputSignal<boolean>;
36
- /**
37
- * Determines if a tooltip is shown for an item.
38
- *
39
- * @defaultValue false
40
- */
41
- readonly showItemTooltip: _angular_core.InputSignal<boolean>;
42
- /** Height of each list item in pixels, or 'auto' to let list measure. */
43
- itemHeight: _angular_core.InputSignal<number | "auto">;
44
- /** Maximum number of visible items before scrolling. */
45
- maxVisibleItems: _angular_core.InputSignal<number>;
46
- /** @ignore */
47
- private hotKeyService;
48
- /** @ignore */
49
- protected isLoading: _angular_core.WritableSignal<boolean>;
50
- /** @ignore */
51
- protected searchValue: _angular_core.WritableSignal<string>;
52
- /** @ignore */
53
- protected renderList: _angular_core.WritableSignal<boolean>;
54
- /** @ignore */
55
- protected _dropdownWidth: _angular_core.WritableSignal<string>;
56
- /** @ignore */
57
- protected _dropdownHeight: _angular_core.WritableSignal<string>;
58
- /** @ignore */
59
- protected _listDataSource: AXDataSource<any>;
60
- /** @ignore */
61
- private _originalDataSource;
62
- /** @ignore */
63
- private onChangedSubscription;
64
- /** @ignore */
65
- private onLoadingChangedSubscription;
66
- /**
67
- * Gets the data source for the component, which can be either an `AXDataSource` or an array of items.
68
- * @returns {AXDataSource<any> | any[]}
69
- */
70
- get dataSource(): AXDataSource<any> | any[];
71
- /**
72
- * Sets the data source, either as an `AXDataSource` or an array.
73
- * @param {AXDataSource<any> | any[]} v
74
- */
75
- set dataSource(v: AXDataSource<any> | any[]);
76
- /**
77
- * The placeholder text displayed when the component is empty.
78
- * @param {string} placeholder
79
- */
80
- placeholder: string;
81
- /**
82
- * The minRecordsForSearch defines the minimum number of records required to display the search box.
83
- * @param {number} minRecordsForSearch
84
- */
85
- minRecordsForSearch: number;
86
- /**
87
- * The caption text to be displayed in the component.
88
- * @param {string} caption
34
+ * The list of items the user can select from.
35
+ * Each item has `id` (search/identity), `text` (display), and `value` (submitted).
89
36
  */
90
- caption: string;
37
+ items: _angular_core.InputSignal<AXComboBoxItem[]>;
91
38
  /**
92
- * The template used to customize the rendering of items.
93
- * @param {TemplateRef<any>} itemTemplate
39
+ * Whether the combo box renders an editable input with typeahead filtering (`true`)
40
+ * or a non-editable, select-like trigger (`false`).
94
41
  */
95
- itemTemplate: TemplateRef<any>;
42
+ editable: _angular_core.InputSignal<boolean>;
96
43
  /**
97
- * The template used to customize the rendering of selected items.
98
- * @param {TemplateRef<any>} selectedTemplate
44
+ * The placeholder text shown when no value is selected.
99
45
  */
100
- selectedTemplate: TemplateRef<any>;
46
+ placeholder: _angular_core.InputSignal<string>;
101
47
  /**
102
- * The template used to display when there are no items.
103
- * @param {TemplateRef<any>} emptyTemplate
48
+ * Whether the combo box is disabled.
104
49
  */
105
- emptyTemplate: TemplateRef<any>;
50
+ disabled: _angular_core.ModelSignal<boolean>;
106
51
  /**
107
- * The template used to display while loading.
108
- * @param {TemplateRef<any>} loadingTemplate
52
+ * Whether the combo box is readonly.
109
53
  */
110
- loadingTemplate: TemplateRef<any>;
54
+ readonly: _angular_core.ModelSignal<boolean>;
111
55
  /**
112
- * The width of the dropdown in pixels.
113
- * @defaultValue null
56
+ * Predefined look scheme of the editor container. Same looks as other editor components like ax-text-box.
114
57
  */
115
- dropdownWidth: _angular_core.InputSignal<string>;
116
- /** @ignore */
117
- panel: ElementRef<HTMLDivElement>;
118
- /** @ignore */
119
- list: AXListComponent;
120
- /** @ignore */
121
- searchBox: AXSearchBoxComponent;
122
- searchBoxAutoFocus: _angular_core.InputSignal<boolean>;
123
- /** @ignore */
124
- protected dropdown: AXDropdownBoxComponent;
58
+ look: _angular_core.ModelSignal<AXStyleLookType>;
125
59
  /**
126
- * Service for managing selection data, injected via `AX_SELECTION_DATA_TOKEN`.
60
+ * The selected item's `value`. Supports two-way binding.
127
61
  */
128
- selectionService: MXSelectionBridgeService;
129
- searchEvent: Observable<any>;
130
- /** @ignore */
131
- private _unsubscriber;
132
- /** @ignore */
133
- protected ngOnInit(): void;
62
+ value: _angular_core.ModelSignal<string | number>;
134
63
  /**
135
- * Proactively fetches item data if the component has a value but no corresponding item data.
136
- * This prevents showing "loading..." when the component has a value.
64
+ * Emitted when the selected value changes.
137
65
  */
138
- private fetchItemDataIfNeeded;
139
- /** @ignore */
140
- ngOnDestroy(): void;
66
+ onValueChanged: _angular_core.OutputEmitterRef<AXValueChangedEvent<string | number>>;
141
67
  /**
142
- * Retrieves an item by its key.
143
- * @param {any} key
68
+ * Emitted when the popup list opens.
144
69
  */
145
- getItemByKey(key: any): Promise<any> | any;
146
- /** @ignore */
147
- protected _handleOnOpenedEvent(e: AXEvent): void;
148
- /** @ignore */
149
- protected _handleOnClosedEvent(e: AXEvent): void;
150
- /** @ignore */
151
- protected _handleFocus(): void;
70
+ onOpened: _angular_core.OutputEmitterRef<AXEvent>;
152
71
  /**
153
- * Scroll (and focus when there is no search autofocus) to the selected item once the list is ready.
154
- * @ignore
72
+ * Emitted when the popup list closes.
155
73
  */
156
- private scheduleRevealSelected;
157
- /** @ignore */
158
- protected _handleBadgeRemove(e: MouseEvent, item: any): void;
159
- /** @ignore */
160
- protected _handleValueChanged(e: AXValueChangedEvent): void;
161
- /** @ignore */
162
- protected _handleItemClick(e: AXItemClickEvent): void;
163
- /** @ignore */
164
- protected _handleItemSelected(e: AXItemSelectedEvent): void;
165
- private resetSearchAfterSelection;
166
- /** @ignore */
167
- private setDropdownSize;
74
+ onClosed: _angular_core.OutputEmitterRef<AXEvent>;
75
+ /** Whether the popup is expanded. */
76
+ protected expanded: _angular_core.WritableSignal<boolean>;
77
+ /** The item whose `value` matches the current model value. */
78
+ protected selectedItem: _angular_core.Signal<AXComboBoxItem>;
79
+ /** Display text shown in the trigger / used as the editable input baseline. */
80
+ protected displayText: _angular_core.Signal<string>;
81
+ /** The text typed in the editable input. Resets to the selected item's text. */
82
+ protected searchText: _angular_core.WritableSignal<string>;
83
+ /** The listbox selection (item ids), kept in sync with the selected value. */
84
+ protected selection: _angular_core.WritableSignal<string[]>;
85
+ /** Items filtered by typed query against `id` when the combo box is editable. */
86
+ protected filteredItems: _angular_core.Signal<AXComboBoxItem[]>;
87
+ protected comboboxRef: _angular_core.Signal<Combobox>;
88
+ protected listboxRef: _angular_core.Signal<Listbox<any>>;
89
+ protected popoverRef: _angular_core.Signal<AXPopoverComponent>;
90
+ constructor();
168
91
  /**
169
- * Shrinks list height to the visible overlay area so virtual scroll ends on fully
170
- * visible rows instead of inside an overflow:hidden clipped region.
171
- * @ignore
92
+ * Opens (editable) or toggles (non-editable) the popup on trigger click.
172
93
  */
173
- private _fitListHeightToAvailableSpace;
174
- private updateDropdownPosition;
175
- private updateDropdownSize;
176
- private _fitDropdownToContent;
177
- internalValueChanged(value: any): void;
178
- /** @ignore */
179
- _handleKeydown(e: KeyboardEvent): void;
180
- /** @ignore */
181
- private selectItemByNav;
94
+ protected onTriggerClick(): void;
182
95
  /**
183
- * Filters the data source based on the provided search term.
184
- * @param {string} term
96
+ * Keeps the combobox expanded state in sync when the popover closes (e.g. click outside).
185
97
  */
186
- search(term: string): void;
98
+ protected onPopoverClosed(): void;
187
99
  /**
188
- * Refreshes the component by resetting state, clearing selection cache, refreshing the list, and closing the component.
100
+ * Commits the current listbox selection as the component value and closes the popup.
189
101
  */
190
- refresh(): void;
191
- hostClickListener(): void;
102
+ protected commit(): void;
192
103
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXComboBoxComponent, never>;
193
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXComboBoxComponent, "ax-combo-box", never, { "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "minValue": { "alias": "minValue"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "value": { "alias": "value"; "required": false; }; "state": { "alias": "state"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": false; }; "look": { "alias": "look"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "maxVisibleItems": { "alias": "maxVisibleItems"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "minRecordsForSearch": { "alias": "minRecordsForSearch"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "selectedTemplate": { "alias": "selectedTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "dropdownWidth": { "alias": "dropdownWidth"; "required": false; "isSignal": true; }; "searchBoxAutoFocus": { "alias": "searchBoxAutoFocus"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "stateChange": "stateChange"; "onValueChanged": "onValueChanged"; "onBlur": "onBlur"; "onFocus": "onFocus"; "readonlyChange": "readonlyChange"; "disabledChange": "disabledChange"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onItemSelected": "onItemSelected"; "onItemClick": "onItemClick"; }, ["searchBox"], ["ax-prefix", "ax-clear-button", "ax-suffix", "ax-search-box", "ax-footer", "ax-validation-rule"], true, never>;
104
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXComboBoxComponent, "ax-combo-box", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "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; }; }, { "disabled": "disabledChange"; "readonly": "readonlyChange"; "look": "lookChange"; "value": "valueChange"; "onValueChanged": "onValueChanged"; "onOpened": "onOpened"; "onClosed": "onClosed"; }, never, ["ax-prefix", "ax-suffix"], true, never>;
194
105
  }
195
106
 
196
107
  declare class AXComboBoxModule {
197
108
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXComboBoxModule, never>;
198
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXComboBoxModule, never, [typeof i1.CommonModule, typeof i2.AXCommonModule, typeof i3.FormsModule, typeof i4.AXCheckBoxModule, typeof i5.AXBadgeModule, typeof i6.AXDecoratorModule, typeof i7.AXTranslationModule, typeof i8.AXPopoverModule, typeof i9.AXLoadingModule, typeof i10.A11yModule, typeof i11.AXTextBoxModule, typeof i12.AXDropdownModule, typeof i13.AXListModule, typeof AXComboBoxComponent], [typeof AXComboBoxComponent]>;
109
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXComboBoxModule, never, [typeof AXComboBoxComponent], [typeof AXComboBoxComponent]>;
199
110
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXComboBoxModule>;
200
111
  }
201
112
 
202
113
  export { AXComboBoxComponent, AXComboBoxModule };
114
+ export type { AXComboBoxItem };