@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
@@ -1,6 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { DropDownTreeProps, DropDownTreeHandle } from './DropDownTreeProps';
3
+ /**
4
+ * Represents the PropsContext of the `DropDownTree` component.
5
+ * Used for global configuration of all `DropDownTree` instances.
6
+ *
7
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
8
+ */
9
+ export declare const DropDownTreePropsContext: React.Context<(p: DropDownTreeProps) => DropDownTreeProps>;
3
10
  /**
4
11
  * Represents the DropDownTree component.
12
+ *
13
+ * Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
14
+ * Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
5
15
  */
6
16
  export declare const DropDownTree: React.ForwardRefExoticComponent<DropDownTreeProps & React.RefAttributes<DropDownTreeHandle>>;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import * as React from 'react';
13
13
  import * as PropTypes from 'prop-types';
14
- import { classNames, noop, useRtl, getTabIndex, Keys, mapTree, extendDataItem, guid } from '@progress/kendo-react-common';
14
+ import { classNames, noop, useRtl, getTabIndex, Keys, mapTree, extendDataItem, guid, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
15
15
  import { Popup } from '@progress/kendo-react-popup';
16
16
  import { useLocalization } from '@progress/kendo-react-intl';
17
17
  import { TreeView } from '@progress/kendo-react-treeview';
@@ -46,11 +46,22 @@ var defaultProps = {
46
46
  required: false,
47
47
  validityStyles: true
48
48
  };
49
+ /**
50
+ * Represents the PropsContext of the `DropDownTree` component.
51
+ * Used for global configuration of all `DropDownTree` instances.
52
+ *
53
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
54
+ */
55
+ export var DropDownTreePropsContext = createPropsContext();
49
56
  /**
50
57
  * Represents the DropDownTree component.
58
+ *
59
+ * Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
60
+ * Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
51
61
  */
52
- export var DropDownTree = React.forwardRef(function (props, ref) {
62
+ export var DropDownTree = React.forwardRef(function (directProps, ref) {
53
63
  validatePackage(packageMetadata);
64
+ var props = usePropsContext(DropDownTreePropsContext, directProps);
54
65
  var calculatedId = React.useMemo(function () { return guid(); }, []);
55
66
  var id = props.id || calculatedId;
56
67
  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 ? noop : _d, _e = props.onClose, onClose = _e === void 0 ? 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>>;
@@ -21,18 +21,30 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  import * as React from 'react';
22
22
  import * as PropTypes from 'prop-types';
23
23
  import { MultiColumnList } from './../common/MultiColumnList';
24
- import { classNames, getScrollbarWidth, setScrollbarWidth, getter } from '@progress/kendo-react-common';
25
- import ComboBox from '../ComboBox/ComboBox';
24
+ import { classNames, getScrollbarWidth, setScrollbarWidth, getter, usePropsContext, createPropsContext } from '@progress/kendo-react-common';
25
+ import { ComboBox, ComboBoxWithoutContext } from '../ComboBox/ComboBox';
26
26
  var columnWidth = function (width, defaultWidth) {
27
27
  if (width) {
28
28
  return typeof width === 'number' ? width + 'px' : width;
29
29
  }
30
30
  return defaultWidth;
31
31
  };
32
+ /**
33
+ * Represents the PropsContext of the `MultiColumnComboBox` component.
34
+ * Used for global configuration of all `MultiColumnComboBox` instances.
35
+ *
36
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
37
+ */
38
+ export var MultiColumnComboBoxPropsContext = createPropsContext();
32
39
  /**
33
40
  * Represents the MultiColumnComboBox component.
41
+ *
42
+ * Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
43
+ * Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
44
+ *
34
45
  */
35
- export var MultiColumnComboBox = React.forwardRef(function (props, ref) {
46
+ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
47
+ var props = usePropsContext(MultiColumnComboBoxPropsContext, directProps);
36
48
  var target = React.useRef(null);
37
49
  var comboBoxRef = React.useRef(null);
38
50
  var scrollbarWidth = getScrollbarWidth();
@@ -103,7 +115,7 @@ export var MultiColumnComboBox = React.forwardRef(function (props, ref) {
103
115
  var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList, __assign({}, listProps)); }, []);
104
116
  return (React.createElement(ComboBox, __assign({}, other, { list: List, popupSettings: __assign({ width: popupWidth }, popupSettings, { popupClass: 'k-dropdowngrid-popup', className: 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 })));
105
117
  });
106
- var propTypes = __assign({}, ComboBox.propTypes, { columns: PropTypes.any.isRequired });
118
+ var propTypes = __assign({}, ComboBoxWithoutContext.propTypes, { columns: PropTypes.any.isRequired });
107
119
  var defaultProps = {
108
120
  columns: [],
109
121
  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>>;
@@ -24,7 +24,7 @@ var __assign = (this && this.__assign) || function () {
24
24
  };
25
25
  import * as React from 'react';
26
26
  import * as PropTypes from 'prop-types';
27
- import { classNames, Keys, guid } from '@progress/kendo-react-common';
27
+ import { classNames, Keys, guid, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
28
28
  import { FloatingLabel } from '@progress/kendo-react-labels';
29
29
  import ListContainer from '../common/ListContainer';
30
30
  import List from '../common/List';
@@ -44,31 +44,10 @@ var FocusedItemType;
44
44
  FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
45
45
  FocusedItemType[FocusedItemType["CustomItem"] = 2] = "CustomItem";
46
46
  })(FocusedItemType || (FocusedItemType = {}));
47
- /**
48
- * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
49
- *
50
- * @example
51
- * ```jsx
52
- * class App extends React.Component {
53
- * multiselect = null;
54
- * render() {
55
- * return (
56
- * <div>
57
- * <MultiSelect
58
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
59
- * ref={component => this.multiselect = component}
60
- * />
61
- * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
62
- * </div>
63
- * );
64
- * }
65
- * }
66
- * ReactDOM.render(<App />, document.querySelector('my-app'));
67
- * ```
68
- */
69
- var MultiSelect = /** @class */ (function (_super) {
70
- __extends(MultiSelect, _super);
71
- function MultiSelect(props) {
47
+ /** @hidden */
48
+ var MultiSelectWithoutContext = /** @class */ (function (_super) {
49
+ __extends(MultiSelectWithoutContext, _super);
50
+ function MultiSelectWithoutContext(props) {
72
51
  var _this = _super.call(this, props) || this;
73
52
  /**
74
53
  * @hidden
@@ -390,7 +369,7 @@ var MultiSelect = /** @class */ (function (_super) {
390
369
  validatePackage(packageMetadata);
391
370
  return _this;
392
371
  }
393
- Object.defineProperty(MultiSelect.prototype, "element", {
372
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "element", {
394
373
  /**
395
374
  * @hidden
396
375
  */
@@ -400,7 +379,7 @@ var MultiSelect = /** @class */ (function (_super) {
400
379
  enumerable: true,
401
380
  configurable: true
402
381
  });
403
- Object.defineProperty(MultiSelect.prototype, "value", {
382
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "value", {
404
383
  /**
405
384
  * Represents the value of the MultiSelect.
406
385
  */
@@ -423,7 +402,7 @@ var MultiSelect = /** @class */ (function (_super) {
423
402
  enumerable: true,
424
403
  configurable: true
425
404
  });
426
- Object.defineProperty(MultiSelect.prototype, "name", {
405
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "name", {
427
406
  /**
428
407
  * Gets the `name` property of the MultiSelect.
429
408
  */
@@ -433,7 +412,7 @@ var MultiSelect = /** @class */ (function (_super) {
433
412
  enumerable: true,
434
413
  configurable: true
435
414
  });
436
- Object.defineProperty(MultiSelect.prototype, "validity", {
415
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "validity", {
437
416
  /**
438
417
  * Represents the validity state into which the MultiSelect is set.
439
418
  */
@@ -451,23 +430,23 @@ var MultiSelect = /** @class */ (function (_super) {
451
430
  enumerable: true,
452
431
  configurable: true
453
432
  });
454
- Object.defineProperty(MultiSelect.prototype, "required", {
433
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "required", {
455
434
  /**
456
435
  * @hidden
457
436
  */
458
437
  get: function () {
459
438
  return this.props.required !== undefined
460
439
  ? this.props.required
461
- : MultiSelect.defaultProps.required;
440
+ : MultiSelectWithoutContext.defaultProps.required;
462
441
  },
463
442
  enumerable: true,
464
443
  configurable: true
465
444
  });
466
- Object.defineProperty(MultiSelect.prototype, "validityStyles", {
445
+ Object.defineProperty(MultiSelectWithoutContext.prototype, "validityStyles", {
467
446
  get: function () {
468
447
  return this.props.validityStyles !== undefined
469
448
  ? this.props.validityStyles
470
- : MultiSelect.defaultProps.validityStyles;
449
+ : MultiSelectWithoutContext.defaultProps.validityStyles;
471
450
  },
472
451
  enumerable: true,
473
452
  configurable: true
@@ -475,7 +454,7 @@ var MultiSelect = /** @class */ (function (_super) {
475
454
  /**
476
455
  * @hidden
477
456
  */
478
- MultiSelect.prototype.componentDidUpdate = function (prevProps, prevState) {
457
+ MultiSelectWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
479
458
  var virtual = this.props.virtual;
480
459
  var skip = virtual ? virtual.skip : 0;
481
460
  var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
@@ -509,14 +488,14 @@ var MultiSelect = /** @class */ (function (_super) {
509
488
  /**
510
489
  * @hidden
511
490
  */
512
- MultiSelect.prototype.componentDidMount = function () {
491
+ MultiSelectWithoutContext.prototype.componentDidMount = function () {
513
492
  this.base.didMount();
514
493
  this.setValidity();
515
494
  };
516
495
  /**
517
496
  * @hidden
518
497
  */
519
- MultiSelect.prototype.onNavigate = function (state, keyCode) {
498
+ MultiSelectWithoutContext.prototype.onNavigate = function (state, keyCode) {
520
499
  var _a = this.props, allowCustom = _a.allowCustom, _b = _a.data, data = _b === void 0 ? [] : _b;
521
500
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
522
501
  var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
@@ -547,7 +526,7 @@ var MultiSelect = /** @class */ (function (_super) {
547
526
  /**
548
527
  * @hidden
549
528
  */
550
- MultiSelect.prototype.render = function () {
529
+ MultiSelectWithoutContext.prototype.render = function () {
551
530
  var _this = this;
552
531
  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;
553
532
  var _b = this.state, focused = _b.focused, text = _b.text, focusedTag = _b.focusedTag;
@@ -583,7 +562,7 @@ var MultiSelect = /** @class */ (function (_super) {
583
562
  this.renderListContainer()));
584
563
  return label ? (React.createElement(FloatingLabel, { label: label, editorId: id, editorValue: text || getItemValue(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;
585
564
  };
586
- MultiSelect.prototype.renderSearchbar = function (id) {
565
+ MultiSelectWithoutContext.prototype.renderSearchbar = function (id) {
587
566
  var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag;
588
567
  var _b = this.props, disabled = _b.disabled, placeholder = _b.placeholder, ariaDescribedBy = _b.ariaDescribedBy;
589
568
  var text = (this.props.filter !== undefined ? this.props.filter : this.state.text) || '';
@@ -596,7 +575,7 @@ var MultiSelect = /** @class */ (function (_super) {
596
575
  "option-" + this.base.guid + "-" + focusedIndex;
597
576
  return (React.createElement(SearchBar, { 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 }));
598
577
  };
599
- MultiSelect.prototype.onTagsNavigate = function (event, state) {
578
+ MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {
600
579
  var keyCode = event.keyCode;
601
580
  var focusedTag = this.state.focusedTag;
602
581
  var tags = this._tags;
@@ -654,7 +633,7 @@ var MultiSelect = /** @class */ (function (_super) {
654
633
  }
655
634
  this.applyState(state);
656
635
  };
657
- MultiSelect.prototype.triggerOnChange = function (items, state) {
636
+ MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {
658
637
  if (this.props.value === undefined) {
659
638
  state.data.value = items.slice();
660
639
  }
@@ -662,7 +641,7 @@ var MultiSelect = /** @class */ (function (_super) {
662
641
  this.setItems(items, this._valueItemsDuringOnChange);
663
642
  state.events.push({ type: 'onChange' });
664
643
  };
665
- MultiSelect.prototype.selectFocusedItem = function (event) {
644
+ MultiSelectWithoutContext.prototype.selectFocusedItem = function (event) {
666
645
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual;
667
646
  var focusedIndex = this.getFocusedState().focusedIndex;
668
647
  var skip = virtual ? virtual.skip : 0;
@@ -670,11 +649,11 @@ var MultiSelect = /** @class */ (function (_super) {
670
649
  this.handleItemClick(focusedIndex, event);
671
650
  }
672
651
  };
673
- MultiSelect.prototype.setItems = function (srcItems, destItems) {
652
+ MultiSelectWithoutContext.prototype.setItems = function (srcItems, destItems) {
674
653
  destItems.length = 0;
675
654
  destItems.push.apply(destItems, srcItems);
676
655
  };
677
- MultiSelect.prototype.getFocusedState = function () {
656
+ MultiSelectWithoutContext.prototype.getFocusedState = function () {
678
657
  var focusedIndex = this.state.focusedIndex;
679
658
  var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
680
659
  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 ? itemIndexStartsWith : _c;
@@ -715,27 +694,63 @@ var MultiSelect = /** @class */ (function (_super) {
715
694
  { focusedItem: data[0], focusedIndex: 0, focusedType: FocusedItemType.ListItem } :
716
695
  { focusedType: FocusedItemType.None, focusedIndex: -1 };
717
696
  };
718
- MultiSelect.prototype.focusElement = function (element) {
697
+ MultiSelectWithoutContext.prototype.focusElement = function (element) {
719
698
  var _this = this;
720
699
  this._skipFocusEvent = true;
721
700
  element.focus();
722
701
  window.setTimeout(function () { return _this._skipFocusEvent = false; }, 0);
723
702
  };
724
- MultiSelect.prototype.applyState = function (state) {
703
+ MultiSelectWithoutContext.prototype.applyState = function (state) {
725
704
  this.base.applyState(state);
726
705
  this._valueItemsDuringOnChange = null;
727
706
  };
707
+ MultiSelectWithoutContext.displayName = 'MultiSelect';
728
708
  /**
729
709
  * @hidden
730
710
  */
731
- MultiSelect.propTypes = __assign({}, DropDownBase.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({
711
+ MultiSelectWithoutContext.propTypes = __assign({}, DropDownBase.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({
732
712
  text: PropTypes.string,
733
713
  data: PropTypes.arrayOf(PropTypes.any)
734
714
  })), tagRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
735
715
  /**
736
716
  * @hidden
737
717
  */
738
- MultiSelect.defaultProps = __assign({}, DropDownBase.defaultProps, { autoClose: true, required: false });
739
- return MultiSelect;
718
+ MultiSelectWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps, { autoClose: true, required: false });
719
+ return MultiSelectWithoutContext;
740
720
  }(React.Component));
741
- export default MultiSelect;
721
+ export { MultiSelectWithoutContext };
722
+ /**
723
+ * Represents the PropsContext of the `MultiSelect` component.
724
+ * Used for global configuration of all `MultiSelect` instances.
725
+ *
726
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
727
+ */
728
+ export var MultiSelectPropsContext = createPropsContext();
729
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
730
+ /**
731
+ * Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
732
+ *
733
+ * Accepts properties of type [MultiSelectProps]({% slug api_dropdowns_multiselectprops %}).
734
+ * Obtaining the `ref` returns an object of type [MultiSelectHandle]({% slug api_dropdowns_multiselecthandle %}).
735
+ *
736
+ * @example
737
+ * ```jsx
738
+ * class App extends React.Component {
739
+ * multiselect = null;
740
+ * render() {
741
+ * return (
742
+ * <div>
743
+ * <MultiSelect
744
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
745
+ * ref={component => this.multiselect = component}
746
+ * />
747
+ * <button onClick={() => alert(this.multiselect.value)}>alert value</button>
748
+ * </div>
749
+ * );
750
+ * }
751
+ * }
752
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
753
+ * ```
754
+ */
755
+ export var MultiSelect = withPropsContext(MultiSelectPropsContext, MultiSelectWithoutContext);
756
+ 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>>;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import * as React from 'react';
13
13
  import * as PropTypes from 'prop-types';
14
- import { classNames, noop, useRtl, getTabIndex, Keys, guid } from '@progress/kendo-react-common';
14
+ import { classNames, noop, useRtl, getTabIndex, Keys, guid, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
15
15
  import { Popup } from '@progress/kendo-react-popup';
16
16
  import { useLocalization } from '@progress/kendo-react-intl';
17
17
  import { TreeView } from '@progress/kendo-react-treeview';
@@ -47,10 +47,21 @@ var defaultProps = {
47
47
  required: false,
48
48
  validityStyles: true
49
49
  };
50
+ /**
51
+ * Represents the PropsContext of the `MultiSelectTree` component.
52
+ * Used for global configuration of all `MultiSelectTree` instances.
53
+ *
54
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
55
+ */
56
+ export var MultiSelectTreePropsContext = createPropsContext();
50
57
  /**
51
58
  * Represents the MultiSelectTree component.
59
+ *
60
+ * Accepts properties of type [MultiSelectTreeProps]({% slug api_dropdowns_multiselecttreeprops %}).
61
+ * Obtaining the `ref` returns an object of type [MultiSelectTreeHandle]({% slug api_dropdowns_multiselecttreehandle %}).
52
62
  */
53
- export var MultiSelectTree = React.forwardRef(function (props, ref) {
63
+ export var MultiSelectTree = React.forwardRef(function (directProps, ref) {
64
+ var props = usePropsContext(MultiSelectTreePropsContext, directProps);
54
65
  validatePackage(packageMetadata);
55
66
  var componentGuid = React.useMemo(function () { return guid(); }, []);
56
67
  var id = props.id || componentGuid;
package/dist/es/main.d.ts CHANGED
@@ -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/es/main.js CHANGED
@@ -1,9 +1,9 @@
1
- import DropDownList from './DropDownList/DropDownList';
2
- import ComboBox from './ComboBox/ComboBox';
3
- import AutoComplete from './AutoComplete/AutoComplete';
4
- import MultiSelect from './MultiSelect/MultiSelect';
5
- import { MultiColumnComboBox } from './MultiColumnComboBox/MultiColumnComboBox';
6
- import { DropDownTree } from './DropDownTree/DropDownTree';
7
- import { MultiSelectTree } from './MultiSelectTree/MultiSelectTree';
1
+ import { DropDownList, DropDownListPropsContext } from './DropDownList/DropDownList';
2
+ import { ComboBox, ComboBoxPropsContext } from './ComboBox/ComboBox';
3
+ import { AutoComplete, AutoCompletePropsContext } from './AutoComplete/AutoComplete';
4
+ import { MultiSelect, MultiSelectPropsContext } from './MultiSelect/MultiSelect';
5
+ import { MultiColumnComboBox, MultiColumnComboBoxPropsContext } from './MultiColumnComboBox/MultiColumnComboBox';
6
+ import { DropDownTree, DropDownTreePropsContext } from './DropDownTree/DropDownTree';
7
+ import { MultiSelectTree, MultiSelectTreePropsContext } from './MultiSelectTree/MultiSelectTree';
8
8
  export * from './MultiSelectTree/utils';
9
- export { AutoComplete, DropDownList, ComboBox, MultiSelect, MultiColumnComboBox, DropDownTree, MultiSelectTree };
9
+ export { AutoComplete, AutoCompletePropsContext, DropDownList, DropDownListPropsContext, ComboBox, ComboBoxPropsContext, MultiSelect, MultiSelectPropsContext, MultiColumnComboBox, MultiColumnComboBoxPropsContext, DropDownTree, DropDownTreePropsContext, MultiSelectTree, MultiSelectTreePropsContext };
@@ -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: 1638196763,
8
+ publishDate: 1638254452,
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
  };