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

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