@progress/kendo-react-dropdowns 4.14.1-dev.202201181415 → 5.0.1-dev.202201200659

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 (71) hide show
  1. package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
  2. package/dist/es/AutoComplete/AutoComplete.d.ts +7 -4
  3. package/dist/es/AutoComplete/AutoComplete.js +30 -19
  4. package/dist/es/AutoComplete/AutoCompleteProps.d.ts +37 -0
  5. package/dist/es/ComboBox/ComboBox.d.ts +8 -1
  6. package/dist/es/ComboBox/ComboBox.js +46 -33
  7. package/dist/es/ComboBox/ComboBoxProps.d.ts +37 -0
  8. package/dist/es/DropDownList/DropDownList.d.ts +6 -8
  9. package/dist/es/DropDownList/DropDownList.js +56 -48
  10. package/dist/es/DropDownList/DropDownListProps.d.ts +37 -0
  11. package/dist/es/DropDownTree/DropDownTree.js +44 -24
  12. package/dist/es/DropDownTree/DropDownTreeProps.d.ts +37 -0
  13. package/dist/es/MultiColumnComboBox/MultiColumnComboBox.d.ts +37 -0
  14. package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +23 -12
  15. package/dist/es/MultiSelect/MultiSelect.d.ts +8 -5
  16. package/dist/es/MultiSelect/MultiSelect.js +51 -32
  17. package/dist/es/MultiSelect/MultiSelectProps.d.ts +38 -1
  18. package/dist/es/MultiSelect/TagList.d.ts +2 -1
  19. package/dist/es/MultiSelect/TagList.js +10 -15
  20. package/dist/es/MultiSelectTree/MultiSelectTree.js +42 -29
  21. package/dist/es/MultiSelectTree/MultiSelectTreeProps.d.ts +37 -0
  22. package/dist/es/common/ClearButton.js +2 -1
  23. package/dist/es/common/DropDownBase.d.ts +2 -3
  24. package/dist/es/common/DropDownBase.js +2 -16
  25. package/dist/es/common/List.d.ts +1 -0
  26. package/dist/es/common/List.js +3 -2
  27. package/dist/es/common/ListDefaultItem.js +2 -2
  28. package/dist/es/common/ListFilter.d.ts +5 -0
  29. package/dist/es/common/ListFilter.js +12 -3
  30. package/dist/es/common/ListItem.js +5 -5
  31. package/dist/es/common/MultiColumnList.js +1 -1
  32. package/dist/es/common/SearchBar.d.ts +1 -4
  33. package/dist/es/common/SearchBar.js +2 -8
  34. package/dist/es/common/VirtualScroll.js +3 -2
  35. package/dist/es/package-metadata.js +1 -1
  36. package/dist/npm/AutoComplete/AutoComplete.d.ts +7 -4
  37. package/dist/npm/AutoComplete/AutoComplete.js +29 -18
  38. package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +37 -0
  39. package/dist/npm/ComboBox/ComboBox.d.ts +8 -1
  40. package/dist/npm/ComboBox/ComboBox.js +45 -32
  41. package/dist/npm/ComboBox/ComboBoxProps.d.ts +37 -0
  42. package/dist/npm/DropDownList/DropDownList.d.ts +6 -8
  43. package/dist/npm/DropDownList/DropDownList.js +55 -47
  44. package/dist/npm/DropDownList/DropDownListProps.d.ts +37 -0
  45. package/dist/npm/DropDownTree/DropDownTree.js +43 -23
  46. package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +37 -0
  47. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +37 -0
  48. package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +22 -11
  49. package/dist/npm/MultiSelect/MultiSelect.d.ts +8 -5
  50. package/dist/npm/MultiSelect/MultiSelect.js +50 -31
  51. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +38 -1
  52. package/dist/npm/MultiSelect/TagList.d.ts +2 -1
  53. package/dist/npm/MultiSelect/TagList.js +10 -15
  54. package/dist/npm/MultiSelectTree/MultiSelectTree.js +40 -27
  55. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +37 -0
  56. package/dist/npm/common/ClearButton.js +2 -1
  57. package/dist/npm/common/DropDownBase.d.ts +2 -3
  58. package/dist/npm/common/DropDownBase.js +2 -16
  59. package/dist/npm/common/List.d.ts +1 -0
  60. package/dist/npm/common/List.js +3 -2
  61. package/dist/npm/common/ListDefaultItem.js +2 -2
  62. package/dist/npm/common/ListFilter.d.ts +5 -0
  63. package/dist/npm/common/ListFilter.js +12 -3
  64. package/dist/npm/common/ListItem.js +5 -5
  65. package/dist/npm/common/MultiColumnList.js +1 -1
  66. package/dist/npm/common/SearchBar.d.ts +1 -4
  67. package/dist/npm/common/SearchBar.js +2 -8
  68. package/dist/npm/common/VirtualScroll.js +3 -2
  69. package/dist/npm/package-metadata.js +1 -1
  70. package/dist/systemjs/kendo-react-dropdowns.js +1 -1
  71. package/package.json +19 -13
@@ -24,6 +24,9 @@ export declare class AutoCompleteWithoutContext extends React.Component<AutoComp
24
24
  * @hidden
25
25
  */
26
26
  static propTypes: {
27
+ size: PropTypes.Requireable<"small" | "medium" | "large">;
28
+ rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
29
+ fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
27
30
  suggest: PropTypes.Requireable<string | boolean>;
28
31
  placeholder: PropTypes.Requireable<string>;
29
32
  value: PropTypes.Requireable<string>;
@@ -53,11 +56,8 @@ export declare class AutoCompleteWithoutContext extends React.Component<AutoComp
53
56
  }>>;
54
57
  popupClass: PropTypes.Requireable<string>;
55
58
  className: PropTypes.Requireable<string>;
56
- appendTo: PropTypes.Requireable<any>;
59
+ appendTo: PropTypes.Requireable<PropTypes.ReactElementLike>;
57
60
  width: PropTypes.Requireable<string | number>;
58
- /**
59
- * @hidden
60
- */
61
61
  height: PropTypes.Requireable<string | number>;
62
62
  }>>;
63
63
  onOpen: PropTypes.Requireable<(...args: any[]) => any>;
@@ -75,6 +75,9 @@ export declare class AutoCompleteWithoutContext extends React.Component<AutoComp
75
75
  * @hidden
76
76
  */
77
77
  static defaultProps: {
78
+ size: "small" | "medium" | "large";
79
+ rounded: "small" | "medium" | "large" | "full";
80
+ fillMode: "solid" | "flat" | "outline";
78
81
  popupSettings: {
79
82
  height: string;
80
83
  };
@@ -29,11 +29,13 @@ 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, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
32
+ import { guid, Keys, classNames, createPropsContext, withPropsContext, kendoThemeMaps } 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
+ import ClearButton from '../common/ClearButton';
36
37
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
38
+ var sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;
37
39
  /** @hidden */
38
40
  var AutoCompleteWithoutContext = /** @class */ (function (_super) {
39
41
  __extends(AutoCompleteWithoutContext, _super);
@@ -288,9 +290,9 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
288
290
  */
289
291
  AutoCompleteWithoutContext.prototype.render = function () {
290
292
  var _this = this;
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;
293
+ var _a;
294
+ var _b = this.props, dir = _b.dir, disabled = _b.disabled, label = _b.label, className = _b.className, style = _b.style, loading = _b.loading, suggest = _b.suggest, size = _b.size, rounded = _b.rounded, fillMode = _b.fillMode;
292
295
  var isValid = !this.validityStyles || this.validity.valid;
293
- var focused = this.state.focused;
294
296
  var base = this.base;
295
297
  var value = this.value;
296
298
  var renderClearButton = this.props.clearButton !== false && !loading && !!value;
@@ -298,18 +300,24 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
298
300
  if (typeof suggest === 'string') {
299
301
  this._suggested = suggest;
300
302
  }
301
- var autoComplete = (React.createElement("span", { className: classNames('k-widget k-autocomplete', className, {
302
- 'k-state-disabled': disabled,
303
- 'k-state-focused': focused && !disabled,
304
- 'k-state-invalid': !isValid
305
- }), ref: function (element) {
303
+ var autoComplete = (React.createElement("span", { className: classNames('k-autocomplete k-input', className, (_a = {},
304
+ _a["k-input-" + (sizeMap[size] || size)] = size,
305
+ _a["k-rounded-" + (roundedMap[rounded] || rounded)] = rounded,
306
+ _a["k-input-" + fillMode] = fillMode,
307
+ _a['k-valid'] = isValid,
308
+ _a['k-invalid'] = !isValid,
309
+ _a['k-loading'] = loading,
310
+ _a['k-required'] = this.required,
311
+ _a['k-disabled'] = disabled,
312
+ _a)), ref: function (element) {
306
313
  _this._element = element;
307
314
  base.wrapper = element;
308
315
  }, style: !label
309
316
  ? style
310
317
  : __assign({}, style, { width: undefined }), dir: dir },
311
- this.renderSearchBar(renderClearButton, value || '', id),
318
+ this.renderSearchBar(value || '', id),
312
319
  loading && React.createElement("span", { className: "k-icon k-i-loading" }),
320
+ renderClearButton && !loading && React.createElement(ClearButton, { onClick: this.clearButtonClick, key: "clearbutton" }),
313
321
  this.renderListContainer()));
314
322
  return label
315
323
  ? (React.createElement(FloatingLabel, { label: label, editorId: id, editorValue: value, editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: autoComplete }))
@@ -353,17 +361,18 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
353
361
  }
354
362
  this.applyState(state);
355
363
  };
356
- AutoCompleteWithoutContext.prototype.renderSearchBar = function (clearButton, value, id) {
364
+ AutoCompleteWithoutContext.prototype.renderSearchBar = function (value, id) {
357
365
  var _this = this;
358
366
  var base = this.base;
359
367
  var _a = this.props, placeholder = _a.placeholder, tabIndex = _a.tabIndex, disabled = _a.disabled, readonly = _a.readonly;
360
368
  var focused = this.state.focused;
361
369
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
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 }));
370
+ 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", ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, render: this.props.valueRender }));
363
371
  };
364
372
  AutoCompleteWithoutContext.prototype.renderListContainer = function () {
373
+ var _a;
365
374
  var base = this.base;
366
- var _a = this.props, dir = _a.dir, header = _a.header, footer = _a.footer, _b = _a.data, data = _b === void 0 ? [] : _b;
375
+ var _b = this.props, dir = _b.dir, header = _b.header, footer = _b.footer, _c = _b.data, data = _c === void 0 ? [] : _c, size = _b.size;
367
376
  var popupSettings = base.getPopupSettings();
368
377
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
369
378
  var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
@@ -371,13 +380,15 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
371
380
  animate: popupSettings.animate,
372
381
  anchor: this.element,
373
382
  show: opened,
374
- popupClass: popupSettings.popupClass,
375
- className: classNames('k-list-container k-reset', popupSettings.className),
383
+ popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {},
384
+ _a["k-list-" + (sizeMap[size] || size)] = size,
385
+ _a)),
386
+ className: popupSettings.className,
376
387
  appendTo: popupSettings.appendTo
377
388
  }, dir: dir !== undefined ? dir : this.base.dirCalculated, itemsCount: [data.length] },
378
- header,
389
+ header && React.createElement("div", { className: "k-list-header" }, header),
379
390
  this.renderList(),
380
- footer));
391
+ footer && React.createElement("div", { className: "k-list-footer" }, footer)));
381
392
  };
382
393
  AutoCompleteWithoutContext.prototype.renderList = function () {
383
394
  var base = this.base;
@@ -385,7 +396,7 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
385
396
  var _a = this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;
386
397
  var value = this.value;
387
398
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
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(); } }));
399
+ 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-content", onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); } }));
389
400
  };
390
401
  AutoCompleteWithoutContext.prototype.triggerOnChange = function (newValue, state, eventArgs) {
391
402
  if (this.value === newValue && !eventArgs) {
@@ -425,11 +436,11 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
425
436
  /**
426
437
  * @hidden
427
438
  */
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 });
439
+ AutoCompleteWithoutContext.propTypes = __assign({}, DropDownBase.basicPropTypes, { size: PropTypes.oneOf([null, 'small', 'medium', 'large']), rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']), fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']), 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 });
429
440
  /**
430
441
  * @hidden
431
442
  */
432
- AutoCompleteWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps);
443
+ AutoCompleteWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps, { size: 'medium', rounded: 'medium', fillMode: 'solid' });
433
444
  return AutoCompleteWithoutContext;
434
445
  }(React.Component));
435
446
  export { AutoCompleteWithoutContext };
@@ -177,4 +177,41 @@ export interface AutoCompleteProps extends FormComponentProps {
177
177
  * Sets the footer component of the AutoComplete ([see example]({% slug customrendering_autocomplete %}#toc-headers-and-footers)).
178
178
  */
179
179
  footer?: React.ReactNode;
180
+ /**
181
+ * Configures the `size` of the AutoComplete.
182
+ *
183
+ * The available options are:
184
+ * - small
185
+ * - medium
186
+ * - large
187
+ * - null&mdash;Does not set a size `className`.
188
+ *
189
+ * @default `medium`
190
+ */
191
+ size?: null | 'small' | 'medium' | 'large';
192
+ /**
193
+ * Configures the `roundness` of the AutoComplete.
194
+ *
195
+ * The available options are:
196
+ * - small
197
+ * - medium
198
+ * - large
199
+ * - full
200
+ * - null&mdash;Does not set a rounded `className`.
201
+ *
202
+ * @default `medium`
203
+ */
204
+ rounded?: null | 'small' | 'medium' | 'large' | 'full';
205
+ /**
206
+ * Configures the `fillMode` of the AutoComplete.
207
+ *
208
+ * The available options are:
209
+ * - solid
210
+ * - flat
211
+ * - outline
212
+ * - null&mdash;Does not set a fillMode `className`.
213
+ *
214
+ * @default `solid`
215
+ */
216
+ fillMode?: null | 'solid' | 'flat' | 'outline';
180
217
  }
@@ -24,6 +24,9 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
24
24
  * @hidden
25
25
  */
26
26
  static propTypes: {
27
+ size: PropTypes.Requireable<"small" | "medium" | "large">;
28
+ rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full">;
29
+ fillMode: PropTypes.Requireable<"solid" | "flat" | "outline">;
27
30
  dataItemKey: PropTypes.Requireable<string>;
28
31
  groupField: PropTypes.Requireable<string>;
29
32
  suggest: PropTypes.Requireable<boolean>;
@@ -66,7 +69,7 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
66
69
  }>>;
67
70
  popupClass: PropTypes.Requireable<string>;
68
71
  className: PropTypes.Requireable<string>;
69
- appendTo: PropTypes.Requireable<any>;
72
+ appendTo: PropTypes.Requireable<PropTypes.ReactElementLike>;
70
73
  width: PropTypes.Requireable<string | number>;
71
74
  height: PropTypes.Requireable<string | number>;
72
75
  }>>;
@@ -85,6 +88,9 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
85
88
  * @hidden
86
89
  */
87
90
  static defaultProps: {
91
+ size: "small" | "medium" | "large";
92
+ rounded: "small" | "medium" | "large" | "full";
93
+ fillMode: "solid" | "flat" | "outline";
88
94
  allowCustom: boolean;
89
95
  clearButton: boolean;
90
96
  required: boolean;
@@ -155,6 +161,7 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
155
161
  * @hidden
156
162
  */
157
163
  onNavigate(state: InternalState, keyCode: number): void;
164
+ private componentRef;
158
165
  private toggleBtnClick;
159
166
  private applyValueOnEnter;
160
167
  private applyValueOnRejectSuggestions;
@@ -25,7 +25,7 @@ var __assign = (this && this.__assign) || function () {
25
25
  import * as React from 'react';
26
26
  import * as PropTypes from 'prop-types';
27
27
  import DropDownBase from '../common/DropDownBase';
28
- import { guid, classNames, Keys, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
28
+ import { guid, classNames, Keys, createPropsContext, withPropsContext, kendoThemeMaps } from '@progress/kendo-react-common';
29
29
  import { FloatingLabel } from '@progress/kendo-react-labels';
30
30
  import { areSame, itemIndexStartsWith, getItemIndexByText, getItemValue, isPresent, suggestValue } from '../common/utils';
31
31
  import SearchBar from '../common/SearchBar';
@@ -33,7 +33,9 @@ import ListContainer from '../common/ListContainer';
33
33
  import List from '../common/List';
34
34
  import { validatePackage } from '@progress/kendo-react-common';
35
35
  import { packageMetadata } from '../package-metadata';
36
+ import ClearButton from '../common/ClearButton';
36
37
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
38
+ var sizeMap = kendoThemeMaps.sizeMap, roundedMap = kendoThemeMaps.roundedMap;
37
39
  /** @hidden */
38
40
  var ComboBoxWithoutContext = /** @class */ (function (_super) {
39
41
  __extends(ComboBoxWithoutContext, _super);
@@ -71,6 +73,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
71
73
  _this.base.triggerPageChangeCornerItems(item, state);
72
74
  }
73
75
  };
76
+ _this.componentRef = function (element) {
77
+ _this._element = element;
78
+ _this.base.wrapper = element;
79
+ };
74
80
  _this.toggleBtnClick = function (event) {
75
81
  var state = _this.base.initState();
76
82
  state.syntheticEvent = event;
@@ -78,11 +84,12 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
78
84
  _this.applyState(state);
79
85
  };
80
86
  _this.onScroll = function (event) {
81
- var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, groupField = _a.groupField;
87
+ var _a = _this.base, vs = _a.vs, list = _a.list;
88
+ vs.scrollHandler(event);
89
+ var _b = _this.props, _c = _b.data, data = _c === void 0 ? [] : _c, groupField = _b.groupField;
82
90
  if (!groupField || !data.length) {
83
91
  return;
84
92
  }
85
- var _c = _this.base, vs = _c.vs, list = _c.list;
86
93
  var itemHeight = _this.itemHeight =
87
94
  _this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));
88
95
  var target = event.target;
@@ -347,9 +354,8 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
347
354
  * @hidden
348
355
  */
349
356
  ComboBoxWithoutContext.prototype.render = function () {
350
- var _this = this;
351
- 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;
352
- var focused = this.state.focused;
357
+ var _a, _b;
358
+ var _c = this.props, dir = _c.dir, disabled = _c.disabled, _d = _c.clearButton, clearButton = _d === void 0 ? ComboBoxWithoutContext.defaultProps.clearButton : _d, label = _c.label, textField = _c.textField, className = _c.className, style = _c.style, loading = _c.loading, iconClassName = _c.iconClassName, virtual = _c.virtual, size = _c.size, rounded = _c.rounded, fillMode = _c.fillMode;
353
359
  var isValid = !this.validityStyles || this.validity.valid;
354
360
  var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
355
361
  var selectedItemText = getItemValue(this.value, textField);
@@ -364,22 +370,27 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
364
370
  vs.total = virtual.total;
365
371
  vs.pageSize = virtual.pageSize;
366
372
  }
367
- var combobox = (React.createElement("span", { className: classNames('k-widget k-combobox', {
368
- 'k-combobox-clearable': clearButton,
369
- 'k-state-invalid': !isValid
370
- }, className), ref: function (element) { return _this._element = element; }, style: !label
373
+ var combobox = (React.createElement("span", { className: classNames('k-combobox k-input', (_a = {},
374
+ _a["k-input-" + (sizeMap[size] || size)] = size,
375
+ _a["k-rounded-" + (roundedMap[rounded] || rounded)] = rounded,
376
+ _a["k-input-" + fillMode] = fillMode,
377
+ _a['k-valid'] = isValid,
378
+ _a['k-invalid'] = !isValid,
379
+ _a['k-loading'] = loading,
380
+ _a['k-required'] = this.required,
381
+ _a['k-disabled'] = disabled,
382
+ _a), className), ref: this.componentRef, style: !label
371
383
  ? style
372
384
  : __assign({}, style, { width: undefined }), dir: dir },
373
- React.createElement("span", { ref: function (wrapper) { return base.wrapper = wrapper; }, className: classNames('k-dropdown-wrap', {
374
- 'k-state-disabled': disabled,
375
- 'k-state-focused': focused && !disabled
376
- }) },
377
- this.renderSearchBar(renderClearButton, inputText || '', id),
378
- React.createElement("span", { className: "k-select", onClick: this.toggleBtnClick, onMouseDown: function (e) { return e.preventDefault(); } },
379
- React.createElement("span", { className: classNames('k-icon', iconClassName, {
380
- 'k-i-arrow-s': !loading && !iconClassName,
381
- 'k-i-loading': loading && !iconClassName
382
- }) }))),
385
+ this.renderSearchBar(inputText || '', id),
386
+ renderClearButton && !loading && React.createElement(ClearButton, { onClick: this.clearButtonClick, key: "clearbutton" }),
387
+ loading && React.createElement("span", { className: "k-icon k-i-loading", key: "loading" }),
388
+ React.createElement("button", { type: "button", className: classNames('k-input-button k-button k-icon-button', (_b = {},
389
+ _b["k-button-" + (sizeMap[size] || size)] = size,
390
+ _b["k-button-" + fillMode] = fillMode,
391
+ _b["k-button-" + fillMode + "-base"] = fillMode,
392
+ _b)), onClick: this.toggleBtnClick, onMouseDown: function (e) { return e.preventDefault(); } },
393
+ React.createElement("span", { className: classNames('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
383
394
  this.renderListContainer()));
384
395
  return label
385
396
  ? (React.createElement(FloatingLabel, { label: label, editorId: id, editorValue: inputText, editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: combobox }))
@@ -496,8 +507,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
496
507
  return this.applyState(state);
497
508
  };
498
509
  ComboBoxWithoutContext.prototype.renderListContainer = function () {
510
+ var _a;
499
511
  var base = this.base;
500
- var _a = this.props, dir = _a.dir, header = _a.header, footer = _a.footer, _b = _a.data, data = _b === void 0 ? [] : _b, groupField = _a.groupField;
512
+ var _b = this.props, dir = _b.dir, header = _b.header, footer = _b.footer, _c = _b.data, data = _c === void 0 ? [] : _c, groupField = _b.groupField, size = _b.size;
501
513
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
502
514
  var popupSettings = base.getPopupSettings();
503
515
  var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
@@ -509,14 +521,17 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
509
521
  animate: popupSettings.animate,
510
522
  anchor: this.element,
511
523
  show: opened,
512
- popupClass: popupSettings.popupClass,
513
- className: classNames('k-list-container k-reset', popupSettings.className),
524
+ popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {},
525
+ _a["k-list-" + (sizeMap[size] || size)] = size,
526
+ _a['k-virtual-list'] = this.base.vs.enabled,
527
+ _a)),
528
+ className: popupSettings.className,
514
529
  appendTo: popupSettings.appendTo
515
530
  }, dir: dir !== undefined ? dir : this.base.dirCalculated, itemsCount: [data.length] },
516
- header,
531
+ header && React.createElement("div", { className: "k-list-header" }, header),
517
532
  group && React.createElement("div", { className: "k-group-header" }, group),
518
- base.renderScrollWrapper([this.renderList(), base.renderScrollElement()], this.onScroll),
519
- footer));
533
+ this.renderList(),
534
+ footer && React.createElement("div", { className: "k-list-footer" }, footer)));
520
535
  };
521
536
  ComboBoxWithoutContext.prototype.renderList = function () {
522
537
  var _this = this;
@@ -532,11 +547,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
532
547
  var selectedItemText = getItemValue(this.value, textField);
533
548
  var value = isPresent(text) && text !== selectedItemText ? null : this.value;
534
549
  var ListComponent = this.props.list || List;
535
- return (React.createElement(ListComponent, { id: base.listBoxId, show: opened, data: data, focusedIndex: focusedIndex, value: value, textField: textField, valueField: dataItemKey, groupField: this.props.groupField, optionsGuid: base.guid, listRef: function (list) { vs.list = _this.base.list = list; _this.itemHeight = 0; }, wrapperStyle: !vs.enabled ?
536
- { maxHeight: popupSettings.height } : { float: 'left', width: '100%' }, wrapperCssClass: !vs.enabled ? 'k-list-scroller' : undefined, listStyle: vs.enabled ?
537
- { transform: translate } : undefined, key: "listkey", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll }));
550
+ return (React.createElement(ListComponent, { id: base.listBoxId, show: opened, data: data, focusedIndex: focusedIndex, value: value, textField: textField, valueField: dataItemKey, groupField: this.props.groupField, optionsGuid: base.guid, listRef: function (list) { vs.list = _this.base.list = list; _this.itemHeight = 0; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: "k-list-content", listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll, wrapperRef: vs.scrollerRef, scroller: this.base.renderScrollElement() }));
538
551
  };
539
- ComboBoxWithoutContext.prototype.renderSearchBar = function (clearButton, text, id) {
552
+ ComboBoxWithoutContext.prototype.renderSearchBar = function (text, id) {
540
553
  var _this = this;
541
554
  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;
542
555
  var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
@@ -545,7 +558,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
545
558
  if (this._suggested && !areSame(this._valueOnDidUpdate, value, dataItemKey)) {
546
559
  this._suggested = '';
547
560
  }
548
- return (React.createElement(SearchBar, { 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 }));
561
+ return (React.createElement(SearchBar, { 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", ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, render: this.props.valueRender }));
549
562
  };
550
563
  ComboBoxWithoutContext.prototype.triggerOnChange = function (item, state) {
551
564
  var value = this.value;
@@ -584,11 +597,11 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
584
597
  /**
585
598
  * @hidden
586
599
  */
587
- ComboBoxWithoutContext.propTypes = __assign({}, DropDownBase.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 });
600
+ ComboBoxWithoutContext.propTypes = __assign({}, DropDownBase.propTypes, { size: PropTypes.oneOf([null, 'small', 'medium', 'large']), rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']), fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']), 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 });
588
601
  /**
589
602
  * @hidden
590
603
  */
591
- ComboBoxWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps, { allowCustom: false, clearButton: true, required: false });
604
+ ComboBoxWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps, { size: 'medium', rounded: 'medium', fillMode: 'solid', allowCustom: false, clearButton: true, required: false });
592
605
  return ComboBoxWithoutContext;
593
606
  }(React.Component));
594
607
  export { ComboBoxWithoutContext };
@@ -221,4 +221,41 @@ export interface ComboBoxProps extends FormComponentProps {
221
221
  * @hidden
222
222
  */
223
223
  list?: any;
224
+ /**
225
+ * Configures the `size` of the ComboBox.
226
+ *
227
+ * The available options are:
228
+ * - small
229
+ * - medium
230
+ * - large
231
+ * - null&mdash;Does not set a size `className`.
232
+ *
233
+ * @default `medium`
234
+ */
235
+ size?: null | 'small' | 'medium' | 'large';
236
+ /**
237
+ * Configures the `roundness` of the ComboBox.
238
+ *
239
+ * The available options are:
240
+ * - small
241
+ * - medium
242
+ * - large
243
+ * - full
244
+ * - null&mdash;Does not set a rounded `className`.
245
+ *
246
+ * @default `medium`
247
+ */
248
+ rounded?: null | 'small' | 'medium' | 'large' | 'full';
249
+ /**
250
+ * Configures the `fillMode` of the ComboBox.
251
+ *
252
+ * The available options are:
253
+ * - solid
254
+ * - flat
255
+ * - outline
256
+ * - null&mdash;Does not set a fillMode `className`.
257
+ *
258
+ * @default `solid`
259
+ */
260
+ fillMode?: null | 'solid' | 'flat' | 'outline';
224
261
  }
@@ -23,9 +23,6 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
23
23
  filterable: PropTypes.Requireable<boolean>;
24
24
  filter: PropTypes.Requireable<string>;
25
25
  virtual: PropTypes.Requireable<PropTypes.InferProps<{
26
- /**
27
- * The value of the DropDownList.
28
- */
29
26
  pageSize: PropTypes.Validator<number>;
30
27
  skip: PropTypes.Validator<number>;
31
28
  total: PropTypes.Validator<number>;
@@ -49,7 +46,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
49
46
  }>>;
50
47
  popupClass: PropTypes.Requireable<string>;
51
48
  className: PropTypes.Requireable<string>;
52
- appendTo: PropTypes.Requireable<any>;
49
+ appendTo: PropTypes.Requireable<PropTypes.ReactElementLike>;
53
50
  width: PropTypes.Requireable<string | number>;
54
51
  height: PropTypes.Requireable<string | number>;
55
52
  }>>;
@@ -62,9 +59,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
62
59
  listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
63
60
  focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
64
61
  header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
65
- footer: PropTypes.Requireable<PropTypes.ReactNodeLike>; /**
66
- * @hidden
67
- */
62
+ footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
68
63
  delay: PropTypes.Requireable<number>;
69
64
  ignoreCase: PropTypes.Requireable<boolean>;
70
65
  iconClassName: PropTypes.Requireable<string>;
@@ -84,6 +79,9 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
84
79
  */
85
80
  static defaultProps: {
86
81
  required: boolean;
82
+ size: "small" | "medium" | "large";
83
+ rounded: "small" | "medium" | "large" | "full";
84
+ fillMode: "solid" | "flat" | "outline";
87
85
  popupSettings: {
88
86
  height: string;
89
87
  };
@@ -159,7 +157,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
159
157
  * @hidden
160
158
  */
161
159
  onNavigate(state: InternalState, keyCode: number): void;
162
- private renderDropDownWrapper;
160
+ private componentRef;
163
161
  private dummySelect;
164
162
  private renderListContainer;
165
163
  private renderList;