ng-select2-component 8.0.2 → 8.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2027 +1,2129 @@
1
+ import { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
1
2
  import { ViewportRuler } from '@angular/cdk/scrolling';
2
3
  import { EventEmitter, TemplateRef, Component, ChangeDetectorRef, Optional, Self, Attribute, Input, Output, HostBinding, ViewChild, ViewChildren, Directive, NgModule } from '@angular/core';
3
4
  import { NgForm, FormGroupDirective, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
4
5
  import { Subject } from 'rxjs';
5
- import { OverlayModule } from '@angular/cdk/overlay';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { InfiniteScrollModule } from 'ngx-infinite-scroll';
8
8
 
9
- /**
10
- * @fileoverview added by tsickle
11
- * Generated from: lib/select2-interfaces.ts
12
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
- */
14
- /**
15
- * @record
16
- */
17
- function Select2Group() { }
18
- if (false) {
19
- /**
20
- * label of group
21
- * @type {?}
22
- */
23
- Select2Group.prototype.label;
24
- /**
25
- * options list
26
- * @type {?}
27
- */
28
- Select2Group.prototype.options;
29
- /**
30
- * add classes
31
- * @type {?|undefined}
32
- */
33
- Select2Group.prototype.classes;
34
- /**
35
- * template id
36
- * @type {?|undefined}
37
- */
38
- Select2Group.prototype.templateId;
39
- /**
40
- * template data
41
- * @type {?|undefined}
42
- */
43
- Select2Group.prototype.data;
44
- }
45
- /**
46
- * @record
47
- */
48
- function Select2Option() { }
49
- if (false) {
50
- /**
51
- * value
52
- * @type {?}
53
- */
54
- Select2Option.prototype.value;
55
- /**
56
- * label of option
57
- * @type {?}
58
- */
59
- Select2Option.prototype.label;
60
- /**
61
- * no selectable is disabled
62
- * @type {?|undefined}
63
- */
64
- Select2Option.prototype.disabled;
65
- /**
66
- * for identification
67
- * @type {?|undefined}
68
- */
69
- Select2Option.prototype.id;
70
- /**
71
- * add classes
72
- * @type {?|undefined}
73
- */
74
- Select2Option.prototype.classes;
75
- /**
76
- * template id
77
- * @type {?|undefined}
78
- */
79
- Select2Option.prototype.templateId;
80
- /**
81
- * template data
82
- * @type {?|undefined}
83
- */
84
- Select2Option.prototype.data;
85
- /**
86
- * hide this option
87
- * @type {?|undefined}
88
- */
89
- Select2Option.prototype.hide;
90
- }
91
- /**
92
- * @record
93
- * @template U
94
- */
95
- function Select2UpdateEvent() { }
96
- if (false) {
97
- /** @type {?} */
98
- Select2UpdateEvent.prototype.component;
99
- /** @type {?} */
100
- Select2UpdateEvent.prototype.value;
101
- /** @type {?} */
102
- Select2UpdateEvent.prototype.options;
103
- }
104
- /**
105
- * @record
106
- * @template U
107
- */
108
- function Select2SearchEvent() { }
109
- if (false) {
110
- /** @type {?} */
111
- Select2SearchEvent.prototype.component;
112
- /** @type {?} */
113
- Select2SearchEvent.prototype.value;
114
- /** @type {?} */
115
- Select2SearchEvent.prototype.search;
116
- }
117
- /**
118
- * @record
119
- * @template U
120
- */
121
- function Select2RemoveEvent() { }
122
- if (false) {
123
- /** @type {?} */
124
- Select2RemoveEvent.prototype.component;
125
- /** @type {?} */
126
- Select2RemoveEvent.prototype.value;
127
- /** @type {?} */
128
- Select2RemoveEvent.prototype.removedOption;
129
- }
130
- /**
131
- * @record
132
- */
133
- function Select2ScrollEvent() { }
134
- if (false) {
135
- /** @type {?} */
136
- Select2ScrollEvent.prototype.component;
137
- /** @type {?} */
138
- Select2ScrollEvent.prototype.way;
139
- /** @type {?} */
140
- Select2ScrollEvent.prototype.search;
9
+ /**
10
+ * @fileoverview added by tsickle
11
+ * Generated from: lib/select2-interfaces.ts
12
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
+ */
14
+ /**
15
+ * @record
16
+ */
17
+ function Select2Group() { }
18
+ if (false) {
19
+ /**
20
+ * label of group
21
+ * @type {?}
22
+ */
23
+ Select2Group.prototype.label;
24
+ /**
25
+ * options list
26
+ * @type {?}
27
+ */
28
+ Select2Group.prototype.options;
29
+ /**
30
+ * add classes
31
+ * @type {?|undefined}
32
+ */
33
+ Select2Group.prototype.classes;
34
+ /**
35
+ * template id
36
+ * @type {?|undefined}
37
+ */
38
+ Select2Group.prototype.templateId;
39
+ /**
40
+ * template data
41
+ * @type {?|undefined}
42
+ */
43
+ Select2Group.prototype.data;
44
+ }
45
+ /**
46
+ * @record
47
+ */
48
+ function Select2Option() { }
49
+ if (false) {
50
+ /**
51
+ * value
52
+ * @type {?}
53
+ */
54
+ Select2Option.prototype.value;
55
+ /**
56
+ * label of option
57
+ * @type {?}
58
+ */
59
+ Select2Option.prototype.label;
60
+ /**
61
+ * no selectable is disabled
62
+ * @type {?|undefined}
63
+ */
64
+ Select2Option.prototype.disabled;
65
+ /**
66
+ * for identification
67
+ * @type {?|undefined}
68
+ */
69
+ Select2Option.prototype.id;
70
+ /**
71
+ * add classes
72
+ * @type {?|undefined}
73
+ */
74
+ Select2Option.prototype.classes;
75
+ /**
76
+ * template id
77
+ * @type {?|undefined}
78
+ */
79
+ Select2Option.prototype.templateId;
80
+ /**
81
+ * template data
82
+ * @type {?|undefined}
83
+ */
84
+ Select2Option.prototype.data;
85
+ /**
86
+ * hide this option
87
+ * @type {?|undefined}
88
+ */
89
+ Select2Option.prototype.hide;
90
+ }
91
+ /**
92
+ * @record
93
+ * @template U
94
+ */
95
+ function Select2UpdateEvent() { }
96
+ if (false) {
97
+ /** @type {?} */
98
+ Select2UpdateEvent.prototype.component;
99
+ /** @type {?} */
100
+ Select2UpdateEvent.prototype.value;
101
+ /** @type {?} */
102
+ Select2UpdateEvent.prototype.options;
103
+ }
104
+ /**
105
+ * @record
106
+ * @template U
107
+ */
108
+ function Select2SearchEvent() { }
109
+ if (false) {
110
+ /** @type {?} */
111
+ Select2SearchEvent.prototype.component;
112
+ /** @type {?} */
113
+ Select2SearchEvent.prototype.value;
114
+ /** @type {?} */
115
+ Select2SearchEvent.prototype.search;
116
+ }
117
+ /**
118
+ * @record
119
+ * @template U
120
+ */
121
+ function Select2RemoveEvent() { }
122
+ if (false) {
123
+ /** @type {?} */
124
+ Select2RemoveEvent.prototype.component;
125
+ /** @type {?} */
126
+ Select2RemoveEvent.prototype.value;
127
+ /** @type {?} */
128
+ Select2RemoveEvent.prototype.removedOption;
129
+ }
130
+ /**
131
+ * @record
132
+ */
133
+ function Select2ScrollEvent() { }
134
+ if (false) {
135
+ /** @type {?} */
136
+ Select2ScrollEvent.prototype.component;
137
+ /** @type {?} */
138
+ Select2ScrollEvent.prototype.way;
139
+ /** @type {?} */
140
+ Select2ScrollEvent.prototype.search;
141
141
  }
142
142
 
143
- /**
144
- * @fileoverview added by tsickle
145
- * Generated from: lib/select2-const.ts
146
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
147
- */
148
- /** @type {?} */
149
- const timeout = 200;
150
- /** @type {?} */
151
- const unicodePatterns = [
152
- { l: 'a', s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi },
153
- { l: 'aa', s: /ꜳ/gi },
154
- { l: 'ae', s: /[æǽǣ]/gi },
155
- { l: 'ao', s: /ꜵ/gi },
156
- { l: 'au', s: /ꜷ/gi },
157
- { l: 'av', s: /[ꜹꜻ]/gi },
158
- { l: 'ay', s: /ꜽ/gi },
159
- { l: 'b', s: /[ⓑbḃḅḇƀƃɓ]/gi },
160
- { l: 'c', s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi },
161
- { l: 'd', s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi },
162
- { l: 'dz', s: /[dzdž]/gi },
163
- { l: 'e', s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi },
164
- { l: 'f', s: /[ⓕfḟƒꝼ]/gi },
165
- { l: 'g', s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi },
166
- { l: 'h', s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi },
167
- { l: 'hv', s: /ƕ/gi },
168
- { l: 'i', s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi },
169
- { l: 'j', s: /[ⓙjĵǰɉ]/gi },
170
- { l: 'k', s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi },
171
- { l: 'l', s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi },
172
- { l: 'lj', s: /lj/gi },
173
- { l: 'm', s: /[ⓜmḿṁṃɱɯ]/gi },
174
- { l: 'n', s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi },
175
- { l: 'nj', s: /nj/gi },
176
- { l: 'o', s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi },
177
- { l: 'oi', s: /ƣ/gi },
178
- { l: 'oe', s: /œ/gi },
179
- { l: 'oo', s: /ꝏ/gi },
180
- { l: 'ou', s: /ȣ/gi },
181
- { l: 'p', s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi },
182
- { l: 'q', s: /[ⓠqɋꝗꝙ]/gi },
183
- { l: 'r', s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi },
184
- { l: 's', s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi },
185
- { l: 't', s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi },
186
- { l: 'tz', s: /ꜩ/gi },
187
- { l: 'u', s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi },
188
- { l: 'v', s: /[ⓥvṽṿʋꝟʌ]/gi },
189
- { l: 'vy', s: /ꝡ/gi },
190
- { l: 'w', s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi },
191
- { l: 'x', s: /[ⓧxẋẍ]/gi },
192
- { l: 'y', s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi },
193
- { l: 'z', s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi }
194
- ];
195
- /** @type {?} */
196
- const defaultMinCountForSearch = 6;
197
- /** @type {?} */
143
+ /**
144
+ * @fileoverview added by tsickle
145
+ * Generated from: lib/select2-const.ts
146
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
147
+ */
148
+ /** @type {?} */
149
+ const timeout = 200;
150
+ /** @type {?} */
151
+ const unicodePatterns = [
152
+ { l: 'a', s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi },
153
+ { l: 'aa', s: /ꜳ/gi },
154
+ { l: 'ae', s: /[æǽǣ]/gi },
155
+ { l: 'ao', s: /ꜵ/gi },
156
+ { l: 'au', s: /ꜷ/gi },
157
+ { l: 'av', s: /[ꜹꜻ]/gi },
158
+ { l: 'ay', s: /ꜽ/gi },
159
+ { l: 'b', s: /[ⓑbḃḅḇƀƃɓ]/gi },
160
+ { l: 'c', s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi },
161
+ { l: 'd', s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi },
162
+ { l: 'dz', s: /[dzdž]/gi },
163
+ { l: 'e', s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi },
164
+ { l: 'f', s: /[ⓕfḟƒꝼ]/gi },
165
+ { l: 'g', s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi },
166
+ { l: 'h', s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi },
167
+ { l: 'hv', s: /ƕ/gi },
168
+ { l: 'i', s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi },
169
+ { l: 'j', s: /[ⓙjĵǰɉ]/gi },
170
+ { l: 'k', s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi },
171
+ { l: 'l', s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi },
172
+ { l: 'lj', s: /lj/gi },
173
+ { l: 'm', s: /[ⓜmḿṁṃɱɯ]/gi },
174
+ { l: 'n', s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi },
175
+ { l: 'nj', s: /nj/gi },
176
+ { l: 'o', s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi },
177
+ { l: 'oi', s: /ƣ/gi },
178
+ { l: 'oe', s: /œ/gi },
179
+ { l: 'oo', s: /ꝏ/gi },
180
+ { l: 'ou', s: /ȣ/gi },
181
+ { l: 'p', s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi },
182
+ { l: 'q', s: /[ⓠqɋꝗꝙ]/gi },
183
+ { l: 'r', s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi },
184
+ { l: 's', s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi },
185
+ { l: 't', s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi },
186
+ { l: 'tz', s: /ꜩ/gi },
187
+ { l: 'u', s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi },
188
+ { l: 'v', s: /[ⓥvṽṿʋꝟʌ]/gi },
189
+ { l: 'vy', s: /ꝡ/gi },
190
+ { l: 'w', s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi },
191
+ { l: 'x', s: /[ⓧxẋẍ]/gi },
192
+ { l: 'y', s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi },
193
+ { l: 'z', s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi },
194
+ ];
195
+ /** @type {?} */
196
+ const defaultMinCountForSearch = 6;
197
+ /** @type {?} */
198
198
  const protectRegexp = new RegExp('[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]', 'g');
199
199
 
200
- /**
201
- * @fileoverview added by tsickle
202
- * Generated from: lib/select2-utils.ts
203
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
204
- */
205
- class Select2Utils {
206
- /**
207
- * @param {?} data
208
- * @param {?} value
209
- * @return {?}
210
- */
211
- static getOptionByValue(data, value) {
212
- if (Array.isArray(data)) {
213
- for (const groupOrOption of data) {
214
- /** @type {?} */
215
- const options = ((/** @type {?} */ (groupOrOption))).options;
216
- if (options) {
217
- for (const option of options) {
218
- if (option.value === value) {
219
- return option;
220
- }
221
- }
222
- }
223
- else {
224
- if (((/** @type {?} */ (groupOrOption))).value === value) {
225
- return (/** @type {?} */ (groupOrOption));
226
- }
227
- }
228
- }
229
- }
230
- return null;
231
- }
232
- /**
233
- * @param {?} data
234
- * @param {?} value
235
- * @param {?} multiple
236
- * @return {?}
237
- */
238
- static getOptionsByValue(data, value, multiple) {
239
- if (multiple) {
240
- /** @type {?} */
241
- const values = Array.isArray(value) ? value : [];
242
- /** @type {?} */
243
- const result = [];
244
- for (const v of values) {
245
- /** @type {?} */
246
- const option = Select2Utils.getOptionByValue(data, v);
247
- if (option) {
248
- result.push(option);
249
- }
250
- }
251
- return result;
252
- }
253
- return Select2Utils.getOptionByValue(data, (/** @type {?} */ (value)));
254
- }
255
- /**
256
- * @param {?} data
257
- * @return {?}
258
- */
259
- static getFirstAvailableOption(data) {
260
- if (Array.isArray(data)) {
261
- for (const groupOrOption of data) {
262
- /** @type {?} */
263
- const options = ((/** @type {?} */ (groupOrOption))).options;
264
- if (options) {
265
- for (const option of options) {
266
- if (!option.disabled) {
267
- return option.value;
268
- }
269
- }
270
- }
271
- else {
272
- /** @type {?} */
273
- const option = (/** @type {?} */ (groupOrOption));
274
- if (!option.disabled) {
275
- return option.value;
276
- }
277
- }
278
- }
279
- }
280
- return null;
281
- }
282
- /**
283
- * @private
284
- * @param {?} data
285
- * @return {?}
286
- */
287
- static getOptionsCount(data) {
288
- /** @type {?} */
289
- let count = 0;
290
- if (Array.isArray(data)) {
291
- for (const groupOrOption of data) {
292
- /** @type {?} */
293
- const options = ((/** @type {?} */ (groupOrOption))).options;
294
- if (options) {
295
- count += options.length;
296
- }
297
- else {
298
- count++;
299
- }
300
- }
301
- }
302
- return count;
303
- }
304
- /**
305
- * @param {?} filteredData
306
- * @param {?} value
307
- * @return {?}
308
- */
309
- static valueIsNotInFilteredData(filteredData, value) {
310
- if (Select2Utils.isNullOrUndefined(value)) {
311
- return true;
312
- }
313
- for (const groupOrOption of filteredData) {
314
- /** @type {?} */
315
- const options = ((/** @type {?} */ (groupOrOption))).options;
316
- if (options) {
317
- for (const option of options) {
318
- if (option.value === value) {
319
- return false;
320
- }
321
- }
322
- }
323
- else {
324
- if (((/** @type {?} */ (groupOrOption))).value === value) {
325
- return false;
326
- }
327
- }
328
- }
329
- return true;
330
- }
331
- // tslint:disable-next-line:cognitive-complexity
332
- /**
333
- * @param {?} filteredData
334
- * @param {?} hoveringValue
335
- * @return {?}
336
- */
337
- static getPreviousOption(filteredData, hoveringValue) {
338
- /** @type {?} */
339
- let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
340
- for (let i = filteredData.length - 1; i >= 0; i--) {
341
- /** @type {?} */
342
- const groupOrOption = filteredData[i];
343
- /** @type {?} */
344
- const options = ((/** @type {?} */ (groupOrOption))).options;
345
- if (options) {
346
- for (let j = options.length - 1; j >= 0; j--) {
347
- /** @type {?} */
348
- const option = options[j];
349
- if (findIt) {
350
- if (!option.disabled && !option.hide) {
351
- return option;
352
- }
353
- }
354
- if (!findIt) {
355
- findIt = option.value === hoveringValue;
356
- }
357
- }
358
- }
359
- else {
360
- /** @type {?} */
361
- const option = (/** @type {?} */ (groupOrOption));
362
- if (findIt) {
363
- if (!option.disabled && !option.hide) {
364
- return option;
365
- }
366
- }
367
- if (!findIt) {
368
- findIt = option.value === hoveringValue;
369
- }
370
- }
371
- }
372
- return null;
373
- }
374
- // tslint:disable-next-line:cognitive-complexity
375
- /**
376
- * @param {?} filteredData
377
- * @param {?} hoveringValue
378
- * @return {?}
379
- */
380
- static getNextOption(filteredData, hoveringValue) {
381
- /** @type {?} */
382
- let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
383
- for (const groupOrOption of filteredData) {
384
- /** @type {?} */
385
- const options = ((/** @type {?} */ (groupOrOption))).options;
386
- if (options) {
387
- for (const option of options) {
388
- if (findIt) {
389
- if (!option.disabled && !option.hide) {
390
- return option;
391
- }
392
- }
393
- else if (!findIt) {
394
- findIt = option.value === hoveringValue;
395
- }
396
- }
397
- }
398
- else {
399
- /** @type {?} */
400
- const option = (/** @type {?} */ (groupOrOption));
401
- if (findIt) {
402
- if (!option.disabled && !option.hide) {
403
- return option;
404
- }
405
- }
406
- else if (!findIt) {
407
- findIt = option.value === hoveringValue;
408
- }
409
- }
410
- }
411
- return null;
412
- }
413
- /**
414
- * @private
415
- * @param {?} value
416
- * @return {?}
417
- */
418
- static isNullOrUndefined(value) {
419
- return value === null || value === undefined;
420
- }
421
- /**
422
- * @private
423
- * @param {?} label
424
- * @param {?} searchText
425
- * @param {?} editPattern
426
- * @return {?}
427
- */
428
- static containSearchText(label, searchText, editPattern) {
429
- return searchText
430
- ? Select2Utils
431
- .formatSansUnicode(label)
432
- .match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null
433
- : true;
434
- }
435
- /**
436
- * @private
437
- * @param {?} str
438
- * @return {?}
439
- */
440
- static protectPattern(str) {
441
- return str.replace(protectRegexp, '\\$&');
442
- }
443
- /**
444
- * @private
445
- * @param {?} str
446
- * @return {?}
447
- */
448
- static formatSansUnicode(str) {
449
- for (const unicodePattern of unicodePatterns) {
450
- str = str.replace(unicodePattern.s, unicodePattern.l);
451
- }
452
- return str;
453
- }
454
- /**
455
- * @private
456
- * @param {?} str
457
- * @param {?} editPattern
458
- * @return {?}
459
- */
460
- static formatPattern(str, editPattern) {
461
- str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));
462
- if (editPattern && typeof editPattern === 'function') {
463
- str = editPattern(str);
464
- }
465
- return str;
466
- }
467
- /**
468
- * @param {?} data
469
- * @param {?} searchText
470
- * @param {?=} editPattern
471
- * @return {?}
472
- */
473
- static getFilteredData(data, searchText, editPattern) {
474
- if (searchText) {
475
- /** @type {?} */
476
- const result = [];
477
- for (const groupOrOption of data) {
478
- /** @type {?} */
479
- const options = ((/** @type {?} */ (groupOrOption))).options;
480
- if (options) {
481
- if (options.some((/**
482
- * @param {?} group
483
- * @return {?}
484
- */
485
- group => Select2Utils.containSearchText(group.label, searchText, editPattern)))) {
486
- /** @type {?} */
487
- const filteredOptions = options.filter((/**
488
- * @param {?} group
489
- * @return {?}
490
- */
491
- group => Select2Utils.containSearchText(group.label, searchText, editPattern)));
492
- result.push({
493
- label: groupOrOption.label,
494
- options: filteredOptions
495
- });
496
- }
497
- }
498
- else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {
499
- result.push(groupOrOption);
500
- }
501
- }
502
- return result;
503
- }
504
- else {
505
- return data;
506
- }
507
- }
508
- /**
509
- * @param {?} data
510
- * @param {?} selectedOptions
511
- * @return {?}
512
- */
513
- static getFilteredSelectedData(data, selectedOptions) {
514
- /** @type {?} */
515
- const result = [];
516
- for (const groupOrOption of data) {
517
- /** @type {?} */
518
- const options = ((/** @type {?} */ (groupOrOption))).options;
519
- if (options) {
520
- /** @type {?} */
521
- const filteredOptions = options.filter((/**
522
- * @param {?} group
523
- * @return {?}
524
- */
525
- group => Select2Utils.isSelected(selectedOptions, group, true) === 'false'));
526
- if (filteredOptions.length) {
527
- result.push({
528
- label: groupOrOption.label,
529
- options: filteredOptions
530
- });
531
- }
532
- }
533
- else if (Select2Utils.isSelected(selectedOptions, (/** @type {?} */ (groupOrOption)), true) === 'false') {
534
- result.push(groupOrOption);
535
- }
536
- }
537
- return result;
538
- }
539
- /**
540
- * @param {?} data
541
- * @param {?=} minCountForSearch
542
- * @return {?}
543
- */
544
- static isSearchboxHiddex(data, minCountForSearch) {
545
- if (minCountForSearch === '' || minCountForSearch === undefined || minCountForSearch === null || isNaN(+minCountForSearch)) {
546
- minCountForSearch = defaultMinCountForSearch;
547
- }
548
- /** @type {?} */
549
- const optionCount = Select2Utils.getOptionsCount(data);
550
- return optionCount < +minCountForSearch;
551
- }
552
- /**
553
- * @param {?} options
554
- * @param {?} option
555
- * @param {?} multiple
556
- * @return {?}
557
- */
558
- static isSelected(options, option, multiple) {
559
- return multiple
560
- ? options && ((/** @type {?} */ (options)))
561
- .some((/**
562
- * @param {?} op
563
- * @return {?}
564
- */
565
- op => op.value === option.value)) ? 'true' : 'false'
566
- : options && option.value === ((/** @type {?} */ (options))).value ? 'true' : 'false';
567
- }
568
- /**
569
- * @param {?} options
570
- * @param {?} option
571
- * @return {?}
572
- */
573
- static removeSelection(options, option) {
574
- for (let i = 0; i < ((/** @type {?} */ (options))).length; i++) {
575
- if (((/** @type {?} */ (options)))[i].value === option.value) {
576
- ((/** @type {?} */ (options))).splice(i, 1);
577
- return;
578
- }
579
- }
580
- }
200
+ /**
201
+ * @fileoverview added by tsickle
202
+ * Generated from: lib/select2-utils.ts
203
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
204
+ */
205
+ class Select2Utils {
206
+ /**
207
+ * @param {?} data
208
+ * @param {?} value
209
+ * @return {?}
210
+ */
211
+ static getOptionByValue(data, value) {
212
+ if (Array.isArray(data)) {
213
+ for (const groupOrOption of data) {
214
+ /** @type {?} */
215
+ const options = ((/** @type {?} */ (groupOrOption))).options;
216
+ if (options) {
217
+ for (const option of options) {
218
+ if (option.value === value) {
219
+ return option;
220
+ }
221
+ }
222
+ }
223
+ else {
224
+ if (((/** @type {?} */ (groupOrOption))).value === value) {
225
+ return (/** @type {?} */ (groupOrOption));
226
+ }
227
+ }
228
+ }
229
+ }
230
+ return null;
231
+ }
232
+ /**
233
+ * @param {?} data
234
+ * @param {?} value
235
+ * @param {?} multiple
236
+ * @return {?}
237
+ */
238
+ static getOptionsByValue(data, value, multiple) {
239
+ if (multiple) {
240
+ /** @type {?} */
241
+ const values = Array.isArray(value) ? value : [];
242
+ /** @type {?} */
243
+ const result = [];
244
+ for (const v of values) {
245
+ /** @type {?} */
246
+ const option = Select2Utils.getOptionByValue(data, v);
247
+ if (option) {
248
+ result.push(option);
249
+ }
250
+ }
251
+ return result;
252
+ }
253
+ return Select2Utils.getOptionByValue(data, (/** @type {?} */ (value)));
254
+ }
255
+ /**
256
+ * @param {?} data
257
+ * @return {?}
258
+ */
259
+ static getFirstAvailableOption(data) {
260
+ if (Array.isArray(data)) {
261
+ for (const groupOrOption of data) {
262
+ /** @type {?} */
263
+ const options = ((/** @type {?} */ (groupOrOption))).options;
264
+ if (options) {
265
+ for (const option of options) {
266
+ if (!option.disabled) {
267
+ return option.value;
268
+ }
269
+ }
270
+ }
271
+ else {
272
+ /** @type {?} */
273
+ const option = (/** @type {?} */ (groupOrOption));
274
+ if (!option.disabled) {
275
+ return option.value;
276
+ }
277
+ }
278
+ }
279
+ }
280
+ return null;
281
+ }
282
+ /**
283
+ * @private
284
+ * @param {?} data
285
+ * @return {?}
286
+ */
287
+ static getOptionsCount(data) {
288
+ /** @type {?} */
289
+ let count = 0;
290
+ if (Array.isArray(data)) {
291
+ for (const groupOrOption of data) {
292
+ /** @type {?} */
293
+ const options = ((/** @type {?} */ (groupOrOption))).options;
294
+ if (options) {
295
+ count += options.length;
296
+ }
297
+ else {
298
+ count++;
299
+ }
300
+ }
301
+ }
302
+ return count;
303
+ }
304
+ /**
305
+ * @param {?} filteredData
306
+ * @param {?} value
307
+ * @return {?}
308
+ */
309
+ static valueIsNotInFilteredData(filteredData, value) {
310
+ if (Select2Utils.isNullOrUndefined(value)) {
311
+ return true;
312
+ }
313
+ for (const groupOrOption of filteredData) {
314
+ /** @type {?} */
315
+ const options = ((/** @type {?} */ (groupOrOption))).options;
316
+ if (options) {
317
+ for (const option of options) {
318
+ if (option.value === value) {
319
+ return false;
320
+ }
321
+ }
322
+ }
323
+ else {
324
+ if (((/** @type {?} */ (groupOrOption))).value === value) {
325
+ return false;
326
+ }
327
+ }
328
+ }
329
+ return true;
330
+ }
331
+ // tslint:disable-next-line:cognitive-complexity
332
+ /**
333
+ * @param {?} filteredData
334
+ * @param {?} hoveringValue
335
+ * @return {?}
336
+ */
337
+ static getPreviousOption(filteredData, hoveringValue) {
338
+ /** @type {?} */
339
+ let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
340
+ for (let i = filteredData.length - 1; i >= 0; i--) {
341
+ /** @type {?} */
342
+ const groupOrOption = filteredData[i];
343
+ /** @type {?} */
344
+ const options = ((/** @type {?} */ (groupOrOption))).options;
345
+ if (options) {
346
+ for (let j = options.length - 1; j >= 0; j--) {
347
+ /** @type {?} */
348
+ const option = options[j];
349
+ if (findIt) {
350
+ if (!option.disabled && !option.hide) {
351
+ return option;
352
+ }
353
+ }
354
+ if (!findIt) {
355
+ findIt = option.value === hoveringValue;
356
+ }
357
+ }
358
+ }
359
+ else {
360
+ /** @type {?} */
361
+ const option = (/** @type {?} */ (groupOrOption));
362
+ if (findIt) {
363
+ if (!option.disabled && !option.hide) {
364
+ return option;
365
+ }
366
+ }
367
+ if (!findIt) {
368
+ findIt = option.value === hoveringValue;
369
+ }
370
+ }
371
+ }
372
+ return null;
373
+ }
374
+ // tslint:disable-next-line:cognitive-complexity
375
+ /**
376
+ * @param {?} filteredData
377
+ * @param {?} hoveringValue
378
+ * @return {?}
379
+ */
380
+ static getNextOption(filteredData, hoveringValue) {
381
+ /** @type {?} */
382
+ let findIt = Select2Utils.isNullOrUndefined(hoveringValue);
383
+ for (const groupOrOption of filteredData) {
384
+ /** @type {?} */
385
+ const options = ((/** @type {?} */ (groupOrOption))).options;
386
+ if (options) {
387
+ for (const option of options) {
388
+ if (findIt) {
389
+ if (!option.disabled && !option.hide) {
390
+ return option;
391
+ }
392
+ }
393
+ else if (!findIt) {
394
+ findIt = option.value === hoveringValue;
395
+ }
396
+ }
397
+ }
398
+ else {
399
+ /** @type {?} */
400
+ const option = (/** @type {?} */ (groupOrOption));
401
+ if (findIt) {
402
+ if (!option.disabled && !option.hide) {
403
+ return option;
404
+ }
405
+ }
406
+ else if (!findIt) {
407
+ findIt = option.value === hoveringValue;
408
+ }
409
+ }
410
+ }
411
+ return null;
412
+ }
413
+ /**
414
+ * @private
415
+ * @param {?} value
416
+ * @return {?}
417
+ */
418
+ static isNullOrUndefined(value) {
419
+ return value === null || value === undefined;
420
+ }
421
+ /**
422
+ * @private
423
+ * @param {?} label
424
+ * @param {?} searchText
425
+ * @param {?} editPattern
426
+ * @return {?}
427
+ */
428
+ static containSearchText(label, searchText, editPattern) {
429
+ return searchText
430
+ ? Select2Utils.formatSansUnicode(label).match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null
431
+ : true;
432
+ }
433
+ /**
434
+ * @private
435
+ * @param {?} str
436
+ * @return {?}
437
+ */
438
+ static protectPattern(str) {
439
+ return str.replace(protectRegexp, '\\$&');
440
+ }
441
+ /**
442
+ * @private
443
+ * @param {?} str
444
+ * @return {?}
445
+ */
446
+ static formatSansUnicode(str) {
447
+ for (const unicodePattern of unicodePatterns) {
448
+ str = str.replace(unicodePattern.s, unicodePattern.l);
449
+ }
450
+ return str;
451
+ }
452
+ /**
453
+ * @private
454
+ * @param {?} str
455
+ * @param {?} editPattern
456
+ * @return {?}
457
+ */
458
+ static formatPattern(str, editPattern) {
459
+ str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));
460
+ if (editPattern && typeof editPattern === 'function') {
461
+ str = editPattern(str);
462
+ }
463
+ return str;
464
+ }
465
+ /**
466
+ * @param {?} data
467
+ * @param {?} searchText
468
+ * @param {?=} editPattern
469
+ * @return {?}
470
+ */
471
+ static getFilteredData(data, searchText, editPattern) {
472
+ if (searchText) {
473
+ /** @type {?} */
474
+ const result = [];
475
+ for (const groupOrOption of data) {
476
+ /** @type {?} */
477
+ const options = ((/** @type {?} */ (groupOrOption))).options;
478
+ if (options) {
479
+ if (options.some((/**
480
+ * @param {?} group
481
+ * @return {?}
482
+ */
483
+ group => Select2Utils.containSearchText(group.label, searchText, editPattern)))) {
484
+ /** @type {?} */
485
+ const filteredOptions = options.filter((/**
486
+ * @param {?} group
487
+ * @return {?}
488
+ */
489
+ group => Select2Utils.containSearchText(group.label, searchText, editPattern)));
490
+ result.push({
491
+ label: groupOrOption.label,
492
+ options: filteredOptions,
493
+ });
494
+ }
495
+ }
496
+ else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {
497
+ result.push(groupOrOption);
498
+ }
499
+ }
500
+ return result;
501
+ }
502
+ else {
503
+ return data;
504
+ }
505
+ }
506
+ /**
507
+ * @param {?} data
508
+ * @param {?} selectedOptions
509
+ * @return {?}
510
+ */
511
+ static getFilteredSelectedData(data, selectedOptions) {
512
+ /** @type {?} */
513
+ const result = [];
514
+ for (const groupOrOption of data) {
515
+ /** @type {?} */
516
+ const options = ((/** @type {?} */ (groupOrOption))).options;
517
+ if (options) {
518
+ /** @type {?} */
519
+ const filteredOptions = options.filter((/**
520
+ * @param {?} group
521
+ * @return {?}
522
+ */
523
+ group => Select2Utils.isSelected(selectedOptions, group, true) === 'false'));
524
+ if (filteredOptions.length) {
525
+ result.push({
526
+ label: groupOrOption.label,
527
+ options: filteredOptions,
528
+ });
529
+ }
530
+ }
531
+ else if (Select2Utils.isSelected(selectedOptions, (/** @type {?} */ (groupOrOption)), true) === 'false') {
532
+ result.push(groupOrOption);
533
+ }
534
+ }
535
+ return result;
536
+ }
537
+ /**
538
+ * @param {?} data
539
+ * @param {?=} minCountForSearch
540
+ * @return {?}
541
+ */
542
+ static isSearchboxHiddex(data, minCountForSearch) {
543
+ if (minCountForSearch === '' ||
544
+ minCountForSearch === undefined ||
545
+ minCountForSearch === null ||
546
+ isNaN(+minCountForSearch)) {
547
+ minCountForSearch = defaultMinCountForSearch;
548
+ }
549
+ /** @type {?} */
550
+ const optionCount = Select2Utils.getOptionsCount(data);
551
+ return optionCount < +minCountForSearch;
552
+ }
553
+ /**
554
+ * @param {?} options
555
+ * @param {?} option
556
+ * @param {?} multiple
557
+ * @return {?}
558
+ */
559
+ static isSelected(options, option, multiple) {
560
+ return multiple
561
+ ? options && ((/** @type {?} */ (options))).some((/**
562
+ * @param {?} op
563
+ * @return {?}
564
+ */
565
+ op => op.value === option.value))
566
+ ? 'true'
567
+ : 'false'
568
+ : options && option.value === ((/** @type {?} */ (options))).value
569
+ ? 'true'
570
+ : 'false';
571
+ }
572
+ /**
573
+ * @param {?} options
574
+ * @param {?} option
575
+ * @return {?}
576
+ */
577
+ static removeSelection(options, option) {
578
+ for (let i = 0; i < ((/** @type {?} */ (options))).length; i++) {
579
+ if (((/** @type {?} */ (options)))[i].value === option.value) {
580
+ ((/** @type {?} */ (options))).splice(i, 1);
581
+ return;
582
+ }
583
+ }
584
+ }
581
585
  }
582
586
 
583
- /**
584
- * @fileoverview added by tsickle
585
- * Generated from: lib/select2.component.ts
586
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
587
- */
588
- /** @type {?} */
589
- let nextUniqueId = 0;
590
- /** @type {?} */
591
- const displaySearchStatusList = ['default', 'hidden', 'always'];
592
- class Select2 {
593
- /**
594
- * @param {?} _viewportRuler
595
- * @param {?} _changeDetectorRef
596
- * @param {?} _parentForm
597
- * @param {?} _parentFormGroup
598
- * @param {?} _control
599
- * @param {?} tabIndex
600
- */
601
- constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {
602
- this._viewportRuler = _viewportRuler;
603
- this._changeDetectorRef = _changeDetectorRef;
604
- this._parentForm = _parentForm;
605
- this._parentFormGroup = _parentFormGroup;
606
- this._control = _control;
607
- this.minCharForSearch = 0;
608
- this.limitSelection = 0;
609
- /**
610
- * use the material style
611
- */
612
- this.styleMode = 'default';
613
- /**
614
- * infinite scroll distance
615
- */
616
- this.infiniteScrollDistance = 1.5;
617
- /**
618
- * infinite scroll distance
619
- */
620
- this.infiniteScrollThrottle = 150;
621
- /**
622
- * the max height of the results container when opening the select
623
- */
624
- this.resultMaxHeight = '200px';
625
- this.update = new EventEmitter();
626
- this.open = new EventEmitter();
627
- this.close = new EventEmitter();
628
- this.focus = new EventEmitter();
629
- this.blur = new EventEmitter();
630
- this.search = new EventEmitter();
631
- this.scroll = new EventEmitter();
632
- this.removeOption = new EventEmitter();
633
- this.option = null;
634
- this.isOpen = false;
635
- /**
636
- * Whether the element is focused or not.
637
- */
638
- this.focused = false;
639
- this.hoveringValue = null;
640
- this.innerSearchText = '';
641
- this._stateChanges = new Subject();
642
- this._disabled = false;
643
- this._required = false;
644
- this._readonly = false;
645
- this._multiple = false;
646
- this._overlay = false;
647
- this._resettable = false;
648
- this._hideSelectedItems = false;
649
- this._clickDetection = false;
650
- this._uid = `select2-${nextUniqueId++}`;
651
- this._infiniteScroll = true;
652
- /**
653
- * View -> model callback called when select has been touched
654
- */
655
- this._onTouched = (/**
656
- * @return {?}
657
- */
658
- () => {
659
- // do nothing
660
- });
661
- /**
662
- * View -> model callback called when value changes
663
- */
664
- this._onChange = (/**
665
- * @return {?}
666
- */
667
- () => {
668
- // do nothing
669
- });
670
- this.id = this.id;
671
- this._tabIndex = parseInt(tabIndex, 10) || 0;
672
- if (this._control) {
673
- this._control.valueAccessor = this;
674
- }
675
- this._clickDetectionFc = this.clickDetection.bind(this);
676
- }
677
- /**
678
- * @return {?}
679
- */
680
- get multiple() { return this._multiple; }
681
- /**
682
- * @param {?} value
683
- * @return {?}
684
- */
685
- set multiple(value) { this._multiple = this._coerceBooleanProperty(value); this.ngOnInit(); }
686
- /**
687
- * use the material style
688
- * @return {?}
689
- */
690
- get overlay() { return this._overlay; }
691
- /**
692
- * @param {?} value
693
- * @return {?}
694
- */
695
- set overlay(value) { this._overlay = this._coerceBooleanProperty(value); }
696
- /**
697
- * infinite scroll activated
698
- * @return {?}
699
- */
700
- get infiniteScroll() { return this._infiniteScroll; }
701
- /**
702
- * @param {?} value
703
- * @return {?}
704
- */
705
- set infiniteScroll(value) { this._infiniteScroll = this._coerceBooleanProperty(value); }
706
- /**
707
- * @return {?}
708
- */
709
- get select2Options() {
710
- return this.multiple ? (/** @type {?} */ (this.option)) : null;
711
- }
712
- /**
713
- * @return {?}
714
- */
715
- get select2Option() {
716
- return this.multiple ? null : (/** @type {?} */ (this.option));
717
- }
718
- /**
719
- * @return {?}
720
- */
721
- get searchText() {
722
- return this.innerSearchText;
723
- }
724
- /**
725
- * @param {?} text
726
- * @return {?}
727
- */
728
- set searchText(text) {
729
- if (this.customSearchEnabled) {
730
- this.search.emit({
731
- component: this,
732
- value: this._value,
733
- search: text
734
- });
735
- }
736
- this.innerSearchText = text;
737
- }
738
- /**
739
- * minimal data of show the search field
740
- * @return {?}
741
- */
742
- get minCountForSearch() {
743
- return this._minCountForSearch;
744
- }
745
- /**
746
- * @param {?} value
747
- * @return {?}
748
- */
749
- set minCountForSearch(value) {
750
- this._minCountForSearch = value;
751
- this.updateSearchBox();
752
- }
753
- /**
754
- * Unique id of the element.
755
- * @return {?}
756
- */
757
- get id() { return this._id; }
758
- /**
759
- * @param {?} value
760
- * @return {?}
761
- */
762
- set id(value) { this._id = value || this._uid; }
763
- /**
764
- * Whether the element is required.
765
- * @return {?}
766
- */
767
- get required() { return this._required; }
768
- /**
769
- * @param {?} value
770
- * @return {?}
771
- */
772
- set required(value) { this._required = this._coerceBooleanProperty(value); }
773
- /**
774
- * Whether selected items should be hidden.
775
- * @return {?}
776
- */
777
- get disabled() { return this._control ? this._control.disabled : this._disabled; }
778
- /**
779
- * @param {?} value
780
- * @return {?}
781
- */
782
- set disabled(value) { this._disabled = this._coerceBooleanProperty(value); }
783
- /**
784
- * Whether items are hidden when has.
785
- * @return {?}
786
- */
787
- get hideSelectedItems() { return this._hideSelectedItems; }
788
- /**
789
- * @param {?} value
790
- * @return {?}
791
- */
792
- set hideSelectedItems(value) { this._hideSelectedItems = this._coerceBooleanProperty(value); }
793
- /**
794
- * Whether the element is readonly.
795
- * @return {?}
796
- */
797
- get readonly() { return this._readonly; }
798
- /**
799
- * @param {?} value
800
- * @return {?}
801
- */
802
- set readonly(value) { this._readonly = this._coerceBooleanProperty(value); }
803
- /**
804
- * The input element's value.
805
- * @return {?}
806
- */
807
- get value() {
808
- return this._value;
809
- }
810
- /**
811
- * @param {?} value
812
- * @return {?}
813
- */
814
- set value(value) {
815
- if (this.testValueChange(this._value, value)) {
816
- setTimeout((/**
817
- * @return {?}
818
- */
819
- () => {
820
- this._value = value;
821
- this.writeValue(value);
822
- }), 10);
823
- }
824
- }
825
- /**
826
- * Tab index for the select2 element.
827
- * @return {?}
828
- */
829
- get tabIndex() {
830
- return this.disabled ? -1 : this._tabIndex;
831
- }
832
- /**
833
- * @param {?} value
834
- * @return {?}
835
- */
836
- set tabIndex(value) {
837
- if (typeof value !== 'undefined') {
838
- this._tabIndex = value;
839
- }
840
- }
841
- /**
842
- * reset with no selected value
843
- * @return {?}
844
- */
845
- get resettable() { return this._resettable; }
846
- /**
847
- * @param {?} value
848
- * @return {?}
849
- */
850
- set resettable(value) { this._resettable = this._coerceBooleanProperty(value); }
851
- /**
852
- * @return {?}
853
- */
854
- get ariaInvalid() {
855
- return this._isErrorState();
856
- }
857
- /**
858
- * @return {?}
859
- */
860
- get classMaterial() {
861
- return this.styleMode === 'material';
862
- }
863
- /**
864
- * @return {?}
865
- */
866
- get classNostyle() {
867
- return this.styleMode === 'noStyle';
868
- }
869
- /**
870
- * @return {?}
871
- */
872
- get select2above() {
873
- return this.listPosition === 'above';
874
- }
875
- /**
876
- * @private
877
- * @return {?}
878
- */
879
- get resultsElement() {
880
- return this.resultContainer.nativeElement;
881
- }
882
- /**
883
- * @return {?}
884
- */
885
- ngOnInit() {
886
- this._viewportRuler.change(100).subscribe((/**
887
- * @return {?}
888
- */
889
- () => {
890
- if (this.isOpen) {
891
- this.triggerRect();
892
- }
893
- }));
894
- /** @type {?} */
895
- const option = Select2Utils.getOptionsByValue(this.data, this._control ? this._control.value : this.value, this.multiple);
896
- if (option !== null) {
897
- this.option = option;
898
- }
899
- if (!Array.isArray(option)) {
900
- this.hoveringValue = (/** @type {?} */ (this.value));
901
- }
902
- this.updateSearchBox();
903
- }
904
- /**
905
- * @return {?}
906
- */
907
- ngAfterViewInit() {
908
- this.selectionElement = this.selection.nativeElement;
909
- this.triggerRect();
910
- }
911
- /**
912
- * @return {?}
913
- */
914
- ngDoCheck() {
915
- this.updateSearchBox();
916
- this._dirtyCheckNativeValue();
917
- if (this._triggerRect && this.overlayWidth !== this._triggerRect.width) {
918
- this.overlayWidth = this._triggerRect.width;
919
- }
920
- }
921
- /**
922
- * @return {?}
923
- */
924
- ngOnDestroy() {
925
- window.document.body.removeEventListener('click', this._clickDetectionFc);
926
- }
927
- /**
928
- * @return {?}
929
- */
930
- updateSearchBox() {
931
- /** @type {?} */
932
- const hidden = this.customSearchEnabled
933
- ? false
934
- : Select2Utils.isSearchboxHiddex(this.data, this._minCountForSearch);
935
- if (this.isSearchboxHidden !== hidden) {
936
- this.isSearchboxHidden = hidden;
937
- }
938
- }
939
- /**
940
- * @return {?}
941
- */
942
- hideSearch() {
943
- /** @type {?} */
944
- const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1
945
- ? this.displaySearchStatus
946
- : 'default';
947
- return (displaySearchStatus === 'default' && this.isSearchboxHidden) || displaySearchStatus === 'hidden';
948
- }
949
- /**
950
- * @param {?} option
951
- * @return {?}
952
- */
953
- getOptionStyle(option) {
954
- return 'select2-results__option ' +
955
- (option.hide ? 'select2-results__option--hide ' : '') +
956
- (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') +
957
- (option.classes || '');
958
- }
959
- /**
960
- * @param {?} option
961
- * @return {?}
962
- */
963
- mouseenter(option) {
964
- if (!option.disabled) {
965
- this.hoveringValue = option.value;
966
- }
967
- }
968
- /**
969
- * @param {?} option
970
- * @return {?}
971
- */
972
- click(option) {
973
- if (this.testSelection(option)) {
974
- this.select(option);
975
- }
976
- }
977
- /**
978
- * @param {?} e
979
- * @return {?}
980
- */
981
- reset(e) {
982
- this.select(null);
983
- e.preventDefault();
984
- e.stopPropagation();
985
- }
986
- /**
987
- * @param {?} event
988
- * @return {?}
989
- */
990
- prevChange(event) {
991
- event.stopPropagation();
992
- }
993
- /**
994
- * @return {?}
995
- */
996
- toggleOpenAndClose() {
997
- if (this.disabled) {
998
- return;
999
- }
1000
- this._focus(true);
1001
- this.isOpen = !this.isOpen;
1002
- if (this.isOpen) {
1003
- this.triggerRect();
1004
- this.innerSearchText = '';
1005
- this.updateFilteredData();
1006
- this._focusSearchboxOrResultsElement();
1007
- setTimeout((/**
1008
- * @return {?}
1009
- */
1010
- () => {
1011
- if (this.option) {
1012
- /** @type {?} */
1013
- const option = this.option instanceof Array ? this.option[0] : this.option;
1014
- this.updateScrollFromOption(option);
1015
- }
1016
- else {
1017
- this.resultsElement.scrollTop = 0;
1018
- }
1019
- }));
1020
- this.open.emit(this);
1021
- }
1022
- else {
1023
- this.close.emit(this);
1024
- }
1025
- if (this.isOpen && !this._clickDetection) {
1026
- setTimeout((/**
1027
- * @return {?}
1028
- */
1029
- () => {
1030
- window.document.body.addEventListener('click', this._clickDetectionFc, false);
1031
- this._clickDetection = true;
1032
- }), timeout);
1033
- }
1034
- this._changeDetectorRef.markForCheck();
1035
- }
1036
- /**
1037
- * @param {?} option
1038
- * @param {?} defaut
1039
- * @return {?}
1040
- */
1041
- hasTemplate(option, defaut) {
1042
- return this.templates instanceof TemplateRef
1043
- || this.templates && this.templates[option.templateId] instanceof TemplateRef
1044
- || this.templates && this.templates[defaut] instanceof TemplateRef;
1045
- }
1046
- /**
1047
- * @param {?} option
1048
- * @param {?} defaut
1049
- * @return {?}
1050
- */
1051
- getTemplate(option, defaut) {
1052
- if (this.hasTemplate(option, defaut)) {
1053
- return this.templates[option.templateId]
1054
- || this.templates[defaut]
1055
- || this.templates;
1056
- }
1057
- return undefined;
1058
- }
1059
- /**
1060
- * @return {?}
1061
- */
1062
- triggerRect() {
1063
- this._triggerRect = this.selectionElement.getBoundingClientRect();
1064
- }
1065
- /**
1066
- * @private
1067
- * @param {?} option
1068
- * @return {?}
1069
- */
1070
- testSelection(option) {
1071
- if (option.disabled) {
1072
- return false;
1073
- }
1074
- if (!this.multiple ||
1075
- !this.limitSelection ||
1076
- Array.isArray(this._value) && this._value.length < this.limitSelection) {
1077
- return true;
1078
- }
1079
- return false;
1080
- }
1081
- /**
1082
- * @private
1083
- * @param {?} value1
1084
- * @param {?} value2
1085
- * @return {?}
1086
- */
1087
- testValueChange(value1, value2) {
1088
- if ((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined) ||
1089
- value1 === value2) {
1090
- return false;
1091
- }
1092
- if (this.multiple
1093
- && value1 && ((/** @type {?} */ (value1))).length
1094
- && value2 && ((/** @type {?} */ (value2))).length
1095
- && ((/** @type {?} */ (value1))).length === ((/** @type {?} */ (value2))).length) {
1096
- for (const e1 of ((/** @type {?} */ (value1)))) {
1097
- /** @type {?} */
1098
- const test = ((/** @type {?} */ (value2))).indexOf(e1) > -1;
1099
- if (!test) {
1100
- return true;
1101
- }
1102
- }
1103
- return false;
1104
- }
1105
- return true;
1106
- }
1107
- /**
1108
- * @private
1109
- * @return {?}
1110
- */
1111
- updateFilteredData() {
1112
- setTimeout((/**
1113
- * @return {?}
1114
- */
1115
- () => {
1116
- /** @type {?} */
1117
- let result = this.data;
1118
- if (this.multiple && this.hideSelectedItems) {
1119
- result = Select2Utils.getFilteredSelectedData(result, this.option);
1120
- }
1121
- if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {
1122
- result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);
1123
- }
1124
- if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {
1125
- this.hoveringValue = Select2Utils.getFirstAvailableOption(result);
1126
- }
1127
- this.filteredData = result;
1128
- this._changeDetectorRef.markForCheck();
1129
- }));
1130
- }
1131
- /**
1132
- * @private
1133
- * @param {?} e
1134
- * @return {?}
1135
- */
1136
- clickDetection(e) {
1137
- if (!this.ifParentContainsClass((/** @type {?} */ (e.target)), 'selection')) {
1138
- if (this.isOpen && !this.ifParentContainsClass((/** @type {?} */ (e.target)), 'select2-dropdown')) {
1139
- this.toggleOpenAndClose();
1140
- }
1141
- if (!this.ifParentContainsId((/** @type {?} */ (e.target)), this._id)) {
1142
- this.clickExit();
1143
- }
1144
- }
1145
- else if (this.isOpen && !this.ifParentContainsId((/** @type {?} */ (e.target)), this._id)) {
1146
- this.toggleOpenAndClose();
1147
- this.clickExit();
1148
- }
1149
- }
1150
- /**
1151
- * @private
1152
- * @return {?}
1153
- */
1154
- clickExit() {
1155
- this._focus(false);
1156
- window.document.body.removeEventListener('click', this._clickDetectionFc);
1157
- this._clickDetection = false;
1158
- }
1159
- /**
1160
- * @private
1161
- * @param {?} element
1162
- * @param {?} cssClass
1163
- * @return {?}
1164
- */
1165
- ifParentContainsClass(element, cssClass) {
1166
- return this.getParentElementByClass(element, cssClass) !== null;
1167
- }
1168
- /**
1169
- * @private
1170
- * @param {?} element
1171
- * @param {?} id
1172
- * @return {?}
1173
- */
1174
- ifParentContainsId(element, id) {
1175
- return this.getParentElementById(element, id) !== null;
1176
- }
1177
- /**
1178
- * @private
1179
- * @param {?} element
1180
- * @param {?} cssClass
1181
- * @return {?}
1182
- */
1183
- getParentElementByClass(element, cssClass) {
1184
- if (this.containClasses(element, cssClass.trim().split(/\s+/))) {
1185
- return element;
1186
- }
1187
- return element.parentElement
1188
- ? this.getParentElementByClass(element.parentElement, cssClass)
1189
- : null;
1190
- }
1191
- /**
1192
- * @private
1193
- * @param {?} element
1194
- * @param {?} id
1195
- * @return {?}
1196
- */
1197
- getParentElementById(element, id) {
1198
- if (element.id === id) {
1199
- return element;
1200
- }
1201
- return element.parentElement
1202
- ? this.getParentElementById(element.parentElement, id)
1203
- : null;
1204
- }
1205
- /**
1206
- * @private
1207
- * @param {?} element
1208
- * @param {?} cssClasses
1209
- * @return {?}
1210
- */
1211
- containClasses(element, cssClasses) {
1212
- if (!element.classList) {
1213
- return false;
1214
- }
1215
- for (const cssClass of cssClasses) {
1216
- if (!element.classList.contains(cssClass)) {
1217
- return false;
1218
- }
1219
- }
1220
- return true;
1221
- }
1222
- /**
1223
- * @return {?}
1224
- */
1225
- focusin() {
1226
- if (this.disabled) {
1227
- return;
1228
- }
1229
- this._focus(true);
1230
- }
1231
- /**
1232
- * @return {?}
1233
- */
1234
- focusout() {
1235
- if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {
1236
- this._focus(false);
1237
- this._onTouched();
1238
- }
1239
- }
1240
- /**
1241
- * @private
1242
- * @return {?}
1243
- */
1244
- moveUp() {
1245
- this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));
1246
- }
1247
- /**
1248
- * @private
1249
- * @return {?}
1250
- */
1251
- moveDown() {
1252
- this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));
1253
- }
1254
- /**
1255
- * @private
1256
- * @param {?} option
1257
- * @return {?}
1258
- */
1259
- updateScrollFromOption(option) {
1260
- if (option) {
1261
- this.hoveringValue = option.value;
1262
- /** @type {?} */
1263
- const domElement = this.results.find((/**
1264
- * @param {?} r
1265
- * @return {?}
1266
- */
1267
- r => r.nativeElement.innerText.trim() === option.label));
1268
- if (domElement) {
1269
- this.resultsElement.scrollTop = 0;
1270
- /** @type {?} */
1271
- const listClientRect = this.resultsElement.getBoundingClientRect();
1272
- /** @type {?} */
1273
- const optionClientRect = domElement.nativeElement.getBoundingClientRect();
1274
- this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;
1275
- }
1276
- }
1277
- }
1278
- /**
1279
- * @private
1280
- * @return {?}
1281
- */
1282
- selectByEnter() {
1283
- if (this.hoveringValue) {
1284
- /** @type {?} */
1285
- const option = Select2Utils.getOptionByValue(this.data, this.hoveringValue);
1286
- this.select(option);
1287
- }
1288
- }
1289
- /**
1290
- * @param {?} option
1291
- * @return {?}
1292
- */
1293
- select(option) {
1294
- /** @type {?} */
1295
- let value;
1296
- if (option !== null) {
1297
- if (this.multiple) {
1298
- /** @type {?} */
1299
- const options = (/** @type {?} */ (this.option));
1300
- /** @type {?} */
1301
- const index = options.findIndex((/**
1302
- * @param {?} op
1303
- * @return {?}
1304
- */
1305
- op => op.value === option.value));
1306
- if (index === -1) {
1307
- options.push(option);
1308
- }
1309
- else {
1310
- options.splice(index, 1);
1311
- }
1312
- value = ((/** @type {?} */ (this.option))).map((/**
1313
- * @param {?} op
1314
- * @return {?}
1315
- */
1316
- op => op.value));
1317
- }
1318
- else {
1319
- this.option = option;
1320
- if (this.isOpen) {
1321
- this.isOpen = false;
1322
- this.close.emit(this);
1323
- if (this.selectionElement) {
1324
- this.selectionElement.focus();
1325
- }
1326
- }
1327
- value = this.option.value;
1328
- }
1329
- }
1330
- else {
1331
- this.option = null;
1332
- }
1333
- if (this.multiple && this.hideSelectedItems) {
1334
- this.updateFilteredData();
1335
- }
1336
- if (this._control) {
1337
- this._onChange(value);
1338
- }
1339
- else {
1340
- this._value = value;
1341
- }
1342
- this.update.emit({
1343
- component: this,
1344
- value: value,
1345
- options: Array.isArray(this.option) ? this.option : (this.option ? [this.option] : null)
1346
- });
1347
- }
1348
- /**
1349
- * @param {?} e
1350
- * @return {?}
1351
- */
1352
- keyDown(e) {
1353
- if (this._testKey(e, ['ArrowDown', 40])) {
1354
- this.moveDown();
1355
- e.preventDefault();
1356
- }
1357
- else if (this._testKey(e, ['ArrowUp', 38])) {
1358
- this.moveUp();
1359
- e.preventDefault();
1360
- }
1361
- else if (this._testKey(e, ['Enter', 13])) {
1362
- this.selectByEnter();
1363
- e.preventDefault();
1364
- }
1365
- else if (this._testKey(e, ['Escape', 'Tab', 9, 27]) && this.isOpen) {
1366
- this.toggleOpenAndClose();
1367
- this._focus(false);
1368
- }
1369
- }
1370
- /**
1371
- * @param {?} e
1372
- * @return {?}
1373
- */
1374
- openKey(e) {
1375
- if (this._testKey(e, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {
1376
- this.toggleOpenAndClose();
1377
- e.preventDefault();
1378
- }
1379
- else if (this._testKey(e, ['Escape', 'Tab', 9, 27])) {
1380
- this._focus(false);
1381
- this._onTouched();
1382
- }
1383
- }
1384
- /**
1385
- * @param {?} _index
1386
- * @param {?} item
1387
- * @return {?}
1388
- */
1389
- trackBy(_index, item) {
1390
- return item.value;
1391
- }
1392
- /**
1393
- * @param {?} e
1394
- * @return {?}
1395
- */
1396
- searchUpdate(e) {
1397
- this.searchText = ((/** @type {?} */ (e.target))).value;
1398
- this.updateFilteredData();
1399
- }
1400
- /**
1401
- * @param {?} option
1402
- * @return {?}
1403
- */
1404
- isSelected(option) {
1405
- return Select2Utils.isSelected(this.option, option, this.multiple);
1406
- }
1407
- /**
1408
- * @param {?} option
1409
- * @return {?}
1410
- */
1411
- isDisabled(option) {
1412
- return option.disabled ? 'true' : 'false';
1413
- }
1414
- /**
1415
- * @param {?} e
1416
- * @param {?} option
1417
- * @return {?}
1418
- */
1419
- removeSelection(e, option) {
1420
- Select2Utils.removeSelection(this.option, option);
1421
- if (this.multiple && this.hideSelectedItems) {
1422
- this.updateFilteredData();
1423
- }
1424
- /** @type {?} */
1425
- const value = ((/** @type {?} */ (this.option))).map((/**
1426
- * @param {?} op
1427
- * @return {?}
1428
- */
1429
- op => op.value));
1430
- if (this._control) {
1431
- this._onChange(value);
1432
- }
1433
- else {
1434
- this._value = value;
1435
- }
1436
- this.update.emit({
1437
- component: this,
1438
- value: value,
1439
- options: Array.isArray(this.option) ? this.option : (this.option ? [this.option] : null)
1440
- });
1441
- this.removeOption.emit({
1442
- component: this,
1443
- value: value,
1444
- removedOption: option
1445
- });
1446
- e.preventDefault();
1447
- e.stopPropagation();
1448
- if (this.isOpen) {
1449
- this._focusSearchboxOrResultsElement();
1450
- }
1451
- }
1452
- /**
1453
- * Sets the model value. Implemented as part of ControlValueAccessor.
1454
- * @param {?} value
1455
- * @return {?}
1456
- */
1457
- writeValue(value) {
1458
- this._setSelectionByValue(value);
1459
- }
1460
- /**
1461
- * Saves a callback function to be invoked when the select's value
1462
- * changes from user input. Part of the ControlValueAccessor interface
1463
- * required to integrate with Angular's core forms API.
1464
- *
1465
- * @param {?} fn Callback to be triggered when the value changes.
1466
- * @return {?}
1467
- */
1468
- registerOnChange(fn) {
1469
- this._onChange = fn;
1470
- }
1471
- /**
1472
- * Saves a callback function to be invoked when the select is blurred
1473
- * by the user. Part of the ControlValueAccessor interface required
1474
- * to integrate with Angular's core forms API.
1475
- *
1476
- * @param {?} fn Callback to be triggered when the component has been touched.
1477
- * @return {?}
1478
- */
1479
- registerOnTouched(fn) {
1480
- this._onTouched = fn;
1481
- }
1482
- /**
1483
- * Sets whether the component should be disabled.
1484
- * Implemented as part of ControlValueAccessor.
1485
- * @param {?} isDisabled
1486
- * @return {?}
1487
- */
1488
- setDisabledState(isDisabled) {
1489
- this.disabled = isDisabled;
1490
- }
1491
- /**
1492
- * @return {?}
1493
- */
1494
- _isErrorState() {
1495
- /** @type {?} */
1496
- const isInvalid = this._control && this._control.invalid;
1497
- /** @type {?} */
1498
- const isTouched = this._control && this._control.touched;
1499
- /** @type {?} */
1500
- const isSubmitted = (this._parentFormGroup && this._parentFormGroup.submitted) ||
1501
- (this._parentForm && this._parentForm.submitted);
1502
- return !!(isInvalid && (isTouched || isSubmitted));
1503
- }
1504
- /**
1505
- * @private
1506
- * @param {?} event
1507
- * @param {?=} refs
1508
- * @return {?}
1509
- */
1510
- _testKey(event, refs = []) {
1511
- return this._isKey(this._getKey(event), refs);
1512
- }
1513
- /**
1514
- * @private
1515
- * @param {?} event
1516
- * @return {?}
1517
- */
1518
- _getKey(event) {
1519
- /** @type {?} */
1520
- let code;
1521
- if (event.key !== undefined) {
1522
- code = event.key;
1523
- }
1524
- else if (event['keyIdentifier'] !== undefined) {
1525
- code = event['keyIdentifier'];
1526
- }
1527
- else if (event['keyCode'] !== undefined) {
1528
- code = event['keyCode'];
1529
- }
1530
- else {
1531
- event.preventDefault();
1532
- }
1533
- return code;
1534
- }
1535
- /**
1536
- * @private
1537
- * @param {?} code
1538
- * @param {?=} refs
1539
- * @return {?}
1540
- */
1541
- _isKey(code, refs = []) {
1542
- return refs && refs.length > 0
1543
- ? refs.indexOf(code) !== -1
1544
- : false;
1545
- }
1546
- /**
1547
- * Sets the selected option based on a value. If no option can be
1548
- * found with the designated value, the select trigger is cleared.
1549
- * @private
1550
- * @param {?} value
1551
- * @return {?}
1552
- */
1553
- _setSelectionByValue(value) {
1554
- if (this.option || (value !== undefined && value !== null)) {
1555
- /** @type {?} */
1556
- const isArray = Array.isArray(value);
1557
- if (this.multiple && value && !isArray) {
1558
- throw new Error('Non array value.');
1559
- }
1560
- else if (this.data) {
1561
- if (this.multiple) {
1562
- this.option = []; // if value is null, then empty option and return
1563
- if (isArray) {
1564
- // value is not null. Preselect value
1565
- /** @type {?} */
1566
- const selectedValues = Select2Utils.getOptionsByValue(this.data, value, this.multiple);
1567
- selectedValues.map((/**
1568
- * @param {?} item
1569
- * @return {?}
1570
- */
1571
- item => this.select(item)));
1572
- }
1573
- }
1574
- else {
1575
- this.select(Select2Utils.getOptionByValue(this.data, value));
1576
- }
1577
- }
1578
- else if (this._control) {
1579
- this._control.viewToModelUpdate(value);
1580
- }
1581
- this._changeDetectorRef.markForCheck();
1582
- }
1583
- }
1584
- /**
1585
- * Does some manual dirty checking on the native input `value` property.
1586
- * @private
1587
- * @return {?}
1588
- */
1589
- _dirtyCheckNativeValue() {
1590
- /** @type {?} */
1591
- const newValue = this.value;
1592
- if (this._previousNativeValue !== newValue) {
1593
- this._previousNativeValue = newValue;
1594
- this._stateChanges.next();
1595
- }
1596
- }
1597
- /**
1598
- * @private
1599
- * @param {?} value
1600
- * @return {?}
1601
- */
1602
- _coerceBooleanProperty(value) {
1603
- return value != null && `${value}` !== 'false';
1604
- }
1605
- /**
1606
- * @private
1607
- * @return {?}
1608
- */
1609
- _focusSearchboxOrResultsElement() {
1610
- if (!this.isSearchboxHidden) {
1611
- setTimeout((/**
1612
- * @return {?}
1613
- */
1614
- () => {
1615
- if (this.searchInput && this.searchInput.nativeElement) {
1616
- console.log(this.searchInput.nativeElement);
1617
- this.searchInput.nativeElement.focus();
1618
- }
1619
- }));
1620
- }
1621
- else {
1622
- if (this.resultsElement) {
1623
- this.resultsElement.focus();
1624
- }
1625
- }
1626
- }
1627
- /**
1628
- * @private
1629
- * @param {?} state
1630
- * @return {?}
1631
- */
1632
- _focus(state) {
1633
- if (!state && this.focused) {
1634
- this.focused = state;
1635
- this.blur.emit(this);
1636
- }
1637
- else if (state && !this.focused) {
1638
- this.focused = state;
1639
- this.focus.emit(this);
1640
- }
1641
- }
1642
- /**
1643
- * @param {?} way
1644
- * @return {?}
1645
- */
1646
- onScroll(way) {
1647
- this.scroll.emit({
1648
- component: this,
1649
- way,
1650
- search: this.innerSearchText
1651
- });
1652
- }
1653
- }
1654
- Select2.decorators = [
1655
- { type: Component, args: [{
1656
- selector: 'select2',
1657
- template: "<div class=\"select2-label\"\n (click)=\"toggleOpenAndClose()\">\n <ng-content select=\"select2-label\"></ng-content>\n <span *ngIf=\"required\"\n class=\"select2-required\"></span>\n</div>\n<div class=\"select2 select2-container select2-container--default select2-container--focus\"\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 <div class=\"selection\"\n #selection\n #trigger=\"cdkOverlayOrigin\"\n [attr.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 <div class=\"select2-selection\"\n [class.select2-selection--multiple]=\"multiple\"\n [class.select2-selection--single]=\"!multiple\"\n role=\"combobox\">\n <span *ngIf=\"!multiple\"\n class=\"select2-selection__rendered\"\n [title]=\"select2Option?.label || ''\">\n <span *ngIf=\"!select2Option\">&nbsp;</span>\n <span *ngIf=\"select2Option\"\n [innerHTML]=\"select2Option.label\"></span>\n <span [class.select2-selection__placeholder__option]=\"option\"\n class=\"select2-selection__placeholder\">{{placeholder}}</span>\n </span>\n <span (click)=\"reset($event)\"\n *ngIf=\"!multiple && resettable && select2Option\"\n class=\"select2-selection__reset\"\n role=\"presentation\">\u00D7</span>\n <span *ngIf=\"!multiple\"\n class=\"select2-selection__arrow\"\n role=\"presentation\">\n </span>\n <ul *ngIf=\"multiple\"\n class=\"select2-selection__rendered\">\n <span [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\">{{placeholder}}</span>\n <li *ngFor=\"let op of option; trackBy: trackBy\"\n class=\"select2-selection__choice\"\n [title]=\"op.label\">\n <span (click)=\"removeSelection($event, op)\"\n class=\"select2-selection__choice__remove\"\n role=\"presentation\">\u00D7</span>\n <span [innerHTML]=\"op.label\"></span>\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 cdkConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"select2-overlay-backdrop\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"this.isOpen && overlay\"\n [cdkConnectedOverlayMinWidth]=\"overlayWidth\"\n (backdropClick)=\"toggleOpenAndClose()\">\n <ng-container *ngTemplateOutlet=\"containerTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #containerTemplate>\n <div class=\"select2-container select2-container--default select2-container-dropdown\"\n [class.select2-container--open]=\"isOpen\"\n [class.select2-overlay]=\"overlay\">\n <div class=\"select2-dropdown\"\n [class.select2-dropdown--below]=\"!select2above\"\n [class.select2-dropdown--above]=\"select2above\">\n <div class=\"select2-search select2-search--dropdown\"\n [class.select2-search--hide]=\"hideSearch()\">\n <input #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 </div>\n <div class=\"select2-results\">\n <ul #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 <ng-container *ngFor=\"let groupOrOption of filteredData; index as i; trackBy:trackBy\">\n <li *ngIf=\"groupOrOption.options\"\n class=\"select2-results__option\"\n role=\"group\">\n <strong *ngIf=\"!hasTemplate(groupOrOption, 'group'); else optGroup\"\n [attr.class]=\"'select2-results__group' + (groupOrOption.classes ? ' ' + groupOrOption.classes : '')\"\n [innerHTML]=\"groupOrOption.label\"></strong>\n <ng-template #optGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'group'); context: groupOrOption\">\n </ng-container>\n </ng-template>\n\n <ul class=\"select2-results__options select2-results__options--nested\">\n <li *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 <div *ngIf=\"!hasTemplate(option, 'option'); else liGroup\"\n class=\"select2-label-content\"\n [innerHTML]=\"option.label\"></div>\n <ng-template #liGroup>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(option, 'option'); context: option\">\n </ng-container>\n </ng-template>\n </li>\n </ul>\n </li>\n <li *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 <div *ngIf=\"!hasTemplate(groupOrOption, 'option'); else li\"\n [innerHTML]=\"groupOrOption.label\"\n class=\"select2-label-content\"></div>\n <ng-template #li>\n <ng-container\n *ngTemplateOutlet=\"getTemplate(groupOrOption, 'option'); context: groupOrOption\">\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"select2-no-result select2-results__option\"\n *ngIf=\"!filteredData?.length && noResultMessage\"\n [innerHTML]=\"noResultMessage\"></li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n",
1658
- styles: [".select2-label{color:#000;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{opacity:0;position:absolute;width:0}.select2-container .select2-selection--single{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;flex:1 1 auto;overflow:hidden;padding:0 0 0 8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{border:none;box-sizing:border-box;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:#fff;background:var(--select2-dropdown-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-dropdown-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);box-sizing:border-box;display:block;height:0;overflow:hidden;position:absolute;width:100%;z-index:1051}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;color:#000;color:var(--select2-option-text-color,#000);padding:6px;user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{opacity:1;width:100%}.select2-container--open .select2-dropdown{height:auto;overflow: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{box-sizing:border-box;padding:4px;width:100%}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{background:#fff;border:0;display:block;filter:alpha(opacity=0);height:auto;left:0;margin:0;min-height:100%;min-width:100%;opacity:0;padding:0;position:fixed;top:0;width:auto;z-index:99}.select2-required:before{color:red;color:var(--select2-required-color,red);content:\"*\"}.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:#fff;background:var(--select2-selection-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-selection-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;color:var(--select2-selection-text-color,#444);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:#999;color:var(--select2-placeholder-color,#999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;text-overflow:ellipsis;text-overflow:var(--select2-placeholder-overflow,ellipsis);white-space:nowrap}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__arrow,.select2-container--default .select2-selection--single .select2-selection__reset{align-items:center;display:flex;justify-content:center;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow:before{border-bottom:0 solid var(--select2-arrow-color,#888);border-color:#888 transparent;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid var(--select2-arrow-color,#888);content:\" \";height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:#999;color:var(--select2-reset-color,#999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:#eee;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-bottom-color:var(--select2-arrow-color,#888);border-color:transparent transparent #888;border-right-color:transparent;border-top-color:transparent;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:#fff;background:var(--select2-selection-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-selection-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;flex:1 1 auto;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{color:#999;color:var(--select2-placeholder-color,#999);display:block;float:left;margin-top:5px;overflow:hidden;text-overflow:ellipsis;text-overflow:var(--select2-placeholder-overflow,ellipsis);white-space:nowrap;width:100%}.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-right:10px;margin-top:5px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background:#e4e4e4;background:var(--select2-selection-choice-background,#e4e4e4);border:1px solid #aaa;border:1px solid var(--select2-selection-choice-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);color:#000;color:var(--select2-selection-choice-text-color,#000);cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;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:#333;color:var(--select2-selection-choice-hover-close-color,#333)}.select2-container--default.select2-container--focused .select2-selection--multiple,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single{border:1px solid #000;border:1px solid var(--select2-selection-focus-border-color,#000);outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:#eee;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--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{background:#fff;background:1px solid var(--select2-search-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-search-border-color,#aaa);border-radius:0;border-radius:var(--select2-search-border-radius,0)}.select2-container--default .select2-search--inline .select2-search__field{-webkit-appearance:textfield;background:transparent;border:none;box-shadow:none;outline:none}.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]{background:transparent;background:var(--select2-option-disabled-background,transparent);color:#999;color:var(--select2-option-disabled-text-color,#999)}.select2-container--default .select2-results__option[aria-selected=true]{background:#ddd;background:var(--select2-option-selected-background,#ddd);color:#000;color:var(--select2-option-selected-text-color,#000)}.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:#5897fb;background:var(--select2-option-highlighted-background,#5897fb);color:#fff;color:var(--select2-option-highlighted-text-color,#fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{background:transparent;background:var(--select2-option-group-background,transparent);color:grey;color:var(--select2-option-group-text-color,grey);cursor:default;display:block;padding:6px}.select2-no-result{color:#888;color:var(--select2-no-result-color,#888);font-style:italic;font-style:var(--select2-font-style-color,italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-selection--multiple,:host.nostyle .select2-selection--single{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{align-items:baseline;border-top:.84375em solid transparent;display:inline-flex;height:auto;padding:.4375em 0;width:100%}:host.material .select2-container--default .select2-selection--multiple,:host.material .select2-container--default .select2-selection--single{border:0;border-radius:0;box-sizing:border-box;height:24px;width:100%}:host.material .select2-container--default .select2-selection--multiple:before,:host.material .select2-container--default .select2-selection--single:before{background:#ddd;background:var(--select2-material-underline,#ddd);bottom:1.65em;content:\" \";display:block;height:1px;position:absolute;width:100%}:host.material .select2-container--default .select2-selection--multiple:after,:host.material .select2-container--default .select2-selection--single:after{background:#5a419e;background:var(--select2-material-underline-active,#5a419e);bottom:1.63em;content:\" \";display:block;height:2px;left:50%;position:absolute;transition:none;width:0}:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered,:host.material .select2-container--default .select2-selection--single .select2-selection__rendered{line-height:inherit;padding-left:1px}:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder{color:rgba(0,0,0,.38);color:var(--select2-material-placeholder-color,rgba(0,0,0,.38));display:block;left:0;position:absolute;top:20px;transform-origin:0 21px;transition:transform .3s}:host.material .select2-container--default .select2-container--open{bottom:1.6em;left:0}: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--multiple:after,:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after{left:0;transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%}:host.material .select2-container--default .select2-dropdown{border:0;border-radius:0;box-shadow:0 5px 5px rgba(0,0,0,.5)}:host.material .select2-container--default .select2-results__option--highlighted[aria-selected],:host.material .select2-container--default .select2-results__option[aria-selected=true]{background:rgba(0,0,0,.04);background:var(--select2-material-option-selected-background,rgba(0,0,0,.04));color:#000;color:var(--select2-material-option-highlighted-text-color,#000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:#ff5722;color:var(--select2-material-option-selected-text-color,#ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple,:host.material .select2-container--default.select2-container--disabled .select2-selection--single{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before{background:linear-gradient(90deg,rgba(0,0,0,.26) 0,rgba(0,0,0,.26) 33%,transparent 0);background:var(--select2-material-underline-disabled,linear-gradient(90deg,rgba(0,0,0,.26) 0,rgba(0,0,0,.26) 33%,transparent 0));background-position:0 bottom;background-repeat:repeat-x;background-size:4px 1px}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple: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--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before{background:red;background:var(--select2-material-underline-invalid,red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple,:host.material:not(.select2-container--open) .select2-focused .select2-selection--single{border:0}:host.material .select2-subscript-wrapper{color:#888;color:var(--select2-hint-text-color,#888);font-size:75%;position:absolute;top:calc(100% - 1.72917em)}::ng-deep .select2-overlay-backdrop{background:rgba(0,0,0,.32);background:var(--select2-overlay-backdrop,transparent)}@supports (-moz-appearance:none){select2.material .select2-container--default .select2-selection--multiple,select2.material .select2-container--default .select2-selection--single{height:26px}}@supports (-ms-scroll-limit:0){select2.material .select2-container--default .select2-selection--multiple,select2.material .select2-container--default .select2-selection--single{height:25px}}"]
1659
- }] }
1660
- ];
1661
- /** @nocollapse */
1662
- Select2.ctorParameters = () => [
1663
- { type: ViewportRuler },
1664
- { type: ChangeDetectorRef },
1665
- { type: NgForm, decorators: [{ type: Optional }] },
1666
- { type: FormGroupDirective, decorators: [{ type: Optional }] },
1667
- { type: NgControl, decorators: [{ type: Self }, { type: Optional }] },
1668
- { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] }
1669
- ];
1670
- Select2.propDecorators = {
1671
- data: [{ type: Input }],
1672
- minCharForSearch: [{ type: Input }],
1673
- displaySearchStatus: [{ type: Input }],
1674
- placeholder: [{ type: Input }],
1675
- customSearchEnabled: [{ type: Input }],
1676
- limitSelection: [{ type: Input }],
1677
- listPosition: [{ type: Input }],
1678
- multiple: [{ type: Input }],
1679
- overlay: [{ type: Input }],
1680
- styleMode: [{ type: Input }],
1681
- noResultMessage: [{ type: Input }],
1682
- infiniteScrollDistance: [{ type: Input }],
1683
- infiniteScrollThrottle: [{ type: Input }],
1684
- infiniteScroll: [{ type: Input }],
1685
- editPattern: [{ type: Input }],
1686
- templates: [{ type: Input }],
1687
- resultMaxHeight: [{ type: Input }],
1688
- update: [{ type: Output }],
1689
- open: [{ type: Output }],
1690
- close: [{ type: Output }],
1691
- focus: [{ type: Output }],
1692
- blur: [{ type: Output }],
1693
- search: [{ type: Output }],
1694
- scroll: [{ type: Output }],
1695
- removeOption: [{ type: Output }],
1696
- minCountForSearch: [{ type: Input }],
1697
- id: [{ type: Input }, { type: HostBinding, args: ['id',] }],
1698
- required: [{ type: Input }],
1699
- disabled: [{ type: Input }],
1700
- hideSelectedItems: [{ type: Input }],
1701
- readonly: [{ type: Input }],
1702
- value: [{ type: Input }],
1703
- tabIndex: [{ type: Input }],
1704
- resettable: [{ type: Input }],
1705
- ariaInvalid: [{ type: HostBinding, args: ['attr.aria-invalid',] }],
1706
- classMaterial: [{ type: HostBinding, args: ['class.material',] }],
1707
- classNostyle: [{ type: HostBinding, args: ['class.nostyle',] }],
1708
- select2above: [{ type: HostBinding, args: ['class.select2-above',] }],
1709
- selection: [{ type: ViewChild, args: ['selection', { static: true },] }],
1710
- resultContainer: [{ type: ViewChild, args: ['results',] }],
1711
- results: [{ type: ViewChildren, args: ['result',] }],
1712
- searchInput: [{ type: ViewChild, args: ['searchInput',] }]
1713
- };
1714
- if (false) {
1715
- /**
1716
- * data of options & optiongrps
1717
- * @type {?}
1718
- */
1719
- Select2.prototype.data;
1720
- /** @type {?} */
1721
- Select2.prototype.minCharForSearch;
1722
- /** @type {?} */
1723
- Select2.prototype.displaySearchStatus;
1724
- /** @type {?} */
1725
- Select2.prototype.placeholder;
1726
- /** @type {?} */
1727
- Select2.prototype.customSearchEnabled;
1728
- /** @type {?} */
1729
- Select2.prototype.limitSelection;
1730
- /** @type {?} */
1731
- Select2.prototype.listPosition;
1732
- /**
1733
- * use the material style
1734
- * @type {?}
1735
- */
1736
- Select2.prototype.styleMode;
1737
- /**
1738
- * message when no result
1739
- * @type {?}
1740
- */
1741
- Select2.prototype.noResultMessage;
1742
- /**
1743
- * infinite scroll distance
1744
- * @type {?}
1745
- */
1746
- Select2.prototype.infiniteScrollDistance;
1747
- /**
1748
- * infinite scroll distance
1749
- * @type {?}
1750
- */
1751
- Select2.prototype.infiniteScrollThrottle;
1752
- /**
1753
- * use it for change the pattern of the filter search
1754
- * @type {?}
1755
- */
1756
- Select2.prototype.editPattern;
1757
- /**
1758
- * template for formating
1759
- * @type {?}
1760
- */
1761
- Select2.prototype.templates;
1762
- /**
1763
- * the max height of the results container when opening the select
1764
- * @type {?}
1765
- */
1766
- Select2.prototype.resultMaxHeight;
1767
- /** @type {?} */
1768
- Select2.prototype.update;
1769
- /** @type {?} */
1770
- Select2.prototype.open;
1771
- /** @type {?} */
1772
- Select2.prototype.close;
1773
- /** @type {?} */
1774
- Select2.prototype.focus;
1775
- /** @type {?} */
1776
- Select2.prototype.blur;
1777
- /** @type {?} */
1778
- Select2.prototype.search;
1779
- /** @type {?} */
1780
- Select2.prototype.scroll;
1781
- /** @type {?} */
1782
- Select2.prototype.removeOption;
1783
- /** @type {?} */
1784
- Select2.prototype.option;
1785
- /** @type {?} */
1786
- Select2.prototype.isOpen;
1787
- /** @type {?} */
1788
- Select2.prototype.searchStyle;
1789
- /**
1790
- * Whether the element is focused or not.
1791
- * @type {?}
1792
- */
1793
- Select2.prototype.focused;
1794
- /** @type {?} */
1795
- Select2.prototype.filteredData;
1796
- /** @type {?} */
1797
- Select2.prototype.overlayWidth;
1798
- /** @type {?} */
1799
- Select2.prototype._triggerRect;
1800
- /**
1801
- * @type {?}
1802
- * @private
1803
- */
1804
- Select2.prototype._minCountForSearch;
1805
- /**
1806
- * @type {?}
1807
- * @private
1808
- */
1809
- Select2.prototype.selection;
1810
- /**
1811
- * @type {?}
1812
- * @private
1813
- */
1814
- Select2.prototype.resultContainer;
1815
- /**
1816
- * @type {?}
1817
- * @private
1818
- */
1819
- Select2.prototype.results;
1820
- /**
1821
- * @type {?}
1822
- * @private
1823
- */
1824
- Select2.prototype.searchInput;
1825
- /**
1826
- * @type {?}
1827
- * @private
1828
- */
1829
- Select2.prototype.hoveringValue;
1830
- /**
1831
- * @type {?}
1832
- * @private
1833
- */
1834
- Select2.prototype.innerSearchText;
1835
- /**
1836
- * @type {?}
1837
- * @private
1838
- */
1839
- Select2.prototype.isSearchboxHidden;
1840
- /**
1841
- * @type {?}
1842
- * @private
1843
- */
1844
- Select2.prototype.selectionElement;
1845
- /**
1846
- * @type {?}
1847
- * @private
1848
- */
1849
- Select2.prototype._stateChanges;
1850
- /**
1851
- * Tab index for the element.
1852
- * @type {?}
1853
- * @private
1854
- */
1855
- Select2.prototype._tabIndex;
1856
- /**
1857
- * @type {?}
1858
- * @private
1859
- */
1860
- Select2.prototype._disabled;
1861
- /**
1862
- * @type {?}
1863
- * @private
1864
- */
1865
- Select2.prototype._required;
1866
- /**
1867
- * @type {?}
1868
- * @private
1869
- */
1870
- Select2.prototype._readonly;
1871
- /**
1872
- * @type {?}
1873
- * @private
1874
- */
1875
- Select2.prototype._multiple;
1876
- /**
1877
- * @type {?}
1878
- * @private
1879
- */
1880
- Select2.prototype._overlay;
1881
- /**
1882
- * @type {?}
1883
- * @private
1884
- */
1885
- Select2.prototype._resettable;
1886
- /**
1887
- * @type {?}
1888
- * @private
1889
- */
1890
- Select2.prototype._hideSelectedItems;
1891
- /**
1892
- * @type {?}
1893
- * @private
1894
- */
1895
- Select2.prototype._clickDetection;
1896
- /**
1897
- * @type {?}
1898
- * @private
1899
- */
1900
- Select2.prototype._clickDetectionFc;
1901
- /**
1902
- * @type {?}
1903
- * @private
1904
- */
1905
- Select2.prototype._id;
1906
- /**
1907
- * @type {?}
1908
- * @private
1909
- */
1910
- Select2.prototype._uid;
1911
- /**
1912
- * @type {?}
1913
- * @private
1914
- */
1915
- Select2.prototype._value;
1916
- /**
1917
- * @type {?}
1918
- * @private
1919
- */
1920
- Select2.prototype._previousNativeValue;
1921
- /**
1922
- * @type {?}
1923
- * @private
1924
- */
1925
- Select2.prototype._infiniteScroll;
1926
- /**
1927
- * View -> model callback called when select has been touched
1928
- * @type {?}
1929
- * @private
1930
- */
1931
- Select2.prototype._onTouched;
1932
- /**
1933
- * View -> model callback called when value changes
1934
- * @type {?}
1935
- * @private
1936
- */
1937
- Select2.prototype._onChange;
1938
- /**
1939
- * @type {?}
1940
- * @protected
1941
- */
1942
- Select2.prototype._viewportRuler;
1943
- /**
1944
- * @type {?}
1945
- * @private
1946
- */
1947
- Select2.prototype._changeDetectorRef;
1948
- /**
1949
- * @type {?}
1950
- * @private
1951
- */
1952
- Select2.prototype._parentForm;
1953
- /**
1954
- * @type {?}
1955
- * @private
1956
- */
1957
- Select2.prototype._parentFormGroup;
1958
- /** @type {?} */
1959
- Select2.prototype._control;
587
+ /**
588
+ * @fileoverview added by tsickle
589
+ * Generated from: lib/select2.component.ts
590
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
591
+ */
592
+ /** @type {?} */
593
+ let nextUniqueId = 0;
594
+ /** @type {?} */
595
+ const displaySearchStatusList = ['default', 'hidden', 'always'];
596
+ class Select2 {
597
+ /**
598
+ * @param {?} _viewportRuler
599
+ * @param {?} _changeDetectorRef
600
+ * @param {?} _parentForm
601
+ * @param {?} _parentFormGroup
602
+ * @param {?} _control
603
+ * @param {?} tabIndex
604
+ */
605
+ constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {
606
+ this._viewportRuler = _viewportRuler;
607
+ this._changeDetectorRef = _changeDetectorRef;
608
+ this._parentForm = _parentForm;
609
+ this._parentFormGroup = _parentFormGroup;
610
+ this._control = _control;
611
+ this.minCharForSearch = 0;
612
+ this.limitSelection = 0;
613
+ this.listPosition = 'below';
614
+ /**
615
+ * use the material style
616
+ */
617
+ this.styleMode = 'default';
618
+ /**
619
+ * infinite scroll distance
620
+ */
621
+ this.infiniteScrollDistance = 1.5;
622
+ /**
623
+ * infinite scroll distance
624
+ */
625
+ this.infiniteScrollThrottle = 150;
626
+ /**
627
+ * the max height of the results container when opening the select
628
+ */
629
+ this.resultMaxHeight = '200px';
630
+ this.update = new EventEmitter();
631
+ this.open = new EventEmitter();
632
+ this.close = new EventEmitter();
633
+ this.focus = new EventEmitter();
634
+ this.blur = new EventEmitter();
635
+ this.search = new EventEmitter();
636
+ this.scroll = new EventEmitter();
637
+ this.removeOption = new EventEmitter();
638
+ this.option = null;
639
+ this.isOpen = false;
640
+ /**
641
+ * Whether the element is focused or not.
642
+ */
643
+ this.focused = false;
644
+ this.hoveringValue = null;
645
+ this.innerSearchText = '';
646
+ this._stateChanges = new Subject();
647
+ this._disabled = false;
648
+ this._required = false;
649
+ this._readonly = false;
650
+ this._multiple = false;
651
+ this._overlay = false;
652
+ this._resettable = false;
653
+ this._hideSelectedItems = false;
654
+ this._clickDetection = false;
655
+ this._uid = `select2-${nextUniqueId++}`;
656
+ this._infiniteScroll = true;
657
+ /**
658
+ * View -> model callback called when select has been touched
659
+ */
660
+ this._onTouched = (/**
661
+ * @return {?}
662
+ */
663
+ () => {
664
+ // do nothing
665
+ });
666
+ /**
667
+ * View -> model callback called when value changes
668
+ */
669
+ this._onChange = (/**
670
+ * @return {?}
671
+ */
672
+ () => {
673
+ // do nothing
674
+ });
675
+ this.id = this.id;
676
+ this._tabIndex = parseInt(tabIndex, 10) || 0;
677
+ if (this._control) {
678
+ this._control.valueAccessor = this;
679
+ }
680
+ this._clickDetectionFc = this.clickDetection.bind(this);
681
+ }
682
+ /**
683
+ * data of options & optiongrps
684
+ * @param {?} data
685
+ * @return {?}
686
+ */
687
+ set data(data) {
688
+ this._data = data;
689
+ this.updateFilteredData();
690
+ }
691
+ /**
692
+ * @return {?}
693
+ */
694
+ get multiple() {
695
+ return this._multiple;
696
+ }
697
+ /**
698
+ * @param {?} value
699
+ * @return {?}
700
+ */
701
+ set multiple(value) {
702
+ this._multiple = this._coerceBooleanProperty(value);
703
+ this.ngOnInit();
704
+ }
705
+ /**
706
+ * use the material style
707
+ * @return {?}
708
+ */
709
+ get overlay() {
710
+ return this._overlay;
711
+ }
712
+ /**
713
+ * @param {?} value
714
+ * @return {?}
715
+ */
716
+ set overlay(value) {
717
+ this._overlay = this._coerceBooleanProperty(value);
718
+ }
719
+ /**
720
+ * infinite scroll activated
721
+ * @return {?}
722
+ */
723
+ get infiniteScroll() {
724
+ return this._infiniteScroll;
725
+ }
726
+ /**
727
+ * @param {?} value
728
+ * @return {?}
729
+ */
730
+ set infiniteScroll(value) {
731
+ this._infiniteScroll = this._coerceBooleanProperty(value);
732
+ }
733
+ /**
734
+ * @return {?}
735
+ */
736
+ get select2Options() {
737
+ return this.multiple ? ((/** @type {?} */ (this.option))) : null;
738
+ }
739
+ /**
740
+ * @return {?}
741
+ */
742
+ get select2Option() {
743
+ return this.multiple ? null : ((/** @type {?} */ (this.option)));
744
+ }
745
+ /**
746
+ * @return {?}
747
+ */
748
+ get searchText() {
749
+ return this.innerSearchText;
750
+ }
751
+ /**
752
+ * @param {?} text
753
+ * @return {?}
754
+ */
755
+ set searchText(text) {
756
+ if (this.customSearchEnabled) {
757
+ this.search.emit({
758
+ component: this,
759
+ value: this._value,
760
+ search: text,
761
+ });
762
+ }
763
+ this.innerSearchText = text;
764
+ }
765
+ /**
766
+ * minimal data of show the search field
767
+ * @return {?}
768
+ */
769
+ get minCountForSearch() {
770
+ return this._minCountForSearch;
771
+ }
772
+ /**
773
+ * @param {?} value
774
+ * @return {?}
775
+ */
776
+ set minCountForSearch(value) {
777
+ this._minCountForSearch = value;
778
+ this.updateSearchBox();
779
+ }
780
+ /**
781
+ * Unique id of the element.
782
+ * @return {?}
783
+ */
784
+ get id() {
785
+ return this._id;
786
+ }
787
+ /**
788
+ * @param {?} value
789
+ * @return {?}
790
+ */
791
+ set id(value) {
792
+ this._id = value || this._uid;
793
+ }
794
+ /**
795
+ * Whether the element is required.
796
+ * @return {?}
797
+ */
798
+ get required() {
799
+ return this._required;
800
+ }
801
+ /**
802
+ * @param {?} value
803
+ * @return {?}
804
+ */
805
+ set required(value) {
806
+ this._required = this._coerceBooleanProperty(value);
807
+ }
808
+ /**
809
+ * Whether selected items should be hidden.
810
+ * @return {?}
811
+ */
812
+ get disabled() {
813
+ return this._control ? this._control.disabled : this._disabled;
814
+ }
815
+ /**
816
+ * @param {?} value
817
+ * @return {?}
818
+ */
819
+ set disabled(value) {
820
+ this._disabled = this._coerceBooleanProperty(value);
821
+ }
822
+ /**
823
+ * Whether items are hidden when has.
824
+ * @return {?}
825
+ */
826
+ get hideSelectedItems() {
827
+ return this._hideSelectedItems;
828
+ }
829
+ /**
830
+ * @param {?} value
831
+ * @return {?}
832
+ */
833
+ set hideSelectedItems(value) {
834
+ this._hideSelectedItems = this._coerceBooleanProperty(value);
835
+ }
836
+ /**
837
+ * Whether the element is readonly.
838
+ * @return {?}
839
+ */
840
+ get readonly() {
841
+ return this._readonly;
842
+ }
843
+ /**
844
+ * @param {?} value
845
+ * @return {?}
846
+ */
847
+ set readonly(value) {
848
+ this._readonly = this._coerceBooleanProperty(value);
849
+ }
850
+ /**
851
+ * The input element's value.
852
+ * @return {?}
853
+ */
854
+ get value() {
855
+ return this._value;
856
+ }
857
+ /**
858
+ * @param {?} value
859
+ * @return {?}
860
+ */
861
+ set value(value) {
862
+ if (this.testValueChange(this._value, value)) {
863
+ setTimeout((/**
864
+ * @return {?}
865
+ */
866
+ () => {
867
+ this._value = value;
868
+ this.writeValue(value);
869
+ }), 10);
870
+ }
871
+ }
872
+ /**
873
+ * Tab index for the select2 element.
874
+ * @return {?}
875
+ */
876
+ get tabIndex() {
877
+ return this.disabled ? -1 : this._tabIndex;
878
+ }
879
+ /**
880
+ * @param {?} value
881
+ * @return {?}
882
+ */
883
+ set tabIndex(value) {
884
+ if (typeof value !== 'undefined') {
885
+ this._tabIndex = value;
886
+ }
887
+ }
888
+ /**
889
+ * reset with no selected value
890
+ * @return {?}
891
+ */
892
+ get resettable() {
893
+ return this._resettable;
894
+ }
895
+ /**
896
+ * @param {?} value
897
+ * @return {?}
898
+ */
899
+ set resettable(value) {
900
+ this._resettable = this._coerceBooleanProperty(value);
901
+ }
902
+ /**
903
+ * @return {?}
904
+ */
905
+ get ariaInvalid() {
906
+ return this._isErrorState();
907
+ }
908
+ /**
909
+ * @return {?}
910
+ */
911
+ get classMaterial() {
912
+ return this.styleMode === 'material';
913
+ }
914
+ /**
915
+ * @return {?}
916
+ */
917
+ get classNostyle() {
918
+ return this.styleMode === 'noStyle';
919
+ }
920
+ /**
921
+ * @return {?}
922
+ */
923
+ get select2above() {
924
+ return !this.overlay ? this.listPosition === 'above' : this._isAbobeOverlay();
925
+ }
926
+ /**
927
+ * @return {?}
928
+ */
929
+ get _positions() {
930
+ if (this.listPosition === 'auto') {
931
+ [
932
+ {
933
+ originX: 'start',
934
+ originY: 'bottom',
935
+ overlayX: 'start',
936
+ overlayY: 'bottom',
937
+ },
938
+ {
939
+ originX: 'start',
940
+ originY: 'top',
941
+ overlayX: 'start',
942
+ overlayY: 'top',
943
+ },
944
+ ];
945
+ }
946
+ else {
947
+ return null;
948
+ }
949
+ }
950
+ /**
951
+ * @private
952
+ * @return {?}
953
+ */
954
+ get resultsElement() {
955
+ var _a;
956
+ return (_a = this.resultContainer) === null || _a === void 0 ? void 0 : _a.nativeElement;
957
+ }
958
+ /**
959
+ * @return {?}
960
+ */
961
+ ngOnInit() {
962
+ this._viewportRuler.change(100).subscribe((/**
963
+ * @return {?}
964
+ */
965
+ () => {
966
+ if (this.isOpen) {
967
+ this.triggerRect();
968
+ }
969
+ }));
970
+ /** @type {?} */
971
+ const option = Select2Utils.getOptionsByValue(this._data, this._control ? this._control.value : this.value, this.multiple);
972
+ if (option !== null) {
973
+ this.option = option;
974
+ }
975
+ if (!Array.isArray(option)) {
976
+ this.hoveringValue = (/** @type {?} */ (this.value));
977
+ }
978
+ this.updateSearchBox();
979
+ }
980
+ /**
981
+ * @return {?}
982
+ */
983
+ ngAfterViewInit() {
984
+ this.cdkConnectedOverlay.positionChange.subscribe((/**
985
+ * @param {?} posChange
986
+ * @return {?}
987
+ */
988
+ (posChange) => {
989
+ var _a;
990
+ if (this.listPosition === 'auto' && ((_a = posChange.connectionPair) === null || _a === void 0 ? void 0 : _a.originY) &&
991
+ this._overlayPosition !== posChange.connectionPair.originY) {
992
+ this.triggerRect();
993
+ this._overlayPosition = posChange.connectionPair.originY;
994
+ this._changeDetectorRef.detectChanges();
995
+ }
996
+ }));
997
+ this.selectionElement = this.selection.nativeElement;
998
+ this.triggerRect();
999
+ }
1000
+ /**
1001
+ * @return {?}
1002
+ */
1003
+ ngDoCheck() {
1004
+ var _a;
1005
+ this.updateSearchBox();
1006
+ this._dirtyCheckNativeValue();
1007
+ if (this._triggerRect) {
1008
+ if (this.overlayWidth !== this._triggerRect.width) {
1009
+ this.overlayWidth = this._triggerRect.width;
1010
+ }
1011
+ if (((_a = this._dropdownRect) === null || _a === void 0 ? void 0 : _a.height) > 0 && this.overlayHeight !== this._dropdownRect.height) {
1012
+ this.overlayHeight = this.listPosition === 'auto' ? this._dropdownRect.height : 0;
1013
+ }
1014
+ }
1015
+ }
1016
+ /**
1017
+ * @return {?}
1018
+ */
1019
+ ngOnDestroy() {
1020
+ window.document.body.removeEventListener('click', this._clickDetectionFc);
1021
+ }
1022
+ /**
1023
+ * @return {?}
1024
+ */
1025
+ updateSearchBox() {
1026
+ /** @type {?} */
1027
+ const hidden = this.customSearchEnabled
1028
+ ? false
1029
+ : Select2Utils.isSearchboxHiddex(this._data, this._minCountForSearch);
1030
+ if (this.isSearchboxHidden !== hidden) {
1031
+ this.isSearchboxHidden = hidden;
1032
+ }
1033
+ }
1034
+ /**
1035
+ * @return {?}
1036
+ */
1037
+ hideSearch() {
1038
+ /** @type {?} */
1039
+ const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1 ? this.displaySearchStatus : 'default';
1040
+ return (displaySearchStatus === 'default' && this.isSearchboxHidden) || displaySearchStatus === 'hidden';
1041
+ }
1042
+ /**
1043
+ * @param {?} option
1044
+ * @return {?}
1045
+ */
1046
+ getOptionStyle(option) {
1047
+ return ('select2-results__option ' +
1048
+ (option.hide ? 'select2-results__option--hide ' : '') +
1049
+ (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') +
1050
+ (option.classes || ''));
1051
+ }
1052
+ /**
1053
+ * @param {?} option
1054
+ * @return {?}
1055
+ */
1056
+ mouseenter(option) {
1057
+ if (!option.disabled) {
1058
+ this.hoveringValue = option.value;
1059
+ }
1060
+ }
1061
+ /**
1062
+ * @param {?} option
1063
+ * @return {?}
1064
+ */
1065
+ click(option) {
1066
+ if (this.testSelection(option)) {
1067
+ this.select(option);
1068
+ }
1069
+ }
1070
+ /**
1071
+ * @param {?} e
1072
+ * @return {?}
1073
+ */
1074
+ reset(e) {
1075
+ this.select(null);
1076
+ e.preventDefault();
1077
+ e.stopPropagation();
1078
+ }
1079
+ /**
1080
+ * @param {?} event
1081
+ * @return {?}
1082
+ */
1083
+ prevChange(event) {
1084
+ event.stopPropagation();
1085
+ }
1086
+ /**
1087
+ * @return {?}
1088
+ */
1089
+ toggleOpenAndClose() {
1090
+ if (this.disabled) {
1091
+ return;
1092
+ }
1093
+ this._focus(true);
1094
+ this.isOpen = !this.isOpen;
1095
+ if (this.isOpen) {
1096
+ this.innerSearchText = '';
1097
+ this.updateFilteredData();
1098
+ this._focusSearchboxOrResultsElement();
1099
+ setTimeout((/**
1100
+ * @return {?}
1101
+ */
1102
+ () => {
1103
+ if (this.option) {
1104
+ /** @type {?} */
1105
+ const option = this.option instanceof Array ? this.option[0] : this.option;
1106
+ this.updateScrollFromOption(option);
1107
+ }
1108
+ else if (this.resultsElement) {
1109
+ this.resultsElement.scrollTop = 0;
1110
+ }
1111
+ setTimeout((/**
1112
+ * @return {?}
1113
+ */
1114
+ () => {
1115
+ var _a, _b;
1116
+ this.triggerRect();
1117
+ (_b = (_a = this.cdkConnectedOverlay) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.updatePosition();
1118
+ }), 100);
1119
+ }));
1120
+ this.open.emit(this);
1121
+ }
1122
+ else {
1123
+ this.close.emit(this);
1124
+ }
1125
+ if (this.isOpen && !this._clickDetection) {
1126
+ setTimeout((/**
1127
+ * @return {?}
1128
+ */
1129
+ () => {
1130
+ window.document.body.addEventListener('click', this._clickDetectionFc, false);
1131
+ this._clickDetection = true;
1132
+ }), timeout);
1133
+ }
1134
+ this._changeDetectorRef.markForCheck();
1135
+ }
1136
+ /**
1137
+ * @param {?} option
1138
+ * @param {?} defaut
1139
+ * @return {?}
1140
+ */
1141
+ hasTemplate(option, defaut) {
1142
+ var _a, _b;
1143
+ return (this.templates instanceof TemplateRef ||
1144
+ ((_a = this.templates) === null || _a === void 0 ? void 0 : _a[option.templateId]) instanceof TemplateRef ||
1145
+ ((_b = this.templates) === null || _b === void 0 ? void 0 : _b[defaut]) instanceof TemplateRef);
1146
+ }
1147
+ /**
1148
+ * @param {?} option
1149
+ * @param {?} defaut
1150
+ * @return {?}
1151
+ */
1152
+ getTemplate(option, defaut) {
1153
+ return this.hasTemplate(option, defaut)
1154
+ ? this.templates[option.templateId] || this.templates[defaut] || this.templates
1155
+ : undefined;
1156
+ }
1157
+ /**
1158
+ * @return {?}
1159
+ */
1160
+ triggerRect() {
1161
+ var _a;
1162
+ this._triggerRect = this.selectionElement.getBoundingClientRect();
1163
+ this._dropdownRect = ((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.nativeElement) ? this.dropdown.nativeElement.getBoundingClientRect()
1164
+ : undefined;
1165
+ }
1166
+ /**
1167
+ * @private
1168
+ * @param {?} option
1169
+ * @return {?}
1170
+ */
1171
+ testSelection(option) {
1172
+ if (option.disabled) {
1173
+ return false;
1174
+ }
1175
+ if (!this.multiple ||
1176
+ !this.limitSelection ||
1177
+ (Array.isArray(this._value) && this._value.length < this.limitSelection)) {
1178
+ return true;
1179
+ }
1180
+ return false;
1181
+ }
1182
+ /**
1183
+ * @private
1184
+ * @param {?} value1
1185
+ * @param {?} value2
1186
+ * @return {?}
1187
+ */
1188
+ testValueChange(value1, value2) {
1189
+ var _a, _b;
1190
+ if (((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined)) ||
1191
+ value1 === value2) {
1192
+ return false;
1193
+ }
1194
+ if (this.multiple && ((_a = ((/** @type {?} */ (value1)))) === null || _a === void 0 ? void 0 : _a.length) && ((_b = ((/** @type {?} */ (value2)))) === null || _b === void 0 ? void 0 : _b.length) &&
1195
+ ((/** @type {?} */ (value1))).length === ((/** @type {?} */ (value2))).length) {
1196
+ for (const e1 of (/** @type {?} */ (value1))) {
1197
+ /** @type {?} */
1198
+ const test = ((/** @type {?} */ (value2))).indexOf(e1) > -1;
1199
+ if (!test) {
1200
+ return true;
1201
+ }
1202
+ }
1203
+ return false;
1204
+ }
1205
+ return true;
1206
+ }
1207
+ /**
1208
+ * @private
1209
+ * @return {?}
1210
+ */
1211
+ updateFilteredData() {
1212
+ setTimeout((/**
1213
+ * @return {?}
1214
+ */
1215
+ () => {
1216
+ /** @type {?} */
1217
+ let result = this._data;
1218
+ if (this.multiple && this.hideSelectedItems) {
1219
+ result = Select2Utils.getFilteredSelectedData(result, this.option);
1220
+ }
1221
+ if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {
1222
+ result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);
1223
+ }
1224
+ if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {
1225
+ this.hoveringValue = Select2Utils.getFirstAvailableOption(result);
1226
+ }
1227
+ this.filteredData = result;
1228
+ this._changeDetectorRef.markForCheck();
1229
+ }));
1230
+ }
1231
+ /**
1232
+ * @private
1233
+ * @param {?} e
1234
+ * @return {?}
1235
+ */
1236
+ clickDetection(e) {
1237
+ if (!this.ifParentContainsClass((/** @type {?} */ (e.target)), 'selection')) {
1238
+ if (this.isOpen && !this.ifParentContainsClass((/** @type {?} */ (e.target)), 'select2-dropdown')) {
1239
+ this.toggleOpenAndClose();
1240
+ }
1241
+ if (!this.ifParentContainsId((/** @type {?} */ (e.target)), this._id)) {
1242
+ this.clickExit();
1243
+ }
1244
+ }
1245
+ else if (this.isOpen && !this.ifParentContainsId((/** @type {?} */ (e.target)), this._id)) {
1246
+ this.toggleOpenAndClose();
1247
+ this.clickExit();
1248
+ }
1249
+ }
1250
+ /**
1251
+ * @private
1252
+ * @return {?}
1253
+ */
1254
+ clickExit() {
1255
+ this._focus(false);
1256
+ window.document.body.removeEventListener('click', this._clickDetectionFc);
1257
+ this._clickDetection = false;
1258
+ }
1259
+ /**
1260
+ * @private
1261
+ * @param {?} element
1262
+ * @param {?} cssClass
1263
+ * @return {?}
1264
+ */
1265
+ ifParentContainsClass(element, cssClass) {
1266
+ return this.getParentElementByClass(element, cssClass) !== null;
1267
+ }
1268
+ /**
1269
+ * @private
1270
+ * @param {?} element
1271
+ * @param {?} id
1272
+ * @return {?}
1273
+ */
1274
+ ifParentContainsId(element, id) {
1275
+ return this.getParentElementById(element, id) !== null;
1276
+ }
1277
+ /**
1278
+ * @private
1279
+ * @param {?} element
1280
+ * @param {?} cssClass
1281
+ * @return {?}
1282
+ */
1283
+ getParentElementByClass(element, cssClass) {
1284
+ if (this.containClasses(element, cssClass.trim().split(/\s+/))) {
1285
+ return element;
1286
+ }
1287
+ return element.parentElement ? this.getParentElementByClass(element.parentElement, cssClass) : null;
1288
+ }
1289
+ /**
1290
+ * @private
1291
+ * @param {?} element
1292
+ * @param {?} id
1293
+ * @return {?}
1294
+ */
1295
+ getParentElementById(element, id) {
1296
+ if (element.id === id) {
1297
+ return element;
1298
+ }
1299
+ return element.parentElement ? this.getParentElementById(element.parentElement, id) : null;
1300
+ }
1301
+ /**
1302
+ * @private
1303
+ * @param {?} element
1304
+ * @param {?} cssClasses
1305
+ * @return {?}
1306
+ */
1307
+ containClasses(element, cssClasses) {
1308
+ if (!element.classList) {
1309
+ return false;
1310
+ }
1311
+ for (const cssClass of cssClasses) {
1312
+ if (!element.classList.contains(cssClass)) {
1313
+ return false;
1314
+ }
1315
+ }
1316
+ return true;
1317
+ }
1318
+ /**
1319
+ * @return {?}
1320
+ */
1321
+ focusin() {
1322
+ if (this.disabled) {
1323
+ return;
1324
+ }
1325
+ this._focus(true);
1326
+ }
1327
+ /**
1328
+ * @return {?}
1329
+ */
1330
+ focusout() {
1331
+ if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {
1332
+ this._focus(false);
1333
+ this._onTouched();
1334
+ }
1335
+ }
1336
+ /**
1337
+ * @private
1338
+ * @return {?}
1339
+ */
1340
+ moveUp() {
1341
+ this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));
1342
+ }
1343
+ /**
1344
+ * @private
1345
+ * @return {?}
1346
+ */
1347
+ moveDown() {
1348
+ this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));
1349
+ }
1350
+ /**
1351
+ * @private
1352
+ * @param {?} option
1353
+ * @return {?}
1354
+ */
1355
+ updateScrollFromOption(option) {
1356
+ if (option) {
1357
+ this.hoveringValue = option.value;
1358
+ /** @type {?} */
1359
+ const domElement = this.results.find((/**
1360
+ * @param {?} r
1361
+ * @return {?}
1362
+ */
1363
+ r => r.nativeElement.innerText.trim() === option.label));
1364
+ if (domElement && this.resultsElement) {
1365
+ this.resultsElement.scrollTop = 0;
1366
+ /** @type {?} */
1367
+ const listClientRect = this.resultsElement.getBoundingClientRect();
1368
+ /** @type {?} */
1369
+ const optionClientRect = domElement.nativeElement.getBoundingClientRect();
1370
+ this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;
1371
+ }
1372
+ }
1373
+ }
1374
+ /**
1375
+ * @private
1376
+ * @return {?}
1377
+ */
1378
+ selectByEnter() {
1379
+ if (this.hoveringValue) {
1380
+ /** @type {?} */
1381
+ const option = Select2Utils.getOptionByValue(this._data, this.hoveringValue);
1382
+ this.select(option);
1383
+ }
1384
+ }
1385
+ /**
1386
+ * @param {?} option
1387
+ * @return {?}
1388
+ */
1389
+ select(option) {
1390
+ /** @type {?} */
1391
+ let value;
1392
+ if (option !== null) {
1393
+ if (this.multiple) {
1394
+ /** @type {?} */
1395
+ const options = (/** @type {?} */ (this.option));
1396
+ /** @type {?} */
1397
+ const index = options.findIndex((/**
1398
+ * @param {?} op
1399
+ * @return {?}
1400
+ */
1401
+ op => op.value === option.value));
1402
+ if (index === -1) {
1403
+ options.push(option);
1404
+ }
1405
+ else {
1406
+ options.splice(index, 1);
1407
+ }
1408
+ value = ((/** @type {?} */ (this.option))).map((/**
1409
+ * @param {?} op
1410
+ * @return {?}
1411
+ */
1412
+ op => op.value));
1413
+ }
1414
+ else {
1415
+ this.option = option;
1416
+ if (this.isOpen) {
1417
+ this.isOpen = false;
1418
+ this.close.emit(this);
1419
+ if (this.selectionElement) {
1420
+ this.selectionElement.focus();
1421
+ }
1422
+ }
1423
+ value = this.option.value;
1424
+ }
1425
+ }
1426
+ else {
1427
+ this.option = null;
1428
+ }
1429
+ if (this.multiple && this.hideSelectedItems) {
1430
+ this.updateFilteredData();
1431
+ }
1432
+ if (this._control) {
1433
+ this._onChange(value);
1434
+ }
1435
+ else {
1436
+ this._value = value;
1437
+ }
1438
+ this.update.emit({
1439
+ component: this,
1440
+ value: value,
1441
+ options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
1442
+ });
1443
+ }
1444
+ /**
1445
+ * @param {?} e
1446
+ * @return {?}
1447
+ */
1448
+ keyDown(e) {
1449
+ if (this._testKey(e, ['ArrowDown', 40])) {
1450
+ this.moveDown();
1451
+ e.preventDefault();
1452
+ }
1453
+ else if (this._testKey(e, ['ArrowUp', 38])) {
1454
+ this.moveUp();
1455
+ e.preventDefault();
1456
+ }
1457
+ else if (this._testKey(e, ['Enter', 13])) {
1458
+ this.selectByEnter();
1459
+ e.preventDefault();
1460
+ }
1461
+ else if (this._testKey(e, ['Escape', 'Tab', 9, 27]) && this.isOpen) {
1462
+ this.toggleOpenAndClose();
1463
+ this._focus(false);
1464
+ }
1465
+ }
1466
+ /**
1467
+ * @param {?} e
1468
+ * @return {?}
1469
+ */
1470
+ openKey(e) {
1471
+ if (this._testKey(e, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {
1472
+ this.toggleOpenAndClose();
1473
+ e.preventDefault();
1474
+ }
1475
+ else if (this._testKey(e, ['Escape', 'Tab', 9, 27])) {
1476
+ this._focus(false);
1477
+ this._onTouched();
1478
+ }
1479
+ }
1480
+ /**
1481
+ * @param {?} _index
1482
+ * @param {?} item
1483
+ * @return {?}
1484
+ */
1485
+ trackBy(_index, item) {
1486
+ return item.value;
1487
+ }
1488
+ /**
1489
+ * @param {?} e
1490
+ * @return {?}
1491
+ */
1492
+ searchUpdate(e) {
1493
+ this.searchText = ((/** @type {?} */ (e.target))).value;
1494
+ this.updateFilteredData();
1495
+ }
1496
+ /**
1497
+ * @param {?} option
1498
+ * @return {?}
1499
+ */
1500
+ isSelected(option) {
1501
+ return Select2Utils.isSelected(this.option, option, this.multiple);
1502
+ }
1503
+ /**
1504
+ * @param {?} option
1505
+ * @return {?}
1506
+ */
1507
+ isDisabled(option) {
1508
+ return option.disabled ? 'true' : 'false';
1509
+ }
1510
+ /**
1511
+ * @param {?} e
1512
+ * @param {?} option
1513
+ * @return {?}
1514
+ */
1515
+ removeSelection(e, option) {
1516
+ Select2Utils.removeSelection(this.option, option);
1517
+ if (this.multiple && this.hideSelectedItems) {
1518
+ this.updateFilteredData();
1519
+ }
1520
+ /** @type {?} */
1521
+ const value = ((/** @type {?} */ (this.option))).map((/**
1522
+ * @param {?} op
1523
+ * @return {?}
1524
+ */
1525
+ op => op.value));
1526
+ if (this._control) {
1527
+ this._onChange(value);
1528
+ }
1529
+ else {
1530
+ this._value = value;
1531
+ }
1532
+ this.update.emit({
1533
+ component: this,
1534
+ value: value,
1535
+ options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,
1536
+ });
1537
+ this.removeOption.emit({
1538
+ component: this,
1539
+ value: value,
1540
+ removedOption: option,
1541
+ });
1542
+ e.preventDefault();
1543
+ e.stopPropagation();
1544
+ if (this.isOpen) {
1545
+ this._focusSearchboxOrResultsElement();
1546
+ }
1547
+ }
1548
+ /**
1549
+ * Sets the model value. Implemented as part of ControlValueAccessor.
1550
+ * @param {?} value
1551
+ * @return {?}
1552
+ */
1553
+ writeValue(value) {
1554
+ this._setSelectionByValue(value);
1555
+ }
1556
+ /**
1557
+ * Saves a callback function to be invoked when the select's value
1558
+ * changes from user input. Part of the ControlValueAccessor interface
1559
+ * required to integrate with Angular's core forms API.
1560
+ *
1561
+ * @param {?} fn Callback to be triggered when the value changes.
1562
+ * @return {?}
1563
+ */
1564
+ registerOnChange(fn) {
1565
+ this._onChange = fn;
1566
+ }
1567
+ /**
1568
+ * Saves a callback function to be invoked when the select is blurred
1569
+ * by the user. Part of the ControlValueAccessor interface required
1570
+ * to integrate with Angular's core forms API.
1571
+ *
1572
+ * @param {?} fn Callback to be triggered when the component has been touched.
1573
+ * @return {?}
1574
+ */
1575
+ registerOnTouched(fn) {
1576
+ this._onTouched = fn;
1577
+ }
1578
+ /**
1579
+ * Sets whether the component should be disabled.
1580
+ * Implemented as part of ControlValueAccessor.
1581
+ * @param {?} isDisabled
1582
+ * @return {?}
1583
+ */
1584
+ setDisabledState(isDisabled) {
1585
+ this.disabled = isDisabled;
1586
+ }
1587
+ /**
1588
+ * @param {?} way
1589
+ * @return {?}
1590
+ */
1591
+ onScroll(way) {
1592
+ this.scroll.emit({
1593
+ component: this,
1594
+ way,
1595
+ search: this.innerSearchText,
1596
+ });
1597
+ }
1598
+ /**
1599
+ * @return {?}
1600
+ */
1601
+ _isErrorState() {
1602
+ /** @type {?} */
1603
+ const isInvalid = this._control && this._control.invalid;
1604
+ /** @type {?} */
1605
+ const isTouched = this._control && this._control.touched;
1606
+ /** @type {?} */
1607
+ const isSubmitted = (this._parentFormGroup && this._parentFormGroup.submitted) ||
1608
+ (this._parentForm && this._parentForm.submitted);
1609
+ return !!(isInvalid && (isTouched || isSubmitted));
1610
+ }
1611
+ /**
1612
+ * @private
1613
+ * @param {?} event
1614
+ * @param {?=} refs
1615
+ * @return {?}
1616
+ */
1617
+ _testKey(event, refs = []) {
1618
+ return this._isKey(this._getKey(event), refs);
1619
+ }
1620
+ /**
1621
+ * @private
1622
+ * @param {?} event
1623
+ * @return {?}
1624
+ */
1625
+ _getKey(event) {
1626
+ /** @type {?} */
1627
+ let code;
1628
+ if (event.key !== undefined) {
1629
+ code = event.key;
1630
+ }
1631
+ else if (event['keyIdentifier'] !== undefined) {
1632
+ code = event['keyIdentifier'];
1633
+ }
1634
+ else if (event['keyCode'] !== undefined) {
1635
+ code = event['keyCode'];
1636
+ }
1637
+ else {
1638
+ event.preventDefault();
1639
+ }
1640
+ return code;
1641
+ }
1642
+ /**
1643
+ * @private
1644
+ * @param {?} code
1645
+ * @param {?=} refs
1646
+ * @return {?}
1647
+ */
1648
+ _isKey(code, refs = []) {
1649
+ return refs && refs.length > 0 ? refs.indexOf(code) !== -1 : false;
1650
+ }
1651
+ /**
1652
+ * Sets the selected option based on a value. If no option can be
1653
+ * found with the designated value, the select trigger is cleared.
1654
+ * @private
1655
+ * @param {?} value
1656
+ * @return {?}
1657
+ */
1658
+ _setSelectionByValue(value) {
1659
+ if (this.option || (value !== undefined && value !== null)) {
1660
+ /** @type {?} */
1661
+ const isArray = Array.isArray(value);
1662
+ if (this.multiple && value && !isArray) {
1663
+ throw new Error('Non array value.');
1664
+ }
1665
+ else if (this._data) {
1666
+ if (this.multiple) {
1667
+ this.option = []; // if value is null, then empty option and return
1668
+ if (isArray) {
1669
+ // value is not null. Preselect value
1670
+ /** @type {?} */
1671
+ const selectedValues = Select2Utils.getOptionsByValue(this._data, value, this.multiple);
1672
+ selectedValues.map((/**
1673
+ * @param {?} item
1674
+ * @return {?}
1675
+ */
1676
+ item => this.select(item)));
1677
+ }
1678
+ }
1679
+ else {
1680
+ this.select(Select2Utils.getOptionByValue(this._data, value));
1681
+ }
1682
+ }
1683
+ else if (this._control) {
1684
+ this._control.viewToModelUpdate(value);
1685
+ }
1686
+ this._changeDetectorRef.markForCheck();
1687
+ }
1688
+ }
1689
+ /**
1690
+ * Does some manual dirty checking on the native input `value` property.
1691
+ * @private
1692
+ * @return {?}
1693
+ */
1694
+ _dirtyCheckNativeValue() {
1695
+ /** @type {?} */
1696
+ const newValue = this.value;
1697
+ if (this._previousNativeValue !== newValue) {
1698
+ this._previousNativeValue = newValue;
1699
+ this._stateChanges.next();
1700
+ }
1701
+ }
1702
+ /**
1703
+ * @private
1704
+ * @param {?} value
1705
+ * @return {?}
1706
+ */
1707
+ _coerceBooleanProperty(value) {
1708
+ return value != null && `${value}` !== 'false';
1709
+ }
1710
+ /**
1711
+ * @private
1712
+ * @return {?}
1713
+ */
1714
+ _focusSearchboxOrResultsElement() {
1715
+ if (!this.isSearchboxHidden) {
1716
+ setTimeout((/**
1717
+ * @return {?}
1718
+ */
1719
+ () => {
1720
+ if (this.searchInput && this.searchInput.nativeElement) {
1721
+ this.searchInput.nativeElement.focus();
1722
+ }
1723
+ }));
1724
+ }
1725
+ else if (this.resultsElement) {
1726
+ this.resultsElement.focus();
1727
+ }
1728
+ }
1729
+ /**
1730
+ * @private
1731
+ * @param {?} state
1732
+ * @return {?}
1733
+ */
1734
+ _focus(state) {
1735
+ if (!state && this.focused) {
1736
+ this.focused = state;
1737
+ this.blur.emit(this);
1738
+ }
1739
+ else if (state && !this.focused) {
1740
+ this.focused = state;
1741
+ this.focus.emit(this);
1742
+ }
1743
+ }
1744
+ /**
1745
+ * @private
1746
+ * @return {?}
1747
+ */
1748
+ _isAbobeOverlay() {
1749
+ return this.overlay && this._overlayPosition && this.listPosition === 'auto'
1750
+ ? this._overlayPosition === 'top'
1751
+ : this.listPosition === 'above';
1752
+ }
1753
+ }
1754
+ Select2.decorators = [
1755
+ { type: Component, args: [{
1756
+ selector: 'select2',
1757
+ 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 select2-container--focus\"\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 [attr.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 <span *ngIf=\"select2Option\" [innerHTML]=\"select2Option.label\"></span>\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 [class.select2-selection__placeholder__option]=\"select2Options?.length > 0\"\n class=\"select2-selection__placeholder\"\n >{{ placeholder }}</span\n >\n <li *ngFor=\"let op of option; trackBy: trackBy\" class=\"select2-selection__choice\" [title]=\"op.label\">\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 </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 </ul>\n </div>\n </div>\n </div>\n</ng-template>\n",
1758
+ styles: [".select2-label{color:#000;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{opacity:0;position:absolute;width:0}.select2-container .select2-selection--single{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;flex:1 1 auto;overflow:hidden;padding:0 0 0 8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{border:none;box-sizing:border-box;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:#fff;background:var(--select2-dropdown-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-dropdown-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);box-sizing:border-box;display:block;height:0;overflow:hidden;position:absolute;width:100%;z-index:1051}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;color:#000;color:var(--select2-option-text-color,#000);padding:6px;user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{opacity:1;width:100%}.select2-container--open .select2-dropdown{height:auto;overflow: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{box-sizing:border-box;padding:4px;width:100%}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{background:#fff;border:0;display:block;filter:alpha(opacity=0);height:auto;left:0;margin:0;min-height:100%;min-width:100%;opacity:0;padding:0;position:fixed;top:0;width:auto;z-index:99}.select2-required:before{color:red;color:var(--select2-required-color,red);content:\"*\"}.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:#fff;background:var(--select2-selection-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-selection-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;color:var(--select2-selection-text-color,#444);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:#999;color:var(--select2-placeholder-color,#999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;text-overflow:ellipsis;text-overflow:var(--select2-placeholder-overflow,ellipsis);white-space:nowrap}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__arrow,.select2-container--default .select2-selection--single .select2-selection__reset{align-items:center;display:flex;justify-content:center;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow:before{border-bottom:0 solid var(--select2-arrow-color,#888);border-color:#888 transparent;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid var(--select2-arrow-color,#888);content:\" \";height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:#999;color:var(--select2-reset-color,#999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:#eee;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-bottom-color:var(--select2-arrow-color,#888);border-color:transparent transparent #888;border-right-color:transparent;border-top-color:transparent;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:#fff;background:var(--select2-selection-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-selection-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;flex:1 1 auto;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{color:#999;color:var(--select2-placeholder-color,#999);display:block;float:left;margin-top:5px;overflow:hidden;text-overflow:ellipsis;text-overflow:var(--select2-placeholder-overflow,ellipsis);white-space:nowrap;width:100%}.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-right:10px;margin-top:5px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background:#e4e4e4;background:var(--select2-selection-choice-background,#e4e4e4);border:1px solid #aaa;border:1px solid var(--select2-selection-choice-border-color,#aaa);border-radius:4px;border-radius:var(--select2-selection-border-radius,4px);color:#000;color:var(--select2-selection-choice-text-color,#000);cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;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:#333;color:var(--select2-selection-choice-hover-close-color,#333)}.select2-container--default.select2-container--focused .select2-selection--multiple,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single{border:1px solid #000;border:1px solid var(--select2-selection-focus-border-color,#000);outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:#eee;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--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{background:#fff;background:1px solid var(--select2-search-background,#fff);border:1px solid #aaa;border:1px solid var(--select2-search-border-color,#aaa);border-radius:0;border-radius:var(--select2-search-border-radius,0)}.select2-container--default .select2-search--inline .select2-search__field{-webkit-appearance:textfield;background:transparent;border:none;box-shadow:none;outline:none}.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]{background:transparent;background:var(--select2-option-disabled-background,transparent);color:#999;color:var(--select2-option-disabled-text-color,#999)}.select2-container--default .select2-results__option[aria-selected=true]{background:#ddd;background:var(--select2-option-selected-background,#ddd);color:#000;color:var(--select2-option-selected-text-color,#000)}.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:#5897fb;background:var(--select2-option-highlighted-background,#5897fb);color:#fff;color:var(--select2-option-highlighted-text-color,#fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{background:transparent;background:var(--select2-option-group-background,transparent);color:grey;color:var(--select2-option-group-text-color,grey);cursor:default;display:block;padding:6px}.select2-no-result{color:#888;color:var(--select2-no-result-color,#888);font-style:italic;font-style:var(--select2-font-style-color,italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-selection--multiple,:host.nostyle .select2-selection--single{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{align-items:baseline;border-top:.84375em solid transparent;display:inline-flex;height:auto;padding:.4375em 0;width:100%}:host.material .select2-container--default .select2-selection--multiple,:host.material .select2-container--default .select2-selection--single{border:0;border-radius:0;box-sizing:border-box;height:24px;width:100%}:host.material .select2-container--default .select2-selection--multiple:before,:host.material .select2-container--default .select2-selection--single:before{background:#ddd;background:var(--select2-material-underline,#ddd);bottom:1.65em;content:\" \";display:block;height:1px;position:absolute;width:100%}:host.material .select2-container--default .select2-selection--multiple:after,:host.material .select2-container--default .select2-selection--single:after{background:#5a419e;background:var(--select2-material-underline-active,#5a419e);bottom:1.63em;content:\" \";display:block;height:2px;left:50%;position:absolute;transition:none;width:0}:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered,:host.material .select2-container--default .select2-selection--single .select2-selection__rendered{line-height:inherit;padding-left:1px}:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder{color:rgba(0,0,0,.38);color:var(--select2-material-placeholder-color,rgba(0,0,0,.38));display:block;left:0;position:absolute;top:20px;transform-origin:0 21px;transition:transform .3s}:host.material .select2-container--default .select2-container--open{bottom:1.6em;left:0}: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--multiple:after,:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after{left:0;transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%}:host.material .select2-container--default .select2-dropdown{border:0;border-radius:0;box-shadow:0 5px 5px rgba(0,0,0,.5)}:host.material .select2-container--default .select2-results__option--highlighted[aria-selected],:host.material .select2-container--default .select2-results__option[aria-selected=true]{background:rgba(0,0,0,.04);background:var(--select2-material-option-selected-background,rgba(0,0,0,.04));color:#000;color:var(--select2-material-option-highlighted-text-color,#000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:#ff5722;color:var(--select2-material-option-selected-text-color,#ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple,:host.material .select2-container--default.select2-container--disabled .select2-selection--single{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before{background:linear-gradient(90deg,rgba(0,0,0,.26) 0,rgba(0,0,0,.26) 33%,transparent 0);background:var(--select2-material-underline-disabled,linear-gradient(90deg,rgba(0,0,0,.26) 0,rgba(0,0,0,.26) 33%,transparent 0));background-position:0 bottom;background-repeat:repeat-x;background-size:4px 1px}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple: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--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before{background:red;background:var(--select2-material-underline-invalid,red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple,:host.material:not(.select2-container--open) .select2-focused .select2-selection--single{border:0}:host.material .select2-subscript-wrapper{color:#888;color:var(--select2-hint-text-color,#888);font-size:75%;position:absolute;top:calc(100% - 1.72917em)}::ng-deep .select2-overlay-backdrop{background:rgba(0,0,0,.32);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--multiple,select2.material .select2-container--default .select2-selection--single{height:26px}}@supports (-ms-scroll-limit:0){select2.material .select2-container--default .select2-selection--multiple,select2.material .select2-container--default .select2-selection--single{height:25px}}"]
1759
+ }] }
1760
+ ];
1761
+ /** @nocollapse */
1762
+ Select2.ctorParameters = () => [
1763
+ { type: ViewportRuler },
1764
+ { type: ChangeDetectorRef },
1765
+ { type: NgForm, decorators: [{ type: Optional }] },
1766
+ { type: FormGroupDirective, decorators: [{ type: Optional }] },
1767
+ { type: NgControl, decorators: [{ type: Self }, { type: Optional }] },
1768
+ { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] }
1769
+ ];
1770
+ Select2.propDecorators = {
1771
+ data: [{ type: Input }],
1772
+ minCharForSearch: [{ type: Input }],
1773
+ displaySearchStatus: [{ type: Input }],
1774
+ placeholder: [{ type: Input }],
1775
+ customSearchEnabled: [{ type: Input }],
1776
+ limitSelection: [{ type: Input }],
1777
+ listPosition: [{ type: Input }],
1778
+ multiple: [{ type: Input }],
1779
+ overlay: [{ type: Input }],
1780
+ styleMode: [{ type: Input }],
1781
+ noResultMessage: [{ type: Input }],
1782
+ infiniteScrollDistance: [{ type: Input }],
1783
+ infiniteScrollThrottle: [{ type: Input }],
1784
+ infiniteScroll: [{ type: Input }],
1785
+ editPattern: [{ type: Input }],
1786
+ templates: [{ type: Input }],
1787
+ resultMaxHeight: [{ type: Input }],
1788
+ update: [{ type: Output }],
1789
+ open: [{ type: Output }],
1790
+ close: [{ type: Output }],
1791
+ focus: [{ type: Output }],
1792
+ blur: [{ type: Output }],
1793
+ search: [{ type: Output }],
1794
+ scroll: [{ type: Output }],
1795
+ removeOption: [{ type: Output }],
1796
+ minCountForSearch: [{ type: Input }],
1797
+ id: [{ type: Input }, { type: HostBinding, args: ['id',] }],
1798
+ required: [{ type: Input }],
1799
+ disabled: [{ type: Input }],
1800
+ hideSelectedItems: [{ type: Input }],
1801
+ readonly: [{ type: Input }],
1802
+ value: [{ type: Input }],
1803
+ tabIndex: [{ type: Input }],
1804
+ resettable: [{ type: Input }],
1805
+ ariaInvalid: [{ type: HostBinding, args: ['attr.aria-invalid',] }],
1806
+ classMaterial: [{ type: HostBinding, args: ['class.material',] }],
1807
+ classNostyle: [{ type: HostBinding, args: ['class.nostyle',] }],
1808
+ select2above: [{ type: HostBinding, args: ['class.select2-above',] }],
1809
+ cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
1810
+ selection: [{ type: ViewChild, args: ['selection', { static: true },] }],
1811
+ resultContainer: [{ type: ViewChild, args: ['results',] }],
1812
+ results: [{ type: ViewChildren, args: ['result',] }],
1813
+ searchInput: [{ type: ViewChild, args: ['searchInput',] }],
1814
+ dropdown: [{ type: ViewChild, args: ['dropdown',] }]
1815
+ };
1816
+ if (false) {
1817
+ /** @type {?} */
1818
+ Select2.prototype._data;
1819
+ /** @type {?} */
1820
+ Select2.prototype.minCharForSearch;
1821
+ /** @type {?} */
1822
+ Select2.prototype.displaySearchStatus;
1823
+ /** @type {?} */
1824
+ Select2.prototype.placeholder;
1825
+ /** @type {?} */
1826
+ Select2.prototype.customSearchEnabled;
1827
+ /** @type {?} */
1828
+ Select2.prototype.limitSelection;
1829
+ /** @type {?} */
1830
+ Select2.prototype.listPosition;
1831
+ /**
1832
+ * use the material style
1833
+ * @type {?}
1834
+ */
1835
+ Select2.prototype.styleMode;
1836
+ /**
1837
+ * message when no result
1838
+ * @type {?}
1839
+ */
1840
+ Select2.prototype.noResultMessage;
1841
+ /**
1842
+ * infinite scroll distance
1843
+ * @type {?}
1844
+ */
1845
+ Select2.prototype.infiniteScrollDistance;
1846
+ /**
1847
+ * infinite scroll distance
1848
+ * @type {?}
1849
+ */
1850
+ Select2.prototype.infiniteScrollThrottle;
1851
+ /**
1852
+ * use it for change the pattern of the filter search
1853
+ * @type {?}
1854
+ */
1855
+ Select2.prototype.editPattern;
1856
+ /**
1857
+ * template for formating
1858
+ * @type {?}
1859
+ */
1860
+ Select2.prototype.templates;
1861
+ /**
1862
+ * the max height of the results container when opening the select
1863
+ * @type {?}
1864
+ */
1865
+ Select2.prototype.resultMaxHeight;
1866
+ /** @type {?} */
1867
+ Select2.prototype.update;
1868
+ /** @type {?} */
1869
+ Select2.prototype.open;
1870
+ /** @type {?} */
1871
+ Select2.prototype.close;
1872
+ /** @type {?} */
1873
+ Select2.prototype.focus;
1874
+ /** @type {?} */
1875
+ Select2.prototype.blur;
1876
+ /** @type {?} */
1877
+ Select2.prototype.search;
1878
+ /** @type {?} */
1879
+ Select2.prototype.scroll;
1880
+ /** @type {?} */
1881
+ Select2.prototype.removeOption;
1882
+ /** @type {?} */
1883
+ Select2.prototype.option;
1884
+ /** @type {?} */
1885
+ Select2.prototype.isOpen;
1886
+ /** @type {?} */
1887
+ Select2.prototype.searchStyle;
1888
+ /**
1889
+ * Whether the element is focused or not.
1890
+ * @type {?}
1891
+ */
1892
+ Select2.prototype.focused;
1893
+ /** @type {?} */
1894
+ Select2.prototype.filteredData;
1895
+ /** @type {?} */
1896
+ Select2.prototype.overlayWidth;
1897
+ /** @type {?} */
1898
+ Select2.prototype.overlayHeight;
1899
+ /** @type {?} */
1900
+ Select2.prototype._triggerRect;
1901
+ /** @type {?} */
1902
+ Select2.prototype._dropdownRect;
1903
+ /**
1904
+ * @type {?}
1905
+ * @private
1906
+ */
1907
+ Select2.prototype._minCountForSearch;
1908
+ /**
1909
+ * @type {?}
1910
+ * @private
1911
+ */
1912
+ Select2.prototype.cdkConnectedOverlay;
1913
+ /**
1914
+ * @type {?}
1915
+ * @private
1916
+ */
1917
+ Select2.prototype.selection;
1918
+ /**
1919
+ * @type {?}
1920
+ * @private
1921
+ */
1922
+ Select2.prototype.resultContainer;
1923
+ /**
1924
+ * @type {?}
1925
+ * @private
1926
+ */
1927
+ Select2.prototype.results;
1928
+ /**
1929
+ * @type {?}
1930
+ * @private
1931
+ */
1932
+ Select2.prototype.searchInput;
1933
+ /**
1934
+ * @type {?}
1935
+ * @private
1936
+ */
1937
+ Select2.prototype.dropdown;
1938
+ /**
1939
+ * @type {?}
1940
+ * @private
1941
+ */
1942
+ Select2.prototype.hoveringValue;
1943
+ /**
1944
+ * @type {?}
1945
+ * @private
1946
+ */
1947
+ Select2.prototype.innerSearchText;
1948
+ /**
1949
+ * @type {?}
1950
+ * @private
1951
+ */
1952
+ Select2.prototype.isSearchboxHidden;
1953
+ /**
1954
+ * @type {?}
1955
+ * @private
1956
+ */
1957
+ Select2.prototype.selectionElement;
1958
+ /**
1959
+ * @type {?}
1960
+ * @private
1961
+ */
1962
+ Select2.prototype._stateChanges;
1963
+ /**
1964
+ * Tab index for the element.
1965
+ * @type {?}
1966
+ * @private
1967
+ */
1968
+ Select2.prototype._tabIndex;
1969
+ /**
1970
+ * @type {?}
1971
+ * @private
1972
+ */
1973
+ Select2.prototype._disabled;
1974
+ /**
1975
+ * @type {?}
1976
+ * @private
1977
+ */
1978
+ Select2.prototype._required;
1979
+ /**
1980
+ * @type {?}
1981
+ * @private
1982
+ */
1983
+ Select2.prototype._readonly;
1984
+ /**
1985
+ * @type {?}
1986
+ * @private
1987
+ */
1988
+ Select2.prototype._multiple;
1989
+ /**
1990
+ * @type {?}
1991
+ * @private
1992
+ */
1993
+ Select2.prototype._overlay;
1994
+ /**
1995
+ * @type {?}
1996
+ * @private
1997
+ */
1998
+ Select2.prototype._resettable;
1999
+ /**
2000
+ * @type {?}
2001
+ * @private
2002
+ */
2003
+ Select2.prototype._hideSelectedItems;
2004
+ /**
2005
+ * @type {?}
2006
+ * @private
2007
+ */
2008
+ Select2.prototype._clickDetection;
2009
+ /**
2010
+ * @type {?}
2011
+ * @private
2012
+ */
2013
+ Select2.prototype._clickDetectionFc;
2014
+ /**
2015
+ * @type {?}
2016
+ * @private
2017
+ */
2018
+ Select2.prototype._id;
2019
+ /**
2020
+ * @type {?}
2021
+ * @private
2022
+ */
2023
+ Select2.prototype._uid;
2024
+ /**
2025
+ * @type {?}
2026
+ * @private
2027
+ */
2028
+ Select2.prototype._value;
2029
+ /**
2030
+ * @type {?}
2031
+ * @private
2032
+ */
2033
+ Select2.prototype._previousNativeValue;
2034
+ /**
2035
+ * @type {?}
2036
+ * @private
2037
+ */
2038
+ Select2.prototype._infiniteScroll;
2039
+ /**
2040
+ * @type {?}
2041
+ * @private
2042
+ */
2043
+ Select2.prototype._overlayPosition;
2044
+ /**
2045
+ * View -> model callback called when select has been touched
2046
+ * @type {?}
2047
+ * @private
2048
+ */
2049
+ Select2.prototype._onTouched;
2050
+ /**
2051
+ * View -> model callback called when value changes
2052
+ * @type {?}
2053
+ * @private
2054
+ */
2055
+ Select2.prototype._onChange;
2056
+ /**
2057
+ * @type {?}
2058
+ * @protected
2059
+ */
2060
+ Select2.prototype._viewportRuler;
2061
+ /**
2062
+ * @type {?}
2063
+ * @private
2064
+ */
2065
+ Select2.prototype._changeDetectorRef;
2066
+ /**
2067
+ * @type {?}
2068
+ * @private
2069
+ */
2070
+ Select2.prototype._parentForm;
2071
+ /**
2072
+ * @type {?}
2073
+ * @private
2074
+ */
2075
+ Select2.prototype._parentFormGroup;
2076
+ /** @type {?} */
2077
+ Select2.prototype._control;
1960
2078
  }
1961
2079
 
1962
- /**
1963
- * @fileoverview added by tsickle
1964
- * Generated from: lib/select2-hint.component.ts
1965
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1966
- */
1967
- class Select2Hint {
1968
- }
1969
- Select2Hint.decorators = [
1970
- { type: Directive, args: [{ selector: 'select2-hint' },] }
2080
+ /**
2081
+ * @fileoverview added by tsickle
2082
+ * Generated from: lib/select2-hint.component.ts
2083
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2084
+ */
2085
+ class Select2Hint {
2086
+ }
2087
+ Select2Hint.decorators = [
2088
+ { type: Directive, args: [{ selector: 'select2-hint' },] }
1971
2089
  ];
1972
2090
 
1973
- /**
1974
- * @fileoverview added by tsickle
1975
- * Generated from: lib/select2-label.component.ts
1976
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1977
- */
1978
- class Select2Label {
1979
- }
1980
- Select2Label.decorators = [
1981
- { type: Directive, args: [{ selector: 'select2-label' },] }
2091
+ /**
2092
+ * @fileoverview added by tsickle
2093
+ * Generated from: lib/select2-label.component.ts
2094
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2095
+ */
2096
+ class Select2Label {
2097
+ }
2098
+ Select2Label.decorators = [
2099
+ { type: Directive, args: [{ selector: 'select2-label' },] }
1982
2100
  ];
1983
2101
 
1984
- /**
1985
- * @fileoverview added by tsickle
1986
- * Generated from: lib/select2.module.ts
1987
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1988
- */
1989
- class Select2Module {
1990
- }
1991
- Select2Module.decorators = [
1992
- { type: NgModule, args: [{
1993
- imports: [
1994
- CommonModule,
1995
- FormsModule,
1996
- OverlayModule,
1997
- ReactiveFormsModule,
1998
- InfiniteScrollModule
1999
- ],
2000
- declarations: [
2001
- Select2Hint,
2002
- Select2Label,
2003
- Select2
2004
- ],
2005
- exports: [
2006
- FormsModule,
2007
- ReactiveFormsModule,
2008
- Select2Hint,
2009
- Select2Label,
2010
- Select2
2011
- ]
2012
- },] }
2102
+ /**
2103
+ * @fileoverview added by tsickle
2104
+ * Generated from: lib/select2.module.ts
2105
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2106
+ */
2107
+ class Select2Module {
2108
+ }
2109
+ Select2Module.decorators = [
2110
+ { type: NgModule, args: [{
2111
+ imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule],
2112
+ declarations: [Select2Hint, Select2Label, Select2],
2113
+ exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2],
2114
+ },] }
2013
2115
  ];
2014
2116
 
2015
- /**
2016
- * @fileoverview added by tsickle
2017
- * Generated from: public_api.ts
2018
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2117
+ /**
2118
+ * @fileoverview added by tsickle
2119
+ * Generated from: public_api.ts
2120
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2019
2121
  */
2020
2122
 
2021
- /**
2022
- * @fileoverview added by tsickle
2023
- * Generated from: ng-select2-component.ts
2024
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2123
+ /**
2124
+ * @fileoverview added by tsickle
2125
+ * Generated from: ng-select2-component.ts
2126
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2025
2127
  */
2026
2128
 
2027
2129
  export { Select2, Select2Hint, Select2Label, Select2Module, Select2Utils, defaultMinCountForSearch, protectRegexp, timeout, unicodePatterns };