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

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
@@ -17,29 +17,9 @@ export interface AutoCompleteState extends DropDownStateBase {
17
17
  export interface AutoCompleteInternalState extends InternalState {
18
18
  data: AutoCompleteState;
19
19
  }
20
- /**
21
- * Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
22
- *
23
- * @example
24
- * ```jsx
25
- * class App extends React.Component {
26
- * autocomplete = null;
27
- * render() {
28
- * return (
29
- * <div>
30
- * <AutoComplete
31
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
32
- * ref={component => this.autocomplete = component}
33
- * />
34
- * <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
35
- * </div>
36
- * );
37
- * }
38
- * }
39
- * ReactDOM.render(<App />, document.querySelector('my-app'));
40
- * ```
41
- */
42
- export default class AutoComplete extends React.Component<AutoCompleteProps, AutoCompleteState> implements FormComponent {
20
+ /** @hidden */
21
+ export declare class AutoCompleteWithoutContext extends React.Component<AutoCompleteProps, AutoCompleteState> implements FormComponent {
22
+ static displayName: string;
43
23
  /**
44
24
  * @hidden
45
25
  */
@@ -75,6 +55,9 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, Aut
75
55
  className: PropTypes.Requireable<string>;
76
56
  appendTo: PropTypes.Requireable<any>;
77
57
  width: PropTypes.Requireable<string | number>;
58
+ /**
59
+ * @hidden
60
+ */
78
61
  height: PropTypes.Requireable<string | number>;
79
62
  }>>;
80
63
  onOpen: PropTypes.Requireable<(...args: any[]) => any>;
@@ -183,3 +166,55 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, Aut
183
166
  private suggestValue;
184
167
  private focusedIndex;
185
168
  }
169
+ /**
170
+ * Represents the PropsContext of the `AutoComplete` component.
171
+ * Used for global configuration of all `AutoComplete` instances.
172
+ *
173
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
174
+ */
175
+ export declare const AutoCompletePropsContext: React.Context<(p: AutoCompleteProps) => AutoCompleteProps>;
176
+ /**
177
+ * Represent the `ref` of the AutoComplete component.
178
+ */
179
+ export interface AutoCompleteHandle extends Pick<AutoCompleteWithoutContext, keyof AutoCompleteWithoutContext> {
180
+ /**
181
+ * Gets the `name` property of the AutoComplete.
182
+ */
183
+ name: string | undefined;
184
+ /**
185
+ * Represents the validity state into which the AutoComplete is set.
186
+ */
187
+ validity: FormComponentValidity;
188
+ /**
189
+ * The value of the AutoComplete.
190
+ */
191
+ value: string;
192
+ }
193
+ /** @hidden */
194
+ export declare type AutoComplete = AutoCompleteHandle;
195
+ /**
196
+ * Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
197
+ *
198
+ * Accepts properties of type [AutoCompleteProps]({% slug api_dropdowns_autocompleteprops %}).
199
+ * Obtaining the `ref` returns an object of type [AutoCompleteHandle]({% slug api_dropdowns_autocompletehandle %}).
200
+ *
201
+ * @example
202
+ * ```jsx
203
+ * class App extends React.Component {
204
+ * autocomplete = null;
205
+ * render() {
206
+ * return (
207
+ * <div>
208
+ * <AutoComplete
209
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
210
+ * ref={component => this.autocomplete = component}
211
+ * />
212
+ * <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
213
+ * </div>
214
+ * );
215
+ * }
216
+ * }
217
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
218
+ * ```
219
+ */
220
+ export declare const AutoComplete: React.ForwardRefExoticComponent<AutoCompleteProps & React.RefAttributes<any>>;
@@ -29,36 +29,15 @@ import ListContainer from './../common/ListContainer';
29
29
  import List from './../common/List';
30
30
  import DropDownBase from '../common/DropDownBase';
31
31
  import { itemIndexStartsWith, getItemValue, areSame, getFocusedItem } from '../common/utils';
32
- import { guid, Keys, classNames } from '@progress/kendo-react-common';
32
+ import { guid, Keys, classNames, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
33
33
  import { FloatingLabel } from '@progress/kendo-react-labels';
34
34
  import { validatePackage } from '@progress/kendo-react-common';
35
35
  import { packageMetadata } from '../package-metadata';
36
36
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
37
- /**
38
- * Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
39
- *
40
- * @example
41
- * ```jsx
42
- * class App extends React.Component {
43
- * autocomplete = null;
44
- * render() {
45
- * return (
46
- * <div>
47
- * <AutoComplete
48
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
49
- * ref={component => this.autocomplete = component}
50
- * />
51
- * <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
52
- * </div>
53
- * );
54
- * }
55
- * }
56
- * ReactDOM.render(<App />, document.querySelector('my-app'));
57
- * ```
58
- */
59
- var AutoComplete = /** @class */ (function (_super) {
60
- __extends(AutoComplete, _super);
61
- function AutoComplete(props) {
37
+ /** @hidden */
38
+ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
39
+ __extends(AutoCompleteWithoutContext, _super);
40
+ function AutoCompleteWithoutContext(props) {
62
41
  var _this = _super.call(this, props) || this;
63
42
  /**
64
43
  * @hidden
@@ -194,7 +173,7 @@ var AutoComplete = /** @class */ (function (_super) {
194
173
  validatePackage(packageMetadata);
195
174
  return _this;
196
175
  }
197
- Object.defineProperty(AutoComplete.prototype, "element", {
176
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "element", {
198
177
  /**
199
178
  * @hidden
200
179
  */
@@ -204,7 +183,7 @@ var AutoComplete = /** @class */ (function (_super) {
204
183
  enumerable: true,
205
184
  configurable: true
206
185
  });
207
- Object.defineProperty(AutoComplete.prototype, "value", {
186
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "value", {
208
187
  /**
209
188
  * The value of the AutoComplete.
210
189
  */
@@ -226,7 +205,7 @@ var AutoComplete = /** @class */ (function (_super) {
226
205
  enumerable: true,
227
206
  configurable: true
228
207
  });
229
- Object.defineProperty(AutoComplete.prototype, "name", {
208
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "name", {
230
209
  /**
231
210
  * Gets the `name` property of the AutoComplete.
232
211
  */
@@ -236,7 +215,7 @@ var AutoComplete = /** @class */ (function (_super) {
236
215
  enumerable: true,
237
216
  configurable: true
238
217
  });
239
- Object.defineProperty(AutoComplete.prototype, "validity", {
218
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "validity", {
240
219
  /**
241
220
  * Represents the validity state into which the AutoComplete is set.
242
221
  */
@@ -255,26 +234,26 @@ var AutoComplete = /** @class */ (function (_super) {
255
234
  enumerable: true,
256
235
  configurable: true
257
236
  });
258
- Object.defineProperty(AutoComplete.prototype, "validityStyles", {
237
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "validityStyles", {
259
238
  /**
260
239
  * @hidden
261
240
  */
262
241
  get: function () {
263
242
  return this.props.validityStyles !== undefined
264
243
  ? this.props.validityStyles
265
- : AutoComplete.defaultProps.validityStyles;
244
+ : AutoCompleteWithoutContext.defaultProps.validityStyles;
266
245
  },
267
246
  enumerable: true,
268
247
  configurable: true
269
248
  });
270
- Object.defineProperty(AutoComplete.prototype, "required", {
249
+ Object.defineProperty(AutoCompleteWithoutContext.prototype, "required", {
271
250
  /**
272
251
  * @hidden
273
252
  */
274
253
  get: function () {
275
254
  return this.props.required !== undefined
276
255
  ? this.props.required
277
- : AutoComplete.defaultProps.required;
256
+ : AutoCompleteWithoutContext.defaultProps.required;
278
257
  },
279
258
  enumerable: true,
280
259
  configurable: true
@@ -282,7 +261,7 @@ var AutoComplete = /** @class */ (function (_super) {
282
261
  /**
283
262
  * @hidden
284
263
  */
285
- AutoComplete.prototype.componentDidUpdate = function (prevProps, prevState) {
264
+ AutoCompleteWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
286
265
  var _a = this.props.data, data = _a === void 0 ? [] : _a;
287
266
  var _b = prevProps.data, prevData = _b === void 0 ? [] : _b;
288
267
  var focusedIndex = this.focusedIndex();
@@ -300,14 +279,14 @@ var AutoComplete = /** @class */ (function (_super) {
300
279
  /**
301
280
  * @hidden
302
281
  */
303
- AutoComplete.prototype.componentDidMount = function () {
282
+ AutoCompleteWithoutContext.prototype.componentDidMount = function () {
304
283
  this.base.didMount();
305
284
  this.setValidity();
306
285
  };
307
286
  /**
308
287
  * @hidden
309
288
  */
310
- AutoComplete.prototype.render = function () {
289
+ AutoCompleteWithoutContext.prototype.render = function () {
311
290
  var _this = this;
312
291
  var _a = this.props, dir = _a.dir, disabled = _a.disabled, label = _a.label, className = _a.className, style = _a.style, loading = _a.loading, suggest = _a.suggest;
313
292
  var isValid = !this.validityStyles || this.validity.valid;
@@ -339,7 +318,7 @@ var AutoComplete = /** @class */ (function (_super) {
339
318
  /**
340
319
  * @hidden
341
320
  */
342
- AutoComplete.prototype.onNavigate = function (state, keyCode) {
321
+ AutoCompleteWithoutContext.prototype.onNavigate = function (state, keyCode) {
343
322
  var _this = this;
344
323
  var typedText = this.value;
345
324
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
@@ -361,7 +340,7 @@ var AutoComplete = /** @class */ (function (_super) {
361
340
  /**
362
341
  * @hidden
363
342
  */
364
- AutoComplete.prototype.applyInputValue = function (value, state, eventKey) {
343
+ AutoCompleteWithoutContext.prototype.applyInputValue = function (value, state, eventKey) {
365
344
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
366
345
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField;
367
346
  this._suggested = '';
@@ -374,7 +353,7 @@ var AutoComplete = /** @class */ (function (_super) {
374
353
  }
375
354
  this.applyState(state);
376
355
  };
377
- AutoComplete.prototype.renderSearchBar = function (clearButton, value, id) {
356
+ AutoCompleteWithoutContext.prototype.renderSearchBar = function (clearButton, value, id) {
378
357
  var _this = this;
379
358
  var base = this.base;
380
359
  var _a = this.props, placeholder = _a.placeholder, tabIndex = _a.tabIndex, disabled = _a.disabled, readonly = _a.readonly;
@@ -382,7 +361,7 @@ var AutoComplete = /** @class */ (function (_super) {
382
361
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
383
362
  return (React.createElement(SearchBar, { id: id, placeholder: placeholder, tabIndex: tabIndex || undefined, accessKey: this.props.accessKey, value: value, suggestedText: this._suggested, focused: focused, name: this.props.name, ref: function (searchbar) { return _this._input = searchbar && searchbar.input; }, onKeyDown: this.onInputKeyDown, onChange: this.onChangeHandler, onFocus: base.handleFocus, onBlur: this.handleBlur, disabled: disabled, readOnly: readonly, expanded: opened, owns: base.listBoxId, activedescendant: 'option-' + base.guid + '-' + this.focusedIndex(), role: "combobox", clearButton: clearButton, clearButtonClick: this.clearButtonClick, ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, render: this.props.valueRender }));
384
363
  };
385
- AutoComplete.prototype.renderListContainer = function () {
364
+ AutoCompleteWithoutContext.prototype.renderListContainer = function () {
386
365
  var base = this.base;
387
366
  var _a = this.props, dir = _a.dir, header = _a.header, footer = _a.footer, _b = _a.data, data = _b === void 0 ? [] : _b;
388
367
  var popupSettings = base.getPopupSettings();
@@ -400,7 +379,7 @@ var AutoComplete = /** @class */ (function (_super) {
400
379
  this.renderList(),
401
380
  footer));
402
381
  };
403
- AutoComplete.prototype.renderList = function () {
382
+ AutoCompleteWithoutContext.prototype.renderList = function () {
404
383
  var base = this.base;
405
384
  var popupSettings = base.getPopupSettings();
406
385
  var _a = this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;
@@ -408,7 +387,7 @@ var AutoComplete = /** @class */ (function (_super) {
408
387
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
409
388
  return (React.createElement(List, { id: base.listBoxId, show: opened, data: data.slice(), focusedIndex: this.focusedIndex(), value: value, textField: textField, valueField: textField, highlightSelected: false, optionsGuid: base.guid, listRef: function (list) { return base.list = list; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: "k-list-scroller", onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); } }));
410
389
  };
411
- AutoComplete.prototype.triggerOnChange = function (newValue, state, eventArgs) {
390
+ AutoCompleteWithoutContext.prototype.triggerOnChange = function (newValue, state, eventArgs) {
412
391
  if (this.value === newValue && !eventArgs) {
413
392
  return;
414
393
  }
@@ -416,11 +395,11 @@ var AutoComplete = /** @class */ (function (_super) {
416
395
  this._valueDuringOnChange = newValue;
417
396
  state.events.push(__assign({ type: 'onChange' }, (eventArgs || {})));
418
397
  };
419
- AutoComplete.prototype.applyState = function (state) {
398
+ AutoCompleteWithoutContext.prototype.applyState = function (state) {
420
399
  this.base.applyState(state);
421
400
  this._valueDuringOnChange = undefined;
422
401
  };
423
- AutoComplete.prototype.suggestValue = function (value) {
402
+ AutoCompleteWithoutContext.prototype.suggestValue = function (value) {
424
403
  this._suggested = '';
425
404
  if (value) {
426
405
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField;
@@ -433,7 +412,7 @@ var AutoComplete = /** @class */ (function (_super) {
433
412
  }
434
413
  }
435
414
  };
436
- AutoComplete.prototype.focusedIndex = function (value) {
415
+ AutoCompleteWithoutContext.prototype.focusedIndex = function (value) {
437
416
  var _this = this;
438
417
  var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
439
418
  var inputValue = value !== undefined ? value : this.value;
@@ -442,14 +421,50 @@ var AutoComplete = /** @class */ (function (_super) {
442
421
  (focusedItemIndex ? focusedItemIndex(data, inputValue, textField) :
443
422
  Math.max(0, data.indexOf(getFocusedItem(data, inputValue, textField))));
444
423
  };
424
+ AutoCompleteWithoutContext.displayName = 'AutoComplete';
445
425
  /**
446
426
  * @hidden
447
427
  */
448
- AutoComplete.propTypes = __assign({}, DropDownBase.basicPropTypes, { suggest: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), placeholder: PropTypes.string, value: PropTypes.string, defaultValue: PropTypes.string, validationMessage: PropTypes.string, required: PropTypes.bool, readonly: PropTypes.bool, clearButton: PropTypes.bool, valueRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
428
+ AutoCompleteWithoutContext.propTypes = __assign({}, DropDownBase.basicPropTypes, { suggest: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), placeholder: PropTypes.string, value: PropTypes.string, defaultValue: PropTypes.string, validationMessage: PropTypes.string, required: PropTypes.bool, readonly: PropTypes.bool, clearButton: PropTypes.bool, valueRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
449
429
  /**
450
430
  * @hidden
451
431
  */
452
- AutoComplete.defaultProps = __assign({}, DropDownBase.defaultProps);
453
- return AutoComplete;
432
+ AutoCompleteWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps);
433
+ return AutoCompleteWithoutContext;
454
434
  }(React.Component));
455
- export default AutoComplete;
435
+ export { AutoCompleteWithoutContext };
436
+ /**
437
+ * Represents the PropsContext of the `AutoComplete` component.
438
+ * Used for global configuration of all `AutoComplete` instances.
439
+ *
440
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
441
+ */
442
+ export var AutoCompletePropsContext = createPropsContext();
443
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
444
+ /**
445
+ * Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
446
+ *
447
+ * Accepts properties of type [AutoCompleteProps]({% slug api_dropdowns_autocompleteprops %}).
448
+ * Obtaining the `ref` returns an object of type [AutoCompleteHandle]({% slug api_dropdowns_autocompletehandle %}).
449
+ *
450
+ * @example
451
+ * ```jsx
452
+ * class App extends React.Component {
453
+ * autocomplete = null;
454
+ * render() {
455
+ * return (
456
+ * <div>
457
+ * <AutoComplete
458
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
459
+ * ref={component => this.autocomplete = component}
460
+ * />
461
+ * <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
462
+ * </div>
463
+ * );
464
+ * }
465
+ * }
466
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
467
+ * ```
468
+ */
469
+ export var AutoComplete = withPropsContext(AutoCompletePropsContext, AutoCompleteWithoutContext);
470
+ AutoComplete.displayName = 'KendoReactAutoComplete';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import AutoComplete from './AutoComplete';
2
+ import { AutoComplete } from './AutoComplete';
3
3
  import { ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent } from './../common/events';
4
4
  import { DropDownsPopupSettings, Suggestion } from '../common/settings';
5
5
  import { ListItemProps } from '../common/ListItem';
@@ -17,29 +17,9 @@ export interface ComboBoxState extends DropDownStateBase {
17
17
  export interface ComboInternalState extends InternalState {
18
18
  data: ComboBoxState;
19
19
  }
20
- /**
21
- * Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).
22
- *
23
- * @example
24
- * ```jsx
25
- * class App extends React.Component {
26
- * combobox = null;
27
- * render() {
28
- * return (
29
- * <div>
30
- * <ComboBox
31
- * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
32
- * ref={component => this.combobox = component}
33
- * />
34
- * <button onClick={() => alert(this.combobox.value)}>alert value</button>
35
- * </div>
36
- * );
37
- * }
38
- * }
39
- * ReactDOM.render(<App />, document.querySelector('my-app'));
40
- * ```
41
- */
42
- export default class ComboBox extends React.Component<ComboBoxProps, ComboBoxState> implements FormComponent {
20
+ /** @hidden */
21
+ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProps, ComboBoxState> implements FormComponent {
22
+ static displayName: string;
43
23
  /**
44
24
  * @hidden
45
25
  */
@@ -194,3 +174,59 @@ export default class ComboBox extends React.Component<ComboBoxProps, ComboBoxSta
194
174
  private applyState;
195
175
  private setValidity;
196
176
  }
177
+ /**
178
+ * Represents the PropsContext of the `ComboBox` component.
179
+ * Used for global configuration of all `ComboBox` instances.
180
+ *
181
+ * For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
182
+ */
183
+ export declare const ComboBoxPropsContext: React.Context<(p: ComboBoxProps) => ComboBoxProps>;
184
+ /**
185
+ * Represent the `ref` of the ComboBox component.
186
+ */
187
+ export interface ComboBoxHandle extends Pick<ComboBoxWithoutContext, keyof ComboBoxWithoutContext> {
188
+ /**
189
+ * The index of the selected item.
190
+ */
191
+ index: number;
192
+ /**
193
+ * Gets the `name` property of the ComboBox.
194
+ */
195
+ name: string | undefined;
196
+ /**
197
+ * Represents the validity state into which the component is set.
198
+ */
199
+ validity: FormComponentValidity;
200
+ /**
201
+ * The value of the ComboBox.
202
+ */
203
+ value: any;
204
+ }
205
+ /** @hidden */
206
+ export declare type ComboBox = ComboBoxHandle;
207
+ /**
208
+ * Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).
209
+ *
210
+ * Accepts properties of type [ComboBoxProps]({% slug api_dropdowns_comboboxprops %}).
211
+ * Obtaining the `ref` returns an object of type [ComboBoxHandle]({% slug api_dropdowns_comboboxhandle %}).
212
+ *
213
+ * @example
214
+ * ```jsx
215
+ * class App extends React.Component {
216
+ * combobox = null;
217
+ * render() {
218
+ * return (
219
+ * <div>
220
+ * <ComboBox
221
+ * data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
222
+ * ref={component => this.combobox = component}
223
+ * />
224
+ * <button onClick={() => alert(this.combobox.value)}>alert value</button>
225
+ * </div>
226
+ * );
227
+ * }
228
+ * }
229
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
230
+ * ```
231
+ */
232
+ export declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<any>>;