@rescui/select 0.11.7 → 0.11.9

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