@progress/kendo-react-dropdowns 5.13.0-dev.202304201410 → 5.13.0-dev.202304251043

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.
@@ -76,7 +76,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
76
76
  /** @hidden */
77
77
  _this.state = {
78
78
  activedescendant: settings_1.ActiveDescendant.PopupList,
79
- currentTreeValue: []
79
+ currentValue: []
80
80
  };
81
81
  _this._element = null;
82
82
  _this._valueItemsDuringOnChange = null;
@@ -110,12 +110,16 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
110
110
  newItems = __spreadArray(__spreadArray([], _this.value, true), [dataItem], false);
111
111
  }
112
112
  var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
113
- if (text) {
113
+ if (text && !_this.mobileMode) {
114
114
  if (_this.state.text) {
115
115
  state.data.text = '';
116
116
  }
117
117
  _this.base.filterChanged('', state);
118
118
  }
119
+ if (_this._adaptiveInput) {
120
+ _this._adaptiveInput.blur();
121
+ }
122
+ ;
119
123
  if (_this.state.focusedIndex !== undefined) {
120
124
  state.data.focusedIndex = undefined;
121
125
  }
@@ -129,7 +133,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
129
133
  if (_this.opened) {
130
134
  _this.base.togglePopup(state);
131
135
  }
132
- if (!_this.state.focused) {
136
+ if (!_this.state.focused && !_this.mobileMode) {
133
137
  state.data.focused = true;
134
138
  _this.focus();
135
139
  }
@@ -179,10 +183,11 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
179
183
  state.data.focusedIndex = undefined;
180
184
  if (!_this.opened) {
181
185
  _this.base.togglePopup(state);
182
- _this.setState({ currentTreeValue: _this.value });
186
+ _this.setState({ currentValue: _this.value });
183
187
  }
184
188
  _this.base.filterChanged(value, state);
185
189
  _this.applyState(state);
190
+ _this.setState({ group: undefined });
186
191
  };
187
192
  _this.clearButtonClick = function (event) {
188
193
  var state = _this.base.initState();
@@ -270,7 +275,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
270
275
  _b["k-list-".concat(_this.mobileMode ? 'lg' : sizeMap[size] || size)] = size,
271
276
  _b['k-virtual-list'] = _this.base.vs.enabled,
272
277
  _b)) },
273
- !list && group && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),
278
+ !list && group && data.length !== 0 && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),
274
279
  _this.renderList()),
275
280
  footer && React.createElement("div", { className: "k-list-footer" }, footer)));
276
281
  };
@@ -301,11 +306,13 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
301
306
  var _b = _this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;
302
307
  var mobileText = filter !== undefined ? filter : _this.state.text;
303
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.input; }, onChange: _this.onChangeHandler, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode })) : null;
304
310
  var actionSheetProps = {
305
311
  adaptiveTitle: adaptiveTitle,
306
312
  expand: _this.opened,
307
313
  onClose: function (event) { return _this.onCancel(event); },
308
314
  windowWidth: windowWidth,
315
+ mobileFilter: mobileFilter,
309
316
  footer: {
310
317
  cancelText: _this.localization.toLanguageString(messages_1.adaptiveModeFooterCancel, messages_1.messages[messages_1.adaptiveModeFooterCancel]),
311
318
  onCancel: function (event) { return _this.onCancel(event); },
@@ -315,8 +322,8 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
315
322
  };
316
323
  return (React.createElement(AdaptiveMode_1.AdaptiveMode, __assign({}, actionSheetProps),
317
324
  React.createElement(kendo_react_layout_1.ActionSheetContent, { className: '!k-overflow-hidden' },
318
- filterable && React.createElement(ListFilter_1.default, { value: mobileText, ref: function (adaptiveFilter) { return _this._adaptiveInput = adaptiveFilter && adaptiveFilter.input; }, onChange: _this.onChangeHandler, onKeyDown: _this.onInputKeyDown, size: _this.props.size, rounded: _this.props.rounded, fillMode: _this.props.fillMode }),
319
- _this.listContainerContent())));
325
+ React.createElement("div", { className: 'k-list-container' },
326
+ React.createElement("div", { className: 'k-list k-list-lg' }, _this.listContainerContent())))));
320
327
  };
321
328
  _this.closePopup = function (event) {
322
329
  var state = _this.base.initState();
@@ -429,7 +436,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
429
436
  state.data.focused = true;
430
437
  }
431
438
  if (_this.mobileMode) {
432
- _this.setState({ currentTreeValue: _this.tagsToRender });
439
+ _this.setState({ currentValue: _this.tagsToRender });
433
440
  if (_this.mobileMode) {
434
441
  window.setTimeout(function () { return _this._adaptiveInput && _this._adaptiveInput.focus(); }, 300);
435
442
  }
@@ -625,8 +632,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
625
632
  /** @hidden */
626
633
  MultiSelectWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
627
634
  var _a;
628
- var _b = this.props, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c;
629
- var _d = this.props.data, data = _d === void 0 ? [] : _d;
635
+ var _b = this.props, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c, _d = _b.data, data = _d === void 0 ? [] : _d;
630
636
  var skip = virtual ? virtual.skip : 0;
631
637
  var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
632
638
  var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;
@@ -649,6 +655,10 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
649
655
  this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
650
656
  }
651
657
  else if (opening && !virtual) {
658
+ // Resets the sticky header group value for scenarios with open/close of component's popup
659
+ if (data && data.length !== 0) {
660
+ this.base.resetGroupStickyHeader(data[0][groupField], this);
661
+ }
652
662
  this.base.scrollToItem(focusedIndex);
653
663
  }
654
664
  else if (this.opened && prevOpened && focusedItem && this.scrollToFocused) {
@@ -707,7 +717,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
707
717
  MultiSelectWithoutContext.prototype.render = function () {
708
718
  var _a, _b;
709
719
  var _c = this.props, style = _c.style, className = _c.className, label = _c.label, dir = _c.dir, disabled = _c.disabled, textField = _c.textField, dataItemKey = _c.dataItemKey, virtual = _c.virtual, size = _c.size, rounded = _c.rounded, fillMode = _c.fillMode, loading = _c.loading, filter = _c.filter;
710
- var _d = this.state, text = _d.text, focused = _d.focused, focusedTag = _d.focusedTag, currentTreeValue = _d.currentTreeValue;
720
+ var _d = this.state, text = _d.text, focused = _d.focused, focusedTag = _d.focusedTag, currentValue = _d.currentValue;
711
721
  var vs = this.base.vs;
712
722
  var id = this.props.id || this._inputId;
713
723
  vs.enabled = virtual !== undefined;
@@ -716,7 +726,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
716
726
  vs.total = virtual.total;
717
727
  vs.pageSize = virtual.pageSize;
718
728
  }
719
- var currentTagsToRender = (this.mobileMode && this.opened) ? currentTreeValue : this.tagsToRender;
729
+ var currentTagsToRender = (this.mobileMode && this.opened) ? currentValue : this.tagsToRender;
720
730
  this.setItems(this.tagsToRender, this._tags);
721
731
  var isValid = !this.validityStyles || this.validity.valid;
722
732
  var clearButton = Boolean(filter !== undefined ? filter : text)
@@ -744,12 +754,12 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
744
754
  return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorId: id, editorValue: text || (0, utils_1.getItemValue)(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;
745
755
  };
746
756
  MultiSelectWithoutContext.prototype.renderSearchBar = function (id) {
747
- var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag, currentTreeValue = _a.currentTreeValue;
757
+ var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag, currentValue = _a.currentValue;
748
758
  var _b = this.props, disabled = _b.disabled, placeholder = _b.placeholder, ariaDescribedBy = _b.ariaDescribedBy;
749
759
  var text = !this.mobileMode && (this.props.filter !== undefined ? this.props.filter : this.state.text) || '';
750
760
  var focusedIndex = this.getFocusedState().focusedIndex;
751
761
  var placeholderToShow = this.value.length === 0 && !text ? placeholder : undefined;
752
- var adaptivePlaceholder = (currentTreeValue && currentTreeValue.length > 0) ? undefined : placeholder;
762
+ var adaptivePlaceholder = (currentValue && currentValue.length > 0) ? undefined : placeholder;
753
763
  var ariaActivedescendant = activedescendant === settings_1.ActiveDescendant.TagsList && focusedTag !== undefined ?
754
764
  "tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) :
755
765
  "option-".concat(this.base.guid, "-").concat(focusedIndex);
@@ -159,7 +159,7 @@ export interface MultiSelectProps extends FormComponentProps {
159
159
  */
160
160
  filter?: string;
161
161
  /**
162
- * Sets the value of the adaptive filtering input of the of ComboBox.
162
+ * Sets the value of the adaptive filtering input of the of MultiSelect.
163
163
  */
164
164
  adaptiveFilter?: string;
165
165
  /**
@@ -161,4 +161,5 @@ export default class DropDownBase {
161
161
  renderScrollElement: () => false | JSX.Element;
162
162
  getPopupSettings(): DropDownsPopupSettings;
163
163
  getGroupedDataModernMode(data: any[], groupField: string): any[];
164
+ resetGroupStickyHeader: (groupName: string, that: any) => void;
164
165
  }
@@ -105,6 +105,11 @@ var DropDownBase = /** @class */ (function () {
105
105
  var vs = _this.vs;
106
106
  return vs.enabled && (React.createElement("div", { ref: function (element) { return vs.scrollElement = element; }, key: 'scrollElementKey' }));
107
107
  };
108
+ this.resetGroupStickyHeader = function (groupName, that) {
109
+ if (groupName !== that.state.group) {
110
+ that.setState(__assign(__assign({}, that.state), { group: groupName }));
111
+ }
112
+ };
108
113
  this.listBoxId = (0, kendo_react_common_1.guid)();
109
114
  this.guid = (0, kendo_react_common_1.guid)();
110
115
  this.component = component;
@@ -18,8 +18,6 @@ var List_1 = require("./List");
18
18
  * @hidden
19
19
  */
20
20
  var MultiColumnList = function (props) {
21
- // eslint-disable-next-line no-console
22
- console.log('%c- props.listStyle:', 'color: #ff4081; font-weight: bold', __assign({}, props.listStyle));
23
21
  return (React.createElement(List_1.default, __assign({}, props, { wrapperCssClass: "k-table-body k-table-scroller", listClassName: "k-table k-table-list", listStyle: __assign({}, props.listStyle) })));
24
22
  };
25
23
  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: 1681998518,
11
+ publishDate: 1682418128,
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
  };