@progress/kendo-react-dropdowns 5.13.1 → 5.14.0-dev.202305100720
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.
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/dist/es/ComboBox/ComboBox.d.ts +1 -1
- package/dist/es/ComboBox/ComboBox.js +10 -7
- package/dist/es/ComboBox/ComboBoxProps.d.ts +4 -0
- package/dist/es/DropDownList/DropDownList.d.ts +3 -0
- package/dist/es/DropDownList/DropDownList.js +2 -2
- package/dist/es/DropDownTree/DropDownTree.js +17 -13
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +3 -1
- package/dist/es/MultiSelect/MultiSelect.js +3 -3
- package/dist/es/MultiSelectTree/MultiSelectTree.js +21 -17
- package/dist/es/common/ListFilter.d.ts +5 -7
- package/dist/es/common/ListFilter.js +30 -38
- package/dist/es/common/MultiColumnList.js +4 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/ComboBox/ComboBox.d.ts +1 -1
- package/dist/npm/ComboBox/ComboBox.js +9 -6
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +4 -0
- package/dist/npm/DropDownList/DropDownList.d.ts +3 -0
- package/dist/npm/DropDownList/DropDownList.js +2 -2
- package/dist/npm/DropDownTree/DropDownTree.js +17 -13
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +3 -1
- package/dist/npm/MultiSelect/MultiSelect.js +3 -3
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +21 -17
- package/dist/npm/common/ListFilter.d.ts +5 -7
- package/dist/npm/common/ListFilter.js +29 -37
- package/dist/npm/common/MultiColumnList.js +4 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dropdowns.js +1 -1
- package/package.json +16 -13
|
@@ -175,7 +175,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
175
175
|
};
|
|
176
176
|
_this.renderListFilter = function () {
|
|
177
177
|
var filterText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
178
|
-
return _this.props.filterable && (React.createElement(ListFilter_1.default, { value: filterText, ref: function (filter) { return _this._filterInput = filter && filter.
|
|
178
|
+
return _this.props.filterable && (React.createElement(ListFilter_1.default, { value: filterText, ref: function (filter) { return _this._filterInput = filter && filter.element; }, onChange: _this.handleListFilterChange, onKeyDown: _this.handleKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode }));
|
|
179
179
|
};
|
|
180
180
|
_this.renderDefaultItem = function () {
|
|
181
181
|
var _a = _this.props, textField = _a.textField, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey;
|
|
@@ -344,7 +344,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
344
344
|
};
|
|
345
345
|
_this.handleListFilterChange = function (event) {
|
|
346
346
|
var state = _this.base.initState();
|
|
347
|
-
state.syntheticEvent = event;
|
|
347
|
+
state.syntheticEvent = event.syntheticEvent;
|
|
348
348
|
if (_this.props.filter === undefined) {
|
|
349
349
|
state.data.text = event.target.value;
|
|
350
350
|
}
|
|
@@ -120,9 +120,9 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
120
120
|
var _k = React.useState(false), open = _k[0], setOpen = _k[1];
|
|
121
121
|
var isOpen = opened !== undefined ? opened : open;
|
|
122
122
|
var _l = React.useState(false), focused = _l[0], setFocused = _l[1];
|
|
123
|
-
var _m = React.useState(
|
|
124
|
-
var _o = React.useState(), windowWidth = _o[0], setWindowWidth = _o[1];
|
|
123
|
+
var _m = React.useState(), windowWidth = _m[0], setWindowWidth = _m[1];
|
|
125
124
|
var isAdaptive = !!(windowWidth && windowWidth <= constants_1.MOBILE_MEDIUM_DEVISE && props.adaptive);
|
|
125
|
+
var _o = React.useState(''), filter = _o[0], setFilter = _o[1];
|
|
126
126
|
var setValidity = React.useCallback(function () {
|
|
127
127
|
if (selectRef.current && selectRef.current.setCustomValidity) {
|
|
128
128
|
selectRef.current.setCustomValidity(validity.valid
|
|
@@ -163,7 +163,8 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
163
163
|
setOpen(false);
|
|
164
164
|
if (isAdaptive) {
|
|
165
165
|
setTimeout(function () {
|
|
166
|
-
|
|
166
|
+
var _a;
|
|
167
|
+
focusElement((_a = adaptiveInputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
167
168
|
}, 300);
|
|
168
169
|
}
|
|
169
170
|
}
|
|
@@ -186,9 +187,10 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
186
187
|
window.setTimeout(function () { return skipFocusRef.current = false; }, 0);
|
|
187
188
|
}, []);
|
|
188
189
|
var onWrapperKeyDown = React.useCallback(function (event) {
|
|
190
|
+
var _a, _b;
|
|
189
191
|
var keyCode = event.keyCode, altKey = event.altKey;
|
|
190
192
|
var treeview = treeViewRef.current && treeViewRef.current.element;
|
|
191
|
-
if (!target.current || (event.isDefaultPrevented() && inputRef.current === event.target)) {
|
|
193
|
+
if (!target.current || (event.isDefaultPrevented() && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element) === event.target)) {
|
|
192
194
|
return;
|
|
193
195
|
}
|
|
194
196
|
var ev = {
|
|
@@ -205,17 +207,17 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
205
207
|
(keyCode === kendo_react_common_1.Keys.up || keyCode === kendo_react_common_1.Keys.down ||
|
|
206
208
|
keyCode === kendo_react_common_1.Keys.left || keyCode === kendo_react_common_1.Keys.right ||
|
|
207
209
|
keyCode === kendo_react_common_1.Keys.home || keyCode === kendo_react_common_1.Keys.end)) {
|
|
208
|
-
if (keyCode === kendo_react_common_1.Keys.up && inputRef.current) {
|
|
210
|
+
if (keyCode === kendo_react_common_1.Keys.up && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.element)) {
|
|
209
211
|
var items = Array.from(treeview.querySelectorAll('.k-treeview-item'));
|
|
210
212
|
var focusedItem = __spreadArray([], items, true).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
211
213
|
if (focusedItem && items.indexOf(focusedItem) === 0) {
|
|
212
|
-
return switchFocus(function () { focusElement(inputRef.current); });
|
|
214
|
+
return switchFocus(function () { var _a; focusElement((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element); });
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
switchFocus(kendo_react_common_1.noop);
|
|
216
218
|
}
|
|
217
219
|
else if (keyCode === kendo_react_common_1.Keys.down) {
|
|
218
|
-
switchFocus(function () { focusElement(inputRef.current || treeview); });
|
|
220
|
+
switchFocus(function () { var _a; focusElement(((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element) || treeview); });
|
|
219
221
|
}
|
|
220
222
|
}
|
|
221
223
|
else {
|
|
@@ -241,12 +243,13 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
241
243
|
}
|
|
242
244
|
}, []);
|
|
243
245
|
var onPopupOpened = React.useCallback(function () {
|
|
246
|
+
var _a;
|
|
244
247
|
if (!focused && isOpen && !opened) {
|
|
245
248
|
closePopup({ target: target.current });
|
|
246
249
|
}
|
|
247
250
|
else {
|
|
248
251
|
if (props.filterable) {
|
|
249
|
-
focusElement(inputRef.current);
|
|
252
|
+
focusElement((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
250
253
|
}
|
|
251
254
|
else {
|
|
252
255
|
focusElement(treeViewRef.current && treeViewRef.current.element);
|
|
@@ -296,7 +299,8 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
296
299
|
}
|
|
297
300
|
if (isAdaptive) {
|
|
298
301
|
setTimeout(function () {
|
|
299
|
-
|
|
302
|
+
var _a;
|
|
303
|
+
focusElement((_a = adaptiveInputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
300
304
|
}, 300);
|
|
301
305
|
}
|
|
302
306
|
}, [focused, isAdaptive]);
|
|
@@ -354,7 +358,7 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
354
358
|
var filterDesc = { field: props.textField, operator: 'contains', value: event.target.value };
|
|
355
359
|
var ev = {
|
|
356
360
|
filter: filterDesc,
|
|
357
|
-
syntheticEvent: event,
|
|
361
|
+
syntheticEvent: event.syntheticEvent,
|
|
358
362
|
nativeEvent: event.nativeEvent,
|
|
359
363
|
target: target.current
|
|
360
364
|
};
|
|
@@ -365,7 +369,7 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
365
369
|
}
|
|
366
370
|
}, [props.onFilterChange, props.filter, props.textField]);
|
|
367
371
|
var renderAdaptiveListContainer = function () {
|
|
368
|
-
var mobileFilter = props.filterable ? (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter,
|
|
372
|
+
var mobileFilter = props.filterable ? (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter, ref: adaptiveInputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })) : null;
|
|
369
373
|
var actionSheetProps = {
|
|
370
374
|
adaptiveTitle: props.adaptiveTitle,
|
|
371
375
|
expand: isOpen,
|
|
@@ -416,8 +420,8 @@ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
416
420
|
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
421
|
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
422
|
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-
|
|
420
|
-
props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter,
|
|
423
|
+
!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-dropdowntree-popup'), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo },
|
|
424
|
+
props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filter : props.filter, ref: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })),
|
|
421
425
|
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
426
|
isAdaptive && renderAdaptiveListContainer()));
|
|
423
427
|
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;
|
|
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.MultiColumnComboBox = exports.MultiColumnComboBoxPropsContext = void 0;
|
|
26
26
|
var React = require("react");
|
|
27
27
|
var PropTypes = require("prop-types");
|
|
28
|
+
var kendo_react_popup_1 = require("@progress/kendo-react-popup");
|
|
28
29
|
var MultiColumnList_1 = require("./../common/MultiColumnList");
|
|
29
30
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
30
31
|
var ComboBox_1 = require("../ComboBox/ComboBox");
|
|
@@ -159,7 +160,8 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
159
160
|
;
|
|
160
161
|
}, [props.data]);
|
|
161
162
|
var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList_1.MultiColumnList, __assign({}, listProps)); }, []);
|
|
162
|
-
return (React.createElement(
|
|
163
|
+
return (React.createElement(kendo_react_popup_1.PopupPropsContext.Provider, { value: function (PopupProps) { return (__assign(__assign({}, PopupProps), { popupClass: 'k-dropdowngrid-popup' })); } },
|
|
164
|
+
React.createElement(ComboBox_1.ComboBox, __assign({}, other, { list: List, popupSettings: __assign(__assign({ width: popupWidth }, popupSettings), { className: popupSettings.className }), ref: comboBoxRef, header: header, itemRender: itemRender, groupHeaderItemRender: props.groupHeaderItemRender, size: props.size, rounded: props.rounded, fillMode: props.fillMode, groupMode: props.groupMode, groupField: props.groupField, isMultiColumn: true, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler, onGroupScroll: onGroupScroll, className: (0, kendo_react_common_1.classNames)('k-dropdowngrid', className), required: props.required, adaptive: props.adaptive, adaptiveFilter: props.adaptiveFilter, adaptiveTitle: props.adaptiveTitle, footer: props.footer, footerClassName: 'k-table-footer' }))));
|
|
163
165
|
});
|
|
164
166
|
var propTypes = __assign(__assign({}, ComboBox_1.ComboBoxWithoutContext.propTypes), { columns: PropTypes.any.isRequired });
|
|
165
167
|
var defaultProps = {
|
|
@@ -306,7 +306,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
306
306
|
var _b = _this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;
|
|
307
307
|
var mobileText = filter !== undefined ? filter : _this.state.text;
|
|
308
308
|
_this.localization = (0, kendo_react_intl_1.provideLocalizationService)(_this);
|
|
309
|
-
var mobileFilter = filterable ? (React.createElement(ListFilter_1.default, { value: mobileText, ref: function (adaptiveFilter) { return _this._adaptiveInput = adaptiveFilter && adaptiveFilter.
|
|
309
|
+
var mobileFilter = filterable ? (React.createElement(ListFilter_1.default, { value: mobileText, ref: function (adaptiveFilter) { return _this._adaptiveInput = adaptiveFilter && adaptiveFilter.element; }, onChange: _this.onChangeHandler, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode })) : null;
|
|
310
310
|
var actionSheetProps = {
|
|
311
311
|
adaptiveTitle: adaptiveTitle,
|
|
312
312
|
expand: _this.opened,
|
|
@@ -322,8 +322,8 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
322
322
|
};
|
|
323
323
|
return (React.createElement(AdaptiveMode_1.AdaptiveMode, __assign({}, actionSheetProps),
|
|
324
324
|
React.createElement(kendo_react_layout_1.ActionSheetContent, { className: '!k-overflow-hidden' },
|
|
325
|
-
React.createElement(
|
|
326
|
-
|
|
325
|
+
filterable && React.createElement(ListFilter_1.default, { value: mobileText, ref: function (adaptiveFilter) { return _this._adaptiveInput = adaptiveFilter && adaptiveFilter.element; }, onChange: _this.onChangeHandler, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode }),
|
|
326
|
+
_this.listContainerContent())));
|
|
327
327
|
};
|
|
328
328
|
_this.closePopup = function (event) {
|
|
329
329
|
var state = _this.base.initState();
|
|
@@ -102,9 +102,9 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
102
102
|
var _o = React.useState(), focusedTagState = _o[0], setFocusedTagState = _o[1];
|
|
103
103
|
var _p = React.useState(false), openState = _p[0], setOpenState = _p[1];
|
|
104
104
|
var _q = React.useState(false), focusedState = _q[0], setFocusedState = _q[1];
|
|
105
|
-
var _r = React.useState(
|
|
106
|
-
var _s = React.useState(),
|
|
107
|
-
var _t = React.useState(
|
|
105
|
+
var _r = React.useState(), windowWidth = _r[0], setWindowWidth = _r[1];
|
|
106
|
+
var _s = React.useState([]), currentTreeValue = _s[0], setCurrentTreeValue = _s[1];
|
|
107
|
+
var _t = React.useState(''), filterState = _t[0], setFilterState = _t[1];
|
|
108
108
|
var isAdaptive = !!(windowWidth && windowWidth <= constants_1.MOBILE_MEDIUM_DEVISE && props.adaptive);
|
|
109
109
|
var isOpen = opened !== undefined ? opened : openState;
|
|
110
110
|
var hasValue = Boolean(Array.isArray(value) && value.length);
|
|
@@ -174,12 +174,13 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
174
174
|
setCurrentTreeValue(value || []);
|
|
175
175
|
if (isAdaptive) {
|
|
176
176
|
setTimeout(function () {
|
|
177
|
-
|
|
177
|
+
var _a;
|
|
178
|
+
focusElement((_a = adaptiveInputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
178
179
|
}, 300);
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
|
-
}, [isOpen, opened, onOpen, isAdaptive]);
|
|
183
|
+
}, [isOpen, opened, onOpen, isAdaptive, adaptiveInputRef]);
|
|
183
184
|
var closePopup = React.useCallback(function (event) {
|
|
184
185
|
if (isOpen) {
|
|
185
186
|
if (onClose) {
|
|
@@ -202,12 +203,13 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
202
203
|
}
|
|
203
204
|
}, [switchFocus]);
|
|
204
205
|
var onPopupOpened = React.useCallback(function () {
|
|
206
|
+
var _a;
|
|
205
207
|
if (!focusedState && isOpen) {
|
|
206
208
|
closePopup({ target: targetRef.current });
|
|
207
209
|
}
|
|
208
210
|
else {
|
|
209
211
|
if (props.filterable) {
|
|
210
|
-
focusElement(inputRef.current);
|
|
212
|
+
focusElement((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
211
213
|
}
|
|
212
214
|
else {
|
|
213
215
|
focusElement(treeViewRef.current && treeViewRef.current.element);
|
|
@@ -270,9 +272,10 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
270
272
|
}
|
|
271
273
|
}, [isOpen, openPopup]);
|
|
272
274
|
var onWrapperKeyDown = React.useCallback(function (event) {
|
|
275
|
+
var _a, _b;
|
|
273
276
|
var keyCode = event.keyCode, altKey = event.altKey;
|
|
274
277
|
var treeviewElement = treeViewRef.current && treeViewRef.current.element;
|
|
275
|
-
if (!targetRef.current || (event.isDefaultPrevented() && inputRef.current === event.target)) {
|
|
278
|
+
if (!targetRef.current || (event.isDefaultPrevented() && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element) === event.target)) {
|
|
276
279
|
return;
|
|
277
280
|
}
|
|
278
281
|
var ev = {
|
|
@@ -331,17 +334,17 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
331
334
|
(keyCode === kendo_react_common_1.Keys.up || keyCode === kendo_react_common_1.Keys.down ||
|
|
332
335
|
keyCode === kendo_react_common_1.Keys.left || keyCode === kendo_react_common_1.Keys.right ||
|
|
333
336
|
keyCode === kendo_react_common_1.Keys.home || keyCode === kendo_react_common_1.Keys.end)) {
|
|
334
|
-
if (keyCode === kendo_react_common_1.Keys.up && inputRef.current) {
|
|
337
|
+
if (keyCode === kendo_react_common_1.Keys.up && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.element)) {
|
|
335
338
|
var items = Array.from(treeviewElement.querySelectorAll('.k-treeview-item'));
|
|
336
339
|
var focusedItem = __spreadArray([], items, true).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
337
340
|
if (focusedItem && items.indexOf(focusedItem) === 0) {
|
|
338
|
-
return switchFocus(function () { focusElement(inputRef.current); });
|
|
341
|
+
return switchFocus(function () { var _a; focusElement((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element); });
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
344
|
switchFocus(kendo_react_common_1.noop);
|
|
342
345
|
}
|
|
343
346
|
else if (keyCode === kendo_react_common_1.Keys.down) {
|
|
344
|
-
switchFocus(function () { focusElement(inputRef.current || treeviewElement); });
|
|
347
|
+
switchFocus(function () { var _a; focusElement(((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element) || treeviewElement); });
|
|
345
348
|
}
|
|
346
349
|
}
|
|
347
350
|
else {
|
|
@@ -375,9 +378,10 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
375
378
|
event.preventDefault();
|
|
376
379
|
}, [changeValue, closePopup]);
|
|
377
380
|
var onTagDelete = React.useCallback(function (itemsToRemove, event) {
|
|
381
|
+
var _a;
|
|
378
382
|
closePopup({ target: targetRef.current });
|
|
379
383
|
if (!focusedState) {
|
|
380
|
-
focusElement(inputRef.current);
|
|
384
|
+
focusElement((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.element);
|
|
381
385
|
}
|
|
382
386
|
changeValue({
|
|
383
387
|
syntheticEvent: event,
|
|
@@ -403,7 +407,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
403
407
|
var filterDesc = { field: props.textField, operator: 'contains', value: event.target.value };
|
|
404
408
|
var ev = {
|
|
405
409
|
filter: filterDesc,
|
|
406
|
-
syntheticEvent: event,
|
|
410
|
+
syntheticEvent: event.syntheticEvent,
|
|
407
411
|
nativeEvent: event.nativeEvent,
|
|
408
412
|
target: targetRef.current
|
|
409
413
|
};
|
|
@@ -430,7 +434,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
430
434
|
event.preventDefault();
|
|
431
435
|
}, [props.onCancel, closePopup]);
|
|
432
436
|
var renderAdaptiveListContainer = function () {
|
|
433
|
-
var mobileFilter = props.filterable ? (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filterState : props.filter,
|
|
437
|
+
var mobileFilter = props.filterable ? (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filterState : props.filter, ref: adaptiveInputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, size: size, rounded: rounded, fillMode: fillMode })) : null;
|
|
434
438
|
var actionSheetProps = {
|
|
435
439
|
adaptiveTitle: props.adaptiveTitle,
|
|
436
440
|
expand: isOpen,
|
|
@@ -462,7 +466,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
462
466
|
var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
|
|
463
467
|
var currentTagsToRender = isAdaptive && isOpen ? currentTreeValue : tagsToRenderRef.current;
|
|
464
468
|
var multiselecttree = (React.createElement(React.Fragment, null,
|
|
465
|
-
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-
|
|
469
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-multiselecttree k-input', props.className, (_a = {},
|
|
466
470
|
_a["k-input-".concat(sizeMap[size] || size)] = size,
|
|
467
471
|
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
468
472
|
_a["k-input-".concat(fillMode)] = fillMode,
|
|
@@ -471,7 +475,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
471
475
|
_a['k-disabled'] = disabled,
|
|
472
476
|
_a['k-loading'] = props.loading,
|
|
473
477
|
_a['k-required'] = required,
|
|
474
|
-
_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, onFocus: onFocus, onBlur: onBlur, role: "combobox", "aria-haspopup": "
|
|
478
|
+
_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, 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 ? props.ariaDescribedBy : 'tagslist-' + id, "aria-required": props.required, onClick: disabled ? undefined : onWrapperClick },
|
|
475
479
|
React.createElement("div", { id: 'tagslist-' + id, className: (0, kendo_react_common_1.classNames)('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
476
480
|
_b["k-chip-list-".concat(sizeMap[size] || size)] = size,
|
|
477
481
|
_b)) }, currentTagsToRender.length > 0 && (React.createElement(TagList_1.default, { tag: props.tag, onTagDelete: onTagDelete, data: currentTagsToRender, guid: id, focused: focusedTagState ? tagsToRenderRef.current.find(function (t) { return (0, utils_1.matchTags)(t, focusedTagState, dataItemKey); }) : undefined, size: size }))),
|
|
@@ -483,8 +487,8 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
483
487
|
React.createElement(ClearButton_1.default, { onClick: onClear }),
|
|
484
488
|
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%' } },
|
|
485
489
|
React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
|
|
486
|
-
!isAdaptive && React.createElement(kendo_react_popup_1.Popup, { popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-
|
|
487
|
-
props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filterState : props.filter,
|
|
490
|
+
!isAdaptive && React.createElement(kendo_react_popup_1.Popup, { popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-multiselecttree-popup'), className: (0, kendo_react_common_1.classNames)(popupSettings.className, { 'k-rtl': dir === 'rtl' }), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo, ref: popupRef },
|
|
491
|
+
props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filterState : props.filter, ref: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, tabIndex: tabIndex, size: size, rounded: rounded, fillMode: fillMode })),
|
|
488
492
|
data.length > 0 ? (React.createElement(kendo_react_treeview_1.TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: data, focusIdField: dataItemKey, textField: props.textField, checkField: checkField, checkIndeterminateField: checkIndeterminateField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onCheckChange: onChange, onExpandChange: onExpand, checkboxes: true, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(messages_1.nodata, messages_1.messages[messages_1.nodata]))))),
|
|
489
493
|
isAdaptive && renderAdaptiveListContainer()));
|
|
490
494
|
return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorValue: hasValue, editorPlaceholder: placeholder, editorValid: isValid, editorDisabled: disabled, editorId: id, style: { width: style ? style.width : undefined }, children: multiselecttree, dir: dir })) : multiselecttree;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TextBoxChangeEvent, TextBoxHandle } from '@progress/kendo-react-inputs';
|
|
2
3
|
/**
|
|
3
4
|
* @hidden
|
|
4
5
|
*/
|
|
5
6
|
export interface ListFilterProps {
|
|
6
|
-
value?: string;
|
|
7
|
-
inputRef?: any;
|
|
7
|
+
value?: string | number | readonly string[] | undefined;
|
|
8
8
|
tabIndex?: number;
|
|
9
|
-
onChange?:
|
|
9
|
+
onChange?: (event: TextBoxChangeEvent) => void;
|
|
10
10
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
11
11
|
size?: null | 'small' | 'medium' | 'large';
|
|
12
12
|
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
@@ -15,7 +15,5 @@ export interface ListFilterProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|
|
18
|
+
declare const ListFilter: React.ForwardRefExoticComponent<ListFilterProps & React.RefAttributes<TextBoxHandle | null>>;
|
|
19
|
+
export default ListFilter;
|
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
8
10
|
};
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
17
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
14
|
var React = require("react");
|
|
15
|
+
var PropTypes = require("prop-types");
|
|
16
|
+
var kendo_react_inputs_1 = require("@progress/kendo-react-inputs");
|
|
19
17
|
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
20
18
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
21
|
-
var sizeMap = kendo_react_common_1.kendoThemeMaps.sizeMap, roundedMap = kendo_react_common_1.kendoThemeMaps.roundedMap;
|
|
22
19
|
/**
|
|
23
20
|
* @hidden
|
|
24
21
|
*/
|
|
25
|
-
var ListFilter =
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
React.createElement(kendo_react_common_1.IconWrap, { className: "k-input-icon", name: 'search', icon: kendo_svg_icons_1.searchIcon }),
|
|
43
|
-
React.createElement("input", { ref: inputRef ? inputRef : function (input) { return _this.input = input; }, value: this.props.value || '', className: "k-input-inner", onChange: this.props.onChange, onKeyDown: this.props.onKeyDown, tabIndex: this.props.tabIndex, onClick: function (e) { return e.stopPropagation(); } }))));
|
|
44
|
-
};
|
|
45
|
-
return ListFilter;
|
|
46
|
-
}(React.Component));
|
|
22
|
+
var ListFilter = React.forwardRef(function (props, ref) {
|
|
23
|
+
var input = React.useRef(null);
|
|
24
|
+
React.useImperativeHandle(ref, function () { return input.current; });
|
|
25
|
+
return (React.createElement("div", { className: "k-list-filter" },
|
|
26
|
+
React.createElement(kendo_react_inputs_1.TextBox, __assign({}, props, { ref: input, value: props.value || '', onChange: props.onChange, onKeyDown: props.onKeyDown, tabIndex: props.tabIndex, onClick: function (e) { return e.stopPropagation(); }, size: props.size, fillMode: props.fillMode, rounded: props.rounded, prefix: function () { return (React.createElement(kendo_react_inputs_1.InputPrefix, null,
|
|
27
|
+
React.createElement(kendo_react_common_1.IconWrap, { name: 'search', icon: kendo_svg_icons_1.searchIcon }))); } }))));
|
|
28
|
+
});
|
|
29
|
+
ListFilter.propTypes = {
|
|
30
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
31
|
+
tabIndex: PropTypes.number,
|
|
32
|
+
onChange: PropTypes.func,
|
|
33
|
+
onKeyDown: PropTypes.func,
|
|
34
|
+
size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
|
|
35
|
+
rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),
|
|
36
|
+
fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline'])
|
|
37
|
+
};
|
|
38
|
+
ListFilter.displayName = 'KendoReactListFilter';
|
|
47
39
|
exports.default = ListFilter;
|
|
@@ -14,10 +14,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.MultiColumnList = void 0;
|
|
15
15
|
var React = require("react");
|
|
16
16
|
var List_1 = require("./List");
|
|
17
|
+
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
17
18
|
/**
|
|
18
19
|
* @hidden
|
|
19
20
|
*/
|
|
20
21
|
var MultiColumnList = function (props) {
|
|
21
|
-
return (React.createElement(List_1.default, __assign({}, props, { wrapperCssClass: "k-table-body k-table-scroller", listClassName:
|
|
22
|
+
return (React.createElement(List_1.default, __assign({}, props, { wrapperCssClass: "k-table-body k-table-scroller", listClassName: (0, kendo_react_common_1.classNames)('k-table k-table-list', {
|
|
23
|
+
'k-virtual-table': props.virtual !== undefined
|
|
24
|
+
}), listStyle: __assign({}, props.listStyle) })));
|
|
22
25
|
};
|
|
23
26
|
exports.MultiColumnList = MultiColumnList;
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-dropdowns',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1683701306,
|
|
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
|
};
|