@rescui/select 0.11.7 → 0.11.9-RUI-226-Update-card-cn-6e43cc89.60

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.
@@ -1,24 +1,4 @@
1
- import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
- import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
- import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
4
- import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
5
- import _toConsumableArray from "@babel/runtime-corejs3/helpers/esm/toConsumableArray";
6
- import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
7
- import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
8
- import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
9
- var _excluded = ["options", "size", "mode", "theme", "className", "value", "onChange", "placeholder", "isSingleLine", "isClearable", "isLoading", "isDisabled", "noOptionsMessage", "placement", "boldLabel"];
10
-
11
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
-
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
14
-
15
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
16
- import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
17
- import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
18
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
19
- import "core-js/modules/es.object.to-string.js";
20
- import "core-js/modules/web.dom-collections.for-each.js";
21
- import "core-js/modules/es.function.name.js";
22
2
  import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
23
3
  import PropTypes from 'prop-types';
24
4
  import cn from 'classnames';
@@ -35,37 +15,36 @@ import FormTriggerWrapper from './form-trigger-wrapper.js';
35
15
  import { useObservableForceRerender } from './use-observable-force-rerender.js';
36
16
  import styles from './common-select.p.module.css.js'; // eslint-disable-next-line complexity
37
17
 
38
- var Option = function Option(_ref) {
39
- var selected = _ref.selected,
40
- cursorIndex = _ref.cursorIndex,
41
- item = _ref.item,
42
- isSingleLine = _ref.isSingleLine,
43
- isLastItem = _ref.isLastItem,
44
- highlightedItemRef = _ref.highlightedItemRef,
45
- handleHighlightIndex = _ref.handleHighlightIndex,
46
- handleSelectIndex = _ref.handleSelectIndex;
18
+ const Option = _ref => {
19
+ let {
20
+ selected,
21
+ cursorIndex,
22
+ item,
23
+ isSingleLine,
24
+ isLastItem,
25
+ highlightedItemRef,
26
+ handleHighlightIndex,
27
+ handleSelectIndex
28
+ } = _ref;
47
29
 
48
30
  if (item.type === OptionGroupTypes.OPTION) {
49
- var index = item.index,
50
- label = item.label;
51
- var value = getOptionValue(item);
52
- var isItemSelected = Boolean(selected && selected.length && selected.some(function (s) {
53
- return value === getOptionValue(s);
54
- }));
55
- var isHighlighted = isIndexMatchCursor(cursorIndex, index);
56
- var icon = isSingleLine && isItemSelected ? /*#__PURE__*/React.createElement(CheckIcon, {
57
- className: styles.checkIcon
31
+ const {
32
+ index,
33
+ label
34
+ } = item;
35
+ const value = getOptionValue(item);
36
+ const isItemSelected = Boolean(selected && selected.length && selected.some(s => value === getOptionValue(s)));
37
+ const isHighlighted = isIndexMatchCursor(cursorIndex, index);
38
+ const icon = isSingleLine && isItemSelected ? /*#__PURE__*/React.createElement(CheckIcon, {
39
+ className: styles.checkIcon,
40
+ "data-render-all-sizes": true
58
41
  }) : null;
59
42
  return /*#__PURE__*/React.createElement(MenuItem, {
60
43
  selected: isItemSelected,
61
44
  highlighted: isHighlighted,
62
45
  ref: isHighlighted ? highlightedItemRef : null,
63
- onMouseMove: function onMouseMove() {
64
- return handleHighlightIndex(index);
65
- },
66
- onClick: function onClick() {
67
- return handleSelectIndex(index);
68
- },
46
+ onMouseMove: () => handleHighlightIndex(index),
47
+ onClick: () => handleSelectIndex(index),
69
48
  className: cn(isLastItem && styles.lastOption),
70
49
  icon: icon
71
50
  }, label);
@@ -78,59 +57,57 @@ var Option = function Option(_ref) {
78
57
  }
79
58
 
80
59
  if (item.type === OptionGroupTypes.HEADER) {
81
- var _label = item.label;
60
+ const {
61
+ label
62
+ } = item;
82
63
  return /*#__PURE__*/React.createElement(GroupHeader, {
83
- text: _label
64
+ text: label
84
65
  });
85
66
  }
86
67
 
87
68
  return null;
88
69
  };
89
70
 
90
- var getOptionKey = function getOptionKey(item, i) {
71
+ const getOptionKey = (item, i) => {
91
72
  if (item.type === OptionGroupTypes.OPTION) {
92
- var _context;
93
-
94
- var value = getOptionValue(item);
95
- return _concatInstanceProperty(_context = "".concat(value, "_")).call(_context, item.index[0]);
73
+ const value = getOptionValue(item);
74
+ return `${value}_${item.index[0]}`;
96
75
  } else if (item.type === OptionGroupTypes.DIVIDER) {
97
- return "divider".concat(i);
76
+ return `divider${i}`;
98
77
  } else if (item.type === OptionGroupTypes.HEADER) {
99
- return "header".concat(i);
78
+ return `header${i}`;
100
79
  }
101
80
 
102
81
  return null;
103
82
  };
104
83
 
105
84
  function filterSelected(groups, selected) {
106
- var selectedValues = {};
85
+ const selectedValues = {};
107
86
 
108
87
  if (selected) {
109
- selected.forEach(function (s) {
88
+ selected.forEach(s => {
110
89
  selectedValues[getOptionValue(s)] = true;
111
90
  });
112
91
  }
113
92
 
114
- return _mapInstanceProperty(groups).call(groups, function (g) {
115
- var newOptions = [];
93
+ return groups.map(g => {
94
+ let newOptions = [];
116
95
 
117
96
  if (g.options) {
118
- var _context2;
119
-
120
- newOptions = _filterInstanceProperty(_context2 = g.options).call(_context2, function (opt) {
121
- return !selectedValues[getOptionValue(opt)];
122
- });
97
+ newOptions = g.options.filter(opt => !selectedValues[getOptionValue(opt)]);
123
98
  }
124
99
 
125
- return _objectSpread(_objectSpread({}, g), {}, {
100
+ return { ...g,
126
101
  options: newOptions
127
- });
102
+ };
128
103
  });
129
104
  }
130
105
 
131
- var NativeSelectedOptions = function NativeSelectedOptions(_ref2) {
132
- var name = _ref2.name,
133
- selected = _ref2.selected;
106
+ const NativeSelectedOptions = _ref2 => {
107
+ let {
108
+ name,
109
+ selected
110
+ } = _ref2;
134
111
 
135
112
  if (!selected || !Array.isArray(selected) || !selected.length) {
136
113
  return /*#__PURE__*/React.createElement("input", {
@@ -140,8 +117,10 @@ var NativeSelectedOptions = function NativeSelectedOptions(_ref2) {
140
117
  });
141
118
  }
142
119
 
143
- return /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(selected).call(selected, function (_ref3) {
144
- var value = _ref3.value;
120
+ return /*#__PURE__*/React.createElement(React.Fragment, null, selected.map(_ref3 => {
121
+ let {
122
+ value
123
+ } = _ref3;
145
124
  return /*#__PURE__*/React.createElement("input", {
146
125
  key: value,
147
126
  type: "hidden",
@@ -151,101 +130,61 @@ var NativeSelectedOptions = function NativeSelectedOptions(_ref2) {
151
130
  }));
152
131
  };
153
132
 
154
- var SIZE_STYLES = {
133
+ const SIZE_STYLES = {
155
134
  s: styles.sizeS,
156
135
  m: styles.sizeM,
157
136
  l: styles.sizeL
158
137
  };
159
- var MENU_SIZE_STYLES = {
138
+ const MENU_SIZE_STYLES = {
160
139
  s: styles.menuSizeS,
161
140
  m: styles.menuSizeM,
162
141
  l: styles.menuSizeL
163
142
  }; // eslint-disable-next-line complexity
164
143
 
165
- var Multiselect = function Multiselect(_ref4) {
166
- var _context5;
167
-
168
- var options = _ref4.options,
169
- _ref4$size = _ref4.size,
170
- size = _ref4$size === void 0 ? 'm' : _ref4$size,
171
- _ref4$mode = _ref4.mode,
172
- mode = _ref4$mode === void 0 ? 'classic' : _ref4$mode,
173
- themeFromProps = _ref4.theme,
174
- _ref4$className = _ref4.className,
175
- className = _ref4$className === void 0 ? null : _ref4$className,
176
- _ref4$value = _ref4.value,
177
- value = _ref4$value === void 0 ? undefined : _ref4$value,
178
- onChange = _ref4.onChange,
179
- placeholder = _ref4.placeholder,
180
- _ref4$isSingleLine = _ref4.isSingleLine,
181
- isSingleLine = _ref4$isSingleLine === void 0 ? false : _ref4$isSingleLine,
182
- _ref4$isClearable = _ref4.isClearable,
183
- isClearable = _ref4$isClearable === void 0 ? false : _ref4$isClearable,
184
- _ref4$isLoading = _ref4.isLoading,
185
- isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
186
- _ref4$isDisabled = _ref4.isDisabled,
187
- isDisabled = _ref4$isDisabled === void 0 ? false : _ref4$isDisabled,
188
- noOptionsMessage = _ref4.noOptionsMessage,
189
- _ref4$placement = _ref4.placement,
190
- placement = _ref4$placement === void 0 ? 'bottom' : _ref4$placement,
191
- boldLabel = _ref4.boldLabel,
192
- restProps = _objectWithoutProperties(_ref4, _excluded);
193
-
194
- var _useState = useState(null),
195
- _useState2 = _slicedToArray(_useState, 2),
196
- triggerFormWrapperRef = _useState2[0],
197
- setTriggerFormWrapperRef = _useState2[1];
198
-
199
- var dropdownRef = useRef(null);
200
- var highlightedItemRef = useRef();
201
- var theme = useThemeWithUndefined(themeFromProps);
202
-
203
- var _useState3 = useState(false),
204
- _useState4 = _slicedToArray(_useState3, 2),
205
- isKeyboardNavigating = _useState4[0],
206
- setIsKeyboardNavigating = _useState4[1];
207
-
208
- var skipScrollingRef = useRef(false);
209
- var groups = useStrongMemo(function () {
210
- return convertToOptionGroupsIfNeeded(options);
211
- }, [options]);
212
- var filteredGroups = useStrongMemo(function () {
144
+ const Multiselect = _ref4 => {
145
+ let {
146
+ options,
147
+ size = 'm',
148
+ mode = 'classic',
149
+ theme: themeFromProps,
150
+ className = null,
151
+ value = undefined,
152
+ onChange,
153
+ placeholder,
154
+ isSingleLine = false,
155
+ isClearable = false,
156
+ isLoading = false,
157
+ isDisabled = false,
158
+ noOptionsMessage,
159
+ placement = 'bottom',
160
+ boldLabel,
161
+ ...restProps
162
+ } = _ref4;
163
+ const [triggerFormWrapperRef, setTriggerFormWrapperRef] = useState(null);
164
+ const dropdownRef = useRef(null);
165
+ const highlightedItemRef = useRef();
166
+ const theme = useThemeWithUndefined(themeFromProps);
167
+ const [isKeyboardNavigating, setIsKeyboardNavigating] = useState(false);
168
+ const skipScrollingRef = useRef(false);
169
+ const groups = useStrongMemo(() => convertToOptionGroupsIfNeeded(options), [options]);
170
+ const filteredGroups = useStrongMemo(() => {
213
171
  if (isSingleLine) {
214
172
  return groups;
215
173
  }
216
174
 
217
175
  return filterSelected(groups, value);
218
176
  }, [isSingleLine, value, groups]);
219
-
220
- var _useState5 = useState(false),
221
- _useState6 = _slicedToArray(_useState5, 2),
222
- menuIsOpen = _useState6[0],
223
- setMenuIsOpen = _useState6[1];
224
-
225
- var _useState7 = useState(function () {
226
- return getDefaultCursorIndex(filteredGroups);
227
- }),
228
- _useState8 = _slicedToArray(_useState7, 2),
229
- cursorIndex = _useState8[0],
230
- setCursorIndex = _useState8[1];
231
-
232
- useEffect(function () {
177
+ const [menuIsOpen, setMenuIsOpen] = useState(false);
178
+ const [cursorIndex, setCursorIndex] = useState(() => getDefaultCursorIndex(filteredGroups));
179
+ useEffect(() => {
233
180
  setCursorIndex(getDefaultCursorIndex(filteredGroups));
234
181
  }, [filteredGroups, value]);
235
- var isEmptyMenu = useMemo(function () {
236
- return isGroupsEmpty(filteredGroups);
237
- }, [filteredGroups]);
238
- var handleSelectIndex = useCallback(function (index) {
239
- var _context3;
240
-
241
- var selectedOption = filteredGroups[index[0]].options[index[1]];
242
- var selectedOptionValue = getOptionValue(selectedOption);
243
- var optionAdded = !value.some(function (option) {
244
- return getOptionValue(option) === selectedOptionValue;
245
- });
246
- var newSelected = optionAdded ? _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(value), [selectedOption]) : _filterInstanceProperty(value).call(value, function (option) {
247
- return getOptionValue(option) !== selectedOptionValue;
248
- });
182
+ const isEmptyMenu = useMemo(() => isGroupsEmpty(filteredGroups), [filteredGroups]);
183
+ const handleSelectIndex = useCallback(index => {
184
+ const selectedOption = filteredGroups[index[0]].options[index[1]];
185
+ const selectedOptionValue = getOptionValue(selectedOption);
186
+ const optionAdded = !value.some(option => getOptionValue(option) === selectedOptionValue);
187
+ const newSelected = optionAdded ? [...value, selectedOption] : value.filter(option => getOptionValue(option) !== selectedOptionValue);
249
188
 
250
189
  if (onChange) {
251
190
  onChange(newSelected);
@@ -254,32 +193,28 @@ var Multiselect = function Multiselect(_ref4) {
254
193
  setMenuIsOpen(false);
255
194
  setIsKeyboardNavigating(false);
256
195
  }, [onChange, filteredGroups, value]);
257
- useEffect(function () {
196
+ useEffect(() => {
258
197
  if (dropdownRef.current) {
259
198
  dropdownRef.current.scheduleUpdate();
260
199
  }
261
200
  }, [value]);
262
- var handleMouseMove = useCallback(function () {
263
- return setIsKeyboardNavigating(false);
264
- }, []);
265
- useEffect(function () {
201
+ const handleMouseMove = useCallback(() => setIsKeyboardNavigating(false), []);
202
+ useEffect(() => {
266
203
  if (isKeyboardNavigating) {
267
204
  document.addEventListener('mousemove', handleMouseMove);
268
205
  }
269
206
 
270
- return function () {
271
- return document.removeEventListener('mousemove', handleMouseMove);
272
- };
207
+ return () => document.removeEventListener('mousemove', handleMouseMove);
273
208
  }, [handleMouseMove, isKeyboardNavigating]);
274
- useEffect(function () {
209
+ useEffect(() => {
275
210
  if (isKeyboardNavigating && highlightedItemRef.current) {
276
211
  if (skipScrollingRef.current) {
277
212
  skipScrollingRef.current = false;
278
213
  } else {
279
- var elementToScrollTo = highlightedItemRef.current;
214
+ let elementToScrollTo = highlightedItemRef.current;
280
215
 
281
216
  if (cursorIndex[0] === 0 && cursorIndex[1] === 0) {
282
- var groupHeader = highlightedItemRef.current.previousSibling;
217
+ const groupHeader = highlightedItemRef.current.previousSibling;
283
218
 
284
219
  if (groupHeader) {
285
220
  elementToScrollTo = groupHeader;
@@ -295,14 +230,14 @@ var Multiselect = function Multiselect(_ref4) {
295
230
  }
296
231
  }
297
232
  }, [highlightedItemRef, cursorIndex, isKeyboardNavigating]);
298
- var handleClose = useCallback(function () {
233
+ const handleClose = useCallback(() => {
299
234
  setMenuIsOpen(false);
300
235
  setIsKeyboardNavigating(false);
301
236
  }, []);
302
- var handleKeyNavigation = useCallback( // eslint-disable-next-line complexity
303
- function (e) {
237
+ const handleKeyNavigation = useCallback( // eslint-disable-next-line complexity
238
+ e => {
304
239
  if (e.key === ARROW_DOWN || e.key === ARROW_UP) {
305
- var isDownDirection = e.key === ARROW_DOWN;
240
+ const isDownDirection = e.key === ARROW_DOWN;
306
241
  setCursorIndex(getMovedCursorIndex(filteredGroups, cursorIndex, isDownDirection));
307
242
  setIsKeyboardNavigating(true);
308
243
  e.preventDefault();
@@ -322,16 +257,14 @@ var Multiselect = function Multiselect(_ref4) {
322
257
  handleClose();
323
258
  }
324
259
  }, [filteredGroups, cursorIndex, handleClose, handleSelectIndex]);
325
- var handleClick = useCallback(function () {
260
+ const handleClick = useCallback(() => {
326
261
  if (isDisabled) {
327
262
  return;
328
263
  }
329
264
 
330
- setMenuIsOpen(function (currentMenuIsOpen) {
331
- return !currentMenuIsOpen;
332
- });
265
+ setMenuIsOpen(currentMenuIsOpen => !currentMenuIsOpen);
333
266
  }, [isDisabled]);
334
- var handleClearClick = useCallback(function () {
267
+ const handleClearClick = useCallback(() => {
335
268
  setCursorIndex(getDefaultCursorIndex(groups));
336
269
  setMenuIsOpen(false);
337
270
 
@@ -340,7 +273,7 @@ var Multiselect = function Multiselect(_ref4) {
340
273
  }
341
274
  }, [groups, onChange]); // eslint-disable-next-line complexity
342
275
 
343
- var handleTriggerKeyDown = useCallback(function (e) {
276
+ const handleTriggerKeyDown = useCallback(e => {
344
277
  if (e.key === ESCAPE) {
345
278
  handleClose();
346
279
  e.preventDefault();
@@ -353,9 +286,9 @@ var Multiselect = function Multiselect(_ref4) {
353
286
  if (menuIsOpen) {
354
287
  handleKeyNavigation(e);
355
288
  } else {
356
- var target = e.target;
357
- var trigger = target.closest('[data-target="trigger"]');
358
- var isTriggerTarget = trigger === target;
289
+ const target = e.target;
290
+ const trigger = target.closest('[data-target="trigger"]');
291
+ const isTriggerTarget = trigger === target;
359
292
 
360
293
  if (shouldOpenSelect(e.key, isTriggerTarget)) {
361
294
  setMenuIsOpen(true);
@@ -372,28 +305,25 @@ var Multiselect = function Multiselect(_ref4) {
372
305
  }
373
306
  }
374
307
  }, [handleClearClick, handleClose, handleKeyNavigation, isClearable, isDisabled, menuIsOpen]);
375
- var handleUnselectClick = useCallback(function (unselectedOption) {
376
- var unselectedOptionValue = getOptionValue(unselectedOption);
377
-
378
- var newSelected = _filterInstanceProperty(value).call(value, function (option) {
379
- return getOptionValue(option) !== unselectedOptionValue;
380
- });
308
+ const handleUnselectClick = useCallback(unselectedOption => {
309
+ const unselectedOptionValue = getOptionValue(unselectedOption);
310
+ const newSelected = value.filter(option => getOptionValue(option) !== unselectedOptionValue);
381
311
 
382
312
  if (onChange) {
383
313
  onChange(newSelected);
384
314
  }
385
315
  }, [onChange, value]);
386
- var handleHighlightIndex = useCallback(function (index) {
316
+ const handleHighlightIndex = useCallback(index => {
387
317
  if (!isIndexMatchCursor(cursorIndex, index)) {
388
318
  setCursorIndex(index);
389
319
  }
390
320
  }, [cursorIndex]); // We use invisible and "untouchable" dummy element to observe `size` changes from css to trigger force rerenders
391
321
 
392
- var observableRef = useObservableForceRerender();
393
- var sizeFromCss = null;
322
+ const observableRef = useObservableForceRerender();
323
+ let sizeFromCss = null;
394
324
 
395
325
  if (triggerFormWrapperRef && menuIsOpen) {
396
- var _context4;
326
+ var _context;
397
327
 
398
328
  // In theory this part of the code might cause issues with SSR.
399
329
  // But in this specific context, because of checking ref "triggerFormWrapperRef",
@@ -402,14 +332,14 @@ var Multiselect = function Multiselect(_ref4) {
402
332
  // Also, there will be no layout shifts on the following renders because
403
333
  // it's a dropdown-content and in most cases it opens only on-demand.
404
334
  // In additional, we use "observable" el to watch size changes between rerenders (@media query case).
405
- var triggerFormWrapperStyles = getComputedStyle(triggerFormWrapperRef);
406
- var rawSizeFromCss = triggerFormWrapperStyles.getPropertyValue('--_rs-select-size');
407
- sizeFromCss = _includesInstanceProperty(_context4 = ['s', 'm', 'l']).call(_context4, rawSizeFromCss) ? rawSizeFromCss : null;
335
+ const triggerFormWrapperStyles = getComputedStyle(triggerFormWrapperRef);
336
+ const rawSizeFromCss = triggerFormWrapperStyles.getPropertyValue('--_rs-select-size');
337
+ sizeFromCss = _includesInstanceProperty(_context = ['s', 'm', 'l']).call(_context, rawSizeFromCss) ? rawSizeFromCss : null;
408
338
  }
409
339
 
410
- var actualSize = sizeFromCss || size;
411
- var maxHeight = calculateMaxHeight(actualSize);
412
- var withGroupsLabel = !withoutGroupsLabel(filteredGroups);
340
+ const actualSize = sizeFromCss || size;
341
+ const maxHeight = calculateMaxHeight(actualSize);
342
+ const withGroupsLabel = !withoutGroupsLabel(filteredGroups);
413
343
  return /*#__PURE__*/React.createElement(Dropdown, {
414
344
  theme: theme,
415
345
  onRequestClose: handleClose,
@@ -422,8 +352,10 @@ var Multiselect = function Multiselect(_ref4) {
422
352
  maxHeight: maxHeight,
423
353
  leastMaxHeight: maxHeight,
424
354
  disableFocusLock: true,
425
- trigger: function trigger(_ref5) {
426
- var ref = _ref5.ref;
355
+ trigger: _ref5 => {
356
+ let {
357
+ ref
358
+ } = _ref5;
427
359
  return /*#__PURE__*/React.createElement(FormTriggerWrapper, {
428
360
  ref: setTriggerFormWrapperRef,
429
361
  className: cn(className, SIZE_STYLES[size]),
@@ -468,19 +400,17 @@ var Multiselect = function Multiselect(_ref4) {
468
400
  disableCursor: isKeyboardNavigating,
469
401
  iconPlacement: 'right',
470
402
  enableKeyboardNavigation: false
471
- }, !isEmptyMenu ? _mapInstanceProperty(_context5 = getPlainOptionsFromGroups(filteredGroups)).call(_context5, function (item, i, collection) {
472
- return /*#__PURE__*/React.createElement(Option, {
473
- key: getOptionKey(item, i),
474
- selected: value,
475
- cursorIndex: cursorIndex,
476
- item: item,
477
- isSingleLine: isSingleLine,
478
- isLastItem: i === collection.length - 1,
479
- highlightedItemRef: highlightedItemRef,
480
- handleSelectIndex: handleSelectIndex,
481
- handleHighlightIndex: handleHighlightIndex
482
- });
483
- }) : /*#__PURE__*/React.createElement(MenuItem, {
403
+ }, !isEmptyMenu ? getPlainOptionsFromGroups(filteredGroups).map((item, i, collection) => /*#__PURE__*/React.createElement(Option, {
404
+ key: getOptionKey(item, i),
405
+ selected: value,
406
+ cursorIndex: cursorIndex,
407
+ item: item,
408
+ isSingleLine: isSingleLine,
409
+ isLastItem: i === collection.length - 1,
410
+ highlightedItemRef: highlightedItemRef,
411
+ handleSelectIndex: handleSelectIndex,
412
+ handleHighlightIndex: handleHighlightIndex
413
+ })) : /*#__PURE__*/React.createElement(MenuItem, {
484
414
  disabled: true
485
415
  }, getEmptyMessage(isLoading, false, noOptionsMessage))));
486
416
  };