@arc-ui/components 13.0.0 → 13.2.0
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/lib/Alert/styles.css +1 -1
- package/lib/Align/styles.css +1 -1
- package/lib/AppButton/styles.css +1 -1
- package/lib/Avatar/styles.css +1 -1
- package/lib/AvatarGroup/styles.css +1 -1
- package/lib/Badge/styles.css +1 -1
- package/lib/Banner/Banner.cjs +7 -3
- package/lib/Banner/Banner.mjs +7 -3
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/styles.css +1 -1
- package/lib/Button/styles.css +1 -1
- package/lib/ButtonGroup/styles.css +1 -1
- package/lib/ButtonV2/styles.css +1 -1
- package/lib/Calendar/Calendar.cjs +2 -2
- package/lib/Calendar/Calendar.mjs +2 -2
- package/lib/Calendar/styles.css +1 -1
- package/lib/CardFooter/styles.css +1 -1
- package/lib/CardHeading/styles.css +1 -1
- package/lib/Carousel/Carousel.cjs +26 -14
- package/lib/Carousel/Carousel.mjs +26 -14
- package/lib/Carousel/styles.css +1 -1
- package/lib/Checkbox/styles.css +1 -1
- package/lib/CheckboxIcon/styles.css +1 -1
- package/lib/ClientSideVisible/ClientSideVisible.cjs +1 -0
- package/lib/ClientSideVisible/ClientSideVisible.mjs +1 -0
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +530 -136
- package/lib/ComboBox/ComboBox.mjs +530 -136
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ConditionalWrapper/ConditionalWrapper.cjs +1 -0
- package/lib/ConditionalWrapper/ConditionalWrapper.mjs +1 -0
- package/lib/ContentSwitcher/styles.css +1 -1
- package/lib/ContentSwitcherDropdown/styles.css +1 -1
- package/lib/DatePicker/DatePicker.cjs +3 -3
- package/lib/DatePicker/DatePicker.mjs +3 -3
- package/lib/DatePicker/styles.css +1 -1
- package/lib/Disclosure/styles.css +1 -1
- package/lib/DisclosureMini/styles.css +1 -1
- package/lib/Download/styles.css +1 -1
- package/lib/Drawer/styles.css +1 -1
- package/lib/Elevation/styles.css +1 -1
- package/lib/Filter/styles.css +1 -1
- package/lib/FormControl/styles.css +1 -1
- package/lib/GhostedHeroBanner/styles.css +1 -1
- package/lib/GradientPageBackground/GradientPageBackground.cjs +2 -2
- package/lib/GradientPageBackground/GradientPageBackground.mjs +2 -2
- package/lib/GradientPageBackground/styles.css +1 -1
- package/lib/Grid/Grid.cjs +1 -0
- package/lib/Grid/Grid.mjs +1 -0
- package/lib/Grid/styles.css +1 -1
- package/lib/Group/styles.css +1 -1
- package/lib/Heading/styles.css +1 -1
- package/lib/HeroBanner/HeroBanner.cjs +7 -3
- package/lib/HeroBanner/HeroBanner.mjs +7 -3
- package/lib/HeroBanner/styles.css +1 -1
- package/lib/HeroButton/styles.css +1 -1
- package/lib/Hidden/styles.css +1 -1
- package/lib/HorizontalCard/styles.css +1 -1
- package/lib/Icon/styles.css +1 -1
- package/lib/Image/styles.css +1 -1
- package/lib/ImpactCard/ImpactCard.cjs +28 -15
- package/lib/ImpactCard/ImpactCard.mjs +29 -16
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +57 -33
- package/lib/InformationCard/InformationCard.mjs +59 -35
- package/lib/InformationCard/styles.css +1 -1
- package/lib/Link/styles.css +1 -1
- package/lib/Markup/styles.css +1 -1
- package/lib/MediaCard/MediaCard.cjs +40 -21
- package/lib/MediaCard/MediaCard.mjs +41 -22
- package/lib/MediaCard/styles.css +1 -1
- package/lib/Menu/styles.css +1 -1
- package/lib/Modal/styles.css +1 -1
- package/lib/NavigationHeader/NavigationHeader.cjs +2764 -472
- package/lib/NavigationHeader/NavigationHeader.mjs +2707 -436
- package/lib/NavigationHeader/styles.css +1 -1
- package/lib/Pagination/styles.css +1 -1
- package/lib/PaginationSimple/styles.css +1 -1
- package/lib/Popover/Popover.cjs +1 -1
- package/lib/Popover/Popover.mjs +1 -1
- package/lib/Popover/styles.css +1 -1
- package/lib/Poster/styles.css +1 -1
- package/lib/ProgressBar/styles.css +1 -1
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/styles.css +1 -1
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +2 -1
- package/lib/RadioGroup/RadioGroup.mjs +2 -1
- package/lib/RadioGroup/styles.css +1 -1
- package/lib/Rule/styles.css +1 -1
- package/lib/ScrollToTop/styles.css +1 -1
- package/lib/Section/styles.css +1 -1
- package/lib/Select/styles.css +1 -1
- package/lib/SemanticButton/SemanticButton.cjs +10 -0
- package/lib/SemanticButton/SemanticButton.mjs +4 -0
- package/lib/SemanticButton/styles.css +1 -0
- package/lib/SemanticHeading/styles.css +1 -1
- package/lib/SemanticLink/SemanticLink.cjs +10 -0
- package/lib/SemanticLink/SemanticLink.mjs +4 -0
- package/lib/SemanticLink/styles.css +1 -0
- package/lib/SiteFooter/styles.css +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.cjs +3 -2
- package/lib/SiteFooterV2/SiteFooterV2.mjs +3 -2
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +1 -1
- package/lib/SiteHeaderV2/styles.css +1 -1
- package/lib/Skeleton/styles.css +1 -1
- package/lib/SkipLink/SkipLink.cjs +1 -0
- package/lib/SkipLink/SkipLink.mjs +1 -0
- package/lib/SkipLink/styles.css +1 -1
- package/lib/Spacing/Spacing.cjs +38 -0
- package/lib/Spacing/Spacing.mjs +36 -0
- package/lib/Spacing/styles.css +1 -0
- package/lib/Spinner/styles.css +1 -1
- package/lib/Surface/styles.css +1 -1
- package/lib/Switch/styles.css +1 -1
- package/lib/TabbedBanner/TabbedBanner.cjs +5 -3
- package/lib/TabbedBanner/TabbedBanner.mjs +5 -3
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.cjs +57 -25
- package/lib/Tabs/Tabs.mjs +57 -25
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +5 -1
- package/lib/TemplateBanner/TemplateBanner.mjs +5 -1
- package/lib/TemplateBanner/styles.css +1 -1
- package/lib/Text/styles.css +1 -1
- package/lib/TextArea/styles.css +1 -1
- package/lib/TextInput/TextInput.cjs +1 -1
- package/lib/TextInput/TextInput.mjs +1 -1
- package/lib/TextInput/styles.css +1 -1
- package/lib/Theme/Theme.cjs +1 -1
- package/lib/Theme/Theme.mjs +1 -1
- package/lib/Theme/styles.css +1 -1
- package/lib/ThemeIcon/styles.css +1 -1
- package/lib/ThumbnailSignpost/styles.css +1 -1
- package/lib/Toast/styles.css +1 -1
- package/lib/Tooltip/styles.css +1 -1
- package/lib/Truncate/styles.css +1 -1
- package/lib/TypographyCard/TypographyCard.cjs +38 -14
- package/lib/TypographyCard/TypographyCard.mjs +39 -15
- package/lib/TypographyCard/styles.css +1 -1
- package/lib/UniversalHeader/UniversalHeader.cjs +10 -8
- package/lib/UniversalHeader/UniversalHeader.mjs +10 -8
- package/lib/UniversalHeader/styles.css +1 -1
- package/lib/VerticalSpace/styles.css +1 -1
- package/lib/VideoPlayer/styles.css +1 -1
- package/lib/Visible/styles.css +1 -1
- package/lib/VisuallyHidden/styles.css +1 -1
- package/lib/_shared/cjs/{Calendar-CdLn9iv6.cjs → Calendar-B-DmNni2.cjs} +1 -1
- package/lib/_shared/cjs/{Popover-BtvRErpC.cjs → Popover-BxuQPltF.cjs} +2 -2
- package/lib/_shared/cjs/SemanticButton-Be0gsNLA.cjs +16 -0
- package/lib/_shared/cjs/SemanticLink-DYO9HLGa.cjs +16 -0
- package/lib/_shared/cjs/{TemplateBanner-DyXBKuMw.cjs → TemplateBanner-DfzDwiVT.cjs} +35 -5
- package/lib/_shared/cjs/{TextInput-C_K2PLf5.cjs → TextInput-CLkhL2KT.cjs} +39 -6
- package/lib/_shared/cjs/{arc-breakpoints-uADxN-b4.cjs → arc-breakpoints-C3HREhvT.cjs} +1 -1
- package/lib/_shared/cjs/{index.es-BAsay4oe.cjs → index.es-D5DdMrn2.cjs} +1 -1
- package/lib/_shared/esm/{Calendar-CzFIMyD1.mjs → Calendar-CfEBiAjy.mjs} +1 -1
- package/lib/_shared/esm/{Popover-DRQSgAog.mjs → Popover-Pjtmu_TN.mjs} +2 -2
- package/lib/_shared/esm/SemanticButton-NGAMAw3m.mjs +14 -0
- package/lib/_shared/esm/SemanticLink-DfJjaHk2.mjs +14 -0
- package/lib/_shared/esm/{TemplateBanner-BPzuH5bz.mjs → TemplateBanner-oQjgkrBQ.mjs} +36 -6
- package/lib/_shared/esm/{TextInput-BCvKXfM_.mjs → TextInput-WczTCUvp.mjs} +40 -7
- package/lib/_shared/esm/{arc-breakpoints-ChQgbftE.mjs → arc-breakpoints-ANMn37k9.mjs} +1 -1
- package/lib/_shared/esm/{index.es-99J0r2va.mjs → index.es-Du5Lyvbp.mjs} +2 -2
- package/lib/index.cjs +9958 -7073
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +560 -203
- package/lib/index.d.mts +560 -203
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +16949 -14068
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +6 -2
- package/package.json +9 -8
|
@@ -3,123 +3,223 @@
|
|
|
3
3
|
|
|
4
4
|
var tslib_es6 = require('../_shared/cjs/tslib.es6-CCZ3TN_7.cjs');
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var index = require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
6
7
|
var index$2 = require('../_shared/cjs/index-DsqYRMfM.cjs');
|
|
7
|
-
var index$1 = require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
8
8
|
var filterAttrs = require('../_shared/cjs/filter-attrs-D19P2s1V.cjs');
|
|
9
|
+
var suffixModifier = require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
9
10
|
var FormControl = require('../_shared/cjs/FormControl-TtboqHRx.cjs');
|
|
10
|
-
var index = require('../_shared/cjs/index-DlWZZNwu.cjs');
|
|
11
|
-
var Box = require('../_shared/cjs/Box-Va2g7Gdp.cjs');
|
|
11
|
+
var index$1 = require('../_shared/cjs/index-DlWZZNwu.cjs');
|
|
12
12
|
var Icon = require('../_shared/cjs/Icon-Dk2XHa7V.cjs');
|
|
13
|
+
var Surface = require('../_shared/cjs/Surface-DIU5ciDT.cjs');
|
|
13
14
|
var ThemeIcon = require('../_shared/cjs/ThemeIcon-CwYN77IF.cjs');
|
|
15
|
+
var Tooltip = require('../_shared/cjs/Tooltip-CdmWvrnr.cjs');
|
|
16
|
+
var VerticalSpace = require('../_shared/cjs/VerticalSpace-DLQUYsvc.cjs');
|
|
17
|
+
var Text = require('../_shared/cjs/Text-jwsn80lQ.cjs');
|
|
18
|
+
var Rule = require('../_shared/cjs/Rule-essaguo_.cjs');
|
|
14
19
|
require('../_shared/cjs/Combination-Cm62lfyr.cjs');
|
|
15
20
|
require('react/jsx-runtime');
|
|
16
21
|
require('react-dom');
|
|
17
22
|
require('../_shared/cjs/index-WO7l1Mfx.cjs');
|
|
18
23
|
require('../_shared/cjs/index-BdJeAKfz.cjs');
|
|
19
24
|
require('../_shared/cjs/index-BBDa9gnQ.cjs');
|
|
20
|
-
require('../_shared/cjs/Surface-DIU5ciDT.cjs');
|
|
21
25
|
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
22
26
|
require('../_shared/cjs/DisclosureMini-Cy7hNc90.cjs');
|
|
23
|
-
require('../_shared/cjs/Text-jwsn80lQ.cjs');
|
|
24
|
-
require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
25
27
|
require('../_shared/cjs/VisuallyHidden-CQg3cOVK.cjs');
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='M15.993 23.914 2.294 10.207a1 1 0 1 1 1.414-1.414l12.285 12.293L28.292 8.793a1 1 0 1 1 1.414 1.414Z'/%3e%3c/svg%3e";
|
|
29
|
+
var convertOptionsToObjects = function (options) {
|
|
30
|
+
return options.map(function (option) { return ({
|
|
31
|
+
isCustom: false,
|
|
32
|
+
text: option,
|
|
33
|
+
}); });
|
|
34
|
+
};
|
|
34
35
|
|
|
35
36
|
var filterOptions = function (options, value) {
|
|
36
|
-
return options
|
|
37
|
+
return options
|
|
38
|
+
.filter(function (option) {
|
|
37
39
|
return value ? option.toLowerCase().includes(value.toLowerCase()) : true;
|
|
38
|
-
})
|
|
40
|
+
})
|
|
41
|
+
.map(function (option) { return ({ text: option, isCustom: false }); });
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var findOptionIndex = function (options, searchOption) { return options.findIndex(function (option) { return option.text === searchOption.text; }); };
|
|
45
|
+
|
|
46
|
+
var getClosestMatchingOptionIndex = function (options, filteredOptions) {
|
|
47
|
+
return options.length && filteredOptions.length
|
|
48
|
+
? options.findIndex(function (option) { return option.text === filteredOptions[0].text; })
|
|
49
|
+
: 0;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var isOptionValueMatch = function (option, value) {
|
|
53
|
+
return option.text.toLowerCase() === value.toLowerCase();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var getMatchingOption = function (options, value) {
|
|
57
|
+
return options.find(function (option) { return isOptionValueMatch(option, value); });
|
|
39
58
|
};
|
|
59
|
+
|
|
60
|
+
var getKeydownOptionToHighlight = function (_a) {
|
|
61
|
+
var options = _a.options, isNext = _a.isNext, highlightedOptionIndex = _a.highlightedOptionIndex;
|
|
62
|
+
var currentHighlightIndex = highlightedOptionIndex !== null && highlightedOptionIndex !== void 0 ? highlightedOptionIndex : -1;
|
|
63
|
+
var isAtBoundary = isNext
|
|
64
|
+
? currentHighlightIndex === options.length - 1
|
|
65
|
+
: currentHighlightIndex <= 0;
|
|
66
|
+
var boundaryIndex = isNext ? 0 : options.length - 1;
|
|
67
|
+
var nextOptionIndex = isNext
|
|
68
|
+
? currentHighlightIndex + 1
|
|
69
|
+
: currentHighlightIndex - 1;
|
|
70
|
+
return isAtBoundary ? boundaryIndex : nextOptionIndex;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var multiSelectLimitReached = function (newSelectedOptions, multiSelectLimit) { return (multiSelectLimit ? newSelectedOptions.length >= multiSelectLimit : false); };
|
|
74
|
+
|
|
75
|
+
var convertOptionsToText = function (options) {
|
|
76
|
+
return options.map(function (option) { return option.text; });
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var canAddNewMultiSelectOptions = function (newSelectedOptions, multiSelectLimit) {
|
|
80
|
+
return !multiSelectLimit ||
|
|
81
|
+
(multiSelectLimit && newSelectedOptions.length <= multiSelectLimit);
|
|
82
|
+
};
|
|
83
|
+
|
|
40
84
|
var getSelectedOptions = function (option, selectedOptions) {
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
var isOptionCurrentlySelected = getMatchingOption(selectedOptions, option.text);
|
|
86
|
+
return isOptionCurrentlySelected
|
|
87
|
+
? selectedOptions.filter(function (selectedOption) { return !isOptionValueMatch(selectedOption, option.text); })
|
|
43
88
|
: tslib_es6.__spreadArray(tslib_es6.__spreadArray([], selectedOptions, true), [option], false);
|
|
44
89
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
90
|
+
|
|
91
|
+
var getNewMultiSelectOptions = function (selectedOption, selectedOptions, multiSelectLimit) {
|
|
92
|
+
var newSelectedOptions = getSelectedOptions(selectedOption, selectedOptions);
|
|
93
|
+
var limitReached = multiSelectLimitReached(newSelectedOptions, multiSelectLimit);
|
|
94
|
+
var canAddNewOptions = canAddNewMultiSelectOptions(newSelectedOptions, multiSelectLimit);
|
|
95
|
+
return {
|
|
96
|
+
newOptions: canAddNewOptions ? newSelectedOptions : selectedOptions,
|
|
97
|
+
limitReached: limitReached,
|
|
98
|
+
};
|
|
50
99
|
};
|
|
51
100
|
|
|
52
101
|
var reducer = function (initialOptions) {
|
|
53
102
|
return function (state, action) {
|
|
103
|
+
var _a;
|
|
54
104
|
switch (action.type) {
|
|
55
105
|
case "OPEN": {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: true, highlightedOptionIndex: 0 });
|
|
107
|
+
}
|
|
108
|
+
case "CLOSE_MENU": {
|
|
109
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { showAllTags: false, isExpanded: false, highlightedOptionIndex: undefined });
|
|
110
|
+
}
|
|
111
|
+
case "CLEAR": {
|
|
112
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { value: "", singleSelectedOption: action.payload.isCustomEntryAllowed
|
|
113
|
+
? { isCustom: false, text: "" }
|
|
114
|
+
: state.singleSelectedOption, options: convertOptionsToObjects(initialOptions), onChangeValue: action.payload.isMultiSelectable
|
|
115
|
+
? convertOptionsToText(state.selectedOptions)
|
|
116
|
+
: "" });
|
|
117
|
+
}
|
|
118
|
+
case "SHOW_ALL_TAGS": {
|
|
119
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { showAllTags: true });
|
|
120
|
+
}
|
|
121
|
+
case "EXIT_INPUT": {
|
|
122
|
+
var _b = action.payload, isMultiSelectable = _b.isMultiSelectable, isCustomEntryAllowed = _b.isCustomEntryAllowed;
|
|
123
|
+
var matchingOption = getMatchingOption(state.options, state.value);
|
|
124
|
+
var allOptions = convertOptionsToObjects(initialOptions);
|
|
125
|
+
var isCustomEntrySingleSelect = !isMultiSelectable && isCustomEntryAllowed;
|
|
126
|
+
var isConstrainedSingleSelect = !isMultiSelectable && !isCustomEntryAllowed;
|
|
127
|
+
var commonState = tslib_es6.__assign(tslib_es6.__assign({}, state), { options: allOptions, showAllTags: false, isExpanded: false, highlightedOptionIndex: undefined });
|
|
128
|
+
if (!isMultiSelectable && matchingOption) {
|
|
129
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, commonState), { singleSelectedOption: matchingOption, value: matchingOption.text, onChangeValue: matchingOption.text });
|
|
130
|
+
}
|
|
131
|
+
if (isCustomEntrySingleSelect && !matchingOption) {
|
|
132
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, commonState), { value: state.value, onChangeValue: state.value });
|
|
133
|
+
}
|
|
134
|
+
if (isConstrainedSingleSelect) {
|
|
135
|
+
var newValue = ((_a = state.singleSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || "";
|
|
136
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, commonState), { value: newValue, onChangeValue: newValue });
|
|
137
|
+
}
|
|
138
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, commonState), { value: "", onChangeValue: isMultiSelectable
|
|
139
|
+
? convertOptionsToText(state.selectedOptions)
|
|
140
|
+
: "" });
|
|
61
141
|
}
|
|
62
|
-
case "
|
|
63
|
-
|
|
142
|
+
case "SET_HIGHLIGHTED_OPTION": {
|
|
143
|
+
var index = action.payload.index;
|
|
144
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { highlightedOptionIndex: index });
|
|
64
145
|
}
|
|
65
146
|
case "INPUT_CHANGE": {
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
147
|
+
var _c = action.payload, value = _c.value, isAutocomplete = _c.isAutocomplete, isCustomEntryAllowed = _c.isCustomEntryAllowed, isMultiSelectable = _c.isMultiSelectable;
|
|
148
|
+
var filteredOptions = filterOptions(initialOptions, value);
|
|
149
|
+
var matchingOption = getMatchingOption(state.options, value);
|
|
150
|
+
var showCustomMultiSelectOption = Boolean(value.trim()) &&
|
|
151
|
+
isCustomEntryAllowed &&
|
|
152
|
+
isMultiSelectable &&
|
|
153
|
+
!matchingOption;
|
|
154
|
+
var optionsList = isAutocomplete
|
|
155
|
+
? filteredOptions
|
|
156
|
+
: convertOptionsToObjects(initialOptions);
|
|
157
|
+
var newOptions = showCustomMultiSelectOption
|
|
158
|
+
? tslib_es6.__spreadArray([{ isCustom: true, text: value }], optionsList, true) : optionsList;
|
|
159
|
+
var closestMatchingOptionIndex = getClosestMatchingOptionIndex(newOptions, filteredOptions);
|
|
160
|
+
var singleSelectedOption = isCustomEntryAllowed
|
|
161
|
+
? { isCustom: false, text: "" }
|
|
162
|
+
: state.singleSelectedOption;
|
|
163
|
+
var highlightedOptionIndex = isAutocomplete
|
|
164
|
+
? 0
|
|
165
|
+
: closestMatchingOptionIndex;
|
|
166
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { value: value, onChangeValue: !isMultiSelectable
|
|
167
|
+
? value
|
|
168
|
+
: convertOptionsToText(state.selectedOptions), options: newOptions, singleSelectedOption: singleSelectedOption, highlightedOptionIndex: highlightedOptionIndex, isDirty: true, isExpanded: true });
|
|
70
169
|
}
|
|
71
170
|
case "SINGLE_SELECT": {
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
: state.options, value: selectedOption });
|
|
171
|
+
var selectedOption = action.payload.option;
|
|
172
|
+
var options = state.options;
|
|
173
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: false, isDirty: true, singleSelectedOption: selectedOption, options: convertOptionsToObjects(initialOptions), highlightedOptionIndex: findOptionIndex(options, selectedOption), value: selectedOption.text, onChangeValue: selectedOption.text });
|
|
76
174
|
}
|
|
77
175
|
case "MULTI_SELECT": {
|
|
78
|
-
var
|
|
79
|
-
var selectedOptions = state.selectedOptions
|
|
80
|
-
var
|
|
81
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), {
|
|
176
|
+
var _d = action.payload, selectedOption = _d.option, multiSelectLimit = _d.multiSelectLimit;
|
|
177
|
+
var selectedOptions = state.selectedOptions;
|
|
178
|
+
var _e = getNewMultiSelectOptions(selectedOption, selectedOptions, multiSelectLimit), newOptions = _e.newOptions, limitReached = _e.limitReached;
|
|
179
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { limitReached: limitReached, selectedOptions: newOptions, onChangeValue: convertOptionsToText(newOptions) });
|
|
82
180
|
}
|
|
83
181
|
case "MULTI_SELECT_REMOVE": {
|
|
84
|
-
var
|
|
182
|
+
var _f = action.payload, option_1 = _f.option, multiSelectLimit = _f.multiSelectLimit;
|
|
85
183
|
var selectedOptions = state.selectedOptions;
|
|
86
|
-
|
|
184
|
+
var newSelectedOptions = selectedOptions.filter(function (selectedOption) { return option_1.text !== selectedOption.text; });
|
|
185
|
+
var limitReached = multiSelectLimitReached(newSelectedOptions, multiSelectLimit);
|
|
186
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { limitReached: limitReached, onChangeValue: convertOptionsToText(newSelectedOptions), selectedOptions: newSelectedOptions });
|
|
87
187
|
}
|
|
88
188
|
case "KEYDOWN": {
|
|
89
|
-
var
|
|
189
|
+
var _g = action.payload, key = _g.key, isMultiSelectable = _g.isMultiSelectable, multiSelectLimit = _g.multiSelectLimit;
|
|
90
190
|
var isExpanded = state.isExpanded, highlightedOptionIndex = state.highlightedOptionIndex, options = state.options, selectedOptions = state.selectedOptions;
|
|
191
|
+
var hasNoHighlightedOption = highlightedOptionIndex === undefined;
|
|
91
192
|
if (key === "Escape" && isExpanded) {
|
|
92
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: false, highlightedOptionIndex: 0 });
|
|
193
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { showAllTags: false, isExpanded: false, highlightedOptionIndex: 0 });
|
|
93
194
|
}
|
|
94
195
|
if (key === "ArrowDown" && isExpanded) {
|
|
95
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), { highlightedOptionIndex:
|
|
96
|
-
|
|
97
|
-
:
|
|
196
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { highlightedOptionIndex: getKeydownOptionToHighlight({
|
|
197
|
+
isNext: true,
|
|
198
|
+
options: options,
|
|
199
|
+
highlightedOptionIndex: highlightedOptionIndex,
|
|
200
|
+
}) });
|
|
98
201
|
}
|
|
99
202
|
if (key === "ArrowUp" && isExpanded) {
|
|
100
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), { highlightedOptionIndex:
|
|
101
|
-
|
|
102
|
-
:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: true, highlightedOptionIndex: isMultiSelectable && selectedOptions.length
|
|
106
|
-
? findOptionIndex(options, selectedOptions[selectedOptions.length - 1])
|
|
107
|
-
: 0 });
|
|
203
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { highlightedOptionIndex: getKeydownOptionToHighlight({
|
|
204
|
+
isNext: false,
|
|
205
|
+
options: options,
|
|
206
|
+
highlightedOptionIndex: highlightedOptionIndex,
|
|
207
|
+
}) });
|
|
108
208
|
}
|
|
109
|
-
if (
|
|
110
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: true, highlightedOptionIndex:
|
|
111
|
-
? findOptionIndex(options, selectedOptions[selectedOptions.length - 1])
|
|
112
|
-
: options.length - 1 });
|
|
209
|
+
if (["ArrowDown", "ArrowUp"].includes(key) && !isExpanded) {
|
|
210
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: true, highlightedOptionIndex: 0 });
|
|
113
211
|
}
|
|
114
212
|
if (key === "Enter" && isExpanded) {
|
|
213
|
+
if (hasNoHighlightedOption) {
|
|
214
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: false });
|
|
215
|
+
}
|
|
115
216
|
if (isMultiSelectable) {
|
|
116
|
-
var
|
|
117
|
-
return tslib_es6.__assign(tslib_es6.__assign({}, state), {
|
|
217
|
+
var _h = getNewMultiSelectOptions(options[highlightedOptionIndex], selectedOptions, multiSelectLimit), newOptions = _h.newOptions, limitReached = _h.limitReached;
|
|
218
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { limitReached: limitReached, onChangeValue: convertOptionsToText(newOptions), selectedOptions: newOptions });
|
|
118
219
|
}
|
|
119
220
|
else {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
: options, value: options[highlightedOptionIndex] });
|
|
221
|
+
var newSelectedOption = options[highlightedOptionIndex];
|
|
222
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, state), { isExpanded: false, singleSelectedOption: newSelectedOption, options: convertOptionsToObjects(initialOptions), onChangeValue: newSelectedOption.text, value: newSelectedOption.text });
|
|
123
223
|
}
|
|
124
224
|
}
|
|
125
225
|
return state;
|
|
@@ -130,27 +230,179 @@ var reducer = function (initialOptions) {
|
|
|
130
230
|
};
|
|
131
231
|
};
|
|
132
232
|
|
|
133
|
-
|
|
233
|
+
var ComboBoxTags = function (_a) {
|
|
234
|
+
var ref = _a.ref, selectedOptions = _a.selectedOptions, showAllTags = _a.showAllTags, isDisabled = _a.isDisabled, isError = _a.isError, isDarkSurface = _a.isDarkSurface, visibleTagCount = _a.visibleTagCount, inputSize = _a.inputSize, isReadOnly = _a.isReadOnly, onTagBlur = _a.onTagBlur, onTagClick = _a.onTagClick, onTagKeyDown = _a.onTagKeyDown, onShowAllTagsClick = _a.onShowAllTagsClick;
|
|
235
|
+
var id = React.useId();
|
|
236
|
+
var tagLimit = !showAllTags ? visibleTagCount : undefined;
|
|
237
|
+
var showHiddenTagCount = !showAllTags && selectedOptions.length > visibleTagCount;
|
|
238
|
+
return (React.createElement("div", { ref: ref, className: index.classNames("arc-ComboBoxTags", suffixModifier.suffixModifier("arc-ComboBoxTags--size", inputSize), {
|
|
239
|
+
"arc-ComboBoxTags--disabled": isDisabled,
|
|
240
|
+
"arc-ComboBoxTags--readOnly": isReadOnly,
|
|
241
|
+
"arc-ComboBoxTags--invalid": isError,
|
|
242
|
+
"arc-ComboBoxTags--onDarkSurface": isDarkSurface,
|
|
243
|
+
}) },
|
|
244
|
+
selectedOptions.slice(0, tagLimit).map(function (option, i) { return (React.createElement("button", { type: "button", disabled: isDisabled, key: "".concat(id, "-selectedOption-").concat(i), className: "arc-ComboBoxTags-tag", "aria-label": "".concat(option.text, ", press space or enter to remove"), onBlur: onTagBlur, onMouseDown: onTagClick(option), onKeyDown: onTagKeyDown(option) },
|
|
245
|
+
React.createElement("div", { "aria-hidden": true, className: "arc-ComboBoxTags-tagInner" },
|
|
246
|
+
React.createElement("span", null, option.text),
|
|
247
|
+
React.createElement("div", { className: "arc-ComboBoxTags-tagIcon" },
|
|
248
|
+
React.createElement(ThemeIcon.ThemeIcon, { icon: "comboboxTagRemove", size: 20 }))))); }),
|
|
249
|
+
showHiddenTagCount && (React.createElement("button", { type: "button", disabled: isDisabled, onClick: onShowAllTagsClick, className: "arc-ComboBoxTags-showHiddenButton", "aria-label": "Show all selected options" },
|
|
250
|
+
React.createElement("span", { className: "arc-ComboBoxTags-showHiddenButtonContent" },
|
|
251
|
+
"+\u00A0",
|
|
252
|
+
selectedOptions.length - visibleTagCount,
|
|
253
|
+
"\u00A0more")))));
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
var ComboBoxListItemInner = function (_a) {
|
|
257
|
+
var isHighlighted = _a.isHighlighted, isSingleSelected = _a.isSingleSelected, children = _a.children;
|
|
258
|
+
return (React.createElement("div", { className: index.classNames("arc-ComboBoxListItemInner", {
|
|
259
|
+
"arc-ComboBoxListItemInner--highlighted": isHighlighted,
|
|
260
|
+
"arc-ComboBoxListItemInner--singleSelected": isSingleSelected,
|
|
261
|
+
}) }, children));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
var ComboBoxRegularOption = function (_a) {
|
|
265
|
+
var option = _a.option, isDisabled = _a.isDisabled, isMultiSelectable = _a.isMultiSelectable, isHighlighted = _a.isHighlighted, isSingleSelected = _a.isSingleSelected, isMultiSelected = _a.isMultiSelected;
|
|
266
|
+
return (React.createElement(ComboBoxListItemInner, { isHighlighted: isHighlighted, isSingleSelected: isSingleSelected },
|
|
267
|
+
React.createElement("div", { className: "arc-ComboBoxRegularOption-container" },
|
|
268
|
+
isMultiSelectable && (React.createElement("div", { className: index.classNames("arc-ComboBoxRegularOption-icon", "arc-ComboBoxRegularOption-icon--checkbox", {
|
|
269
|
+
"arc-ComboBoxRegularOption-icon--checkboxSelected": isMultiSelected,
|
|
270
|
+
"arc-ComboBoxRegularOption-icon--checkboxDisabled": isDisabled,
|
|
271
|
+
}) },
|
|
272
|
+
React.createElement(ThemeIcon.ThemeIcon, { size: 24, icon: "comboboxSelected" }))),
|
|
273
|
+
React.createElement("div", { className: "arc-ComboBoxRegularOption-text" },
|
|
274
|
+
React.createElement(Text.Text, null, option.text)),
|
|
275
|
+
!isMultiSelectable && isSingleSelected && (React.createElement("div", { className: "arc-ComboBoxRegularOption-icon" },
|
|
276
|
+
React.createElement(ThemeIcon.ThemeIcon, { size: 24, icon: "comboboxSelected" }))))));
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
var ComboBoxCustomOption = function (_a) {
|
|
280
|
+
var option = _a.option, selectedOptions = _a.selectedOptions, customOptionSupportingCopy = _a.customOptionSupportingCopy, optionsLength = _a.optionsLength, isHighlighted = _a.isHighlighted, isSelected = _a.isSelected;
|
|
281
|
+
var prefixText = getMatchingOption(selectedOptions, option.text)
|
|
282
|
+
? "Remove"
|
|
283
|
+
: "Add";
|
|
284
|
+
return (React.createElement(React.Fragment, null,
|
|
285
|
+
React.createElement(ComboBoxListItemInner, { isHighlighted: isHighlighted, isSingleSelected: isSelected },
|
|
286
|
+
React.createElement(Text.Text, null,
|
|
287
|
+
prefixText,
|
|
288
|
+
": \"",
|
|
289
|
+
option.text,
|
|
290
|
+
"\""),
|
|
291
|
+
customOptionSupportingCopy && (React.createElement("div", null,
|
|
292
|
+
React.createElement(VerticalSpace.VerticalSpace, { size: "4" }),
|
|
293
|
+
React.createElement(Text.Text, { size: "xs" }, customOptionSupportingCopy)))),
|
|
294
|
+
optionsLength > 1 && (React.createElement(React.Fragment, null,
|
|
295
|
+
React.createElement("div", { className: "arc-ComboBoxCustomOption-rule" },
|
|
296
|
+
React.createElement("div", { className: "arc-ComboBoxCustomOption-ruleWrapper" },
|
|
297
|
+
React.createElement(Rule.Rule, null))),
|
|
298
|
+
React.createElement(VerticalSpace.VerticalSpace, { size: "8" })))));
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
var ComboBoxNoResults = function (_a) {
|
|
302
|
+
var noResultsSupportingCopy = _a.noResultsSupportingCopy, value = _a.value;
|
|
303
|
+
return (React.createElement("li", { "aria-disabled": true, "aria-selected": false, role: "option", className: "arc-ComboBoxNoResults" },
|
|
304
|
+
React.createElement(ComboBoxListItemInner, null,
|
|
305
|
+
React.createElement("div", { className: "arc-ComboBoxNoResults-container" },
|
|
306
|
+
React.createElement("div", { className: "arc-ComboBoxNoResults-icon" },
|
|
307
|
+
React.createElement(ThemeIcon.ThemeIcon, { size: 24, icon: "comboboxNoResults" })),
|
|
308
|
+
React.createElement("div", { className: "arc-ComboBoxNoResults-text" },
|
|
309
|
+
React.createElement(Text.Text, null,
|
|
310
|
+
"No results for \"",
|
|
311
|
+
value,
|
|
312
|
+
"\""),
|
|
313
|
+
noResultsSupportingCopy && (React.createElement(React.Fragment, null,
|
|
314
|
+
React.createElement(VerticalSpace.VerticalSpace, { size: "4" }),
|
|
315
|
+
React.createElement(Text.Text, { size: "xs" }, noResultsSupportingCopy))))))));
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
var ComboBoxOptions = function (_a) {
|
|
319
|
+
var options = _a.options, listBoxId = _a.listBoxId, onMouseMove = _a.onMouseMove, onMouseDown = _a.onMouseDown, isMultiSelectable = _a.isMultiSelectable, noResultsSupportingCopy = _a.noResultsSupportingCopy, customOptionSupportingCopy = _a.customOptionSupportingCopy, selectedOptions = _a.selectedOptions, singleSelectedOption = _a.singleSelectedOption, highlightedOptionIndex = _a.highlightedOptionIndex, setOptionRef = _a.setOptionRef, limitReached = _a.limitReached, value = _a.value;
|
|
320
|
+
var isHighlighted = function (index, currentHighlightIndex) {
|
|
321
|
+
return index === currentHighlightIndex;
|
|
322
|
+
};
|
|
323
|
+
var isSingleSelected = function (option, selectedOption) { return option.text === selectedOption.text; };
|
|
324
|
+
var isMultiSelected = function (option, selectedOptions) {
|
|
325
|
+
return selectedOptions.some(function (selectedOption) { return option.text === selectedOption.text; });
|
|
326
|
+
};
|
|
327
|
+
var isOptionDisabled = function (option, selectedOptions) { return limitReached && !isMultiSelected(option, selectedOptions); };
|
|
328
|
+
return (React.createElement(React.Fragment, null, options.length ? (options.map(function (option, i) { return (React.createElement("li", { key: option.text, role: "option", id: "".concat(listBoxId, "-").concat(i), ref: setOptionRef(i), onMouseMove: onMouseMove(i), onMouseDown: onMouseDown(option), "aria-disabled": isOptionDisabled(option, selectedOptions), "aria-selected": isMultiSelectable
|
|
329
|
+
? isMultiSelected(option, selectedOptions)
|
|
330
|
+
: isSingleSelected(option, singleSelectedOption), className: index.classNames("arc-ComboBoxOptions-listItem", {
|
|
331
|
+
"arc-ComboBoxOptions-listItem--disabled": isOptionDisabled(option, selectedOptions),
|
|
332
|
+
}) }, option.isCustom ? (React.createElement(ComboBoxCustomOption, { option: option, optionsLength: options.length, customOptionSupportingCopy: customOptionSupportingCopy, selectedOptions: selectedOptions, isHighlighted: isHighlighted(i, highlightedOptionIndex), isSelected: isSingleSelected(option, singleSelectedOption) })) : (React.createElement(ComboBoxRegularOption, { option: option, isDisabled: isOptionDisabled(option, selectedOptions), isMultiSelectable: isMultiSelectable, isHighlighted: isHighlighted(i, highlightedOptionIndex), isMultiSelected: isMultiSelected(option, selectedOptions), isSingleSelected: isSingleSelected(option, singleSelectedOption) })))); })) : (React.createElement(ComboBoxNoResults, { noResultsSupportingCopy: noResultsSupportingCopy, value: value }))));
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
var KeyNames;
|
|
336
|
+
(function (KeyNames) {
|
|
337
|
+
KeyNames["ArrowUp"] = "ArrowUp";
|
|
338
|
+
KeyNames["ArrowDown"] = "ArrowDown";
|
|
339
|
+
KeyNames["Home"] = "Home";
|
|
340
|
+
KeyNames["Enter"] = "Enter";
|
|
341
|
+
KeyNames["Escape"] = "Escape";
|
|
342
|
+
KeyNames["Space"] = " ";
|
|
343
|
+
})(KeyNames || (KeyNames = {}));
|
|
344
|
+
|
|
345
|
+
var isSelectionKey = function (key) {
|
|
346
|
+
return key === KeyNames.Space || key === KeyNames.Enter;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
var ComboBoxClearButton = function (_a) {
|
|
350
|
+
var ref = _a.ref, inputSize = _a.inputSize, tooltip = _a.tooltip, onKeyDown = _a.onKeyDown, onMouseDown = _a.onMouseDown, onBlur = _a.onBlur, isDarkSurface = _a.isDarkSurface, props = tslib_es6.__rest(_a, ["ref", "inputSize", "tooltip", "onKeyDown", "onMouseDown", "onBlur", "isDarkSurface"]);
|
|
351
|
+
return (React.createElement("button", tslib_es6.__assign({}, props, { type: "button", ref: ref, "aria-label": tooltip, onMouseDown: onMouseDown, onKeyDown: onKeyDown, onBlur: onBlur, className: index.classNames("arc-ComboBoxClearButton", suffixModifier.suffixModifier("arc-ComboBoxClearButton--size", inputSize), {
|
|
352
|
+
"arc-ComboBoxClearButton--onDarkSurface": isDarkSurface,
|
|
353
|
+
}) }),
|
|
354
|
+
React.createElement("div", { className: "arc-ComboBoxClearButton-icon" },
|
|
355
|
+
React.createElement(ThemeIcon.ThemeIcon, { "aria-hidden": true, icon: "comboboxClear" }))));
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
/** Use `ComboBox` to assist a text input with a dropdown list of options. */
|
|
134
359
|
var ComboBox = function (_a) {
|
|
135
|
-
var ref = _a.ref, name = _a.name, onBlur = _a.onBlur, onFocus = _a.onFocus, label = _a.label, helper = _a.helper, id = _a.id,
|
|
360
|
+
var ref = _a.ref, name = _a.name, onBlur = _a.onBlur, onFocus = _a.onFocus, label = _a.label, helper = _a.helper, id = _a.id, hideLabel = _a.hideLabel, isFluid = _a.isFluid, errorMessage = _a.errorMessage, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, listBoxAriaLabel = _a.listBoxAriaLabel, prefixIcon = _a.prefixIcon, onChange = _a.onChange, noResultsSupportingCopy = _a.noResultsSupportingCopy, customOptionSupportingCopy = _a.customOptionSupportingCopy, multiSelectLimit = _a.multiSelectLimit, initialOptions = _a.options, _b = _a.clearButtonTooltip, clearButtonTooltip = _b === void 0 ? "Clear input" : _b, _c = _a.defaultSelectedValues, defaultSelectedValues = _c === void 0 ? [] : _c, _d = _a.defaultValue, defaultValue = _d === void 0 ? "" : _d, _e = _a.size, size = _e === void 0 ? "m" : _e, _f = _a.visibleTagCount, visibleTagCount = _f === void 0 ? 5 : _f, _g = _a.isClearButtonEnabled, isClearButtonEnabled = _g === void 0 ? false : _g, _h = _a.isReadOnly, isReadOnly = _h === void 0 ? false : _h, _j = _a.isMultiSelectable, isMultiSelectable = _j === void 0 ? false : _j, _k = _a.isDisabled, isDisabled = _k === void 0 ? false : _k, _l = _a.isRequired, isRequired = _l === void 0 ? false : _l, _m = _a.isAutocomplete, isAutocomplete = _m === void 0 ? false : _m, _o = _a.isCustomEntryAllowed, isCustomEntryAllowed = _o === void 0 ? false : _o, props = tslib_es6.__rest(_a, ["ref", "name", "onBlur", "onFocus", "label", "helper", "id", "hideLabel", "isFluid", "errorMessage", "disclosureTitle", "disclosureText", "onClickDisclosure", "listBoxAriaLabel", "prefixIcon", "onChange", "noResultsSupportingCopy", "customOptionSupportingCopy", "multiSelectLimit", "options", "clearButtonTooltip", "defaultSelectedValues", "defaultValue", "size", "visibleTagCount", "isClearButtonEnabled", "isReadOnly", "isMultiSelectable", "isDisabled", "isRequired", "isAutocomplete", "isCustomEntryAllowed"]);
|
|
136
361
|
var listBoxId = React.useId();
|
|
362
|
+
var surface = React.useContext(Surface.Context).surface;
|
|
363
|
+
var _p = index$1.useThemeElement(), themeElement = _p[0], setThemeElement = _p[1];
|
|
137
364
|
var listItemRefs = React.useRef([]);
|
|
138
|
-
var
|
|
365
|
+
var comboBoxContainerRef = React.useRef(null);
|
|
366
|
+
var tagContainerRef = React.useRef(null);
|
|
139
367
|
var inputRef = React.useRef(null);
|
|
140
|
-
var
|
|
141
|
-
var
|
|
368
|
+
var prevOnChangeValueRef = React.useRef(null);
|
|
369
|
+
var _q = React.useReducer(reducer(initialOptions), {
|
|
142
370
|
isExpanded: false,
|
|
371
|
+
showAllTags: false,
|
|
372
|
+
isDirty: Boolean(defaultValue),
|
|
373
|
+
singleSelectedOption: { isCustom: false, text: defaultValue },
|
|
374
|
+
limitReached: defaultSelectedValues && multiSelectLimit
|
|
375
|
+
? defaultSelectedValues.length > multiSelectLimit
|
|
376
|
+
: false,
|
|
143
377
|
value: defaultValue,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
378
|
+
onChangeValue: isMultiSelectable
|
|
379
|
+
? defaultSelectedValues || null
|
|
380
|
+
: defaultValue || null,
|
|
381
|
+
options: convertOptionsToObjects(initialOptions),
|
|
382
|
+
selectedOptions: isMultiSelectable
|
|
383
|
+
? convertOptionsToObjects(defaultSelectedValues).slice(0, multiSelectLimit)
|
|
384
|
+
: [],
|
|
385
|
+
}), _r = _q[0], isExpanded = _r.isExpanded, value = _r.value, options = _r.options, showAllTags = _r.showAllTags, singleSelectedOption = _r.singleSelectedOption, highlightedOptionIndex = _r.highlightedOptionIndex, selectedOptions = _r.selectedOptions, limitReached = _r.limitReached, isDirty = _r.isDirty, onChangeValue = _r.onChangeValue, dispatch = _q[1];
|
|
148
386
|
var ariaDescribedby = FormControl.useAriaDescribedby({
|
|
149
387
|
errorMessage: errorMessage,
|
|
150
388
|
id: id,
|
|
151
389
|
helper: helper,
|
|
152
390
|
disclosureText: disclosureText,
|
|
153
391
|
}).ariaDescribedby;
|
|
392
|
+
React.useEffect(function () {
|
|
393
|
+
var hasValueChanged = JSON.stringify(onChangeValue) !==
|
|
394
|
+
JSON.stringify(prevOnChangeValueRef.current);
|
|
395
|
+
if (hasValueChanged && onChange && onChangeValue) {
|
|
396
|
+
prevOnChangeValueRef.current = onChangeValue;
|
|
397
|
+
onChange(onChangeValue);
|
|
398
|
+
}
|
|
399
|
+
}, [onChangeValue, onChange]);
|
|
400
|
+
var hasHighlightedOption = typeof highlightedOptionIndex !== "undefined";
|
|
401
|
+
var listVerticalPadding = "12";
|
|
402
|
+
var isDarkSurface = surface === "dark";
|
|
403
|
+
var canOpenMenu = !isExpanded && !isReadOnly;
|
|
404
|
+
var showClearButton = isClearButtonEnabled && isDirty && value && !isDisabled && !isReadOnly;
|
|
405
|
+
var stackAutoCompleteIconFirst = selectedOptions.length && isAutocomplete && !showClearButton;
|
|
154
406
|
var getTextInputRef = function (elementRef) {
|
|
155
407
|
inputRef.current = elementRef;
|
|
156
408
|
if (ref && typeof ref === "object") {
|
|
@@ -160,18 +412,24 @@ var ComboBox = function (_a) {
|
|
|
160
412
|
ref(elementRef);
|
|
161
413
|
}
|
|
162
414
|
};
|
|
415
|
+
var setOptionRef = function (index) { return function (el) {
|
|
416
|
+
return (listItemRefs.current[index] = el);
|
|
417
|
+
}; };
|
|
163
418
|
var setScrollPosition = function (listEl) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
listEl.scrollTop
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
419
|
+
if (hasHighlightedOption) {
|
|
420
|
+
var listItemEl = listItemRefs.current[highlightedOptionIndex];
|
|
421
|
+
if (listItemEl && listEl) {
|
|
422
|
+
var listItemOffset = listItemEl.offsetTop - parseInt(listVerticalPadding);
|
|
423
|
+
var selectedOptionIsBelowOverFlow = listItemOffset + listItemEl.offsetHeight >
|
|
424
|
+
listEl.offsetHeight + listEl.scrollTop;
|
|
425
|
+
var selectedOptionIsAboveOverFlow = listItemOffset < listEl.scrollTop;
|
|
426
|
+
if (selectedOptionIsBelowOverFlow) {
|
|
427
|
+
listEl.scrollTop =
|
|
428
|
+
listItemOffset + listItemEl.offsetHeight - listEl.offsetHeight;
|
|
429
|
+
}
|
|
430
|
+
if (selectedOptionIsAboveOverFlow) {
|
|
431
|
+
listEl.scrollTop = listItemOffset;
|
|
432
|
+
}
|
|
175
433
|
}
|
|
176
434
|
}
|
|
177
435
|
};
|
|
@@ -183,6 +441,7 @@ var ComboBox = function (_a) {
|
|
|
183
441
|
dispatch({
|
|
184
442
|
type: "MULTI_SELECT",
|
|
185
443
|
payload: {
|
|
444
|
+
multiSelectLimit: multiSelectLimit,
|
|
186
445
|
option: itemOption,
|
|
187
446
|
},
|
|
188
447
|
});
|
|
@@ -191,7 +450,6 @@ var ComboBox = function (_a) {
|
|
|
191
450
|
dispatch({
|
|
192
451
|
type: "SINGLE_SELECT",
|
|
193
452
|
payload: {
|
|
194
|
-
isAutocomplete: isAutocomplete,
|
|
195
453
|
option: itemOption,
|
|
196
454
|
},
|
|
197
455
|
});
|
|
@@ -203,94 +461,230 @@ var ComboBox = function (_a) {
|
|
|
203
461
|
dispatch({
|
|
204
462
|
type: "INPUT_CHANGE",
|
|
205
463
|
payload: {
|
|
464
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
465
|
+
isMultiSelectable: isMultiSelectable,
|
|
206
466
|
isAutocomplete: isAutocomplete,
|
|
207
467
|
value: e.target.value,
|
|
208
468
|
},
|
|
209
469
|
});
|
|
210
470
|
};
|
|
211
|
-
var
|
|
212
|
-
|
|
471
|
+
var onMouseDown = function (preventDefault) { return function (e) {
|
|
472
|
+
var _a;
|
|
473
|
+
preventDefault && e.preventDefault();
|
|
474
|
+
if (isDisabled) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
if (canOpenMenu) {
|
|
478
|
+
dispatch({
|
|
479
|
+
type: "OPEN",
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
if (isExpanded) {
|
|
483
|
+
dispatch({
|
|
484
|
+
type: "CLOSE_MENU",
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
488
|
+
}; };
|
|
489
|
+
var onInteractOutsideDropdown = function (e) {
|
|
490
|
+
if (comboBoxContainerRef.current &&
|
|
491
|
+
!comboBoxContainerRef.current.contains(e.currentTarget)) {
|
|
492
|
+
dispatch({
|
|
493
|
+
type: "EXIT_INPUT",
|
|
494
|
+
payload: {
|
|
495
|
+
isMultiSelectable: isMultiSelectable,
|
|
496
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
497
|
+
},
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
var onInputFocus = function (e) {
|
|
502
|
+
if (canOpenMenu) {
|
|
213
503
|
dispatch({
|
|
214
504
|
type: "OPEN",
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
onFocus && onFocus(e);
|
|
508
|
+
};
|
|
509
|
+
var onInputBlur = function (e) {
|
|
510
|
+
var _a;
|
|
511
|
+
if (!isExpanded &&
|
|
512
|
+
!((_a = comboBoxContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
|
|
513
|
+
dispatch({
|
|
514
|
+
type: "EXIT_INPUT",
|
|
215
515
|
payload: {
|
|
216
516
|
isMultiSelectable: isMultiSelectable,
|
|
517
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
217
518
|
},
|
|
218
519
|
});
|
|
520
|
+
}
|
|
521
|
+
onBlur && onBlur(e);
|
|
219
522
|
};
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
|
|
523
|
+
var onClearButtonBlur = function (e) {
|
|
524
|
+
var _a;
|
|
525
|
+
if (!isExpanded &&
|
|
526
|
+
!((_a = comboBoxContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
|
|
223
527
|
dispatch({
|
|
224
|
-
type: "
|
|
528
|
+
type: "EXIT_INPUT",
|
|
529
|
+
payload: {
|
|
530
|
+
isMultiSelectable: isMultiSelectable,
|
|
531
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
532
|
+
},
|
|
225
533
|
});
|
|
226
534
|
}
|
|
227
535
|
};
|
|
228
536
|
var onInputKeyDown = function (e) {
|
|
537
|
+
if (!isReadOnly) {
|
|
538
|
+
if (isSelectionKey(e.key)) {
|
|
539
|
+
e.preventDefault();
|
|
540
|
+
}
|
|
541
|
+
dispatch({
|
|
542
|
+
type: "KEYDOWN",
|
|
543
|
+
payload: {
|
|
544
|
+
key: e.key,
|
|
545
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
546
|
+
isMultiSelectable: isMultiSelectable,
|
|
547
|
+
multiSelectLimit: multiSelectLimit,
|
|
548
|
+
},
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
var setHighlightedOption = function (index) { return function () {
|
|
229
553
|
dispatch({
|
|
230
|
-
type: "
|
|
554
|
+
type: "SET_HIGHLIGHTED_OPTION",
|
|
231
555
|
payload: {
|
|
232
|
-
|
|
233
|
-
isAutocomplete: isAutocomplete,
|
|
234
|
-
isMultiSelectable: isMultiSelectable,
|
|
556
|
+
index: index,
|
|
235
557
|
},
|
|
236
558
|
});
|
|
237
|
-
};
|
|
238
|
-
var onMultiSelectRemove = function (option) {
|
|
559
|
+
}; };
|
|
560
|
+
var onMultiSelectRemove = function (option) {
|
|
239
561
|
var _a;
|
|
240
|
-
e.preventDefault();
|
|
241
|
-
e.stopPropagation();
|
|
242
562
|
dispatch({
|
|
243
563
|
type: "MULTI_SELECT_REMOVE",
|
|
244
564
|
payload: {
|
|
245
565
|
option: option,
|
|
566
|
+
multiSelectLimit: multiSelectLimit,
|
|
246
567
|
},
|
|
247
568
|
});
|
|
248
569
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
570
|
+
};
|
|
571
|
+
var onTagClick = function (option) { return function (e) {
|
|
572
|
+
e.preventDefault();
|
|
573
|
+
e.stopPropagation();
|
|
574
|
+
!isReadOnly && onMultiSelectRemove(option);
|
|
575
|
+
}; };
|
|
576
|
+
var onTagKeyDown = function (option) { return function (e) {
|
|
577
|
+
if (isSelectionKey(e.key)) {
|
|
578
|
+
e.preventDefault();
|
|
579
|
+
e.stopPropagation();
|
|
580
|
+
!isReadOnly && onMultiSelectRemove(option);
|
|
581
|
+
}
|
|
249
582
|
}; };
|
|
583
|
+
var onShowAllTagsClick = function () {
|
|
584
|
+
var _a, _b;
|
|
585
|
+
dispatch({
|
|
586
|
+
type: "SHOW_ALL_TAGS",
|
|
587
|
+
});
|
|
588
|
+
if (!isReadOnly) {
|
|
589
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
((_b = tagContainerRef.current) === null || _b === void 0 ? void 0 : _b.firstChild).focus();
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
var onTagBlur = function (e) {
|
|
596
|
+
var _a;
|
|
597
|
+
if (isReadOnly &&
|
|
598
|
+
!((_a = comboBoxContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
|
|
599
|
+
dispatch({
|
|
600
|
+
type: "EXIT_INPUT",
|
|
601
|
+
payload: {
|
|
602
|
+
isMultiSelectable: isMultiSelectable,
|
|
603
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
604
|
+
},
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
var onClearButtonMouseDown = function (e) {
|
|
609
|
+
var _a, _b;
|
|
610
|
+
e.preventDefault();
|
|
611
|
+
dispatch({
|
|
612
|
+
type: "CLEAR",
|
|
613
|
+
payload: {
|
|
614
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
615
|
+
isMultiSelectable: isMultiSelectable,
|
|
616
|
+
},
|
|
617
|
+
});
|
|
618
|
+
if (!((_a = comboBoxContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement))) {
|
|
619
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
var onClearButtonKeydown = function (e) {
|
|
623
|
+
var _a;
|
|
624
|
+
if (isSelectionKey(e.key)) {
|
|
625
|
+
e.preventDefault();
|
|
626
|
+
dispatch({
|
|
627
|
+
type: "CLEAR",
|
|
628
|
+
payload: {
|
|
629
|
+
isCustomEntryAllowed: isCustomEntryAllowed,
|
|
630
|
+
isMultiSelectable: isMultiSelectable,
|
|
631
|
+
},
|
|
632
|
+
});
|
|
633
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
634
|
+
}
|
|
635
|
+
};
|
|
250
636
|
var onOpenAutoFocus = function (e) {
|
|
251
637
|
var _a;
|
|
252
638
|
e.preventDefault();
|
|
253
639
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
254
640
|
};
|
|
255
|
-
return (React.createElement("div", { ref: setThemeElement, className: index
|
|
641
|
+
return (React.createElement("div", tslib_es6.__assign({ ref: setThemeElement, className: index.classNames("arc-ComboBox", suffixModifier.suffixModifier("arc-ComboBox--size", size), {
|
|
256
642
|
"arc-ComboBox--constrained": !isFluid,
|
|
257
|
-
|
|
258
|
-
|
|
643
|
+
"arc-ComboBox--invalid": errorMessage,
|
|
644
|
+
"arc-ComboBox--disabled": isDisabled,
|
|
645
|
+
"arc-ComboBox--expanded": isExpanded,
|
|
646
|
+
"arc-ComboBox--autoComplete": isAutocomplete,
|
|
647
|
+
"arc-ComboBox--onDarkSurface": isDarkSurface,
|
|
648
|
+
"arc-ComboBox--readOnly": isReadOnly,
|
|
649
|
+
}) }, filterAttrs.filterAttrs(props)),
|
|
650
|
+
React.createElement("div", { ref: comboBoxContainerRef },
|
|
259
651
|
React.createElement(index$2.Root2, { open: isExpanded },
|
|
260
|
-
React.createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize:
|
|
261
|
-
React.createElement(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
React.createElement(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
React.createElement(Box.Box, { elevationLevel: "1" },
|
|
284
|
-
React.createElement("ul", { ref: setScrollPosition, id: listBoxId, className: "arc-ComboBox-list", role: "listbox", "aria-label": listBoxAriaLabel, "aria-multiselectable": isMultiSelectable }, options.length ? (options.map(function (option, i) { return (React.createElement("li", { id: "".concat(listBoxId, "-").concat(i), ref: function (el) {
|
|
285
|
-
listItemRefs.current[i] = el;
|
|
286
|
-
}, key: option, className: index$1.classNames("arc-ComboBox-listItem", {
|
|
287
|
-
"arc-ComboBox-listItem--highlighted": i === highlightedOptionIndex,
|
|
288
|
-
}), onMouseDown: onItemClick(option), role: "option", "aria-selected": isSelected(option, selectedOptions) },
|
|
289
|
-
React.createElement("div", { className: "arc-ComboBox-listItemText" }, option),
|
|
290
|
-
React.createElement("div", { className: index$1.classNames("arc-ComboBox-listItemIcon", {
|
|
291
|
-
"arc-ComboBox-listItemIcon--visible": isSelected(option, selectedOptions),
|
|
652
|
+
React.createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: size, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
653
|
+
React.createElement(index$2.Anchor2, null,
|
|
654
|
+
React.createElement("div", { className: "arc-ComboBox-container" },
|
|
655
|
+
React.createElement("div", { className: index.classNames("arc-ComboBox-inputContainer", {
|
|
656
|
+
"arc-ComboBox-inputContainer--selectedOptionMode": selectedOptions.length,
|
|
657
|
+
}) },
|
|
658
|
+
React.createElement("div", { className: "arc-ComboBox-controls" },
|
|
659
|
+
selectedOptions.length > 0 && (React.createElement(ComboBoxTags, { ref: tagContainerRef, isReadOnly: isReadOnly, inputSize: size, isDisabled: isDisabled, isDarkSurface: isDarkSurface, isError: Boolean(errorMessage), showAllTags: showAllTags, visibleTagCount: visibleTagCount, selectedOptions: selectedOptions, onShowAllTagsClick: onShowAllTagsClick, onTagBlur: onTagBlur, onTagClick: onTagClick, onTagKeyDown: onTagKeyDown })),
|
|
660
|
+
React.createElement("div", { className: "arc-ComboBox-inputWrapper" },
|
|
661
|
+
prefixIcon && (React.createElement("div", { onMouseDown: onMouseDown(true), className: "arc-ComboBox-prefixIcon" },
|
|
662
|
+
React.createElement(Icon.Icon, { icon: prefixIcon }))),
|
|
663
|
+
React.createElement("input", { readOnly: isReadOnly, className: "arc-ComboBox-input", type: "text", role: "combobox", autoComplete: "off", ref: getTextInputRef, id: id, name: name, onMouseDown: onMouseDown(false), onFocus: onInputFocus, onBlur: onInputBlur, onChange: onInputChange, onKeyDown: onInputKeyDown, disabled: isDisabled, required: isRequired, value: value, "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", "aria-autocomplete": isAutocomplete ? "list" : "none", "aria-controls": listBoxId, "aria-expanded": isExpanded, "aria-activedescendant": hasHighlightedOption
|
|
664
|
+
? "".concat(listBoxId, "-").concat(highlightedOptionIndex)
|
|
665
|
+
: undefined }))),
|
|
666
|
+
React.createElement("div", { className: index.classNames("arc-ComboBox-icons", {
|
|
667
|
+
"arc-ComboBox-icons--stack": selectedOptions.length,
|
|
668
|
+
"arc-ComboBox-icons--unreversed": stackAutoCompleteIconFirst,
|
|
669
|
+
}) },
|
|
670
|
+
showClearButton && (React.createElement("div", { className: "arc-ComboBox-iconContainer" },
|
|
671
|
+
React.createElement(Tooltip.Tooltip, { asChild: true, zIndex: 102, title: clearButtonTooltip, alignContent: "center", delayDuration: 500, side: "bottom" },
|
|
672
|
+
React.createElement(ComboBoxClearButton, { onBlur: onClearButtonBlur, isDarkSurface: isDarkSurface, inputSize: size, tooltip: clearButtonTooltip, onMouseDown: onClearButtonMouseDown, onKeyDown: onClearButtonKeydown })))),
|
|
673
|
+
isAutocomplete && (React.createElement("div", { onMouseDown: onMouseDown(true), className: index.classNames("arc-ComboBox-iconContainer", "arc-ComboBox-iconContainer--autoComplete", {
|
|
674
|
+
"arc-ComboBox-iconContainer--rotate": isExpanded,
|
|
292
675
|
}) },
|
|
293
|
-
React.createElement(
|
|
676
|
+
React.createElement("div", { className: "arc-ComboBox-autoCompleteIcon" },
|
|
677
|
+
React.createElement(ThemeIcon.ThemeIcon, { icon: "comboboxAutoComplete" }))))))))),
|
|
678
|
+
React.createElement(index$2.Portal, { container: themeElement },
|
|
679
|
+
React.createElement(index$2.Content2, { align: "start", className: "arc-ComboBox-popoverContent", sideOffset: parseInt(listVerticalPadding), onInteractOutside: onInteractOutsideDropdown, onOpenAutoFocus: onOpenAutoFocus },
|
|
680
|
+
React.createElement("div", { onMouseLeave: setHighlightedOption(undefined), className: "arc-ComboBox-listboxContainer" },
|
|
681
|
+
React.createElement("div", { className: index.classNames("arc-ComboBox-listBoxInner", {
|
|
682
|
+
"arc-ComboBox-listBoxInner--onDarkSurface": isDarkSurface,
|
|
683
|
+
}) },
|
|
684
|
+
React.createElement(VerticalSpace.VerticalSpace, { size: listVerticalPadding }),
|
|
685
|
+
React.createElement("ul", { tabIndex: -1, className: "arc-ComboBox-list", role: "listbox", ref: setScrollPosition, id: listBoxId, "aria-label": listBoxAriaLabel, "aria-multiselectable": isMultiSelectable },
|
|
686
|
+
React.createElement(ComboBoxOptions, { value: value, limitReached: limitReached, customOptionSupportingCopy: customOptionSupportingCopy, noResultsSupportingCopy: noResultsSupportingCopy, setOptionRef: setOptionRef, options: options, listBoxId: listBoxId, isMultiSelectable: isMultiSelectable, selectedOptions: selectedOptions, singleSelectedOption: singleSelectedOption, highlightedOptionIndex: highlightedOptionIndex, onMouseMove: setHighlightedOption, onMouseDown: onItemClick })),
|
|
687
|
+
React.createElement(VerticalSpace.VerticalSpace, { size: listVerticalPadding })))))))));
|
|
294
688
|
};
|
|
295
689
|
|
|
296
690
|
exports.ComboBox = ComboBox;
|