@ng-select/ng-select 20.1.3 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ng-select-ng-select.mjs +507 -742
- package/fesm2022/ng-select-ng-select.mjs.map +1 -1
- package/index.d.ts +257 -301
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
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,
|
|
6
|
-
import {
|
|
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(
|
|
35
|
-
this.element =
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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: [
|
|
42
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
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: () => [
|
|
51
|
-
type: Input
|
|
52
|
-
}], escape: [{
|
|
53
|
-
type: Input
|
|
54
|
-
}] } });
|
|
54
|
+
}], ctorParameters: () => [] });
|
|
55
55
|
class NgOptionTemplateDirective {
|
|
56
|
-
constructor(
|
|
57
|
-
this.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: [
|
|
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
|
-
}]
|
|
69
|
+
}] });
|
|
70
70
|
class NgOptgroupTemplateDirective {
|
|
71
|
-
constructor(
|
|
72
|
-
this.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: [
|
|
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
|
-
}]
|
|
84
|
+
}] });
|
|
85
85
|
class NgLabelTemplateDirective {
|
|
86
|
-
constructor(
|
|
87
|
-
this.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: [
|
|
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
|
-
}]
|
|
99
|
+
}] });
|
|
100
100
|
class NgMultiLabelTemplateDirective {
|
|
101
|
-
constructor(
|
|
102
|
-
this.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: [
|
|
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
|
-
}]
|
|
114
|
+
}] });
|
|
115
115
|
class NgHeaderTemplateDirective {
|
|
116
|
-
constructor(
|
|
117
|
-
this.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: [
|
|
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
|
-
}]
|
|
129
|
+
}] });
|
|
130
130
|
class NgFooterTemplateDirective {
|
|
131
|
-
constructor(
|
|
132
|
-
this.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: [
|
|
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
|
-
}]
|
|
144
|
+
}] });
|
|
145
145
|
class NgNotFoundTemplateDirective {
|
|
146
|
-
constructor(
|
|
147
|
-
this.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: [
|
|
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
|
-
}]
|
|
159
|
+
}] });
|
|
160
160
|
class NgPlaceholderTemplateDirective {
|
|
161
|
-
constructor(
|
|
162
|
-
this.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: [
|
|
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
|
-
}]
|
|
174
|
+
}] });
|
|
175
175
|
class NgTypeToSearchTemplateDirective {
|
|
176
|
-
constructor(
|
|
177
|
-
this.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: [
|
|
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
|
-
}]
|
|
189
|
+
}] });
|
|
190
190
|
class NgLoadingTextTemplateDirective {
|
|
191
|
-
constructor(
|
|
192
|
-
this.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: [
|
|
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
|
-
}]
|
|
204
|
+
}] });
|
|
205
205
|
class NgTagTemplateDirective {
|
|
206
|
-
constructor(
|
|
207
|
-
this.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: [
|
|
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
|
-
}]
|
|
219
|
+
}] });
|
|
220
220
|
class NgLoadingSpinnerTemplateDirective {
|
|
221
|
-
constructor(
|
|
222
|
-
this.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: [
|
|
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
|
-
}]
|
|
234
|
+
}] });
|
|
235
235
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
236
236
|
class NgClearButtonTemplateDirective {
|
|
237
|
-
constructor(
|
|
238
|
-
this.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: [
|
|
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
|
-
}]
|
|
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
|
-
|
|
1145
|
-
|
|
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
|
-
|
|
1172
|
-
|
|
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 =
|
|
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(
|
|
1533
|
-
this._renderer =
|
|
1534
|
-
this._zone =
|
|
1535
|
-
this._panelService =
|
|
1536
|
-
this._document =
|
|
1537
|
-
this.
|
|
1538
|
-
this.
|
|
1539
|
-
this.
|
|
1540
|
-
this.
|
|
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 =
|
|
1543
|
-
this.scroll =
|
|
1544
|
-
this.scrollToEnd =
|
|
1545
|
-
this.outsideClick =
|
|
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
|
-
|
|
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
|
-
|
|
1787
|
-
|
|
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
|
-
|
|
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: [
|
|
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:
|
|
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
|
-
}]
|
|
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(
|
|
1941
|
-
this.
|
|
1942
|
-
this.disabled = false
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
this.
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
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
|
-
|
|
1967
|
-
this.
|
|
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: [
|
|
1970
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
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: () => [
|
|
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(
|
|
2109
|
-
this.classes =
|
|
2110
|
-
this.autoFocus =
|
|
2111
|
-
this.config =
|
|
2112
|
-
this._cd =
|
|
2113
|
-
this._console =
|
|
2114
|
-
|
|
2115
|
-
this.
|
|
2116
|
-
|
|
2117
|
-
this.
|
|
2118
|
-
this.
|
|
2119
|
-
this.
|
|
2120
|
-
this.
|
|
2121
|
-
this.
|
|
2122
|
-
this.
|
|
2123
|
-
this.
|
|
2124
|
-
this.
|
|
2125
|
-
this.
|
|
2126
|
-
this.
|
|
2127
|
-
this.
|
|
2128
|
-
this.
|
|
2129
|
-
this.
|
|
2130
|
-
this.
|
|
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.
|
|
2133
|
-
this.
|
|
2134
|
-
this.
|
|
2135
|
-
this.
|
|
2136
|
-
this.
|
|
2137
|
-
this.
|
|
2138
|
-
this.
|
|
2139
|
-
this.
|
|
2140
|
-
this.
|
|
2141
|
-
this.
|
|
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 =
|
|
2144
|
-
this.focusEvent =
|
|
2145
|
-
this.changeEvent =
|
|
2146
|
-
this.openEvent =
|
|
2147
|
-
this.closeEvent =
|
|
2148
|
-
this.searchEvent =
|
|
2149
|
-
this.clearEvent =
|
|
2150
|
-
this.addEvent =
|
|
2151
|
-
this.removeEvent =
|
|
2152
|
-
this.scroll =
|
|
2153
|
-
this.scrollToEnd =
|
|
2154
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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();
|
|
@@ -2422,11 +2425,11 @@ class NgSelectComponent {
|
|
|
2422
2425
|
this._onTouched = fn;
|
|
2423
2426
|
}
|
|
2424
2427
|
setDisabledState(state) {
|
|
2425
|
-
this._disabled
|
|
2428
|
+
this._disabled.set(state);
|
|
2426
2429
|
this._cd.markForCheck();
|
|
2427
2430
|
}
|
|
2428
2431
|
toggle() {
|
|
2429
|
-
if (!this.isOpen) {
|
|
2432
|
+
if (!this.isOpen()) {
|
|
2430
2433
|
this.open();
|
|
2431
2434
|
}
|
|
2432
2435
|
else {
|
|
@@ -2434,14 +2437,14 @@ class NgSelectComponent {
|
|
|
2434
2437
|
}
|
|
2435
2438
|
}
|
|
2436
2439
|
open() {
|
|
2437
|
-
if (this.disabled || this.isOpen || this._manualOpen) {
|
|
2440
|
+
if (this.disabled() || this.isOpen() || this._manualOpen) {
|
|
2438
2441
|
return;
|
|
2439
2442
|
}
|
|
2440
|
-
if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {
|
|
2443
|
+
if (!this._isTypeahead && !this.addTag() && this.itemsList.noItemsToSelect) {
|
|
2441
2444
|
return;
|
|
2442
2445
|
}
|
|
2443
|
-
this.isOpen
|
|
2444
|
-
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2446
|
+
this.isOpen.set(true);
|
|
2447
|
+
this.itemsList.markSelectedOrDefault(this.markFirst());
|
|
2445
2448
|
this.openEvent.emit();
|
|
2446
2449
|
if (!this.searchTerm) {
|
|
2447
2450
|
this.focus();
|
|
@@ -2449,10 +2452,10 @@ class NgSelectComponent {
|
|
|
2449
2452
|
this.detectChanges();
|
|
2450
2453
|
}
|
|
2451
2454
|
close() {
|
|
2452
|
-
if (!this.isOpen || this._manualOpen) {
|
|
2455
|
+
if (!this.isOpen() || this._manualOpen) {
|
|
2453
2456
|
return;
|
|
2454
2457
|
}
|
|
2455
|
-
this.isOpen
|
|
2458
|
+
this.isOpen.set(false);
|
|
2456
2459
|
this._isComposing = false;
|
|
2457
2460
|
if (!this._editableSearchTerm) {
|
|
2458
2461
|
this._clearSearch();
|
|
@@ -2466,10 +2469,10 @@ class NgSelectComponent {
|
|
|
2466
2469
|
this._cd.markForCheck();
|
|
2467
2470
|
}
|
|
2468
2471
|
toggleItem(item) {
|
|
2469
|
-
if (!item || item.disabled || this.disabled) {
|
|
2472
|
+
if (!item || item.disabled || this.disabled()) {
|
|
2470
2473
|
return;
|
|
2471
2474
|
}
|
|
2472
|
-
if (this.
|
|
2475
|
+
if (this.deselectOnClickValue() && item.selected) {
|
|
2473
2476
|
this.unselect(item);
|
|
2474
2477
|
}
|
|
2475
2478
|
else {
|
|
@@ -2482,24 +2485,24 @@ class NgSelectComponent {
|
|
|
2482
2485
|
select(item) {
|
|
2483
2486
|
if (!item.selected) {
|
|
2484
2487
|
this.itemsList.select(item);
|
|
2485
|
-
if (this.
|
|
2488
|
+
if (this.clearSearchOnAddValue() && !this._editableSearchTerm) {
|
|
2486
2489
|
this._clearSearch();
|
|
2487
2490
|
}
|
|
2488
2491
|
this._updateNgModel();
|
|
2489
|
-
if (this.multiple) {
|
|
2492
|
+
if (this.multiple()) {
|
|
2490
2493
|
this.addEvent.emit(item.value);
|
|
2491
2494
|
}
|
|
2492
2495
|
}
|
|
2493
|
-
if (this.closeOnSelect || this.itemsList.noItemsToSelect) {
|
|
2496
|
+
if (this.closeOnSelect() || this.itemsList.noItemsToSelect) {
|
|
2494
2497
|
this.close();
|
|
2495
2498
|
}
|
|
2496
2499
|
this._onSelectionChanged();
|
|
2497
2500
|
}
|
|
2498
2501
|
focus() {
|
|
2499
|
-
this.searchInput.nativeElement.focus();
|
|
2502
|
+
this.searchInput().nativeElement.focus();
|
|
2500
2503
|
}
|
|
2501
2504
|
blur() {
|
|
2502
|
-
this.searchInput.nativeElement.blur();
|
|
2505
|
+
this.searchInput().nativeElement.blur();
|
|
2503
2506
|
}
|
|
2504
2507
|
unselect(item) {
|
|
2505
2508
|
if (!item) {
|
|
@@ -2513,13 +2516,13 @@ class NgSelectComponent {
|
|
|
2513
2516
|
}
|
|
2514
2517
|
selectTag() {
|
|
2515
2518
|
let tag;
|
|
2516
|
-
if (isFunction(this.addTag)) {
|
|
2517
|
-
tag = this.addTag(this.searchTerm);
|
|
2519
|
+
if (isFunction(this.addTag())) {
|
|
2520
|
+
tag = this.addTag()(this.searchTerm);
|
|
2518
2521
|
}
|
|
2519
2522
|
else {
|
|
2520
|
-
tag = this._primitive ? this.searchTerm : { [this.bindLabel]: this.searchTerm };
|
|
2523
|
+
tag = this._primitive ? this.searchTerm : { [this.bindLabel()]: this.searchTerm };
|
|
2521
2524
|
}
|
|
2522
|
-
const handleTag = (item) => (this._isTypeahead || !this.isOpen ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
|
|
2525
|
+
const handleTag = (item) => (this._isTypeahead || !this.isOpen() ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
|
|
2523
2526
|
if (isPromise(tag)) {
|
|
2524
2527
|
tag.then((item) => this.select(handleTag(item))).catch(() => { });
|
|
2525
2528
|
}
|
|
@@ -2528,45 +2531,45 @@ class NgSelectComponent {
|
|
|
2528
2531
|
}
|
|
2529
2532
|
}
|
|
2530
2533
|
showClear() {
|
|
2531
|
-
return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
|
|
2534
|
+
return this.clearable() && (this.hasValue || this.searchTerm) && !this.disabled();
|
|
2532
2535
|
}
|
|
2533
2536
|
focusOnClear() {
|
|
2534
2537
|
this.blur();
|
|
2535
|
-
if (this.clearButton) {
|
|
2536
|
-
this.clearButton.nativeElement.focus();
|
|
2538
|
+
if (this.clearButton()) {
|
|
2539
|
+
this.clearButton().nativeElement.focus();
|
|
2537
2540
|
}
|
|
2538
2541
|
}
|
|
2539
2542
|
showNoItemsFound() {
|
|
2540
2543
|
const empty = this.itemsList.filteredItems.length === 0;
|
|
2541
|
-
return (((empty && !this._isTypeahead && !this.loading) || (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
|
|
2544
|
+
return (((empty && !this._isTypeahead && !this.loading()) || (empty && this._isTypeahead && this._validTerm && !this.loading())) &&
|
|
2542
2545
|
!this.showAddTag);
|
|
2543
2546
|
}
|
|
2544
2547
|
showTypeToSearch() {
|
|
2545
2548
|
const empty = this.itemsList.filteredItems.length === 0;
|
|
2546
|
-
return empty && this._isTypeahead && !this._validTerm && !this.loading;
|
|
2549
|
+
return empty && this._isTypeahead && !this._validTerm && !this.loading();
|
|
2547
2550
|
}
|
|
2548
2551
|
onCompositionStart() {
|
|
2549
2552
|
this._isComposing = true;
|
|
2550
2553
|
}
|
|
2551
2554
|
onCompositionEnd(term) {
|
|
2552
2555
|
this._isComposing = false;
|
|
2553
|
-
if (this.searchWhileComposing) {
|
|
2556
|
+
if (this.searchWhileComposing()) {
|
|
2554
2557
|
return;
|
|
2555
2558
|
}
|
|
2556
2559
|
this.filter(term);
|
|
2557
2560
|
}
|
|
2558
2561
|
filter(term) {
|
|
2559
|
-
if (this._isComposing && !this.searchWhileComposing) {
|
|
2562
|
+
if (this._isComposing && !this.searchWhileComposing()) {
|
|
2560
2563
|
return;
|
|
2561
2564
|
}
|
|
2562
2565
|
this.searchTerm = term;
|
|
2563
|
-
if (this._isTypeahead && (this._validTerm || this.minTermLength === 0)) {
|
|
2564
|
-
this.typeahead.next(term);
|
|
2566
|
+
if (this._isTypeahead && (this._validTerm || this.minTermLength() === 0)) {
|
|
2567
|
+
this.typeahead().next(term);
|
|
2565
2568
|
}
|
|
2566
2569
|
if (!this._isTypeahead) {
|
|
2567
2570
|
this.itemsList.filter(this.searchTerm);
|
|
2568
|
-
if (this.isOpen) {
|
|
2569
|
-
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2571
|
+
if (this.isOpen()) {
|
|
2572
|
+
this.itemsList.markSelectedOrDefault(this.markFirst());
|
|
2570
2573
|
}
|
|
2571
2574
|
}
|
|
2572
2575
|
this.searchEvent.emit({ term, items: this.itemsList.filteredItems.map((x) => x.value) });
|
|
@@ -2586,7 +2589,7 @@ class NgSelectComponent {
|
|
|
2586
2589
|
onInputBlur($event) {
|
|
2587
2590
|
this.element.classList.remove('ng-select-focused');
|
|
2588
2591
|
this.blurEvent.emit($event);
|
|
2589
|
-
if (!this.isOpen && !this.disabled) {
|
|
2592
|
+
if (!this.isOpen() && !this.disabled()) {
|
|
2590
2593
|
this._onTouched();
|
|
2591
2594
|
}
|
|
2592
2595
|
if (this._editableSearchTerm) {
|
|
@@ -2611,61 +2614,57 @@ class NgSelectComponent {
|
|
|
2611
2614
|
}
|
|
2612
2615
|
_setItems(items) {
|
|
2613
2616
|
const firstItem = items[0];
|
|
2614
|
-
this.bindLabel
|
|
2615
|
-
this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel === this._defaultLabel;
|
|
2617
|
+
this.bindLabel.set(this.bindLabel() || this._defaultLabel);
|
|
2618
|
+
this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel() === this._defaultLabel;
|
|
2616
2619
|
this.itemsList.setItems(items);
|
|
2617
2620
|
if (items.length > 0 && this.hasValue) {
|
|
2618
2621
|
this.itemsList.mapSelectedItems();
|
|
2619
2622
|
}
|
|
2620
|
-
if (this.isOpen && isDefined(this.searchTerm) && !this._isTypeahead) {
|
|
2623
|
+
if (this.isOpen() && isDefined(this.searchTerm) && !this._isTypeahead) {
|
|
2621
2624
|
this.itemsList.filter(this.searchTerm);
|
|
2622
2625
|
}
|
|
2623
|
-
if (this._isTypeahead || this.isOpen) {
|
|
2624
|
-
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2626
|
+
if (this._isTypeahead || this.isOpen()) {
|
|
2627
|
+
this.itemsList.markSelectedOrDefault(this.markFirst());
|
|
2625
2628
|
}
|
|
2626
2629
|
}
|
|
2627
2630
|
_setItemsFromNgOptions() {
|
|
2628
2631
|
const mapNgOptions = (options) => {
|
|
2629
|
-
|
|
2630
|
-
$ngOptionValue: option.value,
|
|
2632
|
+
const items = options.map((option) => ({
|
|
2633
|
+
$ngOptionValue: option.value(),
|
|
2631
2634
|
$ngOptionLabel: option.elementRef.nativeElement.innerHTML,
|
|
2632
|
-
disabled: option.disabled,
|
|
2633
|
-
}));
|
|
2634
|
-
this.
|
|
2635
|
+
disabled: option.disabled(),
|
|
2636
|
+
})) ?? [];
|
|
2637
|
+
this.items.set(items);
|
|
2638
|
+
this.itemsList.setItems(items);
|
|
2635
2639
|
if (this.hasValue) {
|
|
2636
2640
|
this.itemsList.mapSelectedItems();
|
|
2637
2641
|
}
|
|
2638
|
-
this.detectChanges();
|
|
2639
2642
|
};
|
|
2640
|
-
const handleOptionChange = () => {
|
|
2641
|
-
|
|
2642
|
-
merge(...this.ngOptions.map((option) => option.stateChange$))
|
|
2643
|
-
.pipe(takeUntil(changedOrDestroyed))
|
|
2644
|
-
.subscribe((option) => {
|
|
2643
|
+
const handleOptionChange = (options) => {
|
|
2644
|
+
return merge(...options.map((option) => option.stateChange$)).pipe(tap((option) => {
|
|
2645
2645
|
const item = this.itemsList.findItem(option.value);
|
|
2646
2646
|
item.disabled = option.disabled;
|
|
2647
2647
|
item.label = option.label || item.label;
|
|
2648
|
-
|
|
2649
|
-
});
|
|
2648
|
+
}));
|
|
2650
2649
|
};
|
|
2651
|
-
this.
|
|
2652
|
-
this.bindLabel
|
|
2650
|
+
this.ngOptionsObservable.pipe(startWith(this.ngOptions()), takeUntil(this._destroy$), tap((options) => {
|
|
2651
|
+
this.bindLabel.set(this._defaultLabel);
|
|
2653
2652
|
mapNgOptions(options);
|
|
2654
|
-
|
|
2655
|
-
});
|
|
2653
|
+
this._cd.detectChanges();
|
|
2654
|
+
}), switchMap((options) => handleOptionChange(options))).subscribe();
|
|
2656
2655
|
}
|
|
2657
2656
|
_isValidWriteValue(value) {
|
|
2658
|
-
if (!isDefined(value) || (this.multiple && value === '') || (Array.isArray(value) && value.length === 0)) {
|
|
2657
|
+
if (!isDefined(value) || (this.multiple() && value === '') || (Array.isArray(value) && value.length === 0)) {
|
|
2659
2658
|
return false;
|
|
2660
2659
|
}
|
|
2661
2660
|
const validateBinding = (item) => {
|
|
2662
|
-
if (!isDefined(this.compareWith) && isObject(item) && this.bindValue) {
|
|
2661
|
+
if (!isDefined(this.compareWith()) && isObject(item) && this.bindValue()) {
|
|
2663
2662
|
this._console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
|
|
2664
2663
|
return false;
|
|
2665
2664
|
}
|
|
2666
2665
|
return true;
|
|
2667
2666
|
};
|
|
2668
|
-
if (this.multiple) {
|
|
2667
|
+
if (this.multiple()) {
|
|
2669
2668
|
if (!Array.isArray(value)) {
|
|
2670
2669
|
this._console.warn('Multiple select ngModel should be array.');
|
|
2671
2670
|
return false;
|
|
@@ -2687,20 +2686,20 @@ class NgSelectComponent {
|
|
|
2687
2686
|
}
|
|
2688
2687
|
else {
|
|
2689
2688
|
const isValObject = isObject(val);
|
|
2690
|
-
const isPrimitive = !isValObject && !this.bindValue;
|
|
2689
|
+
const isPrimitive = !isValObject && !this.bindValue();
|
|
2691
2690
|
if (isValObject || isPrimitive) {
|
|
2692
2691
|
this.itemsList.select(this.itemsList.mapItem(val, null));
|
|
2693
2692
|
}
|
|
2694
|
-
else if (this.bindValue) {
|
|
2693
|
+
else if (this.bindValue()) {
|
|
2695
2694
|
item = {
|
|
2696
|
-
[this.bindLabel]: null,
|
|
2697
|
-
[this.bindValue]: val,
|
|
2695
|
+
[this.bindLabel()]: null,
|
|
2696
|
+
[this.bindValue()]: val,
|
|
2698
2697
|
};
|
|
2699
2698
|
this.itemsList.select(this.itemsList.mapItem(item, null));
|
|
2700
2699
|
}
|
|
2701
2700
|
}
|
|
2702
2701
|
};
|
|
2703
|
-
if (this.multiple) {
|
|
2702
|
+
if (this.multiple()) {
|
|
2704
2703
|
ngModel.forEach((item) => select(item));
|
|
2705
2704
|
}
|
|
2706
2705
|
else {
|
|
@@ -2708,7 +2707,7 @@ class NgSelectComponent {
|
|
|
2708
2707
|
}
|
|
2709
2708
|
}
|
|
2710
2709
|
_handleKeyPresses() {
|
|
2711
|
-
if (this.searchable) {
|
|
2710
|
+
if (this.searchable()) {
|
|
2712
2711
|
return;
|
|
2713
2712
|
}
|
|
2714
2713
|
this._keyPress$
|
|
@@ -2716,7 +2715,7 @@ class NgSelectComponent {
|
|
|
2716
2715
|
.subscribe((term) => {
|
|
2717
2716
|
const item = this.itemsList.findByLabel(term);
|
|
2718
2717
|
if (item) {
|
|
2719
|
-
if (this.isOpen) {
|
|
2718
|
+
if (this.isOpen()) {
|
|
2720
2719
|
this.itemsList.markItem(item);
|
|
2721
2720
|
this._scrollToMarked();
|
|
2722
2721
|
this._cd.markForCheck();
|
|
@@ -2729,14 +2728,14 @@ class NgSelectComponent {
|
|
|
2729
2728
|
});
|
|
2730
2729
|
}
|
|
2731
2730
|
_setInputAttributes() {
|
|
2732
|
-
const input = this.searchInput.nativeElement;
|
|
2731
|
+
const input = this.searchInput().nativeElement;
|
|
2733
2732
|
const attributes = {
|
|
2734
2733
|
type: 'text',
|
|
2735
2734
|
autocorrect: 'off',
|
|
2736
2735
|
autocapitalize: 'off',
|
|
2737
2736
|
autocomplete: 'off',
|
|
2738
2737
|
'aria-controls': this.dropdownId,
|
|
2739
|
-
...this.inputAttrs,
|
|
2738
|
+
...this.inputAttrs(),
|
|
2740
2739
|
};
|
|
2741
2740
|
for (const key of Object.keys(attributes)) {
|
|
2742
2741
|
input.setAttribute(key, attributes[key]);
|
|
@@ -2748,14 +2747,14 @@ class NgSelectComponent {
|
|
|
2748
2747
|
_updateNgModel() {
|
|
2749
2748
|
const model = [];
|
|
2750
2749
|
for (const item of this.selectedItems) {
|
|
2751
|
-
if (this.bindValue) {
|
|
2750
|
+
if (this.bindValue()) {
|
|
2752
2751
|
let value = null;
|
|
2753
2752
|
if (item.children) {
|
|
2754
|
-
const groupKey = this.groupValue ? this.bindValue : this.groupBy;
|
|
2755
|
-
value = item.value[groupKey || this.groupBy];
|
|
2753
|
+
const groupKey = this.groupValue() ? this.bindValue() : this.groupBy();
|
|
2754
|
+
value = item.value[groupKey || this.groupBy()];
|
|
2756
2755
|
}
|
|
2757
2756
|
else {
|
|
2758
|
-
value = this.itemsList.resolveNested(item.value, this.bindValue);
|
|
2757
|
+
value = this.itemsList.resolveNested(item.value, this.bindValue());
|
|
2759
2758
|
}
|
|
2760
2759
|
model.push(value);
|
|
2761
2760
|
}
|
|
@@ -2764,7 +2763,7 @@ class NgSelectComponent {
|
|
|
2764
2763
|
}
|
|
2765
2764
|
}
|
|
2766
2765
|
const selected = this.selectedItems.map((x) => x.value);
|
|
2767
|
-
if (this.multiple) {
|
|
2766
|
+
if (this.multiple()) {
|
|
2768
2767
|
this._onChange(model);
|
|
2769
2768
|
this.changeEvent.emit(selected);
|
|
2770
2769
|
}
|
|
@@ -2784,39 +2783,40 @@ class NgSelectComponent {
|
|
|
2784
2783
|
_changeSearch(searchTerm) {
|
|
2785
2784
|
this.searchTerm = searchTerm;
|
|
2786
2785
|
if (this._isTypeahead) {
|
|
2787
|
-
this.typeahead.next(searchTerm);
|
|
2786
|
+
this.typeahead().next(searchTerm);
|
|
2788
2787
|
}
|
|
2789
2788
|
}
|
|
2790
2789
|
_scrollToMarked() {
|
|
2791
|
-
if (!this.isOpen || !this.dropdownPanel) {
|
|
2790
|
+
if (!this.isOpen() || !this.dropdownPanel()) {
|
|
2792
2791
|
return;
|
|
2793
2792
|
}
|
|
2794
|
-
this.dropdownPanel.scrollTo(this.itemsList.markedItem);
|
|
2793
|
+
this.dropdownPanel().scrollTo(this.itemsList.markedItem);
|
|
2795
2794
|
}
|
|
2796
2795
|
_scrollToTag() {
|
|
2797
|
-
if (!this.isOpen || !this.dropdownPanel) {
|
|
2796
|
+
if (!this.isOpen() || !this.dropdownPanel()) {
|
|
2798
2797
|
return;
|
|
2799
2798
|
}
|
|
2800
|
-
this.dropdownPanel.scrollToTag();
|
|
2799
|
+
this.dropdownPanel().scrollToTag();
|
|
2801
2800
|
}
|
|
2802
2801
|
_onSelectionChanged() {
|
|
2803
|
-
|
|
2802
|
+
const appendTo = this.appendTo() ?? this.config.appendTo;
|
|
2803
|
+
if (this.isOpen() && this.deselectOnClickValue() && appendTo) {
|
|
2804
2804
|
// Make sure items are rendered.
|
|
2805
2805
|
this._cd.detectChanges();
|
|
2806
|
-
this.dropdownPanel.adjustPosition();
|
|
2806
|
+
this.dropdownPanel().adjustPosition();
|
|
2807
2807
|
}
|
|
2808
2808
|
}
|
|
2809
2809
|
_handleTab($event) {
|
|
2810
|
-
if (this.isOpen === false) {
|
|
2810
|
+
if (this.isOpen() === false) {
|
|
2811
2811
|
if (this.showClear() && !$event.shiftKey && this.tabFocusOnClear()) {
|
|
2812
2812
|
this.focusOnClear();
|
|
2813
2813
|
$event.preventDefault();
|
|
2814
2814
|
}
|
|
2815
|
-
else if (!this.addTag) {
|
|
2815
|
+
else if (!this.addTag()) {
|
|
2816
2816
|
return;
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
|
-
if (this.selectOnTab) {
|
|
2819
|
+
if (this.selectOnTab()) {
|
|
2820
2820
|
if (this.itemsList.markedItem) {
|
|
2821
2821
|
this.toggleItem(this.itemsList.markedItem);
|
|
2822
2822
|
$event.preventDefault();
|
|
@@ -2834,7 +2834,8 @@ class NgSelectComponent {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
2836
|
_handleEnter($event) {
|
|
2837
|
-
|
|
2837
|
+
const openOnEnter = this.openOnEnter() ?? this.config.openOnEnter;
|
|
2838
|
+
if (this.isOpen() || this._manualOpen) {
|
|
2838
2839
|
if (this.itemsList.markedItem) {
|
|
2839
2840
|
this.toggleItem(this.itemsList.markedItem);
|
|
2840
2841
|
}
|
|
@@ -2842,7 +2843,7 @@ class NgSelectComponent {
|
|
|
2842
2843
|
this.selectTag();
|
|
2843
2844
|
}
|
|
2844
2845
|
}
|
|
2845
|
-
else if (
|
|
2846
|
+
else if (openOnEnter) {
|
|
2846
2847
|
this.open();
|
|
2847
2848
|
}
|
|
2848
2849
|
else {
|
|
@@ -2851,7 +2852,7 @@ class NgSelectComponent {
|
|
|
2851
2852
|
$event.preventDefault();
|
|
2852
2853
|
}
|
|
2853
2854
|
_handleSpace($event) {
|
|
2854
|
-
if (this.isOpen || this._manualOpen) {
|
|
2855
|
+
if (this.isOpen() || this._manualOpen) {
|
|
2855
2856
|
return;
|
|
2856
2857
|
}
|
|
2857
2858
|
this.open();
|
|
@@ -2870,7 +2871,7 @@ class NgSelectComponent {
|
|
|
2870
2871
|
$event.preventDefault();
|
|
2871
2872
|
}
|
|
2872
2873
|
_handleArrowUp($event) {
|
|
2873
|
-
if (!this.isOpen) {
|
|
2874
|
+
if (!this.isOpen()) {
|
|
2874
2875
|
return;
|
|
2875
2876
|
}
|
|
2876
2877
|
if (this._nextItemIsTag(-1)) {
|
|
@@ -2885,13 +2886,13 @@ class NgSelectComponent {
|
|
|
2885
2886
|
}
|
|
2886
2887
|
_nextItemIsTag(nextStep) {
|
|
2887
2888
|
const nextIndex = this.itemsList.markedIndex + nextStep;
|
|
2888
|
-
return (this.addTag && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
|
|
2889
|
+
return (this.addTag() && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
|
|
2889
2890
|
}
|
|
2890
2891
|
_handleBackspace() {
|
|
2891
|
-
if (this.searchTerm || !this.clearable || !this.clearOnBackspace || !this.hasValue) {
|
|
2892
|
+
if (this.searchTerm || !this.clearable() || !this.clearOnBackspace() || !this.hasValue) {
|
|
2892
2893
|
return;
|
|
2893
2894
|
}
|
|
2894
|
-
if (this.multiple) {
|
|
2895
|
+
if (this.multiple()) {
|
|
2895
2896
|
this.unselect(this.itemsList.lastSelectedItem);
|
|
2896
2897
|
}
|
|
2897
2898
|
else {
|
|
@@ -2899,19 +2900,9 @@ class NgSelectComponent {
|
|
|
2899
2900
|
}
|
|
2900
2901
|
}
|
|
2901
2902
|
_mergeGlobalConfig(config) {
|
|
2902
|
-
this.
|
|
2903
|
-
this.
|
|
2904
|
-
this.
|
|
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;
|
|
2903
|
+
this.bindValue.set(this.bindValue() || config.bindValue);
|
|
2904
|
+
this.bindLabel.set(this.bindLabel() || config.bindLabel);
|
|
2905
|
+
this.appearance.set(this.appearance() || config.appearance);
|
|
2915
2906
|
this._setTabFocusOnClear();
|
|
2916
2907
|
}
|
|
2917
2908
|
/**
|
|
@@ -2922,7 +2913,7 @@ class NgSelectComponent {
|
|
|
2922
2913
|
* @returns `true` if virtual scroll is enabled, `false` otherwise
|
|
2923
2914
|
*/
|
|
2924
2915
|
getVirtualScroll(config) {
|
|
2925
|
-
return isDefined(this.virtualScroll) ? this.virtualScroll : this.isVirtualScrollDisabled(config);
|
|
2916
|
+
return isDefined(this.virtualScroll) ? this.virtualScroll() : this.isVirtualScrollDisabled(config);
|
|
2926
2917
|
}
|
|
2927
2918
|
/**
|
|
2928
2919
|
* Gets disableVirtualScroll value from input or from config
|
|
@@ -2934,15 +2925,15 @@ class NgSelectComponent {
|
|
|
2934
2925
|
isVirtualScrollDisabled(config) {
|
|
2935
2926
|
return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
|
|
2936
2927
|
}
|
|
2937
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [
|
|
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:
|
|
2928
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2929
|
+
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
2930
|
{
|
|
2940
2931
|
provide: NG_VALUE_ACCESSOR,
|
|
2941
2932
|
useExisting: forwardRef(() => NgSelectComponent),
|
|
2942
2933
|
multi: true,
|
|
2943
2934
|
},
|
|
2944
2935
|
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 }); }
|
|
2936
|
+
], 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
2937
|
}
|
|
2947
2938
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, decorators: [{
|
|
2948
2939
|
type: Component,
|
|
@@ -2953,253 +2944,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2953
2944
|
multi: true,
|
|
2954
2945
|
},
|
|
2955
2946
|
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
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
type: Optional
|
|
2968
|
-
|
|
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: [{
|
|
2947
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, NgItemLabelDirective, NgDropdownPanelComponent], host: {
|
|
2948
|
+
'[class.ng-select]': 'true',
|
|
2949
|
+
'[class.ng-select-single]': '!multiple()',
|
|
2950
|
+
'[class.ng-select-typeahead]': 'typeahead()',
|
|
2951
|
+
'[class.ng-select-multiple]': 'multiple()',
|
|
2952
|
+
'[class.ng-select-taggable]': 'addTag()',
|
|
2953
|
+
'[class.ng-select-searchable]': 'searchable()',
|
|
2954
|
+
'[class.ng-select-clearable]': 'clearable()',
|
|
2955
|
+
'[class.ng-select-opened]': 'isOpen()',
|
|
2956
|
+
'[class.ng-select-filtered]': 'filtered',
|
|
2957
|
+
'[class.ng-select-disabled]': 'disabled()',
|
|
2958
|
+
}, 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"] }]
|
|
2959
|
+
}], ctorParameters: () => [], propDecorators: { handleKeyDown: [{
|
|
3203
2960
|
type: HostListener,
|
|
3204
2961
|
args: ['keydown', ['$event']]
|
|
3205
2962
|
}] } });
|
|
@@ -3237,7 +2994,7 @@ class NgSelectModule {
|
|
|
3237
2994
|
NgTagTemplateDirective,
|
|
3238
2995
|
NgLoadingSpinnerTemplateDirective,
|
|
3239
2996
|
NgClearButtonTemplateDirective] }); }
|
|
3240
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers:
|
|
2997
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers: provideNgSelect() }); }
|
|
3241
2998
|
}
|
|
3242
2999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, decorators: [{
|
|
3243
3000
|
type: NgModule,
|
|
@@ -3278,9 +3035,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
3278
3035
|
NgLoadingSpinnerTemplateDirective,
|
|
3279
3036
|
NgClearButtonTemplateDirective
|
|
3280
3037
|
],
|
|
3281
|
-
providers:
|
|
3038
|
+
providers: provideNgSelect(),
|
|
3282
3039
|
}]
|
|
3283
3040
|
}] });
|
|
3041
|
+
function provideNgSelect() {
|
|
3042
|
+
return [
|
|
3043
|
+
{
|
|
3044
|
+
provide: SELECTION_MODEL_FACTORY,
|
|
3045
|
+
useValue: DefaultSelectionModelFactory,
|
|
3046
|
+
},
|
|
3047
|
+
];
|
|
3048
|
+
}
|
|
3284
3049
|
|
|
3285
3050
|
/*
|
|
3286
3051
|
* Public API Surface of ng-select
|