@amro93/ngb-select 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, output,
|
|
2
|
+
import { inject, ElementRef, ChangeDetectorRef, input, model, output, contentChild, viewChild, computed, signal, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
6
|
|
|
7
|
-
const NGB_SELECT_VERSION = '0.1.
|
|
7
|
+
const NGB_SELECT_VERSION = '0.1.7';
|
|
8
8
|
|
|
9
9
|
class NgbSelectComponent {
|
|
10
|
-
elementRef;
|
|
11
|
-
cdr;
|
|
12
10
|
static VERSION = NGB_SELECT_VERSION;
|
|
11
|
+
// --- Dependency Injection ---
|
|
12
|
+
elementRef = inject(ElementRef);
|
|
13
|
+
cdr = inject(ChangeDetectorRef);
|
|
13
14
|
// --- Basic & Data Inputs ---
|
|
14
15
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
15
16
|
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -60,7 +61,7 @@ class NgbSelectComponent {
|
|
|
60
61
|
direction = input(undefined, ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
61
62
|
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
62
63
|
variant = input('outlined', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
63
|
-
fluid = input(
|
|
64
|
+
fluid = input(true, ...(ngDevMode ? [{ debugName: "fluid" }] : /* istanbul ignore next */ []));
|
|
64
65
|
scrollHeight = input('200px', ...(ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []));
|
|
65
66
|
style = input(undefined, ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
|
|
66
67
|
styleClass = input(undefined, ...(ngDevMode ? [{ debugName: "styleClass" }] : /* istanbul ignore next */ []));
|
|
@@ -95,25 +96,26 @@ class NgbSelectComponent {
|
|
|
95
96
|
onRemoveChip = output();
|
|
96
97
|
onLazyLoad = output();
|
|
97
98
|
// --- Custom Content Templates ---
|
|
98
|
-
itemTemplate;
|
|
99
|
-
selectedItemTemplate;
|
|
100
|
-
labelTemplate;
|
|
101
|
-
chipTemplate;
|
|
102
|
-
headerCheckboxTemplate;
|
|
103
|
-
headerTemplate;
|
|
104
|
-
footerTemplate;
|
|
105
|
-
groupTemplate;
|
|
106
|
-
emptyTemplate;
|
|
107
|
-
clearIconTemplate;
|
|
108
|
-
dropdownIconTemplate;
|
|
109
|
-
filterIconTemplate;
|
|
99
|
+
itemTemplate = contentChild('item', ...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
100
|
+
selectedItemTemplate = contentChild('selectedItem', ...(ngDevMode ? [{ debugName: "selectedItemTemplate" }] : /* istanbul ignore next */ []));
|
|
101
|
+
labelTemplate = contentChild('label', ...(ngDevMode ? [{ debugName: "labelTemplate" }] : /* istanbul ignore next */ []));
|
|
102
|
+
chipTemplate = contentChild('chip', ...(ngDevMode ? [{ debugName: "chipTemplate" }] : /* istanbul ignore next */ []));
|
|
103
|
+
headerCheckboxTemplate = contentChild('headerCheckbox', ...(ngDevMode ? [{ debugName: "headerCheckboxTemplate" }] : /* istanbul ignore next */ []));
|
|
104
|
+
headerTemplate = contentChild('header', ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
105
|
+
footerTemplate = contentChild('footer', ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
106
|
+
groupTemplate = contentChild('group', ...(ngDevMode ? [{ debugName: "groupTemplate" }] : /* istanbul ignore next */ []));
|
|
107
|
+
emptyTemplate = contentChild('empty', ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
108
|
+
clearIconTemplate = contentChild('clearIcon', ...(ngDevMode ? [{ debugName: "clearIconTemplate" }] : /* istanbul ignore next */ []));
|
|
109
|
+
dropdownIconTemplate = contentChild('dropdownIcon', ...(ngDevMode ? [{ debugName: "dropdownIconTemplate" }] : /* istanbul ignore next */ []));
|
|
110
|
+
filterIconTemplate = contentChild('filterIcon', ...(ngDevMode ? [{ debugName: "filterIconTemplate" }] : /* istanbul ignore next */ []));
|
|
110
111
|
// --- View References ---
|
|
111
|
-
filterInputElement;
|
|
112
|
-
triggerFilterInputElement;
|
|
113
|
-
editableInputElement;
|
|
114
|
-
dropdownMenuElement;
|
|
112
|
+
filterInputElement = viewChild('filterInput', ...(ngDevMode ? [{ debugName: "filterInputElement" }] : /* istanbul ignore next */ []));
|
|
113
|
+
triggerFilterInputElement = viewChild('triggerFilterInput', ...(ngDevMode ? [{ debugName: "triggerFilterInputElement" }] : /* istanbul ignore next */ []));
|
|
114
|
+
editableInputElement = viewChild('editableInput', ...(ngDevMode ? [{ debugName: "editableInputElement" }] : /* istanbul ignore next */ []));
|
|
115
|
+
dropdownMenuElement = viewChild('dropdownMenu', ...(ngDevMode ? [{ debugName: "dropdownMenuElement" }] : /* istanbul ignore next */ []));
|
|
116
|
+
// --- Computed UI & Accessibility State ---
|
|
115
117
|
effectiveSearchPlaceholder = computed(() => {
|
|
116
|
-
return this.searchPlaceholder() || this.filterPlaceholder() || this.placeholder() || 'Search...';
|
|
118
|
+
return (this.searchPlaceholder() || this.filterPlaceholder() || this.placeholder() || 'Search...');
|
|
117
119
|
}, ...(ngDevMode ? [{ debugName: "effectiveSearchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
118
120
|
effectiveDropdownPosition = computed(() => {
|
|
119
121
|
return this.dropdownDirection() || this.direction() || this.dropdownPosition() || 'auto';
|
|
@@ -133,46 +135,199 @@ class NgbSelectComponent {
|
|
|
133
135
|
}, ...(ngDevMode ? [{ debugName: "effectiveFilterValue" }] : /* istanbul ignore next */ []));
|
|
134
136
|
// --- Internal State ---
|
|
135
137
|
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
136
|
-
filteredOptions = signal([], ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
137
138
|
filterValue = signal('', ...(ngDevMode ? [{ debugName: "filterValue" }] : /* istanbul ignore next */ []));
|
|
138
139
|
focusedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
|
|
139
|
-
|
|
140
|
+
// --- Reactive Option Filtering & Transformation ---
|
|
141
|
+
safeOptions = computed(() => {
|
|
142
|
+
const opts = this.options();
|
|
143
|
+
return Array.isArray(opts) ? opts : [];
|
|
144
|
+
}, ...(ngDevMode ? [{ debugName: "safeOptions" }] : /* istanbul ignore next */ []));
|
|
145
|
+
filterFields = computed(() => {
|
|
146
|
+
const filterBy = this.filterBy();
|
|
147
|
+
if (filterBy) {
|
|
148
|
+
return filterBy.split(',').map((f) => f.trim());
|
|
149
|
+
}
|
|
150
|
+
return [this.optionLabel() || 'label'];
|
|
151
|
+
}, ...(ngDevMode ? [{ debugName: "filterFields" }] : /* istanbul ignore next */ []));
|
|
152
|
+
filteredOptions = computed(() => {
|
|
153
|
+
const opts = this.safeOptions();
|
|
154
|
+
const query = this.filterValue();
|
|
155
|
+
if (!query) {
|
|
156
|
+
return opts;
|
|
157
|
+
}
|
|
158
|
+
const mode = this.filterMatchMode();
|
|
159
|
+
const locale = this.filterLocale();
|
|
160
|
+
const normalizeArabic = this.filterNormalizeArabic();
|
|
161
|
+
const fields = this.filterFields();
|
|
162
|
+
const isGroup = this.group();
|
|
163
|
+
const groupChildrenKey = this.optionGroupChildren();
|
|
164
|
+
if (isGroup) {
|
|
165
|
+
return opts
|
|
166
|
+
.map((group) => {
|
|
167
|
+
const children = this.resolveOptionGroupChildren(group);
|
|
168
|
+
const filteredChildren = children.filter((opt) => this.matchesFilter(opt, query, fields, mode, locale, normalizeArabic));
|
|
169
|
+
return {
|
|
170
|
+
...group,
|
|
171
|
+
[groupChildrenKey]: filteredChildren,
|
|
172
|
+
};
|
|
173
|
+
})
|
|
174
|
+
.filter((group) => this.resolveOptionGroupChildren(group).length > 0);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
return opts.filter((opt) => this.matchesFilter(opt, query, fields, mode, locale, normalizeArabic));
|
|
178
|
+
}
|
|
179
|
+
}, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
180
|
+
flatFilteredOptions = computed(() => {
|
|
181
|
+
const filtered = this.filteredOptions();
|
|
182
|
+
if (this.group()) {
|
|
183
|
+
const flat = [];
|
|
184
|
+
for (const grp of filtered) {
|
|
185
|
+
flat.push(...this.resolveOptionGroupChildren(grp));
|
|
186
|
+
}
|
|
187
|
+
return flat;
|
|
188
|
+
}
|
|
189
|
+
return filtered;
|
|
190
|
+
}, ...(ngDevMode ? [{ debugName: "flatFilteredOptions" }] : /* istanbul ignore next */ []));
|
|
191
|
+
isOptionsEmpty = computed(() => {
|
|
192
|
+
const filtered = this.filteredOptions();
|
|
193
|
+
if (filtered.length === 0)
|
|
194
|
+
return true;
|
|
195
|
+
if (this.group()) {
|
|
196
|
+
return filtered.every((grp) => this.resolveOptionGroupChildren(grp).length === 0);
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}, ...(ngDevMode ? [{ debugName: "isOptionsEmpty" }] : /* istanbul ignore next */ []));
|
|
200
|
+
// Flat list of all available options for fast lookup
|
|
201
|
+
flatOptions = computed(() => {
|
|
202
|
+
const opts = this.safeOptions();
|
|
203
|
+
if (this.group()) {
|
|
204
|
+
const flat = [];
|
|
205
|
+
for (const grp of opts) {
|
|
206
|
+
flat.push(...this.resolveOptionGroupChildren(grp));
|
|
207
|
+
}
|
|
208
|
+
return flat;
|
|
209
|
+
}
|
|
210
|
+
return opts;
|
|
211
|
+
}, ...(ngDevMode ? [{ debugName: "flatOptions" }] : /* istanbul ignore next */ []));
|
|
212
|
+
// Fast O(1) Map for option resolution by value or dataKey
|
|
213
|
+
valueToOptionMap = computed(() => {
|
|
214
|
+
const map = new Map();
|
|
215
|
+
const all = this.flatOptions();
|
|
216
|
+
for (const opt of all) {
|
|
217
|
+
const val = this.resolveOptionValue(opt);
|
|
218
|
+
if (val !== null && val !== undefined) {
|
|
219
|
+
map.set(val, opt);
|
|
220
|
+
}
|
|
221
|
+
if (opt !== null && opt !== undefined && typeof opt === 'object') {
|
|
222
|
+
map.set(opt, opt);
|
|
223
|
+
}
|
|
224
|
+
if (typeof val === 'object') {
|
|
225
|
+
const key = this.getLookupKey(val);
|
|
226
|
+
if (key !== undefined) {
|
|
227
|
+
map.set(key, opt);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (opt && typeof opt === 'object') {
|
|
231
|
+
const key = this.getLookupKey(opt);
|
|
232
|
+
if (key !== undefined) {
|
|
233
|
+
map.set(key, opt);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return map;
|
|
238
|
+
}, ...(ngDevMode ? [{ debugName: "valueToOptionMap" }] : /* istanbul ignore next */ []));
|
|
239
|
+
// Fast O(1) Set for multi-select membership checking
|
|
240
|
+
selectedValuesSet = computed(() => {
|
|
241
|
+
const val = this.value();
|
|
242
|
+
const set = new Set();
|
|
243
|
+
if (this.multiple() && Array.isArray(val)) {
|
|
244
|
+
for (const item of val) {
|
|
245
|
+
set.add(item);
|
|
246
|
+
if (item && typeof item === 'object') {
|
|
247
|
+
const key = this.getLookupKey(item);
|
|
248
|
+
if (key !== undefined) {
|
|
249
|
+
set.add(key);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return set;
|
|
255
|
+
}, ...(ngDevMode ? [{ debugName: "selectedValuesSet" }] : /* istanbul ignore next */ []));
|
|
256
|
+
hasSelectedValue = computed(() => {
|
|
257
|
+
const val = this.value();
|
|
258
|
+
if (this.multiple()) {
|
|
259
|
+
return Array.isArray(val) && val.length > 0;
|
|
260
|
+
}
|
|
261
|
+
return val !== null && val !== undefined && val !== '';
|
|
262
|
+
}, ...(ngDevMode ? [{ debugName: "hasSelectedValue" }] : /* istanbul ignore next */ []));
|
|
263
|
+
displayLabel = computed(() => {
|
|
264
|
+
if (!this.hasSelectedValue()) {
|
|
265
|
+
return '';
|
|
266
|
+
}
|
|
267
|
+
if (this.multiple()) {
|
|
268
|
+
const selectedList = Array.isArray(this.value()) ? this.value() : [];
|
|
269
|
+
if (selectedList.length > this.maxSelectedLabels()) {
|
|
270
|
+
return this.selectedItemsLabel().replace('{0}', String(selectedList.length));
|
|
271
|
+
}
|
|
272
|
+
return selectedList.map((val) => this.resolveOptionLabelByValue(val)).join(', ');
|
|
273
|
+
}
|
|
274
|
+
if (this.editable() && typeof this.value() === 'string') {
|
|
275
|
+
return this.value();
|
|
276
|
+
}
|
|
277
|
+
return this.resolveOptionLabelByValue(this.value());
|
|
278
|
+
}, ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
279
|
+
selectAll = computed(() => {
|
|
280
|
+
if (!this.multiple() || !this.showSelectAll())
|
|
281
|
+
return null;
|
|
282
|
+
const targetOptions = this.flatFilteredOptions().filter((opt) => !this.isOptionDisabled(opt));
|
|
283
|
+
if (targetOptions.length === 0)
|
|
284
|
+
return false;
|
|
285
|
+
return targetOptions.every((opt) => this.isSelected(opt));
|
|
286
|
+
}, ...(ngDevMode ? [{ debugName: "selectAll" }] : /* istanbul ignore next */ []));
|
|
287
|
+
focusedOption = computed(() => {
|
|
288
|
+
const idx = this.focusedIndex();
|
|
289
|
+
if (idx < 0)
|
|
290
|
+
return undefined;
|
|
291
|
+
const flat = this.flatFilteredOptions();
|
|
292
|
+
if (idx >= flat.length)
|
|
293
|
+
return undefined;
|
|
294
|
+
return flat[idx];
|
|
295
|
+
}, ...(ngDevMode ? [{ debugName: "focusedOption" }] : /* istanbul ignore next */ []));
|
|
140
296
|
// --- ControlValueAccessor Callbacks ---
|
|
141
297
|
onModelChange = () => { };
|
|
142
298
|
onModelTouched = () => { };
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
effect(() => {
|
|
154
|
-
// React to overlayVisible changes
|
|
155
|
-
const visible = this.overlayVisible();
|
|
156
|
-
if (visible) {
|
|
157
|
-
this.openOverlay();
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
this.closeOverlay();
|
|
299
|
+
unlistenWindow;
|
|
300
|
+
unlistenDocumentClick;
|
|
301
|
+
ngOnInit() {
|
|
302
|
+
const handleWindowReposition = () => {
|
|
303
|
+
if (this.overlayVisible()) {
|
|
304
|
+
this.calculateDropdownPosition();
|
|
305
|
+
if (this.appendTo()) {
|
|
306
|
+
this.repositionOverlay();
|
|
307
|
+
}
|
|
161
308
|
}
|
|
162
|
-
}
|
|
309
|
+
};
|
|
310
|
+
if (typeof window !== 'undefined') {
|
|
311
|
+
window.addEventListener('resize', handleWindowReposition, { passive: true });
|
|
312
|
+
window.addEventListener('scroll', handleWindowReposition, { passive: true, capture: true });
|
|
313
|
+
this.unlistenWindow = () => {
|
|
314
|
+
window.removeEventListener('resize', handleWindowReposition);
|
|
315
|
+
window.removeEventListener('scroll', handleWindowReposition, { capture: true });
|
|
316
|
+
};
|
|
317
|
+
}
|
|
163
318
|
}
|
|
164
|
-
|
|
319
|
+
ngAfterViewInit() {
|
|
165
320
|
if (this.autofocus()) {
|
|
166
|
-
|
|
321
|
+
this.focus();
|
|
167
322
|
}
|
|
168
323
|
}
|
|
169
324
|
ngOnDestroy() {
|
|
325
|
+
if (this.unlistenWindow) {
|
|
326
|
+
this.unlistenWindow();
|
|
327
|
+
}
|
|
328
|
+
this.unbindDocumentClickListener();
|
|
170
329
|
this.cleanAppendTo();
|
|
171
330
|
}
|
|
172
|
-
safeOptions = computed(() => {
|
|
173
|
-
const opts = this.options();
|
|
174
|
-
return Array.isArray(opts) ? opts : [];
|
|
175
|
-
}, ...(ngDevMode ? [{ debugName: "safeOptions" }] : /* istanbul ignore next */ []));
|
|
176
331
|
writeValue(obj) {
|
|
177
332
|
if (this.multiple()) {
|
|
178
333
|
this.value.set(Array.isArray(obj) ? [...obj] : []);
|
|
@@ -180,7 +335,6 @@ class NgbSelectComponent {
|
|
|
180
335
|
else {
|
|
181
336
|
this.value.set(obj !== undefined ? obj : null);
|
|
182
337
|
}
|
|
183
|
-
this.updateSelectAllState();
|
|
184
338
|
this.cdr.markForCheck();
|
|
185
339
|
}
|
|
186
340
|
registerOnChange(fn) {
|
|
@@ -193,28 +347,21 @@ class NgbSelectComponent {
|
|
|
193
347
|
this.disabled.set(isDisabled);
|
|
194
348
|
this.cdr.markForCheck();
|
|
195
349
|
}
|
|
196
|
-
hasSelectedValue = computed(() => {
|
|
197
|
-
const val = this.value();
|
|
198
|
-
if (this.multiple()) {
|
|
199
|
-
return Array.isArray(val) && val.length > 0;
|
|
200
|
-
}
|
|
201
|
-
return val !== null && val !== undefined && val !== '';
|
|
202
|
-
}, ...(ngDevMode ? [{ debugName: "hasSelectedValue" }] : /* istanbul ignore next */ []));
|
|
203
350
|
getDisplayLabel() {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return selectedList.map((val) => this.resolveOptionLabelByValue(val)).join(', ');
|
|
351
|
+
return this.displayLabel();
|
|
352
|
+
}
|
|
353
|
+
resolveOptionTrackKey(option, index) {
|
|
354
|
+
if (option === null || option === undefined)
|
|
355
|
+
return index;
|
|
356
|
+
const val = this.resolveOptionValue(option);
|
|
357
|
+
if (val !== null && val !== undefined && (typeof val === 'string' || typeof val === 'number')) {
|
|
358
|
+
return val;
|
|
213
359
|
}
|
|
214
|
-
|
|
215
|
-
|
|
360
|
+
const dataKey = this.dataKey();
|
|
361
|
+
if (dataKey && typeof option === 'object' && option[dataKey] !== undefined) {
|
|
362
|
+
return option[dataKey];
|
|
216
363
|
}
|
|
217
|
-
return
|
|
364
|
+
return option;
|
|
218
365
|
}
|
|
219
366
|
resolveOptionLabelByValue(val) {
|
|
220
367
|
const selectedOpt = this.findOptionByValue(val);
|
|
@@ -227,8 +374,9 @@ class NgbSelectComponent {
|
|
|
227
374
|
if (option === null || option === undefined)
|
|
228
375
|
return '';
|
|
229
376
|
if (typeof option === 'object') {
|
|
230
|
-
|
|
231
|
-
|
|
377
|
+
const labelKey = this.optionLabel();
|
|
378
|
+
if (labelKey && option[labelKey] !== undefined) {
|
|
379
|
+
return String(option[labelKey]);
|
|
232
380
|
}
|
|
233
381
|
if (option.label !== undefined) {
|
|
234
382
|
return String(option.label);
|
|
@@ -241,8 +389,9 @@ class NgbSelectComponent {
|
|
|
241
389
|
if (option === null || option === undefined)
|
|
242
390
|
return null;
|
|
243
391
|
if (typeof option === 'object') {
|
|
244
|
-
|
|
245
|
-
|
|
392
|
+
const valKey = this.optionValue();
|
|
393
|
+
if (valKey && option[valKey] !== undefined) {
|
|
394
|
+
return option[valKey];
|
|
246
395
|
}
|
|
247
396
|
if (option.value !== undefined) {
|
|
248
397
|
return option.value;
|
|
@@ -250,12 +399,26 @@ class NgbSelectComponent {
|
|
|
250
399
|
}
|
|
251
400
|
return option;
|
|
252
401
|
}
|
|
402
|
+
getLookupKey(val) {
|
|
403
|
+
if (!val || typeof val !== 'object')
|
|
404
|
+
return val;
|
|
405
|
+
const dataKey = this.dataKey();
|
|
406
|
+
if (dataKey && val[dataKey] !== undefined) {
|
|
407
|
+
return `dk:${val[dataKey]}`;
|
|
408
|
+
}
|
|
409
|
+
const valKey = this.optionValue();
|
|
410
|
+
if (valKey && val[valKey] !== undefined) {
|
|
411
|
+
return `ov:${val[valKey]}`;
|
|
412
|
+
}
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
253
415
|
isOptionDisabled(option) {
|
|
254
416
|
if (this.disabled())
|
|
255
417
|
return true;
|
|
256
418
|
if (option && typeof option === 'object') {
|
|
257
|
-
|
|
258
|
-
|
|
419
|
+
const disabledKey = this.optionDisabled();
|
|
420
|
+
if (disabledKey && option[disabledKey] !== undefined) {
|
|
421
|
+
return Boolean(option[disabledKey]);
|
|
259
422
|
}
|
|
260
423
|
return Boolean(option.disabled);
|
|
261
424
|
}
|
|
@@ -264,22 +427,34 @@ class NgbSelectComponent {
|
|
|
264
427
|
resolveOptionGroupLabel(groupOption) {
|
|
265
428
|
if (!groupOption)
|
|
266
429
|
return '';
|
|
267
|
-
|
|
268
|
-
|
|
430
|
+
const groupLabelKey = this.optionGroupLabel();
|
|
431
|
+
if (groupLabelKey && groupOption[groupLabelKey] !== undefined) {
|
|
432
|
+
return String(groupOption[groupLabelKey]);
|
|
269
433
|
}
|
|
270
434
|
return String(groupOption.label || '');
|
|
271
435
|
}
|
|
272
436
|
resolveOptionGroupChildren(groupOption) {
|
|
273
437
|
if (!groupOption)
|
|
274
438
|
return [];
|
|
275
|
-
|
|
276
|
-
|
|
439
|
+
const groupChildrenKey = this.optionGroupChildren();
|
|
440
|
+
if (groupChildrenKey && Array.isArray(groupOption[groupChildrenKey])) {
|
|
441
|
+
return groupOption[groupChildrenKey];
|
|
277
442
|
}
|
|
278
443
|
return Array.isArray(groupOption.items) ? groupOption.items : [];
|
|
279
444
|
}
|
|
280
445
|
findOptionByValue(val) {
|
|
281
446
|
if (val === null || val === undefined)
|
|
282
447
|
return undefined;
|
|
448
|
+
// Fast O(1) lookup from computed map
|
|
449
|
+
const map = this.valueToOptionMap();
|
|
450
|
+
if (map.has(val)) {
|
|
451
|
+
return map.get(val);
|
|
452
|
+
}
|
|
453
|
+
const lookupKey = this.getLookupKey(val);
|
|
454
|
+
if (lookupKey !== undefined && map.has(lookupKey)) {
|
|
455
|
+
return map.get(lookupKey);
|
|
456
|
+
}
|
|
457
|
+
// Fallback scan
|
|
283
458
|
if (this.group()) {
|
|
284
459
|
for (const grp of this.safeOptions()) {
|
|
285
460
|
const children = this.resolveOptionGroupChildren(grp);
|
|
@@ -301,10 +476,9 @@ class NgbSelectComponent {
|
|
|
301
476
|
if (dataKey && val1[dataKey] !== undefined && val2[dataKey] !== undefined) {
|
|
302
477
|
return val1[dataKey] === val2[dataKey];
|
|
303
478
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return val1[this.optionValue()] === val2[this.optionValue()];
|
|
479
|
+
const optVal = this.optionValue();
|
|
480
|
+
if (optVal && val1[optVal] !== undefined && val2[optVal] !== undefined) {
|
|
481
|
+
return val1[optVal] === val2[optVal];
|
|
308
482
|
}
|
|
309
483
|
try {
|
|
310
484
|
return JSON.stringify(val1) === JSON.stringify(val2);
|
|
@@ -317,18 +491,25 @@ class NgbSelectComponent {
|
|
|
317
491
|
}
|
|
318
492
|
isSelected(option) {
|
|
319
493
|
const optVal = this.resolveOptionValue(option);
|
|
320
|
-
if (this.multiple()
|
|
321
|
-
|
|
494
|
+
if (this.multiple()) {
|
|
495
|
+
const set = this.selectedValuesSet();
|
|
496
|
+
if (set.has(optVal))
|
|
497
|
+
return true;
|
|
498
|
+
const lookupKey = this.getLookupKey(optVal);
|
|
499
|
+
if (lookupKey !== undefined && set.has(lookupKey))
|
|
500
|
+
return true;
|
|
501
|
+
const valArr = Array.isArray(this.value()) ? this.value() : [];
|
|
502
|
+
return valArr.some((item) => this.areValuesEqual(item, optVal));
|
|
322
503
|
}
|
|
323
504
|
return this.areValuesEqual(this.value(), optVal);
|
|
324
505
|
}
|
|
325
|
-
|
|
326
|
-
if
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
506
|
+
updateFilteredOptions() {
|
|
507
|
+
// Kept for backward compatibility if called manually
|
|
508
|
+
this.cdr.markForCheck();
|
|
509
|
+
}
|
|
510
|
+
updateSelectAllState() {
|
|
511
|
+
// Select all is now a computed signal
|
|
512
|
+
this.cdr.markForCheck();
|
|
332
513
|
}
|
|
333
514
|
onTriggerClick(event) {
|
|
334
515
|
if (this.disabled() || this.readonly())
|
|
@@ -354,8 +535,9 @@ class NgbSelectComponent {
|
|
|
354
535
|
const spaceBelow = window.innerHeight - triggerRect.bottom;
|
|
355
536
|
const spaceAbove = triggerRect.top;
|
|
356
537
|
let panelHeight = 200;
|
|
357
|
-
|
|
358
|
-
|
|
538
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
539
|
+
if (dropdownMenuEl?.nativeElement?.offsetHeight) {
|
|
540
|
+
panelHeight = dropdownMenuEl.nativeElement.offsetHeight;
|
|
359
541
|
}
|
|
360
542
|
else if (this.scrollHeight()) {
|
|
361
543
|
const parsed = parseInt(this.scrollHeight(), 10);
|
|
@@ -385,40 +567,60 @@ class NgbSelectComponent {
|
|
|
385
567
|
this.overlayVisible.set(true);
|
|
386
568
|
this.onShow.emit(event || null);
|
|
387
569
|
this.onModelTouched();
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
570
|
+
this.bindDocumentClickListener();
|
|
571
|
+
const triggerFilterInputEl = this.triggerFilterInputElement();
|
|
572
|
+
const filterInputEl = this.filterInputElement();
|
|
573
|
+
if (this.filterInTrigger() && triggerFilterInputEl) {
|
|
574
|
+
triggerFilterInputEl.nativeElement.focus();
|
|
575
|
+
}
|
|
576
|
+
else if (this.filter() && filterInputEl) {
|
|
577
|
+
filterInputEl.nativeElement.focus();
|
|
578
|
+
}
|
|
579
|
+
this.handleFocusOnOpen();
|
|
580
|
+
this.handleAppendTo();
|
|
581
|
+
this.cdr.markForCheck();
|
|
400
582
|
}
|
|
401
583
|
closeOverlay(event) {
|
|
402
584
|
if (!this.overlayVisible())
|
|
403
585
|
return;
|
|
586
|
+
this.unbindDocumentClickListener();
|
|
404
587
|
this.overlayVisible.set(false);
|
|
405
588
|
this.onHide.emit(event || null);
|
|
406
589
|
if (this.resetFilterOnHide() && this.filterValue()) {
|
|
407
590
|
this.filterValue.set('');
|
|
408
|
-
this.updateFilteredOptions();
|
|
409
591
|
}
|
|
410
592
|
this.focusedIndex.set(-1);
|
|
411
593
|
this.cdr.markForCheck();
|
|
412
594
|
}
|
|
595
|
+
bindDocumentClickListener() {
|
|
596
|
+
if (typeof document === 'undefined' || this.unlistenDocumentClick)
|
|
597
|
+
return;
|
|
598
|
+
const clickHandler = (event) => {
|
|
599
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
600
|
+
if (!this.elementRef.nativeElement.contains(event.target) &&
|
|
601
|
+
(!dropdownMenuEl ||
|
|
602
|
+
!dropdownMenuEl.nativeElement.contains(event.target))) {
|
|
603
|
+
this.closeOverlay(event);
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
607
|
+
this.unlistenDocumentClick = () => {
|
|
608
|
+
document.removeEventListener('click', clickHandler, { capture: true });
|
|
609
|
+
this.unlistenDocumentClick = undefined;
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
unbindDocumentClickListener() {
|
|
613
|
+
if (this.unlistenDocumentClick) {
|
|
614
|
+
this.unlistenDocumentClick();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
413
617
|
handleFocusOnOpen() {
|
|
414
|
-
const flatItems = this.
|
|
618
|
+
const flatItems = this.flatFilteredOptions();
|
|
415
619
|
let targetIndex = -1;
|
|
416
620
|
const hasSelection = this.hasSelectedValue();
|
|
417
621
|
const selectedIdx = flatItems.findIndex((opt) => this.isSelected(opt));
|
|
418
622
|
const focusOnOpen = this.focusOnOpen();
|
|
419
|
-
if (focusOnOpen !== undefined &&
|
|
420
|
-
focusOnOpen >= 0 &&
|
|
421
|
-
focusOnOpen < flatItems.length) {
|
|
623
|
+
if (focusOnOpen !== undefined && focusOnOpen >= 0 && focusOnOpen < flatItems.length) {
|
|
422
624
|
if (this.focusOnOpenStrategy() === 'notSelected' && hasSelection && selectedIdx !== -1) {
|
|
423
625
|
targetIndex = selectedIdx;
|
|
424
626
|
}
|
|
@@ -429,9 +631,10 @@ class NgbSelectComponent {
|
|
|
429
631
|
else if (this.autoOptionFocus()) {
|
|
430
632
|
targetIndex = selectedIdx !== -1 ? selectedIdx : 0;
|
|
431
633
|
}
|
|
432
|
-
|
|
634
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
635
|
+
if (targetIndex !== -1 && dropdownMenuEl) {
|
|
433
636
|
this.focusedIndex.set(targetIndex);
|
|
434
|
-
const elements =
|
|
637
|
+
const elements = dropdownMenuEl.nativeElement.querySelectorAll('.dropdown-item[role="option"]');
|
|
435
638
|
const targetElement = elements[targetIndex];
|
|
436
639
|
if (targetElement && typeof targetElement.scrollIntoView === 'function') {
|
|
437
640
|
targetElement.scrollIntoView({ block: 'nearest', inline: 'start' });
|
|
@@ -449,13 +652,13 @@ class NgbSelectComponent {
|
|
|
449
652
|
currentSelection.splice(selectedIndex, 1);
|
|
450
653
|
}
|
|
451
654
|
else {
|
|
452
|
-
if (this.selectionLimit() !== undefined &&
|
|
655
|
+
if (this.selectionLimit() !== undefined &&
|
|
656
|
+
currentSelection.length >= this.selectionLimit()) {
|
|
453
657
|
return;
|
|
454
658
|
}
|
|
455
659
|
currentSelection.push(val);
|
|
456
660
|
}
|
|
457
661
|
this.updateModel(currentSelection, event);
|
|
458
|
-
this.updateSelectAllState();
|
|
459
662
|
if (this.closeOnSelect()) {
|
|
460
663
|
this.closeOverlay(event);
|
|
461
664
|
}
|
|
@@ -464,9 +667,9 @@ class NgbSelectComponent {
|
|
|
464
667
|
this.updateModel(val, event);
|
|
465
668
|
if (this.filterInTrigger()) {
|
|
466
669
|
this.filterValue.set('');
|
|
467
|
-
this.
|
|
468
|
-
if (
|
|
469
|
-
|
|
670
|
+
const triggerFilterInputEl = this.triggerFilterInputElement();
|
|
671
|
+
if (triggerFilterInputEl) {
|
|
672
|
+
triggerFilterInputEl.nativeElement.value = '';
|
|
470
673
|
}
|
|
471
674
|
}
|
|
472
675
|
this.closeOverlay(event);
|
|
@@ -480,12 +683,11 @@ class NgbSelectComponent {
|
|
|
480
683
|
const nextVal = this.value().filter((item) => !this.areValuesEqual(item, val));
|
|
481
684
|
this.updateModel(nextVal, event);
|
|
482
685
|
this.onRemoveChip.emit({ originalEvent: event, value: val });
|
|
483
|
-
this.updateSelectAllState();
|
|
484
686
|
}
|
|
485
687
|
}
|
|
486
688
|
toggleSelectAll(event) {
|
|
487
689
|
const checked = event.target.checked;
|
|
488
|
-
const targetOptions = this.
|
|
690
|
+
const targetOptions = this.flatFilteredOptions().filter((opt) => !this.isOptionDisabled(opt));
|
|
489
691
|
if (checked) {
|
|
490
692
|
let allValues = targetOptions.map((opt) => this.resolveOptionValue(opt));
|
|
491
693
|
if (this.selectionLimit() !== undefined) {
|
|
@@ -496,20 +698,9 @@ class NgbSelectComponent {
|
|
|
496
698
|
else {
|
|
497
699
|
this.value.set([]);
|
|
498
700
|
}
|
|
499
|
-
this.selectAll.set(checked);
|
|
500
701
|
this.updateModel(this.value(), event);
|
|
501
702
|
this.onSelectAllChange.emit({ originalEvent: event, checked });
|
|
502
703
|
}
|
|
503
|
-
updateSelectAllState() {
|
|
504
|
-
if (!this.multiple() || !this.showSelectAll())
|
|
505
|
-
return;
|
|
506
|
-
const targetOptions = this.getFlatFilteredOptions().filter((opt) => !this.isOptionDisabled(opt));
|
|
507
|
-
if (targetOptions.length === 0) {
|
|
508
|
-
this.selectAll.set(false);
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
this.selectAll.set(targetOptions.every((opt) => this.isSelected(opt)));
|
|
512
|
-
}
|
|
513
704
|
updateModel(val, event) {
|
|
514
705
|
this.value.set(val);
|
|
515
706
|
this.onModelChange(this.value());
|
|
@@ -525,7 +716,6 @@ class NgbSelectComponent {
|
|
|
525
716
|
return;
|
|
526
717
|
const clearedValue = this.multiple() ? [] : null;
|
|
527
718
|
this.updateModel(clearedValue, event);
|
|
528
|
-
this.updateSelectAllState();
|
|
529
719
|
this.onClear.emit(event);
|
|
530
720
|
}
|
|
531
721
|
onEditableInput(event) {
|
|
@@ -533,61 +723,31 @@ class NgbSelectComponent {
|
|
|
533
723
|
this.updateModel(inputVal, event);
|
|
534
724
|
}
|
|
535
725
|
onEditableFocus(event) {
|
|
536
|
-
|
|
537
|
-
|
|
726
|
+
const editableInputEl = this.editableInputElement();
|
|
727
|
+
if (this.selectOnFocus() && editableInputEl) {
|
|
728
|
+
editableInputEl.nativeElement.select();
|
|
538
729
|
}
|
|
539
730
|
this.onFocus.emit(event);
|
|
540
731
|
}
|
|
541
732
|
onFilterChange(event) {
|
|
542
733
|
const raw = event.target.value || '';
|
|
543
734
|
this.filterValue.set(raw);
|
|
544
|
-
this.updateFilteredOptions();
|
|
545
|
-
this.updateSelectAllState();
|
|
546
735
|
this.onFilter.emit({
|
|
547
736
|
originalEvent: event,
|
|
548
737
|
filter: this.filterValue(),
|
|
549
738
|
});
|
|
550
739
|
}
|
|
551
|
-
|
|
552
|
-
if (!this.filterValue()) {
|
|
553
|
-
this.filteredOptions.set([...this.safeOptions()]);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
const query = this.filterValue();
|
|
557
|
-
if (this.group()) {
|
|
558
|
-
this.filteredOptions.set(this.safeOptions()
|
|
559
|
-
.map((group) => {
|
|
560
|
-
const children = this.resolveOptionGroupChildren(group);
|
|
561
|
-
const filteredChildren = children.filter((opt) => this.matchesFilter(opt, query));
|
|
562
|
-
return {
|
|
563
|
-
...group,
|
|
564
|
-
[this.optionGroupChildren()]: filteredChildren,
|
|
565
|
-
};
|
|
566
|
-
})
|
|
567
|
-
.filter((group) => this.resolveOptionGroupChildren(group).length > 0));
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
this.filteredOptions.set(this.safeOptions().filter((opt) => this.matchesFilter(opt, query)));
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
matchesFilter(option, query) {
|
|
740
|
+
matchesFilter(option, query, fieldsToSearch, matchMode, locale, normalizeArabic = true) {
|
|
574
741
|
if (!option)
|
|
575
742
|
return false;
|
|
576
|
-
const fieldsToSearch = this.getFilterFields();
|
|
577
743
|
return fieldsToSearch.some((field) => {
|
|
578
744
|
const val = this.resolveFieldData(option, field);
|
|
579
745
|
if (val === null || val === undefined)
|
|
580
746
|
return false;
|
|
581
747
|
const stringVal = String(val);
|
|
582
|
-
return this.compareStrings(stringVal, query,
|
|
748
|
+
return this.compareStrings(stringVal, query, matchMode, locale, normalizeArabic);
|
|
583
749
|
});
|
|
584
750
|
}
|
|
585
|
-
getFilterFields() {
|
|
586
|
-
if (this.filterBy()) {
|
|
587
|
-
return this.filterBy().split(',').map((f) => f.trim());
|
|
588
|
-
}
|
|
589
|
-
return [this.optionLabel() || 'label'];
|
|
590
|
-
}
|
|
591
751
|
resolveFieldData(data, field) {
|
|
592
752
|
if (data && field) {
|
|
593
753
|
if (field.indexOf('.') === -1) {
|
|
@@ -615,10 +775,10 @@ class NgbSelectComponent {
|
|
|
615
775
|
.replace(/[يى]/g, 'ي') // Normalize Yaa & Alef Maksura
|
|
616
776
|
.replace(/[ة]/g, 'ه'); // Normalize Taa Marbuta
|
|
617
777
|
}
|
|
618
|
-
compareStrings(val, query, mode, locale) {
|
|
778
|
+
compareStrings(val, query, mode, locale, normalizeArabic = true) {
|
|
619
779
|
let v = locale ? val.toLocaleLowerCase(locale) : val.toLowerCase();
|
|
620
780
|
let q = locale ? query.toLocaleLowerCase(locale) : query.toLowerCase();
|
|
621
|
-
if (
|
|
781
|
+
if (normalizeArabic) {
|
|
622
782
|
v = this.normalizeArabicText(v);
|
|
623
783
|
q = this.normalizeArabicText(q);
|
|
624
784
|
}
|
|
@@ -637,14 +797,7 @@ class NgbSelectComponent {
|
|
|
637
797
|
}
|
|
638
798
|
}
|
|
639
799
|
getFlatFilteredOptions() {
|
|
640
|
-
|
|
641
|
-
const flat = [];
|
|
642
|
-
for (const grp of this.filteredOptions()) {
|
|
643
|
-
flat.push(...this.resolveOptionGroupChildren(grp));
|
|
644
|
-
}
|
|
645
|
-
return flat;
|
|
646
|
-
}
|
|
647
|
-
return this.filteredOptions();
|
|
800
|
+
return this.flatFilteredOptions();
|
|
648
801
|
}
|
|
649
802
|
onKeydown(event) {
|
|
650
803
|
if (this.disabled() || this.readonly())
|
|
@@ -671,9 +824,9 @@ class NgbSelectComponent {
|
|
|
671
824
|
case 'Enter':
|
|
672
825
|
case ' ':
|
|
673
826
|
if (event.key === ' ' &&
|
|
674
|
-
((this.filter() && this.filterInputElement?.nativeElement === document.activeElement) ||
|
|
827
|
+
((this.filter() && this.filterInputElement()?.nativeElement === document.activeElement) ||
|
|
675
828
|
(this.filterInTrigger() &&
|
|
676
|
-
this.triggerFilterInputElement?.nativeElement === document.activeElement))) {
|
|
829
|
+
this.triggerFilterInputElement()?.nativeElement === document.activeElement))) {
|
|
677
830
|
return;
|
|
678
831
|
}
|
|
679
832
|
event.preventDefault();
|
|
@@ -681,9 +834,10 @@ class NgbSelectComponent {
|
|
|
681
834
|
this.openOverlay(event);
|
|
682
835
|
}
|
|
683
836
|
else {
|
|
684
|
-
const flatItems = this.
|
|
685
|
-
|
|
686
|
-
|
|
837
|
+
const flatItems = this.flatFilteredOptions();
|
|
838
|
+
const focusedIdx = this.focusedIndex();
|
|
839
|
+
if (focusedIdx >= 0 && focusedIdx < flatItems.length) {
|
|
840
|
+
this.onOptionClick(flatItems[focusedIdx], event);
|
|
687
841
|
}
|
|
688
842
|
}
|
|
689
843
|
break;
|
|
@@ -709,7 +863,7 @@ class NgbSelectComponent {
|
|
|
709
863
|
}
|
|
710
864
|
}
|
|
711
865
|
navigateOption(step) {
|
|
712
|
-
const flatItems = this.
|
|
866
|
+
const flatItems = this.flatFilteredOptions();
|
|
713
867
|
if (flatItems.length === 0)
|
|
714
868
|
return;
|
|
715
869
|
let nextIdx = this.focusedIndex() + step;
|
|
@@ -724,8 +878,9 @@ class NgbSelectComponent {
|
|
|
724
878
|
}
|
|
725
879
|
if (nextIdx >= 0 && nextIdx < flatItems.length) {
|
|
726
880
|
this.focusedIndex.set(nextIdx);
|
|
727
|
-
|
|
728
|
-
|
|
881
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
882
|
+
if (dropdownMenuEl) {
|
|
883
|
+
const elements = dropdownMenuEl.nativeElement.querySelectorAll('.dropdown-item[role="option"]');
|
|
729
884
|
const targetElement = elements[nextIdx];
|
|
730
885
|
if (targetElement && typeof targetElement.scrollIntoView === 'function') {
|
|
731
886
|
targetElement.scrollIntoView({ block: 'nearest', inline: 'start' });
|
|
@@ -734,19 +889,19 @@ class NgbSelectComponent {
|
|
|
734
889
|
}
|
|
735
890
|
}
|
|
736
891
|
isOptionFocused(option) {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
const flat = this.getFlatFilteredOptions();
|
|
740
|
-
if (this.focusedIndex() >= flat.length)
|
|
892
|
+
const focused = this.focusedOption();
|
|
893
|
+
if (focused === undefined || option === undefined)
|
|
741
894
|
return false;
|
|
742
|
-
|
|
895
|
+
if (focused === option)
|
|
896
|
+
return true;
|
|
897
|
+
return this.areValuesEqual(this.resolveOptionValue(focused), this.resolveOptionValue(option));
|
|
743
898
|
}
|
|
744
899
|
onOverlayScroll(event) {
|
|
745
900
|
if (!this.lazy())
|
|
746
901
|
return;
|
|
747
902
|
const target = event.target;
|
|
748
903
|
if (target.scrollTop + target.clientHeight >= target.scrollHeight - 10) {
|
|
749
|
-
const flat = this.
|
|
904
|
+
const flat = this.flatFilteredOptions();
|
|
750
905
|
this.onLazyLoad.emit({
|
|
751
906
|
first: flat.length,
|
|
752
907
|
last: flat.length + 10,
|
|
@@ -755,23 +910,25 @@ class NgbSelectComponent {
|
|
|
755
910
|
}
|
|
756
911
|
handleAppendTo() {
|
|
757
912
|
const appendTo = this.appendTo();
|
|
758
|
-
|
|
913
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
914
|
+
if (!appendTo || !dropdownMenuEl)
|
|
759
915
|
return;
|
|
760
916
|
if (appendTo === 'body') {
|
|
761
|
-
document.body.appendChild(
|
|
917
|
+
document.body.appendChild(dropdownMenuEl.nativeElement);
|
|
762
918
|
this.repositionOverlay();
|
|
763
919
|
}
|
|
764
920
|
else if (appendTo instanceof HTMLElement) {
|
|
765
|
-
appendTo.appendChild(
|
|
921
|
+
appendTo.appendChild(dropdownMenuEl.nativeElement);
|
|
766
922
|
this.repositionOverlay();
|
|
767
923
|
}
|
|
768
924
|
}
|
|
769
925
|
repositionOverlay() {
|
|
770
|
-
|
|
926
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
927
|
+
if (!dropdownMenuEl || this.isModalMode())
|
|
771
928
|
return;
|
|
772
929
|
this.calculateDropdownPosition();
|
|
773
930
|
const triggerRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
774
|
-
const dropdown =
|
|
931
|
+
const dropdown = dropdownMenuEl.nativeElement;
|
|
775
932
|
dropdown.style.position = 'fixed';
|
|
776
933
|
dropdown.style.left = `${triggerRect.left}px`;
|
|
777
934
|
dropdown.style.width = `${triggerRect.width}px`;
|
|
@@ -789,8 +946,9 @@ class NgbSelectComponent {
|
|
|
789
946
|
}
|
|
790
947
|
}
|
|
791
948
|
cleanAppendTo() {
|
|
792
|
-
|
|
793
|
-
|
|
949
|
+
const dropdownMenuEl = this.dropdownMenuElement();
|
|
950
|
+
if (this.appendTo() && dropdownMenuEl) {
|
|
951
|
+
const el = dropdownMenuEl.nativeElement;
|
|
794
952
|
if (el.parentElement) {
|
|
795
953
|
el.parentElement.removeChild(el);
|
|
796
954
|
}
|
|
@@ -803,11 +961,13 @@ class NgbSelectComponent {
|
|
|
803
961
|
this.onBlur.emit(event);
|
|
804
962
|
}
|
|
805
963
|
focus() {
|
|
806
|
-
|
|
807
|
-
|
|
964
|
+
const triggerFilterInputEl = this.triggerFilterInputElement();
|
|
965
|
+
const editableInputEl = this.editableInputElement();
|
|
966
|
+
if (this.filterInTrigger() && triggerFilterInputEl) {
|
|
967
|
+
triggerFilterInputEl.nativeElement.focus();
|
|
808
968
|
}
|
|
809
|
-
else if (this.editable() && !this.multiple() &&
|
|
810
|
-
|
|
969
|
+
else if (this.editable() && !this.multiple() && editableInputEl) {
|
|
970
|
+
editableInputEl.nativeElement.focus();
|
|
811
971
|
}
|
|
812
972
|
else {
|
|
813
973
|
const trigger = this.elementRef.nativeElement.querySelector('.form-select');
|
|
@@ -815,107 +975,25 @@ class NgbSelectComponent {
|
|
|
815
975
|
trigger.focus();
|
|
816
976
|
}
|
|
817
977
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
this.calculateDropdownPosition();
|
|
821
|
-
if (this.appendTo()) {
|
|
822
|
-
this.repositionOverlay();
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
onWindowScroll() {
|
|
827
|
-
if (this.overlayVisible()) {
|
|
828
|
-
this.calculateDropdownPosition();
|
|
829
|
-
if (this.appendTo()) {
|
|
830
|
-
this.repositionOverlay();
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
onDocumentClick(event) {
|
|
835
|
-
if (this.overlayVisible() && !this.elementRef.nativeElement.contains(event.target)) {
|
|
836
|
-
if (this.dropdownMenuElement &&
|
|
837
|
-
this.dropdownMenuElement.nativeElement.contains(event.target)) {
|
|
838
|
-
return;
|
|
839
|
-
}
|
|
840
|
-
this.closeOverlay(event);
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: NgbSelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
844
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: NgbSelectComponent, isStandalone: true, selector: "ngb-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionGroupLabel: { classPropertyName: "optionGroupLabel", publicName: "optionGroupLabel", isSignal: true, isRequired: false, transformFunction: null }, optionGroupChildren: { classPropertyName: "optionGroupChildren", publicName: "optionGroupChildren", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsLabel: { classPropertyName: "selectedItemsLabel", publicName: "selectedItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, selectionLimit: { classPropertyName: "selectionLimit", publicName: "selectionLimit", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterLocale: { classPropertyName: "filterLocale", publicName: "filterLocale", isSignal: true, isRequired: false, transformFunction: null }, filterNormalizeArabic: { classPropertyName: "filterNormalizeArabic", publicName: "filterNormalizeArabic", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterInTrigger: { classPropertyName: "filterInTrigger", publicName: "filterInTrigger", isSignal: true, isRequired: false, transformFunction: null }, resetFilterOnHide: { classPropertyName: "resetFilterOnHide", publicName: "resetFilterOnHide", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", 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 }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelVariant: { classPropertyName: "floatLabelVariant", publicName: "floatLabelVariant", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, dropdownDirection: { classPropertyName: "dropdownDirection", publicName: "dropdownDirection", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: true, isRequired: false, transformFunction: null }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, popup: { classPropertyName: "popup", publicName: "popup", isSignal: true, isRequired: false, transformFunction: null }, touchUI: { classPropertyName: "touchUI", publicName: "touchUI", isSignal: true, isRequired: false, transformFunction: null }, popupTitle: { classPropertyName: "popupTitle", publicName: "popupTitle", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, autoOptionFocus: { classPropertyName: "autoOptionFocus", publicName: "autoOptionFocus", isSignal: true, isRequired: false, transformFunction: null }, focusOnOpen: { classPropertyName: "focusOnOpen", publicName: "focusOnOpen", isSignal: true, isRequired: false, transformFunction: null }, focusOnOpenStrategy: { classPropertyName: "focusOnOpenStrategy", publicName: "focusOnOpenStrategy", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, overlayVisible: { classPropertyName: "overlayVisible", publicName: "overlayVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", overlayVisible: "overlayVisibleChange", onChange: "onChange", onFilter: "onFilter", onFocus: "onFocus", onBlur: "onBlur", onShow: "onShow", onHide: "onHide", onClear: "onClear", onSelectAllChange: "onSelectAllChange", onRemoveChip: "onRemoveChip", onLazyLoad: "onLazyLoad" }, host: { listeners: { "window:resize": "onWindowResize()", "window:scroll": "onWindowScroll()", "document:click": "onDocumentClick($event)" } }, providers: [
|
|
978
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: NgbSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
979
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: NgbSelectComponent, isStandalone: true, selector: "ngb-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionGroupLabel: { classPropertyName: "optionGroupLabel", publicName: "optionGroupLabel", isSignal: true, isRequired: false, transformFunction: null }, optionGroupChildren: { classPropertyName: "optionGroupChildren", publicName: "optionGroupChildren", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsLabel: { classPropertyName: "selectedItemsLabel", publicName: "selectedItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, selectionLimit: { classPropertyName: "selectionLimit", publicName: "selectionLimit", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, filterMatchMode: { classPropertyName: "filterMatchMode", publicName: "filterMatchMode", isSignal: true, isRequired: false, transformFunction: null }, filterLocale: { classPropertyName: "filterLocale", publicName: "filterLocale", isSignal: true, isRequired: false, transformFunction: null }, filterNormalizeArabic: { classPropertyName: "filterNormalizeArabic", publicName: "filterNormalizeArabic", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterInTrigger: { classPropertyName: "filterInTrigger", publicName: "filterInTrigger", isSignal: true, isRequired: false, transformFunction: null }, resetFilterOnHide: { classPropertyName: "resetFilterOnHide", publicName: "resetFilterOnHide", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterMessage: { classPropertyName: "emptyFilterMessage", publicName: "emptyFilterMessage", 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 }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelVariant: { classPropertyName: "floatLabelVariant", publicName: "floatLabelVariant", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, dropdownDirection: { classPropertyName: "dropdownDirection", publicName: "dropdownDirection", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, panelStyle: { classPropertyName: "panelStyle", publicName: "panelStyle", isSignal: true, isRequired: false, transformFunction: null }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, popup: { classPropertyName: "popup", publicName: "popup", isSignal: true, isRequired: false, transformFunction: null }, touchUI: { classPropertyName: "touchUI", publicName: "touchUI", isSignal: true, isRequired: false, transformFunction: null }, popupTitle: { classPropertyName: "popupTitle", publicName: "popupTitle", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, autoOptionFocus: { classPropertyName: "autoOptionFocus", publicName: "autoOptionFocus", isSignal: true, isRequired: false, transformFunction: null }, focusOnOpen: { classPropertyName: "focusOnOpen", publicName: "focusOnOpen", isSignal: true, isRequired: false, transformFunction: null }, focusOnOpenStrategy: { classPropertyName: "focusOnOpenStrategy", publicName: "focusOnOpenStrategy", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, overlayVisible: { classPropertyName: "overlayVisible", publicName: "overlayVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", overlayVisible: "overlayVisibleChange", onChange: "onChange", onFilter: "onFilter", onFocus: "onFocus", onBlur: "onBlur", onShow: "onShow", onHide: "onHide", onClear: "onClear", onSelectAllChange: "onSelectAllChange", onRemoveChip: "onRemoveChip", onLazyLoad: "onLazyLoad" }, providers: [
|
|
845
980
|
{
|
|
846
981
|
provide: NG_VALUE_ACCESSOR,
|
|
847
982
|
useExisting: forwardRef(() => NgbSelectComponent),
|
|
848
983
|
multi: true,
|
|
849
984
|
},
|
|
850
|
-
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true }, { propertyName: "selectedItemTemplate", first: true, predicate: ["selectedItem"], descendants: true }, { propertyName: "labelTemplate", first: true, predicate: ["label"], descendants: true }, { propertyName: "chipTemplate", first: true, predicate: ["chip"], descendants: true }, { propertyName: "headerCheckboxTemplate", first: true, predicate: ["headerCheckbox"], descendants: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true }, { propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true }, { propertyName: "clearIconTemplate", first: true, predicate: ["clearIcon"], descendants: true }, { propertyName: "dropdownIconTemplate", first: true, predicate: ["dropdownIcon"], descendants: true }, { propertyName: "filterIconTemplate", first: true, predicate: ["filterIcon"], descendants: true }], viewQueries: [{ propertyName: "filterInputElement", first: true, predicate: ["filterInput"], descendants: true }, { propertyName: "triggerFilterInputElement", first: true, predicate: ["triggerFilterInput"], descendants: true }, { propertyName: "editableInputElement", first: true, predicate: ["editableInput"], descendants: true }, { propertyName: "dropdownMenuElement", first: true, predicate: ["dropdownMenu"], descendants: true }], ngImport: i0, template: "<div\n class=\"ngb-select-container position-relative\"\n [class.form-floating]=\"floatLabel()\"\n [class.float-variant-on]=\"floatLabel() && floatLabelVariant() === 'on'\"\n [class.float-variant-in]=\"floatLabel() && floatLabelVariant() === 'in'\"\n [class.float-variant-over]=\"floatLabel() && floatLabelVariant() === 'over'\"\n [class.floating-active]=\"hasSelectedValue() || overlayVisible()\"\n [class.dropup]=\"isDropup()\"\n [class.dropdown-up]=\"isDropup()\"\n [class.w-100]=\"fluid()\"\n [attr.dir]=\"dir() || null\"\n [ngStyle]=\"style()\"\n [ngClass]=\"styleClass()\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Select Trigger Box -->\n <div\n class=\"form-select d-flex align-items-center justify-content-between\"\n [class.is-invalid]=\"invalid()\"\n [class.disabled]=\"disabled()\"\n [class.form-select-sm]=\"size() === 'small'\"\n [class.form-select-lg]=\"size() === 'large'\"\n [class.bg-light]=\"variant() === 'filled'\"\n [attr.id]=\"id()\"\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [attr.aria-haspopup]=\"'listbox'\"\n role=\"combobox\"\n (click)=\"onTriggerClick($event)\"\n (focus)=\"onTriggerFocus($event)\"\n (blur)=\"onTriggerBlur($event)\"\n >\n <!-- Selected Value / Input / Chips Area -->\n <span class=\"text-truncate flex-grow-1 me-2 d-flex flex-wrap align-items-center gap-1\">\n <!-- Filter directly in Trigger Box -->\n @if (filterInTrigger()) {\n <!-- Chips in multiple mode when filterInTrigger is active -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n }\n <!-- Search Filter Input embedded inside the trigger -->\n <input\n #triggerFilterInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none flex-grow-1\"\n style=\"min-width: 80px\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"effectiveFilterValue()\"\n [placeholder]=\"\n multiple() && hasSelectedValue()\n ? ''\n : hasSelectedValue() && !overlayVisible()\n ? getDisplayLabel()\n : effectiveSearchPlaceholder()\n \"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n (focus)=\"openOverlay($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Editable Input (Single mode only) -->\n @if (editable() && !multiple()) {\n <input\n #editableInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"getDisplayLabel()\"\n [placeholder]=\"placeholder() || ''\"\n (input)=\"onEditableInput($event)\"\n (focus)=\"onEditableFocus($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Multi-Select Chips Display Mode -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n } @else {\n @if (hasSelectedValue()) {\n @if (selectedItemTemplate || labelTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n selectedItemTemplate || labelTemplate;\n context: { $implicit: findOptionByValue(value()) ?? value(), value: value() }\n \"\n ></ng-container>\n } @else {\n <span>{{ getDisplayLabel() }}</span>\n }\n } @else {\n <span class=\"text-muted\">{{ floatLabel() ? '' : placeholder() || '' }}</span>\n }\n }\n <!-- Standard Single or Comma Multi-Select Text -->\n }\n }\n </span>\n\n <!-- Icons & Spinners Area -->\n <div class=\"d-flex align-items-center flex-shrink-0 gap-1 ms-auto\">\n <!-- Clear Icon -->\n @if (showClear() && hasSelectedValue() && !disabled() && !readonly()) {\n <span\n class=\"ngb-select-clear-icon text-muted me-1\"\n (click)=\"onClearClick($event)\"\n title=\"Clear\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Clear value\"\n >\n @if (clearIconTemplate) {\n <ng-container *ngTemplateOutlet=\"clearIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-x-circle-fill\"></i>\n }\n </span>\n }\n\n <!-- Loading Spinner -->\n @if (loading()) {\n <div class=\"spinner-border spinner-border-sm text-secondary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n }\n\n <!-- Dropdown Caret Icon -->\n @if (!loading()) {\n <span class=\"ngb-select-dropdown-icon text-secondary\">\n @if (dropdownIconTemplate) {\n <ng-container *ngTemplateOutlet=\"dropdownIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-chevron-down\" [class.rotate-180]=\"overlayVisible()\"></i>\n }\n </span>\n }\n </div>\n </div>\n\n <!-- Float Label Support -->\n @if (floatLabel() && placeholder()) {\n <label [attr.for]=\"id()\">{{ placeholder() }}</label>\n }\n\n <ng-template #dropdownContent>\n <!-- Header Template -->\n @if (headerTemplate) {\n <div class=\"p-2 border-bottom\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n }\n\n <!-- Header: Select All Checkbox & Search / Filter Box -->\n @if ((filter() && !filterInTrigger()) || (multiple() && showSelectAll())) {\n <div class=\"p-2 border-bottom bg-light bg-opacity-50\">\n <!-- Select All Checkbox -->\n @if (multiple() && showSelectAll()) {\n <div class=\"d-flex align-items-center mb-2 px-1\">\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0 cursor-pointer\"\n [checked]=\"selectAll()\"\n (change)=\"toggleSelectAll($event)\"\n id=\"selectAllCheckbox\"\n />\n <label\n class=\"form-check-label small fw-semibold cursor-pointer user-select-none\"\n for=\"selectAllCheckbox\"\n >\n @if (headerCheckboxTemplate) {\n <ng-container\n *ngTemplateOutlet=\"headerCheckboxTemplate; context: { $implicit: selectAll() }\"\n ></ng-container>\n } @else {\n Select All\n }\n </label>\n </div>\n }\n <!-- Search Box -->\n @if (filter() && !filterInTrigger()) {\n <div class=\"input-group input-group-sm\">\n <span class=\"input-group-text bg-transparent border-end-0\">\n @if (filterIconTemplate) {\n <ng-container *ngTemplateOutlet=\"filterIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-search text-muted\"></i>\n }\n </span>\n <input\n #filterInput\n type=\"text\"\n class=\"form-control border-start-0\"\n [placeholder]=\"effectiveSearchPlaceholder()\"\n [value]=\"filterValue()\"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n </div>\n }\n </div>\n }\n\n <!-- Grouped Options Mode -->\n @if (group()) {\n @for (groupOption of filteredOptions(); track groupOption) {\n <div>\n <!-- Group Header -->\n <h6\n class=\"dropdown-header text-muted py-2 px-3 m-0 bg-light bg-opacity-75 d-flex align-items-center\"\n >\n @if (groupTemplate) {\n <ng-container\n *ngTemplateOutlet=\"groupTemplate; context: { $implicit: groupOption }\"\n ></ng-container>\n } @else {\n {{ resolveOptionGroupLabel(groupOption) }}\n }\n </h6>\n <!-- Group Items -->\n @for (option of resolveOptionGroupChildren(groupOption); track option) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n </div>\n }\n } @else {\n @for (option of filteredOptions(); track option; let i = $index) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n }\n\n <!-- Empty State Message -->\n @if (isOptionsEmpty()) {\n <div class=\"dropdown-item text-muted text-center py-3\">\n @if (emptyTemplate) {\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n } @else {\n <small>{{\n filterValue()\n ? emptyFilterMessage() || 'No results found'\n : emptyMessage() || 'No results found'\n }}</small>\n }\n </div>\n }\n </ng-template>\n\n @if (isModalMode()) {\n <!-- Bootstrap Modal Overlay -->\n @if (overlayVisible()) {\n <div\n class=\"modal fade show d-block\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-modal=\"true\"\n style=\"background-color: rgba(0, 0, 0, 0.45); z-index: 1075\"\n (click)=\"closeOverlay($event)\"\n >\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\"\n role=\"document\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"modal-content shadow\" [ngClass]=\"panelStyleClass()\" [ngStyle]=\"panelStyle()\">\n <!-- Modal Header -->\n <div class=\"modal-header bg-light bg-opacity-50 py-2 px-3\">\n <h6 class=\"modal-title m-0 fw-semibold text-truncate\">{{ effectivePopupTitle() }}</h6>\n <button\n type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"closeOverlay($event)\"\n ></button>\n </div>\n\n <!-- Modal Body (Options Content) -->\n <div\n class=\"modal-body p-0\"\n #dropdownMenu\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n </div>\n\n <!-- Modal Footer (Custom Template or Done Button) -->\n @if (footerTemplate || multiple()) {\n <div\n class=\"modal-footer p-2 bg-light bg-opacity-50 d-flex align-items-center justify-content-end\"\n >\n @if (footerTemplate) {\n <div class=\"w-100\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-primary px-3\"\n (click)=\"closeOverlay($event)\"\n >\n Done\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n } @else {\n <!-- Standard Dropdown Menu -->\n <div\n #dropdownMenu\n class=\"dropdown-menu shadow-sm p-0\"\n [class.show]=\"overlayVisible()\"\n [ngStyle]=\"panelStyle()\"\n [ngClass]=\"panelStyleClass()\"\n [style.max-height]=\"scrollHeight()\"\n style=\"overflow-y: auto\"\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n\n <!-- Footer Template -->\n @if (footerTemplate) {\n <div class=\"p-2 border-top\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}:host.inline{display:inline-block;width:auto}.ngb-select-container{position:relative;-webkit-user-select:none;user-select:none;width:100%}.ngb-select-container .form-select{cursor:pointer;min-height:38px;background-image:none;padding-right:.75rem;padding-left:.75rem}.ngb-select-container .form-select.form-select-sm{min-height:31px;padding-right:.5rem;padding-left:.5rem}.ngb-select-container .form-select.form-select-lg{min-height:48px;padding-right:1rem;padding-left:1rem}.ngb-select-container .form-select.disabled,.ngb-select-container .form-select:disabled{cursor:not-allowed;background-color:var(--bs-secondary-bg);opacity:.65}.ngb-select-container.form-floating{display:block;width:100%;position:relative}.ngb-select-container.form-floating.float-variant-on,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over){margin-top:.35rem}.ngb-select-container.form-floating.float-variant-on .form-select,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-sm,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-sm{min-height:31px;padding-top:.25rem;padding-bottom:.25rem}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-lg,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-lg{min-height:48px;padding-top:.5rem;padding-bottom:.5rem}.ngb-select-container.form-floating.float-variant-on>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over)>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0 .35rem;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;border-radius:var(--bs-border-radius);background-color:transparent;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out,background-color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-on.floating-active>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over).floating-active>label{top:0;transform:translateY(-50%) scale(.85);background-color:var(--bs-body-bg);color:var(--bs-primary);font-weight:600}.ngb-select-container.form-floating.float-variant-in .form-select{height:calc(3.5rem + 2px);min-height:calc(3.5rem + 2px);padding:1.625rem .75rem .5rem;align-items:flex-end}.ngb-select-container.form-floating.float-variant-in>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:var(--bs-border-width) solid transparent;transform-origin:0 0;transition:opacity .15s ease-in-out,transform .15s ease-in-out,color .15s ease-in-out;color:rgba(var(--bs-body-color-rgb),.65);transform:scale(1) translateY(0)}.ngb-select-container.form-floating.float-variant-in.floating-active>label{transform:scale(.85) translateY(-.65rem) translate(.15rem);color:var(--bs-primary);font-weight:500}.ngb-select-container.form-floating.float-variant-over{margin-top:1.25rem}.ngb-select-container.form-floating.float-variant-over .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-sm{min-height:31px}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-lg{min-height:48px}.ngb-select-container.form-floating.float-variant-over>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-over.floating-active>label{top:-.75rem;transform:scale(.85);color:var(--bs-primary);font-weight:600}.ngb-select-container .ngb-select-clear-icon,.ngb-select-container .ngb-select-dropdown-icon{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1;font-size:.875rem}.ngb-select-container .ngb-select-clear-icon i,.ngb-select-container .ngb-select-dropdown-icon i{transition:transform .2s ease-in-out}.ngb-select-container .ngb-select-clear-icon i.rotate-180,.ngb-select-container .ngb-select-dropdown-icon i.rotate-180{transform:rotate(180deg)}.ngb-select-container .ngb-select-clear-icon{opacity:.6;transition:opacity .15s ease}.ngb-select-container .ngb-select-clear-icon:hover{opacity:1}.ngb-select-container.dropup .dropdown-menu,.ngb-select-container.dropdown-up .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropdown-menu{top:100%;left:0;width:100%;min-width:100%;margin-top:.125rem;z-index:1060;box-sizing:border-box;text-align:inherit}.dropdown-menu .dropdown-item{cursor:pointer;white-space:normal;word-break:break-word;text-align:inherit}.dropdown-menu .dropdown-item.disabled,.dropdown-menu .dropdown-item:disabled{cursor:not-allowed;opacity:.5}.dropdown-menu .dropdown-item.focus,.dropdown-menu .dropdown-item.focused,.dropdown-menu .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color, inherit);background-color:var(--bs-dropdown-link-hover-bg, var(--bs-tertiary-bg))!important}.dropdown-menu .dropdown-item.active{color:var(--bs-dropdown-link-active-color)!important;background-color:var(--bs-dropdown-link-active-bg)!important}.dropdown-menu .dropdown-header{font-weight:600;text-transform:uppercase;font-size:.75rem;letter-spacing:.05em;text-align:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
985
|
+
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "selectedItemTemplate", first: true, predicate: ["selectedItem"], descendants: true, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: ["label"], descendants: true, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: ["chip"], descendants: true, isSignal: true }, { propertyName: "headerCheckboxTemplate", first: true, predicate: ["headerCheckbox"], descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true, isSignal: true }, { propertyName: "clearIconTemplate", first: true, predicate: ["clearIcon"], descendants: true, isSignal: true }, { propertyName: "dropdownIconTemplate", first: true, predicate: ["dropdownIcon"], descendants: true, isSignal: true }, { propertyName: "filterIconTemplate", first: true, predicate: ["filterIcon"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "filterInputElement", first: true, predicate: ["filterInput"], descendants: true, isSignal: true }, { propertyName: "triggerFilterInputElement", first: true, predicate: ["triggerFilterInput"], descendants: true, isSignal: true }, { propertyName: "editableInputElement", first: true, predicate: ["editableInput"], descendants: true, isSignal: true }, { propertyName: "dropdownMenuElement", first: true, predicate: ["dropdownMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"ngb-select-container position-relative\"\n [class.form-floating]=\"floatLabel()\"\n [class.float-variant-on]=\"floatLabel() && floatLabelVariant() === 'on'\"\n [class.float-variant-in]=\"floatLabel() && floatLabelVariant() === 'in'\"\n [class.float-variant-over]=\"floatLabel() && floatLabelVariant() === 'over'\"\n [class.floating-active]=\"hasSelectedValue() || overlayVisible()\"\n [class.dropup]=\"isDropup()\"\n [class.dropdown-up]=\"isDropup()\"\n [class.w-100]=\"fluid()\"\n [attr.dir]=\"dir() || null\"\n [ngStyle]=\"style()\"\n [ngClass]=\"styleClass()\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Select Trigger Box -->\n <div\n class=\"form-select d-flex align-items-center justify-content-between\"\n [class.is-invalid]=\"invalid()\"\n [class.disabled]=\"disabled()\"\n [class.form-select-sm]=\"size() === 'small'\"\n [class.form-select-lg]=\"size() === 'large'\"\n [class.bg-light]=\"variant() === 'filled'\"\n [attr.id]=\"id()\"\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [attr.aria-haspopup]=\"'listbox'\"\n role=\"combobox\"\n (click)=\"onTriggerClick($event)\"\n (focus)=\"onTriggerFocus($event)\"\n (blur)=\"onTriggerBlur($event)\"\n >\n <!-- Selected Value / Input / Chips Area -->\n <span class=\"text-truncate flex-grow-1 me-2 d-flex flex-wrap align-items-center gap-1\">\n <!-- Filter directly in Trigger Box -->\n @if (filterInTrigger()) {\n <!-- Chips in multiple mode when filterInTrigger is active -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate()!;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n }\n <!-- Search Filter Input embedded inside the trigger -->\n <input\n #triggerFilterInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none flex-grow-1\"\n style=\"min-width: 80px\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"effectiveFilterValue()\"\n [placeholder]=\"\n multiple() && hasSelectedValue()\n ? ''\n : hasSelectedValue() && !overlayVisible()\n ? displayLabel()\n : effectiveSearchPlaceholder()\n \"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n (focus)=\"openOverlay($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Editable Input (Single mode only) -->\n @if (editable() && !multiple()) {\n <input\n #editableInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"displayLabel()\"\n [placeholder]=\"placeholder() || ''\"\n (input)=\"onEditableInput($event)\"\n (focus)=\"onEditableFocus($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Multi-Select Chips Display Mode -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate()!;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n } @else {\n @if (hasSelectedValue()) {\n @if (selectedItemTemplate() || labelTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n selectedItemTemplate() || labelTemplate()!;\n context: { $implicit: findOptionByValue(value()) ?? value(), value: value() }\n \"\n ></ng-container>\n } @else {\n <span>{{ displayLabel() }}</span>\n }\n } @else {\n <span class=\"text-muted\">{{ floatLabel() ? '' : placeholder() || '' }}</span>\n }\n }\n <!-- Standard Single or Comma Multi-Select Text -->\n }\n }\n </span>\n\n <!-- Icons & Spinners Area -->\n <div class=\"d-flex align-items-center flex-shrink-0 gap-1 ms-auto\">\n <!-- Clear Icon -->\n @if (showClear() && hasSelectedValue() && !disabled() && !readonly()) {\n <span\n class=\"ngb-select-clear-icon text-muted me-1\"\n (click)=\"onClearClick($event)\"\n title=\"Clear\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Clear value\"\n >\n @if (clearIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"clearIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-x-circle-fill\"></i>\n }\n </span>\n }\n\n <!-- Loading Spinner -->\n @if (loading()) {\n <div class=\"spinner-border spinner-border-sm text-secondary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n }\n\n <!-- Dropdown Caret Icon -->\n @if (!loading()) {\n <span class=\"ngb-select-dropdown-icon text-secondary\">\n @if (dropdownIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"dropdownIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-chevron-down\" [class.rotate-180]=\"overlayVisible()\"></i>\n }\n </span>\n }\n </div>\n </div>\n\n <!-- Float Label Support -->\n @if (floatLabel() && placeholder()) {\n <label [attr.for]=\"id()\">{{ placeholder() }}</label>\n }\n\n <ng-template #dropdownContent>\n <!-- Header Template -->\n @if (headerTemplate()) {\n <div class=\"p-2 border-bottom\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()!\"></ng-container>\n </div>\n }\n\n <!-- Header: Select All Checkbox & Search / Filter Box -->\n @if ((filter() && !filterInTrigger()) || (multiple() && showSelectAll())) {\n <div class=\"p-2 border-bottom bg-light bg-opacity-50\">\n <!-- Select All Checkbox -->\n @if (multiple() && showSelectAll()) {\n <div class=\"d-flex align-items-center mb-2 px-1\">\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0 cursor-pointer\"\n [checked]=\"selectAll()\"\n (change)=\"toggleSelectAll($event)\"\n id=\"selectAllCheckbox\"\n />\n <label\n class=\"form-check-label small fw-semibold cursor-pointer user-select-none\"\n for=\"selectAllCheckbox\"\n >\n @if (headerCheckboxTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerCheckboxTemplate()!; context: { $implicit: selectAll() }\"\n ></ng-container>\n } @else {\n Select All\n }\n </label>\n </div>\n }\n <!-- Search Box -->\n @if (filter() && !filterInTrigger()) {\n <div class=\"input-group input-group-sm\">\n <span class=\"input-group-text bg-transparent border-end-0\">\n @if (filterIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"filterIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-search text-muted\"></i>\n }\n </span>\n <input\n #filterInput\n type=\"text\"\n class=\"form-control border-start-0\"\n [placeholder]=\"effectiveSearchPlaceholder()\"\n [value]=\"filterValue()\"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n </div>\n }\n </div>\n }\n\n <!-- Grouped Options Mode -->\n @if (group()) {\n @for (\n groupOption of filteredOptions();\n track resolveOptionGroupLabel(groupOption) || $index\n ) {\n <div>\n <!-- Group Header -->\n <h6\n class=\"dropdown-header text-muted py-2 px-3 m-0 bg-light bg-opacity-75 d-flex align-items-center\"\n >\n @if (groupTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"groupTemplate()!; context: { $implicit: groupOption }\"\n ></ng-container>\n } @else {\n {{ resolveOptionGroupLabel(groupOption) }}\n }\n </h6>\n <!-- Group Items -->\n @for (\n option of resolveOptionGroupChildren(groupOption);\n track resolveOptionTrackKey(option, $index)\n ) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate()!; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n </div>\n }\n } @else {\n @for (\n option of filteredOptions();\n track resolveOptionTrackKey(option, $index);\n let i = $index\n ) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate()!; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n }\n\n <!-- Empty State Message -->\n @if (isOptionsEmpty()) {\n <div class=\"dropdown-item text-muted text-center py-3\">\n @if (emptyTemplate()) {\n <ng-container *ngTemplateOutlet=\"emptyTemplate()!\"></ng-container>\n } @else {\n <small>{{\n filterValue()\n ? emptyFilterMessage() || 'No results found'\n : emptyMessage() || 'No results found'\n }}</small>\n }\n </div>\n }\n </ng-template>\n\n @if (isModalMode()) {\n <!-- Bootstrap Modal Overlay -->\n @if (overlayVisible()) {\n <div\n class=\"modal fade show d-block\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-modal=\"true\"\n style=\"background-color: rgba(0, 0, 0, 0.45); z-index: 1075\"\n (click)=\"closeOverlay($event)\"\n >\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\"\n role=\"document\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"modal-content shadow\" [ngClass]=\"panelStyleClass()\" [ngStyle]=\"panelStyle()\">\n <!-- Modal Header -->\n <div class=\"modal-header bg-light bg-opacity-50 py-2 px-3\">\n <h6 class=\"modal-title m-0 fw-semibold text-truncate\">{{ effectivePopupTitle() }}</h6>\n <button\n type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"closeOverlay($event)\"\n ></button>\n </div>\n\n <!-- Modal Body (Options Content) -->\n <div\n class=\"modal-body p-0\"\n #dropdownMenu\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n </div>\n\n <!-- Modal Footer (Custom Template or Done Button) -->\n @if (footerTemplate() || multiple()) {\n <div\n class=\"modal-footer p-2 bg-light bg-opacity-50 d-flex align-items-center justify-content-end\"\n >\n @if (footerTemplate()) {\n <div class=\"w-100\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()!\"></ng-container>\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-primary px-3\"\n (click)=\"closeOverlay($event)\"\n >\n Done\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n } @else {\n <!-- Standard Dropdown Menu -->\n <div\n #dropdownMenu\n class=\"dropdown-menu shadow-sm p-0\"\n [class.show]=\"overlayVisible()\"\n [ngStyle]=\"panelStyle()\"\n [ngClass]=\"panelStyleClass()\"\n [style.max-height]=\"scrollHeight()\"\n style=\"overflow-y: auto\"\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n\n <!-- Footer Template -->\n @if (footerTemplate()) {\n <div class=\"p-2 border-top\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()!\"></ng-container>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}:host.inline{display:inline-block;width:auto}.ngb-select-container{position:relative;-webkit-user-select:none;user-select:none;width:100%}.ngb-select-container .form-select{cursor:pointer;min-height:38px;background-image:none;padding-right:.75rem;padding-left:.75rem}.ngb-select-container .form-select.form-select-sm{min-height:31px;padding-right:.5rem;padding-left:.5rem}.ngb-select-container .form-select.form-select-lg{min-height:48px;padding-right:1rem;padding-left:1rem}.ngb-select-container .form-select.disabled,.ngb-select-container .form-select:disabled{cursor:not-allowed;background-color:var(--bs-secondary-bg);opacity:.65}.ngb-select-container.form-floating{display:block;width:100%;position:relative}.ngb-select-container.form-floating.float-variant-on,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over){margin-top:.35rem}.ngb-select-container.form-floating.float-variant-on .form-select,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-sm,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-sm{min-height:31px;padding-top:.25rem;padding-bottom:.25rem}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-lg,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-lg{min-height:48px;padding-top:.5rem;padding-bottom:.5rem}.ngb-select-container.form-floating.float-variant-on>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over)>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0 .35rem;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;border-radius:var(--bs-border-radius);background-color:transparent;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out,background-color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-on.floating-active>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over).floating-active>label{top:0;transform:translateY(-50%) scale(.85);background-color:var(--bs-body-bg);color:var(--bs-primary);font-weight:600}.ngb-select-container.form-floating.float-variant-in .form-select{height:calc(3.5rem + 2px);min-height:calc(3.5rem + 2px);padding:1.625rem .75rem .5rem;align-items:flex-end}.ngb-select-container.form-floating.float-variant-in>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:var(--bs-border-width) solid transparent;transform-origin:0 0;transition:opacity .15s ease-in-out,transform .15s ease-in-out,color .15s ease-in-out;color:rgba(var(--bs-body-color-rgb),.65);transform:scale(1) translateY(0)}.ngb-select-container.form-floating.float-variant-in.floating-active>label{transform:scale(.85) translateY(-.65rem) translate(.15rem);color:var(--bs-primary);font-weight:500}.ngb-select-container.form-floating.float-variant-over{margin-top:1.25rem}.ngb-select-container.form-floating.float-variant-over .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-sm{min-height:31px}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-lg{min-height:48px}.ngb-select-container.form-floating.float-variant-over>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-over.floating-active>label{top:-.75rem;transform:scale(.85);color:var(--bs-primary);font-weight:600}.ngb-select-container .ngb-select-clear-icon,.ngb-select-container .ngb-select-dropdown-icon{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1;font-size:.875rem}.ngb-select-container .ngb-select-clear-icon i,.ngb-select-container .ngb-select-dropdown-icon i{transition:transform .2s ease-in-out}.ngb-select-container .ngb-select-clear-icon i.rotate-180,.ngb-select-container .ngb-select-dropdown-icon i.rotate-180{transform:rotate(180deg)}.ngb-select-container .ngb-select-clear-icon{opacity:.6;transition:opacity .15s ease}.ngb-select-container .ngb-select-clear-icon:hover{opacity:1}.ngb-select-container.dropup .dropdown-menu,.ngb-select-container.dropdown-up .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropdown-menu{top:100%;left:0;width:100%;min-width:100%;margin-top:.125rem;z-index:1060;box-sizing:border-box;text-align:inherit}.dropdown-menu .dropdown-item{cursor:pointer;white-space:normal;word-break:break-word;text-align:inherit}.dropdown-menu .dropdown-item.disabled,.dropdown-menu .dropdown-item:disabled{cursor:not-allowed;opacity:.5}.dropdown-menu .dropdown-item.focus,.dropdown-menu .dropdown-item.focused,.dropdown-menu .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color, inherit);background-color:var(--bs-dropdown-link-hover-bg, var(--bs-tertiary-bg))!important}.dropdown-menu .dropdown-item.active{color:var(--bs-dropdown-link-active-color)!important;background-color:var(--bs-dropdown-link-active-bg)!important}.dropdown-menu .dropdown-header{font-weight:600;text-transform:uppercase;font-size:.75rem;letter-spacing:.05em;text-align:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
851
986
|
}
|
|
852
987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: NgbSelectComponent, decorators: [{
|
|
853
988
|
type: Component,
|
|
854
|
-
args: [{ selector: 'ngb-select', standalone: true, imports: [CommonModule, FormsModule], providers: [
|
|
989
|
+
args: [{ selector: 'ngb-select', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
855
990
|
{
|
|
856
991
|
provide: NG_VALUE_ACCESSOR,
|
|
857
992
|
useExisting: forwardRef(() => NgbSelectComponent),
|
|
858
993
|
multi: true,
|
|
859
994
|
},
|
|
860
|
-
], template: "<div\n class=\"ngb-select-container position-relative\"\n [class.form-floating]=\"floatLabel()\"\n [class.float-variant-on]=\"floatLabel() && floatLabelVariant() === 'on'\"\n [class.float-variant-in]=\"floatLabel() && floatLabelVariant() === 'in'\"\n [class.float-variant-over]=\"floatLabel() && floatLabelVariant() === 'over'\"\n [class.floating-active]=\"hasSelectedValue() || overlayVisible()\"\n [class.dropup]=\"isDropup()\"\n [class.dropdown-up]=\"isDropup()\"\n [class.w-100]=\"fluid()\"\n [attr.dir]=\"dir() || null\"\n [ngStyle]=\"style()\"\n [ngClass]=\"styleClass()\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Select Trigger Box -->\n <div\n class=\"form-select d-flex align-items-center justify-content-between\"\n [class.is-invalid]=\"invalid()\"\n [class.disabled]=\"disabled()\"\n [class.form-select-sm]=\"size() === 'small'\"\n [class.form-select-lg]=\"size() === 'large'\"\n [class.bg-light]=\"variant() === 'filled'\"\n [attr.id]=\"id()\"\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [attr.aria-haspopup]=\"'listbox'\"\n role=\"combobox\"\n (click)=\"onTriggerClick($event)\"\n (focus)=\"onTriggerFocus($event)\"\n (blur)=\"onTriggerBlur($event)\"\n >\n <!-- Selected Value / Input / Chips Area -->\n <span class=\"text-truncate flex-grow-1 me-2 d-flex flex-wrap align-items-center gap-1\">\n <!-- Filter directly in Trigger Box -->\n @if (filterInTrigger()) {\n <!-- Chips in multiple mode when filterInTrigger is active -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n }\n <!-- Search Filter Input embedded inside the trigger -->\n <input\n #triggerFilterInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none flex-grow-1\"\n style=\"min-width: 80px\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"effectiveFilterValue()\"\n [placeholder]=\"\n multiple() && hasSelectedValue()\n ? ''\n : hasSelectedValue() && !overlayVisible()\n ? getDisplayLabel()\n : effectiveSearchPlaceholder()\n \"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n (focus)=\"openOverlay($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Editable Input (Single mode only) -->\n @if (editable() && !multiple()) {\n <input\n #editableInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"getDisplayLabel()\"\n [placeholder]=\"placeholder() || ''\"\n (input)=\"onEditableInput($event)\"\n (focus)=\"onEditableFocus($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Multi-Select Chips Display Mode -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n } @else {\n @if (hasSelectedValue()) {\n @if (selectedItemTemplate || labelTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n selectedItemTemplate || labelTemplate;\n context: { $implicit: findOptionByValue(value()) ?? value(), value: value() }\n \"\n ></ng-container>\n } @else {\n <span>{{ getDisplayLabel() }}</span>\n }\n } @else {\n <span class=\"text-muted\">{{ floatLabel() ? '' : placeholder() || '' }}</span>\n }\n }\n <!-- Standard Single or Comma Multi-Select Text -->\n }\n }\n </span>\n\n <!-- Icons & Spinners Area -->\n <div class=\"d-flex align-items-center flex-shrink-0 gap-1 ms-auto\">\n <!-- Clear Icon -->\n @if (showClear() && hasSelectedValue() && !disabled() && !readonly()) {\n <span\n class=\"ngb-select-clear-icon text-muted me-1\"\n (click)=\"onClearClick($event)\"\n title=\"Clear\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Clear value\"\n >\n @if (clearIconTemplate) {\n <ng-container *ngTemplateOutlet=\"clearIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-x-circle-fill\"></i>\n }\n </span>\n }\n\n <!-- Loading Spinner -->\n @if (loading()) {\n <div class=\"spinner-border spinner-border-sm text-secondary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n }\n\n <!-- Dropdown Caret Icon -->\n @if (!loading()) {\n <span class=\"ngb-select-dropdown-icon text-secondary\">\n @if (dropdownIconTemplate) {\n <ng-container *ngTemplateOutlet=\"dropdownIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-chevron-down\" [class.rotate-180]=\"overlayVisible()\"></i>\n }\n </span>\n }\n </div>\n </div>\n\n <!-- Float Label Support -->\n @if (floatLabel() && placeholder()) {\n <label [attr.for]=\"id()\">{{ placeholder() }}</label>\n }\n\n <ng-template #dropdownContent>\n <!-- Header Template -->\n @if (headerTemplate) {\n <div class=\"p-2 border-bottom\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n }\n\n <!-- Header: Select All Checkbox & Search / Filter Box -->\n @if ((filter() && !filterInTrigger()) || (multiple() && showSelectAll())) {\n <div class=\"p-2 border-bottom bg-light bg-opacity-50\">\n <!-- Select All Checkbox -->\n @if (multiple() && showSelectAll()) {\n <div class=\"d-flex align-items-center mb-2 px-1\">\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0 cursor-pointer\"\n [checked]=\"selectAll()\"\n (change)=\"toggleSelectAll($event)\"\n id=\"selectAllCheckbox\"\n />\n <label\n class=\"form-check-label small fw-semibold cursor-pointer user-select-none\"\n for=\"selectAllCheckbox\"\n >\n @if (headerCheckboxTemplate) {\n <ng-container\n *ngTemplateOutlet=\"headerCheckboxTemplate; context: { $implicit: selectAll() }\"\n ></ng-container>\n } @else {\n Select All\n }\n </label>\n </div>\n }\n <!-- Search Box -->\n @if (filter() && !filterInTrigger()) {\n <div class=\"input-group input-group-sm\">\n <span class=\"input-group-text bg-transparent border-end-0\">\n @if (filterIconTemplate) {\n <ng-container *ngTemplateOutlet=\"filterIconTemplate\"></ng-container>\n } @else {\n <i class=\"bi bi-search text-muted\"></i>\n }\n </span>\n <input\n #filterInput\n type=\"text\"\n class=\"form-control border-start-0\"\n [placeholder]=\"effectiveSearchPlaceholder()\"\n [value]=\"filterValue()\"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n </div>\n }\n </div>\n }\n\n <!-- Grouped Options Mode -->\n @if (group()) {\n @for (groupOption of filteredOptions(); track groupOption) {\n <div>\n <!-- Group Header -->\n <h6\n class=\"dropdown-header text-muted py-2 px-3 m-0 bg-light bg-opacity-75 d-flex align-items-center\"\n >\n @if (groupTemplate) {\n <ng-container\n *ngTemplateOutlet=\"groupTemplate; context: { $implicit: groupOption }\"\n ></ng-container>\n } @else {\n {{ resolveOptionGroupLabel(groupOption) }}\n }\n </h6>\n <!-- Group Items -->\n @for (option of resolveOptionGroupChildren(groupOption); track option) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n </div>\n }\n } @else {\n @for (option of filteredOptions(); track option; let i = $index) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n }\n\n <!-- Empty State Message -->\n @if (isOptionsEmpty()) {\n <div class=\"dropdown-item text-muted text-center py-3\">\n @if (emptyTemplate) {\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n } @else {\n <small>{{\n filterValue()\n ? emptyFilterMessage() || 'No results found'\n : emptyMessage() || 'No results found'\n }}</small>\n }\n </div>\n }\n </ng-template>\n\n @if (isModalMode()) {\n <!-- Bootstrap Modal Overlay -->\n @if (overlayVisible()) {\n <div\n class=\"modal fade show d-block\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-modal=\"true\"\n style=\"background-color: rgba(0, 0, 0, 0.45); z-index: 1075\"\n (click)=\"closeOverlay($event)\"\n >\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\"\n role=\"document\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"modal-content shadow\" [ngClass]=\"panelStyleClass()\" [ngStyle]=\"panelStyle()\">\n <!-- Modal Header -->\n <div class=\"modal-header bg-light bg-opacity-50 py-2 px-3\">\n <h6 class=\"modal-title m-0 fw-semibold text-truncate\">{{ effectivePopupTitle() }}</h6>\n <button\n type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"closeOverlay($event)\"\n ></button>\n </div>\n\n <!-- Modal Body (Options Content) -->\n <div\n class=\"modal-body p-0\"\n #dropdownMenu\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n </div>\n\n <!-- Modal Footer (Custom Template or Done Button) -->\n @if (footerTemplate || multiple()) {\n <div\n class=\"modal-footer p-2 bg-light bg-opacity-50 d-flex align-items-center justify-content-end\"\n >\n @if (footerTemplate) {\n <div class=\"w-100\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-primary px-3\"\n (click)=\"closeOverlay($event)\"\n >\n Done\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n } @else {\n <!-- Standard Dropdown Menu -->\n <div\n #dropdownMenu\n class=\"dropdown-menu shadow-sm p-0\"\n [class.show]=\"overlayVisible()\"\n [ngStyle]=\"panelStyle()\"\n [ngClass]=\"panelStyleClass()\"\n [style.max-height]=\"scrollHeight()\"\n style=\"overflow-y: auto\"\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n\n <!-- Footer Template -->\n @if (footerTemplate) {\n <div class=\"p-2 border-top\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}:host.inline{display:inline-block;width:auto}.ngb-select-container{position:relative;-webkit-user-select:none;user-select:none;width:100%}.ngb-select-container .form-select{cursor:pointer;min-height:38px;background-image:none;padding-right:.75rem;padding-left:.75rem}.ngb-select-container .form-select.form-select-sm{min-height:31px;padding-right:.5rem;padding-left:.5rem}.ngb-select-container .form-select.form-select-lg{min-height:48px;padding-right:1rem;padding-left:1rem}.ngb-select-container .form-select.disabled,.ngb-select-container .form-select:disabled{cursor:not-allowed;background-color:var(--bs-secondary-bg);opacity:.65}.ngb-select-container.form-floating{display:block;width:100%;position:relative}.ngb-select-container.form-floating.float-variant-on,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over){margin-top:.35rem}.ngb-select-container.form-floating.float-variant-on .form-select,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-sm,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-sm{min-height:31px;padding-top:.25rem;padding-bottom:.25rem}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-lg,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-lg{min-height:48px;padding-top:.5rem;padding-bottom:.5rem}.ngb-select-container.form-floating.float-variant-on>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over)>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0 .35rem;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;border-radius:var(--bs-border-radius);background-color:transparent;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out,background-color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-on.floating-active>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over).floating-active>label{top:0;transform:translateY(-50%) scale(.85);background-color:var(--bs-body-bg);color:var(--bs-primary);font-weight:600}.ngb-select-container.form-floating.float-variant-in .form-select{height:calc(3.5rem + 2px);min-height:calc(3.5rem + 2px);padding:1.625rem .75rem .5rem;align-items:flex-end}.ngb-select-container.form-floating.float-variant-in>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:var(--bs-border-width) solid transparent;transform-origin:0 0;transition:opacity .15s ease-in-out,transform .15s ease-in-out,color .15s ease-in-out;color:rgba(var(--bs-body-color-rgb),.65);transform:scale(1) translateY(0)}.ngb-select-container.form-floating.float-variant-in.floating-active>label{transform:scale(.85) translateY(-.65rem) translate(.15rem);color:var(--bs-primary);font-weight:500}.ngb-select-container.form-floating.float-variant-over{margin-top:1.25rem}.ngb-select-container.form-floating.float-variant-over .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-sm{min-height:31px}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-lg{min-height:48px}.ngb-select-container.form-floating.float-variant-over>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-over.floating-active>label{top:-.75rem;transform:scale(.85);color:var(--bs-primary);font-weight:600}.ngb-select-container .ngb-select-clear-icon,.ngb-select-container .ngb-select-dropdown-icon{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1;font-size:.875rem}.ngb-select-container .ngb-select-clear-icon i,.ngb-select-container .ngb-select-dropdown-icon i{transition:transform .2s ease-in-out}.ngb-select-container .ngb-select-clear-icon i.rotate-180,.ngb-select-container .ngb-select-dropdown-icon i.rotate-180{transform:rotate(180deg)}.ngb-select-container .ngb-select-clear-icon{opacity:.6;transition:opacity .15s ease}.ngb-select-container .ngb-select-clear-icon:hover{opacity:1}.ngb-select-container.dropup .dropdown-menu,.ngb-select-container.dropdown-up .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropdown-menu{top:100%;left:0;width:100%;min-width:100%;margin-top:.125rem;z-index:1060;box-sizing:border-box;text-align:inherit}.dropdown-menu .dropdown-item{cursor:pointer;white-space:normal;word-break:break-word;text-align:inherit}.dropdown-menu .dropdown-item.disabled,.dropdown-menu .dropdown-item:disabled{cursor:not-allowed;opacity:.5}.dropdown-menu .dropdown-item.focus,.dropdown-menu .dropdown-item.focused,.dropdown-menu .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color, inherit);background-color:var(--bs-dropdown-link-hover-bg, var(--bs-tertiary-bg))!important}.dropdown-menu .dropdown-item.active{color:var(--bs-dropdown-link-active-color)!important;background-color:var(--bs-dropdown-link-active-bg)!important}.dropdown-menu .dropdown-header{font-weight:600;text-transform:uppercase;font-size:.75rem;letter-spacing:.05em;text-align:inherit}\n"] }]
|
|
861
|
-
}],
|
|
862
|
-
type: ContentChild,
|
|
863
|
-
args: ['item']
|
|
864
|
-
}], selectedItemTemplate: [{
|
|
865
|
-
type: ContentChild,
|
|
866
|
-
args: ['selectedItem']
|
|
867
|
-
}], labelTemplate: [{
|
|
868
|
-
type: ContentChild,
|
|
869
|
-
args: ['label']
|
|
870
|
-
}], chipTemplate: [{
|
|
871
|
-
type: ContentChild,
|
|
872
|
-
args: ['chip']
|
|
873
|
-
}], headerCheckboxTemplate: [{
|
|
874
|
-
type: ContentChild,
|
|
875
|
-
args: ['headerCheckbox']
|
|
876
|
-
}], headerTemplate: [{
|
|
877
|
-
type: ContentChild,
|
|
878
|
-
args: ['header']
|
|
879
|
-
}], footerTemplate: [{
|
|
880
|
-
type: ContentChild,
|
|
881
|
-
args: ['footer']
|
|
882
|
-
}], groupTemplate: [{
|
|
883
|
-
type: ContentChild,
|
|
884
|
-
args: ['group']
|
|
885
|
-
}], emptyTemplate: [{
|
|
886
|
-
type: ContentChild,
|
|
887
|
-
args: ['empty']
|
|
888
|
-
}], clearIconTemplate: [{
|
|
889
|
-
type: ContentChild,
|
|
890
|
-
args: ['clearIcon']
|
|
891
|
-
}], dropdownIconTemplate: [{
|
|
892
|
-
type: ContentChild,
|
|
893
|
-
args: ['dropdownIcon']
|
|
894
|
-
}], filterIconTemplate: [{
|
|
895
|
-
type: ContentChild,
|
|
896
|
-
args: ['filterIcon']
|
|
897
|
-
}], filterInputElement: [{
|
|
898
|
-
type: ViewChild,
|
|
899
|
-
args: ['filterInput']
|
|
900
|
-
}], triggerFilterInputElement: [{
|
|
901
|
-
type: ViewChild,
|
|
902
|
-
args: ['triggerFilterInput']
|
|
903
|
-
}], editableInputElement: [{
|
|
904
|
-
type: ViewChild,
|
|
905
|
-
args: ['editableInput']
|
|
906
|
-
}], dropdownMenuElement: [{
|
|
907
|
-
type: ViewChild,
|
|
908
|
-
args: ['dropdownMenu']
|
|
909
|
-
}], onWindowResize: [{
|
|
910
|
-
type: HostListener,
|
|
911
|
-
args: ['window:resize']
|
|
912
|
-
}], onWindowScroll: [{
|
|
913
|
-
type: HostListener,
|
|
914
|
-
args: ['window:scroll']
|
|
915
|
-
}], onDocumentClick: [{
|
|
916
|
-
type: HostListener,
|
|
917
|
-
args: ['document:click', ['$event']]
|
|
918
|
-
}] } });
|
|
995
|
+
], template: "<div\n class=\"ngb-select-container position-relative\"\n [class.form-floating]=\"floatLabel()\"\n [class.float-variant-on]=\"floatLabel() && floatLabelVariant() === 'on'\"\n [class.float-variant-in]=\"floatLabel() && floatLabelVariant() === 'in'\"\n [class.float-variant-over]=\"floatLabel() && floatLabelVariant() === 'over'\"\n [class.floating-active]=\"hasSelectedValue() || overlayVisible()\"\n [class.dropup]=\"isDropup()\"\n [class.dropdown-up]=\"isDropup()\"\n [class.w-100]=\"fluid()\"\n [attr.dir]=\"dir() || null\"\n [ngStyle]=\"style()\"\n [ngClass]=\"styleClass()\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Select Trigger Box -->\n <div\n class=\"form-select d-flex align-items-center justify-content-between\"\n [class.is-invalid]=\"invalid()\"\n [class.disabled]=\"disabled()\"\n [class.form-select-sm]=\"size() === 'small'\"\n [class.form-select-lg]=\"size() === 'large'\"\n [class.bg-light]=\"variant() === 'filled'\"\n [attr.id]=\"id()\"\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [attr.aria-haspopup]=\"'listbox'\"\n role=\"combobox\"\n (click)=\"onTriggerClick($event)\"\n (focus)=\"onTriggerFocus($event)\"\n (blur)=\"onTriggerBlur($event)\"\n >\n <!-- Selected Value / Input / Chips Area -->\n <span class=\"text-truncate flex-grow-1 me-2 d-flex flex-wrap align-items-center gap-1\">\n <!-- Filter directly in Trigger Box -->\n @if (filterInTrigger()) {\n <!-- Chips in multiple mode when filterInTrigger is active -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate()!;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n }\n <!-- Search Filter Input embedded inside the trigger -->\n <input\n #triggerFilterInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none flex-grow-1\"\n style=\"min-width: 80px\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"effectiveFilterValue()\"\n [placeholder]=\"\n multiple() && hasSelectedValue()\n ? ''\n : hasSelectedValue() && !overlayVisible()\n ? displayLabel()\n : effectiveSearchPlaceholder()\n \"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n (focus)=\"openOverlay($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Editable Input (Single mode only) -->\n @if (editable() && !multiple()) {\n <input\n #editableInput\n type=\"text\"\n class=\"form-control border-0 bg-transparent p-0 shadow-none\"\n [class.form-control-sm]=\"size() === 'small'\"\n [class.form-control-lg]=\"size() === 'large'\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"displayLabel()\"\n [placeholder]=\"placeholder() || ''\"\n (input)=\"onEditableInput($event)\"\n (focus)=\"onEditableFocus($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <!-- Multi-Select Chips Display Mode -->\n @if (multiple() && display() === 'chip' && hasSelectedValue()) {\n @for (val of value(); track val) {\n <span\n class=\"badge bg-light text-dark border d-inline-flex align-items-center gap-1 py-1 px-2\"\n >\n @if (chipTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n chipTemplate()!;\n context: { $implicit: findOptionByValue(val) ?? val, value: val }\n \"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabelByValue(val) }}</span>\n }\n @if (!disabled() && !readonly()) {\n <i\n class=\"bi bi-x ms-1 cursor-pointer fw-bold\"\n (click)=\"removeChip(val, $event)\"\n ></i>\n }\n </span>\n }\n } @else {\n @if (hasSelectedValue()) {\n @if (selectedItemTemplate() || labelTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n selectedItemTemplate() || labelTemplate()!;\n context: { $implicit: findOptionByValue(value()) ?? value(), value: value() }\n \"\n ></ng-container>\n } @else {\n <span>{{ displayLabel() }}</span>\n }\n } @else {\n <span class=\"text-muted\">{{ floatLabel() ? '' : placeholder() || '' }}</span>\n }\n }\n <!-- Standard Single or Comma Multi-Select Text -->\n }\n }\n </span>\n\n <!-- Icons & Spinners Area -->\n <div class=\"d-flex align-items-center flex-shrink-0 gap-1 ms-auto\">\n <!-- Clear Icon -->\n @if (showClear() && hasSelectedValue() && !disabled() && !readonly()) {\n <span\n class=\"ngb-select-clear-icon text-muted me-1\"\n (click)=\"onClearClick($event)\"\n title=\"Clear\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Clear value\"\n >\n @if (clearIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"clearIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-x-circle-fill\"></i>\n }\n </span>\n }\n\n <!-- Loading Spinner -->\n @if (loading()) {\n <div class=\"spinner-border spinner-border-sm text-secondary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n }\n\n <!-- Dropdown Caret Icon -->\n @if (!loading()) {\n <span class=\"ngb-select-dropdown-icon text-secondary\">\n @if (dropdownIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"dropdownIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-chevron-down\" [class.rotate-180]=\"overlayVisible()\"></i>\n }\n </span>\n }\n </div>\n </div>\n\n <!-- Float Label Support -->\n @if (floatLabel() && placeholder()) {\n <label [attr.for]=\"id()\">{{ placeholder() }}</label>\n }\n\n <ng-template #dropdownContent>\n <!-- Header Template -->\n @if (headerTemplate()) {\n <div class=\"p-2 border-bottom\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()!\"></ng-container>\n </div>\n }\n\n <!-- Header: Select All Checkbox & Search / Filter Box -->\n @if ((filter() && !filterInTrigger()) || (multiple() && showSelectAll())) {\n <div class=\"p-2 border-bottom bg-light bg-opacity-50\">\n <!-- Select All Checkbox -->\n @if (multiple() && showSelectAll()) {\n <div class=\"d-flex align-items-center mb-2 px-1\">\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0 cursor-pointer\"\n [checked]=\"selectAll()\"\n (change)=\"toggleSelectAll($event)\"\n id=\"selectAllCheckbox\"\n />\n <label\n class=\"form-check-label small fw-semibold cursor-pointer user-select-none\"\n for=\"selectAllCheckbox\"\n >\n @if (headerCheckboxTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerCheckboxTemplate()!; context: { $implicit: selectAll() }\"\n ></ng-container>\n } @else {\n Select All\n }\n </label>\n </div>\n }\n <!-- Search Box -->\n @if (filter() && !filterInTrigger()) {\n <div class=\"input-group input-group-sm\">\n <span class=\"input-group-text bg-transparent border-end-0\">\n @if (filterIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"filterIconTemplate()!\"></ng-container>\n } @else {\n <i class=\"bi bi-search text-muted\"></i>\n }\n </span>\n <input\n #filterInput\n type=\"text\"\n class=\"form-control border-start-0\"\n [placeholder]=\"effectiveSearchPlaceholder()\"\n [value]=\"filterValue()\"\n (input)=\"onFilterChange($event)\"\n (keydown)=\"onFilterKeydown($event)\"\n />\n </div>\n }\n </div>\n }\n\n <!-- Grouped Options Mode -->\n @if (group()) {\n @for (\n groupOption of filteredOptions();\n track resolveOptionGroupLabel(groupOption) || $index\n ) {\n <div>\n <!-- Group Header -->\n <h6\n class=\"dropdown-header text-muted py-2 px-3 m-0 bg-light bg-opacity-75 d-flex align-items-center\"\n >\n @if (groupTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"groupTemplate()!; context: { $implicit: groupOption }\"\n ></ng-container>\n } @else {\n {{ resolveOptionGroupLabel(groupOption) }}\n }\n </h6>\n <!-- Group Items -->\n @for (\n option of resolveOptionGroupChildren(groupOption);\n track resolveOptionTrackKey(option, $index)\n ) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate()!; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n </div>\n }\n } @else {\n @for (\n option of filteredOptions();\n track resolveOptionTrackKey(option, $index);\n let i = $index\n ) {\n <button\n type=\"button\"\n class=\"dropdown-item d-flex align-items-center py-2 px-3\"\n [class.active]=\"!multiple() && isSelected(option)\"\n [class.bg-light]=\"multiple() && isSelected(option)\"\n [class.fw-semibold]=\"multiple() && isSelected(option)\"\n [class.focus]=\"isOptionFocused(option)\"\n [class.bg-body-secondary]=\"isOptionFocused(option) && !isSelected(option)\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-checked]=\"multiple() ? isSelected(option) : null\"\n (click)=\"onOptionClick(option, $event)\"\n >\n <!-- Checkbox in Multiple Mode synced to selection -->\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"form-check-input me-2 mt-0\"\n style=\"pointer-events: none\"\n [checked]=\"isSelected(option)\"\n tabindex=\"-1\"\n />\n }\n @if (itemTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate()!; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n <span>{{ resolveOptionLabel(option) }}</span>\n }\n </button>\n }\n }\n\n <!-- Empty State Message -->\n @if (isOptionsEmpty()) {\n <div class=\"dropdown-item text-muted text-center py-3\">\n @if (emptyTemplate()) {\n <ng-container *ngTemplateOutlet=\"emptyTemplate()!\"></ng-container>\n } @else {\n <small>{{\n filterValue()\n ? emptyFilterMessage() || 'No results found'\n : emptyMessage() || 'No results found'\n }}</small>\n }\n </div>\n }\n </ng-template>\n\n @if (isModalMode()) {\n <!-- Bootstrap Modal Overlay -->\n @if (overlayVisible()) {\n <div\n class=\"modal fade show d-block\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-modal=\"true\"\n style=\"background-color: rgba(0, 0, 0, 0.45); z-index: 1075\"\n (click)=\"closeOverlay($event)\"\n >\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable\"\n role=\"document\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"modal-content shadow\" [ngClass]=\"panelStyleClass()\" [ngStyle]=\"panelStyle()\">\n <!-- Modal Header -->\n <div class=\"modal-header bg-light bg-opacity-50 py-2 px-3\">\n <h6 class=\"modal-title m-0 fw-semibold text-truncate\">{{ effectivePopupTitle() }}</h6>\n <button\n type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"closeOverlay($event)\"\n ></button>\n </div>\n\n <!-- Modal Body (Options Content) -->\n <div\n class=\"modal-body p-0\"\n #dropdownMenu\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n </div>\n\n <!-- Modal Footer (Custom Template or Done Button) -->\n @if (footerTemplate() || multiple()) {\n <div\n class=\"modal-footer p-2 bg-light bg-opacity-50 d-flex align-items-center justify-content-end\"\n >\n @if (footerTemplate()) {\n <div class=\"w-100\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()!\"></ng-container>\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-sm btn-primary px-3\"\n (click)=\"closeOverlay($event)\"\n >\n Done\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n } @else {\n <!-- Standard Dropdown Menu -->\n <div\n #dropdownMenu\n class=\"dropdown-menu shadow-sm p-0\"\n [class.show]=\"overlayVisible()\"\n [ngStyle]=\"panelStyle()\"\n [ngClass]=\"panelStyleClass()\"\n [style.max-height]=\"scrollHeight()\"\n style=\"overflow-y: auto\"\n role=\"listbox\"\n (scroll)=\"onOverlayScroll($event)\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownContent\"></ng-container>\n\n <!-- Footer Template -->\n @if (footerTemplate()) {\n <div class=\"p-2 border-top\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()!\"></ng-container>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}:host.inline{display:inline-block;width:auto}.ngb-select-container{position:relative;-webkit-user-select:none;user-select:none;width:100%}.ngb-select-container .form-select{cursor:pointer;min-height:38px;background-image:none;padding-right:.75rem;padding-left:.75rem}.ngb-select-container .form-select.form-select-sm{min-height:31px;padding-right:.5rem;padding-left:.5rem}.ngb-select-container .form-select.form-select-lg{min-height:48px;padding-right:1rem;padding-left:1rem}.ngb-select-container .form-select.disabled,.ngb-select-container .form-select:disabled{cursor:not-allowed;background-color:var(--bs-secondary-bg);opacity:.65}.ngb-select-container.form-floating{display:block;width:100%;position:relative}.ngb-select-container.form-floating.float-variant-on,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over){margin-top:.35rem}.ngb-select-container.form-floating.float-variant-on .form-select,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-sm,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-sm{min-height:31px;padding-top:.25rem;padding-bottom:.25rem}.ngb-select-container.form-floating.float-variant-on .form-select.form-select-lg,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over) .form-select.form-select-lg{min-height:48px;padding-top:.5rem;padding-bottom:.5rem}.ngb-select-container.form-floating.float-variant-on>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over)>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0 .35rem;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;border-radius:var(--bs-border-radius);background-color:transparent;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out,background-color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-on.floating-active>label,.ngb-select-container.form-floating:not(.float-variant-in):not(.float-variant-over).floating-active>label{top:0;transform:translateY(-50%) scale(.85);background-color:var(--bs-body-bg);color:var(--bs-primary);font-weight:600}.ngb-select-container.form-floating.float-variant-in .form-select{height:calc(3.5rem + 2px);min-height:calc(3.5rem + 2px);padding:1.625rem .75rem .5rem;align-items:flex-end}.ngb-select-container.form-floating.float-variant-in>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:var(--bs-border-width) solid transparent;transform-origin:0 0;transition:opacity .15s ease-in-out,transform .15s ease-in-out,color .15s ease-in-out;color:rgba(var(--bs-body-color-rgb),.65);transform:scale(1) translateY(0)}.ngb-select-container.form-floating.float-variant-in.floating-active>label{transform:scale(.85) translateY(-.65rem) translate(.15rem);color:var(--bs-primary);font-weight:500}.ngb-select-container.form-floating.float-variant-over{margin-top:1.25rem}.ngb-select-container.form-floating.float-variant-over .form-select{min-height:38px;height:auto;padding:.375rem .75rem;align-items:center}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-sm{min-height:31px}.ngb-select-container.form-floating.float-variant-over .form-select.form-select-lg{min-height:48px}.ngb-select-container.form-floating.float-variant-over>label{position:absolute;top:50%;left:.75rem;transform:translateY(-50%);height:auto;padding:0;margin:0;line-height:1;font-size:.95rem;color:var(--bs-secondary-color);pointer-events:none;transform-origin:left center;transition:transform .2s cubic-bezier(.25,.8,.25,1),top .2s cubic-bezier(.25,.8,.25,1),color .2s ease-in-out;z-index:5}.ngb-select-container.form-floating.float-variant-over.floating-active>label{top:-.75rem;transform:scale(.85);color:var(--bs-primary);font-weight:600}.ngb-select-container .ngb-select-clear-icon,.ngb-select-container .ngb-select-dropdown-icon{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1;font-size:.875rem}.ngb-select-container .ngb-select-clear-icon i,.ngb-select-container .ngb-select-dropdown-icon i{transition:transform .2s ease-in-out}.ngb-select-container .ngb-select-clear-icon i.rotate-180,.ngb-select-container .ngb-select-dropdown-icon i.rotate-180{transform:rotate(180deg)}.ngb-select-container .ngb-select-clear-icon{opacity:.6;transition:opacity .15s ease}.ngb-select-container .ngb-select-clear-icon:hover{opacity:1}.ngb-select-container.dropup .dropdown-menu,.ngb-select-container.dropdown-up .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropdown-menu{top:100%;left:0;width:100%;min-width:100%;margin-top:.125rem;z-index:1060;box-sizing:border-box;text-align:inherit}.dropdown-menu .dropdown-item{cursor:pointer;white-space:normal;word-break:break-word;text-align:inherit}.dropdown-menu .dropdown-item.disabled,.dropdown-menu .dropdown-item:disabled{cursor:not-allowed;opacity:.5}.dropdown-menu .dropdown-item.focus,.dropdown-menu .dropdown-item.focused,.dropdown-menu .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color, inherit);background-color:var(--bs-dropdown-link-hover-bg, var(--bs-tertiary-bg))!important}.dropdown-menu .dropdown-item.active{color:var(--bs-dropdown-link-active-color)!important;background-color:var(--bs-dropdown-link-active-bg)!important}.dropdown-menu .dropdown-header{font-weight:600;text-transform:uppercase;font-size:.75rem;letter-spacing:.05em;text-align:inherit}\n"] }]
|
|
996
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], optionGroupLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupLabel", required: false }] }], optionGroupChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupChildren", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], showSelectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectAll", required: false }] }], maxSelectedLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedLabels", required: false }] }], selectedItemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsLabel", required: false }] }], selectionLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionLimit", required: false }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterBy", required: false }] }], filterMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMatchMode", required: false }] }], filterLocale: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterLocale", required: false }] }], filterNormalizeArabic: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterNormalizeArabic", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], filterInTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterInTrigger", required: false }] }], resetFilterOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetFilterOnHide", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyFilterMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterMessage", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelVariant", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], dropdownPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownPosition", required: false }] }], dropdownDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownDirection", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], panelStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyle", required: false }] }], panelStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyleClass", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], popup: [{ type: i0.Input, args: [{ isSignal: true, alias: "popup", required: false }] }], touchUI: [{ type: i0.Input, args: [{ isSignal: true, alias: "touchUI", required: false }] }], popupTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupTitle", required: false }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], selectOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnFocus", required: false }] }], autoOptionFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoOptionFocus", required: false }] }], focusOnOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnOpen", required: false }] }], focusOnOpenStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnOpenStrategy", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], overlayVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayVisible", required: false }] }, { type: i0.Output, args: ["overlayVisibleChange"] }], onChange: [{ type: i0.Output, args: ["onChange"] }], onFilter: [{ type: i0.Output, args: ["onFilter"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onShow: [{ type: i0.Output, args: ["onShow"] }], onHide: [{ type: i0.Output, args: ["onHide"] }], onClear: [{ type: i0.Output, args: ["onClear"] }], onSelectAllChange: [{ type: i0.Output, args: ["onSelectAllChange"] }], onRemoveChip: [{ type: i0.Output, args: ["onRemoveChip"] }], onLazyLoad: [{ type: i0.Output, args: ["onLazyLoad"] }], itemTemplate: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], selectedItemTemplate: [{ type: i0.ContentChild, args: ['selectedItem', { isSignal: true }] }], labelTemplate: [{ type: i0.ContentChild, args: ['label', { isSignal: true }] }], chipTemplate: [{ type: i0.ContentChild, args: ['chip', { isSignal: true }] }], headerCheckboxTemplate: [{ type: i0.ContentChild, args: ['headerCheckbox', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: ['group', { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], clearIconTemplate: [{ type: i0.ContentChild, args: ['clearIcon', { isSignal: true }] }], dropdownIconTemplate: [{ type: i0.ContentChild, args: ['dropdownIcon', { isSignal: true }] }], filterIconTemplate: [{ type: i0.ContentChild, args: ['filterIcon', { isSignal: true }] }], filterInputElement: [{ type: i0.ViewChild, args: ['filterInput', { isSignal: true }] }], triggerFilterInputElement: [{ type: i0.ViewChild, args: ['triggerFilterInput', { isSignal: true }] }], editableInputElement: [{ type: i0.ViewChild, args: ['editableInput', { isSignal: true }] }], dropdownMenuElement: [{ type: i0.ViewChild, args: ['dropdownMenu', { isSignal: true }] }] } });
|
|
919
997
|
|
|
920
998
|
/**
|
|
921
999
|
* Generated bundle index. Do not edit.
|