@ng-select/ng-select 20.1.3 → 20.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, Directive, Injectable, input, EventEmitter, DOCUMENT, ElementRef, booleanAttribute, ViewChild, Output, Optional, Inject, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, signal, TemplateRef, forwardRef, numberAttribute, HostListener, HostBinding, ContentChildren, ContentChild, Attribute, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, input, effect, Directive, TemplateRef, Injectable, Renderer2, NgZone, booleanAttribute, output, viewChild, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, afterNextRender, InjectionToken, HostAttributeToken, ChangeDetectorRef, numberAttribute, model, contentChild, forwardRef, contentChildren, HostListener, NgModule } from '@angular/core';
3
3
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
4
  import { animationFrameScheduler, asapScheduler, Subject, fromEvent, merge } from 'rxjs';
5
- import { takeUntil, auditTime, startWith, tap, debounceTime, filter, map } from 'rxjs/operators';
6
- import { NgTemplateOutlet, NgClass } from '@angular/common';
5
+ import { takeUntil, auditTime, tap, startWith, switchMap, debounceTime, filter, map } from 'rxjs/operators';
6
+ import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
7
+ import { toObservable } from '@angular/core/rxjs-interop';
7
8
 
8
9
  const unescapedHTMLExp = /[&<>"']/g;
9
10
  const hasUnescapedHTMLExp = RegExp(unescapedHTMLExp.source);
@@ -31,15 +32,18 @@ function isFunction(value) {
31
32
  }
32
33
 
33
34
  class NgItemLabelDirective {
34
- constructor(element) {
35
- this.element = element;
36
- this.escape = true;
37
- }
38
- ngOnChanges(changes) {
39
- this.element.nativeElement.innerHTML = this.escape ? escapeHTML(this.ngItemLabel) : this.ngItemLabel;
35
+ constructor() {
36
+ this.element = inject(ElementRef);
37
+ this.ngItemLabel = input();
38
+ this.escape = input(true);
39
+ effect(() => {
40
+ this.element.nativeElement.innerHTML = this.escape()
41
+ ? escapeHTML(this.ngItemLabel())
42
+ : this.ngItemLabel();
43
+ });
40
44
  }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
42
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgItemLabelDirective, isStandalone: true, selector: "[ngItemLabel]", inputs: { ngItemLabel: "ngItemLabel", escape: "escape" }, usesOnChanges: true, ngImport: i0 }); }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: NgItemLabelDirective, isStandalone: true, selector: "[ngItemLabel]", inputs: { ngItemLabel: { classPropertyName: "ngItemLabel", publicName: "ngItemLabel", isSignal: true, isRequired: false, transformFunction: null }, escape: { classPropertyName: "escape", publicName: "escape", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
43
47
  }
44
48
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, decorators: [{
45
49
  type: Directive,
@@ -47,16 +51,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
47
51
  selector: '[ngItemLabel]',
48
52
  standalone: true,
49
53
  }]
50
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ngItemLabel: [{
51
- type: Input
52
- }], escape: [{
53
- type: Input
54
- }] } });
54
+ }], ctorParameters: () => [] });
55
55
  class NgOptionTemplateDirective {
56
- constructor(template) {
57
- this.template = template;
56
+ constructor() {
57
+ this.template = inject((TemplateRef));
58
58
  }
59
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
60
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgOptionTemplateDirective, isStandalone: true, selector: "[ng-option-tmp]", ngImport: i0 }); }
61
61
  }
62
62
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, decorators: [{
@@ -66,12 +66,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
66
66
  selector: '[ng-option-tmp]',
67
67
  standalone: true,
68
68
  }]
69
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
69
+ }] });
70
70
  class NgOptgroupTemplateDirective {
71
- constructor(template) {
72
- this.template = template;
71
+ constructor() {
72
+ this.template = inject((TemplateRef));
73
73
  }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
74
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
75
75
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgOptgroupTemplateDirective, isStandalone: true, selector: "[ng-optgroup-tmp]", ngImport: i0 }); }
76
76
  }
77
77
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, decorators: [{
@@ -81,12 +81,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
81
81
  selector: '[ng-optgroup-tmp]',
82
82
  standalone: true,
83
83
  }]
84
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
84
+ }] });
85
85
  class NgLabelTemplateDirective {
86
- constructor(template) {
87
- this.template = template;
86
+ constructor() {
87
+ this.template = inject((TemplateRef));
88
88
  }
89
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
90
90
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLabelTemplateDirective, isStandalone: true, selector: "[ng-label-tmp]", ngImport: i0 }); }
91
91
  }
92
92
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, decorators: [{
@@ -96,12 +96,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
96
96
  selector: '[ng-label-tmp]',
97
97
  standalone: true,
98
98
  }]
99
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
99
+ }] });
100
100
  class NgMultiLabelTemplateDirective {
101
- constructor(template) {
102
- this.template = template;
101
+ constructor() {
102
+ this.template = inject((TemplateRef));
103
103
  }
104
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
105
105
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgMultiLabelTemplateDirective, isStandalone: true, selector: "[ng-multi-label-tmp]", ngImport: i0 }); }
106
106
  }
107
107
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, decorators: [{
@@ -111,12 +111,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
111
111
  selector: '[ng-multi-label-tmp]',
112
112
  standalone: true,
113
113
  }]
114
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
114
+ }] });
115
115
  class NgHeaderTemplateDirective {
116
- constructor(template) {
117
- this.template = template;
116
+ constructor() {
117
+ this.template = inject((TemplateRef));
118
118
  }
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
120
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgHeaderTemplateDirective, isStandalone: true, selector: "[ng-header-tmp]", ngImport: i0 }); }
121
121
  }
122
122
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, decorators: [{
@@ -126,12 +126,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
126
126
  selector: '[ng-header-tmp]',
127
127
  standalone: true,
128
128
  }]
129
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
129
+ }] });
130
130
  class NgFooterTemplateDirective {
131
- constructor(template) {
132
- this.template = template;
131
+ constructor() {
132
+ this.template = inject((TemplateRef));
133
133
  }
134
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
134
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
135
135
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgFooterTemplateDirective, isStandalone: true, selector: "[ng-footer-tmp]", ngImport: i0 }); }
136
136
  }
137
137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, decorators: [{
@@ -141,12 +141,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
141
141
  selector: '[ng-footer-tmp]',
142
142
  standalone: true,
143
143
  }]
144
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
144
+ }] });
145
145
  class NgNotFoundTemplateDirective {
146
- constructor(template) {
147
- this.template = template;
146
+ constructor() {
147
+ this.template = inject((TemplateRef));
148
148
  }
149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
149
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
150
150
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgNotFoundTemplateDirective, isStandalone: true, selector: "[ng-notfound-tmp]", ngImport: i0 }); }
151
151
  }
152
152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, decorators: [{
@@ -156,12 +156,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
156
156
  selector: '[ng-notfound-tmp]',
157
157
  standalone: true,
158
158
  }]
159
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
159
+ }] });
160
160
  class NgPlaceholderTemplateDirective {
161
- constructor(template) {
162
- this.template = template;
161
+ constructor() {
162
+ this.template = inject((TemplateRef));
163
163
  }
164
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
164
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
165
165
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgPlaceholderTemplateDirective, isStandalone: true, selector: "[ng-placeholder-tmp]", ngImport: i0 }); }
166
166
  }
167
167
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, decorators: [{
@@ -171,12 +171,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
171
171
  selector: '[ng-placeholder-tmp]',
172
172
  standalone: true,
173
173
  }]
174
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
174
+ }] });
175
175
  class NgTypeToSearchTemplateDirective {
176
- constructor(template) {
177
- this.template = template;
176
+ constructor() {
177
+ this.template = inject((TemplateRef));
178
178
  }
179
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
179
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
180
180
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgTypeToSearchTemplateDirective, isStandalone: true, selector: "[ng-typetosearch-tmp]", ngImport: i0 }); }
181
181
  }
182
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, decorators: [{
@@ -186,12 +186,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
186
186
  selector: '[ng-typetosearch-tmp]',
187
187
  standalone: true,
188
188
  }]
189
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
189
+ }] });
190
190
  class NgLoadingTextTemplateDirective {
191
- constructor(template) {
192
- this.template = template;
191
+ constructor() {
192
+ this.template = inject((TemplateRef));
193
193
  }
194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
194
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
195
195
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLoadingTextTemplateDirective, isStandalone: true, selector: "[ng-loadingtext-tmp]", ngImport: i0 }); }
196
196
  }
197
197
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, decorators: [{
@@ -201,12 +201,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
201
201
  selector: '[ng-loadingtext-tmp]',
202
202
  standalone: true,
203
203
  }]
204
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
204
+ }] });
205
205
  class NgTagTemplateDirective {
206
- constructor(template) {
207
- this.template = template;
206
+ constructor() {
207
+ this.template = inject((TemplateRef));
208
208
  }
209
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
209
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
210
210
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgTagTemplateDirective, isStandalone: true, selector: "[ng-tag-tmp]", ngImport: i0 }); }
211
211
  }
212
212
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, decorators: [{
@@ -216,12 +216,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
216
216
  selector: '[ng-tag-tmp]',
217
217
  standalone: true,
218
218
  }]
219
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
219
+ }] });
220
220
  class NgLoadingSpinnerTemplateDirective {
221
- constructor(template) {
222
- this.template = template;
221
+ constructor() {
222
+ this.template = inject((TemplateRef));
223
223
  }
224
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
224
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
225
225
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLoadingSpinnerTemplateDirective, isStandalone: true, selector: "[ng-loadingspinner-tmp]", ngImport: i0 }); }
226
226
  }
227
227
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, decorators: [{
@@ -231,19 +231,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
231
231
  selector: '[ng-loadingspinner-tmp]',
232
232
  standalone: true,
233
233
  }]
234
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
234
+ }] });
235
235
  // eslint-disable-next-line @angular-eslint/directive-selector
236
236
  class NgClearButtonTemplateDirective {
237
- constructor(template) {
238
- this.template = template;
237
+ constructor() {
238
+ this.template = inject((TemplateRef));
239
239
  }
240
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
240
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
241
241
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgClearButtonTemplateDirective, isStandalone: true, selector: "[ng-clearbutton-tmp]", ngImport: i0 }); }
242
242
  }
243
243
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, decorators: [{
244
244
  type: Directive,
245
245
  args: [{ selector: '[ng-clearbutton-tmp]', standalone: true }]
246
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
246
+ }] });
247
+
248
+ class NgSelectConfig {
249
+ constructor() {
250
+ this.fixedPlaceholder = true;
251
+ this.notFoundText = 'No items found';
252
+ this.typeToSearchText = 'Type to search';
253
+ this.addTagText = 'Add item';
254
+ this.loadingText = 'Loading...';
255
+ this.clearAllText = 'Clear all';
256
+ this.disableVirtualScroll = true;
257
+ this.openOnEnter = true;
258
+ this.appearance = 'underline';
259
+ this.tabFocusOnClear = true;
260
+ }
261
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
262
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
263
+ }
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, decorators: [{
265
+ type: Injectable,
266
+ args: [{ providedIn: 'root' }]
267
+ }] });
268
+
269
+ class ConsoleService {
270
+ warn(message) {
271
+ console.warn(message);
272
+ }
273
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
274
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, providedIn: 'root' }); }
275
+ }
276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, decorators: [{
277
+ type: Injectable,
278
+ args: [{ providedIn: 'root' }]
279
+ }] });
247
280
 
248
281
  function newId() {
249
282
  // First character is an 'a', it's good practice to tag id to begin with a letter
@@ -1124,10 +1157,10 @@ class ItemsList {
1124
1157
  return this._filteredItems[this._markedIndex];
1125
1158
  }
1126
1159
  get noItemsToSelect() {
1127
- return this._ngSelect.hideSelected && this._items.length === this.selectedItems.length;
1160
+ return this._ngSelect.hideSelected() && this._items.length === this.selectedItems.length;
1128
1161
  }
1129
1162
  get maxItemsSelected() {
1130
- return this._ngSelect.multiple && this._ngSelect.maxSelectedItems <= this.selectedItems.length;
1163
+ return this._ngSelect.multiple() && this._ngSelect.maxSelectedItems() <= this.selectedItems.length;
1131
1164
  }
1132
1165
  get lastSelectedItem() {
1133
1166
  let i = this.selectedItems.length - 1;
@@ -1141,8 +1174,9 @@ class ItemsList {
1141
1174
  }
1142
1175
  setItems(items) {
1143
1176
  this._items = items.map((item, index) => this.mapItem(item, index));
1144
- if (this._ngSelect.groupBy) {
1145
- this._groups = this._groupBy(this._items, this._ngSelect.groupBy);
1177
+ const groupBy = this._ngSelect.groupBy();
1178
+ if (groupBy) {
1179
+ this._groups = this._groupBy(this._items, groupBy);
1146
1180
  this._items = this._flatten(this._groups);
1147
1181
  }
1148
1182
  else {
@@ -1155,12 +1189,12 @@ class ItemsList {
1155
1189
  if (item.selected || this.maxItemsSelected) {
1156
1190
  return;
1157
1191
  }
1158
- const multiple = this._ngSelect.multiple;
1192
+ const multiple = this._ngSelect.multiple();
1159
1193
  if (!multiple) {
1160
1194
  this.clearSelected();
1161
1195
  }
1162
- this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel);
1163
- if (this._ngSelect.hideSelected) {
1196
+ this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel());
1197
+ if (this._ngSelect.hideSelected()) {
1164
1198
  this._hideSelected(item);
1165
1199
  }
1166
1200
  }
@@ -1168,21 +1202,22 @@ class ItemsList {
1168
1202
  if (!item.selected) {
1169
1203
  return;
1170
1204
  }
1171
- this._selectionModel.unselect(item, this._ngSelect.multiple);
1172
- if (this._ngSelect.hideSelected && isDefined(item.index) && this._ngSelect.multiple) {
1205
+ const multiple = this._ngSelect.multiple();
1206
+ this._selectionModel.unselect(item, multiple);
1207
+ if (this._ngSelect.hideSelected() && isDefined(item.index) && multiple) {
1173
1208
  this._showSelected(item);
1174
1209
  }
1175
1210
  }
1176
1211
  findItem(value) {
1177
1212
  let findBy;
1178
- if (this._ngSelect.compareWith) {
1179
- findBy = (item) => this._ngSelect.compareWith(item.value, value);
1213
+ if (this._ngSelect.compareWith()) {
1214
+ findBy = (item) => this._ngSelect.compareWith()(item.value, value);
1180
1215
  }
1181
- else if (this._ngSelect.bindValue) {
1182
- findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue) === value;
1216
+ else if (this._ngSelect.bindValue()) {
1217
+ findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue()) === value;
1183
1218
  }
1184
1219
  else {
1185
- findBy = (item) => item.value === value || (!item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel));
1220
+ findBy = (item) => item.value === value || (!item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel()));
1186
1221
  }
1187
1222
  return this._items.find((item) => findBy(item));
1188
1223
  }
@@ -1198,7 +1233,7 @@ class ItemsList {
1198
1233
  item.selected = keepDisabled && item.selected && item.disabled;
1199
1234
  item.marked = false;
1200
1235
  });
1201
- if (this._ngSelect.hideSelected) {
1236
+ if (this._ngSelect.hideSelected()) {
1202
1237
  this.resetFilteredItems();
1203
1238
  }
1204
1239
  }
@@ -1215,16 +1250,16 @@ class ItemsList {
1215
1250
  return;
1216
1251
  }
1217
1252
  this._filteredItems = [];
1218
- term = this._ngSelect.searchFn ? term : stripSpecialChars(term).toLocaleLowerCase();
1219
- const match = this._ngSelect.searchFn || this._defaultSearchFn;
1220
- const hideSelected = this._ngSelect.hideSelected;
1253
+ term = this._ngSelect.searchFn() ? term : stripSpecialChars(term).toLocaleLowerCase();
1254
+ const match = this._ngSelect.searchFn() || this._defaultSearchFn;
1255
+ const hideSelected = this._ngSelect.hideSelected();
1221
1256
  for (const key of Array.from(this._groups.keys())) {
1222
1257
  const matchedItems = [];
1223
1258
  for (const item of this._groups.get(key)) {
1224
1259
  if (hideSelected && ((item.parent && item.parent.selected) || item.selected)) {
1225
1260
  continue;
1226
1261
  }
1227
- const searchItem = this._ngSelect.searchFn ? item.value : item;
1262
+ const searchItem = this._ngSelect.searchFn() ? item.value : item;
1228
1263
  if (match(term, searchItem)) {
1229
1264
  matchedItems.push(item);
1230
1265
  }
@@ -1243,7 +1278,7 @@ class ItemsList {
1243
1278
  if (this._filteredItems.length === this._items.length) {
1244
1279
  return;
1245
1280
  }
1246
- if (this._ngSelect.hideSelected && this.selectedItems.length > 0) {
1281
+ if (this._ngSelect.hideSelected() && this.selectedItems.length > 0) {
1247
1282
  this._filteredItems = this._items.filter((x) => !x.selected);
1248
1283
  }
1249
1284
  else {
@@ -1294,7 +1329,7 @@ class ItemsList {
1294
1329
  }
1295
1330
  }
1296
1331
  mapItem(item, index) {
1297
- const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel);
1332
+ const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel());
1298
1333
  const value = isDefined(item.$ngOptionValue) ? item.$ngOptionValue : item;
1299
1334
  return {
1300
1335
  index,
@@ -1305,21 +1340,22 @@ class ItemsList {
1305
1340
  };
1306
1341
  }
1307
1342
  mapSelectedItems() {
1308
- const multiple = this._ngSelect.multiple;
1343
+ const multiple = this._ngSelect.multiple();
1309
1344
  for (const selected of this.selectedItems) {
1345
+ const bindValue = this._ngSelect.bindValue();
1310
1346
  let item = null;
1311
1347
  // When compareWith is used, we need to find the item using the original selected value rather than the extracted bindValue, since compareWith expects to compare against the original value
1312
- if (this._ngSelect.compareWith) {
1313
- item = this._items.find((item) => this._ngSelect.compareWith(item.value, selected.value));
1348
+ if (this._ngSelect.compareWith()) {
1349
+ item = this._items.find((item) => this._ngSelect.compareWith()(item.value, selected.value));
1314
1350
  }
1315
1351
  else {
1316
- const value = this._ngSelect.bindValue ? this.resolveNested(selected.value, this._ngSelect.bindValue) : selected.value;
1352
+ const value = bindValue ? this.resolveNested(selected.value, bindValue) : selected.value;
1317
1353
  item = isDefined(value) ? this.findItem(value) : null;
1318
1354
  }
1319
1355
  this._selectionModel.unselect(selected, multiple);
1320
- this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel);
1356
+ this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel());
1321
1357
  }
1322
- if (this._ngSelect.hideSelected) {
1358
+ if (this._ngSelect.hideSelected()) {
1323
1359
  this._filteredItems = this.filteredItems.filter((x) => this.selectedItems.indexOf(x) === -1);
1324
1360
  }
1325
1361
  }
@@ -1372,7 +1408,7 @@ class ItemsList {
1372
1408
  }
1373
1409
  }
1374
1410
  _getLastMarkedIndex() {
1375
- if (this._ngSelect.hideSelected) {
1411
+ if (this._ngSelect.hideSelected()) {
1376
1412
  return -1;
1377
1413
  }
1378
1414
  if (this._markedIndex > -1 && this.markedItem === undefined) {
@@ -1397,7 +1433,7 @@ class ItemsList {
1397
1433
  }
1398
1434
  return groups;
1399
1435
  }
1400
- const isFnKey = isFunction(this._ngSelect.groupBy);
1436
+ const isFnKey = isFunction(this._ngSelect.groupBy());
1401
1437
  const keyFn = (item) => {
1402
1438
  const key = isFnKey ? prop(item.value) : item.value[prop];
1403
1439
  return isDefined(key) ? key : undefined;
@@ -1416,7 +1452,7 @@ class ItemsList {
1416
1452
  return groups;
1417
1453
  }
1418
1454
  _flatten(groups) {
1419
- const isGroupByFn = isFunction(this._ngSelect.groupBy);
1455
+ const isGroupByFn = isFunction(this._ngSelect.groupBy());
1420
1456
  const items = [];
1421
1457
  for (const key of Array.from(groups.keys())) {
1422
1458
  let i = items.length;
@@ -1434,11 +1470,11 @@ class ItemsList {
1434
1470
  children: undefined,
1435
1471
  parent: null,
1436
1472
  index: i++,
1437
- disabled: !this._ngSelect.selectableGroup,
1473
+ disabled: !this._ngSelect.selectableGroup(),
1438
1474
  htmlId: newId(),
1439
1475
  };
1440
- const groupKey = isGroupByFn ? this._ngSelect.bindLabel : this._ngSelect.groupBy;
1441
- const groupValue = this._ngSelect.groupValue ||
1476
+ const groupKey = isGroupByFn ? this._ngSelect.bindLabel() : this._ngSelect.groupBy();
1477
+ const groupValue = this._ngSelect.groupValue() ||
1442
1478
  (() => {
1443
1479
  if (isObjectKey) {
1444
1480
  return key.value;
@@ -1529,25 +1565,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
1529
1565
  const CSS_POSITIONS = ['top', 'right', 'bottom', 'left'];
1530
1566
  const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
1531
1567
  class NgDropdownPanelComponent {
1532
- constructor(_renderer, _zone, _panelService, _elementRef, _document) {
1533
- this._renderer = _renderer;
1534
- this._zone = _zone;
1535
- this._panelService = _panelService;
1536
- this._document = _document;
1537
- this.items = [];
1538
- this.position = 'auto';
1539
- this.virtualScroll = false;
1540
- this.filterValue = null;
1568
+ constructor() {
1569
+ this._renderer = inject(Renderer2);
1570
+ this._zone = inject(NgZone);
1571
+ this._panelService = inject(NgDropdownPanelService);
1572
+ this._document = inject(DOCUMENT, { optional: true });
1573
+ this._dropdown = inject((ElementRef)).nativeElement;
1574
+ this.items = input([]);
1575
+ this.markedItem = input(undefined);
1576
+ this.position = input('auto');
1577
+ this.appendTo = input(undefined);
1578
+ this.bufferAmount = input(undefined);
1579
+ this.virtualScroll = input(false, { transform: booleanAttribute });
1580
+ this.headerTemplate = input(undefined);
1581
+ this.footerTemplate = input(undefined);
1582
+ this.filterValue = input(null);
1541
1583
  this.ariaLabelDropdown = input(null);
1542
- this.update = new EventEmitter();
1543
- this.scroll = new EventEmitter();
1544
- this.scrollToEnd = new EventEmitter();
1545
- this.outsideClick = new EventEmitter();
1584
+ this.update = output();
1585
+ this.scroll = output();
1586
+ this.scrollToEnd = output();
1587
+ this.outsideClick = output();
1588
+ this.contentElementRef = viewChild('content', { read: ElementRef });
1589
+ this.scrollElementRef = viewChild('scroll', { read: ElementRef });
1590
+ this.paddingElementRef = viewChild('padding', { read: ElementRef });
1546
1591
  this._destroy$ = new Subject();
1592
+ this._virtualPadding = computed(() => this.paddingElementRef()?.nativeElement);
1593
+ this._scrollablePanel = computed(() => this.scrollElementRef()?.nativeElement);
1594
+ this._contentPanel = computed(() => this.contentElementRef()?.nativeElement);
1547
1595
  this._scrollToEndFired = false;
1548
1596
  this._updateScrollHeight = false;
1549
1597
  this._lastScrollPosition = 0;
1550
- this._dropdown = _elementRef.nativeElement;
1551
1598
  }
1552
1599
  get currentPosition() {
1553
1600
  return this._currentPosition;
@@ -1562,18 +1609,15 @@ class NgDropdownPanelComponent {
1562
1609
  }
1563
1610
  }
1564
1611
  get _startOffset() {
1565
- if (this.markedItem) {
1612
+ if (this.markedItem()) {
1566
1613
  const { itemHeight, panelHeight } = this._panelService.dimensions;
1567
- const offset = this.markedItem.index * itemHeight;
1614
+ const offset = this.markedItem().index * itemHeight;
1568
1615
  return panelHeight > offset ? 0 : offset;
1569
1616
  }
1570
1617
  return 0;
1571
1618
  }
1572
1619
  ngOnInit() {
1573
1620
  this._select = this._dropdown.parentElement;
1574
- this._virtualPadding = this.paddingElementRef.nativeElement;
1575
- this._scrollablePanel = this.scrollElementRef.nativeElement;
1576
- this._contentPanel = this.contentElementRef.nativeElement;
1577
1621
  this._handleScroll();
1578
1622
  this._handleOutsideClick();
1579
1623
  this._appendDropdown();
@@ -1589,7 +1633,7 @@ class NgDropdownPanelComponent {
1589
1633
  this._destroy$.next();
1590
1634
  this._destroy$.complete();
1591
1635
  this._destroy$.unsubscribe();
1592
- if (this.appendTo) {
1636
+ if (this.appendTo()) {
1593
1637
  this._renderer.removeChild(this._dropdown.parentNode, this._dropdown);
1594
1638
  }
1595
1639
  }
@@ -1597,12 +1641,12 @@ class NgDropdownPanelComponent {
1597
1641
  if (!option) {
1598
1642
  return;
1599
1643
  }
1600
- const index = this.items.indexOf(option);
1644
+ const index = this.items().indexOf(option);
1601
1645
  if (index < 0 || index >= this.itemsLength) {
1602
1646
  return;
1603
1647
  }
1604
1648
  let scrollTo;
1605
- if (this.virtualScroll) {
1649
+ if (this.virtualScroll()) {
1606
1650
  const itemHeight = this._panelService.dimensions.itemHeight;
1607
1651
  scrollTo = this._panelService.getScrollTo(index * itemHeight, itemHeight, this._lastScrollPosition);
1608
1652
  }
@@ -1612,11 +1656,11 @@ class NgDropdownPanelComponent {
1612
1656
  scrollTo = this._panelService.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
1613
1657
  }
1614
1658
  if (isDefined(scrollTo)) {
1615
- this._scrollablePanel.scrollTop = scrollTo;
1659
+ this._scrollablePanel().scrollTop = scrollTo;
1616
1660
  }
1617
1661
  }
1618
1662
  scrollToTag() {
1619
- const panel = this._scrollablePanel;
1663
+ const panel = this._scrollablePanel();
1620
1664
  panel.scrollTop = panel.scrollHeight - panel.clientHeight;
1621
1665
  }
1622
1666
  adjustPosition() {
@@ -1630,7 +1674,7 @@ class NgDropdownPanelComponent {
1630
1674
  else {
1631
1675
  this._updateDropdownClass('bottom');
1632
1676
  }
1633
- if (this.appendTo) {
1677
+ if (this.appendTo()) {
1634
1678
  this._updateYPosition();
1635
1679
  }
1636
1680
  this._dropdown.style.opacity = '1';
@@ -1647,7 +1691,10 @@ class NgDropdownPanelComponent {
1647
1691
  }
1648
1692
  _handleScroll() {
1649
1693
  this._zone.runOutsideAngular(() => {
1650
- fromEvent(this.scrollElementRef.nativeElement, 'scroll')
1694
+ if (!this._scrollablePanel()) {
1695
+ return;
1696
+ }
1697
+ fromEvent(this._scrollablePanel(), 'scroll')
1651
1698
  .pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER))
1652
1699
  .subscribe((e) => {
1653
1700
  const path = e.path || (e.composedPath && e.composedPath());
@@ -1679,11 +1726,10 @@ class NgDropdownPanelComponent {
1679
1726
  }
1680
1727
  this._zone.run(() => this.outsideClick.emit());
1681
1728
  }
1682
- _onItemsChange(items, firstChange) {
1683
- this.items = items || [];
1729
+ _onItemsChange(items = [], firstChange) {
1684
1730
  this._scrollToEndFired = false;
1685
1731
  this.itemsLength = items.length;
1686
- if (this.virtualScroll) {
1732
+ if (this.virtualScroll()) {
1687
1733
  this._updateItemsRange(firstChange);
1688
1734
  }
1689
1735
  else {
@@ -1692,16 +1738,16 @@ class NgDropdownPanelComponent {
1692
1738
  }
1693
1739
  }
1694
1740
  _updateItems(firstChange) {
1695
- this.update.emit(this.items);
1741
+ this.update.emit(this.items());
1696
1742
  if (firstChange === false) {
1697
1743
  return;
1698
1744
  }
1699
1745
  this._zone.runOutsideAngular(() => {
1700
1746
  Promise.resolve().then(() => {
1701
- const panelHeight = this._scrollablePanel.clientHeight;
1747
+ const panelHeight = this._scrollablePanel().clientHeight;
1702
1748
  this._panelService.setDimensions(0, panelHeight);
1703
1749
  this._handleDropdownPosition();
1704
- this.scrollTo(this.markedItem, firstChange);
1750
+ this.scrollTo(this.markedItem(), firstChange);
1705
1751
  });
1706
1752
  });
1707
1753
  }
@@ -1719,7 +1765,7 @@ class NgDropdownPanelComponent {
1719
1765
  });
1720
1766
  }
1721
1767
  _onContentScrolled(scrollTop) {
1722
- if (this.virtualScroll) {
1768
+ if (this.virtualScroll()) {
1723
1769
  this._renderItemsRange(scrollTop);
1724
1770
  }
1725
1771
  this._lastScrollPosition = scrollTop;
@@ -1727,15 +1773,15 @@ class NgDropdownPanelComponent {
1727
1773
  }
1728
1774
  _updateVirtualHeight(height) {
1729
1775
  if (this._updateScrollHeight) {
1730
- this._virtualPadding.style.height = `${height}px`;
1776
+ this._virtualPadding().style.height = `${height}px`;
1731
1777
  this._updateScrollHeight = false;
1732
1778
  }
1733
1779
  }
1734
1780
  _setVirtualHeight() {
1735
- if (!this._virtualPadding) {
1781
+ if (!this._virtualPadding()) {
1736
1782
  return;
1737
1783
  }
1738
- this._virtualPadding.style.height = `0px`;
1784
+ this._virtualPadding().style.height = `0px`;
1739
1785
  }
1740
1786
  _onItemsLengthChanged() {
1741
1787
  this._updateScrollHeight = true;
@@ -1744,16 +1790,16 @@ class NgDropdownPanelComponent {
1744
1790
  if (scrollTop && this._lastScrollPosition === scrollTop) {
1745
1791
  return;
1746
1792
  }
1747
- scrollTop = scrollTop || this._scrollablePanel.scrollTop;
1748
- const range = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount);
1793
+ scrollTop = scrollTop || this._scrollablePanel().scrollTop;
1794
+ const range = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount());
1749
1795
  this._updateVirtualHeight(range.scrollHeight);
1750
- this._contentPanel.style.transform = `translateY(${range.topPadding}px)`;
1796
+ this._contentPanel().style.transform = `translateY(${range.topPadding}px)`;
1751
1797
  this._zone.run(() => {
1752
- this.update.emit(this.items.slice(range.start, range.end));
1798
+ this.update.emit(this.items().slice(range.start, range.end));
1753
1799
  this.scroll.emit({ start: range.start, end: range.end });
1754
1800
  });
1755
1801
  if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
1756
- this._scrollablePanel.scrollTop = scrollTop;
1802
+ this._scrollablePanel().scrollTop = scrollTop;
1757
1803
  this._lastScrollPosition = scrollTop;
1758
1804
  }
1759
1805
  }
@@ -1761,13 +1807,13 @@ class NgDropdownPanelComponent {
1761
1807
  if (this._panelService.dimensions.itemHeight > 0 || this.itemsLength === 0) {
1762
1808
  return Promise.resolve(this._panelService.dimensions);
1763
1809
  }
1764
- const [first] = this.items;
1810
+ const [first] = this.items();
1765
1811
  this.update.emit([first]);
1766
1812
  return Promise.resolve().then(() => {
1767
1813
  const option = this._dropdown.querySelector(`#${first.htmlId}`);
1768
1814
  const optionHeight = option.clientHeight;
1769
- this._virtualPadding.style.height = `${optionHeight * this.itemsLength}px`;
1770
- const panelHeight = this._scrollablePanel.clientHeight;
1815
+ this._virtualPadding().style.height = `${optionHeight * this.itemsLength}px`;
1816
+ const panelHeight = this._scrollablePanel().clientHeight;
1771
1817
  this._panelService.setDimensions(optionHeight, panelHeight);
1772
1818
  return this._panelService.dimensions;
1773
1819
  });
@@ -1776,15 +1822,16 @@ class NgDropdownPanelComponent {
1776
1822
  if (this._scrollToEndFired || scrollTop === 0) {
1777
1823
  return;
1778
1824
  }
1779
- const padding = this.virtualScroll ? this._virtualPadding : this._contentPanel;
1825
+ const padding = this.virtualScroll() ? this._virtualPadding() : this._contentPanel();
1780
1826
  if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
1781
1827
  this._zone.run(() => this.scrollToEnd.emit());
1782
1828
  this._scrollToEndFired = true;
1783
1829
  }
1784
1830
  }
1785
1831
  _calculateCurrentPosition(dropdownEl) {
1786
- if (this.position !== 'auto') {
1787
- return this.position;
1832
+ const position = this.position();
1833
+ if (position !== 'auto') {
1834
+ return position;
1788
1835
  }
1789
1836
  const selectRect = this._select.getBoundingClientRect();
1790
1837
  const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
@@ -1799,14 +1846,14 @@ class NgDropdownPanelComponent {
1799
1846
  }
1800
1847
  }
1801
1848
  _appendDropdown() {
1802
- if (!this.appendTo) {
1849
+ if (!this.appendTo()) {
1803
1850
  return;
1804
1851
  }
1805
1852
  this._parent = this._dropdown.shadowRoot
1806
- ? this._dropdown.shadowRoot.querySelector(this.appendTo)
1807
- : document.querySelector(this.appendTo);
1853
+ ? this._dropdown.shadowRoot.querySelector(this.appendTo())
1854
+ : document.querySelector(this.appendTo());
1808
1855
  if (!this._parent) {
1809
- throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);
1856
+ throw new Error(`appendTo selector ${this.appendTo()} did not found any parent element`);
1810
1857
  }
1811
1858
  this._updateXPosition();
1812
1859
  this._parent.appendChild(this._dropdown);
@@ -1814,8 +1861,17 @@ class NgDropdownPanelComponent {
1814
1861
  _updateXPosition() {
1815
1862
  const select = this._select.getBoundingClientRect();
1816
1863
  const parent = this._parent.getBoundingClientRect();
1864
+ const isRTL = document.documentElement.dir === 'rtl';
1817
1865
  const offsetLeft = select.left - parent.left;
1818
- this._dropdown.style.left = offsetLeft + 'px';
1866
+ if (isRTL) {
1867
+ const offsetRight = parent.right - select.right;
1868
+ this._dropdown.style.right = offsetRight + 'px';
1869
+ this._dropdown.style.left = 'auto';
1870
+ }
1871
+ else {
1872
+ this._dropdown.style.left = offsetLeft + 'px';
1873
+ this._dropdown.style.right = 'auto';
1874
+ }
1819
1875
  this._dropdown.style.width = select.width + 'px';
1820
1876
  this._dropdown.style.minWidth = select.width + 'px';
1821
1877
  }
@@ -1847,22 +1903,22 @@ class NgDropdownPanelComponent {
1847
1903
  });
1848
1904
  });
1849
1905
  }
1850
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, deps: [{ token: i0.Renderer2 }, { token: i0.NgZone }, { token: NgDropdownPanelService }, { token: i0.ElementRef }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1851
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgDropdownPanelComponent, isStandalone: true, selector: "ng-dropdown-panel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, markedItem: { classPropertyName: "markedItem", publicName: "markedItem", isSignal: false, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: false, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: false, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: false, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null } }, 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: `
1852
- @if (headerTemplate) {
1906
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1907
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgDropdownPanelComponent, isStandalone: true, selector: "ng-dropdown-panel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, markedItem: { classPropertyName: "markedItem", publicName: "markedItem", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { update: "update", scroll: "scroll", scrollToEnd: "scrollToEnd", outsideClick: "outsideClick" }, viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "scrollElementRef", first: true, predicate: ["scroll"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "paddingElementRef", first: true, predicate: ["padding"], descendants: true, read: ElementRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: `
1908
+ @if (headerTemplate()) {
1853
1909
  <div class="ng-dropdown-header">
1854
- <ng-container [ngTemplateOutlet]="headerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
1910
+ <ng-container [ngTemplateOutlet]="headerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
1855
1911
  </div>
1856
1912
  }
1857
1913
  <div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
1858
- <div #padding [class.total-padding]="virtualScroll"></div>
1859
- <div #content [class.scrollable-content]="virtualScroll && items.length">
1914
+ <div #padding [class.total-padding]="virtualScroll()"></div>
1915
+ <div #content [class.scrollable-content]="virtualScroll() && items().length">
1860
1916
  <ng-content />
1861
1917
  </div>
1862
1918
  </div>
1863
- @if (footerTemplate) {
1919
+ @if (footerTemplate()) {
1864
1920
  <div class="ng-dropdown-footer">
1865
- <ng-container [ngTemplateOutlet]="footerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
1921
+ <ng-container [ngTemplateOutlet]="footerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
1866
1922
  </div>
1867
1923
  }
1868
1924
  `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
@@ -1874,100 +1930,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
1874
1930
  encapsulation: ViewEncapsulation.None,
1875
1931
  selector: 'ng-dropdown-panel',
1876
1932
  template: `
1877
- @if (headerTemplate) {
1933
+ @if (headerTemplate()) {
1878
1934
  <div class="ng-dropdown-header">
1879
- <ng-container [ngTemplateOutlet]="headerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
1935
+ <ng-container [ngTemplateOutlet]="headerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
1880
1936
  </div>
1881
1937
  }
1882
1938
  <div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
1883
- <div #padding [class.total-padding]="virtualScroll"></div>
1884
- <div #content [class.scrollable-content]="virtualScroll && items.length">
1939
+ <div #padding [class.total-padding]="virtualScroll()"></div>
1940
+ <div #content [class.scrollable-content]="virtualScroll() && items().length">
1885
1941
  <ng-content />
1886
1942
  </div>
1887
1943
  </div>
1888
- @if (footerTemplate) {
1944
+ @if (footerTemplate()) {
1889
1945
  <div class="ng-dropdown-footer">
1890
- <ng-container [ngTemplateOutlet]="footerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
1946
+ <ng-container [ngTemplateOutlet]="footerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
1891
1947
  </div>
1892
1948
  }
1893
1949
  `,
1894
- imports: [NgTemplateOutlet],
1950
+ imports: [NgTemplateOutlet]
1895
1951
  }]
1896
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.NgZone }, { type: NgDropdownPanelService }, { type: i0.ElementRef }, { type: undefined, decorators: [{
1897
- type: Optional
1898
- }, {
1899
- type: Inject,
1900
- args: [DOCUMENT]
1901
- }] }], propDecorators: { items: [{
1902
- type: Input
1903
- }], markedItem: [{
1904
- type: Input
1905
- }], position: [{
1906
- type: Input
1907
- }], appendTo: [{
1908
- type: Input
1909
- }], bufferAmount: [{
1910
- type: Input
1911
- }], virtualScroll: [{
1912
- type: Input,
1913
- args: [{ transform: booleanAttribute }]
1914
- }], headerTemplate: [{
1915
- type: Input
1916
- }], footerTemplate: [{
1917
- type: Input
1918
- }], filterValue: [{
1919
- type: Input
1920
- }], update: [{
1921
- type: Output
1922
- }], scroll: [{
1923
- type: Output
1924
- }], scrollToEnd: [{
1925
- type: Output
1926
- }], outsideClick: [{
1927
- type: Output
1928
- }], contentElementRef: [{
1929
- type: ViewChild,
1930
- args: ['content', { read: ElementRef, static: true }]
1931
- }], scrollElementRef: [{
1932
- type: ViewChild,
1933
- args: ['scroll', { read: ElementRef, static: true }]
1934
- }], paddingElementRef: [{
1935
- type: ViewChild,
1936
- args: ['padding', { read: ElementRef, static: true }]
1937
- }] } });
1952
+ }] });
1938
1953
 
1939
1954
  class NgOptionComponent {
1940
- constructor(elementRef) {
1941
- this.elementRef = elementRef;
1942
- this.disabled = false;
1943
- this.stateChange$ = new Subject();
1944
- }
1945
- get label() {
1946
- return (this.elementRef.nativeElement.textContent || '').trim();
1947
- }
1948
- ngOnChanges(changes) {
1949
- if (changes.disabled) {
1950
- this.stateChange$.next({
1951
- value: this.value,
1952
- disabled: this.disabled,
1953
- });
1954
- }
1955
- }
1956
- ngAfterViewChecked() {
1957
- if (this.label !== this._previousLabel) {
1958
- this._previousLabel = this.label;
1959
- this.stateChange$.next({
1960
- value: this.value,
1961
- disabled: this.disabled,
1962
- label: this.elementRef.nativeElement.innerHTML,
1963
- });
1964
- }
1955
+ constructor() {
1956
+ this.value = input();
1957
+ this.disabled = input(false, {
1958
+ transform: booleanAttribute,
1959
+ });
1960
+ this.elementRef = inject((ElementRef));
1961
+ this.label = signal('');
1962
+ this.stateChange = computed(() => ({
1963
+ value: this.value(),
1964
+ disabled: this.disabled(),
1965
+ label: this.label(),
1966
+ }));
1967
+ this.stateChange$ = toObservable(this.stateChange);
1968
+ afterNextRender(() => {
1969
+ if (this._label !== this.label()) {
1970
+ this.label.set(this._label);
1971
+ }
1972
+ });
1965
1973
  }
1966
- ngOnDestroy() {
1967
- this.stateChange$.complete();
1974
+ get _label() {
1975
+ return (this.elementRef.nativeElement.innerHTML || '').trim();
1968
1976
  }
1969
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1970
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.0.0", type: NgOptionComponent, isStandalone: true, selector: "ng-option", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, usesOnChanges: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1977
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1978
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: NgOptionComponent, isStandalone: true, selector: "ng-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1971
1979
  }
1972
1980
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, decorators: [{
1973
1981
  type: Component,
@@ -1977,12 +1985,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
1977
1985
  changeDetection: ChangeDetectionStrategy.OnPush,
1978
1986
  template: `<ng-content />`,
1979
1987
  }]
1980
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { value: [{
1981
- type: Input
1982
- }], disabled: [{
1983
- type: Input,
1984
- args: [{ transform: booleanAttribute }]
1985
- }] } });
1988
+ }], ctorParameters: () => [] });
1986
1989
 
1987
1990
  var KeyCode;
1988
1991
  (function (KeyCode) {
@@ -2070,88 +2073,128 @@ class DefaultSelectionModel {
2070
2073
  }
2071
2074
  }
2072
2075
 
2073
- class NgSelectConfig {
2074
- constructor() {
2075
- this.fixedPlaceholder = true;
2076
- this.notFoundText = 'No items found';
2077
- this.typeToSearchText = 'Type to search';
2078
- this.addTagText = 'Add item';
2079
- this.loadingText = 'Loading...';
2080
- this.clearAllText = 'Clear all';
2081
- this.disableVirtualScroll = true;
2082
- this.openOnEnter = true;
2083
- this.appearance = 'underline';
2084
- this.tabFocusOnClear = true;
2085
- }
2086
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2087
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
2088
- }
2089
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, decorators: [{
2090
- type: Injectable,
2091
- args: [{ providedIn: 'root' }]
2092
- }] });
2093
-
2094
- class ConsoleService {
2095
- warn(message) {
2096
- console.warn(message);
2097
- }
2098
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2099
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, providedIn: 'root' }); }
2100
- }
2101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, decorators: [{
2102
- type: Injectable,
2103
- args: [{ providedIn: 'root' }]
2104
- }] });
2105
-
2106
2076
  const SELECTION_MODEL_FACTORY = new InjectionToken('ng-select-selection-model');
2107
2077
  class NgSelectComponent {
2108
- constructor(classes, autoFocus, config, newSelectionModel, _elementRef, _cd, _console) {
2109
- this.classes = classes;
2110
- this.autoFocus = autoFocus;
2111
- this.config = config;
2112
- this._cd = _cd;
2113
- this._console = _console;
2114
- this.ariaLabelDropdown = 'Options List';
2115
- this.markFirst = true;
2116
- this.fixedPlaceholder = true;
2117
- this.preventToggleOnRightClick = false;
2118
- this.dropdownPosition = 'auto';
2119
- this.loading = false;
2120
- this.closeOnSelect = true;
2121
- this.hideSelected = false;
2122
- this.selectOnTab = false;
2123
- this.bufferAmount = 4;
2124
- this.selectableGroup = false;
2125
- this.selectableGroupAsModel = true;
2126
- this.searchFn = null;
2127
- this.trackByFn = null;
2128
- this.clearOnBackspace = true;
2129
- this.labelForId = null;
2130
- this.inputAttrs = {};
2078
+ constructor() {
2079
+ this.classes = inject(new HostAttributeToken('class'), { optional: true });
2080
+ this.autoFocus = inject(new HostAttributeToken('autofocus'), { optional: true });
2081
+ this.config = inject(NgSelectConfig);
2082
+ this._cd = inject(ChangeDetectorRef);
2083
+ this._console = inject(ConsoleService);
2084
+ // signals
2085
+ this._disabled = signal(false);
2086
+ // inputs
2087
+ this.ariaLabelDropdown = input('Options List');
2088
+ this.ariaLabel = input(undefined);
2089
+ this.markFirst = input(true, { transform: booleanAttribute });
2090
+ this.placeholder = input(this.config.placeholder);
2091
+ this.fixedPlaceholder = input(true);
2092
+ this.notFoundText = input(undefined);
2093
+ this.typeToSearchText = input(undefined);
2094
+ this.preventToggleOnRightClick = input(false);
2095
+ this.addTagText = input(undefined);
2096
+ this.loadingText = input(undefined);
2097
+ this.clearAllText = input(undefined);
2098
+ this.dropdownPosition = input('auto');
2099
+ this.appendTo = input(undefined);
2100
+ this.loading = input(false, { transform: booleanAttribute });
2101
+ this.closeOnSelect = input(true, { transform: booleanAttribute });
2102
+ this.hideSelected = input(false, { transform: booleanAttribute });
2103
+ this.selectOnTab = input(false, { transform: booleanAttribute });
2104
+ this.openOnEnter = input(undefined, { transform: booleanAttribute });
2105
+ this.maxSelectedItems = input(undefined, { transform: numberAttribute });
2106
+ this.groupBy = input(undefined);
2107
+ this.groupValue = input(undefined);
2108
+ this.bufferAmount = input(4, { transform: numberAttribute });
2109
+ this.virtualScroll = input(undefined, { transform: booleanAttribute });
2110
+ this.selectableGroup = input(false, { transform: booleanAttribute });
2131
2111
  this.tabFocusOnClearButton = input();
2132
- this.readonly = false;
2133
- this.searchWhileComposing = true;
2134
- this.minTermLength = 0;
2135
- this.editableSearchTerm = false;
2136
- this.ngClass = null;
2137
- this.multiple = false;
2138
- this.addTag = false;
2139
- this.searchable = true;
2140
- this.clearable = true;
2141
- this.isOpen = false;
2112
+ this.selectableGroupAsModel = input(true, { transform: booleanAttribute });
2113
+ this.searchFn = input(null);
2114
+ this.trackByFn = input(null);
2115
+ this.clearOnBackspace = input(true, { transform: booleanAttribute });
2116
+ this.labelForId = input(null);
2117
+ this.inputAttrs = input({});
2118
+ this.tabIndex = input(undefined, { transform: numberAttribute });
2119
+ this.readonly = input(false, { transform: booleanAttribute });
2120
+ this.searchWhileComposing = input(true, { transform: booleanAttribute });
2121
+ this.minTermLength = input(0, { transform: numberAttribute });
2122
+ this.editableSearchTerm = input(false, { transform: booleanAttribute });
2123
+ this.ngClass = input(null);
2124
+ this.typeahead = input(undefined);
2125
+ this.multiple = input(false, { transform: booleanAttribute });
2126
+ this.addTag = input(false);
2127
+ this.searchable = input(true, { transform: booleanAttribute });
2128
+ this.clearable = input(true, { transform: booleanAttribute });
2129
+ this.deselectOnClick = input();
2130
+ this.clearSearchOnAdd = input(undefined);
2131
+ this.compareWith = input(undefined, {
2132
+ transform: (fn) => {
2133
+ if (fn !== undefined && fn !== null && !isFunction(fn)) {
2134
+ throw Error('`compareWith` must be a function.');
2135
+ }
2136
+ return fn;
2137
+ },
2138
+ });
2139
+ // models
2140
+ this.bindLabel = model(undefined);
2141
+ this.bindValue = model(undefined);
2142
+ this.appearance = model(undefined);
2143
+ this.isOpen = model(false);
2144
+ this.items = model([]);
2142
2145
  // output events
2143
- this.blurEvent = new EventEmitter();
2144
- this.focusEvent = new EventEmitter();
2145
- this.changeEvent = new EventEmitter();
2146
- this.openEvent = new EventEmitter();
2147
- this.closeEvent = new EventEmitter();
2148
- this.searchEvent = new EventEmitter();
2149
- this.clearEvent = new EventEmitter();
2150
- this.addEvent = new EventEmitter();
2151
- this.removeEvent = new EventEmitter();
2152
- this.scroll = new EventEmitter();
2153
- this.scrollToEnd = new EventEmitter();
2154
- this.useDefaultClass = true;
2146
+ this.blurEvent = output({ alias: 'blur' });
2147
+ this.focusEvent = output({ alias: 'focus' });
2148
+ this.changeEvent = output({ alias: 'change' });
2149
+ this.openEvent = output({ alias: 'open' });
2150
+ this.closeEvent = output({ alias: 'close' });
2151
+ this.searchEvent = output({ alias: 'search' });
2152
+ this.clearEvent = output({ alias: 'clear' });
2153
+ this.addEvent = output({ alias: 'add' });
2154
+ this.removeEvent = output({ alias: 'remove' });
2155
+ this.scroll = output({ alias: 'scroll' });
2156
+ this.scrollToEnd = output({ alias: 'scrollToEnd' });
2157
+ // computed
2158
+ this.disabled = computed(() => this.readonly() || this._disabled());
2159
+ this.clearSearchOnAddValue = computed(() => {
2160
+ if (isDefined(this.clearSearchOnAdd())) {
2161
+ return this.clearSearchOnAdd();
2162
+ }
2163
+ if (isDefined(this.config.clearSearchOnAdd)) {
2164
+ return this.config.clearSearchOnAdd;
2165
+ }
2166
+ return this.closeOnSelect();
2167
+ });
2168
+ this.deselectOnClickValue = computed(() => {
2169
+ if (isDefined(this.deselectOnClick())) {
2170
+ return this.deselectOnClick();
2171
+ }
2172
+ if (isDefined(this.config.deselectOnClick)) {
2173
+ return this.config.deselectOnClick;
2174
+ }
2175
+ return this.multiple();
2176
+ });
2177
+ // content child queries
2178
+ this.optionTemplate = contentChild(NgOptionTemplateDirective, { read: TemplateRef });
2179
+ this.optgroupTemplate = contentChild(NgOptgroupTemplateDirective, { read: TemplateRef });
2180
+ this.labelTemplate = contentChild(NgLabelTemplateDirective, { read: TemplateRef });
2181
+ this.multiLabelTemplate = contentChild(NgMultiLabelTemplateDirective, { read: TemplateRef });
2182
+ this.headerTemplate = contentChild(NgHeaderTemplateDirective, { read: TemplateRef });
2183
+ this.footerTemplate = contentChild(NgFooterTemplateDirective, { read: TemplateRef });
2184
+ this.notFoundTemplate = contentChild(NgNotFoundTemplateDirective, { read: TemplateRef });
2185
+ this.placeholderTemplate = contentChild(NgPlaceholderTemplateDirective, { read: TemplateRef });
2186
+ this.typeToSearchTemplate = contentChild(NgTypeToSearchTemplateDirective, { read: TemplateRef });
2187
+ this.loadingTextTemplate = contentChild(NgLoadingTextTemplateDirective, { read: TemplateRef });
2188
+ this.tagTemplate = contentChild(NgTagTemplateDirective, { read: TemplateRef });
2189
+ this.loadingSpinnerTemplate = contentChild(NgLoadingSpinnerTemplateDirective, { read: TemplateRef });
2190
+ this.clearButtonTemplate = contentChild(NgClearButtonTemplateDirective, { read: TemplateRef });
2191
+ // view children queries
2192
+ this.dropdownPanel = viewChild(forwardRef(() => NgDropdownPanelComponent));
2193
+ this.searchInput = viewChild('searchInput');
2194
+ this.clearButton = viewChild('clearButton');
2195
+ // public variables
2196
+ this.ngOptions = contentChildren(NgOptionComponent, { descendants: true });
2197
+ this.ngOptionsObservable = toObservable(this.ngOptions);
2155
2198
  this.viewPortItems = [];
2156
2199
  this.searchTerm = null;
2157
2200
  this.dropdownId = newId();
@@ -2162,72 +2205,28 @@ class NgSelectComponent {
2162
2205
  this._isComposing = false;
2163
2206
  this._destroy$ = new Subject();
2164
2207
  this._keyPress$ = new Subject();
2165
- this._items = [];
2166
- this.keyDownFn = (_) => true;
2208
+ this.keyDownFn = input((_) => true);
2167
2209
  this.clearItem = (item) => {
2168
2210
  const option = this.selectedItems.find((x) => x.value === item);
2169
2211
  this.unselect(option);
2170
2212
  };
2171
2213
  this.trackByOption = (_, item) => {
2172
- if (this.trackByFn) {
2173
- return this.trackByFn(item.value);
2214
+ if (this.trackByFn()) {
2215
+ return this.trackByFn()(item.value);
2174
2216
  }
2175
2217
  return item;
2176
2218
  };
2177
2219
  this._onChange = (_) => { };
2178
2220
  this._onTouched = () => { };
2221
+ const config = this.config;
2222
+ const newSelectionModel = inject(SELECTION_MODEL_FACTORY, { optional: true });
2223
+ const _elementRef = inject(ElementRef);
2179
2224
  this._mergeGlobalConfig(config);
2180
2225
  this.itemsList = new ItemsList(this, newSelectionModel ? newSelectionModel() : DefaultSelectionModelFactory());
2181
2226
  this.element = _elementRef.nativeElement;
2182
2227
  }
2183
2228
  get filtered() {
2184
- return (!!this.searchTerm && this.searchable) || this._isComposing;
2185
- }
2186
- get single() {
2187
- return !this.multiple;
2188
- }
2189
- get items() {
2190
- return this._items;
2191
- }
2192
- set items(value) {
2193
- this._itemsAreUsed = true;
2194
- this._items = value ?? [];
2195
- }
2196
- get disabled() {
2197
- return this.readonly || this._disabled;
2198
- }
2199
- get compareWith() {
2200
- return this._compareWith;
2201
- }
2202
- set compareWith(fn) {
2203
- if (fn !== undefined && fn !== null && !isFunction(fn)) {
2204
- throw Error('`compareWith` must be a function.');
2205
- }
2206
- this._compareWith = fn;
2207
- }
2208
- get clearSearchOnAdd() {
2209
- if (isDefined(this._clearSearchOnAdd)) {
2210
- return this._clearSearchOnAdd;
2211
- }
2212
- else if (isDefined(this.config.clearSearchOnAdd)) {
2213
- return this.config.clearSearchOnAdd;
2214
- }
2215
- return this.closeOnSelect;
2216
- }
2217
- set clearSearchOnAdd(value) {
2218
- this._clearSearchOnAdd = value;
2219
- }
2220
- get deselectOnClick() {
2221
- if (isDefined(this._deselectOnClick)) {
2222
- return this._deselectOnClick;
2223
- }
2224
- else if (isDefined(this.config.deselectOnClick)) {
2225
- return this.config.deselectOnClick;
2226
- }
2227
- return this.multiple;
2228
- }
2229
- set deselectOnClick(value) {
2230
- this._deselectOnClick = value;
2229
+ return (!!this.searchTerm && this.searchable()) || this._isComposing;
2231
2230
  }
2232
2231
  get selectedItems() {
2233
2232
  return this.itemsList.selectedItems;
@@ -2239,8 +2238,8 @@ class NgSelectComponent {
2239
2238
  return this.selectedItems.length > 0;
2240
2239
  }
2241
2240
  get currentPanelPosition() {
2242
- if (this.dropdownPanel) {
2243
- return this.dropdownPanel.currentPosition;
2241
+ if (this.dropdownPanel()) {
2242
+ return this.dropdownPanel().currentPosition;
2244
2243
  }
2245
2244
  return undefined;
2246
2245
  }
@@ -2249,20 +2248,20 @@ class NgSelectComponent {
2249
2248
  return false;
2250
2249
  }
2251
2250
  const term = this.searchTerm.toLowerCase().trim();
2252
- return (this.addTag &&
2251
+ return (this.addTag() &&
2253
2252
  !this.itemsList.filteredItems.some((x) => x.label.toLowerCase() === term) &&
2254
- ((!this.hideSelected && this.isOpen) || !this.selectedItems.some((x) => x.label.toLowerCase() === term)) &&
2255
- !this.loading);
2253
+ ((!this.hideSelected() && this.isOpen()) || !this.selectedItems.some((x) => x.label.toLowerCase() === term)) &&
2254
+ !this.loading());
2256
2255
  }
2257
2256
  get _editableSearchTerm() {
2258
- return this.editableSearchTerm && !this.multiple;
2257
+ return this.editableSearchTerm() && !this.multiple();
2259
2258
  }
2260
2259
  get _isTypeahead() {
2261
- return this.typeahead && this.typeahead.observers.length > 0;
2260
+ return this.typeahead() && this.typeahead().observed;
2262
2261
  }
2263
2262
  get _validTerm() {
2264
2263
  const term = this.searchTerm?.trim();
2265
- return term && term.length >= this.minTermLength;
2264
+ return term && term.length >= this.minTermLength();
2266
2265
  }
2267
2266
  ngOnInit() {
2268
2267
  this._handleKeyPresses();
@@ -2273,6 +2272,7 @@ class NgSelectComponent {
2273
2272
  this.itemsList.clearSelected();
2274
2273
  }
2275
2274
  if (changes.items) {
2275
+ this._itemsAreUsed = true;
2276
2276
  this._setItems(changes.items.currentValue || []);
2277
2277
  }
2278
2278
  if (changes.isOpen) {
@@ -2280,7 +2280,7 @@ class NgSelectComponent {
2280
2280
  }
2281
2281
  if (changes.groupBy) {
2282
2282
  if (!changes.items) {
2283
- this._setItems([...this.items]);
2283
+ this._setItems([...this.items()]);
2284
2284
  }
2285
2285
  }
2286
2286
  if (changes.inputAttrs) {
@@ -2304,7 +2304,7 @@ class NgSelectComponent {
2304
2304
  handleKeyDown($event) {
2305
2305
  const keyName = $event.key;
2306
2306
  if (Object.values(KeyCode).includes(keyName)) {
2307
- if (this.keyDownFn($event) === false) {
2307
+ if (this.keyDownFn()($event) === false) {
2308
2308
  return;
2309
2309
  }
2310
2310
  this.handleKeyCode($event);
@@ -2315,7 +2315,7 @@ class NgSelectComponent {
2315
2315
  }
2316
2316
  handleKeyCode($event) {
2317
2317
  const target = $event.target;
2318
- if (this.clearButton && this.clearButton.nativeElement === target) {
2318
+ if (this.clearButton() && this.clearButton().nativeElement === target) {
2319
2319
  this.handleKeyCodeClear($event);
2320
2320
  }
2321
2321
  else {
@@ -2357,7 +2357,10 @@ class NgSelectComponent {
2357
2357
  }
2358
2358
  }
2359
2359
  handleMousedown($event) {
2360
- if (this.preventToggleOnRightClick && $event.button === 2) {
2360
+ if (this.disabled()) {
2361
+ return;
2362
+ }
2363
+ if (this.preventToggleOnRightClick() && $event.button === 2) {
2361
2364
  return false;
2362
2365
  }
2363
2366
  const target = $event.target;
@@ -2378,7 +2381,7 @@ class NgSelectComponent {
2378
2381
  if (!this.focused) {
2379
2382
  this.focus();
2380
2383
  }
2381
- if (this.searchable) {
2384
+ if (this.searchable()) {
2382
2385
  this.open();
2383
2386
  }
2384
2387
  else {
@@ -2386,7 +2389,7 @@ class NgSelectComponent {
2386
2389
  }
2387
2390
  }
2388
2391
  handleArrowClick() {
2389
- if (this.isOpen) {
2392
+ if (this.isOpen()) {
2390
2393
  this.close();
2391
2394
  }
2392
2395
  else {
@@ -2404,7 +2407,7 @@ class NgSelectComponent {
2404
2407
  this._onSelectionChanged();
2405
2408
  }
2406
2409
  clearModel() {
2407
- if (!this.clearable) {
2410
+ if (!this.clearable()) {
2408
2411
  return;
2409
2412
  }
2410
2413
  this.itemsList.clearSelected();
@@ -2413,6 +2416,9 @@ class NgSelectComponent {
2413
2416
  writeValue(value) {
2414
2417
  this.itemsList.clearSelected();
2415
2418
  this._handleWriteValue(value);
2419
+ if (this._editableSearchTerm) {
2420
+ this._setSearchTermFromItems();
2421
+ }
2416
2422
  this._cd.markForCheck();
2417
2423
  }
2418
2424
  registerOnChange(fn) {
@@ -2422,11 +2428,11 @@ class NgSelectComponent {
2422
2428
  this._onTouched = fn;
2423
2429
  }
2424
2430
  setDisabledState(state) {
2425
- this._disabled = state;
2431
+ this._disabled.set(state);
2426
2432
  this._cd.markForCheck();
2427
2433
  }
2428
2434
  toggle() {
2429
- if (!this.isOpen) {
2435
+ if (!this.isOpen()) {
2430
2436
  this.open();
2431
2437
  }
2432
2438
  else {
@@ -2434,14 +2440,14 @@ class NgSelectComponent {
2434
2440
  }
2435
2441
  }
2436
2442
  open() {
2437
- if (this.disabled || this.isOpen || this._manualOpen) {
2443
+ if (this.disabled() || this.isOpen() || this._manualOpen) {
2438
2444
  return;
2439
2445
  }
2440
- if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {
2446
+ if (!this._isTypeahead && !this.addTag() && this.itemsList.noItemsToSelect) {
2441
2447
  return;
2442
2448
  }
2443
- this.isOpen = true;
2444
- this.itemsList.markSelectedOrDefault(this.markFirst);
2449
+ this.isOpen.set(true);
2450
+ this.itemsList.markSelectedOrDefault(this.markFirst());
2445
2451
  this.openEvent.emit();
2446
2452
  if (!this.searchTerm) {
2447
2453
  this.focus();
@@ -2449,10 +2455,10 @@ class NgSelectComponent {
2449
2455
  this.detectChanges();
2450
2456
  }
2451
2457
  close() {
2452
- if (!this.isOpen || this._manualOpen) {
2458
+ if (!this.isOpen() || this._manualOpen) {
2453
2459
  return;
2454
2460
  }
2455
- this.isOpen = false;
2461
+ this.isOpen.set(false);
2456
2462
  this._isComposing = false;
2457
2463
  if (!this._editableSearchTerm) {
2458
2464
  this._clearSearch();
@@ -2466,10 +2472,10 @@ class NgSelectComponent {
2466
2472
  this._cd.markForCheck();
2467
2473
  }
2468
2474
  toggleItem(item) {
2469
- if (!item || item.disabled || this.disabled) {
2475
+ if (!item || item.disabled || this.disabled()) {
2470
2476
  return;
2471
2477
  }
2472
- if (this.deselectOnClick && item.selected) {
2478
+ if (this.deselectOnClickValue() && item.selected) {
2473
2479
  this.unselect(item);
2474
2480
  }
2475
2481
  else {
@@ -2482,24 +2488,24 @@ class NgSelectComponent {
2482
2488
  select(item) {
2483
2489
  if (!item.selected) {
2484
2490
  this.itemsList.select(item);
2485
- if (this.clearSearchOnAdd && !this._editableSearchTerm) {
2491
+ if (this.clearSearchOnAddValue() && !this._editableSearchTerm) {
2486
2492
  this._clearSearch();
2487
2493
  }
2488
2494
  this._updateNgModel();
2489
- if (this.multiple) {
2495
+ if (this.multiple()) {
2490
2496
  this.addEvent.emit(item.value);
2491
2497
  }
2492
2498
  }
2493
- if (this.closeOnSelect || this.itemsList.noItemsToSelect) {
2499
+ if (this.closeOnSelect() || this.itemsList.noItemsToSelect) {
2494
2500
  this.close();
2495
2501
  }
2496
2502
  this._onSelectionChanged();
2497
2503
  }
2498
2504
  focus() {
2499
- this.searchInput.nativeElement.focus();
2505
+ this.searchInput().nativeElement.focus();
2500
2506
  }
2501
2507
  blur() {
2502
- this.searchInput.nativeElement.blur();
2508
+ this.searchInput().nativeElement.blur();
2503
2509
  }
2504
2510
  unselect(item) {
2505
2511
  if (!item) {
@@ -2513,13 +2519,13 @@ class NgSelectComponent {
2513
2519
  }
2514
2520
  selectTag() {
2515
2521
  let tag;
2516
- if (isFunction(this.addTag)) {
2517
- tag = this.addTag(this.searchTerm);
2522
+ if (isFunction(this.addTag())) {
2523
+ tag = this.addTag()(this.searchTerm);
2518
2524
  }
2519
2525
  else {
2520
- tag = this._primitive ? this.searchTerm : { [this.bindLabel]: this.searchTerm };
2526
+ tag = this._primitive ? this.searchTerm : { [this.bindLabel()]: this.searchTerm };
2521
2527
  }
2522
- const handleTag = (item) => (this._isTypeahead || !this.isOpen ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
2528
+ const handleTag = (item) => (this._isTypeahead || !this.isOpen() ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
2523
2529
  if (isPromise(tag)) {
2524
2530
  tag.then((item) => this.select(handleTag(item))).catch(() => { });
2525
2531
  }
@@ -2528,45 +2534,45 @@ class NgSelectComponent {
2528
2534
  }
2529
2535
  }
2530
2536
  showClear() {
2531
- return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
2537
+ return this.clearable() && (this.hasValue || this.searchTerm) && !this.disabled();
2532
2538
  }
2533
2539
  focusOnClear() {
2534
2540
  this.blur();
2535
- if (this.clearButton) {
2536
- this.clearButton.nativeElement.focus();
2541
+ if (this.clearButton()) {
2542
+ this.clearButton().nativeElement.focus();
2537
2543
  }
2538
2544
  }
2539
2545
  showNoItemsFound() {
2540
2546
  const empty = this.itemsList.filteredItems.length === 0;
2541
- return (((empty && !this._isTypeahead && !this.loading) || (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
2547
+ return (((empty && !this._isTypeahead && !this.loading()) || (empty && this._isTypeahead && this._validTerm && !this.loading())) &&
2542
2548
  !this.showAddTag);
2543
2549
  }
2544
2550
  showTypeToSearch() {
2545
2551
  const empty = this.itemsList.filteredItems.length === 0;
2546
- return empty && this._isTypeahead && !this._validTerm && !this.loading;
2552
+ return empty && this._isTypeahead && !this._validTerm && !this.loading();
2547
2553
  }
2548
2554
  onCompositionStart() {
2549
2555
  this._isComposing = true;
2550
2556
  }
2551
2557
  onCompositionEnd(term) {
2552
2558
  this._isComposing = false;
2553
- if (this.searchWhileComposing) {
2559
+ if (this.searchWhileComposing()) {
2554
2560
  return;
2555
2561
  }
2556
2562
  this.filter(term);
2557
2563
  }
2558
2564
  filter(term) {
2559
- if (this._isComposing && !this.searchWhileComposing) {
2565
+ if (this._isComposing && !this.searchWhileComposing()) {
2560
2566
  return;
2561
2567
  }
2562
2568
  this.searchTerm = term;
2563
- if (this._isTypeahead && (this._validTerm || this.minTermLength === 0)) {
2564
- this.typeahead.next(term);
2569
+ if (this._isTypeahead && (this._validTerm || this.minTermLength() === 0)) {
2570
+ this.typeahead().next(term);
2565
2571
  }
2566
2572
  if (!this._isTypeahead) {
2567
2573
  this.itemsList.filter(this.searchTerm);
2568
- if (this.isOpen) {
2569
- this.itemsList.markSelectedOrDefault(this.markFirst);
2574
+ if (this.isOpen()) {
2575
+ this.itemsList.markSelectedOrDefault(this.markFirst());
2570
2576
  }
2571
2577
  }
2572
2578
  this.searchEvent.emit({ term, items: this.itemsList.filteredItems.map((x) => x.value) });
@@ -2586,7 +2592,7 @@ class NgSelectComponent {
2586
2592
  onInputBlur($event) {
2587
2593
  this.element.classList.remove('ng-select-focused');
2588
2594
  this.blurEvent.emit($event);
2589
- if (!this.isOpen && !this.disabled) {
2595
+ if (!this.isOpen() && !this.disabled()) {
2590
2596
  this._onTouched();
2591
2597
  }
2592
2598
  if (this._editableSearchTerm) {
@@ -2611,61 +2617,57 @@ class NgSelectComponent {
2611
2617
  }
2612
2618
  _setItems(items) {
2613
2619
  const firstItem = items[0];
2614
- this.bindLabel = this.bindLabel || this._defaultLabel;
2615
- this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel === this._defaultLabel;
2620
+ this.bindLabel.set(this.bindLabel() || this._defaultLabel);
2621
+ this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel() === this._defaultLabel;
2616
2622
  this.itemsList.setItems(items);
2617
2623
  if (items.length > 0 && this.hasValue) {
2618
2624
  this.itemsList.mapSelectedItems();
2619
2625
  }
2620
- if (this.isOpen && isDefined(this.searchTerm) && !this._isTypeahead) {
2626
+ if (this.isOpen() && isDefined(this.searchTerm) && !this._isTypeahead) {
2621
2627
  this.itemsList.filter(this.searchTerm);
2622
2628
  }
2623
- if (this._isTypeahead || this.isOpen) {
2624
- this.itemsList.markSelectedOrDefault(this.markFirst);
2629
+ if (this._isTypeahead || this.isOpen()) {
2630
+ this.itemsList.markSelectedOrDefault(this.markFirst());
2625
2631
  }
2626
2632
  }
2627
2633
  _setItemsFromNgOptions() {
2628
2634
  const mapNgOptions = (options) => {
2629
- this.items = options.map((option) => ({
2630
- $ngOptionValue: option.value,
2635
+ const items = options.map((option) => ({
2636
+ $ngOptionValue: option.value(),
2631
2637
  $ngOptionLabel: option.elementRef.nativeElement.innerHTML,
2632
- disabled: option.disabled,
2633
- }));
2634
- this.itemsList.setItems(this.items);
2638
+ disabled: option.disabled(),
2639
+ })) ?? [];
2640
+ this.items.set(items);
2641
+ this.itemsList.setItems(items);
2635
2642
  if (this.hasValue) {
2636
2643
  this.itemsList.mapSelectedItems();
2637
2644
  }
2638
- this.detectChanges();
2639
2645
  };
2640
- const handleOptionChange = () => {
2641
- const changedOrDestroyed = merge(this.ngOptions.changes, this._destroy$);
2642
- merge(...this.ngOptions.map((option) => option.stateChange$))
2643
- .pipe(takeUntil(changedOrDestroyed))
2644
- .subscribe((option) => {
2646
+ const handleOptionChange = (options) => {
2647
+ return merge(...options.map((option) => option.stateChange$)).pipe(tap((option) => {
2645
2648
  const item = this.itemsList.findItem(option.value);
2646
2649
  item.disabled = option.disabled;
2647
2650
  item.label = option.label || item.label;
2648
- this._cd.detectChanges();
2649
- });
2651
+ }));
2650
2652
  };
2651
- this.ngOptions.changes.pipe(startWith(this.ngOptions), takeUntil(this._destroy$)).subscribe((options) => {
2652
- this.bindLabel = this._defaultLabel;
2653
+ this.ngOptionsObservable.pipe(startWith(this.ngOptions()), takeUntil(this._destroy$), tap((options) => {
2654
+ this.bindLabel.set(this._defaultLabel);
2653
2655
  mapNgOptions(options);
2654
- handleOptionChange();
2655
- });
2656
+ this._cd.detectChanges();
2657
+ }), switchMap((options) => handleOptionChange(options))).subscribe();
2656
2658
  }
2657
2659
  _isValidWriteValue(value) {
2658
- if (!isDefined(value) || (this.multiple && value === '') || (Array.isArray(value) && value.length === 0)) {
2660
+ if (!isDefined(value) || (this.multiple() && value === '') || (Array.isArray(value) && value.length === 0)) {
2659
2661
  return false;
2660
2662
  }
2661
2663
  const validateBinding = (item) => {
2662
- if (!isDefined(this.compareWith) && isObject(item) && this.bindValue) {
2664
+ if (!isDefined(this.compareWith()) && isObject(item) && this.bindValue()) {
2663
2665
  this._console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
2664
2666
  return false;
2665
2667
  }
2666
2668
  return true;
2667
2669
  };
2668
- if (this.multiple) {
2670
+ if (this.multiple()) {
2669
2671
  if (!Array.isArray(value)) {
2670
2672
  this._console.warn('Multiple select ngModel should be array.');
2671
2673
  return false;
@@ -2687,20 +2689,20 @@ class NgSelectComponent {
2687
2689
  }
2688
2690
  else {
2689
2691
  const isValObject = isObject(val);
2690
- const isPrimitive = !isValObject && !this.bindValue;
2692
+ const isPrimitive = !isValObject && !this.bindValue();
2691
2693
  if (isValObject || isPrimitive) {
2692
2694
  this.itemsList.select(this.itemsList.mapItem(val, null));
2693
2695
  }
2694
- else if (this.bindValue) {
2696
+ else if (this.bindValue()) {
2695
2697
  item = {
2696
- [this.bindLabel]: null,
2697
- [this.bindValue]: val,
2698
+ [this.bindLabel()]: null,
2699
+ [this.bindValue()]: val,
2698
2700
  };
2699
2701
  this.itemsList.select(this.itemsList.mapItem(item, null));
2700
2702
  }
2701
2703
  }
2702
2704
  };
2703
- if (this.multiple) {
2705
+ if (this.multiple()) {
2704
2706
  ngModel.forEach((item) => select(item));
2705
2707
  }
2706
2708
  else {
@@ -2708,7 +2710,7 @@ class NgSelectComponent {
2708
2710
  }
2709
2711
  }
2710
2712
  _handleKeyPresses() {
2711
- if (this.searchable) {
2713
+ if (this.searchable()) {
2712
2714
  return;
2713
2715
  }
2714
2716
  this._keyPress$
@@ -2716,7 +2718,7 @@ class NgSelectComponent {
2716
2718
  .subscribe((term) => {
2717
2719
  const item = this.itemsList.findByLabel(term);
2718
2720
  if (item) {
2719
- if (this.isOpen) {
2721
+ if (this.isOpen()) {
2720
2722
  this.itemsList.markItem(item);
2721
2723
  this._scrollToMarked();
2722
2724
  this._cd.markForCheck();
@@ -2729,14 +2731,14 @@ class NgSelectComponent {
2729
2731
  });
2730
2732
  }
2731
2733
  _setInputAttributes() {
2732
- const input = this.searchInput.nativeElement;
2734
+ const input = this.searchInput().nativeElement;
2733
2735
  const attributes = {
2734
2736
  type: 'text',
2735
2737
  autocorrect: 'off',
2736
2738
  autocapitalize: 'off',
2737
2739
  autocomplete: 'off',
2738
2740
  'aria-controls': this.dropdownId,
2739
- ...this.inputAttrs,
2741
+ ...this.inputAttrs(),
2740
2742
  };
2741
2743
  for (const key of Object.keys(attributes)) {
2742
2744
  input.setAttribute(key, attributes[key]);
@@ -2748,14 +2750,14 @@ class NgSelectComponent {
2748
2750
  _updateNgModel() {
2749
2751
  const model = [];
2750
2752
  for (const item of this.selectedItems) {
2751
- if (this.bindValue) {
2753
+ if (this.bindValue()) {
2752
2754
  let value = null;
2753
2755
  if (item.children) {
2754
- const groupKey = this.groupValue ? this.bindValue : this.groupBy;
2755
- value = item.value[groupKey || this.groupBy];
2756
+ const groupKey = this.groupValue() ? this.bindValue() : this.groupBy();
2757
+ value = item.value[groupKey || this.groupBy()];
2756
2758
  }
2757
2759
  else {
2758
- value = this.itemsList.resolveNested(item.value, this.bindValue);
2760
+ value = this.itemsList.resolveNested(item.value, this.bindValue());
2759
2761
  }
2760
2762
  model.push(value);
2761
2763
  }
@@ -2764,7 +2766,7 @@ class NgSelectComponent {
2764
2766
  }
2765
2767
  }
2766
2768
  const selected = this.selectedItems.map((x) => x.value);
2767
- if (this.multiple) {
2769
+ if (this.multiple()) {
2768
2770
  this._onChange(model);
2769
2771
  this.changeEvent.emit(selected);
2770
2772
  }
@@ -2784,39 +2786,40 @@ class NgSelectComponent {
2784
2786
  _changeSearch(searchTerm) {
2785
2787
  this.searchTerm = searchTerm;
2786
2788
  if (this._isTypeahead) {
2787
- this.typeahead.next(searchTerm);
2789
+ this.typeahead().next(searchTerm);
2788
2790
  }
2789
2791
  }
2790
2792
  _scrollToMarked() {
2791
- if (!this.isOpen || !this.dropdownPanel) {
2793
+ if (!this.isOpen() || !this.dropdownPanel()) {
2792
2794
  return;
2793
2795
  }
2794
- this.dropdownPanel.scrollTo(this.itemsList.markedItem);
2796
+ this.dropdownPanel().scrollTo(this.itemsList.markedItem);
2795
2797
  }
2796
2798
  _scrollToTag() {
2797
- if (!this.isOpen || !this.dropdownPanel) {
2799
+ if (!this.isOpen() || !this.dropdownPanel()) {
2798
2800
  return;
2799
2801
  }
2800
- this.dropdownPanel.scrollToTag();
2802
+ this.dropdownPanel().scrollToTag();
2801
2803
  }
2802
2804
  _onSelectionChanged() {
2803
- if (this.isOpen && this.deselectOnClick && this.appendTo) {
2805
+ const appendTo = this.appendTo() ?? this.config.appendTo;
2806
+ if (this.isOpen() && this.deselectOnClickValue() && appendTo) {
2804
2807
  // Make sure items are rendered.
2805
2808
  this._cd.detectChanges();
2806
- this.dropdownPanel.adjustPosition();
2809
+ this.dropdownPanel().adjustPosition();
2807
2810
  }
2808
2811
  }
2809
2812
  _handleTab($event) {
2810
- if (this.isOpen === false) {
2813
+ if (this.isOpen() === false) {
2811
2814
  if (this.showClear() && !$event.shiftKey && this.tabFocusOnClear()) {
2812
2815
  this.focusOnClear();
2813
2816
  $event.preventDefault();
2814
2817
  }
2815
- else if (!this.addTag) {
2818
+ else if (!this.addTag()) {
2816
2819
  return;
2817
2820
  }
2818
2821
  }
2819
- if (this.selectOnTab) {
2822
+ if (this.selectOnTab()) {
2820
2823
  if (this.itemsList.markedItem) {
2821
2824
  this.toggleItem(this.itemsList.markedItem);
2822
2825
  $event.preventDefault();
@@ -2834,7 +2837,8 @@ class NgSelectComponent {
2834
2837
  }
2835
2838
  }
2836
2839
  _handleEnter($event) {
2837
- if (this.isOpen || this._manualOpen) {
2840
+ const openOnEnter = this.openOnEnter() ?? this.config.openOnEnter;
2841
+ if (this.isOpen() || this._manualOpen) {
2838
2842
  if (this.itemsList.markedItem) {
2839
2843
  this.toggleItem(this.itemsList.markedItem);
2840
2844
  }
@@ -2842,7 +2846,7 @@ class NgSelectComponent {
2842
2846
  this.selectTag();
2843
2847
  }
2844
2848
  }
2845
- else if (this.openOnEnter) {
2849
+ else if (openOnEnter) {
2846
2850
  this.open();
2847
2851
  }
2848
2852
  else {
@@ -2851,7 +2855,7 @@ class NgSelectComponent {
2851
2855
  $event.preventDefault();
2852
2856
  }
2853
2857
  _handleSpace($event) {
2854
- if (this.isOpen || this._manualOpen) {
2858
+ if (this.isOpen() || this._manualOpen) {
2855
2859
  return;
2856
2860
  }
2857
2861
  this.open();
@@ -2870,7 +2874,7 @@ class NgSelectComponent {
2870
2874
  $event.preventDefault();
2871
2875
  }
2872
2876
  _handleArrowUp($event) {
2873
- if (!this.isOpen) {
2877
+ if (!this.isOpen()) {
2874
2878
  return;
2875
2879
  }
2876
2880
  if (this._nextItemIsTag(-1)) {
@@ -2885,13 +2889,13 @@ class NgSelectComponent {
2885
2889
  }
2886
2890
  _nextItemIsTag(nextStep) {
2887
2891
  const nextIndex = this.itemsList.markedIndex + nextStep;
2888
- return (this.addTag && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
2892
+ return (this.addTag() && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
2889
2893
  }
2890
2894
  _handleBackspace() {
2891
- if (this.searchTerm || !this.clearable || !this.clearOnBackspace || !this.hasValue) {
2895
+ if (this.searchTerm || !this.clearable() || !this.clearOnBackspace() || !this.hasValue) {
2892
2896
  return;
2893
2897
  }
2894
- if (this.multiple) {
2898
+ if (this.multiple()) {
2895
2899
  this.unselect(this.itemsList.lastSelectedItem);
2896
2900
  }
2897
2901
  else {
@@ -2899,19 +2903,9 @@ class NgSelectComponent {
2899
2903
  }
2900
2904
  }
2901
2905
  _mergeGlobalConfig(config) {
2902
- this.placeholder = this.placeholder || config.placeholder;
2903
- this.fixedPlaceholder = this.fixedPlaceholder || config.fixedPlaceholder;
2904
- this.notFoundText = this.notFoundText || config.notFoundText;
2905
- this.typeToSearchText = this.typeToSearchText || config.typeToSearchText;
2906
- this.addTagText = this.addTagText || config.addTagText;
2907
- this.loadingText = this.loadingText || config.loadingText;
2908
- this.clearAllText = this.clearAllText || config.clearAllText;
2909
- this.virtualScroll = this.getVirtualScroll(config);
2910
- this.openOnEnter = isDefined(this.openOnEnter) ? this.openOnEnter : config.openOnEnter;
2911
- this.appendTo = this.appendTo || config.appendTo;
2912
- this.bindValue = this.bindValue || config.bindValue;
2913
- this.bindLabel = this.bindLabel || config.bindLabel;
2914
- this.appearance = this.appearance || config.appearance;
2906
+ this.bindValue.set(this.bindValue() || config.bindValue);
2907
+ this.bindLabel.set(this.bindLabel() || config.bindLabel);
2908
+ this.appearance.set(this.appearance() || config.appearance);
2915
2909
  this._setTabFocusOnClear();
2916
2910
  }
2917
2911
  /**
@@ -2922,7 +2916,7 @@ class NgSelectComponent {
2922
2916
  * @returns `true` if virtual scroll is enabled, `false` otherwise
2923
2917
  */
2924
2918
  getVirtualScroll(config) {
2925
- return isDefined(this.virtualScroll) ? this.virtualScroll : this.isVirtualScrollDisabled(config);
2919
+ return isDefined(this.virtualScroll) ? this.virtualScroll() : this.isVirtualScrollDisabled(config);
2926
2920
  }
2927
2921
  /**
2928
2922
  * Gets disableVirtualScroll value from input or from config
@@ -2934,15 +2928,15 @@ class NgSelectComponent {
2934
2928
  isVirtualScrollDisabled(config) {
2935
2929
  return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
2936
2930
  }
2937
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [{ token: 'class', attribute: true }, { token: 'autofocus', attribute: true }, { token: NgSelectConfig }, { token: SELECTION_MODEL_FACTORY, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: ConsoleService }], target: i0.ɵɵFactoryTarget.Component }); }
2938
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgSelectComponent, isStandalone: true, selector: "ng-select", inputs: { ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: false, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: false, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, markFirst: { classPropertyName: "markFirst", publicName: "markFirst", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, fixedPlaceholder: { classPropertyName: "fixedPlaceholder", publicName: "fixedPlaceholder", isSignal: false, isRequired: false, transformFunction: null }, notFoundText: { classPropertyName: "notFoundText", publicName: "notFoundText", isSignal: false, isRequired: false, transformFunction: null }, typeToSearchText: { classPropertyName: "typeToSearchText", publicName: "typeToSearchText", isSignal: false, isRequired: false, transformFunction: null }, preventToggleOnRightClick: { classPropertyName: "preventToggleOnRightClick", publicName: "preventToggleOnRightClick", isSignal: false, isRequired: false, transformFunction: null }, addTagText: { classPropertyName: "addTagText", publicName: "addTagText", isSignal: false, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: false, isRequired: false, transformFunction: null }, clearAllText: { classPropertyName: "clearAllText", publicName: "clearAllText", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectOnTab: { classPropertyName: "selectOnTab", publicName: "selectOnTab", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, openOnEnter: { classPropertyName: "openOnEnter", publicName: "openOnEnter", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: false, isRequired: false, transformFunction: numberAttribute }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: false, isRequired: false, transformFunction: null }, groupValue: { classPropertyName: "groupValue", publicName: "groupValue", isSignal: false, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: false, isRequired: false, transformFunction: numberAttribute }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectableGroup: { classPropertyName: "selectableGroup", publicName: "selectableGroup", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectableGroupAsModel: { classPropertyName: "selectableGroupAsModel", publicName: "selectableGroupAsModel", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: false, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: false, isRequired: false, transformFunction: null }, clearOnBackspace: { classPropertyName: "clearOnBackspace", publicName: "clearOnBackspace", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, labelForId: { classPropertyName: "labelForId", publicName: "labelForId", isSignal: false, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, tabFocusOnClearButton: { classPropertyName: "tabFocusOnClearButton", publicName: "tabFocusOnClearButton", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, searchWhileComposing: { classPropertyName: "searchWhileComposing", publicName: "searchWhileComposing", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, minTermLength: { classPropertyName: "minTermLength", publicName: "minTermLength", isSignal: false, isRequired: false, transformFunction: numberAttribute }, editableSearchTerm: { classPropertyName: "editableSearchTerm", publicName: "editableSearchTerm", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, ngClass: { classPropertyName: "ngClass", publicName: "ngClass", isSignal: false, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: false, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: false, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, clearSearchOnAdd: { classPropertyName: "clearSearchOnAdd", publicName: "clearSearchOnAdd", isSignal: false, isRequired: false, transformFunction: null }, deselectOnClick: { classPropertyName: "deselectOnClick", publicName: "deselectOnClick", isSignal: false, isRequired: false, transformFunction: null }, keyDownFn: { classPropertyName: "keyDownFn", publicName: "keyDownFn", isSignal: false, isRequired: false, transformFunction: null } }, 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-typeahead": "this.typeahead", "class.ng-select-multiple": "this.multiple", "class.ng-select-taggable": "this.addTag", "class.ng-select-searchable": "this.searchable", "class.ng-select-clearable": "this.clearable", "class.ng-select-opened": "this.isOpen", "class.ng-select": "this.useDefaultClass", "class.ng-select-filtered": "this.filtered", "class.ng-select-single": "this.single", "class.ng-select-disabled": "this.disabled" } }, providers: [
2931
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2932
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgSelectComponent, isStandalone: true, selector: "ng-select", inputs: { ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, markFirst: { classPropertyName: "markFirst", publicName: "markFirst", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fixedPlaceholder: { classPropertyName: "fixedPlaceholder", publicName: "fixedPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, notFoundText: { classPropertyName: "notFoundText", publicName: "notFoundText", isSignal: true, isRequired: false, transformFunction: null }, typeToSearchText: { classPropertyName: "typeToSearchText", publicName: "typeToSearchText", isSignal: true, isRequired: false, transformFunction: null }, preventToggleOnRightClick: { classPropertyName: "preventToggleOnRightClick", publicName: "preventToggleOnRightClick", isSignal: true, isRequired: false, transformFunction: null }, addTagText: { classPropertyName: "addTagText", publicName: "addTagText", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, clearAllText: { classPropertyName: "clearAllText", publicName: "clearAllText", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: true, isRequired: false, transformFunction: null }, selectOnTab: { classPropertyName: "selectOnTab", publicName: "selectOnTab", isSignal: true, isRequired: false, transformFunction: null }, openOnEnter: { classPropertyName: "openOnEnter", publicName: "openOnEnter", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, groupValue: { classPropertyName: "groupValue", publicName: "groupValue", isSignal: true, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, selectableGroup: { classPropertyName: "selectableGroup", publicName: "selectableGroup", isSignal: true, isRequired: false, transformFunction: null }, tabFocusOnClearButton: { classPropertyName: "tabFocusOnClearButton", publicName: "tabFocusOnClearButton", isSignal: true, isRequired: false, transformFunction: null }, selectableGroupAsModel: { classPropertyName: "selectableGroupAsModel", publicName: "selectableGroupAsModel", isSignal: true, isRequired: false, transformFunction: null }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null }, clearOnBackspace: { classPropertyName: "clearOnBackspace", publicName: "clearOnBackspace", isSignal: true, isRequired: false, transformFunction: null }, labelForId: { classPropertyName: "labelForId", publicName: "labelForId", isSignal: true, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, searchWhileComposing: { classPropertyName: "searchWhileComposing", publicName: "searchWhileComposing", isSignal: true, isRequired: false, transformFunction: null }, minTermLength: { classPropertyName: "minTermLength", publicName: "minTermLength", isSignal: true, isRequired: false, transformFunction: null }, editableSearchTerm: { classPropertyName: "editableSearchTerm", publicName: "editableSearchTerm", isSignal: true, isRequired: false, transformFunction: null }, ngClass: { classPropertyName: "ngClass", publicName: "ngClass", isSignal: true, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, deselectOnClick: { classPropertyName: "deselectOnClick", publicName: "deselectOnClick", isSignal: true, isRequired: false, transformFunction: null }, clearSearchOnAdd: { classPropertyName: "clearSearchOnAdd", publicName: "clearSearchOnAdd", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, keyDownFn: { classPropertyName: "keyDownFn", publicName: "keyDownFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { bindLabel: "bindLabelChange", bindValue: "bindValueChange", appearance: "appearanceChange", isOpen: "isOpenChange", items: "itemsChange", 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": "true", "class.ng-select-single": "!multiple()", "class.ng-select-typeahead": "typeahead()", "class.ng-select-multiple": "multiple()", "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()" } }, providers: [
2939
2933
  {
2940
2934
  provide: NG_VALUE_ACCESSOR,
2941
2935
  useExisting: forwardRef(() => NgSelectComponent),
2942
2936
  multi: true,
2943
2937
  },
2944
2938
  NgDropdownPanelService,
2945
- ], queries: [{ propertyName: "optionTemplate", first: true, predicate: NgOptionTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "optgroupTemplate", first: true, predicate: NgOptgroupTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: NgLabelTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "multiLabelTemplate", first: true, predicate: NgMultiLabelTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "headerTemplate", first: true, predicate: NgHeaderTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "footerTemplate", first: true, predicate: NgFooterTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "notFoundTemplate", first: true, predicate: NgNotFoundTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "placeholderTemplate", first: true, predicate: NgPlaceholderTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "typeToSearchTemplate", first: true, predicate: NgTypeToSearchTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "loadingTextTemplate", first: true, predicate: NgLoadingTextTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "tagTemplate", first: true, predicate: NgTagTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: NgLoadingSpinnerTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "clearButtonTemplate", first: true, predicate: NgClearButtonTemplateDirective, descendants: true, read: TemplateRef }, { propertyName: "ngOptions", predicate: NgOptionComponent, descendants: true }], viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: i0.forwardRef(() => NgDropdownPanelComponent), 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: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.id]=\"labelForId\"\n\t\t\t\t[attr.tabindex]=\"tabIndex\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen) {\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll\"\n\t\t[bufferAmount]=\"bufferAmount\"\n\t\t[appendTo]=\"appendTo\"\n\t\t[position]=\"dropdownPosition\"\n\t\t[headerTemplate]=\"headerTemplate\"\n\t\t[footerTemplate]=\"footerTemplate\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple\"\n\t\t[ngClass]=\"appendTo ? (ngClass ? ngClass : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate || defaultOptionTemplate : optionTemplate || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .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{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgItemLabelDirective, selector: "[ngItemLabel]", inputs: ["ngItemLabel", "escape"] }, { kind: "component", type: NgDropdownPanelComponent, selector: "ng-dropdown-panel", inputs: ["items", "markedItem", "position", "appendTo", "bufferAmount", "virtualScroll", "headerTemplate", "footerTemplate", "filterValue", "ariaLabelDropdown"], outputs: ["update", "scroll", "scrollToEnd", "outsideClick"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2939
+ ], queries: [{ propertyName: "optionTemplate", first: true, predicate: NgOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "optgroupTemplate", first: true, predicate: NgOptgroupTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: NgLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "multiLabelTemplate", first: true, predicate: NgMultiLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: NgHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: NgFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "notFoundTemplate", first: true, predicate: NgNotFoundTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: NgPlaceholderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "typeToSearchTemplate", first: true, predicate: NgTypeToSearchTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingTextTemplate", first: true, predicate: NgLoadingTextTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: NgTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: NgLoadingSpinnerTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "clearButtonTemplate", first: true, predicate: NgClearButtonTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "ngOptions", predicate: NgOptionComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: i0.forwardRef(() => NgDropdownPanelComponent), descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "clearButton", first: true, predicate: ["clearButton"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance() === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || (fixedPlaceholder() ?? config.fixedPlaceholder )) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder() ?? config.placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate() || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate() || !multiple()) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate() || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple() && multiLabelTemplate() && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate()\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen() ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen() ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen()\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t\t[attr.id]=\"labelForId()\"\n\t\t\t\t[attr.tabindex]=\"tabIndex()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t[readOnly]=\"!searchable() || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading()) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate() || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate()) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate()\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText() || config.clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen()) {\n\t@let appendToValue = appendTo() || config.appendTo;\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll() ?? !config.disableVirtualScroll ?? false\"\n\t\t[bufferAmount]=\"bufferAmount()\"\n\t\t[appendTo]=\"appendToValue\"\n\t\t[position]=\"dropdownPosition()\"\n\t\t[headerTemplate]=\"headerTemplate()\"\n\t\t[footerTemplate]=\"footerTemplate()\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple()\"\n\t\t[class]=\"appendToValue ? (ngClass() ? ngClass() : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown()\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate() || defaultOptionTemplate : optionTemplate() || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText() || config.addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate() || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText() ?? config.notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate() || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText() || config.typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate() || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading() && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText() || config.loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate() || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .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{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgItemLabelDirective, selector: "[ngItemLabel]", inputs: ["ngItemLabel", "escape"] }, { kind: "component", type: NgDropdownPanelComponent, 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 }); }
2946
2940
  }
2947
2941
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, decorators: [{
2948
2942
  type: Component,
@@ -2953,253 +2947,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
2953
2947
  multi: true,
2954
2948
  },
2955
2949
  NgDropdownPanelService,
2956
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, NgItemLabelDirective, NgDropdownPanelComponent, NgClass], template: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || fixedPlaceholder) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate || !multiple) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple && multiLabelTemplate && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.id]=\"labelForId\"\n\t\t\t\t[attr.tabindex]=\"tabIndex\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readOnly]=\"!searchable || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen) {\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll\"\n\t\t[bufferAmount]=\"bufferAmount\"\n\t\t[appendTo]=\"appendTo\"\n\t\t[position]=\"dropdownPosition\"\n\t\t[headerTemplate]=\"headerTemplate\"\n\t\t[footerTemplate]=\"footerTemplate\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple\"\n\t\t[ngClass]=\"appendTo ? (ngClass ? ngClass : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate || defaultOptionTemplate : optionTemplate || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .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{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"] }]
2957
- }], ctorParameters: () => [{ type: undefined, decorators: [{
2958
- type: Attribute,
2959
- args: ['class']
2960
- }] }, { type: undefined, decorators: [{
2961
- type: Attribute,
2962
- args: ['autofocus']
2963
- }] }, { type: NgSelectConfig }, { type: undefined, decorators: [{
2964
- type: Inject,
2965
- args: [SELECTION_MODEL_FACTORY]
2966
- }, {
2967
- type: Optional
2968
- }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: ConsoleService }], propDecorators: { ariaLabelDropdown: [{
2969
- type: Input
2970
- }], bindLabel: [{
2971
- type: Input
2972
- }], bindValue: [{
2973
- type: Input
2974
- }], ariaLabel: [{
2975
- type: Input
2976
- }], markFirst: [{
2977
- type: Input,
2978
- args: [{ transform: booleanAttribute }]
2979
- }], placeholder: [{
2980
- type: Input
2981
- }], fixedPlaceholder: [{
2982
- type: Input
2983
- }], notFoundText: [{
2984
- type: Input
2985
- }], typeToSearchText: [{
2986
- type: Input
2987
- }], preventToggleOnRightClick: [{
2988
- type: Input
2989
- }], addTagText: [{
2990
- type: Input
2991
- }], loadingText: [{
2992
- type: Input
2993
- }], clearAllText: [{
2994
- type: Input
2995
- }], appearance: [{
2996
- type: Input
2997
- }], dropdownPosition: [{
2998
- type: Input
2999
- }], appendTo: [{
3000
- type: Input
3001
- }], loading: [{
3002
- type: Input,
3003
- args: [{ transform: booleanAttribute }]
3004
- }], closeOnSelect: [{
3005
- type: Input,
3006
- args: [{ transform: booleanAttribute }]
3007
- }], hideSelected: [{
3008
- type: Input,
3009
- args: [{ transform: booleanAttribute }]
3010
- }], selectOnTab: [{
3011
- type: Input,
3012
- args: [{ transform: booleanAttribute }]
3013
- }], openOnEnter: [{
3014
- type: Input,
3015
- args: [{ transform: booleanAttribute }]
3016
- }], maxSelectedItems: [{
3017
- type: Input,
3018
- args: [{ transform: numberAttribute }]
3019
- }], groupBy: [{
3020
- type: Input
3021
- }], groupValue: [{
3022
- type: Input
3023
- }], bufferAmount: [{
3024
- type: Input,
3025
- args: [{ transform: numberAttribute }]
3026
- }], virtualScroll: [{
3027
- type: Input,
3028
- args: [{ transform: booleanAttribute }]
3029
- }], selectableGroup: [{
3030
- type: Input,
3031
- args: [{ transform: booleanAttribute }]
3032
- }], selectableGroupAsModel: [{
3033
- type: Input,
3034
- args: [{ transform: booleanAttribute }]
3035
- }], searchFn: [{
3036
- type: Input
3037
- }], trackByFn: [{
3038
- type: Input
3039
- }], clearOnBackspace: [{
3040
- type: Input,
3041
- args: [{ transform: booleanAttribute }]
3042
- }], labelForId: [{
3043
- type: Input
3044
- }], inputAttrs: [{
3045
- type: Input
3046
- }], tabIndex: [{
3047
- type: Input,
3048
- args: [{ transform: numberAttribute }]
3049
- }], readonly: [{
3050
- type: Input,
3051
- args: [{ transform: booleanAttribute }]
3052
- }], searchWhileComposing: [{
3053
- type: Input,
3054
- args: [{ transform: booleanAttribute }]
3055
- }], minTermLength: [{
3056
- type: Input,
3057
- args: [{ transform: numberAttribute }]
3058
- }], editableSearchTerm: [{
3059
- type: Input,
3060
- args: [{ transform: booleanAttribute }]
3061
- }], ngClass: [{
3062
- type: Input
3063
- }], typeahead: [{
3064
- type: Input
3065
- }, {
3066
- type: HostBinding,
3067
- args: ['class.ng-select-typeahead']
3068
- }], multiple: [{
3069
- type: Input,
3070
- args: [{ transform: booleanAttribute }]
3071
- }, {
3072
- type: HostBinding,
3073
- args: ['class.ng-select-multiple']
3074
- }], addTag: [{
3075
- type: Input
3076
- }, {
3077
- type: HostBinding,
3078
- args: ['class.ng-select-taggable']
3079
- }], searchable: [{
3080
- type: Input,
3081
- args: [{ transform: booleanAttribute }]
3082
- }, {
3083
- type: HostBinding,
3084
- args: ['class.ng-select-searchable']
3085
- }], clearable: [{
3086
- type: Input,
3087
- args: [{ transform: booleanAttribute }]
3088
- }, {
3089
- type: HostBinding,
3090
- args: ['class.ng-select-clearable']
3091
- }], isOpen: [{
3092
- type: Input
3093
- }, {
3094
- type: HostBinding,
3095
- args: ['class.ng-select-opened']
3096
- }], blurEvent: [{
3097
- type: Output,
3098
- args: ['blur']
3099
- }], focusEvent: [{
3100
- type: Output,
3101
- args: ['focus']
3102
- }], changeEvent: [{
3103
- type: Output,
3104
- args: ['change']
3105
- }], openEvent: [{
3106
- type: Output,
3107
- args: ['open']
3108
- }], closeEvent: [{
3109
- type: Output,
3110
- args: ['close']
3111
- }], searchEvent: [{
3112
- type: Output,
3113
- args: ['search']
3114
- }], clearEvent: [{
3115
- type: Output,
3116
- args: ['clear']
3117
- }], addEvent: [{
3118
- type: Output,
3119
- args: ['add']
3120
- }], removeEvent: [{
3121
- type: Output,
3122
- args: ['remove']
3123
- }], scroll: [{
3124
- type: Output,
3125
- args: ['scroll']
3126
- }], scrollToEnd: [{
3127
- type: Output,
3128
- args: ['scrollToEnd']
3129
- }], optionTemplate: [{
3130
- type: ContentChild,
3131
- args: [NgOptionTemplateDirective, { read: TemplateRef }]
3132
- }], optgroupTemplate: [{
3133
- type: ContentChild,
3134
- args: [NgOptgroupTemplateDirective, { read: TemplateRef }]
3135
- }], labelTemplate: [{
3136
- type: ContentChild,
3137
- args: [NgLabelTemplateDirective, { read: TemplateRef }]
3138
- }], multiLabelTemplate: [{
3139
- type: ContentChild,
3140
- args: [NgMultiLabelTemplateDirective, { read: TemplateRef }]
3141
- }], headerTemplate: [{
3142
- type: ContentChild,
3143
- args: [NgHeaderTemplateDirective, { read: TemplateRef }]
3144
- }], footerTemplate: [{
3145
- type: ContentChild,
3146
- args: [NgFooterTemplateDirective, { read: TemplateRef }]
3147
- }], notFoundTemplate: [{
3148
- type: ContentChild,
3149
- args: [NgNotFoundTemplateDirective, { read: TemplateRef }]
3150
- }], placeholderTemplate: [{
3151
- type: ContentChild,
3152
- args: [NgPlaceholderTemplateDirective, { read: TemplateRef }]
3153
- }], typeToSearchTemplate: [{
3154
- type: ContentChild,
3155
- args: [NgTypeToSearchTemplateDirective, { read: TemplateRef }]
3156
- }], loadingTextTemplate: [{
3157
- type: ContentChild,
3158
- args: [NgLoadingTextTemplateDirective, { read: TemplateRef }]
3159
- }], tagTemplate: [{
3160
- type: ContentChild,
3161
- args: [NgTagTemplateDirective, { read: TemplateRef }]
3162
- }], loadingSpinnerTemplate: [{
3163
- type: ContentChild,
3164
- args: [NgLoadingSpinnerTemplateDirective, { read: TemplateRef }]
3165
- }], clearButtonTemplate: [{
3166
- type: ContentChild,
3167
- args: [NgClearButtonTemplateDirective, { read: TemplateRef }]
3168
- }], dropdownPanel: [{
3169
- type: ViewChild,
3170
- args: [forwardRef(() => NgDropdownPanelComponent)]
3171
- }], searchInput: [{
3172
- type: ViewChild,
3173
- args: ['searchInput', { static: true }]
3174
- }], clearButton: [{
3175
- type: ViewChild,
3176
- args: ['clearButton']
3177
- }], ngOptions: [{
3178
- type: ContentChildren,
3179
- args: [NgOptionComponent, { descendants: true }]
3180
- }], useDefaultClass: [{
3181
- type: HostBinding,
3182
- args: ['class.ng-select']
3183
- }], filtered: [{
3184
- type: HostBinding,
3185
- args: ['class.ng-select-filtered']
3186
- }], single: [{
3187
- type: HostBinding,
3188
- args: ['class.ng-select-single']
3189
- }], items: [{
3190
- type: Input
3191
- }], disabled: [{
3192
- type: HostBinding,
3193
- args: ['class.ng-select-disabled']
3194
- }], compareWith: [{
3195
- type: Input
3196
- }], clearSearchOnAdd: [{
3197
- type: Input
3198
- }], deselectOnClick: [{
3199
- type: Input
3200
- }], keyDownFn: [{
3201
- type: Input
3202
- }], handleKeyDown: [{
2950
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, NgItemLabelDirective, NgDropdownPanelComponent], host: {
2951
+ '[class.ng-select]': 'true',
2952
+ '[class.ng-select-single]': '!multiple()',
2953
+ '[class.ng-select-typeahead]': 'typeahead()',
2954
+ '[class.ng-select-multiple]': 'multiple()',
2955
+ '[class.ng-select-taggable]': 'addTag()',
2956
+ '[class.ng-select-searchable]': 'searchable()',
2957
+ '[class.ng-select-clearable]': 'clearable()',
2958
+ '[class.ng-select-opened]': 'isOpen()',
2959
+ '[class.ng-select-filtered]': 'filtered',
2960
+ '[class.ng-select-disabled]': 'disabled()',
2961
+ }, template: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance() === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || (fixedPlaceholder() ?? config.fixedPlaceholder )) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder() ?? config.placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate() || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate() || !multiple()) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate() || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple() && multiLabelTemplate() && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate()\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen() ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen() ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen()\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t\t[attr.id]=\"labelForId()\"\n\t\t\t\t[attr.tabindex]=\"tabIndex()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t[readOnly]=\"!searchable() || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading()) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate() || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate()) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate()\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText() || config.clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen()) {\n\t@let appendToValue = appendTo() || config.appendTo;\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll() ?? !config.disableVirtualScroll ?? false\"\n\t\t[bufferAmount]=\"bufferAmount()\"\n\t\t[appendTo]=\"appendToValue\"\n\t\t[position]=\"dropdownPosition()\"\n\t\t[headerTemplate]=\"headerTemplate()\"\n\t\t[footerTemplate]=\"footerTemplate()\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple()\"\n\t\t[class]=\"appendToValue ? (ngClass() ? ngClass() : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown()\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate() || defaultOptionTemplate : optionTemplate() || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText() || config.addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate() || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText() ?? config.notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate() || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText() || config.typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate() || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading() && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText() || config.loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate() || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .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{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"] }]
2962
+ }], ctorParameters: () => [], propDecorators: { handleKeyDown: [{
3203
2963
  type: HostListener,
3204
2964
  args: ['keydown', ['$event']]
3205
2965
  }] } });
@@ -3237,7 +2997,7 @@ class NgSelectModule {
3237
2997
  NgTagTemplateDirective,
3238
2998
  NgLoadingSpinnerTemplateDirective,
3239
2999
  NgClearButtonTemplateDirective] }); }
3240
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers: [{ provide: SELECTION_MODEL_FACTORY, useValue: DefaultSelectionModelFactory }] }); }
3000
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers: provideNgSelect() }); }
3241
3001
  }
3242
3002
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, decorators: [{
3243
3003
  type: NgModule,
@@ -3278,9 +3038,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
3278
3038
  NgLoadingSpinnerTemplateDirective,
3279
3039
  NgClearButtonTemplateDirective
3280
3040
  ],
3281
- providers: [{ provide: SELECTION_MODEL_FACTORY, useValue: DefaultSelectionModelFactory }],
3041
+ providers: provideNgSelect(),
3282
3042
  }]
3283
3043
  }] });
3044
+ function provideNgSelect() {
3045
+ return [
3046
+ {
3047
+ provide: SELECTION_MODEL_FACTORY,
3048
+ useValue: DefaultSelectionModelFactory,
3049
+ },
3050
+ ];
3051
+ }
3284
3052
 
3285
3053
  /*
3286
3054
  * Public API Surface of ng-select