@progress/kendo-vue-dropdowns 3.5.0 → 3.5.1-dev.202208150613

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.
Files changed (90) hide show
  1. package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
  2. package/dist/es/AutoComplete/AutoComplete.js +9 -13
  3. package/dist/es/AutoComplete/AutoCompleteProps.js +1 -0
  4. package/dist/es/ComboBox/ComboBox.js +11 -14
  5. package/dist/es/ComboBox/ComboBoxProps.d.ts +1 -1
  6. package/dist/es/ComboBox/ComboBoxProps.js +1 -0
  7. package/dist/es/DropDownList/DropDownList.js +11 -21
  8. package/dist/es/DropDownList/DropDownListProps.js +1 -0
  9. package/dist/es/MultiSelect/MultiSelect.js +23 -30
  10. package/dist/es/MultiSelect/MultiSelectProps.d.ts +1 -1
  11. package/dist/es/MultiSelect/MultiSelectProps.js +1 -0
  12. package/dist/es/MultiSelect/TagList.js +3 -3
  13. package/dist/es/common/List.js +2 -2
  14. package/dist/es/common/ListContainer.js +8 -5
  15. package/dist/es/common/ListFilter.js +1 -1
  16. package/dist/es/common/events.js +1 -0
  17. package/dist/es/common/filterDescriptor.js +1 -0
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/esm/AutoComplete/AutoComplete.d.ts +107 -0
  20. package/dist/esm/AutoComplete/AutoComplete.js +757 -0
  21. package/dist/esm/AutoComplete/AutoCompleteProps.d.ts +202 -0
  22. package/dist/esm/AutoComplete/AutoCompleteProps.js +2 -0
  23. package/dist/esm/ComboBox/ComboBox.d.ts +99 -0
  24. package/dist/esm/ComboBox/ComboBox.js +1060 -0
  25. package/dist/esm/ComboBox/ComboBoxProps.d.ts +244 -0
  26. package/dist/esm/ComboBox/ComboBoxProps.js +2 -0
  27. package/dist/esm/DropDownList/DropDownList.d.ts +100 -0
  28. package/dist/esm/DropDownList/DropDownList.js +1086 -0
  29. package/dist/esm/DropDownList/DropDownListProps.d.ts +274 -0
  30. package/dist/esm/DropDownList/DropDownListProps.js +2 -0
  31. package/dist/esm/MultiSelect/MultiSelect.d.ts +115 -0
  32. package/dist/esm/MultiSelect/MultiSelect.js +1246 -0
  33. package/dist/esm/MultiSelect/MultiSelectProps.d.ts +262 -0
  34. package/dist/esm/MultiSelect/MultiSelectProps.js +2 -0
  35. package/dist/esm/MultiSelect/TagList.d.ts +51 -0
  36. package/dist/esm/MultiSelect/TagList.js +180 -0
  37. package/dist/esm/additionalTypes.ts +21 -0
  38. package/dist/esm/common/ClearButton.d.ts +21 -0
  39. package/dist/esm/common/ClearButton.js +68 -0
  40. package/dist/esm/common/DropDownBase.d.ts +84 -0
  41. package/dist/esm/common/DropDownBase.js +303 -0
  42. package/dist/esm/common/List.d.ts +58 -0
  43. package/dist/esm/common/List.js +176 -0
  44. package/dist/esm/common/ListContainer.d.ts +40 -0
  45. package/dist/esm/common/ListContainer.js +134 -0
  46. package/dist/esm/common/ListDefaultItem.d.ts +29 -0
  47. package/dist/esm/common/ListDefaultItem.js +62 -0
  48. package/dist/esm/common/ListFilter.d.ts +46 -0
  49. package/dist/esm/common/ListFilter.js +112 -0
  50. package/dist/esm/common/ListItem.d.ts +71 -0
  51. package/dist/esm/common/ListItem.js +105 -0
  52. package/dist/esm/common/Navigation.d.ts +12 -0
  53. package/dist/esm/common/Navigation.js +34 -0
  54. package/dist/esm/common/SearchBar.d.ts +65 -0
  55. package/dist/esm/common/SearchBar.js +177 -0
  56. package/dist/esm/common/VirtualScroll.d.ts +42 -0
  57. package/dist/esm/common/VirtualScroll.js +196 -0
  58. package/dist/esm/common/events.d.ts +63 -0
  59. package/dist/esm/common/events.js +1 -0
  60. package/dist/esm/common/filterDescriptor.d.ts +41 -0
  61. package/dist/esm/common/filterDescriptor.js +2 -0
  62. package/dist/esm/common/settings.d.ts +102 -0
  63. package/dist/esm/common/settings.js +8 -0
  64. package/dist/esm/common/utils.d.ts +57 -0
  65. package/dist/esm/common/utils.js +184 -0
  66. package/dist/esm/main.d.ts +13 -0
  67. package/dist/esm/main.js +5 -0
  68. package/dist/esm/messages/index.d.ts +20 -0
  69. package/dist/esm/messages/index.js +21 -0
  70. package/dist/esm/package-metadata.d.ts +5 -0
  71. package/dist/esm/package-metadata.js +11 -0
  72. package/dist/esm/package.json +3 -0
  73. package/dist/npm/AutoComplete/AutoComplete.js +24 -28
  74. package/dist/npm/ComboBox/ComboBox.js +43 -46
  75. package/dist/npm/ComboBox/ComboBoxProps.d.ts +1 -1
  76. package/dist/npm/DropDownList/DropDownList.js +42 -52
  77. package/dist/npm/MultiSelect/MultiSelect.js +41 -48
  78. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +1 -1
  79. package/dist/npm/MultiSelect/TagList.js +3 -3
  80. package/dist/npm/common/ClearButton.js +1 -1
  81. package/dist/npm/common/DropDownBase.js +6 -6
  82. package/dist/npm/common/List.js +8 -8
  83. package/dist/npm/common/ListContainer.js +9 -6
  84. package/dist/npm/common/ListDefaultItem.js +2 -2
  85. package/dist/npm/common/ListFilter.js +3 -3
  86. package/dist/npm/common/ListItem.js +2 -2
  87. package/dist/npm/common/Navigation.js +1 -1
  88. package/dist/npm/common/SearchBar.js +2 -2
  89. package/dist/npm/package-metadata.js +1 -1
  90. package/package.json +11 -5
@@ -0,0 +1,1246 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
18
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
+ if (ar || !(i in from)) {
20
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
+ ar[i] = from[i];
22
+ }
23
+ }
24
+ return to.concat(ar || Array.prototype.slice.call(from));
25
+ }; // @ts-ignore
26
+
27
+
28
+ import * as Vue from 'vue';
29
+ var allVue = Vue;
30
+ var gh = allVue.h;
31
+ var isV3 = allVue.version && allVue.version[0] === '3';
32
+ var ref = allVue.ref;
33
+ import { classNames, Keys, guid, templateRendering, getListeners, getTemplate, kendoThemeMaps, setRef, getRef } from '@progress/kendo-vue-common';
34
+ var sizeMap = kendoThemeMaps.sizeMap,
35
+ roundedMap = kendoThemeMaps.roundedMap;
36
+ import { ListContainer } from '../common/ListContainer.js';
37
+ import { List } from '../common/List.js';
38
+ import { TagList } from './TagList.js';
39
+ import { SearchBar } from '../common/SearchBar.js';
40
+ import DropDownBase from '../common/DropDownBase.js';
41
+ import { ClearButton } from '../common/ClearButton.js';
42
+ import { ActiveDescendant } from './../common/settings.js';
43
+ import { itemIndexStartsWith, getItemValue, areSame, matchDataCollections, removeDataItems, isPresent, preventDefaultNonInputs } from '../common/utils.js';
44
+ var VALIDATION_MESSAGE = 'Please enter a valid value!';
45
+
46
+ var preventDefault = function preventDefault(event) {
47
+ return event.preventDefault();
48
+ };
49
+
50
+ var matchTags = function matchTags(tag1, tag2, key) {
51
+ if (!!tag1 !== !!tag2 || tag1.text !== tag2.text) {
52
+ return false;
53
+ }
54
+
55
+ return tag1 === tag2 || matchDataCollections(tag1.data, tag2.data, key);
56
+ };
57
+
58
+ var isCustom = function isCustom(type) {
59
+ return type === FocusedItemType.CustomItem;
60
+ };
61
+
62
+ var FocusedItemType;
63
+
64
+ (function (FocusedItemType) {
65
+ FocusedItemType[FocusedItemType["None"] = 0] = "None";
66
+ FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
67
+ FocusedItemType[FocusedItemType["CustomItem"] = 2] = "CustomItem";
68
+ })(FocusedItemType || (FocusedItemType = {}));
69
+ /**
70
+ * @hidden
71
+ */
72
+
73
+
74
+ var MultiSelectVue2 = {
75
+ name: 'KendoMultiSelect',
76
+ // @ts-ignore
77
+ emits: {
78
+ 'changemodel': null,
79
+ 'update:modelValue': null,
80
+ 'filterchange': null,
81
+ change: null,
82
+ pagechange: null,
83
+ focus: null,
84
+ blur: null,
85
+ open: null,
86
+ close: null,
87
+ scroll: null
88
+ },
89
+ model: {
90
+ event: 'changemodel'
91
+ },
92
+ props: {
93
+ autoClose: {
94
+ type: Boolean,
95
+ default: true
96
+ },
97
+ allowCustom: Boolean,
98
+ modelValue: Array,
99
+ opened: {
100
+ type: Boolean,
101
+ default: undefined
102
+ },
103
+ disabled: Boolean,
104
+ dir: String,
105
+ tabIndex: {
106
+ type: Number,
107
+ default: 0
108
+ },
109
+ accessKey: String,
110
+ dataItems: Array,
111
+ textField: String,
112
+ label: String,
113
+ loading: Boolean,
114
+ name: String,
115
+ value: Array,
116
+ defaultValue: Array,
117
+ valueField: String,
118
+ valuePrimitive: Boolean,
119
+ dataItemKey: String,
120
+ placeholder: String,
121
+ tags: Array,
122
+ required: {
123
+ type: Boolean,
124
+ default: false
125
+ },
126
+ valid: {
127
+ type: Boolean,
128
+ default: undefined
129
+ },
130
+ validate: {
131
+ type: Boolean
132
+ },
133
+ validationMessage: {
134
+ type: String,
135
+ default: undefined
136
+ },
137
+ validityStyles: {
138
+ type: Boolean,
139
+ default: true
140
+ },
141
+ tagRender: [String, Function, Object],
142
+ id: String,
143
+ popupSettings: {
144
+ type: Object,
145
+ default: function _default() {
146
+ return {
147
+ animate: true,
148
+ height: '200px'
149
+ };
150
+ }
151
+ },
152
+ itemRender: [String, Function, Object],
153
+ listNoDataRender: [String, Function, Object],
154
+ focusedItemIndex: Function,
155
+ virtual: {
156
+ type: Object,
157
+ default: undefined
158
+ },
159
+ header: [String, Function, Object],
160
+ footer: [String, Function, Object],
161
+ filterable: Boolean,
162
+ filter: {
163
+ type: String,
164
+ default: undefined
165
+ },
166
+ ariaLabelledBy: String,
167
+ ariaDescribedBy: String,
168
+ rounded: {
169
+ type: String,
170
+ default: 'medium',
171
+ validator: function validator(value) {
172
+ return ['small', 'medium', 'large', 'full'].includes(value);
173
+ }
174
+ },
175
+ tagsRounded: {
176
+ type: String,
177
+ default: 'medium',
178
+ validator: function validator(value) {
179
+ return ['small', 'medium', 'large', 'full'].includes(value);
180
+ }
181
+ },
182
+ fillMode: {
183
+ type: String,
184
+ default: 'solid',
185
+ validator: function validator(value) {
186
+ return ['solid', 'flat', 'outline'].includes(value);
187
+ }
188
+ },
189
+ size: {
190
+ type: String,
191
+ default: 'medium',
192
+ validator: function validator(value) {
193
+ return ['small', 'medium', 'large'].includes(value);
194
+ }
195
+ }
196
+ },
197
+ // @ts-ignore
198
+ setup: !isV3 ? undefined : function () {
199
+ var v3 = !!isV3;
200
+ var inputRef = ref(null);
201
+ var kendoAnchorRef = ref(null);
202
+ return {
203
+ v3: v3,
204
+ inputRef: inputRef,
205
+ kendoAnchorRef: kendoAnchorRef
206
+ };
207
+ },
208
+ computed: {
209
+ spanClassNames: {
210
+ get: function get() {
211
+ var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
212
+ var editorValue = this.currentText || getItemValue(this.computedValue()[0], this.$props.textField);
213
+ return {
214
+ 'k-floating-label-container': true,
215
+ 'k-focus': this.currentFocused,
216
+ 'k-empty': !(editorValue && editorValue !== 0),
217
+ 'k-invalid': !isValid && isValid !== undefined,
218
+ 'k-rtl': this.$props.dir === 'rtl'
219
+ };
220
+ }
221
+ }
222
+ },
223
+ created: function created() {
224
+ this.valuesItemsDuringOnChange = null;
225
+ this._tags = [];
226
+ this._skipFocusEvent = false;
227
+ this.scrollToFocused = false;
228
+ this.base = new DropDownBase(this);
229
+ this.anchor = guid();
230
+ this.inputId = guid();
231
+ },
232
+ data: function data() {
233
+ return {
234
+ hasMounted: false,
235
+ currentText: '',
236
+ currentValue: '',
237
+ currentFocused: false,
238
+ currentOpened: false,
239
+ currentFocusedIndex: undefined,
240
+ currentFocusedTag: undefined,
241
+ searchState: {
242
+ word: '',
243
+ last: ''
244
+ },
245
+ suggested: '',
246
+ activedescendant: ActiveDescendant.PopupList
247
+ };
248
+ },
249
+ watch: {
250
+ currentOpened: function currentOpened(_, oldValue) {
251
+ this.prevCurrentOpened = oldValue;
252
+ },
253
+ opened: function opened(_, oldValue) {
254
+ this.prevOpened = oldValue;
255
+ },
256
+ virtual: function virtual(newValue, oldValue) {
257
+ if (newValue && oldValue && newValue.total !== oldValue.total) {
258
+ this.virtualTotalHasChanged = true;
259
+ }
260
+ }
261
+ },
262
+ updated: function updated() {
263
+ var virtual = this.$props.virtual;
264
+ var skip = virtual ? virtual.skip : 0;
265
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
266
+ var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
267
+ var opening = !prevOpened && opened;
268
+ var closing = prevOpened && !opened;
269
+ var popupSettings = Object.assign({}, {
270
+ animate: true,
271
+ height: '200px'
272
+ }, this.$props.popupSettings);
273
+ var list = this.$refs.list;
274
+ var scrollElement = this.$refs.scrollElement;
275
+
276
+ if (list) {
277
+ // @ts-ignore
278
+ this.base.vs.list = list.list; // @ts-ignore
279
+
280
+ this.base.list = list.list;
281
+ }
282
+
283
+ if (scrollElement) {
284
+ this.base.vs.scrollElement = scrollElement;
285
+ }
286
+
287
+ if (list && this.dataItems.length) {
288
+ // @ts-ignore
289
+ this.base.vs.scrollerRef(list.$el);
290
+ }
291
+
292
+ if (!popupSettings.animate && closing) {
293
+ this.onPopupClosed();
294
+ }
295
+
296
+ if (virtual && this.virtualTotalHasChanged) {
297
+ this.base.vs.calcScrollElementHeight();
298
+ this.base.vs.reset();
299
+ this.virtualTotalHasChanged = false;
300
+ } else {
301
+ var _a = this.getFocusedState(),
302
+ focusedItem = _a.focusedItem,
303
+ focusedIndex = _a.focusedIndex;
304
+
305
+ if (opening && virtual) {
306
+ this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
307
+ this.prevCurrentOpened = true;
308
+ } else if (opening && !virtual) {
309
+ this.base.scrollToItem(focusedIndex);
310
+ this.prevCurrentOpened = true;
311
+ } else if (opened && prevOpened && focusedItem && this.scrollToFocused) {
312
+ this.base.scrollToItem(focusedIndex - skip);
313
+ }
314
+ }
315
+
316
+ this.scrollToFocused = false;
317
+ this.searchBarRef();
318
+ this.setValidity();
319
+ },
320
+ mounted: function mounted() {
321
+ this.hasMounted = true; // @ts-ignore
322
+
323
+ this.input = this.v3 ? this.inputRef.input : this.$refs.input.input;
324
+ this.base.wrapper = getRef(this, 'kendoAnchor', this.anchor);
325
+ this.element = getRef(this, 'kendoAnchor', this.anchor);
326
+ this.base.didMount();
327
+ this.searchBarRef();
328
+ this.setValidity();
329
+ },
330
+ methods: {
331
+ computedValue: function computedValue() {
332
+ var result = [];
333
+
334
+ if (this.valuesItemsDuringOnChange) {
335
+ result.push.apply(result, this.valuesItemsDuringOnChange);
336
+ } else if (this.$props.value) {
337
+ result.push.apply(result, this.$props.value);
338
+ } else if (this.$props.modelValue !== undefined) {
339
+ result.push.apply(result, this.$props.modelValue);
340
+ } else if (this.currentValue) {
341
+ result.push.apply(result, this.currentValue);
342
+ } else if (this.$props.defaultValue) {
343
+ result.push.apply(result, this.$props.defaultValue);
344
+ }
345
+
346
+ return this.valuePrimitive ? this.findByFieldValue(this.valueField, result) || result : result;
347
+ },
348
+ findByFieldValue: function findByFieldValue(field, result) {
349
+ var _this = this;
350
+
351
+ var newResult = result.map(function (currentValue) {
352
+ var index = _this.dataItems.findIndex(function (i) {
353
+ return getItemValue(i, field) === currentValue;
354
+ });
355
+
356
+ return _this.dataItems[index] || currentValue;
357
+ });
358
+ return newResult;
359
+ },
360
+ primitiveValue: function primitiveValue() {
361
+ var _this = this;
362
+
363
+ var computed = this.computedValue();
364
+ var value = computed.map(function (v) {
365
+ return getItemValue(v, _this.valueField);
366
+ });
367
+ return this.valuePrimitive ? value : computed;
368
+ },
369
+ validity: function validity() {
370
+ var customError = this.$props.validationMessage !== undefined;
371
+ var value = this.computedValue();
372
+ var isValid = !this.$props.required || value !== null && value.length > 0 && value !== undefined;
373
+ var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
374
+ return {
375
+ customError: customError,
376
+ valid: valid,
377
+ valueMissing: value === null
378
+ };
379
+ },
380
+ handleItemSelect: function handleItemSelect(index, state) {
381
+ var _a = this.$props,
382
+ _b = _a.dataItems,
383
+ dataItems = _b === void 0 ? [] : _b,
384
+ dataItemKey = _a.dataItemKey,
385
+ virtual = _a.virtual;
386
+ var value = this.computedValue();
387
+ var skip = virtual ? virtual.skip : 0;
388
+ var dataItem = dataItems[index - skip];
389
+ var indexInValue = value.findIndex(function (i) {
390
+ return areSame(i, dataItem, dataItemKey);
391
+ });
392
+ var newItems = [];
393
+
394
+ if (indexInValue !== -1) {
395
+ // item is already selected
396
+ newItems = value;
397
+ newItems.splice(indexInValue, 1);
398
+ } else {
399
+ newItems = __spreadArray(__spreadArray([], value, true), [dataItem], false);
400
+ }
401
+
402
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
403
+
404
+ if (text) {
405
+ if (this.currentText) {
406
+ state.data.currentText = '';
407
+ }
408
+
409
+ this.base.filterChanged('', state);
410
+ }
411
+
412
+ if (this.currentFocusedIndex !== undefined) {
413
+ state.data.currentFocusedIndex = undefined;
414
+ }
415
+
416
+ this.triggerOnChange(newItems, state);
417
+ this.base.triggerPageChangeCornerItems(dataItem, state);
418
+ },
419
+ onTagDelete: function onTagDelete(itemsToRemove, event) {
420
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
421
+ var state = this.base.initState();
422
+ state.event = event;
423
+
424
+ if (opened) {
425
+ this.base.togglePopup(state);
426
+ }
427
+
428
+ if (!this.currentFocused) {
429
+ state.data.currentFocused = true;
430
+ }
431
+
432
+ var selected = this.computedValue();
433
+ removeDataItems(selected, itemsToRemove, this.$props.dataItemKey);
434
+ this.triggerOnChange(selected, state);
435
+ this.applyState(state);
436
+ },
437
+ onNavigate: function onNavigate(state, keyCode) {
438
+ var _a = this.$props,
439
+ allowCustom = _a.allowCustom,
440
+ _b = _a.dataItems,
441
+ dataItems = _b === void 0 ? [] : _b;
442
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
443
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
444
+
445
+ var _c = this.getFocusedState(),
446
+ focusedType = _c.focusedType,
447
+ focusedIndex = _c.focusedIndex;
448
+
449
+ var customItem = allowCustom && text;
450
+ var customItemFocused = isCustom(focusedType);
451
+ var base = this.base;
452
+ var vs = base.vs;
453
+
454
+ if (opened && keyCode === Keys.up && customItemFocused) {
455
+ if (this.currentFocusedIndex !== undefined) {
456
+ state.data.currentFocusedIndex = undefined;
457
+ }
458
+ } else {
459
+ var newFocused = base.navigation.navigate({
460
+ keyCode: keyCode,
461
+ current: focusedIndex,
462
+ max: (vs.enabled ? vs.total : dataItems.length) - 1,
463
+ min: customItem ? -1 : 0
464
+ });
465
+
466
+ if (newFocused !== undefined) {
467
+ this.itemFocus(newFocused, state);
468
+ this.scrollToFocused = true;
469
+ }
470
+ }
471
+
472
+ this.applyState(state);
473
+ },
474
+ itemFocus: function itemFocus(index, state) {
475
+ var _a = this.$props,
476
+ _b = _a.dataItems,
477
+ dataItems = _b === void 0 ? [] : _b,
478
+ allowCustom = _a.allowCustom,
479
+ virtual = _a.virtual;
480
+ var skip = virtual ? virtual.skip : 0;
481
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
482
+ var focusedIndex = this.getFocusedState().focusedIndex;
483
+ var customItem = allowCustom && text;
484
+ var nextFocusedItem = dataItems[index - skip];
485
+
486
+ if (nextFocusedItem && focusedIndex !== index) {
487
+ if (this.currentFocusedIndex !== index) {
488
+ state.data.currentFocusedIndex = index;
489
+ state.data.activedescendant = ActiveDescendant.PopupList;
490
+ }
491
+ } else if (customItem && index === -1) {
492
+ if (this.currentFocusedIndex !== undefined) {
493
+ state.data.currentFocusedIndex = undefined;
494
+ }
495
+ }
496
+
497
+ this.base.triggerPageChangeCornerItems(nextFocusedItem, state);
498
+ },
499
+ searchBarRef: function searchBarRef() {
500
+ var _this = this;
501
+
502
+ if (this.input && this.currentFocused) {
503
+ setTimeout(function () {
504
+ return _this.input.focus();
505
+ }, 0);
506
+ }
507
+ },
508
+ onChangeHandler: function onChangeHandler(event) {
509
+ var state = this.base.initState();
510
+ var value = event.currentTarget.value;
511
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
512
+ state.event = event;
513
+
514
+ if (this.$props.filter === undefined) {
515
+ state.data.currentText = value;
516
+ }
517
+
518
+ state.data.currentFocusedIndex = undefined;
519
+
520
+ if (!opened) {
521
+ this.base.togglePopup(state);
522
+ }
523
+
524
+ this.base.filterChanged(value, state);
525
+ this.applyState(state);
526
+ },
527
+ clearButtonClick: function clearButtonClick(event) {
528
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
529
+ var state = this.base.initState();
530
+ state.event = event;
531
+ event.stopPropagation();
532
+
533
+ if (this.computedValue().length > 0) {
534
+ this.triggerOnChange([], state);
535
+ }
536
+
537
+ if (this.currentFocusedIndex !== undefined) {
538
+ state.data.currentFocusedIndex = undefined;
539
+ }
540
+
541
+ if (opened) {
542
+ this.base.togglePopup(state);
543
+ }
544
+
545
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
546
+
547
+ if (isPresent(text) && text !== '') {
548
+ this.base.filterChanged('', state);
549
+ }
550
+
551
+ if (this.currentText) {
552
+ state.data.currentText = '';
553
+ }
554
+
555
+ this.applyState(state);
556
+ },
557
+ onInputKeyDown: function onInputKeyDown(event) {
558
+ var _this = this;
559
+
560
+ var keyCode = event.keyCode;
561
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
562
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
563
+ var focusedItem = this.getFocusedState().focusedItem;
564
+ var state = this.base.initState();
565
+ state.event = event;
566
+
567
+ if (!text && this.computedValue().length > 0 && (keyCode === Keys.left || keyCode === Keys.right || keyCode === Keys.home || keyCode === Keys.end || keyCode === Keys.delete || keyCode === Keys.backspace)) {
568
+ return this.onTagsNavigate(event, state);
569
+ }
570
+
571
+ var togglePopup = function togglePopup() {
572
+ event.preventDefault();
573
+
574
+ _this.base.togglePopup(state);
575
+
576
+ _this.applyState(state);
577
+ };
578
+
579
+ if (opened) {
580
+ if (event.altKey && keyCode === Keys.up) {
581
+ togglePopup();
582
+ } else if (keyCode === Keys.up || keyCode === Keys.down) {
583
+ event.preventDefault();
584
+ this.onNavigate(state, keyCode);
585
+ } else if (keyCode === Keys.enter) {
586
+ event.preventDefault();
587
+
588
+ if (this.$props.allowCustom && text && focusedItem === null) {
589
+ this.customItemSelect(event);
590
+ } else {
591
+ this.selectFocusedItem(event);
592
+ }
593
+ } else if (keyCode === Keys.esc) {
594
+ togglePopup();
595
+ }
596
+ } else if (event.altKey && keyCode === Keys.down) {
597
+ togglePopup();
598
+ }
599
+ },
600
+ onTagsNavigate: function onTagsNavigate(event, state) {
601
+ var keyCode = event.keyCode;
602
+ var focusedTag = this.currentFocusedTag;
603
+ var tags = this._tags;
604
+ var itemsKey = this.$props.dataItemKey;
605
+ var focusedIndex = focusedTag ? tags.findIndex(function (t) {
606
+ return matchTags(t, focusedTag, itemsKey);
607
+ }) : -1;
608
+ var newFocusedTag = undefined;
609
+ var hasFocused = focusedIndex !== -1;
610
+
611
+ if (keyCode === Keys.left) {
612
+ if (hasFocused) {
613
+ focusedIndex = Math.max(0, focusedIndex - 1);
614
+ } else {
615
+ focusedIndex = tags.length - 1;
616
+ }
617
+
618
+ newFocusedTag = tags[focusedIndex];
619
+ } else if (keyCode === Keys.right) {
620
+ if (focusedIndex === tags.length - 1) {
621
+ newFocusedTag = undefined;
622
+ } else if (hasFocused) {
623
+ focusedIndex = Math.min(tags.length - 1, focusedIndex + 1);
624
+ newFocusedTag = tags[focusedIndex];
625
+ }
626
+ } else if (keyCode === Keys.home) {
627
+ newFocusedTag = tags[0];
628
+ } else if (keyCode === Keys.end) {
629
+ newFocusedTag = tags[tags.length - 1];
630
+ } else if (keyCode === Keys.delete) {
631
+ if (hasFocused) {
632
+ var items = this.computedValue();
633
+ removeDataItems(items, tags[focusedIndex].data, itemsKey);
634
+ this.triggerOnChange(items, state);
635
+ }
636
+ } else if (keyCode === Keys.backspace) {
637
+ var items = this.computedValue();
638
+
639
+ if (hasFocused) {
640
+ removeDataItems(items, tags[focusedIndex].data, itemsKey);
641
+ this.triggerOnChange(items, state);
642
+ } else if (!hasFocused && tags.length) {
643
+ var removed = tags.pop();
644
+ removeDataItems(items, removed.data, itemsKey);
645
+ this.triggerOnChange(items, state);
646
+ }
647
+ }
648
+
649
+ if (newFocusedTag !== focusedTag) {
650
+ state.data.currentFocusedTag = newFocusedTag;
651
+ state.data.activedescendant = ActiveDescendant.TagsList;
652
+ }
653
+
654
+ this.applyState(state);
655
+ },
656
+ triggerOnChange: function triggerOnChange(items, state) {
657
+ if (this.$props.value === undefined) {
658
+ state.data.currentValue = __spreadArray([], items, true);
659
+ }
660
+
661
+ this.valuesItemsDuringOnChange = [];
662
+ this.setItems(items, this.valuesItemsDuringOnChange);
663
+ state.events.push({
664
+ type: 'change'
665
+ });
666
+ },
667
+ selectFocusedItem: function selectFocusedItem(event) {
668
+ var _a = this.$props,
669
+ _b = _a.dataItems,
670
+ dataItems = _b === void 0 ? [] : _b,
671
+ virtual = _a.virtual;
672
+ var focusedIndex = this.getFocusedState().focusedIndex;
673
+ var skip = virtual ? virtual.skip : 0;
674
+
675
+ if (dataItems[focusedIndex - skip] !== undefined) {
676
+ this.handleItemClick(focusedIndex, event);
677
+ }
678
+ },
679
+ setItems: function setItems(srcItems, destItems) {
680
+ destItems.length = 0;
681
+ destItems.push.apply(destItems, srcItems);
682
+ },
683
+ getFocusedState: function getFocusedState() {
684
+ var focusedIndex = this.currentFocusedIndex;
685
+ var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
686
+ var _a = this.$props,
687
+ allowCustom = _a.allowCustom,
688
+ _b = _a.dataItems,
689
+ dataItems = _b === void 0 ? [] : _b,
690
+ dataItemKey = _a.dataItemKey,
691
+ virtual = _a.virtual,
692
+ textField = _a.textField,
693
+ _c = _a.focusedItemIndex,
694
+ focusedItemIndex = _c === void 0 ? itemIndexStartsWith : _c;
695
+ var skip = virtual && virtual.skip || 0;
696
+ var focusedInd;
697
+
698
+ if (focusedIndex !== undefined) {
699
+ return {
700
+ focusedIndex: focusedIndex,
701
+ focusedItem: dataItems[focusedIndex - skip],
702
+ focusedType: FocusedItemType.ListItem
703
+ };
704
+ }
705
+
706
+ var selected = this.computedValue();
707
+
708
+ if (allowCustom && text) {
709
+ return {
710
+ focusedItem: null,
711
+ focusedIndex: -1,
712
+ focusedType: FocusedItemType.CustomItem
713
+ };
714
+ } else if (text) {
715
+ focusedInd = focusedItemIndex(dataItems, text, textField);
716
+ return {
717
+ focusedItem: dataItems[focusedInd],
718
+ focusedIndex: focusedInd + skip,
719
+ focusedType: FocusedItemType.ListItem
720
+ };
721
+ } else if (selected.length) {
722
+ var last_1 = selected[selected.length - 1];
723
+ focusedInd = dataItems.findIndex(function (i) {
724
+ return areSame(i, last_1, dataItemKey);
725
+ });
726
+
727
+ if (dataItems[focusedInd] !== undefined) {
728
+ return {
729
+ focusedIndex: focusedInd + skip,
730
+ focusedItem: dataItems[focusedInd],
731
+ focusedType: FocusedItemType.ListItem
732
+ };
733
+ }
734
+
735
+ return {
736
+ focusedType: FocusedItemType.None,
737
+ focusedIndex: -1
738
+ };
739
+ }
740
+
741
+ return skip === 0 ? {
742
+ focusedItem: dataItems[0],
743
+ focusedIndex: 0,
744
+ focusedType: FocusedItemType.ListItem
745
+ } : {
746
+ focusedType: FocusedItemType.None,
747
+ focusedIndex: -1
748
+ };
749
+ },
750
+ customItemSelect: function customItemSelect(event) {
751
+ var _a;
752
+
753
+ var itemText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
754
+ var textField = this.$props.textField;
755
+
756
+ if (!itemText) {
757
+ return;
758
+ }
759
+
760
+ var state = this.base.initState();
761
+ state.event = event;
762
+ var item = textField ? (_a = {}, _a[textField] = itemText, _a) : itemText;
763
+
764
+ if (this.currentText !== undefined) {
765
+ state.data.currentText = '';
766
+ }
767
+
768
+ state.data.currentFocusedIndex = undefined;
769
+ this.base.filterChanged('', state);
770
+
771
+ var newItems = __spreadArray(__spreadArray([], this.computedValue(), true), [item], false);
772
+
773
+ this.triggerOnChange(newItems, state);
774
+ this.base.togglePopup(state);
775
+ this.applyState(state);
776
+ },
777
+ handleWrapperClick: function handleWrapperClick(event) {
778
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
779
+ var input = this.input;
780
+
781
+ if (!opened && input) {
782
+ this.focusElement(input);
783
+ }
784
+
785
+ var state = this.base.initState();
786
+ state.event = event;
787
+
788
+ if (!this.currentFocused) {
789
+ state.events.push({
790
+ type: 'focus'
791
+ });
792
+ state.data.currentFocused = true;
793
+ }
794
+
795
+ this.base.togglePopup(state);
796
+ this.applyState(state);
797
+ },
798
+ handleItemClick: function handleItemClick(index, event) {
799
+ var state = this.base.initState();
800
+ state.event = event;
801
+ this.handleItemSelect(index, state);
802
+
803
+ if (this.$props.autoClose) {
804
+ this.base.togglePopup(state);
805
+ }
806
+
807
+ this.applyState(state);
808
+ },
809
+ handleBlur: function handleBlur(event) {
810
+ if (!this.currentFocused || this._skipFocusEvent) {
811
+ return;
812
+ }
813
+
814
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
815
+ var state = this.base.initState();
816
+ var _a = this.$props,
817
+ allowCustom = _a.allowCustom,
818
+ filterable = _a.filterable;
819
+ state.event = event;
820
+ state.data.currentFocused = false;
821
+ state.events.push({
822
+ type: 'blur'
823
+ });
824
+
825
+ if (opened) {
826
+ if (this.currentOpened) {
827
+ state.data.currentOpened = false;
828
+ }
829
+
830
+ state.events.push({
831
+ type: 'close'
832
+ });
833
+ }
834
+
835
+ if (!allowCustom && !filterable && this.currentText) {
836
+ state.data.currentText = '';
837
+ }
838
+
839
+ this.applyState(state);
840
+ },
841
+ handleFocus: function handleFocus(event) {
842
+ if (this._skipFocusEvent) {
843
+ return;
844
+ }
845
+
846
+ this.base.handleFocus(event);
847
+ },
848
+ onPopupOpened: function onPopupOpened() {
849
+ if (this.input && this.currentFocused) {
850
+ this.focusElement(this.input);
851
+ }
852
+ },
853
+ onPopupClosed: function onPopupClosed() {
854
+ var _this = this;
855
+
856
+ if (this.currentFocused) {
857
+ setTimeout(function () {
858
+ if (_this.currentFocused) {
859
+ _this.focusElement(_this.input);
860
+ }
861
+ }, 0);
862
+ }
863
+ },
864
+ focusElement: function focusElement(element) {
865
+ var _this = this;
866
+
867
+ this._skipFocusEvent = true;
868
+ element.focus();
869
+ setTimeout(function () {
870
+ return _this._skipFocusEvent = false;
871
+ }, 30);
872
+ },
873
+ applyState: function applyState(state) {
874
+ this.base.applyState(state);
875
+ this.valuesItemsDuringOnChange = null;
876
+ },
877
+ setValidity: function setValidity() {
878
+ if (this.input && this.input.setCustomValidity) {
879
+ this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
880
+ }
881
+ },
882
+ focus: function focus() {
883
+ if (this.input) {
884
+ this.input.focus();
885
+ }
886
+ }
887
+ },
888
+ render: function render(createElement) {
889
+ var _a;
890
+
891
+ var h = gh || createElement;
892
+ var _b = this.$props,
893
+ style = _b.style,
894
+ label = _b.label,
895
+ dir = _b.dir,
896
+ disabled = _b.disabled,
897
+ tags = _b.tags,
898
+ textField = _b.textField,
899
+ dataItemKey = _b.dataItemKey,
900
+ virtual = _b.virtual,
901
+ loading = _b.loading,
902
+ size = _b.size,
903
+ fillMode = _b.fillMode,
904
+ rounded = _b.rounded,
905
+ tagsRounded = _b.tagsRounded;
906
+ var focused = this.currentFocused;
907
+ var popupSettings = Object.assign({}, {
908
+ animate: true,
909
+ height: '200px'
910
+ }, this.$props.popupSettings);
911
+ var focusedTag = this.currentFocusedTag;
912
+ var value = this.computedValue();
913
+ var searchText = (this.$props.filter !== undefined ? this.$props.filter : this.currentText) || '';
914
+ var clearButton = !loading && (!!searchText || value.length > 0);
915
+ var vs = this.base.vs;
916
+ var id = this.$props.id || this.inputId;
917
+ var tagRender = templateRendering.call(this, this.$props.tagRender, getListeners.call(this));
918
+ vs.enabled = virtual !== undefined;
919
+
920
+ if (virtual !== undefined) {
921
+ vs.skip = virtual.skip;
922
+ vs.total = virtual.total;
923
+ vs.pageSize = virtual.pageSize;
924
+ }
925
+
926
+ var tagsToRender = [];
927
+
928
+ if (tags === undefined) {
929
+ this.computedValue().forEach(function (item) {
930
+ tagsToRender.push({
931
+ text: getItemValue(item, textField),
932
+ data: [item]
933
+ });
934
+ });
935
+ } else {
936
+ tagsToRender.push.apply(tagsToRender, tags);
937
+ }
938
+
939
+ this.setItems(tagsToRender, this._tags);
940
+ var isValid = !this.$props.validityStyles || this.validity().valid;
941
+
942
+ var renderClearButton = function renderClearButton(cbutton) {
943
+ if (cbutton) {
944
+ // @ts-ignore function children
945
+ return h(ClearButton, {
946
+ onClearclick: this.clearButtonClick,
947
+ on: this.v3 ? undefined : {
948
+ "clearclick": this.clearButtonClick
949
+ },
950
+ key: "clearbutton"
951
+ });
952
+ }
953
+
954
+ return h("span");
955
+ };
956
+
957
+ var renderLoading = function renderLoading(cloading) {
958
+ if (cloading) {
959
+ return h("span", {
960
+ "class": "k-icon k-input-loading-icon k-i-loading"
961
+ });
962
+ }
963
+
964
+ return h("span");
965
+ };
966
+
967
+ var renderSearchBar = function renderSearchBar(searchId) {
968
+ var _this = this;
969
+
970
+ var activedescendant = this.activedescendant;
971
+ var placeholder = this.$props.placeholder;
972
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
973
+ var focusedIndex = this.getFocusedState().focusedIndex;
974
+ var placeholderToShow = value.length === 0 && !searchText ? placeholder : undefined;
975
+ var ariaActivedescendant = activedescendant === ActiveDescendant.TagsList && focusedTag !== undefined ? "tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) : "option-".concat(this.base.guid, "-").concat(focusedIndex);
976
+ return (// @ts-ignore function children
977
+ h(SearchBar, {
978
+ id: searchId,
979
+ attrs: this.v3 ? undefined : {
980
+ id: searchId,
981
+ size: Math.max((placeholderToShow || '').length, searchText.length, 1),
982
+ tabIndex: this.$props.tabIndex,
983
+ accessKey: this.$props.accessKey,
984
+ placeholder: placeholderToShow,
985
+ value: searchText,
986
+ disabled: disabled,
987
+ expanded: opened,
988
+ owns: this.base.listBoxId,
989
+ activedescendant: ariaActivedescendant,
990
+ "aria-describedBy": "tagslist-".concat(this.base.guid, " ").concat(this.$props.ariaDescribedBy || ''),
991
+ "aria-labelledBy": this.$props.ariaLabelledBy
992
+ },
993
+ size: Math.max((placeholderToShow || '').length, searchText.length, 1),
994
+ tabIndex: this.$props.tabIndex,
995
+ accessKey: this.$props.accessKey,
996
+ placeholder: placeholderToShow,
997
+ value: searchText,
998
+ onChange: this.onChangeHandler,
999
+ on: this.v3 ? undefined : {
1000
+ "change": this.onChangeHandler,
1001
+ "blur": this.handleBlur,
1002
+ "keydown": this.onInputKeyDown
1003
+ },
1004
+ onBlur: this.handleBlur,
1005
+ onKeydown: this.onInputKeyDown,
1006
+ ref: this.v3 ? function (el) {
1007
+ _this.inputRef = el;
1008
+ } : 'input',
1009
+ disabled: disabled,
1010
+ expanded: opened,
1011
+ owns: this.base.listBoxId,
1012
+ activedescendant: ariaActivedescendant,
1013
+ "aria-describedBy": "tagslist-".concat(this.base.guid, " ").concat(this.$props.ariaDescribedBy || ''),
1014
+ "aria-labelledBy": this.$props.ariaLabelledBy
1015
+ })
1016
+ );
1017
+ };
1018
+
1019
+ var renderList = function renderList() {
1020
+ var _this2 = this;
1021
+
1022
+ var _a = this.$props.dataItems,
1023
+ dataItems = _a === void 0 ? [] : _a;
1024
+ var itemRender = templateRendering.call(this, this.$props.itemRender, getListeners.call(this));
1025
+ var listNoDataRender = templateRendering.call(this, this.$props.listNoDataRender, getListeners.call(this));
1026
+ var skip = virtual ? virtual.skip : 0;
1027
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
1028
+ var focusedIndex = this.getFocusedState().focusedIndex;
1029
+ var translate = "translateY(".concat(vs.translate, "px)");
1030
+ return (// @ts-ignore function children
1031
+ h(List, {
1032
+ id: this.base.listBoxId,
1033
+ attrs: this.v3 ? undefined : {
1034
+ id: this.base.listBoxId,
1035
+ show: opened,
1036
+ dataItems: dataItems.slice(),
1037
+ focusedIndex: focusedIndex - skip,
1038
+ value: this.computedValue(),
1039
+ textField: textField,
1040
+ valueField: dataItemKey,
1041
+ optionsGuid: this.base.guid,
1042
+ wrapperStyle: {
1043
+ maxHeight: popupSettings.height
1044
+ },
1045
+ wrapperCssClass: 'k-list-content',
1046
+ listStyle: vs.enabled ? {
1047
+ transform: translate
1048
+ } : undefined,
1049
+ skip: skip,
1050
+ itemRender: itemRender,
1051
+ noDataRender: listNoDataRender
1052
+ },
1053
+ show: opened,
1054
+ dataItems: dataItems.slice(),
1055
+ focusedIndex: focusedIndex - skip,
1056
+ value: this.computedValue(),
1057
+ textField: textField,
1058
+ valueField: dataItemKey,
1059
+ optionsGuid: this.base.guid,
1060
+ ref: 'list',
1061
+ wrapperStyle: {
1062
+ maxHeight: popupSettings.height
1063
+ },
1064
+ wrapperCssClass: 'k-list-content',
1065
+ listStyle: vs.enabled ? {
1066
+ transform: translate
1067
+ } : undefined,
1068
+ key: "listKey",
1069
+ skip: skip,
1070
+ onListclick: this.handleItemClick,
1071
+ on: this.v3 ? undefined : {
1072
+ "listclick": this.handleItemClick,
1073
+ "scroll": vs.scrollHandler
1074
+ },
1075
+ itemRender: itemRender,
1076
+ noDataRender: listNoDataRender,
1077
+ onScroll: vs.scrollHandler
1078
+ }, this.v3 ? function () {
1079
+ return [renderScrollElement.call(_this2)];
1080
+ } : [renderScrollElement.call(_this2)])
1081
+ );
1082
+ };
1083
+
1084
+ var renderScrollElement = function renderScrollElement() {
1085
+ return vs.enabled && h("div", {
1086
+ ref: 'scrollElement',
1087
+ key: 'scrollElementKey'
1088
+ });
1089
+ };
1090
+
1091
+ var renderListContainer = function renderListContainer() {
1092
+ var _this3 = this;
1093
+
1094
+ var _a;
1095
+
1096
+ var base = this.base;
1097
+ var _b = this.$props,
1098
+ allowCustom = _b.allowCustom,
1099
+ _c = _b.dataItems,
1100
+ dataItems = _c === void 0 ? [] : _c;
1101
+ var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
1102
+ var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
1103
+ var header = getTemplate.call(this, {
1104
+ h: h,
1105
+ template: headerTemplate
1106
+ });
1107
+ var footer = getTemplate.call(this, {
1108
+ h: h,
1109
+ template: footerTemplate
1110
+ });
1111
+ var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
1112
+ var currentText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
1113
+ var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
1114
+ var focusedType = this.getFocusedState().focusedType;
1115
+ var customItem = allowCustom && currentText && h("div", {
1116
+ "class": "k-list",
1117
+ key: "customitem",
1118
+ onClick: this.customItemSelect,
1119
+ on: this.v3 ? undefined : {
1120
+ "click": this.customItemSelect
1121
+ }
1122
+ }, [h("div", {
1123
+ "class": classNames('k-item k-custom-item', {
1124
+ 'k-focus': isCustom(focusedType)
1125
+ })
1126
+ }, [currentText, h("span", {
1127
+ "class": "k-icon k-i-plus",
1128
+ style: {
1129
+ float: 'right'
1130
+ }
1131
+ })])]);
1132
+ return (// @ts-ignore function children
1133
+ h(ListContainer, {
1134
+ ref: 'container',
1135
+ onMousedown: preventDefault,
1136
+ on: this.v3 ? undefined : {
1137
+ "mousedown": preventDefault,
1138
+ "blur": this.handleBlur
1139
+ },
1140
+ dir: dir !== undefined ? dir : base.dirCalculated,
1141
+ attrs: this.v3 ? undefined : {
1142
+ dir: dir !== undefined ? dir : base.dirCalculated,
1143
+ width: popupWidth,
1144
+ popupSettings: __assign(__assign({}, popupSettings), {
1145
+ anchor: this.anchor,
1146
+ show: opened,
1147
+ onOpen: this.onPopupOpened,
1148
+ onClose: this.onPopupClosed,
1149
+ popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
1150
+ className: classNames('k-list-container', popupSettings.className)
1151
+ }),
1152
+ itemsCount: dataItems.length
1153
+ },
1154
+ onBlur: this.handleBlur,
1155
+ width: popupWidth,
1156
+ popupSettings: __assign(__assign({}, popupSettings), {
1157
+ anchor: this.anchor,
1158
+ show: opened,
1159
+ onOpen: this.onPopupOpened,
1160
+ onClose: this.onPopupClosed,
1161
+ popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
1162
+ className: classNames('k-list-container', popupSettings.className)
1163
+ }),
1164
+ itemsCount: dataItems.length
1165
+ }, this.v3 ? function () {
1166
+ return [header && h("div", {
1167
+ "class": "k-list-header"
1168
+ }, [header]), customItem, renderList.call(_this3), footer && h("div", {
1169
+ "class": "k-list-footer"
1170
+ }, [footer]), virtual && header];
1171
+ } : [header && h("div", {
1172
+ "class": "k-list-header"
1173
+ }, [header]), customItem, renderList.call(_this3), footer && h("div", {
1174
+ "class": "k-list-footer"
1175
+ }, [footer]), virtual && header])
1176
+ );
1177
+ };
1178
+
1179
+ var component = h("span", {
1180
+ ref: setRef(this, 'kendoAnchor', this.anchor),
1181
+ "class": classNames('k-multiselect', 'k-input', (_a = {}, _a["k-input-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-input-".concat(fillMode)] = fillMode, _a['k-focus'] = focused && !disabled, _a['k-disabled'] = disabled, _a['k-invalid'] = !isValid, _a['k-loading'] = loading, _a['k-required'] = this.required, _a)),
1182
+ style: !label ? style : __assign(__assign({}, style), {
1183
+ width: undefined
1184
+ }),
1185
+ dir: dir,
1186
+ attrs: this.v3 ? undefined : {
1187
+ dir: dir
1188
+ },
1189
+ onFocusin: this.handleFocus,
1190
+ on: this.v3 ? undefined : {
1191
+ "focusin": this.handleFocus,
1192
+ "click": this.handleWrapperClick,
1193
+ "mousedown": preventDefaultNonInputs
1194
+ },
1195
+ onClick: this.handleWrapperClick,
1196
+ onMousedown: preventDefaultNonInputs
1197
+ }, [tagsToRender.length > 0 && // @ts-ignore function children
1198
+ h(TagList, {
1199
+ tagsRounded: tagsRounded,
1200
+ attrs: this.v3 ? undefined : {
1201
+ tagsRounded: tagsRounded,
1202
+ size: size,
1203
+ fillMode: fillMode,
1204
+ tagRender: tagRender,
1205
+ dataItems: tagsToRender,
1206
+ guid: this.base.guid,
1207
+ focused: focusedTag ? tagsToRender.find(function (t) {
1208
+ return matchTags(t, focusedTag, dataItemKey);
1209
+ }) : undefined
1210
+ },
1211
+ size: size,
1212
+ fillMode: fillMode,
1213
+ tagRender: tagRender,
1214
+ onTagdelete: this.onTagDelete,
1215
+ on: this.v3 ? undefined : {
1216
+ "tagdelete": this.onTagDelete
1217
+ },
1218
+ dataItems: tagsToRender,
1219
+ guid: this.base.guid,
1220
+ focused: focusedTag ? tagsToRender.find(function (t) {
1221
+ return matchTags(t, focusedTag, dataItemKey);
1222
+ }) : undefined
1223
+ }), renderSearchBar.call(this, id), renderClearButton.call(this, clearButton), renderLoading.call(this, loading), renderListContainer.call(this)]);
1224
+ return label ? h("span", {
1225
+ "class": this.spanClassNames,
1226
+ dir: this.$props.dir,
1227
+ attrs: this.v3 ? undefined : {
1228
+ dir: this.$props.dir
1229
+ }
1230
+ }, [component, this.$props.label ? id ? h("label", {
1231
+ "for": id,
1232
+ attrs: this.v3 ? undefined : {
1233
+ "for": id
1234
+ },
1235
+ "class": "k-label"
1236
+ }, [this.$props.label]) : h("span", {
1237
+ "class": "k-label"
1238
+ }, [this.$props.label]) : null]) : component;
1239
+ }
1240
+ };
1241
+ /**
1242
+ * @hidden
1243
+ */
1244
+
1245
+ var MultiSelect = MultiSelectVue2;
1246
+ export { MultiSelect, MultiSelectVue2 };