@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.
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/dist/es/AutoComplete/AutoComplete.d.ts +58 -23
- package/dist/es/AutoComplete/AutoComplete.js +65 -50
- package/dist/es/AutoComplete/AutoCompleteProps.d.ts +1 -1
- package/dist/es/ComboBox/ComboBox.d.ts +59 -23
- package/dist/es/ComboBox/ComboBox.js +69 -54
- package/dist/es/ComboBox/ComboBoxProps.d.ts +1 -1
- package/dist/es/DropDownList/DropDownList.d.ts +65 -22
- package/dist/es/DropDownList/DropDownList.js +63 -46
- package/dist/es/DropDownList/DropDownListProps.d.ts +1 -1
- package/dist/es/DropDownTree/DropDownTree.d.ts +10 -0
- package/dist/es/DropDownTree/DropDownTree.js +13 -2
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.d.ts +11 -0
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +16 -4
- package/dist/es/MultiSelect/MultiSelect.d.ts +58 -23
- package/dist/es/MultiSelect/MultiSelect.js +65 -50
- package/dist/es/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +10 -0
- package/dist/es/MultiSelectTree/MultiSelectTree.js +13 -2
- package/dist/es/main.d.ts +8 -8
- package/dist/es/main.js +8 -8
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.d.ts +58 -23
- package/dist/npm/AutoComplete/AutoComplete.js +64 -49
- package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +1 -1
- package/dist/npm/ComboBox/ComboBox.d.ts +59 -23
- package/dist/npm/ComboBox/ComboBox.js +68 -53
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +1 -1
- package/dist/npm/DropDownList/DropDownList.d.ts +65 -22
- package/dist/npm/DropDownList/DropDownList.js +62 -45
- package/dist/npm/DropDownList/DropDownListProps.d.ts +1 -1
- package/dist/npm/DropDownTree/DropDownTree.d.ts +10 -0
- package/dist/npm/DropDownTree/DropDownTree.js +12 -1
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +11 -0
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +15 -3
- package/dist/npm/MultiSelect/MultiSelect.d.ts +58 -23
- package/dist/npm/MultiSelect/MultiSelect.js +64 -49
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +10 -0
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +12 -1
- package/dist/npm/main.d.ts +8 -8
- package/dist/npm/main.js +11 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dropdowns.js +1 -1
- 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
|
-
|
|
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>>;
|
|
@@ -36,31 +36,10 @@ var kendo_react_labels_1 = require("@progress/kendo-react-labels");
|
|
|
36
36
|
var kendo_react_common_2 = require("@progress/kendo-react-common");
|
|
37
37
|
var package_metadata_1 = require("../package-metadata");
|
|
38
38
|
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* ```jsx
|
|
44
|
-
* class App extends React.Component {
|
|
45
|
-
* autocomplete = null;
|
|
46
|
-
* render() {
|
|
47
|
-
* return (
|
|
48
|
-
* <div>
|
|
49
|
-
* <AutoComplete
|
|
50
|
-
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
51
|
-
* ref={component => this.autocomplete = component}
|
|
52
|
-
* />
|
|
53
|
-
* <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
|
|
54
|
-
* </div>
|
|
55
|
-
* );
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
58
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
var AutoComplete = /** @class */ (function (_super) {
|
|
62
|
-
__extends(AutoComplete, _super);
|
|
63
|
-
function AutoComplete(props) {
|
|
39
|
+
/** @hidden */
|
|
40
|
+
var AutoCompleteWithoutContext = /** @class */ (function (_super) {
|
|
41
|
+
__extends(AutoCompleteWithoutContext, _super);
|
|
42
|
+
function AutoCompleteWithoutContext(props) {
|
|
64
43
|
var _this = _super.call(this, props) || this;
|
|
65
44
|
/**
|
|
66
45
|
* @hidden
|
|
@@ -196,7 +175,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
196
175
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
197
176
|
return _this;
|
|
198
177
|
}
|
|
199
|
-
Object.defineProperty(
|
|
178
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "element", {
|
|
200
179
|
/**
|
|
201
180
|
* @hidden
|
|
202
181
|
*/
|
|
@@ -206,7 +185,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
206
185
|
enumerable: true,
|
|
207
186
|
configurable: true
|
|
208
187
|
});
|
|
209
|
-
Object.defineProperty(
|
|
188
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "value", {
|
|
210
189
|
/**
|
|
211
190
|
* The value of the AutoComplete.
|
|
212
191
|
*/
|
|
@@ -228,7 +207,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
228
207
|
enumerable: true,
|
|
229
208
|
configurable: true
|
|
230
209
|
});
|
|
231
|
-
Object.defineProperty(
|
|
210
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "name", {
|
|
232
211
|
/**
|
|
233
212
|
* Gets the `name` property of the AutoComplete.
|
|
234
213
|
*/
|
|
@@ -238,7 +217,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
238
217
|
enumerable: true,
|
|
239
218
|
configurable: true
|
|
240
219
|
});
|
|
241
|
-
Object.defineProperty(
|
|
220
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "validity", {
|
|
242
221
|
/**
|
|
243
222
|
* Represents the validity state into which the AutoComplete is set.
|
|
244
223
|
*/
|
|
@@ -257,26 +236,26 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
257
236
|
enumerable: true,
|
|
258
237
|
configurable: true
|
|
259
238
|
});
|
|
260
|
-
Object.defineProperty(
|
|
239
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "validityStyles", {
|
|
261
240
|
/**
|
|
262
241
|
* @hidden
|
|
263
242
|
*/
|
|
264
243
|
get: function () {
|
|
265
244
|
return this.props.validityStyles !== undefined
|
|
266
245
|
? this.props.validityStyles
|
|
267
|
-
:
|
|
246
|
+
: AutoCompleteWithoutContext.defaultProps.validityStyles;
|
|
268
247
|
},
|
|
269
248
|
enumerable: true,
|
|
270
249
|
configurable: true
|
|
271
250
|
});
|
|
272
|
-
Object.defineProperty(
|
|
251
|
+
Object.defineProperty(AutoCompleteWithoutContext.prototype, "required", {
|
|
273
252
|
/**
|
|
274
253
|
* @hidden
|
|
275
254
|
*/
|
|
276
255
|
get: function () {
|
|
277
256
|
return this.props.required !== undefined
|
|
278
257
|
? this.props.required
|
|
279
|
-
:
|
|
258
|
+
: AutoCompleteWithoutContext.defaultProps.required;
|
|
280
259
|
},
|
|
281
260
|
enumerable: true,
|
|
282
261
|
configurable: true
|
|
@@ -284,7 +263,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
284
263
|
/**
|
|
285
264
|
* @hidden
|
|
286
265
|
*/
|
|
287
|
-
|
|
266
|
+
AutoCompleteWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
288
267
|
var _a = this.props.data, data = _a === void 0 ? [] : _a;
|
|
289
268
|
var _b = prevProps.data, prevData = _b === void 0 ? [] : _b;
|
|
290
269
|
var focusedIndex = this.focusedIndex();
|
|
@@ -302,14 +281,14 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
302
281
|
/**
|
|
303
282
|
* @hidden
|
|
304
283
|
*/
|
|
305
|
-
|
|
284
|
+
AutoCompleteWithoutContext.prototype.componentDidMount = function () {
|
|
306
285
|
this.base.didMount();
|
|
307
286
|
this.setValidity();
|
|
308
287
|
};
|
|
309
288
|
/**
|
|
310
289
|
* @hidden
|
|
311
290
|
*/
|
|
312
|
-
|
|
291
|
+
AutoCompleteWithoutContext.prototype.render = function () {
|
|
313
292
|
var _this = this;
|
|
314
293
|
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;
|
|
315
294
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
@@ -341,7 +320,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
341
320
|
/**
|
|
342
321
|
* @hidden
|
|
343
322
|
*/
|
|
344
|
-
|
|
323
|
+
AutoCompleteWithoutContext.prototype.onNavigate = function (state, keyCode) {
|
|
345
324
|
var _this = this;
|
|
346
325
|
var typedText = this.value;
|
|
347
326
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
|
|
@@ -363,7 +342,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
363
342
|
/**
|
|
364
343
|
* @hidden
|
|
365
344
|
*/
|
|
366
|
-
|
|
345
|
+
AutoCompleteWithoutContext.prototype.applyInputValue = function (value, state, eventKey) {
|
|
367
346
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
368
347
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField;
|
|
369
348
|
this._suggested = '';
|
|
@@ -376,7 +355,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
376
355
|
}
|
|
377
356
|
this.applyState(state);
|
|
378
357
|
};
|
|
379
|
-
|
|
358
|
+
AutoCompleteWithoutContext.prototype.renderSearchBar = function (clearButton, value, id) {
|
|
380
359
|
var _this = this;
|
|
381
360
|
var base = this.base;
|
|
382
361
|
var _a = this.props, placeholder = _a.placeholder, tabIndex = _a.tabIndex, disabled = _a.disabled, readonly = _a.readonly;
|
|
@@ -384,7 +363,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
384
363
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
385
364
|
return (React.createElement(SearchBar_1.default, { 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 }));
|
|
386
365
|
};
|
|
387
|
-
|
|
366
|
+
AutoCompleteWithoutContext.prototype.renderListContainer = function () {
|
|
388
367
|
var base = this.base;
|
|
389
368
|
var _a = this.props, dir = _a.dir, header = _a.header, footer = _a.footer, _b = _a.data, data = _b === void 0 ? [] : _b;
|
|
390
369
|
var popupSettings = base.getPopupSettings();
|
|
@@ -402,7 +381,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
402
381
|
this.renderList(),
|
|
403
382
|
footer));
|
|
404
383
|
};
|
|
405
|
-
|
|
384
|
+
AutoCompleteWithoutContext.prototype.renderList = function () {
|
|
406
385
|
var base = this.base;
|
|
407
386
|
var popupSettings = base.getPopupSettings();
|
|
408
387
|
var _a = this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;
|
|
@@ -410,7 +389,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
410
389
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
411
390
|
return (React.createElement(List_1.default, { 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(); } }));
|
|
412
391
|
};
|
|
413
|
-
|
|
392
|
+
AutoCompleteWithoutContext.prototype.triggerOnChange = function (newValue, state, eventArgs) {
|
|
414
393
|
if (this.value === newValue && !eventArgs) {
|
|
415
394
|
return;
|
|
416
395
|
}
|
|
@@ -418,11 +397,11 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
418
397
|
this._valueDuringOnChange = newValue;
|
|
419
398
|
state.events.push(__assign({ type: 'onChange' }, (eventArgs || {})));
|
|
420
399
|
};
|
|
421
|
-
|
|
400
|
+
AutoCompleteWithoutContext.prototype.applyState = function (state) {
|
|
422
401
|
this.base.applyState(state);
|
|
423
402
|
this._valueDuringOnChange = undefined;
|
|
424
403
|
};
|
|
425
|
-
|
|
404
|
+
AutoCompleteWithoutContext.prototype.suggestValue = function (value) {
|
|
426
405
|
this._suggested = '';
|
|
427
406
|
if (value) {
|
|
428
407
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField;
|
|
@@ -435,7 +414,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
435
414
|
}
|
|
436
415
|
}
|
|
437
416
|
};
|
|
438
|
-
|
|
417
|
+
AutoCompleteWithoutContext.prototype.focusedIndex = function (value) {
|
|
439
418
|
var _this = this;
|
|
440
419
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
|
|
441
420
|
var inputValue = value !== undefined ? value : this.value;
|
|
@@ -444,14 +423,50 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
444
423
|
(focusedItemIndex ? focusedItemIndex(data, inputValue, textField) :
|
|
445
424
|
Math.max(0, data.indexOf(utils_1.getFocusedItem(data, inputValue, textField))));
|
|
446
425
|
};
|
|
426
|
+
AutoCompleteWithoutContext.displayName = 'AutoComplete';
|
|
447
427
|
/**
|
|
448
428
|
* @hidden
|
|
449
429
|
*/
|
|
450
|
-
|
|
430
|
+
AutoCompleteWithoutContext.propTypes = __assign({}, DropDownBase_1.default.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 });
|
|
451
431
|
/**
|
|
452
432
|
* @hidden
|
|
453
433
|
*/
|
|
454
|
-
|
|
455
|
-
return
|
|
434
|
+
AutoCompleteWithoutContext.defaultProps = __assign({}, DropDownBase_1.default.defaultProps);
|
|
435
|
+
return AutoCompleteWithoutContext;
|
|
456
436
|
}(React.Component));
|
|
457
|
-
exports.
|
|
437
|
+
exports.AutoCompleteWithoutContext = AutoCompleteWithoutContext;
|
|
438
|
+
/**
|
|
439
|
+
* Represents the PropsContext of the `AutoComplete` component.
|
|
440
|
+
* Used for global configuration of all `AutoComplete` instances.
|
|
441
|
+
*
|
|
442
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
443
|
+
*/
|
|
444
|
+
exports.AutoCompletePropsContext = kendo_react_common_1.createPropsContext();
|
|
445
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
446
|
+
/**
|
|
447
|
+
* Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
|
|
448
|
+
*
|
|
449
|
+
* Accepts properties of type [AutoCompleteProps]({% slug api_dropdowns_autocompleteprops %}).
|
|
450
|
+
* Obtaining the `ref` returns an object of type [AutoCompleteHandle]({% slug api_dropdowns_autocompletehandle %}).
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* ```jsx
|
|
454
|
+
* class App extends React.Component {
|
|
455
|
+
* autocomplete = null;
|
|
456
|
+
* render() {
|
|
457
|
+
* return (
|
|
458
|
+
* <div>
|
|
459
|
+
* <AutoComplete
|
|
460
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
461
|
+
* ref={component => this.autocomplete = component}
|
|
462
|
+
* />
|
|
463
|
+
* <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
|
|
464
|
+
* </div>
|
|
465
|
+
* );
|
|
466
|
+
* }
|
|
467
|
+
* }
|
|
468
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
exports.AutoComplete = kendo_react_common_1.withPropsContext(exports.AutoCompletePropsContext, AutoCompleteWithoutContext);
|
|
472
|
+
exports.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
|
-
|
|
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>>;
|