@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
@@ -279,4 +279,12 @@ export interface MultiSelectProps extends FormComponentProps {
279
279
  * Fires when a MultiSelect sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
280
280
  */
281
281
  groupStickyHeaderItemRender?: any;
282
+ /**
283
+ * Provides different rendering of the popup element based on the screen dimensions.
284
+ */
285
+ adaptive?: boolean;
286
+ /**
287
+ * Specifies the text that is rendered as title in the adaptive popup.
288
+ */
289
+ adaptiveTitle?: string;
282
290
  }
@@ -39,10 +39,15 @@ var utils_1 = require("../common/utils");
39
39
  var ListNoData_1 = require("./../DropDownTree/ListNoData");
40
40
  var main_1 = require("./../messages/main");
41
41
  var kendo_vue_labels_1 = require("@progress/kendo-vue-labels");
42
+ var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
42
43
  var TagList_1 = require("../MultiSelect/TagList");
43
44
  var ClearButton_1 = require("../common/ClearButton");
44
45
  var ListFilter_1 = require("../common/ListFilter");
45
46
  var utils_2 = require("./utils");
47
+ var constants_1 = require("../common/constants");
48
+ var kendo_vue_layout_1 = require("@progress/kendo-vue-layout");
49
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
50
+ var DropDownBase_1 = require("../common/DropDownBase");
46
51
  var VALIDATION_MESSAGE = 'Please select a value from the list!';
47
52
  var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap,
48
53
  roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
@@ -175,7 +180,15 @@ var MultiSelectTreeVue2 = {
175
180
  tag: [String, Function, Object],
176
181
  header: [String, Function, Object],
177
182
  footer: [String, Function, Object],
178
- listNoData: [String, Function, Object]
183
+ listNoData: [String, Function, Object],
184
+ adaptive: {
185
+ type: Boolean,
186
+ default: undefined
187
+ },
188
+ adaptiveTitle: {
189
+ type: String,
190
+ default: undefined
191
+ }
179
192
  },
180
193
  inject: {
181
194
  kendoLocalizationService: {
@@ -183,7 +196,9 @@ var MultiSelectTreeVue2 = {
183
196
  }
184
197
  },
185
198
  created: function created() {
199
+ this.observer = null;
186
200
  (0, kendo_vue_common_1.validatePackage)(package_metadata_1.packageMetadata);
201
+ this.base = new DropDownBase_1.default(this);
187
202
  this.componentGuid = (0, kendo_vue_common_1.guid)();
188
203
  this.anchor = (0, kendo_vue_common_1.guid)();
189
204
  },
@@ -194,10 +209,31 @@ var MultiSelectTreeVue2 = {
194
209
  focusedState: false,
195
210
  filterState: '',
196
211
  currentValue: [],
197
- popupWidth: '200px'
212
+ popupWidth: '200px',
213
+ windowWidth: 0,
214
+ initialAdaptiveRenderingValues: undefined
198
215
  };
199
216
  },
200
217
  computed: {
218
+ animationStyles: {
219
+ get: function get() {
220
+ return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? {
221
+ top: 0,
222
+ width: '100%',
223
+ height: '100%'
224
+ } : undefined;
225
+ }
226
+ },
227
+ classNameAdaptive: {
228
+ get: function get() {
229
+ return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
230
+ }
231
+ },
232
+ adaptiveState: {
233
+ get: function get() {
234
+ return this.windowWidth <= constants_1.MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
235
+ }
236
+ },
201
237
  isOpen: function isOpen() {
202
238
  return this.opened !== undefined ? this.opened : this.openState;
203
239
  },
@@ -209,15 +245,39 @@ var MultiSelectTreeVue2 = {
209
245
  },
210
246
  tagsToRenderRef: function tagsToRenderRef() {
211
247
  var _this = this;
212
- return this.tags === undefined ? this.computedValue.map(function (item) {
213
- return {
214
- text: (0, utils_1.getItemValue)(item, _this.$props.textField),
215
- data: [item]
216
- };
217
- }) : __spreadArray([], this.tags, true);
248
+ if (this.initialAdaptiveRenderingValues === undefined) {
249
+ return this.tags === undefined ? this.computedValue.map(function (item) {
250
+ return {
251
+ text: (0, utils_1.getItemValue)(item, _this.$props.textField),
252
+ data: [item]
253
+ };
254
+ }) : __spreadArray([], this.tags, true);
255
+ } else {
256
+ var valuesBeforeAdaptiveRendering = this.initialAdaptiveRenderingValues;
257
+ return valuesBeforeAdaptiveRendering.length > 0 && valuesBeforeAdaptiveRendering.map(function (item) {
258
+ return {
259
+ text: (0, utils_1.getItemValue)(item, _this.$props.textField),
260
+ data: [item]
261
+ };
262
+ });
263
+ }
264
+ }
265
+ },
266
+ watch: {
267
+ // This watch gets the state of the data when the adaptive mode is activated
268
+ isOpen: function isOpen(newValue) {
269
+ if (newValue && this.value) {
270
+ this.initialAdaptiveRenderingValues = __spreadArray([], this.value, true);
271
+ } else {
272
+ this.initialAdaptiveRenderingValues = undefined;
273
+ }
218
274
  }
219
275
  },
220
276
  mounted: function mounted() {
277
+ this.observer = kendo_vue_common_1.canUseDOM && new ResizeObserver(this.calculateMedia);
278
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
279
+ this.observer.observe(document.body);
280
+ }
221
281
  this.elementRef = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
222
282
  this.inputRef = (0, kendo_vue_common_1.getRef)(this, 'input');
223
283
  this.selectRef = (0, kendo_vue_common_1.getRef)(this, 'select');
@@ -226,6 +286,11 @@ var MultiSelectTreeVue2 = {
226
286
  this.popupRef = (0, kendo_vue_common_1.getRef)(this, 'popup');
227
287
  this.calculatePopupWidth();
228
288
  },
289
+ destroyed: !!isV3 ? undefined : function () {
290
+ if (this.observer) {
291
+ this.observer.disconnect();
292
+ }
293
+ },
229
294
  updated: function updated() {
230
295
  this.inputRef = (0, kendo_vue_common_1.getRef)(this, 'input');
231
296
  this.treeViewRef = (0, kendo_vue_common_1.getRef)(this, 'treeView');
@@ -244,7 +309,6 @@ var MultiSelectTreeVue2 = {
244
309
  },
245
310
  // @ts-ignore
246
311
  render: function render(createElement) {
247
- var _this2 = this;
248
312
  var _a, _b;
249
313
  var _this = this;
250
314
  var h = gh || createElement;
@@ -265,7 +329,8 @@ var MultiSelectTreeVue2 = {
265
329
  valid = _c.valid,
266
330
  value = _c.value,
267
331
  required = _c.required,
268
- validityStyles = _c.validityStyles;
332
+ validityStyles = _c.validityStyles,
333
+ adaptiveTitle = _c.adaptiveTitle;
269
334
  var tabIndex = (0, kendo_vue_common_1.getTabIndex)(this.$props.tabIndex, disabled);
270
335
  var localization = (0, kendo_vue_intl_1.provideLocalizationService)(this);
271
336
  var validity = getValidity({
@@ -274,6 +339,7 @@ var MultiSelectTreeVue2 = {
274
339
  required: required
275
340
  }, this.hasValue);
276
341
  var dir = this.$props.dir; // useRtl(elementRef,this.$props.dir);
342
+ var renderAdaptive = this.adaptiveState;
277
343
  var itemTemplate = kendo_vue_common_1.templateRendering.call(this, this.item, kendo_vue_common_1.getListeners.call(this));
278
344
  var tagTemplate = kendo_vue_common_1.templateRendering.call(this, this.tag, kendo_vue_common_1.getListeners.call(this));
279
345
  var headerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.header, kendo_vue_common_1.getListeners.call(this));
@@ -302,7 +368,193 @@ var MultiSelectTreeVue2 = {
302
368
  size = _e.size,
303
369
  rounded = _e.rounded,
304
370
  fillMode = _e.fillMode;
305
- var multiselecttree = h("span", {
371
+ var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
372
+ return [h("div", {
373
+ "class": "k-actionsheet-titlebar-group k-hbox"
374
+ }, [h("div", {
375
+ "class": "k-actionsheet-title"
376
+ }, [h("div", {
377
+ "class": "k-text-center"
378
+ }, [adaptiveTitle]), h("div", {
379
+ "class": "k-actionsheet-subtitle k-text-center"
380
+ }, [placeholder])]), h("div", {
381
+ "class": "k-actionsheet-actions"
382
+ }, [h(kendo_vue_buttons_1.Button, {
383
+ tabindex: 5,
384
+ attrs: this.v3 ? undefined : {
385
+ tabindex: 5,
386
+ "aria-label": "Cancel",
387
+ "aria-disabled": "false",
388
+ type: "button",
389
+ fillMode: "flat",
390
+ icon: "x",
391
+ svgIcon: kendo_svg_icons_1.xIcon
392
+ },
393
+ "aria-label": "Cancel",
394
+ "aria-disabled": "false",
395
+ type: "button",
396
+ fillMode: "flat",
397
+ onClick: _this.onCancel,
398
+ on: this.v3 ? undefined : {
399
+ "click": _this.onCancel
400
+ },
401
+ icon: "x",
402
+ svgIcon: kendo_svg_icons_1.xIcon
403
+ })])]), h("div", {
404
+ "class": "k-actionsheet-titlebar-group k-actionsheet-filter"
405
+ }, [_this.$props.filterable &&
406
+ // @ts-ignore
407
+ h(ListFilter_1.ListFilter, {
408
+ value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
409
+ attrs: this.v3 ? undefined : {
410
+ value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
411
+ size: size,
412
+ rounded: rounded,
413
+ fillMode: fillMode
414
+ },
415
+ ref: (0, kendo_vue_common_1.setRef)(_this, 'input'),
416
+ onChange: _this.onFilterChange,
417
+ on: this.v3 ? undefined : {
418
+ "change": _this.onFilterChange,
419
+ "keydown": _this.onInputKeyDown,
420
+ "focus": _this.onFocus,
421
+ "blur": _this.onBlur
422
+ },
423
+ onKeydown: _this.onInputKeyDown,
424
+ size: size,
425
+ rounded: rounded,
426
+ fillMode: fillMode,
427
+ onFocus: _this.onFocus,
428
+ onBlur: _this.onBlur
429
+ })])];
430
+ };
431
+ var adaptiveActionSheetHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, kendo_vue_common_1.getListeners.call(this));
432
+ var adaptiveActionSheetFooterTemplateDef = function adaptiveActionSheetFooterTemplateDef() {
433
+ var cancelText = localization.toLanguageString(main_1.adaptiveModeFooterCancel, main_1.messages[main_1.adaptiveModeFooterCancel]);
434
+ var applyText = localization.toLanguageString(main_1.adaptiveModeFooterApply, main_1.messages[main_1.adaptiveModeFooterApply]);
435
+ return [h(kendo_vue_buttons_1.Button, {
436
+ size: "large",
437
+ attrs: this.v3 ? undefined : {
438
+ size: "large",
439
+ "aria-label": cancelText,
440
+ "aria-disabled": "false",
441
+ type: "button"
442
+ },
443
+ "aria-label": cancelText,
444
+ "aria-disabled": "false",
445
+ type: "button",
446
+ onClick: _this.onCancel,
447
+ on: this.v3 ? undefined : {
448
+ "click": _this.onCancel
449
+ }
450
+ }, [cancelText]), h(kendo_vue_buttons_1.Button, {
451
+ themeColor: "primary",
452
+ attrs: this.v3 ? undefined : {
453
+ themeColor: "primary",
454
+ size: "large",
455
+ "aria-label": applyText,
456
+ "aria-disabled": "false",
457
+ type: "button"
458
+ },
459
+ size: "large",
460
+ "aria-label": applyText,
461
+ "aria-disabled": "false",
462
+ type: "button",
463
+ onClick: _this.closePopup,
464
+ on: this.v3 ? undefined : {
465
+ "click": _this.closePopup
466
+ }
467
+ }, [applyText])];
468
+ };
469
+ var adaptiveActionSheetFooterTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetFooterTemplateDef, kendo_vue_common_1.getListeners.call(this));
470
+ var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
471
+ var headerToRender = _this.base.getTemplateDef.call(_this, header, h);
472
+ var footerToRender = _this.base.getTemplateDef.call(_this, footer, h);
473
+ return [headerToRender && h("div", {
474
+ "class": "k-list-header"
475
+ }, [headerToRender]), dataItems.length > 0 ?
476
+ // @ts-ignore
477
+ h(kendo_vue_treeview_1.TreeView, {
478
+ ref: (0, kendo_vue_common_1.setRef)(_this, 'treeView'),
479
+ tabIndex: tabIndex,
480
+ attrs: this.v3 ? undefined : {
481
+ tabIndex: tabIndex,
482
+ dataItems: dataItems,
483
+ focusIdField: dataItemKey,
484
+ textField: _this.$props.textField,
485
+ checkField: checkField,
486
+ checkIndeterminateField: checkIndeterminateField,
487
+ expandField: _this.$props.expandField,
488
+ childrenField: subItemsField,
489
+ expandIcons: true,
490
+ checkboxes: true,
491
+ size: 'large',
492
+ item: itemTemplate
493
+ },
494
+ dataItems: dataItems,
495
+ focusIdField: dataItemKey,
496
+ textField: _this.$props.textField,
497
+ checkField: checkField,
498
+ checkIndeterminateField: checkIndeterminateField,
499
+ expandField: _this.$props.expandField,
500
+ childrenField: subItemsField,
501
+ expandIcons: true,
502
+ onItemclick: _this.onChange,
503
+ on: this.v3 ? undefined : {
504
+ "itemclick": _this.onChange,
505
+ "checkchange": _this.onChange,
506
+ "expandchange": _this.onExpand,
507
+ "focus": _this.onFocus,
508
+ "blur": _this.onBlur,
509
+ "keydown": _this.onWrapperKeyDown
510
+ },
511
+ onCheckchange: _this.onChange,
512
+ onExpandchange: _this.onExpand,
513
+ onFocus: _this.onFocus,
514
+ onBlur: _this.onBlur,
515
+ onKeydown: _this.onWrapperKeyDown,
516
+ checkboxes: true,
517
+ size: 'large',
518
+ item: itemTemplate
519
+ }) : noDataTemplate, footerToRender && h("div", {
520
+ className: "k-list-footer",
521
+ attrs: this.v3 ? undefined : {
522
+ className: "k-list-footer"
523
+ }
524
+ }, [footerToRender])];
525
+ };
526
+ var adaptiveActionSheetContentTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetContentTemplateDef, kendo_vue_common_1.getListeners.call(this));
527
+ var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
528
+ return h(kendo_vue_layout_1.ActionSheet, {
529
+ expand: this.isOpen,
530
+ attrs: this.v3 ? undefined : {
531
+ expand: this.isOpen,
532
+ animation: true,
533
+ animationStyles: this.animationStyles,
534
+ className: this.classNameAdaptive,
535
+ footerClassName: 'k-actions k-actions-stretched',
536
+ contentClassName: '!k-overflow-hidden',
537
+ header: adaptiveActionSheetHeaderTemplate,
538
+ content: adaptiveActionSheetContentTemplate,
539
+ footer: adaptiveActionSheetFooterTemplate,
540
+ navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
541
+ },
542
+ animation: true,
543
+ animationStyles: this.animationStyles,
544
+ className: this.classNameAdaptive,
545
+ footerClassName: 'k-actions k-actions-stretched',
546
+ contentClassName: '!k-overflow-hidden',
547
+ header: adaptiveActionSheetHeaderTemplate,
548
+ content: adaptiveActionSheetContentTemplate,
549
+ footer: adaptiveActionSheetFooterTemplate,
550
+ onClose: this.onCancel,
551
+ on: this.v3 ? undefined : {
552
+ "close": this.onCancel
553
+ },
554
+ navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
555
+ });
556
+ };
557
+ var component = h("span", {
306
558
  ref: (0, kendo_vue_common_1.setRef)(this, 'kendoAnchor', this.anchor),
307
559
  "class": (0, kendo_vue_common_1.classNames)('k-multiselecttree k-input', this.$props.className, (_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'] = this.focusedState && !disabled, _a['k-invalid'] = !isValid, _a['k-disabled'] = disabled, _a['k-loading'] = this.$props.loading, _a['k-required'] = required, _a)),
308
560
  tabIndex: tabIndex,
@@ -374,7 +626,7 @@ var MultiSelectTreeVue2 = {
374
626
  tagsRounded: rounded,
375
627
  size: size,
376
628
  fillMode: fillMode
377
- }) : !this.hasValue && h("span", {
629
+ }) : h("span", {
378
630
  "class": "k-input-inner",
379
631
  role: 'combobox',
380
632
  attrs: this.v3 ? undefined : {
@@ -430,7 +682,7 @@ var MultiSelectTreeVue2 = {
430
682
  }
431
683
  })]),
432
684
  // @ts-ignore function children
433
- h(kendo_vue_popup_1.Popup, {
685
+ !renderAdaptive && h(kendo_vue_popup_1.Popup, {
434
686
  style: {
435
687
  width: this.popupWidth,
436
688
  direction: dir
@@ -457,115 +709,45 @@ var MultiSelectTreeVue2 = {
457
709
  onClose: this.onPopupClosed,
458
710
  appendTo: popupSettings.appendTo,
459
711
  ref: (0, kendo_vue_common_1.setRef)(this, 'popup')
460
- }, this.v3 ? function () {
461
- return [_this2.$props.filterable &&
462
- // @ts-ignore
463
- h(ListFilter_1.ListFilter, {
464
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
465
- attrs: _this2.v3 ? undefined : {
466
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
467
- size: size,
468
- rounded: rounded,
469
- fillMode: fillMode
470
- },
471
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'input'),
472
- onChange: _this2.onFilterChange,
473
- on: _this2.v3 ? undefined : {
474
- "change": _this2.onFilterChange,
475
- "keydown": _this2.onInputKeyDown,
476
- "focus": _this2.onFocus,
477
- "blur": _this2.onBlur
478
- },
479
- onKeydown: _this2.onInputKeyDown,
480
- size: size,
481
- rounded: rounded,
482
- fillMode: fillMode,
483
- onFocus: _this2.onFocus,
484
- onBlur: _this2.onBlur
485
- }), header && h("div", {
486
- "class": "k-list-header"
487
- }, [header]), dataItems.length > 0 ?
488
- // @ts-ignore
489
- h(kendo_vue_treeview_1.TreeView, {
490
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'treeView'),
491
- tabIndex: tabIndex,
492
- attrs: _this2.v3 ? undefined : {
493
- tabIndex: tabIndex,
494
- dataItems: dataItems,
495
- focusIdField: dataItemKey,
496
- textField: _this2.$props.textField,
497
- checkField: checkField,
498
- checkIndeterminateField: checkIndeterminateField,
499
- expandField: _this2.$props.expandField,
500
- childrenField: subItemsField,
501
- expandIcons: true,
502
- checkboxes: true,
503
- size: size,
504
- item: itemTemplate
505
- },
506
- dataItems: dataItems,
507
- focusIdField: dataItemKey,
508
- textField: _this2.$props.textField,
509
- checkField: checkField,
510
- checkIndeterminateField: checkIndeterminateField,
511
- expandField: _this2.$props.expandField,
512
- childrenField: subItemsField,
513
- expandIcons: true,
514
- onItemclick: _this2.onChange,
515
- on: _this2.v3 ? undefined : {
516
- "itemclick": _this2.onChange,
517
- "checkchange": _this2.onChange,
518
- "expandchange": _this2.onExpand,
519
- "focus": _this2.onFocus,
520
- "blur": _this2.onBlur,
521
- "keydown": _this2.onWrapperKeyDown
522
- },
523
- onCheckchange: _this2.onChange,
524
- onExpandchange: _this2.onExpand,
525
- onFocus: _this2.onFocus,
526
- onBlur: _this2.onBlur,
527
- onKeydown: _this2.onWrapperKeyDown,
528
- checkboxes: true,
529
- size: size,
530
- item: itemTemplate
531
- }) : noDataTemplate, footer && h("div", {
532
- "class": "k-list-footer"
533
- }, [footer])];
534
- } : [_this2.$props.filterable && h(ListFilter_1.ListFilter, {
535
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
536
- attrs: _this2.v3 ? undefined : {
537
- value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
712
+ }, [this.$props.filterable &&
713
+ // @ts-ignore
714
+ h(ListFilter_1.ListFilter, {
715
+ value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
716
+ attrs: this.v3 ? undefined : {
717
+ value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
538
718
  size: size,
539
719
  rounded: rounded,
540
720
  fillMode: fillMode
541
721
  },
542
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'input'),
543
- onChange: _this2.onFilterChange,
544
- on: _this2.v3 ? undefined : {
545
- "change": _this2.onFilterChange,
546
- "keydown": _this2.onInputKeyDown,
547
- "focus": _this2.onFocus,
548
- "blur": _this2.onBlur
722
+ ref: (0, kendo_vue_common_1.setRef)(this, 'input'),
723
+ onChange: this.onFilterChange,
724
+ on: this.v3 ? undefined : {
725
+ "change": this.onFilterChange,
726
+ "keydown": this.onInputKeyDown,
727
+ "focus": this.onFocus,
728
+ "blur": this.onBlur
549
729
  },
550
- onKeydown: _this2.onInputKeyDown,
730
+ onKeydown: this.onInputKeyDown,
551
731
  size: size,
552
732
  rounded: rounded,
553
733
  fillMode: fillMode,
554
- onFocus: _this2.onFocus,
555
- onBlur: _this2.onBlur
734
+ onFocus: this.onFocus,
735
+ onBlur: this.onBlur
556
736
  }), header && h("div", {
557
737
  "class": "k-list-header"
558
- }, [header]), dataItems.length > 0 ? h(kendo_vue_treeview_1.TreeView, {
559
- ref: (0, kendo_vue_common_1.setRef)(_this2, 'treeView'),
738
+ }, [header]), dataItems.length > 0 ?
739
+ // @ts-ignore
740
+ h(kendo_vue_treeview_1.TreeView, {
741
+ ref: (0, kendo_vue_common_1.setRef)(this, 'treeView'),
560
742
  tabIndex: tabIndex,
561
- attrs: _this2.v3 ? undefined : {
743
+ attrs: this.v3 ? undefined : {
562
744
  tabIndex: tabIndex,
563
745
  dataItems: dataItems,
564
746
  focusIdField: dataItemKey,
565
- textField: _this2.$props.textField,
747
+ textField: this.$props.textField,
566
748
  checkField: checkField,
567
749
  checkIndeterminateField: checkIndeterminateField,
568
- expandField: _this2.$props.expandField,
750
+ expandField: this.$props.expandField,
569
751
  childrenField: subItemsField,
570
752
  expandIcons: true,
571
753
  checkboxes: true,
@@ -574,32 +756,36 @@ var MultiSelectTreeVue2 = {
574
756
  },
575
757
  dataItems: dataItems,
576
758
  focusIdField: dataItemKey,
577
- textField: _this2.$props.textField,
759
+ textField: this.$props.textField,
578
760
  checkField: checkField,
579
761
  checkIndeterminateField: checkIndeterminateField,
580
- expandField: _this2.$props.expandField,
762
+ expandField: this.$props.expandField,
581
763
  childrenField: subItemsField,
582
764
  expandIcons: true,
583
- onItemclick: _this2.onChange,
584
- on: _this2.v3 ? undefined : {
585
- "itemclick": _this2.onChange,
586
- "checkchange": _this2.onChange,
587
- "expandchange": _this2.onExpand,
588
- "focus": _this2.onFocus,
589
- "blur": _this2.onBlur,
590
- "keydown": _this2.onWrapperKeyDown
765
+ onItemclick: this.onChange,
766
+ on: this.v3 ? undefined : {
767
+ "itemclick": this.onChange,
768
+ "checkchange": this.onChange,
769
+ "expandchange": this.onExpand,
770
+ "focus": this.onFocus,
771
+ "blur": this.onBlur,
772
+ "keydown": this.onWrapperKeyDown
591
773
  },
592
- onCheckchange: _this2.onChange,
593
- onExpandchange: _this2.onExpand,
594
- onFocus: _this2.onFocus,
595
- onBlur: _this2.onBlur,
596
- onKeydown: _this2.onWrapperKeyDown,
774
+ onCheckchange: this.onChange,
775
+ onExpandchange: this.onExpand,
776
+ onFocus: this.onFocus,
777
+ onBlur: this.onBlur,
778
+ onKeydown: this.onWrapperKeyDown,
597
779
  checkboxes: true,
598
780
  size: size,
599
781
  item: itemTemplate
600
782
  }) : noDataTemplate, footer && h("div", {
601
783
  "class": "k-list-footer"
602
784
  }, [footer])])]);
785
+ // The following one combines the default rendering of the MultiSelect and the Adaptive rendering.
786
+ // This is needed because of Vue 2 specifics
787
+ var multiselecttree = [component, renderAdaptive && renderAdaptiveListContainer.call(this)];
788
+ var multiselecttreeToRender = isV3 ? multiselecttree : this.$props.adaptive ? h("span", [multiselecttree]) : component;
603
789
  return label ?
604
790
  // @ts-ignore function children
605
791
  h(kendo_vue_labels_1.FloatingLabel, {
@@ -620,10 +806,36 @@ var MultiSelectTreeVue2 = {
620
806
  editorId: id,
621
807
  dir: dir
622
808
  }, this.v3 ? function () {
623
- return [multiselecttree];
624
- } : [multiselecttree]) : multiselecttree;
809
+ return [multiselecttreeToRender];
810
+ } : [multiselecttreeToRender]) : multiselecttreeToRender;
625
811
  },
626
812
  methods: {
813
+ clearFilter: function clearFilter(event) {
814
+ this.onFilterChange(__assign(__assign({}, event), {
815
+ target: __assign(__assign({}, event.target), {
816
+ value: ''
817
+ })
818
+ }));
819
+ },
820
+ onCancel: function onCancel(event) {
821
+ var dropdownEvent = {
822
+ event: event,
823
+ target: this
824
+ };
825
+ var changeEvent = __assign({
826
+ items: [],
827
+ operation: 'toggle',
828
+ value: this.initialAdaptiveRenderingValues
829
+ }, dropdownEvent);
830
+ this.$emit('change', changeEvent);
831
+ this.closePopup(event);
832
+ },
833
+ calculateMedia: function calculateMedia(entries) {
834
+ for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
835
+ var entry = entries_1[_i];
836
+ this.windowWidth = entry.target.clientWidth;
837
+ }
838
+ },
627
839
  calculatePopupWidth: function calculatePopupWidth() {
628
840
  if (this.elementRef) {
629
841
  this.popupWidth = this.popupSettings.width !== undefined ? this.popupSettings.width : this.elementRef.offsetWidth + 'px';
@@ -692,6 +904,7 @@ var MultiSelectTreeVue2 = {
692
904
  }
693
905
  },
694
906
  closePopup: function closePopup(event) {
907
+ this.clearFilter(event);
695
908
  if (this.isOpen) {
696
909
  var closeEvent = __assign({}, event);
697
910
  this.$emit('close', closeEvent);
@@ -746,7 +959,7 @@ var MultiSelectTreeVue2 = {
746
959
  }
747
960
  },
748
961
  onBlur: function onBlur(event) {
749
- if (this.focusedState && !this.skipFocusRef) {
962
+ if (this.focusedState && !this.skipFocusRef && !this.adaptiveState) {
750
963
  this.focusedTagState = undefined;
751
964
  this.focusedState = false;
752
965
  var ev = {
@@ -866,7 +1079,11 @@ var MultiSelectTreeVue2 = {
866
1079
  this.switchFocus(function () {
867
1080
  _this.focusElement(_this.elementRef);
868
1081
  });
869
- this.closePopup(event);
1082
+ if (keyCode === kendo_vue_common_1.Keys.esc && this.adaptiveState) {
1083
+ this.onCancel(event);
1084
+ } else {
1085
+ this.closePopup(event);
1086
+ }
870
1087
  }
871
1088
  if (altKey || keyCode !== kendo_vue_common_1.Keys.up && keyCode !== kendo_vue_common_1.Keys.down) {
872
1089
  return;
@@ -885,6 +1102,7 @@ var MultiSelectTreeVue2 = {
885
1102
  };
886
1103
  this.changeValue(ev, [], 'clear');
887
1104
  this.closePopup(ev);
1105
+ this.filterState = '';
888
1106
  event.preventDefault();
889
1107
  },
890
1108
  onTagDelete: function onTagDelete(itemsToRemove, event) {
@@ -311,4 +311,12 @@ export interface MultiSelectTreeProps extends FormComponentProps {
311
311
  * @default `solid`
312
312
  */
313
313
  fillMode?: null | 'solid' | 'flat' | 'outline' | string;
314
+ /**
315
+ * Provides different rendering of the popup element based on the screen dimensions.
316
+ */
317
+ adaptive?: boolean;
318
+ /**
319
+ * Specifies the text that is rendered as title in the adaptive popup.
320
+ */
321
+ adaptiveTitle?: string;
314
322
  }
@@ -2,6 +2,11 @@ import VirtualScroll from './VirtualScroll';
2
2
  import { Navigation } from './Navigation';
3
3
  import { ListItemProps } from './ListItem';
4
4
  import { InternalState, DropDownStateBase, Page, DropDownsPopupSettings, VirtualizationSettings } from './settings';
5
+ import { DropDownListAll } from '../DropDownList/DropDownList';
6
+ import { ComboBoxAll } from '../ComboBox/ComboBox';
7
+ import { DropDownTreeAll } from '../DropDownTree/DropDownTree';
8
+ import { MultiSelectAll } from '../MultiSelect/MultiSelect';
9
+ import { CreateElement } from 'vue';
5
10
  /**
6
11
  * @hidden
7
12
  */
@@ -84,4 +89,6 @@ export default class DropDownBase {
84
89
  scrollToVirtualItem: (virtual: VirtualizationSettings, selectedItemIndex: number) => void;
85
90
  getGroupedDataModernMode: (data: any[], groupField: string) => any[];
86
91
  resetGroupStickyHeader: (groupName: string, that: any) => void;
92
+ getTemplateDef(this: DropDownListAll | ComboBoxAll | DropDownTreeAll | MultiSelectAll, template: string, h: CreateElement): any;
93
+ getListItemHeight(listItem: HTMLElement): string | 0;
87
94
  }