@ng-matero/ng-select 0.1.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.
@@ -0,0 +1,3341 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, EventEmitter, inject, DOCUMENT, Renderer2, NgZone, ElementRef, booleanAttribute, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, Directive, TemplateRef, InjectionToken, ChangeDetectorRef, HostAttributeToken, forwardRef, numberAttribute, ContentChild, ContentChildren, NgModule } from '@angular/core';
4
+ import { animationFrameScheduler, asapScheduler, Subject, fromEvent, merge } from 'rxjs';
5
+ import { takeUntil, auditTime, startWith, tap, debounceTime, filter, map } from 'rxjs/operators';
6
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
+
8
+ class NgDropdownPanelUtils {
9
+ constructor() {
10
+ this._dimensions = {
11
+ itemHeight: 0,
12
+ panelHeight: 0,
13
+ itemsPerViewport: 0,
14
+ };
15
+ }
16
+ get dimensions() {
17
+ return this._dimensions;
18
+ }
19
+ calculateItems(scrollPos, itemsLength, buffer) {
20
+ const d = this._dimensions;
21
+ const scrollHeight = d.itemHeight * itemsLength;
22
+ const scrollTop = Math.max(0, scrollPos);
23
+ const indexByScrollTop = (scrollTop / scrollHeight) * itemsLength;
24
+ let end = Math.min(itemsLength, Math.ceil(indexByScrollTop) + (d.itemsPerViewport + 1));
25
+ const maxStartEnd = end;
26
+ const maxStart = Math.max(0, maxStartEnd - d.itemsPerViewport);
27
+ let start = Math.min(maxStart, Math.floor(indexByScrollTop));
28
+ let topPadding = d.itemHeight * Math.ceil(start) - d.itemHeight * Math.min(start, buffer);
29
+ topPadding = !isNaN(topPadding) ? topPadding : 0;
30
+ start = !isNaN(start) ? start : -1;
31
+ end = !isNaN(end) ? end : -1;
32
+ start -= buffer;
33
+ start = Math.max(0, start);
34
+ end += buffer;
35
+ end = Math.min(itemsLength, end);
36
+ return {
37
+ topPadding,
38
+ scrollHeight,
39
+ start,
40
+ end,
41
+ };
42
+ }
43
+ setDimensions(itemHeight, panelHeight) {
44
+ const itemsPerViewport = Math.max(1, Math.floor(panelHeight / itemHeight));
45
+ this._dimensions = {
46
+ itemHeight,
47
+ panelHeight,
48
+ itemsPerViewport,
49
+ };
50
+ }
51
+ getScrollTo(itemTop, itemHeight, lastScroll) {
52
+ const { panelHeight } = this.dimensions;
53
+ const itemBottom = itemTop + itemHeight;
54
+ const top = lastScroll;
55
+ const bottom = top + panelHeight;
56
+ if (panelHeight >= itemBottom && lastScroll === itemTop) {
57
+ return null;
58
+ }
59
+ if (itemBottom > bottom) {
60
+ return top + itemBottom - bottom;
61
+ }
62
+ else if (itemTop <= top) {
63
+ return itemTop;
64
+ }
65
+ return null;
66
+ }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgDropdownPanelUtils, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgDropdownPanelUtils, providedIn: 'root' }); }
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgDropdownPanelUtils, decorators: [{
71
+ type: Injectable,
72
+ args: [{ providedIn: 'root' }]
73
+ }] });
74
+
75
+ const unescapedHTMLExp = /[&<>"']/g;
76
+ const hasUnescapedHTMLExp = RegExp(unescapedHTMLExp.source);
77
+ const htmlEscapes = {
78
+ '&': '&amp;',
79
+ '<': '&lt;',
80
+ '>': '&gt;',
81
+ '"': '&quot;',
82
+ "'": '&#39;',
83
+ };
84
+ function escapeHTML(value) {
85
+ return value && hasUnescapedHTMLExp.test(value)
86
+ ? value.replace(unescapedHTMLExp, chr => htmlEscapes[chr])
87
+ : value;
88
+ }
89
+ function isDefined(value) {
90
+ return value != null;
91
+ }
92
+ function isObject(value) {
93
+ return typeof value === 'object' && isDefined(value);
94
+ }
95
+ function isPromise(value) {
96
+ return value instanceof Promise;
97
+ }
98
+ function isFunction(value) {
99
+ return value instanceof Function;
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
+ var KeyCode;
109
+ (function (KeyCode) {
110
+ KeyCode["Tab"] = "Tab";
111
+ KeyCode["Enter"] = "Enter";
112
+ KeyCode["Esc"] = "Escape";
113
+ KeyCode["Space"] = " ";
114
+ KeyCode["ArrowUp"] = "ArrowUp";
115
+ KeyCode["ArrowDown"] = "ArrowDown";
116
+ KeyCode["Backspace"] = "Backspace";
117
+ })(KeyCode || (KeyCode = {}));
118
+
119
+ const CSS_POSITIONS = ['top', 'right', 'bottom', 'left'];
120
+ const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
121
+ class NgDropdownPanel {
122
+ constructor() {
123
+ this.items = [];
124
+ this.position = 'auto';
125
+ this.bufferAmount = 4;
126
+ this.virtualScroll = false;
127
+ this.filterValue = null;
128
+ this.ariaLabelDropdown = null;
129
+ this.update = new EventEmitter();
130
+ this.scroll = new EventEmitter();
131
+ this.scrollToEnd = new EventEmitter();
132
+ this.outsideClick = new EventEmitter();
133
+ this._document = inject(DOCUMENT, { optional: true });
134
+ this._renderer = inject(Renderer2);
135
+ this._zone = inject(NgZone);
136
+ this._elementRef = inject(ElementRef);
137
+ this._panelUtils = inject(NgDropdownPanelUtils);
138
+ this._destroy$ = new Subject();
139
+ this._dropdown = this._elementRef.nativeElement;
140
+ this._scrollToEndFired = false;
141
+ this._updateScrollHeight = false;
142
+ this._lastScrollPosition = 0;
143
+ }
144
+ get currentPosition() {
145
+ return this._currentPosition;
146
+ }
147
+ get itemsLength() {
148
+ return this._itemsLength;
149
+ }
150
+ set itemsLength(value) {
151
+ if (value !== this._itemsLength) {
152
+ this._itemsLength = value;
153
+ this._onItemsLengthChanged();
154
+ }
155
+ }
156
+ get _startOffset() {
157
+ if (this.markedItem) {
158
+ const { itemHeight, panelHeight } = this._panelUtils.dimensions;
159
+ const offset = this.markedItem.index * itemHeight;
160
+ return panelHeight > offset ? 0 : offset;
161
+ }
162
+ return 0;
163
+ }
164
+ ngOnInit() {
165
+ this._select = this._dropdown.parentElement;
166
+ this._virtualPadding = this.paddingElementRef.nativeElement;
167
+ this._scrollablePanel = this.scrollElementRef.nativeElement;
168
+ this._contentPanel = this.contentElementRef.nativeElement;
169
+ this._handleScroll();
170
+ this._handleOutsideClick();
171
+ this._appendDropdown();
172
+ this._setupMousedownListener();
173
+ }
174
+ ngOnChanges(changes) {
175
+ if (changes['items']) {
176
+ const change = changes['items'];
177
+ this._onItemsChange(change.currentValue, change.firstChange);
178
+ }
179
+ }
180
+ ngOnDestroy() {
181
+ this._destroy$.next();
182
+ this._destroy$.complete();
183
+ this._destroy$.unsubscribe();
184
+ if (this.appendTo) {
185
+ this._renderer.removeChild(this._dropdown.parentNode, this._dropdown);
186
+ }
187
+ }
188
+ scrollTo(option, startFromOption = false) {
189
+ if (!option) {
190
+ return;
191
+ }
192
+ const index = this.items.indexOf(option);
193
+ if (index < 0 || index >= this.itemsLength) {
194
+ return;
195
+ }
196
+ let scrollTo;
197
+ if (this.virtualScroll) {
198
+ const itemHeight = this._panelUtils.dimensions.itemHeight;
199
+ scrollTo = this._panelUtils.getScrollTo(index * itemHeight, itemHeight, this._lastScrollPosition);
200
+ }
201
+ else {
202
+ const item = this._dropdown.querySelector(`#${option.htmlId}`);
203
+ const lastScroll = startFromOption ? item.offsetTop : this._lastScrollPosition;
204
+ scrollTo = this._panelUtils.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
205
+ }
206
+ if (isDefined(scrollTo)) {
207
+ this._scrollablePanel.scrollTop = scrollTo;
208
+ }
209
+ }
210
+ scrollToTag() {
211
+ const panel = this._scrollablePanel;
212
+ panel.scrollTop = panel.scrollHeight - panel.clientHeight;
213
+ }
214
+ adjustPosition() {
215
+ this._updateYPosition();
216
+ }
217
+ _handleDropdownPosition() {
218
+ this._currentPosition = this._calculateCurrentPosition(this._dropdown);
219
+ if (CSS_POSITIONS.includes(this._currentPosition)) {
220
+ this._updateDropdownClass(this._currentPosition);
221
+ }
222
+ else {
223
+ this._updateDropdownClass('bottom');
224
+ }
225
+ if (this.appendTo) {
226
+ this._updateYPosition();
227
+ }
228
+ this._dropdown.style.opacity = '1';
229
+ }
230
+ _updateDropdownClass(currentPosition) {
231
+ CSS_POSITIONS.forEach(position => {
232
+ const REMOVE_CSS_CLASS = `ng-select-${position}`;
233
+ this._renderer.removeClass(this._dropdown, REMOVE_CSS_CLASS);
234
+ this._renderer.removeClass(this._select, REMOVE_CSS_CLASS);
235
+ });
236
+ const ADD_CSS_CLASS = `ng-select-${currentPosition}`;
237
+ this._renderer.addClass(this._dropdown, ADD_CSS_CLASS);
238
+ this._renderer.addClass(this._select, ADD_CSS_CLASS);
239
+ }
240
+ _handleScroll() {
241
+ this._zone.runOutsideAngular(() => {
242
+ fromEvent(this.scrollElementRef.nativeElement, 'scroll')
243
+ .pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER))
244
+ .subscribe(e => {
245
+ const path = e.path || (e.composedPath && e.composedPath());
246
+ if (!path || (path.length === 0 && !e.target)) {
247
+ return;
248
+ }
249
+ const scrollTop = !path || path.length === 0 ? e.target.scrollTop : path[0].scrollTop;
250
+ this._onContentScrolled(scrollTop);
251
+ });
252
+ });
253
+ }
254
+ _handleOutsideClick() {
255
+ if (!this._document) {
256
+ return;
257
+ }
258
+ this._zone.runOutsideAngular(() => {
259
+ merge(fromEvent(this._document, 'touchstart', { capture: true }), fromEvent(this._document, 'click', { capture: true }))
260
+ .pipe(takeUntil(this._destroy$))
261
+ .subscribe($event => this._checkToClose($event));
262
+ });
263
+ }
264
+ _checkToClose($event) {
265
+ if (this._select.contains($event.target) || this._dropdown.contains($event.target)) {
266
+ return;
267
+ }
268
+ const path = $event.path || ($event.composedPath && $event.composedPath());
269
+ if ($event.target &&
270
+ $event.target.shadowRoot &&
271
+ path &&
272
+ path[0] &&
273
+ this._select.contains(path[0])) {
274
+ return;
275
+ }
276
+ this._zone.run(() => this.outsideClick.emit());
277
+ }
278
+ _onItemsChange(items, firstChange) {
279
+ this.items = items || [];
280
+ this._scrollToEndFired = false;
281
+ this.itemsLength = items.length;
282
+ if (this.virtualScroll) {
283
+ this._updateItemsRange(firstChange);
284
+ }
285
+ else {
286
+ this._setVirtualHeight();
287
+ this._updateItems(firstChange);
288
+ }
289
+ }
290
+ _updateItems(firstChange) {
291
+ this.update.emit(this.items);
292
+ if (firstChange === false) {
293
+ return;
294
+ }
295
+ this._zone.runOutsideAngular(() => {
296
+ Promise.resolve().then(() => {
297
+ const panelHeight = this._scrollablePanel.clientHeight;
298
+ this._panelUtils.setDimensions(0, panelHeight);
299
+ this._handleDropdownPosition();
300
+ this.scrollTo(this.markedItem, firstChange);
301
+ });
302
+ });
303
+ }
304
+ _updateItemsRange(firstChange) {
305
+ this._zone.runOutsideAngular(() => {
306
+ this._measureDimensions().then(() => {
307
+ if (firstChange) {
308
+ this._renderItemsRange(this._startOffset);
309
+ this._handleDropdownPosition();
310
+ }
311
+ else {
312
+ this._renderItemsRange();
313
+ }
314
+ });
315
+ });
316
+ }
317
+ _onContentScrolled(scrollTop) {
318
+ if (this.virtualScroll) {
319
+ this._renderItemsRange(scrollTop);
320
+ }
321
+ this._lastScrollPosition = scrollTop;
322
+ this._fireScrollToEnd(scrollTop);
323
+ }
324
+ _updateVirtualHeight(height) {
325
+ if (this._updateScrollHeight) {
326
+ this._virtualPadding.style.height = `${height}px`;
327
+ this._updateScrollHeight = false;
328
+ }
329
+ }
330
+ _setVirtualHeight() {
331
+ if (!this._virtualPadding) {
332
+ return;
333
+ }
334
+ this._virtualPadding.style.height = `0px`;
335
+ }
336
+ _onItemsLengthChanged() {
337
+ this._updateScrollHeight = true;
338
+ }
339
+ _renderItemsRange(scrollTop) {
340
+ if (scrollTop && this._lastScrollPosition === scrollTop) {
341
+ return;
342
+ }
343
+ scrollTop = scrollTop || this._scrollablePanel.scrollTop;
344
+ const range = this._panelUtils.calculateItems(scrollTop, this.itemsLength, this.bufferAmount);
345
+ this._updateVirtualHeight(range.scrollHeight);
346
+ this._contentPanel.style.transform = `translateY(${range.topPadding}px)`;
347
+ this._zone.run(() => {
348
+ this.update.emit(this.items.slice(range.start, range.end));
349
+ this.scroll.emit({ start: range.start, end: range.end });
350
+ });
351
+ if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
352
+ this._scrollablePanel.scrollTop = scrollTop;
353
+ this._lastScrollPosition = scrollTop;
354
+ }
355
+ }
356
+ _measureDimensions() {
357
+ if (this._panelUtils.dimensions.itemHeight > 0 || this.itemsLength === 0) {
358
+ return Promise.resolve(this._panelUtils.dimensions);
359
+ }
360
+ const [first] = this.items;
361
+ this.update.emit([first]);
362
+ return Promise.resolve().then(() => {
363
+ const option = this._dropdown.querySelector(`#${first.htmlId}`);
364
+ const optionHeight = option.clientHeight;
365
+ this._virtualPadding.style.height = `${optionHeight * this.itemsLength}px`;
366
+ const panelHeight = this._scrollablePanel.clientHeight;
367
+ this._panelUtils.setDimensions(optionHeight, panelHeight);
368
+ return this._panelUtils.dimensions;
369
+ });
370
+ }
371
+ _fireScrollToEnd(scrollTop) {
372
+ if (this._scrollToEndFired || scrollTop === 0) {
373
+ return;
374
+ }
375
+ const padding = this.virtualScroll ? this._virtualPadding : this._contentPanel;
376
+ if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
377
+ this._zone.run(() => this.scrollToEnd.emit());
378
+ this._scrollToEndFired = true;
379
+ }
380
+ }
381
+ _calculateCurrentPosition(dropdownEl) {
382
+ if (this.position !== 'auto') {
383
+ return this.position;
384
+ }
385
+ const selectRect = this._select.getBoundingClientRect();
386
+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
387
+ const offsetTop = selectRect.top + window.pageYOffset;
388
+ const height = selectRect.height;
389
+ const dropdownHeight = dropdownEl.getBoundingClientRect().height;
390
+ if (offsetTop + height + dropdownHeight > scrollTop + document.documentElement.clientHeight) {
391
+ return 'top';
392
+ }
393
+ else {
394
+ return 'bottom';
395
+ }
396
+ }
397
+ _appendDropdown() {
398
+ if (!this.appendTo) {
399
+ return;
400
+ }
401
+ this._parent = this._dropdown.shadowRoot
402
+ ? this._dropdown.shadowRoot.querySelector(this.appendTo)
403
+ : document.querySelector(this.appendTo);
404
+ if (!this._parent) {
405
+ throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);
406
+ }
407
+ this._updateXPosition();
408
+ this._parent.appendChild(this._dropdown);
409
+ }
410
+ _updateXPosition() {
411
+ const select = this._select.getBoundingClientRect();
412
+ const parent = this._parent.getBoundingClientRect();
413
+ const offsetLeft = select.left - parent.left;
414
+ this._dropdown.style.left = offsetLeft + 'px';
415
+ this._dropdown.style.width = select.width + 'px';
416
+ this._dropdown.style.minWidth = select.width + 'px';
417
+ }
418
+ _updateYPosition() {
419
+ const select = this._select.getBoundingClientRect();
420
+ const parent = this._parent.getBoundingClientRect();
421
+ const delta = select.height;
422
+ if (this._currentPosition === 'top') {
423
+ const offsetBottom = parent.bottom - select.bottom;
424
+ this._dropdown.style.bottom = offsetBottom + delta + 'px';
425
+ this._dropdown.style.top = 'auto';
426
+ }
427
+ else if (this._currentPosition === 'bottom') {
428
+ const offsetTop = select.top - parent.top;
429
+ this._dropdown.style.top = offsetTop + delta + 'px';
430
+ this._dropdown.style.bottom = 'auto';
431
+ }
432
+ }
433
+ _setupMousedownListener() {
434
+ this._zone.runOutsideAngular(() => {
435
+ fromEvent(this._dropdown, 'mousedown')
436
+ .pipe(takeUntil(this._destroy$))
437
+ .subscribe(event => {
438
+ const target = event.target;
439
+ if (target.tagName === 'INPUT') {
440
+ return;
441
+ }
442
+ event.preventDefault();
443
+ });
444
+ });
445
+ }
446
+ 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: `
448
+ @if (headerTemplate) {
449
+ <div class="ng-dropdown-header">
450
+ <ng-container
451
+ [ngTemplateOutlet]="headerTemplate"
452
+ [ngTemplateOutletContext]="{ searchTerm: filterValue }"
453
+ />
454
+ </div>
455
+ }
456
+ <div
457
+ #scroll
458
+ class="ng-dropdown-panel-items ng-select-virtual-scroll-host"
459
+ [attr.aria-label]="ariaLabelDropdown"
460
+ role="listbox"
461
+ >
462
+ <div #padding [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
463
+ <div #content [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
464
+ <ng-content />
465
+ </div>
466
+ </div>
467
+ @if (footerTemplate) {
468
+ <div class="ng-dropdown-footer">
469
+ <ng-container
470
+ [ngTemplateOutlet]="footerTemplate"
471
+ [ngTemplateOutletContext]="{ searchTerm: filterValue }"
472
+ />
473
+ </div>
474
+ }
475
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
476
+ }
477
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgDropdownPanel, decorators: [{
478
+ type: Component,
479
+ args: [{
480
+ selector: 'ng-dropdown-panel',
481
+ template: `
482
+ @if (headerTemplate) {
483
+ <div class="ng-dropdown-header">
484
+ <ng-container
485
+ [ngTemplateOutlet]="headerTemplate"
486
+ [ngTemplateOutletContext]="{ searchTerm: filterValue }"
487
+ />
488
+ </div>
489
+ }
490
+ <div
491
+ #scroll
492
+ class="ng-dropdown-panel-items ng-select-virtual-scroll-host"
493
+ [attr.aria-label]="ariaLabelDropdown"
494
+ role="listbox"
495
+ >
496
+ <div #padding [class.ng-select-virtual-scroll-spacer]="virtualScroll"></div>
497
+ <div #content [class.ng-select-virtual-scroll-content]="virtualScroll && items.length">
498
+ <ng-content />
499
+ </div>
500
+ </div>
501
+ @if (footerTemplate) {
502
+ <div class="ng-dropdown-footer">
503
+ <ng-container
504
+ [ngTemplateOutlet]="footerTemplate"
505
+ [ngTemplateOutletContext]="{ searchTerm: filterValue }"
506
+ />
507
+ </div>
508
+ }
509
+ `,
510
+ imports: [NgTemplateOutlet],
511
+ encapsulation: ViewEncapsulation.None,
512
+ changeDetection: ChangeDetectionStrategy.OnPush,
513
+ }]
514
+ }], propDecorators: { items: [{
515
+ type: Input
516
+ }], markedItem: [{
517
+ type: Input
518
+ }], position: [{
519
+ type: Input
520
+ }], appendTo: [{
521
+ type: Input
522
+ }], bufferAmount: [{
523
+ type: Input
524
+ }], virtualScroll: [{
525
+ type: Input,
526
+ args: [{ transform: booleanAttribute }]
527
+ }], headerTemplate: [{
528
+ type: Input
529
+ }], footerTemplate: [{
530
+ type: Input
531
+ }], filterValue: [{
532
+ type: Input
533
+ }], ariaLabelDropdown: [{
534
+ type: Input
535
+ }], update: [{
536
+ type: Output
537
+ }], scroll: [{
538
+ type: Output
539
+ }], scrollToEnd: [{
540
+ type: Output
541
+ }], outsideClick: [{
542
+ type: Output
543
+ }], contentElementRef: [{
544
+ type: ViewChild,
545
+ args: ['content', { read: ElementRef, static: true }]
546
+ }], scrollElementRef: [{
547
+ type: ViewChild,
548
+ args: ['scroll', { read: ElementRef, static: true }]
549
+ }], paddingElementRef: [{
550
+ type: ViewChild,
551
+ args: ['padding', { read: ElementRef, static: true }]
552
+ }] } });
553
+
554
+ class NgOption {
555
+ constructor() {
556
+ this.disabled = false;
557
+ this.elementRef = inject(ElementRef);
558
+ this.stateChange$ = new Subject();
559
+ this._previousLabel = '';
560
+ }
561
+ get label() {
562
+ return (this.elementRef.nativeElement.textContent || '').trim();
563
+ }
564
+ ngOnChanges(changes) {
565
+ if (changes['disabled']) {
566
+ this.stateChange$.next({
567
+ value: this.value,
568
+ disabled: this.disabled,
569
+ });
570
+ }
571
+ }
572
+ ngAfterViewChecked() {
573
+ if (this.label !== this._previousLabel) {
574
+ this._previousLabel = this.label;
575
+ this.stateChange$.next({
576
+ value: this.value,
577
+ disabled: this.disabled,
578
+ label: this.elementRef.nativeElement.innerHTML,
579
+ });
580
+ }
581
+ }
582
+ ngOnDestroy() {
583
+ this.stateChange$.complete();
584
+ }
585
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
586
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.3.12", type: NgOption, isStandalone: true, selector: "ng-option", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, usesOnChanges: true, ngImport: i0, template: `
587
+ <ng-content />
588
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
589
+ }
590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOption, decorators: [{
591
+ type: Component,
592
+ args: [{
593
+ selector: 'ng-option',
594
+ template: `
595
+ <ng-content />
596
+ `,
597
+ changeDetection: ChangeDetectionStrategy.OnPush,
598
+ }]
599
+ }], propDecorators: { value: [{
600
+ type: Input
601
+ }], disabled: [{
602
+ type: Input,
603
+ args: [{ transform: booleanAttribute }]
604
+ }] } });
605
+
606
+ class NgOptionHighlight {
607
+ constructor() {
608
+ this.term = '';
609
+ this.elementRef = inject(ElementRef);
610
+ this.renderer = inject(Renderer2);
611
+ this.element = this.elementRef.nativeElement;
612
+ this.label = '';
613
+ }
614
+ get _canHighlight() {
615
+ return this.term && this.label;
616
+ }
617
+ ngOnChanges() {
618
+ if (this._canHighlight) {
619
+ this._highlightLabel();
620
+ }
621
+ }
622
+ ngAfterViewInit() {
623
+ this.label = this.element.innerHTML;
624
+ if (this._canHighlight) {
625
+ this._highlightLabel();
626
+ }
627
+ }
628
+ _escapeRegExp(str) {
629
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
630
+ }
631
+ _highlightLabel() {
632
+ const label = this.label;
633
+ if (!this.term) {
634
+ this._setInnerHtml(label);
635
+ return;
636
+ }
637
+ const alternationString = this._escapeRegExp(this.term).replace(' ', '|');
638
+ const termRegex = new RegExp(alternationString, 'gi');
639
+ this._setInnerHtml(label.replace(termRegex, `<span class="highlighted">$&</span>`));
640
+ }
641
+ _setInnerHtml(html) {
642
+ this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', html);
643
+ }
644
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptionHighlight, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
645
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgOptionHighlight, isStandalone: true, selector: "[ngOptionHighlight]", inputs: { term: ["ngOptionHighlight", "term"] }, usesOnChanges: true, ngImport: i0 }); }
646
+ }
647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptionHighlight, decorators: [{
648
+ type: Directive,
649
+ args: [{
650
+ selector: '[ngOptionHighlight]',
651
+ }]
652
+ }], propDecorators: { term: [{
653
+ type: Input,
654
+ args: ['ngOptionHighlight']
655
+ }] } });
656
+
657
+ const diacritics = {
658
+ '\u24B6': 'A',
659
+ '\uFF21': 'A',
660
+ '\u00C0': 'A',
661
+ '\u00C1': 'A',
662
+ '\u00C2': 'A',
663
+ '\u1EA6': 'A',
664
+ '\u1EA4': 'A',
665
+ '\u1EAA': 'A',
666
+ '\u1EA8': 'A',
667
+ '\u00C3': 'A',
668
+ '\u0100': 'A',
669
+ '\u0102': 'A',
670
+ '\u1EB0': 'A',
671
+ '\u1EAE': 'A',
672
+ '\u1EB4': 'A',
673
+ '\u1EB2': 'A',
674
+ '\u0226': 'A',
675
+ '\u01E0': 'A',
676
+ '\u00C4': 'A',
677
+ '\u01DE': 'A',
678
+ '\u1EA2': 'A',
679
+ '\u00C5': 'A',
680
+ '\u01FA': 'A',
681
+ '\u01CD': 'A',
682
+ '\u0200': 'A',
683
+ '\u0202': 'A',
684
+ '\u1EA0': 'A',
685
+ '\u1EAC': 'A',
686
+ '\u1EB6': 'A',
687
+ '\u1E00': 'A',
688
+ '\u0104': 'A',
689
+ '\u023A': 'A',
690
+ '\u2C6F': 'A',
691
+ '\uA732': 'AA',
692
+ '\u00C6': 'AE',
693
+ '\u01FC': 'AE',
694
+ '\u01E2': 'AE',
695
+ '\uA734': 'AO',
696
+ '\uA736': 'AU',
697
+ '\uA738': 'AV',
698
+ '\uA73A': 'AV',
699
+ '\uA73C': 'AY',
700
+ '\u24B7': 'B',
701
+ '\uFF22': 'B',
702
+ '\u1E02': 'B',
703
+ '\u1E04': 'B',
704
+ '\u1E06': 'B',
705
+ '\u0243': 'B',
706
+ '\u0182': 'B',
707
+ '\u0181': 'B',
708
+ '\u24B8': 'C',
709
+ '\uFF23': 'C',
710
+ '\u0106': 'C',
711
+ '\u0108': 'C',
712
+ '\u010A': 'C',
713
+ '\u010C': 'C',
714
+ '\u00C7': 'C',
715
+ '\u1E08': 'C',
716
+ '\u0187': 'C',
717
+ '\u023B': 'C',
718
+ '\uA73E': 'C',
719
+ '\u24B9': 'D',
720
+ '\uFF24': 'D',
721
+ '\u1E0A': 'D',
722
+ '\u010E': 'D',
723
+ '\u1E0C': 'D',
724
+ '\u1E10': 'D',
725
+ '\u1E12': 'D',
726
+ '\u1E0E': 'D',
727
+ '\u0110': 'D',
728
+ '\u018B': 'D',
729
+ '\u018A': 'D',
730
+ '\u0189': 'D',
731
+ '\uA779': 'D',
732
+ '\u01F1': 'DZ',
733
+ '\u01C4': 'DZ',
734
+ '\u01F2': 'Dz',
735
+ '\u01C5': 'Dz',
736
+ '\u24BA': 'E',
737
+ '\uFF25': 'E',
738
+ '\u00C8': 'E',
739
+ '\u00C9': 'E',
740
+ '\u00CA': 'E',
741
+ '\u1EC0': 'E',
742
+ '\u1EBE': 'E',
743
+ '\u1EC4': 'E',
744
+ '\u1EC2': 'E',
745
+ '\u1EBC': 'E',
746
+ '\u0112': 'E',
747
+ '\u1E14': 'E',
748
+ '\u1E16': 'E',
749
+ '\u0114': 'E',
750
+ '\u0116': 'E',
751
+ '\u00CB': 'E',
752
+ '\u1EBA': 'E',
753
+ '\u011A': 'E',
754
+ '\u0204': 'E',
755
+ '\u0206': 'E',
756
+ '\u1EB8': 'E',
757
+ '\u1EC6': 'E',
758
+ '\u0228': 'E',
759
+ '\u1E1C': 'E',
760
+ '\u0118': 'E',
761
+ '\u1E18': 'E',
762
+ '\u1E1A': 'E',
763
+ '\u0190': 'E',
764
+ '\u018E': 'E',
765
+ '\u24BB': 'F',
766
+ '\uFF26': 'F',
767
+ '\u1E1E': 'F',
768
+ '\u0191': 'F',
769
+ '\uA77B': 'F',
770
+ '\u24BC': 'G',
771
+ '\uFF27': 'G',
772
+ '\u01F4': 'G',
773
+ '\u011C': 'G',
774
+ '\u1E20': 'G',
775
+ '\u011E': 'G',
776
+ '\u0120': 'G',
777
+ '\u01E6': 'G',
778
+ '\u0122': 'G',
779
+ '\u01E4': 'G',
780
+ '\u0193': 'G',
781
+ '\uA7A0': 'G',
782
+ '\uA77D': 'G',
783
+ '\uA77E': 'G',
784
+ '\u24BD': 'H',
785
+ '\uFF28': 'H',
786
+ '\u0124': 'H',
787
+ '\u1E22': 'H',
788
+ '\u1E26': 'H',
789
+ '\u021E': 'H',
790
+ '\u1E24': 'H',
791
+ '\u1E28': 'H',
792
+ '\u1E2A': 'H',
793
+ '\u0126': 'H',
794
+ '\u2C67': 'H',
795
+ '\u2C75': 'H',
796
+ '\uA78D': 'H',
797
+ '\u24BE': 'I',
798
+ '\uFF29': 'I',
799
+ '\u00CC': 'I',
800
+ '\u00CD': 'I',
801
+ '\u00CE': 'I',
802
+ '\u0128': 'I',
803
+ '\u012A': 'I',
804
+ '\u012C': 'I',
805
+ '\u0130': 'I',
806
+ '\u00CF': 'I',
807
+ '\u1E2E': 'I',
808
+ '\u1EC8': 'I',
809
+ '\u01CF': 'I',
810
+ '\u0208': 'I',
811
+ '\u020A': 'I',
812
+ '\u1ECA': 'I',
813
+ '\u012E': 'I',
814
+ '\u1E2C': 'I',
815
+ '\u0197': 'I',
816
+ '\u24BF': 'J',
817
+ '\uFF2A': 'J',
818
+ '\u0134': 'J',
819
+ '\u0248': 'J',
820
+ '\u24C0': 'K',
821
+ '\uFF2B': 'K',
822
+ '\u1E30': 'K',
823
+ '\u01E8': 'K',
824
+ '\u1E32': 'K',
825
+ '\u0136': 'K',
826
+ '\u1E34': 'K',
827
+ '\u0198': 'K',
828
+ '\u2C69': 'K',
829
+ '\uA740': 'K',
830
+ '\uA742': 'K',
831
+ '\uA744': 'K',
832
+ '\uA7A2': 'K',
833
+ '\u24C1': 'L',
834
+ '\uFF2C': 'L',
835
+ '\u013F': 'L',
836
+ '\u0139': 'L',
837
+ '\u013D': 'L',
838
+ '\u1E36': 'L',
839
+ '\u1E38': 'L',
840
+ '\u013B': 'L',
841
+ '\u1E3C': 'L',
842
+ '\u1E3A': 'L',
843
+ '\u0141': 'L',
844
+ '\u023D': 'L',
845
+ '\u2C62': 'L',
846
+ '\u2C60': 'L',
847
+ '\uA748': 'L',
848
+ '\uA746': 'L',
849
+ '\uA780': 'L',
850
+ '\u01C7': 'LJ',
851
+ '\u01C8': 'Lj',
852
+ '\u24C2': 'M',
853
+ '\uFF2D': 'M',
854
+ '\u1E3E': 'M',
855
+ '\u1E40': 'M',
856
+ '\u1E42': 'M',
857
+ '\u2C6E': 'M',
858
+ '\u019C': 'M',
859
+ '\u24C3': 'N',
860
+ '\uFF2E': 'N',
861
+ '\u01F8': 'N',
862
+ '\u0143': 'N',
863
+ '\u00D1': 'N',
864
+ '\u1E44': 'N',
865
+ '\u0147': 'N',
866
+ '\u1E46': 'N',
867
+ '\u0145': 'N',
868
+ '\u1E4A': 'N',
869
+ '\u1E48': 'N',
870
+ '\u0220': 'N',
871
+ '\u019D': 'N',
872
+ '\uA790': 'N',
873
+ '\uA7A4': 'N',
874
+ '\u01CA': 'NJ',
875
+ '\u01CB': 'Nj',
876
+ '\u24C4': 'O',
877
+ '\uFF2F': 'O',
878
+ '\u00D2': 'O',
879
+ '\u00D3': 'O',
880
+ '\u00D4': 'O',
881
+ '\u1ED2': 'O',
882
+ '\u1ED0': 'O',
883
+ '\u1ED6': 'O',
884
+ '\u1ED4': 'O',
885
+ '\u00D5': 'O',
886
+ '\u1E4C': 'O',
887
+ '\u022C': 'O',
888
+ '\u1E4E': 'O',
889
+ '\u014C': 'O',
890
+ '\u1E50': 'O',
891
+ '\u1E52': 'O',
892
+ '\u014E': 'O',
893
+ '\u022E': 'O',
894
+ '\u0230': 'O',
895
+ '\u00D6': 'O',
896
+ '\u022A': 'O',
897
+ '\u1ECE': 'O',
898
+ '\u0150': 'O',
899
+ '\u01D1': 'O',
900
+ '\u020C': 'O',
901
+ '\u020E': 'O',
902
+ '\u01A0': 'O',
903
+ '\u1EDC': 'O',
904
+ '\u1EDA': 'O',
905
+ '\u1EE0': 'O',
906
+ '\u1EDE': 'O',
907
+ '\u1EE2': 'O',
908
+ '\u1ECC': 'O',
909
+ '\u1ED8': 'O',
910
+ '\u01EA': 'O',
911
+ '\u01EC': 'O',
912
+ '\u00D8': 'O',
913
+ '\u01FE': 'O',
914
+ '\u0186': 'O',
915
+ '\u019F': 'O',
916
+ '\uA74A': 'O',
917
+ '\uA74C': 'O',
918
+ '\u01A2': 'OI',
919
+ '\uA74E': 'OO',
920
+ '\u0222': 'OU',
921
+ '\u24C5': 'P',
922
+ '\uFF30': 'P',
923
+ '\u1E54': 'P',
924
+ '\u1E56': 'P',
925
+ '\u01A4': 'P',
926
+ '\u2C63': 'P',
927
+ '\uA750': 'P',
928
+ '\uA752': 'P',
929
+ '\uA754': 'P',
930
+ '\u24C6': 'Q',
931
+ '\uFF31': 'Q',
932
+ '\uA756': 'Q',
933
+ '\uA758': 'Q',
934
+ '\u024A': 'Q',
935
+ '\u24C7': 'R',
936
+ '\uFF32': 'R',
937
+ '\u0154': 'R',
938
+ '\u1E58': 'R',
939
+ '\u0158': 'R',
940
+ '\u0210': 'R',
941
+ '\u0212': 'R',
942
+ '\u1E5A': 'R',
943
+ '\u1E5C': 'R',
944
+ '\u0156': 'R',
945
+ '\u1E5E': 'R',
946
+ '\u024C': 'R',
947
+ '\u2C64': 'R',
948
+ '\uA75A': 'R',
949
+ '\uA7A6': 'R',
950
+ '\uA782': 'R',
951
+ '\u24C8': 'S',
952
+ '\uFF33': 'S',
953
+ '\u1E9E': 'S',
954
+ '\u015A': 'S',
955
+ '\u1E64': 'S',
956
+ '\u015C': 'S',
957
+ '\u1E60': 'S',
958
+ '\u0160': 'S',
959
+ '\u1E66': 'S',
960
+ '\u1E62': 'S',
961
+ '\u1E68': 'S',
962
+ '\u0218': 'S',
963
+ '\u015E': 'S',
964
+ '\u2C7E': 'S',
965
+ '\uA7A8': 'S',
966
+ '\uA784': 'S',
967
+ '\u24C9': 'T',
968
+ '\uFF34': 'T',
969
+ '\u1E6A': 'T',
970
+ '\u0164': 'T',
971
+ '\u1E6C': 'T',
972
+ '\u021A': 'T',
973
+ '\u0162': 'T',
974
+ '\u1E70': 'T',
975
+ '\u1E6E': 'T',
976
+ '\u0166': 'T',
977
+ '\u01AC': 'T',
978
+ '\u01AE': 'T',
979
+ '\u023E': 'T',
980
+ '\uA786': 'T',
981
+ '\uA728': 'TZ',
982
+ '\u24CA': 'U',
983
+ '\uFF35': 'U',
984
+ '\u00D9': 'U',
985
+ '\u00DA': 'U',
986
+ '\u00DB': 'U',
987
+ '\u0168': 'U',
988
+ '\u1E78': 'U',
989
+ '\u016A': 'U',
990
+ '\u1E7A': 'U',
991
+ '\u016C': 'U',
992
+ '\u00DC': 'U',
993
+ '\u01DB': 'U',
994
+ '\u01D7': 'U',
995
+ '\u01D5': 'U',
996
+ '\u01D9': 'U',
997
+ '\u1EE6': 'U',
998
+ '\u016E': 'U',
999
+ '\u0170': 'U',
1000
+ '\u01D3': 'U',
1001
+ '\u0214': 'U',
1002
+ '\u0216': 'U',
1003
+ '\u01AF': 'U',
1004
+ '\u1EEA': 'U',
1005
+ '\u1EE8': 'U',
1006
+ '\u1EEE': 'U',
1007
+ '\u1EEC': 'U',
1008
+ '\u1EF0': 'U',
1009
+ '\u1EE4': 'U',
1010
+ '\u1E72': 'U',
1011
+ '\u0172': 'U',
1012
+ '\u1E76': 'U',
1013
+ '\u1E74': 'U',
1014
+ '\u0244': 'U',
1015
+ '\u24CB': 'V',
1016
+ '\uFF36': 'V',
1017
+ '\u1E7C': 'V',
1018
+ '\u1E7E': 'V',
1019
+ '\u01B2': 'V',
1020
+ '\uA75E': 'V',
1021
+ '\u0245': 'V',
1022
+ '\uA760': 'VY',
1023
+ '\u24CC': 'W',
1024
+ '\uFF37': 'W',
1025
+ '\u1E80': 'W',
1026
+ '\u1E82': 'W',
1027
+ '\u0174': 'W',
1028
+ '\u1E86': 'W',
1029
+ '\u1E84': 'W',
1030
+ '\u1E88': 'W',
1031
+ '\u2C72': 'W',
1032
+ '\u24CD': 'X',
1033
+ '\uFF38': 'X',
1034
+ '\u1E8A': 'X',
1035
+ '\u1E8C': 'X',
1036
+ '\u24CE': 'Y',
1037
+ '\uFF39': 'Y',
1038
+ '\u1EF2': 'Y',
1039
+ '\u00DD': 'Y',
1040
+ '\u0176': 'Y',
1041
+ '\u1EF8': 'Y',
1042
+ '\u0232': 'Y',
1043
+ '\u1E8E': 'Y',
1044
+ '\u0178': 'Y',
1045
+ '\u1EF6': 'Y',
1046
+ '\u1EF4': 'Y',
1047
+ '\u01B3': 'Y',
1048
+ '\u024E': 'Y',
1049
+ '\u1EFE': 'Y',
1050
+ '\u24CF': 'Z',
1051
+ '\uFF3A': 'Z',
1052
+ '\u0179': 'Z',
1053
+ '\u1E90': 'Z',
1054
+ '\u017B': 'Z',
1055
+ '\u017D': 'Z',
1056
+ '\u1E92': 'Z',
1057
+ '\u1E94': 'Z',
1058
+ '\u01B5': 'Z',
1059
+ '\u0224': 'Z',
1060
+ '\u2C7F': 'Z',
1061
+ '\u2C6B': 'Z',
1062
+ '\uA762': 'Z',
1063
+ '\u24D0': 'a',
1064
+ '\uFF41': 'a',
1065
+ '\u1E9A': 'a',
1066
+ '\u00E0': 'a',
1067
+ '\u00E1': 'a',
1068
+ '\u00E2': 'a',
1069
+ '\u1EA7': 'a',
1070
+ '\u1EA5': 'a',
1071
+ '\u1EAB': 'a',
1072
+ '\u1EA9': 'a',
1073
+ '\u00E3': 'a',
1074
+ '\u0101': 'a',
1075
+ '\u0103': 'a',
1076
+ '\u1EB1': 'a',
1077
+ '\u1EAF': 'a',
1078
+ '\u1EB5': 'a',
1079
+ '\u1EB3': 'a',
1080
+ '\u0227': 'a',
1081
+ '\u01E1': 'a',
1082
+ '\u00E4': 'a',
1083
+ '\u01DF': 'a',
1084
+ '\u1EA3': 'a',
1085
+ '\u00E5': 'a',
1086
+ '\u01FB': 'a',
1087
+ '\u01CE': 'a',
1088
+ '\u0201': 'a',
1089
+ '\u0203': 'a',
1090
+ '\u1EA1': 'a',
1091
+ '\u1EAD': 'a',
1092
+ '\u1EB7': 'a',
1093
+ '\u1E01': 'a',
1094
+ '\u0105': 'a',
1095
+ '\u2C65': 'a',
1096
+ '\u0250': 'a',
1097
+ '\uA733': 'aa',
1098
+ '\u00E6': 'ae',
1099
+ '\u01FD': 'ae',
1100
+ '\u01E3': 'ae',
1101
+ '\uA735': 'ao',
1102
+ '\uA737': 'au',
1103
+ '\uA739': 'av',
1104
+ '\uA73B': 'av',
1105
+ '\uA73D': 'ay',
1106
+ '\u24D1': 'b',
1107
+ '\uFF42': 'b',
1108
+ '\u1E03': 'b',
1109
+ '\u1E05': 'b',
1110
+ '\u1E07': 'b',
1111
+ '\u0180': 'b',
1112
+ '\u0183': 'b',
1113
+ '\u0253': 'b',
1114
+ '\u24D2': 'c',
1115
+ '\uFF43': 'c',
1116
+ '\u0107': 'c',
1117
+ '\u0109': 'c',
1118
+ '\u010B': 'c',
1119
+ '\u010D': 'c',
1120
+ '\u00E7': 'c',
1121
+ '\u1E09': 'c',
1122
+ '\u0188': 'c',
1123
+ '\u023C': 'c',
1124
+ '\uA73F': 'c',
1125
+ '\u2184': 'c',
1126
+ '\u24D3': 'd',
1127
+ '\uFF44': 'd',
1128
+ '\u1E0B': 'd',
1129
+ '\u010F': 'd',
1130
+ '\u1E0D': 'd',
1131
+ '\u1E11': 'd',
1132
+ '\u1E13': 'd',
1133
+ '\u1E0F': 'd',
1134
+ '\u0111': 'd',
1135
+ '\u018C': 'd',
1136
+ '\u0256': 'd',
1137
+ '\u0257': 'd',
1138
+ '\uA77A': 'd',
1139
+ '\u01F3': 'dz',
1140
+ '\u01C6': 'dz',
1141
+ '\u24D4': 'e',
1142
+ '\uFF45': 'e',
1143
+ '\u00E8': 'e',
1144
+ '\u00E9': 'e',
1145
+ '\u00EA': 'e',
1146
+ '\u1EC1': 'e',
1147
+ '\u1EBF': 'e',
1148
+ '\u1EC5': 'e',
1149
+ '\u1EC3': 'e',
1150
+ '\u1EBD': 'e',
1151
+ '\u0113': 'e',
1152
+ '\u1E15': 'e',
1153
+ '\u1E17': 'e',
1154
+ '\u0115': 'e',
1155
+ '\u0117': 'e',
1156
+ '\u00EB': 'e',
1157
+ '\u1EBB': 'e',
1158
+ '\u011B': 'e',
1159
+ '\u0205': 'e',
1160
+ '\u0207': 'e',
1161
+ '\u1EB9': 'e',
1162
+ '\u1EC7': 'e',
1163
+ '\u0229': 'e',
1164
+ '\u1E1D': 'e',
1165
+ '\u0119': 'e',
1166
+ '\u1E19': 'e',
1167
+ '\u1E1B': 'e',
1168
+ '\u0247': 'e',
1169
+ '\u025B': 'e',
1170
+ '\u01DD': 'e',
1171
+ '\u24D5': 'f',
1172
+ '\uFF46': 'f',
1173
+ '\u1E1F': 'f',
1174
+ '\u0192': 'f',
1175
+ '\uA77C': 'f',
1176
+ '\u24D6': 'g',
1177
+ '\uFF47': 'g',
1178
+ '\u01F5': 'g',
1179
+ '\u011D': 'g',
1180
+ '\u1E21': 'g',
1181
+ '\u011F': 'g',
1182
+ '\u0121': 'g',
1183
+ '\u01E7': 'g',
1184
+ '\u0123': 'g',
1185
+ '\u01E5': 'g',
1186
+ '\u0260': 'g',
1187
+ '\uA7A1': 'g',
1188
+ '\u1D79': 'g',
1189
+ '\uA77F': 'g',
1190
+ '\u24D7': 'h',
1191
+ '\uFF48': 'h',
1192
+ '\u0125': 'h',
1193
+ '\u1E23': 'h',
1194
+ '\u1E27': 'h',
1195
+ '\u021F': 'h',
1196
+ '\u1E25': 'h',
1197
+ '\u1E29': 'h',
1198
+ '\u1E2B': 'h',
1199
+ '\u1E96': 'h',
1200
+ '\u0127': 'h',
1201
+ '\u2C68': 'h',
1202
+ '\u2C76': 'h',
1203
+ '\u0265': 'h',
1204
+ '\u0195': 'hv',
1205
+ '\u24D8': 'i',
1206
+ '\uFF49': 'i',
1207
+ '\u00EC': 'i',
1208
+ '\u00ED': 'i',
1209
+ '\u00EE': 'i',
1210
+ '\u0129': 'i',
1211
+ '\u012B': 'i',
1212
+ '\u012D': 'i',
1213
+ '\u00EF': 'i',
1214
+ '\u1E2F': 'i',
1215
+ '\u1EC9': 'i',
1216
+ '\u01D0': 'i',
1217
+ '\u0209': 'i',
1218
+ '\u020B': 'i',
1219
+ '\u1ECB': 'i',
1220
+ '\u012F': 'i',
1221
+ '\u1E2D': 'i',
1222
+ '\u0268': 'i',
1223
+ '\u0131': 'i',
1224
+ '\u24D9': 'j',
1225
+ '\uFF4A': 'j',
1226
+ '\u0135': 'j',
1227
+ '\u01F0': 'j',
1228
+ '\u0249': 'j',
1229
+ '\u24DA': 'k',
1230
+ '\uFF4B': 'k',
1231
+ '\u1E31': 'k',
1232
+ '\u01E9': 'k',
1233
+ '\u1E33': 'k',
1234
+ '\u0137': 'k',
1235
+ '\u1E35': 'k',
1236
+ '\u0199': 'k',
1237
+ '\u2C6A': 'k',
1238
+ '\uA741': 'k',
1239
+ '\uA743': 'k',
1240
+ '\uA745': 'k',
1241
+ '\uA7A3': 'k',
1242
+ '\u24DB': 'l',
1243
+ '\uFF4C': 'l',
1244
+ '\u0140': 'l',
1245
+ '\u013A': 'l',
1246
+ '\u013E': 'l',
1247
+ '\u1E37': 'l',
1248
+ '\u1E39': 'l',
1249
+ '\u013C': 'l',
1250
+ '\u1E3D': 'l',
1251
+ '\u1E3B': 'l',
1252
+ '\u017F': 'l',
1253
+ '\u0142': 'l',
1254
+ '\u019A': 'l',
1255
+ '\u026B': 'l',
1256
+ '\u2C61': 'l',
1257
+ '\uA749': 'l',
1258
+ '\uA781': 'l',
1259
+ '\uA747': 'l',
1260
+ '\u01C9': 'lj',
1261
+ '\u24DC': 'm',
1262
+ '\uFF4D': 'm',
1263
+ '\u1E3F': 'm',
1264
+ '\u1E41': 'm',
1265
+ '\u1E43': 'm',
1266
+ '\u0271': 'm',
1267
+ '\u026F': 'm',
1268
+ '\u24DD': 'n',
1269
+ '\uFF4E': 'n',
1270
+ '\u01F9': 'n',
1271
+ '\u0144': 'n',
1272
+ '\u00F1': 'n',
1273
+ '\u1E45': 'n',
1274
+ '\u0148': 'n',
1275
+ '\u1E47': 'n',
1276
+ '\u0146': 'n',
1277
+ '\u1E4B': 'n',
1278
+ '\u1E49': 'n',
1279
+ '\u019E': 'n',
1280
+ '\u0272': 'n',
1281
+ '\u0149': 'n',
1282
+ '\uA791': 'n',
1283
+ '\uA7A5': 'n',
1284
+ '\u01CC': 'nj',
1285
+ '\u24DE': 'o',
1286
+ '\uFF4F': 'o',
1287
+ '\u00F2': 'o',
1288
+ '\u00F3': 'o',
1289
+ '\u00F4': 'o',
1290
+ '\u1ED3': 'o',
1291
+ '\u1ED1': 'o',
1292
+ '\u1ED7': 'o',
1293
+ '\u1ED5': 'o',
1294
+ '\u00F5': 'o',
1295
+ '\u1E4D': 'o',
1296
+ '\u022D': 'o',
1297
+ '\u1E4F': 'o',
1298
+ '\u014D': 'o',
1299
+ '\u1E51': 'o',
1300
+ '\u1E53': 'o',
1301
+ '\u014F': 'o',
1302
+ '\u022F': 'o',
1303
+ '\u0231': 'o',
1304
+ '\u00F6': 'o',
1305
+ '\u022B': 'o',
1306
+ '\u1ECF': 'o',
1307
+ '\u0151': 'o',
1308
+ '\u01D2': 'o',
1309
+ '\u020D': 'o',
1310
+ '\u020F': 'o',
1311
+ '\u01A1': 'o',
1312
+ '\u1EDD': 'o',
1313
+ '\u1EDB': 'o',
1314
+ '\u1EE1': 'o',
1315
+ '\u1EDF': 'o',
1316
+ '\u1EE3': 'o',
1317
+ '\u1ECD': 'o',
1318
+ '\u1ED9': 'o',
1319
+ '\u01EB': 'o',
1320
+ '\u01ED': 'o',
1321
+ '\u00F8': 'o',
1322
+ '\u01FF': 'o',
1323
+ '\u0254': 'o',
1324
+ '\uA74B': 'o',
1325
+ '\uA74D': 'o',
1326
+ '\u0275': 'o',
1327
+ '\u01A3': 'oi',
1328
+ '\u0223': 'ou',
1329
+ '\uA74F': 'oo',
1330
+ '\u24DF': 'p',
1331
+ '\uFF50': 'p',
1332
+ '\u1E55': 'p',
1333
+ '\u1E57': 'p',
1334
+ '\u01A5': 'p',
1335
+ '\u1D7D': 'p',
1336
+ '\uA751': 'p',
1337
+ '\uA753': 'p',
1338
+ '\uA755': 'p',
1339
+ '\u24E0': 'q',
1340
+ '\uFF51': 'q',
1341
+ '\u024B': 'q',
1342
+ '\uA757': 'q',
1343
+ '\uA759': 'q',
1344
+ '\u24E1': 'r',
1345
+ '\uFF52': 'r',
1346
+ '\u0155': 'r',
1347
+ '\u1E59': 'r',
1348
+ '\u0159': 'r',
1349
+ '\u0211': 'r',
1350
+ '\u0213': 'r',
1351
+ '\u1E5B': 'r',
1352
+ '\u1E5D': 'r',
1353
+ '\u0157': 'r',
1354
+ '\u1E5F': 'r',
1355
+ '\u024D': 'r',
1356
+ '\u027D': 'r',
1357
+ '\uA75B': 'r',
1358
+ '\uA7A7': 'r',
1359
+ '\uA783': 'r',
1360
+ '\u24E2': 's',
1361
+ '\uFF53': 's',
1362
+ '\u00DF': 's',
1363
+ '\u015B': 's',
1364
+ '\u1E65': 's',
1365
+ '\u015D': 's',
1366
+ '\u1E61': 's',
1367
+ '\u0161': 's',
1368
+ '\u1E67': 's',
1369
+ '\u1E63': 's',
1370
+ '\u1E69': 's',
1371
+ '\u0219': 's',
1372
+ '\u015F': 's',
1373
+ '\u023F': 's',
1374
+ '\uA7A9': 's',
1375
+ '\uA785': 's',
1376
+ '\u1E9B': 's',
1377
+ '\u24E3': 't',
1378
+ '\uFF54': 't',
1379
+ '\u1E6B': 't',
1380
+ '\u1E97': 't',
1381
+ '\u0165': 't',
1382
+ '\u1E6D': 't',
1383
+ '\u021B': 't',
1384
+ '\u0163': 't',
1385
+ '\u1E71': 't',
1386
+ '\u1E6F': 't',
1387
+ '\u0167': 't',
1388
+ '\u01AD': 't',
1389
+ '\u0288': 't',
1390
+ '\u2C66': 't',
1391
+ '\uA787': 't',
1392
+ '\uA729': 'tz',
1393
+ '\u24E4': 'u',
1394
+ '\uFF55': 'u',
1395
+ '\u00F9': 'u',
1396
+ '\u00FA': 'u',
1397
+ '\u00FB': 'u',
1398
+ '\u0169': 'u',
1399
+ '\u1E79': 'u',
1400
+ '\u016B': 'u',
1401
+ '\u1E7B': 'u',
1402
+ '\u016D': 'u',
1403
+ '\u00FC': 'u',
1404
+ '\u01DC': 'u',
1405
+ '\u01D8': 'u',
1406
+ '\u01D6': 'u',
1407
+ '\u01DA': 'u',
1408
+ '\u1EE7': 'u',
1409
+ '\u016F': 'u',
1410
+ '\u0171': 'u',
1411
+ '\u01D4': 'u',
1412
+ '\u0215': 'u',
1413
+ '\u0217': 'u',
1414
+ '\u01B0': 'u',
1415
+ '\u1EEB': 'u',
1416
+ '\u1EE9': 'u',
1417
+ '\u1EEF': 'u',
1418
+ '\u1EED': 'u',
1419
+ '\u1EF1': 'u',
1420
+ '\u1EE5': 'u',
1421
+ '\u1E73': 'u',
1422
+ '\u0173': 'u',
1423
+ '\u1E77': 'u',
1424
+ '\u1E75': 'u',
1425
+ '\u0289': 'u',
1426
+ '\u24E5': 'v',
1427
+ '\uFF56': 'v',
1428
+ '\u1E7D': 'v',
1429
+ '\u1E7F': 'v',
1430
+ '\u028B': 'v',
1431
+ '\uA75F': 'v',
1432
+ '\u028C': 'v',
1433
+ '\uA761': 'vy',
1434
+ '\u24E6': 'w',
1435
+ '\uFF57': 'w',
1436
+ '\u1E81': 'w',
1437
+ '\u1E83': 'w',
1438
+ '\u0175': 'w',
1439
+ '\u1E87': 'w',
1440
+ '\u1E85': 'w',
1441
+ '\u1E98': 'w',
1442
+ '\u1E89': 'w',
1443
+ '\u2C73': 'w',
1444
+ '\u24E7': 'x',
1445
+ '\uFF58': 'x',
1446
+ '\u1E8B': 'x',
1447
+ '\u1E8D': 'x',
1448
+ '\u24E8': 'y',
1449
+ '\uFF59': 'y',
1450
+ '\u1EF3': 'y',
1451
+ '\u00FD': 'y',
1452
+ '\u0177': 'y',
1453
+ '\u1EF9': 'y',
1454
+ '\u0233': 'y',
1455
+ '\u1E8F': 'y',
1456
+ '\u00FF': 'y',
1457
+ '\u1EF7': 'y',
1458
+ '\u1E99': 'y',
1459
+ '\u1EF5': 'y',
1460
+ '\u01B4': 'y',
1461
+ '\u024F': 'y',
1462
+ '\u1EFF': 'y',
1463
+ '\u24E9': 'z',
1464
+ '\uFF5A': 'z',
1465
+ '\u017A': 'z',
1466
+ '\u1E91': 'z',
1467
+ '\u017C': 'z',
1468
+ '\u017E': 'z',
1469
+ '\u1E93': 'z',
1470
+ '\u1E95': 'z',
1471
+ '\u01B6': 'z',
1472
+ '\u0225': 'z',
1473
+ '\u0240': 'z',
1474
+ '\u2C6C': 'z',
1475
+ '\uA763': 'z',
1476
+ '\u0386': '\u0391',
1477
+ '\u0388': '\u0395',
1478
+ '\u0389': '\u0397',
1479
+ '\u038A': '\u0399',
1480
+ '\u03AA': '\u0399',
1481
+ '\u038C': '\u039F',
1482
+ '\u038E': '\u03A5',
1483
+ '\u03AB': '\u03A5',
1484
+ '\u038F': '\u03A9',
1485
+ '\u03AC': '\u03B1',
1486
+ '\u03AD': '\u03B5',
1487
+ '\u03AE': '\u03B7',
1488
+ '\u03AF': '\u03B9',
1489
+ '\u03CA': '\u03B9',
1490
+ '\u0390': '\u03B9',
1491
+ '\u03CC': '\u03BF',
1492
+ '\u03CD': '\u03C5',
1493
+ '\u03CB': '\u03C5',
1494
+ '\u03B0': '\u03C5',
1495
+ '\u03C9': '\u03C9',
1496
+ '\u03C2': '\u03C3',
1497
+ };
1498
+ function stripSpecialChars(text) {
1499
+ const match = (a) => diacritics[a] || a;
1500
+ // eslint-disable-next-line no-control-regex
1501
+ return text.replace(/[^\u0000-\u007E]/g, match);
1502
+ }
1503
+
1504
+ class ItemsList {
1505
+ constructor(_ngSelect, _selectionModel) {
1506
+ this._ngSelect = _ngSelect;
1507
+ this._selectionModel = _selectionModel;
1508
+ this._items = [];
1509
+ this._filteredItems = [];
1510
+ this._markedIndex = -1;
1511
+ }
1512
+ get items() {
1513
+ return this._items;
1514
+ }
1515
+ get filteredItems() {
1516
+ return this._filteredItems;
1517
+ }
1518
+ get markedIndex() {
1519
+ return this._markedIndex;
1520
+ }
1521
+ get selectedItems() {
1522
+ return this._selectionModel.value;
1523
+ }
1524
+ get markedItem() {
1525
+ return this._filteredItems[this._markedIndex];
1526
+ }
1527
+ get noItemsToSelect() {
1528
+ return this._ngSelect.hideSelected && this._items.length === this.selectedItems.length;
1529
+ }
1530
+ get maxItemsSelected() {
1531
+ return this._ngSelect.multiple && this._ngSelect.maxSelectedItems <= this.selectedItems.length;
1532
+ }
1533
+ get lastSelectedItem() {
1534
+ let i = this.selectedItems.length - 1;
1535
+ for (; i >= 0; i--) {
1536
+ const item = this.selectedItems[i];
1537
+ if (!item.disabled) {
1538
+ return item;
1539
+ }
1540
+ }
1541
+ return null;
1542
+ }
1543
+ setItems(items) {
1544
+ this._items = items.map((item, index) => this.mapItem(item, index));
1545
+ if (this._ngSelect.groupBy) {
1546
+ this._groups = this._groupBy(this._items, this._ngSelect.groupBy);
1547
+ this._items = this._flatten(this._groups);
1548
+ }
1549
+ else {
1550
+ this._groups = new Map();
1551
+ this._groups.set(undefined, this._items);
1552
+ }
1553
+ this._filteredItems = [...this._items];
1554
+ }
1555
+ select(item) {
1556
+ if (item.selected || this.maxItemsSelected) {
1557
+ return;
1558
+ }
1559
+ const multiple = this._ngSelect.multiple;
1560
+ if (!multiple) {
1561
+ this.clearSelected();
1562
+ }
1563
+ this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel);
1564
+ if (this._ngSelect.hideSelected) {
1565
+ this._hideSelected(item);
1566
+ }
1567
+ }
1568
+ unselect(item) {
1569
+ if (!item.selected) {
1570
+ return;
1571
+ }
1572
+ this._selectionModel.unselect(item, this._ngSelect.multiple);
1573
+ if (this._ngSelect.hideSelected && isDefined(item.index) && this._ngSelect.multiple) {
1574
+ this._showSelected(item);
1575
+ }
1576
+ }
1577
+ findItem(value) {
1578
+ let findBy;
1579
+ if (this._ngSelect.compareWith) {
1580
+ findBy = item => this._ngSelect.compareWith(item.value, value);
1581
+ }
1582
+ else if (this._ngSelect.bindValue) {
1583
+ findBy = item => !item.children &&
1584
+ this.resolveNested(item.value, this._ngSelect.bindValue) === value;
1585
+ }
1586
+ else {
1587
+ findBy = item => item.value === value ||
1588
+ !!(!item.children &&
1589
+ item.label &&
1590
+ item.label === this.resolveNested(value, this._ngSelect.bindLabel));
1591
+ }
1592
+ return this._items.find(item => findBy(item));
1593
+ }
1594
+ addItem(item) {
1595
+ const option = this.mapItem(item, this._items.length);
1596
+ this._items.push(option);
1597
+ this._filteredItems.push(option);
1598
+ return option;
1599
+ }
1600
+ clearSelected(keepDisabled = false) {
1601
+ this._selectionModel.clear(keepDisabled);
1602
+ this._items.forEach(item => {
1603
+ item.selected = keepDisabled && item.selected && item.disabled;
1604
+ item.marked = false;
1605
+ });
1606
+ if (this._ngSelect.hideSelected) {
1607
+ this.resetFilteredItems();
1608
+ }
1609
+ }
1610
+ findByLabel(term) {
1611
+ term = stripSpecialChars(term).toLocaleLowerCase();
1612
+ return this.filteredItems.find(item => {
1613
+ const label = stripSpecialChars(item.label).toLocaleLowerCase();
1614
+ return label.substr(0, term.length) === term;
1615
+ });
1616
+ }
1617
+ filter(term) {
1618
+ if (!term) {
1619
+ this.resetFilteredItems();
1620
+ return;
1621
+ }
1622
+ this._filteredItems = [];
1623
+ term = this._ngSelect.searchFn
1624
+ ? term
1625
+ : stripSpecialChars(term).toLocaleLowerCase();
1626
+ const match = this._ngSelect.searchFn || this._defaultSearchFn;
1627
+ const hideSelected = this._ngSelect.hideSelected;
1628
+ for (const key of Array.from(this._groups.keys())) {
1629
+ const matchedItems = [];
1630
+ for (const item of this._groups.get(key)) {
1631
+ if (hideSelected && ((item.parent && item.parent.selected) || item.selected)) {
1632
+ continue;
1633
+ }
1634
+ const searchItem = this._ngSelect.searchFn ? item.value : item;
1635
+ if (match(term, searchItem)) {
1636
+ matchedItems.push(item);
1637
+ }
1638
+ }
1639
+ if (matchedItems.length > 0) {
1640
+ const [last] = matchedItems.slice(-1);
1641
+ if (last.parent) {
1642
+ const head = this._items.find(x => x === last.parent);
1643
+ this._filteredItems.push(head);
1644
+ }
1645
+ this._filteredItems.push(...matchedItems);
1646
+ }
1647
+ }
1648
+ }
1649
+ resetFilteredItems() {
1650
+ if (this._filteredItems.length === this._items.length) {
1651
+ return;
1652
+ }
1653
+ if (this._ngSelect.hideSelected && this.selectedItems.length > 0) {
1654
+ this._filteredItems = this._items.filter(x => !x.selected);
1655
+ }
1656
+ else {
1657
+ this._filteredItems = this._items;
1658
+ }
1659
+ }
1660
+ unmarkItem() {
1661
+ this._markedIndex = -1;
1662
+ }
1663
+ markNextItem() {
1664
+ this._stepToItem(+1);
1665
+ }
1666
+ markPreviousItem() {
1667
+ this._stepToItem(-1);
1668
+ }
1669
+ markItem(item) {
1670
+ this._markedIndex = this._filteredItems.indexOf(item);
1671
+ }
1672
+ markSelectedOrDefault(markDefault) {
1673
+ if (this._filteredItems.length === 0) {
1674
+ return;
1675
+ }
1676
+ const lastMarkedIndex = this._getLastMarkedIndex();
1677
+ if (lastMarkedIndex > -1) {
1678
+ this._markedIndex = lastMarkedIndex;
1679
+ }
1680
+ else {
1681
+ this._markedIndex = markDefault ? this.filteredItems.findIndex(x => !x.disabled) : -1;
1682
+ }
1683
+ }
1684
+ resolveNested(option, key) {
1685
+ if (!isObject(option)) {
1686
+ return option;
1687
+ }
1688
+ if (key.indexOf('.') === -1) {
1689
+ return option[key];
1690
+ }
1691
+ else {
1692
+ const keys = key.split('.');
1693
+ let value = option;
1694
+ for (let i = 0, len = keys.length; i < len; ++i) {
1695
+ if (value == null) {
1696
+ return null;
1697
+ }
1698
+ value = value[keys[i]];
1699
+ }
1700
+ return value;
1701
+ }
1702
+ }
1703
+ mapItem(item, index) {
1704
+ const label = isDefined(item.$ngOptionLabel)
1705
+ ? item.$ngOptionLabel
1706
+ : this.resolveNested(item, this._ngSelect.bindLabel);
1707
+ const value = isDefined(item.$ngOptionValue) ? item.$ngOptionValue : item;
1708
+ return {
1709
+ index,
1710
+ label: isDefined(label) ? label.toString() : '',
1711
+ value,
1712
+ disabled: item.disabled,
1713
+ htmlId: `${this._ngSelect.dropdownId}-${index}`,
1714
+ };
1715
+ }
1716
+ mapSelectedItems() {
1717
+ const multiple = this._ngSelect.multiple;
1718
+ for (const selected of this.selectedItems) {
1719
+ const value = this._ngSelect.bindValue
1720
+ ? this.resolveNested(selected.value, this._ngSelect.bindValue)
1721
+ : selected.value;
1722
+ const item = isDefined(value) ? this.findItem(value) : null;
1723
+ this._selectionModel.unselect(selected, multiple);
1724
+ this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel);
1725
+ }
1726
+ if (this._ngSelect.hideSelected) {
1727
+ this._filteredItems = this.filteredItems.filter(x => this.selectedItems.indexOf(x) === -1);
1728
+ }
1729
+ }
1730
+ _showSelected(item) {
1731
+ this._filteredItems.push(item);
1732
+ if (item.parent) {
1733
+ const parent = item.parent;
1734
+ const parentExists = this._filteredItems.find(x => x === parent);
1735
+ if (!parentExists) {
1736
+ this._filteredItems.push(parent);
1737
+ }
1738
+ }
1739
+ else if (item.children) {
1740
+ for (const child of item.children) {
1741
+ child.selected = false;
1742
+ this._filteredItems.push(child);
1743
+ }
1744
+ }
1745
+ this._filteredItems = [...this._filteredItems.sort((a, b) => a.index - b.index)];
1746
+ }
1747
+ _hideSelected(item) {
1748
+ this._filteredItems = this._filteredItems.filter(x => x !== item);
1749
+ if (item.parent) {
1750
+ const children = item.parent.children;
1751
+ if (children.every(x => x.selected)) {
1752
+ this._filteredItems = this._filteredItems.filter(x => x !== item.parent);
1753
+ }
1754
+ }
1755
+ else if (item.children) {
1756
+ this._filteredItems = this.filteredItems.filter(x => x.parent !== item);
1757
+ }
1758
+ }
1759
+ _defaultSearchFn(search, opt) {
1760
+ const label = stripSpecialChars(opt.label).toLocaleLowerCase();
1761
+ return label.indexOf(search) > -1;
1762
+ }
1763
+ _getNextItemIndex(steps) {
1764
+ if (steps > 0) {
1765
+ return this._markedIndex >= this._filteredItems.length - 1 ? 0 : this._markedIndex + 1;
1766
+ }
1767
+ return this._markedIndex <= 0 ? this._filteredItems.length - 1 : this._markedIndex - 1;
1768
+ }
1769
+ _stepToItem(steps) {
1770
+ if (this._filteredItems.length === 0 || this._filteredItems.every(x => x.disabled)) {
1771
+ return;
1772
+ }
1773
+ this._markedIndex = this._getNextItemIndex(steps);
1774
+ if (this.markedItem?.disabled) {
1775
+ this._stepToItem(steps);
1776
+ }
1777
+ }
1778
+ _getLastMarkedIndex() {
1779
+ if (this._ngSelect.hideSelected) {
1780
+ return -1;
1781
+ }
1782
+ if (this._markedIndex > -1 && this.markedItem === undefined) {
1783
+ return -1;
1784
+ }
1785
+ const selectedIndex = this._filteredItems.indexOf(this.lastSelectedItem);
1786
+ if (this.lastSelectedItem && selectedIndex < 0) {
1787
+ return -1;
1788
+ }
1789
+ return Math.max(this.markedIndex, selectedIndex);
1790
+ }
1791
+ _groupBy(items, prop) {
1792
+ const groups = new Map();
1793
+ if (items.length === 0) {
1794
+ return groups;
1795
+ }
1796
+ // Check if items are already grouped by given key.
1797
+ if (Array.isArray(items[0].value[prop])) {
1798
+ for (const item of items) {
1799
+ const children = (item.value[prop] || []).map((x, index) => this.mapItem(x, index));
1800
+ groups.set(item, children);
1801
+ }
1802
+ return groups;
1803
+ }
1804
+ const isFnKey = isFunction(this._ngSelect.groupBy);
1805
+ const keyFn = (item) => {
1806
+ const key = isFnKey ? prop(item.value) : item.value[prop];
1807
+ return isDefined(key) ? key : undefined;
1808
+ };
1809
+ // Group items by key.
1810
+ for (const item of items) {
1811
+ const key = keyFn(item);
1812
+ const group = groups.get(key);
1813
+ if (group) {
1814
+ group.push(item);
1815
+ }
1816
+ else {
1817
+ groups.set(key, [item]);
1818
+ }
1819
+ }
1820
+ return groups;
1821
+ }
1822
+ _flatten(groups) {
1823
+ const isGroupByFn = isFunction(this._ngSelect.groupBy);
1824
+ const items = [];
1825
+ for (const key of Array.from(groups.keys())) {
1826
+ let i = items.length;
1827
+ if (key === undefined) {
1828
+ const withoutGroup = groups.get(undefined) || [];
1829
+ items.push(...withoutGroup.map(x => {
1830
+ x.index = i++;
1831
+ return x;
1832
+ }));
1833
+ continue;
1834
+ }
1835
+ const isObjectKey = isObject(key);
1836
+ const parent = {
1837
+ label: isObjectKey ? '' : String(key),
1838
+ children: undefined,
1839
+ parent: null,
1840
+ index: i++,
1841
+ disabled: !this._ngSelect.selectableGroup,
1842
+ htmlId: newId(),
1843
+ };
1844
+ const groupKey = isGroupByFn
1845
+ ? this._ngSelect.bindLabel
1846
+ : this._ngSelect.groupBy;
1847
+ const groupValue = this._ngSelect.groupValue ||
1848
+ (() => {
1849
+ if (isObjectKey) {
1850
+ return key.value;
1851
+ }
1852
+ return { [groupKey]: key };
1853
+ });
1854
+ const children = groups.get(key).map(x => {
1855
+ x.parent = parent;
1856
+ x.children = undefined;
1857
+ x.index = i++;
1858
+ return x;
1859
+ });
1860
+ parent.children = children;
1861
+ parent.value = groupValue(key, children.map(x => x.value));
1862
+ items.push(parent);
1863
+ items.push(...children);
1864
+ }
1865
+ return items;
1866
+ }
1867
+ }
1868
+
1869
+ class NgSelectConfig {
1870
+ constructor() {
1871
+ this.fixedPlaceholder = true;
1872
+ this.notFoundText = 'No items found';
1873
+ this.typeToSearchText = 'Type to search';
1874
+ this.addTagText = 'Add item';
1875
+ this.loadingText = 'Loading...';
1876
+ this.clearAllText = 'Clear all';
1877
+ this.ariaLabelDropdown = 'Options List';
1878
+ this.disableVirtualScroll = true;
1879
+ this.openOnEnter = true;
1880
+ this.appearance = 'underline';
1881
+ this.tabFocusOnClear = true;
1882
+ }
1883
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1884
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
1885
+ }
1886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectConfig, decorators: [{
1887
+ type: Injectable,
1888
+ args: [{ providedIn: 'root' }]
1889
+ }] });
1890
+
1891
+ class NgItemLabel {
1892
+ constructor() {
1893
+ this.ngItemLabel = '';
1894
+ this.escape = true;
1895
+ this.element = inject(ElementRef);
1896
+ }
1897
+ ngOnChanges(changes) {
1898
+ this.element.nativeElement.innerHTML = this.escape
1899
+ ? escapeHTML(this.ngItemLabel)
1900
+ : this.ngItemLabel;
1901
+ }
1902
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgItemLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1903
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgItemLabel, isStandalone: true, selector: "[ngItemLabel]", inputs: { ngItemLabel: "ngItemLabel", escape: "escape" }, usesOnChanges: true, ngImport: i0 }); }
1904
+ }
1905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgItemLabel, decorators: [{
1906
+ type: Directive,
1907
+ args: [{
1908
+ selector: '[ngItemLabel]',
1909
+ }]
1910
+ }], propDecorators: { ngItemLabel: [{
1911
+ type: Input
1912
+ }], escape: [{
1913
+ type: Input
1914
+ }] } });
1915
+ class NgOptionTemplate {
1916
+ constructor() {
1917
+ this.template = inject(TemplateRef);
1918
+ }
1919
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptionTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1920
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgOptionTemplate, isStandalone: true, selector: "[ng-option-tmp]", ngImport: i0 }); }
1921
+ }
1922
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptionTemplate, decorators: [{
1923
+ type: Directive,
1924
+ args: [{
1925
+ selector: '[ng-option-tmp]',
1926
+ }]
1927
+ }] });
1928
+ class NgOptgroupTemplate {
1929
+ constructor() {
1930
+ this.template = inject(TemplateRef);
1931
+ }
1932
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptgroupTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1933
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgOptgroupTemplate, isStandalone: true, selector: "[ng-optgroup-tmp]", ngImport: i0 }); }
1934
+ }
1935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptgroupTemplate, decorators: [{
1936
+ type: Directive,
1937
+ args: [{
1938
+ selector: '[ng-optgroup-tmp]',
1939
+ }]
1940
+ }] });
1941
+ class NgLabelTemplate {
1942
+ constructor() {
1943
+ this.template = inject(TemplateRef);
1944
+ }
1945
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLabelTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1946
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgLabelTemplate, isStandalone: true, selector: "[ng-label-tmp]", ngImport: i0 }); }
1947
+ }
1948
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLabelTemplate, decorators: [{
1949
+ type: Directive,
1950
+ args: [{
1951
+ selector: '[ng-label-tmp]',
1952
+ }]
1953
+ }] });
1954
+ class NgMultiLabelTemplate {
1955
+ constructor() {
1956
+ this.template = inject(TemplateRef);
1957
+ }
1958
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgMultiLabelTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1959
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgMultiLabelTemplate, isStandalone: true, selector: "[ng-multi-label-tmp]", ngImport: i0 }); }
1960
+ }
1961
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgMultiLabelTemplate, decorators: [{
1962
+ type: Directive,
1963
+ args: [{
1964
+ selector: '[ng-multi-label-tmp]',
1965
+ }]
1966
+ }] });
1967
+ class NgHeaderTemplate {
1968
+ constructor() {
1969
+ this.template = inject(TemplateRef);
1970
+ }
1971
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgHeaderTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1972
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgHeaderTemplate, isStandalone: true, selector: "[ng-header-tmp]", ngImport: i0 }); }
1973
+ }
1974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgHeaderTemplate, decorators: [{
1975
+ type: Directive,
1976
+ args: [{
1977
+ selector: '[ng-header-tmp]',
1978
+ }]
1979
+ }] });
1980
+ class NgFooterTemplate {
1981
+ constructor() {
1982
+ this.template = inject(TemplateRef);
1983
+ }
1984
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgFooterTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1985
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgFooterTemplate, isStandalone: true, selector: "[ng-footer-tmp]", ngImport: i0 }); }
1986
+ }
1987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgFooterTemplate, decorators: [{
1988
+ type: Directive,
1989
+ args: [{
1990
+ selector: '[ng-footer-tmp]',
1991
+ }]
1992
+ }] });
1993
+ class NgNotFoundTemplate {
1994
+ constructor() {
1995
+ this.template = inject(TemplateRef);
1996
+ }
1997
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgNotFoundTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1998
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgNotFoundTemplate, isStandalone: true, selector: "[ng-notfound-tmp]", ngImport: i0 }); }
1999
+ }
2000
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgNotFoundTemplate, decorators: [{
2001
+ type: Directive,
2002
+ args: [{
2003
+ selector: '[ng-notfound-tmp]',
2004
+ }]
2005
+ }] });
2006
+ class NgPlaceholderTemplate {
2007
+ constructor() {
2008
+ this.template = inject(TemplateRef);
2009
+ }
2010
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgPlaceholderTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2011
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgPlaceholderTemplate, isStandalone: true, selector: "[ng-placeholder-tmp]", ngImport: i0 }); }
2012
+ }
2013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgPlaceholderTemplate, decorators: [{
2014
+ type: Directive,
2015
+ args: [{
2016
+ selector: '[ng-placeholder-tmp]',
2017
+ }]
2018
+ }] });
2019
+ class NgTypeToSearchTemplate {
2020
+ constructor() {
2021
+ this.template = inject(TemplateRef);
2022
+ }
2023
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgTypeToSearchTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2024
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgTypeToSearchTemplate, isStandalone: true, selector: "[ng-typetosearch-tmp]", ngImport: i0 }); }
2025
+ }
2026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgTypeToSearchTemplate, decorators: [{
2027
+ type: Directive,
2028
+ args: [{
2029
+ selector: '[ng-typetosearch-tmp]',
2030
+ }]
2031
+ }] });
2032
+ class NgLoadingTextTemplate {
2033
+ constructor() {
2034
+ this.template = inject(TemplateRef);
2035
+ }
2036
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLoadingTextTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2037
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgLoadingTextTemplate, isStandalone: true, selector: "[ng-loadingtext-tmp]", ngImport: i0 }); }
2038
+ }
2039
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLoadingTextTemplate, decorators: [{
2040
+ type: Directive,
2041
+ args: [{
2042
+ selector: '[ng-loadingtext-tmp]',
2043
+ }]
2044
+ }] });
2045
+ class NgTagTemplate {
2046
+ constructor() {
2047
+ this.template = inject(TemplateRef);
2048
+ }
2049
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgTagTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2050
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgTagTemplate, isStandalone: true, selector: "[ng-tag-tmp]", ngImport: i0 }); }
2051
+ }
2052
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgTagTemplate, decorators: [{
2053
+ type: Directive,
2054
+ args: [{
2055
+ selector: '[ng-tag-tmp]',
2056
+ }]
2057
+ }] });
2058
+ class NgLoadingSpinnerTemplate {
2059
+ constructor() {
2060
+ this.template = inject(TemplateRef);
2061
+ }
2062
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLoadingSpinnerTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2063
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgLoadingSpinnerTemplate, isStandalone: true, selector: "[ng-loadingspinner-tmp]", ngImport: i0 }); }
2064
+ }
2065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgLoadingSpinnerTemplate, decorators: [{
2066
+ type: Directive,
2067
+ args: [{
2068
+ selector: '[ng-loadingspinner-tmp]',
2069
+ }]
2070
+ }] });
2071
+ class NgClearButtonTemplate {
2072
+ constructor() {
2073
+ this.template = inject(TemplateRef);
2074
+ }
2075
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgClearButtonTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2076
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: NgClearButtonTemplate, isStandalone: true, selector: "[ng-clearbutton-tmp]", ngImport: i0 }); }
2077
+ }
2078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgClearButtonTemplate, decorators: [{
2079
+ type: Directive,
2080
+ args: [{
2081
+ selector: '[ng-clearbutton-tmp]',
2082
+ }]
2083
+ }] });
2084
+
2085
+ function DefaultSelectionModelFactory() {
2086
+ return new DefaultSelectionModel();
2087
+ }
2088
+ class DefaultSelectionModel {
2089
+ constructor() {
2090
+ this._selected = [];
2091
+ }
2092
+ get value() {
2093
+ return this._selected;
2094
+ }
2095
+ select(item, multiple, groupAsModel) {
2096
+ item.selected = true;
2097
+ if (!item.children || (!multiple && groupAsModel)) {
2098
+ this._selected.push(item);
2099
+ }
2100
+ if (multiple) {
2101
+ if (item.parent) {
2102
+ const childrenCount = item.parent.children?.length;
2103
+ const selectedCount = item.parent.children?.filter(x => x.selected).length;
2104
+ item.parent.selected = childrenCount === selectedCount;
2105
+ }
2106
+ else if (item.children) {
2107
+ this._setChildrenSelectedState(item.children, true);
2108
+ this._removeChildren(item);
2109
+ if (groupAsModel && this._activeChildren(item)) {
2110
+ this._selected = [...this._selected.filter(x => x.parent !== item), item];
2111
+ }
2112
+ else {
2113
+ this._selected = [...this._selected, ...item.children.filter(x => !x.disabled)];
2114
+ }
2115
+ }
2116
+ }
2117
+ }
2118
+ unselect(item, multiple) {
2119
+ this._selected = this._selected.filter(x => x !== item);
2120
+ item.selected = false;
2121
+ if (multiple) {
2122
+ if (item.parent && item.parent.selected) {
2123
+ const children = item.parent.children;
2124
+ this._removeParent(item.parent);
2125
+ this._removeChildren(item.parent);
2126
+ this._selected.push(...children.filter(x => x !== item && !x.disabled));
2127
+ item.parent.selected = false;
2128
+ }
2129
+ else if (item.children) {
2130
+ this._setChildrenSelectedState(item.children, false);
2131
+ this._removeChildren(item);
2132
+ }
2133
+ }
2134
+ }
2135
+ clear(keepDisabled) {
2136
+ this._selected = keepDisabled ? this._selected.filter(x => x.disabled) : [];
2137
+ }
2138
+ _setChildrenSelectedState(children, selected) {
2139
+ for (const child of children) {
2140
+ if (child.disabled) {
2141
+ continue;
2142
+ }
2143
+ child.selected = selected;
2144
+ }
2145
+ }
2146
+ _removeChildren(parent) {
2147
+ this._selected = [
2148
+ ...this._selected.filter(x => x.parent !== parent),
2149
+ ...parent.children.filter(x => x.parent === parent && x.disabled && x.selected),
2150
+ ];
2151
+ }
2152
+ _removeParent(parent) {
2153
+ this._selected = this._selected.filter(x => x !== parent);
2154
+ }
2155
+ _activeChildren(item) {
2156
+ return item.children?.every(x => !x.disabled || x.selected);
2157
+ }
2158
+ }
2159
+
2160
+ /* eslint-disable @angular-eslint/no-output-rename */
2161
+ const SELECTION_MODEL_FACTORY = new InjectionToken('ng-select-selection-model');
2162
+ class NgSelect {
2163
+ get _panelClass() {
2164
+ return [this.classes, this.panelClass].filter(v => !!v).join(' ');
2165
+ }
2166
+ get items() {
2167
+ return this._items;
2168
+ }
2169
+ set items(value) {
2170
+ this._itemsAreUsed = true;
2171
+ this._items = value ?? [];
2172
+ }
2173
+ get disabled() {
2174
+ return this.readonly || this._disabled;
2175
+ }
2176
+ get compareWith() {
2177
+ return this._compareWith;
2178
+ }
2179
+ set compareWith(fn) {
2180
+ if (fn != null && !isFunction(fn)) {
2181
+ throw Error('`compareWith` must be a function.');
2182
+ }
2183
+ this._compareWith = fn;
2184
+ }
2185
+ get clearSearchOnAdd() {
2186
+ if (isDefined(this._clearSearchOnAdd)) {
2187
+ return this._clearSearchOnAdd;
2188
+ }
2189
+ else if (isDefined(this._config.clearSearchOnAdd)) {
2190
+ return this._config.clearSearchOnAdd;
2191
+ }
2192
+ return this.closeOnSelect;
2193
+ }
2194
+ set clearSearchOnAdd(value) {
2195
+ this._clearSearchOnAdd = value;
2196
+ }
2197
+ get deselectOnClick() {
2198
+ if (isDefined(this._deselectOnClick)) {
2199
+ return this._deselectOnClick;
2200
+ }
2201
+ else if (isDefined(this._config.deselectOnClick)) {
2202
+ return this._config.deselectOnClick;
2203
+ }
2204
+ return this.multiple;
2205
+ }
2206
+ set deselectOnClick(value) {
2207
+ this._deselectOnClick = value;
2208
+ }
2209
+ get selectedItems() {
2210
+ return this.itemsList.selectedItems;
2211
+ }
2212
+ get selectedValues() {
2213
+ return this.selectedItems.map(x => x.value);
2214
+ }
2215
+ get hasValue() {
2216
+ return this.selectedItems.length > 0;
2217
+ }
2218
+ get currentPanelPosition() {
2219
+ if (this.dropdownPanel) {
2220
+ return this.dropdownPanel.currentPosition;
2221
+ }
2222
+ return undefined;
2223
+ }
2224
+ get showAddTag() {
2225
+ if (!this._validTerm) {
2226
+ return false;
2227
+ }
2228
+ const term = this.searchTerm?.toLowerCase().trim();
2229
+ return (this.addTag &&
2230
+ !this.itemsList.filteredItems.some(x => x.label.toLowerCase() === term) &&
2231
+ ((!this.hideSelected && this.isOpen) ||
2232
+ !this.selectedItems.some(x => x.label.toLowerCase() === term)) &&
2233
+ !this.loading);
2234
+ }
2235
+ get filtered() {
2236
+ return (!!this.searchTerm && this.searchable) || this._isComposing;
2237
+ }
2238
+ get _editableSearchTerm() {
2239
+ return this.editableSearchTerm && !this.multiple;
2240
+ }
2241
+ get _isTypeahead() {
2242
+ return this.typeahead && this.typeahead.observers.length > 0;
2243
+ }
2244
+ get _validTerm() {
2245
+ const term = this.searchTerm?.trim();
2246
+ return term && term.length >= this.minTermLength;
2247
+ }
2248
+ constructor() {
2249
+ this._cdr = inject(ChangeDetectorRef);
2250
+ this._elementRef = inject(ElementRef);
2251
+ this._config = inject(NgSelectConfig);
2252
+ this.newSelectionModel = inject(SELECTION_MODEL_FACTORY, { optional: true });
2253
+ this.autoFocus = inject(new HostAttributeToken('autofocus'), { optional: true });
2254
+ this.classes = inject(new HostAttributeToken('class'), { optional: true });
2255
+ this.fixedPlaceholder = false;
2256
+ this.dropdownPosition = 'auto';
2257
+ this.readonly = false;
2258
+ this.multiple = false;
2259
+ this.searchable = true;
2260
+ this.clearable = true;
2261
+ this.loading = false;
2262
+ this.closeOnSelect = true;
2263
+ this.clearOnBackspace = true;
2264
+ this.hideSelected = false;
2265
+ this.selectOnTab = false;
2266
+ this.bufferAmount = 4;
2267
+ this.selectableGroup = false;
2268
+ this.selectableGroupAsModel = true;
2269
+ this.searchWhileComposing = true;
2270
+ this.editableSearchTerm = false;
2271
+ this.maxSelectedItems = Infinity;
2272
+ this.minTermLength = 0;
2273
+ this.markFirst = true;
2274
+ this.addTag = false;
2275
+ this.preventToggleOnRightClick = false;
2276
+ this.searchFn = null;
2277
+ this.keyDownFn = (_) => true;
2278
+ this.trackByFn = null;
2279
+ this.labelForId = null;
2280
+ this.inputAttrs = {};
2281
+ this.ariaLabelDropdown = 'Options List';
2282
+ this.isOpen = false;
2283
+ this._items = [];
2284
+ this._disabled = false;
2285
+ // output events
2286
+ this.blurEvent = new EventEmitter();
2287
+ this.focusEvent = new EventEmitter();
2288
+ this.changeEvent = new EventEmitter();
2289
+ this.openEvent = new EventEmitter();
2290
+ this.closeEvent = new EventEmitter();
2291
+ this.searchEvent = new EventEmitter();
2292
+ this.clearEvent = new EventEmitter();
2293
+ this.addEvent = new EventEmitter();
2294
+ this.removeEvent = new EventEmitter();
2295
+ this.scroll = new EventEmitter();
2296
+ this.scrollToEnd = new EventEmitter();
2297
+ this.dropdownId = newId();
2298
+ this.element = this._elementRef.nativeElement;
2299
+ this.viewPortItems = [];
2300
+ this.searchTerm = null;
2301
+ this.escapeHTML = true;
2302
+ this.tabFocusOnClear = true;
2303
+ this._pressedKeys = [];
2304
+ this._isComposing = false;
2305
+ this._defaultLabel = 'label';
2306
+ this._destroy$ = new Subject();
2307
+ this._keyPress$ = new Subject();
2308
+ this._onChange = (_) => { };
2309
+ this._onTouched = () => { };
2310
+ this.trackByOption = (_, item) => {
2311
+ if (this.trackByFn) {
2312
+ return this.trackByFn(item.value);
2313
+ }
2314
+ return item;
2315
+ };
2316
+ this.clearItem = (item) => {
2317
+ const option = this.selectedItems.find(x => x.value === item);
2318
+ this.unselect(option);
2319
+ };
2320
+ this._mergeGlobalConfig();
2321
+ this.itemsList = new ItemsList(this, this.newSelectionModel ? this.newSelectionModel() : DefaultSelectionModelFactory());
2322
+ }
2323
+ ngOnInit() {
2324
+ this._handleKeyPresses();
2325
+ this._setInputAttributes();
2326
+ }
2327
+ ngOnChanges(changes) {
2328
+ if (changes['multiple']) {
2329
+ this.itemsList.clearSelected();
2330
+ }
2331
+ if (changes['items']) {
2332
+ this._setItems(changes['items'].currentValue || []);
2333
+ }
2334
+ if (changes['isOpen']) {
2335
+ this._manualOpen = isDefined(changes['isOpen'].currentValue);
2336
+ }
2337
+ if (changes['groupBy']) {
2338
+ if (!changes['items']) {
2339
+ this._setItems([...this.items]);
2340
+ }
2341
+ }
2342
+ if (changes['inputAttrs']) {
2343
+ this._setInputAttributes();
2344
+ }
2345
+ this._setTabFocusOnClear();
2346
+ }
2347
+ ngAfterViewInit() {
2348
+ if (!this._itemsAreUsed) {
2349
+ this.escapeHTML = false;
2350
+ this._setItemsFromNgOptions();
2351
+ }
2352
+ if (isDefined(this.autoFocus)) {
2353
+ this.focus();
2354
+ }
2355
+ }
2356
+ ngOnDestroy() {
2357
+ this._destroy$.next();
2358
+ this._destroy$.complete();
2359
+ }
2360
+ writeValue(value) {
2361
+ this.itemsList.clearSelected();
2362
+ this._handleWriteValue(value);
2363
+ this._cdr.markForCheck();
2364
+ }
2365
+ registerOnChange(fn) {
2366
+ this._onChange = fn;
2367
+ }
2368
+ registerOnTouched(fn) {
2369
+ this._onTouched = fn;
2370
+ }
2371
+ setDisabledState(isDisabled) {
2372
+ this._disabled = isDisabled;
2373
+ this._cdr.markForCheck();
2374
+ }
2375
+ handleKeyDown(e) {
2376
+ const keyName = e.key;
2377
+ if (Object.values(KeyCode).includes(keyName)) {
2378
+ if (this.keyDownFn(e) === false) {
2379
+ return;
2380
+ }
2381
+ this.handleKeyCode(e);
2382
+ }
2383
+ else if (keyName && keyName.length === 1) {
2384
+ this._keyPress$.next(keyName.toLocaleLowerCase());
2385
+ }
2386
+ }
2387
+ handleKeyCode(e) {
2388
+ const target = e.target;
2389
+ if (this.clearButton && this.clearButton.nativeElement === target) {
2390
+ this.handleKeyCodeClear(e);
2391
+ }
2392
+ else {
2393
+ this.handleKeyCodeInput(e);
2394
+ }
2395
+ }
2396
+ handleKeyCodeInput(e) {
2397
+ switch (e.key) {
2398
+ case KeyCode.ArrowDown:
2399
+ this._handleArrowDown(e);
2400
+ break;
2401
+ case KeyCode.ArrowUp:
2402
+ this._handleArrowUp(e);
2403
+ break;
2404
+ case KeyCode.Space:
2405
+ this._handleSpace(e);
2406
+ break;
2407
+ case KeyCode.Enter:
2408
+ this._handleEnter(e);
2409
+ break;
2410
+ case KeyCode.Tab:
2411
+ this._handleTab(e);
2412
+ break;
2413
+ case KeyCode.Esc:
2414
+ this.close();
2415
+ e.preventDefault();
2416
+ break;
2417
+ case KeyCode.Backspace:
2418
+ this._handleBackspace();
2419
+ break;
2420
+ }
2421
+ }
2422
+ handleKeyCodeClear(e) {
2423
+ switch (e.key) {
2424
+ case KeyCode.Enter:
2425
+ this.handleClearClick();
2426
+ e.preventDefault();
2427
+ break;
2428
+ }
2429
+ }
2430
+ handleMousedown(e) {
2431
+ if (this.preventToggleOnRightClick && e.button === 2) {
2432
+ return;
2433
+ }
2434
+ const target = e.target;
2435
+ if (target.tagName !== 'INPUT') {
2436
+ e.preventDefault();
2437
+ }
2438
+ if (target.classList.contains('ng-clear-wrapper')) {
2439
+ this.handleClearClick();
2440
+ return;
2441
+ }
2442
+ if (target.classList.contains('ng-arrow-wrapper')) {
2443
+ this.handleArrowClick();
2444
+ return;
2445
+ }
2446
+ if (target.classList.contains('ng-value-icon')) {
2447
+ return;
2448
+ }
2449
+ if (!this.focused) {
2450
+ this.focus();
2451
+ }
2452
+ if (this.searchable) {
2453
+ this.open();
2454
+ }
2455
+ else {
2456
+ this.toggle();
2457
+ }
2458
+ }
2459
+ handleArrowClick() {
2460
+ if (this.isOpen) {
2461
+ this.close();
2462
+ }
2463
+ else {
2464
+ this.open();
2465
+ }
2466
+ }
2467
+ handleClearClick() {
2468
+ if (this.hasValue) {
2469
+ this.itemsList.clearSelected(true);
2470
+ this._updateNgModel();
2471
+ }
2472
+ this._clearSearch();
2473
+ this.focus();
2474
+ this.clearEvent.emit();
2475
+ this._onSelectionChanged();
2476
+ }
2477
+ clearModel() {
2478
+ if (!this.clearable) {
2479
+ return;
2480
+ }
2481
+ this.itemsList.clearSelected();
2482
+ this._updateNgModel();
2483
+ }
2484
+ toggle() {
2485
+ if (!this.isOpen) {
2486
+ this.open();
2487
+ }
2488
+ else {
2489
+ this.close();
2490
+ }
2491
+ }
2492
+ open() {
2493
+ if (this.disabled || this.isOpen || this._manualOpen) {
2494
+ return;
2495
+ }
2496
+ if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {
2497
+ return;
2498
+ }
2499
+ this.isOpen = true;
2500
+ this.itemsList.markSelectedOrDefault(this.markFirst);
2501
+ this.openEvent.emit();
2502
+ if (!this.searchTerm) {
2503
+ this.focus();
2504
+ }
2505
+ this.detectChanges();
2506
+ }
2507
+ close() {
2508
+ if (!this.isOpen || this._manualOpen) {
2509
+ return;
2510
+ }
2511
+ this.isOpen = false;
2512
+ this._isComposing = false;
2513
+ if (!this._editableSearchTerm) {
2514
+ this._clearSearch();
2515
+ }
2516
+ else {
2517
+ this.itemsList.resetFilteredItems();
2518
+ }
2519
+ this.itemsList.unmarkItem();
2520
+ this._onTouched();
2521
+ this.closeEvent.emit();
2522
+ this._cdr.markForCheck();
2523
+ }
2524
+ toggleItem(item) {
2525
+ if (!item || item.disabled || this.disabled) {
2526
+ return;
2527
+ }
2528
+ if (this.deselectOnClick && item.selected) {
2529
+ this.unselect(item);
2530
+ }
2531
+ else {
2532
+ this.select(item);
2533
+ }
2534
+ if (this._editableSearchTerm) {
2535
+ this._setSearchTermFromItems();
2536
+ }
2537
+ }
2538
+ select(item) {
2539
+ if (!item.selected) {
2540
+ this.itemsList.select(item);
2541
+ if (this.clearSearchOnAdd && !this._editableSearchTerm) {
2542
+ this._clearSearch();
2543
+ }
2544
+ this._updateNgModel();
2545
+ if (this.multiple) {
2546
+ this.addEvent.emit(item.value);
2547
+ }
2548
+ }
2549
+ if (this.closeOnSelect || this.itemsList.noItemsToSelect) {
2550
+ this.close();
2551
+ }
2552
+ this._onSelectionChanged();
2553
+ }
2554
+ focus() {
2555
+ this.searchInput.nativeElement.focus();
2556
+ }
2557
+ blur() {
2558
+ this.searchInput.nativeElement.blur();
2559
+ }
2560
+ unselect(item) {
2561
+ if (!item) {
2562
+ return;
2563
+ }
2564
+ this.itemsList.unselect(item);
2565
+ this.focus();
2566
+ this._updateNgModel();
2567
+ this.removeEvent.emit(item.value);
2568
+ this._onSelectionChanged();
2569
+ }
2570
+ selectTag() {
2571
+ let tag;
2572
+ if (isFunction(this.addTag)) {
2573
+ tag = this.addTag(this.searchTerm);
2574
+ }
2575
+ else {
2576
+ tag = this._primitive ? this.searchTerm : { [this.bindLabel]: this.searchTerm };
2577
+ }
2578
+ const handleTag = (item) => this._isTypeahead || !this.isOpen
2579
+ ? this.itemsList.mapItem(item, null)
2580
+ : this.itemsList.addItem(item);
2581
+ if (isPromise(tag)) {
2582
+ tag.then(item => this.select(handleTag(item))).catch(() => { });
2583
+ }
2584
+ else if (tag) {
2585
+ this.select(handleTag(tag));
2586
+ }
2587
+ }
2588
+ showClear() {
2589
+ return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
2590
+ }
2591
+ focusOnClear() {
2592
+ this.blur();
2593
+ if (this.clearButton) {
2594
+ this.clearButton.nativeElement.focus();
2595
+ }
2596
+ }
2597
+ showNoItemsFound() {
2598
+ const empty = this.itemsList.filteredItems.length === 0;
2599
+ return (((empty && !this._isTypeahead && !this.loading) ||
2600
+ (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
2601
+ !this.showAddTag);
2602
+ }
2603
+ showTypeToSearch() {
2604
+ const empty = this.itemsList.filteredItems.length === 0;
2605
+ return empty && this._isTypeahead && !this._validTerm && !this.loading;
2606
+ }
2607
+ onCompositionStart() {
2608
+ this._isComposing = true;
2609
+ }
2610
+ onCompositionEnd(term) {
2611
+ this._isComposing = false;
2612
+ if (this.searchWhileComposing) {
2613
+ return;
2614
+ }
2615
+ this.filter(term);
2616
+ }
2617
+ filter(term) {
2618
+ if (this._isComposing && !this.searchWhileComposing) {
2619
+ return;
2620
+ }
2621
+ this.searchTerm = term;
2622
+ if (this._isTypeahead && (this._validTerm || this.minTermLength === 0)) {
2623
+ this.typeahead?.next(term);
2624
+ }
2625
+ if (!this._isTypeahead) {
2626
+ this.itemsList.filter(this.searchTerm);
2627
+ if (this.isOpen) {
2628
+ this.itemsList.markSelectedOrDefault(this.markFirst);
2629
+ }
2630
+ }
2631
+ this.searchEvent.emit({ term, items: this.itemsList.filteredItems.map(x => x.value) });
2632
+ this.open();
2633
+ }
2634
+ onInputFocus(e) {
2635
+ if (this.focused) {
2636
+ return;
2637
+ }
2638
+ if (this._editableSearchTerm) {
2639
+ this._setSearchTermFromItems();
2640
+ }
2641
+ this.element.classList.add('ng-select-focused');
2642
+ this.focusEvent.emit(e);
2643
+ this.focused = true;
2644
+ }
2645
+ onInputBlur(e) {
2646
+ this.element.classList.remove('ng-select-focused');
2647
+ this.blurEvent.emit(e);
2648
+ if (!this.isOpen && !this.disabled) {
2649
+ this._onTouched();
2650
+ }
2651
+ if (this._editableSearchTerm) {
2652
+ this._setSearchTermFromItems();
2653
+ }
2654
+ this.focused = false;
2655
+ }
2656
+ onItemHover(item) {
2657
+ if (item.disabled) {
2658
+ return;
2659
+ }
2660
+ this.itemsList.markItem(item);
2661
+ }
2662
+ detectChanges() {
2663
+ if (!this._cdr.destroyed) {
2664
+ this._cdr.detectChanges();
2665
+ }
2666
+ }
2667
+ _setSearchTermFromItems() {
2668
+ const selected = this.selectedItems?.[0];
2669
+ this.searchTerm = selected?.label ?? null;
2670
+ }
2671
+ _setItems(items) {
2672
+ const firstItem = items[0];
2673
+ this.bindLabel = this.bindLabel || this._defaultLabel;
2674
+ this._primitive = isDefined(firstItem)
2675
+ ? !isObject(firstItem)
2676
+ : this._primitive || this.bindLabel === this._defaultLabel;
2677
+ this.itemsList.setItems(items);
2678
+ if (items.length > 0 && this.hasValue) {
2679
+ this.itemsList.mapSelectedItems();
2680
+ }
2681
+ if (this.isOpen && isDefined(this.searchTerm) && !this._isTypeahead) {
2682
+ this.itemsList.filter(this.searchTerm);
2683
+ }
2684
+ if (this._isTypeahead || this.isOpen) {
2685
+ this.itemsList.markSelectedOrDefault(this.markFirst);
2686
+ }
2687
+ }
2688
+ _setItemsFromNgOptions() {
2689
+ const mapNgOptions = (options) => {
2690
+ this.items = options.map(option => ({
2691
+ $ngOptionValue: option.value,
2692
+ $ngOptionLabel: option.elementRef.nativeElement.innerHTML,
2693
+ disabled: option.disabled,
2694
+ }));
2695
+ this.itemsList.setItems(this.items);
2696
+ if (this.hasValue) {
2697
+ this.itemsList.mapSelectedItems();
2698
+ }
2699
+ this.detectChanges();
2700
+ };
2701
+ const handleOptionChange = () => {
2702
+ const changedOrDestroyed = merge(this.ngOptions.changes, this._destroy$);
2703
+ merge(...this.ngOptions.map(option => option.stateChange$))
2704
+ .pipe(takeUntil(changedOrDestroyed))
2705
+ .subscribe(option => {
2706
+ const item = this.itemsList.findItem(option.value);
2707
+ item.disabled = option.disabled;
2708
+ item.label = option.label || item.label;
2709
+ this._cdr.detectChanges();
2710
+ });
2711
+ };
2712
+ this.ngOptions.changes.pipe(startWith(this.ngOptions), takeUntil(this._destroy$)).subscribe(options => {
2713
+ this.bindLabel = this._defaultLabel;
2714
+ mapNgOptions(options);
2715
+ handleOptionChange();
2716
+ });
2717
+ }
2718
+ _isValidWriteValue(value) {
2719
+ if (!isDefined(value) ||
2720
+ (this.multiple && value === '') ||
2721
+ (Array.isArray(value) && value.length === 0)) {
2722
+ return false;
2723
+ }
2724
+ const validateBinding = (item) => {
2725
+ if (!isDefined(this.compareWith) && isObject(item) && this.bindValue) {
2726
+ console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
2727
+ return false;
2728
+ }
2729
+ return true;
2730
+ };
2731
+ if (this.multiple) {
2732
+ if (!Array.isArray(value)) {
2733
+ console.warn('Multiple select ngModel should be array.');
2734
+ return false;
2735
+ }
2736
+ return value.every(item => validateBinding(item));
2737
+ }
2738
+ else {
2739
+ return validateBinding(value);
2740
+ }
2741
+ }
2742
+ _handleWriteValue(ngModel) {
2743
+ if (!this._isValidWriteValue(ngModel)) {
2744
+ return;
2745
+ }
2746
+ const select = (val) => {
2747
+ let item = this.itemsList.findItem(val);
2748
+ if (item) {
2749
+ this.itemsList.select(item);
2750
+ }
2751
+ else {
2752
+ const isValObject = isObject(val);
2753
+ const isPrimitive = !isValObject && !this.bindValue;
2754
+ if (isValObject || isPrimitive) {
2755
+ this.itemsList.select(this.itemsList.mapItem(val, null));
2756
+ }
2757
+ else if (this.bindValue) {
2758
+ item = {
2759
+ [this.bindLabel]: null,
2760
+ [this.bindValue]: val,
2761
+ };
2762
+ this.itemsList.select(this.itemsList.mapItem(item, null));
2763
+ }
2764
+ }
2765
+ };
2766
+ if (this.multiple) {
2767
+ ngModel.forEach(item => select(item));
2768
+ }
2769
+ else {
2770
+ select(ngModel);
2771
+ }
2772
+ }
2773
+ _handleKeyPresses() {
2774
+ if (this.searchable) {
2775
+ return;
2776
+ }
2777
+ this._keyPress$
2778
+ .pipe(takeUntil(this._destroy$), tap(letter => this._pressedKeys.push(letter)), debounceTime(200), filter(() => this._pressedKeys.length > 0), map(() => this._pressedKeys.join('')))
2779
+ .subscribe(term => {
2780
+ const item = this.itemsList.findByLabel(term);
2781
+ if (item) {
2782
+ if (this.isOpen) {
2783
+ this.itemsList.markItem(item);
2784
+ this._scrollToMarked();
2785
+ this._cdr.markForCheck();
2786
+ }
2787
+ else {
2788
+ this.select(item);
2789
+ }
2790
+ }
2791
+ this._pressedKeys = [];
2792
+ });
2793
+ }
2794
+ _setInputAttributes() {
2795
+ const input = this.searchInput.nativeElement;
2796
+ const attributes = {
2797
+ 'type': 'text',
2798
+ 'autocorrect': 'off',
2799
+ 'autocapitalize': 'off',
2800
+ 'autocomplete': 'off',
2801
+ 'aria-controls': this.dropdownId,
2802
+ ...this.inputAttrs,
2803
+ };
2804
+ for (const key of Object.keys(attributes)) {
2805
+ input.setAttribute(key, attributes[key]);
2806
+ }
2807
+ }
2808
+ _setTabFocusOnClear() {
2809
+ this.tabFocusOnClear = isDefined(this.tabFocusOnClearButton)
2810
+ ? !!this.tabFocusOnClearButton
2811
+ : this._config.tabFocusOnClear;
2812
+ this._cdr.markForCheck();
2813
+ }
2814
+ _updateNgModel() {
2815
+ const model = [];
2816
+ for (const item of this.selectedItems) {
2817
+ if (this.bindValue) {
2818
+ let value = null;
2819
+ if (item.children) {
2820
+ const groupKey = this.groupValue ? this.bindValue : this.groupBy;
2821
+ value = item.value[groupKey || this.groupBy];
2822
+ }
2823
+ else {
2824
+ value = this.itemsList.resolveNested(item.value, this.bindValue);
2825
+ }
2826
+ model.push(value);
2827
+ }
2828
+ else {
2829
+ model.push(item.value);
2830
+ }
2831
+ }
2832
+ const selected = this.selectedItems.map(x => x.value);
2833
+ if (this.multiple) {
2834
+ this._onChange(model);
2835
+ this.changeEvent.emit(selected);
2836
+ }
2837
+ else {
2838
+ this._onChange(isDefined(model[0]) ? model[0] : null);
2839
+ this.changeEvent.emit(selected[0]);
2840
+ }
2841
+ this._cdr.markForCheck();
2842
+ }
2843
+ _clearSearch() {
2844
+ if (!this.searchTerm) {
2845
+ return;
2846
+ }
2847
+ this._changeSearch(null);
2848
+ this.itemsList.resetFilteredItems();
2849
+ }
2850
+ _changeSearch(searchTerm) {
2851
+ this.searchTerm = searchTerm;
2852
+ if (this._isTypeahead) {
2853
+ this.typeahead?.next(searchTerm);
2854
+ }
2855
+ }
2856
+ _scrollToMarked() {
2857
+ if (!this.isOpen || !this.dropdownPanel) {
2858
+ return;
2859
+ }
2860
+ this.dropdownPanel.scrollTo(this.itemsList.markedItem);
2861
+ }
2862
+ _scrollToTag() {
2863
+ if (!this.isOpen || !this.dropdownPanel) {
2864
+ return;
2865
+ }
2866
+ this.dropdownPanel.scrollToTag();
2867
+ }
2868
+ _onSelectionChanged() {
2869
+ if (this.isOpen && this.deselectOnClick && this.appendTo) {
2870
+ // Make sure items are rendered.
2871
+ this._cdr.detectChanges();
2872
+ this.dropdownPanel.adjustPosition();
2873
+ }
2874
+ }
2875
+ _handleTab(e) {
2876
+ if (this.isOpen === false) {
2877
+ if (this.showClear() && !e.shiftKey && this.tabFocusOnClear) {
2878
+ this.focusOnClear();
2879
+ e.preventDefault();
2880
+ }
2881
+ else if (!this.addTag) {
2882
+ return;
2883
+ }
2884
+ }
2885
+ if (this.selectOnTab) {
2886
+ if (this.itemsList.markedItem) {
2887
+ this.toggleItem(this.itemsList.markedItem);
2888
+ e.preventDefault();
2889
+ }
2890
+ else if (this.showAddTag) {
2891
+ this.selectTag();
2892
+ e.preventDefault();
2893
+ }
2894
+ else {
2895
+ this.close();
2896
+ }
2897
+ }
2898
+ else {
2899
+ this.close();
2900
+ }
2901
+ }
2902
+ _handleEnter(e) {
2903
+ if (this.isOpen || this._manualOpen) {
2904
+ if (this.itemsList.markedItem) {
2905
+ this.toggleItem(this.itemsList.markedItem);
2906
+ }
2907
+ else if (this.showAddTag) {
2908
+ this.selectTag();
2909
+ }
2910
+ }
2911
+ else if (this.openOnEnter) {
2912
+ this.open();
2913
+ }
2914
+ else {
2915
+ return;
2916
+ }
2917
+ e.preventDefault();
2918
+ }
2919
+ _handleSpace(e) {
2920
+ if (this.isOpen || this._manualOpen) {
2921
+ return;
2922
+ }
2923
+ this.open();
2924
+ e.preventDefault();
2925
+ }
2926
+ _handleArrowDown(e) {
2927
+ if (this._nextItemIsTag(+1)) {
2928
+ this.itemsList.unmarkItem();
2929
+ this._scrollToTag();
2930
+ }
2931
+ else {
2932
+ this.itemsList.markNextItem();
2933
+ this._scrollToMarked();
2934
+ }
2935
+ this.open();
2936
+ e.preventDefault();
2937
+ }
2938
+ _handleArrowUp(e) {
2939
+ if (!this.isOpen) {
2940
+ return;
2941
+ }
2942
+ if (this._nextItemIsTag(-1)) {
2943
+ this.itemsList.unmarkItem();
2944
+ this._scrollToTag();
2945
+ }
2946
+ else {
2947
+ this.itemsList.markPreviousItem();
2948
+ this._scrollToMarked();
2949
+ }
2950
+ e.preventDefault();
2951
+ }
2952
+ _nextItemIsTag(nextStep) {
2953
+ const nextIndex = this.itemsList.markedIndex + nextStep;
2954
+ return !!(this.addTag &&
2955
+ this.searchTerm &&
2956
+ this.itemsList.markedItem &&
2957
+ (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
2958
+ }
2959
+ _handleBackspace() {
2960
+ if (this.searchTerm || !this.clearable || !this.clearOnBackspace || !this.hasValue) {
2961
+ return;
2962
+ }
2963
+ if (this.multiple) {
2964
+ this.unselect(this.itemsList.lastSelectedItem);
2965
+ }
2966
+ else {
2967
+ this.clearModel();
2968
+ }
2969
+ }
2970
+ _mergeGlobalConfig() {
2971
+ this.placeholder = this.placeholder || this._config.placeholder;
2972
+ this.fixedPlaceholder = this.fixedPlaceholder || this._config.fixedPlaceholder;
2973
+ this.notFoundText = this.notFoundText || this._config.notFoundText;
2974
+ this.typeToSearchText = this.typeToSearchText || this._config.typeToSearchText;
2975
+ this.addTagText = this.addTagText || this._config.addTagText;
2976
+ this.loadingText = this.loadingText || this._config.loadingText;
2977
+ this.clearAllText = this.clearAllText || this._config.clearAllText;
2978
+ this.virtualScroll = this.getVirtualScroll(this._config);
2979
+ this.openOnEnter = isDefined(this.openOnEnter) ? this.openOnEnter : this._config.openOnEnter;
2980
+ this.appendTo = this.appendTo || this._config.appendTo;
2981
+ this.bindValue = this.bindValue || this._config.bindValue;
2982
+ this.bindLabel = this.bindLabel || this._config.bindLabel;
2983
+ this.appearance = this.appearance || this._config.appearance;
2984
+ this._setTabFocusOnClear();
2985
+ }
2986
+ /**
2987
+ * Gets virtual scroll value from input or from config
2988
+ *
2989
+ * @param config NgSelectConfig object
2990
+ *
2991
+ * @returns `true` if virtual scroll is enabled, `false` otherwise
2992
+ */
2993
+ getVirtualScroll(config) {
2994
+ return isDefined(this.virtualScroll)
2995
+ ? this.virtualScroll
2996
+ : this.isVirtualScrollDisabled(config);
2997
+ }
2998
+ /**
2999
+ * Gets disableVirtualScroll value from input or from config
3000
+ *
3001
+ * @param config NgSelectConfig object
3002
+ *
3003
+ * @returns `true` if disableVirtualScroll is enabled, `false` otherwise
3004
+ */
3005
+ isVirtualScrollDisabled(config) {
3006
+ return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
3007
+ }
3008
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3009
+ 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", 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], addTag: "addTag", addTagText: "addTagText", notFoundText: "notFoundText", preventToggleOnRightClick: "preventToggleOnRightClick", typeahead: "typeahead", typeToSearchText: "typeToSearchText", groupBy: "groupBy", groupValue: "groupValue", searchFn: "searchFn", keyDownFn: "keyDownFn", trackByFn: "trackByFn", labelForId: "labelForId", inputAttrs: "inputAttrs", appearance: "appearance", ariaLabelDropdown: "ariaLabelDropdown", ariaLabel: "ariaLabel", tabIndex: ["tabIndex", "tabIndex", numberAttribute], tabFocusOnClearButton: "tabFocusOnClearButton", 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: [
3010
+ {
3011
+ provide: NG_VALUE_ACCESSOR,
3012
+ useExisting: forwardRef(() => NgSelect),
3013
+ multi: true,
3014
+ },
3015
+ ], 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-icon\" (click)=\"unselect(item)\" aria-hidden=\"true\">\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 [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n [attr.aria-controls]=\"isOpen ? dropdownId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.id]=\"labelForId\"\n [attr.tabindex]=\"tabIndex\"\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 role=\"button\"\n [attr.tabindex]=\"tabFocusOnClear ? 0 : -1\"\n >\n <span class=\"ng-clear\" aria-hidden=\"true\">\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 ? _panelClass : null\"\n [id]=\"dropdownId\"\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 [ariaLabelDropdown]=\"ariaLabelDropdown\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit($event)\"\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-icon{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-icon{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-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-icon{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 }); }
3016
+ }
3017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelect, decorators: [{
3018
+ type: Component,
3019
+ args: [{ selector: 'ng-select', imports: [NgTemplateOutlet, NgItemLabel, NgDropdownPanel], host: {
3020
+ 'class': 'ng-select',
3021
+ '[class.ng-select-single]': '!multiple',
3022
+ '[class.ng-select-multiple]': 'multiple',
3023
+ '[class.ng-select-typeahead]': 'typeahead',
3024
+ '[class.ng-select-taggable]': 'addTag',
3025
+ '[class.ng-select-searchable]': 'searchable',
3026
+ '[class.ng-select-clearable]': 'clearable',
3027
+ '[class.ng-select-opened]': 'isOpen',
3028
+ '[class.ng-select-filtered]': 'filtered',
3029
+ '[class.ng-select-disabled]': 'disabled',
3030
+ '(keydown)': 'handleKeyDown($event)',
3031
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
3032
+ {
3033
+ provide: NG_VALUE_ACCESSOR,
3034
+ useExisting: forwardRef(() => NgSelect),
3035
+ multi: true,
3036
+ },
3037
+ ], 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-icon\" (click)=\"unselect(item)\" aria-hidden=\"true\">\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 [attr.aria-activedescendant]=\"isOpen ? itemsList.markedItem?.htmlId : null\"\n [attr.aria-controls]=\"isOpen ? dropdownId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.id]=\"labelForId\"\n [attr.tabindex]=\"tabIndex\"\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 role=\"button\"\n [attr.tabindex]=\"tabFocusOnClear ? 0 : -1\"\n >\n <span class=\"ng-clear\" aria-hidden=\"true\">\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 ? _panelClass : null\"\n [id]=\"dropdownId\"\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 [ariaLabelDropdown]=\"ariaLabelDropdown\"\n (update)=\"viewPortItems = $event\"\n (scroll)=\"scroll.emit($event)\"\n (scrollToEnd)=\"scrollToEnd.emit($event)\"\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-icon{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-icon{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-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-value-disabled .ng-value-icon{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"] }]
3038
+ }], ctorParameters: () => [], propDecorators: { bindLabel: [{
3039
+ type: Input
3040
+ }], bindValue: [{
3041
+ type: Input
3042
+ }], placeholder: [{
3043
+ type: Input
3044
+ }], fixedPlaceholder: [{
3045
+ type: Input
3046
+ }], appendTo: [{
3047
+ type: Input
3048
+ }], dropdownPosition: [{
3049
+ type: Input
3050
+ }], readonly: [{
3051
+ type: Input,
3052
+ args: [{ transform: booleanAttribute }]
3053
+ }], multiple: [{
3054
+ type: Input,
3055
+ args: [{ transform: booleanAttribute }]
3056
+ }], searchable: [{
3057
+ type: Input,
3058
+ args: [{ transform: booleanAttribute }]
3059
+ }], clearable: [{
3060
+ type: Input,
3061
+ args: [{ transform: booleanAttribute }]
3062
+ }], clearAllText: [{
3063
+ type: Input
3064
+ }], loading: [{
3065
+ type: Input,
3066
+ args: [{ transform: booleanAttribute }]
3067
+ }], loadingText: [{
3068
+ type: Input
3069
+ }], closeOnSelect: [{
3070
+ type: Input,
3071
+ args: [{ transform: booleanAttribute }]
3072
+ }], clearOnBackspace: [{
3073
+ type: Input,
3074
+ args: [{ transform: booleanAttribute }]
3075
+ }], hideSelected: [{
3076
+ type: Input,
3077
+ args: [{ transform: booleanAttribute }]
3078
+ }], selectOnTab: [{
3079
+ type: Input,
3080
+ args: [{ transform: booleanAttribute }]
3081
+ }], openOnEnter: [{
3082
+ type: Input,
3083
+ args: [{ transform: booleanAttribute }]
3084
+ }], virtualScroll: [{
3085
+ type: Input,
3086
+ args: [{ transform: booleanAttribute }]
3087
+ }], bufferAmount: [{
3088
+ type: Input,
3089
+ args: [{ transform: numberAttribute }]
3090
+ }], selectableGroup: [{
3091
+ type: Input,
3092
+ args: [{ transform: booleanAttribute }]
3093
+ }], selectableGroupAsModel: [{
3094
+ type: Input,
3095
+ args: [{ transform: booleanAttribute }]
3096
+ }], searchWhileComposing: [{
3097
+ type: Input,
3098
+ args: [{ transform: booleanAttribute }]
3099
+ }], editableSearchTerm: [{
3100
+ type: Input,
3101
+ args: [{ transform: booleanAttribute }]
3102
+ }], maxSelectedItems: [{
3103
+ type: Input,
3104
+ args: [{ transform: numberAttribute }]
3105
+ }], minTermLength: [{
3106
+ type: Input,
3107
+ args: [{ transform: numberAttribute }]
3108
+ }], markFirst: [{
3109
+ type: Input,
3110
+ args: [{ transform: booleanAttribute }]
3111
+ }], addTag: [{
3112
+ type: Input
3113
+ }], addTagText: [{
3114
+ type: Input
3115
+ }], notFoundText: [{
3116
+ type: Input
3117
+ }], preventToggleOnRightClick: [{
3118
+ type: Input
3119
+ }], typeahead: [{
3120
+ type: Input
3121
+ }], typeToSearchText: [{
3122
+ type: Input
3123
+ }], groupBy: [{
3124
+ type: Input
3125
+ }], groupValue: [{
3126
+ type: Input
3127
+ }], searchFn: [{
3128
+ type: Input
3129
+ }], keyDownFn: [{
3130
+ type: Input
3131
+ }], trackByFn: [{
3132
+ type: Input
3133
+ }], labelForId: [{
3134
+ type: Input
3135
+ }], inputAttrs: [{
3136
+ type: Input
3137
+ }], appearance: [{
3138
+ type: Input
3139
+ }], ariaLabelDropdown: [{
3140
+ type: Input
3141
+ }], ariaLabel: [{
3142
+ type: Input
3143
+ }], tabIndex: [{
3144
+ type: Input,
3145
+ args: [{ transform: numberAttribute }]
3146
+ }], tabFocusOnClearButton: [{
3147
+ type: Input
3148
+ }], isOpen: [{
3149
+ type: Input
3150
+ }], panelClass: [{
3151
+ type: Input
3152
+ }], items: [{
3153
+ type: Input
3154
+ }], compareWith: [{
3155
+ type: Input
3156
+ }], clearSearchOnAdd: [{
3157
+ type: Input
3158
+ }], deselectOnClick: [{
3159
+ type: Input
3160
+ }], blurEvent: [{
3161
+ type: Output,
3162
+ args: ['blur']
3163
+ }], focusEvent: [{
3164
+ type: Output,
3165
+ args: ['focus']
3166
+ }], changeEvent: [{
3167
+ type: Output,
3168
+ args: ['change']
3169
+ }], openEvent: [{
3170
+ type: Output,
3171
+ args: ['open']
3172
+ }], closeEvent: [{
3173
+ type: Output,
3174
+ args: ['close']
3175
+ }], searchEvent: [{
3176
+ type: Output,
3177
+ args: ['search']
3178
+ }], clearEvent: [{
3179
+ type: Output,
3180
+ args: ['clear']
3181
+ }], addEvent: [{
3182
+ type: Output,
3183
+ args: ['add']
3184
+ }], removeEvent: [{
3185
+ type: Output,
3186
+ args: ['remove']
3187
+ }], scroll: [{
3188
+ type: Output
3189
+ }], scrollToEnd: [{
3190
+ type: Output
3191
+ }], dropdownPanel: [{
3192
+ type: ViewChild,
3193
+ args: [forwardRef(() => NgDropdownPanel)]
3194
+ }], searchInput: [{
3195
+ type: ViewChild,
3196
+ args: ['searchInput', { static: true }]
3197
+ }], clearButton: [{
3198
+ type: ViewChild,
3199
+ args: ['clearButton']
3200
+ }], ngOptions: [{
3201
+ type: ContentChildren,
3202
+ args: [NgOption, { descendants: true }]
3203
+ }], optionTemplate: [{
3204
+ type: ContentChild,
3205
+ args: [NgOptionTemplate, { read: TemplateRef }]
3206
+ }], optgroupTemplate: [{
3207
+ type: ContentChild,
3208
+ args: [NgOptgroupTemplate, { read: TemplateRef }]
3209
+ }], labelTemplate: [{
3210
+ type: ContentChild,
3211
+ args: [NgLabelTemplate, { read: TemplateRef }]
3212
+ }], multiLabelTemplate: [{
3213
+ type: ContentChild,
3214
+ args: [NgMultiLabelTemplate, { read: TemplateRef }]
3215
+ }], headerTemplate: [{
3216
+ type: ContentChild,
3217
+ args: [NgHeaderTemplate, { read: TemplateRef }]
3218
+ }], footerTemplate: [{
3219
+ type: ContentChild,
3220
+ args: [NgFooterTemplate, { read: TemplateRef }]
3221
+ }], notFoundTemplate: [{
3222
+ type: ContentChild,
3223
+ args: [NgNotFoundTemplate, { read: TemplateRef }]
3224
+ }], placeholderTemplate: [{
3225
+ type: ContentChild,
3226
+ args: [NgPlaceholderTemplate, { read: TemplateRef }]
3227
+ }], typeToSearchTemplate: [{
3228
+ type: ContentChild,
3229
+ args: [NgTypeToSearchTemplate, { read: TemplateRef }]
3230
+ }], loadingTextTemplate: [{
3231
+ type: ContentChild,
3232
+ args: [NgLoadingTextTemplate, { read: TemplateRef }]
3233
+ }], tagTemplate: [{
3234
+ type: ContentChild,
3235
+ args: [NgTagTemplate, { read: TemplateRef }]
3236
+ }], loadingSpinnerTemplate: [{
3237
+ type: ContentChild,
3238
+ args: [NgLoadingSpinnerTemplate, { read: TemplateRef }]
3239
+ }], clearButtonTemplate: [{
3240
+ type: ContentChild,
3241
+ args: [NgClearButtonTemplate, { read: TemplateRef }]
3242
+ }] } });
3243
+
3244
+ class NgSelectModule {
3245
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3246
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: NgSelectModule, imports: [NgDropdownPanel,
3247
+ NgOption,
3248
+ NgSelect,
3249
+ NgOptgroupTemplate,
3250
+ NgOptionTemplate,
3251
+ NgLabelTemplate,
3252
+ NgMultiLabelTemplate,
3253
+ NgHeaderTemplate,
3254
+ NgFooterTemplate,
3255
+ NgPlaceholderTemplate,
3256
+ NgClearButtonTemplate,
3257
+ NgNotFoundTemplate,
3258
+ NgTypeToSearchTemplate,
3259
+ NgLoadingTextTemplate,
3260
+ NgTagTemplate,
3261
+ NgLoadingSpinnerTemplate,
3262
+ NgItemLabel], exports: [NgSelect,
3263
+ NgOption,
3264
+ NgOptgroupTemplate,
3265
+ NgOptionTemplate,
3266
+ NgLabelTemplate,
3267
+ NgMultiLabelTemplate,
3268
+ NgHeaderTemplate,
3269
+ NgFooterTemplate,
3270
+ NgPlaceholderTemplate,
3271
+ NgNotFoundTemplate,
3272
+ NgTypeToSearchTemplate,
3273
+ NgLoadingTextTemplate,
3274
+ NgTagTemplate,
3275
+ NgLoadingSpinnerTemplate,
3276
+ NgClearButtonTemplate] }); }
3277
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectModule, providers: [
3278
+ {
3279
+ provide: SELECTION_MODEL_FACTORY,
3280
+ useValue: DefaultSelectionModelFactory,
3281
+ },
3282
+ ] }); }
3283
+ }
3284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgSelectModule, decorators: [{
3285
+ type: NgModule,
3286
+ args: [{
3287
+ imports: [
3288
+ NgDropdownPanel,
3289
+ NgOption,
3290
+ NgSelect,
3291
+ NgOptgroupTemplate,
3292
+ NgOptionTemplate,
3293
+ NgLabelTemplate,
3294
+ NgMultiLabelTemplate,
3295
+ NgHeaderTemplate,
3296
+ NgFooterTemplate,
3297
+ NgPlaceholderTemplate,
3298
+ NgClearButtonTemplate,
3299
+ NgNotFoundTemplate,
3300
+ NgTypeToSearchTemplate,
3301
+ NgLoadingTextTemplate,
3302
+ NgTagTemplate,
3303
+ NgLoadingSpinnerTemplate,
3304
+ NgItemLabel,
3305
+ ],
3306
+ exports: [
3307
+ NgSelect,
3308
+ NgOption,
3309
+ NgOptgroupTemplate,
3310
+ NgOptionTemplate,
3311
+ NgLabelTemplate,
3312
+ NgMultiLabelTemplate,
3313
+ NgHeaderTemplate,
3314
+ NgFooterTemplate,
3315
+ NgPlaceholderTemplate,
3316
+ NgNotFoundTemplate,
3317
+ NgTypeToSearchTemplate,
3318
+ NgLoadingTextTemplate,
3319
+ NgTagTemplate,
3320
+ NgLoadingSpinnerTemplate,
3321
+ NgClearButtonTemplate,
3322
+ ],
3323
+ providers: [
3324
+ {
3325
+ provide: SELECTION_MODEL_FACTORY,
3326
+ useValue: DefaultSelectionModelFactory,
3327
+ },
3328
+ ],
3329
+ }]
3330
+ }] });
3331
+
3332
+ /*
3333
+ * Public API Surface of ng-select
3334
+ */
3335
+
3336
+ /**
3337
+ * Generated bundle index. Do not edit.
3338
+ */
3339
+
3340
+ export { DefaultSelectionModel, DefaultSelectionModelFactory, NgClearButtonTemplate, NgDropdownPanel, NgDropdownPanelUtils, NgFooterTemplate, NgHeaderTemplate, NgItemLabel, NgLabelTemplate, NgLoadingSpinnerTemplate, NgLoadingTextTemplate, NgMultiLabelTemplate, NgNotFoundTemplate, NgOptgroupTemplate, NgOption, NgOptionHighlight, NgOptionTemplate, NgPlaceholderTemplate, NgSelect, NgSelectConfig, NgSelectModule, NgTagTemplate, NgTypeToSearchTemplate, SELECTION_MODEL_FACTORY };
3341
+ //# sourceMappingURL=ng-matero-ng-select.mjs.map