@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
|
@@ -36,31 +36,10 @@ var List_1 = require("../common/List");
|
|
|
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
|
-
* combobox = null;
|
|
46
|
-
* render() {
|
|
47
|
-
* return (
|
|
48
|
-
* <div>
|
|
49
|
-
* <ComboBox
|
|
50
|
-
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
51
|
-
* ref={component => this.combobox = component}
|
|
52
|
-
* />
|
|
53
|
-
* <button onClick={() => alert(this.combobox.value)}>alert value</button>
|
|
54
|
-
* </div>
|
|
55
|
-
* );
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
58
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
var ComboBox = /** @class */ (function (_super) {
|
|
62
|
-
__extends(ComboBox, _super);
|
|
63
|
-
function ComboBox(props) {
|
|
39
|
+
/** @hidden */
|
|
40
|
+
var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
41
|
+
__extends(ComboBoxWithoutContext, _super);
|
|
42
|
+
function ComboBoxWithoutContext(props) {
|
|
64
43
|
var _this = _super.call(this, props) || this;
|
|
65
44
|
/**
|
|
66
45
|
* @hidden
|
|
@@ -229,7 +208,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
229
208
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
230
209
|
return _this;
|
|
231
210
|
}
|
|
232
|
-
Object.defineProperty(
|
|
211
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "element", {
|
|
233
212
|
/**
|
|
234
213
|
* @hidden
|
|
235
214
|
*/
|
|
@@ -239,7 +218,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
239
218
|
enumerable: true,
|
|
240
219
|
configurable: true
|
|
241
220
|
});
|
|
242
|
-
Object.defineProperty(
|
|
221
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "value", {
|
|
243
222
|
/**
|
|
244
223
|
* The value of the ComboBox.
|
|
245
224
|
*/
|
|
@@ -261,7 +240,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
261
240
|
enumerable: true,
|
|
262
241
|
configurable: true
|
|
263
242
|
});
|
|
264
|
-
Object.defineProperty(
|
|
243
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "index", {
|
|
265
244
|
/**
|
|
266
245
|
* The index of the selected item.
|
|
267
246
|
*/
|
|
@@ -274,7 +253,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
274
253
|
enumerable: true,
|
|
275
254
|
configurable: true
|
|
276
255
|
});
|
|
277
|
-
Object.defineProperty(
|
|
256
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "name", {
|
|
278
257
|
/**
|
|
279
258
|
* Gets the `name` property of the ComboBox.
|
|
280
259
|
*/
|
|
@@ -284,7 +263,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
284
263
|
enumerable: true,
|
|
285
264
|
configurable: true
|
|
286
265
|
});
|
|
287
|
-
Object.defineProperty(
|
|
266
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "validity", {
|
|
288
267
|
/**
|
|
289
268
|
* Represents the validity state into which the component is set.
|
|
290
269
|
*/
|
|
@@ -304,23 +283,23 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
304
283
|
enumerable: true,
|
|
305
284
|
configurable: true
|
|
306
285
|
});
|
|
307
|
-
Object.defineProperty(
|
|
286
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "validityStyles", {
|
|
308
287
|
get: function () {
|
|
309
288
|
return this.props.validityStyles !== undefined
|
|
310
289
|
? this.props.validityStyles
|
|
311
|
-
:
|
|
290
|
+
: ComboBoxWithoutContext.defaultProps.validityStyles;
|
|
312
291
|
},
|
|
313
292
|
enumerable: true,
|
|
314
293
|
configurable: true
|
|
315
294
|
});
|
|
316
|
-
Object.defineProperty(
|
|
295
|
+
Object.defineProperty(ComboBoxWithoutContext.prototype, "required", {
|
|
317
296
|
/**
|
|
318
297
|
* @hidden
|
|
319
298
|
*/
|
|
320
299
|
get: function () {
|
|
321
300
|
return this.props.required !== undefined
|
|
322
301
|
? this.props.required
|
|
323
|
-
:
|
|
302
|
+
: ComboBoxWithoutContext.defaultProps.required;
|
|
324
303
|
},
|
|
325
304
|
enumerable: true,
|
|
326
305
|
configurable: true
|
|
@@ -328,7 +307,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
328
307
|
/**
|
|
329
308
|
* @hidden
|
|
330
309
|
*/
|
|
331
|
-
|
|
310
|
+
ComboBoxWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
332
311
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual;
|
|
333
312
|
var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
|
|
334
313
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -362,16 +341,16 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
362
341
|
/**
|
|
363
342
|
* @hidden
|
|
364
343
|
*/
|
|
365
|
-
|
|
344
|
+
ComboBoxWithoutContext.prototype.componentDidMount = function () {
|
|
366
345
|
this.base.didMount();
|
|
367
346
|
this.setValidity();
|
|
368
347
|
};
|
|
369
348
|
/**
|
|
370
349
|
* @hidden
|
|
371
350
|
*/
|
|
372
|
-
|
|
351
|
+
ComboBoxWithoutContext.prototype.render = function () {
|
|
373
352
|
var _this = this;
|
|
374
|
-
var _a = this.props, dir = _a.dir, disabled = _a.disabled, _b = _a.clearButton, clearButton = _b === void 0 ?
|
|
353
|
+
var _a = this.props, dir = _a.dir, disabled = _a.disabled, _b = _a.clearButton, clearButton = _b === void 0 ? ComboBoxWithoutContext.defaultProps.clearButton : _b, label = _a.label, textField = _a.textField, className = _a.className, style = _a.style, loading = _a.loading, iconClassName = _a.iconClassName, virtual = _a.virtual;
|
|
375
354
|
var focused = this.state.focused;
|
|
376
355
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
377
356
|
var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
|
|
@@ -411,7 +390,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
411
390
|
/**
|
|
412
391
|
* @hidden
|
|
413
392
|
*/
|
|
414
|
-
|
|
393
|
+
ComboBoxWithoutContext.prototype.onNavigate = function (state, keyCode) {
|
|
415
394
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;
|
|
416
395
|
var text = this.props.filter ? this.props.filter : this.state.text;
|
|
417
396
|
var focusedIndex = this.getFocusedIndex();
|
|
@@ -437,7 +416,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
437
416
|
}
|
|
438
417
|
}
|
|
439
418
|
};
|
|
440
|
-
|
|
419
|
+
ComboBoxWithoutContext.prototype.applyValueOnEnter = function (value, state) {
|
|
441
420
|
var _a;
|
|
442
421
|
var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
|
|
443
422
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -467,7 +446,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
467
446
|
}
|
|
468
447
|
this.applyState(state);
|
|
469
448
|
};
|
|
470
|
-
|
|
449
|
+
ComboBoxWithoutContext.prototype.applyValueOnRejectSuggestions = function (text, state) {
|
|
471
450
|
var _a;
|
|
472
451
|
var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
|
|
473
452
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -498,7 +477,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
498
477
|
}
|
|
499
478
|
this.applyState(state);
|
|
500
479
|
};
|
|
501
|
-
|
|
480
|
+
ComboBoxWithoutContext.prototype.selectFocusedItem = function (text, state) {
|
|
502
481
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
503
482
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? utils_1.itemIndexStartsWith : _d;
|
|
504
483
|
var skip = virtual.skip;
|
|
@@ -518,7 +497,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
518
497
|
}
|
|
519
498
|
return this.applyState(state);
|
|
520
499
|
};
|
|
521
|
-
|
|
500
|
+
ComboBoxWithoutContext.prototype.renderListContainer = function () {
|
|
522
501
|
var base = this.base;
|
|
523
502
|
var _a = this.props, dir = _a.dir, header = _a.header, footer = _a.footer, _b = _a.data, data = _b === void 0 ? [] : _b, groupField = _a.groupField;
|
|
524
503
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -541,7 +520,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
541
520
|
base.renderScrollWrapper([this.renderList(), base.renderScrollElement()], this.onScroll),
|
|
542
521
|
footer));
|
|
543
522
|
};
|
|
544
|
-
|
|
523
|
+
ComboBoxWithoutContext.prototype.renderList = function () {
|
|
545
524
|
var _this = this;
|
|
546
525
|
var base = this.base;
|
|
547
526
|
var _a = this.props, textField = _a.textField, dataItemKey = _a.dataItemKey, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender, _b = _a.data, data = _b === void 0 ? [] : _b, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;
|
|
@@ -559,7 +538,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
559
538
|
{ maxHeight: popupSettings.height } : { float: 'left', width: '100%' }, wrapperCssClass: !vs.enabled ? 'k-list-scroller' : undefined, listStyle: vs.enabled ?
|
|
560
539
|
{ transform: translate } : undefined, key: "listkey", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll }));
|
|
561
540
|
};
|
|
562
|
-
|
|
541
|
+
ComboBoxWithoutContext.prototype.renderSearchBar = function (clearButton, text, id) {
|
|
563
542
|
var _this = this;
|
|
564
543
|
var _a = this.props, placeholder = _a.placeholder, tabIndex = _a.tabIndex, disabled = _a.disabled, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;
|
|
565
544
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -570,7 +549,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
570
549
|
}
|
|
571
550
|
return (React.createElement(SearchBar_1.default, { id: id, placeholder: placeholder, tabIndex: tabIndex || undefined, accessKey: this.props.accessKey, value: text + this._suggested, suggestedText: this._suggested, ref: function (el) { return _this._input = el && el.input; }, onKeyDown: this.onInputKeyDown, onChange: this.inputOnChange, onFocus: this.base.handleFocus, onBlur: this.handleBlur, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: this.base.guid + '-' + (selectedIndex + virtual.skip), role: "combobox", clearButton: clearButton, clearButtonClick: this.clearButtonClick, ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, render: this.props.valueRender }));
|
|
572
551
|
};
|
|
573
|
-
|
|
552
|
+
ComboBoxWithoutContext.prototype.triggerOnChange = function (item, state) {
|
|
574
553
|
var value = this.value;
|
|
575
554
|
if ((!utils_1.isPresent(value) && !utils_1.isPresent(item)) || utils_1.areSame(value, item, this.props.dataItemKey)) {
|
|
576
555
|
return;
|
|
@@ -581,7 +560,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
581
560
|
this._valueDuringOnChange = item;
|
|
582
561
|
state.events.push({ type: 'onChange' });
|
|
583
562
|
};
|
|
584
|
-
|
|
563
|
+
ComboBoxWithoutContext.prototype.getFocusedIndex = function () {
|
|
585
564
|
var value = this.value;
|
|
586
565
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? utils_1.itemIndexStartsWith : _d;
|
|
587
566
|
var text = this.props.filter ? this.props.filter : this.state.text;
|
|
@@ -595,22 +574,58 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
595
574
|
return virtual.skip === 0 ? 0 : -1;
|
|
596
575
|
}
|
|
597
576
|
};
|
|
598
|
-
|
|
577
|
+
ComboBoxWithoutContext.prototype.suggestValue = function (value) {
|
|
599
578
|
var _a = this.props, data = _a.data, textField = _a.textField;
|
|
600
579
|
this._suggested = utils_1.suggestValue(value, data, textField);
|
|
601
580
|
};
|
|
602
|
-
|
|
581
|
+
ComboBoxWithoutContext.prototype.applyState = function (state) {
|
|
603
582
|
this.base.applyState(state);
|
|
604
583
|
this._valueDuringOnChange = undefined;
|
|
605
584
|
};
|
|
585
|
+
ComboBoxWithoutContext.displayName = 'ComboBox';
|
|
606
586
|
/**
|
|
607
587
|
* @hidden
|
|
608
588
|
*/
|
|
609
|
-
|
|
589
|
+
ComboBoxWithoutContext.propTypes = __assign({}, DropDownBase_1.default.propTypes, { dataItemKey: PropTypes.string, groupField: PropTypes.string, suggest: PropTypes.bool, placeholder: PropTypes.string, allowCustom: PropTypes.bool, clearButton: PropTypes.bool, iconClassName: PropTypes.string, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, list: PropTypes.any, valueRender: PropTypes.func });
|
|
610
590
|
/**
|
|
611
591
|
* @hidden
|
|
612
592
|
*/
|
|
613
|
-
|
|
614
|
-
return
|
|
593
|
+
ComboBoxWithoutContext.defaultProps = __assign({}, DropDownBase_1.default.defaultProps, { allowCustom: false, clearButton: true, required: false });
|
|
594
|
+
return ComboBoxWithoutContext;
|
|
615
595
|
}(React.Component));
|
|
616
|
-
exports.
|
|
596
|
+
exports.ComboBoxWithoutContext = ComboBoxWithoutContext;
|
|
597
|
+
/**
|
|
598
|
+
* Represents the PropsContext of the `ComboBox` component.
|
|
599
|
+
* Used for global configuration of all `ComboBox` instances.
|
|
600
|
+
*
|
|
601
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
602
|
+
*/
|
|
603
|
+
exports.ComboBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
604
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
605
|
+
/**
|
|
606
|
+
* Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).
|
|
607
|
+
*
|
|
608
|
+
* Accepts properties of type [ComboBoxProps]({% slug api_dropdowns_comboboxprops %}).
|
|
609
|
+
* Obtaining the `ref` returns an object of type [ComboBoxHandle]({% slug api_dropdowns_comboboxhandle %}).
|
|
610
|
+
*
|
|
611
|
+
* @example
|
|
612
|
+
* ```jsx
|
|
613
|
+
* class App extends React.Component {
|
|
614
|
+
* combobox = null;
|
|
615
|
+
* render() {
|
|
616
|
+
* return (
|
|
617
|
+
* <div>
|
|
618
|
+
* <ComboBox
|
|
619
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
620
|
+
* ref={component => this.combobox = component}
|
|
621
|
+
* />
|
|
622
|
+
* <button onClick={() => alert(this.combobox.value)}>alert value</button>
|
|
623
|
+
* </div>
|
|
624
|
+
* );
|
|
625
|
+
* }
|
|
626
|
+
* }
|
|
627
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
exports.ComboBox = kendo_react_common_1.withPropsContext(exports.ComboBoxPropsContext, ComboBoxWithoutContext);
|
|
631
|
+
exports.ComboBox.displayName = 'KendoReactComboBox';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import ComboBox from './ComboBox';
|
|
2
|
+
import { ComboBox } from './ComboBox';
|
|
3
3
|
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent } from './../common/events';
|
|
4
4
|
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
5
5
|
import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
|
|
@@ -10,28 +10,10 @@ import { DropDownStateBase, InternalState } from './../common/settings';
|
|
|
10
10
|
export interface DropDownListState extends DropDownStateBase {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```jsx
|
|
17
|
-
* class App extends React.Component {
|
|
18
|
-
* dropdownlist = null;
|
|
19
|
-
* render() {
|
|
20
|
-
* return (
|
|
21
|
-
* <div>
|
|
22
|
-
* <DropDownList
|
|
23
|
-
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
24
|
-
* ref={component => this.dropdownlist = component}
|
|
25
|
-
* />
|
|
26
|
-
* <button onClick={() => alert(this.dropdownlist.value)}>alert value</button>
|
|
27
|
-
* </div>
|
|
28
|
-
* );
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
32
|
-
* ```
|
|
13
|
+
* @hidden
|
|
33
14
|
*/
|
|
34
|
-
export
|
|
15
|
+
export declare class DropDownListWithoutContext extends React.Component<DropDownListProps, DropDownListState> implements FormComponent {
|
|
16
|
+
static displayName: string;
|
|
35
17
|
/**
|
|
36
18
|
* @hidden
|
|
37
19
|
*/
|
|
@@ -41,6 +23,9 @@ export default class DropDownList extends React.Component<DropDownListProps, Dro
|
|
|
41
23
|
filterable: PropTypes.Requireable<boolean>;
|
|
42
24
|
filter: PropTypes.Requireable<string>;
|
|
43
25
|
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
|
+
/**
|
|
27
|
+
* The value of the DropDownList.
|
|
28
|
+
*/
|
|
44
29
|
pageSize: PropTypes.Validator<number>;
|
|
45
30
|
skip: PropTypes.Validator<number>;
|
|
46
31
|
total: PropTypes.Validator<number>;
|
|
@@ -77,7 +62,9 @@ export default class DropDownList extends React.Component<DropDownListProps, Dro
|
|
|
77
62
|
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
63
|
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
64
|
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
80
|
-
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
65
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>; /**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
81
68
|
delay: PropTypes.Requireable<number>;
|
|
82
69
|
ignoreCase: PropTypes.Requireable<boolean>;
|
|
83
70
|
iconClassName: PropTypes.Requireable<string>;
|
|
@@ -196,3 +183,59 @@ export default class DropDownList extends React.Component<DropDownListProps, Dro
|
|
|
196
183
|
private triggerOnChange;
|
|
197
184
|
private applyState;
|
|
198
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Represents the PropsContext of the `DropDownList` component.
|
|
188
|
+
* Used for global configuration of all `DropDownList` instances.
|
|
189
|
+
*
|
|
190
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
191
|
+
*/
|
|
192
|
+
export declare const DropDownListPropsContext: React.Context<(p: DropDownListProps) => DropDownListProps>;
|
|
193
|
+
/**
|
|
194
|
+
* Represent the `ref` of the DropDownList component.
|
|
195
|
+
*/
|
|
196
|
+
export interface DropDownListHandle extends Pick<DropDownListWithoutContext, keyof DropDownListWithoutContext> {
|
|
197
|
+
/**
|
|
198
|
+
* The index of the selected item.
|
|
199
|
+
*/
|
|
200
|
+
index: number;
|
|
201
|
+
/**
|
|
202
|
+
* Gets the `name` property of the DropDownList.
|
|
203
|
+
*/
|
|
204
|
+
name: string | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* Represents the validity state into which the DropDownList is set.
|
|
207
|
+
*/
|
|
208
|
+
validity: FormComponentValidity;
|
|
209
|
+
/**
|
|
210
|
+
* The value of the DropDownList.
|
|
211
|
+
*/
|
|
212
|
+
value: any;
|
|
213
|
+
}
|
|
214
|
+
/** @hidden */
|
|
215
|
+
export declare type DropDownList = DropDownListHandle;
|
|
216
|
+
/**
|
|
217
|
+
* Represents the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).
|
|
218
|
+
*
|
|
219
|
+
* Accepts properties of type [DropDownListProps]({% slug api_dropdowns_dropdownlistprops %}).
|
|
220
|
+
* Obtaining the `ref` returns an object of type [DropDownListHandle]({% slug api_dropdowns_dropdownlisthandle %}).
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```jsx
|
|
224
|
+
* class App extends React.Component {
|
|
225
|
+
* dropdownlist = null;
|
|
226
|
+
* render() {
|
|
227
|
+
* return (
|
|
228
|
+
* <div>
|
|
229
|
+
* <DropDownList
|
|
230
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
231
|
+
* ref={component => this.dropdownlist = component}
|
|
232
|
+
* />
|
|
233
|
+
* <button onClick={() => alert(this.dropdownlist.value)}>alert value</button>
|
|
234
|
+
* </div>
|
|
235
|
+
* );
|
|
236
|
+
* }
|
|
237
|
+
* }
|
|
238
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
export declare const DropDownList: React.ForwardRefExoticComponent<DropDownListProps & React.RefAttributes<any>>;
|
|
@@ -38,30 +38,11 @@ var kendo_react_common_2 = require("@progress/kendo-react-common");
|
|
|
38
38
|
var package_metadata_1 = require("../package-metadata");
|
|
39
39
|
var VALIDATION_MESSAGE = 'Please select a value from the list!';
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```jsx
|
|
45
|
-
* class App extends React.Component {
|
|
46
|
-
* dropdownlist = null;
|
|
47
|
-
* render() {
|
|
48
|
-
* return (
|
|
49
|
-
* <div>
|
|
50
|
-
* <DropDownList
|
|
51
|
-
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
52
|
-
* ref={component => this.dropdownlist = component}
|
|
53
|
-
* />
|
|
54
|
-
* <button onClick={() => alert(this.dropdownlist.value)}>alert value</button>
|
|
55
|
-
* </div>
|
|
56
|
-
* );
|
|
57
|
-
* }
|
|
58
|
-
* }
|
|
59
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
60
|
-
* ```
|
|
41
|
+
* @hidden
|
|
61
42
|
*/
|
|
62
|
-
var
|
|
63
|
-
__extends(
|
|
64
|
-
function
|
|
43
|
+
var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
44
|
+
__extends(DropDownListWithoutContext, _super);
|
|
45
|
+
function DropDownListWithoutContext(props) {
|
|
65
46
|
var _this = _super.call(this, props) || this;
|
|
66
47
|
/**
|
|
67
48
|
* @hidden
|
|
@@ -362,7 +343,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
362
343
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
363
344
|
return _this;
|
|
364
345
|
}
|
|
365
|
-
Object.defineProperty(
|
|
346
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "element", {
|
|
366
347
|
/**
|
|
367
348
|
* @hidden
|
|
368
349
|
*/
|
|
@@ -372,7 +353,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
372
353
|
enumerable: true,
|
|
373
354
|
configurable: true
|
|
374
355
|
});
|
|
375
|
-
Object.defineProperty(
|
|
356
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "actionElement", {
|
|
376
357
|
/**
|
|
377
358
|
* @hidden
|
|
378
359
|
*/
|
|
@@ -382,7 +363,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
382
363
|
enumerable: true,
|
|
383
364
|
configurable: true
|
|
384
365
|
});
|
|
385
|
-
Object.defineProperty(
|
|
366
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "value", {
|
|
386
367
|
/**
|
|
387
368
|
* The value of the DropDownList.
|
|
388
369
|
*/
|
|
@@ -408,7 +389,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
408
389
|
enumerable: true,
|
|
409
390
|
configurable: true
|
|
410
391
|
});
|
|
411
|
-
Object.defineProperty(
|
|
392
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "index", {
|
|
412
393
|
/**
|
|
413
394
|
* The index of the selected item.
|
|
414
395
|
*/
|
|
@@ -421,7 +402,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
421
402
|
enumerable: true,
|
|
422
403
|
configurable: true
|
|
423
404
|
});
|
|
424
|
-
Object.defineProperty(
|
|
405
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "name", {
|
|
425
406
|
/**
|
|
426
407
|
* Gets the `name` property of the DropDownList.
|
|
427
408
|
*/
|
|
@@ -431,7 +412,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
431
412
|
enumerable: true,
|
|
432
413
|
configurable: true
|
|
433
414
|
});
|
|
434
|
-
Object.defineProperty(
|
|
415
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "validity", {
|
|
435
416
|
/**
|
|
436
417
|
* Represents the validity state into which the DropDownList is set.
|
|
437
418
|
*/
|
|
@@ -449,23 +430,23 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
449
430
|
enumerable: true,
|
|
450
431
|
configurable: true
|
|
451
432
|
});
|
|
452
|
-
Object.defineProperty(
|
|
433
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "validityStyles", {
|
|
453
434
|
get: function () {
|
|
454
435
|
return this.props.validityStyles !== undefined
|
|
455
436
|
? this.props.validityStyles
|
|
456
|
-
:
|
|
437
|
+
: DropDownListWithoutContext.defaultProps.validityStyles;
|
|
457
438
|
},
|
|
458
439
|
enumerable: true,
|
|
459
440
|
configurable: true
|
|
460
441
|
});
|
|
461
|
-
Object.defineProperty(
|
|
442
|
+
Object.defineProperty(DropDownListWithoutContext.prototype, "required", {
|
|
462
443
|
/**
|
|
463
444
|
* @hidden
|
|
464
445
|
*/
|
|
465
446
|
get: function () {
|
|
466
447
|
return this.props.required !== undefined
|
|
467
448
|
? this.props.required
|
|
468
|
-
:
|
|
449
|
+
: DropDownListWithoutContext.defaultProps.required;
|
|
469
450
|
},
|
|
470
451
|
enumerable: true,
|
|
471
452
|
configurable: true
|
|
@@ -473,7 +454,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
473
454
|
/**
|
|
474
455
|
* @hidden
|
|
475
456
|
*/
|
|
476
|
-
|
|
457
|
+
DropDownListWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
477
458
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual;
|
|
478
459
|
var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
|
|
479
460
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -521,14 +502,14 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
521
502
|
/**
|
|
522
503
|
* @hidden
|
|
523
504
|
*/
|
|
524
|
-
|
|
505
|
+
DropDownListWithoutContext.prototype.componentDidMount = function () {
|
|
525
506
|
this.base.didMount();
|
|
526
507
|
this.setValidity();
|
|
527
508
|
};
|
|
528
509
|
/**
|
|
529
510
|
* @hidden
|
|
530
511
|
*/
|
|
531
|
-
|
|
512
|
+
DropDownListWithoutContext.prototype.render = function () {
|
|
532
513
|
var _this = this;
|
|
533
514
|
var _a = this.props, style = _a.style, className = _a.className, label = _a.label, dir = _a.dir, virtual = _a.virtual;
|
|
534
515
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
@@ -554,7 +535,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
554
535
|
/**
|
|
555
536
|
* @hidden
|
|
556
537
|
*/
|
|
557
|
-
|
|
538
|
+
DropDownListWithoutContext.prototype.onNavigate = function (state, keyCode) {
|
|
558
539
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0, total: 0, pageSize: 0 } : _c;
|
|
559
540
|
var vs = this.base.vs;
|
|
560
541
|
var value = this.value;
|
|
@@ -570,7 +551,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
570
551
|
}
|
|
571
552
|
this.applyState(state);
|
|
572
553
|
};
|
|
573
|
-
|
|
554
|
+
DropDownListWithoutContext.prototype.focusedIndex = function () {
|
|
574
555
|
var filterText = utils_1.isPresent(this.props.filter) ? this.props.filter : this.state.text;
|
|
575
556
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, dataItemKey = _a.dataItemKey, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
|
|
576
557
|
var value = this.value;
|
|
@@ -584,13 +565,13 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
584
565
|
return !hasSelected && virtual.skip === 0 ? 0 : undefined;
|
|
585
566
|
}
|
|
586
567
|
};
|
|
587
|
-
|
|
568
|
+
DropDownListWithoutContext.prototype.focusElement = function (element) {
|
|
588
569
|
var _this = this;
|
|
589
570
|
this._skipFocusEvent = true;
|
|
590
571
|
element.focus();
|
|
591
572
|
window.setTimeout(function () { return _this._skipFocusEvent = false; }, 30);
|
|
592
573
|
};
|
|
593
|
-
|
|
574
|
+
DropDownListWithoutContext.prototype.triggerOnChange = function (item, state) {
|
|
594
575
|
if (utils_1.areSame(this.value, item, this.props.dataItemKey)) {
|
|
595
576
|
return;
|
|
596
577
|
}
|
|
@@ -600,18 +581,54 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
600
581
|
this._valueDuringOnChange = item;
|
|
601
582
|
state.events.push({ type: 'onChange' });
|
|
602
583
|
};
|
|
603
|
-
|
|
584
|
+
DropDownListWithoutContext.prototype.applyState = function (state) {
|
|
604
585
|
this.base.applyState(state);
|
|
605
586
|
this._valueDuringOnChange = undefined;
|
|
606
587
|
};
|
|
588
|
+
DropDownListWithoutContext.displayName = 'DropDownList';
|
|
607
589
|
/**
|
|
608
590
|
* @hidden
|
|
609
591
|
*/
|
|
610
|
-
|
|
592
|
+
DropDownListWithoutContext.propTypes = __assign({ delay: PropTypes.number, ignoreCase: PropTypes.bool, iconClassName: PropTypes.string, defaultItem: PropTypes.any, valueRender: PropTypes.func, valueMap: PropTypes.func, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, leftRightKeysNavigation: PropTypes.bool, title: PropTypes.string }, DropDownBase_1.default.propTypes);
|
|
611
593
|
/**
|
|
612
594
|
* @hidden
|
|
613
595
|
*/
|
|
614
|
-
|
|
615
|
-
return
|
|
596
|
+
DropDownListWithoutContext.defaultProps = __assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase_1.default.defaultProps, { required: false });
|
|
597
|
+
return DropDownListWithoutContext;
|
|
616
598
|
}(React.Component));
|
|
617
|
-
exports.
|
|
599
|
+
exports.DropDownListWithoutContext = DropDownListWithoutContext;
|
|
600
|
+
/**
|
|
601
|
+
* Represents the PropsContext of the `DropDownList` component.
|
|
602
|
+
* Used for global configuration of all `DropDownList` instances.
|
|
603
|
+
*
|
|
604
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
605
|
+
*/
|
|
606
|
+
exports.DropDownListPropsContext = kendo_react_common_1.createPropsContext();
|
|
607
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
608
|
+
/**
|
|
609
|
+
* Represents the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).
|
|
610
|
+
*
|
|
611
|
+
* Accepts properties of type [DropDownListProps]({% slug api_dropdowns_dropdownlistprops %}).
|
|
612
|
+
* Obtaining the `ref` returns an object of type [DropDownListHandle]({% slug api_dropdowns_dropdownlisthandle %}).
|
|
613
|
+
*
|
|
614
|
+
* @example
|
|
615
|
+
* ```jsx
|
|
616
|
+
* class App extends React.Component {
|
|
617
|
+
* dropdownlist = null;
|
|
618
|
+
* render() {
|
|
619
|
+
* return (
|
|
620
|
+
* <div>
|
|
621
|
+
* <DropDownList
|
|
622
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
623
|
+
* ref={component => this.dropdownlist = component}
|
|
624
|
+
* />
|
|
625
|
+
* <button onClick={() => alert(this.dropdownlist.value)}>alert value</button>
|
|
626
|
+
* </div>
|
|
627
|
+
* );
|
|
628
|
+
* }
|
|
629
|
+
* }
|
|
630
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
631
|
+
* ```
|
|
632
|
+
*/
|
|
633
|
+
exports.DropDownList = kendo_react_common_1.withPropsContext(exports.DropDownListPropsContext, DropDownListWithoutContext);
|
|
634
|
+
exports.DropDownList.displayName = 'KendoReactDropDownList';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import DropDownList from './DropDownList';
|
|
2
|
+
import { DropDownList } from './DropDownList';
|
|
3
3
|
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent } from './../common/events';
|
|
4
4
|
import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
|
|
5
5
|
import { ListItemProps } from '../common/ListItem';
|
|
@@ -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>>;
|