@progress/kendo-vue-dropdowns 3.14.2 → 3.15.0-dev.202309281100

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 (62) hide show
  1. package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
  2. package/dist/es/ComboBox/ComboBox.js +244 -42
  3. package/dist/es/ComboBox/ComboBoxProps.d.ts +8 -0
  4. package/dist/es/DropDownList/DropDownList.d.ts +3 -0
  5. package/dist/es/DropDownList/DropDownList.js +197 -43
  6. package/dist/es/DropDownList/DropDownListProps.d.ts +8 -0
  7. package/dist/es/DropDownTree/DropDownTree.js +257 -105
  8. package/dist/es/DropDownTree/DropDownTreeProps.d.ts +8 -0
  9. package/dist/es/MultiSelect/MultiSelect.js +340 -65
  10. package/dist/es/MultiSelect/MultiSelectProps.d.ts +8 -0
  11. package/dist/es/MultiSelectTree/MultiSelectTree.js +345 -127
  12. package/dist/es/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
  13. package/dist/es/common/DropDownBase.d.ts +7 -0
  14. package/dist/es/common/DropDownBase.js +13 -1
  15. package/dist/es/common/ListFilter.d.ts +1 -0
  16. package/dist/es/common/ListFilter.js +31 -25
  17. package/dist/es/common/constants.d.ts +4 -0
  18. package/dist/es/common/constants.js +4 -0
  19. package/dist/es/messages/main.d.ts +10 -0
  20. package/dist/es/messages/main.js +10 -0
  21. package/dist/es/package-metadata.js +1 -1
  22. package/dist/esm/ComboBox/ComboBox.js +244 -42
  23. package/dist/esm/ComboBox/ComboBoxProps.d.ts +8 -0
  24. package/dist/esm/DropDownList/DropDownList.d.ts +3 -0
  25. package/dist/esm/DropDownList/DropDownList.js +197 -43
  26. package/dist/esm/DropDownList/DropDownListProps.d.ts +8 -0
  27. package/dist/esm/DropDownTree/DropDownTree.js +257 -105
  28. package/dist/esm/DropDownTree/DropDownTreeProps.d.ts +8 -0
  29. package/dist/esm/MultiSelect/MultiSelect.js +340 -65
  30. package/dist/esm/MultiSelect/MultiSelectProps.d.ts +8 -0
  31. package/dist/esm/MultiSelectTree/MultiSelectTree.js +345 -127
  32. package/dist/esm/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
  33. package/dist/esm/common/DropDownBase.d.ts +7 -0
  34. package/dist/esm/common/DropDownBase.js +13 -1
  35. package/dist/esm/common/ListFilter.d.ts +1 -0
  36. package/dist/esm/common/ListFilter.js +31 -25
  37. package/dist/esm/common/constants.d.ts +4 -0
  38. package/dist/esm/common/constants.js +4 -0
  39. package/dist/esm/messages/main.d.ts +10 -0
  40. package/dist/esm/messages/main.js +10 -0
  41. package/dist/esm/package-metadata.js +1 -1
  42. package/dist/npm/ComboBox/ComboBox.js +242 -40
  43. package/dist/npm/ComboBox/ComboBoxProps.d.ts +8 -0
  44. package/dist/npm/DropDownList/DropDownList.d.ts +3 -0
  45. package/dist/npm/DropDownList/DropDownList.js +195 -41
  46. package/dist/npm/DropDownList/DropDownListProps.d.ts +8 -0
  47. package/dist/npm/DropDownTree/DropDownTree.js +254 -102
  48. package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +8 -0
  49. package/dist/npm/MultiSelect/MultiSelect.js +338 -63
  50. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +8 -0
  51. package/dist/npm/MultiSelectTree/MultiSelectTree.js +343 -125
  52. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
  53. package/dist/npm/common/DropDownBase.d.ts +7 -0
  54. package/dist/npm/common/DropDownBase.js +12 -0
  55. package/dist/npm/common/ListFilter.d.ts +1 -0
  56. package/dist/npm/common/ListFilter.js +31 -25
  57. package/dist/npm/common/constants.d.ts +4 -0
  58. package/dist/npm/common/constants.js +10 -0
  59. package/dist/npm/messages/main.d.ts +10 -0
  60. package/dist/npm/messages/main.js +11 -1
  61. package/dist/npm/package-metadata.js +1 -1
  62. package/package.json +12 -9
@@ -43,6 +43,9 @@ var kendo_vue_labels_1 = require("@progress/kendo-vue-labels");
43
43
  var ListFilter_1 = require("../common/ListFilter");
44
44
  var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
45
45
  var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
46
+ var constants_1 = require("../common/constants");
47
+ var kendo_vue_layout_1 = require("@progress/kendo-vue-layout");
48
+ var DropDownBase_1 = require("../common/DropDownBase");
46
49
  var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap,
47
50
  roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
48
51
  var VALIDATION_MESSAGE = 'Please select a value from the list!';
@@ -186,7 +189,15 @@ var DropDownTreeVue2 = {
186
189
  header: [String, Function, Object],
187
190
  footer: [String, Function, Object],
188
191
  valueRender: [String, Function, Object],
189
- listNoData: [String, Function, Object]
192
+ listNoData: [String, Function, Object],
193
+ adaptive: {
194
+ type: Boolean,
195
+ default: undefined
196
+ },
197
+ adaptiveTitle: {
198
+ type: String,
199
+ default: undefined
200
+ }
190
201
  },
191
202
  inject: {
192
203
  kendoLocalizationService: {
@@ -194,7 +205,9 @@ var DropDownTreeVue2 = {
194
205
  }
195
206
  },
196
207
  created: function created() {
208
+ this.observer = null;
197
209
  (0, kendo_vue_common_2.validatePackage)(package_metadata_1.packageMetadata);
210
+ this.base = new DropDownBase_1.default(this);
198
211
  this.componentGuid = (0, kendo_vue_common_1.guid)();
199
212
  this.anchor = (0, kendo_vue_common_1.guid)();
200
213
  },
@@ -204,7 +217,9 @@ var DropDownTreeVue2 = {
204
217
  focused: false,
205
218
  filterState: '',
206
219
  currentValue: undefined,
207
- popupWidth: '200px'
220
+ popupWidth: '200px',
221
+ windowWidth: 0,
222
+ initialAdaptiveRenderingValues: undefined
208
223
  };
209
224
  },
210
225
  computed: {
@@ -230,6 +245,25 @@ var DropDownTreeVue2 = {
230
245
  'k-picker': true
231
246
  }, _a[this.$props.className] = this.$props.className, _a["k-picker-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-picker-".concat(fillMode)] = fillMode, _a['k-focus'] = this.focused, _a['k-invalid'] = !isValid, _a['k-loading'] = this.$props.loading, _a['k-required'] = required, _a['k-disabled'] = this.$props.disabled, _a;
232
247
  },
248
+ animationStyles: {
249
+ get: function get() {
250
+ return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? {
251
+ top: 0,
252
+ width: '100%',
253
+ height: '100%'
254
+ } : undefined;
255
+ }
256
+ },
257
+ classNameAdaptive: {
258
+ get: function get() {
259
+ return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
260
+ }
261
+ },
262
+ adaptiveState: {
263
+ get: function get() {
264
+ return this.windowWidth <= constants_1.MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
265
+ }
266
+ },
233
267
  isOpen: function isOpen() {
234
268
  return this.opened !== undefined ? this.opened : this.currentOpened;
235
269
  },
@@ -243,7 +277,21 @@ var DropDownTreeVue2 = {
243
277
  return this.hasValue ? (0, utils_1.getItemValue)(this.computedValue, this.$props.textField) : '';
244
278
  }
245
279
  },
280
+ watch: {
281
+ // This watch gets the state of the data when the adaptive mode is activated
282
+ isOpen: function isOpen(newValue) {
283
+ if (newValue && this.value) {
284
+ this.initialAdaptiveRenderingValues = __spreadArray([], this.value, true);
285
+ } else {
286
+ this.initialAdaptiveRenderingValues = undefined;
287
+ }
288
+ }
289
+ },
246
290
  mounted: function mounted() {
291
+ this.observer = kendo_vue_common_1.canUseDOM && new ResizeObserver(this.calculateMedia);
292
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
293
+ this.observer.observe(document.body);
294
+ }
247
295
  this.elementRef = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
248
296
  this.inputRef = (0, kendo_vue_common_1.getRef)(this, 'input');
249
297
  this.selectRef = (0, kendo_vue_common_1.getRef)(this, 'select');
@@ -252,6 +300,11 @@ var DropDownTreeVue2 = {
252
300
  this.popupRef = (0, kendo_vue_common_1.getRef)(this, 'popup');
253
301
  this.calculatePopupWidth();
254
302
  },
303
+ destroyed: !!isV3 ? undefined : function () {
304
+ if (this.observer) {
305
+ this.observer.disconnect();
306
+ }
307
+ },
255
308
  updated: function updated() {
256
309
  this.inputRef = (0, kendo_vue_common_1.getRef)(this, 'input');
257
310
  this.treeViewRef = (0, kendo_vue_common_1.getRef)(this, 'treeView');
@@ -270,7 +323,7 @@ var DropDownTreeVue2 = {
270
323
  },
271
324
  // @ts-ignore
272
325
  render: function render(createElement) {
273
- var _this2 = this;
326
+ var _this = this;
274
327
  var h = gh || createElement;
275
328
  var id = this.$props.id || this.componentGuid;
276
329
  var _a = this.$props,
@@ -286,7 +339,8 @@ var DropDownTreeVue2 = {
286
339
  validationMessage = _a.validationMessage,
287
340
  valid = _a.valid,
288
341
  required = _a.required,
289
- validityStyles = _a.validityStyles;
342
+ validityStyles = _a.validityStyles,
343
+ adaptiveTitle = _a.adaptiveTitle;
290
344
  var tabIndex = (0, kendo_vue_common_1.getTabIndex)(this.$props.tabIndex, disabled);
291
345
  var localization = (0, kendo_vue_intl_1.provideLocalizationService)(this);
292
346
  var validity = getValidity({
@@ -294,6 +348,7 @@ var DropDownTreeVue2 = {
294
348
  valid: valid,
295
349
  required: required
296
350
  }, this.hasValue);
351
+ var renderAdaptive = this.adaptiveState;
297
352
  var dir = this.$props.dir; // useRtl(elementRef, props.dir);
298
353
  var itemTemplate = kendo_vue_common_1.templateRendering.call(this, this.item, kendo_vue_common_1.getListeners.call(this));
299
354
  var valueTemplate = kendo_vue_common_1.templateRendering.call(this, this.valueRender, kendo_vue_common_1.getListeners.call(this));
@@ -329,12 +384,152 @@ var DropDownTreeVue2 = {
329
384
  value: this.computedValue
330
385
  }
331
386
  });
387
+ var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
388
+ return [h("div", {
389
+ "class": "k-actionsheet-titlebar-group k-hbox"
390
+ }, [h("div", {
391
+ "class": "k-actionsheet-title"
392
+ }, [h("div", {
393
+ "class": "k-text-center"
394
+ }, [adaptiveTitle]), h("div", {
395
+ "class": "k-actionsheet-subtitle k-text-center"
396
+ }, [placeholder])]), h("div", {
397
+ "class": "k-actionsheet-actions"
398
+ }, [h(kendo_vue_buttons_1.Button, {
399
+ tabindex: 1,
400
+ attrs: this.v3 ? undefined : {
401
+ tabindex: 1,
402
+ "aria-label": "Cancel",
403
+ "aria-disabled": "false",
404
+ type: "button",
405
+ fillMode: "flat",
406
+ icon: "x",
407
+ svgIcon: kendo_svg_icons_1.xIcon
408
+ },
409
+ "aria-label": "Cancel",
410
+ "aria-disabled": "false",
411
+ type: "button",
412
+ fillMode: "flat",
413
+ onClick: _this.onWrapperClick,
414
+ on: this.v3 ? undefined : {
415
+ "click": _this.onWrapperClick
416
+ },
417
+ icon: "x",
418
+ svgIcon: kendo_svg_icons_1.xIcon
419
+ })])]), h("div", {
420
+ "class": "k-actionsheet-titlebar-group k-actionsheet-filter"
421
+ }, [_this.$props.filterable &&
422
+ // @ts-ignore
423
+ h(ListFilter_1.ListFilter, {
424
+ tabindex: 0,
425
+ attrs: this.v3 ? undefined : {
426
+ tabindex: 0,
427
+ value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
428
+ size: size,
429
+ rounded: rounded,
430
+ fillMode: fillMode
431
+ },
432
+ value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
433
+ ref: (0, kendo_vue_common_1.setRef)(_this, 'input'),
434
+ onChange: _this.onFilterChange,
435
+ on: this.v3 ? undefined : {
436
+ "change": _this.onFilterChange,
437
+ "keydown": _this.onInputKeyDown,
438
+ "focus": _this.onFocus,
439
+ "blur": _this.onBlur
440
+ },
441
+ onKeydown: _this.onInputKeyDown,
442
+ size: size,
443
+ rounded: rounded,
444
+ fillMode: fillMode,
445
+ onFocus: _this.onFocus,
446
+ onBlur: _this.onBlur
447
+ })])];
448
+ };
449
+ var adaptiveActionSheetHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, kendo_vue_common_1.getListeners.call(this));
450
+ var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
451
+ var headerToRender = _this.base.getTemplateDef.call(_this, header, h);
452
+ var footerToRender = _this.base.getTemplateDef.call(_this, footer, h);
453
+ return [headerToRender && h("div", {
454
+ "class": "k-list-header"
455
+ }, [headerToRender]), dataItems.length > 0 ?
456
+ // @ts-ignore
457
+ h(kendo_vue_treeview_1.TreeView, {
458
+ ref: (0, kendo_vue_common_1.setRef)(_this, 'treeView'),
459
+ tabIndex: tabIndex,
460
+ attrs: this.v3 ? undefined : {
461
+ tabIndex: tabIndex,
462
+ dataItems: dataItems,
463
+ focusIdField: dataItemKey,
464
+ textField: _this.$props.textField,
465
+ selectField: selectField,
466
+ expandField: _this.$props.expandField,
467
+ childrenField: subItemsField,
468
+ expandIcons: true,
469
+ size: 'large',
470
+ item: itemTemplate
471
+ },
472
+ dataItems: dataItems,
473
+ focusIdField: dataItemKey,
474
+ textField: _this.$props.textField,
475
+ selectField: selectField,
476
+ expandField: _this.$props.expandField,
477
+ childrenField: subItemsField,
478
+ expandIcons: true,
479
+ onItemclick: _this.onChange,
480
+ on: this.v3 ? undefined : {
481
+ "itemclick": _this.onChange,
482
+ "expandchange": _this.onExpand,
483
+ "focus": _this.onFocus,
484
+ "blur": _this.onBlur,
485
+ "keydown": _this.onWrapperKeyDown
486
+ },
487
+ onExpandchange: _this.onExpand,
488
+ onFocus: _this.onFocus,
489
+ onBlur: _this.onBlur,
490
+ onKeydown: _this.onWrapperKeyDown,
491
+ size: 'large',
492
+ item: itemTemplate
493
+ }) : noDataTemplate, footerToRender && h("div", {
494
+ className: "k-list-footer",
495
+ attrs: this.v3 ? undefined : {
496
+ className: "k-list-footer"
497
+ }
498
+ }, [footerToRender])];
499
+ };
500
+ var adaptiveActionSheetContentTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetContentTemplateDef, kendo_vue_common_1.getListeners.call(this));
501
+ var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
502
+ return h(kendo_vue_layout_1.ActionSheet, {
503
+ expand: this.isOpen,
504
+ attrs: this.v3 ? undefined : {
505
+ expand: this.isOpen,
506
+ animation: true,
507
+ animationStyles: this.animationStyles,
508
+ className: this.classNameAdaptive,
509
+ header: adaptiveActionSheetHeaderTemplate,
510
+ content: adaptiveActionSheetContentTemplate,
511
+ contentClassName: '!k-overflow-hidden',
512
+ navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
513
+ },
514
+ animation: true,
515
+ animationStyles: this.animationStyles,
516
+ className: this.classNameAdaptive,
517
+ header: adaptiveActionSheetHeaderTemplate,
518
+ content: adaptiveActionSheetContentTemplate,
519
+ contentClassName: '!k-overflow-hidden',
520
+ onClose: this.onWrapperClick,
521
+ on: this.v3 ? undefined : {
522
+ "close": this.onWrapperClick
523
+ },
524
+ navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
525
+ });
526
+ };
332
527
  var isValid = !validityStyles || validity.valid;
333
528
  var _b = this.$props,
334
529
  size = _b.size,
335
530
  rounded = _b.rounded,
336
531
  fillMode = _b.fillMode;
337
- var dropdowntree = h("span", {
532
+ var component = h("span", {
338
533
  "class": this.wrapperClass,
339
534
  tabIndex: tabIndex,
340
535
  attrs: this.v3 ? undefined : {
@@ -459,7 +654,7 @@ var DropDownTreeVue2 = {
459
654
  }
460
655
  })]),
461
656
  // @ts-ignore function children
462
- h(kendo_vue_popup_1.Popup, {
657
+ !renderAdaptive && h(kendo_vue_popup_1.Popup, {
463
658
  style: {
464
659
  width: this.popupWidth,
465
660
  direction: dir
@@ -486,100 +681,40 @@ var DropDownTreeVue2 = {
486
681
  },
487
682
  onClose: this.onPopupClosed,
488
683
  appendTo: popupSettings.appendTo
489
- }, this.v3 ? function () {
490
- return [_this2.$props.filterable &&
491
- // @ts-ignore
492
- h(ListFilter_1.ListFilter, {
493
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
494
- attrs: _this2.v3 ? undefined : {
495
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
496
- size: size,
497
- rounded: rounded,
498
- fillMode: fillMode
499
- },
500
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'input'),
501
- onChange: _this2.onFilterChange,
502
- on: _this2.v3 ? undefined : {
503
- "change": _this2.onFilterChange,
504
- "keydown": _this2.onInputKeyDown
505
- },
506
- onKeydown: _this2.onInputKeyDown,
507
- size: size,
508
- rounded: rounded,
509
- fillMode: fillMode
510
- }), header && h("div", {
511
- "class": "k-list-header"
512
- }, [header]), dataItems.length > 0 ?
513
- // @ts-ignore
514
- h(kendo_vue_treeview_1.TreeView, {
515
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'treeView'),
516
- tabIndex: tabIndex,
517
- attrs: _this2.v3 ? undefined : {
518
- tabIndex: tabIndex,
519
- dataItems: dataItems,
520
- focusIdField: dataItemKey,
521
- textField: _this2.$props.textField,
522
- selectField: selectField,
523
- expandField: _this2.$props.expandField,
524
- childrenField: subItemsField,
525
- expandIcons: true,
526
- size: size,
527
- item: itemTemplate
528
- },
529
- dataItems: dataItems,
530
- focusIdField: dataItemKey,
531
- textField: _this2.$props.textField,
532
- selectField: selectField,
533
- expandField: _this2.$props.expandField,
534
- childrenField: subItemsField,
535
- expandIcons: true,
536
- onItemclick: _this2.onChange,
537
- on: _this2.v3 ? undefined : {
538
- "itemclick": _this2.onChange,
539
- "expandchange": _this2.onExpand,
540
- "focus": _this2.onFocus,
541
- "blur": _this2.onBlur,
542
- "keydown": _this2.onWrapperKeyDown
543
- },
544
- onExpandchange: _this2.onExpand,
545
- onFocus: _this2.onFocus,
546
- onBlur: _this2.onBlur,
547
- onKeydown: _this2.onWrapperKeyDown,
548
- size: size,
549
- item: itemTemplate
550
- }) : noDataTemplate, footer && h("div", {
551
- "class": "k-list-footer"
552
- }, [footer])];
553
- } : [_this2.$props.filterable && h(ListFilter_1.ListFilter, {
554
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
555
- attrs: _this2.v3 ? undefined : {
556
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
684
+ }, [this.$props.filterable &&
685
+ // @ts-ignore
686
+ h(ListFilter_1.ListFilter, {
687
+ value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
688
+ attrs: this.v3 ? undefined : {
689
+ value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
557
690
  size: size,
558
691
  rounded: rounded,
559
692
  fillMode: fillMode
560
693
  },
561
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'input'),
562
- onChange: _this2.onFilterChange,
563
- on: _this2.v3 ? undefined : {
564
- "change": _this2.onFilterChange,
565
- "keydown": _this2.onInputKeyDown
694
+ ref: (0, kendo_vue_common_1.setRef)(this, 'input'),
695
+ onChange: this.onFilterChange,
696
+ on: this.v3 ? undefined : {
697
+ "change": this.onFilterChange,
698
+ "keydown": this.onInputKeyDown
566
699
  },
567
- onKeydown: _this2.onInputKeyDown,
700
+ onKeydown: this.onInputKeyDown,
568
701
  size: size,
569
702
  rounded: rounded,
570
703
  fillMode: fillMode
571
704
  }), header && h("div", {
572
705
  "class": "k-list-header"
573
- }, [header]), dataItems.length > 0 ? h(kendo_vue_treeview_1.TreeView, {
574
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'treeView'),
706
+ }, [header]), dataItems.length > 0 ?
707
+ // @ts-ignore
708
+ h(kendo_vue_treeview_1.TreeView, {
709
+ ref: (0, kendo_vue_common_1.setRef)(this, 'treeView'),
575
710
  tabIndex: tabIndex,
576
- attrs: _this2.v3 ? undefined : {
711
+ attrs: this.v3 ? undefined : {
577
712
  tabIndex: tabIndex,
578
713
  dataItems: dataItems,
579
714
  focusIdField: dataItemKey,
580
- textField: _this2.$props.textField,
715
+ textField: this.$props.textField,
581
716
  selectField: selectField,
582
- expandField: _this2.$props.expandField,
717
+ expandField: this.$props.expandField,
583
718
  childrenField: subItemsField,
584
719
  expandIcons: true,
585
720
  size: size,
@@ -587,28 +722,32 @@ var DropDownTreeVue2 = {
587
722
  },
588
723
  dataItems: dataItems,
589
724
  focusIdField: dataItemKey,
590
- textField: _this2.$props.textField,
725
+ textField: this.$props.textField,
591
726
  selectField: selectField,
592
- expandField: _this2.$props.expandField,
727
+ expandField: this.$props.expandField,
593
728
  childrenField: subItemsField,
594
729
  expandIcons: true,
595
- onItemclick: _this2.onChange,
596
- on: _this2.v3 ? undefined : {
597
- "itemclick": _this2.onChange,
598
- "expandchange": _this2.onExpand,
599
- "focus": _this2.onFocus,
600
- "blur": _this2.onBlur,
601
- "keydown": _this2.onWrapperKeyDown
730
+ onItemclick: this.onChange,
731
+ on: this.v3 ? undefined : {
732
+ "itemclick": this.onChange,
733
+ "expandchange": this.onExpand,
734
+ "focus": this.onFocus,
735
+ "blur": this.onBlur,
736
+ "keydown": this.onWrapperKeyDown
602
737
  },
603
- onExpandchange: _this2.onExpand,
604
- onFocus: _this2.onFocus,
605
- onBlur: _this2.onBlur,
606
- onKeydown: _this2.onWrapperKeyDown,
738
+ onExpandchange: this.onExpand,
739
+ onFocus: this.onFocus,
740
+ onBlur: this.onBlur,
741
+ onKeydown: this.onWrapperKeyDown,
607
742
  size: size,
608
743
  item: itemTemplate
609
744
  }) : noDataTemplate, footer && h("div", {
610
745
  "class": "k-list-footer"
611
746
  }, [footer])])]);
747
+ // The following one combines the default rendering of the MultiSelect and the Adaptive rendering.
748
+ // This is needed because of Vue 2 specifics
749
+ var dropdowntree = [component, renderAdaptive && renderAdaptiveListContainer.call(this)];
750
+ var dropdowntreeToRender = isV3 ? dropdowntree : this.$props.adaptive ? h("span", [dropdowntree]) : component;
612
751
  return label ?
613
752
  // @ts-ignore function children
614
753
  h(kendo_vue_labels_1.FloatingLabel, {
@@ -631,10 +770,16 @@ var DropDownTreeVue2 = {
631
770
  focused: this.focused,
632
771
  dir: dir
633
772
  }, this.v3 ? function () {
634
- return [dropdowntree];
635
- } : [dropdowntree]) : dropdowntree;
773
+ return [dropdowntreeToRender];
774
+ } : [dropdowntreeToRender]) : dropdowntreeToRender;
636
775
  },
637
776
  methods: {
777
+ calculateMedia: function calculateMedia(entries) {
778
+ for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
779
+ var entry = entries_1[_i];
780
+ this.windowWidth = entry.target.clientWidth;
781
+ }
782
+ },
638
783
  calculatePopupWidth: function calculatePopupWidth() {
639
784
  if (this.elementRef) {
640
785
  this.popupWidth = this.popupSettings.width !== undefined ? this.popupSettings.width : this.elementRef.offsetWidth + 'px';
@@ -674,6 +819,11 @@ var DropDownTreeVue2 = {
674
819
  }
675
820
  },
676
821
  onWrapperClick: function onWrapperClick(event) {
822
+ this.onFilterChange(__assign(__assign({}, event), {
823
+ target: {
824
+ value: ''
825
+ }
826
+ }));
677
827
  if (!event.defaultPrevented && this.$el) {
678
828
  this.focused = true;
679
829
  var ev = {
@@ -737,7 +887,9 @@ var DropDownTreeVue2 = {
737
887
  var _this = this;
738
888
  var keyCode = event.keyCode,
739
889
  altKey = event.altKey;
740
- if (altKey || keyCode !== kendo_vue_common_1.Keys.up && keyCode !== kendo_vue_common_1.Keys.down) {
890
+ if (keyCode === kendo_vue_common_1.Keys.esc) {
891
+ this.onWrapperClick(event);
892
+ } else if (altKey || keyCode !== kendo_vue_common_1.Keys.up && keyCode !== kendo_vue_common_1.Keys.down) {
741
893
  return;
742
894
  }
743
895
  event.preventDefault();
@@ -792,7 +944,7 @@ var DropDownTreeVue2 = {
792
944
  target: this
793
945
  };
794
946
  var focusEvent = __assign({}, ev);
795
- if (!event.relatedTarget || !event.relatedTarget.closest('.popup-' + this.componentGuid)) {
947
+ if ((!event.relatedTarget || !event.relatedTarget.closest('.popup-' + this.componentGuid)) && !this.adaptiveState) {
796
948
  this.$emit('blur', focusEvent);
797
949
  this.closePopup(ev);
798
950
  }
@@ -290,4 +290,12 @@ export interface DropDownTreeProps extends FormComponentProps {
290
290
  * @default `solid`
291
291
  */
292
292
  fillMode?: null | 'solid' | 'flat' | 'outline' | string;
293
+ /**
294
+ * Provides different rendering of the popup element based on the screen dimensions.
295
+ */
296
+ adaptive?: boolean;
297
+ /**
298
+ * Specifies the text that is rendered as title in the adaptive popup.
299
+ */
300
+ adaptiveTitle?: string;
293
301
  }