@ng-select/ng-select 20.0.0 → 20.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/fesm2022/ng-select-ng-select.mjs +704 -488
- package/fesm2022/ng-select-ng-select.mjs.map +1 -1
- package/index.d.ts +299 -257
- package/package.json +1 -1
- package/scss/ng-select.component.scss +1 -3
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Directive, Input, Injectable, input, EventEmitter, DOCUMENT, booleanAttribute, ElementRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, Inject, Output, ViewChild, InjectionToken, signal, numberAttribute, forwardRef, TemplateRef, Attribute, HostBinding, ContentChild, 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,
|
|
6
|
-
import {
|
|
7
|
-
import { toObservable } from '@angular/core/rxjs-interop';
|
|
5
|
+
import { takeUntil, auditTime, startWith, tap, debounceTime, filter, map } from 'rxjs/operators';
|
|
6
|
+
import { NgTemplateOutlet, NgClass } from '@angular/common';
|
|
8
7
|
|
|
9
8
|
const unescapedHTMLExp = /[&<>"']/g;
|
|
10
9
|
const hasUnescapedHTMLExp = RegExp(unescapedHTMLExp.source);
|
|
@@ -32,18 +31,15 @@ function isFunction(value) {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
class NgItemLabelDirective {
|
|
35
|
-
constructor() {
|
|
36
|
-
this.element =
|
|
37
|
-
this.
|
|
38
|
-
this.escape = input(true);
|
|
39
|
-
effect(() => {
|
|
40
|
-
this.element.nativeElement.innerHTML = this.escape()
|
|
41
|
-
? escapeHTML(this.ngItemLabel())
|
|
42
|
-
: this.ngItemLabel();
|
|
43
|
-
});
|
|
34
|
+
constructor(element) {
|
|
35
|
+
this.element = element;
|
|
36
|
+
this.escape = true;
|
|
44
37
|
}
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
ngOnChanges(changes) {
|
|
39
|
+
this.element.nativeElement.innerHTML = this.escape ? escapeHTML(this.ngItemLabel) : this.ngItemLabel;
|
|
40
|
+
}
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
42
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgItemLabelDirective, isStandalone: true, selector: "[ngItemLabel]", inputs: { ngItemLabel: "ngItemLabel", escape: "escape" }, usesOnChanges: true, ngImport: i0 }); }
|
|
47
43
|
}
|
|
48
44
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, decorators: [{
|
|
49
45
|
type: Directive,
|
|
@@ -51,12 +47,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
51
47
|
selector: '[ngItemLabel]',
|
|
52
48
|
standalone: true,
|
|
53
49
|
}]
|
|
54
|
-
}], ctorParameters: () => []
|
|
50
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ngItemLabel: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}], escape: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}] } });
|
|
55
55
|
class NgOptionTemplateDirective {
|
|
56
|
-
constructor() {
|
|
57
|
-
this.template =
|
|
56
|
+
constructor(template) {
|
|
57
|
+
this.template = template;
|
|
58
58
|
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
70
70
|
class NgOptgroupTemplateDirective {
|
|
71
|
-
constructor() {
|
|
72
|
-
this.template =
|
|
71
|
+
constructor(template) {
|
|
72
|
+
this.template = template;
|
|
73
73
|
}
|
|
74
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
85
85
|
class NgLabelTemplateDirective {
|
|
86
|
-
constructor() {
|
|
87
|
-
this.template =
|
|
86
|
+
constructor(template) {
|
|
87
|
+
this.template = template;
|
|
88
88
|
}
|
|
89
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
100
100
|
class NgMultiLabelTemplateDirective {
|
|
101
|
-
constructor() {
|
|
102
|
-
this.template =
|
|
101
|
+
constructor(template) {
|
|
102
|
+
this.template = template;
|
|
103
103
|
}
|
|
104
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
115
115
|
class NgHeaderTemplateDirective {
|
|
116
|
-
constructor() {
|
|
117
|
-
this.template =
|
|
116
|
+
constructor(template) {
|
|
117
|
+
this.template = template;
|
|
118
118
|
}
|
|
119
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
130
130
|
class NgFooterTemplateDirective {
|
|
131
|
-
constructor() {
|
|
132
|
-
this.template =
|
|
131
|
+
constructor(template) {
|
|
132
|
+
this.template = template;
|
|
133
133
|
}
|
|
134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
145
145
|
class NgNotFoundTemplateDirective {
|
|
146
|
-
constructor() {
|
|
147
|
-
this.template =
|
|
146
|
+
constructor(template) {
|
|
147
|
+
this.template = template;
|
|
148
148
|
}
|
|
149
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
149
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
160
160
|
class NgPlaceholderTemplateDirective {
|
|
161
|
-
constructor() {
|
|
162
|
-
this.template =
|
|
161
|
+
constructor(template) {
|
|
162
|
+
this.template = template;
|
|
163
163
|
}
|
|
164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
164
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
175
175
|
class NgTypeToSearchTemplateDirective {
|
|
176
|
-
constructor() {
|
|
177
|
-
this.template =
|
|
176
|
+
constructor(template) {
|
|
177
|
+
this.template = template;
|
|
178
178
|
}
|
|
179
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
190
190
|
class NgLoadingTextTemplateDirective {
|
|
191
|
-
constructor() {
|
|
192
|
-
this.template =
|
|
191
|
+
constructor(template) {
|
|
192
|
+
this.template = template;
|
|
193
193
|
}
|
|
194
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
205
205
|
class NgTagTemplateDirective {
|
|
206
|
-
constructor() {
|
|
207
|
-
this.template =
|
|
206
|
+
constructor(template) {
|
|
207
|
+
this.template = template;
|
|
208
208
|
}
|
|
209
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
209
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
220
220
|
class NgLoadingSpinnerTemplateDirective {
|
|
221
|
-
constructor() {
|
|
222
|
-
this.template =
|
|
221
|
+
constructor(template) {
|
|
222
|
+
this.template = template;
|
|
223
223
|
}
|
|
224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
224
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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,52 +231,19 @@ 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
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
235
235
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
236
236
|
class NgClearButtonTemplateDirective {
|
|
237
|
-
constructor() {
|
|
238
|
-
this.template =
|
|
237
|
+
constructor(template) {
|
|
238
|
+
this.template = template;
|
|
239
239
|
}
|
|
240
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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
|
-
}] });
|
|
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
|
-
}] });
|
|
246
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
280
247
|
|
|
281
248
|
function newId() {
|
|
282
249
|
// First character is an 'a', it's good practice to tag id to begin with a letter
|
|
@@ -1157,10 +1124,10 @@ class ItemsList {
|
|
|
1157
1124
|
return this._filteredItems[this._markedIndex];
|
|
1158
1125
|
}
|
|
1159
1126
|
get noItemsToSelect() {
|
|
1160
|
-
return this._ngSelect.hideSelected
|
|
1127
|
+
return this._ngSelect.hideSelected && this._items.length === this.selectedItems.length;
|
|
1161
1128
|
}
|
|
1162
1129
|
get maxItemsSelected() {
|
|
1163
|
-
return this._ngSelect.multiple
|
|
1130
|
+
return this._ngSelect.multiple && this._ngSelect.maxSelectedItems <= this.selectedItems.length;
|
|
1164
1131
|
}
|
|
1165
1132
|
get lastSelectedItem() {
|
|
1166
1133
|
let i = this.selectedItems.length - 1;
|
|
@@ -1174,9 +1141,8 @@ class ItemsList {
|
|
|
1174
1141
|
}
|
|
1175
1142
|
setItems(items) {
|
|
1176
1143
|
this._items = items.map((item, index) => this.mapItem(item, index));
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
this._groups = this._groupBy(this._items, groupBy);
|
|
1144
|
+
if (this._ngSelect.groupBy) {
|
|
1145
|
+
this._groups = this._groupBy(this._items, this._ngSelect.groupBy);
|
|
1180
1146
|
this._items = this._flatten(this._groups);
|
|
1181
1147
|
}
|
|
1182
1148
|
else {
|
|
@@ -1189,12 +1155,12 @@ class ItemsList {
|
|
|
1189
1155
|
if (item.selected || this.maxItemsSelected) {
|
|
1190
1156
|
return;
|
|
1191
1157
|
}
|
|
1192
|
-
const multiple = this._ngSelect.multiple
|
|
1158
|
+
const multiple = this._ngSelect.multiple;
|
|
1193
1159
|
if (!multiple) {
|
|
1194
1160
|
this.clearSelected();
|
|
1195
1161
|
}
|
|
1196
|
-
this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel
|
|
1197
|
-
if (this._ngSelect.hideSelected
|
|
1162
|
+
this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel);
|
|
1163
|
+
if (this._ngSelect.hideSelected) {
|
|
1198
1164
|
this._hideSelected(item);
|
|
1199
1165
|
}
|
|
1200
1166
|
}
|
|
@@ -1202,22 +1168,21 @@ class ItemsList {
|
|
|
1202
1168
|
if (!item.selected) {
|
|
1203
1169
|
return;
|
|
1204
1170
|
}
|
|
1205
|
-
|
|
1206
|
-
this.
|
|
1207
|
-
if (this._ngSelect.hideSelected() && isDefined(item.index) && multiple) {
|
|
1171
|
+
this._selectionModel.unselect(item, this._ngSelect.multiple);
|
|
1172
|
+
if (this._ngSelect.hideSelected && isDefined(item.index) && this._ngSelect.multiple) {
|
|
1208
1173
|
this._showSelected(item);
|
|
1209
1174
|
}
|
|
1210
1175
|
}
|
|
1211
1176
|
findItem(value) {
|
|
1212
1177
|
let findBy;
|
|
1213
|
-
if (this._ngSelect.compareWith
|
|
1214
|
-
findBy = (item) => this._ngSelect.compareWith(
|
|
1178
|
+
if (this._ngSelect.compareWith) {
|
|
1179
|
+
findBy = (item) => this._ngSelect.compareWith(item.value, value);
|
|
1215
1180
|
}
|
|
1216
|
-
else if (this._ngSelect.bindValue
|
|
1217
|
-
findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue
|
|
1181
|
+
else if (this._ngSelect.bindValue) {
|
|
1182
|
+
findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue) === value;
|
|
1218
1183
|
}
|
|
1219
1184
|
else {
|
|
1220
|
-
findBy = (item) => item.value === value || (!item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel
|
|
1185
|
+
findBy = (item) => item.value === value || (!item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel));
|
|
1221
1186
|
}
|
|
1222
1187
|
return this._items.find((item) => findBy(item));
|
|
1223
1188
|
}
|
|
@@ -1233,7 +1198,7 @@ class ItemsList {
|
|
|
1233
1198
|
item.selected = keepDisabled && item.selected && item.disabled;
|
|
1234
1199
|
item.marked = false;
|
|
1235
1200
|
});
|
|
1236
|
-
if (this._ngSelect.hideSelected
|
|
1201
|
+
if (this._ngSelect.hideSelected) {
|
|
1237
1202
|
this.resetFilteredItems();
|
|
1238
1203
|
}
|
|
1239
1204
|
}
|
|
@@ -1250,16 +1215,16 @@ class ItemsList {
|
|
|
1250
1215
|
return;
|
|
1251
1216
|
}
|
|
1252
1217
|
this._filteredItems = [];
|
|
1253
|
-
term = this._ngSelect.searchFn
|
|
1254
|
-
const match = this._ngSelect.searchFn
|
|
1255
|
-
const hideSelected = this._ngSelect.hideSelected
|
|
1218
|
+
term = this._ngSelect.searchFn ? term : stripSpecialChars(term).toLocaleLowerCase();
|
|
1219
|
+
const match = this._ngSelect.searchFn || this._defaultSearchFn;
|
|
1220
|
+
const hideSelected = this._ngSelect.hideSelected;
|
|
1256
1221
|
for (const key of Array.from(this._groups.keys())) {
|
|
1257
1222
|
const matchedItems = [];
|
|
1258
1223
|
for (const item of this._groups.get(key)) {
|
|
1259
1224
|
if (hideSelected && ((item.parent && item.parent.selected) || item.selected)) {
|
|
1260
1225
|
continue;
|
|
1261
1226
|
}
|
|
1262
|
-
const searchItem = this._ngSelect.searchFn
|
|
1227
|
+
const searchItem = this._ngSelect.searchFn ? item.value : item;
|
|
1263
1228
|
if (match(term, searchItem)) {
|
|
1264
1229
|
matchedItems.push(item);
|
|
1265
1230
|
}
|
|
@@ -1278,7 +1243,7 @@ class ItemsList {
|
|
|
1278
1243
|
if (this._filteredItems.length === this._items.length) {
|
|
1279
1244
|
return;
|
|
1280
1245
|
}
|
|
1281
|
-
if (this._ngSelect.hideSelected
|
|
1246
|
+
if (this._ngSelect.hideSelected && this.selectedItems.length > 0) {
|
|
1282
1247
|
this._filteredItems = this._items.filter((x) => !x.selected);
|
|
1283
1248
|
}
|
|
1284
1249
|
else {
|
|
@@ -1329,7 +1294,7 @@ class ItemsList {
|
|
|
1329
1294
|
}
|
|
1330
1295
|
}
|
|
1331
1296
|
mapItem(item, index) {
|
|
1332
|
-
const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel
|
|
1297
|
+
const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel);
|
|
1333
1298
|
const value = isDefined(item.$ngOptionValue) ? item.$ngOptionValue : item;
|
|
1334
1299
|
return {
|
|
1335
1300
|
index,
|
|
@@ -1340,15 +1305,14 @@ class ItemsList {
|
|
|
1340
1305
|
};
|
|
1341
1306
|
}
|
|
1342
1307
|
mapSelectedItems() {
|
|
1343
|
-
const multiple = this._ngSelect.multiple
|
|
1308
|
+
const multiple = this._ngSelect.multiple;
|
|
1344
1309
|
for (const selected of this.selectedItems) {
|
|
1345
|
-
const
|
|
1346
|
-
const value = bindValue ? this.resolveNested(selected.value, bindValue) : selected.value;
|
|
1310
|
+
const value = this._ngSelect.bindValue ? this.resolveNested(selected.value, this._ngSelect.bindValue) : selected.value;
|
|
1347
1311
|
const item = isDefined(value) ? this.findItem(value) : null;
|
|
1348
1312
|
this._selectionModel.unselect(selected, multiple);
|
|
1349
|
-
this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel
|
|
1313
|
+
this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel);
|
|
1350
1314
|
}
|
|
1351
|
-
if (this._ngSelect.hideSelected
|
|
1315
|
+
if (this._ngSelect.hideSelected) {
|
|
1352
1316
|
this._filteredItems = this.filteredItems.filter((x) => this.selectedItems.indexOf(x) === -1);
|
|
1353
1317
|
}
|
|
1354
1318
|
}
|
|
@@ -1401,7 +1365,7 @@ class ItemsList {
|
|
|
1401
1365
|
}
|
|
1402
1366
|
}
|
|
1403
1367
|
_getLastMarkedIndex() {
|
|
1404
|
-
if (this._ngSelect.hideSelected
|
|
1368
|
+
if (this._ngSelect.hideSelected) {
|
|
1405
1369
|
return -1;
|
|
1406
1370
|
}
|
|
1407
1371
|
if (this._markedIndex > -1 && this.markedItem === undefined) {
|
|
@@ -1426,7 +1390,7 @@ class ItemsList {
|
|
|
1426
1390
|
}
|
|
1427
1391
|
return groups;
|
|
1428
1392
|
}
|
|
1429
|
-
const isFnKey = isFunction(this._ngSelect.groupBy
|
|
1393
|
+
const isFnKey = isFunction(this._ngSelect.groupBy);
|
|
1430
1394
|
const keyFn = (item) => {
|
|
1431
1395
|
const key = isFnKey ? prop(item.value) : item.value[prop];
|
|
1432
1396
|
return isDefined(key) ? key : undefined;
|
|
@@ -1445,7 +1409,7 @@ class ItemsList {
|
|
|
1445
1409
|
return groups;
|
|
1446
1410
|
}
|
|
1447
1411
|
_flatten(groups) {
|
|
1448
|
-
const isGroupByFn = isFunction(this._ngSelect.groupBy
|
|
1412
|
+
const isGroupByFn = isFunction(this._ngSelect.groupBy);
|
|
1449
1413
|
const items = [];
|
|
1450
1414
|
for (const key of Array.from(groups.keys())) {
|
|
1451
1415
|
let i = items.length;
|
|
@@ -1463,11 +1427,11 @@ class ItemsList {
|
|
|
1463
1427
|
children: undefined,
|
|
1464
1428
|
parent: null,
|
|
1465
1429
|
index: i++,
|
|
1466
|
-
disabled: !this._ngSelect.selectableGroup
|
|
1430
|
+
disabled: !this._ngSelect.selectableGroup,
|
|
1467
1431
|
htmlId: newId(),
|
|
1468
1432
|
};
|
|
1469
|
-
const groupKey = isGroupByFn ? this._ngSelect.bindLabel
|
|
1470
|
-
const groupValue = this._ngSelect.groupValue
|
|
1433
|
+
const groupKey = isGroupByFn ? this._ngSelect.bindLabel : this._ngSelect.groupBy;
|
|
1434
|
+
const groupValue = this._ngSelect.groupValue ||
|
|
1471
1435
|
(() => {
|
|
1472
1436
|
if (isObjectKey) {
|
|
1473
1437
|
return key.value;
|
|
@@ -1558,36 +1522,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1558
1522
|
const CSS_POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
1559
1523
|
const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
|
|
1560
1524
|
class NgDropdownPanelComponent {
|
|
1561
|
-
constructor() {
|
|
1562
|
-
this._renderer =
|
|
1563
|
-
this._zone =
|
|
1564
|
-
this._panelService =
|
|
1565
|
-
this._document =
|
|
1566
|
-
this.
|
|
1567
|
-
this.
|
|
1568
|
-
this.
|
|
1569
|
-
this.
|
|
1570
|
-
this.appendTo = input(undefined);
|
|
1571
|
-
this.bufferAmount = input(undefined);
|
|
1572
|
-
this.virtualScroll = input(false, { transform: booleanAttribute });
|
|
1573
|
-
this.headerTemplate = input(undefined);
|
|
1574
|
-
this.footerTemplate = input(undefined);
|
|
1575
|
-
this.filterValue = input(null);
|
|
1525
|
+
constructor(_renderer, _zone, _panelService, _elementRef, _document) {
|
|
1526
|
+
this._renderer = _renderer;
|
|
1527
|
+
this._zone = _zone;
|
|
1528
|
+
this._panelService = _panelService;
|
|
1529
|
+
this._document = _document;
|
|
1530
|
+
this.items = [];
|
|
1531
|
+
this.position = 'auto';
|
|
1532
|
+
this.virtualScroll = false;
|
|
1533
|
+
this.filterValue = null;
|
|
1576
1534
|
this.ariaLabelDropdown = input(null);
|
|
1577
|
-
this.update =
|
|
1578
|
-
this.scroll =
|
|
1579
|
-
this.scrollToEnd =
|
|
1580
|
-
this.outsideClick =
|
|
1581
|
-
this.contentElementRef = viewChild('content', { read: ElementRef });
|
|
1582
|
-
this.scrollElementRef = viewChild('scroll', { read: ElementRef });
|
|
1583
|
-
this.paddingElementRef = viewChild('padding', { read: ElementRef });
|
|
1535
|
+
this.update = new EventEmitter();
|
|
1536
|
+
this.scroll = new EventEmitter();
|
|
1537
|
+
this.scrollToEnd = new EventEmitter();
|
|
1538
|
+
this.outsideClick = new EventEmitter();
|
|
1584
1539
|
this._destroy$ = new Subject();
|
|
1585
|
-
this._virtualPadding = computed(() => this.paddingElementRef()?.nativeElement);
|
|
1586
|
-
this._scrollablePanel = computed(() => this.scrollElementRef()?.nativeElement);
|
|
1587
|
-
this._contentPanel = computed(() => this.contentElementRef()?.nativeElement);
|
|
1588
1540
|
this._scrollToEndFired = false;
|
|
1589
1541
|
this._updateScrollHeight = false;
|
|
1590
1542
|
this._lastScrollPosition = 0;
|
|
1543
|
+
this._dropdown = _elementRef.nativeElement;
|
|
1591
1544
|
}
|
|
1592
1545
|
get currentPosition() {
|
|
1593
1546
|
return this._currentPosition;
|
|
@@ -1602,15 +1555,18 @@ class NgDropdownPanelComponent {
|
|
|
1602
1555
|
}
|
|
1603
1556
|
}
|
|
1604
1557
|
get _startOffset() {
|
|
1605
|
-
if (this.markedItem
|
|
1558
|
+
if (this.markedItem) {
|
|
1606
1559
|
const { itemHeight, panelHeight } = this._panelService.dimensions;
|
|
1607
|
-
const offset = this.markedItem
|
|
1560
|
+
const offset = this.markedItem.index * itemHeight;
|
|
1608
1561
|
return panelHeight > offset ? 0 : offset;
|
|
1609
1562
|
}
|
|
1610
1563
|
return 0;
|
|
1611
1564
|
}
|
|
1612
1565
|
ngOnInit() {
|
|
1613
1566
|
this._select = this._dropdown.parentElement;
|
|
1567
|
+
this._virtualPadding = this.paddingElementRef.nativeElement;
|
|
1568
|
+
this._scrollablePanel = this.scrollElementRef.nativeElement;
|
|
1569
|
+
this._contentPanel = this.contentElementRef.nativeElement;
|
|
1614
1570
|
this._handleScroll();
|
|
1615
1571
|
this._handleOutsideClick();
|
|
1616
1572
|
this._appendDropdown();
|
|
@@ -1626,7 +1582,7 @@ class NgDropdownPanelComponent {
|
|
|
1626
1582
|
this._destroy$.next();
|
|
1627
1583
|
this._destroy$.complete();
|
|
1628
1584
|
this._destroy$.unsubscribe();
|
|
1629
|
-
if (this.appendTo
|
|
1585
|
+
if (this.appendTo) {
|
|
1630
1586
|
this._renderer.removeChild(this._dropdown.parentNode, this._dropdown);
|
|
1631
1587
|
}
|
|
1632
1588
|
}
|
|
@@ -1634,12 +1590,12 @@ class NgDropdownPanelComponent {
|
|
|
1634
1590
|
if (!option) {
|
|
1635
1591
|
return;
|
|
1636
1592
|
}
|
|
1637
|
-
const index = this.items
|
|
1593
|
+
const index = this.items.indexOf(option);
|
|
1638
1594
|
if (index < 0 || index >= this.itemsLength) {
|
|
1639
1595
|
return;
|
|
1640
1596
|
}
|
|
1641
1597
|
let scrollTo;
|
|
1642
|
-
if (this.virtualScroll
|
|
1598
|
+
if (this.virtualScroll) {
|
|
1643
1599
|
const itemHeight = this._panelService.dimensions.itemHeight;
|
|
1644
1600
|
scrollTo = this._panelService.getScrollTo(index * itemHeight, itemHeight, this._lastScrollPosition);
|
|
1645
1601
|
}
|
|
@@ -1649,11 +1605,11 @@ class NgDropdownPanelComponent {
|
|
|
1649
1605
|
scrollTo = this._panelService.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
|
|
1650
1606
|
}
|
|
1651
1607
|
if (isDefined(scrollTo)) {
|
|
1652
|
-
this._scrollablePanel
|
|
1608
|
+
this._scrollablePanel.scrollTop = scrollTo;
|
|
1653
1609
|
}
|
|
1654
1610
|
}
|
|
1655
1611
|
scrollToTag() {
|
|
1656
|
-
const panel = this._scrollablePanel
|
|
1612
|
+
const panel = this._scrollablePanel;
|
|
1657
1613
|
panel.scrollTop = panel.scrollHeight - panel.clientHeight;
|
|
1658
1614
|
}
|
|
1659
1615
|
adjustPosition() {
|
|
@@ -1667,7 +1623,7 @@ class NgDropdownPanelComponent {
|
|
|
1667
1623
|
else {
|
|
1668
1624
|
this._updateDropdownClass('bottom');
|
|
1669
1625
|
}
|
|
1670
|
-
if (this.appendTo
|
|
1626
|
+
if (this.appendTo) {
|
|
1671
1627
|
this._updateYPosition();
|
|
1672
1628
|
}
|
|
1673
1629
|
this._dropdown.style.opacity = '1';
|
|
@@ -1684,10 +1640,7 @@ class NgDropdownPanelComponent {
|
|
|
1684
1640
|
}
|
|
1685
1641
|
_handleScroll() {
|
|
1686
1642
|
this._zone.runOutsideAngular(() => {
|
|
1687
|
-
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
fromEvent(this._scrollablePanel(), 'scroll')
|
|
1643
|
+
fromEvent(this.scrollElementRef.nativeElement, 'scroll')
|
|
1691
1644
|
.pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER))
|
|
1692
1645
|
.subscribe((e) => {
|
|
1693
1646
|
const path = e.path || (e.composedPath && e.composedPath());
|
|
@@ -1719,10 +1672,11 @@ class NgDropdownPanelComponent {
|
|
|
1719
1672
|
}
|
|
1720
1673
|
this._zone.run(() => this.outsideClick.emit());
|
|
1721
1674
|
}
|
|
1722
|
-
_onItemsChange(items
|
|
1675
|
+
_onItemsChange(items, firstChange) {
|
|
1676
|
+
this.items = items || [];
|
|
1723
1677
|
this._scrollToEndFired = false;
|
|
1724
1678
|
this.itemsLength = items.length;
|
|
1725
|
-
if (this.virtualScroll
|
|
1679
|
+
if (this.virtualScroll) {
|
|
1726
1680
|
this._updateItemsRange(firstChange);
|
|
1727
1681
|
}
|
|
1728
1682
|
else {
|
|
@@ -1731,16 +1685,16 @@ class NgDropdownPanelComponent {
|
|
|
1731
1685
|
}
|
|
1732
1686
|
}
|
|
1733
1687
|
_updateItems(firstChange) {
|
|
1734
|
-
this.update.emit(this.items
|
|
1688
|
+
this.update.emit(this.items);
|
|
1735
1689
|
if (firstChange === false) {
|
|
1736
1690
|
return;
|
|
1737
1691
|
}
|
|
1738
1692
|
this._zone.runOutsideAngular(() => {
|
|
1739
1693
|
Promise.resolve().then(() => {
|
|
1740
|
-
const panelHeight = this._scrollablePanel
|
|
1694
|
+
const panelHeight = this._scrollablePanel.clientHeight;
|
|
1741
1695
|
this._panelService.setDimensions(0, panelHeight);
|
|
1742
1696
|
this._handleDropdownPosition();
|
|
1743
|
-
this.scrollTo(this.markedItem
|
|
1697
|
+
this.scrollTo(this.markedItem, firstChange);
|
|
1744
1698
|
});
|
|
1745
1699
|
});
|
|
1746
1700
|
}
|
|
@@ -1758,7 +1712,7 @@ class NgDropdownPanelComponent {
|
|
|
1758
1712
|
});
|
|
1759
1713
|
}
|
|
1760
1714
|
_onContentScrolled(scrollTop) {
|
|
1761
|
-
if (this.virtualScroll
|
|
1715
|
+
if (this.virtualScroll) {
|
|
1762
1716
|
this._renderItemsRange(scrollTop);
|
|
1763
1717
|
}
|
|
1764
1718
|
this._lastScrollPosition = scrollTop;
|
|
@@ -1766,15 +1720,15 @@ class NgDropdownPanelComponent {
|
|
|
1766
1720
|
}
|
|
1767
1721
|
_updateVirtualHeight(height) {
|
|
1768
1722
|
if (this._updateScrollHeight) {
|
|
1769
|
-
this._virtualPadding
|
|
1723
|
+
this._virtualPadding.style.height = `${height}px`;
|
|
1770
1724
|
this._updateScrollHeight = false;
|
|
1771
1725
|
}
|
|
1772
1726
|
}
|
|
1773
1727
|
_setVirtualHeight() {
|
|
1774
|
-
if (!this._virtualPadding
|
|
1728
|
+
if (!this._virtualPadding) {
|
|
1775
1729
|
return;
|
|
1776
1730
|
}
|
|
1777
|
-
this._virtualPadding
|
|
1731
|
+
this._virtualPadding.style.height = `0px`;
|
|
1778
1732
|
}
|
|
1779
1733
|
_onItemsLengthChanged() {
|
|
1780
1734
|
this._updateScrollHeight = true;
|
|
@@ -1783,16 +1737,16 @@ class NgDropdownPanelComponent {
|
|
|
1783
1737
|
if (scrollTop && this._lastScrollPosition === scrollTop) {
|
|
1784
1738
|
return;
|
|
1785
1739
|
}
|
|
1786
|
-
scrollTop = scrollTop || this._scrollablePanel
|
|
1787
|
-
const range = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount
|
|
1740
|
+
scrollTop = scrollTop || this._scrollablePanel.scrollTop;
|
|
1741
|
+
const range = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount);
|
|
1788
1742
|
this._updateVirtualHeight(range.scrollHeight);
|
|
1789
|
-
this._contentPanel
|
|
1743
|
+
this._contentPanel.style.transform = `translateY(${range.topPadding}px)`;
|
|
1790
1744
|
this._zone.run(() => {
|
|
1791
|
-
this.update.emit(this.items
|
|
1745
|
+
this.update.emit(this.items.slice(range.start, range.end));
|
|
1792
1746
|
this.scroll.emit({ start: range.start, end: range.end });
|
|
1793
1747
|
});
|
|
1794
1748
|
if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
|
|
1795
|
-
this._scrollablePanel
|
|
1749
|
+
this._scrollablePanel.scrollTop = scrollTop;
|
|
1796
1750
|
this._lastScrollPosition = scrollTop;
|
|
1797
1751
|
}
|
|
1798
1752
|
}
|
|
@@ -1800,13 +1754,13 @@ class NgDropdownPanelComponent {
|
|
|
1800
1754
|
if (this._panelService.dimensions.itemHeight > 0 || this.itemsLength === 0) {
|
|
1801
1755
|
return Promise.resolve(this._panelService.dimensions);
|
|
1802
1756
|
}
|
|
1803
|
-
const [first] = this.items
|
|
1757
|
+
const [first] = this.items;
|
|
1804
1758
|
this.update.emit([first]);
|
|
1805
1759
|
return Promise.resolve().then(() => {
|
|
1806
1760
|
const option = this._dropdown.querySelector(`#${first.htmlId}`);
|
|
1807
1761
|
const optionHeight = option.clientHeight;
|
|
1808
|
-
this._virtualPadding
|
|
1809
|
-
const panelHeight = this._scrollablePanel
|
|
1762
|
+
this._virtualPadding.style.height = `${optionHeight * this.itemsLength}px`;
|
|
1763
|
+
const panelHeight = this._scrollablePanel.clientHeight;
|
|
1810
1764
|
this._panelService.setDimensions(optionHeight, panelHeight);
|
|
1811
1765
|
return this._panelService.dimensions;
|
|
1812
1766
|
});
|
|
@@ -1815,16 +1769,15 @@ class NgDropdownPanelComponent {
|
|
|
1815
1769
|
if (this._scrollToEndFired || scrollTop === 0) {
|
|
1816
1770
|
return;
|
|
1817
1771
|
}
|
|
1818
|
-
const padding = this.virtualScroll
|
|
1772
|
+
const padding = this.virtualScroll ? this._virtualPadding : this._contentPanel;
|
|
1819
1773
|
if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
|
|
1820
1774
|
this._zone.run(() => this.scrollToEnd.emit());
|
|
1821
1775
|
this._scrollToEndFired = true;
|
|
1822
1776
|
}
|
|
1823
1777
|
}
|
|
1824
1778
|
_calculateCurrentPosition(dropdownEl) {
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
return position;
|
|
1779
|
+
if (this.position !== 'auto') {
|
|
1780
|
+
return this.position;
|
|
1828
1781
|
}
|
|
1829
1782
|
const selectRect = this._select.getBoundingClientRect();
|
|
1830
1783
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
@@ -1839,14 +1792,14 @@ class NgDropdownPanelComponent {
|
|
|
1839
1792
|
}
|
|
1840
1793
|
}
|
|
1841
1794
|
_appendDropdown() {
|
|
1842
|
-
if (!this.appendTo
|
|
1795
|
+
if (!this.appendTo) {
|
|
1843
1796
|
return;
|
|
1844
1797
|
}
|
|
1845
1798
|
this._parent = this._dropdown.shadowRoot
|
|
1846
|
-
? this._dropdown.shadowRoot.querySelector(this.appendTo
|
|
1847
|
-
: document.querySelector(this.appendTo
|
|
1799
|
+
? this._dropdown.shadowRoot.querySelector(this.appendTo)
|
|
1800
|
+
: document.querySelector(this.appendTo);
|
|
1848
1801
|
if (!this._parent) {
|
|
1849
|
-
throw new Error(`appendTo selector ${this.appendTo
|
|
1802
|
+
throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);
|
|
1850
1803
|
}
|
|
1851
1804
|
this._updateXPosition();
|
|
1852
1805
|
this._parent.appendChild(this._dropdown);
|
|
@@ -1854,17 +1807,8 @@ class NgDropdownPanelComponent {
|
|
|
1854
1807
|
_updateXPosition() {
|
|
1855
1808
|
const select = this._select.getBoundingClientRect();
|
|
1856
1809
|
const parent = this._parent.getBoundingClientRect();
|
|
1857
|
-
const isRTL = document.documentElement.dir === 'rtl';
|
|
1858
1810
|
const offsetLeft = select.left - parent.left;
|
|
1859
|
-
|
|
1860
|
-
const offsetRight = parent.right - select.right;
|
|
1861
|
-
this._dropdown.style.right = offsetRight + 'px';
|
|
1862
|
-
this._dropdown.style.left = 'auto';
|
|
1863
|
-
}
|
|
1864
|
-
else {
|
|
1865
|
-
this._dropdown.style.left = offsetLeft + 'px';
|
|
1866
|
-
this._dropdown.style.right = 'auto';
|
|
1867
|
-
}
|
|
1811
|
+
this._dropdown.style.left = offsetLeft + 'px';
|
|
1868
1812
|
this._dropdown.style.width = select.width + 'px';
|
|
1869
1813
|
this._dropdown.style.minWidth = select.width + 'px';
|
|
1870
1814
|
}
|
|
@@ -1896,22 +1840,22 @@ class NgDropdownPanelComponent {
|
|
|
1896
1840
|
});
|
|
1897
1841
|
});
|
|
1898
1842
|
}
|
|
1899
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1900
|
-
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:
|
|
1901
|
-
@if (headerTemplate
|
|
1843
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, deps: [{ token: i0.Renderer2 }, { token: i0.NgZone }, { token: NgDropdownPanelService }, { token: i0.ElementRef }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1844
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgDropdownPanelComponent, isStandalone: true, selector: "ng-dropdown-panel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, markedItem: { classPropertyName: "markedItem", publicName: "markedItem", isSignal: false, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: false, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: false, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: false, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { update: "update", scroll: "scroll", scrollToEnd: "scrollToEnd", outsideClick: "outsideClick" }, viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }, { propertyName: "scrollElementRef", first: true, predicate: ["scroll"], descendants: true, read: ElementRef, static: true }, { propertyName: "paddingElementRef", first: true, predicate: ["padding"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
1845
|
+
@if (headerTemplate) {
|
|
1902
1846
|
<div class="ng-dropdown-header">
|
|
1903
|
-
<ng-container [ngTemplateOutlet]="headerTemplate
|
|
1847
|
+
<ng-container [ngTemplateOutlet]="headerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
|
|
1904
1848
|
</div>
|
|
1905
1849
|
}
|
|
1906
1850
|
<div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
|
|
1907
|
-
<div #padding [class.total-padding]="virtualScroll
|
|
1908
|
-
<div #content [class.scrollable-content]="virtualScroll
|
|
1851
|
+
<div #padding [class.total-padding]="virtualScroll"></div>
|
|
1852
|
+
<div #content [class.scrollable-content]="virtualScroll && items.length">
|
|
1909
1853
|
<ng-content />
|
|
1910
1854
|
</div>
|
|
1911
1855
|
</div>
|
|
1912
|
-
@if (footerTemplate
|
|
1856
|
+
@if (footerTemplate) {
|
|
1913
1857
|
<div class="ng-dropdown-footer">
|
|
1914
|
-
<ng-container [ngTemplateOutlet]="footerTemplate
|
|
1858
|
+
<ng-container [ngTemplateOutlet]="footerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
|
|
1915
1859
|
</div>
|
|
1916
1860
|
}
|
|
1917
1861
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
@@ -1923,52 +1867,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1923
1867
|
encapsulation: ViewEncapsulation.None,
|
|
1924
1868
|
selector: 'ng-dropdown-panel',
|
|
1925
1869
|
template: `
|
|
1926
|
-
@if (headerTemplate
|
|
1870
|
+
@if (headerTemplate) {
|
|
1927
1871
|
<div class="ng-dropdown-header">
|
|
1928
|
-
<ng-container [ngTemplateOutlet]="headerTemplate
|
|
1872
|
+
<ng-container [ngTemplateOutlet]="headerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
|
|
1929
1873
|
</div>
|
|
1930
1874
|
}
|
|
1931
1875
|
<div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
|
|
1932
|
-
<div #padding [class.total-padding]="virtualScroll
|
|
1933
|
-
<div #content [class.scrollable-content]="virtualScroll
|
|
1876
|
+
<div #padding [class.total-padding]="virtualScroll"></div>
|
|
1877
|
+
<div #content [class.scrollable-content]="virtualScroll && items.length">
|
|
1934
1878
|
<ng-content />
|
|
1935
1879
|
</div>
|
|
1936
1880
|
</div>
|
|
1937
|
-
@if (footerTemplate
|
|
1881
|
+
@if (footerTemplate) {
|
|
1938
1882
|
<div class="ng-dropdown-footer">
|
|
1939
|
-
<ng-container [ngTemplateOutlet]="footerTemplate
|
|
1883
|
+
<ng-container [ngTemplateOutlet]="footerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }" />
|
|
1940
1884
|
</div>
|
|
1941
1885
|
}
|
|
1942
1886
|
`,
|
|
1943
|
-
imports: [NgTemplateOutlet]
|
|
1887
|
+
imports: [NgTemplateOutlet],
|
|
1944
1888
|
}]
|
|
1945
|
-
}] }
|
|
1889
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.NgZone }, { type: NgDropdownPanelService }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
1890
|
+
type: Optional
|
|
1891
|
+
}, {
|
|
1892
|
+
type: Inject,
|
|
1893
|
+
args: [DOCUMENT]
|
|
1894
|
+
}] }], propDecorators: { items: [{
|
|
1895
|
+
type: Input
|
|
1896
|
+
}], markedItem: [{
|
|
1897
|
+
type: Input
|
|
1898
|
+
}], position: [{
|
|
1899
|
+
type: Input
|
|
1900
|
+
}], appendTo: [{
|
|
1901
|
+
type: Input
|
|
1902
|
+
}], bufferAmount: [{
|
|
1903
|
+
type: Input
|
|
1904
|
+
}], virtualScroll: [{
|
|
1905
|
+
type: Input,
|
|
1906
|
+
args: [{ transform: booleanAttribute }]
|
|
1907
|
+
}], headerTemplate: [{
|
|
1908
|
+
type: Input
|
|
1909
|
+
}], footerTemplate: [{
|
|
1910
|
+
type: Input
|
|
1911
|
+
}], filterValue: [{
|
|
1912
|
+
type: Input
|
|
1913
|
+
}], update: [{
|
|
1914
|
+
type: Output
|
|
1915
|
+
}], scroll: [{
|
|
1916
|
+
type: Output
|
|
1917
|
+
}], scrollToEnd: [{
|
|
1918
|
+
type: Output
|
|
1919
|
+
}], outsideClick: [{
|
|
1920
|
+
type: Output
|
|
1921
|
+
}], contentElementRef: [{
|
|
1922
|
+
type: ViewChild,
|
|
1923
|
+
args: ['content', { read: ElementRef, static: true }]
|
|
1924
|
+
}], scrollElementRef: [{
|
|
1925
|
+
type: ViewChild,
|
|
1926
|
+
args: ['scroll', { read: ElementRef, static: true }]
|
|
1927
|
+
}], paddingElementRef: [{
|
|
1928
|
+
type: ViewChild,
|
|
1929
|
+
args: ['padding', { read: ElementRef, static: true }]
|
|
1930
|
+
}] } });
|
|
1946
1931
|
|
|
1947
1932
|
class NgOptionComponent {
|
|
1948
|
-
constructor() {
|
|
1949
|
-
this.
|
|
1950
|
-
this.disabled =
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
this.
|
|
1955
|
-
this.stateChange = computed(() => ({
|
|
1956
|
-
value: this.value(),
|
|
1957
|
-
disabled: this.disabled(),
|
|
1958
|
-
label: this.label(),
|
|
1959
|
-
}));
|
|
1960
|
-
this.stateChange$ = toObservable(this.stateChange);
|
|
1961
|
-
afterNextRender(() => {
|
|
1962
|
-
if (this._label !== this.label()) {
|
|
1963
|
-
this.label.set(this._label);
|
|
1964
|
-
}
|
|
1965
|
-
});
|
|
1933
|
+
constructor(elementRef) {
|
|
1934
|
+
this.elementRef = elementRef;
|
|
1935
|
+
this.disabled = false;
|
|
1936
|
+
this.stateChange$ = new Subject();
|
|
1937
|
+
}
|
|
1938
|
+
get label() {
|
|
1939
|
+
return (this.elementRef.nativeElement.textContent || '').trim();
|
|
1966
1940
|
}
|
|
1967
|
-
|
|
1968
|
-
|
|
1941
|
+
ngOnChanges(changes) {
|
|
1942
|
+
if (changes.disabled) {
|
|
1943
|
+
this.stateChange$.next({
|
|
1944
|
+
value: this.value,
|
|
1945
|
+
disabled: this.disabled,
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
ngAfterViewChecked() {
|
|
1950
|
+
if (this.label !== this._previousLabel) {
|
|
1951
|
+
this._previousLabel = this.label;
|
|
1952
|
+
this.stateChange$.next({
|
|
1953
|
+
value: this.value,
|
|
1954
|
+
disabled: this.disabled,
|
|
1955
|
+
label: this.elementRef.nativeElement.innerHTML,
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
ngOnDestroy() {
|
|
1960
|
+
this.stateChange$.complete();
|
|
1969
1961
|
}
|
|
1970
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1971
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1962
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1963
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.0.0", type: NgOptionComponent, isStandalone: true, selector: "ng-option", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, usesOnChanges: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1972
1964
|
}
|
|
1973
1965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, decorators: [{
|
|
1974
1966
|
type: Component,
|
|
@@ -1978,7 +1970,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1978
1970
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1979
1971
|
template: `<ng-content />`,
|
|
1980
1972
|
}]
|
|
1981
|
-
}], ctorParameters: () => []
|
|
1973
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { value: [{
|
|
1974
|
+
type: Input
|
|
1975
|
+
}], disabled: [{
|
|
1976
|
+
type: Input,
|
|
1977
|
+
args: [{ transform: booleanAttribute }]
|
|
1978
|
+
}] } });
|
|
1982
1979
|
|
|
1983
1980
|
var KeyCode;
|
|
1984
1981
|
(function (KeyCode) {
|
|
@@ -2066,91 +2063,87 @@ class DefaultSelectionModel {
|
|
|
2066
2063
|
}
|
|
2067
2064
|
}
|
|
2068
2065
|
|
|
2066
|
+
class NgSelectConfig {
|
|
2067
|
+
constructor() {
|
|
2068
|
+
this.fixedPlaceholder = false;
|
|
2069
|
+
this.notFoundText = 'No items found';
|
|
2070
|
+
this.typeToSearchText = 'Type to search';
|
|
2071
|
+
this.addTagText = 'Add item';
|
|
2072
|
+
this.loadingText = 'Loading...';
|
|
2073
|
+
this.clearAllText = 'Clear all';
|
|
2074
|
+
this.disableVirtualScroll = true;
|
|
2075
|
+
this.openOnEnter = true;
|
|
2076
|
+
this.appearance = 'underline';
|
|
2077
|
+
this.tabFocusOnClear = true;
|
|
2078
|
+
}
|
|
2079
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2080
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
|
|
2081
|
+
}
|
|
2082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, decorators: [{
|
|
2083
|
+
type: Injectable,
|
|
2084
|
+
args: [{ providedIn: 'root' }]
|
|
2085
|
+
}] });
|
|
2086
|
+
|
|
2087
|
+
class ConsoleService {
|
|
2088
|
+
warn(message) {
|
|
2089
|
+
console.warn(message);
|
|
2090
|
+
}
|
|
2091
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2092
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, providedIn: 'root' }); }
|
|
2093
|
+
}
|
|
2094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, decorators: [{
|
|
2095
|
+
type: Injectable,
|
|
2096
|
+
args: [{ providedIn: 'root' }]
|
|
2097
|
+
}] });
|
|
2098
|
+
|
|
2069
2099
|
const SELECTION_MODEL_FACTORY = new InjectionToken('ng-select-selection-model');
|
|
2070
2100
|
class NgSelectComponent {
|
|
2071
|
-
constructor() {
|
|
2072
|
-
this.classes =
|
|
2073
|
-
this.autoFocus =
|
|
2074
|
-
this.config =
|
|
2075
|
-
this._cd =
|
|
2076
|
-
this._console =
|
|
2077
|
-
this.
|
|
2078
|
-
this.
|
|
2079
|
-
this.
|
|
2080
|
-
this.
|
|
2081
|
-
this.
|
|
2082
|
-
this.
|
|
2083
|
-
this.
|
|
2084
|
-
this.
|
|
2085
|
-
this.
|
|
2086
|
-
this.
|
|
2087
|
-
this.
|
|
2088
|
-
this.
|
|
2089
|
-
this.
|
|
2090
|
-
this.
|
|
2091
|
-
this.
|
|
2092
|
-
this.
|
|
2093
|
-
this.
|
|
2094
|
-
this.closeOnSelect = input(true, { transform: booleanAttribute });
|
|
2095
|
-
this.hideSelected = input(false, { transform: booleanAttribute });
|
|
2096
|
-
this.selectOnTab = input(false, { transform: booleanAttribute });
|
|
2097
|
-
this.openOnEnter = input(undefined, { transform: booleanAttribute });
|
|
2098
|
-
this.maxSelectedItems = input(undefined, { transform: numberAttribute });
|
|
2099
|
-
this.groupBy = input(undefined);
|
|
2100
|
-
this.groupValue = input(undefined);
|
|
2101
|
-
this.bufferAmount = input(4, { transform: numberAttribute });
|
|
2102
|
-
this.virtualScroll = input(undefined, { transform: booleanAttribute });
|
|
2103
|
-
this.selectableGroup = input(false, { transform: booleanAttribute });
|
|
2101
|
+
constructor(classes, autoFocus, config, newSelectionModel, _elementRef, _cd, _console) {
|
|
2102
|
+
this.classes = classes;
|
|
2103
|
+
this.autoFocus = autoFocus;
|
|
2104
|
+
this.config = config;
|
|
2105
|
+
this._cd = _cd;
|
|
2106
|
+
this._console = _console;
|
|
2107
|
+
this.ariaLabelDropdown = 'Options List';
|
|
2108
|
+
this.markFirst = true;
|
|
2109
|
+
this.fixedPlaceholder = false;
|
|
2110
|
+
this.preventToggleOnRightClick = false;
|
|
2111
|
+
this.dropdownPosition = 'auto';
|
|
2112
|
+
this.loading = false;
|
|
2113
|
+
this.closeOnSelect = true;
|
|
2114
|
+
this.hideSelected = false;
|
|
2115
|
+
this.selectOnTab = false;
|
|
2116
|
+
this.bufferAmount = 4;
|
|
2117
|
+
this.selectableGroup = false;
|
|
2118
|
+
this.selectableGroupAsModel = true;
|
|
2119
|
+
this.searchFn = null;
|
|
2120
|
+
this.trackByFn = null;
|
|
2121
|
+
this.clearOnBackspace = true;
|
|
2122
|
+
this.labelForId = null;
|
|
2123
|
+
this.inputAttrs = {};
|
|
2104
2124
|
this.tabFocusOnClearButton = input();
|
|
2105
|
-
this.
|
|
2106
|
-
this.
|
|
2107
|
-
this.
|
|
2108
|
-
this.
|
|
2109
|
-
this.
|
|
2110
|
-
this.
|
|
2111
|
-
this.
|
|
2112
|
-
this.
|
|
2113
|
-
this.
|
|
2114
|
-
this.
|
|
2115
|
-
this.editableSearchTerm = input(false, { transform: booleanAttribute });
|
|
2116
|
-
this.ngClass = input(null);
|
|
2117
|
-
this.typeahead = input(undefined);
|
|
2118
|
-
this.multiple = input(false, { transform: booleanAttribute });
|
|
2119
|
-
this.addTag = input(false);
|
|
2120
|
-
this.searchable = input(true, { transform: booleanAttribute });
|
|
2121
|
-
this.clearable = input(true, { transform: booleanAttribute });
|
|
2122
|
-
this.isOpen = model(false);
|
|
2125
|
+
this.readonly = false;
|
|
2126
|
+
this.searchWhileComposing = true;
|
|
2127
|
+
this.minTermLength = 0;
|
|
2128
|
+
this.editableSearchTerm = false;
|
|
2129
|
+
this.ngClass = null;
|
|
2130
|
+
this.multiple = false;
|
|
2131
|
+
this.addTag = false;
|
|
2132
|
+
this.searchable = true;
|
|
2133
|
+
this.clearable = true;
|
|
2134
|
+
this.isOpen = false;
|
|
2123
2135
|
// output events
|
|
2124
|
-
this.blurEvent =
|
|
2125
|
-
this.focusEvent =
|
|
2126
|
-
this.changeEvent =
|
|
2127
|
-
this.openEvent =
|
|
2128
|
-
this.closeEvent =
|
|
2129
|
-
this.searchEvent =
|
|
2130
|
-
this.clearEvent =
|
|
2131
|
-
this.addEvent =
|
|
2132
|
-
this.removeEvent =
|
|
2133
|
-
this.scroll =
|
|
2134
|
-
this.scrollToEnd =
|
|
2135
|
-
// custom templates
|
|
2136
|
-
this.optionTemplate = contentChild(NgOptionTemplateDirective, { read: TemplateRef });
|
|
2137
|
-
this.optgroupTemplate = contentChild(NgOptgroupTemplateDirective, { read: TemplateRef });
|
|
2138
|
-
this.labelTemplate = contentChild(NgLabelTemplateDirective, { read: TemplateRef });
|
|
2139
|
-
this.multiLabelTemplate = contentChild(NgMultiLabelTemplateDirective, { read: TemplateRef });
|
|
2140
|
-
this.headerTemplate = contentChild(NgHeaderTemplateDirective, { read: TemplateRef });
|
|
2141
|
-
this.footerTemplate = contentChild(NgFooterTemplateDirective, { read: TemplateRef });
|
|
2142
|
-
this.notFoundTemplate = contentChild(NgNotFoundTemplateDirective, { read: TemplateRef });
|
|
2143
|
-
this.placeholderTemplate = contentChild(NgPlaceholderTemplateDirective, { read: TemplateRef });
|
|
2144
|
-
this.typeToSearchTemplate = contentChild(NgTypeToSearchTemplateDirective, { read: TemplateRef });
|
|
2145
|
-
this.loadingTextTemplate = contentChild(NgLoadingTextTemplateDirective, { read: TemplateRef });
|
|
2146
|
-
this.tagTemplate = contentChild(NgTagTemplateDirective, { read: TemplateRef });
|
|
2147
|
-
this.loadingSpinnerTemplate = contentChild(NgLoadingSpinnerTemplateDirective, { read: TemplateRef });
|
|
2148
|
-
this.clearButtonTemplate = contentChild(NgClearButtonTemplateDirective, { read: TemplateRef });
|
|
2149
|
-
this.dropdownPanel = viewChild(forwardRef(() => NgDropdownPanelComponent));
|
|
2150
|
-
this.searchInput = viewChild('searchInput');
|
|
2151
|
-
this.clearButton = viewChild('clearButton');
|
|
2152
|
-
this.ngOptions = contentChildren(NgOptionComponent, { descendants: true });
|
|
2153
|
-
this.ngOptionsObservable = toObservable(this.ngOptions);
|
|
2136
|
+
this.blurEvent = new EventEmitter();
|
|
2137
|
+
this.focusEvent = new EventEmitter();
|
|
2138
|
+
this.changeEvent = new EventEmitter();
|
|
2139
|
+
this.openEvent = new EventEmitter();
|
|
2140
|
+
this.closeEvent = new EventEmitter();
|
|
2141
|
+
this.searchEvent = new EventEmitter();
|
|
2142
|
+
this.clearEvent = new EventEmitter();
|
|
2143
|
+
this.addEvent = new EventEmitter();
|
|
2144
|
+
this.removeEvent = new EventEmitter();
|
|
2145
|
+
this.scroll = new EventEmitter();
|
|
2146
|
+
this.scrollToEnd = new EventEmitter();
|
|
2154
2147
|
this.useDefaultClass = true;
|
|
2155
2148
|
this.viewPortItems = [];
|
|
2156
2149
|
this.searchTerm = null;
|
|
@@ -2162,64 +2155,72 @@ class NgSelectComponent {
|
|
|
2162
2155
|
this._isComposing = false;
|
|
2163
2156
|
this._destroy$ = new Subject();
|
|
2164
2157
|
this._keyPress$ = new Subject();
|
|
2165
|
-
this.
|
|
2166
|
-
this.
|
|
2167
|
-
this.compareWith = input(undefined, {
|
|
2168
|
-
transform: (fn) => {
|
|
2169
|
-
if (fn !== undefined && fn !== null && !isFunction(fn)) {
|
|
2170
|
-
throw Error('`compareWith` must be a function.');
|
|
2171
|
-
}
|
|
2172
|
-
return fn;
|
|
2173
|
-
},
|
|
2174
|
-
});
|
|
2175
|
-
this.clearSearchOnAdd = input(undefined);
|
|
2176
|
-
this.clearSearchOnAddValue = computed(() => {
|
|
2177
|
-
if (isDefined(this.clearSearchOnAdd())) {
|
|
2178
|
-
return this.clearSearchOnAdd();
|
|
2179
|
-
}
|
|
2180
|
-
if (isDefined(this.config.clearSearchOnAdd)) {
|
|
2181
|
-
return this.config.clearSearchOnAdd;
|
|
2182
|
-
}
|
|
2183
|
-
return this.closeOnSelect();
|
|
2184
|
-
});
|
|
2185
|
-
this.deselectOnClick = input();
|
|
2186
|
-
this.deselectOnClickValue = computed(() => {
|
|
2187
|
-
if (isDefined(this.deselectOnClick())) {
|
|
2188
|
-
return this.deselectOnClick();
|
|
2189
|
-
}
|
|
2190
|
-
if (isDefined(this.config.deselectOnClick)) {
|
|
2191
|
-
return this.config.deselectOnClick;
|
|
2192
|
-
}
|
|
2193
|
-
return this.multiple();
|
|
2194
|
-
});
|
|
2195
|
-
this.keyDownFn = input((_) => true);
|
|
2158
|
+
this._items = [];
|
|
2159
|
+
this.keyDownFn = (_) => true;
|
|
2196
2160
|
this.clearItem = (item) => {
|
|
2197
2161
|
const option = this.selectedItems.find((x) => x.value === item);
|
|
2198
2162
|
this.unselect(option);
|
|
2199
2163
|
};
|
|
2200
2164
|
this.trackByOption = (_, item) => {
|
|
2201
|
-
if (this.trackByFn
|
|
2202
|
-
return this.trackByFn(
|
|
2165
|
+
if (this.trackByFn) {
|
|
2166
|
+
return this.trackByFn(item.value);
|
|
2203
2167
|
}
|
|
2204
2168
|
return item;
|
|
2205
2169
|
};
|
|
2206
2170
|
this._onChange = (_) => { };
|
|
2207
2171
|
this._onTouched = () => { };
|
|
2208
|
-
const config = this.config;
|
|
2209
|
-
const newSelectionModel = inject(SELECTION_MODEL_FACTORY, { optional: true });
|
|
2210
|
-
const _elementRef = inject(ElementRef);
|
|
2211
2172
|
this._mergeGlobalConfig(config);
|
|
2212
2173
|
this.itemsList = new ItemsList(this, newSelectionModel ? newSelectionModel() : DefaultSelectionModelFactory());
|
|
2213
2174
|
this.element = _elementRef.nativeElement;
|
|
2214
2175
|
}
|
|
2215
2176
|
get filtered() {
|
|
2216
|
-
return (!!this.searchTerm && this.searchable
|
|
2177
|
+
return (!!this.searchTerm && this.searchable) || this._isComposing;
|
|
2217
2178
|
}
|
|
2218
2179
|
get single() {
|
|
2219
|
-
return !this.multiple
|
|
2180
|
+
return !this.multiple;
|
|
2181
|
+
}
|
|
2182
|
+
get items() {
|
|
2183
|
+
return this._items;
|
|
2184
|
+
}
|
|
2185
|
+
set items(value) {
|
|
2186
|
+
this._itemsAreUsed = true;
|
|
2187
|
+
this._items = value ?? [];
|
|
2220
2188
|
}
|
|
2221
2189
|
get disabled() {
|
|
2222
|
-
return this.readonly
|
|
2190
|
+
return this.readonly || this._disabled;
|
|
2191
|
+
}
|
|
2192
|
+
get compareWith() {
|
|
2193
|
+
return this._compareWith;
|
|
2194
|
+
}
|
|
2195
|
+
set compareWith(fn) {
|
|
2196
|
+
if (fn !== undefined && fn !== null && !isFunction(fn)) {
|
|
2197
|
+
throw Error('`compareWith` must be a function.');
|
|
2198
|
+
}
|
|
2199
|
+
this._compareWith = fn;
|
|
2200
|
+
}
|
|
2201
|
+
get clearSearchOnAdd() {
|
|
2202
|
+
if (isDefined(this._clearSearchOnAdd)) {
|
|
2203
|
+
return this._clearSearchOnAdd;
|
|
2204
|
+
}
|
|
2205
|
+
else if (isDefined(this.config.clearSearchOnAdd)) {
|
|
2206
|
+
return this.config.clearSearchOnAdd;
|
|
2207
|
+
}
|
|
2208
|
+
return this.closeOnSelect;
|
|
2209
|
+
}
|
|
2210
|
+
set clearSearchOnAdd(value) {
|
|
2211
|
+
this._clearSearchOnAdd = value;
|
|
2212
|
+
}
|
|
2213
|
+
get deselectOnClick() {
|
|
2214
|
+
if (isDefined(this._deselectOnClick)) {
|
|
2215
|
+
return this._deselectOnClick;
|
|
2216
|
+
}
|
|
2217
|
+
else if (isDefined(this.config.deselectOnClick)) {
|
|
2218
|
+
return this.config.deselectOnClick;
|
|
2219
|
+
}
|
|
2220
|
+
return this.multiple;
|
|
2221
|
+
}
|
|
2222
|
+
set deselectOnClick(value) {
|
|
2223
|
+
this._deselectOnClick = value;
|
|
2223
2224
|
}
|
|
2224
2225
|
get selectedItems() {
|
|
2225
2226
|
return this.itemsList.selectedItems;
|
|
@@ -2231,8 +2232,8 @@ class NgSelectComponent {
|
|
|
2231
2232
|
return this.selectedItems.length > 0;
|
|
2232
2233
|
}
|
|
2233
2234
|
get currentPanelPosition() {
|
|
2234
|
-
if (this.dropdownPanel
|
|
2235
|
-
return this.dropdownPanel
|
|
2235
|
+
if (this.dropdownPanel) {
|
|
2236
|
+
return this.dropdownPanel.currentPosition;
|
|
2236
2237
|
}
|
|
2237
2238
|
return undefined;
|
|
2238
2239
|
}
|
|
@@ -2241,20 +2242,20 @@ class NgSelectComponent {
|
|
|
2241
2242
|
return false;
|
|
2242
2243
|
}
|
|
2243
2244
|
const term = this.searchTerm.toLowerCase().trim();
|
|
2244
|
-
return (this.addTag
|
|
2245
|
+
return (this.addTag &&
|
|
2245
2246
|
!this.itemsList.filteredItems.some((x) => x.label.toLowerCase() === term) &&
|
|
2246
|
-
((!this.hideSelected
|
|
2247
|
-
!this.loading
|
|
2247
|
+
((!this.hideSelected && this.isOpen) || !this.selectedItems.some((x) => x.label.toLowerCase() === term)) &&
|
|
2248
|
+
!this.loading);
|
|
2248
2249
|
}
|
|
2249
2250
|
get _editableSearchTerm() {
|
|
2250
|
-
return this.editableSearchTerm
|
|
2251
|
+
return this.editableSearchTerm && !this.multiple;
|
|
2251
2252
|
}
|
|
2252
2253
|
get _isTypeahead() {
|
|
2253
|
-
return this.typeahead
|
|
2254
|
+
return this.typeahead && this.typeahead.observers.length > 0;
|
|
2254
2255
|
}
|
|
2255
2256
|
get _validTerm() {
|
|
2256
2257
|
const term = this.searchTerm?.trim();
|
|
2257
|
-
return term && term.length >= this.minTermLength
|
|
2258
|
+
return term && term.length >= this.minTermLength;
|
|
2258
2259
|
}
|
|
2259
2260
|
ngOnInit() {
|
|
2260
2261
|
this._handleKeyPresses();
|
|
@@ -2265,7 +2266,6 @@ class NgSelectComponent {
|
|
|
2265
2266
|
this.itemsList.clearSelected();
|
|
2266
2267
|
}
|
|
2267
2268
|
if (changes.items) {
|
|
2268
|
-
this._itemsAreUsed = true;
|
|
2269
2269
|
this._setItems(changes.items.currentValue || []);
|
|
2270
2270
|
}
|
|
2271
2271
|
if (changes.isOpen) {
|
|
@@ -2273,7 +2273,7 @@ class NgSelectComponent {
|
|
|
2273
2273
|
}
|
|
2274
2274
|
if (changes.groupBy) {
|
|
2275
2275
|
if (!changes.items) {
|
|
2276
|
-
this._setItems([...this.items
|
|
2276
|
+
this._setItems([...this.items]);
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
2279
|
if (changes.inputAttrs) {
|
|
@@ -2297,7 +2297,7 @@ class NgSelectComponent {
|
|
|
2297
2297
|
handleKeyDown($event) {
|
|
2298
2298
|
const keyName = $event.key;
|
|
2299
2299
|
if (Object.values(KeyCode).includes(keyName)) {
|
|
2300
|
-
if (this.keyDownFn(
|
|
2300
|
+
if (this.keyDownFn($event) === false) {
|
|
2301
2301
|
return;
|
|
2302
2302
|
}
|
|
2303
2303
|
this.handleKeyCode($event);
|
|
@@ -2308,7 +2308,7 @@ class NgSelectComponent {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
handleKeyCode($event) {
|
|
2310
2310
|
const target = $event.target;
|
|
2311
|
-
if (this.clearButton
|
|
2311
|
+
if (this.clearButton && this.clearButton.nativeElement === target) {
|
|
2312
2312
|
this.handleKeyCodeClear($event);
|
|
2313
2313
|
}
|
|
2314
2314
|
else {
|
|
@@ -2350,10 +2350,7 @@ class NgSelectComponent {
|
|
|
2350
2350
|
}
|
|
2351
2351
|
}
|
|
2352
2352
|
handleMousedown($event) {
|
|
2353
|
-
if (this.
|
|
2354
|
-
return;
|
|
2355
|
-
}
|
|
2356
|
-
if (this.preventToggleOnRightClick() && $event.button === 2) {
|
|
2353
|
+
if (this.preventToggleOnRightClick && $event.button === 2) {
|
|
2357
2354
|
return false;
|
|
2358
2355
|
}
|
|
2359
2356
|
const target = $event.target;
|
|
@@ -2374,7 +2371,7 @@ class NgSelectComponent {
|
|
|
2374
2371
|
if (!this.focused) {
|
|
2375
2372
|
this.focus();
|
|
2376
2373
|
}
|
|
2377
|
-
if (this.searchable
|
|
2374
|
+
if (this.searchable) {
|
|
2378
2375
|
this.open();
|
|
2379
2376
|
}
|
|
2380
2377
|
else {
|
|
@@ -2382,7 +2379,7 @@ class NgSelectComponent {
|
|
|
2382
2379
|
}
|
|
2383
2380
|
}
|
|
2384
2381
|
handleArrowClick() {
|
|
2385
|
-
if (this.isOpen
|
|
2382
|
+
if (this.isOpen) {
|
|
2386
2383
|
this.close();
|
|
2387
2384
|
}
|
|
2388
2385
|
else {
|
|
@@ -2400,7 +2397,7 @@ class NgSelectComponent {
|
|
|
2400
2397
|
this._onSelectionChanged();
|
|
2401
2398
|
}
|
|
2402
2399
|
clearModel() {
|
|
2403
|
-
if (!this.clearable
|
|
2400
|
+
if (!this.clearable) {
|
|
2404
2401
|
return;
|
|
2405
2402
|
}
|
|
2406
2403
|
this.itemsList.clearSelected();
|
|
@@ -2418,11 +2415,11 @@ class NgSelectComponent {
|
|
|
2418
2415
|
this._onTouched = fn;
|
|
2419
2416
|
}
|
|
2420
2417
|
setDisabledState(state) {
|
|
2421
|
-
this._disabled
|
|
2418
|
+
this._disabled = state;
|
|
2422
2419
|
this._cd.markForCheck();
|
|
2423
2420
|
}
|
|
2424
2421
|
toggle() {
|
|
2425
|
-
if (!this.isOpen
|
|
2422
|
+
if (!this.isOpen) {
|
|
2426
2423
|
this.open();
|
|
2427
2424
|
}
|
|
2428
2425
|
else {
|
|
@@ -2430,14 +2427,14 @@ class NgSelectComponent {
|
|
|
2430
2427
|
}
|
|
2431
2428
|
}
|
|
2432
2429
|
open() {
|
|
2433
|
-
if (this.disabled || this.isOpen
|
|
2430
|
+
if (this.disabled || this.isOpen || this._manualOpen) {
|
|
2434
2431
|
return;
|
|
2435
2432
|
}
|
|
2436
|
-
if (!this._isTypeahead && !this.addTag
|
|
2433
|
+
if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {
|
|
2437
2434
|
return;
|
|
2438
2435
|
}
|
|
2439
|
-
this.isOpen
|
|
2440
|
-
this.itemsList.markSelectedOrDefault(this.markFirst
|
|
2436
|
+
this.isOpen = true;
|
|
2437
|
+
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2441
2438
|
this.openEvent.emit();
|
|
2442
2439
|
if (!this.searchTerm) {
|
|
2443
2440
|
this.focus();
|
|
@@ -2445,10 +2442,10 @@ class NgSelectComponent {
|
|
|
2445
2442
|
this.detectChanges();
|
|
2446
2443
|
}
|
|
2447
2444
|
close() {
|
|
2448
|
-
if (!this.isOpen
|
|
2445
|
+
if (!this.isOpen || this._manualOpen) {
|
|
2449
2446
|
return;
|
|
2450
2447
|
}
|
|
2451
|
-
this.isOpen
|
|
2448
|
+
this.isOpen = false;
|
|
2452
2449
|
this._isComposing = false;
|
|
2453
2450
|
if (!this._editableSearchTerm) {
|
|
2454
2451
|
this._clearSearch();
|
|
@@ -2465,7 +2462,7 @@ class NgSelectComponent {
|
|
|
2465
2462
|
if (!item || item.disabled || this.disabled) {
|
|
2466
2463
|
return;
|
|
2467
2464
|
}
|
|
2468
|
-
if (this.
|
|
2465
|
+
if (this.deselectOnClick && item.selected) {
|
|
2469
2466
|
this.unselect(item);
|
|
2470
2467
|
}
|
|
2471
2468
|
else {
|
|
@@ -2478,24 +2475,24 @@ class NgSelectComponent {
|
|
|
2478
2475
|
select(item) {
|
|
2479
2476
|
if (!item.selected) {
|
|
2480
2477
|
this.itemsList.select(item);
|
|
2481
|
-
if (this.
|
|
2478
|
+
if (this.clearSearchOnAdd && !this._editableSearchTerm) {
|
|
2482
2479
|
this._clearSearch();
|
|
2483
2480
|
}
|
|
2484
2481
|
this._updateNgModel();
|
|
2485
|
-
if (this.multiple
|
|
2482
|
+
if (this.multiple) {
|
|
2486
2483
|
this.addEvent.emit(item.value);
|
|
2487
2484
|
}
|
|
2488
2485
|
}
|
|
2489
|
-
if (this.closeOnSelect
|
|
2486
|
+
if (this.closeOnSelect || this.itemsList.noItemsToSelect) {
|
|
2490
2487
|
this.close();
|
|
2491
2488
|
}
|
|
2492
2489
|
this._onSelectionChanged();
|
|
2493
2490
|
}
|
|
2494
2491
|
focus() {
|
|
2495
|
-
this.searchInput
|
|
2492
|
+
this.searchInput.nativeElement.focus();
|
|
2496
2493
|
}
|
|
2497
2494
|
blur() {
|
|
2498
|
-
this.searchInput
|
|
2495
|
+
this.searchInput.nativeElement.blur();
|
|
2499
2496
|
}
|
|
2500
2497
|
unselect(item) {
|
|
2501
2498
|
if (!item) {
|
|
@@ -2509,13 +2506,13 @@ class NgSelectComponent {
|
|
|
2509
2506
|
}
|
|
2510
2507
|
selectTag() {
|
|
2511
2508
|
let tag;
|
|
2512
|
-
if (isFunction(this.addTag
|
|
2513
|
-
tag = this.addTag(
|
|
2509
|
+
if (isFunction(this.addTag)) {
|
|
2510
|
+
tag = this.addTag(this.searchTerm);
|
|
2514
2511
|
}
|
|
2515
2512
|
else {
|
|
2516
|
-
tag = this._primitive ? this.searchTerm : { [this.bindLabel
|
|
2513
|
+
tag = this._primitive ? this.searchTerm : { [this.bindLabel]: this.searchTerm };
|
|
2517
2514
|
}
|
|
2518
|
-
const handleTag = (item) => (this._isTypeahead || !this.isOpen
|
|
2515
|
+
const handleTag = (item) => (this._isTypeahead || !this.isOpen ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
|
|
2519
2516
|
if (isPromise(tag)) {
|
|
2520
2517
|
tag.then((item) => this.select(handleTag(item))).catch(() => { });
|
|
2521
2518
|
}
|
|
@@ -2524,45 +2521,45 @@ class NgSelectComponent {
|
|
|
2524
2521
|
}
|
|
2525
2522
|
}
|
|
2526
2523
|
showClear() {
|
|
2527
|
-
return this.clearable
|
|
2524
|
+
return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
|
|
2528
2525
|
}
|
|
2529
2526
|
focusOnClear() {
|
|
2530
2527
|
this.blur();
|
|
2531
|
-
if (this.clearButton
|
|
2532
|
-
this.clearButton
|
|
2528
|
+
if (this.clearButton) {
|
|
2529
|
+
this.clearButton.nativeElement.focus();
|
|
2533
2530
|
}
|
|
2534
2531
|
}
|
|
2535
2532
|
showNoItemsFound() {
|
|
2536
2533
|
const empty = this.itemsList.filteredItems.length === 0;
|
|
2537
|
-
return (((empty && !this._isTypeahead && !this.loading
|
|
2534
|
+
return (((empty && !this._isTypeahead && !this.loading) || (empty && this._isTypeahead && this._validTerm && !this.loading)) &&
|
|
2538
2535
|
!this.showAddTag);
|
|
2539
2536
|
}
|
|
2540
2537
|
showTypeToSearch() {
|
|
2541
2538
|
const empty = this.itemsList.filteredItems.length === 0;
|
|
2542
|
-
return empty && this._isTypeahead && !this._validTerm && !this.loading
|
|
2539
|
+
return empty && this._isTypeahead && !this._validTerm && !this.loading;
|
|
2543
2540
|
}
|
|
2544
2541
|
onCompositionStart() {
|
|
2545
2542
|
this._isComposing = true;
|
|
2546
2543
|
}
|
|
2547
2544
|
onCompositionEnd(term) {
|
|
2548
2545
|
this._isComposing = false;
|
|
2549
|
-
if (this.searchWhileComposing
|
|
2546
|
+
if (this.searchWhileComposing) {
|
|
2550
2547
|
return;
|
|
2551
2548
|
}
|
|
2552
2549
|
this.filter(term);
|
|
2553
2550
|
}
|
|
2554
2551
|
filter(term) {
|
|
2555
|
-
if (this._isComposing && !this.searchWhileComposing
|
|
2552
|
+
if (this._isComposing && !this.searchWhileComposing) {
|
|
2556
2553
|
return;
|
|
2557
2554
|
}
|
|
2558
2555
|
this.searchTerm = term;
|
|
2559
|
-
if (this._isTypeahead && (this._validTerm || this.minTermLength
|
|
2560
|
-
this.typeahead
|
|
2556
|
+
if (this._isTypeahead && (this._validTerm || this.minTermLength === 0)) {
|
|
2557
|
+
this.typeahead.next(term);
|
|
2561
2558
|
}
|
|
2562
2559
|
if (!this._isTypeahead) {
|
|
2563
2560
|
this.itemsList.filter(this.searchTerm);
|
|
2564
|
-
if (this.isOpen
|
|
2565
|
-
this.itemsList.markSelectedOrDefault(this.markFirst
|
|
2561
|
+
if (this.isOpen) {
|
|
2562
|
+
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2566
2563
|
}
|
|
2567
2564
|
}
|
|
2568
2565
|
this.searchEvent.emit({ term, items: this.itemsList.filteredItems.map((x) => x.value) });
|
|
@@ -2582,7 +2579,7 @@ class NgSelectComponent {
|
|
|
2582
2579
|
onInputBlur($event) {
|
|
2583
2580
|
this.element.classList.remove('ng-select-focused');
|
|
2584
2581
|
this.blurEvent.emit($event);
|
|
2585
|
-
if (!this.isOpen
|
|
2582
|
+
if (!this.isOpen && !this.disabled) {
|
|
2586
2583
|
this._onTouched();
|
|
2587
2584
|
}
|
|
2588
2585
|
if (this._editableSearchTerm) {
|
|
@@ -2607,57 +2604,61 @@ class NgSelectComponent {
|
|
|
2607
2604
|
}
|
|
2608
2605
|
_setItems(items) {
|
|
2609
2606
|
const firstItem = items[0];
|
|
2610
|
-
this.bindLabel
|
|
2611
|
-
this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel
|
|
2607
|
+
this.bindLabel = this.bindLabel || this._defaultLabel;
|
|
2608
|
+
this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel === this._defaultLabel;
|
|
2612
2609
|
this.itemsList.setItems(items);
|
|
2613
2610
|
if (items.length > 0 && this.hasValue) {
|
|
2614
2611
|
this.itemsList.mapSelectedItems();
|
|
2615
2612
|
}
|
|
2616
|
-
if (this.isOpen
|
|
2613
|
+
if (this.isOpen && isDefined(this.searchTerm) && !this._isTypeahead) {
|
|
2617
2614
|
this.itemsList.filter(this.searchTerm);
|
|
2618
2615
|
}
|
|
2619
|
-
if (this._isTypeahead || this.isOpen
|
|
2620
|
-
this.itemsList.markSelectedOrDefault(this.markFirst
|
|
2616
|
+
if (this._isTypeahead || this.isOpen) {
|
|
2617
|
+
this.itemsList.markSelectedOrDefault(this.markFirst);
|
|
2621
2618
|
}
|
|
2622
2619
|
}
|
|
2623
2620
|
_setItemsFromNgOptions() {
|
|
2624
2621
|
const mapNgOptions = (options) => {
|
|
2625
|
-
|
|
2626
|
-
$ngOptionValue: option.value
|
|
2622
|
+
this.items = options.map((option) => ({
|
|
2623
|
+
$ngOptionValue: option.value,
|
|
2627
2624
|
$ngOptionLabel: option.elementRef.nativeElement.innerHTML,
|
|
2628
|
-
disabled: option.disabled
|
|
2629
|
-
}))
|
|
2630
|
-
this.
|
|
2631
|
-
this.itemsList.setItems(items);
|
|
2625
|
+
disabled: option.disabled,
|
|
2626
|
+
}));
|
|
2627
|
+
this.itemsList.setItems(this.items);
|
|
2632
2628
|
if (this.hasValue) {
|
|
2633
2629
|
this.itemsList.mapSelectedItems();
|
|
2634
2630
|
}
|
|
2631
|
+
this.detectChanges();
|
|
2635
2632
|
};
|
|
2636
|
-
const handleOptionChange = (
|
|
2637
|
-
|
|
2633
|
+
const handleOptionChange = () => {
|
|
2634
|
+
const changedOrDestroyed = merge(this.ngOptions.changes, this._destroy$);
|
|
2635
|
+
merge(...this.ngOptions.map((option) => option.stateChange$))
|
|
2636
|
+
.pipe(takeUntil(changedOrDestroyed))
|
|
2637
|
+
.subscribe((option) => {
|
|
2638
2638
|
const item = this.itemsList.findItem(option.value);
|
|
2639
2639
|
item.disabled = option.disabled;
|
|
2640
2640
|
item.label = option.label || item.label;
|
|
2641
|
-
|
|
2641
|
+
this._cd.detectChanges();
|
|
2642
|
+
});
|
|
2642
2643
|
};
|
|
2643
|
-
this.
|
|
2644
|
-
this.bindLabel
|
|
2644
|
+
this.ngOptions.changes.pipe(startWith(this.ngOptions), takeUntil(this._destroy$)).subscribe((options) => {
|
|
2645
|
+
this.bindLabel = this._defaultLabel;
|
|
2645
2646
|
mapNgOptions(options);
|
|
2646
|
-
|
|
2647
|
-
})
|
|
2647
|
+
handleOptionChange();
|
|
2648
|
+
});
|
|
2648
2649
|
}
|
|
2649
2650
|
_isValidWriteValue(value) {
|
|
2650
|
-
if (!isDefined(value) || (this.multiple
|
|
2651
|
+
if (!isDefined(value) || (this.multiple && value === '') || (Array.isArray(value) && value.length === 0)) {
|
|
2651
2652
|
return false;
|
|
2652
2653
|
}
|
|
2653
2654
|
const validateBinding = (item) => {
|
|
2654
|
-
if (!isDefined(this.compareWith
|
|
2655
|
+
if (!isDefined(this.compareWith) && isObject(item) && this.bindValue) {
|
|
2655
2656
|
this._console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
|
|
2656
2657
|
return false;
|
|
2657
2658
|
}
|
|
2658
2659
|
return true;
|
|
2659
2660
|
};
|
|
2660
|
-
if (this.multiple
|
|
2661
|
+
if (this.multiple) {
|
|
2661
2662
|
if (!Array.isArray(value)) {
|
|
2662
2663
|
this._console.warn('Multiple select ngModel should be array.');
|
|
2663
2664
|
return false;
|
|
@@ -2679,20 +2680,20 @@ class NgSelectComponent {
|
|
|
2679
2680
|
}
|
|
2680
2681
|
else {
|
|
2681
2682
|
const isValObject = isObject(val);
|
|
2682
|
-
const isPrimitive = !isValObject && !this.bindValue
|
|
2683
|
+
const isPrimitive = !isValObject && !this.bindValue;
|
|
2683
2684
|
if (isValObject || isPrimitive) {
|
|
2684
2685
|
this.itemsList.select(this.itemsList.mapItem(val, null));
|
|
2685
2686
|
}
|
|
2686
|
-
else if (this.bindValue
|
|
2687
|
+
else if (this.bindValue) {
|
|
2687
2688
|
item = {
|
|
2688
|
-
[this.bindLabel
|
|
2689
|
-
[this.bindValue
|
|
2689
|
+
[this.bindLabel]: null,
|
|
2690
|
+
[this.bindValue]: val,
|
|
2690
2691
|
};
|
|
2691
2692
|
this.itemsList.select(this.itemsList.mapItem(item, null));
|
|
2692
2693
|
}
|
|
2693
2694
|
}
|
|
2694
2695
|
};
|
|
2695
|
-
if (this.multiple
|
|
2696
|
+
if (this.multiple) {
|
|
2696
2697
|
ngModel.forEach((item) => select(item));
|
|
2697
2698
|
}
|
|
2698
2699
|
else {
|
|
@@ -2700,7 +2701,7 @@ class NgSelectComponent {
|
|
|
2700
2701
|
}
|
|
2701
2702
|
}
|
|
2702
2703
|
_handleKeyPresses() {
|
|
2703
|
-
if (this.searchable
|
|
2704
|
+
if (this.searchable) {
|
|
2704
2705
|
return;
|
|
2705
2706
|
}
|
|
2706
2707
|
this._keyPress$
|
|
@@ -2708,7 +2709,7 @@ class NgSelectComponent {
|
|
|
2708
2709
|
.subscribe((term) => {
|
|
2709
2710
|
const item = this.itemsList.findByLabel(term);
|
|
2710
2711
|
if (item) {
|
|
2711
|
-
if (this.isOpen
|
|
2712
|
+
if (this.isOpen) {
|
|
2712
2713
|
this.itemsList.markItem(item);
|
|
2713
2714
|
this._scrollToMarked();
|
|
2714
2715
|
this._cd.markForCheck();
|
|
@@ -2721,14 +2722,14 @@ class NgSelectComponent {
|
|
|
2721
2722
|
});
|
|
2722
2723
|
}
|
|
2723
2724
|
_setInputAttributes() {
|
|
2724
|
-
const input = this.searchInput
|
|
2725
|
+
const input = this.searchInput.nativeElement;
|
|
2725
2726
|
const attributes = {
|
|
2726
2727
|
type: 'text',
|
|
2727
2728
|
autocorrect: 'off',
|
|
2728
2729
|
autocapitalize: 'off',
|
|
2729
2730
|
autocomplete: 'off',
|
|
2730
2731
|
'aria-controls': this.dropdownId,
|
|
2731
|
-
...this.inputAttrs
|
|
2732
|
+
...this.inputAttrs,
|
|
2732
2733
|
};
|
|
2733
2734
|
for (const key of Object.keys(attributes)) {
|
|
2734
2735
|
input.setAttribute(key, attributes[key]);
|
|
@@ -2740,14 +2741,14 @@ class NgSelectComponent {
|
|
|
2740
2741
|
_updateNgModel() {
|
|
2741
2742
|
const model = [];
|
|
2742
2743
|
for (const item of this.selectedItems) {
|
|
2743
|
-
if (this.bindValue
|
|
2744
|
+
if (this.bindValue) {
|
|
2744
2745
|
let value = null;
|
|
2745
2746
|
if (item.children) {
|
|
2746
|
-
const groupKey = this.groupValue
|
|
2747
|
-
value = item.value[groupKey || this.groupBy
|
|
2747
|
+
const groupKey = this.groupValue ? this.bindValue : this.groupBy;
|
|
2748
|
+
value = item.value[groupKey || this.groupBy];
|
|
2748
2749
|
}
|
|
2749
2750
|
else {
|
|
2750
|
-
value = this.itemsList.resolveNested(item.value, this.bindValue
|
|
2751
|
+
value = this.itemsList.resolveNested(item.value, this.bindValue);
|
|
2751
2752
|
}
|
|
2752
2753
|
model.push(value);
|
|
2753
2754
|
}
|
|
@@ -2756,7 +2757,7 @@ class NgSelectComponent {
|
|
|
2756
2757
|
}
|
|
2757
2758
|
}
|
|
2758
2759
|
const selected = this.selectedItems.map((x) => x.value);
|
|
2759
|
-
if (this.multiple
|
|
2760
|
+
if (this.multiple) {
|
|
2760
2761
|
this._onChange(model);
|
|
2761
2762
|
this.changeEvent.emit(selected);
|
|
2762
2763
|
}
|
|
@@ -2776,40 +2777,39 @@ class NgSelectComponent {
|
|
|
2776
2777
|
_changeSearch(searchTerm) {
|
|
2777
2778
|
this.searchTerm = searchTerm;
|
|
2778
2779
|
if (this._isTypeahead) {
|
|
2779
|
-
this.typeahead
|
|
2780
|
+
this.typeahead.next(searchTerm);
|
|
2780
2781
|
}
|
|
2781
2782
|
}
|
|
2782
2783
|
_scrollToMarked() {
|
|
2783
|
-
if (!this.isOpen
|
|
2784
|
+
if (!this.isOpen || !this.dropdownPanel) {
|
|
2784
2785
|
return;
|
|
2785
2786
|
}
|
|
2786
|
-
this.dropdownPanel
|
|
2787
|
+
this.dropdownPanel.scrollTo(this.itemsList.markedItem);
|
|
2787
2788
|
}
|
|
2788
2789
|
_scrollToTag() {
|
|
2789
|
-
if (!this.isOpen
|
|
2790
|
+
if (!this.isOpen || !this.dropdownPanel) {
|
|
2790
2791
|
return;
|
|
2791
2792
|
}
|
|
2792
|
-
this.dropdownPanel
|
|
2793
|
+
this.dropdownPanel.scrollToTag();
|
|
2793
2794
|
}
|
|
2794
2795
|
_onSelectionChanged() {
|
|
2795
|
-
|
|
2796
|
-
if (this.isOpen() && this.deselectOnClickValue() && appendTo) {
|
|
2796
|
+
if (this.isOpen && this.deselectOnClick && this.appendTo) {
|
|
2797
2797
|
// Make sure items are rendered.
|
|
2798
2798
|
this._cd.detectChanges();
|
|
2799
|
-
this.dropdownPanel
|
|
2799
|
+
this.dropdownPanel.adjustPosition();
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
2802
2802
|
_handleTab($event) {
|
|
2803
|
-
if (this.isOpen
|
|
2803
|
+
if (this.isOpen === false) {
|
|
2804
2804
|
if (this.showClear() && !$event.shiftKey && this.tabFocusOnClear()) {
|
|
2805
2805
|
this.focusOnClear();
|
|
2806
2806
|
$event.preventDefault();
|
|
2807
2807
|
}
|
|
2808
|
-
else if (!this.addTag
|
|
2808
|
+
else if (!this.addTag) {
|
|
2809
2809
|
return;
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
|
-
if (this.selectOnTab
|
|
2812
|
+
if (this.selectOnTab) {
|
|
2813
2813
|
if (this.itemsList.markedItem) {
|
|
2814
2814
|
this.toggleItem(this.itemsList.markedItem);
|
|
2815
2815
|
$event.preventDefault();
|
|
@@ -2827,8 +2827,7 @@ class NgSelectComponent {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
2829
|
_handleEnter($event) {
|
|
2830
|
-
|
|
2831
|
-
if (this.isOpen() || this._manualOpen) {
|
|
2830
|
+
if (this.isOpen || this._manualOpen) {
|
|
2832
2831
|
if (this.itemsList.markedItem) {
|
|
2833
2832
|
this.toggleItem(this.itemsList.markedItem);
|
|
2834
2833
|
}
|
|
@@ -2836,7 +2835,7 @@ class NgSelectComponent {
|
|
|
2836
2835
|
this.selectTag();
|
|
2837
2836
|
}
|
|
2838
2837
|
}
|
|
2839
|
-
else if (openOnEnter) {
|
|
2838
|
+
else if (this.openOnEnter) {
|
|
2840
2839
|
this.open();
|
|
2841
2840
|
}
|
|
2842
2841
|
else {
|
|
@@ -2845,7 +2844,7 @@ class NgSelectComponent {
|
|
|
2845
2844
|
$event.preventDefault();
|
|
2846
2845
|
}
|
|
2847
2846
|
_handleSpace($event) {
|
|
2848
|
-
if (this.isOpen
|
|
2847
|
+
if (this.isOpen || this._manualOpen) {
|
|
2849
2848
|
return;
|
|
2850
2849
|
}
|
|
2851
2850
|
this.open();
|
|
@@ -2864,7 +2863,7 @@ class NgSelectComponent {
|
|
|
2864
2863
|
$event.preventDefault();
|
|
2865
2864
|
}
|
|
2866
2865
|
_handleArrowUp($event) {
|
|
2867
|
-
if (!this.isOpen
|
|
2866
|
+
if (!this.isOpen) {
|
|
2868
2867
|
return;
|
|
2869
2868
|
}
|
|
2870
2869
|
if (this._nextItemIsTag(-1)) {
|
|
@@ -2879,13 +2878,13 @@ class NgSelectComponent {
|
|
|
2879
2878
|
}
|
|
2880
2879
|
_nextItemIsTag(nextStep) {
|
|
2881
2880
|
const nextIndex = this.itemsList.markedIndex + nextStep;
|
|
2882
|
-
return (this.addTag
|
|
2881
|
+
return (this.addTag && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
|
|
2883
2882
|
}
|
|
2884
2883
|
_handleBackspace() {
|
|
2885
|
-
if (this.searchTerm || !this.clearable
|
|
2884
|
+
if (this.searchTerm || !this.clearable || !this.clearOnBackspace || !this.hasValue) {
|
|
2886
2885
|
return;
|
|
2887
2886
|
}
|
|
2888
|
-
if (this.multiple
|
|
2887
|
+
if (this.multiple) {
|
|
2889
2888
|
this.unselect(this.itemsList.lastSelectedItem);
|
|
2890
2889
|
}
|
|
2891
2890
|
else {
|
|
@@ -2893,9 +2892,19 @@ class NgSelectComponent {
|
|
|
2893
2892
|
}
|
|
2894
2893
|
}
|
|
2895
2894
|
_mergeGlobalConfig(config) {
|
|
2896
|
-
this.
|
|
2897
|
-
this.
|
|
2898
|
-
this.
|
|
2895
|
+
this.placeholder = this.placeholder || config.placeholder;
|
|
2896
|
+
this.fixedPlaceholder = this.fixedPlaceholder || config.fixedPlaceholder;
|
|
2897
|
+
this.notFoundText = this.notFoundText || config.notFoundText;
|
|
2898
|
+
this.typeToSearchText = this.typeToSearchText || config.typeToSearchText;
|
|
2899
|
+
this.addTagText = this.addTagText || config.addTagText;
|
|
2900
|
+
this.loadingText = this.loadingText || config.loadingText;
|
|
2901
|
+
this.clearAllText = this.clearAllText || config.clearAllText;
|
|
2902
|
+
this.virtualScroll = this.getVirtualScroll(config);
|
|
2903
|
+
this.openOnEnter = isDefined(this.openOnEnter) ? this.openOnEnter : config.openOnEnter;
|
|
2904
|
+
this.appendTo = this.appendTo || config.appendTo;
|
|
2905
|
+
this.bindValue = this.bindValue || config.bindValue;
|
|
2906
|
+
this.bindLabel = this.bindLabel || config.bindLabel;
|
|
2907
|
+
this.appearance = this.appearance || config.appearance;
|
|
2899
2908
|
this._setTabFocusOnClear();
|
|
2900
2909
|
}
|
|
2901
2910
|
/**
|
|
@@ -2906,7 +2915,7 @@ class NgSelectComponent {
|
|
|
2906
2915
|
* @returns `true` if virtual scroll is enabled, `false` otherwise
|
|
2907
2916
|
*/
|
|
2908
2917
|
getVirtualScroll(config) {
|
|
2909
|
-
return isDefined(this.virtualScroll) ? this.virtualScroll
|
|
2918
|
+
return isDefined(this.virtualScroll) ? this.virtualScroll : this.isVirtualScrollDisabled(config);
|
|
2910
2919
|
}
|
|
2911
2920
|
/**
|
|
2912
2921
|
* Gets disableVirtualScroll value from input or from config
|
|
@@ -2918,15 +2927,15 @@ class NgSelectComponent {
|
|
|
2918
2927
|
isVirtualScrollDisabled(config) {
|
|
2919
2928
|
return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
|
|
2920
2929
|
}
|
|
2921
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2922
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgSelectComponent, isStandalone: true, selector: "ng-select", inputs: {
|
|
2930
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [{ token: 'class', attribute: true }, { token: 'autofocus', attribute: true }, { token: NgSelectConfig }, { token: SELECTION_MODEL_FACTORY, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: ConsoleService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2931
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgSelectComponent, isStandalone: true, selector: "ng-select", inputs: { ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: false, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: false, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, markFirst: { classPropertyName: "markFirst", publicName: "markFirst", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, fixedPlaceholder: { classPropertyName: "fixedPlaceholder", publicName: "fixedPlaceholder", isSignal: false, isRequired: false, transformFunction: null }, notFoundText: { classPropertyName: "notFoundText", publicName: "notFoundText", isSignal: false, isRequired: false, transformFunction: null }, typeToSearchText: { classPropertyName: "typeToSearchText", publicName: "typeToSearchText", isSignal: false, isRequired: false, transformFunction: null }, preventToggleOnRightClick: { classPropertyName: "preventToggleOnRightClick", publicName: "preventToggleOnRightClick", isSignal: false, isRequired: false, transformFunction: null }, addTagText: { classPropertyName: "addTagText", publicName: "addTagText", isSignal: false, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: false, isRequired: false, transformFunction: null }, clearAllText: { classPropertyName: "clearAllText", publicName: "clearAllText", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectOnTab: { classPropertyName: "selectOnTab", publicName: "selectOnTab", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, openOnEnter: { classPropertyName: "openOnEnter", publicName: "openOnEnter", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: false, isRequired: false, transformFunction: numberAttribute }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: false, isRequired: false, transformFunction: null }, groupValue: { classPropertyName: "groupValue", publicName: "groupValue", isSignal: false, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: false, isRequired: false, transformFunction: numberAttribute }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectableGroup: { classPropertyName: "selectableGroup", publicName: "selectableGroup", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectableGroupAsModel: { classPropertyName: "selectableGroupAsModel", publicName: "selectableGroupAsModel", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: false, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: false, isRequired: false, transformFunction: null }, clearOnBackspace: { classPropertyName: "clearOnBackspace", publicName: "clearOnBackspace", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, labelForId: { classPropertyName: "labelForId", publicName: "labelForId", isSignal: false, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: numberAttribute }, tabFocusOnClearButton: { classPropertyName: "tabFocusOnClearButton", publicName: "tabFocusOnClearButton", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, searchWhileComposing: { classPropertyName: "searchWhileComposing", publicName: "searchWhileComposing", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, minTermLength: { classPropertyName: "minTermLength", publicName: "minTermLength", isSignal: false, isRequired: false, transformFunction: numberAttribute }, editableSearchTerm: { classPropertyName: "editableSearchTerm", publicName: "editableSearchTerm", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, ngClass: { classPropertyName: "ngClass", publicName: "ngClass", isSignal: false, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: false, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: false, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, clearSearchOnAdd: { classPropertyName: "clearSearchOnAdd", publicName: "clearSearchOnAdd", isSignal: false, isRequired: false, transformFunction: null }, deselectOnClick: { classPropertyName: "deselectOnClick", publicName: "deselectOnClick", isSignal: false, isRequired: false, transformFunction: null }, keyDownFn: { classPropertyName: "keyDownFn", publicName: "keyDownFn", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { blurEvent: "blur", focusEvent: "focus", changeEvent: "change", openEvent: "open", closeEvent: "close", searchEvent: "search", clearEvent: "clear", addEvent: "add", removeEvent: "remove", scroll: "scroll", scrollToEnd: "scrollToEnd" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.ng-select-typeahead": "this.typeahead", "class.ng-select-multiple": "this.multiple", "class.ng-select-taggable": "this.addTag", "class.ng-select-searchable": "this.searchable", "class.ng-select-clearable": "this.clearable", "class.ng-select-opened": "this.isOpen", "class.ng-select": "this.useDefaultClass", "class.ng-select-filtered": "this.filtered", "class.ng-select-single": "this.single", "class.ng-select-disabled": "this.disabled" } }, providers: [
|
|
2923
2932
|
{
|
|
2924
2933
|
provide: NG_VALUE_ACCESSOR,
|
|
2925
2934
|
useExisting: forwardRef(() => NgSelectComponent),
|
|
2926
2935
|
multi: true,
|
|
2927
2936
|
},
|
|
2928
2937
|
NgDropdownPanelService,
|
|
2929
|
-
], 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<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{position:relative;z-index:1001;-webkit-user-select:text;user-select:text;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 }); }
|
|
2938
|
+
], 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<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 }); }
|
|
2930
2939
|
}
|
|
2931
2940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, decorators: [{
|
|
2932
2941
|
type: Component,
|
|
@@ -2937,25 +2946,230 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2937
2946
|
multi: true,
|
|
2938
2947
|
},
|
|
2939
2948
|
NgDropdownPanelService,
|
|
2940
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, NgItemLabelDirective, NgDropdownPanelComponent], 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<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{position:relative;z-index:1001;-webkit-user-select:text;user-select:text;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"] }]
|
|
2941
|
-
}], ctorParameters: () => [
|
|
2949
|
+
], 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<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"] }]
|
|
2950
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2951
|
+
type: Attribute,
|
|
2952
|
+
args: ['class']
|
|
2953
|
+
}] }, { type: undefined, decorators: [{
|
|
2954
|
+
type: Attribute,
|
|
2955
|
+
args: ['autofocus']
|
|
2956
|
+
}] }, { type: NgSelectConfig }, { type: undefined, decorators: [{
|
|
2957
|
+
type: Inject,
|
|
2958
|
+
args: [SELECTION_MODEL_FACTORY]
|
|
2959
|
+
}, {
|
|
2960
|
+
type: Optional
|
|
2961
|
+
}] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: ConsoleService }], propDecorators: { ariaLabelDropdown: [{
|
|
2962
|
+
type: Input
|
|
2963
|
+
}], bindLabel: [{
|
|
2964
|
+
type: Input
|
|
2965
|
+
}], bindValue: [{
|
|
2966
|
+
type: Input
|
|
2967
|
+
}], ariaLabel: [{
|
|
2968
|
+
type: Input
|
|
2969
|
+
}], markFirst: [{
|
|
2970
|
+
type: Input,
|
|
2971
|
+
args: [{ transform: booleanAttribute }]
|
|
2972
|
+
}], placeholder: [{
|
|
2973
|
+
type: Input
|
|
2974
|
+
}], fixedPlaceholder: [{
|
|
2975
|
+
type: Input
|
|
2976
|
+
}], notFoundText: [{
|
|
2977
|
+
type: Input
|
|
2978
|
+
}], typeToSearchText: [{
|
|
2979
|
+
type: Input
|
|
2980
|
+
}], preventToggleOnRightClick: [{
|
|
2981
|
+
type: Input
|
|
2982
|
+
}], addTagText: [{
|
|
2983
|
+
type: Input
|
|
2984
|
+
}], loadingText: [{
|
|
2985
|
+
type: Input
|
|
2986
|
+
}], clearAllText: [{
|
|
2987
|
+
type: Input
|
|
2988
|
+
}], appearance: [{
|
|
2989
|
+
type: Input
|
|
2990
|
+
}], dropdownPosition: [{
|
|
2991
|
+
type: Input
|
|
2992
|
+
}], appendTo: [{
|
|
2993
|
+
type: Input
|
|
2994
|
+
}], loading: [{
|
|
2995
|
+
type: Input,
|
|
2996
|
+
args: [{ transform: booleanAttribute }]
|
|
2997
|
+
}], closeOnSelect: [{
|
|
2998
|
+
type: Input,
|
|
2999
|
+
args: [{ transform: booleanAttribute }]
|
|
3000
|
+
}], hideSelected: [{
|
|
3001
|
+
type: Input,
|
|
3002
|
+
args: [{ transform: booleanAttribute }]
|
|
3003
|
+
}], selectOnTab: [{
|
|
3004
|
+
type: Input,
|
|
3005
|
+
args: [{ transform: booleanAttribute }]
|
|
3006
|
+
}], openOnEnter: [{
|
|
3007
|
+
type: Input,
|
|
3008
|
+
args: [{ transform: booleanAttribute }]
|
|
3009
|
+
}], maxSelectedItems: [{
|
|
3010
|
+
type: Input,
|
|
3011
|
+
args: [{ transform: numberAttribute }]
|
|
3012
|
+
}], groupBy: [{
|
|
3013
|
+
type: Input
|
|
3014
|
+
}], groupValue: [{
|
|
3015
|
+
type: Input
|
|
3016
|
+
}], bufferAmount: [{
|
|
3017
|
+
type: Input,
|
|
3018
|
+
args: [{ transform: numberAttribute }]
|
|
3019
|
+
}], virtualScroll: [{
|
|
3020
|
+
type: Input,
|
|
3021
|
+
args: [{ transform: booleanAttribute }]
|
|
3022
|
+
}], selectableGroup: [{
|
|
3023
|
+
type: Input,
|
|
3024
|
+
args: [{ transform: booleanAttribute }]
|
|
3025
|
+
}], selectableGroupAsModel: [{
|
|
3026
|
+
type: Input,
|
|
3027
|
+
args: [{ transform: booleanAttribute }]
|
|
3028
|
+
}], searchFn: [{
|
|
3029
|
+
type: Input
|
|
3030
|
+
}], trackByFn: [{
|
|
3031
|
+
type: Input
|
|
3032
|
+
}], clearOnBackspace: [{
|
|
3033
|
+
type: Input,
|
|
3034
|
+
args: [{ transform: booleanAttribute }]
|
|
3035
|
+
}], labelForId: [{
|
|
3036
|
+
type: Input
|
|
3037
|
+
}], inputAttrs: [{
|
|
3038
|
+
type: Input
|
|
3039
|
+
}], tabIndex: [{
|
|
3040
|
+
type: Input,
|
|
3041
|
+
args: [{ transform: numberAttribute }]
|
|
3042
|
+
}], readonly: [{
|
|
3043
|
+
type: Input,
|
|
3044
|
+
args: [{ transform: booleanAttribute }]
|
|
3045
|
+
}], searchWhileComposing: [{
|
|
3046
|
+
type: Input,
|
|
3047
|
+
args: [{ transform: booleanAttribute }]
|
|
3048
|
+
}], minTermLength: [{
|
|
3049
|
+
type: Input,
|
|
3050
|
+
args: [{ transform: numberAttribute }]
|
|
3051
|
+
}], editableSearchTerm: [{
|
|
3052
|
+
type: Input,
|
|
3053
|
+
args: [{ transform: booleanAttribute }]
|
|
3054
|
+
}], ngClass: [{
|
|
3055
|
+
type: Input
|
|
3056
|
+
}], typeahead: [{
|
|
3057
|
+
type: Input
|
|
3058
|
+
}, {
|
|
2942
3059
|
type: HostBinding,
|
|
2943
3060
|
args: ['class.ng-select-typeahead']
|
|
2944
3061
|
}], multiple: [{
|
|
3062
|
+
type: Input,
|
|
3063
|
+
args: [{ transform: booleanAttribute }]
|
|
3064
|
+
}, {
|
|
2945
3065
|
type: HostBinding,
|
|
2946
3066
|
args: ['class.ng-select-multiple']
|
|
2947
3067
|
}], addTag: [{
|
|
3068
|
+
type: Input
|
|
3069
|
+
}, {
|
|
2948
3070
|
type: HostBinding,
|
|
2949
3071
|
args: ['class.ng-select-taggable']
|
|
2950
3072
|
}], searchable: [{
|
|
3073
|
+
type: Input,
|
|
3074
|
+
args: [{ transform: booleanAttribute }]
|
|
3075
|
+
}, {
|
|
2951
3076
|
type: HostBinding,
|
|
2952
3077
|
args: ['class.ng-select-searchable']
|
|
2953
3078
|
}], clearable: [{
|
|
3079
|
+
type: Input,
|
|
3080
|
+
args: [{ transform: booleanAttribute }]
|
|
3081
|
+
}, {
|
|
2954
3082
|
type: HostBinding,
|
|
2955
3083
|
args: ['class.ng-select-clearable']
|
|
2956
3084
|
}], isOpen: [{
|
|
3085
|
+
type: Input
|
|
3086
|
+
}, {
|
|
2957
3087
|
type: HostBinding,
|
|
2958
3088
|
args: ['class.ng-select-opened']
|
|
3089
|
+
}], blurEvent: [{
|
|
3090
|
+
type: Output,
|
|
3091
|
+
args: ['blur']
|
|
3092
|
+
}], focusEvent: [{
|
|
3093
|
+
type: Output,
|
|
3094
|
+
args: ['focus']
|
|
3095
|
+
}], changeEvent: [{
|
|
3096
|
+
type: Output,
|
|
3097
|
+
args: ['change']
|
|
3098
|
+
}], openEvent: [{
|
|
3099
|
+
type: Output,
|
|
3100
|
+
args: ['open']
|
|
3101
|
+
}], closeEvent: [{
|
|
3102
|
+
type: Output,
|
|
3103
|
+
args: ['close']
|
|
3104
|
+
}], searchEvent: [{
|
|
3105
|
+
type: Output,
|
|
3106
|
+
args: ['search']
|
|
3107
|
+
}], clearEvent: [{
|
|
3108
|
+
type: Output,
|
|
3109
|
+
args: ['clear']
|
|
3110
|
+
}], addEvent: [{
|
|
3111
|
+
type: Output,
|
|
3112
|
+
args: ['add']
|
|
3113
|
+
}], removeEvent: [{
|
|
3114
|
+
type: Output,
|
|
3115
|
+
args: ['remove']
|
|
3116
|
+
}], scroll: [{
|
|
3117
|
+
type: Output,
|
|
3118
|
+
args: ['scroll']
|
|
3119
|
+
}], scrollToEnd: [{
|
|
3120
|
+
type: Output,
|
|
3121
|
+
args: ['scrollToEnd']
|
|
3122
|
+
}], optionTemplate: [{
|
|
3123
|
+
type: ContentChild,
|
|
3124
|
+
args: [NgOptionTemplateDirective, { read: TemplateRef }]
|
|
3125
|
+
}], optgroupTemplate: [{
|
|
3126
|
+
type: ContentChild,
|
|
3127
|
+
args: [NgOptgroupTemplateDirective, { read: TemplateRef }]
|
|
3128
|
+
}], labelTemplate: [{
|
|
3129
|
+
type: ContentChild,
|
|
3130
|
+
args: [NgLabelTemplateDirective, { read: TemplateRef }]
|
|
3131
|
+
}], multiLabelTemplate: [{
|
|
3132
|
+
type: ContentChild,
|
|
3133
|
+
args: [NgMultiLabelTemplateDirective, { read: TemplateRef }]
|
|
3134
|
+
}], headerTemplate: [{
|
|
3135
|
+
type: ContentChild,
|
|
3136
|
+
args: [NgHeaderTemplateDirective, { read: TemplateRef }]
|
|
3137
|
+
}], footerTemplate: [{
|
|
3138
|
+
type: ContentChild,
|
|
3139
|
+
args: [NgFooterTemplateDirective, { read: TemplateRef }]
|
|
3140
|
+
}], notFoundTemplate: [{
|
|
3141
|
+
type: ContentChild,
|
|
3142
|
+
args: [NgNotFoundTemplateDirective, { read: TemplateRef }]
|
|
3143
|
+
}], placeholderTemplate: [{
|
|
3144
|
+
type: ContentChild,
|
|
3145
|
+
args: [NgPlaceholderTemplateDirective, { read: TemplateRef }]
|
|
3146
|
+
}], typeToSearchTemplate: [{
|
|
3147
|
+
type: ContentChild,
|
|
3148
|
+
args: [NgTypeToSearchTemplateDirective, { read: TemplateRef }]
|
|
3149
|
+
}], loadingTextTemplate: [{
|
|
3150
|
+
type: ContentChild,
|
|
3151
|
+
args: [NgLoadingTextTemplateDirective, { read: TemplateRef }]
|
|
3152
|
+
}], tagTemplate: [{
|
|
3153
|
+
type: ContentChild,
|
|
3154
|
+
args: [NgTagTemplateDirective, { read: TemplateRef }]
|
|
3155
|
+
}], loadingSpinnerTemplate: [{
|
|
3156
|
+
type: ContentChild,
|
|
3157
|
+
args: [NgLoadingSpinnerTemplateDirective, { read: TemplateRef }]
|
|
3158
|
+
}], clearButtonTemplate: [{
|
|
3159
|
+
type: ContentChild,
|
|
3160
|
+
args: [NgClearButtonTemplateDirective, { read: TemplateRef }]
|
|
3161
|
+
}], dropdownPanel: [{
|
|
3162
|
+
type: ViewChild,
|
|
3163
|
+
args: [forwardRef(() => NgDropdownPanelComponent)]
|
|
3164
|
+
}], searchInput: [{
|
|
3165
|
+
type: ViewChild,
|
|
3166
|
+
args: ['searchInput', { static: true }]
|
|
3167
|
+
}], clearButton: [{
|
|
3168
|
+
type: ViewChild,
|
|
3169
|
+
args: ['clearButton']
|
|
3170
|
+
}], ngOptions: [{
|
|
3171
|
+
type: ContentChildren,
|
|
3172
|
+
args: [NgOptionComponent, { descendants: true }]
|
|
2959
3173
|
}], useDefaultClass: [{
|
|
2960
3174
|
type: HostBinding,
|
|
2961
3175
|
args: ['class.ng-select']
|
|
@@ -2965,9 +3179,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2965
3179
|
}], single: [{
|
|
2966
3180
|
type: HostBinding,
|
|
2967
3181
|
args: ['class.ng-select-single']
|
|
3182
|
+
}], items: [{
|
|
3183
|
+
type: Input
|
|
2968
3184
|
}], disabled: [{
|
|
2969
3185
|
type: HostBinding,
|
|
2970
3186
|
args: ['class.ng-select-disabled']
|
|
3187
|
+
}], compareWith: [{
|
|
3188
|
+
type: Input
|
|
3189
|
+
}], clearSearchOnAdd: [{
|
|
3190
|
+
type: Input
|
|
3191
|
+
}], deselectOnClick: [{
|
|
3192
|
+
type: Input
|
|
3193
|
+
}], keyDownFn: [{
|
|
3194
|
+
type: Input
|
|
2971
3195
|
}], handleKeyDown: [{
|
|
2972
3196
|
type: HostListener,
|
|
2973
3197
|
args: ['keydown', ['$event']]
|
|
@@ -3006,7 +3230,7 @@ class NgSelectModule {
|
|
|
3006
3230
|
NgTagTemplateDirective,
|
|
3007
3231
|
NgLoadingSpinnerTemplateDirective,
|
|
3008
3232
|
NgClearButtonTemplateDirective] }); }
|
|
3009
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers:
|
|
3233
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers: [{ provide: SELECTION_MODEL_FACTORY, useValue: DefaultSelectionModelFactory }] }); }
|
|
3010
3234
|
}
|
|
3011
3235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, decorators: [{
|
|
3012
3236
|
type: NgModule,
|
|
@@ -3047,17 +3271,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
3047
3271
|
NgLoadingSpinnerTemplateDirective,
|
|
3048
3272
|
NgClearButtonTemplateDirective
|
|
3049
3273
|
],
|
|
3050
|
-
providers:
|
|
3274
|
+
providers: [{ provide: SELECTION_MODEL_FACTORY, useValue: DefaultSelectionModelFactory }],
|
|
3051
3275
|
}]
|
|
3052
3276
|
}] });
|
|
3053
|
-
function provideNgSelect() {
|
|
3054
|
-
return [
|
|
3055
|
-
{
|
|
3056
|
-
provide: SELECTION_MODEL_FACTORY,
|
|
3057
|
-
useValue: DefaultSelectionModelFactory,
|
|
3058
|
-
},
|
|
3059
|
-
];
|
|
3060
|
-
}
|
|
3061
3277
|
|
|
3062
3278
|
/*
|
|
3063
3279
|
* Public API Surface of ng-select
|