@progress/kendo-vue-dropdowns 3.6.4-dev.202210071340 → 3.6.5-dev.202210181442

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 (47) hide show
  1. package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
  2. package/dist/es/AutoComplete/AutoComplete.js +49 -92
  3. package/dist/es/ComboBox/ComboBox.js +88 -162
  4. package/dist/es/DropDownList/DropDownList.js +99 -154
  5. package/dist/es/MultiSelect/MultiSelect.js +61 -170
  6. package/dist/es/MultiSelect/TagList.js +10 -21
  7. package/dist/es/common/ClearButton.js +0 -2
  8. package/dist/es/common/DropDownBase.js +18 -78
  9. package/dist/es/common/List.js +17 -21
  10. package/dist/es/common/ListContainer.js +16 -18
  11. package/dist/es/common/ListDefaultItem.js +3 -5
  12. package/dist/es/common/ListFilter.js +4 -7
  13. package/dist/es/common/ListItem.js +2 -8
  14. package/dist/es/common/SearchBar.js +3 -9
  15. package/dist/es/common/VirtualScroll.js +5 -41
  16. package/dist/es/package-metadata.js +1 -1
  17. package/dist/esm/AutoComplete/AutoComplete.js +49 -92
  18. package/dist/esm/ComboBox/ComboBox.js +88 -162
  19. package/dist/esm/DropDownList/DropDownList.js +99 -154
  20. package/dist/esm/MultiSelect/MultiSelect.js +61 -170
  21. package/dist/esm/MultiSelect/TagList.js +10 -21
  22. package/dist/esm/common/ClearButton.js +0 -2
  23. package/dist/esm/common/DropDownBase.js +18 -78
  24. package/dist/esm/common/List.js +17 -21
  25. package/dist/esm/common/ListContainer.js +16 -18
  26. package/dist/esm/common/ListDefaultItem.js +3 -5
  27. package/dist/esm/common/ListFilter.js +4 -7
  28. package/dist/esm/common/ListItem.js +2 -8
  29. package/dist/esm/common/SearchBar.js +3 -9
  30. package/dist/esm/common/VirtualScroll.js +5 -41
  31. package/dist/esm/package-metadata.js +1 -1
  32. package/dist/npm/AutoComplete/AutoComplete.js +49 -101
  33. package/dist/npm/ComboBox/ComboBox.js +88 -175
  34. package/dist/npm/DropDownList/DropDownList.js +99 -165
  35. package/dist/npm/MultiSelect/MultiSelect.js +61 -182
  36. package/dist/npm/MultiSelect/TagList.js +10 -24
  37. package/dist/npm/common/ClearButton.js +2 -8
  38. package/dist/npm/common/DropDownBase.js +18 -84
  39. package/dist/npm/common/List.js +19 -30
  40. package/dist/npm/common/ListContainer.js +18 -24
  41. package/dist/npm/common/ListDefaultItem.js +5 -11
  42. package/dist/npm/common/ListFilter.js +6 -12
  43. package/dist/npm/common/ListItem.js +2 -12
  44. package/dist/npm/common/SearchBar.js +5 -14
  45. package/dist/npm/common/VirtualScroll.js +5 -41
  46. package/dist/npm/package-metadata.js +1 -1
  47. package/package.json +5 -5
@@ -2,18 +2,14 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
18
14
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
15
  if (ar || !(i in from)) {
@@ -22,9 +18,8 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
22
18
  }
23
19
  }
24
20
  return to.concat(ar || Array.prototype.slice.call(from));
25
- }; // @ts-ignore
26
-
27
-
21
+ };
22
+ // @ts-ignore
28
23
  import * as Vue from 'vue';
29
24
  var allVue = Vue;
30
25
  var gh = allVue.h;
@@ -32,7 +27,7 @@ var isV3 = allVue.version && allVue.version[0] === '3';
32
27
  var ref = allVue.ref;
33
28
  import { classNames, Keys, guid, templateRendering, getListeners, getTemplate, kendoThemeMaps, setRef, getRef } from '@progress/kendo-vue-common';
34
29
  var sizeMap = kendoThemeMaps.sizeMap,
35
- roundedMap = kendoThemeMaps.roundedMap;
30
+ roundedMap = kendoThemeMaps.roundedMap;
36
31
  import { ListContainer } from '../common/ListContainer';
37
32
  import { List } from '../common/List';
38
33
  import { TagList } from './TagList';
@@ -42,25 +37,19 @@ import { ClearButton } from '../common/ClearButton';
42
37
  import { ActiveDescendant } from './../common/settings';
43
38
  import { itemIndexStartsWith, getItemValue, areSame, matchDataCollections, removeDataItems, isPresent, preventDefaultNonInputs } from '../common/utils';
44
39
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
45
-
46
40
  var preventDefault = function preventDefault(event) {
47
41
  return event.preventDefault();
48
42
  };
49
-
50
43
  var matchTags = function matchTags(tag1, tag2, key) {
51
44
  if (!!tag1 !== !!tag2 || tag1.text !== tag2.text) {
52
45
  return false;
53
46
  }
54
-
55
47
  return tag1 === tag2 || matchDataCollections(tag1.data, tag2.data, key);
56
48
  };
57
-
58
49
  var isCustom = function isCustom(type) {
59
50
  return type === FocusedItemType.CustomItem;
60
51
  };
61
-
62
52
  var FocusedItemType;
63
-
64
53
  (function (FocusedItemType) {
65
54
  FocusedItemType[FocusedItemType["None"] = 0] = "None";
66
55
  FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
@@ -69,8 +58,6 @@ var FocusedItemType;
69
58
  /**
70
59
  * @hidden
71
60
  */
72
-
73
-
74
61
  var MultiSelectVue2 = {
75
62
  name: 'KendoMultiSelect',
76
63
  // @ts-ignore
@@ -273,36 +260,30 @@ var MultiSelectVue2 = {
273
260
  }, this.$props.popupSettings);
274
261
  var list = this.$refs.list;
275
262
  var scrollElement = this.$refs.scrollElement;
276
-
277
263
  if (list) {
278
264
  // @ts-ignore
279
- this.base.vs.list = list.list; // @ts-ignore
280
-
265
+ this.base.vs.list = list.list;
266
+ // @ts-ignore
281
267
  this.base.list = list.list;
282
268
  }
283
-
284
269
  if (scrollElement) {
285
270
  this.base.vs.scrollElement = scrollElement;
286
271
  }
287
-
288
272
  if (list && this.dataItems.length) {
289
273
  // @ts-ignore
290
274
  this.base.vs.scrollerRef(list.$el);
291
275
  }
292
-
293
276
  if (!popupSettings.animate && closing) {
294
277
  this.onPopupClosed();
295
278
  }
296
-
297
279
  if (virtual && this.virtualTotalHasChanged) {
298
280
  this.base.vs.calcScrollElementHeight();
299
281
  this.base.vs.reset();
300
282
  this.virtualTotalHasChanged = false;
301
283
  } else {
302
284
  var _a = this.getFocusedState(),
303
- focusedItem = _a.focusedItem,
304
- focusedIndex = _a.focusedIndex;
305
-
285
+ focusedItem = _a.focusedItem,
286
+ focusedIndex = _a.focusedIndex;
306
287
  if (opening && virtual) {
307
288
  this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
308
289
  this.prevCurrentOpened = true;
@@ -313,14 +294,13 @@ var MultiSelectVue2 = {
313
294
  this.base.scrollToItem(focusedIndex - skip);
314
295
  }
315
296
  }
316
-
317
297
  this.scrollToFocused = false;
318
298
  this.searchBarRef();
319
299
  this.setValidity();
320
300
  },
321
301
  mounted: function mounted() {
322
- this.hasMounted = true; // @ts-ignore
323
-
302
+ this.hasMounted = true;
303
+ // @ts-ignore
324
304
  this.input = this.v3 ? this.inputRef.input : this.$refs.input.input;
325
305
  this.base.wrapper = getRef(this, 'kendoAnchor', this.anchor);
326
306
  this.element = getRef(this, 'kendoAnchor', this.anchor);
@@ -331,7 +311,6 @@ var MultiSelectVue2 = {
331
311
  methods: {
332
312
  computedValue: function computedValue() {
333
313
  var result = [];
334
-
335
314
  if (this.valuesItemsDuringOnChange) {
336
315
  result.push.apply(result, this.valuesItemsDuringOnChange);
337
316
  } else if (this.$props.value) {
@@ -343,24 +322,20 @@ var MultiSelectVue2 = {
343
322
  } else if (this.$props.defaultValue) {
344
323
  result.push.apply(result, this.$props.defaultValue);
345
324
  }
346
-
347
325
  return this.valuePrimitive ? this.findByFieldValue(this.valueField, result) || result : result;
348
326
  },
349
327
  findByFieldValue: function findByFieldValue(field, result) {
350
328
  var _this = this;
351
-
352
329
  var newResult = result.map(function (currentValue) {
353
330
  var index = _this.dataItems.findIndex(function (i) {
354
331
  return getItemValue(i, field) === currentValue;
355
332
  });
356
-
357
333
  return _this.dataItems[index] || currentValue;
358
334
  });
359
335
  return newResult;
360
336
  },
361
337
  primitiveValue: function primitiveValue() {
362
338
  var _this = this;
363
-
364
339
  var computed = this.computedValue();
365
340
  var value = computed.map(function (v) {
366
341
  return getItemValue(v, _this.valueField);
@@ -380,10 +355,10 @@ var MultiSelectVue2 = {
380
355
  },
381
356
  handleItemSelect: function handleItemSelect(index, state) {
382
357
  var _a = this.$props,
383
- _b = _a.dataItems,
384
- dataItems = _b === void 0 ? [] : _b,
385
- dataItemKey = _a.dataItemKey,
386
- virtual = _a.virtual;
358
+ _b = _a.dataItems,
359
+ dataItems = _b === void 0 ? [] : _b,
360
+ dataItemKey = _a.dataItemKey,
361
+ virtual = _a.virtual;
387
362
  var value = this.computedValue();
388
363
  var skip = virtual ? virtual.skip : 0;
389
364
  var dataItem = dataItems[index - skip];
@@ -391,7 +366,6 @@ var MultiSelectVue2 = {
391
366
  return areSame(i, dataItem, dataItemKey);
392
367
  });
393
368
  var newItems = [];
394
-
395
369
  if (indexInValue !== -1) {
396
370
  // item is already selected
397
371
  newItems = value;
@@ -399,21 +373,16 @@ var MultiSelectVue2 = {
399
373
  } else {
400
374
  newItems = __spreadArray(__spreadArray([], value, true), [dataItem], false);
401
375
  }
402
-
403
376
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
404
-
405
377
  if (text) {
406
378
  if (this.currentText) {
407
379
  state.data.currentText = '';
408
380
  }
409
-
410
381
  this.base.filterChanged('', state);
411
382
  }
412
-
413
383
  if (this.currentFocusedIndex !== undefined) {
414
384
  state.data.currentFocusedIndex = undefined;
415
385
  }
416
-
417
386
  this.triggerOnChange(newItems, state);
418
387
  this.base.triggerPageChangeCornerItems(dataItem, state);
419
388
  },
@@ -421,15 +390,12 @@ var MultiSelectVue2 = {
421
390
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
422
391
  var state = this.base.initState();
423
392
  state.event = event;
424
-
425
393
  if (opened) {
426
394
  this.base.togglePopup(state);
427
395
  }
428
-
429
396
  if (!this.currentFocused) {
430
397
  state.data.currentFocused = true;
431
398
  }
432
-
433
399
  var selected = this.computedValue();
434
400
  removeDataItems(selected, itemsToRemove, this.$props.dataItemKey);
435
401
  this.triggerOnChange(selected, state);
@@ -437,21 +403,18 @@ var MultiSelectVue2 = {
437
403
  },
438
404
  onNavigate: function onNavigate(state, keyCode) {
439
405
  var _a = this.$props,
440
- allowCustom = _a.allowCustom,
441
- _b = _a.dataItems,
442
- dataItems = _b === void 0 ? [] : _b;
406
+ allowCustom = _a.allowCustom,
407
+ _b = _a.dataItems,
408
+ dataItems = _b === void 0 ? [] : _b;
443
409
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
444
410
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
445
-
446
411
  var _c = this.getFocusedState(),
447
- focusedType = _c.focusedType,
448
- focusedIndex = _c.focusedIndex;
449
-
412
+ focusedType = _c.focusedType,
413
+ focusedIndex = _c.focusedIndex;
450
414
  var customItem = allowCustom && text;
451
415
  var customItemFocused = isCustom(focusedType);
452
416
  var base = this.base;
453
417
  var vs = base.vs;
454
-
455
418
  if (opened && keyCode === Keys.up && customItemFocused) {
456
419
  if (this.currentFocusedIndex !== undefined) {
457
420
  state.data.currentFocusedIndex = undefined;
@@ -463,27 +426,24 @@ var MultiSelectVue2 = {
463
426
  max: (vs.enabled ? vs.total : dataItems.length) - 1,
464
427
  min: customItem ? -1 : 0
465
428
  });
466
-
467
429
  if (newFocused !== undefined) {
468
430
  this.itemFocus(newFocused, state);
469
431
  this.scrollToFocused = true;
470
432
  }
471
433
  }
472
-
473
434
  this.applyState(state);
474
435
  },
475
436
  itemFocus: function itemFocus(index, state) {
476
437
  var _a = this.$props,
477
- _b = _a.dataItems,
478
- dataItems = _b === void 0 ? [] : _b,
479
- allowCustom = _a.allowCustom,
480
- virtual = _a.virtual;
438
+ _b = _a.dataItems,
439
+ dataItems = _b === void 0 ? [] : _b,
440
+ allowCustom = _a.allowCustom,
441
+ virtual = _a.virtual;
481
442
  var skip = virtual ? virtual.skip : 0;
482
443
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
483
444
  var focusedIndex = this.getFocusedState().focusedIndex;
484
445
  var customItem = allowCustom && text;
485
446
  var nextFocusedItem = dataItems[index - skip];
486
-
487
447
  if (nextFocusedItem && focusedIndex !== index) {
488
448
  if (this.currentFocusedIndex !== index) {
489
449
  state.data.currentFocusedIndex = index;
@@ -494,12 +454,10 @@ var MultiSelectVue2 = {
494
454
  state.data.currentFocusedIndex = undefined;
495
455
  }
496
456
  }
497
-
498
457
  this.base.triggerPageChangeCornerItems(nextFocusedItem, state);
499
458
  },
500
459
  searchBarRef: function searchBarRef() {
501
460
  var _this = this;
502
-
503
461
  if (this.input && this.currentFocused) {
504
462
  setTimeout(function () {
505
463
  return _this.input.focus();
@@ -511,17 +469,13 @@ var MultiSelectVue2 = {
511
469
  var value = event.currentTarget.value;
512
470
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
513
471
  state.event = event;
514
-
515
472
  if (this.$props.filter === undefined) {
516
473
  state.data.currentText = value;
517
474
  }
518
-
519
475
  state.data.currentFocusedIndex = undefined;
520
-
521
476
  if (!opened) {
522
477
  this.base.togglePopup(state);
523
478
  }
524
-
525
479
  this.base.filterChanged(value, state);
526
480
  this.applyState(state);
527
481
  },
@@ -530,53 +484,40 @@ var MultiSelectVue2 = {
530
484
  var state = this.base.initState();
531
485
  state.event = event;
532
486
  event.stopPropagation();
533
-
534
487
  if (this.computedValue().length > 0) {
535
488
  this.triggerOnChange([], state);
536
489
  }
537
-
538
490
  if (this.currentFocusedIndex !== undefined) {
539
491
  state.data.currentFocusedIndex = undefined;
540
492
  }
541
-
542
493
  if (opened) {
543
494
  this.base.togglePopup(state);
544
495
  }
545
-
546
496
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
547
-
548
497
  if (isPresent(text) && text !== '') {
549
498
  this.base.filterChanged('', state);
550
499
  }
551
-
552
500
  if (this.currentText) {
553
501
  state.data.currentText = '';
554
502
  }
555
-
556
503
  this.applyState(state);
557
504
  },
558
505
  onInputKeyDown: function onInputKeyDown(event) {
559
506
  var _this = this;
560
-
561
507
  var keyCode = event.keyCode;
562
508
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
563
509
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
564
510
  var focusedItem = this.getFocusedState().focusedItem;
565
511
  var state = this.base.initState();
566
512
  state.event = event;
567
-
568
513
  if (!text && this.computedValue().length > 0 && (keyCode === Keys.left || keyCode === Keys.right || keyCode === Keys.home || keyCode === Keys.end || keyCode === Keys.delete || keyCode === Keys.backspace)) {
569
514
  return this.onTagsNavigate(event, state);
570
515
  }
571
-
572
516
  var togglePopup = function togglePopup() {
573
517
  event.preventDefault();
574
-
575
518
  _this.base.togglePopup(state);
576
-
577
519
  _this.applyState(state);
578
520
  };
579
-
580
521
  if (opened) {
581
522
  if (event.altKey && keyCode === Keys.up) {
582
523
  togglePopup();
@@ -585,7 +526,6 @@ var MultiSelectVue2 = {
585
526
  this.onNavigate(state, keyCode);
586
527
  } else if (keyCode === Keys.enter) {
587
528
  event.preventDefault();
588
-
589
529
  if (this.$props.allowCustom && text && focusedItem === null) {
590
530
  this.customItemSelect(event);
591
531
  } else {
@@ -608,14 +548,12 @@ var MultiSelectVue2 = {
608
548
  }) : -1;
609
549
  var newFocusedTag = undefined;
610
550
  var hasFocused = focusedIndex !== -1;
611
-
612
551
  if (keyCode === Keys.left) {
613
552
  if (hasFocused) {
614
553
  focusedIndex = Math.max(0, focusedIndex - 1);
615
554
  } else {
616
555
  focusedIndex = tags.length - 1;
617
556
  }
618
-
619
557
  newFocusedTag = tags[focusedIndex];
620
558
  } else if (keyCode === Keys.right) {
621
559
  if (focusedIndex === tags.length - 1) {
@@ -636,7 +574,6 @@ var MultiSelectVue2 = {
636
574
  }
637
575
  } else if (keyCode === Keys.backspace) {
638
576
  var items = this.computedValue();
639
-
640
577
  if (hasFocused) {
641
578
  removeDataItems(items, tags[focusedIndex].data, itemsKey);
642
579
  this.triggerOnChange(items, state);
@@ -646,19 +583,16 @@ var MultiSelectVue2 = {
646
583
  this.triggerOnChange(items, state);
647
584
  }
648
585
  }
649
-
650
586
  if (newFocusedTag !== focusedTag) {
651
587
  state.data.currentFocusedTag = newFocusedTag;
652
588
  state.data.activedescendant = ActiveDescendant.TagsList;
653
589
  }
654
-
655
590
  this.applyState(state);
656
591
  },
657
592
  triggerOnChange: function triggerOnChange(items, state) {
658
593
  if (this.$props.value === undefined) {
659
594
  state.data.currentValue = __spreadArray([], items, true);
660
595
  }
661
-
662
596
  this.valuesItemsDuringOnChange = [];
663
597
  this.setItems(items, this.valuesItemsDuringOnChange);
664
598
  state.events.push({
@@ -667,12 +601,11 @@ var MultiSelectVue2 = {
667
601
  },
668
602
  selectFocusedItem: function selectFocusedItem(event) {
669
603
  var _a = this.$props,
670
- _b = _a.dataItems,
671
- dataItems = _b === void 0 ? [] : _b,
672
- virtual = _a.virtual;
604
+ _b = _a.dataItems,
605
+ dataItems = _b === void 0 ? [] : _b,
606
+ virtual = _a.virtual;
673
607
  var focusedIndex = this.getFocusedState().focusedIndex;
674
608
  var skip = virtual ? virtual.skip : 0;
675
-
676
609
  if (dataItems[focusedIndex - skip] !== undefined) {
677
610
  this.handleItemClick(focusedIndex, event);
678
611
  }
@@ -685,17 +618,16 @@ var MultiSelectVue2 = {
685
618
  var focusedIndex = this.currentFocusedIndex;
686
619
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
687
620
  var _a = this.$props,
688
- allowCustom = _a.allowCustom,
689
- _b = _a.dataItems,
690
- dataItems = _b === void 0 ? [] : _b,
691
- dataItemKey = _a.dataItemKey,
692
- virtual = _a.virtual,
693
- textField = _a.textField,
694
- _c = _a.focusedItemIndex,
695
- focusedItemIndex = _c === void 0 ? itemIndexStartsWith : _c;
621
+ allowCustom = _a.allowCustom,
622
+ _b = _a.dataItems,
623
+ dataItems = _b === void 0 ? [] : _b,
624
+ dataItemKey = _a.dataItemKey,
625
+ virtual = _a.virtual,
626
+ textField = _a.textField,
627
+ _c = _a.focusedItemIndex,
628
+ focusedItemIndex = _c === void 0 ? itemIndexStartsWith : _c;
696
629
  var skip = virtual && virtual.skip || 0;
697
630
  var focusedInd;
698
-
699
631
  if (focusedIndex !== undefined) {
700
632
  return {
701
633
  focusedIndex: focusedIndex,
@@ -703,9 +635,7 @@ var MultiSelectVue2 = {
703
635
  focusedType: FocusedItemType.ListItem
704
636
  };
705
637
  }
706
-
707
638
  var selected = this.computedValue();
708
-
709
639
  if (allowCustom && text) {
710
640
  return {
711
641
  focusedItem: null,
@@ -724,7 +654,6 @@ var MultiSelectVue2 = {
724
654
  focusedInd = dataItems.findIndex(function (i) {
725
655
  return areSame(i, last_1, dataItemKey);
726
656
  });
727
-
728
657
  if (dataItems[focusedInd] !== undefined) {
729
658
  return {
730
659
  focusedIndex: focusedInd + skip,
@@ -732,13 +661,11 @@ var MultiSelectVue2 = {
732
661
  focusedType: FocusedItemType.ListItem
733
662
  };
734
663
  }
735
-
736
664
  return {
737
665
  focusedType: FocusedItemType.None,
738
666
  focusedIndex: -1
739
667
  };
740
668
  }
741
-
742
669
  return skip === 0 ? {
743
670
  focusedItem: dataItems[0],
744
671
  focusedIndex: 0,
@@ -750,27 +677,20 @@ var MultiSelectVue2 = {
750
677
  },
751
678
  customItemSelect: function customItemSelect(event) {
752
679
  var _a;
753
-
754
680
  var itemText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
755
681
  var textField = this.$props.textField;
756
-
757
682
  if (!itemText) {
758
683
  return;
759
684
  }
760
-
761
685
  var state = this.base.initState();
762
686
  state.event = event;
763
687
  var item = textField ? (_a = {}, _a[textField] = itemText, _a) : itemText;
764
-
765
688
  if (this.currentText !== undefined) {
766
689
  state.data.currentText = '';
767
690
  }
768
-
769
691
  state.data.currentFocusedIndex = undefined;
770
692
  this.base.filterChanged('', state);
771
-
772
693
  var newItems = __spreadArray(__spreadArray([], this.computedValue(), true), [item], false);
773
-
774
694
  this.triggerOnChange(newItems, state);
775
695
  this.base.togglePopup(state);
776
696
  this.applyState(state);
@@ -778,21 +698,17 @@ var MultiSelectVue2 = {
778
698
  handleWrapperClick: function handleWrapperClick(event) {
779
699
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
780
700
  var input = this.input;
781
-
782
701
  if (!opened && input) {
783
702
  this.focusElement(input);
784
703
  }
785
-
786
704
  var state = this.base.initState();
787
705
  state.event = event;
788
-
789
706
  if (!this.currentFocused) {
790
707
  state.events.push({
791
708
  type: 'focus'
792
709
  });
793
710
  state.data.currentFocused = true;
794
711
  }
795
-
796
712
  this.base.togglePopup(state);
797
713
  this.applyState(state);
798
714
  },
@@ -800,50 +716,42 @@ var MultiSelectVue2 = {
800
716
  var state = this.base.initState();
801
717
  state.event = event;
802
718
  this.handleItemSelect(index, state);
803
-
804
719
  if (this.$props.autoClose) {
805
720
  this.base.togglePopup(state);
806
721
  }
807
-
808
722
  this.applyState(state);
809
723
  },
810
724
  handleBlur: function handleBlur(event) {
811
725
  if (!this.currentFocused || this._skipFocusEvent) {
812
726
  return;
813
727
  }
814
-
815
728
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
816
729
  var state = this.base.initState();
817
730
  var _a = this.$props,
818
- allowCustom = _a.allowCustom,
819
- filterable = _a.filterable;
731
+ allowCustom = _a.allowCustom,
732
+ filterable = _a.filterable;
820
733
  state.event = event;
821
734
  state.data.currentFocused = false;
822
735
  state.events.push({
823
736
  type: 'blur'
824
737
  });
825
-
826
738
  if (opened) {
827
739
  if (this.currentOpened) {
828
740
  state.data.currentOpened = false;
829
741
  }
830
-
831
742
  state.events.push({
832
743
  type: 'close'
833
744
  });
834
745
  }
835
-
836
746
  if (!allowCustom && !filterable && this.currentText) {
837
747
  state.data.currentText = '';
838
748
  }
839
-
840
749
  this.applyState(state);
841
750
  },
842
751
  handleFocus: function handleFocus(event) {
843
752
  if (this._skipFocusEvent) {
844
753
  return;
845
754
  }
846
-
847
755
  this.base.handleFocus(event);
848
756
  },
849
757
  onPopupOpened: function onPopupOpened() {
@@ -853,7 +761,6 @@ var MultiSelectVue2 = {
853
761
  },
854
762
  onPopupClosed: function onPopupClosed() {
855
763
  var _this = this;
856
-
857
764
  if (this.currentFocused) {
858
765
  setTimeout(function () {
859
766
  if (_this.currentFocused) {
@@ -864,7 +771,6 @@ var MultiSelectVue2 = {
864
771
  },
865
772
  focusElement: function focusElement(element) {
866
773
  var _this = this;
867
-
868
774
  this._skipFocusEvent = true;
869
775
  element.focus();
870
776
  setTimeout(function () {
@@ -891,23 +797,22 @@ var MultiSelectVue2 = {
891
797
  },
892
798
  render: function render(createElement) {
893
799
  var _a;
894
-
895
800
  var h = gh || createElement;
896
801
  var _b = this.$props,
897
- style = _b.style,
898
- label = _b.label,
899
- dir = _b.dir,
900
- disabled = _b.disabled,
901
- tags = _b.tags,
902
- textField = _b.textField,
903
- dataItemKey = _b.dataItemKey,
904
- virtual = _b.virtual,
905
- loading = _b.loading,
906
- size = _b.size,
907
- fillMode = _b.fillMode,
908
- rounded = _b.rounded,
909
- tagsRounded = _b.tagsRounded,
910
- removeTagIcon = _b.removeTagIcon;
802
+ style = _b.style,
803
+ label = _b.label,
804
+ dir = _b.dir,
805
+ disabled = _b.disabled,
806
+ tags = _b.tags,
807
+ textField = _b.textField,
808
+ dataItemKey = _b.dataItemKey,
809
+ virtual = _b.virtual,
810
+ loading = _b.loading,
811
+ size = _b.size,
812
+ fillMode = _b.fillMode,
813
+ rounded = _b.rounded,
814
+ tagsRounded = _b.tagsRounded,
815
+ removeTagIcon = _b.removeTagIcon;
911
816
  var focused = this.currentFocused;
912
817
  var popupSettings = Object.assign({}, {
913
818
  animate: true,
@@ -921,15 +826,12 @@ var MultiSelectVue2 = {
921
826
  var id = this.$props.id || this.inputId;
922
827
  var tagRender = templateRendering.call(this, this.$props.tagRender, getListeners.call(this));
923
828
  vs.enabled = virtual !== undefined;
924
-
925
829
  if (virtual !== undefined) {
926
830
  vs.skip = virtual.skip;
927
831
  vs.total = virtual.total;
928
832
  vs.pageSize = virtual.pageSize;
929
833
  }
930
-
931
834
  var tagsToRender = [];
932
-
933
835
  if (tags === undefined) {
934
836
  this.computedValue().forEach(function (item) {
935
837
  tagsToRender.push({
@@ -940,10 +842,8 @@ var MultiSelectVue2 = {
940
842
  } else {
941
843
  tagsToRender.push.apply(tagsToRender, tags);
942
844
  }
943
-
944
845
  this.setItems(tagsToRender, this._tags);
945
846
  var isValid = !this.$props.validityStyles || this.validity().valid;
946
-
947
847
  var renderClearButton = function renderClearButton(cbutton) {
948
848
  if (cbutton) {
949
849
  // @ts-ignore function children
@@ -955,30 +855,26 @@ var MultiSelectVue2 = {
955
855
  key: "clearbutton"
956
856
  });
957
857
  }
958
-
959
858
  return h("span");
960
859
  };
961
-
962
860
  var renderLoading = function renderLoading(cloading) {
963
861
  if (cloading) {
964
862
  return h("span", {
965
863
  "class": "k-icon k-input-loading-icon k-i-loading"
966
864
  });
967
865
  }
968
-
969
866
  return h("span");
970
867
  };
971
-
972
868
  var renderSearchBar = function renderSearchBar(searchId) {
973
869
  var _this = this;
974
-
975
870
  var activedescendant = this.activedescendant;
976
871
  var placeholder = this.$props.placeholder;
977
872
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
978
873
  var focusedIndex = this.getFocusedState().focusedIndex;
979
874
  var placeholderToShow = value.length === 0 && !searchText ? placeholder : undefined;
980
875
  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);
981
- return (// @ts-ignore function children
876
+ return (
877
+ // @ts-ignore function children
982
878
  h(SearchBar, {
983
879
  id: searchId,
984
880
  attrs: this.v3 ? undefined : {
@@ -1020,19 +916,18 @@ var MultiSelectVue2 = {
1020
916
  })
1021
917
  );
1022
918
  };
1023
-
1024
919
  var renderList = function renderList() {
1025
920
  var _this2 = this;
1026
-
1027
921
  var _a = this.$props.dataItems,
1028
- dataItems = _a === void 0 ? [] : _a;
922
+ dataItems = _a === void 0 ? [] : _a;
1029
923
  var itemRender = templateRendering.call(this, this.$props.itemRender, getListeners.call(this));
1030
924
  var listNoDataRender = templateRendering.call(this, this.$props.listNoDataRender, getListeners.call(this));
1031
925
  var skip = virtual ? virtual.skip : 0;
1032
926
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
1033
927
  var focusedIndex = this.getFocusedState().focusedIndex;
1034
928
  var translate = "translateY(".concat(vs.translate, "px)");
1035
- return (// @ts-ignore function children
929
+ return (
930
+ // @ts-ignore function children
1036
931
  h(List, {
1037
932
  id: this.base.listBoxId,
1038
933
  attrs: this.v3 ? undefined : {
@@ -1085,24 +980,20 @@ var MultiSelectVue2 = {
1085
980
  } : [renderScrollElement.call(_this2)])
1086
981
  );
1087
982
  };
1088
-
1089
983
  var renderScrollElement = function renderScrollElement() {
1090
984
  return vs.enabled && h("div", {
1091
985
  ref: 'scrollElement',
1092
986
  key: 'scrollElementKey'
1093
987
  });
1094
988
  };
1095
-
1096
989
  var renderListContainer = function renderListContainer() {
1097
990
  var _this3 = this;
1098
-
1099
991
  var _a;
1100
-
1101
992
  var base = this.base;
1102
993
  var _b = this.$props,
1103
- allowCustom = _b.allowCustom,
1104
- _c = _b.dataItems,
1105
- dataItems = _c === void 0 ? [] : _c;
994
+ allowCustom = _b.allowCustom,
995
+ _c = _b.dataItems,
996
+ dataItems = _c === void 0 ? [] : _c;
1106
997
  var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
1107
998
  var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
1108
999
  var header = getTemplate.call(this, {
@@ -1134,7 +1025,8 @@ var MultiSelectVue2 = {
1134
1025
  float: 'right'
1135
1026
  }
1136
1027
  })])]);
1137
- return (// @ts-ignore function children
1028
+ return (
1029
+ // @ts-ignore function children
1138
1030
  h(ListContainer, {
1139
1031
  ref: 'container',
1140
1032
  onMousedown: preventDefault,
@@ -1180,7 +1072,6 @@ var MultiSelectVue2 = {
1180
1072
  }, [footer]), virtual && header])
1181
1073
  );
1182
1074
  };
1183
-
1184
1075
  var component = h("span", {
1185
1076
  ref: setRef(this, 'kendoAnchor', this.anchor),
1186
1077
  "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)),
@@ -1199,7 +1090,8 @@ var MultiSelectVue2 = {
1199
1090
  },
1200
1091
  onClick: this.handleWrapperClick,
1201
1092
  onMousedown: preventDefaultNonInputs
1202
- }, [tagsToRender.length > 0 && // @ts-ignore function children
1093
+ }, [tagsToRender.length > 0 &&
1094
+ // @ts-ignore function children
1203
1095
  h(TagList, {
1204
1096
  removeTagIcon: removeTagIcon,
1205
1097
  attrs: this.v3 ? undefined : {
@@ -1248,6 +1140,5 @@ var MultiSelectVue2 = {
1248
1140
  /**
1249
1141
  * @hidden
1250
1142
  */
1251
-
1252
1143
  var MultiSelect = MultiSelectVue2;
1253
1144
  export { MultiSelect, MultiSelectVue2 };