@acorex/components 22.0.0-next.9 → 22.1.0-next.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 +31 -0
- 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-calendar.mjs +10 -12
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-combo-box.mjs +460 -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-BuNEjswI.mjs} +2 -2
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs.map → acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +2034 -7467
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +135 -45
- 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 +19 -3
- 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 +2 -2
- 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-grid-layout-builder.mjs +238 -36
- package/fesm2022/acorex-components-grid-layout-builder.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 +1839 -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 +231 -74
- 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-number-box.mjs +30 -29
- package/fesm2022/acorex-components-number-box.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 +12 -22
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +15 -4
- package/fesm2022/acorex-components-select-box.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/lookup/README.md +52 -0
- package/package.json +11 -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 +204 -0
- package/types/acorex-components-conversation.d.ts +317 -94
- package/types/acorex-components-data-table.d.ts +35 -3
- 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-lookup.d.ts +624 -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 +4 -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 +8 -2
- package/types/acorex-components-toast.d.ts +10 -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
|
@@ -0,0 +1,1839 @@
|
|
|
1
|
+
import { AXListDataSource, AXDataSource, NXComponent, convertArrayToDataSource, AXComponent, AXClearableComponent, AXClosableComponent } from '@acorex/cdk/common';
|
|
2
|
+
import * as i1$1 from '@acorex/components/decorators';
|
|
3
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
4
|
+
import { AXPopoverComponent } from '@acorex/components/popover';
|
|
5
|
+
import { AXPlatform } from '@acorex/core/platform';
|
|
6
|
+
import { AXTranslatorPipe } from '@acorex/core/translation';
|
|
7
|
+
import { NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
8
|
+
import * as i0 from '@angular/core';
|
|
9
|
+
import { input, output, signal, computed, viewChild, viewChildren, inject, NgZone, effect, untracked, Directive, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, DestroyRef, model, linkedSignal, NgModule } from '@angular/core';
|
|
10
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
+
import * as i3 from '@acorex/cdk/list-navigation';
|
|
12
|
+
import { AXListNavigationDirective, AXListNavigationItemDirective, AXListNavigationModule } from '@acorex/cdk/list-navigation';
|
|
13
|
+
import * as i1 from '@angular/cdk/scrolling';
|
|
14
|
+
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
15
|
+
import { AXTreeViewComponent } from '@acorex/components/tree-view';
|
|
16
|
+
import { AXDataTableComponent, AXDataTableTextColumnComponent } from '@acorex/components/data-table';
|
|
17
|
+
import { fromEvent, auditTime } from 'rxjs';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Shared `AXDataSource` + CDK virtual scroll plumbing for the list-based lookup views
|
|
21
|
+
* (`ax-lookup-drop-down-list`, `ax-lookup-multi-select`).
|
|
22
|
+
*/
|
|
23
|
+
class AXLookupListViewBase {
|
|
24
|
+
#ngZone;
|
|
25
|
+
constructor() {
|
|
26
|
+
/**
|
|
27
|
+
* The datasource providing the items (paged, remote-capable).
|
|
28
|
+
*/
|
|
29
|
+
this.dataSource = input.required(/* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/**
|
|
32
|
+
* The item property used as the selection value.
|
|
33
|
+
*/
|
|
34
|
+
this.valueField = input('id', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
36
|
+
/**
|
|
37
|
+
* The item property used as the display text.
|
|
38
|
+
*/
|
|
39
|
+
this.textField = input('text', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/**
|
|
42
|
+
* The item property marking an item as disabled.
|
|
43
|
+
*/
|
|
44
|
+
this.disabledField = input('disabled', /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "disabledField" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/**
|
|
47
|
+
* Currently selected values (always an array, even for single selection).
|
|
48
|
+
*/
|
|
49
|
+
this.selectedValues = input([], /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
51
|
+
/**
|
|
52
|
+
* The fixed row height in pixels used by the virtual scroll viewport.
|
|
53
|
+
*/
|
|
54
|
+
this.itemHeight = input(40, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "itemHeight" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/**
|
|
57
|
+
* The maximum number of rows visible before the popup scrolls.
|
|
58
|
+
*/
|
|
59
|
+
this.maxVisibleItems = input(8, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "maxVisibleItems" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/**
|
|
62
|
+
* Custom template rendered for each item. Context: `$implicit` is the item.
|
|
63
|
+
*/
|
|
64
|
+
this.itemTemplate = input(undefined, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
66
|
+
/**
|
|
67
|
+
* Custom template rendered when the datasource has no items.
|
|
68
|
+
*/
|
|
69
|
+
this.emptyTemplate = input(undefined, /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
71
|
+
/**
|
|
72
|
+
* Custom template rendered for rows whose page is still loading.
|
|
73
|
+
*/
|
|
74
|
+
this.loadingTemplate = input(undefined, /* @ts-ignore */
|
|
75
|
+
...(ngDevMode ? [{ debugName: "loadingTemplate" }] : /* istanbul ignore next */ []));
|
|
76
|
+
/**
|
|
77
|
+
* When `true`, list rows use alternating background colors for easier scanning.
|
|
78
|
+
*/
|
|
79
|
+
this.alternate = input(false, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "alternate" }] : /* istanbul ignore next */ []));
|
|
81
|
+
/**
|
|
82
|
+
* Emitted when the user picks (or toggles) an item.
|
|
83
|
+
*/
|
|
84
|
+
this.itemClick = output();
|
|
85
|
+
/**
|
|
86
|
+
* Emitted when keyboard navigation should leave the list (e.g. ArrowUp on the first
|
|
87
|
+
* item, or a printable key that should return focus to the trigger search input).
|
|
88
|
+
*/
|
|
89
|
+
this.navigateOut = output();
|
|
90
|
+
/** CDK virtual scroll adapter over the datasource. */
|
|
91
|
+
this.listDataSource = signal(null, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "listDataSource" }] : /* istanbul ignore next */ []));
|
|
93
|
+
this.totalCount = signal(0, /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "totalCount" }] : /* istanbul ignore next */ []));
|
|
95
|
+
this.isLoading = signal(true, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
97
|
+
this.isEmpty = computed(() => this.totalCount() === 0 && !this.isLoading(), /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
99
|
+
/** Viewport height so the popup grows with the items up to `maxVisibleItems`. */
|
|
100
|
+
this.viewportHeight = computed(() => {
|
|
101
|
+
const count = this.totalCount() || (this.isLoading() ? 3 : 1);
|
|
102
|
+
return Math.min(count, this.maxVisibleItems()) * this.itemHeight();
|
|
103
|
+
}, /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []));
|
|
105
|
+
this.viewportRef = viewChild(CdkVirtualScrollViewport, /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "viewportRef" }] : /* istanbul ignore next */ []));
|
|
107
|
+
this.listNavigation = viewChild(AXListNavigationDirective, /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "listNavigation" }] : /* istanbul ignore next */ []));
|
|
109
|
+
this.navItems = viewChildren(AXListNavigationItemDirective, /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []));
|
|
111
|
+
this.#ngZone = inject(NgZone);
|
|
112
|
+
this.trackByIndex = (index) => index;
|
|
113
|
+
// CDK measures the viewport size only once, when it initializes. Inside the popover the
|
|
114
|
+
// panel is still animating/positioning at that moment (and the height also changes when
|
|
115
|
+
// the loading placeholder is replaced by the real item count), so the measurement is stale
|
|
116
|
+
// and CDK renders too few rows, leaving empty space. A ResizeObserver on the viewport
|
|
117
|
+
// element re-measures on every actual size change, covering all of these cases.
|
|
118
|
+
effect((onCleanup) => {
|
|
119
|
+
const viewport = this.viewportRef();
|
|
120
|
+
if (!viewport || typeof ResizeObserver === 'undefined') {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const observer = new ResizeObserver(() => {
|
|
124
|
+
this.#ngZone.run(() => viewport.checkViewportSize());
|
|
125
|
+
});
|
|
126
|
+
observer.observe(viewport.elementRef.nativeElement);
|
|
127
|
+
onCleanup(() => observer.disconnect());
|
|
128
|
+
});
|
|
129
|
+
effect((onCleanup) => {
|
|
130
|
+
const source = this.dataSource();
|
|
131
|
+
const list = new AXListDataSource({ source });
|
|
132
|
+
untracked(() => {
|
|
133
|
+
this.totalCount.set(source.totalCount);
|
|
134
|
+
this.isLoading.set(source.totalCount > 0 ? source.isLoading : true);
|
|
135
|
+
this.listDataSource.set(list);
|
|
136
|
+
});
|
|
137
|
+
const loadingSub = source.onLoadingChanged.subscribe((value) => this.isLoading.set(value));
|
|
138
|
+
const changedSub = source.onChanged.subscribe((e) => this.totalCount.set(e.totalCount));
|
|
139
|
+
onCleanup(() => {
|
|
140
|
+
loadingSub.unsubscribe();
|
|
141
|
+
changedSub.unsubscribe();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/** Moves keyboard focus to the first rendered list option. */
|
|
146
|
+
focusFirst() {
|
|
147
|
+
this.listNavigation()?.focusOnIndex(0);
|
|
148
|
+
}
|
|
149
|
+
getValue(item) {
|
|
150
|
+
return item?.[this.valueField()];
|
|
151
|
+
}
|
|
152
|
+
getText(item) {
|
|
153
|
+
return String(item?.[this.textField()] ?? '');
|
|
154
|
+
}
|
|
155
|
+
isSelected(item) {
|
|
156
|
+
const value = this.getValue(item);
|
|
157
|
+
return this.selectedValues().some((v) => v == value);
|
|
158
|
+
}
|
|
159
|
+
isDisabled(item) {
|
|
160
|
+
return Boolean(item?.[this.disabledField()]);
|
|
161
|
+
}
|
|
162
|
+
handleItemClick(item) {
|
|
163
|
+
if (!item || this.isDisabled(item)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this.itemClick.emit({ item, value: this.getValue(item) });
|
|
167
|
+
}
|
|
168
|
+
handleItemKeypress(e, item) {
|
|
169
|
+
if (e.nativeEvent.key === 'Enter' || e.nativeEvent.code === 'Space') {
|
|
170
|
+
e.nativeEvent.stopPropagation();
|
|
171
|
+
e.nativeEvent.preventDefault();
|
|
172
|
+
this.handleItemClick(item);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
handleListKeypress(e) {
|
|
176
|
+
const key = e.nativeEvent.key;
|
|
177
|
+
const nav = this.listNavigation();
|
|
178
|
+
const viewport = this.viewportRef();
|
|
179
|
+
if (key === 'ArrowUp' && nav && nav.activeIndex() === 0) {
|
|
180
|
+
const offset = viewport?.measureScrollOffset() ?? 0;
|
|
181
|
+
if (offset > 0) {
|
|
182
|
+
e.nativeEvent.preventDefault();
|
|
183
|
+
viewport.scrollToOffset(Math.max(0, offset - this.itemHeight()));
|
|
184
|
+
queueMicrotask(() => nav.focusOnIndex(0));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
e.nativeEvent.preventDefault();
|
|
188
|
+
this.navigateOut.emit('up');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (key === 'ArrowDown' && nav && viewport) {
|
|
192
|
+
const items = this.navItems();
|
|
193
|
+
if (items.length > 0 && nav.activeIndex() >= items.length - 1) {
|
|
194
|
+
const maxOffset = Math.max(0, this.totalCount() * this.itemHeight() - viewport.getViewportSize());
|
|
195
|
+
const nextOffset = Math.min(maxOffset, viewport.measureScrollOffset() + this.itemHeight());
|
|
196
|
+
if (nextOffset > viewport.measureScrollOffset()) {
|
|
197
|
+
e.nativeEvent.preventDefault();
|
|
198
|
+
viewport.scrollToOffset(nextOffset);
|
|
199
|
+
queueMicrotask(() => nav.focusOnIndex(this.navItems().length - 1));
|
|
200
|
+
}
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (key === 'ArrowUp' ||
|
|
205
|
+
key === 'ArrowDown' ||
|
|
206
|
+
key === 'Tab' ||
|
|
207
|
+
key === 'Shift' ||
|
|
208
|
+
key === 'Enter' ||
|
|
209
|
+
key === 'Escape' ||
|
|
210
|
+
key === ' ') {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.navigateOut.emit('typeahead');
|
|
214
|
+
}
|
|
215
|
+
activateNavItem(nav, item) {
|
|
216
|
+
nav?.navigateTo(item);
|
|
217
|
+
}
|
|
218
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupListViewBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
219
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.8", type: AXLookupListViewBase, isStandalone: true, inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleItems: { classPropertyName: "maxVisibleItems", publicName: "maxVisibleItems", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, loadingTemplate: { classPropertyName: "loadingTemplate", publicName: "loadingTemplate", isSignal: true, isRequired: false, transformFunction: null }, alternate: { classPropertyName: "alternate", publicName: "alternate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", navigateOut: "navigateOut" }, viewQueries: [{ propertyName: "viewportRef", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }, { propertyName: "listNavigation", first: true, predicate: AXListNavigationDirective, descendants: true, isSignal: true }, { propertyName: "navItems", predicate: AXListNavigationItemDirective, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
220
|
+
}
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupListViewBase, decorators: [{
|
|
222
|
+
type: Directive
|
|
223
|
+
}], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }], itemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemHeight", required: false }] }], maxVisibleItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleItems", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], loadingTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTemplate", required: false }] }], alternate: [{ type: i0.Input, args: [{ isSignal: true, alias: "alternate", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], navigateOut: [{ type: i0.Output, args: ["navigateOut"] }], viewportRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], listNavigation: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXListNavigationDirective), { isSignal: true }] }], navItems: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => AXListNavigationItemDirective), { isSignal: true }] }] } });
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Internal mini component for the `drop-down-list` lookup mode:
|
|
227
|
+
* a predefined, virtualized list of options for picking single values.
|
|
228
|
+
*
|
|
229
|
+
* @category Components
|
|
230
|
+
*/
|
|
231
|
+
class AXLookupDropDownListComponent extends AXLookupListViewBase {
|
|
232
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupDropDownListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
233
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXLookupDropDownListComponent, isStandalone: true, selector: "ax-lookup-drop-down-list", providers: [{ provide: AXLookupListViewBase, useExisting: AXLookupDropDownListComponent }], usesInheritance: true, ngImport: i0, template: `
|
|
234
|
+
@if (isEmpty()) {
|
|
235
|
+
@if (emptyTemplate()) {
|
|
236
|
+
<ng-container [ngTemplateOutlet]="emptyTemplate()!" />
|
|
237
|
+
} @else {
|
|
238
|
+
<div class="ax-lookup-empty">
|
|
239
|
+
{{ '@acorex:common.general.no-result-found' | translate | async }}
|
|
240
|
+
</div>
|
|
241
|
+
}
|
|
242
|
+
} @else {
|
|
243
|
+
<cdk-virtual-scroll-viewport
|
|
244
|
+
class="ax-lookup-viewport"
|
|
245
|
+
role="listbox"
|
|
246
|
+
axListNavigation
|
|
247
|
+
#nav="axListNavigation"
|
|
248
|
+
[itemSize]="itemHeight()"
|
|
249
|
+
[style.height.px]="viewportHeight()"
|
|
250
|
+
(onKeypress)="handleListKeypress($event)"
|
|
251
|
+
>
|
|
252
|
+
<div
|
|
253
|
+
*cdkVirtualFor="let item of listDataSource(); let i = index; trackBy: trackByIndex"
|
|
254
|
+
role="option"
|
|
255
|
+
class="ax-lookup-option-host"
|
|
256
|
+
axListNavigationItem
|
|
257
|
+
#navItem="axListNavigationItem"
|
|
258
|
+
[style.height.px]="itemHeight()"
|
|
259
|
+
[class.ax-lookup-option]="!itemTemplate()"
|
|
260
|
+
[class.ax-state-alternate]="alternate() && i % 2 === 1"
|
|
261
|
+
[class.ax-state-selected]="item != null && isSelected(item)"
|
|
262
|
+
[class.ax-state-disabled]="item != null && isDisabled(item)"
|
|
263
|
+
[class.ax-state-active]="navItem.isActive()"
|
|
264
|
+
[attr.aria-selected]="item != null ? isSelected(item) : null"
|
|
265
|
+
(mouseenter)="activateNavItem(nav, navItem)"
|
|
266
|
+
(click)="handleItemClick(item)"
|
|
267
|
+
(onKeypress)="handleItemKeypress($event, item)"
|
|
268
|
+
>
|
|
269
|
+
@if (item != null) {
|
|
270
|
+
@if (itemTemplate()) {
|
|
271
|
+
<ng-container [ngTemplateOutlet]="itemTemplate()!" [ngTemplateOutletContext]="{ $implicit: item }" />
|
|
272
|
+
} @else {
|
|
273
|
+
<span class="ax-lookup-option-text">{{ getText(item) }}</span>
|
|
274
|
+
@if (isSelected(item)) {
|
|
275
|
+
<ax-icon class="ax-lookup-option-check ax-icon ax-icon-check" aria-hidden="true"></ax-icon>
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} @else {
|
|
279
|
+
<ng-container [ngTemplateOutlet]="loadingRow" />
|
|
280
|
+
}
|
|
281
|
+
</div>
|
|
282
|
+
</cdk-virtual-scroll-viewport>
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
<ng-template #loadingRow>
|
|
286
|
+
@if (loadingTemplate()) {
|
|
287
|
+
<ng-container [ngTemplateOutlet]="loadingTemplate()!" />
|
|
288
|
+
} @else {
|
|
289
|
+
<span class="ax-lookup-option-loading">{{ '@acorex:common.status.loading' | translate | async }}</span>
|
|
290
|
+
}
|
|
291
|
+
</ng-template>
|
|
292
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXListNavigationModule }, { kind: "directive", type: i3.AXListNavigationDirective, selector: "[axListNavigation]", inputs: ["orientation"], outputs: ["onNavigationChanged", "onKeypress"], exportAs: ["axListNavigation"] }, { kind: "directive", type: i3.AXListNavigationItemDirective, selector: "[axListNavigationItem]", outputs: ["onKeypress"], exportAs: ["axListNavigationItem"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
293
|
+
}
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupDropDownListComponent, decorators: [{
|
|
295
|
+
type: Component,
|
|
296
|
+
args: [{
|
|
297
|
+
selector: 'ax-lookup-drop-down-list',
|
|
298
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
299
|
+
encapsulation: ViewEncapsulation.None,
|
|
300
|
+
imports: [
|
|
301
|
+
ScrollingModule,
|
|
302
|
+
NgTemplateOutlet,
|
|
303
|
+
AXTranslatorPipe,
|
|
304
|
+
AsyncPipe,
|
|
305
|
+
AXDecoratorModule,
|
|
306
|
+
AXListNavigationModule,
|
|
307
|
+
],
|
|
308
|
+
providers: [{ provide: AXLookupListViewBase, useExisting: AXLookupDropDownListComponent }],
|
|
309
|
+
template: `
|
|
310
|
+
@if (isEmpty()) {
|
|
311
|
+
@if (emptyTemplate()) {
|
|
312
|
+
<ng-container [ngTemplateOutlet]="emptyTemplate()!" />
|
|
313
|
+
} @else {
|
|
314
|
+
<div class="ax-lookup-empty">
|
|
315
|
+
{{ '@acorex:common.general.no-result-found' | translate | async }}
|
|
316
|
+
</div>
|
|
317
|
+
}
|
|
318
|
+
} @else {
|
|
319
|
+
<cdk-virtual-scroll-viewport
|
|
320
|
+
class="ax-lookup-viewport"
|
|
321
|
+
role="listbox"
|
|
322
|
+
axListNavigation
|
|
323
|
+
#nav="axListNavigation"
|
|
324
|
+
[itemSize]="itemHeight()"
|
|
325
|
+
[style.height.px]="viewportHeight()"
|
|
326
|
+
(onKeypress)="handleListKeypress($event)"
|
|
327
|
+
>
|
|
328
|
+
<div
|
|
329
|
+
*cdkVirtualFor="let item of listDataSource(); let i = index; trackBy: trackByIndex"
|
|
330
|
+
role="option"
|
|
331
|
+
class="ax-lookup-option-host"
|
|
332
|
+
axListNavigationItem
|
|
333
|
+
#navItem="axListNavigationItem"
|
|
334
|
+
[style.height.px]="itemHeight()"
|
|
335
|
+
[class.ax-lookup-option]="!itemTemplate()"
|
|
336
|
+
[class.ax-state-alternate]="alternate() && i % 2 === 1"
|
|
337
|
+
[class.ax-state-selected]="item != null && isSelected(item)"
|
|
338
|
+
[class.ax-state-disabled]="item != null && isDisabled(item)"
|
|
339
|
+
[class.ax-state-active]="navItem.isActive()"
|
|
340
|
+
[attr.aria-selected]="item != null ? isSelected(item) : null"
|
|
341
|
+
(mouseenter)="activateNavItem(nav, navItem)"
|
|
342
|
+
(click)="handleItemClick(item)"
|
|
343
|
+
(onKeypress)="handleItemKeypress($event, item)"
|
|
344
|
+
>
|
|
345
|
+
@if (item != null) {
|
|
346
|
+
@if (itemTemplate()) {
|
|
347
|
+
<ng-container [ngTemplateOutlet]="itemTemplate()!" [ngTemplateOutletContext]="{ $implicit: item }" />
|
|
348
|
+
} @else {
|
|
349
|
+
<span class="ax-lookup-option-text">{{ getText(item) }}</span>
|
|
350
|
+
@if (isSelected(item)) {
|
|
351
|
+
<ax-icon class="ax-lookup-option-check ax-icon ax-icon-check" aria-hidden="true"></ax-icon>
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
} @else {
|
|
355
|
+
<ng-container [ngTemplateOutlet]="loadingRow" />
|
|
356
|
+
}
|
|
357
|
+
</div>
|
|
358
|
+
</cdk-virtual-scroll-viewport>
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
<ng-template #loadingRow>
|
|
362
|
+
@if (loadingTemplate()) {
|
|
363
|
+
<ng-container [ngTemplateOutlet]="loadingTemplate()!" />
|
|
364
|
+
} @else {
|
|
365
|
+
<span class="ax-lookup-option-loading">{{ '@acorex:common.status.loading' | translate | async }}</span>
|
|
366
|
+
}
|
|
367
|
+
</ng-template>
|
|
368
|
+
`,
|
|
369
|
+
}]
|
|
370
|
+
}] });
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Internal mini component for the `drop-down-tree` lookup mode:
|
|
374
|
+
* a predefined list rendered in a tree-like structure for single item selection.
|
|
375
|
+
*
|
|
376
|
+
* @category Components
|
|
377
|
+
*/
|
|
378
|
+
class AXLookupDropDownTreeComponent {
|
|
379
|
+
constructor() {
|
|
380
|
+
/**
|
|
381
|
+
* The tree datasource: an array of nodes or a lazy children callback.
|
|
382
|
+
*/
|
|
383
|
+
this.dataSource = input.required(/* @ts-ignore */
|
|
384
|
+
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
385
|
+
/**
|
|
386
|
+
* The node property used as the selection value (tree `idField`).
|
|
387
|
+
*/
|
|
388
|
+
this.valueField = input('id', /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
390
|
+
/**
|
|
391
|
+
* The node property used as the display text (tree `titleField`).
|
|
392
|
+
*/
|
|
393
|
+
this.textField = input('title', /* @ts-ignore */
|
|
394
|
+
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
395
|
+
/**
|
|
396
|
+
* The node property marking a node as disabled.
|
|
397
|
+
*/
|
|
398
|
+
this.disabledField = input('disabled', /* @ts-ignore */
|
|
399
|
+
...(ngDevMode ? [{ debugName: "disabledField" }] : /* istanbul ignore next */ []));
|
|
400
|
+
/**
|
|
401
|
+
* Currently selected values (at most one for single selection).
|
|
402
|
+
*/
|
|
403
|
+
this.selectedValues = input([], /* @ts-ignore */
|
|
404
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
405
|
+
/**
|
|
406
|
+
* Custom template rendered for each tree node.
|
|
407
|
+
*/
|
|
408
|
+
this.nodeTemplate = input(undefined, /* @ts-ignore */
|
|
409
|
+
...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
|
|
410
|
+
/**
|
|
411
|
+
* Emitted when the user selects a node.
|
|
412
|
+
*/
|
|
413
|
+
this.itemClick = output();
|
|
414
|
+
this.selectedIds = computed(() => this.selectedValues().map((v) => String(v)), /* @ts-ignore */
|
|
415
|
+
...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
416
|
+
}
|
|
417
|
+
handleSelectionChange(e) {
|
|
418
|
+
if (e.source !== 'user') {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
const node = e.selectedNodes[0];
|
|
422
|
+
if (!node) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
this.itemClick.emit({ item: node, value: node[this.valueField()] });
|
|
426
|
+
}
|
|
427
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupDropDownTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
428
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXLookupDropDownTreeComponent, isStandalone: true, selector: "ax-lookup-drop-down-tree", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, ngImport: i0, template: `
|
|
429
|
+
<div class="ax-lookup-tree">
|
|
430
|
+
<ax-tree-view
|
|
431
|
+
[datasource]="dataSource()"
|
|
432
|
+
selectMode="single"
|
|
433
|
+
selectionBehavior="all"
|
|
434
|
+
[controlledSelection]="true"
|
|
435
|
+
[selectedIds]="selectedIds()"
|
|
436
|
+
[idField]="valueField()"
|
|
437
|
+
[titleField]="textField()"
|
|
438
|
+
[disabledField]="disabledField()"
|
|
439
|
+
[nodeTemplate]="nodeTemplate()"
|
|
440
|
+
(onSelectionChange)="handleSelectionChange($event)"
|
|
441
|
+
/>
|
|
442
|
+
</div>
|
|
443
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay", "controlledSelection", "selectedIds"], outputs: ["datasourceChange", "selectedIdsChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
444
|
+
}
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupDropDownTreeComponent, decorators: [{
|
|
446
|
+
type: Component,
|
|
447
|
+
args: [{
|
|
448
|
+
selector: 'ax-lookup-drop-down-tree',
|
|
449
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
450
|
+
encapsulation: ViewEncapsulation.None,
|
|
451
|
+
imports: [AXTreeViewComponent],
|
|
452
|
+
template: `
|
|
453
|
+
<div class="ax-lookup-tree">
|
|
454
|
+
<ax-tree-view
|
|
455
|
+
[datasource]="dataSource()"
|
|
456
|
+
selectMode="single"
|
|
457
|
+
selectionBehavior="all"
|
|
458
|
+
[controlledSelection]="true"
|
|
459
|
+
[selectedIds]="selectedIds()"
|
|
460
|
+
[idField]="valueField()"
|
|
461
|
+
[titleField]="textField()"
|
|
462
|
+
[disabledField]="disabledField()"
|
|
463
|
+
[nodeTemplate]="nodeTemplate()"
|
|
464
|
+
(onSelectionChange)="handleSelectionChange($event)"
|
|
465
|
+
/>
|
|
466
|
+
</div>
|
|
467
|
+
`,
|
|
468
|
+
}]
|
|
469
|
+
}], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }], nodeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodeTemplate", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Internal mini component for the `multi-column` lookup mode:
|
|
473
|
+
* renders selectable rows in an `ax-data-table` grid and loads further
|
|
474
|
+
* pages as the user scrolls (no pager UI).
|
|
475
|
+
*
|
|
476
|
+
* @category Components
|
|
477
|
+
*/
|
|
478
|
+
class AXLookupMultiColumnComponent {
|
|
479
|
+
/** Accumulated rows fed to the table (grows as pages are scrolled in). */
|
|
480
|
+
#loadedItems;
|
|
481
|
+
/** Total matching rows from the source (used to size the popup). */
|
|
482
|
+
#totalCount;
|
|
483
|
+
#host;
|
|
484
|
+
constructor() {
|
|
485
|
+
/**
|
|
486
|
+
* The datasource providing the grid rows (paged, remote-capable).
|
|
487
|
+
* Pages are fetched on demand as the user scrolls the table body.
|
|
488
|
+
*/
|
|
489
|
+
this.dataSource = input.required(/* @ts-ignore */
|
|
490
|
+
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
491
|
+
/**
|
|
492
|
+
* The item property used as the selection value.
|
|
493
|
+
*/
|
|
494
|
+
this.valueField = input('id', /* @ts-ignore */
|
|
495
|
+
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
496
|
+
/**
|
|
497
|
+
* The item property used as the display text.
|
|
498
|
+
*/
|
|
499
|
+
this.textField = input('text', /* @ts-ignore */
|
|
500
|
+
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
501
|
+
/**
|
|
502
|
+
* The item property marking an item as disabled.
|
|
503
|
+
*/
|
|
504
|
+
this.disabledField = input('disabled', /* @ts-ignore */
|
|
505
|
+
...(ngDevMode ? [{ debugName: "disabledField" }] : /* istanbul ignore next */ []));
|
|
506
|
+
/**
|
|
507
|
+
* Currently selected values (always an array, even for single selection).
|
|
508
|
+
*/
|
|
509
|
+
this.selectedValues = input([], /* @ts-ignore */
|
|
510
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
511
|
+
/**
|
|
512
|
+
* The fixed row height in pixels passed to the data table.
|
|
513
|
+
*/
|
|
514
|
+
this.itemHeight = input(40, /* @ts-ignore */
|
|
515
|
+
...(ngDevMode ? [{ debugName: "itemHeight" }] : /* istanbul ignore next */ []));
|
|
516
|
+
/**
|
|
517
|
+
* The maximum number of body rows visible before the table scrolls.
|
|
518
|
+
*/
|
|
519
|
+
this.maxVisibleItems = input(8, /* @ts-ignore */
|
|
520
|
+
...(ngDevMode ? [{ debugName: "maxVisibleItems" }] : /* istanbul ignore next */ []));
|
|
521
|
+
/**
|
|
522
|
+
* Column definitions rendered as `ax-text-column` instances.
|
|
523
|
+
*/
|
|
524
|
+
this.columns = input([], /* @ts-ignore */
|
|
525
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
526
|
+
/**
|
|
527
|
+
* Optional custom row content. Context: `$implicit` is the row item.
|
|
528
|
+
* When set, replaces the default multi-column cell layout.
|
|
529
|
+
*/
|
|
530
|
+
this.itemTemplate = input(undefined, /* @ts-ignore */
|
|
531
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
532
|
+
/**
|
|
533
|
+
* Custom template rendered when the datasource has no items.
|
|
534
|
+
*/
|
|
535
|
+
this.emptyTemplate = input(undefined, /* @ts-ignore */
|
|
536
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
537
|
+
/**
|
|
538
|
+
* Custom template rendered while the table is loading.
|
|
539
|
+
*/
|
|
540
|
+
this.loadingTemplate = input(undefined, /* @ts-ignore */
|
|
541
|
+
...(ngDevMode ? [{ debugName: "loadingTemplate" }] : /* istanbul ignore next */ []));
|
|
542
|
+
/**
|
|
543
|
+
* When `true`, table rows use alternating background colors for easier scanning.
|
|
544
|
+
*/
|
|
545
|
+
this.alternate = input(false, /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "alternate" }] : /* istanbul ignore next */ []));
|
|
547
|
+
/**
|
|
548
|
+
* Emitted when the user picks a row.
|
|
549
|
+
*/
|
|
550
|
+
this.itemClick = output();
|
|
551
|
+
this.tableRef = viewChild(AXDataTableComponent, /* @ts-ignore */
|
|
552
|
+
...(ngDevMode ? [{ debugName: "tableRef" }] : /* istanbul ignore next */ []));
|
|
553
|
+
/** Accumulated rows fed to the table (grows as pages are scrolled in). */
|
|
554
|
+
this.#loadedItems = [];
|
|
555
|
+
/** Total matching rows from the source (used to size the popup). */
|
|
556
|
+
this.#totalCount = signal(0, /* @ts-ignore */
|
|
557
|
+
...(ngDevMode ? [{ debugName: "#totalCount" }] : /* istanbul ignore next */ []));
|
|
558
|
+
/**
|
|
559
|
+
* Local table source: one page of whatever has been scrolled in so far.
|
|
560
|
+
* Kept as a stable instance so the table host is not recreated on each page load.
|
|
561
|
+
* `pageSize` grows with `#loadedItems` — never seed with a huge empty array (data-table
|
|
562
|
+
* initializes `displayedRows` as `new Array(pageSize)`, which caused NG0955-level jank).
|
|
563
|
+
*/
|
|
564
|
+
this.tableDataSource = new AXDataSource({
|
|
565
|
+
pageSize: 1,
|
|
566
|
+
key: 'id',
|
|
567
|
+
load: async () => ({
|
|
568
|
+
items: this.#loadedItems,
|
|
569
|
+
total: this.#loadedItems.length,
|
|
570
|
+
}),
|
|
571
|
+
});
|
|
572
|
+
/**
|
|
573
|
+
* Header (~40px) + body rows. Grows with results up to `maxVisibleItems`,
|
|
574
|
+
* then the table body scrolls for the rest.
|
|
575
|
+
*/
|
|
576
|
+
this.tableHeight = computed(() => {
|
|
577
|
+
const header = 40;
|
|
578
|
+
const total = this.#totalCount();
|
|
579
|
+
const rows = total > 0 ? total : Math.min(3, this.maxVisibleItems());
|
|
580
|
+
return header + Math.min(rows, this.maxVisibleItems()) * this.itemHeight();
|
|
581
|
+
}, /* @ts-ignore */
|
|
582
|
+
...(ngDevMode ? [{ debugName: "tableHeight" }] : /* istanbul ignore next */ []));
|
|
583
|
+
this.loadingConfig = computed(() => ({
|
|
584
|
+
enabled: true,
|
|
585
|
+
animation: true,
|
|
586
|
+
loadingTemplate: this.loadingTemplate(),
|
|
587
|
+
}), /* @ts-ignore */
|
|
588
|
+
...(ngDevMode ? [{ debugName: "loadingConfig" }] : /* istanbul ignore next */ []));
|
|
589
|
+
this.#host = inject((ElementRef));
|
|
590
|
+
this.resolveRowCssClass = (row) => {
|
|
591
|
+
const item = row;
|
|
592
|
+
if (!item) {
|
|
593
|
+
return '';
|
|
594
|
+
}
|
|
595
|
+
const classes = [];
|
|
596
|
+
if (this.isSelected(item)) {
|
|
597
|
+
classes.push('ax-state-selected');
|
|
598
|
+
}
|
|
599
|
+
if (this.isDisabled(item)) {
|
|
600
|
+
classes.push('ax-state-disabled');
|
|
601
|
+
}
|
|
602
|
+
return classes.join(' ');
|
|
603
|
+
};
|
|
604
|
+
effect((onCleanup) => {
|
|
605
|
+
const source = this.dataSource();
|
|
606
|
+
this.tableDataSource.config.key = source.config.key || this.valueField();
|
|
607
|
+
untracked(() => {
|
|
608
|
+
this.#loadedItems = [];
|
|
609
|
+
this.#totalCount.set(0);
|
|
610
|
+
this.#syncTablePageSize();
|
|
611
|
+
this.tableDataSource.refresh({ reset: true });
|
|
612
|
+
});
|
|
613
|
+
const changedSub = source.onChanged.subscribe((event) => {
|
|
614
|
+
this.#loadedItems = event.cachedItems.filter((item) => item != null);
|
|
615
|
+
this.#totalCount.set(event.totalCount);
|
|
616
|
+
this.#syncTablePageSize();
|
|
617
|
+
this.tableDataSource.refresh({ reset: true });
|
|
618
|
+
});
|
|
619
|
+
// Kick the first page; later pages come from scroll.
|
|
620
|
+
queueMicrotask(() => source.setPage(0));
|
|
621
|
+
onCleanup(() => changedSub.unsubscribe());
|
|
622
|
+
});
|
|
623
|
+
effect((onCleanup) => {
|
|
624
|
+
// Rebind when the table instance appears / source changes.
|
|
625
|
+
this.tableRef();
|
|
626
|
+
this.dataSource();
|
|
627
|
+
let scrollSub;
|
|
628
|
+
const timer = setTimeout(() => {
|
|
629
|
+
const wrapper = this.tableRef()?.getHostElement()?.querySelector('.ax-data-table-wrapper') ??
|
|
630
|
+
this.#host.nativeElement.querySelector('.ax-data-table-wrapper');
|
|
631
|
+
if (!wrapper) {
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
scrollSub = fromEvent(wrapper, 'scroll')
|
|
635
|
+
.pipe(auditTime(80))
|
|
636
|
+
.subscribe(() => this.#tryLoadMore(wrapper));
|
|
637
|
+
}, 0);
|
|
638
|
+
onCleanup(() => {
|
|
639
|
+
clearTimeout(timer);
|
|
640
|
+
scrollSub?.unsubscribe();
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
/** Stable unique key for `@for` — avoids NG0955 when `field` is missing or duplicated. */
|
|
645
|
+
trackColumnKey(index, column) {
|
|
646
|
+
return `${column?.field ?? ''}::${index}`;
|
|
647
|
+
}
|
|
648
|
+
resolveColumnWidth(column) {
|
|
649
|
+
const width = column.width?.trim();
|
|
650
|
+
if (!width || width.includes('fr')) {
|
|
651
|
+
return 'auto';
|
|
652
|
+
}
|
|
653
|
+
return width;
|
|
654
|
+
}
|
|
655
|
+
#syncTablePageSize() {
|
|
656
|
+
this.tableDataSource.config.pageSize = Math.max(this.#loadedItems.length, 1);
|
|
657
|
+
}
|
|
658
|
+
handleRowClick(event) {
|
|
659
|
+
this.handleItemClick(event.data);
|
|
660
|
+
}
|
|
661
|
+
handleItemClick(item) {
|
|
662
|
+
if (!item || this.isDisabled(item)) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
this.itemClick.emit({ item, value: this.getValue(item) });
|
|
666
|
+
}
|
|
667
|
+
isSelected(item) {
|
|
668
|
+
const value = this.getValue(item);
|
|
669
|
+
return this.selectedValues().some((v) => v == value);
|
|
670
|
+
}
|
|
671
|
+
isDisabled(item) {
|
|
672
|
+
return Boolean(item?.[this.disabledField()]);
|
|
673
|
+
}
|
|
674
|
+
#tryLoadMore(wrapper) {
|
|
675
|
+
const nearBottom = wrapper.scrollTop + wrapper.clientHeight >= wrapper.scrollHeight - 48;
|
|
676
|
+
if (!nearBottom) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const source = this.dataSource();
|
|
680
|
+
if (source.isLoading || source.totalCount === 0) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
const loadedCount = source.cachedItems.filter((item) => item != null).length;
|
|
684
|
+
if (loadedCount >= source.totalCount) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
const nextPage = Math.floor(loadedCount / source.pageSize);
|
|
688
|
+
source.setPage(nextPage);
|
|
689
|
+
}
|
|
690
|
+
getValue(item) {
|
|
691
|
+
return item?.[this.valueField()];
|
|
692
|
+
}
|
|
693
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
694
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXLookupMultiColumnComponent, isStandalone: true, selector: "ax-lookup-multi-column", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleItems: { classPropertyName: "maxVisibleItems", publicName: "maxVisibleItems", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, loadingTemplate: { classPropertyName: "loadingTemplate", publicName: "loadingTemplate", isSignal: true, isRequired: false, transformFunction: null }, alternate: { classPropertyName: "alternate", publicName: "alternate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, host: { properties: { "style.height.px": "tableHeight()" }, classAttribute: "ax-lookup-multi-column" }, viewQueries: [{ propertyName: "tableRef", first: true, predicate: AXDataTableComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
695
|
+
<ax-data-table
|
|
696
|
+
class="ax-lookup-multi-column-table"
|
|
697
|
+
look="minimal"
|
|
698
|
+
[dataSource]="tableDataSource"
|
|
699
|
+
[itemHeight]="itemHeight()"
|
|
700
|
+
[alternative]="alternate()"
|
|
701
|
+
[emptyTemplate]="emptyTemplate()"
|
|
702
|
+
[loading]="loadingConfig()"
|
|
703
|
+
[paging]="false"
|
|
704
|
+
[showHeader]="true"
|
|
705
|
+
[fixedHeader]="true"
|
|
706
|
+
[showFooter]="false"
|
|
707
|
+
[allowReordering]="false"
|
|
708
|
+
[rowTemplate]="itemTemplate() ? customRowTemplate : undefined"
|
|
709
|
+
[rowCssClass]="resolveRowCssClass"
|
|
710
|
+
(onRowClick)="handleRowClick($event)"
|
|
711
|
+
>
|
|
712
|
+
@for (column of columns(); track trackColumnKey($index, column)) {
|
|
713
|
+
<ax-text-column
|
|
714
|
+
[dataField]="column.field"
|
|
715
|
+
[caption]="column.title"
|
|
716
|
+
[width]="resolveColumnWidth(column)"
|
|
717
|
+
[allowSorting]="false"
|
|
718
|
+
[allowResizing]="false"
|
|
719
|
+
/>
|
|
720
|
+
}
|
|
721
|
+
</ax-data-table>
|
|
722
|
+
|
|
723
|
+
<ng-template #customRowTemplate let-ctx>
|
|
724
|
+
<tr
|
|
725
|
+
[class.ax-state-selected]="ctx.data != null && isSelected(ctx.data)"
|
|
726
|
+
[class.ax-state-disabled]="ctx.data != null && isDisabled(ctx.data)"
|
|
727
|
+
[style.height.px]="itemHeight()"
|
|
728
|
+
[style.max-height.px]="itemHeight()"
|
|
729
|
+
(click)="handleItemClick(ctx.data)"
|
|
730
|
+
>
|
|
731
|
+
<td [attr.colspan]="columns().length || 1">
|
|
732
|
+
@if (ctx.data != null && itemTemplate()) {
|
|
733
|
+
<ng-container
|
|
734
|
+
[ngTemplateOutlet]="itemTemplate()!"
|
|
735
|
+
[ngTemplateOutletContext]="{ $implicit: ctx.data }"
|
|
736
|
+
/>
|
|
737
|
+
}
|
|
738
|
+
</td>
|
|
739
|
+
</tr>
|
|
740
|
+
</ng-template>
|
|
741
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "hasChildrenField", "rowDetailsTemplate", "rowCssClass", "cellCssClass", "highlightText", "look", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: AXDataTableTextColumnComponent, selector: "ax-text-column", inputs: ["width", "caption", "allowSorting", "allowResizing", "fixed", "hasTitle", "customExpandIcon", "customCollapseIcon", "dataField", "expandHandler", "wrapText", "cellTemplate", "footerTemplate", "headerTemplate", "format", "formatOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
742
|
+
}
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiColumnComponent, decorators: [{
|
|
744
|
+
type: Component,
|
|
745
|
+
args: [{
|
|
746
|
+
selector: 'ax-lookup-multi-column',
|
|
747
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
748
|
+
encapsulation: ViewEncapsulation.None,
|
|
749
|
+
imports: [NgTemplateOutlet, AXDataTableComponent, AXDataTableTextColumnComponent],
|
|
750
|
+
host: {
|
|
751
|
+
class: 'ax-lookup-multi-column',
|
|
752
|
+
'[style.height.px]': 'tableHeight()',
|
|
753
|
+
},
|
|
754
|
+
template: `
|
|
755
|
+
<ax-data-table
|
|
756
|
+
class="ax-lookup-multi-column-table"
|
|
757
|
+
look="minimal"
|
|
758
|
+
[dataSource]="tableDataSource"
|
|
759
|
+
[itemHeight]="itemHeight()"
|
|
760
|
+
[alternative]="alternate()"
|
|
761
|
+
[emptyTemplate]="emptyTemplate()"
|
|
762
|
+
[loading]="loadingConfig()"
|
|
763
|
+
[paging]="false"
|
|
764
|
+
[showHeader]="true"
|
|
765
|
+
[fixedHeader]="true"
|
|
766
|
+
[showFooter]="false"
|
|
767
|
+
[allowReordering]="false"
|
|
768
|
+
[rowTemplate]="itemTemplate() ? customRowTemplate : undefined"
|
|
769
|
+
[rowCssClass]="resolveRowCssClass"
|
|
770
|
+
(onRowClick)="handleRowClick($event)"
|
|
771
|
+
>
|
|
772
|
+
@for (column of columns(); track trackColumnKey($index, column)) {
|
|
773
|
+
<ax-text-column
|
|
774
|
+
[dataField]="column.field"
|
|
775
|
+
[caption]="column.title"
|
|
776
|
+
[width]="resolveColumnWidth(column)"
|
|
777
|
+
[allowSorting]="false"
|
|
778
|
+
[allowResizing]="false"
|
|
779
|
+
/>
|
|
780
|
+
}
|
|
781
|
+
</ax-data-table>
|
|
782
|
+
|
|
783
|
+
<ng-template #customRowTemplate let-ctx>
|
|
784
|
+
<tr
|
|
785
|
+
[class.ax-state-selected]="ctx.data != null && isSelected(ctx.data)"
|
|
786
|
+
[class.ax-state-disabled]="ctx.data != null && isDisabled(ctx.data)"
|
|
787
|
+
[style.height.px]="itemHeight()"
|
|
788
|
+
[style.max-height.px]="itemHeight()"
|
|
789
|
+
(click)="handleItemClick(ctx.data)"
|
|
790
|
+
>
|
|
791
|
+
<td [attr.colspan]="columns().length || 1">
|
|
792
|
+
@if (ctx.data != null && itemTemplate()) {
|
|
793
|
+
<ng-container
|
|
794
|
+
[ngTemplateOutlet]="itemTemplate()!"
|
|
795
|
+
[ngTemplateOutletContext]="{ $implicit: ctx.data }"
|
|
796
|
+
/>
|
|
797
|
+
}
|
|
798
|
+
</td>
|
|
799
|
+
</tr>
|
|
800
|
+
</ng-template>
|
|
801
|
+
`,
|
|
802
|
+
}]
|
|
803
|
+
}], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }], itemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemHeight", required: false }] }], maxVisibleItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleItems", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], loadingTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTemplate", required: false }] }], alternate: [{ type: i0.Input, args: [{ isSignal: true, alias: "alternate", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], tableRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXDataTableComponent), { isSignal: true }] }] } });
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Internal mini component for the `multi-select-tree` lookup mode:
|
|
807
|
+
* a predefined list rendered in a tree-like structure for multiple item selection.
|
|
808
|
+
*
|
|
809
|
+
* @category Components
|
|
810
|
+
*/
|
|
811
|
+
class AXLookupMultiSelectTreeComponent {
|
|
812
|
+
constructor() {
|
|
813
|
+
/**
|
|
814
|
+
* The tree datasource: an array of nodes or a lazy children callback.
|
|
815
|
+
*/
|
|
816
|
+
this.dataSource = input.required(/* @ts-ignore */
|
|
817
|
+
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
818
|
+
/**
|
|
819
|
+
* The node property used as the selection value (tree `idField`).
|
|
820
|
+
*/
|
|
821
|
+
this.valueField = input('id', /* @ts-ignore */
|
|
822
|
+
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
823
|
+
/**
|
|
824
|
+
* The node property used as the display text (tree `titleField`).
|
|
825
|
+
*/
|
|
826
|
+
this.textField = input('title', /* @ts-ignore */
|
|
827
|
+
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
828
|
+
/**
|
|
829
|
+
* The node property marking a node as disabled.
|
|
830
|
+
*/
|
|
831
|
+
this.disabledField = input('disabled', /* @ts-ignore */
|
|
832
|
+
...(ngDevMode ? [{ debugName: "disabledField" }] : /* istanbul ignore next */ []));
|
|
833
|
+
/**
|
|
834
|
+
* Currently selected values.
|
|
835
|
+
*/
|
|
836
|
+
this.selectedValues = input([], /* @ts-ignore */
|
|
837
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
838
|
+
/**
|
|
839
|
+
* How selecting parent/child nodes affects each other. Passed through to the tree-view.
|
|
840
|
+
*/
|
|
841
|
+
this.selectionBehavior = input('all', /* @ts-ignore */
|
|
842
|
+
...(ngDevMode ? [{ debugName: "selectionBehavior" }] : /* istanbul ignore next */ []));
|
|
843
|
+
/**
|
|
844
|
+
* Custom template rendered for each tree node.
|
|
845
|
+
*/
|
|
846
|
+
this.nodeTemplate = input(undefined, /* @ts-ignore */
|
|
847
|
+
...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
|
|
848
|
+
/**
|
|
849
|
+
* Emitted when the user changes the tree selection.
|
|
850
|
+
*/
|
|
851
|
+
this.selectionChange = output();
|
|
852
|
+
this.selectedIds = computed(() => this.selectedValues().map((v) => String(v)), /* @ts-ignore */
|
|
853
|
+
...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
854
|
+
}
|
|
855
|
+
handleSelectionChange(e) {
|
|
856
|
+
if (e.source !== 'user') {
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
this.selectionChange.emit({ ids: e.selectedIds, nodes: e.selectedNodes });
|
|
860
|
+
}
|
|
861
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiSelectTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
862
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXLookupMultiSelectTreeComponent, isStandalone: true, selector: "ax-lookup-multi-select-tree", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null }, selectionBehavior: { classPropertyName: "selectionBehavior", publicName: "selectionBehavior", isSignal: true, isRequired: false, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, ngImport: i0, template: `
|
|
863
|
+
<div class="ax-lookup-tree">
|
|
864
|
+
<ax-tree-view
|
|
865
|
+
[datasource]="dataSource()"
|
|
866
|
+
selectMode="multiple"
|
|
867
|
+
[selectionBehavior]="selectionBehavior()"
|
|
868
|
+
[controlledSelection]="true"
|
|
869
|
+
[selectedIds]="selectedIds()"
|
|
870
|
+
[idField]="valueField()"
|
|
871
|
+
[titleField]="textField()"
|
|
872
|
+
[disabledField]="disabledField()"
|
|
873
|
+
[nodeTemplate]="nodeTemplate()"
|
|
874
|
+
(onSelectionChange)="handleSelectionChange($event)"
|
|
875
|
+
/>
|
|
876
|
+
</div>
|
|
877
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXTreeViewComponent, selector: "ax-tree-view", inputs: ["datasource", "selectMode", "selectionBehavior", "dragArea", "dragBehavior", "showIcons", "showChildrenBadge", "expandedIcon", "collapsedIcon", "indentSize", "look", "nodeTemplate", "idField", "titleField", "tooltipField", "iconField", "expandedField", "selectedField", "indeterminateField", "disabledField", "hiddenField", "childrenField", "childrenCountField", "dataField", "inheritDisabled", "expandOnDoubleClick", "doubleClickDuration", "tooltipDelay", "controlledSelection", "selectedIds"], outputs: ["datasourceChange", "selectedIdsChange", "onBeforeDrop", "onNodeToggle", "onNodeSelect", "onNodeDoubleClick", "onNodeClick", "onSelectionChange", "onOrderChange", "onMoveChange", "onItemsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
878
|
+
}
|
|
879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiSelectTreeComponent, decorators: [{
|
|
880
|
+
type: Component,
|
|
881
|
+
args: [{
|
|
882
|
+
selector: 'ax-lookup-multi-select-tree',
|
|
883
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
884
|
+
encapsulation: ViewEncapsulation.None,
|
|
885
|
+
imports: [AXTreeViewComponent],
|
|
886
|
+
template: `
|
|
887
|
+
<div class="ax-lookup-tree">
|
|
888
|
+
<ax-tree-view
|
|
889
|
+
[datasource]="dataSource()"
|
|
890
|
+
selectMode="multiple"
|
|
891
|
+
[selectionBehavior]="selectionBehavior()"
|
|
892
|
+
[controlledSelection]="true"
|
|
893
|
+
[selectedIds]="selectedIds()"
|
|
894
|
+
[idField]="valueField()"
|
|
895
|
+
[titleField]="textField()"
|
|
896
|
+
[disabledField]="disabledField()"
|
|
897
|
+
[nodeTemplate]="nodeTemplate()"
|
|
898
|
+
(onSelectionChange)="handleSelectionChange($event)"
|
|
899
|
+
/>
|
|
900
|
+
</div>
|
|
901
|
+
`,
|
|
902
|
+
}]
|
|
903
|
+
}], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }], selectionBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBehavior", required: false }] }], nodeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodeTemplate", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Internal mini component for the `multi-select` lookup mode:
|
|
907
|
+
* a predefined, virtualized list of options with checkboxes for multiple item selection.
|
|
908
|
+
*
|
|
909
|
+
* @category Components
|
|
910
|
+
*/
|
|
911
|
+
class AXLookupMultiSelectComponent extends AXLookupListViewBase {
|
|
912
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
913
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXLookupMultiSelectComponent, isStandalone: true, selector: "ax-lookup-multi-select", providers: [{ provide: AXLookupListViewBase, useExisting: AXLookupMultiSelectComponent }], usesInheritance: true, ngImport: i0, template: `
|
|
914
|
+
@if (isEmpty()) {
|
|
915
|
+
@if (emptyTemplate()) {
|
|
916
|
+
<ng-container [ngTemplateOutlet]="emptyTemplate()!" />
|
|
917
|
+
} @else {
|
|
918
|
+
<div class="ax-lookup-empty">
|
|
919
|
+
{{ '@acorex:common.general.no-result-found' | translate | async }}
|
|
920
|
+
</div>
|
|
921
|
+
}
|
|
922
|
+
} @else {
|
|
923
|
+
<cdk-virtual-scroll-viewport
|
|
924
|
+
class="ax-lookup-viewport"
|
|
925
|
+
role="listbox"
|
|
926
|
+
aria-multiselectable="true"
|
|
927
|
+
axListNavigation
|
|
928
|
+
#nav="axListNavigation"
|
|
929
|
+
[itemSize]="itemHeight()"
|
|
930
|
+
[style.height.px]="viewportHeight()"
|
|
931
|
+
(onKeypress)="handleListKeypress($event)"
|
|
932
|
+
>
|
|
933
|
+
<div
|
|
934
|
+
*cdkVirtualFor="let item of listDataSource(); let i = index; trackBy: trackByIndex"
|
|
935
|
+
role="option"
|
|
936
|
+
class="ax-lookup-option-host"
|
|
937
|
+
axListNavigationItem
|
|
938
|
+
#navItem="axListNavigationItem"
|
|
939
|
+
[style.height.px]="itemHeight()"
|
|
940
|
+
[class.ax-lookup-option]="!itemTemplate()"
|
|
941
|
+
[class.ax-lookup-option-host--check]="!!itemTemplate()"
|
|
942
|
+
[class.ax-state-alternate]="alternate() && i % 2 === 1"
|
|
943
|
+
[class.ax-state-selected]="item != null && isSelected(item)"
|
|
944
|
+
[class.ax-state-disabled]="item != null && isDisabled(item)"
|
|
945
|
+
[class.ax-state-active]="navItem.isActive()"
|
|
946
|
+
[attr.aria-selected]="item != null ? isSelected(item) : null"
|
|
947
|
+
(mouseenter)="activateNavItem(nav, navItem)"
|
|
948
|
+
(click)="handleItemClick(item)"
|
|
949
|
+
(onKeypress)="handleItemKeypress($event, item)"
|
|
950
|
+
>
|
|
951
|
+
@if (item != null) {
|
|
952
|
+
<input
|
|
953
|
+
type="checkbox"
|
|
954
|
+
class="ax-lookup-checkbox"
|
|
955
|
+
tabindex="-1"
|
|
956
|
+
[checked]="isSelected(item)"
|
|
957
|
+
[disabled]="isDisabled(item)"
|
|
958
|
+
/>
|
|
959
|
+
@if (itemTemplate()) {
|
|
960
|
+
<ng-container [ngTemplateOutlet]="itemTemplate()!" [ngTemplateOutletContext]="{ $implicit: item }" />
|
|
961
|
+
} @else {
|
|
962
|
+
<span class="ax-lookup-option-text">{{ getText(item) }}</span>
|
|
963
|
+
}
|
|
964
|
+
} @else {
|
|
965
|
+
<ng-container [ngTemplateOutlet]="loadingRow" />
|
|
966
|
+
}
|
|
967
|
+
</div>
|
|
968
|
+
</cdk-virtual-scroll-viewport>
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
<ng-template #loadingRow>
|
|
972
|
+
@if (loadingTemplate()) {
|
|
973
|
+
<ng-container [ngTemplateOutlet]="loadingTemplate()!" />
|
|
974
|
+
} @else {
|
|
975
|
+
<span class="ax-lookup-option-loading">{{ '@acorex:common.status.loading' | translate | async }}</span>
|
|
976
|
+
}
|
|
977
|
+
</ng-template>
|
|
978
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXListNavigationModule }, { kind: "directive", type: i3.AXListNavigationDirective, selector: "[axListNavigation]", inputs: ["orientation"], outputs: ["onNavigationChanged", "onKeypress"], exportAs: ["axListNavigation"] }, { kind: "directive", type: i3.AXListNavigationItemDirective, selector: "[axListNavigationItem]", outputs: ["onKeypress"], exportAs: ["axListNavigationItem"] }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
979
|
+
}
|
|
980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupMultiSelectComponent, decorators: [{
|
|
981
|
+
type: Component,
|
|
982
|
+
args: [{
|
|
983
|
+
selector: 'ax-lookup-multi-select',
|
|
984
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
985
|
+
encapsulation: ViewEncapsulation.None,
|
|
986
|
+
imports: [ScrollingModule, NgTemplateOutlet, AXTranslatorPipe, AsyncPipe, AXListNavigationModule],
|
|
987
|
+
providers: [{ provide: AXLookupListViewBase, useExisting: AXLookupMultiSelectComponent }],
|
|
988
|
+
template: `
|
|
989
|
+
@if (isEmpty()) {
|
|
990
|
+
@if (emptyTemplate()) {
|
|
991
|
+
<ng-container [ngTemplateOutlet]="emptyTemplate()!" />
|
|
992
|
+
} @else {
|
|
993
|
+
<div class="ax-lookup-empty">
|
|
994
|
+
{{ '@acorex:common.general.no-result-found' | translate | async }}
|
|
995
|
+
</div>
|
|
996
|
+
}
|
|
997
|
+
} @else {
|
|
998
|
+
<cdk-virtual-scroll-viewport
|
|
999
|
+
class="ax-lookup-viewport"
|
|
1000
|
+
role="listbox"
|
|
1001
|
+
aria-multiselectable="true"
|
|
1002
|
+
axListNavigation
|
|
1003
|
+
#nav="axListNavigation"
|
|
1004
|
+
[itemSize]="itemHeight()"
|
|
1005
|
+
[style.height.px]="viewportHeight()"
|
|
1006
|
+
(onKeypress)="handleListKeypress($event)"
|
|
1007
|
+
>
|
|
1008
|
+
<div
|
|
1009
|
+
*cdkVirtualFor="let item of listDataSource(); let i = index; trackBy: trackByIndex"
|
|
1010
|
+
role="option"
|
|
1011
|
+
class="ax-lookup-option-host"
|
|
1012
|
+
axListNavigationItem
|
|
1013
|
+
#navItem="axListNavigationItem"
|
|
1014
|
+
[style.height.px]="itemHeight()"
|
|
1015
|
+
[class.ax-lookup-option]="!itemTemplate()"
|
|
1016
|
+
[class.ax-lookup-option-host--check]="!!itemTemplate()"
|
|
1017
|
+
[class.ax-state-alternate]="alternate() && i % 2 === 1"
|
|
1018
|
+
[class.ax-state-selected]="item != null && isSelected(item)"
|
|
1019
|
+
[class.ax-state-disabled]="item != null && isDisabled(item)"
|
|
1020
|
+
[class.ax-state-active]="navItem.isActive()"
|
|
1021
|
+
[attr.aria-selected]="item != null ? isSelected(item) : null"
|
|
1022
|
+
(mouseenter)="activateNavItem(nav, navItem)"
|
|
1023
|
+
(click)="handleItemClick(item)"
|
|
1024
|
+
(onKeypress)="handleItemKeypress($event, item)"
|
|
1025
|
+
>
|
|
1026
|
+
@if (item != null) {
|
|
1027
|
+
<input
|
|
1028
|
+
type="checkbox"
|
|
1029
|
+
class="ax-lookup-checkbox"
|
|
1030
|
+
tabindex="-1"
|
|
1031
|
+
[checked]="isSelected(item)"
|
|
1032
|
+
[disabled]="isDisabled(item)"
|
|
1033
|
+
/>
|
|
1034
|
+
@if (itemTemplate()) {
|
|
1035
|
+
<ng-container [ngTemplateOutlet]="itemTemplate()!" [ngTemplateOutletContext]="{ $implicit: item }" />
|
|
1036
|
+
} @else {
|
|
1037
|
+
<span class="ax-lookup-option-text">{{ getText(item) }}</span>
|
|
1038
|
+
}
|
|
1039
|
+
} @else {
|
|
1040
|
+
<ng-container [ngTemplateOutlet]="loadingRow" />
|
|
1041
|
+
}
|
|
1042
|
+
</div>
|
|
1043
|
+
</cdk-virtual-scroll-viewport>
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
<ng-template #loadingRow>
|
|
1047
|
+
@if (loadingTemplate()) {
|
|
1048
|
+
<ng-container [ngTemplateOutlet]="loadingTemplate()!" />
|
|
1049
|
+
} @else {
|
|
1050
|
+
<span class="ax-lookup-option-loading">{{ '@acorex:common.status.loading' | translate | async }}</span>
|
|
1051
|
+
}
|
|
1052
|
+
</ng-template>
|
|
1053
|
+
`,
|
|
1054
|
+
}]
|
|
1055
|
+
}] });
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* An advanced drop-down (lookup) editor with five modes, `AXDataSource` support, and virtual scrolling.
|
|
1059
|
+
*
|
|
1060
|
+
* Modes (each rendered by its own internal mini component):
|
|
1061
|
+
* - `drop-down-list` — a predefined list of options for picking single values.
|
|
1062
|
+
* - `multi-select` — a predefined list of options for multiple item selection (chips in the trigger).
|
|
1063
|
+
* - `drop-down-tree` — a predefined list rendered in a tree-like structure for single item selection.
|
|
1064
|
+
* - `multi-select-tree` — a tree-like structure for multiple item selection.
|
|
1065
|
+
* - `multi-column` — an `ax-data-table` grid; when searchable, the trigger input filters as you type.
|
|
1066
|
+
*
|
|
1067
|
+
* With `adaptivityEnabled` (default `true`), the list opens as a bottom actionsheet on small
|
|
1068
|
+
* screens instead of an anchored dropdown — the same alternate presentation as `ax-select-box`.
|
|
1069
|
+
*
|
|
1070
|
+
* Implements {@link FormValueControl} so `[(ngModel)]` / signal forms work via the `value` model
|
|
1071
|
+
* (no `ControlValueAccessor`).
|
|
1072
|
+
*
|
|
1073
|
+
* @category Components
|
|
1074
|
+
*/
|
|
1075
|
+
class AXLookupComponent extends NXComponent {
|
|
1076
|
+
#platform;
|
|
1077
|
+
#destroyRef;
|
|
1078
|
+
#itemsCache;
|
|
1079
|
+
#isUserInteraction;
|
|
1080
|
+
#lastValue;
|
|
1081
|
+
#lastExpanded;
|
|
1082
|
+
#resolveRevision;
|
|
1083
|
+
#selectionInitialized;
|
|
1084
|
+
#filterApplied;
|
|
1085
|
+
#searchDebounce;
|
|
1086
|
+
constructor() {
|
|
1087
|
+
super();
|
|
1088
|
+
this.#platform = inject(AXPlatform);
|
|
1089
|
+
this.#destroyRef = inject(DestroyRef);
|
|
1090
|
+
/**
|
|
1091
|
+
* The lookup rendering mode. Selects which mini component renders in the popup.
|
|
1092
|
+
*/
|
|
1093
|
+
this.mode = input('drop-down-list', /* @ts-ignore */
|
|
1094
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1095
|
+
/**
|
|
1096
|
+
* The items source for list-based modes (`drop-down-list`, `multi-select`, `multi-column`).
|
|
1097
|
+
* Accepts an `AXDataSource` (remote paging, `byKey`, server-side filter) or a plain array.
|
|
1098
|
+
*/
|
|
1099
|
+
this.dataSource = input(undefined, /* @ts-ignore */
|
|
1100
|
+
...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
1101
|
+
/**
|
|
1102
|
+
* The nodes source for tree modes (`drop-down-tree`, `multi-select-tree`):
|
|
1103
|
+
* an array of nodes or a lazy children callback.
|
|
1104
|
+
*/
|
|
1105
|
+
this.treeDataSource = input(undefined, /* @ts-ignore */
|
|
1106
|
+
...(ngDevMode ? [{ debugName: "treeDataSource" }] : /* istanbul ignore next */ []));
|
|
1107
|
+
/**
|
|
1108
|
+
* The item property used as the selection value. Maps to the tree `idField` in tree modes.
|
|
1109
|
+
*/
|
|
1110
|
+
this.valueField = input('id', /* @ts-ignore */
|
|
1111
|
+
...(ngDevMode ? [{ debugName: "valueField" }] : /* istanbul ignore next */ []));
|
|
1112
|
+
/**
|
|
1113
|
+
* The item property used as the display text. Maps to the tree `titleField` in tree modes
|
|
1114
|
+
* (set it to `title` when your nodes use the default tree shape).
|
|
1115
|
+
*/
|
|
1116
|
+
this.textField = input('text', /* @ts-ignore */
|
|
1117
|
+
...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
|
|
1118
|
+
/**
|
|
1119
|
+
* The item property marking an item as disabled.
|
|
1120
|
+
*/
|
|
1121
|
+
this.disabledField = input('disabled', /* @ts-ignore */
|
|
1122
|
+
...(ngDevMode ? [{ debugName: "disabledField" }] : /* istanbul ignore next */ []));
|
|
1123
|
+
/**
|
|
1124
|
+
* Column definitions for the `multi-column` mode (rendered as `ax-text-column` in `ax-data-table`).
|
|
1125
|
+
*/
|
|
1126
|
+
this.columns = input([], /* @ts-ignore */
|
|
1127
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1128
|
+
/**
|
|
1129
|
+
* Whether the trigger accepts typing and filters the datasource (`true`),
|
|
1130
|
+
* or is select-only with no writable input (`false`).
|
|
1131
|
+
* Applies to `drop-down-list`, `multi-select`, and `multi-column`. Tree modes ignore this.
|
|
1132
|
+
*/
|
|
1133
|
+
this.searchable = input(true, /* @ts-ignore */
|
|
1134
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
1135
|
+
/**
|
|
1136
|
+
* When `true` (default), the popup list uses the alternate actionsheet presentation on small
|
|
1137
|
+
* screens (`SM`). When `false`, the list always opens as an anchored dropdown.
|
|
1138
|
+
*/
|
|
1139
|
+
this.adaptivityEnabled = input(true, /* @ts-ignore */
|
|
1140
|
+
...(ngDevMode ? [{ debugName: "adaptivityEnabled" }] : /* istanbul ignore next */ []));
|
|
1141
|
+
/**
|
|
1142
|
+
* Title shown in the actionsheet header on small screens. Falls back to `placeholder`.
|
|
1143
|
+
*/
|
|
1144
|
+
this.caption = input('', /* @ts-ignore */
|
|
1145
|
+
...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
1146
|
+
/**
|
|
1147
|
+
* When `true`, list rows use alternating background colors for easier scanning
|
|
1148
|
+
* (`drop-down-list`, `multi-select`, and `multi-column` modes).
|
|
1149
|
+
*/
|
|
1150
|
+
this.alternate = input(false, /* @ts-ignore */
|
|
1151
|
+
...(ngDevMode ? [{ debugName: "alternate" }] : /* istanbul ignore next */ []));
|
|
1152
|
+
/**
|
|
1153
|
+
* Placeholder for the trigger search input when items are already selected
|
|
1154
|
+
* (mainly useful in `multi-select`). Falls back to `placeholder` when the selection is empty.
|
|
1155
|
+
*/
|
|
1156
|
+
this.searchPlaceholder = input('Search...', /* @ts-ignore */
|
|
1157
|
+
...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
1158
|
+
/**
|
|
1159
|
+
* The placeholder text shown when no value is selected.
|
|
1160
|
+
*/
|
|
1161
|
+
this.placeholder = input('', /* @ts-ignore */
|
|
1162
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1163
|
+
/**
|
|
1164
|
+
* Whether the lookup is disabled.
|
|
1165
|
+
*/
|
|
1166
|
+
this.disabled = input(false, /* @ts-ignore */
|
|
1167
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1168
|
+
/**
|
|
1169
|
+
* Whether the lookup is readonly.
|
|
1170
|
+
*/
|
|
1171
|
+
this.readonly = input(false, /* @ts-ignore */
|
|
1172
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1173
|
+
/**
|
|
1174
|
+
* Predefined look scheme of the editor container. Same looks as other editor components like ax-text-box.
|
|
1175
|
+
*/
|
|
1176
|
+
this.look = model('solid', /* @ts-ignore */
|
|
1177
|
+
...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
|
|
1178
|
+
/**
|
|
1179
|
+
* The fixed row height in pixels used by the virtual scroll viewport (list-based modes).
|
|
1180
|
+
*/
|
|
1181
|
+
this.itemHeight = input(40, /* @ts-ignore */
|
|
1182
|
+
...(ngDevMode ? [{ debugName: "itemHeight" }] : /* istanbul ignore next */ []));
|
|
1183
|
+
/**
|
|
1184
|
+
* The maximum number of rows visible before the popup scrolls (list-based modes).
|
|
1185
|
+
*/
|
|
1186
|
+
this.maxVisibleItems = input(8, /* @ts-ignore */
|
|
1187
|
+
...(ngDevMode ? [{ debugName: "maxVisibleItems" }] : /* istanbul ignore next */ []));
|
|
1188
|
+
/**
|
|
1189
|
+
* How selecting parent/child nodes affects each other in `multi-select-tree` mode.
|
|
1190
|
+
*/
|
|
1191
|
+
this.treeSelectionBehavior = input('all', /* @ts-ignore */
|
|
1192
|
+
...(ngDevMode ? [{ debugName: "treeSelectionBehavior" }] : /* istanbul ignore next */ []));
|
|
1193
|
+
/**
|
|
1194
|
+
* Custom template rendered for each item/node. Context: `$implicit` is the item.
|
|
1195
|
+
*/
|
|
1196
|
+
this.itemTemplate = input(undefined, /* @ts-ignore */
|
|
1197
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
1198
|
+
/**
|
|
1199
|
+
* Custom template for the selected item display (trigger text / chips). Context: `$implicit` is the item.
|
|
1200
|
+
*/
|
|
1201
|
+
this.selectedTemplate = input(undefined, /* @ts-ignore */
|
|
1202
|
+
...(ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []));
|
|
1203
|
+
/**
|
|
1204
|
+
* Custom template rendered when the datasource has no items.
|
|
1205
|
+
*/
|
|
1206
|
+
this.emptyTemplate = input(undefined, /* @ts-ignore */
|
|
1207
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
1208
|
+
/**
|
|
1209
|
+
* Custom template rendered for rows whose page is still loading.
|
|
1210
|
+
*/
|
|
1211
|
+
this.loadingTemplate = input(undefined, /* @ts-ignore */
|
|
1212
|
+
...(ngDevMode ? [{ debugName: "loadingTemplate" }] : /* istanbul ignore next */ []));
|
|
1213
|
+
/**
|
|
1214
|
+
* The selected value(s): a scalar in single modes, an array in
|
|
1215
|
+
* `multi-select` / `multi-select-tree`. Supports `[(value)]`, `[(ngModel)]`, and signal forms
|
|
1216
|
+
* via {@link FormValueControl}.
|
|
1217
|
+
*/
|
|
1218
|
+
this.value = model(null, /* @ts-ignore */
|
|
1219
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1220
|
+
/**
|
|
1221
|
+
* Emitted when the selected value changes.
|
|
1222
|
+
*/
|
|
1223
|
+
this.onValueChanged = output();
|
|
1224
|
+
/**
|
|
1225
|
+
* Emitted when the selection changes, carrying the resolved selected items.
|
|
1226
|
+
*/
|
|
1227
|
+
this.onSelectionChanged = output();
|
|
1228
|
+
/**
|
|
1229
|
+
* Emitted when the trigger receives focus.
|
|
1230
|
+
*/
|
|
1231
|
+
this.onFocus = output();
|
|
1232
|
+
/**
|
|
1233
|
+
* Emitted when the trigger loses focus.
|
|
1234
|
+
*/
|
|
1235
|
+
this.onBlur = output();
|
|
1236
|
+
/**
|
|
1237
|
+
* Emitted when a list/tree item is clicked.
|
|
1238
|
+
*/
|
|
1239
|
+
this.onItemClick = output();
|
|
1240
|
+
/**
|
|
1241
|
+
* Emitted when an item is selected (click or keyboard).
|
|
1242
|
+
*/
|
|
1243
|
+
this.onItemSelected = output();
|
|
1244
|
+
/**
|
|
1245
|
+
* Emitted when the popup opens.
|
|
1246
|
+
*/
|
|
1247
|
+
this.onOpened = output();
|
|
1248
|
+
/**
|
|
1249
|
+
* Emitted when the popup closes.
|
|
1250
|
+
*/
|
|
1251
|
+
this.onClosed = output();
|
|
1252
|
+
/** Whether the popup is expanded. */
|
|
1253
|
+
this.expanded = signal(false, /* @ts-ignore */
|
|
1254
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
1255
|
+
/** Whether the list is currently shown as a bottom actionsheet (small screens + adaptivity). */
|
|
1256
|
+
this.isActionsheetStyle = signal(false, /* @ts-ignore */
|
|
1257
|
+
...(ngDevMode ? [{ debugName: "isActionsheetStyle" }] : /* istanbul ignore next */ []));
|
|
1258
|
+
/** Whether the current mode selects multiple values. */
|
|
1259
|
+
this.isMultiple = computed(() => this.mode() === 'multi-select' || this.mode() === 'multi-select-tree', /* @ts-ignore */
|
|
1260
|
+
...(ngDevMode ? [{ debugName: "isMultiple" }] : /* istanbul ignore next */ []));
|
|
1261
|
+
/** Whether the current mode renders a tree. */
|
|
1262
|
+
this.isTreeMode = computed(() => this.mode() === 'drop-down-tree' || this.mode() === 'multi-select-tree', /* @ts-ignore */
|
|
1263
|
+
...(ngDevMode ? [{ debugName: "isTreeMode" }] : /* istanbul ignore next */ []));
|
|
1264
|
+
/** Whether the trigger input is writable and filters as you type. */
|
|
1265
|
+
this.isEditableTrigger = computed(() => {
|
|
1266
|
+
if (!this.searchable() || this.readonly()) {
|
|
1267
|
+
return false;
|
|
1268
|
+
}
|
|
1269
|
+
const mode = this.mode();
|
|
1270
|
+
return mode === 'drop-down-list' || mode === 'multi-select' || mode === 'multi-column';
|
|
1271
|
+
}, /* @ts-ignore */
|
|
1272
|
+
...(ngDevMode ? [{ debugName: "isEditableTrigger" }] : /* istanbul ignore next */ []));
|
|
1273
|
+
/** The datasource for list-based modes; plain arrays are converted. */
|
|
1274
|
+
this.resolvedDataSource = computed(() => {
|
|
1275
|
+
const source = this.dataSource();
|
|
1276
|
+
if (!source) {
|
|
1277
|
+
return convertArrayToDataSource([], { key: this.valueField(), pageSize: 20 });
|
|
1278
|
+
}
|
|
1279
|
+
return Array.isArray(source)
|
|
1280
|
+
? convertArrayToDataSource(source, { key: this.valueField(), pageSize: 20 })
|
|
1281
|
+
: source;
|
|
1282
|
+
}, /* @ts-ignore */
|
|
1283
|
+
...(ngDevMode ? [{ debugName: "resolvedDataSource" }] : /* istanbul ignore next */ []));
|
|
1284
|
+
/** The current selection normalized to an array. */
|
|
1285
|
+
this.selectedValues = computed(() => {
|
|
1286
|
+
const value = this.value();
|
|
1287
|
+
if (value == null) {
|
|
1288
|
+
return [];
|
|
1289
|
+
}
|
|
1290
|
+
return Array.isArray(value) ? value : [value];
|
|
1291
|
+
}, /* @ts-ignore */
|
|
1292
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
1293
|
+
/** The resolved selected items (via cache, datasource `find`/`byKey`, or tree node lookup). */
|
|
1294
|
+
this.selectedItems = signal([], /* @ts-ignore */
|
|
1295
|
+
...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
|
|
1296
|
+
/** Display text shown in the trigger for single modes. */
|
|
1297
|
+
this.displayText = computed(() => {
|
|
1298
|
+
const item = this.selectedItems()[0];
|
|
1299
|
+
return item ? this.getItemText(item) : '';
|
|
1300
|
+
}, /* @ts-ignore */
|
|
1301
|
+
...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
|
|
1302
|
+
/**
|
|
1303
|
+
* Text typed in the editable trigger input.
|
|
1304
|
+
* Multi-select starts empty; single modes sync from the selected display text.
|
|
1305
|
+
*/
|
|
1306
|
+
this.searchText = linkedSignal(() => (this.mode() === 'multi-select' || this.mode() === 'multi-select-tree' ? '' : this.displayText()), /* @ts-ignore */
|
|
1307
|
+
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
1308
|
+
/**
|
|
1309
|
+
* Whether the trigger should render `selectedTemplate` instead of the plain input text.
|
|
1310
|
+
* Searchable mode shows the template while the popup is closed and the input still matches
|
|
1311
|
+
* the selected display text (same pattern as combo-box).
|
|
1312
|
+
*/
|
|
1313
|
+
this.showSelectedTemplate = computed(() => {
|
|
1314
|
+
if (this.isMultiple() || !this.selectedTemplate() || this.selectedItems().length === 0) {
|
|
1315
|
+
return false;
|
|
1316
|
+
}
|
|
1317
|
+
if (!this.isEditableTrigger()) {
|
|
1318
|
+
return true;
|
|
1319
|
+
}
|
|
1320
|
+
return !this.expanded() && this.searchText() === this.displayText();
|
|
1321
|
+
}, /* @ts-ignore */
|
|
1322
|
+
...(ngDevMode ? [{ debugName: "showSelectedTemplate" }] : /* istanbul ignore next */ []));
|
|
1323
|
+
this.popoverRef = viewChild(AXPopoverComponent, /* @ts-ignore */
|
|
1324
|
+
...(ngDevMode ? [{ debugName: "popoverRef" }] : /* istanbul ignore next */ []));
|
|
1325
|
+
this.triggerSearchInput = viewChild('triggerSearchInput', /* @ts-ignore */
|
|
1326
|
+
...(ngDevMode ? [{ debugName: "triggerSearchInput" }] : /* istanbul ignore next */ []));
|
|
1327
|
+
this.listView = viewChild(AXLookupListViewBase, /* @ts-ignore */
|
|
1328
|
+
...(ngDevMode ? [{ debugName: "listView" }] : /* istanbul ignore next */ []));
|
|
1329
|
+
this.#itemsCache = new Map();
|
|
1330
|
+
this.#isUserInteraction = false;
|
|
1331
|
+
this.#lastValue = undefined;
|
|
1332
|
+
this.#lastExpanded = undefined;
|
|
1333
|
+
this.#resolveRevision = 0;
|
|
1334
|
+
this.#selectionInitialized = false;
|
|
1335
|
+
this.#filterApplied = false;
|
|
1336
|
+
/** Placeholder for the editable trigger search input. */
|
|
1337
|
+
this.triggerSearchPlaceholder = computed(() => {
|
|
1338
|
+
if (this.mode() === 'multi-select' && this.selectedItems().length > 0) {
|
|
1339
|
+
return this.searchPlaceholder();
|
|
1340
|
+
}
|
|
1341
|
+
return this.placeholder();
|
|
1342
|
+
}, /* @ts-ignore */
|
|
1343
|
+
...(ngDevMode ? [{ debugName: "triggerSearchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
1344
|
+
effect(() => this.#emitValueChanged(this.value()));
|
|
1345
|
+
effect(() => this.#emitOpenedOrClosed(this.expanded()));
|
|
1346
|
+
effect(() => {
|
|
1347
|
+
this.adaptivityEnabled();
|
|
1348
|
+
untracked(() => this.#syncActionsheetStyle());
|
|
1349
|
+
});
|
|
1350
|
+
this.#platform.resize.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1351
|
+
this.#syncActionsheetStyle();
|
|
1352
|
+
// Match dropdown-box: close anchored dropdowns on resize; keep actionsheet open.
|
|
1353
|
+
if (this.expanded() && !this.isActionsheetStyle()) {
|
|
1354
|
+
this.close();
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
// Seed the actionsheet flag once.
|
|
1358
|
+
this.#syncActionsheetStyle();
|
|
1359
|
+
// Resolve selected items whenever the value (or the sources) change.
|
|
1360
|
+
effect(() => {
|
|
1361
|
+
const values = this.selectedValues();
|
|
1362
|
+
this.mode();
|
|
1363
|
+
this.dataSource();
|
|
1364
|
+
this.treeDataSource();
|
|
1365
|
+
untracked(() => void this.#resolveSelectedItems(values));
|
|
1366
|
+
});
|
|
1367
|
+
// Keep the popover in sync with the expanded state.
|
|
1368
|
+
effect(() => {
|
|
1369
|
+
const expanded = this.expanded();
|
|
1370
|
+
const popover = this.popoverRef();
|
|
1371
|
+
if (!popover) {
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
untracked(() => {
|
|
1375
|
+
if (expanded && !popover.isOpen) {
|
|
1376
|
+
void popover.open();
|
|
1377
|
+
}
|
|
1378
|
+
else if (!expanded && popover.isOpen) {
|
|
1379
|
+
popover.close();
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
#syncActionsheetStyle() {
|
|
1385
|
+
this.isActionsheetStyle.set(this.adaptivityEnabled() && this.#platform.is('SM'));
|
|
1386
|
+
}
|
|
1387
|
+
/** Returns the display text of an item using the `textField` mapping. */
|
|
1388
|
+
getItemText(item) {
|
|
1389
|
+
return String(item?.[this.textField()] ?? '');
|
|
1390
|
+
}
|
|
1391
|
+
/** Stable unique key for selected chips — avoids NG0955 and remounts on reorder/remove. */
|
|
1392
|
+
trackSelectedKey(item) {
|
|
1393
|
+
const key = item?.[this.valueField()];
|
|
1394
|
+
return key != null ? key : item;
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Opens (editable trigger) or toggles the popup on trigger click.
|
|
1398
|
+
*/
|
|
1399
|
+
onTriggerClick() {
|
|
1400
|
+
if (this.disabled() || this.readonly()) {
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
if (this.isEditableTrigger()) {
|
|
1404
|
+
this.expanded.set(true);
|
|
1405
|
+
queueMicrotask(() => this.triggerSearchInput()?.nativeElement.focus());
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
this.expanded.update((open) => !open);
|
|
1409
|
+
if (!this.expanded()) {
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
queueMicrotask(() => this.focusListFirst());
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Focuses the lookup trigger input.
|
|
1416
|
+
*/
|
|
1417
|
+
focus(options) {
|
|
1418
|
+
if (this.disabled()) {
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1421
|
+
this.triggerSearchInput()?.nativeElement.focus(options);
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Handles keyboard interaction on the trigger input.
|
|
1425
|
+
*/
|
|
1426
|
+
onTriggerKeydown(e) {
|
|
1427
|
+
if (this.disabled() || this.readonly()) {
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
if (e.key === 'Escape') {
|
|
1431
|
+
this.close();
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
if (e.key === 'ArrowDown') {
|
|
1435
|
+
e.preventDefault();
|
|
1436
|
+
this.expanded.set(true);
|
|
1437
|
+
queueMicrotask(() => this.focusListFirst());
|
|
1438
|
+
return;
|
|
1439
|
+
}
|
|
1440
|
+
if (!this.isEditableTrigger() && (e.key === 'Enter' || e.key === ' ')) {
|
|
1441
|
+
e.preventDefault();
|
|
1442
|
+
this.expanded.update((open) => !open);
|
|
1443
|
+
if (this.expanded()) {
|
|
1444
|
+
queueMicrotask(() => this.focusListFirst());
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
/** Blocks typing when the trigger is not editable (keeps Tab / keyboard open working). */
|
|
1449
|
+
onBeforeInput(event) {
|
|
1450
|
+
if (!this.isEditableTrigger() || this.readonly()) {
|
|
1451
|
+
event.preventDefault();
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Returns focus to the trigger input when list navigation requests it.
|
|
1456
|
+
*/
|
|
1457
|
+
onListNavigateOut(_reason) {
|
|
1458
|
+
this.triggerSearchInput()?.nativeElement.focus();
|
|
1459
|
+
}
|
|
1460
|
+
focusListFirst() {
|
|
1461
|
+
const tryFocus = (attempt = 0) => {
|
|
1462
|
+
const list = this.listView();
|
|
1463
|
+
if (list) {
|
|
1464
|
+
list.focusFirst();
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
if (attempt < 5) {
|
|
1468
|
+
setTimeout(() => tryFocus(attempt + 1), 16);
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
tryFocus();
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Keeps the expanded state in sync when the popover closes (e.g. click outside),
|
|
1475
|
+
* and clears any applied search filter.
|
|
1476
|
+
*/
|
|
1477
|
+
onPopoverClosed() {
|
|
1478
|
+
this.expanded.set(false);
|
|
1479
|
+
this.searchText.set(this.isMultiple() ? '' : this.displayText());
|
|
1480
|
+
if (this.#filterApplied) {
|
|
1481
|
+
this.#filterApplied = false;
|
|
1482
|
+
const source = this.resolvedDataSource();
|
|
1483
|
+
source.clearFilter();
|
|
1484
|
+
source.refresh();
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Closes the popup.
|
|
1489
|
+
*/
|
|
1490
|
+
close() {
|
|
1491
|
+
this.expanded.set(false);
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Closes the popup (alias for {@link close}, required by `AXClosableComponent`).
|
|
1495
|
+
*/
|
|
1496
|
+
closeAll() {
|
|
1497
|
+
this.close();
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Opens the popup.
|
|
1501
|
+
*/
|
|
1502
|
+
open() {
|
|
1503
|
+
if (this.disabled() || this.readonly()) {
|
|
1504
|
+
return;
|
|
1505
|
+
}
|
|
1506
|
+
this.expanded.set(true);
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Handles typing in the editable trigger input.
|
|
1510
|
+
*/
|
|
1511
|
+
onTriggerSearchInput(text) {
|
|
1512
|
+
if (!this.isEditableTrigger()) {
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
this.searchText.set(text);
|
|
1516
|
+
this.expanded.set(true);
|
|
1517
|
+
this.#applyFilterDebounced(text);
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Commits a single pick (drop-down-list, drop-down-tree, multi-column) and closes the popup.
|
|
1521
|
+
*/
|
|
1522
|
+
handleSinglePick(e) {
|
|
1523
|
+
this.#emitItemClick(e.item);
|
|
1524
|
+
this.#emitItemSelected(e.item);
|
|
1525
|
+
this.#itemsCache.set(e.value, e.item);
|
|
1526
|
+
if (!this.#valuesEqual(e.value, this.value())) {
|
|
1527
|
+
this.#isUserInteraction = true;
|
|
1528
|
+
this.value.set(e.value);
|
|
1529
|
+
}
|
|
1530
|
+
this.close();
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* Toggles an item in the multi-select list; the popup stays open.
|
|
1534
|
+
* Clears the trigger search so the full list returns (select-box-like).
|
|
1535
|
+
*/
|
|
1536
|
+
handleMultiToggle(e) {
|
|
1537
|
+
this.#emitItemClick(e.item);
|
|
1538
|
+
this.#itemsCache.set(e.value, e.item);
|
|
1539
|
+
const current = this.selectedValues();
|
|
1540
|
+
const exists = current.some((v) => v == e.value);
|
|
1541
|
+
if (!exists) {
|
|
1542
|
+
this.#emitItemSelected(e.item);
|
|
1543
|
+
}
|
|
1544
|
+
const next = exists ? current.filter((v) => !(v == e.value)) : [...current, e.value];
|
|
1545
|
+
this.#isUserInteraction = true;
|
|
1546
|
+
this.value.set(next);
|
|
1547
|
+
if (this.isEditableTrigger() && this.searchText()) {
|
|
1548
|
+
this.searchText.set('');
|
|
1549
|
+
this.#applyFilterDebounced('');
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Applies the multi-select-tree selection to the value; the popup stays open.
|
|
1554
|
+
*/
|
|
1555
|
+
handleTreeSelectionChange(e) {
|
|
1556
|
+
const prev = new Set(this.selectedValues().map((v) => String(v)));
|
|
1557
|
+
const newlySelected = e.nodes.filter((node) => !prev.has(String(node[this.valueField()])));
|
|
1558
|
+
if (newlySelected.length > 0) {
|
|
1559
|
+
this.#emitItemSelected(newlySelected[0]);
|
|
1560
|
+
}
|
|
1561
|
+
for (const node of e.nodes) {
|
|
1562
|
+
this.#itemsCache.set(String(node[this.valueField()]), node);
|
|
1563
|
+
}
|
|
1564
|
+
this.#isUserInteraction = true;
|
|
1565
|
+
this.value.set([...e.ids]);
|
|
1566
|
+
}
|
|
1567
|
+
/** Forwards native focus from the trigger input. */
|
|
1568
|
+
emitOnFocus(e) {
|
|
1569
|
+
this.onFocus.emit({
|
|
1570
|
+
component: this,
|
|
1571
|
+
htmlElement: this.nativeElement,
|
|
1572
|
+
nativeEvent: e,
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
/** Forwards native blur from the trigger input. */
|
|
1576
|
+
emitOnBlur(e) {
|
|
1577
|
+
this.onBlur.emit({
|
|
1578
|
+
component: this,
|
|
1579
|
+
htmlElement: this.nativeElement,
|
|
1580
|
+
nativeEvent: e,
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
#emitItemClick(item) {
|
|
1584
|
+
this.onItemClick.emit({
|
|
1585
|
+
component: this,
|
|
1586
|
+
item,
|
|
1587
|
+
htmlElement: this.nativeElement,
|
|
1588
|
+
isUserInteraction: true,
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
#emitItemSelected(item) {
|
|
1592
|
+
this.onItemSelected.emit({
|
|
1593
|
+
component: this,
|
|
1594
|
+
item,
|
|
1595
|
+
htmlElement: this.nativeElement,
|
|
1596
|
+
isUserInteraction: true,
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Removes a single chip from the multi selection.
|
|
1601
|
+
*/
|
|
1602
|
+
removeChip(event, item) {
|
|
1603
|
+
event.stopPropagation();
|
|
1604
|
+
if (this.disabled() || this.readonly()) {
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
const value = item?.[this.valueField()];
|
|
1608
|
+
this.#isUserInteraction = true;
|
|
1609
|
+
this.value.set(this.selectedValues().filter((v) => !(v == value)));
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Clears the whole selection.
|
|
1613
|
+
* Sets `null` in single modes and `[]` in multi modes. Used by projected `ax-clear-button`.
|
|
1614
|
+
*
|
|
1615
|
+
* @param isUserInteraction - Whether the clear was triggered by the user.
|
|
1616
|
+
*/
|
|
1617
|
+
reset(isUserInteraction = false) {
|
|
1618
|
+
if (this.disabled() || this.readonly()) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
const next = this.isMultiple() ? [] : null;
|
|
1622
|
+
const current = this.value();
|
|
1623
|
+
if (this.isMultiple()) {
|
|
1624
|
+
if (Array.isArray(current) && current.length === 0) {
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
else if (current == null) {
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
this.#isUserInteraction = isUserInteraction;
|
|
1632
|
+
this.value.set(next);
|
|
1633
|
+
if (this.isEditableTrigger() && this.searchText()) {
|
|
1634
|
+
this.searchText.set('');
|
|
1635
|
+
this.#applyFilterDebounced('');
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
#applyFilterDebounced(text) {
|
|
1639
|
+
if (this.#searchDebounce) {
|
|
1640
|
+
clearTimeout(this.#searchDebounce);
|
|
1641
|
+
}
|
|
1642
|
+
this.#searchDebounce = setTimeout(() => {
|
|
1643
|
+
const source = this.resolvedDataSource();
|
|
1644
|
+
const query = text?.trim() ?? '';
|
|
1645
|
+
if (query) {
|
|
1646
|
+
source.filter({ field: this.textField(), value: query, operator: { type: 'contains' } });
|
|
1647
|
+
this.#filterApplied = true;
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
source.clearFilter();
|
|
1651
|
+
}
|
|
1652
|
+
source.refresh();
|
|
1653
|
+
}, 300);
|
|
1654
|
+
}
|
|
1655
|
+
async #resolveSelectedItems(values) {
|
|
1656
|
+
const revision = ++this.#resolveRevision;
|
|
1657
|
+
const resolved = await Promise.all(values.map((value) => Promise.resolve(this.#resolveItem(value))));
|
|
1658
|
+
if (revision !== this.#resolveRevision) {
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
const items = resolved.filter((item) => item != null);
|
|
1662
|
+
this.selectedItems.set(items);
|
|
1663
|
+
if (this.#selectionInitialized) {
|
|
1664
|
+
this.onSelectionChanged.emit({
|
|
1665
|
+
component: this,
|
|
1666
|
+
htmlElement: this.nativeElement,
|
|
1667
|
+
isUserInteraction: this.#isUserInteraction,
|
|
1668
|
+
items,
|
|
1669
|
+
value: this.value(),
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
this.#selectionInitialized = true;
|
|
1673
|
+
}
|
|
1674
|
+
#resolveItem(value) {
|
|
1675
|
+
const cached = this.#itemsCache.get(value) ?? this.#itemsCache.get(String(value));
|
|
1676
|
+
if (cached) {
|
|
1677
|
+
return cached;
|
|
1678
|
+
}
|
|
1679
|
+
if (this.isTreeMode()) {
|
|
1680
|
+
const nodes = this.treeDataSource();
|
|
1681
|
+
if (Array.isArray(nodes)) {
|
|
1682
|
+
const found = this.#findTreeNode(nodes, value);
|
|
1683
|
+
if (found) {
|
|
1684
|
+
this.#itemsCache.set(value, found);
|
|
1685
|
+
return found;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
return this.#fallbackItem(value);
|
|
1689
|
+
}
|
|
1690
|
+
const source = this.resolvedDataSource();
|
|
1691
|
+
const result = source.find(value);
|
|
1692
|
+
if (result == null) {
|
|
1693
|
+
return this.#fallbackItem(value);
|
|
1694
|
+
}
|
|
1695
|
+
if (result instanceof Promise) {
|
|
1696
|
+
return result.then((item) => {
|
|
1697
|
+
if (item) {
|
|
1698
|
+
this.#itemsCache.set(value, item);
|
|
1699
|
+
return item;
|
|
1700
|
+
}
|
|
1701
|
+
return this.#fallbackItem(value);
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
this.#itemsCache.set(value, result);
|
|
1705
|
+
return result;
|
|
1706
|
+
}
|
|
1707
|
+
#fallbackItem(value) {
|
|
1708
|
+
return { [this.valueField()]: value, [this.textField()]: String(value) };
|
|
1709
|
+
}
|
|
1710
|
+
#findTreeNode(nodes, value) {
|
|
1711
|
+
for (const node of nodes) {
|
|
1712
|
+
if (String(node[this.valueField()]) === String(value)) {
|
|
1713
|
+
return node;
|
|
1714
|
+
}
|
|
1715
|
+
const children = node['children'];
|
|
1716
|
+
if (Array.isArray(children)) {
|
|
1717
|
+
const found = this.#findTreeNode(children, value);
|
|
1718
|
+
if (found) {
|
|
1719
|
+
return found;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1725
|
+
#valuesEqual(a, b) {
|
|
1726
|
+
if (a === b) {
|
|
1727
|
+
return true;
|
|
1728
|
+
}
|
|
1729
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
1730
|
+
return a.length === b.length && a.every((item, index) => item == b[index]);
|
|
1731
|
+
}
|
|
1732
|
+
return false;
|
|
1733
|
+
}
|
|
1734
|
+
/** Emits onValueChanged when the value actually changes (skips the initial value). */
|
|
1735
|
+
#emitValueChanged(value) {
|
|
1736
|
+
const previous = this.#lastValue;
|
|
1737
|
+
this.#lastValue = value;
|
|
1738
|
+
if (previous === undefined || this.#valuesEqual(previous, value)) {
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
this.onValueChanged.emit({
|
|
1742
|
+
component: this,
|
|
1743
|
+
htmlElement: this.nativeElement,
|
|
1744
|
+
name: 'value',
|
|
1745
|
+
value,
|
|
1746
|
+
oldValue: previous,
|
|
1747
|
+
isUserInteraction: this.#isUserInteraction,
|
|
1748
|
+
});
|
|
1749
|
+
this.#isUserInteraction = false;
|
|
1750
|
+
}
|
|
1751
|
+
/** Emits onOpened/onClosed when the expanded state actually changes (skips the initial state). */
|
|
1752
|
+
#emitOpenedOrClosed(expanded) {
|
|
1753
|
+
const previous = this.#lastExpanded;
|
|
1754
|
+
this.#lastExpanded = expanded;
|
|
1755
|
+
if (previous === undefined || previous === expanded) {
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
const event = {
|
|
1759
|
+
component: this,
|
|
1760
|
+
htmlElement: this.nativeElement,
|
|
1761
|
+
isUserInteraction: true,
|
|
1762
|
+
};
|
|
1763
|
+
expanded ? this.onOpened.emit(event) : this.onClosed.emit(event);
|
|
1764
|
+
}
|
|
1765
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1766
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXLookupComponent, isStandalone: true, selector: "ax-lookup", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, treeDataSource: { classPropertyName: "treeDataSource", publicName: "treeDataSource", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", 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 }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleItems: { classPropertyName: "maxVisibleItems", publicName: "maxVisibleItems", isSignal: true, isRequired: false, transformFunction: null }, treeSelectionBehavior: { classPropertyName: "treeSelectionBehavior", publicName: "treeSelectionBehavior", 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 }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, loadingTemplate: { classPropertyName: "loadingTemplate", publicName: "loadingTemplate", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { look: "lookChange", value: "valueChange", onValueChanged: "onValueChanged", onSelectionChanged: "onSelectionChanged", onFocus: "onFocus", onBlur: "onBlur", onItemClick: "onItemClick", onItemSelected: "onItemSelected", onOpened: "onOpened", onClosed: "onClosed" }, providers: [
|
|
1767
|
+
{ provide: AXComponent, useExisting: AXLookupComponent },
|
|
1768
|
+
{ provide: AXClearableComponent, useExisting: AXLookupComponent },
|
|
1769
|
+
{ provide: AXClosableComponent, useExisting: AXLookupComponent },
|
|
1770
|
+
], viewQueries: [{ propertyName: "popoverRef", first: true, predicate: AXPopoverComponent, descendants: true, isSignal: true }, { propertyName: "triggerSearchInput", first: true, predicate: ["triggerSearchInput"], descendants: true, isSignal: true }, { propertyName: "listView", first: true, predicate: AXLookupListViewBase, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #origin\n class=\"ax-editor-container ax-{{ look() }} ax-default\"\n [class.ax-lookup-trigger]=\"!isEditableTrigger()\"\n [class.ax-lookup-trigger-multiple]=\"isMultiple()\"\n [class.ax-state-disabled]=\"disabled()\"\n [class.ax-state-readonly]=\"readonly()\"\n (click)=\"onTriggerClick()\"\n>\n <ng-content select=\"ax-prefix\"></ng-content>\n\n @if (isMultiple()) {\n <div class=\"ax-lookup-chips\">\n @for (item of selectedItems(); track trackSelectedKey(item)) {\n <span class=\"ax-lookup-chip\">\n @if (selectedTemplate()) {\n <ng-container [ngTemplateOutlet]=\"selectedTemplate()!\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <span class=\"ax-lookup-chip-text\">{{ getItemText(item) }}</span>\n }\n <button\n type=\"button\"\n class=\"ax-lookup-chip-remove\"\n tabindex=\"-1\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeChip($event, item)\"\n >\n <span class=\"ax-icon ax-icon-close\"></span>\n </button>\n </span>\n }\n <input\n #triggerSearchInput\n type=\"text\"\n class=\"ax-input ax-lookup-trigger-search\"\n [class.ax-lookup-select-input]=\"!isEditableTrigger()\"\n [placeholder]=\"triggerSearchPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [value]=\"searchText()\"\n (input)=\"onTriggerSearchInput($any($event.target).value)\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n } @else {\n <div class=\"ax-lookup-value\">\n @if (showSelectedTemplate()) {\n <div class=\"ax-lookup-selected-content\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedItems()[0] }\"\n />\n </div>\n }\n <input\n #triggerSearchInput\n type=\"text\"\n class=\"ax-input\"\n [class.ax-lookup-select-input]=\"!isEditableTrigger()\"\n [class.ax-lookup-input-overlay]=\"showSelectedTemplate()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [value]=\"searchText()\"\n (input)=\"onTriggerSearchInput($any($event.target).value)\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n }\n\n @if (selectedValues().length > 0 && !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 >\n <span\n class=\"ax-icon\"\n [class.ax-icon-chevron-down]=\"!expanded()\"\n [class.ax-icon-chevron-up]=\"expanded()\"\n ></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]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n [width]=\"isActionsheetStyle() ? '100%' : origin.offsetWidth + 'px'\"\n [adaptivityEnabled]=\"isActionsheetStyle()\"\n [disabled]=\"disabled() || readonly()\"\n (onClosed)=\"onPopoverClosed()\"\n>\n <div class=\"ax-lookup-popup\" [class.ax-is-actionsheet]=\"isActionsheetStyle()\" [class.ax-is-alternate]=\"alternate()\" (keydown.escape)=\"close()\">\n @if (isActionsheetStyle()) {\n <ax-header class=\"ax-solid\">\n <ax-title>{{ caption() || placeholder() || ('@acorex:selectbox.popover.title' | translate | async) }}</ax-title>\n <ax-close-button [icon]=\"isMultiple() ? 'ax-icon ax-icon-check' : 'ax-icon ax-icon-close'\"></ax-close-button>\n </ax-header>\n }\n <ng-content select=\"ax-header\"></ng-content>\n @if (expanded()) {\n @switch (mode()) {\n @case ('drop-down-list') {\n <ax-lookup-drop-down-list\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleSinglePick($event)\"\n (navigateOut)=\"onListNavigateOut($event)\"\n />\n }\n @case ('multi-select') {\n <ax-lookup-multi-select\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleMultiToggle($event)\"\n (navigateOut)=\"onListNavigateOut($event)\"\n />\n }\n @case ('drop-down-tree') {\n <ax-lookup-drop-down-tree\n [dataSource]=\"treeDataSource()!\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [nodeTemplate]=\"$any(itemTemplate())\"\n (itemClick)=\"handleSinglePick($event)\"\n />\n }\n @case ('multi-select-tree') {\n <ax-lookup-multi-select-tree\n [dataSource]=\"treeDataSource()!\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [selectionBehavior]=\"treeSelectionBehavior()\"\n [nodeTemplate]=\"$any(itemTemplate())\"\n (selectionChange)=\"handleTreeSelectionChange($event)\"\n />\n }\n @case ('multi-column') {\n <ax-lookup-multi-column\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [columns]=\"columns()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleSinglePick($event)\"\n />\n }\n }\n }\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n</ax-popover>\n", styles: ["@layer properties;@layer components{ax-lookup{display:block;width:100%}ax-lookup .ax-editor-container{justify-content:flex-start;gap:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-editor-container.ax-state-disabled{cursor:not-allowed;opacity:50%}ax-lookup .ax-editor-container.ax-state-disabled .ax-input,ax-lookup .ax-editor-container.ax-state-disabled .ax-editor{cursor:not-allowed}ax-lookup .ax-editor-container.ax-state-readonly{opacity:75%}ax-lookup .ax-lookup-trigger{cursor:pointer;-webkit-user-select:none;user-select:none}ax-lookup .ax-lookup-trigger-multiple{height:auto;min-height:calc(var(--spacing, .25rem) * 9);padding-block:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-lookup-value{position:relative;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-lookup .ax-lookup-select-input{cursor:pointer;caret-color:transparent;-webkit-user-select:none;user-select:none}ax-lookup .ax-lookup-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-lookup .ax-lookup-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-lookup .ax-lookup-chips{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-wrap:wrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-lookup-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-lookup .ax-lookup-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;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-lookup .ax-lookup-placeholder{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 50%,transparent)}}ax-lookup .ax-lookup-chip{display:inline-flex;max-width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-on-surface));padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * .5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}@supports (color: color-mix(in lab,red,red)){ax-lookup .ax-lookup-chip{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}ax-lookup .ax-lookup-chip .ax-lookup-chip-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove{display:flex;width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove:hover{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){ax-lookup .ax-lookup-chip .ax-lookup-chip-remove:hover{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove .ax-icon{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-leading: 1;line-height:1}.ax-lookup-popup{box-sizing:border-box;display:flex;width:100%;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-lookup-popup:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-darkest-surface))}.ax-lookup-popup.ax-is-actionsheet{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-lookup-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-lookup-popup.ax-is-actionsheet>ax-header.ax-solid .ax-icon-check{color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-popup.ax-is-actionsheet>ax-header.ax-solid ax-title{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-lookup-popup>ax-header:not(.ax-solid),.ax-lookup-popup>ax-footer{flex-shrink:0;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-lookup-popup>ax-header:not(.ax-solid){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ax-lookup-popup>ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px}.ax-lookup-viewport{width:100%}.ax-lookup-empty{display:flex;min-height:calc(var(--spacing, .25rem) * 12);width:100%;align-items:center;justify-content:center;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-lookup-empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 60%,transparent)}}.ax-lookup-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-lookup-option-host.ax-state-alternate{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-alternate{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 5%,transparent)}}.ax-lookup-option-host:hover,.ax-lookup-option-host.ax-state-active{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host:hover,.ax-lookup-option-host.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}.ax-lookup-option-host.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-alternate.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}.ax-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}:is(.ax-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-lightest-surface)) 80%,transparent)}}:is(.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-disabled{cursor:not-allowed;opacity:50%}.ax-lookup-option-host.ax-lookup-option-host--check{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3)}.ax-lookup-option-host .ax-lookup-checkbox{pointer-events:none;width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;accent-color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-option-host .ax-lookup-option-loading{width:100%;padding-inline:calc(var(--spacing, .25rem) * 3);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-lookup-option-host .ax-lookup-option-loading{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 50%,transparent)}}.ax-lookup-option{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);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-lookup-option.ax-state-selected{color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-option .ax-lookup-option-text{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-lookup-option .ax-lookup-option-check{flex-shrink:0;color:rgba(var(--ax-sys-color-primary-surface))}ax-lookup-multi-column,.ax-lookup-multi-column{display:block;min-height:calc(var(--spacing, .25rem) * 0);width:100%}:is(ax-lookup-multi-column,.ax-lookup-multi-column) .ax-lookup-multi-column-table,:is(ax-lookup-multi-column,.ax-lookup-multi-column) ax-data-table{height:100%;min-height:calc(var(--spacing, .25rem) * 0);border-style:var(--tw-border-style)!important;border-width:0px!important}:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-selected{background-color:rgba(var(--ax-sys-color-primary-surface))}@supports (color: color-mix(in lab,red,red)){:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-selected{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-surface)) 10%,transparent)}}:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-disabled{pointer-events:none;opacity:50%}.ax-lookup-tree{max-height:calc(var(--spacing, .25rem) * 80);overflow:auto;padding:calc(var(--spacing, .25rem) * 2)}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-leading{syntax: \"*\"; inherits: false;}@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-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-leading: initial;--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-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1$1.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "component", type: i1$1.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: "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: AXLookupDropDownListComponent, selector: "ax-lookup-drop-down-list" }, { kind: "component", type: AXLookupMultiSelectComponent, selector: "ax-lookup-multi-select" }, { kind: "component", type: AXLookupDropDownTreeComponent, selector: "ax-lookup-drop-down-tree", inputs: ["dataSource", "valueField", "textField", "disabledField", "selectedValues", "nodeTemplate"], outputs: ["itemClick"] }, { kind: "component", type: AXLookupMultiSelectTreeComponent, selector: "ax-lookup-multi-select-tree", inputs: ["dataSource", "valueField", "textField", "disabledField", "selectedValues", "selectionBehavior", "nodeTemplate"], outputs: ["selectionChange"] }, { kind: "component", type: AXLookupMultiColumnComponent, selector: "ax-lookup-multi-column", inputs: ["dataSource", "valueField", "textField", "disabledField", "selectedValues", "itemHeight", "maxVisibleItems", "columns", "itemTemplate", "emptyTemplate", "loadingTemplate", "alternate"], outputs: ["itemClick"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1771
|
+
}
|
|
1772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupComponent, decorators: [{
|
|
1773
|
+
type: Component,
|
|
1774
|
+
args: [{ selector: 'ax-lookup', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1775
|
+
NgTemplateOutlet,
|
|
1776
|
+
AsyncPipe,
|
|
1777
|
+
AXTranslatorPipe,
|
|
1778
|
+
AXDecoratorModule,
|
|
1779
|
+
AXPopoverComponent,
|
|
1780
|
+
AXLookupDropDownListComponent,
|
|
1781
|
+
AXLookupMultiSelectComponent,
|
|
1782
|
+
AXLookupDropDownTreeComponent,
|
|
1783
|
+
AXLookupMultiSelectTreeComponent,
|
|
1784
|
+
AXLookupMultiColumnComponent,
|
|
1785
|
+
], providers: [
|
|
1786
|
+
{ provide: AXComponent, useExisting: AXLookupComponent },
|
|
1787
|
+
{ provide: AXClearableComponent, useExisting: AXLookupComponent },
|
|
1788
|
+
{ provide: AXClosableComponent, useExisting: AXLookupComponent },
|
|
1789
|
+
], template: "<div\n #origin\n class=\"ax-editor-container ax-{{ look() }} ax-default\"\n [class.ax-lookup-trigger]=\"!isEditableTrigger()\"\n [class.ax-lookup-trigger-multiple]=\"isMultiple()\"\n [class.ax-state-disabled]=\"disabled()\"\n [class.ax-state-readonly]=\"readonly()\"\n (click)=\"onTriggerClick()\"\n>\n <ng-content select=\"ax-prefix\"></ng-content>\n\n @if (isMultiple()) {\n <div class=\"ax-lookup-chips\">\n @for (item of selectedItems(); track trackSelectedKey(item)) {\n <span class=\"ax-lookup-chip\">\n @if (selectedTemplate()) {\n <ng-container [ngTemplateOutlet]=\"selectedTemplate()!\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <span class=\"ax-lookup-chip-text\">{{ getItemText(item) }}</span>\n }\n <button\n type=\"button\"\n class=\"ax-lookup-chip-remove\"\n tabindex=\"-1\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeChip($event, item)\"\n >\n <span class=\"ax-icon ax-icon-close\"></span>\n </button>\n </span>\n }\n <input\n #triggerSearchInput\n type=\"text\"\n class=\"ax-input ax-lookup-trigger-search\"\n [class.ax-lookup-select-input]=\"!isEditableTrigger()\"\n [placeholder]=\"triggerSearchPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [value]=\"searchText()\"\n (input)=\"onTriggerSearchInput($any($event.target).value)\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n } @else {\n <div class=\"ax-lookup-value\">\n @if (showSelectedTemplate()) {\n <div class=\"ax-lookup-selected-content\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"selectedTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedItems()[0] }\"\n />\n </div>\n }\n <input\n #triggerSearchInput\n type=\"text\"\n class=\"ax-input\"\n [class.ax-lookup-select-input]=\"!isEditableTrigger()\"\n [class.ax-lookup-input-overlay]=\"showSelectedTemplate()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly() || !isEditableTrigger()\"\n [attr.inputmode]=\"isEditableTrigger() ? null : 'none'\"\n [value]=\"searchText()\"\n (input)=\"onTriggerSearchInput($any($event.target).value)\"\n (keydown)=\"onTriggerKeydown($event)\"\n (beforeinput)=\"onBeforeInput($event)\"\n (focus)=\"emitOnFocus($event)\"\n (blur)=\"emitOnBlur($event)\"\n />\n </div>\n }\n\n @if (selectedValues().length > 0 && !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 >\n <span\n class=\"ax-icon\"\n [class.ax-icon-chevron-down]=\"!expanded()\"\n [class.ax-icon-chevron-up]=\"expanded()\"\n ></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]=\"'clickOut'\"\n [placement]=\"'bottom-start'\"\n [width]=\"isActionsheetStyle() ? '100%' : origin.offsetWidth + 'px'\"\n [adaptivityEnabled]=\"isActionsheetStyle()\"\n [disabled]=\"disabled() || readonly()\"\n (onClosed)=\"onPopoverClosed()\"\n>\n <div class=\"ax-lookup-popup\" [class.ax-is-actionsheet]=\"isActionsheetStyle()\" [class.ax-is-alternate]=\"alternate()\" (keydown.escape)=\"close()\">\n @if (isActionsheetStyle()) {\n <ax-header class=\"ax-solid\">\n <ax-title>{{ caption() || placeholder() || ('@acorex:selectbox.popover.title' | translate | async) }}</ax-title>\n <ax-close-button [icon]=\"isMultiple() ? 'ax-icon ax-icon-check' : 'ax-icon ax-icon-close'\"></ax-close-button>\n </ax-header>\n }\n <ng-content select=\"ax-header\"></ng-content>\n @if (expanded()) {\n @switch (mode()) {\n @case ('drop-down-list') {\n <ax-lookup-drop-down-list\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleSinglePick($event)\"\n (navigateOut)=\"onListNavigateOut($event)\"\n />\n }\n @case ('multi-select') {\n <ax-lookup-multi-select\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleMultiToggle($event)\"\n (navigateOut)=\"onListNavigateOut($event)\"\n />\n }\n @case ('drop-down-tree') {\n <ax-lookup-drop-down-tree\n [dataSource]=\"treeDataSource()!\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [nodeTemplate]=\"$any(itemTemplate())\"\n (itemClick)=\"handleSinglePick($event)\"\n />\n }\n @case ('multi-select-tree') {\n <ax-lookup-multi-select-tree\n [dataSource]=\"treeDataSource()!\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [selectionBehavior]=\"treeSelectionBehavior()\"\n [nodeTemplate]=\"$any(itemTemplate())\"\n (selectionChange)=\"handleTreeSelectionChange($event)\"\n />\n }\n @case ('multi-column') {\n <ax-lookup-multi-column\n [dataSource]=\"resolvedDataSource()\"\n [valueField]=\"valueField()\"\n [textField]=\"textField()\"\n [disabledField]=\"disabledField()\"\n [selectedValues]=\"selectedValues()\"\n [itemHeight]=\"itemHeight()\"\n [maxVisibleItems]=\"maxVisibleItems()\"\n [columns]=\"columns()\"\n [itemTemplate]=\"itemTemplate()\"\n [emptyTemplate]=\"emptyTemplate()\"\n [loadingTemplate]=\"loadingTemplate()\"\n [alternate]=\"alternate()\"\n (itemClick)=\"handleSinglePick($event)\"\n />\n }\n }\n }\n <ng-content select=\"ax-footer\"></ng-content>\n </div>\n</ax-popover>\n", styles: ["@layer properties;@layer components{ax-lookup{display:block;width:100%}ax-lookup .ax-editor-container{justify-content:flex-start;gap:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-editor-container.ax-state-disabled{cursor:not-allowed;opacity:50%}ax-lookup .ax-editor-container.ax-state-disabled .ax-input,ax-lookup .ax-editor-container.ax-state-disabled .ax-editor{cursor:not-allowed}ax-lookup .ax-editor-container.ax-state-readonly{opacity:75%}ax-lookup .ax-lookup-trigger{cursor:pointer;-webkit-user-select:none;user-select:none}ax-lookup .ax-lookup-trigger-multiple{height:auto;min-height:calc(var(--spacing, .25rem) * 9);padding-block:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-lookup-value{position:relative;display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;align-items:center;overflow:hidden}ax-lookup .ax-lookup-select-input{cursor:pointer;caret-color:transparent;-webkit-user-select:none;user-select:none}ax-lookup .ax-lookup-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-lookup .ax-lookup-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-lookup .ax-lookup-chips{display:flex;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-wrap:wrap;align-items:center;gap:calc(var(--spacing, .25rem) * 1)}ax-lookup .ax-lookup-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-lookup .ax-lookup-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;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-lookup .ax-lookup-placeholder{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 50%,transparent)}}ax-lookup .ax-lookup-chip{display:inline-flex;max-width:100%;align-items:center;gap:calc(var(--spacing, .25rem) * 1);border-radius:var(--ax-sys-border-radius);background-color:rgba(var(--ax-sys-color-on-surface));padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * .5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}@supports (color: color-mix(in lab,red,red)){ax-lookup .ax-lookup-chip{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}ax-lookup .ax-lookup-chip .ax-lookup-chip-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove{display:flex;width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding:calc(var(--spacing, .25rem) * 0)}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove:hover{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){ax-lookup .ax-lookup-chip .ax-lookup-chip-remove:hover{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}ax-lookup .ax-lookup-chip .ax-lookup-chip-remove .ax-icon{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-leading: 1;line-height:1}.ax-lookup-popup{box-sizing:border-box;display:flex;width:100%;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-lookup-popup:where(.ax-dark,.ax-dark *):not(:where(.ax-light,.ax-light *)){background-color:rgba(var(--ax-sys-color-darkest-surface))}.ax-lookup-popup.ax-is-actionsheet{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-lookup-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-lookup-popup.ax-is-actionsheet>ax-header.ax-solid .ax-icon-check{color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-popup.ax-is-actionsheet>ax-header.ax-solid ax-title{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-lookup-popup>ax-header:not(.ax-solid),.ax-lookup-popup>ax-footer{flex-shrink:0;border-color:rgba(var(--ax-sys-color-border-lightest-surface))}.ax-lookup-popup>ax-header:not(.ax-solid){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.ax-lookup-popup>ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px}.ax-lookup-viewport{width:100%}.ax-lookup-empty{display:flex;min-height:calc(var(--spacing, .25rem) * 12);width:100%;align-items:center;justify-content:center;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-lookup-empty{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 60%,transparent)}}.ax-lookup-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-lookup-option-host.ax-state-alternate{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-alternate{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 5%,transparent)}}.ax-lookup-option-host:hover,.ax-lookup-option-host.ax-state-active{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host:hover,.ax-lookup-option-host.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 10%,transparent)}}.ax-lookup-option-host.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-on-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-alternate.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 15%,transparent)}}.ax-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}:is(.ax-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected,.ax-lookup-option-host.ax-state-selected:hover,.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate,.ax-lookup-option-host.ax-state-selected.ax-state-alternate:hover,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}@supports (color: color-mix(in lab,red,red)){.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-lightest-surface)) 80%,transparent)}}:is(.ax-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-selected.ax-state-active,.ax-lookup-option-host.ax-state-selected.ax-state-alternate.ax-state-active):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-lookup-option-host.ax-state-disabled{cursor:not-allowed;opacity:50%}.ax-lookup-option-host.ax-lookup-option-host--check{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3)}.ax-lookup-option-host .ax-lookup-checkbox{pointer-events:none;width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;accent-color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-option-host .ax-lookup-option-loading{width:100%;padding-inline:calc(var(--spacing, .25rem) * 3);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-lookup-option-host .ax-lookup-option-loading{color:color-mix(in oklab,rgba(var(--ax-sys-color-on-surface)) 50%,transparent)}}.ax-lookup-option{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);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-lookup-option.ax-state-selected{color:rgba(var(--ax-sys-color-primary-surface))}.ax-lookup-option .ax-lookup-option-text{min-width:calc(var(--spacing, .25rem) * 0);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-lookup-option .ax-lookup-option-check{flex-shrink:0;color:rgba(var(--ax-sys-color-primary-surface))}ax-lookup-multi-column,.ax-lookup-multi-column{display:block;min-height:calc(var(--spacing, .25rem) * 0);width:100%}:is(ax-lookup-multi-column,.ax-lookup-multi-column) .ax-lookup-multi-column-table,:is(ax-lookup-multi-column,.ax-lookup-multi-column) ax-data-table{height:100%;min-height:calc(var(--spacing, .25rem) * 0);border-style:var(--tw-border-style)!important;border-width:0px!important}:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-selected{background-color:rgba(var(--ax-sys-color-primary-surface))}@supports (color: color-mix(in lab,red,red)){:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-selected{background-color:color-mix(in oklab,rgba(var(--ax-sys-color-primary-surface)) 10%,transparent)}}:is(ax-lookup-multi-column,.ax-lookup-multi-column) tr.ax-state-disabled{pointer-events:none;opacity:50%}.ax-lookup-tree{max-height:calc(var(--spacing, .25rem) * 80);overflow:auto;padding:calc(var(--spacing, .25rem) * 2)}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-leading{syntax: \"*\"; inherits: false;}@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-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-leading: initial;--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-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1790
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], treeDataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeDataSource", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", 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 }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", 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"] }], itemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemHeight", required: false }] }], maxVisibleItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleItems", required: false }] }], treeSelectionBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeSelectionBehavior", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], selectedTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedTemplate", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], loadingTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTemplate", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], onValueChanged: [{ type: i0.Output, args: ["onValueChanged"] }], onSelectionChanged: [{ type: i0.Output, args: ["onSelectionChanged"] }], 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"] }], popoverRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXPopoverComponent), { isSignal: true }] }], triggerSearchInput: [{ type: i0.ViewChild, args: ['triggerSearchInput', { isSignal: true }] }], listView: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXLookupListViewBase), { isSignal: true }] }] } });
|
|
1791
|
+
|
|
1792
|
+
class AXLookupModule {
|
|
1793
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1794
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXLookupModule, imports: [AXLookupComponent,
|
|
1795
|
+
AXLookupDropDownListComponent,
|
|
1796
|
+
AXLookupMultiSelectComponent,
|
|
1797
|
+
AXLookupDropDownTreeComponent,
|
|
1798
|
+
AXLookupMultiSelectTreeComponent,
|
|
1799
|
+
AXLookupMultiColumnComponent], exports: [AXLookupComponent,
|
|
1800
|
+
AXLookupDropDownListComponent,
|
|
1801
|
+
AXLookupMultiSelectComponent,
|
|
1802
|
+
AXLookupDropDownTreeComponent,
|
|
1803
|
+
AXLookupMultiSelectTreeComponent,
|
|
1804
|
+
AXLookupMultiColumnComponent] }); }
|
|
1805
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupModule, imports: [AXLookupComponent,
|
|
1806
|
+
AXLookupDropDownListComponent,
|
|
1807
|
+
AXLookupMultiSelectComponent,
|
|
1808
|
+
AXLookupDropDownTreeComponent,
|
|
1809
|
+
AXLookupMultiSelectTreeComponent,
|
|
1810
|
+
AXLookupMultiColumnComponent] }); }
|
|
1811
|
+
}
|
|
1812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLookupModule, decorators: [{
|
|
1813
|
+
type: NgModule,
|
|
1814
|
+
args: [{
|
|
1815
|
+
imports: [
|
|
1816
|
+
AXLookupComponent,
|
|
1817
|
+
AXLookupDropDownListComponent,
|
|
1818
|
+
AXLookupMultiSelectComponent,
|
|
1819
|
+
AXLookupDropDownTreeComponent,
|
|
1820
|
+
AXLookupMultiSelectTreeComponent,
|
|
1821
|
+
AXLookupMultiColumnComponent,
|
|
1822
|
+
],
|
|
1823
|
+
exports: [
|
|
1824
|
+
AXLookupComponent,
|
|
1825
|
+
AXLookupDropDownListComponent,
|
|
1826
|
+
AXLookupMultiSelectComponent,
|
|
1827
|
+
AXLookupDropDownTreeComponent,
|
|
1828
|
+
AXLookupMultiSelectTreeComponent,
|
|
1829
|
+
AXLookupMultiColumnComponent,
|
|
1830
|
+
],
|
|
1831
|
+
}]
|
|
1832
|
+
}] });
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Generated bundle index. Do not edit.
|
|
1836
|
+
*/
|
|
1837
|
+
|
|
1838
|
+
export { AXLookupComponent, AXLookupDropDownListComponent, AXLookupDropDownTreeComponent, AXLookupModule, AXLookupMultiColumnComponent, AXLookupMultiSelectComponent, AXLookupMultiSelectTreeComponent };
|
|
1839
|
+
//# sourceMappingURL=acorex-components-lookup.mjs.map
|