@progress/kendo-react-dropdowns 5.13.0-dev.202304180747 → 5.13.0-dev.202304200559

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.
@@ -18,9 +18,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
18
  }
19
19
  return to.concat(ar || Array.prototype.slice.call(from));
20
20
  };
21
+ var _this = this;
21
22
  import * as React from 'react';
22
23
  import * as PropTypes from 'prop-types';
23
- import { classNames, noop, useRtl, getTabIndex, Keys, mapTree, extendDataItem, guid, createPropsContext, kendoThemeMaps, usePropsContext, IconWrap } from '@progress/kendo-react-common';
24
+ import { classNames, noop, useRtl, getTabIndex, Keys, mapTree, extendDataItem, guid, createPropsContext, kendoThemeMaps, usePropsContext, IconWrap, canUseDOM } from '@progress/kendo-react-common';
24
25
  import { Popup } from '@progress/kendo-react-popup';
25
26
  import { useLocalization } from '@progress/kendo-react-intl';
26
27
  import { TreeView } from '@progress/kendo-react-treeview';
@@ -34,6 +35,9 @@ import { FloatingLabel } from '@progress/kendo-react-labels';
34
35
  import ListFilter from '../common/ListFilter';
35
36
  import { Button } from '@progress/kendo-react-buttons';
36
37
  import { xIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
38
+ import { AdaptiveMode } from '../common/AdaptiveMode';
39
+ import { ActionSheetContent } from '@progress/kendo-react-layout';
40
+ import { MOBILE_MEDIUM_DEVISE } from '../common/constants';
37
41
  var sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;
38
42
  var VALIDATION_MESSAGE = 'Please select a value from the list!';
39
43
  var ValueHolder = function (props) {
@@ -88,6 +92,7 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
88
92
  var target = React.useRef(null);
89
93
  var elementRef = React.useRef(null);
90
94
  var inputRef = React.useRef(null);
95
+ var adaptiveInputRef = React.useRef(null);
91
96
  var selectRef = React.useRef(null);
92
97
  var treeViewRef = React.useRef(null);
93
98
  var skipFocusRef = React.useRef(false);
@@ -113,6 +118,8 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
113
118
  var isOpen = opened !== undefined ? opened : open;
114
119
  var _l = React.useState(false), focused = _l[0], setFocused = _l[1];
115
120
  var _m = React.useState(''), filter = _m[0], setFilter = _m[1];
121
+ var _o = React.useState(), windowWidth = _o[0], setWindowWidth = _o[1];
122
+ var isAdaptive = !!(windowWidth && windowWidth <= MOBILE_MEDIUM_DEVISE && props.adaptive);
116
123
  var setValidity = React.useCallback(function () {
117
124
  if (selectRef.current && selectRef.current.setCustomValidity) {
118
125
  selectRef.current.setCustomValidity(validity.valid
@@ -121,6 +128,17 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
121
128
  }
122
129
  }, [validationMessage, validity]);
123
130
  React.useEffect(setValidity);
131
+ React.useEffect(function () {
132
+ var observerResize = canUseDOM && window.ResizeObserver && new window.ResizeObserver(calculateMedia.bind(_this));
133
+ if ((document === null || document === void 0 ? void 0 : document.body) && observerResize) {
134
+ observerResize.observe(document.body);
135
+ }
136
+ return function () {
137
+ if ((document === null || document === void 0 ? void 0 : document.body) && observerResize) {
138
+ observerResize.disconnect();
139
+ }
140
+ };
141
+ }, []);
124
142
  var openPopup = React.useCallback(function (event) {
125
143
  if (!isOpen) {
126
144
  if (onOpen) {
@@ -140,9 +158,14 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
140
158
  }
141
159
  if (opened === undefined) {
142
160
  setOpen(false);
161
+ if (isAdaptive) {
162
+ setTimeout(function () {
163
+ focusElement(adaptiveInputRef.current);
164
+ }, 300);
165
+ }
143
166
  }
144
167
  }
145
- }, [isOpen, opened, onClose]);
168
+ }, [isOpen, opened, onClose, isAdaptive]);
146
169
  var onWrapperClick = React.useCallback(function (event) {
147
170
  if (!event.isDefaultPrevented() && target.current) {
148
171
  setFocused(true);
@@ -258,7 +281,9 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
258
281
  var focusEvent = __assign({}, ev);
259
282
  props.onBlur.call(undefined, focusEvent);
260
283
  }
261
- closePopup(ev);
284
+ if (!isAdaptive) {
285
+ closePopup(ev);
286
+ }
262
287
  }
263
288
  }, [focused, props.onBlur, isOpen, opened, onClose]);
264
289
  var onWrapperMouseDown = React.useCallback(function () {
@@ -266,7 +291,12 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
266
291
  // moving focus from treeview to dropdown triggers Focus and Blur events.
267
292
  switchFocus(noop);
268
293
  }
269
- }, [focused]);
294
+ if (isAdaptive) {
295
+ setTimeout(function () {
296
+ focusElement(adaptiveInputRef.current);
297
+ }, 300);
298
+ }
299
+ }, [focused, isAdaptive]);
270
300
  var changeValue = React.useCallback(function (event, newValue, hierarchicalIndex) {
271
301
  if (props.onChange) {
272
302
  var changeEvent = __assign({ value: newValue, level: hierarchicalIndex ? toLevel(hierarchicalIndex) : [] }, event);
@@ -331,6 +361,27 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
331
361
  }
332
362
  }
333
363
  }, [props.onFilterChange, props.filter, props.textField]);
364
+ var renderAdaptiveListContainer = function () {
365
+ var mobileFilter = props.filterable ? (React.createElement(ListFilter, { value: props.filter === undefined ? filter : props.filter, inputRef: adaptiveInputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })) : null;
366
+ var actionSheetProps = {
367
+ adaptiveTitle: props.adaptiveTitle,
368
+ expand: isOpen,
369
+ onClose: function (event) { return closePopup(event); },
370
+ windowWidth: windowWidth,
371
+ mobileFilter: mobileFilter
372
+ };
373
+ return (React.createElement(AdaptiveMode, __assign({}, actionSheetProps),
374
+ React.createElement(ActionSheetContent, { className: '!k-overflow-hidden' },
375
+ React.createElement("div", { className: 'k-list-container' },
376
+ React.createElement("div", { className: 'k-list k-list-lg' }, data.length > 0 ? (React.createElement(TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(nodata, messages[nodata]))))))));
377
+ };
378
+ var calculateMedia = React.useCallback(function (entries) {
379
+ for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
380
+ var entry = entries_1[_i];
381
+ setWindowWidth(entry.target.clientWidth);
382
+ }
383
+ ;
384
+ }, []);
334
385
  var treeViewData = React.useMemo(function () {
335
386
  return (controlled || !hasValue) ? data :
336
387
  mapTree(data, subItemsField, function (item) {
@@ -343,27 +394,29 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
343
394
  var localization = useLocalization();
344
395
  var isValid = !validityStyles || validity.valid;
345
396
  var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
346
- var dropdowntree = (React.createElement("span", { className: classNames('k-dropdowntree k-picker', props.className, (_a = {},
347
- _a["k-picker-".concat(sizeMap[size] || size)] = size,
348
- _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
349
- _a["k-picker-".concat(fillMode)] = fillMode,
350
- _a['k-focus'] = focused,
351
- _a['k-invalid'] = !isValid,
352
- _a['k-loading'] = props.loading,
353
- _a['k-required'] = required,
354
- _a['k-disabled'] = props.disabled,
355
- _a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __assign(__assign({}, style), { width: undefined }) : style, dir: dir, ref: elementRef, onKeyDown: disabled ? undefined : onWrapperKeyDown, onMouseDown: onWrapperMouseDown, onClick: disabled ? undefined : onWrapperClick, onFocus: onFocus, onBlur: onBlur, role: "combobox", "aria-haspopup": "tree", "aria-expanded": isOpen, "aria-disabled": disabled, "aria-label": label, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, "aria-required": required },
356
- React.createElement("span", { className: "k-input-inner" },
357
- React.createElement(ValueComponent, { item: value }, currentValueText || placeholder)),
358
- props.loading && React.createElement(IconWrap, { className: "k-input-loading-icon", name: 'loading' }),
359
- hasValue && !disabled && (React.createElement("span", { onClick: onClear, className: "k-clear-value", title: localization.toLanguageString(clear, messages[clear]), role: "button", tabIndex: -1, onMouseDown: function (e) { return e.preventDefault(); } },
360
- React.createElement(IconWrap, { name: 'x', icon: xIcon }))),
361
- React.createElement(Button, { tabIndex: -1, type: "button", "aria-label": "select", className: "k-input-button", size: size, fillMode: fillMode, themeColor: "base", rounded: null, icon: "caret-alt-down", svgIcon: caretAltDownIcon }),
362
- React.createElement("select", { name: name, ref: selectRef, tabIndex: -1, "aria-hidden": true, title: label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },
363
- React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
364
- React.createElement(Popup, { className: classNames(popupSettings.className, { 'k-rtl': dir === 'rtl' }), popupClass: classNames(popupSettings.popupClass, 'k-list-container', 'k-dropdowntree-popup'), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo },
365
- props.filterable && (React.createElement(ListFilter, { value: props.filter === undefined ? filter : props.filter, inputRef: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })),
366
- data.length > 0 ? (React.createElement(TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(nodata, messages[nodata]))))));
397
+ var dropdowntree = (React.createElement(React.Fragment, null,
398
+ React.createElement("span", { className: classNames('k-dropdowntree k-picker', props.className, (_a = {},
399
+ _a["k-picker-".concat(sizeMap[size] || size)] = size,
400
+ _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
401
+ _a["k-picker-".concat(fillMode)] = fillMode,
402
+ _a['k-focus'] = focused,
403
+ _a['k-invalid'] = !isValid,
404
+ _a['k-loading'] = props.loading,
405
+ _a['k-required'] = required,
406
+ _a['k-disabled'] = props.disabled,
407
+ _a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __assign(__assign({}, style), { width: undefined }) : style, dir: dir, ref: elementRef, onKeyDown: disabled ? undefined : onWrapperKeyDown, onMouseDown: onWrapperMouseDown, onClick: disabled ? undefined : onWrapperClick, onFocus: onFocus, onBlur: onBlur, role: "combobox", "aria-haspopup": "tree", "aria-expanded": isOpen, "aria-disabled": disabled, "aria-label": label, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, "aria-required": required },
408
+ React.createElement("span", { className: "k-input-inner" },
409
+ React.createElement(ValueComponent, { item: value }, currentValueText || placeholder)),
410
+ props.loading && React.createElement(IconWrap, { className: "k-input-loading-icon", name: 'loading' }),
411
+ hasValue && !disabled && (React.createElement("span", { onClick: onClear, className: "k-clear-value", title: localization.toLanguageString(clear, messages[clear]), role: "button", tabIndex: -1, onMouseDown: function (e) { return e.preventDefault(); } },
412
+ React.createElement(IconWrap, { name: 'x', icon: xIcon }))),
413
+ React.createElement(Button, { tabIndex: -1, type: "button", "aria-label": "select", className: "k-input-button", size: size, fillMode: fillMode, themeColor: "base", rounded: null, icon: "caret-alt-down", svgIcon: caretAltDownIcon }),
414
+ React.createElement("select", { name: name, ref: selectRef, tabIndex: -1, "aria-hidden": true, title: label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },
415
+ React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
416
+ !isAdaptive && React.createElement(Popup, { className: classNames(popupSettings.className, { 'k-rtl': dir === 'rtl' }), popupClass: classNames(popupSettings.popupClass, 'k-list-container', 'k-dropdowntree-popup'), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo },
417
+ props.filterable && (React.createElement(ListFilter, { value: props.filter === undefined ? filter : props.filter, inputRef: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })),
418
+ data.length > 0 ? (React.createElement(TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(nodata, messages[nodata]))))),
419
+ isAdaptive && renderAdaptiveListContainer()));
367
420
  return label ? (React.createElement(FloatingLabel, { label: label, editorValue: currentValueText, editorPlaceholder: placeholder, editorValid: isValid, editorDisabled: disabled, editorId: id, style: { width: style ? style.width : undefined }, children: dropdowntree, dir: dir })) : dropdowntree;
368
421
  });
369
422
  var propTypes = {
@@ -415,7 +468,9 @@ var propTypes = {
415
468
  onExpandChange: PropTypes.func,
416
469
  item: PropTypes.func,
417
470
  valueHolder: PropTypes.func,
418
- listNoData: PropTypes.func
471
+ listNoData: PropTypes.func,
472
+ adaptiveTitle: PropTypes.string,
473
+ adaptive: PropTypes.bool
419
474
  };
420
475
  DropDownTree.displayName = 'KendoReactDropDownTree';
421
476
  DropDownTree.defaultProps = defaultProps;
@@ -283,4 +283,12 @@ export interface DropDownTreeProps extends FormComponentProps {
283
283
  * @default `solid`
284
284
  */
285
285
  fillMode?: null | 'solid' | 'flat' | 'outline';
286
+ /**
287
+ * Providing different rendering of the popup element based on the screen dimensions.
288
+ */
289
+ adaptive?: boolean;
290
+ /**
291
+ * Specifies the text that is rendered as title in the adaptive popup.
292
+ */
293
+ adaptiveTitle?: string;
286
294
  }
@@ -22,7 +22,7 @@ export var AdaptiveMode = function (props) {
22
22
  navigatable: navigatable || false,
23
23
  navigatableElements: navigatableElements || [],
24
24
  expand: expand,
25
- animation: animation || true,
25
+ animation: animation === false ? false : true,
26
26
  onClose: onClose,
27
27
  animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,
28
28
  className: windowWidth <= MOBILE_SMALL_DEVISE
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-dropdowns',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1681802673,
8
+ publishDate: 1681969040,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -19,6 +19,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
19
  }
20
20
  return to.concat(ar || Array.prototype.slice.call(from));
21
21
  };
22
+ var _this = this;
22
23
  Object.defineProperty(exports, "__esModule", { value: true });
23
24
  exports.DropDownTree = exports.DropDownTreePropsContext = void 0;
24
25
  var React = require("react");
@@ -37,6 +38,9 @@ var kendo_react_labels_1 = require("@progress/kendo-react-labels");
37
38
  var ListFilter_1 = require("../common/ListFilter");
38
39
  var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
39
40
  var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
41
+ var AdaptiveMode_1 = require("../common/AdaptiveMode");
42
+ var kendo_react_layout_1 = require("@progress/kendo-react-layout");
43
+ var constants_1 = require("../common/constants");
40
44
  var sizeMap = kendo_react_common_1.kendoThemeMaps.sizeMap, roundedMap = kendo_react_common_1.kendoThemeMaps.roundedMap;
41
45
  var VALIDATION_MESSAGE = 'Please select a value from the list!';
42
46
  var ValueHolder = function (props) {
@@ -91,6 +95,7 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
91
95
  var target = React.useRef(null);
92
96
  var elementRef = React.useRef(null);
93
97
  var inputRef = React.useRef(null);
98
+ var adaptiveInputRef = React.useRef(null);
94
99
  var selectRef = React.useRef(null);
95
100
  var treeViewRef = React.useRef(null);
96
101
  var skipFocusRef = React.useRef(false);
@@ -116,6 +121,8 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
116
121
  var isOpen = opened !== undefined ? opened : open;
117
122
  var _l = React.useState(false), focused = _l[0], setFocused = _l[1];
118
123
  var _m = React.useState(''), filter = _m[0], setFilter = _m[1];
124
+ var _o = React.useState(), windowWidth = _o[0], setWindowWidth = _o[1];
125
+ var isAdaptive = !!(windowWidth && windowWidth <= constants_1.MOBILE_MEDIUM_DEVISE && props.adaptive);
119
126
  var setValidity = React.useCallback(function () {
120
127
  if (selectRef.current && selectRef.current.setCustomValidity) {
121
128
  selectRef.current.setCustomValidity(validity.valid
@@ -124,6 +131,17 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
124
131
  }
125
132
  }, [validationMessage, validity]);
126
133
  React.useEffect(setValidity);
134
+ React.useEffect(function () {
135
+ var observerResize = kendo_react_common_1.canUseDOM && window.ResizeObserver && new window.ResizeObserver(calculateMedia.bind(_this));
136
+ if ((document === null || document === void 0 ? void 0 : document.body) && observerResize) {
137
+ observerResize.observe(document.body);
138
+ }
139
+ return function () {
140
+ if ((document === null || document === void 0 ? void 0 : document.body) && observerResize) {
141
+ observerResize.disconnect();
142
+ }
143
+ };
144
+ }, []);
127
145
  var openPopup = React.useCallback(function (event) {
128
146
  if (!isOpen) {
129
147
  if (onOpen) {
@@ -143,9 +161,14 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
143
161
  }
144
162
  if (opened === undefined) {
145
163
  setOpen(false);
164
+ if (isAdaptive) {
165
+ setTimeout(function () {
166
+ focusElement(adaptiveInputRef.current);
167
+ }, 300);
168
+ }
146
169
  }
147
170
  }
148
- }, [isOpen, opened, onClose]);
171
+ }, [isOpen, opened, onClose, isAdaptive]);
149
172
  var onWrapperClick = React.useCallback(function (event) {
150
173
  if (!event.isDefaultPrevented() && target.current) {
151
174
  setFocused(true);
@@ -261,7 +284,9 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
261
284
  var focusEvent = __assign({}, ev);
262
285
  props.onBlur.call(undefined, focusEvent);
263
286
  }
264
- closePopup(ev);
287
+ if (!isAdaptive) {
288
+ closePopup(ev);
289
+ }
265
290
  }
266
291
  }, [focused, props.onBlur, isOpen, opened, onClose]);
267
292
  var onWrapperMouseDown = React.useCallback(function () {
@@ -269,7 +294,12 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
269
294
  // moving focus from treeview to dropdown triggers Focus and Blur events.
270
295
  switchFocus(kendo_react_common_1.noop);
271
296
  }
272
- }, [focused]);
297
+ if (isAdaptive) {
298
+ setTimeout(function () {
299
+ focusElement(adaptiveInputRef.current);
300
+ }, 300);
301
+ }
302
+ }, [focused, isAdaptive]);
273
303
  var changeValue = React.useCallback(function (event, newValue, hierarchicalIndex) {
274
304
  if (props.onChange) {
275
305
  var changeEvent = __assign({ value: newValue, level: hierarchicalIndex ? toLevel(hierarchicalIndex) : [] }, event);
@@ -334,6 +364,27 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
334
364
  }
335
365
  }
336
366
  }, [props.onFilterChange, props.filter, props.textField]);
367
+ var renderAdaptiveListContainer = function () {
368
+ var mobileFilter = props.filterable ? (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter, inputRef: adaptiveInputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })) : null;
369
+ var actionSheetProps = {
370
+ adaptiveTitle: props.adaptiveTitle,
371
+ expand: isOpen,
372
+ onClose: function (event) { return closePopup(event); },
373
+ windowWidth: windowWidth,
374
+ mobileFilter: mobileFilter
375
+ };
376
+ return (React.createElement(AdaptiveMode_1.AdaptiveMode, __assign({}, actionSheetProps),
377
+ React.createElement(kendo_react_layout_1.ActionSheetContent, { className: '!k-overflow-hidden' },
378
+ React.createElement("div", { className: 'k-list-container' },
379
+ React.createElement("div", { className: 'k-list k-list-lg' }, data.length > 0 ? (React.createElement(kendo_react_treeview_1.TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(messages_1.nodata, messages_1.messages[messages_1.nodata]))))))));
380
+ };
381
+ var calculateMedia = React.useCallback(function (entries) {
382
+ for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
383
+ var entry = entries_1[_i];
384
+ setWindowWidth(entry.target.clientWidth);
385
+ }
386
+ ;
387
+ }, []);
337
388
  var treeViewData = React.useMemo(function () {
338
389
  return (controlled || !hasValue) ? data :
339
390
  (0, kendo_react_common_1.mapTree)(data, subItemsField, function (item) {
@@ -346,27 +397,29 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
346
397
  var localization = (0, kendo_react_intl_1.useLocalization)();
347
398
  var isValid = !validityStyles || validity.valid;
348
399
  var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
349
- var dropdowntree = (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-dropdowntree k-picker', props.className, (_a = {},
350
- _a["k-picker-".concat(sizeMap[size] || size)] = size,
351
- _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
352
- _a["k-picker-".concat(fillMode)] = fillMode,
353
- _a['k-focus'] = focused,
354
- _a['k-invalid'] = !isValid,
355
- _a['k-loading'] = props.loading,
356
- _a['k-required'] = required,
357
- _a['k-disabled'] = props.disabled,
358
- _a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __assign(__assign({}, style), { width: undefined }) : style, dir: dir, ref: elementRef, onKeyDown: disabled ? undefined : onWrapperKeyDown, onMouseDown: onWrapperMouseDown, onClick: disabled ? undefined : onWrapperClick, onFocus: onFocus, onBlur: onBlur, role: "combobox", "aria-haspopup": "tree", "aria-expanded": isOpen, "aria-disabled": disabled, "aria-label": label, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, "aria-required": required },
359
- React.createElement("span", { className: "k-input-inner" },
360
- React.createElement(ValueComponent, { item: value }, currentValueText || placeholder)),
361
- props.loading && React.createElement(kendo_react_common_1.IconWrap, { className: "k-input-loading-icon", name: 'loading' }),
362
- hasValue && !disabled && (React.createElement("span", { onClick: onClear, className: "k-clear-value", title: localization.toLanguageString(messages_1.clear, messages_1.messages[messages_1.clear]), role: "button", tabIndex: -1, onMouseDown: function (e) { return e.preventDefault(); } },
363
- React.createElement(kendo_react_common_1.IconWrap, { name: 'x', icon: kendo_svg_icons_1.xIcon }))),
364
- React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", "aria-label": "select", className: "k-input-button", size: size, fillMode: fillMode, themeColor: "base", rounded: null, icon: "caret-alt-down", svgIcon: kendo_svg_icons_1.caretAltDownIcon }),
365
- React.createElement("select", { name: name, ref: selectRef, tabIndex: -1, "aria-hidden": true, title: label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },
366
- React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
367
- React.createElement(kendo_react_popup_1.Popup, { className: (0, kendo_react_common_1.classNames)(popupSettings.className, { 'k-rtl': dir === 'rtl' }), popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-list-container', 'k-dropdowntree-popup'), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo },
368
- props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter, inputRef: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })),
369
- data.length > 0 ? (React.createElement(kendo_react_treeview_1.TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(messages_1.nodata, messages_1.messages[messages_1.nodata]))))));
400
+ var dropdowntree = (React.createElement(React.Fragment, null,
401
+ React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-dropdowntree k-picker', props.className, (_a = {},
402
+ _a["k-picker-".concat(sizeMap[size] || size)] = size,
403
+ _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
404
+ _a["k-picker-".concat(fillMode)] = fillMode,
405
+ _a['k-focus'] = focused,
406
+ _a['k-invalid'] = !isValid,
407
+ _a['k-loading'] = props.loading,
408
+ _a['k-required'] = required,
409
+ _a['k-disabled'] = props.disabled,
410
+ _a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __assign(__assign({}, style), { width: undefined }) : style, dir: dir, ref: elementRef, onKeyDown: disabled ? undefined : onWrapperKeyDown, onMouseDown: onWrapperMouseDown, onClick: disabled ? undefined : onWrapperClick, onFocus: onFocus, onBlur: onBlur, role: "combobox", "aria-haspopup": "tree", "aria-expanded": isOpen, "aria-disabled": disabled, "aria-label": label, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, "aria-required": required },
411
+ React.createElement("span", { className: "k-input-inner" },
412
+ React.createElement(ValueComponent, { item: value }, currentValueText || placeholder)),
413
+ props.loading && React.createElement(kendo_react_common_1.IconWrap, { className: "k-input-loading-icon", name: 'loading' }),
414
+ hasValue && !disabled && (React.createElement("span", { onClick: onClear, className: "k-clear-value", title: localization.toLanguageString(messages_1.clear, messages_1.messages[messages_1.clear]), role: "button", tabIndex: -1, onMouseDown: function (e) { return e.preventDefault(); } },
415
+ React.createElement(kendo_react_common_1.IconWrap, { name: 'x', icon: kendo_svg_icons_1.xIcon }))),
416
+ React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", "aria-label": "select", className: "k-input-button", size: size, fillMode: fillMode, themeColor: "base", rounded: null, icon: "caret-alt-down", svgIcon: kendo_svg_icons_1.caretAltDownIcon }),
417
+ React.createElement("select", { name: name, ref: selectRef, tabIndex: -1, "aria-hidden": true, title: label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },
418
+ React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
419
+ !isAdaptive && React.createElement(kendo_react_popup_1.Popup, { className: (0, kendo_react_common_1.classNames)(popupSettings.className, { 'k-rtl': dir === 'rtl' }), popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-list-container', 'k-dropdowntree-popup'), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo },
420
+ props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter, inputRef: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })),
421
+ data.length > 0 ? (React.createElement(kendo_react_treeview_1.TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: treeViewData, focusIdField: dataItemKey, textField: props.textField, selectField: selectField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onExpandChange: onExpand, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(messages_1.nodata, messages_1.messages[messages_1.nodata]))))),
422
+ isAdaptive && renderAdaptiveListContainer()));
370
423
  return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorValue: currentValueText, editorPlaceholder: placeholder, editorValid: isValid, editorDisabled: disabled, editorId: id, style: { width: style ? style.width : undefined }, children: dropdowntree, dir: dir })) : dropdowntree;
371
424
  });
372
425
  var propTypes = {
@@ -418,7 +471,9 @@ var propTypes = {
418
471
  onExpandChange: PropTypes.func,
419
472
  item: PropTypes.func,
420
473
  valueHolder: PropTypes.func,
421
- listNoData: PropTypes.func
474
+ listNoData: PropTypes.func,
475
+ adaptiveTitle: PropTypes.string,
476
+ adaptive: PropTypes.bool
422
477
  };
423
478
  exports.DropDownTree.displayName = 'KendoReactDropDownTree';
424
479
  exports.DropDownTree.defaultProps = defaultProps;
@@ -283,4 +283,12 @@ export interface DropDownTreeProps extends FormComponentProps {
283
283
  * @default `solid`
284
284
  */
285
285
  fillMode?: null | 'solid' | 'flat' | 'outline';
286
+ /**
287
+ * Providing different rendering of the popup element based on the screen dimensions.
288
+ */
289
+ adaptive?: boolean;
290
+ /**
291
+ * Specifies the text that is rendered as title in the adaptive popup.
292
+ */
293
+ adaptiveTitle?: string;
286
294
  }
@@ -25,7 +25,7 @@ var AdaptiveMode = function (props) {
25
25
  navigatable: navigatable || false,
26
26
  navigatableElements: navigatableElements || [],
27
27
  expand: expand,
28
- animation: animation || true,
28
+ animation: animation === false ? false : true,
29
29
  onClose: onClose,
30
30
  animationStyles: windowWidth <= MOBILE_SMALL_DEVISE ? { top: 0, width: '100%', height: '100%' } : undefined,
31
31
  className: windowWidth <= MOBILE_SMALL_DEVISE
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-dropdowns',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1681802673,
11
+ publishDate: 1681969040,
12
12
  version: '',
13
13
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  };