@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
@@ -4,18 +4,14 @@ var __assign = undefined && undefined.__assign || function () {
4
4
  __assign = Object.assign || function (t) {
5
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
6
6
  s = arguments[i];
7
-
8
7
  for (var p in s) {
9
8
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
10
9
  }
11
10
  }
12
-
13
11
  return t;
14
12
  };
15
-
16
13
  return __assign.apply(this, arguments);
17
14
  };
18
-
19
15
  var __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {
20
16
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
21
17
  if (ar || !(i in from)) {
@@ -25,60 +21,41 @@ var __spreadArray = undefined && undefined.__spreadArray || function (to, from,
25
21
  }
26
22
  return to.concat(ar || Array.prototype.slice.call(from));
27
23
  };
28
-
29
24
  Object.defineProperty(exports, "__esModule", {
30
25
  value: true
31
26
  });
32
- exports.MultiSelectVue2 = exports.MultiSelect = void 0; // @ts-ignore
33
-
27
+ exports.MultiSelectVue2 = exports.MultiSelect = void 0;
28
+ // @ts-ignore
34
29
  var Vue = require("vue");
35
-
36
30
  var allVue = Vue;
37
31
  var gh = allVue.h;
38
32
  var isV3 = allVue.version && allVue.version[0] === '3';
39
33
  var ref = allVue.ref;
40
-
41
34
  var kendo_vue_common_1 = require("@progress/kendo-vue-common");
42
-
43
35
  var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap,
44
- roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
45
-
36
+ roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
46
37
  var ListContainer_1 = require("../common/ListContainer");
47
-
48
38
  var List_1 = require("../common/List");
49
-
50
39
  var TagList_1 = require("./TagList");
51
-
52
40
  var SearchBar_1 = require("../common/SearchBar");
53
-
54
41
  var DropDownBase_1 = require("../common/DropDownBase");
55
-
56
42
  var ClearButton_1 = require("../common/ClearButton");
57
-
58
43
  var settings_1 = require("./../common/settings");
59
-
60
44
  var utils_1 = require("../common/utils");
61
-
62
45
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
63
-
64
46
  var preventDefault = function preventDefault(event) {
65
47
  return event.preventDefault();
66
48
  };
67
-
68
49
  var matchTags = function matchTags(tag1, tag2, key) {
69
50
  if (!!tag1 !== !!tag2 || tag1.text !== tag2.text) {
70
51
  return false;
71
52
  }
72
-
73
53
  return tag1 === tag2 || (0, utils_1.matchDataCollections)(tag1.data, tag2.data, key);
74
54
  };
75
-
76
55
  var isCustom = function isCustom(type) {
77
56
  return type === FocusedItemType.CustomItem;
78
57
  };
79
-
80
58
  var FocusedItemType;
81
-
82
59
  (function (FocusedItemType) {
83
60
  FocusedItemType[FocusedItemType["None"] = 0] = "None";
84
61
  FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
@@ -87,8 +64,6 @@ var FocusedItemType;
87
64
  /**
88
65
  * @hidden
89
66
  */
90
-
91
-
92
67
  var MultiSelectVue2 = {
93
68
  name: 'KendoMultiSelect',
94
69
  // @ts-ignore
@@ -291,36 +266,30 @@ var MultiSelectVue2 = {
291
266
  }, this.$props.popupSettings);
292
267
  var list = this.$refs.list;
293
268
  var scrollElement = this.$refs.scrollElement;
294
-
295
269
  if (list) {
296
270
  // @ts-ignore
297
- this.base.vs.list = list.list; // @ts-ignore
298
-
271
+ this.base.vs.list = list.list;
272
+ // @ts-ignore
299
273
  this.base.list = list.list;
300
274
  }
301
-
302
275
  if (scrollElement) {
303
276
  this.base.vs.scrollElement = scrollElement;
304
277
  }
305
-
306
278
  if (list && this.dataItems.length) {
307
279
  // @ts-ignore
308
280
  this.base.vs.scrollerRef(list.$el);
309
281
  }
310
-
311
282
  if (!popupSettings.animate && closing) {
312
283
  this.onPopupClosed();
313
284
  }
314
-
315
285
  if (virtual && this.virtualTotalHasChanged) {
316
286
  this.base.vs.calcScrollElementHeight();
317
287
  this.base.vs.reset();
318
288
  this.virtualTotalHasChanged = false;
319
289
  } else {
320
290
  var _a = this.getFocusedState(),
321
- focusedItem = _a.focusedItem,
322
- focusedIndex = _a.focusedIndex;
323
-
291
+ focusedItem = _a.focusedItem,
292
+ focusedIndex = _a.focusedIndex;
324
293
  if (opening && virtual) {
325
294
  this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
326
295
  this.prevCurrentOpened = true;
@@ -331,14 +300,13 @@ var MultiSelectVue2 = {
331
300
  this.base.scrollToItem(focusedIndex - skip);
332
301
  }
333
302
  }
334
-
335
303
  this.scrollToFocused = false;
336
304
  this.searchBarRef();
337
305
  this.setValidity();
338
306
  },
339
307
  mounted: function mounted() {
340
- this.hasMounted = true; // @ts-ignore
341
-
308
+ this.hasMounted = true;
309
+ // @ts-ignore
342
310
  this.input = this.v3 ? this.inputRef.input : this.$refs.input.input;
343
311
  this.base.wrapper = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
344
312
  this.element = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
@@ -349,7 +317,6 @@ var MultiSelectVue2 = {
349
317
  methods: {
350
318
  computedValue: function computedValue() {
351
319
  var result = [];
352
-
353
320
  if (this.valuesItemsDuringOnChange) {
354
321
  result.push.apply(result, this.valuesItemsDuringOnChange);
355
322
  } else if (this.$props.value) {
@@ -361,24 +328,20 @@ var MultiSelectVue2 = {
361
328
  } else if (this.$props.defaultValue) {
362
329
  result.push.apply(result, this.$props.defaultValue);
363
330
  }
364
-
365
331
  return this.valuePrimitive ? this.findByFieldValue(this.valueField, result) || result : result;
366
332
  },
367
333
  findByFieldValue: function findByFieldValue(field, result) {
368
334
  var _this = this;
369
-
370
335
  var newResult = result.map(function (currentValue) {
371
336
  var index = _this.dataItems.findIndex(function (i) {
372
337
  return (0, utils_1.getItemValue)(i, field) === currentValue;
373
338
  });
374
-
375
339
  return _this.dataItems[index] || currentValue;
376
340
  });
377
341
  return newResult;
378
342
  },
379
343
  primitiveValue: function primitiveValue() {
380
344
  var _this = this;
381
-
382
345
  var computed = this.computedValue();
383
346
  var value = computed.map(function (v) {
384
347
  return (0, utils_1.getItemValue)(v, _this.valueField);
@@ -398,10 +361,10 @@ var MultiSelectVue2 = {
398
361
  },
399
362
  handleItemSelect: function handleItemSelect(index, state) {
400
363
  var _a = this.$props,
401
- _b = _a.dataItems,
402
- dataItems = _b === void 0 ? [] : _b,
403
- dataItemKey = _a.dataItemKey,
404
- virtual = _a.virtual;
364
+ _b = _a.dataItems,
365
+ dataItems = _b === void 0 ? [] : _b,
366
+ dataItemKey = _a.dataItemKey,
367
+ virtual = _a.virtual;
405
368
  var value = this.computedValue();
406
369
  var skip = virtual ? virtual.skip : 0;
407
370
  var dataItem = dataItems[index - skip];
@@ -409,7 +372,6 @@ var MultiSelectVue2 = {
409
372
  return (0, utils_1.areSame)(i, dataItem, dataItemKey);
410
373
  });
411
374
  var newItems = [];
412
-
413
375
  if (indexInValue !== -1) {
414
376
  // item is already selected
415
377
  newItems = value;
@@ -417,21 +379,16 @@ var MultiSelectVue2 = {
417
379
  } else {
418
380
  newItems = __spreadArray(__spreadArray([], value, true), [dataItem], false);
419
381
  }
420
-
421
382
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
422
-
423
383
  if (text) {
424
384
  if (this.currentText) {
425
385
  state.data.currentText = '';
426
386
  }
427
-
428
387
  this.base.filterChanged('', state);
429
388
  }
430
-
431
389
  if (this.currentFocusedIndex !== undefined) {
432
390
  state.data.currentFocusedIndex = undefined;
433
391
  }
434
-
435
392
  this.triggerOnChange(newItems, state);
436
393
  this.base.triggerPageChangeCornerItems(dataItem, state);
437
394
  },
@@ -439,15 +396,12 @@ var MultiSelectVue2 = {
439
396
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
440
397
  var state = this.base.initState();
441
398
  state.event = event;
442
-
443
399
  if (opened) {
444
400
  this.base.togglePopup(state);
445
401
  }
446
-
447
402
  if (!this.currentFocused) {
448
403
  state.data.currentFocused = true;
449
404
  }
450
-
451
405
  var selected = this.computedValue();
452
406
  (0, utils_1.removeDataItems)(selected, itemsToRemove, this.$props.dataItemKey);
453
407
  this.triggerOnChange(selected, state);
@@ -455,21 +409,18 @@ var MultiSelectVue2 = {
455
409
  },
456
410
  onNavigate: function onNavigate(state, keyCode) {
457
411
  var _a = this.$props,
458
- allowCustom = _a.allowCustom,
459
- _b = _a.dataItems,
460
- dataItems = _b === void 0 ? [] : _b;
412
+ allowCustom = _a.allowCustom,
413
+ _b = _a.dataItems,
414
+ dataItems = _b === void 0 ? [] : _b;
461
415
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
462
416
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
463
-
464
417
  var _c = this.getFocusedState(),
465
- focusedType = _c.focusedType,
466
- focusedIndex = _c.focusedIndex;
467
-
418
+ focusedType = _c.focusedType,
419
+ focusedIndex = _c.focusedIndex;
468
420
  var customItem = allowCustom && text;
469
421
  var customItemFocused = isCustom(focusedType);
470
422
  var base = this.base;
471
423
  var vs = base.vs;
472
-
473
424
  if (opened && keyCode === kendo_vue_common_1.Keys.up && customItemFocused) {
474
425
  if (this.currentFocusedIndex !== undefined) {
475
426
  state.data.currentFocusedIndex = undefined;
@@ -481,27 +432,24 @@ var MultiSelectVue2 = {
481
432
  max: (vs.enabled ? vs.total : dataItems.length) - 1,
482
433
  min: customItem ? -1 : 0
483
434
  });
484
-
485
435
  if (newFocused !== undefined) {
486
436
  this.itemFocus(newFocused, state);
487
437
  this.scrollToFocused = true;
488
438
  }
489
439
  }
490
-
491
440
  this.applyState(state);
492
441
  },
493
442
  itemFocus: function itemFocus(index, state) {
494
443
  var _a = this.$props,
495
- _b = _a.dataItems,
496
- dataItems = _b === void 0 ? [] : _b,
497
- allowCustom = _a.allowCustom,
498
- virtual = _a.virtual;
444
+ _b = _a.dataItems,
445
+ dataItems = _b === void 0 ? [] : _b,
446
+ allowCustom = _a.allowCustom,
447
+ virtual = _a.virtual;
499
448
  var skip = virtual ? virtual.skip : 0;
500
449
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
501
450
  var focusedIndex = this.getFocusedState().focusedIndex;
502
451
  var customItem = allowCustom && text;
503
452
  var nextFocusedItem = dataItems[index - skip];
504
-
505
453
  if (nextFocusedItem && focusedIndex !== index) {
506
454
  if (this.currentFocusedIndex !== index) {
507
455
  state.data.currentFocusedIndex = index;
@@ -512,12 +460,10 @@ var MultiSelectVue2 = {
512
460
  state.data.currentFocusedIndex = undefined;
513
461
  }
514
462
  }
515
-
516
463
  this.base.triggerPageChangeCornerItems(nextFocusedItem, state);
517
464
  },
518
465
  searchBarRef: function searchBarRef() {
519
466
  var _this = this;
520
-
521
467
  if (this.input && this.currentFocused) {
522
468
  setTimeout(function () {
523
469
  return _this.input.focus();
@@ -529,17 +475,13 @@ var MultiSelectVue2 = {
529
475
  var value = event.currentTarget.value;
530
476
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
531
477
  state.event = event;
532
-
533
478
  if (this.$props.filter === undefined) {
534
479
  state.data.currentText = value;
535
480
  }
536
-
537
481
  state.data.currentFocusedIndex = undefined;
538
-
539
482
  if (!opened) {
540
483
  this.base.togglePopup(state);
541
484
  }
542
-
543
485
  this.base.filterChanged(value, state);
544
486
  this.applyState(state);
545
487
  },
@@ -548,53 +490,40 @@ var MultiSelectVue2 = {
548
490
  var state = this.base.initState();
549
491
  state.event = event;
550
492
  event.stopPropagation();
551
-
552
493
  if (this.computedValue().length > 0) {
553
494
  this.triggerOnChange([], state);
554
495
  }
555
-
556
496
  if (this.currentFocusedIndex !== undefined) {
557
497
  state.data.currentFocusedIndex = undefined;
558
498
  }
559
-
560
499
  if (opened) {
561
500
  this.base.togglePopup(state);
562
501
  }
563
-
564
502
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
565
-
566
503
  if ((0, utils_1.isPresent)(text) && text !== '') {
567
504
  this.base.filterChanged('', state);
568
505
  }
569
-
570
506
  if (this.currentText) {
571
507
  state.data.currentText = '';
572
508
  }
573
-
574
509
  this.applyState(state);
575
510
  },
576
511
  onInputKeyDown: function onInputKeyDown(event) {
577
512
  var _this = this;
578
-
579
513
  var keyCode = event.keyCode;
580
514
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
581
515
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
582
516
  var focusedItem = this.getFocusedState().focusedItem;
583
517
  var state = this.base.initState();
584
518
  state.event = event;
585
-
586
519
  if (!text && this.computedValue().length > 0 && (keyCode === kendo_vue_common_1.Keys.left || keyCode === kendo_vue_common_1.Keys.right || keyCode === kendo_vue_common_1.Keys.home || keyCode === kendo_vue_common_1.Keys.end || keyCode === kendo_vue_common_1.Keys.delete || keyCode === kendo_vue_common_1.Keys.backspace)) {
587
520
  return this.onTagsNavigate(event, state);
588
521
  }
589
-
590
522
  var togglePopup = function togglePopup() {
591
523
  event.preventDefault();
592
-
593
524
  _this.base.togglePopup(state);
594
-
595
525
  _this.applyState(state);
596
526
  };
597
-
598
527
  if (opened) {
599
528
  if (event.altKey && keyCode === kendo_vue_common_1.Keys.up) {
600
529
  togglePopup();
@@ -603,7 +532,6 @@ var MultiSelectVue2 = {
603
532
  this.onNavigate(state, keyCode);
604
533
  } else if (keyCode === kendo_vue_common_1.Keys.enter) {
605
534
  event.preventDefault();
606
-
607
535
  if (this.$props.allowCustom && text && focusedItem === null) {
608
536
  this.customItemSelect(event);
609
537
  } else {
@@ -626,14 +554,12 @@ var MultiSelectVue2 = {
626
554
  }) : -1;
627
555
  var newFocusedTag = undefined;
628
556
  var hasFocused = focusedIndex !== -1;
629
-
630
557
  if (keyCode === kendo_vue_common_1.Keys.left) {
631
558
  if (hasFocused) {
632
559
  focusedIndex = Math.max(0, focusedIndex - 1);
633
560
  } else {
634
561
  focusedIndex = tags.length - 1;
635
562
  }
636
-
637
563
  newFocusedTag = tags[focusedIndex];
638
564
  } else if (keyCode === kendo_vue_common_1.Keys.right) {
639
565
  if (focusedIndex === tags.length - 1) {
@@ -654,7 +580,6 @@ var MultiSelectVue2 = {
654
580
  }
655
581
  } else if (keyCode === kendo_vue_common_1.Keys.backspace) {
656
582
  var items = this.computedValue();
657
-
658
583
  if (hasFocused) {
659
584
  (0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
660
585
  this.triggerOnChange(items, state);
@@ -664,19 +589,16 @@ var MultiSelectVue2 = {
664
589
  this.triggerOnChange(items, state);
665
590
  }
666
591
  }
667
-
668
592
  if (newFocusedTag !== focusedTag) {
669
593
  state.data.currentFocusedTag = newFocusedTag;
670
594
  state.data.activedescendant = settings_1.ActiveDescendant.TagsList;
671
595
  }
672
-
673
596
  this.applyState(state);
674
597
  },
675
598
  triggerOnChange: function triggerOnChange(items, state) {
676
599
  if (this.$props.value === undefined) {
677
600
  state.data.currentValue = __spreadArray([], items, true);
678
601
  }
679
-
680
602
  this.valuesItemsDuringOnChange = [];
681
603
  this.setItems(items, this.valuesItemsDuringOnChange);
682
604
  state.events.push({
@@ -685,12 +607,11 @@ var MultiSelectVue2 = {
685
607
  },
686
608
  selectFocusedItem: function selectFocusedItem(event) {
687
609
  var _a = this.$props,
688
- _b = _a.dataItems,
689
- dataItems = _b === void 0 ? [] : _b,
690
- virtual = _a.virtual;
610
+ _b = _a.dataItems,
611
+ dataItems = _b === void 0 ? [] : _b,
612
+ virtual = _a.virtual;
691
613
  var focusedIndex = this.getFocusedState().focusedIndex;
692
614
  var skip = virtual ? virtual.skip : 0;
693
-
694
615
  if (dataItems[focusedIndex - skip] !== undefined) {
695
616
  this.handleItemClick(focusedIndex, event);
696
617
  }
@@ -703,17 +624,16 @@ var MultiSelectVue2 = {
703
624
  var focusedIndex = this.currentFocusedIndex;
704
625
  var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
705
626
  var _a = this.$props,
706
- allowCustom = _a.allowCustom,
707
- _b = _a.dataItems,
708
- dataItems = _b === void 0 ? [] : _b,
709
- dataItemKey = _a.dataItemKey,
710
- virtual = _a.virtual,
711
- textField = _a.textField,
712
- _c = _a.focusedItemIndex,
713
- focusedItemIndex = _c === void 0 ? utils_1.itemIndexStartsWith : _c;
627
+ allowCustom = _a.allowCustom,
628
+ _b = _a.dataItems,
629
+ dataItems = _b === void 0 ? [] : _b,
630
+ dataItemKey = _a.dataItemKey,
631
+ virtual = _a.virtual,
632
+ textField = _a.textField,
633
+ _c = _a.focusedItemIndex,
634
+ focusedItemIndex = _c === void 0 ? utils_1.itemIndexStartsWith : _c;
714
635
  var skip = virtual && virtual.skip || 0;
715
636
  var focusedInd;
716
-
717
637
  if (focusedIndex !== undefined) {
718
638
  return {
719
639
  focusedIndex: focusedIndex,
@@ -721,9 +641,7 @@ var MultiSelectVue2 = {
721
641
  focusedType: FocusedItemType.ListItem
722
642
  };
723
643
  }
724
-
725
644
  var selected = this.computedValue();
726
-
727
645
  if (allowCustom && text) {
728
646
  return {
729
647
  focusedItem: null,
@@ -742,7 +660,6 @@ var MultiSelectVue2 = {
742
660
  focusedInd = dataItems.findIndex(function (i) {
743
661
  return (0, utils_1.areSame)(i, last_1, dataItemKey);
744
662
  });
745
-
746
663
  if (dataItems[focusedInd] !== undefined) {
747
664
  return {
748
665
  focusedIndex: focusedInd + skip,
@@ -750,13 +667,11 @@ var MultiSelectVue2 = {
750
667
  focusedType: FocusedItemType.ListItem
751
668
  };
752
669
  }
753
-
754
670
  return {
755
671
  focusedType: FocusedItemType.None,
756
672
  focusedIndex: -1
757
673
  };
758
674
  }
759
-
760
675
  return skip === 0 ? {
761
676
  focusedItem: dataItems[0],
762
677
  focusedIndex: 0,
@@ -768,27 +683,20 @@ var MultiSelectVue2 = {
768
683
  },
769
684
  customItemSelect: function customItemSelect(event) {
770
685
  var _a;
771
-
772
686
  var itemText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
773
687
  var textField = this.$props.textField;
774
-
775
688
  if (!itemText) {
776
689
  return;
777
690
  }
778
-
779
691
  var state = this.base.initState();
780
692
  state.event = event;
781
693
  var item = textField ? (_a = {}, _a[textField] = itemText, _a) : itemText;
782
-
783
694
  if (this.currentText !== undefined) {
784
695
  state.data.currentText = '';
785
696
  }
786
-
787
697
  state.data.currentFocusedIndex = undefined;
788
698
  this.base.filterChanged('', state);
789
-
790
699
  var newItems = __spreadArray(__spreadArray([], this.computedValue(), true), [item], false);
791
-
792
700
  this.triggerOnChange(newItems, state);
793
701
  this.base.togglePopup(state);
794
702
  this.applyState(state);
@@ -796,21 +704,17 @@ var MultiSelectVue2 = {
796
704
  handleWrapperClick: function handleWrapperClick(event) {
797
705
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
798
706
  var input = this.input;
799
-
800
707
  if (!opened && input) {
801
708
  this.focusElement(input);
802
709
  }
803
-
804
710
  var state = this.base.initState();
805
711
  state.event = event;
806
-
807
712
  if (!this.currentFocused) {
808
713
  state.events.push({
809
714
  type: 'focus'
810
715
  });
811
716
  state.data.currentFocused = true;
812
717
  }
813
-
814
718
  this.base.togglePopup(state);
815
719
  this.applyState(state);
816
720
  },
@@ -818,50 +722,42 @@ var MultiSelectVue2 = {
818
722
  var state = this.base.initState();
819
723
  state.event = event;
820
724
  this.handleItemSelect(index, state);
821
-
822
725
  if (this.$props.autoClose) {
823
726
  this.base.togglePopup(state);
824
727
  }
825
-
826
728
  this.applyState(state);
827
729
  },
828
730
  handleBlur: function handleBlur(event) {
829
731
  if (!this.currentFocused || this._skipFocusEvent) {
830
732
  return;
831
733
  }
832
-
833
734
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
834
735
  var state = this.base.initState();
835
736
  var _a = this.$props,
836
- allowCustom = _a.allowCustom,
837
- filterable = _a.filterable;
737
+ allowCustom = _a.allowCustom,
738
+ filterable = _a.filterable;
838
739
  state.event = event;
839
740
  state.data.currentFocused = false;
840
741
  state.events.push({
841
742
  type: 'blur'
842
743
  });
843
-
844
744
  if (opened) {
845
745
  if (this.currentOpened) {
846
746
  state.data.currentOpened = false;
847
747
  }
848
-
849
748
  state.events.push({
850
749
  type: 'close'
851
750
  });
852
751
  }
853
-
854
752
  if (!allowCustom && !filterable && this.currentText) {
855
753
  state.data.currentText = '';
856
754
  }
857
-
858
755
  this.applyState(state);
859
756
  },
860
757
  handleFocus: function handleFocus(event) {
861
758
  if (this._skipFocusEvent) {
862
759
  return;
863
760
  }
864
-
865
761
  this.base.handleFocus(event);
866
762
  },
867
763
  onPopupOpened: function onPopupOpened() {
@@ -871,7 +767,6 @@ var MultiSelectVue2 = {
871
767
  },
872
768
  onPopupClosed: function onPopupClosed() {
873
769
  var _this = this;
874
-
875
770
  if (this.currentFocused) {
876
771
  setTimeout(function () {
877
772
  if (_this.currentFocused) {
@@ -882,7 +777,6 @@ var MultiSelectVue2 = {
882
777
  },
883
778
  focusElement: function focusElement(element) {
884
779
  var _this = this;
885
-
886
780
  this._skipFocusEvent = true;
887
781
  element.focus();
888
782
  setTimeout(function () {
@@ -909,23 +803,22 @@ var MultiSelectVue2 = {
909
803
  },
910
804
  render: function render(createElement) {
911
805
  var _a;
912
-
913
806
  var h = gh || createElement;
914
807
  var _b = this.$props,
915
- style = _b.style,
916
- label = _b.label,
917
- dir = _b.dir,
918
- disabled = _b.disabled,
919
- tags = _b.tags,
920
- textField = _b.textField,
921
- dataItemKey = _b.dataItemKey,
922
- virtual = _b.virtual,
923
- loading = _b.loading,
924
- size = _b.size,
925
- fillMode = _b.fillMode,
926
- rounded = _b.rounded,
927
- tagsRounded = _b.tagsRounded,
928
- removeTagIcon = _b.removeTagIcon;
808
+ style = _b.style,
809
+ label = _b.label,
810
+ dir = _b.dir,
811
+ disabled = _b.disabled,
812
+ tags = _b.tags,
813
+ textField = _b.textField,
814
+ dataItemKey = _b.dataItemKey,
815
+ virtual = _b.virtual,
816
+ loading = _b.loading,
817
+ size = _b.size,
818
+ fillMode = _b.fillMode,
819
+ rounded = _b.rounded,
820
+ tagsRounded = _b.tagsRounded,
821
+ removeTagIcon = _b.removeTagIcon;
929
822
  var focused = this.currentFocused;
930
823
  var popupSettings = Object.assign({}, {
931
824
  animate: true,
@@ -939,15 +832,12 @@ var MultiSelectVue2 = {
939
832
  var id = this.$props.id || this.inputId;
940
833
  var tagRender = kendo_vue_common_1.templateRendering.call(this, this.$props.tagRender, kendo_vue_common_1.getListeners.call(this));
941
834
  vs.enabled = virtual !== undefined;
942
-
943
835
  if (virtual !== undefined) {
944
836
  vs.skip = virtual.skip;
945
837
  vs.total = virtual.total;
946
838
  vs.pageSize = virtual.pageSize;
947
839
  }
948
-
949
840
  var tagsToRender = [];
950
-
951
841
  if (tags === undefined) {
952
842
  this.computedValue().forEach(function (item) {
953
843
  tagsToRender.push({
@@ -958,10 +848,8 @@ var MultiSelectVue2 = {
958
848
  } else {
959
849
  tagsToRender.push.apply(tagsToRender, tags);
960
850
  }
961
-
962
851
  this.setItems(tagsToRender, this._tags);
963
852
  var isValid = !this.$props.validityStyles || this.validity().valid;
964
-
965
853
  var renderClearButton = function renderClearButton(cbutton) {
966
854
  if (cbutton) {
967
855
  // @ts-ignore function children
@@ -973,30 +861,26 @@ var MultiSelectVue2 = {
973
861
  key: "clearbutton"
974
862
  });
975
863
  }
976
-
977
864
  return h("span");
978
865
  };
979
-
980
866
  var renderLoading = function renderLoading(cloading) {
981
867
  if (cloading) {
982
868
  return h("span", {
983
869
  "class": "k-icon k-input-loading-icon k-i-loading"
984
870
  });
985
871
  }
986
-
987
872
  return h("span");
988
873
  };
989
-
990
874
  var renderSearchBar = function renderSearchBar(searchId) {
991
875
  var _this = this;
992
-
993
876
  var activedescendant = this.activedescendant;
994
877
  var placeholder = this.$props.placeholder;
995
878
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
996
879
  var focusedIndex = this.getFocusedState().focusedIndex;
997
880
  var placeholderToShow = value.length === 0 && !searchText ? placeholder : undefined;
998
881
  var ariaActivedescendant = activedescendant === settings_1.ActiveDescendant.TagsList && focusedTag !== undefined ? "tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) : "option-".concat(this.base.guid, "-").concat(focusedIndex);
999
- return (// @ts-ignore function children
882
+ return (
883
+ // @ts-ignore function children
1000
884
  h(SearchBar_1.SearchBar, {
1001
885
  id: searchId,
1002
886
  attrs: this.v3 ? undefined : {
@@ -1038,19 +922,18 @@ var MultiSelectVue2 = {
1038
922
  })
1039
923
  );
1040
924
  };
1041
-
1042
925
  var renderList = function renderList() {
1043
926
  var _this2 = this;
1044
-
1045
927
  var _a = this.$props.dataItems,
1046
- dataItems = _a === void 0 ? [] : _a;
928
+ dataItems = _a === void 0 ? [] : _a;
1047
929
  var itemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.itemRender, kendo_vue_common_1.getListeners.call(this));
1048
930
  var listNoDataRender = kendo_vue_common_1.templateRendering.call(this, this.$props.listNoDataRender, kendo_vue_common_1.getListeners.call(this));
1049
931
  var skip = virtual ? virtual.skip : 0;
1050
932
  var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
1051
933
  var focusedIndex = this.getFocusedState().focusedIndex;
1052
934
  var translate = "translateY(".concat(vs.translate, "px)");
1053
- return (// @ts-ignore function children
935
+ return (
936
+ // @ts-ignore function children
1054
937
  h(List_1.List, {
1055
938
  id: this.base.listBoxId,
1056
939
  attrs: this.v3 ? undefined : {
@@ -1103,24 +986,20 @@ var MultiSelectVue2 = {
1103
986
  } : [renderScrollElement.call(_this2)])
1104
987
  );
1105
988
  };
1106
-
1107
989
  var renderScrollElement = function renderScrollElement() {
1108
990
  return vs.enabled && h("div", {
1109
991
  ref: 'scrollElement',
1110
992
  key: 'scrollElementKey'
1111
993
  });
1112
994
  };
1113
-
1114
995
  var renderListContainer = function renderListContainer() {
1115
996
  var _this3 = this;
1116
-
1117
997
  var _a;
1118
-
1119
998
  var base = this.base;
1120
999
  var _b = this.$props,
1121
- allowCustom = _b.allowCustom,
1122
- _c = _b.dataItems,
1123
- dataItems = _c === void 0 ? [] : _c;
1000
+ allowCustom = _b.allowCustom,
1001
+ _c = _b.dataItems,
1002
+ dataItems = _c === void 0 ? [] : _c;
1124
1003
  var headerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.header, kendo_vue_common_1.getListeners.call(this));
1125
1004
  var footerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.footer, kendo_vue_common_1.getListeners.call(this));
1126
1005
  var header = kendo_vue_common_1.getTemplate.call(this, {
@@ -1152,7 +1031,8 @@ var MultiSelectVue2 = {
1152
1031
  float: 'right'
1153
1032
  }
1154
1033
  })])]);
1155
- return (// @ts-ignore function children
1034
+ return (
1035
+ // @ts-ignore function children
1156
1036
  h(ListContainer_1.ListContainer, {
1157
1037
  ref: 'container',
1158
1038
  onMousedown: preventDefault,
@@ -1198,7 +1078,6 @@ var MultiSelectVue2 = {
1198
1078
  }, [footer]), virtual && header])
1199
1079
  );
1200
1080
  };
1201
-
1202
1081
  var component = h("span", {
1203
1082
  ref: (0, kendo_vue_common_1.setRef)(this, 'kendoAnchor', this.anchor),
1204
1083
  "class": (0, kendo_vue_common_1.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)),
@@ -1217,7 +1096,8 @@ var MultiSelectVue2 = {
1217
1096
  },
1218
1097
  onClick: this.handleWrapperClick,
1219
1098
  onMousedown: utils_1.preventDefaultNonInputs
1220
- }, [tagsToRender.length > 0 && // @ts-ignore function children
1099
+ }, [tagsToRender.length > 0 &&
1100
+ // @ts-ignore function children
1221
1101
  h(TagList_1.TagList, {
1222
1102
  removeTagIcon: removeTagIcon,
1223
1103
  attrs: this.v3 ? undefined : {
@@ -1267,6 +1147,5 @@ exports.MultiSelectVue2 = MultiSelectVue2;
1267
1147
  /**
1268
1148
  * @hidden
1269
1149
  */
1270
-
1271
1150
  var MultiSelect = MultiSelectVue2;
1272
1151
  exports.MultiSelect = MultiSelect;