@ng-matero/ng-select 0.3.0 → 0.4.0

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.
@@ -98,13 +98,6 @@ function isPromise(value) {
98
98
  function isFunction(value) {
99
99
  return value instanceof Function;
100
100
  }
101
- function newId() {
102
- // First character is an 'a', it's good practice to tag id to begin with a letter
103
- return 'axxxxxxxxxxx'.replace(/[x]/g, () => {
104
- const val = (Math.random() * 16) | 0;
105
- return val.toString(16);
106
- });
107
- }
108
101
  var KeyCode;
109
102
  (function (KeyCode) {
110
103
  KeyCode["Tab"] = "Tab";
@@ -120,12 +113,12 @@ const CSS_POSITIONS = ['top', 'right', 'bottom', 'left'];
120
113
  const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
121
114
  class NgDropdownPanel {
122
115
  constructor() {
116
+ this.listboxId = '';
123
117
  this.items = [];
124
118
  this.position = 'auto';
125
119
  this.bufferAmount = 4;
126
120
  this.virtualScroll = false;
127
121
  this.filterValue = null;
128
- this.ariaLabelDropdown = null;
129
122
  this.update = new EventEmitter();
130
123
  this.scroll = new EventEmitter();
131
124
  this.scrollToEnd = new EventEmitter();
@@ -163,9 +156,9 @@ class NgDropdownPanel {
163
156
  }
164
157
  ngOnInit() {
165
158
  this._select = this._dropdown.parentElement;
166
- this._virtualPadding = this.paddingElementRef.nativeElement;
167
- this._scrollablePanel = this.scrollElementRef.nativeElement;
168
- this._contentPanel = this.contentElementRef.nativeElement;
159
+ this._scrollHost = this.scrollHostElRef.nativeElement;
160
+ this._scrollContent = this.scrollContentElRef.nativeElement;
161
+ this._scrollSpacer = this.scrollSpacerElRef.nativeElement;
169
162
  this._handleScroll();
170
163
  this._handleOutsideClick();
171
164
  this._appendDropdown();
@@ -204,11 +197,11 @@ class NgDropdownPanel {
204
197
  scrollTo = this._panelUtils.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
205
198
  }
206
199
  if (isDefined(scrollTo)) {
207
- this._scrollablePanel.scrollTop = scrollTo;
200
+ this._scrollHost.scrollTop = scrollTo;
208
201
  }
209
202
  }
210
203
  scrollToTag() {
211
- const panel = this._scrollablePanel;
204
+ const panel = this._scrollHost;
212
205
  panel.scrollTop = panel.scrollHeight - panel.clientHeight;
213
206
  }
214
207
  adjustPosition() {
@@ -239,7 +232,7 @@ class NgDropdownPanel {
239
232
  }
240
233
  _handleScroll() {
241
234
  this._zone.runOutsideAngular(() => {
242
- fromEvent(this.scrollElementRef.nativeElement, 'scroll')
235
+ fromEvent(this._scrollHost, 'scroll')
243
236
  .pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER))
244
237
  .subscribe(e => {
245
238
  const path = e.path || (e.composedPath && e.composedPath());
@@ -294,7 +287,7 @@ class NgDropdownPanel {
294
287
  }
295
288
  this._zone.runOutsideAngular(() => {
296
289
  Promise.resolve().then(() => {
297
- const panelHeight = this._scrollablePanel.clientHeight;
290
+ const panelHeight = this._scrollHost.clientHeight;
298
291
  this._panelUtils.setDimensions(0, panelHeight);
299
292
  this._handleDropdownPosition();
300
293
  this.scrollTo(this.markedItem, firstChange);
@@ -323,15 +316,15 @@ class NgDropdownPanel {
323
316
  }
324
317
  _updateVirtualHeight(height) {
325
318
  if (this._updateScrollHeight) {
326
- this._virtualPadding.style.height = `${height}px`;
319
+ this._scrollSpacer.style.height = `${height}px`;
327
320
  this._updateScrollHeight = false;
328
321
  }
329
322
  }
330
323
  _setVirtualHeight() {
331
- if (!this._virtualPadding) {
324
+ if (!this._scrollSpacer) {
332
325
  return;
333
326
  }
334
- this._virtualPadding.style.height = `0px`;
327
+ this._scrollSpacer.style.height = `0px`;
335
328
  }
336
329
  _onItemsLengthChanged() {
337
330
  this._updateScrollHeight = true;
@@ -340,16 +333,16 @@ class NgDropdownPanel {
340
333
  if (scrollTop && this._lastScrollPosition === scrollTop) {
341
334
  return;
342
335
  }
343
- scrollTop = scrollTop || this._scrollablePanel.scrollTop;
336
+ scrollTop = scrollTop || this._scrollHost.scrollTop;
344
337
  const range = this._panelUtils.calculateItems(scrollTop, this.itemsLength, this.bufferAmount);
345
338
  this._updateVirtualHeight(range.scrollHeight);
346
- this._contentPanel.style.transform = `translateY(${range.topPadding}px)`;
339
+ this._scrollContent.style.transform = `translateY(${range.topPadding}px)`;
347
340
  this._zone.run(() => {
348
341
  this.update.emit(this.items.slice(range.start, range.end));
349
342
  this.scroll.emit({ start: range.start, end: range.end });
350
343
  });
351
344
  if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
352
- this._scrollablePanel.scrollTop = scrollTop;
345
+ this._scrollHost.scrollTop = scrollTop;
353
346
  this._lastScrollPosition = scrollTop;
354
347
  }
355
348
  }
@@ -362,8 +355,8 @@ class NgDropdownPanel {
362
355
  return Promise.resolve().then(() => {
363
356
  const option = this._dropdown.querySelector(`#${first.htmlId}`);
364
357
  const optionHeight = option.clientHeight;
365
- this._virtualPadding.style.height = `${optionHeight * this.itemsLength}px`;
366
- const panelHeight = this._scrollablePanel.clientHeight;
358
+ this._scrollSpacer.style.height = `${optionHeight * this.itemsLength}px`;
359
+ const panelHeight = this._scrollHost.clientHeight;
367
360
  this._panelUtils.setDimensions(optionHeight, panelHeight);
368
361
  return this._panelUtils.dimensions;
369
362
  });
@@ -372,7 +365,7 @@ class NgDropdownPanel {
372
365
  if (this._scrollToEndFired || scrollTop === 0) {
373
366
  return;
374
367
  }
375
- const padding = this.virtualScroll ? this._virtualPadding : this._contentPanel;
368
+ const padding = this.virtualScroll ? this._scrollSpacer : this._scrollContent;
376
369
  if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
377
370
  this._zone.run(() => this.scrollToEnd.emit());
378
371
  this._scrollToEndFired = true;
@@ -444,7 +437,7 @@ class NgDropdownPanel {
444
437
  });
445
438
  }
446
439
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgDropdownPanel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
447
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: NgDropdownPanel, isStandalone: true, selector: "ng-dropdown-panel", inputs: { items: "items", markedItem: "markedItem", position: "position", appendTo: "appendTo", bufferAmount: "bufferAmount", virtualScroll: ["virtualScroll", "virtualScroll", booleanAttribute], headerTemplate: "headerTemplate", footerTemplate: "footerTemplate", filterValue: "filterValue", ariaLabelDropdown: "ariaLabelDropdown" }, outputs: { update: "update", scroll: "scroll", scrollToEnd: "scrollToEnd", outsideClick: "outsideClick" }, viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }, { propertyName: "scrollElementRef", first: true, predicate: ["scroll"], descendants: true, read: ElementRef, static: true }, { propertyName: "paddingElementRef", first: true, predicate: ["padding"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
440
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: NgDropdownPanel, isStandalone: true, selector: "ng-dropdown-panel", inputs: { listboxId: "listboxId", items: "items", markedItem: "markedItem", position: "position", appendTo: "appendTo", bufferAmount: "bufferAmount", virtualScroll: ["virtualScroll", "virtualScroll", booleanAttribute], headerTemplate: "headerTemplate", footerTemplate: "footerTemplate", filterValue: "filterValue" }, outputs: { update: "update", scroll: "scroll", scrollToEnd: "scrollToEnd", outsideClick: "outsideClick" }, viewQueries: [{ propertyName: "scrollHostElRef", first: true, predicate: ["scrollHost"], descendants: true, read: ElementRef, static: true }, { propertyName: "scrollContentElRef", first: true, predicate: ["scrollContent"], descendants: true, read: ElementRef, static: true }, { propertyName: "scrollSpacerElRef", first: true, predicate: ["scrollSpacer"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
448
441
  @if (headerTemplate) {
449
442
  <div class="ng-dropdown-header">
450
443
  <ng-container
@@ -454,13 +447,14 @@ class NgDropdownPanel {
454
447
  </div>
455
448
  }
456
449
  <div
457
- #scroll
458
- class="ng-dropdown-panel-items ng-select-virtual-scroll-host"
459
- [attr.aria-label]="ariaLabelDropdown"
450
+ #scrollHost
451
+ class="ng-dropdown-panel-items"
452
+ [class.ng-select-virtual-scroll-host]="virtualScroll"
453
+ [attr.id]="listboxId"
460
454
  role="listbox"
461
455
  >
462
- <div #padding [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
463
- <div #content [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
456
+ <div #scrollSpacer [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
457
+ <div #scrollContent [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
464
458
  <ng-content />
465
459
  </div>
466
460
  </div>
@@ -488,13 +482,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
488
482
  </div>
489
483
  }
490
484
  <div
491
- #scroll
492
- class="ng-dropdown-panel-items ng-select-virtual-scroll-host"
493
- [attr.aria-label]="ariaLabelDropdown"
485
+ #scrollHost
486
+ class="ng-dropdown-panel-items"
487
+ [class.ng-select-virtual-scroll-host]="virtualScroll"
488
+ [attr.id]="listboxId"
494
489
  role="listbox"
495
490
  >
496
- <div #padding [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
497
- <div #content [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
491
+ <div #scrollSpacer [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
492
+ <div #scrollContent [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
498
493
  <ng-content />
499
494
  </div>
500
495
  </div>
@@ -511,7 +506,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
511
506
  encapsulation: ViewEncapsulation.None,
512
507
  changeDetection: ChangeDetectionStrategy.OnPush,
513
508
  }]
514
- }], propDecorators: { items: [{
509
+ }], propDecorators: { listboxId: [{
510
+ type: Input
511
+ }], items: [{
515
512
  type: Input
516
513
  }], markedItem: [{
517
514
  type: Input
@@ -530,8 +527,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
530
527
  type: Input
531
528
  }], filterValue: [{
532
529
  type: Input
533
- }], ariaLabelDropdown: [{
534
- type: Input
535
530
  }], update: [{
536
531
  type: Output
537
532
  }], scroll: [{
@@ -540,15 +535,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
540
535
  type: Output
541
536
  }], outsideClick: [{
542
537
  type: Output
543
- }], contentElementRef: [{
538
+ }], scrollHostElRef: [{
544
539
  type: ViewChild,
545
- args: ['content', { read: ElementRef, static: true }]
546
- }], scrollElementRef: [{
540
+ args: ['scrollHost', { read: ElementRef, static: true }]
541
+ }], scrollContentElRef: [{
547
542
  type: ViewChild,
548
- args: ['scroll', { read: ElementRef, static: true }]
549
- }], paddingElementRef: [{
543
+ args: ['scrollContent', { read: ElementRef, static: true }]
544
+ }], scrollSpacerElRef: [{
550
545
  type: ViewChild,
551
- args: ['padding', { read: ElementRef, static: true }]
546
+ args: ['scrollSpacer', { read: ElementRef, static: true }]
552
547
  }] } });
553
548
 
554
549
  class NgOption {
@@ -1710,7 +1705,7 @@ class ItemsList {
1710
1705
  label: isDefined(label) ? label.toString() : '',
1711
1706
  value,
1712
1707
  disabled: item.disabled,
1713
- htmlId: `${this._ngSelect.dropdownId}-${index}`,
1708
+ htmlId: `${this._ngSelect._uid}-option-${index}`,
1714
1709
  };
1715
1710
  }
1716
1711
  mapSelectedItems() {
@@ -1779,7 +1774,7 @@ class ItemsList {
1779
1774
  if (this._ngSelect.hideSelected) {
1780
1775
  return -1;
1781
1776
  }
1782
- if (this._markedIndex > -1 && this.markedItem === undefined) {
1777
+ if (this._markedIndex > -1 && this.markedItem == null) {
1783
1778
  return -1;
1784
1779
  }
1785
1780
  const selectedIndex = this._filteredItems.indexOf(this.lastSelectedItem);
@@ -1822,9 +1817,10 @@ class ItemsList {
1822
1817
  _flatten(groups) {
1823
1818
  const isGroupByFn = isFunction(this._ngSelect.groupBy);
1824
1819
  const items = [];
1825
- for (const key of Array.from(groups.keys())) {
1820
+ let groupIndex = 0;
1821
+ for (const key of groups.keys()) {
1826
1822
  let i = items.length;
1827
- if (key === undefined) {
1823
+ if (key == null) {
1828
1824
  const withoutGroup = groups.get(undefined) || [];
1829
1825
  items.push(...withoutGroup.map(x => {
1830
1826
  x.index = i++;
@@ -1835,11 +1831,11 @@ class ItemsList {
1835
1831
  const isObjectKey = isObject(key);
1836
1832
  const parent = {
1837
1833
  label: isObjectKey ? '' : String(key),
1838
- children: undefined,
1834
+ children: null,
1839
1835
  parent: null,
1840
1836
  index: i++,
1841
1837
  disabled: !this._ngSelect.selectableGroup,
1842
- htmlId: newId(),
1838
+ htmlId: `${this._ngSelect._uid}-group-${groupIndex}-heading`,
1843
1839
  };
1844
1840
  const groupKey = isGroupByFn
1845
1841
  ? this._ngSelect.bindLabel
@@ -1853,7 +1849,7 @@ class ItemsList {
1853
1849
  });
1854
1850
  const children = groups.get(key).map(x => {
1855
1851
  x.parent = parent;
1856
- x.children = undefined;
1852
+ x.children = null;
1857
1853
  x.index = i++;
1858
1854
  return x;
1859
1855
  });
@@ -1861,6 +1857,7 @@ class ItemsList {
1861
1857
  parent.value = groupValue(key, children.map(x => x.value));
1862
1858
  items.push(parent);
1863
1859
  items.push(...children);
1860
+ groupIndex++;
1864
1861
  }
1865
1862
  return items;
1866
1863
  }
@@ -1874,11 +1871,9 @@ class NgSelectConfig {
1874
1871
  this.addTagText = 'Add item';
1875
1872
  this.loadingText = 'Loading...';
1876
1873
  this.clearAllText = 'Clear all';
1877
- this.ariaLabelDropdown = 'Options List';
1878
- this.disableVirtualScroll = true;
1874
+ this.virtualScroll = false;
1879
1875
  this.openOnEnter = true;
1880
1876
  this.appearance = 'underline';
1881
- this.tabFocusOnClear = true;
1882
1877
  }
1883
1878
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1884
1879
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
@@ -1894,7 +1889,7 @@ class NgItemLabel {
1894
1889
  this.escape = true;
1895
1890
  this.element = inject(ElementRef);
1896
1891
  }
1897
- ngOnChanges(changes) {
1892
+ ngOnChanges() {
1898
1893
  this.element.nativeElement.innerHTML = this.escape
1899
1894
  ? escapeHTML(this.ngItemLabel)
1900
1895
  : this.ngItemLabel;
@@ -2158,6 +2153,7 @@ class DefaultSelectionModel {
2158
2153
  }
2159
2154
 
2160
2155
  const SELECTION_MODEL_FACTORY = new InjectionToken('ng-select-selection-model');
2156
+ let nextUniqueId = 0;
2161
2157
  class NgSelect {
2162
2158
  set panelClass(value) {
2163
2159
  const newClassList = {};
@@ -2174,6 +2170,12 @@ class NgSelect {
2174
2170
  this._classList = newClassList;
2175
2171
  this._cdr.markForCheck();
2176
2172
  }
2173
+ get inputId() {
2174
+ return this._inputId || `${this._uid}-input`;
2175
+ }
2176
+ set inputId(value) {
2177
+ this._inputId = value;
2178
+ }
2177
2179
  get items() {
2178
2180
  return this._items;
2179
2181
  }
@@ -2194,25 +2196,13 @@ class NgSelect {
2194
2196
  this._compareWith = fn;
2195
2197
  }
2196
2198
  get clearSearchOnAdd() {
2197
- if (isDefined(this._clearSearchOnAdd)) {
2198
- return this._clearSearchOnAdd;
2199
- }
2200
- else if (isDefined(this._config.clearSearchOnAdd)) {
2201
- return this._config.clearSearchOnAdd;
2202
- }
2203
- return this.closeOnSelect;
2199
+ return this._clearSearchOnAdd ?? this._config.clearSearchOnAdd ?? this.closeOnSelect;
2204
2200
  }
2205
2201
  set clearSearchOnAdd(value) {
2206
2202
  this._clearSearchOnAdd = value;
2207
2203
  }
2208
2204
  get deselectOnClick() {
2209
- if (isDefined(this._deselectOnClick)) {
2210
- return this._deselectOnClick;
2211
- }
2212
- else if (isDefined(this._config.deselectOnClick)) {
2213
- return this._config.deselectOnClick;
2214
- }
2215
- return this.multiple;
2205
+ return this._deselectOnClick ?? this._config.deselectOnClick ?? this.multiple;
2216
2206
  }
2217
2207
  set deselectOnClick(value) {
2218
2208
  this._deselectOnClick = value;
@@ -2256,6 +2246,22 @@ class NgSelect {
2256
2246
  const term = this.searchTerm?.trim();
2257
2247
  return term && term.length >= this.minTermLength;
2258
2248
  }
2249
+ get showClearButton() {
2250
+ return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
2251
+ }
2252
+ get showNoItemsFound() {
2253
+ const empty = this.itemsList.filteredItems.length === 0;
2254
+ return (((empty && !this._isTypeahead && !this.loading) ||
2255
+ (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
2256
+ !this.showAddTag);
2257
+ }
2258
+ get showTypeToSearch() {
2259
+ const empty = this.itemsList.filteredItems.length === 0;
2260
+ return empty && this._isTypeahead && !this._validTerm && !this.loading;
2261
+ }
2262
+ get listboxId() {
2263
+ return `${this._uid}-listbox`;
2264
+ }
2259
2265
  constructor() {
2260
2266
  this._cdr = inject(ChangeDetectorRef);
2261
2267
  this._elementRef = inject(ElementRef);
@@ -2264,17 +2270,26 @@ class NgSelect {
2264
2270
  this.autoFocus = inject(new HostAttributeToken('autofocus'), { optional: true });
2265
2271
  this.classes = inject(new HostAttributeToken('class'), { optional: true });
2266
2272
  this._classList = {};
2267
- this.fixedPlaceholder = false;
2268
- this.dropdownPosition = 'auto';
2273
+ this._uid = `ng-select-${nextUniqueId++}`;
2274
+ this.bindLabel = this._config.bindLabel;
2275
+ this.bindValue = this._config.bindValue;
2276
+ this.placeholder = this._config.placeholder;
2277
+ this.fixedPlaceholder = this._config.fixedPlaceholder ?? false;
2278
+ this.appendTo = this._config.appendTo;
2279
+ this.panelPosition = 'auto';
2269
2280
  this.readonly = false;
2270
2281
  this.multiple = false;
2271
2282
  this.searchable = true;
2272
2283
  this.clearable = true;
2284
+ this.clearOnBackspace = true;
2285
+ this.clearAllText = this._config.clearAllText;
2273
2286
  this.loading = false;
2287
+ this.loadingText = this._config.loadingText;
2274
2288
  this.closeOnSelect = true;
2275
- this.clearOnBackspace = true;
2276
2289
  this.hideSelected = false;
2277
2290
  this.selectOnTab = false;
2291
+ this.openOnEnter = this._config.openOnEnter;
2292
+ this.virtualScroll = this._config.virtualScroll;
2278
2293
  this.bufferAmount = 4;
2279
2294
  this.selectableGroup = false;
2280
2295
  this.selectableGroupAsModel = true;
@@ -2285,14 +2300,17 @@ class NgSelect {
2285
2300
  this.markFirst = true;
2286
2301
  this.preventToggleOnRightClick = false;
2287
2302
  this.addTag = false;
2303
+ this.addTagText = this._config.addTagText;
2304
+ this.notFoundText = this._config.notFoundText;
2305
+ this.typeToSearchText = this._config.typeToSearchText;
2288
2306
  this.searchFn = null;
2289
2307
  this.keyDownFn = (_) => true;
2290
2308
  this.trackByFn = null;
2291
- this.labelForId = null;
2292
- this.ariaLabelDropdown = 'Options List';
2309
+ this.appearance = this._config.appearance;
2293
2310
  this.inputAttrs = {};
2294
2311
  // isOpen should allow undefined value, so avoid using booleanAttribute!
2295
2312
  this.isOpen = false;
2313
+ this._inputId = '';
2296
2314
  this._items = [];
2297
2315
  this._disabled = false;
2298
2316
  // output events
@@ -2307,12 +2325,11 @@ class NgSelect {
2307
2325
  this.removeEvent = new EventEmitter();
2308
2326
  this.scroll = new EventEmitter();
2309
2327
  this.scrollToEnd = new EventEmitter();
2310
- this.dropdownId = newId();
2328
+ this.itemsList = new ItemsList(this, this.newSelectionModel?.() ?? DefaultSelectionModelFactory());
2311
2329
  this.element = this._elementRef.nativeElement;
2312
2330
  this.viewPortItems = [];
2313
2331
  this.searchTerm = null;
2314
2332
  this.escapeHTML = true;
2315
- this.tabFocusOnClear = true;
2316
2333
  this._pressedKeys = [];
2317
2334
  this._isComposing = false;
2318
2335
  this._defaultLabel = 'label';
@@ -2330,9 +2347,7 @@ class NgSelect {
2330
2347
  const option = this.selectedItems.find(x => x.value === item);
2331
2348
  this.unselect(option);
2332
2349
  };
2333
- this._mergeGlobalConfig();
2334
2350
  this.classes?.split(/\s+/).forEach(c => (this._classList[c] = true));
2335
- this.itemsList = new ItemsList(this, this.newSelectionModel ? this.newSelectionModel() : DefaultSelectionModelFactory());
2336
2351
  }
2337
2352
  ngOnInit() {
2338
2353
  this._handleKeyPresses();
@@ -2356,7 +2371,6 @@ class NgSelect {
2356
2371
  if (changes['inputAttrs']) {
2357
2372
  this._setInputAttributes();
2358
2373
  }
2359
- this._setTabFocusOnClear();
2360
2374
  }
2361
2375
  ngAfterViewInit() {
2362
2376
  if (!this._itemsAreUsed) {
@@ -2584,7 +2598,7 @@ class NgSelect {
2584
2598
  selectTag() {
2585
2599
  let tag;
2586
2600
  if (isFunction(this.addTag)) {
2587
- tag = this.addTag(this.searchTerm);
2601
+ tag = this.addTag(this.searchTerm || '');
2588
2602
  }
2589
2603
  else {
2590
2604
  tag = this._primitive ? this.searchTerm : { [this.bindLabel]: this.searchTerm };
@@ -2599,25 +2613,6 @@ class NgSelect {
2599
2613
  this.select(handleTag(tag));
2600
2614
  }
2601
2615
  }
2602
- showClear() {
2603
- return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
2604
- }
2605
- focusOnClear() {
2606
- this.blur();
2607
- if (this.clearButton) {
2608
- this.clearButton.nativeElement.focus();
2609
- }
2610
- }
2611
- showNoItemsFound() {
2612
- const empty = this.itemsList.filteredItems.length === 0;
2613
- return (((empty && !this._isTypeahead && !this.loading) ||
2614
- (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
2615
- !this.showAddTag);
2616
- }
2617
- showTypeToSearch() {
2618
- const empty = this.itemsList.filteredItems.length === 0;
2619
- return empty && this._isTypeahead && !this._validTerm && !this.loading;
2620
- }
2621
2616
  onCompositionStart() {
2622
2617
  this._isComposing = true;
2623
2618
  }
@@ -2818,12 +2813,6 @@ class NgSelect {
2818
2813
  input.setAttribute(key, attributes[key]);
2819
2814
  }
2820
2815
  }
2821
- _setTabFocusOnClear() {
2822
- this.tabFocusOnClear = isDefined(this.tabFocusOnClearButton)
2823
- ? !!this.tabFocusOnClearButton
2824
- : this._config.tabFocusOnClear;
2825
- this._cdr.markForCheck();
2826
- }
2827
2816
  _updateNgModel() {
2828
2817
  const model = [];
2829
2818
  for (const item of this.selectedItems) {
@@ -2887,11 +2876,7 @@ class NgSelect {
2887
2876
  }
2888
2877
  _handleTab(e) {
2889
2878
  if (this.isOpen === false) {
2890
- if (this.showClear() && !e.shiftKey && this.tabFocusOnClear) {
2891
- this.focusOnClear();
2892
- e.preventDefault();
2893
- }
2894
- else if (!this.addTag) {
2879
+ if (!this.addTag) {
2895
2880
  return;
2896
2881
  }
2897
2882
  }
@@ -2980,52 +2965,14 @@ class NgSelect {
2980
2965
  this.clearModel();
2981
2966
  }
2982
2967
  }
2983
- _mergeGlobalConfig() {
2984
- this.placeholder = this.placeholder || this._config.placeholder;
2985
- this.fixedPlaceholder = this.fixedPlaceholder || this._config.fixedPlaceholder;
2986
- this.notFoundText = this.notFoundText || this._config.notFoundText;
2987
- this.typeToSearchText = this.typeToSearchText || this._config.typeToSearchText;
2988
- this.addTagText = this.addTagText || this._config.addTagText;
2989
- this.loadingText = this.loadingText || this._config.loadingText;
2990
- this.clearAllText = this.clearAllText || this._config.clearAllText;
2991
- this.virtualScroll = this.getVirtualScroll(this._config);
2992
- this.openOnEnter = isDefined(this.openOnEnter) ? this.openOnEnter : this._config.openOnEnter;
2993
- this.appendTo = this.appendTo || this._config.appendTo;
2994
- this.bindValue = this.bindValue || this._config.bindValue;
2995
- this.bindLabel = this.bindLabel || this._config.bindLabel;
2996
- this.appearance = this.appearance || this._config.appearance;
2997
- this._setTabFocusOnClear();
2998
- }
2999
- /**
3000
- * Gets virtual scroll value from input or from config
3001
- *
3002
- * @param config NgSelectConfig object
3003
- *
3004
- * @returns `true` if virtual scroll is enabled, `false` otherwise
3005
- */
3006
- getVirtualScroll(config) {
3007
- return isDefined(this.virtualScroll)
3008
- ? this.virtualScroll
3009
- : this.isVirtualScrollDisabled(config);
3010
- }
3011
- /**
3012
- * Gets disableVirtualScroll value from input or from config
3013
- *
3014
- * @param config NgSelectConfig object
3015
- *
3016
- * @returns `true` if disableVirtualScroll is enabled, `false` otherwise
3017
- */
3018
- isVirtualScrollDisabled(config) {
3019
- return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
3020
- }
3021
2968
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3022
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: NgSelect, isStandalone: true, selector: "ng-select", inputs: { bindLabel: "bindLabel", bindValue: "bindValue", placeholder: "placeholder", fixedPlaceholder: "fixedPlaceholder", appendTo: "appendTo", dropdownPosition: "dropdownPosition", readonly: ["readonly", "readonly", booleanAttribute], multiple: ["multiple", "multiple", booleanAttribute], searchable: ["searchable", "searchable", booleanAttribute], clearable: ["clearable", "clearable", booleanAttribute], clearAllText: "clearAllText", tabFocusOnClearButton: "tabFocusOnClearButton", loading: ["loading", "loading", booleanAttribute], loadingText: "loadingText", closeOnSelect: ["closeOnSelect", "closeOnSelect", booleanAttribute], clearOnBackspace: ["clearOnBackspace", "clearOnBackspace", booleanAttribute], hideSelected: ["hideSelected", "hideSelected", booleanAttribute], selectOnTab: ["selectOnTab", "selectOnTab", booleanAttribute], openOnEnter: ["openOnEnter", "openOnEnter", booleanAttribute], virtualScroll: ["virtualScroll", "virtualScroll", booleanAttribute], bufferAmount: ["bufferAmount", "bufferAmount", numberAttribute], selectableGroup: ["selectableGroup", "selectableGroup", booleanAttribute], selectableGroupAsModel: ["selectableGroupAsModel", "selectableGroupAsModel", booleanAttribute], searchWhileComposing: ["searchWhileComposing", "searchWhileComposing", booleanAttribute], editableSearchTerm: ["editableSearchTerm", "editableSearchTerm", booleanAttribute], maxSelectedItems: ["maxSelectedItems", "maxSelectedItems", numberAttribute], minTermLength: ["minTermLength", "minTermLength", numberAttribute], markFirst: ["markFirst", "markFirst", booleanAttribute], preventToggleOnRightClick: ["preventToggleOnRightClick", "preventToggleOnRightClick", booleanAttribute], addTag: "addTag", addTagText: "addTagText", notFoundText: "notFoundText", typeahead: "typeahead", typeToSearchText: "typeToSearchText", groupBy: "groupBy", groupValue: "groupValue", searchFn: "searchFn", keyDownFn: "keyDownFn", trackByFn: "trackByFn", appearance: "appearance", tabIndex: ["tabIndex", "tabIndex", numberAttribute], labelForId: "labelForId", ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", ariaDescribedby: "ariaDescribedby", ariaLabelDropdown: "ariaLabelDropdown", inputAttrs: "inputAttrs", isOpen: "isOpen", panelClass: "panelClass", items: "items", compareWith: "compareWith", clearSearchOnAdd: "clearSearchOnAdd", deselectOnClick: "deselectOnClick" }, outputs: { blurEvent: "blur", focusEvent: "focus", changeEvent: "change", openEvent: "open", closeEvent: "close", searchEvent: "search", clearEvent: "clear", addEvent: "add", removeEvent: "remove", scroll: "scroll", scrollToEnd: "scrollToEnd" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.ng-select-single": "!multiple", "class.ng-select-multiple": "multiple", "class.ng-select-typeahead": "typeahead", "class.ng-select-taggable": "addTag", "class.ng-select-searchable": "searchable", "class.ng-select-clearable": "clearable", "class.ng-select-opened": "isOpen", "class.ng-select-filtered": "filtered", "class.ng-select-disabled": "disabled" }, classAttribute: "ng-select" }, providers: [
2969
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: NgSelect, isStandalone: true, selector: "ng-select", inputs: { bindLabel: "bindLabel", bindValue: "bindValue", placeholder: "placeholder", fixedPlaceholder: "fixedPlaceholder", appendTo: "appendTo", panelPosition: "panelPosition", readonly: ["readonly", "readonly", booleanAttribute], multiple: ["multiple", "multiple", booleanAttribute], searchable: ["searchable", "searchable", booleanAttribute], clearable: ["clearable", "clearable", booleanAttribute], clearOnBackspace: ["clearOnBackspace", "clearOnBackspace", booleanAttribute], clearAllText: "clearAllText", loading: ["loading", "loading", booleanAttribute], loadingText: "loadingText", closeOnSelect: ["closeOnSelect", "closeOnSelect", booleanAttribute], hideSelected: ["hideSelected", "hideSelected", booleanAttribute], selectOnTab: ["selectOnTab", "selectOnTab", booleanAttribute], openOnEnter: ["openOnEnter", "openOnEnter", booleanAttribute], virtualScroll: ["virtualScroll", "virtualScroll", booleanAttribute], bufferAmount: ["bufferAmount", "bufferAmount", numberAttribute], selectableGroup: ["selectableGroup", "selectableGroup", booleanAttribute], selectableGroupAsModel: ["selectableGroupAsModel", "selectableGroupAsModel", booleanAttribute], searchWhileComposing: ["searchWhileComposing", "searchWhileComposing", booleanAttribute], editableSearchTerm: ["editableSearchTerm", "editableSearchTerm", booleanAttribute], maxSelectedItems: ["maxSelectedItems", "maxSelectedItems", numberAttribute], minTermLength: ["minTermLength", "minTermLength", numberAttribute], markFirst: ["markFirst", "markFirst", booleanAttribute], preventToggleOnRightClick: ["preventToggleOnRightClick", "preventToggleOnRightClick", booleanAttribute], addTag: "addTag", addTagText: "addTagText", notFoundText: "notFoundText", typeahead: "typeahead", typeToSearchText: "typeToSearchText", groupBy: "groupBy", groupValue: "groupValue", searchFn: "searchFn", keyDownFn: "keyDownFn", trackByFn: "trackByFn", appearance: "appearance", tabIndex: ["tabIndex", "tabIndex", numberAttribute], ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", ariaDescribedby: "ariaDescribedby", inputAttrs: "inputAttrs", isOpen: "isOpen", panelClass: "panelClass", inputId: "inputId", items: "items", compareWith: "compareWith", clearSearchOnAdd: "clearSearchOnAdd", deselectOnClick: "deselectOnClick" }, outputs: { blurEvent: "blur", focusEvent: "focus", changeEvent: "change", openEvent: "open", closeEvent: "close", searchEvent: "search", clearEvent: "clear", addEvent: "add", removeEvent: "remove", scroll: "scroll", scrollToEnd: "scrollToEnd" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.ng-select-single": "!multiple", "class.ng-select-multiple": "multiple", "class.ng-select-typeahead": "typeahead", "class.ng-select-taggable": "addTag", "class.ng-select-searchable": "searchable", "class.ng-select-clearable": "clearable", "class.ng-select-opened": "isOpen", "class.ng-select-filtered": "filtered", "class.ng-select-disabled": "disabled" }, classAttribute: "ng-select" }, providers: [
3023
2970
  {
3024
2971
  provide: NG_VALUE_ACCESSOR,
3025
2972
  useExisting: forwardRef(() => NgSelect),
3026
2973
  multi: true,
3027
2974
  },
3028
- ], queries: [{ propertyName: "optionTemplate", first: true, predicate: NgOptionTemplate, descendants: true, read: TemplateRef }, { propertyName: "optgroupTemplate", first: true, predicate: NgOptgroupTemplate, descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: NgLabelTemplate, descendants: true, read: TemplateRef }, { propertyName: "multiLabelTemplate", first: true, predicate: NgMultiLabelTemplate, descendants: true, read: TemplateRef }, { propertyName: "headerTemplate", first: true, predicate: NgHeaderTemplate, descendants: true, read: TemplateRef }, { propertyName: "footerTemplate", first: true, predicate: NgFooterTemplate, descendants: true, read: TemplateRef }, { propertyName: "notFoundTemplate", first: true, predicate: NgNotFoundTemplate, descendants: true, read: TemplateRef }, { propertyName: "placeholderTemplate", first: true, predicate: NgPlaceholderTemplate, descendants: true, read: TemplateRef }, { propertyName: "typeToSearchTemplate", first: true, predicate: NgTypeToSearchTemplate, descendants: true, read: TemplateRef }, { propertyName: "loadingTextTemplate", first: true, predicate: NgLoadingTextTemplate, descendants: true, read: TemplateRef }, { propertyName: "tagTemplate", first: true, predicate: NgTagTemplate, descendants: true, read: TemplateRef }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: NgLoadingSpinnerTemplate, descendants: true, read: TemplateRef }, { propertyName: "clearButtonTemplate", first: true, predicate: NgClearButtonTemplate, descendants: true, read: TemplateRef }, { propertyName: "ngOptions", predicate: NgOption, descendants: true }], viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: i0.forwardRef(() => NgDropdownPanel), descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, static: true }, { propertyName: "clearButton", first: true, predicate: ["clearButton"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"ng-select-container\"\n [class.ng-appearance-outline]=\"appearance === 'outline'\"\n [class.ng-has-value]=\"hasValue\"\n (mousedown)=\"handleMousedown($event)\"\n>\n <div class=\"ng-value-container\">\n @if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n <ng-template #defaultPlaceholderTemplate>\n <div class=\"ng-placeholder\">{{ placeholder }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\" />\n }\n\n @if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n @for (item of selectedItems; track trackByOption($index, item)) {\n <div class=\"ng-value\" [class.ng-value-disabled]=\"item.disabled\">\n <ng-template #defaultLabelTemplate>\n <span\n class=\"ng-value-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n <span class=\"ng-value-remove\" (click)=\"unselect(item)\" role=\"button\">\u00D7</span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n [ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\"\n />\n </div>\n }\n }\n\n @if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n <ng-template\n [ngTemplateOutlet]=\"multiLabelTemplate\"\n [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\"\n />\n }\n\n <div class=\"ng-input\">\n <input\n #searchInput\n [disabled]=\"disabled\"\n [readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n [value]=\"searchTerm ?? ''\"\n (change)=\"$event.stopPropagation()\"\n (input)=\"filter(searchInput.value)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (compositionend)=\"onCompositionEnd(searchInput.value)\"\n (compositionstart)=\"onCompositionStart()\"\n [tabIndex]=\"tabIndex\"\n [attr.id]=\"labelForId\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? dropdownId : null\"\n [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n aria-autocomplete=\"list\"\n role=\"combobox\"\n />\n </div>\n </div>\n\n @if (loading) {\n <ng-template #defaultLoadingSpinnerTemplate>\n <div class=\"ng-select-spinner\"></div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\" />\n }\n\n @if (showClear()) {\n @if (clearButtonTemplate) {\n <ng-container [ngTemplateOutlet]=\"clearButtonTemplate\" />\n } @else {\n <span\n #clearButton\n class=\"ng-clear-wrapper\"\n [title]=\"clearAllText\"\n [attr.tabindex]=\"tabFocusOnClear ? 0 : -1\"\n role=\"button\"\n >\n <span class=\"ng-clear\">\u00D7</span>\n </span>\n }\n }\n\n <span class=\"ng-arrow-wrapper\">\n <span class=\"ng-arrow\"></span>\n </span>\n</div>\n\n@if (isOpen) {\n <ng-dropdown-panel\n class=\"ng-dropdown-panel\"\n [class.ng-select-multiple]=\"multiple\"\n [class]=\"appendTo ? _classList : null\"\n [id]=\"dropdownId\"\n [ariaLabelDropdown]=\"ariaLabelDropdown\"\n [virtualScroll]=\"virtualScroll\"\n [bufferAmount]=\"bufferAmount\"\n [appendTo]=\"appendTo\"\n [position]=\"dropdownPosition\"\n [headerTemplate]=\"headerTemplate\"\n [footerTemplate]=\"footerTemplate\"\n [filterValue]=\"searchTerm\"\n [items]=\"itemsList.filteredItems\"\n [markedItem]=\"itemsList.markedItem\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit()\"\n (outsideClick)=\"close()\"\n >\n <ng-container>\n @for (item of viewPortItems; track trackByOption($index, item)) {\n <div\n class=\"ng-option\"\n [class.ng-option-disabled]=\"item.disabled\"\n [class.ng-option-selected]=\"item.selected\"\n [class.ng-optgroup]=\"item.children\"\n [class.ng-option]=\"!item.children\"\n [class.ng-option-child]=\"!!item.parent\"\n [class.ng-option-marked]=\"item === itemsList.markedItem\"\n [attr.id]=\"item?.htmlId\"\n [attr.role]=\"item.children ? 'group' : 'option'\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-setsize]=\"itemsList.filteredItems.length\"\n [attr.aria-posinset]=\"item.index! + 1\"\n (click)=\"toggleItem(item)\"\n (mouseover)=\"onItemHover(item)\"\n >\n <ng-template #defaultOptionTemplate>\n <span\n class=\"ng-option-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"\n item.children\n ? optgroupTemplate || defaultOptionTemplate\n : optionTemplate || defaultOptionTemplate\n \"\n [ngTemplateOutletContext]=\"{\n item: item.value,\n item$: item,\n index: item.index,\n searchTerm: searchTerm,\n }\"\n />\n </div>\n }\n @if (showAddTag) {\n <div\n class=\"ng-option\"\n [class.ng-option-marked]=\"!itemsList.markedItem\"\n (click)=\"selectTag()\"\n (mouseover)=\"itemsList.unmarkItem()\"\n role=\"option\"\n >\n <ng-template #defaultTagTemplate>\n <span>\n <span class=\"ng-tag-label\">{{ addTagText }}</span>\n \"{{ searchTerm }}\"\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n </div>\n }\n </ng-container>\n @if (showNoItemsFound()) {\n <ng-template #defaultNotFoundTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n @if (showTypeToSearch()) {\n <ng-template #defaultTypeToSearchTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\" />\n }\n @if (loading && itemsList.filteredItems.length === 0) {\n <ng-template #defaultLoadingTextTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n </ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div class=\"ng-select-visually-hidden\" aria-atomic=\"true\" aria-live=\"polite\" role=\"status\">\n @if (isOpen && showNoItemsFound()) {\n {{ notFoundText }}\n }\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-placeholder,.ng-select.ng-select-disabled .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder,.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{box-sizing:border-box;position:relative;display:flex;width:100%;outline:none;overflow:hidden;cursor:default}.ng-select .ng-value-container{display:flex;flex:1}.ng-select .ng-input{box-sizing:border-box;opacity:0}.ng-select .ng-input>input{width:100%;padding:0;background:transparent;border:none;box-shadow:none;outline:none;cursor:default}.ng-select .ng-input>input::-ms-clear{display:none}.ng-select .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-value-container,.ng-select.ng-select-single .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-value-remove{display:none}.ng-select.ng-select-single .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-placeholder{position:absolute;z-index:1}.ng-select.ng-select-multiple .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-value-remove{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-input{flex:1;z-index:2}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-arrow-wrapper{position:relative;text-align:center;-webkit-user-select:none;user-select:none;cursor:pointer}.ng-select .ng-arrow{position:relative;display:inline-block;height:0;width:0;pointer-events:none}.ng-dropdown-panel{box-sizing:border-box;position:absolute;z-index:1050;width:100%;opacity:0;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-optgroup,.ng-dropdown-panel .ng-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-option{display:block;cursor:pointer}.ng-dropdown-panel .ng-option.disabled{cursor:default}.ng-dropdown-panel .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-option-label:empty:before{content:\"\\200b\"}.ng-select-virtual-scroll-host{position:relative;display:block;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.ng-select-virtual-scroll-content{position:absolute;top:0;left:0;width:100%;height:100%}.ng-select-virtual-scroll-spacer{width:1px;opacity:0}.ng-select-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0;clip-path:rect(0 0 0 0);white-space:nowrap}.ng-select-spinner{position:relative;width:16px;height:16px;margin:0 4px;font-size:10px;text-indent:-9999em;border-radius:50%;border:2px solid rgba(66,66,66,.2);border-left-color:#424242;animation:load8 .8s infinite linear}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgItemLabel, selector: "[ngItemLabel]", inputs: ["ngItemLabel", "escape"] }, { kind: "component", type: NgDropdownPanel, selector: "ng-dropdown-panel", inputs: ["items", "markedItem", "position", "appendTo", "bufferAmount", "virtualScroll", "headerTemplate", "footerTemplate", "filterValue", "ariaLabelDropdown"], outputs: ["update", "scroll", "scrollToEnd", "outsideClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2975
+ ], queries: [{ propertyName: "optionTemplate", first: true, predicate: NgOptionTemplate, descendants: true, read: TemplateRef }, { propertyName: "optgroupTemplate", first: true, predicate: NgOptgroupTemplate, descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: NgLabelTemplate, descendants: true, read: TemplateRef }, { propertyName: "multiLabelTemplate", first: true, predicate: NgMultiLabelTemplate, descendants: true, read: TemplateRef }, { propertyName: "headerTemplate", first: true, predicate: NgHeaderTemplate, descendants: true, read: TemplateRef }, { propertyName: "footerTemplate", first: true, predicate: NgFooterTemplate, descendants: true, read: TemplateRef }, { propertyName: "notFoundTemplate", first: true, predicate: NgNotFoundTemplate, descendants: true, read: TemplateRef }, { propertyName: "placeholderTemplate", first: true, predicate: NgPlaceholderTemplate, descendants: true, read: TemplateRef }, { propertyName: "typeToSearchTemplate", first: true, predicate: NgTypeToSearchTemplate, descendants: true, read: TemplateRef }, { propertyName: "loadingTextTemplate", first: true, predicate: NgLoadingTextTemplate, descendants: true, read: TemplateRef }, { propertyName: "tagTemplate", first: true, predicate: NgTagTemplate, descendants: true, read: TemplateRef }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: NgLoadingSpinnerTemplate, descendants: true, read: TemplateRef }, { propertyName: "clearButtonTemplate", first: true, predicate: NgClearButtonTemplate, descendants: true, read: TemplateRef }, { propertyName: "ngOptions", predicate: NgOption, descendants: true }], viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: i0.forwardRef(() => NgDropdownPanel), descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, static: true }, { propertyName: "clearButton", first: true, predicate: ["clearButton"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"ng-select-container\"\n [class.ng-appearance-outline]=\"appearance === 'outline'\"\n [class.ng-has-value]=\"hasValue\"\n (mousedown)=\"handleMousedown($event)\"\n>\n <div class=\"ng-value-container\">\n @if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n <ng-template #defaultPlaceholderTemplate>\n <div class=\"ng-placeholder\">{{ placeholder }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\" />\n }\n\n @if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n @for (item of selectedItems; track trackByOption($index, item)) {\n <div class=\"ng-value\" [class.ng-value-disabled]=\"item.disabled\">\n <ng-template #defaultLabelTemplate>\n <span\n class=\"ng-value-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n <span class=\"ng-value-remove\" (click)=\"unselect(item)\" role=\"button\">\u00D7</span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n [ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\"\n />\n </div>\n }\n }\n\n @if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n <ng-template\n [ngTemplateOutlet]=\"multiLabelTemplate\"\n [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\"\n />\n }\n\n <div class=\"ng-input\">\n <input\n #searchInput\n [disabled]=\"disabled\"\n [readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n [value]=\"searchTerm ?? ''\"\n (change)=\"$event.stopPropagation()\"\n (input)=\"filter(searchInput.value)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (compositionend)=\"onCompositionEnd(searchInput.value)\"\n (compositionstart)=\"onCompositionStart()\"\n [tabIndex]=\"tabIndex\"\n [attr.id]=\"inputId\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? listboxId : null\"\n [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n role=\"combobox\"\n />\n </div>\n </div>\n\n @if (loading) {\n <ng-template #defaultLoadingSpinnerTemplate>\n <div class=\"ng-select-spinner\"></div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\" />\n }\n\n @if (showClearButton) {\n @if (clearButtonTemplate) {\n <ng-container [ngTemplateOutlet]=\"clearButtonTemplate\" />\n } @else {\n <span #clearButton class=\"ng-clear-wrapper\" [title]=\"clearAllText\" aria-hidden=\"true\">\n <span class=\"ng-clear\">\u00D7</span>\n </span>\n }\n }\n\n <span class=\"ng-arrow-wrapper\" aria-hidden=\"true\">\n <span class=\"ng-arrow\"></span>\n </span>\n</div>\n\n@if (isOpen) {\n <ng-dropdown-panel\n class=\"ng-dropdown-panel\"\n [class.ng-select-multiple]=\"multiple\"\n [class]=\"appendTo ? _classList : null\"\n [listboxId]=\"listboxId\"\n [virtualScroll]=\"virtualScroll\"\n [bufferAmount]=\"bufferAmount\"\n [appendTo]=\"appendTo\"\n [position]=\"panelPosition\"\n [headerTemplate]=\"headerTemplate\"\n [footerTemplate]=\"footerTemplate\"\n [filterValue]=\"searchTerm\"\n [items]=\"itemsList.filteredItems\"\n [markedItem]=\"itemsList.markedItem\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit()\"\n (outsideClick)=\"close()\"\n >\n @for (item of viewPortItems; track trackByOption($index, item)) {\n <div\n class=\"ng-option\"\n [class.ng-option-disabled]=\"item.disabled\"\n [class.ng-option-selected]=\"item.selected\"\n [class.ng-optgroup]=\"item.children\"\n [class.ng-option]=\"!item.children\"\n [class.ng-option-child]=\"!!item.parent\"\n [class.ng-option-marked]=\"item === itemsList.markedItem\"\n [attr.id]=\"item?.htmlId\"\n [attr.role]=\"item.children ? 'group' : 'option'\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-setsize]=\"itemsList.filteredItems.length\"\n [attr.aria-posinset]=\"item.index! + 1\"\n (click)=\"toggleItem(item)\"\n (mouseover)=\"onItemHover(item)\"\n >\n <ng-template #defaultOptionTemplate>\n <span\n class=\"ng-option-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"\n item.children\n ? optgroupTemplate || defaultOptionTemplate\n : optionTemplate || defaultOptionTemplate\n \"\n [ngTemplateOutletContext]=\"{\n item: item.value,\n item$: item,\n index: item.index,\n searchTerm: searchTerm,\n }\"\n />\n </div>\n }\n\n @if (showAddTag) {\n <div\n class=\"ng-option\"\n [class.ng-option-marked]=\"!itemsList.markedItem\"\n (click)=\"selectTag()\"\n (mouseover)=\"itemsList.unmarkItem()\"\n role=\"option\"\n >\n <ng-template #defaultTagTemplate>\n <span>\n <span class=\"ng-tag-label\">{{ addTagText }}</span>\n \"{{ searchTerm }}\"\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n </div>\n }\n\n @if (showNoItemsFound) {\n <ng-template #defaultNotFoundTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n @if (showTypeToSearch) {\n <ng-template #defaultTypeToSearchTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\" />\n }\n @if (loading && itemsList.filteredItems.length === 0) {\n <ng-template #defaultLoadingTextTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n </ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div class=\"ng-select-visually-hidden\" aria-atomic=\"true\" aria-live=\"polite\" role=\"status\">\n @if (isOpen && showNoItemsFound) {\n {{ notFoundText }}\n }\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-placeholder,.ng-select.ng-select-disabled .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder,.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{box-sizing:border-box;position:relative;display:flex;width:100%;outline:none;overflow:hidden;cursor:default}.ng-select .ng-value-container{display:flex;flex:1}.ng-select .ng-input{box-sizing:border-box;opacity:0}.ng-select .ng-input>input{width:100%;padding:0;background:transparent;border:none;box-shadow:none;outline:none;cursor:default}.ng-select .ng-input>input::-ms-clear{display:none}.ng-select .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-value-container,.ng-select.ng-select-single .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-value-remove{display:none}.ng-select.ng-select-single .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-placeholder{position:absolute;z-index:1}.ng-select.ng-select-multiple .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-value-remove{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-input{flex:1;z-index:2}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-arrow-wrapper{position:relative;text-align:center;-webkit-user-select:none;user-select:none;cursor:pointer}.ng-select .ng-arrow{position:relative;display:inline-block;height:0;width:0;pointer-events:none}.ng-dropdown-panel{box-sizing:border-box;position:absolute;z-index:1050;width:100%;opacity:0;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-optgroup,.ng-dropdown-panel .ng-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-option{display:block;cursor:pointer}.ng-dropdown-panel .ng-option.disabled{cursor:default}.ng-dropdown-panel .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-option-label:empty:before{content:\"\\200b\"}.ng-select-virtual-scroll-host{position:relative;display:block;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.ng-select-virtual-scroll-content{position:absolute;top:0;left:0;width:100%;height:100%}.ng-select-virtual-scroll-spacer{width:1px;opacity:0}.ng-select-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0;clip-path:rect(0 0 0 0);white-space:nowrap}.ng-select-spinner{position:relative;width:16px;height:16px;margin:0 4px;font-size:10px;text-indent:-9999em;border-radius:50%;border:2px solid rgba(66,66,66,.2);border-left-color:#424242;animation:load8 .8s infinite linear}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgItemLabel, selector: "[ngItemLabel]", inputs: ["ngItemLabel", "escape"] }, { kind: "component", type: NgDropdownPanel, selector: "ng-dropdown-panel", inputs: ["listboxId", "items", "markedItem", "position", "appendTo", "bufferAmount", "virtualScroll", "headerTemplate", "footerTemplate", "filterValue"], outputs: ["update", "scroll", "scrollToEnd", "outsideClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3029
2976
  }
3030
2977
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelect, decorators: [{
3031
2978
  type: Component,
@@ -3047,7 +2994,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
3047
2994
  useExisting: forwardRef(() => NgSelect),
3048
2995
  multi: true,
3049
2996
  },
3050
- ], template: "<!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"ng-select-container\"\n [class.ng-appearance-outline]=\"appearance === 'outline'\"\n [class.ng-has-value]=\"hasValue\"\n (mousedown)=\"handleMousedown($event)\"\n>\n <div class=\"ng-value-container\">\n @if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n <ng-template #defaultPlaceholderTemplate>\n <div class=\"ng-placeholder\">{{ placeholder }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\" />\n }\n\n @if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n @for (item of selectedItems; track trackByOption($index, item)) {\n <div class=\"ng-value\" [class.ng-value-disabled]=\"item.disabled\">\n <ng-template #defaultLabelTemplate>\n <span\n class=\"ng-value-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n <span class=\"ng-value-remove\" (click)=\"unselect(item)\" role=\"button\">\u00D7</span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n [ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\"\n />\n </div>\n }\n }\n\n @if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n <ng-template\n [ngTemplateOutlet]=\"multiLabelTemplate\"\n [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\"\n />\n }\n\n <div class=\"ng-input\">\n <input\n #searchInput\n [disabled]=\"disabled\"\n [readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n [value]=\"searchTerm ?? ''\"\n (change)=\"$event.stopPropagation()\"\n (input)=\"filter(searchInput.value)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (compositionend)=\"onCompositionEnd(searchInput.value)\"\n (compositionstart)=\"onCompositionStart()\"\n [tabIndex]=\"tabIndex\"\n [attr.id]=\"labelForId\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? dropdownId : null\"\n [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n aria-autocomplete=\"list\"\n role=\"combobox\"\n />\n </div>\n </div>\n\n @if (loading) {\n <ng-template #defaultLoadingSpinnerTemplate>\n <div class=\"ng-select-spinner\"></div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\" />\n }\n\n @if (showClear()) {\n @if (clearButtonTemplate) {\n <ng-container [ngTemplateOutlet]=\"clearButtonTemplate\" />\n } @else {\n <span\n #clearButton\n class=\"ng-clear-wrapper\"\n [title]=\"clearAllText\"\n [attr.tabindex]=\"tabFocusOnClear ? 0 : -1\"\n role=\"button\"\n >\n <span class=\"ng-clear\">\u00D7</span>\n </span>\n }\n }\n\n <span class=\"ng-arrow-wrapper\">\n <span class=\"ng-arrow\"></span>\n </span>\n</div>\n\n@if (isOpen) {\n <ng-dropdown-panel\n class=\"ng-dropdown-panel\"\n [class.ng-select-multiple]=\"multiple\"\n [class]=\"appendTo ? _classList : null\"\n [id]=\"dropdownId\"\n [ariaLabelDropdown]=\"ariaLabelDropdown\"\n [virtualScroll]=\"virtualScroll\"\n [bufferAmount]=\"bufferAmount\"\n [appendTo]=\"appendTo\"\n [position]=\"dropdownPosition\"\n [headerTemplate]=\"headerTemplate\"\n [footerTemplate]=\"footerTemplate\"\n [filterValue]=\"searchTerm\"\n [items]=\"itemsList.filteredItems\"\n [markedItem]=\"itemsList.markedItem\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit()\"\n (outsideClick)=\"close()\"\n >\n <ng-container>\n @for (item of viewPortItems; track trackByOption($index, item)) {\n <div\n class=\"ng-option\"\n [class.ng-option-disabled]=\"item.disabled\"\n [class.ng-option-selected]=\"item.selected\"\n [class.ng-optgroup]=\"item.children\"\n [class.ng-option]=\"!item.children\"\n [class.ng-option-child]=\"!!item.parent\"\n [class.ng-option-marked]=\"item === itemsList.markedItem\"\n [attr.id]=\"item?.htmlId\"\n [attr.role]=\"item.children ? 'group' : 'option'\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-setsize]=\"itemsList.filteredItems.length\"\n [attr.aria-posinset]=\"item.index! + 1\"\n (click)=\"toggleItem(item)\"\n (mouseover)=\"onItemHover(item)\"\n >\n <ng-template #defaultOptionTemplate>\n <span\n class=\"ng-option-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"\n item.children\n ? optgroupTemplate || defaultOptionTemplate\n : optionTemplate || defaultOptionTemplate\n \"\n [ngTemplateOutletContext]=\"{\n item: item.value,\n item$: item,\n index: item.index,\n searchTerm: searchTerm,\n }\"\n />\n </div>\n }\n @if (showAddTag) {\n <div\n class=\"ng-option\"\n [class.ng-option-marked]=\"!itemsList.markedItem\"\n (click)=\"selectTag()\"\n (mouseover)=\"itemsList.unmarkItem()\"\n role=\"option\"\n >\n <ng-template #defaultTagTemplate>\n <span>\n <span class=\"ng-tag-label\">{{ addTagText }}</span>\n \"{{ searchTerm }}\"\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n </div>\n }\n </ng-container>\n @if (showNoItemsFound()) {\n <ng-template #defaultNotFoundTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n @if (showTypeToSearch()) {\n <ng-template #defaultTypeToSearchTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\" />\n }\n @if (loading && itemsList.filteredItems.length === 0) {\n <ng-template #defaultLoadingTextTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n </ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div class=\"ng-select-visually-hidden\" aria-atomic=\"true\" aria-live=\"polite\" role=\"status\">\n @if (isOpen && showNoItemsFound()) {\n {{ notFoundText }}\n }\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-placeholder,.ng-select.ng-select-disabled .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder,.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{box-sizing:border-box;position:relative;display:flex;width:100%;outline:none;overflow:hidden;cursor:default}.ng-select .ng-value-container{display:flex;flex:1}.ng-select .ng-input{box-sizing:border-box;opacity:0}.ng-select .ng-input>input{width:100%;padding:0;background:transparent;border:none;box-shadow:none;outline:none;cursor:default}.ng-select .ng-input>input::-ms-clear{display:none}.ng-select .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-value-container,.ng-select.ng-select-single .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-value-remove{display:none}.ng-select.ng-select-single .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-placeholder{position:absolute;z-index:1}.ng-select.ng-select-multiple .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-value-remove{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-input{flex:1;z-index:2}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-arrow-wrapper{position:relative;text-align:center;-webkit-user-select:none;user-select:none;cursor:pointer}.ng-select .ng-arrow{position:relative;display:inline-block;height:0;width:0;pointer-events:none}.ng-dropdown-panel{box-sizing:border-box;position:absolute;z-index:1050;width:100%;opacity:0;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-optgroup,.ng-dropdown-panel .ng-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-option{display:block;cursor:pointer}.ng-dropdown-panel .ng-option.disabled{cursor:default}.ng-dropdown-panel .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-option-label:empty:before{content:\"\\200b\"}.ng-select-virtual-scroll-host{position:relative;display:block;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.ng-select-virtual-scroll-content{position:absolute;top:0;left:0;width:100%;height:100%}.ng-select-virtual-scroll-spacer{width:1px;opacity:0}.ng-select-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0;clip-path:rect(0 0 0 0);white-space:nowrap}.ng-select-spinner{position:relative;width:16px;height:16px;margin:0 4px;font-size:10px;text-indent:-9999em;border-radius:50%;border:2px solid rgba(66,66,66,.2);border-left-color:#424242;animation:load8 .8s infinite linear}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
2997
+ ], template: "<!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"ng-select-container\"\n [class.ng-appearance-outline]=\"appearance === 'outline'\"\n [class.ng-has-value]=\"hasValue\"\n (mousedown)=\"handleMousedown($event)\"\n>\n <div class=\"ng-value-container\">\n @if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n <ng-template #defaultPlaceholderTemplate>\n <div class=\"ng-placeholder\">{{ placeholder }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\" />\n }\n\n @if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n @for (item of selectedItems; track trackByOption($index, item)) {\n <div class=\"ng-value\" [class.ng-value-disabled]=\"item.disabled\">\n <ng-template #defaultLabelTemplate>\n <span\n class=\"ng-value-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n <span class=\"ng-value-remove\" (click)=\"unselect(item)\" role=\"button\">\u00D7</span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n [ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\"\n />\n </div>\n }\n }\n\n @if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n <ng-template\n [ngTemplateOutlet]=\"multiLabelTemplate\"\n [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\"\n />\n }\n\n <div class=\"ng-input\">\n <input\n #searchInput\n [disabled]=\"disabled\"\n [readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n [value]=\"searchTerm ?? ''\"\n (change)=\"$event.stopPropagation()\"\n (input)=\"filter(searchInput.value)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (compositionend)=\"onCompositionEnd(searchInput.value)\"\n (compositionstart)=\"onCompositionStart()\"\n [tabIndex]=\"tabIndex\"\n [attr.id]=\"inputId\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? listboxId : null\"\n [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n role=\"combobox\"\n />\n </div>\n </div>\n\n @if (loading) {\n <ng-template #defaultLoadingSpinnerTemplate>\n <div class=\"ng-select-spinner\"></div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\" />\n }\n\n @if (showClearButton) {\n @if (clearButtonTemplate) {\n <ng-container [ngTemplateOutlet]=\"clearButtonTemplate\" />\n } @else {\n <span #clearButton class=\"ng-clear-wrapper\" [title]=\"clearAllText\" aria-hidden=\"true\">\n <span class=\"ng-clear\">\u00D7</span>\n </span>\n }\n }\n\n <span class=\"ng-arrow-wrapper\" aria-hidden=\"true\">\n <span class=\"ng-arrow\"></span>\n </span>\n</div>\n\n@if (isOpen) {\n <ng-dropdown-panel\n class=\"ng-dropdown-panel\"\n [class.ng-select-multiple]=\"multiple\"\n [class]=\"appendTo ? _classList : null\"\n [listboxId]=\"listboxId\"\n [virtualScroll]=\"virtualScroll\"\n [bufferAmount]=\"bufferAmount\"\n [appendTo]=\"appendTo\"\n [position]=\"panelPosition\"\n [headerTemplate]=\"headerTemplate\"\n [footerTemplate]=\"footerTemplate\"\n [filterValue]=\"searchTerm\"\n [items]=\"itemsList.filteredItems\"\n [markedItem]=\"itemsList.markedItem\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit()\"\n (outsideClick)=\"close()\"\n >\n @for (item of viewPortItems; track trackByOption($index, item)) {\n <div\n class=\"ng-option\"\n [class.ng-option-disabled]=\"item.disabled\"\n [class.ng-option-selected]=\"item.selected\"\n [class.ng-optgroup]=\"item.children\"\n [class.ng-option]=\"!item.children\"\n [class.ng-option-child]=\"!!item.parent\"\n [class.ng-option-marked]=\"item === itemsList.markedItem\"\n [attr.id]=\"item?.htmlId\"\n [attr.role]=\"item.children ? 'group' : 'option'\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-setsize]=\"itemsList.filteredItems.length\"\n [attr.aria-posinset]=\"item.index! + 1\"\n (click)=\"toggleItem(item)\"\n (mouseover)=\"onItemHover(item)\"\n >\n <ng-template #defaultOptionTemplate>\n <span\n class=\"ng-option-label\"\n [ngItemLabel]=\"item.label || ''\"\n [escape]=\"escapeHTML\"\n ></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"\n item.children\n ? optgroupTemplate || defaultOptionTemplate\n : optionTemplate || defaultOptionTemplate\n \"\n [ngTemplateOutletContext]=\"{\n item: item.value,\n item$: item,\n index: item.index,\n searchTerm: searchTerm,\n }\"\n />\n </div>\n }\n\n @if (showAddTag) {\n <div\n class=\"ng-option\"\n [class.ng-option-marked]=\"!itemsList.markedItem\"\n (click)=\"selectTag()\"\n (mouseover)=\"itemsList.unmarkItem()\"\n role=\"option\"\n >\n <ng-template #defaultTagTemplate>\n <span>\n <span class=\"ng-tag-label\">{{ addTagText }}</span>\n \"{{ searchTerm }}\"\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n </div>\n }\n\n @if (showNoItemsFound) {\n <ng-template #defaultNotFoundTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n @if (showTypeToSearch) {\n <ng-template #defaultTypeToSearchTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n </ng-template>\n <ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\" />\n }\n @if (loading && itemsList.filteredItems.length === 0) {\n <ng-template #defaultLoadingTextTemplate>\n <div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n [ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\"\n />\n }\n </ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div class=\"ng-select-visually-hidden\" aria-atomic=\"true\" aria-live=\"polite\" role=\"status\">\n @if (isOpen && showNoItemsFound) {\n {{ notFoundText }}\n }\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-placeholder,.ng-select.ng-select-disabled .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder,.ng-select .ng-has-value .ng-placeholder{display:none}.ng-select .ng-select-container{box-sizing:border-box;position:relative;display:flex;width:100%;outline:none;overflow:hidden;cursor:default}.ng-select .ng-value-container{display:flex;flex:1}.ng-select .ng-input{box-sizing:border-box;opacity:0}.ng-select .ng-input>input{width:100%;padding:0;background:transparent;border:none;box-shadow:none;outline:none;cursor:default}.ng-select .ng-input>input::-ms-clear{display:none}.ng-select .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-value-container,.ng-select.ng-select-single .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-value-remove{display:none}.ng-select.ng-select-single .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-placeholder{position:absolute;z-index:1}.ng-select.ng-select-multiple .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-value-remove{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-remove{display:none}.ng-select.ng-select-multiple .ng-input{flex:1;z-index:2}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-arrow-wrapper{position:relative;text-align:center;-webkit-user-select:none;user-select:none;cursor:pointer}.ng-select .ng-arrow{position:relative;display:inline-block;height:0;width:0;pointer-events:none}.ng-dropdown-panel{box-sizing:border-box;position:absolute;z-index:1050;width:100%;opacity:0;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-optgroup,.ng-dropdown-panel .ng-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-option{display:block;cursor:pointer}.ng-dropdown-panel .ng-option.disabled{cursor:default}.ng-dropdown-panel .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-option-label:empty:before{content:\"\\200b\"}.ng-select-virtual-scroll-host{position:relative;display:block;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.ng-select-virtual-scroll-content{position:absolute;top:0;left:0;width:100%;height:100%}.ng-select-virtual-scroll-spacer{width:1px;opacity:0}.ng-select-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0;clip-path:rect(0 0 0 0);white-space:nowrap}.ng-select-spinner{position:relative;width:16px;height:16px;margin:0 4px;font-size:10px;text-indent:-9999em;border-radius:50%;border:2px solid rgba(66,66,66,.2);border-left-color:#424242;animation:load8 .8s infinite linear}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
3051
2998
  }], ctorParameters: () => [], propDecorators: { bindLabel: [{
3052
2999
  type: Input
3053
3000
  }], bindValue: [{
@@ -3058,7 +3005,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
3058
3005
  type: Input
3059
3006
  }], appendTo: [{
3060
3007
  type: Input
3061
- }], dropdownPosition: [{
3008
+ }], panelPosition: [{
3062
3009
  type: Input
3063
3010
  }], readonly: [{
3064
3011
  type: Input,
@@ -3072,10 +3019,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
3072
3019
  }], clearable: [{
3073
3020
  type: Input,
3074
3021
  args: [{ transform: booleanAttribute }]
3022
+ }], clearOnBackspace: [{
3023
+ type: Input,
3024
+ args: [{ transform: booleanAttribute }]
3075
3025
  }], clearAllText: [{
3076
3026
  type: Input
3077
- }], tabFocusOnClearButton: [{
3078
- type: Input
3079
3027
  }], loading: [{
3080
3028
  type: Input,
3081
3029
  args: [{ transform: booleanAttribute }]
@@ -3084,9 +3032,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
3084
3032
  }], closeOnSelect: [{
3085
3033
  type: Input,
3086
3034
  args: [{ transform: booleanAttribute }]
3087
- }], clearOnBackspace: [{
3088
- type: Input,
3089
- args: [{ transform: booleanAttribute }]
3090
3035
  }], hideSelected: [{
3091
3036
  type: Input,
3092
3037
  args: [{ transform: booleanAttribute }]
@@ -3151,22 +3096,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
3151
3096
  }], tabIndex: [{
3152
3097
  type: Input,
3153
3098
  args: [{ transform: numberAttribute }]
3154
- }], labelForId: [{
3155
- type: Input
3156
3099
  }], ariaLabel: [{
3157
3100
  type: Input
3158
3101
  }], ariaLabelledby: [{
3159
3102
  type: Input
3160
3103
  }], ariaDescribedby: [{
3161
3104
  type: Input
3162
- }], ariaLabelDropdown: [{
3163
- type: Input
3164
3105
  }], inputAttrs: [{
3165
3106
  type: Input
3166
3107
  }], isOpen: [{
3167
3108
  type: Input
3168
3109
  }], panelClass: [{
3169
3110
  type: Input
3111
+ }], inputId: [{
3112
+ type: Input
3170
3113
  }], items: [{
3171
3114
  type: Input
3172
3115
  }], compareWith: [{