@progress/kendo-react-dropdowns 4.13.0-dev.202111291459 → 4.13.0-dev.202111300702

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 (45) hide show
  1. package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
  2. package/dist/es/AutoComplete/AutoComplete.d.ts +58 -23
  3. package/dist/es/AutoComplete/AutoComplete.js +65 -50
  4. package/dist/es/AutoComplete/AutoCompleteProps.d.ts +1 -1
  5. package/dist/es/ComboBox/ComboBox.d.ts +59 -23
  6. package/dist/es/ComboBox/ComboBox.js +69 -54
  7. package/dist/es/ComboBox/ComboBoxProps.d.ts +1 -1
  8. package/dist/es/DropDownList/DropDownList.d.ts +65 -22
  9. package/dist/es/DropDownList/DropDownList.js +63 -46
  10. package/dist/es/DropDownList/DropDownListProps.d.ts +1 -1
  11. package/dist/es/DropDownTree/DropDownTree.d.ts +10 -0
  12. package/dist/es/DropDownTree/DropDownTree.js +13 -2
  13. package/dist/es/MultiColumnComboBox/MultiColumnComboBox.d.ts +11 -0
  14. package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +16 -4
  15. package/dist/es/MultiSelect/MultiSelect.d.ts +58 -23
  16. package/dist/es/MultiSelect/MultiSelect.js +65 -50
  17. package/dist/es/MultiSelect/MultiSelectProps.d.ts +1 -1
  18. package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +10 -0
  19. package/dist/es/MultiSelectTree/MultiSelectTree.js +13 -2
  20. package/dist/es/main.d.ts +8 -8
  21. package/dist/es/main.js +8 -8
  22. package/dist/es/package-metadata.js +1 -1
  23. package/dist/npm/AutoComplete/AutoComplete.d.ts +58 -23
  24. package/dist/npm/AutoComplete/AutoComplete.js +64 -49
  25. package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +1 -1
  26. package/dist/npm/ComboBox/ComboBox.d.ts +59 -23
  27. package/dist/npm/ComboBox/ComboBox.js +68 -53
  28. package/dist/npm/ComboBox/ComboBoxProps.d.ts +1 -1
  29. package/dist/npm/DropDownList/DropDownList.d.ts +65 -22
  30. package/dist/npm/DropDownList/DropDownList.js +62 -45
  31. package/dist/npm/DropDownList/DropDownListProps.d.ts +1 -1
  32. package/dist/npm/DropDownTree/DropDownTree.d.ts +10 -0
  33. package/dist/npm/DropDownTree/DropDownTree.js +12 -1
  34. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +11 -0
  35. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +15 -3
  36. package/dist/npm/MultiSelect/MultiSelect.d.ts +58 -23
  37. package/dist/npm/MultiSelect/MultiSelect.js +64 -49
  38. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +1 -1
  39. package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +10 -0
  40. package/dist/npm/MultiSelectTree/MultiSelectTree.js +12 -1
  41. package/dist/npm/main.d.ts +8 -8
  42. package/dist/npm/main.js +11 -4
  43. package/dist/npm/package-metadata.js +1 -1
  44. package/dist/systemjs/kendo-react-dropdowns.js +1 -1
  45. package/package.json +11 -8
@@ -48,11 +48,22 @@ var defaultProps = {
48
48
  required: false,
49
49
  validityStyles: true
50
50
  };
51
+ /**
52
+ * Represents the PropsContext of the `DropDownTree` component.
53
+ * Used for global configuration of all `DropDownTree` instances.
54
+ *
55
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
56
+ */
57
+ exports.DropDownTreePropsContext = kendo_react_common_1.createPropsContext();
51
58
  /**
52
59
  * Represents the DropDownTree component.
60
+ *
61
+ * Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
62
+ * Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
53
63
  */
54
- exports.DropDownTree = React.forwardRef(function (props, ref) {
64
+ exports.DropDownTree = React.forwardRef(function (directProps, ref) {
55
65
  kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
66
+ var props = kendo_react_common_1.usePropsContext(exports.DropDownTreePropsContext, directProps);
56
67
  var calculatedId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
57
68
  var id = props.id || calculatedId;
58
69
  var _a = props.data, data = _a === void 0 ? [] : _a, dataItemKey = props.dataItemKey, _b = props.popupSettings, popupSettings = _b === void 0 ? {} : _b, _c = props.style, style = _c === void 0 ? {} : _c, opened = props.opened, disabled = props.disabled, _d = props.onOpen, onOpen = _d === void 0 ? kendo_react_common_1.noop : _d, _e = props.onClose, onClose = _e === void 0 ? kendo_react_common_1.noop : _e, placeholder = props.placeholder, label = props.label, name = props.name, _f = props.selectField, selectField = _f === void 0 ? defaultProps.selectField : _f, _g = props.subItemsField, subItemsField = _g === void 0 ? defaultProps.subItemsField : _g, validationMessage = props.validationMessage, valid = props.valid, _h = props.required, required = _h === void 0 ? defaultProps.required : _h, _j = props.validityStyles, validityStyles = _j === void 0 ? defaultProps.validityStyles : _j;
@@ -190,7 +190,18 @@ export interface MultiColumnComboBoxChangeEvent {
190
190
  */
191
191
  syntheticEvent: React.SyntheticEvent<any>;
192
192
  }
193
+ /**
194
+ * Represents the PropsContext of the `MultiColumnComboBox` component.
195
+ * Used for global configuration of all `MultiColumnComboBox` instances.
196
+ *
197
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
198
+ */
199
+ export declare const MultiColumnComboBoxPropsContext: React.Context<(p: MultiColumnComboBoxProps) => MultiColumnComboBoxProps>;
193
200
  /**
194
201
  * Represents the MultiColumnComboBox component.
202
+ *
203
+ * Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
204
+ * Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
205
+ *
195
206
  */
196
207
  export declare const MultiColumnComboBox: React.ForwardRefExoticComponent<MultiColumnComboBoxProps & React.RefAttributes<MultiColumnComboBoxHandle>>;
@@ -31,10 +31,22 @@ var columnWidth = function (width, defaultWidth) {
31
31
  }
32
32
  return defaultWidth;
33
33
  };
34
+ /**
35
+ * Represents the PropsContext of the `MultiColumnComboBox` component.
36
+ * Used for global configuration of all `MultiColumnComboBox` instances.
37
+ *
38
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
39
+ */
40
+ exports.MultiColumnComboBoxPropsContext = kendo_react_common_1.createPropsContext();
34
41
  /**
35
42
  * Represents the MultiColumnComboBox component.
43
+ *
44
+ * Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
45
+ * Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
46
+ *
36
47
  */
37
- exports.MultiColumnComboBox = React.forwardRef(function (props, ref) {
48
+ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
49
+ var props = kendo_react_common_1.usePropsContext(exports.MultiColumnComboBoxPropsContext, directProps);
38
50
  var target = React.useRef(null);
39
51
  var comboBoxRef = React.useRef(null);
40
52
  var scrollbarWidth = kendo_react_common_1.getScrollbarWidth();
@@ -103,9 +115,9 @@ exports.MultiColumnComboBox = React.forwardRef(function (props, ref) {
103
115
  var onPageChangeHandler = React.useCallback(function (event) { return handleEvent(onPageChange, event); }, [onPageChange]);
104
116
  React.useEffect(function () { kendo_react_common_1.setScrollbarWidth(); });
105
117
  var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList_1.MultiColumnList, __assign({}, listProps)); }, []);
106
- return (React.createElement(ComboBox_1.default, __assign({}, other, { list: List, popupSettings: __assign({ width: popupWidth }, popupSettings, { popupClass: 'k-dropdowngrid-popup', className: kendo_react_common_1.classNames('k-popup-flush', popupSettings.className) }), ref: comboBoxRef, header: header, itemRender: itemRender, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler })));
118
+ return (React.createElement(ComboBox_1.ComboBox, __assign({}, other, { list: List, popupSettings: __assign({ width: popupWidth }, popupSettings, { popupClass: 'k-dropdowngrid-popup', className: kendo_react_common_1.classNames('k-popup-flush', popupSettings.className) }), ref: comboBoxRef, header: header, itemRender: itemRender, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler })));
107
119
  });
108
- var propTypes = __assign({}, ComboBox_1.default.propTypes, { columns: PropTypes.any.isRequired });
120
+ var propTypes = __assign({}, ComboBox_1.ComboBoxWithoutContext.propTypes, { columns: PropTypes.any.isRequired });
109
121
  var defaultProps = {
110
122
  columns: [],
111
123
  popupSettings: {},
@@ -21,29 +21,9 @@ export interface MultiSelectState extends DropDownStateBase {
21
21
  export interface MultiSelectInternalState extends InternalState {
22
22
  data: MultiSelectState;
23
23
  }
24
- /**
25
- * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
26
- *
27
- * @example
28
- * ```jsx
29
- * class App extends React.Component {
30
- * multiselect = null;
31
- * render() {
32
- * return (
33
- * <div>
34
- * <MultiSelect
35
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
36
- * ref={component => this.multiselect = component}
37
- * />
38
- * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
39
- * </div>
40
- * );
41
- * }
42
- * }
43
- * ReactDOM.render(<App />, document.querySelector('my-app'));
44
- * ```
45
- */
46
- export default class MultiSelect extends React.Component<MultiSelectProps, MultiSelectState> implements FormComponent {
24
+ /** @hidden */
25
+ export declare class MultiSelectWithoutContext extends React.Component<MultiSelectProps, MultiSelectState> implements FormComponent {
26
+ static displayName: string;
47
27
  /**
48
28
  * @hidden
49
29
  */
@@ -68,6 +48,9 @@ export default class MultiSelect extends React.Component<MultiSelectProps, Multi
68
48
  skip: PropTypes.Validator<number>;
69
49
  total: PropTypes.Validator<number>;
70
50
  }>>;
51
+ /**
52
+ * @hidden
53
+ */
71
54
  onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
72
55
  onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
73
56
  opened: PropTypes.Requireable<boolean>;
@@ -202,3 +185,55 @@ export default class MultiSelect extends React.Component<MultiSelectProps, Multi
202
185
  private applyState;
203
186
  private setValidity;
204
187
  }
188
+ /**
189
+ * Represents the PropsContext of the `MultiSelect` component.
190
+ * Used for global configuration of all `MultiSelect` instances.
191
+ *
192
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
193
+ */
194
+ export declare const MultiSelectPropsContext: React.Context<(p: MultiSelectProps) => MultiSelectProps>;
195
+ /**
196
+ * Represent the `ref` of the MultiSelect component.
197
+ */
198
+ export interface MultiSelectHandle extends Pick<MultiSelectWithoutContext, keyof MultiSelectWithoutContext> {
199
+ /**
200
+ * Gets the `name` property of the MultiSelect.
201
+ */
202
+ name: string | undefined;
203
+ /**
204
+ * Represents the validity state into which the MultiSelect is set.
205
+ */
206
+ validity: FormComponentValidity;
207
+ /**
208
+ * Represents the value of the MultiSelect.
209
+ */
210
+ value: Array<any>;
211
+ }
212
+ /** @hidden */
213
+ export declare type MultiSelect = MultiSelectHandle;
214
+ /**
215
+ * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
216
+ *
217
+ * Accepts properties of type [MultiSelectProps]({% slug api_dropdowns_multiselectprops %}).
218
+ * Obtaining the `ref` returns an object of type [MultiSelectHandle]({% slug api_dropdowns_multiselecthandle %}).
219
+ *
220
+ * @example
221
+ * ```jsx
222
+ * class App extends React.Component {
223
+ * multiselect = null;
224
+ * render() {
225
+ * return (
226
+ * <div>
227
+ * <MultiSelect
228
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
229
+ * ref={component => this.multiselect = component}
230
+ * />
231
+ * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
232
+ * </div>
233
+ * );
234
+ * }
235
+ * }
236
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
237
+ * ```
238
+ */
239
+ export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<any>>;
@@ -46,31 +46,10 @@ var FocusedItemType;
46
46
  FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
47
47
  FocusedItemType[FocusedItemType["CustomItem"] = 2] = "CustomItem";
48
48
  })(FocusedItemType || (FocusedItemType = {}));
49
- /**
50
- * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
51
- *
52
- * @example
53
- * ```jsx
54
- * class App extends React.Component {
55
- * multiselect = null;
56
- * render() {
57
- * return (
58
- * <div>
59
- * <MultiSelect
60
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
61
- * ref={component => this.multiselect = component}
62
- * />
63
- * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
64
- * </div>
65
- * );
66
- * }
67
- * }
68
- * ReactDOM.render(<App />, document.querySelector('my-app'));
69
- * ```
70
- */
71
- var MultiSelect = /** @class */ (function (_super) {
72
- __extends(MultiSelect, _super);
73
- function MultiSelect(props) {
49
+ /** @hidden */
50
+ var MultiSelectWithoutContext = /** @class */ (function (_super) {
51
+ __extends(MultiSelectWithoutContext, _super);
52
+ function MultiSelectWithoutContext(props) {
74
53
  var _this = _super.call(this, props) || this;
75
54
  /**
76
55
  * @hidden
@@ -392,7 +371,7 @@ var MultiSelect = /** @class */ (function (_super) {
392
371
  kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
393
372
  return _this;
394
373
  }
395
- Object.defineProperty(MultiSelect.prototype, "element", {
374
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "element", {
396
375
  /**
397
376
  * @hidden
398
377
  */
@@ -402,7 +381,7 @@ var MultiSelect = /** @class */ (function (_super) {
402
381
  enumerable: true,
403
382
  configurable: true
404
383
  });
405
- Object.defineProperty(MultiSelect.prototype, "value", {
384
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "value", {
406
385
  /**
407
386
  * Represents the value of the MultiSelect.
408
387
  */
@@ -425,7 +404,7 @@ var MultiSelect = /** @class */ (function (_super) {
425
404
  enumerable: true,
426
405
  configurable: true
427
406
  });
428
- Object.defineProperty(MultiSelect.prototype, "name", {
407
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "name", {
429
408
  /**
430
409
  * Gets the `name` property of the MultiSelect.
431
410
  */
@@ -435,7 +414,7 @@ var MultiSelect = /** @class */ (function (_super) {
435
414
  enumerable: true,
436
415
  configurable: true
437
416
  });
438
- Object.defineProperty(MultiSelect.prototype, "validity", {
417
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "validity", {
439
418
  /**
440
419
  * Represents the validity state into which the MultiSelect is set.
441
420
  */
@@ -453,23 +432,23 @@ var MultiSelect = /** @class */ (function (_super) {
453
432
  enumerable: true,
454
433
  configurable: true
455
434
  });
456
- Object.defineProperty(MultiSelect.prototype, "required", {
435
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "required", {
457
436
  /**
458
437
  * @hidden
459
438
  */
460
439
  get: function () {
461
440
  return this.props.required !== undefined
462
441
  ? this.props.required
463
- : MultiSelect.defaultProps.required;
442
+ : MultiSelectWithoutContext.defaultProps.required;
464
443
  },
465
444
  enumerable: true,
466
445
  configurable: true
467
446
  });
468
- Object.defineProperty(MultiSelect.prototype, "validityStyles", {
447
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "validityStyles", {
469
448
  get: function () {
470
449
  return this.props.validityStyles !== undefined
471
450
  ? this.props.validityStyles
472
- : MultiSelect.defaultProps.validityStyles;
451
+ : MultiSelectWithoutContext.defaultProps.validityStyles;
473
452
  },
474
453
  enumerable: true,
475
454
  configurable: true
@@ -477,7 +456,7 @@ var MultiSelect = /** @class */ (function (_super) {
477
456
  /**
478
457
  * @hidden
479
458
  */
480
- MultiSelect.prototype.componentDidUpdate = function (prevProps, prevState) {
459
+ MultiSelectWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
481
460
  var virtual = this.props.virtual;
482
461
  var skip = virtual ? virtual.skip : 0;
483
462
  var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
@@ -511,14 +490,14 @@ var MultiSelect = /** @class */ (function (_super) {
511
490
  /**
512
491
  * @hidden
513
492
  */
514
- MultiSelect.prototype.componentDidMount = function () {
493
+ MultiSelectWithoutContext.prototype.componentDidMount = function () {
515
494
  this.base.didMount();
516
495
  this.setValidity();
517
496
  };
518
497
  /**
519
498
  * @hidden
520
499
  */
521
- MultiSelect.prototype.onNavigate = function (state, keyCode) {
500
+ MultiSelectWithoutContext.prototype.onNavigate = function (state, keyCode) {
522
501
  var _a = this.props, allowCustom = _a.allowCustom, _b = _a.data, data = _b === void 0 ? [] : _b;
523
502
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
524
503
  var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
@@ -549,7 +528,7 @@ var MultiSelect = /** @class */ (function (_super) {
549
528
  /**
550
529
  * @hidden
551
530
  */
552
- MultiSelect.prototype.render = function () {
531
+ MultiSelectWithoutContext.prototype.render = function () {
553
532
  var _this = this;
554
533
  var _a = this.props, style = _a.style, className = _a.className, label = _a.label, dir = _a.dir, disabled = _a.disabled, tags = _a.tags, textField = _a.textField, dataItemKey = _a.dataItemKey, virtual = _a.virtual;
555
534
  var _b = this.state, focused = _b.focused, text = _b.text, focusedTag = _b.focusedTag;
@@ -585,7 +564,7 @@ var MultiSelect = /** @class */ (function (_super) {
585
564
  this.renderListContainer()));
586
565
  return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorId: id, editorValue: text || utils_1.getItemValue(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;
587
566
  };
588
- MultiSelect.prototype.renderSearchbar = function (id) {
567
+ MultiSelectWithoutContext.prototype.renderSearchbar = function (id) {
589
568
  var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag;
590
569
  var _b = this.props, disabled = _b.disabled, placeholder = _b.placeholder, ariaDescribedBy = _b.ariaDescribedBy;
591
570
  var text = (this.props.filter !== undefined ? this.props.filter : this.state.text) || '';
@@ -598,7 +577,7 @@ var MultiSelect = /** @class */ (function (_super) {
598
577
  "option-" + this.base.guid + "-" + focusedIndex;
599
578
  return (React.createElement(SearchBar_1.default, { id: id, size: Math.max((placeholderToShow || '').length, text.length, 1), tabIndex: this.props.tabIndex, accessKey: this.props.accessKey, placeholder: placeholderToShow, value: text, onChange: this.onChangeHandler, onKeyDown: this.onInputKeyDown, ref: this.searchbarRef, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: ariaActivedescendant, ariaDescribedBy: "tagslist-" + this.base.guid + (ariaDescribedBy ? (' ' + ariaDescribedBy) : ''), clearButton: clearButton, clearButtonClick: this.clearButtonClick, loading: this.props.loading, ariaLabelledBy: this.props.ariaLabelledBy }));
600
579
  };
601
- MultiSelect.prototype.onTagsNavigate = function (event, state) {
580
+ MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {
602
581
  var keyCode = event.keyCode;
603
582
  var focusedTag = this.state.focusedTag;
604
583
  var tags = this._tags;
@@ -656,7 +635,7 @@ var MultiSelect = /** @class */ (function (_super) {
656
635
  }
657
636
  this.applyState(state);
658
637
  };
659
- MultiSelect.prototype.triggerOnChange = function (items, state) {
638
+ MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {
660
639
  if (this.props.value === undefined) {
661
640
  state.data.value = items.slice();
662
641
  }
@@ -664,7 +643,7 @@ var MultiSelect = /** @class */ (function (_super) {
664
643
  this.setItems(items, this._valueItemsDuringOnChange);
665
644
  state.events.push({ type: 'onChange' });
666
645
  };
667
- MultiSelect.prototype.selectFocusedItem = function (event) {
646
+ MultiSelectWithoutContext.prototype.selectFocusedItem = function (event) {
668
647
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual;
669
648
  var focusedIndex = this.getFocusedState().focusedIndex;
670
649
  var skip = virtual ? virtual.skip : 0;
@@ -672,11 +651,11 @@ var MultiSelect = /** @class */ (function (_super) {
672
651
  this.handleItemClick(focusedIndex, event);
673
652
  }
674
653
  };
675
- MultiSelect.prototype.setItems = function (srcItems, destItems) {
654
+ MultiSelectWithoutContext.prototype.setItems = function (srcItems, destItems) {
676
655
  destItems.length = 0;
677
656
  destItems.push.apply(destItems, srcItems);
678
657
  };
679
- MultiSelect.prototype.getFocusedState = function () {
658
+ MultiSelectWithoutContext.prototype.getFocusedState = function () {
680
659
  var focusedIndex = this.state.focusedIndex;
681
660
  var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
682
661
  var _a = this.props, allowCustom = _a.allowCustom, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual, textField = _a.textField, _c = _a.focusedItemIndex, focusedItemIndex = _c === void 0 ? utils_1.itemIndexStartsWith : _c;
@@ -717,27 +696,63 @@ var MultiSelect = /** @class */ (function (_super) {
717
696
  { focusedItem: data[0], focusedIndex: 0, focusedType: FocusedItemType.ListItem } :
718
697
  { focusedType: FocusedItemType.None, focusedIndex: -1 };
719
698
  };
720
- MultiSelect.prototype.focusElement = function (element) {
699
+ MultiSelectWithoutContext.prototype.focusElement = function (element) {
721
700
  var _this = this;
722
701
  this._skipFocusEvent = true;
723
702
  element.focus();
724
703
  window.setTimeout(function () { return _this._skipFocusEvent = false; }, 0);
725
704
  };
726
- MultiSelect.prototype.applyState = function (state) {
705
+ MultiSelectWithoutContext.prototype.applyState = function (state) {
727
706
  this.base.applyState(state);
728
707
  this._valueItemsDuringOnChange = null;
729
708
  };
709
+ MultiSelectWithoutContext.displayName = 'MultiSelect';
730
710
  /**
731
711
  * @hidden
732
712
  */
733
- MultiSelect.propTypes = __assign({}, DropDownBase_1.default.propTypes, { autoClose: PropTypes.bool, value: PropTypes.arrayOf(PropTypes.any), defaultValue: PropTypes.arrayOf(PropTypes.any), dataItemKey: PropTypes.string, placeholder: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.shape({
713
+ MultiSelectWithoutContext.propTypes = __assign({}, DropDownBase_1.default.propTypes, { autoClose: PropTypes.bool, value: PropTypes.arrayOf(PropTypes.any), defaultValue: PropTypes.arrayOf(PropTypes.any), dataItemKey: PropTypes.string, placeholder: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.shape({
734
714
  text: PropTypes.string,
735
715
  data: PropTypes.arrayOf(PropTypes.any)
736
716
  })), tagRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
737
717
  /**
738
718
  * @hidden
739
719
  */
740
- MultiSelect.defaultProps = __assign({}, DropDownBase_1.default.defaultProps, { autoClose: true, required: false });
741
- return MultiSelect;
720
+ MultiSelectWithoutContext.defaultProps = __assign({}, DropDownBase_1.default.defaultProps, { autoClose: true, required: false });
721
+ return MultiSelectWithoutContext;
742
722
  }(React.Component));
743
- exports.default = MultiSelect;
723
+ exports.MultiSelectWithoutContext = MultiSelectWithoutContext;
724
+ /**
725
+ * Represents the PropsContext of the `MultiSelect` component.
726
+ * Used for global configuration of all `MultiSelect` instances.
727
+ *
728
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
729
+ */
730
+ exports.MultiSelectPropsContext = kendo_react_common_1.createPropsContext();
731
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
732
+ /**
733
+ * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
734
+ *
735
+ * Accepts properties of type [MultiSelectProps]({% slug api_dropdowns_multiselectprops %}).
736
+ * Obtaining the `ref` returns an object of type [MultiSelectHandle]({% slug api_dropdowns_multiselecthandle %}).
737
+ *
738
+ * @example
739
+ * ```jsx
740
+ * class App extends React.Component {
741
+ * multiselect = null;
742
+ * render() {
743
+ * return (
744
+ * <div>
745
+ * <MultiSelect
746
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
747
+ * ref={component => this.multiselect = component}
748
+ * />
749
+ * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
750
+ * </div>
751
+ * );
752
+ * }
753
+ * }
754
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
755
+ * ```
756
+ */
757
+ exports.MultiSelect = kendo_react_common_1.withPropsContext(exports.MultiSelectPropsContext, MultiSelectWithoutContext);
758
+ exports.MultiSelect.displayName = 'KendoReactMultiSelect';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import MultiSelect from './MultiSelect';
2
+ import { MultiSelect } from './MultiSelect';
3
3
  import { FormComponentProps } from '@progress/kendo-react-common';
4
4
  import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent } from './../common/events';
5
5
  import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
@@ -1,6 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { MultiSelectTreeProps, MultiSelectTreeHandle } from './MultiSelectTreeProps';
3
+ /**
4
+ * Represents the PropsContext of the `MultiSelectTree` component.
5
+ * Used for global configuration of all `MultiSelectTree` instances.
6
+ *
7
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
8
+ */
9
+ export declare const MultiSelectTreePropsContext: React.Context<(p: MultiSelectTreeProps) => MultiSelectTreeProps>;
3
10
  /**
4
11
  * Represents the MultiSelectTree component.
12
+ *
13
+ * Accepts properties of type [MultiSelectTreeProps]({% slug api_dropdowns_multiselecttreeprops %}).
14
+ * Obtaining the `ref` returns an object of type [MultiSelectTreeHandle]({% slug api_dropdowns_multiselecttreehandle %}).
5
15
  */
6
16
  export declare const MultiSelectTree: React.ForwardRefExoticComponent<MultiSelectTreeProps & React.RefAttributes<MultiSelectTreeHandle>>;
@@ -49,10 +49,21 @@ var defaultProps = {
49
49
  required: false,
50
50
  validityStyles: true
51
51
  };
52
+ /**
53
+ * Represents the PropsContext of the `MultiSelectTree` component.
54
+ * Used for global configuration of all `MultiSelectTree` instances.
55
+ *
56
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
57
+ */
58
+ exports.MultiSelectTreePropsContext = kendo_react_common_1.createPropsContext();
52
59
  /**
53
60
  * Represents the MultiSelectTree component.
61
+ *
62
+ * Accepts properties of type [MultiSelectTreeProps]({% slug api_dropdowns_multiselecttreeprops %}).
63
+ * Obtaining the `ref` returns an object of type [MultiSelectTreeHandle]({% slug api_dropdowns_multiselecttreehandle %}).
54
64
  */
55
- exports.MultiSelectTree = React.forwardRef(function (props, ref) {
65
+ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
66
+ var props = kendo_react_common_1.usePropsContext(exports.MultiSelectTreePropsContext, directProps);
56
67
  kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
57
68
  var componentGuid = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
58
69
  var id = props.id || componentGuid;
@@ -1,19 +1,19 @@
1
1
  import { FormComponentValidity } from '@progress/kendo-react-common';
2
- import DropDownList from './DropDownList/DropDownList';
2
+ import { DropDownList, DropDownListHandle, DropDownListPropsContext } from './DropDownList/DropDownList';
3
3
  import { DropDownListProps, DropDownListFilterChangeEvent, DropDownListChangeEvent, DropDownListOpenEvent, DropDownListCloseEvent, DropDownListFocusEvent, DropDownListBlurEvent, DropDownListPageChangeEvent } from './DropDownList/DropDownListProps';
4
4
  import { Page, VirtualizationSettings, DropDownsPopupSettings, Suggestion } from './common/settings';
5
5
  import { ListItemProps } from './common/ListItem';
6
- import ComboBox from './ComboBox/ComboBox';
6
+ import { ComboBox, ComboBoxPropsContext, ComboBoxHandle } from './ComboBox/ComboBox';
7
7
  import { ComboBoxProps, ComboBoxFilterChangeEvent, ComboBoxChangeEvent, ComboBoxOpenEvent, ComboBoxCloseEvent, ComboBoxFocusEvent, ComboBoxBlurEvent, ComboBoxPageChangeEvent } from './ComboBox/ComboBoxProps';
8
- import AutoComplete from './AutoComplete/AutoComplete';
8
+ import { AutoComplete, AutoCompleteHandle, AutoCompletePropsContext } from './AutoComplete/AutoComplete';
9
9
  import { AutoCompleteProps, AutoCompleteChangeEvent, AutoCompleteOpenEvent, AutoCompleteCloseEvent, AutoCompleteFocusEvent, AutoCompleteBlurEvent } from './AutoComplete/AutoCompleteProps';
10
- import MultiSelect from './MultiSelect/MultiSelect';
10
+ import { MultiSelect, MultiSelectHandle, MultiSelectPropsContext } from './MultiSelect/MultiSelect';
11
11
  import { MultiSelectProps, MultiSelectChangeEvent, MultiSelectPageChangeEvent, MultiSelectFilterChangeEvent, MultiSelectOpenEvent, MultiSelectCloseEvent, MultiSelectFocusEvent, MultiSelectBlurEvent } from './MultiSelect/MultiSelectProps';
12
12
  import { TagData as MultiSelectTagData, TagData } from './MultiSelect/TagList';
13
- import { MultiColumnComboBox, MultiColumnComboBoxProps, MultiColumnComboBoxHandle, MultiColumnComboBoxColumn, MultiColumnComboBoxChangeEvent } from './MultiColumnComboBox/MultiColumnComboBox';
14
- import { DropDownTree } from './DropDownTree/DropDownTree';
13
+ import { MultiColumnComboBox, MultiColumnComboBoxPropsContext, MultiColumnComboBoxProps, MultiColumnComboBoxHandle, MultiColumnComboBoxColumn, MultiColumnComboBoxChangeEvent } from './MultiColumnComboBox/MultiColumnComboBox';
14
+ import { DropDownTree, DropDownTreePropsContext } from './DropDownTree/DropDownTree';
15
15
  export * from './DropDownTree/DropDownTreeProps';
16
- import { MultiSelectTree } from './MultiSelectTree/MultiSelectTree';
16
+ import { MultiSelectTree, MultiSelectTreePropsContext } from './MultiSelectTree/MultiSelectTree';
17
17
  export * from './MultiSelectTree/MultiSelectTreeProps';
18
18
  export * from './MultiSelectTree/utils';
19
- export { AutoComplete, AutoCompleteProps, AutoCompleteChangeEvent, AutoCompleteOpenEvent, AutoCompleteCloseEvent, AutoCompleteFocusEvent, AutoCompleteBlurEvent, DropDownList, DropDownListProps, DropDownListFilterChangeEvent, DropDownListChangeEvent, DropDownListOpenEvent, DropDownListCloseEvent, DropDownListFocusEvent, DropDownListBlurEvent, DropDownListPageChangeEvent, Page, VirtualizationSettings, DropDownsPopupSettings, ListItemProps, Suggestion, ComboBox, ComboBoxProps, ComboBoxFilterChangeEvent, ComboBoxChangeEvent, ComboBoxOpenEvent, ComboBoxCloseEvent, ComboBoxFocusEvent, ComboBoxBlurEvent, ComboBoxPageChangeEvent, MultiSelect, MultiSelectProps, MultiSelectChangeEvent, MultiSelectPageChangeEvent, MultiSelectFilterChangeEvent, MultiSelectOpenEvent, MultiSelectCloseEvent, MultiSelectFocusEvent, MultiSelectBlurEvent, MultiSelectTagData, FormComponentValidity, MultiColumnComboBox, MultiColumnComboBoxColumn, MultiColumnComboBoxProps, MultiColumnComboBoxHandle, MultiColumnComboBoxChangeEvent, DropDownTree, MultiSelectTree, TagData };
19
+ export { AutoComplete, AutoCompleteHandle, AutoCompleteProps, AutoCompletePropsContext, AutoCompleteChangeEvent, AutoCompleteOpenEvent, AutoCompleteCloseEvent, AutoCompleteFocusEvent, AutoCompleteBlurEvent, DropDownList, DropDownListHandle, DropDownListProps, DropDownListPropsContext, DropDownListFilterChangeEvent, DropDownListChangeEvent, DropDownListOpenEvent, DropDownListCloseEvent, DropDownListFocusEvent, DropDownListBlurEvent, DropDownListPageChangeEvent, Page, VirtualizationSettings, DropDownsPopupSettings, ListItemProps, Suggestion, ComboBox, ComboBoxHandle, ComboBoxProps, ComboBoxPropsContext, ComboBoxFilterChangeEvent, ComboBoxChangeEvent, ComboBoxOpenEvent, ComboBoxCloseEvent, ComboBoxFocusEvent, ComboBoxBlurEvent, ComboBoxPageChangeEvent, MultiSelect, MultiSelectHandle, MultiSelectProps, MultiSelectPropsContext, MultiSelectChangeEvent, MultiSelectPageChangeEvent, MultiSelectFilterChangeEvent, MultiSelectOpenEvent, MultiSelectCloseEvent, MultiSelectFocusEvent, MultiSelectBlurEvent, MultiSelectTagData, FormComponentValidity, MultiColumnComboBox, MultiColumnComboBoxColumn, MultiColumnComboBoxProps, MultiColumnComboBoxPropsContext, MultiColumnComboBoxHandle, MultiColumnComboBoxChangeEvent, DropDownTree, DropDownTreePropsContext, MultiSelectTree, MultiSelectTreePropsContext, TagData };
package/dist/npm/main.js CHANGED
@@ -4,17 +4,24 @@ function __export(m) {
4
4
  }
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var DropDownList_1 = require("./DropDownList/DropDownList");
7
- exports.DropDownList = DropDownList_1.default;
7
+ exports.DropDownList = DropDownList_1.DropDownList;
8
+ exports.DropDownListPropsContext = DropDownList_1.DropDownListPropsContext;
8
9
  var ComboBox_1 = require("./ComboBox/ComboBox");
9
- exports.ComboBox = ComboBox_1.default;
10
+ exports.ComboBox = ComboBox_1.ComboBox;
11
+ exports.ComboBoxPropsContext = ComboBox_1.ComboBoxPropsContext;
10
12
  var AutoComplete_1 = require("./AutoComplete/AutoComplete");
11
- exports.AutoComplete = AutoComplete_1.default;
13
+ exports.AutoComplete = AutoComplete_1.AutoComplete;
14
+ exports.AutoCompletePropsContext = AutoComplete_1.AutoCompletePropsContext;
12
15
  var MultiSelect_1 = require("./MultiSelect/MultiSelect");
13
- exports.MultiSelect = MultiSelect_1.default;
16
+ exports.MultiSelect = MultiSelect_1.MultiSelect;
17
+ exports.MultiSelectPropsContext = MultiSelect_1.MultiSelectPropsContext;
14
18
  var MultiColumnComboBox_1 = require("./MultiColumnComboBox/MultiColumnComboBox");
15
19
  exports.MultiColumnComboBox = MultiColumnComboBox_1.MultiColumnComboBox;
20
+ exports.MultiColumnComboBoxPropsContext = MultiColumnComboBox_1.MultiColumnComboBoxPropsContext;
16
21
  var DropDownTree_1 = require("./DropDownTree/DropDownTree");
17
22
  exports.DropDownTree = DropDownTree_1.DropDownTree;
23
+ exports.DropDownTreePropsContext = DropDownTree_1.DropDownTreePropsContext;
18
24
  var MultiSelectTree_1 = require("./MultiSelectTree/MultiSelectTree");
19
25
  exports.MultiSelectTree = MultiSelectTree_1.MultiSelectTree;
26
+ exports.MultiSelectTreePropsContext = MultiSelectTree_1.MultiSelectTreePropsContext;
20
27
  __export(require("./MultiSelectTree/utils"));
@@ -7,7 +7,7 @@ exports.packageMetadata = {
7
7
  name: '@progress/kendo-react-dropdowns',
8
8
  productName: 'KendoReact',
9
9
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
10
- publishDate: 1638196763,
10
+ publishDate: 1638254452,
11
11
  version: '',
12
12
  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'
13
13
  };