@rescui/select 0.15.1-RUI-280-Update-select-component-separate-components-e772abaa1.56 → 0.15.1-RUI-280-Update-select-component-downshift-2f40ef205.67

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 (70) hide show
  1. package/lib/_virtual/index.css.js +12 -12
  2. package/lib/constants.d.ts +0 -1
  3. package/lib/constants.js +1 -2
  4. package/lib/hooks/use-a11y.d.ts +29 -0
  5. package/lib/hooks/use-a11y.js +53 -0
  6. package/lib/hooks/use-backward-compatible-id.d.ts +4 -0
  7. package/lib/hooks/use-backward-compatible-id.js +14 -0
  8. package/lib/hooks/use-focus.d.ts +10 -0
  9. package/lib/hooks/use-focus.js +17 -0
  10. package/lib/hooks/use-hover.d.ts +10 -0
  11. package/lib/hooks/use-hover.js +17 -0
  12. package/lib/hooks/use-label-focus.d.ts +1 -3
  13. package/lib/hooks/use-label-focus.js +3 -9
  14. package/lib/hooks/use-multi-handlers.d.ts +11 -0
  15. package/lib/hooks/use-multi-handlers.js +48 -0
  16. package/lib/hooks/use-options.d.ts +13 -0
  17. package/lib/hooks/use-options.js +89 -0
  18. package/lib/index.css +423 -1195
  19. package/lib/multiselect.d.ts +3 -29
  20. package/lib/multiselect.js +250 -180
  21. package/lib/native-select.js +75 -48
  22. package/lib/parts/hidden-select.d.ts +13 -0
  23. package/lib/parts/hidden-select.js +45 -0
  24. package/lib/parts/icons.js +2 -8
  25. package/lib/parts/list-box.d.ts +7 -15
  26. package/lib/parts/list-box.js +50 -82
  27. package/lib/parts/multi-trigger.d.ts +5 -4
  28. package/lib/parts/multi-trigger.js +27 -15
  29. package/lib/public-api.p.css +368 -126
  30. package/lib/public-api.pcss +368 -126
  31. package/lib/select-basic.d.ts +2 -2
  32. package/lib/select-basic.js +160 -103
  33. package/lib/select-searchable.d.ts +2 -2
  34. package/lib/select-searchable.js +205 -127
  35. package/lib/select.d.ts +1 -1
  36. package/lib/select.js +38 -31
  37. package/lib/styles/common.p.module.css.js +28 -24
  38. package/lib/styles/form-trigger.p.module.css.js +12 -12
  39. package/lib/styles/list-box.p.module.css.js +11 -13
  40. package/lib/types.d.ts +26 -27
  41. package/lib/utils/get-real-items-cnt.d.ts +2 -2
  42. package/lib/utils/get-real-items-cnt.js +8 -10
  43. package/lib/utils/item-to-string.d.ts +2 -0
  44. package/lib/utils/item-to-string.js +7 -0
  45. package/lib/utils/merge-props.d.ts +29 -0
  46. package/lib/utils/merge-props.js +106 -0
  47. package/package.json +11 -23
  48. package/lib/hooks/use-css-context-transfer.d.ts +0 -14
  49. package/lib/hooks/use-css-context-transfer.js +0 -40
  50. package/lib/hooks/use-multi-option-serialization.d.ts +0 -10
  51. package/lib/hooks/use-multi-option-serialization.js +0 -82
  52. package/lib/hooks/use-observable-force-rerender.d.ts +0 -2
  53. package/lib/hooks/use-observable-force-rerender.js +0 -16
  54. package/lib/hooks/use-option-serialization.d.ts +0 -10
  55. package/lib/hooks/use-option-serialization.js +0 -59
  56. package/lib/parts/native-select-trigger.d.ts +0 -18
  57. package/lib/parts/native-select-trigger.js +0 -54
  58. package/lib/parts/popover.d.ts +0 -12
  59. package/lib/parts/popover.js +0 -64
  60. package/lib/parts/popup-content.d.ts +0 -19
  61. package/lib/parts/popup-content.js +0 -76
  62. package/lib/styles/native-select-trigger.p.module.css.js +0 -17
  63. package/lib/styles/native-select.p.module.css.js +0 -9
  64. package/lib/styles/popover.p.module.css.js +0 -10
  65. package/lib/utils/convert-options.d.ts +0 -3
  66. package/lib/utils/convert-options.js +0 -52
  67. package/lib/utils/convert-placement.d.ts +0 -3
  68. package/lib/utils/convert-placement.js +0 -22
  69. package/lib/utils/css-vars-utils.d.ts +0 -3
  70. package/lib/utils/css-vars-utils.js +0 -20
@@ -1,29 +1,3 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { MultiselectProps, NoOptionsMessage, SelectOption, SelectOptionOrGroup } from './types';
4
- export declare function Multiselect({ options, value, onChange, error, note, size, mode, theme: themeFromProps, placement, isSingleLine, boldLabel, reserveErrorLine, maxVisibleItems, isClearable, isLoading, isDisabled, ...props }: MultiselectProps): JSX.Element;
5
- export declare namespace Multiselect {
6
- var propTypes: {
7
- className: PropTypes.Requireable<string>;
8
- style: PropTypes.Requireable<object>;
9
- options: React.Validator<SelectOptionOrGroup[]>;
10
- value: React.Validator<SelectOption[]>;
11
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
12
- size: PropTypes.Requireable<string>;
13
- mode: PropTypes.Requireable<string>;
14
- theme: PropTypes.Requireable<string>;
15
- placeholder: PropTypes.Requireable<string>;
16
- isSingleLine: PropTypes.Requireable<boolean>;
17
- isClearable: PropTypes.Requireable<boolean>;
18
- isDisabled: PropTypes.Requireable<boolean>;
19
- isLoading: PropTypes.Requireable<boolean>;
20
- error: React.Validator<React.ReactNode>;
21
- label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
- note: PropTypes.Requireable<PropTypes.ReactNodeLike>;
23
- id: PropTypes.Requireable<string>;
24
- noOptionsMessage: React.Validator<NoOptionsMessage>;
25
- placement: PropTypes.Requireable<string>;
26
- name: PropTypes.Requireable<string>;
27
- boldLabel: PropTypes.Requireable<boolean>;
28
- };
29
- }
1
+ /// <reference types="react" />
2
+ import type { MultiselectProps } from './types';
3
+ export declare function Multiselect({ options, value: selectedItems, onChange, error, label, note, size, mode, theme: themeFromProps, placement, isSingleLine, boldLabel, reserveErrorLine, maxVisibleItems, isClearable, isLoading, isDisabled, name, noOptionsMessage, className, id, style, placeholder, ...rest }: MultiselectProps): JSX.Element;
@@ -1,25 +1,23 @@
1
- "use client";
2
- import React, { useRef } from 'react';
3
- import PropTypes from 'prop-types';
1
+ import React, { useEffect } from 'react';
4
2
  import cn from 'classnames';
5
- import { useSelectState } from '@react-stately/select';
6
- import { useSelect, HiddenSelect } from '@react-aria/select';
7
- import { useButton } from '@react-aria/button';
8
- import { useFocusRing } from '@react-aria/focus';
9
- import { mergeProps } from '@react-aria/utils';
3
+ import { Dropdown } from '@rescui/dropdown';
4
+ import { useSelect } from 'downshift';
10
5
  import { useThemeWithUndefined } from '@rescui/ui-contexts';
11
- import { ErrorMessage } from '@rescui/form-field';
12
- import { optionType, optionsGroupType, noOptionsMessageType } from './common-prop-types.js';
13
- import { PopupContent } from './parts/popup-content.js';
6
+ import scrollIntoView from 'scroll-into-view-if-needed';
7
+ import { useLabelFocus } from './hooks/use-label-focus.js';
8
+ import { useOptions } from './hooks/use-options.js';
9
+ import { useMultiHandlers } from './hooks/use-multi-handlers.js';
10
+ import { useA11y } from './hooks/use-a11y.js';
11
+ import { ListBox } from './parts/list-box.js';
14
12
  import { Icons } from './parts/icons.js';
15
- import { FormTriggerWrapper } from './parts/form-trigger-wrapper.js';
16
13
  import { MultiTrigger } from './parts/multi-trigger.js';
17
- import { useLabelFocus } from './hooks/use-label-focus.js';
18
- import { useMultiOptionSerialization } from './hooks/use-multi-option-serialization.js';
14
+ import { HiddenSelect } from './parts/hidden-select.js';
15
+ import { FormTriggerWrapper } from './parts/form-trigger-wrapper.js';
19
16
  import { getEmptyMessage } from './utils/get-empty-message.js';
20
- import { convertOptions } from './utils/convert-options.js';
21
- import { convertPlacement } from './utils/convert-placement.js';
17
+ import { mergeProps } from './utils/merge-props.js';
18
+ import { itemToString } from './utils/item-to-string.js';
22
19
  import { getOptionValue } from './utils/get-option-value.js';
20
+ import { getRealItemsCnt } from './utils/get-real-items-cnt.js';
23
21
  import styles from './styles/common.p.module.css.js';
24
22
  const THEME_STYLES = {
25
23
  light: styles.themeLight,
@@ -33,83 +31,206 @@ const SIZE_STYLES = {
33
31
  const MODE_STYLES = {
34
32
  classic: styles.classic,
35
33
  rock: styles.rock
34
+ };
35
+
36
+ const stateReducer = (state, actionAndChanges) => {
37
+ const {
38
+ changes,
39
+ type
40
+ } = actionAndChanges; // console.log(type, state, changes);
41
+
42
+ switch (type) {
43
+ case useSelect.stateChangeTypes.ToggleButtonKeyDownEnter:
44
+ case useSelect.stateChangeTypes.ToggleButtonKeyDownSpaceButton:
45
+ case useSelect.stateChangeTypes.ItemClick:
46
+ return { ...changes,
47
+ isOpen: true,
48
+ highlightedIndex: state.highlightedIndex
49
+ };
50
+
51
+ default:
52
+ return { ...changes,
53
+ selectedItem: null
54
+ };
55
+ }
36
56
  }; // eslint-disable-next-line complexity
37
57
 
38
- function MultiselectInner(_ref) {
58
+
59
+ function Multiselect(_ref) {
39
60
  let {
61
+ options = [],
62
+ value: selectedItems = [],
63
+ onChange,
64
+ error,
65
+ label,
66
+ note,
67
+ size = 'm',
68
+ mode = 'classic',
69
+ theme: themeFromProps,
70
+ placement = 'bottom',
71
+ isSingleLine = false,
72
+ boldLabel = true,
73
+ reserveErrorLine = false,
74
+ maxVisibleItems = 5,
75
+ isClearable = false,
76
+ isLoading = false,
77
+ isDisabled = false,
78
+ name,
79
+ noOptionsMessage,
80
+ className,
40
81
  id,
41
- size,
42
- mode,
43
- theme,
44
82
  style,
45
- className,
46
- isClearable,
47
- isLoading,
48
- placement,
49
- boldLabel,
50
- reserveErrorLine,
51
- noOptionsMessage,
52
- maxVisibleItems,
53
- isSingleLine,
54
- ...ariaProps
83
+ placeholder,
84
+ ...rest
55
85
  } = _ref;
56
- // Create state with multiple selection mode
57
- const state = useSelectState({ ...ariaProps,
58
- selectionMode: 'multiple',
59
- allowsEmptyCollection: true
86
+ const theme = useThemeWithUndefined(themeFromProps);
87
+ const triggerRef = React.useRef(null);
88
+ const menuRef = React.useRef(null);
89
+ const dropdownRef = React.useRef(null);
90
+ const {
91
+ selectedMap,
92
+ removeItem: removeSelectedItem,
93
+ addItem: addSelectedItem,
94
+ removeAllItems: reset
95
+ } = useMultiHandlers({
96
+ selectedItems,
97
+ onChange
60
98
  });
61
- const hasValue = state.selectedItems.length > 0; // Get props for child elements from useSelect
62
-
63
- const triggerRef = useRef(null);
64
99
  const {
65
- labelProps,
66
- triggerProps,
67
- valueProps,
68
- menuProps: listBoxProps,
69
- hiddenSelectProps,
100
+ flattenedOptions,
101
+ listBoxItems
102
+ } = useOptions(options);
103
+ const isListBoxEmpty = getRealItemsCnt(listBoxItems) === 0;
104
+ const {
105
+ fieldProps,
70
106
  errorMessageProps,
71
- descriptionProps
72
- } = useSelect({ ...ariaProps,
73
- selectionMode: 'multiple',
74
- onKeyDown: e => {
75
- if (hasValue) {
76
- if (e.key === 'Backspace') {
77
- state.setValue([...state.selectedItems].map(item => item.key).slice(0, -1));
78
- e.stopPropagation();
79
- }
107
+ descriptionProps,
108
+ baseId
109
+ } = useA11y({
110
+ prefix: 'multiselect',
111
+ error,
112
+ description: note
113
+ });
114
+ const {
115
+ isOpen,
116
+ getToggleButtonProps,
117
+ getLabelProps,
118
+ getMenuProps,
119
+ highlightedIndex,
120
+ getItemProps,
121
+ setHighlightedIndex
122
+ } = useSelect({
123
+ items: flattenedOptions,
124
+ itemToString,
125
+ id: baseId,
126
+
127
+ onIsOpenChange(newIsOpen) {
128
+ if (newIsOpen) {
129
+ // set the first selected item as a highlighted item if the popup is opened
130
+ const firstSelectedKey = [...selectedMap.keys()][0];
80
131
 
81
- if (e.key === 'Delete') {
82
- state.setValue([]);
83
- e.stopPropagation();
132
+ if (firstSelectedKey) {
133
+ setHighlightedIndex(flattenedOptions.findIndex(item => firstSelectedKey === getOptionValue(item)));
84
134
  }
85
135
  }
136
+ },
137
+
138
+ stateReducer,
139
+ // there's no actual selection happening in the hook, we're doing it custom via controlled props.
140
+ selectedItem: null,
141
+ // defining our scroll behavior because on the first menu render the hook
142
+ // doesn't know menuRef and use page as the scroll boundary
143
+ scrollIntoView: (listItemEl, listEl) => {
144
+ scrollIntoView(listItemEl, {
145
+ scrollMode: 'if-needed',
146
+ block: 'nearest',
147
+ boundary: listEl ?? menuRef.current
148
+ });
149
+ },
150
+ onSelectedItemChange: _ref2 => {
151
+ let {
152
+ selectedItem
153
+ } = _ref2;
154
+
155
+ if (!selectedItem) {
156
+ return;
157
+ }
158
+
159
+ const changedValue = getOptionValue(selectedItem);
160
+
161
+ if (selectedMap.has(changedValue)) {
162
+ removeSelectedItem(selectedItem);
163
+ } else {
164
+ addSelectedItem(selectedItem);
165
+ }
166
+ },
167
+
168
+ isItemDisabled(item) {
169
+ return item && item.disabled;
86
170
  }
87
- }, state, triggerRef);
88
- const {
89
- buttonProps
90
- } = useButton({ ...triggerProps,
91
- elementType: 'div'
92
- }, triggerRef);
93
- const isDisabled = ariaProps.isDisabled;
94
- const isOpen = state.isOpen;
95
- const {
96
- isFocusVisible,
97
- focusProps
98
- } = useFocusRing({
99
- within: true
171
+
100
172
  });
173
+ const menuProps = getMenuProps({
174
+ ref: menuRef,
175
+ 'aria-multiselectable': isListBoxEmpty ? undefined : 'true'
176
+ }, {
177
+ suppressRefError: true
178
+ });
179
+ const triggerProps = getToggleButtonProps({
180
+ ref: triggerRef,
181
+ // eslint-disable-next-line complexity
182
+ onKeyDown: event => {
183
+ // shift + arrow up/down selection (when popup is open)
184
+ if (isOpen && event.shiftKey && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
185
+ const newHighlightedIndex = event.key === 'ArrowUp' ? Math.max(highlightedIndex - 1, 0) : Math.min(highlightedIndex + 1, flattenedOptions.length - 1);
186
+
187
+ if (newHighlightedIndex === highlightedIndex) {
188
+ return;
189
+ }
190
+
191
+ addSelectedItem(flattenedOptions[newHighlightedIndex]);
192
+ } // backspace removing the last selected item (when popup is closed)
193
+
194
+
195
+ if (!isOpen && event.key === 'Backspace') {
196
+ removeSelectedItem(selectedItems[selectedItems.length - 1]);
197
+ } // delete removing all selected items (when popup is closed)
198
+
199
+
200
+ if (!isOpen && event.key === 'Delete') {
201
+ reset();
202
+ }
203
+ },
204
+ // fix screen-reader focus on an opened popup with an empty list
205
+ ...(isOpen && isListBoxEmpty ? {
206
+ 'aria-activedescendant': menuProps.id
207
+ } : {})
208
+ }); // recalculate the popup position after a possible trigger height change
209
+
210
+ useEffect(() => {
211
+ if (dropdownRef.current) {
212
+ dropdownRef.current.scheduleUpdate();
213
+ }
214
+ }, [selectedItems]);
101
215
  const {
102
216
  isFocusedByLabel,
103
217
  labelClickProps,
104
218
  triggerFocusProps: labelFocusForTriggerProps
105
- } = useLabelFocus(triggerRef);
219
+ } = useLabelFocus();
106
220
  const emptyListMessage = getEmptyMessage({
107
221
  isLoading,
108
222
  isNothingFound: false,
109
223
  noOptionsMessage
110
224
  });
225
+ const listBoxState = {
226
+ selectedMap,
227
+ selectionMode: 'multiple',
228
+ highlightedIndex,
229
+ getItemProps,
230
+ menuProps
231
+ };
111
232
  return /*#__PURE__*/React.createElement("div", {
112
- className: cn(className, styles.root, THEME_STYLES[theme], SIZE_STYLES[size], MODE_STYLES[mode], isDisabled ? styles.disabled : styles.enabled, Boolean(ariaProps.errorMessage) && styles.error),
233
+ className: cn(className, styles.root, THEME_STYLES[theme], SIZE_STYLES[size], MODE_STYLES[mode], isDisabled ? styles.disabled : styles.enabled, Boolean(error) && styles.error),
113
234
  id: id,
114
235
  style: style,
115
236
  "data-test": "multiselect"
@@ -117,126 +238,75 @@ function MultiselectInner(_ref) {
117
238
  theme: theme,
118
239
  size: size,
119
240
  disabled: isDisabled,
120
- label: ariaProps.label,
121
- labelProps: mergeProps(labelClickProps, labelProps),
241
+ label: label,
242
+ labelProps: mergeProps(getLabelProps(), labelClickProps),
122
243
  boldLabel: boldLabel,
123
- error: ariaProps.errorMessage,
244
+ error: error,
124
245
  reserveErrorLine: reserveErrorLine,
125
246
  errorMessageProps: errorMessageProps,
126
- note: ariaProps.description,
247
+ note: note,
127
248
  descriptionProps: descriptionProps
128
- }, /*#__PURE__*/React.createElement(HiddenSelect, { ...hiddenSelectProps
129
- }), /*#__PURE__*/React.createElement("div", { ...mergeProps(buttonProps, focusProps, labelFocusForTriggerProps),
130
- ref: triggerRef,
131
- className: cn(styles.trigger, !isSingleLine && styles.canBeMultiline),
132
- "data-open": isOpen,
133
- "data-focus-visible": isFocusVisible,
134
- "data-label-focused": isFocusedByLabel,
135
- "data-test": "multiselect__trigger"
136
- }, /*#__PURE__*/React.createElement(MultiTrigger, {
137
- state: state,
138
- valueProps: valueProps,
139
- isSingleLine: isSingleLine,
140
- isDisabled: isDisabled,
141
- placeholder: ariaProps.placeholder,
142
- triggerRef: triggerRef
143
- }), /*#__PURE__*/React.createElement(Icons, {
144
- isLoading: isLoading,
145
- canHaveClearIcon: isClearable && !isDisabled && hasValue,
146
- onClear: () => {
147
- var _triggerRef$current;
148
-
149
- state.setValue([]);
150
- (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
151
- },
152
- triggerId: triggerProps.id
153
- })), /*#__PURE__*/React.createElement(PopupContent, {
249
+ }, /*#__PURE__*/React.createElement(HiddenSelect, {
250
+ name: name,
251
+ value: selectedItems,
252
+ isMultiple: true,
253
+ options: flattenedOptions
254
+ }), /*#__PURE__*/React.createElement(Dropdown, {
255
+ mode: mode,
154
256
  theme: theme,
155
- state: state,
156
- triggerRef: triggerRef,
257
+ ref: dropdownRef,
157
258
  placement: placement,
158
- size: size,
159
- mode: mode,
160
- listBoxProps: listBoxProps,
161
- emptyListMessage: emptyListMessage,
162
- maxVisibleItems: maxVisibleItems,
163
- selectionMode: "multiple"
164
- })));
165
- }
166
-
167
- function Multiselect(_ref2) {
168
- let {
169
- options = [],
170
- value,
171
- onChange,
172
- error,
173
- note,
174
- size = 'm',
175
- mode = 'classic',
176
- theme: themeFromProps,
177
- placement = 'bottom',
178
- isSingleLine = false,
179
- boldLabel = true,
180
- reserveErrorLine = false,
181
- maxVisibleItems = 5,
182
- isClearable = false,
183
- isLoading = false,
184
- isDisabled = false,
185
- ...props
186
- } = _ref2;
187
- const theme = useThemeWithUndefined(themeFromProps);
188
- const {
189
- selectedKeys,
190
- findOptionsByKeys,
191
- virtualOptions
192
- } = useMultiOptionSerialization(options, value);
193
-
194
- const handleSelectionChange = keys => {
195
- const newValue = findOptionsByKeys(keys);
196
- onChange === null || onChange === void 0 || onChange(newValue);
197
- };
259
+ maxWidth: "trigger",
260
+ minWidth: "trigger",
261
+ isOpen: isOpen,
262
+ cancelCloseAnimation: true,
263
+ disableFocusLock: true,
264
+ trigger: _ref3 => {
265
+ let {
266
+ ref: triggerRefForDropdown
267
+ } = _ref3;
268
+ return /*#__PURE__*/React.createElement("div", {
269
+ className: styles.triggerContainer,
270
+ "data-open": isOpen,
271
+ "data-label-focused": isFocusedByLabel
272
+ }, /*#__PURE__*/React.createElement("div", { ...rest,
273
+ ...mergeProps(fieldProps, // aria-invalid & aria-describedby, rest are overridden by triggerProps
274
+ triggerProps, labelFocusForTriggerProps, {
275
+ ref: triggerRefForDropdown
276
+ }),
277
+ className: cn(styles.trigger, !isSingleLine && styles.canBeMultiline),
278
+ "data-open": isOpen,
279
+ "data-label-focused": isFocusedByLabel,
280
+ "data-test": "multiselect__trigger"
281
+ }, /*#__PURE__*/React.createElement(MultiTrigger, {
282
+ selectedItems: selectedItems,
283
+ valueProps: {},
284
+ isSingleLine: isSingleLine,
285
+ isDisabled: isDisabled,
286
+ placeholder: placeholder,
287
+ triggerRef: triggerRef,
288
+ removeSelectedItem: removeSelectedItem
289
+ }), /*#__PURE__*/React.createElement(Icons, {
290
+ isLoading: isLoading,
291
+ canHaveClearIcon: isClearable && !isDisabled && selectedItems.length > 0,
292
+ onClear: () => {
293
+ var _triggerRef$current;
198
294
 
199
- return /*#__PURE__*/React.createElement(MultiselectInner, { ...props,
295
+ reset();
296
+ (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus({
297
+ focusVisible: false
298
+ });
299
+ },
300
+ triggerId: triggerProps.id
301
+ })));
302
+ }
303
+ }, /*#__PURE__*/React.createElement(ListBox, {
304
+ state: listBoxState,
200
305
  size: size,
201
- mode: mode,
202
- theme: theme,
203
- value: selectedKeys,
204
- onChange: handleSelectionChange,
205
- errorMessage: error,
206
- description: note,
207
- placement: convertPlacement(placement),
208
- isSingleLine: isSingleLine,
209
- disabledKeys: virtualOptions.map(option => getOptionValue(option)),
210
- boldLabel: boldLabel,
211
- reserveErrorLine: reserveErrorLine,
212
306
  maxVisibleItems: maxVisibleItems,
213
- isClearable: isClearable,
214
- isLoading: isLoading,
215
- isDisabled: isDisabled
216
- }, convertOptions(options, virtualOptions));
307
+ emptyListMessage: emptyListMessage,
308
+ items: listBoxItems
309
+ }))));
217
310
  }
218
311
 
219
- Multiselect.propTypes = {
220
- className: PropTypes.string,
221
- style: PropTypes.object,
222
- options: PropTypes.arrayOf(PropTypes.oneOfType([optionType, optionsGroupType])),
223
- value: PropTypes.arrayOf(optionType),
224
- onChange: PropTypes.func,
225
- size: PropTypes.oneOf(['m', 's', 'l']),
226
- mode: PropTypes.oneOf(['classic', 'rock']),
227
- theme: PropTypes.oneOf(['light', 'dark']),
228
- placeholder: PropTypes.string,
229
- isSingleLine: PropTypes.bool,
230
- isClearable: PropTypes.bool,
231
- isDisabled: PropTypes.bool,
232
- isLoading: PropTypes.bool,
233
- error: ErrorMessage.propTypes.children,
234
- label: PropTypes.node,
235
- note: PropTypes.node,
236
- id: PropTypes.string,
237
- noOptionsMessage: noOptionsMessageType,
238
- placement: PropTypes.oneOf(['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']),
239
- name: PropTypes.string,
240
- boldLabel: PropTypes.bool
241
- };
242
312
  export { Multiselect };