ng-select2-component 12.0.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
3
3
  import * as i0 from '@angular/core';
4
4
  import { EventEmitter, TemplateRef, Component, Optional, Self, Attribute, Input, Output, HostBinding, ViewChild, ViewChildren, Directive, NgModule } from '@angular/core';
5
5
  import { Subject } from 'rxjs';
6
+ import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
6
7
  import * as i1 from '@angular/cdk/scrolling';
7
8
  import * as i2 from '@angular/forms';
8
9
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -11,1260 +12,1273 @@ import { CommonModule } from '@angular/common';
11
12
  import * as i5 from 'ngx-infinite-scroll';
12
13
  import { InfiniteScrollModule } from 'ngx-infinite-scroll';
13
14
 
14
- const timeout = 200;
15
- const unicodePatterns = [
16
- { l: 'a', s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi },
17
- { l: 'aa', s: /ꜳ/gi },
18
- { l: 'ae', s: /[æǽǣ]/gi },
19
- { l: 'ao', s: /ꜵ/gi },
20
- { l: 'au', s: /ꜷ/gi },
21
- { l: 'av', s: /[ꜹꜻ]/gi },
22
- { l: 'ay', s: /ꜽ/gi },
23
- { l: 'b', s: /[ⓑbḃḅḇƀƃɓ]/gi },
24
- { l: 'c', s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi },
25
- { l: 'd', s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi },
26
- { l: 'dz', s: /[dzdž]/gi },
27
- { l: 'e', s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi },
28
- { l: 'f', s: /[ⓕfḟƒꝼ]/gi },
29
- { l: 'g', s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi },
30
- { l: 'h', s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi },
31
- { l: 'hv', s: /ƕ/gi },
32
- { l: 'i', s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi },
33
- { l: 'j', s: /[ⓙjĵǰɉ]/gi },
34
- { l: 'k', s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi },
35
- { l: 'l', s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi },
36
- { l: 'lj', s: /lj/gi },
37
- { l: 'm', s: /[ⓜmḿṁṃɱɯ]/gi },
38
- { l: 'n', s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi },
39
- { l: 'nj', s: /nj/gi },
40
- { l: 'o', s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi },
41
- { l: 'oi', s: /ƣ/gi },
42
- { l: 'oe', s: /œ/gi },
43
- { l: 'oo', s: /ꝏ/gi },
44
- { l: 'ou', s: /ȣ/gi },
45
- { l: 'p', s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi },
46
- { l: 'q', s: /[ⓠqɋꝗꝙ]/gi },
47
- { l: 'r', s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi },
48
- { l: 's', s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi },
49
- { l: 't', s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi },
50
- { l: 'tz', s: /ꜩ/gi },
51
- { l: 'u', s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi },
52
- { l: 'v', s: /[ⓥvṽṿʋꝟʌ]/gi },
53
- { l: 'vy', s: /ꝡ/gi },
54
- { l: 'w', s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi },
55
- { l: 'x', s: /[ⓧxẋẍ]/gi },
56
- { l: 'y', s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi },
57
- { l: 'z', s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi },
58
- ];
59
- const defaultMinCountForSearch = 6;
15
+ const timeout = 200;
16
+ const unicodePatterns = [
17
+ { l: 'a', s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi },
18
+ { l: 'aa', s: /ꜳ/gi },
19
+ { l: 'ae', s: /[æǽǣ]/gi },
20
+ { l: 'ao', s: /ꜵ/gi },
21
+ { l: 'au', s: /ꜷ/gi },
22
+ { l: 'av', s: /[ꜹꜻ]/gi },
23
+ { l: 'ay', s: /ꜽ/gi },
24
+ { l: 'b', s: /[ⓑbḃḅḇƀƃɓ]/gi },
25
+ { l: 'c', s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi },
26
+ { l: 'd', s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi },
27
+ { l: 'dz', s: /[dzdž]/gi },
28
+ { l: 'e', s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi },
29
+ { l: 'f', s: /[ⓕfḟƒꝼ]/gi },
30
+ { l: 'g', s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi },
31
+ { l: 'h', s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi },
32
+ { l: 'hv', s: /ƕ/gi },
33
+ { l: 'i', s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi },
34
+ { l: 'j', s: /[ⓙjĵǰɉ]/gi },
35
+ { l: 'k', s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi },
36
+ { l: 'l', s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi },
37
+ { l: 'lj', s: /lj/gi },
38
+ { l: 'm', s: /[ⓜmḿṁṃɱɯ]/gi },
39
+ { l: 'n', s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi },
40
+ { l: 'nj', s: /nj/gi },
41
+ { l: 'o', s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi },
42
+ { l: 'oi', s: /ƣ/gi },
43
+ { l: 'oe', s: /œ/gi },
44
+ { l: 'oo', s: /ꝏ/gi },
45
+ { l: 'ou', s: /ȣ/gi },
46
+ { l: 'p', s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi },
47
+ { l: 'q', s: /[ⓠqɋꝗꝙ]/gi },
48
+ { l: 'r', s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi },
49
+ { l: 's', s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi },
50
+ { l: 't', s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi },
51
+ { l: 'tz', s: /ꜩ/gi },
52
+ { l: 'u', s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi },
53
+ { l: 'v', s: /[ⓥvṽṿʋꝟʌ]/gi },
54
+ { l: 'vy', s: /ꝡ/gi },
55
+ { l: 'w', s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi },
56
+ { l: 'x', s: /[ⓧxẋẍ]/gi },
57
+ { l: 'y', s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi },
58
+ { l: 'z', s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi },
59
+ ];
60
+ const defaultMinCountForSearch = 6;
60
61
  const protectRegexp = new RegExp('[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]', 'g');
61
62
 
62
- class Select2Utils {
63
- static getOptionByValue(data, value) {
64
- if (Array.isArray(data)) {
65
- for (const groupOrOption of data) {
66
- const options = groupOrOption.options;
67
- if (options) {
68
- for (const option of options) {
69
- if (option.value === value) {
70
- return option;
71
- }
72
- }
73
- }
74
- else if (groupOrOption.value === value) {
75
- return groupOrOption;
76
- }
77
- }
78
- }
79
- return null;
80
- }
81
- static getOptionsByValue(data, value, multiple) {
82
- if (multiple) {
83
- const values = Array.isArray(value) ? value : [];
84
- const result = [];
85
- for (const v of values) {
86
- const option = Select2Utils.getOptionByValue(data, v);
87
- if (option) {
88
- result.push(option);
89
- }
90
- }
91
- return result;
92
- }
93
- return Select2Utils.getOptionByValue(data, value);
94
- }
95
- static getFirstAvailableOption(data) {
96
- if (Array.isArray(data)) {
97
- for (const groupOrOption of data) {
98
- const options = groupOrOption.options;
99
- if (options) {
100
- for (const option of options) {
101
- if (!option.disabled) {
102
- return option.value;
103
- }
104
- }
105
- }
106
- else {
107
- const option = groupOrOption;
108
- if (!option.disabled) {
109
- return option.value;
110
- }
111
- }
112
- }
113
- }
114
- return null;
115
- }
116
- static valueIsNotInFilteredData(filteredData, value) {
117
- if (Select2Utils.isNullOrUndefined(value)) {
118
- return true;
119
- }
120
- for (const groupOrOption of filteredData) {
121
- const options = groupOrOption.options;
122
- if (options) {
123
- for (const option of options) {
124
- if (option.value === value) {
125
- return false;
126
- }
127
- }
128
- }
129
- else if (groupOrOption.value === value) {
130
- return false;
131
- }
132
- }
133
- return true;
134
- }
135
- // eslint-disable-next-line
136
- static getPreviousOption(filteredData, hoveringValue) {
137
- let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
138
- for (let i = filteredData.length - 1; i >= 0; i--) {
139
- const groupOrOption = filteredData[i];
140
- const options = groupOrOption.options;
141
- if (options) {
142
- for (let j = options.length - 1; j >= 0; j--) {
143
- const option = options[j];
144
- if (findIt && !option.disabled && !option.hide) {
145
- return option;
146
- }
147
- if (!findIt) {
148
- findIt = option.value === hoveringValue;
149
- }
150
- }
151
- }
152
- else {
153
- const option = groupOrOption;
154
- if (findIt && !option.disabled && !option.hide) {
155
- return option;
156
- }
157
- if (!findIt) {
158
- findIt = option.value === hoveringValue;
159
- }
160
- }
161
- }
162
- return null;
163
- }
164
- // eslint-disable-next-line
165
- static getNextOption(filteredData, hoveringValue) {
166
- let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
167
- for (const groupOrOption of filteredData) {
168
- const options = groupOrOption.options;
169
- if (options) {
170
- for (const option of options) {
171
- if (findIt) {
172
- if (!option.disabled && !option.hide) {
173
- return option;
174
- }
175
- }
176
- else if (!findIt) {
177
- findIt = option.value === hoveringValue;
178
- }
179
- }
180
- }
181
- else {
182
- const option = groupOrOption;
183
- if (findIt) {
184
- if (!option.disabled && !option.hide) {
185
- return option;
186
- }
187
- }
188
- else if (!findIt) {
189
- findIt = option.value === hoveringValue;
190
- }
191
- }
192
- }
193
- return null;
194
- }
195
- static getReduceData(data, maxResults = 0) {
196
- if (maxResults > 0) {
197
- let counter = 0;
198
- const result = [];
199
- // debugger;
200
- for (const groupOrOption of data) {
201
- const options = groupOrOption.options;
202
- if (options) {
203
- const group = {
204
- ...groupOrOption,
205
- options: [],
206
- };
207
- result.push(group);
208
- for (const item of options) {
209
- group.options.push(item);
210
- counter++;
211
- if (counter === maxResults) {
212
- return { result, reduce: true };
213
- }
214
- }
215
- }
216
- else {
217
- result.push(groupOrOption);
218
- counter++;
219
- }
220
- if (counter === maxResults) {
221
- return { result, reduce: true };
222
- }
223
- }
224
- return { result, reduce: false };
225
- }
226
- else {
227
- return { result: data, reduce: false };
228
- }
229
- }
230
- static getFilteredData(data, searchText, editPattern) {
231
- if (searchText) {
232
- const result = [];
233
- for (const groupOrOption of data) {
234
- const options = groupOrOption.options;
235
- if (options) {
236
- if (options.some(group => Select2Utils.containSearchText(group.label, searchText, editPattern))) {
237
- const filteredOptions = options.filter(group => Select2Utils.containSearchText(group.label, searchText, editPattern));
238
- result.push({
239
- ...groupOrOption,
240
- options: filteredOptions,
241
- });
242
- }
243
- }
244
- else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {
245
- result.push(groupOrOption);
246
- }
247
- }
248
- return result;
249
- }
250
- else {
251
- return data;
252
- }
253
- }
254
- static getFilteredSelectedData(data, selectedOptions) {
255
- const result = [];
256
- for (const groupOrOption of data) {
257
- const options = groupOrOption.options;
258
- if (options) {
259
- const filteredOptions = options.filter(group => Select2Utils.isSelected(selectedOptions, group, true) === 'false');
260
- if (filteredOptions.length) {
261
- result.push({
262
- ...groupOrOption,
263
- options: filteredOptions,
264
- });
265
- }
266
- }
267
- else if (Select2Utils.isSelected(selectedOptions, groupOrOption, true) === 'false') {
268
- result.push(groupOrOption);
269
- }
270
- }
271
- return result;
272
- }
273
- static isSearchboxHiddex(data, minCountForSearch) {
274
- if (minCountForSearch === '' ||
275
- minCountForSearch === undefined ||
276
- minCountForSearch === null ||
277
- isNaN(+minCountForSearch)) {
278
- minCountForSearch = defaultMinCountForSearch;
279
- }
280
- const optionCount = Select2Utils.getOptionsCount(data);
281
- return optionCount < +minCountForSearch;
282
- }
283
- static isSelected(options, option, multiple) {
284
- return multiple
285
- ? options && options.some(op => op.value === option.value)
286
- ? 'true'
287
- : 'false'
288
- : options && option.value === options.value
289
- ? 'true'
290
- : 'false';
291
- }
292
- static removeSelection(options, option) {
293
- for (let i = 0; i < options.length; i++) {
294
- if (options[i].value === option.value) {
295
- options.splice(i, 1);
296
- return;
297
- }
298
- }
299
- }
300
- static getOptionsCount(data) {
301
- let count = 0;
302
- if (Array.isArray(data)) {
303
- for (const groupOrOption of data) {
304
- const options = groupOrOption.options;
305
- if (options) {
306
- count += options.length;
307
- }
308
- else {
309
- count++;
310
- }
311
- }
312
- }
313
- return count;
314
- }
315
- static isNullOrUndefined(value) {
316
- return value === null || value === undefined;
317
- }
318
- static containSearchText(label, searchText, editPattern) {
319
- return searchText
320
- ? Select2Utils.formatSansUnicode(label).match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null
321
- : true;
322
- }
323
- static protectPattern(str) {
324
- return str.replace(protectRegexp, '\\$&');
325
- }
326
- static formatSansUnicode(str) {
327
- for (const unicodePattern of unicodePatterns) {
328
- str = str.replace(unicodePattern.s, unicodePattern.l);
329
- }
330
- return str;
331
- }
332
- static formatPattern(str, editPattern) {
333
- str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));
334
- if (editPattern && typeof editPattern === 'function') {
335
- str = editPattern(str);
336
- }
337
- return str;
338
- }
63
+ class Select2Utils {
64
+ static getOptionByValue(data, value) {
65
+ if (Array.isArray(data)) {
66
+ for (const groupOrOption of data) {
67
+ const options = groupOrOption.options;
68
+ if (options) {
69
+ for (const option of options) {
70
+ if (option.value === value) {
71
+ return option;
72
+ }
73
+ }
74
+ }
75
+ else if (groupOrOption.value === value) {
76
+ return groupOrOption;
77
+ }
78
+ }
79
+ }
80
+ return null;
81
+ }
82
+ static getOptionsByValue(data, value, multiple) {
83
+ if (multiple) {
84
+ const values = Array.isArray(value) ? value : [];
85
+ const result = [];
86
+ for (const v of values) {
87
+ const option = Select2Utils.getOptionByValue(data, v);
88
+ if (option) {
89
+ result.push(option);
90
+ }
91
+ }
92
+ return result;
93
+ }
94
+ return Select2Utils.getOptionByValue(data, value);
95
+ }
96
+ static getFirstAvailableOption(data) {
97
+ if (Array.isArray(data)) {
98
+ for (const groupOrOption of data) {
99
+ const options = groupOrOption.options;
100
+ if (options) {
101
+ for (const option of options) {
102
+ if (!option.disabled) {
103
+ return option.value;
104
+ }
105
+ }
106
+ }
107
+ else {
108
+ const option = groupOrOption;
109
+ if (!option.disabled) {
110
+ return option.value;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ return null;
116
+ }
117
+ static valueIsNotInFilteredData(filteredData, value) {
118
+ if (Select2Utils.isNullOrUndefined(value)) {
119
+ return true;
120
+ }
121
+ for (const groupOrOption of filteredData) {
122
+ const options = groupOrOption.options;
123
+ if (options) {
124
+ for (const option of options) {
125
+ if (option.value === value) {
126
+ return false;
127
+ }
128
+ }
129
+ }
130
+ else if (groupOrOption.value === value) {
131
+ return false;
132
+ }
133
+ }
134
+ return true;
135
+ }
136
+ // eslint-disable-next-line
137
+ static getPreviousOption(filteredData, hoveringValue) {
138
+ let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
139
+ for (let i = filteredData.length - 1; i >= 0; i--) {
140
+ const groupOrOption = filteredData[i];
141
+ const options = groupOrOption.options;
142
+ if (options) {
143
+ for (let j = options.length - 1; j >= 0; j--) {
144
+ const option = options[j];
145
+ if (findIt && !option.disabled && !option.hide) {
146
+ return option;
147
+ }
148
+ if (!findIt) {
149
+ findIt = option.value === hoveringValue;
150
+ }
151
+ }
152
+ }
153
+ else {
154
+ const option = groupOrOption;
155
+ if (findIt && !option.disabled && !option.hide) {
156
+ return option;
157
+ }
158
+ if (!findIt) {
159
+ findIt = option.value === hoveringValue;
160
+ }
161
+ }
162
+ }
163
+ return null;
164
+ }
165
+ // eslint-disable-next-line
166
+ static getNextOption(filteredData, hoveringValue) {
167
+ let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
168
+ for (const groupOrOption of filteredData) {
169
+ const options = groupOrOption.options;
170
+ if (options) {
171
+ for (const option of options) {
172
+ if (findIt) {
173
+ if (!option.disabled && !option.hide) {
174
+ return option;
175
+ }
176
+ }
177
+ else if (!findIt) {
178
+ findIt = option.value === hoveringValue;
179
+ }
180
+ }
181
+ }
182
+ else {
183
+ const option = groupOrOption;
184
+ if (findIt) {
185
+ if (!option.disabled && !option.hide) {
186
+ return option;
187
+ }
188
+ }
189
+ else if (!findIt) {
190
+ findIt = option.value === hoveringValue;
191
+ }
192
+ }
193
+ }
194
+ return null;
195
+ }
196
+ static getReduceData(data, maxResults = 0) {
197
+ if (maxResults > 0) {
198
+ let counter = 0;
199
+ const result = [];
200
+ // debugger;
201
+ for (const groupOrOption of data) {
202
+ const options = groupOrOption.options;
203
+ if (options) {
204
+ const group = {
205
+ ...groupOrOption,
206
+ options: [],
207
+ };
208
+ result.push(group);
209
+ for (const item of options) {
210
+ group.options.push(item);
211
+ counter++;
212
+ if (counter === maxResults) {
213
+ return { result, reduce: true };
214
+ }
215
+ }
216
+ }
217
+ else {
218
+ result.push(groupOrOption);
219
+ counter++;
220
+ }
221
+ if (counter === maxResults) {
222
+ return { result, reduce: true };
223
+ }
224
+ }
225
+ return { result, reduce: false };
226
+ }
227
+ else {
228
+ return { result: data, reduce: false };
229
+ }
230
+ }
231
+ static getFilteredData(data, searchText, editPattern) {
232
+ if (searchText) {
233
+ const result = [];
234
+ for (const groupOrOption of data) {
235
+ const options = groupOrOption.options;
236
+ if (options) {
237
+ if (options.some(group => Select2Utils.containSearchText(group.label, searchText, editPattern))) {
238
+ const filteredOptions = options.filter(group => Select2Utils.containSearchText(group.label, searchText, editPattern));
239
+ result.push({
240
+ ...groupOrOption,
241
+ options: filteredOptions,
242
+ });
243
+ }
244
+ }
245
+ else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {
246
+ result.push(groupOrOption);
247
+ }
248
+ }
249
+ return result;
250
+ }
251
+ else {
252
+ return data;
253
+ }
254
+ }
255
+ static getFilteredSelectedData(data, selectedOptions) {
256
+ const result = [];
257
+ for (const groupOrOption of data) {
258
+ const options = groupOrOption.options;
259
+ if (options) {
260
+ const filteredOptions = options.filter(group => Select2Utils.isSelected(selectedOptions, group, true) === 'false');
261
+ if (filteredOptions.length) {
262
+ result.push({
263
+ ...groupOrOption,
264
+ options: filteredOptions,
265
+ });
266
+ }
267
+ }
268
+ else if (Select2Utils.isSelected(selectedOptions, groupOrOption, true) === 'false') {
269
+ result.push(groupOrOption);
270
+ }
271
+ }
272
+ return result;
273
+ }
274
+ static isSearchboxHiddex(data, minCountForSearch) {
275
+ if (minCountForSearch === '' ||
276
+ minCountForSearch === undefined ||
277
+ minCountForSearch === null ||
278
+ isNaN(+minCountForSearch)) {
279
+ minCountForSearch = defaultMinCountForSearch;
280
+ }
281
+ const optionCount = Select2Utils.getOptionsCount(data);
282
+ return optionCount < +minCountForSearch;
283
+ }
284
+ static isSelected(options, option, multiple) {
285
+ return multiple
286
+ ? options && options.some(op => op.value === option.value)
287
+ ? 'true'
288
+ : 'false'
289
+ : options && option.value === options.value
290
+ ? 'true'
291
+ : 'false';
292
+ }
293
+ static removeSelection(options, option) {
294
+ for (let i = 0; i < options.length; i++) {
295
+ if (options[i].value === option.value) {
296
+ options.splice(i, 1);
297
+ return;
298
+ }
299
+ }
300
+ }
301
+ static getOptionsCount(data) {
302
+ let count = 0;
303
+ if (Array.isArray(data)) {
304
+ for (const groupOrOption of data) {
305
+ const options = groupOrOption.options;
306
+ if (options) {
307
+ count += options.length;
308
+ }
309
+ else {
310
+ count++;
311
+ }
312
+ }
313
+ }
314
+ return count;
315
+ }
316
+ static isNullOrUndefined(value) {
317
+ return value === null || value === undefined;
318
+ }
319
+ static containSearchText(label, searchText, editPattern) {
320
+ return searchText
321
+ ? Select2Utils.formatSansUnicode(label).match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null
322
+ : true;
323
+ }
324
+ static protectPattern(str) {
325
+ return str.replace(protectRegexp, '\\$&');
326
+ }
327
+ static formatSansUnicode(str) {
328
+ for (const unicodePattern of unicodePatterns) {
329
+ str = str.replace(unicodePattern.s, unicodePattern.l);
330
+ }
331
+ return str;
332
+ }
333
+ static formatPattern(str, editPattern) {
334
+ str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));
335
+ if (editPattern && typeof editPattern === 'function') {
336
+ str = editPattern(str);
337
+ }
338
+ return str;
339
+ }
339
340
  }
340
341
 
341
- let nextUniqueId = 0;
342
- const displaySearchStatusList = ['default', 'hidden', 'always'];
343
- class Select2 {
344
- /** data of options & optiongrps */
345
- set data(data) {
346
- this._data = data;
347
- this.updateFilteredData();
348
- }
349
- get multiple() {
350
- return this._multiple;
351
- }
352
- set multiple(value) {
353
- this._multiple = this._coerceBooleanProperty(value);
354
- this.ngOnInit();
355
- }
356
- /** use the material style */
357
- get overlay() {
358
- return this._overlay;
359
- }
360
- set overlay(value) {
361
- this._overlay = this._coerceBooleanProperty(value);
362
- }
363
- /** infinite scroll activated */
364
- get infiniteScroll() {
365
- return this._infiniteScroll;
366
- }
367
- set infiniteScroll(value) {
368
- this._infiniteScroll = this._coerceBooleanProperty(value);
369
- }
370
- /** auto create if not existe */
371
- get autoCreate() {
372
- return this._autoCreate;
373
- }
374
- set autoCreate(value) {
375
- this._autoCreate = this._coerceBooleanProperty(value);
376
- }
377
- /** no template for label selection */
378
- get noLabelTemplate() {
379
- return this._noLabelTemplate;
380
- }
381
- set noLabelTemplate(value) {
382
- this._noLabelTemplate = this._coerceBooleanProperty(value);
383
- }
384
- get select2Options() {
385
- return this.multiple ? this.option : null;
386
- }
387
- get select2Option() {
388
- return this.multiple ? null : this.option;
389
- }
390
- get searchText() {
391
- return this.innerSearchText;
392
- }
393
- set searchText(text) {
394
- if (this.customSearchEnabled) {
395
- this.search.emit({
396
- component: this,
397
- value: this._value,
398
- search: text,
399
- });
400
- }
401
- this.innerSearchText = text;
402
- }
403
- /** minimal data of show the search field */
404
- get minCountForSearch() {
405
- return this._minCountForSearch;
406
- }
407
- set minCountForSearch(value) {
408
- this._minCountForSearch = value;
409
- this.updateSearchBox();
410
- }
411
- /** Unique id of the element. */
412
- get id() {
413
- return this._id;
414
- }
415
- set id(value) {
416
- this._id = value || this._uid;
417
- }
418
- /** Whether the element is required. */
419
- get required() {
420
- return this._required;
421
- }
422
- set required(value) {
423
- this._required = this._coerceBooleanProperty(value);
424
- }
425
- /** Whether selected items should be hidden. */
426
- get disabled() {
427
- return this._control ? this._control.disabled : this._disabled;
428
- }
429
- set disabled(value) {
430
- this._disabled = this._coerceBooleanProperty(value);
431
- }
432
- /** Whether items are hidden when has. */
433
- get hideSelectedItems() {
434
- return this._hideSelectedItems;
435
- }
436
- set hideSelectedItems(value) {
437
- this._hideSelectedItems = this._coerceBooleanProperty(value);
438
- }
439
- /** Whether the element is readonly. */
440
- get readonly() {
441
- return this._readonly;
442
- }
443
- set readonly(value) {
444
- this._readonly = this._coerceBooleanProperty(value);
445
- }
446
- /** The input element's value. */
447
- get value() {
448
- return this._value;
449
- }
450
- set value(value) {
451
- if (this.testValueChange(this._value, value)) {
452
- setTimeout(() => {
453
- this._value = value;
454
- this.writeValue(value);
455
- }, 10);
456
- }
457
- }
458
- /** Tab index for the select2 element. */
459
- get tabIndex() {
460
- return this.disabled ? -1 : this._tabIndex;
461
- }
462
- set tabIndex(value) {
463
- if (typeof value !== 'undefined') {
464
- this._tabIndex = value;
465
- }
466
- }
467
- /** reset with no selected value */
468
- get resettable() {
469
- return this._resettable;
470
- }
471
- set resettable(value) {
472
- this._resettable = this._coerceBooleanProperty(value);
473
- }
474
- get ariaInvalid() {
475
- return this._isErrorState();
476
- }
477
- get classMaterial() {
478
- return this.styleMode === 'material';
479
- }
480
- get classNostyle() {
481
- return this.styleMode === 'noStyle';
482
- }
483
- get select2above() {
484
- return !this.overlay ? this.listPosition === 'above' : this._isAbobeOverlay();
485
- }
486
- get _positions() {
487
- return this.listPosition === 'auto' ? undefined : null;
488
- }
489
- get resultsElement() {
490
- return this.resultContainer?.nativeElement;
491
- }
492
- constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {
493
- this._viewportRuler = _viewportRuler;
494
- this._changeDetectorRef = _changeDetectorRef;
495
- this._parentForm = _parentForm;
496
- this._parentFormGroup = _parentFormGroup;
497
- this._control = _control;
498
- this.minCharForSearch = 0;
499
- this.limitSelection = 0;
500
- this.listPosition = 'below';
501
- /** use the material style */
502
- this.styleMode = 'default';
503
- /** maximum results limit (0 = no limit) */
504
- this.maxResults = 0;
505
- /** message when maximum results */
506
- this.maxResultsMessage = 'Too many results…';
507
- /** infinite scroll distance */
508
- this.infiniteScrollDistance = 1.5;
509
- /** infinite scroll distance */
510
- this.infiniteScrollThrottle = 150;
511
- /** the max height of the results container when opening the select */
512
- this.resultMaxHeight = '200px';
513
- this.update = new EventEmitter();
514
- this.open = new EventEmitter();
515
- this.close = new EventEmitter();
516
- this.focus = new EventEmitter();
517
- this.blur = new EventEmitter();
518
- this.search = new EventEmitter();
519
- this.scroll = new EventEmitter();
520
- this.removeOption = new EventEmitter();
521
- this.option = null;
522
- this.isOpen = false;
523
- /** Whether the element is focused or not. */
524
- this.focused = false;
525
- this.hoveringValue = null;
526
- this.innerSearchText = '';
527
- this._stateChanges = new Subject();
528
- this._disabled = false;
529
- this._required = false;
530
- this._readonly = false;
531
- this._multiple = false;
532
- this._overlay = false;
533
- this._resettable = false;
534
- this._hideSelectedItems = false;
535
- this._clickDetection = false;
536
- this._uid = `select2-${nextUniqueId++}`;
537
- this._infiniteScroll = true;
538
- this._autoCreate = true;
539
- this._noLabelTemplate = true;
540
- /** View -> model callback called when select has been touched */
541
- this._onTouched = () => {
542
- // do nothing
543
- };
544
- /** View -> model callback called when value changes */
545
- this._onChange = () => {
546
- // do nothing
547
- };
548
- // eslint-disable-next-line no-self-assign
549
- this.id = this.id;
550
- this._tabIndex = parseInt(tabIndex, 10) || 0;
551
- if (this._control) {
552
- this._control.valueAccessor = this;
553
- }
554
- this._clickDetectionFc = this.clickDetection.bind(this);
555
- }
556
- ngOnInit() {
557
- this._viewportRuler.change(100).subscribe(() => {
558
- if (this.isOpen) {
559
- this.triggerRect();
560
- }
561
- });
562
- const option = Select2Utils.getOptionsByValue(this._data, this._control ? this._control.value : this.value, this.multiple);
563
- if (option !== null) {
564
- this.option = option;
565
- }
566
- if (!Array.isArray(option)) {
567
- this.hoveringValue = this.value;
568
- }
569
- this.updateSearchBox();
570
- }
571
- ngAfterViewInit() {
572
- this.cdkConnectedOverlay.positionChange.subscribe((posChange) => {
573
- if (this.listPosition === 'auto' &&
574
- posChange.connectionPair?.originY &&
575
- this._overlayPosition !== posChange.connectionPair.originY) {
576
- this.triggerRect();
577
- this._overlayPosition = posChange.connectionPair.originY;
578
- this._changeDetectorRef.detectChanges();
579
- }
580
- });
581
- this.selectionElement = this.selection.nativeElement;
582
- this.triggerRect();
583
- }
584
- ngDoCheck() {
585
- this.updateSearchBox();
586
- this._dirtyCheckNativeValue();
587
- if (this._triggerRect) {
588
- if (this.overlayWidth !== this._triggerRect.width) {
589
- this.overlayWidth = this._triggerRect.width;
590
- }
591
- if (this._dropdownRect?.height > 0 && this.overlayHeight !== this._dropdownRect.height) {
592
- this.overlayHeight = this.listPosition === 'auto' ? this._dropdownRect.height : 0;
593
- }
594
- }
595
- }
596
- ngOnDestroy() {
597
- window.document.body.removeEventListener('click', this._clickDetectionFc);
598
- }
599
- updateSearchBox() {
600
- const hidden = this.customSearchEnabled
601
- ? false
602
- : Select2Utils.isSearchboxHiddex(this._data, this._minCountForSearch);
603
- if (this.isSearchboxHidden !== hidden) {
604
- this.isSearchboxHidden = hidden;
605
- }
606
- }
607
- hideSearch() {
608
- const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1 ? this.displaySearchStatus : 'default';
609
- return (displaySearchStatus === 'default' && this.isSearchboxHidden) || displaySearchStatus === 'hidden';
610
- }
611
- getOptionStyle(option) {
612
- return ('select2-results__option ' +
613
- (option.hide ? 'select2-results__option--hide ' : '') +
614
- (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') +
615
- (option.classes || ''));
616
- }
617
- mouseenter(option) {
618
- if (!option.disabled) {
619
- this.hoveringValue = option.value;
620
- }
621
- }
622
- click(option) {
623
- if (this.testSelection(option)) {
624
- this.select(option);
625
- }
626
- }
627
- reset(event) {
628
- this.select(null);
629
- this.stopEvent(event);
630
- }
631
- prevChange(event) {
632
- event.stopPropagation();
633
- }
634
- stopEvent(event) {
635
- event.preventDefault();
636
- event.stopPropagation();
637
- }
638
- toggleOpenAndClose(focus = true, open) {
639
- if (this.disabled) {
640
- return;
641
- }
642
- this._focus(focus);
643
- this.isOpen = open ?? !this.isOpen;
644
- if (this.isOpen) {
645
- this.innerSearchText = '';
646
- this.updateFilteredData();
647
- this._focusSearchboxOrResultsElement(focus);
648
- setTimeout(() => {
649
- if (this.option) {
650
- const option = this.option instanceof Array ? this.option[0] : this.option;
651
- this.updateScrollFromOption(option);
652
- }
653
- else if (this.resultsElement) {
654
- this.resultsElement.scrollTop = 0;
655
- }
656
- setTimeout(() => {
657
- this.triggerRect();
658
- this.cdkConnectedOverlay?.overlayRef?.updatePosition();
659
- }, 100);
660
- });
661
- this.open.emit(this);
662
- }
663
- else {
664
- this.close.emit(this);
665
- }
666
- if (this.isOpen && !this._clickDetection && focus) {
667
- setTimeout(() => {
668
- window.document.body.addEventListener('click', this._clickDetectionFc, false);
669
- this._clickDetection = true;
670
- }, timeout);
671
- }
672
- this._changeDetectorRef.markForCheck();
673
- }
674
- hasTemplate(option, defaut) {
675
- return (this.templates instanceof TemplateRef ||
676
- this.templates?.[option.templateId] instanceof TemplateRef ||
677
- this.templates?.[defaut] instanceof TemplateRef);
678
- }
679
- getTemplate(option, defaut) {
680
- return this.hasTemplate(option, defaut)
681
- ? this.templates[option.templateId] || this.templates[defaut] || this.templates
682
- : undefined;
683
- }
684
- triggerRect() {
685
- this._triggerRect = this.selectionElement.getBoundingClientRect();
686
- this._dropdownRect = this.dropdown?.nativeElement
687
- ? this.dropdown.nativeElement.getBoundingClientRect()
688
- : undefined;
689
- }
690
- testSelection(option) {
691
- if (option.disabled) {
692
- return false;
693
- }
694
- return (!this.multiple ||
695
- !this.limitSelection ||
696
- (Array.isArray(this._value) && this._value.length < this.limitSelection));
697
- }
698
- testValueChange(value1, value2) {
699
- if (((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined)) ||
700
- value1 === value2) {
701
- return false;
702
- }
703
- if (this.multiple &&
704
- value1?.length &&
705
- value2?.length &&
706
- value1.length === value2.length) {
707
- for (const e1 of value1) {
708
- const test = value2.indexOf(e1) > -1;
709
- if (!test) {
710
- return true;
711
- }
712
- }
713
- return false;
714
- }
715
- return true;
716
- }
717
- updateFilteredData() {
718
- setTimeout(() => {
719
- let result = this._data;
720
- if (this.multiple && this.hideSelectedItems) {
721
- result = Select2Utils.getFilteredSelectedData(result, this.option);
722
- }
723
- if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {
724
- result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);
725
- }
726
- if (this.maxResults > 0) {
727
- const data = Select2Utils.getReduceData(result, +this.maxResults);
728
- result = data.result;
729
- this.maxResultsExceeded = data.reduce;
730
- }
731
- else {
732
- this.maxResultsExceeded = false;
733
- }
734
- if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {
735
- this.hoveringValue = Select2Utils.getFirstAvailableOption(result);
736
- }
737
- this.filteredData = result;
738
- this._changeDetectorRef.markForCheck();
739
- });
740
- }
741
- clickDetection(e) {
742
- if (!this.ifParentContainsClass(e.target, 'selection')) {
743
- if (this.isOpen && !this.ifParentContainsClass(e.target, 'select2-dropdown')) {
744
- this.toggleOpenAndClose();
745
- }
746
- if (!this.ifParentContainsId(e.target, this._id)) {
747
- this.clickExit();
748
- }
749
- }
750
- else if (this.isOpen && !this.ifParentContainsId(e.target, this._id)) {
751
- this.toggleOpenAndClose();
752
- this.clickExit();
753
- }
754
- }
755
- clickExit() {
756
- this._focus(false);
757
- window.document.body.removeEventListener('click', this._clickDetectionFc);
758
- this._clickDetection = false;
759
- }
760
- ifParentContainsClass(element, cssClass) {
761
- return this.getParentElementByClass(element, cssClass) !== null;
762
- }
763
- ifParentContainsId(element, id) {
764
- return this.getParentElementById(element, id) !== null;
765
- }
766
- getParentElementByClass(element, cssClass) {
767
- return this.containClasses(element, cssClass.trim().split(/\s+/))
768
- ? element
769
- : element.parentElement
770
- ? this.getParentElementByClass(element.parentElement, cssClass)
771
- : null;
772
- }
773
- getParentElementById(element, id) {
774
- return element.id === id
775
- ? element
776
- : element.parentElement
777
- ? this.getParentElementById(element.parentElement, id)
778
- : null;
779
- }
780
- containClasses(element, cssClasses) {
781
- if (!element.classList) {
782
- return false;
783
- }
784
- for (const cssClass of cssClasses) {
785
- if (!element.classList.contains(cssClass)) {
786
- return false;
787
- }
788
- }
789
- return true;
790
- }
791
- focusin() {
792
- if (!this.disabled) {
793
- this._focus(true);
794
- }
795
- }
796
- focusout() {
797
- if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {
798
- this._focus(false);
799
- this._onTouched();
800
- }
801
- }
802
- select(option) {
803
- let value;
804
- if (option !== null) {
805
- if (this.multiple) {
806
- const options = this.option;
807
- const index = options.findIndex(op => op.value === option.value);
808
- if (index === -1) {
809
- options.push(option);
810
- }
811
- else {
812
- options.splice(index, 1);
813
- }
814
- value = this.option.map(op => op.value);
815
- }
816
- else {
817
- this.option = option;
818
- if (this.isOpen) {
819
- this.isOpen = false;
820
- this.close.emit(this);
821
- this.selectionElement?.focus();
822
- }
823
- value = this.option.value;
824
- }
825
- }
826
- else {
827
- this.option = null;
828
- }
829
- if (this.multiple && this.hideSelectedItems) {
830
- this.updateFilteredData();
831
- }
832
- if (this._control) {
833
- this._onChange(value);
834
- }
835
- else {
836
- this._value = value;
837
- }
838
- this.update.emit({
839
- component: this,
840
- value: value,
841
- options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
842
- });
843
- }
844
- keyDown(e, create = false) {
845
- if (create && this._testKey(e, ['Enter', 13])) {
846
- this.createAndAdd(e);
847
- return;
848
- }
849
- if (this._testKey(e, ['ArrowDown', 40])) {
850
- this.moveDown();
851
- e.preventDefault();
852
- }
853
- else if (this._testKey(e, ['ArrowUp', 38])) {
854
- this.moveUp();
855
- e.preventDefault();
856
- }
857
- else if (this._testKey(e, ['Enter', 13])) {
858
- this.selectByEnter();
859
- e.preventDefault();
860
- }
861
- else if (this._testKey(e, ['Escape', 'Tab', 9, 27]) && this.isOpen) {
862
- this.toggleOpenAndClose();
863
- this._focus(false);
864
- }
865
- }
866
- openKey(e, create = false) {
867
- if (create && this._testKey(e, ['Enter', 13])) {
868
- this.createAndAdd(e);
869
- return;
870
- }
871
- if (this._testKey(e, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {
872
- this.toggleOpenAndClose();
873
- e.preventDefault();
874
- }
875
- else if (this._testKey(e, ['Escape', 'Tab', 9, 27])) {
876
- this._focus(false);
877
- this._onTouched();
878
- }
879
- }
880
- searchUpdate(e) {
881
- this.searchText = e.target.value;
882
- this.updateFilteredData();
883
- }
884
- trackBy(_index, item) {
885
- return item.value;
886
- }
887
- isSelected(option) {
888
- return Select2Utils.isSelected(this.option, option, this.multiple);
889
- }
890
- isDisabled(option) {
891
- return option.disabled ? 'true' : 'false';
892
- }
893
- removeSelection(e, option) {
894
- Select2Utils.removeSelection(this.option, option);
895
- if (this.multiple && this.hideSelectedItems) {
896
- this.updateFilteredData();
897
- }
898
- const value = this.option.map(op => op.value);
899
- if (this._control) {
900
- this._onChange(value);
901
- }
902
- else {
903
- this._value = value;
904
- }
905
- this.update.emit({
906
- component: this,
907
- value: value,
908
- options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
909
- });
910
- this.removeOption.emit({
911
- component: this,
912
- value: value,
913
- removedOption: option,
914
- });
915
- e.preventDefault();
916
- e.stopPropagation();
917
- if (this.isOpen) {
918
- this._focusSearchboxOrResultsElement();
919
- }
920
- }
921
- /**
922
- * Sets the model value. Implemented as part of ControlValueAccessor.
923
- * @param value
924
- */
925
- writeValue(value) {
926
- this._setSelectionByValue(value);
927
- }
928
- /**
929
- * Saves a callback function to be invoked when the select's value
930
- * changes from user input. Part of the ControlValueAccessor interface
931
- * required to integrate with Angular's core forms API.
932
- *
933
- * @param fn Callback to be triggered when the value changes.
934
- */
935
- registerOnChange(fn) {
936
- this._onChange = fn;
937
- }
938
- /**
939
- * Saves a callback function to be invoked when the select is blurred
940
- * by the user. Part of the ControlValueAccessor interface required
941
- * to integrate with Angular's core forms API.
942
- *
943
- * @param fn Callback to be triggered when the component has been touched.
944
- */
945
- registerOnTouched(fn) {
946
- this._onTouched = fn;
947
- }
948
- /**
949
- * Sets whether the component should be disabled.
950
- * Implemented as part of ControlValueAccessor.
951
- * @param isDisabled
952
- */
953
- setDisabledState(isDisabled) {
954
- this.disabled = isDisabled;
955
- }
956
- onScroll(way) {
957
- this.scroll.emit({
958
- component: this,
959
- way,
960
- search: this.innerSearchText,
961
- });
962
- }
963
- _isErrorState() {
964
- const isInvalid = this._control?.invalid;
965
- const isTouched = this._control?.touched;
966
- const isSubmitted = this._parentFormGroup?.submitted || this._parentForm?.submitted;
967
- return !!(isInvalid && (isTouched || isSubmitted));
968
- }
969
- addItem(value) {
970
- let item = Select2Utils.getOptionByValue(this._data, value);
971
- if (!item) {
972
- item = {
973
- value,
974
- label: value,
975
- };
976
- this._data.push(item);
977
- }
978
- return item;
979
- }
980
- createAndAdd(e) {
981
- const value = e.target.value;
982
- if (value.trim()) {
983
- const item = this.addItem(value.trim());
984
- this.click(item);
985
- e.target.value = '';
986
- }
987
- this.stopEvent(e);
988
- }
989
- moveUp() {
990
- this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));
991
- }
992
- moveDown() {
993
- this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));
994
- }
995
- updateScrollFromOption(option) {
996
- if (option) {
997
- this.hoveringValue = option.value;
998
- const domElement = this.results.find(r => r.nativeElement.innerText.trim() === option.label);
999
- if (domElement && this.resultsElement) {
1000
- this.resultsElement.scrollTop = 0;
1001
- const listClientRect = this.resultsElement.getBoundingClientRect();
1002
- const optionClientRect = domElement.nativeElement.getBoundingClientRect();
1003
- this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;
1004
- }
1005
- }
1006
- }
1007
- selectByEnter() {
1008
- if (this.hoveringValue) {
1009
- const option = Select2Utils.getOptionByValue(this._data, this.hoveringValue);
1010
- this.select(option);
1011
- }
1012
- }
1013
- _testKey(event, refs = []) {
1014
- return this._isKey(this._getKey(event), refs);
1015
- }
1016
- _getKey(event) {
1017
- let code;
1018
- if (event.key !== undefined) {
1019
- code = event.key;
1020
- }
1021
- else if (event['keyIdentifier'] !== undefined) {
1022
- code = event['keyIdentifier'];
1023
- }
1024
- else if (event['keyCode'] !== undefined) {
1025
- code = event['keyCode'];
1026
- }
1027
- else {
1028
- event.preventDefault();
1029
- }
1030
- return code;
1031
- }
1032
- _isKey(code, refs = []) {
1033
- return refs && refs.length > 0 ? refs.indexOf(code) !== -1 : false;
1034
- }
1035
- /**
1036
- * Sets the selected option based on a value. If no option can be
1037
- * found with the designated value, the select trigger is cleared.
1038
- */
1039
- _setSelectionByValue(value) {
1040
- if (this.option || (value !== undefined && value !== null)) {
1041
- const isArray = Array.isArray(value);
1042
- if (this.multiple && value && !isArray) {
1043
- throw new Error('Non array value.');
1044
- }
1045
- else if (this._data) {
1046
- if (this.multiple) {
1047
- this.option = []; // if value is null, then empty option and return
1048
- if (isArray) {
1049
- // value is not null. Preselect value
1050
- const selectedValues = Select2Utils.getOptionsByValue(this._data, value, this.multiple);
1051
- selectedValues.map(item => this.select(item));
1052
- }
1053
- }
1054
- else {
1055
- this.select(Select2Utils.getOptionByValue(this._data, value));
1056
- }
1057
- }
1058
- else if (this._control) {
1059
- this._control.viewToModelUpdate(value);
1060
- }
1061
- this._changeDetectorRef.markForCheck();
1062
- }
1063
- }
1064
- /** Does some manual dirty checking on the native input `value` property. */
1065
- _dirtyCheckNativeValue() {
1066
- const newValue = this.value;
1067
- if (this._previousNativeValue !== newValue) {
1068
- this._previousNativeValue = newValue;
1069
- this._stateChanges.next();
1070
- }
1071
- }
1072
- _coerceBooleanProperty(value) {
1073
- return value != null && `${value}` !== 'false';
1074
- }
1075
- _focusSearchboxOrResultsElement(focus = true) {
1076
- if (!this.isSearchboxHidden) {
1077
- setTimeout(() => {
1078
- if (this.searchInput && this.searchInput.nativeElement && focus) {
1079
- this.searchInput.nativeElement.focus();
1080
- }
1081
- });
1082
- }
1083
- else if (this.resultsElement) {
1084
- this.resultsElement.focus();
1085
- }
1086
- }
1087
- _focus(state) {
1088
- if (!state && this.focused) {
1089
- this.focused = state;
1090
- this.blur.emit(this);
1091
- }
1092
- else if (state && !this.focused) {
1093
- this.focused = state;
1094
- this.focus.emit(this);
1095
- }
1096
- }
1097
- _isAbobeOverlay() {
1098
- return this.overlay && this._overlayPosition && this.listPosition === 'auto'
1099
- ? this._overlayPosition === 'top'
1100
- : this.listPosition === 'above';
1101
- }
1102
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2, deps: [{ token: i1.ViewportRuler }, { token: i0.ChangeDetectorRef }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i2.NgControl, optional: true, self: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }
1103
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.4", type: Select2, selector: "select2", inputs: { data: "data", minCharForSearch: "minCharForSearch", displaySearchStatus: "displaySearchStatus", placeholder: "placeholder", customSearchEnabled: "customSearchEnabled", limitSelection: "limitSelection", listPosition: "listPosition", multiple: "multiple", overlay: "overlay", styleMode: "styleMode", noResultMessage: "noResultMessage", maxResults: "maxResults", maxResultsMessage: "maxResultsMessage", infiniteScrollDistance: "infiniteScrollDistance", infiniteScrollThrottle: "infiniteScrollThrottle", infiniteScroll: "infiniteScroll", autoCreate: "autoCreate", noLabelTemplate: "noLabelTemplate", editPattern: "editPattern", templates: "templates", resultMaxHeight: "resultMaxHeight", minCountForSearch: "minCountForSearch", id: "id", required: "required", disabled: "disabled", hideSelectedItems: "hideSelectedItems", readonly: "readonly", value: "value", tabIndex: "tabIndex", resettable: "resettable" }, outputs: { update: "update", open: "open", close: "close", focus: "focus", blur: "blur", search: "search", scroll: "scroll", removeOption: "removeOption" }, host: { properties: { "id": "this.id", "attr.aria-invalid": "this.ariaInvalid", "class.material": "this.classMaterial", "class.nostyle": "this.classNostyle", "class.select2-above": "this.select2above" } }, viewQueries: [{ propertyName: "cdkConnectedOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true }, { propertyName: "selection", first: true, predicate: ["selection"], descendants: true, static: true }, { propertyName: "resultContainer", first: true, predicate: ["results"], descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "results", predicate: ["result"], descendants: true }], ngImport: i0, template: "<div class=\"select2-label\" (click)=\"toggleOpenAndClose()\">\n <ng-content select=\"select2-label\"></ng-content>\n <span *ngIf=\"required\" class=\"select2-required\"></span>\n</div>\n<div\n class=\"select2 select2-container select2-container--default\"\n [class.select2-container--focus]=\"focused\"\n [class.select2-container--below]=\"!select2above\"\n [class.select2-container--above]=\"select2above\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-container--disabled]=\"disabled\"\n>\n <div\n class=\"selection\"\n #selection\n #trigger=\"cdkOverlayOrigin\"\n [tabindex]=\"!this.isOpen ? tabIndex : '-1'\"\n (click)=\"toggleOpenAndClose()\"\n (focus)=\"focusin()\"\n (blur)=\"focusout()\"\n (keydown)=\"openKey($event)\"\n cdkOverlayOrigin\n [class.select2-focused]=\"focused\"\n >\n <div\n class=\"select2-selection\"\n [class.select2-selection--multiple]=\"multiple\"\n [class.select2-selection--single]=\"!multiple\"\n role=\"combobox\"\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__rendered\" [title]=\"select2Option?.label || ''\">\n <span *ngIf=\"!select2Option\">&nbsp;</span>\n <ng-container *ngIf=\"select2Option\">\n <span\n *ngIf=\"!hasTemplate(select2Option, 'option') || noLabelTemplate; else template\"\n [innerHTML]=\"select2Option.label\"\n ></span>\n <ng-template #template>\n <ng-container *ngTemplateOutlet=\"getTemplate(select2Option, 'option'); context: select2Option\">\n </ng-container>\n </ng-template>\n </ng-container>\n <span [class.select2-selection__placeholder__option]=\"option\" class=\"select2-selection__placeholder\">{{\n placeholder\n }}</span>\n </span>\n <span\n (click)=\"reset($event)\"\n *ngIf=\"!multiple && resettable && select2Option && !(disabled || readonly)\"\n class=\"select2-selection__reset\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__arrow\" role=\"presentation\"> </span>\n <ul *ngIf=\"multiple\" class=\"select2-selection__rendered\">\n <span\n *ngIf=\"!autoCreate\"\n [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\"\n >{{ placeholder }}</span\n >\n <li\n *ngFor=\"let op of option; trackBy: trackBy\"\n class=\"select2-selection__choice\"\n [title]=\"op.label\"\n tabindex=\"0\"\n (keydown.enter)=\"removeSelection($event, op)\"\n >\n <span\n *ngIf=\"!(disabled || readonly)\"\n (click)=\"removeSelection($event, op)\"\n class=\"select2-selection__choice__remove\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span [innerHTML]=\"op.label\"></span>\n </li>\n <li\n *ngIf=\"autoCreate\"\n class=\"select2-selection__auto-create\"\n (focus)=\"stopEvent($event)\"\n (blur)=\"stopEvent($event)\"\n >\n <input\n [id]=\"id + '-create-field'\"\n (click)=\"toggleOpenAndClose(false, true); stopEvent($event)\"\n (keydown)=\"keyDown($event, true)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-create__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n />\n </li>\n </ul>\n </div>\n </div>\n <ng-container *ngIf=\"!overlay\">\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n </ng-container>\n\n <div class=\"select2-subscript-wrapper\">\n <ng-content select=\"select2-hint\"></ng-content>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"select2-overlay-backdrop\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"this.isOpen && overlay\"\n [cdkConnectedOverlayMinWidth]=\"overlayWidth\"\n [cdkConnectedOverlayHeight]=\"overlayHeight\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n (backdropClick)=\"toggleOpenAndClose()\"\n>\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #containerTemplate>\n <div\n class=\"select2-container select2-container--default select2-container-dropdown\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-overlay]=\"overlay\"\n [class.select2-position-auto]=\"listPosition === 'auto'\"\n >\n <div\n #dropdown\n class=\"select2-dropdown\"\n [class.select2-dropdown--below]=\"!select2above\"\n [class.select2-dropdown--above]=\"select2above\"\n >\n <div class=\"select2-search select2-search--dropdown\" [class.select2-search--hide]=\"hideSearch()\">\n <input\n #searchInput\n [id]=\"id + '-search-field'\"\n [value]=\"searchText\"\n (keydown)=\"keyDown($event)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-search__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [attr.tabindex]=\"this.isOpen ? tabIndex : '-1'\"\n />\n </div>\n <div class=\"select2-results\">\n <ul\n #results\n class=\"select2-results__options\"\n [style.max-height]=\"resultMaxHeight\"\n role=\"tree\"\n tabindex=\"-1\"\n infiniteScroll\n [infiniteScrollDisabled]=\"!infiniteScroll && !isOpen\"\n [infiniteScrollDistance]=\"infiniteScrollDistance\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle\"\n [infiniteScrollContainer]=\"results\"\n (scrolled)=\"onScroll('down')\"\n (scrolledUp)=\"onScroll('up')\"\n (keydown)=\"keyDown($event)\"\n >\n <ng-container *ngFor=\"let groupOrOption of filteredData; index as i; trackBy: trackBy\">\n <li *ngIf=\"groupOrOption.options\" class=\"select2-results__option\" role=\"group\">\n <strong\n *ngIf=\"!hasTemplate(groupOrOption, 'group'); else optGroup\"\n [attr.class]=\"\n 'select2-results__group' +\n (groupOrOption.classes ? ' ' + groupOrOption.classes : '')\n \"\n [innerHTML]=\"groupOrOption.label\"\n ></strong>\n <ng-template #optGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'group'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n\n <ul class=\"select2-results__options select2-results__options--nested\">\n <li\n *ngFor=\"let option of groupOrOption.options; index as j; trackBy: trackBy\"\n #result\n [id]=\"option.id || id + '-option-' + i + '-' + j\"\n [class]=\"getOptionStyle(option)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"isDisabled(option)\"\n (mouseenter)=\"mouseenter(option)\"\n (click)=\"click(option)\"\n >\n <div\n *ngIf=\"!hasTemplate(option, 'option'); else liGroup\"\n class=\"select2-label-content\"\n [innerHTML]=\"option.label\"\n ></div>\n <ng-template #liGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(option, 'option'); context: option\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ul>\n </li>\n <li\n *ngIf=\"!groupOrOption.options\"\n #result\n [id]=\"groupOrOption.id || id + '-option-' + i\"\n [class]=\"getOptionStyle(groupOrOption)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(groupOrOption)\"\n [attr.aria-disabled]=\"isDisabled(groupOrOption)\"\n (mouseenter)=\"mouseenter(groupOrOption)\"\n (click)=\"click(groupOrOption)\"\n >\n <div\n *ngIf=\"!hasTemplate(groupOrOption, 'option'); else li\"\n [innerHTML]=\"groupOrOption.label\"\n class=\"select2-label-content\"\n ></div>\n <ng-template #li>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'option'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n <li\n class=\"select2-no-result select2-results__option\"\n *ngIf=\"!filteredData?.length && noResultMessage\"\n [innerHTML]=\"noResultMessage\"\n ></li>\n <li\n class=\"select2-too-much-result select2-results__option\"\n *ngIf=\"maxResultsExceeded\"\n [innerHTML]=\"maxResultsMessage\"\n ></li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:0 0 0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:5px}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\"*\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\" \";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\" \";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\" \";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i4.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: i5.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }] }); }
1104
- }
1105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2, decorators: [{
1106
- type: Component,
1107
- args: [{ selector: 'select2', template: "<div class=\"select2-label\" (click)=\"toggleOpenAndClose()\">\n <ng-content select=\"select2-label\"></ng-content>\n <span *ngIf=\"required\" class=\"select2-required\"></span>\n</div>\n<div\n class=\"select2 select2-container select2-container--default\"\n [class.select2-container--focus]=\"focused\"\n [class.select2-container--below]=\"!select2above\"\n [class.select2-container--above]=\"select2above\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-container--disabled]=\"disabled\"\n>\n <div\n class=\"selection\"\n #selection\n #trigger=\"cdkOverlayOrigin\"\n [tabindex]=\"!this.isOpen ? tabIndex : '-1'\"\n (click)=\"toggleOpenAndClose()\"\n (focus)=\"focusin()\"\n (blur)=\"focusout()\"\n (keydown)=\"openKey($event)\"\n cdkOverlayOrigin\n [class.select2-focused]=\"focused\"\n >\n <div\n class=\"select2-selection\"\n [class.select2-selection--multiple]=\"multiple\"\n [class.select2-selection--single]=\"!multiple\"\n role=\"combobox\"\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__rendered\" [title]=\"select2Option?.label || ''\">\n <span *ngIf=\"!select2Option\">&nbsp;</span>\n <ng-container *ngIf=\"select2Option\">\n <span\n *ngIf=\"!hasTemplate(select2Option, 'option') || noLabelTemplate; else template\"\n [innerHTML]=\"select2Option.label\"\n ></span>\n <ng-template #template>\n <ng-container *ngTemplateOutlet=\"getTemplate(select2Option, 'option'); context: select2Option\">\n </ng-container>\n </ng-template>\n </ng-container>\n <span [class.select2-selection__placeholder__option]=\"option\" class=\"select2-selection__placeholder\">{{\n placeholder\n }}</span>\n </span>\n <span\n (click)=\"reset($event)\"\n *ngIf=\"!multiple && resettable && select2Option && !(disabled || readonly)\"\n class=\"select2-selection__reset\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__arrow\" role=\"presentation\"> </span>\n <ul *ngIf=\"multiple\" class=\"select2-selection__rendered\">\n <span\n *ngIf=\"!autoCreate\"\n [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\"\n >{{ placeholder }}</span\n >\n <li\n *ngFor=\"let op of option; trackBy: trackBy\"\n class=\"select2-selection__choice\"\n [title]=\"op.label\"\n tabindex=\"0\"\n (keydown.enter)=\"removeSelection($event, op)\"\n >\n <span\n *ngIf=\"!(disabled || readonly)\"\n (click)=\"removeSelection($event, op)\"\n class=\"select2-selection__choice__remove\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span [innerHTML]=\"op.label\"></span>\n </li>\n <li\n *ngIf=\"autoCreate\"\n class=\"select2-selection__auto-create\"\n (focus)=\"stopEvent($event)\"\n (blur)=\"stopEvent($event)\"\n >\n <input\n [id]=\"id + '-create-field'\"\n (click)=\"toggleOpenAndClose(false, true); stopEvent($event)\"\n (keydown)=\"keyDown($event, true)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-create__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n />\n </li>\n </ul>\n </div>\n </div>\n <ng-container *ngIf=\"!overlay\">\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n </ng-container>\n\n <div class=\"select2-subscript-wrapper\">\n <ng-content select=\"select2-hint\"></ng-content>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"select2-overlay-backdrop\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"this.isOpen && overlay\"\n [cdkConnectedOverlayMinWidth]=\"overlayWidth\"\n [cdkConnectedOverlayHeight]=\"overlayHeight\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n (backdropClick)=\"toggleOpenAndClose()\"\n>\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #containerTemplate>\n <div\n class=\"select2-container select2-container--default select2-container-dropdown\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-overlay]=\"overlay\"\n [class.select2-position-auto]=\"listPosition === 'auto'\"\n >\n <div\n #dropdown\n class=\"select2-dropdown\"\n [class.select2-dropdown--below]=\"!select2above\"\n [class.select2-dropdown--above]=\"select2above\"\n >\n <div class=\"select2-search select2-search--dropdown\" [class.select2-search--hide]=\"hideSearch()\">\n <input\n #searchInput\n [id]=\"id + '-search-field'\"\n [value]=\"searchText\"\n (keydown)=\"keyDown($event)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-search__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [attr.tabindex]=\"this.isOpen ? tabIndex : '-1'\"\n />\n </div>\n <div class=\"select2-results\">\n <ul\n #results\n class=\"select2-results__options\"\n [style.max-height]=\"resultMaxHeight\"\n role=\"tree\"\n tabindex=\"-1\"\n infiniteScroll\n [infiniteScrollDisabled]=\"!infiniteScroll && !isOpen\"\n [infiniteScrollDistance]=\"infiniteScrollDistance\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle\"\n [infiniteScrollContainer]=\"results\"\n (scrolled)=\"onScroll('down')\"\n (scrolledUp)=\"onScroll('up')\"\n (keydown)=\"keyDown($event)\"\n >\n <ng-container *ngFor=\"let groupOrOption of filteredData; index as i; trackBy: trackBy\">\n <li *ngIf=\"groupOrOption.options\" class=\"select2-results__option\" role=\"group\">\n <strong\n *ngIf=\"!hasTemplate(groupOrOption, 'group'); else optGroup\"\n [attr.class]=\"\n 'select2-results__group' +\n (groupOrOption.classes ? ' ' + groupOrOption.classes : '')\n \"\n [innerHTML]=\"groupOrOption.label\"\n ></strong>\n <ng-template #optGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'group'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n\n <ul class=\"select2-results__options select2-results__options--nested\">\n <li\n *ngFor=\"let option of groupOrOption.options; index as j; trackBy: trackBy\"\n #result\n [id]=\"option.id || id + '-option-' + i + '-' + j\"\n [class]=\"getOptionStyle(option)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"isDisabled(option)\"\n (mouseenter)=\"mouseenter(option)\"\n (click)=\"click(option)\"\n >\n <div\n *ngIf=\"!hasTemplate(option, 'option'); else liGroup\"\n class=\"select2-label-content\"\n [innerHTML]=\"option.label\"\n ></div>\n <ng-template #liGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(option, 'option'); context: option\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ul>\n </li>\n <li\n *ngIf=\"!groupOrOption.options\"\n #result\n [id]=\"groupOrOption.id || id + '-option-' + i\"\n [class]=\"getOptionStyle(groupOrOption)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(groupOrOption)\"\n [attr.aria-disabled]=\"isDisabled(groupOrOption)\"\n (mouseenter)=\"mouseenter(groupOrOption)\"\n (click)=\"click(groupOrOption)\"\n >\n <div\n *ngIf=\"!hasTemplate(groupOrOption, 'option'); else li\"\n [innerHTML]=\"groupOrOption.label\"\n class=\"select2-label-content\"\n ></div>\n <ng-template #li>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'option'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n <li\n class=\"select2-no-result select2-results__option\"\n *ngIf=\"!filteredData?.length && noResultMessage\"\n [innerHTML]=\"noResultMessage\"\n ></li>\n <li\n class=\"select2-too-much-result select2-results__option\"\n *ngIf=\"maxResultsExceeded\"\n [innerHTML]=\"maxResultsMessage\"\n ></li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:0 0 0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:5px}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\"*\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\" \";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\" \";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\" \";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\n"] }]
1108
- }], ctorParameters: function () { return [{ type: i1.ViewportRuler }, { type: i0.ChangeDetectorRef }, { type: i2.NgForm, decorators: [{
1109
- type: Optional
1110
- }] }, { type: i2.FormGroupDirective, decorators: [{
1111
- type: Optional
1112
- }] }, { type: i2.NgControl, decorators: [{
1113
- type: Self
1114
- }, {
1115
- type: Optional
1116
- }] }, { type: undefined, decorators: [{
1117
- type: Attribute,
1118
- args: ['tabindex']
1119
- }] }]; }, propDecorators: { data: [{
1120
- type: Input
1121
- }], minCharForSearch: [{
1122
- type: Input
1123
- }], displaySearchStatus: [{
1124
- type: Input
1125
- }], placeholder: [{
1126
- type: Input
1127
- }], customSearchEnabled: [{
1128
- type: Input
1129
- }], limitSelection: [{
1130
- type: Input
1131
- }], listPosition: [{
1132
- type: Input
1133
- }], multiple: [{
1134
- type: Input
1135
- }], overlay: [{
1136
- type: Input
1137
- }], styleMode: [{
1138
- type: Input
1139
- }], noResultMessage: [{
1140
- type: Input
1141
- }], maxResults: [{
1142
- type: Input
1143
- }], maxResultsMessage: [{
1144
- type: Input
1145
- }], infiniteScrollDistance: [{
1146
- type: Input
1147
- }], infiniteScrollThrottle: [{
1148
- type: Input
1149
- }], infiniteScroll: [{
1150
- type: Input
1151
- }], autoCreate: [{
1152
- type: Input
1153
- }], noLabelTemplate: [{
1154
- type: Input
1155
- }], editPattern: [{
1156
- type: Input
1157
- }], templates: [{
1158
- type: Input
1159
- }], resultMaxHeight: [{
1160
- type: Input
1161
- }], update: [{
1162
- type: Output
1163
- }], open: [{
1164
- type: Output
1165
- }], close: [{
1166
- type: Output
1167
- }], focus: [{
1168
- type: Output
1169
- }], blur: [{
1170
- type: Output
1171
- }], search: [{
1172
- type: Output
1173
- }], scroll: [{
1174
- type: Output
1175
- }], removeOption: [{
1176
- type: Output
1177
- }], minCountForSearch: [{
1178
- type: Input
1179
- }], id: [{
1180
- type: Input
1181
- }, {
1182
- type: HostBinding,
1183
- args: ['id']
1184
- }], required: [{
1185
- type: Input
1186
- }], disabled: [{
1187
- type: Input
1188
- }], hideSelectedItems: [{
1189
- type: Input
1190
- }], readonly: [{
1191
- type: Input
1192
- }], value: [{
1193
- type: Input
1194
- }], tabIndex: [{
1195
- type: Input
1196
- }], resettable: [{
1197
- type: Input
1198
- }], ariaInvalid: [{
1199
- type: HostBinding,
1200
- args: ['attr.aria-invalid']
1201
- }], classMaterial: [{
1202
- type: HostBinding,
1203
- args: ['class.material']
1204
- }], classNostyle: [{
1205
- type: HostBinding,
1206
- args: ['class.nostyle']
1207
- }], select2above: [{
1208
- type: HostBinding,
1209
- args: ['class.select2-above']
1210
- }], cdkConnectedOverlay: [{
1211
- type: ViewChild,
1212
- args: [CdkConnectedOverlay]
1213
- }], selection: [{
1214
- type: ViewChild,
1215
- args: ['selection', { static: true }]
1216
- }], resultContainer: [{
1217
- type: ViewChild,
1218
- args: ['results']
1219
- }], results: [{
1220
- type: ViewChildren,
1221
- args: ['result']
1222
- }], searchInput: [{
1223
- type: ViewChild,
1224
- args: ['searchInput']
1225
- }], dropdown: [{
1226
- type: ViewChild,
1227
- args: ['dropdown']
342
+ let nextUniqueId = 0;
343
+ const displaySearchStatusList = ['default', 'hidden', 'always'];
344
+ class Select2 {
345
+ /** data of options & optiongrps */
346
+ set data(data) {
347
+ this._data = data;
348
+ this.updateFilteredData();
349
+ }
350
+ get multiple() {
351
+ return this._multiple;
352
+ }
353
+ set multiple(value) {
354
+ this._multiple = coerceBooleanProperty(value);
355
+ this.ngOnInit();
356
+ }
357
+ /** use the material style */
358
+ get overlay() {
359
+ return this._overlay;
360
+ }
361
+ set overlay(value) {
362
+ this._overlay = coerceBooleanProperty(value);
363
+ }
364
+ /** infinite scroll activated */
365
+ get infiniteScroll() {
366
+ return this._infiniteScroll;
367
+ }
368
+ set infiniteScroll(value) {
369
+ this._infiniteScroll = coerceBooleanProperty(value);
370
+ }
371
+ /** auto create if not existe */
372
+ get autoCreate() {
373
+ return this._autoCreate;
374
+ }
375
+ set autoCreate(value) {
376
+ this._autoCreate = coerceBooleanProperty(value);
377
+ }
378
+ /** no template for label selection */
379
+ get noLabelTemplate() {
380
+ return this._noLabelTemplate;
381
+ }
382
+ set noLabelTemplate(value) {
383
+ this._noLabelTemplate = coerceBooleanProperty(value);
384
+ }
385
+ get select2Options() {
386
+ return this.multiple ? this.option : null;
387
+ }
388
+ get select2Option() {
389
+ return this.multiple ? null : this.option;
390
+ }
391
+ get searchText() {
392
+ return this.innerSearchText;
393
+ }
394
+ set searchText(text) {
395
+ this.innerSearchText = text;
396
+ }
397
+ /** Active Search event */
398
+ get customSearchEnabled() {
399
+ return this._customSearchEnabled;
400
+ }
401
+ set customSearchEnabled(value) {
402
+ this._customSearchEnabled = coerceBooleanProperty(value);
403
+ }
404
+ /** minimal data of show the search field */
405
+ get minCountForSearch() {
406
+ return this._minCountForSearch;
407
+ }
408
+ set minCountForSearch(value) {
409
+ this._minCountForSearch = coerceNumberProperty(value);
410
+ this.updateSearchBox();
411
+ }
412
+ /** Unique id of the element. */
413
+ get id() {
414
+ return this._id;
415
+ }
416
+ set id(value) {
417
+ this._id = value || this._uid;
418
+ }
419
+ /** Whether the element is required. */
420
+ get required() {
421
+ return this._required;
422
+ }
423
+ set required(value) {
424
+ this._required = coerceBooleanProperty(value);
425
+ }
426
+ /** Whether selected items should be hidden. */
427
+ get disabled() {
428
+ return this._control ? this._control.disabled : this._disabled;
429
+ }
430
+ set disabled(value) {
431
+ this._disabled = coerceBooleanProperty(value);
432
+ }
433
+ /** Whether items are hidden when has. */
434
+ get hideSelectedItems() {
435
+ return this._hideSelectedItems;
436
+ }
437
+ set hideSelectedItems(value) {
438
+ this._hideSelectedItems = coerceBooleanProperty(value);
439
+ }
440
+ /** Whether the element is readonly. */
441
+ get readonly() {
442
+ return this._readonly;
443
+ }
444
+ set readonly(value) {
445
+ this._readonly = coerceBooleanProperty(value);
446
+ }
447
+ /** The input element's value. */
448
+ get value() {
449
+ return this._value;
450
+ }
451
+ set value(value) {
452
+ if (this.testValueChange(this._value, value)) {
453
+ setTimeout(() => {
454
+ this._value = value;
455
+ this.writeValue(value);
456
+ }, 10);
457
+ }
458
+ }
459
+ /** Tab index for the select2 element. */
460
+ get tabIndex() {
461
+ return this.disabled ? -1 : this._tabIndex;
462
+ }
463
+ set tabIndex(value) {
464
+ if (typeof value !== 'undefined') {
465
+ this._tabIndex = value;
466
+ }
467
+ }
468
+ /** reset with no selected value */
469
+ get resettable() {
470
+ return this._resettable;
471
+ }
472
+ set resettable(value) {
473
+ this._resettable = coerceBooleanProperty(value);
474
+ }
475
+ get ariaInvalid() {
476
+ return this._isErrorState();
477
+ }
478
+ get classMaterial() {
479
+ return this.styleMode === 'material';
480
+ }
481
+ get classNostyle() {
482
+ return this.styleMode === 'noStyle';
483
+ }
484
+ get select2above() {
485
+ return !this.overlay ? this.listPosition === 'above' : this._isAbobeOverlay();
486
+ }
487
+ get _positions() {
488
+ return this.listPosition === 'auto' ? undefined : null;
489
+ }
490
+ get resultsElement() {
491
+ return this.resultContainer?.nativeElement;
492
+ }
493
+ constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {
494
+ this._viewportRuler = _viewportRuler;
495
+ this._changeDetectorRef = _changeDetectorRef;
496
+ this._parentForm = _parentForm;
497
+ this._parentFormGroup = _parentFormGroup;
498
+ this._control = _control;
499
+ this.minCharForSearch = 0;
500
+ this.limitSelection = 0;
501
+ this.listPosition = 'below';
502
+ /** use the material style */
503
+ this.styleMode = 'default';
504
+ /** maximum results limit (0 = no limit) */
505
+ this.maxResults = 0;
506
+ /** message when maximum results */
507
+ this.maxResultsMessage = 'Too many results…';
508
+ /** infinite scroll distance */
509
+ this.infiniteScrollDistance = 1.5;
510
+ /** infinite scroll distance */
511
+ this.infiniteScrollThrottle = 150;
512
+ /** the max height of the results container when opening the select */
513
+ this.resultMaxHeight = '200px';
514
+ this.update = new EventEmitter();
515
+ this.open = new EventEmitter();
516
+ this.close = new EventEmitter();
517
+ this.focus = new EventEmitter();
518
+ this.blur = new EventEmitter();
519
+ this.search = new EventEmitter();
520
+ this.scroll = new EventEmitter();
521
+ this.removeOption = new EventEmitter();
522
+ this.option = null;
523
+ this.isOpen = false;
524
+ /** Whether the element is focused or not. */
525
+ this.focused = false;
526
+ this.hoveringValue = null;
527
+ this.innerSearchText = '';
528
+ this._stateChanges = new Subject();
529
+ this._disabled = false;
530
+ this._required = false;
531
+ this._readonly = false;
532
+ this._multiple = false;
533
+ this._overlay = false;
534
+ this._resettable = false;
535
+ this._hideSelectedItems = false;
536
+ this._clickDetection = false;
537
+ this._uid = `select2-${nextUniqueId++}`;
538
+ this._infiniteScroll = true;
539
+ this._autoCreate = true;
540
+ this._noLabelTemplate = true;
541
+ /** View -> model callback called when select has been touched */
542
+ this._onTouched = () => {
543
+ // do nothing
544
+ };
545
+ /** View -> model callback called when value changes */
546
+ this._onChange = () => {
547
+ // do nothing
548
+ };
549
+ // eslint-disable-next-line no-self-assign
550
+ this.id = this.id;
551
+ this._tabIndex = parseInt(tabIndex, 10) || 0;
552
+ if (this._control) {
553
+ this._control.valueAccessor = this;
554
+ }
555
+ this._clickDetectionFc = this.clickDetection.bind(this);
556
+ }
557
+ ngOnInit() {
558
+ this._viewportRuler.change(100).subscribe(() => {
559
+ if (this.isOpen) {
560
+ this.triggerRect();
561
+ }
562
+ });
563
+ const option = Select2Utils.getOptionsByValue(this._data, this._control ? this._control.value : this.value, this.multiple);
564
+ if (option !== null) {
565
+ this.option = option;
566
+ }
567
+ if (!Array.isArray(option)) {
568
+ this.hoveringValue = this.value;
569
+ }
570
+ this.updateSearchBox();
571
+ }
572
+ ngAfterViewInit() {
573
+ this.cdkConnectedOverlay.positionChange.subscribe((posChange) => {
574
+ if (this.listPosition === 'auto' &&
575
+ posChange.connectionPair?.originY &&
576
+ this._overlayPosition !== posChange.connectionPair.originY) {
577
+ this.triggerRect();
578
+ this._overlayPosition = posChange.connectionPair.originY;
579
+ this._changeDetectorRef.detectChanges();
580
+ }
581
+ });
582
+ this.selectionElement = this.selection.nativeElement;
583
+ this.triggerRect();
584
+ }
585
+ ngDoCheck() {
586
+ this.updateSearchBox();
587
+ this._dirtyCheckNativeValue();
588
+ if (this._triggerRect) {
589
+ if (this.overlayWidth !== this._triggerRect.width) {
590
+ this.overlayWidth = this._triggerRect.width;
591
+ }
592
+ if (this._dropdownRect?.height > 0 && this.overlayHeight !== this._dropdownRect.height) {
593
+ this.overlayHeight = this.listPosition === 'auto' ? this._dropdownRect.height : 0;
594
+ }
595
+ }
596
+ }
597
+ ngOnDestroy() {
598
+ window.document.body.removeEventListener('click', this._clickDetectionFc);
599
+ }
600
+ updateSearchBox() {
601
+ const hidden = this.customSearchEnabled
602
+ ? false
603
+ : Select2Utils.isSearchboxHiddex(this._data, this._minCountForSearch);
604
+ if (this.isSearchboxHidden !== hidden) {
605
+ this.isSearchboxHidden = hidden;
606
+ }
607
+ }
608
+ hideSearch() {
609
+ const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1 ? this.displaySearchStatus : 'default';
610
+ return (displaySearchStatus === 'default' && this.isSearchboxHidden) || displaySearchStatus === 'hidden';
611
+ }
612
+ getOptionStyle(option) {
613
+ return ('select2-results__option ' +
614
+ (option.hide ? 'select2-results__option--hide ' : '') +
615
+ (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') +
616
+ (option.classes || ''));
617
+ }
618
+ mouseenter(option) {
619
+ if (!option.disabled) {
620
+ this.hoveringValue = option.value;
621
+ }
622
+ }
623
+ click(option) {
624
+ if (this.testSelection(option)) {
625
+ this.select(option);
626
+ }
627
+ }
628
+ reset(event) {
629
+ this.select(null);
630
+ this.stopEvent(event);
631
+ }
632
+ prevChange(event) {
633
+ event.stopPropagation();
634
+ }
635
+ stopEvent(event) {
636
+ event.preventDefault();
637
+ event.stopPropagation();
638
+ }
639
+ toggleOpenAndClose(focus = true, open) {
640
+ if (this.disabled) {
641
+ return;
642
+ }
643
+ this._focus(focus);
644
+ this.isOpen = open ?? !this.isOpen;
645
+ if (this.isOpen) {
646
+ this.innerSearchText = '';
647
+ this.updateFilteredData();
648
+ this._focusSearchboxOrResultsElement(focus);
649
+ setTimeout(() => {
650
+ if (this.option) {
651
+ const option = this.option instanceof Array ? this.option[0] : this.option;
652
+ this.updateScrollFromOption(option);
653
+ }
654
+ else if (this.resultsElement) {
655
+ this.resultsElement.scrollTop = 0;
656
+ }
657
+ setTimeout(() => {
658
+ this.triggerRect();
659
+ this.cdkConnectedOverlay?.overlayRef?.updatePosition();
660
+ }, 100);
661
+ });
662
+ this.open.emit(this);
663
+ }
664
+ else {
665
+ this.close.emit(this);
666
+ }
667
+ if (this.isOpen && !this._clickDetection && focus) {
668
+ setTimeout(() => {
669
+ window.document.body.addEventListener('click', this._clickDetectionFc, false);
670
+ this._clickDetection = true;
671
+ }, timeout);
672
+ }
673
+ this._changeDetectorRef.markForCheck();
674
+ }
675
+ hasTemplate(option, defaut) {
676
+ return (this.templates instanceof TemplateRef ||
677
+ this.templates?.[option.templateId] instanceof TemplateRef ||
678
+ this.templates?.[defaut] instanceof TemplateRef);
679
+ }
680
+ getTemplate(option, defaut) {
681
+ return this.hasTemplate(option, defaut)
682
+ ? this.templates[option.templateId] || this.templates[defaut] || this.templates
683
+ : undefined;
684
+ }
685
+ triggerRect() {
686
+ this._triggerRect = this.selectionElement.getBoundingClientRect();
687
+ this._dropdownRect = this.dropdown?.nativeElement
688
+ ? this.dropdown.nativeElement.getBoundingClientRect()
689
+ : undefined;
690
+ }
691
+ testSelection(option) {
692
+ if (option.disabled) {
693
+ return false;
694
+ }
695
+ return (!this.multiple ||
696
+ !this.limitSelection ||
697
+ (Array.isArray(this._value) && this._value.length < this.limitSelection));
698
+ }
699
+ testValueChange(value1, value2) {
700
+ if (((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined)) ||
701
+ value1 === value2) {
702
+ return false;
703
+ }
704
+ if (this.multiple &&
705
+ value1?.length &&
706
+ value2?.length &&
707
+ value1.length === value2.length) {
708
+ for (const e1 of value1) {
709
+ const test = value2.indexOf(e1) > -1;
710
+ if (!test) {
711
+ return true;
712
+ }
713
+ }
714
+ return false;
715
+ }
716
+ return true;
717
+ }
718
+ updateFilteredData() {
719
+ setTimeout(() => {
720
+ let result = this._data;
721
+ if (this.multiple && this.hideSelectedItems) {
722
+ result = Select2Utils.getFilteredSelectedData(result, this.option);
723
+ }
724
+ if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {
725
+ result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);
726
+ }
727
+ if (this.maxResults > 0) {
728
+ const data = Select2Utils.getReduceData(result, +this.maxResults);
729
+ result = data.result;
730
+ this.maxResultsExceeded = data.reduce;
731
+ }
732
+ else {
733
+ this.maxResultsExceeded = false;
734
+ }
735
+ if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {
736
+ this.hoveringValue = Select2Utils.getFirstAvailableOption(result);
737
+ }
738
+ this.filteredData = result;
739
+ this._changeDetectorRef.markForCheck();
740
+ });
741
+ }
742
+ clickDetection(e) {
743
+ if (!this.ifParentContainsClass(e.target, 'selection')) {
744
+ if (this.isOpen && !this.ifParentContainsClass(e.target, 'select2-dropdown')) {
745
+ this.toggleOpenAndClose();
746
+ }
747
+ if (!this.ifParentContainsId(e.target, this._id)) {
748
+ this.clickExit();
749
+ }
750
+ }
751
+ else if (this.isOpen && !this.ifParentContainsId(e.target, this._id)) {
752
+ this.toggleOpenAndClose();
753
+ this.clickExit();
754
+ }
755
+ }
756
+ clickExit() {
757
+ this._focus(false);
758
+ window.document.body.removeEventListener('click', this._clickDetectionFc);
759
+ this._clickDetection = false;
760
+ }
761
+ ifParentContainsClass(element, cssClass) {
762
+ return this.getParentElementByClass(element, cssClass) !== null;
763
+ }
764
+ ifParentContainsId(element, id) {
765
+ return this.getParentElementById(element, id) !== null;
766
+ }
767
+ getParentElementByClass(element, cssClass) {
768
+ return this.containClasses(element, cssClass.trim().split(/\s+/))
769
+ ? element
770
+ : element.parentElement
771
+ ? this.getParentElementByClass(element.parentElement, cssClass)
772
+ : null;
773
+ }
774
+ getParentElementById(element, id) {
775
+ return element.id === id
776
+ ? element
777
+ : element.parentElement
778
+ ? this.getParentElementById(element.parentElement, id)
779
+ : null;
780
+ }
781
+ containClasses(element, cssClasses) {
782
+ if (!element.classList) {
783
+ return false;
784
+ }
785
+ for (const cssClass of cssClasses) {
786
+ if (!element.classList.contains(cssClass)) {
787
+ return false;
788
+ }
789
+ }
790
+ return true;
791
+ }
792
+ focusin() {
793
+ if (!this.disabled) {
794
+ this._focus(true);
795
+ }
796
+ }
797
+ focusout() {
798
+ if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {
799
+ this._focus(false);
800
+ this._onTouched();
801
+ }
802
+ }
803
+ select(option) {
804
+ let value;
805
+ if (option !== null) {
806
+ if (this.multiple) {
807
+ const options = this.option;
808
+ const index = options.findIndex(op => op.value === option.value);
809
+ if (index === -1) {
810
+ options.push(option);
811
+ }
812
+ else {
813
+ options.splice(index, 1);
814
+ }
815
+ value = this.option.map(op => op.value);
816
+ }
817
+ else {
818
+ this.option = option;
819
+ if (this.isOpen) {
820
+ this.isOpen = false;
821
+ this.close.emit(this);
822
+ this.selectionElement?.focus();
823
+ }
824
+ value = this.option.value;
825
+ }
826
+ }
827
+ else {
828
+ this.option = null;
829
+ }
830
+ if (this.multiple && this.hideSelectedItems) {
831
+ this.updateFilteredData();
832
+ }
833
+ if (this._control) {
834
+ this._onChange(value);
835
+ }
836
+ else {
837
+ this._value = value;
838
+ }
839
+ this.update.emit({
840
+ component: this,
841
+ value: value,
842
+ options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
843
+ });
844
+ }
845
+ keyDown(e, create = false) {
846
+ if (create && this._testKey(e, ['Enter', 13])) {
847
+ this.createAndAdd(e);
848
+ return;
849
+ }
850
+ if (this._testKey(e, ['ArrowDown', 40])) {
851
+ this.moveDown();
852
+ e.preventDefault();
853
+ }
854
+ else if (this._testKey(e, ['ArrowUp', 38])) {
855
+ this.moveUp();
856
+ e.preventDefault();
857
+ }
858
+ else if (this._testKey(e, ['Enter', 13])) {
859
+ this.selectByEnter();
860
+ e.preventDefault();
861
+ }
862
+ else if (this._testKey(e, ['Escape', 'Tab', 9, 27]) && this.isOpen) {
863
+ this.toggleOpenAndClose();
864
+ this._focus(false);
865
+ }
866
+ }
867
+ openKey(e, create = false) {
868
+ if (create && this._testKey(e, ['Enter', 13])) {
869
+ this.createAndAdd(e);
870
+ return;
871
+ }
872
+ if (this._testKey(e, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {
873
+ this.toggleOpenAndClose();
874
+ e.preventDefault();
875
+ }
876
+ else if (this._testKey(e, ['Escape', 'Tab', 9, 27])) {
877
+ this._focus(false);
878
+ this._onTouched();
879
+ }
880
+ }
881
+ searchUpdate(e) {
882
+ this.searchText = e.target.value;
883
+ if (!this._customSearchEnabled) {
884
+ this.updateFilteredData();
885
+ }
886
+ else {
887
+ this.search.emit({
888
+ component: this,
889
+ value: this._value,
890
+ search: this.searchText,
891
+ data: this._data,
892
+ filteredData: (data) => {
893
+ this.filteredData = data;
894
+ this._changeDetectorRef.markForCheck();
895
+ },
896
+ });
897
+ }
898
+ }
899
+ trackBy(_index, item) {
900
+ return item.value;
901
+ }
902
+ isSelected(option) {
903
+ return Select2Utils.isSelected(this.option, option, this.multiple);
904
+ }
905
+ isDisabled(option) {
906
+ return option.disabled ? 'true' : 'false';
907
+ }
908
+ removeSelection(e, option) {
909
+ Select2Utils.removeSelection(this.option, option);
910
+ if (this.multiple && this.hideSelectedItems) {
911
+ this.updateFilteredData();
912
+ }
913
+ const value = this.option.map(op => op.value);
914
+ if (this._control) {
915
+ this._onChange(value);
916
+ }
917
+ else {
918
+ this._value = value;
919
+ }
920
+ this.update.emit({
921
+ component: this,
922
+ value: value,
923
+ options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
924
+ });
925
+ this.removeOption.emit({
926
+ component: this,
927
+ value: value,
928
+ removedOption: option,
929
+ });
930
+ e.preventDefault();
931
+ e.stopPropagation();
932
+ if (this.isOpen) {
933
+ this._focusSearchboxOrResultsElement();
934
+ }
935
+ }
936
+ /**
937
+ * Sets the model value. Implemented as part of ControlValueAccessor.
938
+ * @param value
939
+ */
940
+ writeValue(value) {
941
+ this._setSelectionByValue(value);
942
+ }
943
+ /**
944
+ * Saves a callback function to be invoked when the select's value
945
+ * changes from user input. Part of the ControlValueAccessor interface
946
+ * required to integrate with Angular's core forms API.
947
+ *
948
+ * @param fn Callback to be triggered when the value changes.
949
+ */
950
+ registerOnChange(fn) {
951
+ this._onChange = fn;
952
+ }
953
+ /**
954
+ * Saves a callback function to be invoked when the select is blurred
955
+ * by the user. Part of the ControlValueAccessor interface required
956
+ * to integrate with Angular's core forms API.
957
+ *
958
+ * @param fn Callback to be triggered when the component has been touched.
959
+ */
960
+ registerOnTouched(fn) {
961
+ this._onTouched = fn;
962
+ }
963
+ /**
964
+ * Sets whether the component should be disabled.
965
+ * Implemented as part of ControlValueAccessor.
966
+ * @param isDisabled
967
+ */
968
+ setDisabledState(isDisabled) {
969
+ this.disabled = isDisabled;
970
+ }
971
+ onScroll(way) {
972
+ this.scroll.emit({
973
+ component: this,
974
+ way,
975
+ search: this.innerSearchText,
976
+ data: this._data,
977
+ });
978
+ }
979
+ _isErrorState() {
980
+ const isInvalid = this._control?.invalid;
981
+ const isTouched = this._control?.touched;
982
+ const isSubmitted = this._parentFormGroup?.submitted || this._parentForm?.submitted;
983
+ return !!(isInvalid && (isTouched || isSubmitted));
984
+ }
985
+ addItem(value) {
986
+ let item = Select2Utils.getOptionByValue(this._data, value);
987
+ if (!item) {
988
+ item = {
989
+ value,
990
+ label: value,
991
+ };
992
+ this._data.push(item);
993
+ }
994
+ return item;
995
+ }
996
+ createAndAdd(e) {
997
+ const value = e.target.value;
998
+ if (value.trim()) {
999
+ const item = this.addItem(value.trim());
1000
+ this.click(item);
1001
+ e.target.value = '';
1002
+ }
1003
+ this.stopEvent(e);
1004
+ }
1005
+ moveUp() {
1006
+ this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));
1007
+ }
1008
+ moveDown() {
1009
+ this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));
1010
+ }
1011
+ updateScrollFromOption(option) {
1012
+ if (option) {
1013
+ this.hoveringValue = option.value;
1014
+ const domElement = this.results.find(r => r.nativeElement.innerText.trim() === option.label);
1015
+ if (domElement && this.resultsElement) {
1016
+ this.resultsElement.scrollTop = 0;
1017
+ const listClientRect = this.resultsElement.getBoundingClientRect();
1018
+ const optionClientRect = domElement.nativeElement.getBoundingClientRect();
1019
+ this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;
1020
+ }
1021
+ }
1022
+ }
1023
+ selectByEnter() {
1024
+ if (this.hoveringValue) {
1025
+ const option = Select2Utils.getOptionByValue(this._data, this.hoveringValue);
1026
+ this.select(option);
1027
+ }
1028
+ }
1029
+ _testKey(event, refs = []) {
1030
+ return this._isKey(this._getKey(event), refs);
1031
+ }
1032
+ _getKey(event) {
1033
+ let code;
1034
+ if (event.key !== undefined) {
1035
+ code = event.key;
1036
+ }
1037
+ else if (event['keyIdentifier'] !== undefined) {
1038
+ code = event['keyIdentifier'];
1039
+ }
1040
+ else if (event['keyCode'] !== undefined) {
1041
+ code = event['keyCode'];
1042
+ }
1043
+ else {
1044
+ event.preventDefault();
1045
+ }
1046
+ return code;
1047
+ }
1048
+ _isKey(code, refs = []) {
1049
+ return refs && refs.length > 0 ? refs.indexOf(code) !== -1 : false;
1050
+ }
1051
+ /**
1052
+ * Sets the selected option based on a value. If no option can be
1053
+ * found with the designated value, the select trigger is cleared.
1054
+ */
1055
+ _setSelectionByValue(value) {
1056
+ if (this.option || (value !== undefined && value !== null)) {
1057
+ const isArray = Array.isArray(value);
1058
+ if (this.multiple && value && !isArray) {
1059
+ throw new Error('Non array value.');
1060
+ }
1061
+ else if (this._data) {
1062
+ if (this.multiple) {
1063
+ this.option = []; // if value is null, then empty option and return
1064
+ if (isArray) {
1065
+ // value is not null. Preselect value
1066
+ const selectedValues = Select2Utils.getOptionsByValue(this._data, value, this.multiple);
1067
+ selectedValues.map(item => this.select(item));
1068
+ }
1069
+ }
1070
+ else {
1071
+ this.select(Select2Utils.getOptionByValue(this._data, value));
1072
+ }
1073
+ }
1074
+ else if (this._control) {
1075
+ this._control.viewToModelUpdate(value);
1076
+ }
1077
+ this._changeDetectorRef.markForCheck();
1078
+ }
1079
+ }
1080
+ /** Does some manual dirty checking on the native input `value` property. */
1081
+ _dirtyCheckNativeValue() {
1082
+ const newValue = this.value;
1083
+ if (this._previousNativeValue !== newValue) {
1084
+ this._previousNativeValue = newValue;
1085
+ this._stateChanges.next();
1086
+ }
1087
+ }
1088
+ _focusSearchboxOrResultsElement(focus = true) {
1089
+ if (!this.isSearchboxHidden) {
1090
+ setTimeout(() => {
1091
+ if (this.searchInput && this.searchInput.nativeElement && focus) {
1092
+ this.searchInput.nativeElement.focus();
1093
+ }
1094
+ });
1095
+ }
1096
+ else if (this.resultsElement) {
1097
+ this.resultsElement.focus();
1098
+ }
1099
+ }
1100
+ _focus(state) {
1101
+ if (!state && this.focused) {
1102
+ this.focused = state;
1103
+ this.blur.emit(this);
1104
+ }
1105
+ else if (state && !this.focused) {
1106
+ this.focused = state;
1107
+ this.focus.emit(this);
1108
+ }
1109
+ }
1110
+ _isAbobeOverlay() {
1111
+ return this.overlay && this._overlayPosition && this.listPosition === 'auto'
1112
+ ? this._overlayPosition === 'top'
1113
+ : this.listPosition === 'above';
1114
+ }
1115
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2, deps: [{ token: i1.ViewportRuler }, { token: i0.ChangeDetectorRef }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i2.NgControl, optional: true, self: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }
1116
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.3", type: Select2, selector: "select2", inputs: { data: "data", minCharForSearch: "minCharForSearch", displaySearchStatus: "displaySearchStatus", placeholder: "placeholder", limitSelection: "limitSelection", listPosition: "listPosition", multiple: "multiple", overlay: "overlay", styleMode: "styleMode", noResultMessage: "noResultMessage", maxResults: "maxResults", maxResultsMessage: "maxResultsMessage", infiniteScrollDistance: "infiniteScrollDistance", infiniteScrollThrottle: "infiniteScrollThrottle", infiniteScroll: "infiniteScroll", autoCreate: "autoCreate", noLabelTemplate: "noLabelTemplate", editPattern: "editPattern", templates: "templates", resultMaxHeight: "resultMaxHeight", customSearchEnabled: "customSearchEnabled", minCountForSearch: "minCountForSearch", id: "id", required: "required", disabled: "disabled", hideSelectedItems: "hideSelectedItems", readonly: "readonly", value: "value", tabIndex: "tabIndex", resettable: "resettable" }, outputs: { update: "update", open: "open", close: "close", focus: "focus", blur: "blur", search: "search", scroll: "scroll", removeOption: "removeOption" }, host: { properties: { "id": "this.id", "attr.aria-invalid": "this.ariaInvalid", "class.material": "this.classMaterial", "class.nostyle": "this.classNostyle", "class.select2-above": "this.select2above" } }, viewQueries: [{ propertyName: "cdkConnectedOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true }, { propertyName: "selection", first: true, predicate: ["selection"], descendants: true, static: true }, { propertyName: "resultContainer", first: true, predicate: ["results"], descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "results", predicate: ["result"], descendants: true }], ngImport: i0, template: "<div class=\"select2-label\" (click)=\"toggleOpenAndClose()\">\n <ng-content select=\"select2-label\"></ng-content>\n <span *ngIf=\"required\" class=\"select2-required\"></span>\n</div>\n<div\n class=\"select2 select2-container select2-container--default\"\n [class.select2-container--focus]=\"focused\"\n [class.select2-container--below]=\"!select2above\"\n [class.select2-container--above]=\"select2above\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-container--disabled]=\"disabled\"\n>\n <div\n class=\"selection\"\n #selection\n #trigger=\"cdkOverlayOrigin\"\n [tabindex]=\"!this.isOpen ? tabIndex : '-1'\"\n (click)=\"toggleOpenAndClose()\"\n (focus)=\"focusin()\"\n (blur)=\"focusout()\"\n (keydown)=\"openKey($event)\"\n cdkOverlayOrigin\n [class.select2-focused]=\"focused\"\n >\n <div\n class=\"select2-selection\"\n [class.select2-selection--multiple]=\"multiple\"\n [class.select2-selection--single]=\"!multiple\"\n role=\"combobox\"\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__rendered\" [title]=\"select2Option?.label || ''\">\n <span *ngIf=\"!select2Option\">&nbsp;</span>\n <ng-container *ngIf=\"select2Option\">\n <span\n *ngIf=\"!hasTemplate(select2Option, 'option') || noLabelTemplate; else template\"\n [innerHTML]=\"select2Option.label\"\n ></span>\n <ng-template #template>\n <ng-container *ngTemplateOutlet=\"getTemplate(select2Option, 'option'); context: select2Option\">\n </ng-container>\n </ng-template>\n </ng-container>\n <span [class.select2-selection__placeholder__option]=\"option\" class=\"select2-selection__placeholder\">{{\n placeholder\n }}</span>\n </span>\n <span\n (click)=\"reset($event)\"\n *ngIf=\"!multiple && resettable && select2Option && !(disabled || readonly)\"\n class=\"select2-selection__reset\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__arrow\" role=\"presentation\"> </span>\n <ul *ngIf=\"multiple\" class=\"select2-selection__rendered\">\n <span\n *ngIf=\"!autoCreate\"\n [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\"\n >{{ placeholder }}</span\n >\n <li\n *ngFor=\"let op of option; trackBy: trackBy\"\n class=\"select2-selection__choice\"\n [title]=\"op.label\"\n tabindex=\"0\"\n (keydown.enter)=\"removeSelection($event, op)\"\n >\n <span\n *ngIf=\"!(disabled || readonly)\"\n (click)=\"removeSelection($event, op)\"\n class=\"select2-selection__choice__remove\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span [innerHTML]=\"op.label\"></span>\n </li>\n <li\n *ngIf=\"autoCreate\"\n class=\"select2-selection__auto-create\"\n (focus)=\"stopEvent($event)\"\n (blur)=\"stopEvent($event)\"\n >\n <input\n [id]=\"id + '-create-field'\"\n (click)=\"toggleOpenAndClose(false, true); stopEvent($event)\"\n (keydown)=\"keyDown($event, true)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-create__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n />\n </li>\n </ul>\n </div>\n </div>\n <ng-container *ngIf=\"!overlay\">\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n </ng-container>\n\n <div class=\"select2-subscript-wrapper\">\n <ng-content select=\"select2-hint\"></ng-content>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"select2-overlay-backdrop\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"this.isOpen && overlay\"\n [cdkConnectedOverlayMinWidth]=\"overlayWidth\"\n [cdkConnectedOverlayHeight]=\"overlayHeight\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n (backdropClick)=\"toggleOpenAndClose()\"\n>\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #containerTemplate>\n <div\n class=\"select2-container select2-container--default select2-container-dropdown\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-overlay]=\"overlay\"\n [class.select2-position-auto]=\"listPosition === 'auto'\"\n >\n <div\n #dropdown\n class=\"select2-dropdown\"\n [class.select2-dropdown--below]=\"!select2above\"\n [class.select2-dropdown--above]=\"select2above\"\n >\n <div class=\"select2-search select2-search--dropdown\" [class.select2-search--hide]=\"hideSearch()\">\n <input\n #searchInput\n [id]=\"id + '-search-field'\"\n [value]=\"searchText\"\n (keydown)=\"keyDown($event)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-search__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [attr.tabindex]=\"this.isOpen ? tabIndex : '-1'\"\n />\n </div>\n <div class=\"select2-results\">\n <ul\n #results\n class=\"select2-results__options\"\n [style.max-height]=\"resultMaxHeight\"\n role=\"tree\"\n tabindex=\"-1\"\n infiniteScroll\n [infiniteScrollDisabled]=\"!infiniteScroll && !isOpen\"\n [infiniteScrollDistance]=\"infiniteScrollDistance\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle\"\n [infiniteScrollContainer]=\"results\"\n (scrolled)=\"onScroll('down')\"\n (scrolledUp)=\"onScroll('up')\"\n (keydown)=\"keyDown($event)\"\n >\n <ng-container *ngFor=\"let groupOrOption of filteredData; index as i; trackBy: trackBy\">\n <li *ngIf=\"groupOrOption.options\" class=\"select2-results__option\" role=\"group\">\n <strong\n *ngIf=\"!hasTemplate(groupOrOption, 'group'); else optGroup\"\n [attr.class]=\"\n 'select2-results__group' +\n (groupOrOption.classes ? ' ' + groupOrOption.classes : '')\n \"\n [innerHTML]=\"groupOrOption.label\"\n ></strong>\n <ng-template #optGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'group'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n\n <ul class=\"select2-results__options select2-results__options--nested\">\n <li\n *ngFor=\"let option of groupOrOption.options; index as j; trackBy: trackBy\"\n #result\n [id]=\"option.id || id + '-option-' + i + '-' + j\"\n [class]=\"getOptionStyle(option)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"isDisabled(option)\"\n (mouseenter)=\"mouseenter(option)\"\n (click)=\"click(option)\"\n >\n <div\n *ngIf=\"!hasTemplate(option, 'option'); else liGroup\"\n class=\"select2-label-content\"\n [innerHTML]=\"option.label\"\n ></div>\n <ng-template #liGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(option, 'option'); context: option\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ul>\n </li>\n <li\n *ngIf=\"!groupOrOption.options\"\n #result\n [id]=\"groupOrOption.id || id + '-option-' + i\"\n [class]=\"getOptionStyle(groupOrOption)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(groupOrOption)\"\n [attr.aria-disabled]=\"isDisabled(groupOrOption)\"\n (mouseenter)=\"mouseenter(groupOrOption)\"\n (click)=\"click(groupOrOption)\"\n >\n <div\n *ngIf=\"!hasTemplate(groupOrOption, 'option'); else li\"\n [innerHTML]=\"groupOrOption.label\"\n class=\"select2-label-content\"\n ></div>\n <ng-template #li>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'option'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n <li\n class=\"select2-no-result select2-results__option\"\n *ngIf=\"!filteredData?.length && noResultMessage\"\n [innerHTML]=\"noResultMessage\"\n ></li>\n <li\n class=\"select2-too-much-result select2-results__option\"\n *ngIf=\"maxResultsExceeded\"\n [innerHTML]=\"maxResultsMessage\"\n ></li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:0 0 0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:5px}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\"*\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\" \";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\" \";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\" \";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i4.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: i5.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }] }); }
1117
+ }
1118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2, decorators: [{
1119
+ type: Component,
1120
+ args: [{ selector: 'select2', template: "<div class=\"select2-label\" (click)=\"toggleOpenAndClose()\">\n <ng-content select=\"select2-label\"></ng-content>\n <span *ngIf=\"required\" class=\"select2-required\"></span>\n</div>\n<div\n class=\"select2 select2-container select2-container--default\"\n [class.select2-container--focus]=\"focused\"\n [class.select2-container--below]=\"!select2above\"\n [class.select2-container--above]=\"select2above\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-container--disabled]=\"disabled\"\n>\n <div\n class=\"selection\"\n #selection\n #trigger=\"cdkOverlayOrigin\"\n [tabindex]=\"!this.isOpen ? tabIndex : '-1'\"\n (click)=\"toggleOpenAndClose()\"\n (focus)=\"focusin()\"\n (blur)=\"focusout()\"\n (keydown)=\"openKey($event)\"\n cdkOverlayOrigin\n [class.select2-focused]=\"focused\"\n >\n <div\n class=\"select2-selection\"\n [class.select2-selection--multiple]=\"multiple\"\n [class.select2-selection--single]=\"!multiple\"\n role=\"combobox\"\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__rendered\" [title]=\"select2Option?.label || ''\">\n <span *ngIf=\"!select2Option\">&nbsp;</span>\n <ng-container *ngIf=\"select2Option\">\n <span\n *ngIf=\"!hasTemplate(select2Option, 'option') || noLabelTemplate; else template\"\n [innerHTML]=\"select2Option.label\"\n ></span>\n <ng-template #template>\n <ng-container *ngTemplateOutlet=\"getTemplate(select2Option, 'option'); context: select2Option\">\n </ng-container>\n </ng-template>\n </ng-container>\n <span [class.select2-selection__placeholder__option]=\"option\" class=\"select2-selection__placeholder\">{{\n placeholder\n }}</span>\n </span>\n <span\n (click)=\"reset($event)\"\n *ngIf=\"!multiple && resettable && select2Option && !(disabled || readonly)\"\n class=\"select2-selection__reset\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span *ngIf=\"!multiple\" class=\"select2-selection__arrow\" role=\"presentation\"> </span>\n <ul *ngIf=\"multiple\" class=\"select2-selection__rendered\">\n <span\n *ngIf=\"!autoCreate\"\n [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\"\n >{{ placeholder }}</span\n >\n <li\n *ngFor=\"let op of option; trackBy: trackBy\"\n class=\"select2-selection__choice\"\n [title]=\"op.label\"\n tabindex=\"0\"\n (keydown.enter)=\"removeSelection($event, op)\"\n >\n <span\n *ngIf=\"!(disabled || readonly)\"\n (click)=\"removeSelection($event, op)\"\n class=\"select2-selection__choice__remove\"\n role=\"presentation\"\n >\u00D7</span\n >\n <span [innerHTML]=\"op.label\"></span>\n </li>\n <li\n *ngIf=\"autoCreate\"\n class=\"select2-selection__auto-create\"\n (focus)=\"stopEvent($event)\"\n (blur)=\"stopEvent($event)\"\n >\n <input\n [id]=\"id + '-create-field'\"\n (click)=\"toggleOpenAndClose(false, true); stopEvent($event)\"\n (keydown)=\"keyDown($event, true)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-create__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n />\n </li>\n </ul>\n </div>\n </div>\n <ng-container *ngIf=\"!overlay\">\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n </ng-container>\n\n <div class=\"select2-subscript-wrapper\">\n <ng-content select=\"select2-hint\"></ng-content>\n </div>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"select2-overlay-backdrop\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"this.isOpen && overlay\"\n [cdkConnectedOverlayMinWidth]=\"overlayWidth\"\n [cdkConnectedOverlayHeight]=\"overlayHeight\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n (backdropClick)=\"toggleOpenAndClose()\"\n>\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #containerTemplate>\n <div\n class=\"select2-container select2-container--default select2-container-dropdown\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-overlay]=\"overlay\"\n [class.select2-position-auto]=\"listPosition === 'auto'\"\n >\n <div\n #dropdown\n class=\"select2-dropdown\"\n [class.select2-dropdown--below]=\"!select2above\"\n [class.select2-dropdown--above]=\"select2above\"\n >\n <div class=\"select2-search select2-search--dropdown\" [class.select2-search--hide]=\"hideSearch()\">\n <input\n #searchInput\n [id]=\"id + '-search-field'\"\n [value]=\"searchText\"\n (keydown)=\"keyDown($event)\"\n (keyup)=\"searchUpdate($event)\"\n (change)=\"prevChange($event)\"\n class=\"select2-search__field\"\n type=\"search\"\n role=\"textbox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [attr.tabindex]=\"this.isOpen ? tabIndex : '-1'\"\n />\n </div>\n <div class=\"select2-results\">\n <ul\n #results\n class=\"select2-results__options\"\n [style.max-height]=\"resultMaxHeight\"\n role=\"tree\"\n tabindex=\"-1\"\n infiniteScroll\n [infiniteScrollDisabled]=\"!infiniteScroll && !isOpen\"\n [infiniteScrollDistance]=\"infiniteScrollDistance\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle\"\n [infiniteScrollContainer]=\"results\"\n (scrolled)=\"onScroll('down')\"\n (scrolledUp)=\"onScroll('up')\"\n (keydown)=\"keyDown($event)\"\n >\n <ng-container *ngFor=\"let groupOrOption of filteredData; index as i; trackBy: trackBy\">\n <li *ngIf=\"groupOrOption.options\" class=\"select2-results__option\" role=\"group\">\n <strong\n *ngIf=\"!hasTemplate(groupOrOption, 'group'); else optGroup\"\n [attr.class]=\"\n 'select2-results__group' +\n (groupOrOption.classes ? ' ' + groupOrOption.classes : '')\n \"\n [innerHTML]=\"groupOrOption.label\"\n ></strong>\n <ng-template #optGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'group'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n\n <ul class=\"select2-results__options select2-results__options--nested\">\n <li\n *ngFor=\"let option of groupOrOption.options; index as j; trackBy: trackBy\"\n #result\n [id]=\"option.id || id + '-option-' + i + '-' + j\"\n [class]=\"getOptionStyle(option)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"isDisabled(option)\"\n (mouseenter)=\"mouseenter(option)\"\n (click)=\"click(option)\"\n >\n <div\n *ngIf=\"!hasTemplate(option, 'option'); else liGroup\"\n class=\"select2-label-content\"\n [innerHTML]=\"option.label\"\n ></div>\n <ng-template #liGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(option, 'option'); context: option\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ul>\n </li>\n <li\n *ngIf=\"!groupOrOption.options\"\n #result\n [id]=\"groupOrOption.id || id + '-option-' + i\"\n [class]=\"getOptionStyle(groupOrOption)\"\n role=\"treeitem\"\n [attr.aria-selected]=\"isSelected(groupOrOption)\"\n [attr.aria-disabled]=\"isDisabled(groupOrOption)\"\n (mouseenter)=\"mouseenter(groupOrOption)\"\n (click)=\"click(groupOrOption)\"\n >\n <div\n *ngIf=\"!hasTemplate(groupOrOption, 'option'); else li\"\n [innerHTML]=\"groupOrOption.label\"\n class=\"select2-label-content\"\n ></div>\n <ng-template #li>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'option'); context: groupOrOption\"\n >\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n <li\n class=\"select2-no-result select2-results__option\"\n *ngIf=\"!filteredData?.length && noResultMessage\"\n [innerHTML]=\"noResultMessage\"\n ></li>\n <li\n class=\"select2-too-much-result select2-results__option\"\n *ngIf=\"maxResultsExceeded\"\n [innerHTML]=\"maxResultsMessage\"\n ></li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:0 0 0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:5px}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\"*\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\" \";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\" \";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\" \";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\n"] }]
1121
+ }], ctorParameters: function () { return [{ type: i1.ViewportRuler }, { type: i0.ChangeDetectorRef }, { type: i2.NgForm, decorators: [{
1122
+ type: Optional
1123
+ }] }, { type: i2.FormGroupDirective, decorators: [{
1124
+ type: Optional
1125
+ }] }, { type: i2.NgControl, decorators: [{
1126
+ type: Self
1127
+ }, {
1128
+ type: Optional
1129
+ }] }, { type: undefined, decorators: [{
1130
+ type: Attribute,
1131
+ args: ['tabindex']
1132
+ }] }]; }, propDecorators: { data: [{
1133
+ type: Input,
1134
+ args: [{ required: true }]
1135
+ }], minCharForSearch: [{
1136
+ type: Input
1137
+ }], displaySearchStatus: [{
1138
+ type: Input
1139
+ }], placeholder: [{
1140
+ type: Input
1141
+ }], limitSelection: [{
1142
+ type: Input
1143
+ }], listPosition: [{
1144
+ type: Input
1145
+ }], multiple: [{
1146
+ type: Input
1147
+ }], overlay: [{
1148
+ type: Input
1149
+ }], styleMode: [{
1150
+ type: Input
1151
+ }], noResultMessage: [{
1152
+ type: Input
1153
+ }], maxResults: [{
1154
+ type: Input
1155
+ }], maxResultsMessage: [{
1156
+ type: Input
1157
+ }], infiniteScrollDistance: [{
1158
+ type: Input
1159
+ }], infiniteScrollThrottle: [{
1160
+ type: Input
1161
+ }], infiniteScroll: [{
1162
+ type: Input
1163
+ }], autoCreate: [{
1164
+ type: Input
1165
+ }], noLabelTemplate: [{
1166
+ type: Input
1167
+ }], editPattern: [{
1168
+ type: Input
1169
+ }], templates: [{
1170
+ type: Input
1171
+ }], resultMaxHeight: [{
1172
+ type: Input
1173
+ }], update: [{
1174
+ type: Output
1175
+ }], open: [{
1176
+ type: Output
1177
+ }], close: [{
1178
+ type: Output
1179
+ }], focus: [{
1180
+ type: Output
1181
+ }], blur: [{
1182
+ type: Output
1183
+ }], search: [{
1184
+ type: Output
1185
+ }], scroll: [{
1186
+ type: Output
1187
+ }], removeOption: [{
1188
+ type: Output
1189
+ }], customSearchEnabled: [{
1190
+ type: Input
1191
+ }], minCountForSearch: [{
1192
+ type: Input
1193
+ }], id: [{
1194
+ type: Input
1195
+ }, {
1196
+ type: HostBinding,
1197
+ args: ['id']
1198
+ }], required: [{
1199
+ type: Input
1200
+ }], disabled: [{
1201
+ type: Input
1202
+ }], hideSelectedItems: [{
1203
+ type: Input
1204
+ }], readonly: [{
1205
+ type: Input
1206
+ }], value: [{
1207
+ type: Input
1208
+ }], tabIndex: [{
1209
+ type: Input
1210
+ }], resettable: [{
1211
+ type: Input
1212
+ }], ariaInvalid: [{
1213
+ type: HostBinding,
1214
+ args: ['attr.aria-invalid']
1215
+ }], classMaterial: [{
1216
+ type: HostBinding,
1217
+ args: ['class.material']
1218
+ }], classNostyle: [{
1219
+ type: HostBinding,
1220
+ args: ['class.nostyle']
1221
+ }], select2above: [{
1222
+ type: HostBinding,
1223
+ args: ['class.select2-above']
1224
+ }], cdkConnectedOverlay: [{
1225
+ type: ViewChild,
1226
+ args: [CdkConnectedOverlay]
1227
+ }], selection: [{
1228
+ type: ViewChild,
1229
+ args: ['selection', { static: true }]
1230
+ }], resultContainer: [{
1231
+ type: ViewChild,
1232
+ args: ['results']
1233
+ }], results: [{
1234
+ type: ViewChildren,
1235
+ args: ['result']
1236
+ }], searchInput: [{
1237
+ type: ViewChild,
1238
+ args: ['searchInput']
1239
+ }], dropdown: [{
1240
+ type: ViewChild,
1241
+ args: ['dropdown']
1228
1242
  }] } });
1229
1243
 
1230
- class Select2Hint {
1231
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Hint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1232
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.4", type: Select2Hint, selector: "select2-hint", ngImport: i0 }); }
1233
- }
1234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Hint, decorators: [{
1235
- type: Directive,
1236
- args: [{ selector: 'select2-hint' }]
1244
+ class Select2Hint {
1245
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Hint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1246
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.3", type: Select2Hint, selector: "select2-hint", ngImport: i0 }); }
1247
+ }
1248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Hint, decorators: [{
1249
+ type: Directive,
1250
+ args: [{ selector: 'select2-hint' }]
1237
1251
  }] });
1238
1252
 
1239
- class Select2Label {
1240
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Label, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1241
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.4", type: Select2Label, selector: "select2-label", ngImport: i0 }); }
1242
- }
1243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Label, decorators: [{
1244
- type: Directive,
1245
- args: [{ selector: 'select2-label' }]
1253
+ class Select2Label {
1254
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Label, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1255
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.3", type: Select2Label, selector: "select2-label", ngImport: i0 }); }
1256
+ }
1257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Label, decorators: [{
1258
+ type: Directive,
1259
+ args: [{ selector: 'select2-label' }]
1246
1260
  }] });
1247
1261
 
1248
- class Select2Module {
1249
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1250
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.4", ngImport: i0, type: Select2Module, declarations: [Select2Hint, Select2Label, Select2], imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule], exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2] }); }
1251
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Module, imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule, FormsModule, ReactiveFormsModule] }); }
1252
- }
1253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.4", ngImport: i0, type: Select2Module, decorators: [{
1254
- type: NgModule,
1255
- args: [{
1256
- imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule],
1257
- declarations: [Select2Hint, Select2Label, Select2],
1258
- exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2],
1259
- }]
1262
+ class Select2Module {
1263
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1264
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.3", ngImport: i0, type: Select2Module, declarations: [Select2Hint, Select2Label, Select2], imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule], exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2] }); }
1265
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Module, imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule, FormsModule, ReactiveFormsModule] }); }
1266
+ }
1267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: Select2Module, decorators: [{
1268
+ type: NgModule,
1269
+ args: [{
1270
+ imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule],
1271
+ declarations: [Select2Hint, Select2Label, Select2],
1272
+ exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2],
1273
+ }]
1260
1274
  }] });
1261
1275
 
1262
- /*
1263
- * Public API Surface of ng-select2-component
1276
+ /*
1277
+ * Public API Surface of ng-select2-component
1264
1278
  */
1265
1279
 
1266
- /**
1267
- * Generated bundle index. Do not edit.
1280
+ /**
1281
+ * Generated bundle index. Do not edit.
1268
1282
  */
1269
1283
 
1270
1284
  export { Select2, Select2Hint, Select2Label, Select2Module, Select2Utils, defaultMinCountForSearch, protectRegexp, timeout, unicodePatterns };