@dxc-technology/halstack-react 0.0.0-c9c1158 → 0.0.0-c9efd3e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +2 -7
- package/HalstackContext.d.ts +29 -133
- package/HalstackContext.js +1 -1
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +10 -26
- package/accordion/Accordion.stories.tsx +4 -36
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +3 -3
- package/accordion-group/AccordionGroupAccordion.js +2 -2
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +15 -72
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -28
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +1 -4
- package/bulleted-list/BulletedList.accessibility.test.js +107 -0
- package/bulleted-list/BulletedList.js +15 -22
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +15 -15
- package/button/Button.stories.tsx +32 -51
- package/button/Button.test.js +3 -1
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.js +36 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +26 -31
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +8 -5
- package/chip/Chip.stories.tsx +5 -24
- package/chip/Chip.test.js +4 -4
- package/common/coreTokens.d.ts +1 -1
- package/common/coreTokens.js +3 -3
- package/common/variables.d.ts +29 -133
- package/common/variables.js +38 -142
- package/container/Container.js +3 -7
- package/container/Container.stories.tsx +10 -25
- package/contextual-menu/ContextualMenu.accessibility.test.js +86 -0
- package/contextual-menu/ContextualMenu.d.ts +7 -0
- package/contextual-menu/ContextualMenu.js +71 -0
- package/contextual-menu/ContextualMenu.stories.tsx +182 -0
- package/contextual-menu/ContextualMenu.test.js +71 -0
- package/contextual-menu/MenuItemAction.d.ts +4 -0
- package/contextual-menu/MenuItemAction.js +46 -0
- package/contextual-menu/types.d.ts +22 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/DateInput.accessibility.test.js +216 -0
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +2 -5
- package/dialog/Dialog.stories.tsx +170 -0
- package/dialog/Dialog.test.js +1 -1
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +21 -36
- package/dropdown/Dropdown.stories.tsx +5 -16
- package/dropdown/DropdownMenuItem.js +6 -3
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.js +3 -39
- package/file-input/FileInput.test.js +7 -84
- package/file-input/FileItem.js +13 -27
- package/footer/Footer.accessibility.test.js +117 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +36 -31
- package/footer/Footer.stories.tsx +46 -2
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +65 -1
- package/footer/types.d.ts +8 -8
- package/header/Header.accessibility.test.js +84 -0
- package/header/Header.js +18 -40
- package/header/types.d.ts +4 -3
- package/heading/Heading.accessibility.test.js +33 -0
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +1 -1
- package/layout/Icons.js +0 -2
- package/link/Link.accessibility.test.js +112 -0
- package/link/Link.js +7 -5
- package/link/Link.stories.tsx +2 -2
- package/link/types.d.ts +1 -1
- package/main.d.ts +5 -3
- package/main.js +22 -8
- package/nav-tabs/NavTabs.accessibility.test.js +52 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +9 -6
- package/nav-tabs/NavTabs.stories.tsx +6 -4
- package/nav-tabs/NavTabs.test.js +3 -2
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +8 -7
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.js +165 -6
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +12 -12
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +1 -4
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.stories.tsx +0 -1
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +5 -11
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +1 -1
- package/resultset-table/ResultsetTable.accessibility.test.js +274 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +23 -12
- package/resultset-table/ResultsetTable.stories.tsx +106 -5
- package/resultset-table/ResultsetTable.test.js +76 -0
- package/resultset-table/types.d.ts +40 -7
- package/select/Option.js +8 -1
- package/select/Select.accessibility.test.js +217 -0
- package/select/Select.js +35 -27
- package/select/Select.stories.tsx +0 -1
- package/select/Select.test.js +498 -462
- package/select/types.d.ts +2 -2
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +20 -18
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +37 -46
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +6 -14
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +89 -0
- package/switch/Switch.js +23 -28
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +82 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +73 -11
- package/table/Table.stories.tsx +297 -2
- package/table/Table.test.js +92 -0
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +7 -4
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +4 -5
- package/tabs/Tabs.stories.tsx +1 -1
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +6 -6
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.js +4 -12
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestions.js +7 -10
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +77 -102
- package/text-input/TextInput.stories.tsx +1 -1
- package/text-input/TextInput.test.js +96 -79
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +10 -16
- package/textarea/Textarea.stories.tsx +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +1 -4
- package/typography/Typography.accessibility.test.js +339 -0
- package/useTheme.d.ts +29 -133
- package/utils/FocusLock.js +15 -5
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/types.d.ts +1 -1
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
package/select/Select.js
CHANGED
|
@@ -20,16 +20,17 @@ var _utils = require("../common/utils");
|
|
|
20
20
|
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
21
21
|
var _Listbox = _interopRequireDefault(require("./Listbox"));
|
|
22
22
|
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
23
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
|
23
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
26
|
-
var
|
|
27
|
-
return
|
|
28
|
-
return groupOption.options.length > 0;
|
|
29
|
-
}) : false : true;
|
|
26
|
+
var isOptionGroup = function isOptionGroup(option) {
|
|
27
|
+
return "options" in option && option.options != null;
|
|
30
28
|
};
|
|
31
|
-
var
|
|
32
|
-
return
|
|
29
|
+
var isArrayOfOptionGroups = function isArrayOfOptionGroups(options) {
|
|
30
|
+
return isOptionGroup(options[0]);
|
|
31
|
+
};
|
|
32
|
+
var groupsHaveOptions = function groupsHaveOptions(filteredOptions) {
|
|
33
|
+
return isArrayOfOptionGroups(filteredOptions) ? filteredOptions.some(function (groupOption) {
|
|
33
34
|
var _groupOption$options;
|
|
34
35
|
return ((_groupOption$options = groupOption.options) === null || _groupOption$options === void 0 ? void 0 : _groupOption$options.length) > 0;
|
|
35
36
|
}) : true;
|
|
@@ -39,7 +40,7 @@ var canOpenOptions = function canOpenOptions(options, disabled) {
|
|
|
39
40
|
};
|
|
40
41
|
var filterOptionsBySearchValue = function filterOptionsBySearchValue(options, searchValue) {
|
|
41
42
|
if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
|
|
42
|
-
if (options
|
|
43
|
+
if (isArrayOfOptionGroups(options)) return options.map(function (optionGroup) {
|
|
43
44
|
var group = {
|
|
44
45
|
label: optionGroup.label,
|
|
45
46
|
options: optionGroup.options.filter(function (option) {
|
|
@@ -58,7 +59,7 @@ var getLastOptionIndex = function getLastOptionIndex(options, filteredOptions, s
|
|
|
58
59
|
var _current$options;
|
|
59
60
|
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
60
61
|
};
|
|
61
|
-
if (searchable && filteredOptions.length > 0) filteredOptions
|
|
62
|
+
if (searchable && (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) > 0) isArrayOfOptionGroups(filteredOptions) ? last = filteredOptions.reduce(reducer, 0) - 1 : last = filteredOptions.length - 1;else if ((options === null || options === void 0 ? void 0 : options.length) > 0) isArrayOfOptionGroups(options) ? last = options.reduce(reducer, 0) - 1 : last = options.length - 1;
|
|
62
63
|
return optional && !multiple ? last + 1 : last;
|
|
63
64
|
};
|
|
64
65
|
var getSelectedOption = function getSelectedOption(value, options, multiple, optional, optionalItem) {
|
|
@@ -67,11 +68,9 @@ var getSelectedOption = function getSelectedOption(value, options, multiple, opt
|
|
|
67
68
|
if (multiple) {
|
|
68
69
|
if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
|
|
69
70
|
options.forEach(function (option) {
|
|
70
|
-
if (option.options) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
} else if (value.includes(option.value) && Array.isArray(selectedOption)) selectedOption.push(option);
|
|
71
|
+
if (isOptionGroup(option)) option.options.forEach(function (singleOption) {
|
|
72
|
+
if (value.includes(singleOption.value) && Array.isArray(selectedOption)) selectedOption.push(singleOption);
|
|
73
|
+
});else if (value.includes(option.value) && Array.isArray(selectedOption)) selectedOption.push(option);
|
|
75
74
|
});
|
|
76
75
|
}
|
|
77
76
|
} else {
|
|
@@ -81,7 +80,7 @@ var getSelectedOption = function getSelectedOption(value, options, multiple, opt
|
|
|
81
80
|
} else if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
|
|
82
81
|
var group_index = 0;
|
|
83
82
|
options.some(function (option, index) {
|
|
84
|
-
if (option
|
|
83
|
+
if (isOptionGroup(option)) {
|
|
85
84
|
option.options.some(function (singleOption) {
|
|
86
85
|
if (singleOption.value === value) {
|
|
87
86
|
selectedOption = singleOption;
|
|
@@ -103,6 +102,12 @@ var getSelectedOption = function getSelectedOption(value, options, multiple, opt
|
|
|
103
102
|
singleSelectionIndex: singleSelectionIndex
|
|
104
103
|
};
|
|
105
104
|
};
|
|
105
|
+
var getSelectedOptionLabel = function getSelectedOptionLabel(placeholder, selectedOption) {
|
|
106
|
+
var _selectedOption$label;
|
|
107
|
+
if (Array.isArray(selectedOption)) return selectedOption.length === 0 ? placeholder : selectedOption.map(function (option) {
|
|
108
|
+
return option.label;
|
|
109
|
+
}).join(", ");else return (_selectedOption$label = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _selectedOption$label !== void 0 ? _selectedOption$label : placeholder;
|
|
110
|
+
};
|
|
106
111
|
var notOptionalCheck = function notOptionalCheck(value, multiple, optional) {
|
|
107
112
|
return !optional && (multiple ? value.length === 0 : value === "");
|
|
108
113
|
};
|
|
@@ -127,7 +132,7 @@ var useWidth = function useWidth(target) {
|
|
|
127
132
|
return width;
|
|
128
133
|
};
|
|
129
134
|
var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
130
|
-
var _ref4
|
|
135
|
+
var _ref4;
|
|
131
136
|
var label = _ref.label,
|
|
132
137
|
_ref$name = _ref.name,
|
|
133
138
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
@@ -177,6 +182,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
177
182
|
changeIsOpen = _useState12[1];
|
|
178
183
|
var selectRef = (0, _react.useRef)(null);
|
|
179
184
|
var selectSearchInputRef = (0, _react.useRef)(null);
|
|
185
|
+
var selectedOptionLabelRef = (0, _react.useRef)(null);
|
|
180
186
|
var width = useWidth(selectRef.current);
|
|
181
187
|
var colorsTheme = (0, _useTheme["default"])();
|
|
182
188
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
@@ -231,7 +237,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
231
237
|
if (!event.currentTarget.contains(event.relatedTarget)) searchable && selectSearchInputRef.current.focus();
|
|
232
238
|
};
|
|
233
239
|
var handleSelectOnBlur = function handleSelectOnBlur(event) {
|
|
234
|
-
// focus leaves container (outside, not to
|
|
240
|
+
// focus leaves container (outside, not to a child)
|
|
235
241
|
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
236
242
|
closeOptions();
|
|
237
243
|
setSearchValue("");
|
|
@@ -273,7 +279,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
273
279
|
var accLength = optional && !multiple ? 1 : 0;
|
|
274
280
|
if (searchable) {
|
|
275
281
|
if (filteredOptions.length > 0) {
|
|
276
|
-
if (optional && !multiple && visualFocusIndex === 0 &&
|
|
282
|
+
if (optional && !multiple && visualFocusIndex === 0 && groupsHaveOptions(filteredOptions)) handleSelectChangeValue(optionalItem);else isArrayOfOptionGroups(filteredOptions) ? groupsHaveOptions(filteredOptions) && filteredOptions.some(function (groupOption) {
|
|
277
283
|
var groupLength = accLength + groupOption.options.length;
|
|
278
284
|
groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
|
|
279
285
|
accLength = groupLength;
|
|
@@ -281,7 +287,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
281
287
|
}) : handleSelectChangeValue(filteredOptions[visualFocusIndex - accLength]);
|
|
282
288
|
}
|
|
283
289
|
} else {
|
|
284
|
-
if (optional && !multiple && visualFocusIndex === 0) handleSelectChangeValue(optionalItem);else options
|
|
290
|
+
if (optional && !multiple && visualFocusIndex === 0) handleSelectChangeValue(optionalItem);else isArrayOfOptionGroups(options) ? options.some(function (groupOption) {
|
|
285
291
|
var groupLength = accLength + groupOption.options.length;
|
|
286
292
|
groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
|
|
287
293
|
accLength = groupLength;
|
|
@@ -318,6 +324,11 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
318
324
|
!multiple && closeOptions();
|
|
319
325
|
setSearchValue("");
|
|
320
326
|
}, [handleSelectChangeValue, closeOptions, multiple]);
|
|
327
|
+
(0, _react.useEffect)(function () {
|
|
328
|
+
if ((selectedOptionLabelRef === null || selectedOptionLabelRef === void 0 ? void 0 : selectedOptionLabelRef.current) != null) {
|
|
329
|
+
if ((selectedOptionLabelRef === null || selectedOptionLabelRef === void 0 ? void 0 : selectedOptionLabelRef.current.scrollWidth) > (selectedOptionLabelRef === null || selectedOptionLabelRef === void 0 ? void 0 : selectedOptionLabelRef.current.clientWidth)) selectedOptionLabelRef.current.title = getSelectedOptionLabel(placeholder, selectedOption);else selectedOptionLabelRef.current.title = "";
|
|
330
|
+
}
|
|
331
|
+
}, [placeholder, selectedOption]);
|
|
321
332
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
322
333
|
theme: colorsTheme.select
|
|
323
334
|
}, /*#__PURE__*/_react["default"].createElement(SelectContainer, {
|
|
@@ -384,15 +395,12 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
384
395
|
autoComplete: "nope",
|
|
385
396
|
autoCorrect: "nope",
|
|
386
397
|
size: 1
|
|
387
|
-
}), (!searchable || searchValue === "") &&
|
|
388
|
-
disabled: disabled,
|
|
389
|
-
atBackground: (value !== null && value !== void 0 ? value : innerValue).length === 0 || searchable && isOpen
|
|
390
|
-
}, /*#__PURE__*/_react["default"].createElement(SelectedOptionLabel, null, Array.isArray(selectedOption) && selectedOption.map(function (option) {
|
|
391
|
-
return option.label;
|
|
392
|
-
}).join(", ")), Array.isArray(selectedOption) && selectedOption.length === 0 && placeholder) : /*#__PURE__*/_react["default"].createElement(SelectedOption, {
|
|
398
|
+
}), (!searchable || searchValue === "") && /*#__PURE__*/_react["default"].createElement(SelectedOption, {
|
|
393
399
|
disabled: disabled,
|
|
394
|
-
atBackground: !(value !== null && value !== void 0 ? value : innerValue) || searchable && isOpen
|
|
395
|
-
}, /*#__PURE__*/_react["default"].createElement(SelectedOptionLabel,
|
|
400
|
+
atBackground: (multiple ? (value !== null && value !== void 0 ? value : innerValue).length === 0 : !(value !== null && value !== void 0 ? value : innerValue)) || searchable && isOpen
|
|
401
|
+
}, /*#__PURE__*/_react["default"].createElement(SelectedOptionLabel, {
|
|
402
|
+
ref: selectedOptionLabelRef
|
|
403
|
+
}, getSelectedOptionLabel(placeholder, selectedOption)))), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, null, _Icons["default"].error), searchable && searchValue.length > 0 && /*#__PURE__*/_react["default"].createElement(ClearSearchAction, {
|
|
396
404
|
onMouseDown: function onMouseDown(event) {
|
|
397
405
|
// Avoid input to lose focus
|
|
398
406
|
event.preventDefault();
|