@amro93/ngb-select 0.1.4 → 0.1.6
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,14 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, output, computed, signal,
|
|
2
|
+
import { input, model, output, computed, signal, forwardRef, ViewChild, ContentChild, 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.6';
|
|
8
8
|
|
|
9
9
|
class NgbSelectComponent {
|
|
10
10
|
elementRef;
|
|
11
11
|
cdr;
|
|
12
|
+
ngZone;
|
|
12
13
|
static VERSION = NGB_SELECT_VERSION;
|
|
13
14
|
// --- Basic & Data Inputs ---
|
|
14
15
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
@@ -112,8 +113,9 @@ class NgbSelectComponent {
|
|
|
112
113
|
triggerFilterInputElement;
|
|
113
114
|
editableInputElement;
|
|
114
115
|
dropdownMenuElement;
|
|
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,205 @@ 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
|
-
|
|
299
|
+
unlistenWindow;
|
|
300
|
+
unlistenDocumentClick;
|
|
301
|
+
constructor(elementRef, cdr, ngZone) {
|
|
144
302
|
this.elementRef = elementRef;
|
|
145
303
|
this.cdr = cdr;
|
|
146
|
-
|
|
147
|
-
// React to options or group changes
|
|
148
|
-
this.options();
|
|
149
|
-
this.group();
|
|
150
|
-
this.updateFilteredOptions();
|
|
151
|
-
this.updateSelectAllState();
|
|
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();
|
|
161
|
-
}
|
|
162
|
-
});
|
|
304
|
+
this.ngZone = ngZone;
|
|
163
305
|
}
|
|
164
306
|
ngOnInit() {
|
|
165
307
|
if (this.autofocus()) {
|
|
166
308
|
setTimeout(() => this.focus());
|
|
167
309
|
}
|
|
310
|
+
// Attach high-frequency window scroll & resize events outside Angular zone
|
|
311
|
+
this.ngZone.runOutsideAngular(() => {
|
|
312
|
+
const handleWindowReposition = () => {
|
|
313
|
+
if (this.overlayVisible()) {
|
|
314
|
+
this.calculateDropdownPosition();
|
|
315
|
+
if (this.appendTo()) {
|
|
316
|
+
this.repositionOverlay();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
if (typeof window !== 'undefined') {
|
|
321
|
+
window.addEventListener('resize', handleWindowReposition, { passive: true });
|
|
322
|
+
window.addEventListener('scroll', handleWindowReposition, { passive: true, capture: true });
|
|
323
|
+
this.unlistenWindow = () => {
|
|
324
|
+
window.removeEventListener('resize', handleWindowReposition);
|
|
325
|
+
window.removeEventListener('scroll', handleWindowReposition, { capture: true });
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
});
|
|
168
329
|
}
|
|
169
330
|
ngOnDestroy() {
|
|
331
|
+
if (this.unlistenWindow) {
|
|
332
|
+
this.unlistenWindow();
|
|
333
|
+
}
|
|
334
|
+
this.unbindDocumentClickListener();
|
|
170
335
|
this.cleanAppendTo();
|
|
171
336
|
}
|
|
172
|
-
safeOptions = computed(() => {
|
|
173
|
-
const opts = this.options();
|
|
174
|
-
return Array.isArray(opts) ? opts : [];
|
|
175
|
-
}, ...(ngDevMode ? [{ debugName: "safeOptions" }] : /* istanbul ignore next */ []));
|
|
176
337
|
writeValue(obj) {
|
|
177
338
|
if (this.multiple()) {
|
|
178
339
|
this.value.set(Array.isArray(obj) ? [...obj] : []);
|
|
@@ -180,7 +341,6 @@ class NgbSelectComponent {
|
|
|
180
341
|
else {
|
|
181
342
|
this.value.set(obj !== undefined ? obj : null);
|
|
182
343
|
}
|
|
183
|
-
this.updateSelectAllState();
|
|
184
344
|
this.cdr.markForCheck();
|
|
185
345
|
}
|
|
186
346
|
registerOnChange(fn) {
|
|
@@ -193,28 +353,21 @@ class NgbSelectComponent {
|
|
|
193
353
|
this.disabled.set(isDisabled);
|
|
194
354
|
this.cdr.markForCheck();
|
|
195
355
|
}
|
|
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
356
|
getDisplayLabel() {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return selectedList.map((val) => this.resolveOptionLabelByValue(val)).join(', ');
|
|
357
|
+
return this.displayLabel();
|
|
358
|
+
}
|
|
359
|
+
resolveOptionTrackKey(option, index) {
|
|
360
|
+
if (option === null || option === undefined)
|
|
361
|
+
return index;
|
|
362
|
+
const val = this.resolveOptionValue(option);
|
|
363
|
+
if (val !== null && val !== undefined && (typeof val === 'string' || typeof val === 'number')) {
|
|
364
|
+
return val;
|
|
213
365
|
}
|
|
214
|
-
|
|
215
|
-
|
|
366
|
+
const dataKey = this.dataKey();
|
|
367
|
+
if (dataKey && typeof option === 'object' && option[dataKey] !== undefined) {
|
|
368
|
+
return option[dataKey];
|
|
216
369
|
}
|
|
217
|
-
return
|
|
370
|
+
return option;
|
|
218
371
|
}
|
|
219
372
|
resolveOptionLabelByValue(val) {
|
|
220
373
|
const selectedOpt = this.findOptionByValue(val);
|
|
@@ -227,8 +380,9 @@ class NgbSelectComponent {
|
|
|
227
380
|
if (option === null || option === undefined)
|
|
228
381
|
return '';
|
|
229
382
|
if (typeof option === 'object') {
|
|
230
|
-
|
|
231
|
-
|
|
383
|
+
const labelKey = this.optionLabel();
|
|
384
|
+
if (labelKey && option[labelKey] !== undefined) {
|
|
385
|
+
return String(option[labelKey]);
|
|
232
386
|
}
|
|
233
387
|
if (option.label !== undefined) {
|
|
234
388
|
return String(option.label);
|
|
@@ -241,8 +395,9 @@ class NgbSelectComponent {
|
|
|
241
395
|
if (option === null || option === undefined)
|
|
242
396
|
return null;
|
|
243
397
|
if (typeof option === 'object') {
|
|
244
|
-
|
|
245
|
-
|
|
398
|
+
const valKey = this.optionValue();
|
|
399
|
+
if (valKey && option[valKey] !== undefined) {
|
|
400
|
+
return option[valKey];
|
|
246
401
|
}
|
|
247
402
|
if (option.value !== undefined) {
|
|
248
403
|
return option.value;
|
|
@@ -250,12 +405,26 @@ class NgbSelectComponent {
|
|
|
250
405
|
}
|
|
251
406
|
return option;
|
|
252
407
|
}
|
|
408
|
+
getLookupKey(val) {
|
|
409
|
+
if (!val || typeof val !== 'object')
|
|
410
|
+
return val;
|
|
411
|
+
const dataKey = this.dataKey();
|
|
412
|
+
if (dataKey && val[dataKey] !== undefined) {
|
|
413
|
+
return `dk:${val[dataKey]}`;
|
|
414
|
+
}
|
|
415
|
+
const valKey = this.optionValue();
|
|
416
|
+
if (valKey && val[valKey] !== undefined) {
|
|
417
|
+
return `ov:${val[valKey]}`;
|
|
418
|
+
}
|
|
419
|
+
return undefined;
|
|
420
|
+
}
|
|
253
421
|
isOptionDisabled(option) {
|
|
254
422
|
if (this.disabled())
|
|
255
423
|
return true;
|
|
256
424
|
if (option && typeof option === 'object') {
|
|
257
|
-
|
|
258
|
-
|
|
425
|
+
const disabledKey = this.optionDisabled();
|
|
426
|
+
if (disabledKey && option[disabledKey] !== undefined) {
|
|
427
|
+
return Boolean(option[disabledKey]);
|
|
259
428
|
}
|
|
260
429
|
return Boolean(option.disabled);
|
|
261
430
|
}
|
|
@@ -264,22 +433,34 @@ class NgbSelectComponent {
|
|
|
264
433
|
resolveOptionGroupLabel(groupOption) {
|
|
265
434
|
if (!groupOption)
|
|
266
435
|
return '';
|
|
267
|
-
|
|
268
|
-
|
|
436
|
+
const groupLabelKey = this.optionGroupLabel();
|
|
437
|
+
if (groupLabelKey && groupOption[groupLabelKey] !== undefined) {
|
|
438
|
+
return String(groupOption[groupLabelKey]);
|
|
269
439
|
}
|
|
270
440
|
return String(groupOption.label || '');
|
|
271
441
|
}
|
|
272
442
|
resolveOptionGroupChildren(groupOption) {
|
|
273
443
|
if (!groupOption)
|
|
274
444
|
return [];
|
|
275
|
-
|
|
276
|
-
|
|
445
|
+
const groupChildrenKey = this.optionGroupChildren();
|
|
446
|
+
if (groupChildrenKey && Array.isArray(groupOption[groupChildrenKey])) {
|
|
447
|
+
return groupOption[groupChildrenKey];
|
|
277
448
|
}
|
|
278
449
|
return Array.isArray(groupOption.items) ? groupOption.items : [];
|
|
279
450
|
}
|
|
280
451
|
findOptionByValue(val) {
|
|
281
452
|
if (val === null || val === undefined)
|
|
282
453
|
return undefined;
|
|
454
|
+
// Fast O(1) lookup from computed map
|
|
455
|
+
const map = this.valueToOptionMap();
|
|
456
|
+
if (map.has(val)) {
|
|
457
|
+
return map.get(val);
|
|
458
|
+
}
|
|
459
|
+
const lookupKey = this.getLookupKey(val);
|
|
460
|
+
if (lookupKey !== undefined && map.has(lookupKey)) {
|
|
461
|
+
return map.get(lookupKey);
|
|
462
|
+
}
|
|
463
|
+
// Fallback scan
|
|
283
464
|
if (this.group()) {
|
|
284
465
|
for (const grp of this.safeOptions()) {
|
|
285
466
|
const children = this.resolveOptionGroupChildren(grp);
|
|
@@ -301,10 +482,9 @@ class NgbSelectComponent {
|
|
|
301
482
|
if (dataKey && val1[dataKey] !== undefined && val2[dataKey] !== undefined) {
|
|
302
483
|
return val1[dataKey] === val2[dataKey];
|
|
303
484
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return val1[this.optionValue()] === val2[this.optionValue()];
|
|
485
|
+
const optVal = this.optionValue();
|
|
486
|
+
if (optVal && val1[optVal] !== undefined && val2[optVal] !== undefined) {
|
|
487
|
+
return val1[optVal] === val2[optVal];
|
|
308
488
|
}
|
|
309
489
|
try {
|
|
310
490
|
return JSON.stringify(val1) === JSON.stringify(val2);
|
|
@@ -317,18 +497,25 @@ class NgbSelectComponent {
|
|
|
317
497
|
}
|
|
318
498
|
isSelected(option) {
|
|
319
499
|
const optVal = this.resolveOptionValue(option);
|
|
320
|
-
if (this.multiple()
|
|
321
|
-
|
|
500
|
+
if (this.multiple()) {
|
|
501
|
+
const set = this.selectedValuesSet();
|
|
502
|
+
if (set.has(optVal))
|
|
503
|
+
return true;
|
|
504
|
+
const lookupKey = this.getLookupKey(optVal);
|
|
505
|
+
if (lookupKey !== undefined && set.has(lookupKey))
|
|
506
|
+
return true;
|
|
507
|
+
const valArr = Array.isArray(this.value()) ? this.value() : [];
|
|
508
|
+
return valArr.some((item) => this.areValuesEqual(item, optVal));
|
|
322
509
|
}
|
|
323
510
|
return this.areValuesEqual(this.value(), optVal);
|
|
324
511
|
}
|
|
325
|
-
|
|
326
|
-
if
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
512
|
+
updateFilteredOptions() {
|
|
513
|
+
// Kept for backward compatibility if called manually
|
|
514
|
+
this.cdr.markForCheck();
|
|
515
|
+
}
|
|
516
|
+
updateSelectAllState() {
|
|
517
|
+
// Select all is now a computed signal
|
|
518
|
+
this.cdr.markForCheck();
|
|
332
519
|
}
|
|
333
520
|
onTriggerClick(event) {
|
|
334
521
|
if (this.disabled() || this.readonly())
|
|
@@ -385,6 +572,7 @@ class NgbSelectComponent {
|
|
|
385
572
|
this.overlayVisible.set(true);
|
|
386
573
|
this.onShow.emit(event || null);
|
|
387
574
|
this.onModelTouched();
|
|
575
|
+
this.bindDocumentClickListener();
|
|
388
576
|
setTimeout(() => {
|
|
389
577
|
this.calculateDropdownPosition();
|
|
390
578
|
if (this.filterInTrigger() && this.triggerFilterInputElement) {
|
|
@@ -401,24 +589,45 @@ class NgbSelectComponent {
|
|
|
401
589
|
closeOverlay(event) {
|
|
402
590
|
if (!this.overlayVisible())
|
|
403
591
|
return;
|
|
592
|
+
this.unbindDocumentClickListener();
|
|
404
593
|
this.overlayVisible.set(false);
|
|
405
594
|
this.onHide.emit(event || null);
|
|
406
595
|
if (this.resetFilterOnHide() && this.filterValue()) {
|
|
407
596
|
this.filterValue.set('');
|
|
408
|
-
this.updateFilteredOptions();
|
|
409
597
|
}
|
|
410
598
|
this.focusedIndex.set(-1);
|
|
411
599
|
this.cdr.markForCheck();
|
|
412
600
|
}
|
|
601
|
+
bindDocumentClickListener() {
|
|
602
|
+
if (typeof document === 'undefined' || this.unlistenDocumentClick)
|
|
603
|
+
return;
|
|
604
|
+
const clickHandler = (event) => {
|
|
605
|
+
if (!this.elementRef.nativeElement.contains(event.target) &&
|
|
606
|
+
(!this.dropdownMenuElement ||
|
|
607
|
+
!this.dropdownMenuElement.nativeElement.contains(event.target))) {
|
|
608
|
+
this.ngZone.run(() => {
|
|
609
|
+
this.closeOverlay(event);
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
614
|
+
this.unlistenDocumentClick = () => {
|
|
615
|
+
document.removeEventListener('click', clickHandler, { capture: true });
|
|
616
|
+
this.unlistenDocumentClick = undefined;
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
unbindDocumentClickListener() {
|
|
620
|
+
if (this.unlistenDocumentClick) {
|
|
621
|
+
this.unlistenDocumentClick();
|
|
622
|
+
}
|
|
623
|
+
}
|
|
413
624
|
handleFocusOnOpen() {
|
|
414
|
-
const flatItems = this.
|
|
625
|
+
const flatItems = this.flatFilteredOptions();
|
|
415
626
|
let targetIndex = -1;
|
|
416
627
|
const hasSelection = this.hasSelectedValue();
|
|
417
628
|
const selectedIdx = flatItems.findIndex((opt) => this.isSelected(opt));
|
|
418
629
|
const focusOnOpen = this.focusOnOpen();
|
|
419
|
-
if (focusOnOpen !== undefined &&
|
|
420
|
-
focusOnOpen >= 0 &&
|
|
421
|
-
focusOnOpen < flatItems.length) {
|
|
630
|
+
if (focusOnOpen !== undefined && focusOnOpen >= 0 && focusOnOpen < flatItems.length) {
|
|
422
631
|
if (this.focusOnOpenStrategy() === 'notSelected' && hasSelection && selectedIdx !== -1) {
|
|
423
632
|
targetIndex = selectedIdx;
|
|
424
633
|
}
|
|
@@ -449,13 +658,13 @@ class NgbSelectComponent {
|
|
|
449
658
|
currentSelection.splice(selectedIndex, 1);
|
|
450
659
|
}
|
|
451
660
|
else {
|
|
452
|
-
if (this.selectionLimit() !== undefined &&
|
|
661
|
+
if (this.selectionLimit() !== undefined &&
|
|
662
|
+
currentSelection.length >= this.selectionLimit()) {
|
|
453
663
|
return;
|
|
454
664
|
}
|
|
455
665
|
currentSelection.push(val);
|
|
456
666
|
}
|
|
457
667
|
this.updateModel(currentSelection, event);
|
|
458
|
-
this.updateSelectAllState();
|
|
459
668
|
if (this.closeOnSelect()) {
|
|
460
669
|
this.closeOverlay(event);
|
|
461
670
|
}
|
|
@@ -464,7 +673,6 @@ class NgbSelectComponent {
|
|
|
464
673
|
this.updateModel(val, event);
|
|
465
674
|
if (this.filterInTrigger()) {
|
|
466
675
|
this.filterValue.set('');
|
|
467
|
-
this.updateFilteredOptions();
|
|
468
676
|
if (this.triggerFilterInputElement) {
|
|
469
677
|
this.triggerFilterInputElement.nativeElement.value = '';
|
|
470
678
|
}
|
|
@@ -480,12 +688,11 @@ class NgbSelectComponent {
|
|
|
480
688
|
const nextVal = this.value().filter((item) => !this.areValuesEqual(item, val));
|
|
481
689
|
this.updateModel(nextVal, event);
|
|
482
690
|
this.onRemoveChip.emit({ originalEvent: event, value: val });
|
|
483
|
-
this.updateSelectAllState();
|
|
484
691
|
}
|
|
485
692
|
}
|
|
486
693
|
toggleSelectAll(event) {
|
|
487
694
|
const checked = event.target.checked;
|
|
488
|
-
const targetOptions = this.
|
|
695
|
+
const targetOptions = this.flatFilteredOptions().filter((opt) => !this.isOptionDisabled(opt));
|
|
489
696
|
if (checked) {
|
|
490
697
|
let allValues = targetOptions.map((opt) => this.resolveOptionValue(opt));
|
|
491
698
|
if (this.selectionLimit() !== undefined) {
|
|
@@ -496,20 +703,9 @@ class NgbSelectComponent {
|
|
|
496
703
|
else {
|
|
497
704
|
this.value.set([]);
|
|
498
705
|
}
|
|
499
|
-
this.selectAll.set(checked);
|
|
500
706
|
this.updateModel(this.value(), event);
|
|
501
707
|
this.onSelectAllChange.emit({ originalEvent: event, checked });
|
|
502
708
|
}
|
|
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
709
|
updateModel(val, event) {
|
|
514
710
|
this.value.set(val);
|
|
515
711
|
this.onModelChange(this.value());
|
|
@@ -525,7 +721,6 @@ class NgbSelectComponent {
|
|
|
525
721
|
return;
|
|
526
722
|
const clearedValue = this.multiple() ? [] : null;
|
|
527
723
|
this.updateModel(clearedValue, event);
|
|
528
|
-
this.updateSelectAllState();
|
|
529
724
|
this.onClear.emit(event);
|
|
530
725
|
}
|
|
531
726
|
onEditableInput(event) {
|
|
@@ -541,53 +736,22 @@ class NgbSelectComponent {
|
|
|
541
736
|
onFilterChange(event) {
|
|
542
737
|
const raw = event.target.value || '';
|
|
543
738
|
this.filterValue.set(raw);
|
|
544
|
-
this.updateFilteredOptions();
|
|
545
|
-
this.updateSelectAllState();
|
|
546
739
|
this.onFilter.emit({
|
|
547
740
|
originalEvent: event,
|
|
548
741
|
filter: this.filterValue(),
|
|
549
742
|
});
|
|
550
743
|
}
|
|
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) {
|
|
744
|
+
matchesFilter(option, query, fieldsToSearch, matchMode, locale, normalizeArabic = true) {
|
|
574
745
|
if (!option)
|
|
575
746
|
return false;
|
|
576
|
-
const fieldsToSearch = this.getFilterFields();
|
|
577
747
|
return fieldsToSearch.some((field) => {
|
|
578
748
|
const val = this.resolveFieldData(option, field);
|
|
579
749
|
if (val === null || val === undefined)
|
|
580
750
|
return false;
|
|
581
751
|
const stringVal = String(val);
|
|
582
|
-
return this.compareStrings(stringVal, query,
|
|
752
|
+
return this.compareStrings(stringVal, query, matchMode, locale, normalizeArabic);
|
|
583
753
|
});
|
|
584
754
|
}
|
|
585
|
-
getFilterFields() {
|
|
586
|
-
if (this.filterBy()) {
|
|
587
|
-
return this.filterBy().split(',').map((f) => f.trim());
|
|
588
|
-
}
|
|
589
|
-
return [this.optionLabel() || 'label'];
|
|
590
|
-
}
|
|
591
755
|
resolveFieldData(data, field) {
|
|
592
756
|
if (data && field) {
|
|
593
757
|
if (field.indexOf('.') === -1) {
|
|
@@ -615,10 +779,10 @@ class NgbSelectComponent {
|
|
|
615
779
|
.replace(/[يى]/g, 'ي') // Normalize Yaa & Alef Maksura
|
|
616
780
|
.replace(/[ة]/g, 'ه'); // Normalize Taa Marbuta
|
|
617
781
|
}
|
|
618
|
-
compareStrings(val, query, mode, locale) {
|
|
782
|
+
compareStrings(val, query, mode, locale, normalizeArabic = true) {
|
|
619
783
|
let v = locale ? val.toLocaleLowerCase(locale) : val.toLowerCase();
|
|
620
784
|
let q = locale ? query.toLocaleLowerCase(locale) : query.toLowerCase();
|
|
621
|
-
if (
|
|
785
|
+
if (normalizeArabic) {
|
|
622
786
|
v = this.normalizeArabicText(v);
|
|
623
787
|
q = this.normalizeArabicText(q);
|
|
624
788
|
}
|
|
@@ -637,14 +801,7 @@ class NgbSelectComponent {
|
|
|
637
801
|
}
|
|
638
802
|
}
|
|
639
803
|
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();
|
|
804
|
+
return this.flatFilteredOptions();
|
|
648
805
|
}
|
|
649
806
|
onKeydown(event) {
|
|
650
807
|
if (this.disabled() || this.readonly())
|
|
@@ -681,9 +838,10 @@ class NgbSelectComponent {
|
|
|
681
838
|
this.openOverlay(event);
|
|
682
839
|
}
|
|
683
840
|
else {
|
|
684
|
-
const flatItems = this.
|
|
685
|
-
|
|
686
|
-
|
|
841
|
+
const flatItems = this.flatFilteredOptions();
|
|
842
|
+
const focusedIdx = this.focusedIndex();
|
|
843
|
+
if (focusedIdx >= 0 && focusedIdx < flatItems.length) {
|
|
844
|
+
this.onOptionClick(flatItems[focusedIdx], event);
|
|
687
845
|
}
|
|
688
846
|
}
|
|
689
847
|
break;
|
|
@@ -709,7 +867,7 @@ class NgbSelectComponent {
|
|
|
709
867
|
}
|
|
710
868
|
}
|
|
711
869
|
navigateOption(step) {
|
|
712
|
-
const flatItems = this.
|
|
870
|
+
const flatItems = this.flatFilteredOptions();
|
|
713
871
|
if (flatItems.length === 0)
|
|
714
872
|
return;
|
|
715
873
|
let nextIdx = this.focusedIndex() + step;
|
|
@@ -734,19 +892,19 @@ class NgbSelectComponent {
|
|
|
734
892
|
}
|
|
735
893
|
}
|
|
736
894
|
isOptionFocused(option) {
|
|
737
|
-
|
|
895
|
+
const focused = this.focusedOption();
|
|
896
|
+
if (focused === undefined || option === undefined)
|
|
738
897
|
return false;
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
return this.areValuesEqual(this.resolveOptionValue(flat[this.focusedIndex()]), this.resolveOptionValue(option));
|
|
898
|
+
if (focused === option)
|
|
899
|
+
return true;
|
|
900
|
+
return this.areValuesEqual(this.resolveOptionValue(focused), this.resolveOptionValue(option));
|
|
743
901
|
}
|
|
744
902
|
onOverlayScroll(event) {
|
|
745
903
|
if (!this.lazy())
|
|
746
904
|
return;
|
|
747
905
|
const target = event.target;
|
|
748
906
|
if (target.scrollTop + target.clientHeight >= target.scrollHeight - 10) {
|
|
749
|
-
const flat = this.
|
|
907
|
+
const flat = this.flatFilteredOptions();
|
|
750
908
|
this.onLazyLoad.emit({
|
|
751
909
|
first: flat.length,
|
|
752
910
|
last: flat.length + 10,
|
|
@@ -815,50 +973,25 @@ class NgbSelectComponent {
|
|
|
815
973
|
trigger.focus();
|
|
816
974
|
}
|
|
817
975
|
}
|
|
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: [
|
|
976
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: NgbSelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
977
|
+
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
978
|
{
|
|
846
979
|
provide: NG_VALUE_ACCESSOR,
|
|
847
980
|
useExisting: forwardRef(() => NgbSelectComponent),
|
|
848
981
|
multi: true,
|
|
849
982
|
},
|
|
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 }] });
|
|
983
|
+
], 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 ? 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
984
|
}
|
|
852
985
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: NgbSelectComponent, decorators: [{
|
|
853
986
|
type: Component,
|
|
854
|
-
args: [{ selector: 'ngb-select', standalone: true, imports: [CommonModule, FormsModule], providers: [
|
|
987
|
+
args: [{ selector: 'ngb-select', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
855
988
|
{
|
|
856
989
|
provide: NG_VALUE_ACCESSOR,
|
|
857
990
|
useExisting: forwardRef(() => NgbSelectComponent),
|
|
858
991
|
multi: true,
|
|
859
992
|
},
|
|
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
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], 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: [{
|
|
993
|
+
], 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"] }]
|
|
994
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], 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: [{
|
|
862
995
|
type: ContentChild,
|
|
863
996
|
args: ['item']
|
|
864
997
|
}], selectedItemTemplate: [{
|
|
@@ -906,15 +1039,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImpo
|
|
|
906
1039
|
}], dropdownMenuElement: [{
|
|
907
1040
|
type: ViewChild,
|
|
908
1041
|
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
1042
|
}] } });
|
|
919
1043
|
|
|
920
1044
|
/**
|