@itcase/ui 1.0.77 → 1.0.79
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/dist/components/Accordion.js +2 -0
- package/dist/components/Avatar.js +58 -21
- package/dist/components/Badge.js +28 -4
- package/dist/components/Breadcrumbs.js +2 -0
- package/dist/components/Button.js +2 -0
- package/dist/components/Cell.js +2 -0
- package/dist/components/Choice.js +1 -1
- package/dist/components/ContextMenu.js +2 -0
- package/dist/components/CookiesWarning.js +2 -0
- package/dist/components/DatePicker.js +2 -0
- package/dist/components/Empty.js +2 -0
- package/dist/components/FormField.js +2 -0
- package/dist/components/Icon.js +11 -13
- package/dist/components/InputPassword.js +2 -0
- package/dist/components/LanguageSelector.js +2 -0
- package/dist/components/Search.js +2 -0
- package/dist/components/Select.js +143 -42
- package/dist/components/SiteMenu.js +2 -0
- package/dist/components/Swiper.js +383 -133
- package/dist/constants/componentProps/iconFillSize.js +5 -0
- package/dist/constants/componentProps/sizePX.js +1 -1
- package/dist/constants.js +2 -0
- package/dist/css/components/Avatar/Avatar.css +20 -13
- package/dist/css/components/Badge/Badge.css +25 -7
- package/dist/css/components/Swiper/Swiper.css +8 -6
- package/dist/hooks/styleAttributes.js +1 -1
- package/package.json +16 -16
|
@@ -29,6 +29,8 @@ require('../context/UIContext.js');
|
|
|
29
29
|
require('../hooks/useMediaQueries.js');
|
|
30
30
|
require('react-responsive');
|
|
31
31
|
require('lodash/castArray');
|
|
32
|
+
require('../constants/componentProps/borderColor.js');
|
|
33
|
+
require('../constants/componentProps/borderType.js');
|
|
32
34
|
require('../constants/componentProps/iconSize.js');
|
|
33
35
|
require('../constants/componentProps/shape.js');
|
|
34
36
|
require('../constants/componentProps/strokeColor.js');
|
|
@@ -4868,14 +4870,14 @@ var defaultAriaLiveMessages = {
|
|
|
4868
4870
|
guidance: function guidance(props) {
|
|
4869
4871
|
var isSearchable = props.isSearchable,
|
|
4870
4872
|
isMulti = props.isMulti,
|
|
4871
|
-
isDisabled = props.isDisabled,
|
|
4872
4873
|
tabSelectsValue = props.tabSelectsValue,
|
|
4873
|
-
context = props.context
|
|
4874
|
+
context = props.context,
|
|
4875
|
+
isInitialFocus = props.isInitialFocus;
|
|
4874
4876
|
switch (context) {
|
|
4875
4877
|
case 'menu':
|
|
4876
|
-
return "Use Up and Down to choose options
|
|
4878
|
+
return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
|
|
4877
4879
|
case 'input':
|
|
4878
|
-
return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
|
|
4880
|
+
return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : '';
|
|
4879
4881
|
case 'value':
|
|
4880
4882
|
return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
|
|
4881
4883
|
default:
|
|
@@ -4911,17 +4913,18 @@ var defaultAriaLiveMessages = {
|
|
|
4911
4913
|
label = _props$label2 === void 0 ? '' : _props$label2,
|
|
4912
4914
|
selectValue = props.selectValue,
|
|
4913
4915
|
isDisabled = props.isDisabled,
|
|
4914
|
-
isSelected = props.isSelected
|
|
4916
|
+
isSelected = props.isSelected,
|
|
4917
|
+
isAppleDevice = props.isAppleDevice;
|
|
4915
4918
|
var getArrayIndex = function getArrayIndex(arr, item) {
|
|
4916
4919
|
return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
|
|
4917
4920
|
};
|
|
4918
4921
|
if (context === 'value' && selectValue) {
|
|
4919
4922
|
return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
|
|
4920
4923
|
}
|
|
4921
|
-
if (context === 'menu') {
|
|
4924
|
+
if (context === 'menu' && isAppleDevice) {
|
|
4922
4925
|
var disabled = isDisabled ? ' disabled' : '';
|
|
4923
|
-
var status = "".concat(isSelected ? 'selected' : '
|
|
4924
|
-
return "
|
|
4926
|
+
var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
|
|
4927
|
+
return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
|
|
4925
4928
|
}
|
|
4926
4929
|
return '';
|
|
4927
4930
|
},
|
|
@@ -4940,7 +4943,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
4940
4943
|
isFocused = props.isFocused,
|
|
4941
4944
|
selectValue = props.selectValue,
|
|
4942
4945
|
selectProps = props.selectProps,
|
|
4943
|
-
id = props.id
|
|
4946
|
+
id = props.id,
|
|
4947
|
+
isAppleDevice = props.isAppleDevice;
|
|
4944
4948
|
var ariaLiveMessages = selectProps.ariaLiveMessages,
|
|
4945
4949
|
getOptionLabel = selectProps.getOptionLabel,
|
|
4946
4950
|
inputValue = selectProps.inputValue,
|
|
@@ -4950,7 +4954,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
4950
4954
|
menuIsOpen = selectProps.menuIsOpen,
|
|
4951
4955
|
options = selectProps.options,
|
|
4952
4956
|
screenReaderStatus = selectProps.screenReaderStatus,
|
|
4953
|
-
tabSelectsValue = selectProps.tabSelectsValue
|
|
4957
|
+
tabSelectsValue = selectProps.tabSelectsValue,
|
|
4958
|
+
isLoading = selectProps.isLoading;
|
|
4954
4959
|
var ariaLabel = selectProps['aria-label'];
|
|
4955
4960
|
var ariaLive = selectProps['aria-live'];
|
|
4956
4961
|
|
|
@@ -5003,15 +5008,16 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5003
5008
|
isSelected: isSelected,
|
|
5004
5009
|
options: focusableOptions,
|
|
5005
5010
|
context: focused === focusedOption ? 'menu' : 'value',
|
|
5006
|
-
selectValue: selectValue
|
|
5011
|
+
selectValue: selectValue,
|
|
5012
|
+
isAppleDevice: isAppleDevice
|
|
5007
5013
|
};
|
|
5008
5014
|
focusMsg = messages.onFocus(onFocusProps);
|
|
5009
5015
|
}
|
|
5010
5016
|
return focusMsg;
|
|
5011
|
-
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
|
|
5017
|
+
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
|
|
5012
5018
|
var ariaResults = React.useMemo(function () {
|
|
5013
5019
|
var resultsMsg = '';
|
|
5014
|
-
if (menuIsOpen && options.length && messages.onFilter) {
|
|
5020
|
+
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
5015
5021
|
var resultsMessage = screenReaderStatus({
|
|
5016
5022
|
count: focusableOptions.length
|
|
5017
5023
|
});
|
|
@@ -5021,7 +5027,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5021
5027
|
});
|
|
5022
5028
|
}
|
|
5023
5029
|
return resultsMsg;
|
|
5024
|
-
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
|
|
5030
|
+
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
5031
|
+
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
5025
5032
|
var ariaGuidance = React.useMemo(function () {
|
|
5026
5033
|
var guidanceMsg = '';
|
|
5027
5034
|
if (messages.guidance) {
|
|
@@ -5032,24 +5039,28 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5032
5039
|
isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
|
|
5033
5040
|
isMulti: isMulti,
|
|
5034
5041
|
isSearchable: isSearchable,
|
|
5035
|
-
tabSelectsValue: tabSelectsValue
|
|
5042
|
+
tabSelectsValue: tabSelectsValue,
|
|
5043
|
+
isInitialFocus: isInitialFocus
|
|
5036
5044
|
});
|
|
5037
5045
|
}
|
|
5038
5046
|
return guidanceMsg;
|
|
5039
|
-
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
|
|
5040
|
-
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
|
|
5047
|
+
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
5041
5048
|
var ScreenReaderText = jsx(React.Fragment, null, jsx("span", {
|
|
5042
5049
|
id: "aria-selection"
|
|
5043
5050
|
}, ariaSelected), jsx("span", {
|
|
5044
|
-
id: "aria-
|
|
5045
|
-
},
|
|
5046
|
-
|
|
5051
|
+
id: "aria-focused"
|
|
5052
|
+
}, ariaFocused), jsx("span", {
|
|
5053
|
+
id: "aria-results"
|
|
5054
|
+
}, ariaResults), jsx("span", {
|
|
5055
|
+
id: "aria-guidance"
|
|
5056
|
+
}, ariaGuidance));
|
|
5047
5057
|
return jsx(React.Fragment, null, jsx(A11yText$1, {
|
|
5048
5058
|
id: id
|
|
5049
5059
|
}, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
|
|
5050
5060
|
"aria-live": ariaLive,
|
|
5051
5061
|
"aria-atomic": "false",
|
|
5052
|
-
"aria-relevant": "additions text"
|
|
5062
|
+
"aria-relevant": "additions text",
|
|
5063
|
+
role: "log"
|
|
5053
5064
|
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
5054
5065
|
};
|
|
5055
5066
|
var LiveRegion$1 = LiveRegion;
|
|
@@ -5689,6 +5700,30 @@ var RequiredInput = function RequiredInput(_ref) {
|
|
|
5689
5700
|
};
|
|
5690
5701
|
var RequiredInput$1 = RequiredInput;
|
|
5691
5702
|
|
|
5703
|
+
/// <reference types="user-agent-data-types" />
|
|
5704
|
+
|
|
5705
|
+
function testPlatform(re) {
|
|
5706
|
+
var _window$navigator$use;
|
|
5707
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
|
|
5708
|
+
}
|
|
5709
|
+
function isIPhone() {
|
|
5710
|
+
return testPlatform(/^iPhone/i);
|
|
5711
|
+
}
|
|
5712
|
+
function isMac() {
|
|
5713
|
+
return testPlatform(/^Mac/i);
|
|
5714
|
+
}
|
|
5715
|
+
function isIPad() {
|
|
5716
|
+
return testPlatform(/^iPad/i) ||
|
|
5717
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
5718
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
5719
|
+
}
|
|
5720
|
+
function isIOS() {
|
|
5721
|
+
return isIPhone() || isIPad();
|
|
5722
|
+
}
|
|
5723
|
+
function isAppleDevice() {
|
|
5724
|
+
return isMac() || isIOS();
|
|
5725
|
+
}
|
|
5726
|
+
|
|
5692
5727
|
var formatGroupLabel = function formatGroupLabel(group) {
|
|
5693
5728
|
return group.label;
|
|
5694
5729
|
};
|
|
@@ -5858,6 +5893,24 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
|
|
|
5858
5893
|
return optionsAccumulator;
|
|
5859
5894
|
}, []);
|
|
5860
5895
|
}
|
|
5896
|
+
function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
|
|
5897
|
+
return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
|
|
5898
|
+
if (categorizedOption.type === 'group') {
|
|
5899
|
+
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
|
|
5900
|
+
return {
|
|
5901
|
+
data: option.data,
|
|
5902
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
|
|
5903
|
+
};
|
|
5904
|
+
})));
|
|
5905
|
+
} else {
|
|
5906
|
+
optionsAccumulator.push({
|
|
5907
|
+
data: categorizedOption.data,
|
|
5908
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index)
|
|
5909
|
+
});
|
|
5910
|
+
}
|
|
5911
|
+
return optionsAccumulator;
|
|
5912
|
+
}, []);
|
|
5913
|
+
}
|
|
5861
5914
|
function buildFocusableOptions(props, selectValue) {
|
|
5862
5915
|
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
|
|
5863
5916
|
}
|
|
@@ -5895,6 +5948,13 @@ function getNextFocusedOption(state, options) {
|
|
|
5895
5948
|
var lastFocusedOption = state.focusedOption;
|
|
5896
5949
|
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
|
|
5897
5950
|
}
|
|
5951
|
+
var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
|
|
5952
|
+
var _focusableOptionsWith;
|
|
5953
|
+
var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
|
|
5954
|
+
return option.data === focusedOption;
|
|
5955
|
+
})) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
|
|
5956
|
+
return focusedOptionId || null;
|
|
5957
|
+
};
|
|
5898
5958
|
var getOptionLabel = function getOptionLabel(props, data) {
|
|
5899
5959
|
return props.getOptionLabel(data);
|
|
5900
5960
|
};
|
|
@@ -5945,6 +6005,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
5945
6005
|
_this.state = {
|
|
5946
6006
|
ariaSelection: null,
|
|
5947
6007
|
focusedOption: null,
|
|
6008
|
+
focusedOptionId: null,
|
|
6009
|
+
focusableOptionsWithIds: [],
|
|
5948
6010
|
focusedValue: null,
|
|
5949
6011
|
inputIsHidden: false,
|
|
5950
6012
|
isFocused: false,
|
|
@@ -5952,17 +6014,18 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
5952
6014
|
clearFocusValueOnUpdate: false,
|
|
5953
6015
|
prevWasFocused: false,
|
|
5954
6016
|
inputIsHiddenAfterUpdate: undefined,
|
|
5955
|
-
prevProps: undefined
|
|
6017
|
+
prevProps: undefined,
|
|
6018
|
+
instancePrefix: ''
|
|
5956
6019
|
};
|
|
5957
6020
|
_this.blockOptionHover = false;
|
|
5958
6021
|
_this.isComposing = false;
|
|
5959
6022
|
_this.commonProps = void 0;
|
|
5960
6023
|
_this.initialTouchX = 0;
|
|
5961
6024
|
_this.initialTouchY = 0;
|
|
5962
|
-
_this.instancePrefix = '';
|
|
5963
6025
|
_this.openAfterFocus = false;
|
|
5964
6026
|
_this.scrollToFocusedOptionOnUpdate = false;
|
|
5965
6027
|
_this.userIsDragging = void 0;
|
|
6028
|
+
_this.isAppleDevice = isAppleDevice();
|
|
5966
6029
|
_this.controlRef = null;
|
|
5967
6030
|
_this.getControlRef = function (ref) {
|
|
5968
6031
|
_this.controlRef = ref;
|
|
@@ -6077,6 +6140,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6077
6140
|
removedValue: lastSelectedValue
|
|
6078
6141
|
});
|
|
6079
6142
|
};
|
|
6143
|
+
_this.getFocusedOptionId = function (focusedOption) {
|
|
6144
|
+
return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
|
|
6145
|
+
};
|
|
6146
|
+
_this.getFocusableOptionsWithIds = function () {
|
|
6147
|
+
return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
|
|
6148
|
+
};
|
|
6080
6149
|
_this.getValue = function () {
|
|
6081
6150
|
return _this.state.selectValue;
|
|
6082
6151
|
};
|
|
@@ -6104,7 +6173,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6104
6173
|
return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
|
|
6105
6174
|
};
|
|
6106
6175
|
_this.getElementId = function (element) {
|
|
6107
|
-
return "".concat(_this.instancePrefix, "-").concat(element);
|
|
6176
|
+
return "".concat(_this.state.instancePrefix, "-").concat(element);
|
|
6108
6177
|
};
|
|
6109
6178
|
_this.getComponents = function () {
|
|
6110
6179
|
return defaultComponents(_this.props);
|
|
@@ -6313,8 +6382,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6313
6382
|
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
|
|
6314
6383
|
return;
|
|
6315
6384
|
}
|
|
6385
|
+
var options = _this.getFocusableOptions();
|
|
6386
|
+
var focusedOptionIndex = options.indexOf(focusedOption);
|
|
6316
6387
|
_this.setState({
|
|
6317
|
-
focusedOption: focusedOption
|
|
6388
|
+
focusedOption: focusedOption,
|
|
6389
|
+
focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
|
|
6318
6390
|
});
|
|
6319
6391
|
};
|
|
6320
6392
|
_this.shouldHideSelectedOptions = function () {
|
|
@@ -6458,14 +6530,16 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6458
6530
|
}
|
|
6459
6531
|
event.preventDefault();
|
|
6460
6532
|
};
|
|
6461
|
-
_this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6533
|
+
_this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6462
6534
|
_this.state.selectValue = cleanValue(_props.value);
|
|
6463
|
-
|
|
6464
6535
|
// Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
|
|
6465
6536
|
if (_props.menuIsOpen && _this.state.selectValue.length) {
|
|
6537
|
+
var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
|
|
6466
6538
|
var focusableOptions = _this.buildFocusableOptions();
|
|
6467
6539
|
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
|
|
6540
|
+
_this.state.focusableOptionsWithIds = focusableOptionsWithIds;
|
|
6468
6541
|
_this.state.focusedOption = focusableOptions[optionIndex];
|
|
6542
|
+
_this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
|
|
6469
6543
|
}
|
|
6470
6544
|
return _this;
|
|
6471
6545
|
}
|
|
@@ -6590,7 +6664,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6590
6664
|
this.setState({
|
|
6591
6665
|
inputIsHiddenAfterUpdate: false,
|
|
6592
6666
|
focusedValue: null,
|
|
6593
|
-
focusedOption: focusableOptions[openAtIndex]
|
|
6667
|
+
focusedOption: focusableOptions[openAtIndex],
|
|
6668
|
+
focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
|
|
6594
6669
|
}, function () {
|
|
6595
6670
|
return _this2.onMenuOpen();
|
|
6596
6671
|
});
|
|
@@ -6666,7 +6741,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6666
6741
|
this.scrollToFocusedOptionOnUpdate = true;
|
|
6667
6742
|
this.setState({
|
|
6668
6743
|
focusedOption: options[nextFocus],
|
|
6669
|
-
focusedValue: null
|
|
6744
|
+
focusedValue: null,
|
|
6745
|
+
focusedOptionId: this.getFocusedOptionId(options[nextFocus])
|
|
6670
6746
|
});
|
|
6671
6747
|
}
|
|
6672
6748
|
}, {
|
|
@@ -6862,10 +6938,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6862
6938
|
'aria-label': this.props['aria-label'],
|
|
6863
6939
|
'aria-labelledby': this.props['aria-labelledby'],
|
|
6864
6940
|
'aria-required': required,
|
|
6865
|
-
role: 'combobox'
|
|
6941
|
+
role: 'combobox',
|
|
6942
|
+
'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
|
|
6866
6943
|
}, menuIsOpen && {
|
|
6867
|
-
'aria-controls': this.getElementId('listbox')
|
|
6868
|
-
'aria-owns': this.getElementId('listbox')
|
|
6944
|
+
'aria-controls': this.getElementId('listbox')
|
|
6869
6945
|
}), !isSearchable && {
|
|
6870
6946
|
'aria-readonly': true
|
|
6871
6947
|
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
|
|
@@ -7110,8 +7186,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7110
7186
|
onClick: onSelect,
|
|
7111
7187
|
onMouseMove: onHover,
|
|
7112
7188
|
onMouseOver: onHover,
|
|
7113
|
-
tabIndex: -1
|
|
7189
|
+
tabIndex: -1,
|
|
7190
|
+
role: 'option',
|
|
7191
|
+
'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
|
|
7114
7192
|
};
|
|
7193
|
+
|
|
7115
7194
|
return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
|
|
7116
7195
|
innerProps: innerProps,
|
|
7117
7196
|
data: data,
|
|
@@ -7180,8 +7259,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7180
7259
|
innerRef: ref,
|
|
7181
7260
|
innerProps: {
|
|
7182
7261
|
onMouseDown: _this4.onMenuMouseDown,
|
|
7183
|
-
onMouseMove: _this4.onMenuMouseMove
|
|
7184
|
-
id: _this4.getElementId('listbox')
|
|
7262
|
+
onMouseMove: _this4.onMenuMouseMove
|
|
7185
7263
|
},
|
|
7186
7264
|
isLoading: isLoading,
|
|
7187
7265
|
placement: placement
|
|
@@ -7196,6 +7274,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7196
7274
|
_this4.getMenuListRef(instance);
|
|
7197
7275
|
scrollTargetRef(instance);
|
|
7198
7276
|
},
|
|
7277
|
+
innerProps: {
|
|
7278
|
+
role: 'listbox',
|
|
7279
|
+
'aria-multiselectable': commonProps.isMulti,
|
|
7280
|
+
id: _this4.getElementId('listbox')
|
|
7281
|
+
},
|
|
7199
7282
|
isLoading: isLoading,
|
|
7200
7283
|
maxHeight: maxHeight,
|
|
7201
7284
|
focusedOption: focusedOption
|
|
@@ -7283,7 +7366,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7283
7366
|
focusedValue: focusedValue,
|
|
7284
7367
|
isFocused: isFocused,
|
|
7285
7368
|
selectValue: selectValue,
|
|
7286
|
-
focusableOptions: focusableOptions
|
|
7369
|
+
focusableOptions: focusableOptions,
|
|
7370
|
+
isAppleDevice: this.isAppleDevice
|
|
7287
7371
|
}));
|
|
7288
7372
|
}
|
|
7289
7373
|
}, {
|
|
@@ -7332,7 +7416,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7332
7416
|
inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
|
|
7333
7417
|
ariaSelection = state.ariaSelection,
|
|
7334
7418
|
isFocused = state.isFocused,
|
|
7335
|
-
prevWasFocused = state.prevWasFocused
|
|
7419
|
+
prevWasFocused = state.prevWasFocused,
|
|
7420
|
+
instancePrefix = state.instancePrefix;
|
|
7336
7421
|
var options = props.options,
|
|
7337
7422
|
value = props.value,
|
|
7338
7423
|
menuIsOpen = props.menuIsOpen,
|
|
@@ -7342,11 +7427,15 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7342
7427
|
var newMenuOptionsState = {};
|
|
7343
7428
|
if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
|
|
7344
7429
|
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
|
|
7430
|
+
var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
|
|
7345
7431
|
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
|
|
7346
7432
|
var focusedOption = getNextFocusedOption(state, focusableOptions);
|
|
7433
|
+
var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
|
|
7347
7434
|
newMenuOptionsState = {
|
|
7348
7435
|
selectValue: selectValue,
|
|
7349
7436
|
focusedOption: focusedOption,
|
|
7437
|
+
focusedOptionId: focusedOptionId,
|
|
7438
|
+
focusableOptionsWithIds: focusableOptionsWithIds,
|
|
7350
7439
|
focusedValue: focusedValue,
|
|
7351
7440
|
clearFocusValueOnUpdate: false
|
|
7352
7441
|
};
|
|
@@ -7551,14 +7640,16 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
7551
7640
|
|
|
7552
7641
|
const SelectControl = props => {
|
|
7553
7642
|
const {
|
|
7643
|
+
before,
|
|
7644
|
+
after,
|
|
7554
7645
|
inputFill,
|
|
7555
7646
|
inputShape,
|
|
7556
7647
|
inputBorderColor,
|
|
7557
7648
|
inputBorderColorHover
|
|
7558
7649
|
} = props.selectProps;
|
|
7559
|
-
return /*#__PURE__*/React__namespace.default.createElement(Select$1.components.Control, Object.assign({}, props, {
|
|
7650
|
+
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, before, /*#__PURE__*/React__namespace.default.createElement(Select$1.components.Control, Object.assign({}, props, {
|
|
7560
7651
|
className: clsx__default.default('select__control', inputFill, inputShape, inputBorderColor && `border-color_${inputBorderColor}`, inputBorderColorHover && `border-color_hover_${inputBorderColorHover}`)
|
|
7561
|
-
}));
|
|
7652
|
+
})), after);
|
|
7562
7653
|
};
|
|
7563
7654
|
SelectControl.propTypes = {
|
|
7564
7655
|
selectProps: PropTypes__default.default.shape({
|
|
@@ -7735,13 +7826,15 @@ SelectInput.__docgenInfo = {
|
|
|
7735
7826
|
|
|
7736
7827
|
const SelectMenu = props => {
|
|
7737
7828
|
const {
|
|
7738
|
-
elevation
|
|
7829
|
+
elevation,
|
|
7830
|
+
menuAfter,
|
|
7831
|
+
menuBefore
|
|
7739
7832
|
} = props.selectProps;
|
|
7740
7833
|
return /*#__PURE__*/React__namespace.default.createElement(Select$1.components.Menu, Object.assign({}, props, {
|
|
7741
7834
|
className: clsx__default.default(elevation && `elevation_${elevation}`)
|
|
7742
|
-
}), props.selectProps.fetchingData ? /*#__PURE__*/React__namespace.default.createElement("span", {
|
|
7835
|
+
}), menuBefore, props.selectProps.fetchingData ? /*#__PURE__*/React__namespace.default.createElement("span", {
|
|
7743
7836
|
className: "fetching"
|
|
7744
|
-
}, "Fetching data...") : /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, props.children));
|
|
7837
|
+
}, "Fetching data...") : /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, props.children), menuAfter);
|
|
7745
7838
|
};
|
|
7746
7839
|
SelectMenu.propTypes = {
|
|
7747
7840
|
selectProps: PropTypes__default.default.shape({
|
|
@@ -8152,7 +8245,11 @@ const SelectContainer = /*#__PURE__*/React__namespace.default.forwardRef(functio
|
|
|
8152
8245
|
}), []);
|
|
8153
8246
|
const {
|
|
8154
8247
|
className,
|
|
8248
|
+
after,
|
|
8249
|
+
before,
|
|
8155
8250
|
hideSelectedOptions,
|
|
8251
|
+
menuAfter,
|
|
8252
|
+
menuBefore,
|
|
8156
8253
|
clearIcon,
|
|
8157
8254
|
clearIconFill,
|
|
8158
8255
|
clearIconStroke,
|
|
@@ -8314,6 +8411,10 @@ const SelectContainer = /*#__PURE__*/React__namespace.default.forwardRef(functio
|
|
|
8314
8411
|
classNamePrefix: "select",
|
|
8315
8412
|
styles: clearStyle,
|
|
8316
8413
|
value: value,
|
|
8414
|
+
after: after,
|
|
8415
|
+
before: before,
|
|
8416
|
+
menuAfter: menuAfter,
|
|
8417
|
+
menuBefore: menuBefore,
|
|
8317
8418
|
elevation: elevation,
|
|
8318
8419
|
isClearable: isClearable,
|
|
8319
8420
|
openMenuOnClick: openMenuOnClick,
|
|
@@ -25,6 +25,8 @@ require('../hooks/useStyles.js');
|
|
|
25
25
|
require('lodash/maxBy');
|
|
26
26
|
require('lodash/upperFirst');
|
|
27
27
|
require('../hooks/styleAttributes.js');
|
|
28
|
+
require('../constants/componentProps/borderColor.js');
|
|
29
|
+
require('../constants/componentProps/borderType.js');
|
|
28
30
|
require('../constants/componentProps/iconSize.js');
|
|
29
31
|
require('../constants/componentProps/shape.js');
|
|
30
32
|
require('../constants/componentProps/strokeColor.js');
|