@vchasno/ui-kit 0.2.13 → 0.2.15
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/CHANGELOG.md +13 -0
- package/dist/Datepicker/index.cjs.js +13548 -8319
- package/dist/Datepicker/index.cjs.js.map +1 -1
- package/dist/Datepicker/index.js +13552 -8323
- package/dist/Datepicker/index.js.map +1 -1
- package/dist/Datepicker/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
- package/dist/Datepicker/types/components/BlackTooltip/index.d.ts +2 -0
- package/dist/Datepicker/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
- package/dist/Datepicker/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
- package/dist/Datepicker/types/components/ProjectsPopover/index.d.ts +2 -0
- package/dist/Datepicker/types/components/ProjectsPopover/mappers.d.ts +6 -0
- package/dist/Datepicker/types/components/ProjectsPopover/types.d.ts +7 -0
- package/dist/Datepicker/types/components/ProjectsPopover/utils.d.ts +10 -0
- package/dist/Datepicker/types/components/Select/Select.d.ts +1 -1
- package/dist/Datepicker/types/components/index.d.ts +2 -0
- package/dist/ProjectsPopover/index.cjs.js +12650 -0
- package/dist/ProjectsPopover/index.cjs.js.map +1 -0
- package/dist/ProjectsPopover/index.d.ts +27 -0
- package/dist/ProjectsPopover/index.js +12630 -0
- package/dist/ProjectsPopover/index.js.map +1 -0
- package/dist/ProjectsPopover/types/components/Alert/Alert.d.ts +16 -0
- package/dist/ProjectsPopover/types/components/Alert/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
- package/dist/ProjectsPopover/types/components/BlackTooltip/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/BubbleBox/BubbleBox.d.ts +17 -0
- package/dist/ProjectsPopover/types/components/BubbleBox/index.d.ts +3 -0
- package/dist/ProjectsPopover/types/components/BubbleBox/utils.d.ts +1 -0
- package/dist/ProjectsPopover/types/components/Button/Button.d.ts +12 -0
- package/dist/ProjectsPopover/types/components/Button/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/ProjectsPopover/types/components/Checkbox/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Datepicker/DatePicker.d.ts +15 -0
- package/dist/ProjectsPopover/types/components/Datepicker/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/FlexBox/FlexBox.d.ts +15 -0
- package/dist/ProjectsPopover/types/components/FlexBox/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Input/Input.d.ts +15 -0
- package/dist/ProjectsPopover/types/components/Input/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/InputMeta/InputMeta.d.ts +8 -0
- package/dist/ProjectsPopover/types/components/InputMeta/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/LabelText/LabelText.d.ts +8 -0
- package/dist/ProjectsPopover/types/components/LabelText/index.d.ts +1 -0
- package/dist/ProjectsPopover/types/components/MaskInput/MaskInput.d.ts +10 -0
- package/dist/ProjectsPopover/types/components/MaskInput/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Pagination/Pagination.d.ts +16 -0
- package/dist/ProjectsPopover/types/components/Pagination/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Pagination/utils.d.ts +1 -0
- package/dist/ProjectsPopover/types/components/Paragraph/Paragraph.d.ts +9 -0
- package/dist/ProjectsPopover/types/components/Paragraph/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/mappers.d.ts +6 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/types.d.ts +7 -0
- package/dist/ProjectsPopover/types/components/ProjectsPopover/utils.d.ts +10 -0
- package/dist/ProjectsPopover/types/components/PulseDot/PulseDot.d.ts +22 -0
- package/dist/ProjectsPopover/types/components/PulseDot/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Select/Select.d.ts +39 -0
- package/dist/ProjectsPopover/types/components/Select/SelectCreatable.d.ts +14 -0
- package/dist/ProjectsPopover/types/components/Select/customComponents.d.ts +9 -0
- package/dist/ProjectsPopover/types/components/Select/defaultProps.d.ts +6 -0
- package/dist/ProjectsPopover/types/components/Select/index.d.ts +5 -0
- package/dist/ProjectsPopover/types/components/Select/types.d.ts +4 -0
- package/dist/ProjectsPopover/types/components/Spinner/Spinner.d.ts +18 -0
- package/dist/ProjectsPopover/types/components/Spinner/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/SplashLogo/SplashLogo.d.ts +12 -0
- package/dist/ProjectsPopover/types/components/SplashLogo/dataUrls.d.ts +6 -0
- package/dist/ProjectsPopover/types/components/SplashLogo/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/SvgBorder/SvgBorder.d.ts +18 -0
- package/dist/ProjectsPopover/types/components/SvgBorder/index.d.ts +3 -0
- package/dist/ProjectsPopover/types/components/SvgBorder/utils.d.ts +1 -0
- package/dist/ProjectsPopover/types/components/Switch/Switch.d.ts +14 -0
- package/dist/ProjectsPopover/types/components/Switch/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Tabs/Tabs.d.ts +19 -0
- package/dist/ProjectsPopover/types/components/Tabs/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Text/Text.d.ts +14 -0
- package/dist/ProjectsPopover/types/components/Text/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/TextAreaInput/TextAreaInput.d.ts +10 -0
- package/dist/ProjectsPopover/types/components/TextAreaInput/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/TextInput/TextInput.d.ts +9 -0
- package/dist/ProjectsPopover/types/components/TextInput/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/Title/Title.d.ts +9 -0
- package/dist/ProjectsPopover/types/components/Title/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/components/index.d.ts +42 -0
- package/dist/ProjectsPopover/types/components/types.d.ts +24 -0
- package/dist/ProjectsPopover/types/hooks/useClientRect.d.ts +5 -0
- package/dist/ProjectsPopover/types/index.d.ts +2 -0
- package/dist/ProjectsPopover/types/utils/react.d.ts +6 -0
- package/dist/Select/index.cjs.js +195 -92
- package/dist/Select/index.cjs.js.map +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +195 -92
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
- package/dist/Select/types/components/BlackTooltip/index.d.ts +2 -0
- package/dist/Select/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
- package/dist/Select/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
- package/dist/Select/types/components/ProjectsPopover/index.d.ts +2 -0
- package/dist/Select/types/components/ProjectsPopover/mappers.d.ts +6 -0
- package/dist/Select/types/components/ProjectsPopover/types.d.ts +7 -0
- package/dist/Select/types/components/ProjectsPopover/utils.d.ts +10 -0
- package/dist/Select/types/components/Select/Select.d.ts +1 -1
- package/dist/Select/types/components/index.d.ts +2 -0
- package/dist/SelectCreatable/index.cjs.js +195 -92
- package/dist/SelectCreatable/index.cjs.js.map +1 -1
- package/dist/SelectCreatable/index.js +195 -92
- package/dist/SelectCreatable/index.js.map +1 -1
- package/dist/SelectCreatable/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
- package/dist/SelectCreatable/types/components/BlackTooltip/index.d.ts +2 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/index.d.ts +2 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/mappers.d.ts +6 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/types.d.ts +7 -0
- package/dist/SelectCreatable/types/components/ProjectsPopover/utils.d.ts +10 -0
- package/dist/SelectCreatable/types/components/Select/Select.d.ts +1 -1
- package/dist/SelectCreatable/types/components/index.d.ts +2 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +12451 -365
- package/dist/index.js.map +1 -1
- package/dist/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
- package/dist/types/components/BlackTooltip/index.d.ts +2 -0
- package/dist/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
- package/dist/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
- package/dist/types/components/ProjectsPopover/index.d.ts +2 -0
- package/dist/types/components/ProjectsPopover/mappers.d.ts +6 -0
- package/dist/types/components/ProjectsPopover/types.d.ts +7 -0
- package/dist/types/components/ProjectsPopover/utils.d.ts +10 -0
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +45 -37
|
@@ -72,24 +72,24 @@ function _typeof(o) {
|
|
|
72
72
|
}, _typeof(o);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
79
|
-
var
|
|
80
|
-
if (
|
|
75
|
+
function toPrimitive(t, r) {
|
|
76
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
77
|
+
var e = t[Symbol.toPrimitive];
|
|
78
|
+
if (void 0 !== e) {
|
|
79
|
+
var i = e.call(t, r || "default");
|
|
80
|
+
if ("object" != _typeof(i)) return i;
|
|
81
81
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
82
82
|
}
|
|
83
|
-
return (
|
|
83
|
+
return ("string" === r ? String : Number)(t);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function
|
|
87
|
-
var
|
|
88
|
-
return _typeof(
|
|
86
|
+
function toPropertyKey(t) {
|
|
87
|
+
var i = toPrimitive(t, "string");
|
|
88
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function _defineProperty(obj, key, value) {
|
|
92
|
-
key =
|
|
92
|
+
key = toPropertyKey(key);
|
|
93
93
|
if (key in obj) {
|
|
94
94
|
Object.defineProperty(obj, key, {
|
|
95
95
|
value: value,
|
|
@@ -137,7 +137,7 @@ function _defineProperties(target, props) {
|
|
|
137
137
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
138
138
|
descriptor.configurable = true;
|
|
139
139
|
if ("value" in descriptor) descriptor.writable = true;
|
|
140
|
-
Object.defineProperty(target,
|
|
140
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -182,15 +182,12 @@ function _getPrototypeOf(o) {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
function _isNativeReflectConstruct() {
|
|
185
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
186
|
-
if (Reflect.construct.sham) return false;
|
|
187
|
-
if (typeof Proxy === "function") return true;
|
|
188
185
|
try {
|
|
189
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return
|
|
193
|
-
}
|
|
186
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
187
|
+
} catch (t) {}
|
|
188
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
189
|
+
return !!t;
|
|
190
|
+
})();
|
|
194
191
|
}
|
|
195
192
|
|
|
196
193
|
function _assertThisInitialized(self) {
|
|
@@ -3096,12 +3093,11 @@ function _slicedToArray(arr, i) {
|
|
|
3096
3093
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3097
3094
|
if (source == null) return {};
|
|
3098
3095
|
var target = {};
|
|
3099
|
-
var
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
target[key] = source[key];
|
|
3096
|
+
for (var key in source) {
|
|
3097
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3098
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3099
|
+
target[key] = source[key];
|
|
3100
|
+
}
|
|
3105
3101
|
}
|
|
3106
3102
|
return target;
|
|
3107
3103
|
}
|
|
@@ -4537,7 +4533,9 @@ var Control = function Control(props) {
|
|
|
4537
4533
|
'control--is-disabled': isDisabled,
|
|
4538
4534
|
'control--is-focused': isFocused,
|
|
4539
4535
|
'control--menu-is-open': menuIsOpen
|
|
4540
|
-
}), innerProps
|
|
4536
|
+
}), innerProps, {
|
|
4537
|
+
"aria-disabled": isDisabled || undefined
|
|
4538
|
+
}), children);
|
|
4541
4539
|
};
|
|
4542
4540
|
var Control$1 = Control;
|
|
4543
4541
|
|
|
@@ -4973,14 +4971,14 @@ var defaultAriaLiveMessages = {
|
|
|
4973
4971
|
guidance: function guidance(props) {
|
|
4974
4972
|
var isSearchable = props.isSearchable,
|
|
4975
4973
|
isMulti = props.isMulti,
|
|
4976
|
-
isDisabled = props.isDisabled,
|
|
4977
4974
|
tabSelectsValue = props.tabSelectsValue,
|
|
4978
|
-
context = props.context
|
|
4975
|
+
context = props.context,
|
|
4976
|
+
isInitialFocus = props.isInitialFocus;
|
|
4979
4977
|
switch (context) {
|
|
4980
4978
|
case 'menu':
|
|
4981
|
-
return "Use Up and Down to choose options
|
|
4979
|
+
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' : '', ".");
|
|
4982
4980
|
case 'input':
|
|
4983
|
-
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' : '');
|
|
4981
|
+
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' : '') : '';
|
|
4984
4982
|
case 'value':
|
|
4985
4983
|
return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
|
|
4986
4984
|
default:
|
|
@@ -5016,17 +5014,18 @@ var defaultAriaLiveMessages = {
|
|
|
5016
5014
|
label = _props$label2 === void 0 ? '' : _props$label2,
|
|
5017
5015
|
selectValue = props.selectValue,
|
|
5018
5016
|
isDisabled = props.isDisabled,
|
|
5019
|
-
isSelected = props.isSelected
|
|
5017
|
+
isSelected = props.isSelected,
|
|
5018
|
+
isAppleDevice = props.isAppleDevice;
|
|
5020
5019
|
var getArrayIndex = function getArrayIndex(arr, item) {
|
|
5021
5020
|
return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
|
|
5022
5021
|
};
|
|
5023
5022
|
if (context === 'value' && selectValue) {
|
|
5024
5023
|
return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
|
|
5025
5024
|
}
|
|
5026
|
-
if (context === 'menu') {
|
|
5025
|
+
if (context === 'menu' && isAppleDevice) {
|
|
5027
5026
|
var disabled = isDisabled ? ' disabled' : '';
|
|
5028
|
-
var status = "".concat(isSelected ? 'selected' : '
|
|
5029
|
-
return "
|
|
5027
|
+
var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
|
|
5028
|
+
return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
|
|
5030
5029
|
}
|
|
5031
5030
|
return '';
|
|
5032
5031
|
},
|
|
@@ -5045,7 +5044,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5045
5044
|
isFocused = props.isFocused,
|
|
5046
5045
|
selectValue = props.selectValue,
|
|
5047
5046
|
selectProps = props.selectProps,
|
|
5048
|
-
id = props.id
|
|
5047
|
+
id = props.id,
|
|
5048
|
+
isAppleDevice = props.isAppleDevice;
|
|
5049
5049
|
var ariaLiveMessages = selectProps.ariaLiveMessages,
|
|
5050
5050
|
getOptionLabel = selectProps.getOptionLabel,
|
|
5051
5051
|
inputValue = selectProps.inputValue,
|
|
@@ -5055,7 +5055,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5055
5055
|
menuIsOpen = selectProps.menuIsOpen,
|
|
5056
5056
|
options = selectProps.options,
|
|
5057
5057
|
screenReaderStatus = selectProps.screenReaderStatus,
|
|
5058
|
-
tabSelectsValue = selectProps.tabSelectsValue
|
|
5058
|
+
tabSelectsValue = selectProps.tabSelectsValue,
|
|
5059
|
+
isLoading = selectProps.isLoading;
|
|
5059
5060
|
var ariaLabel = selectProps['aria-label'];
|
|
5060
5061
|
var ariaLive = selectProps['aria-live'];
|
|
5061
5062
|
|
|
@@ -5108,15 +5109,16 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5108
5109
|
isSelected: isSelected,
|
|
5109
5110
|
options: focusableOptions,
|
|
5110
5111
|
context: focused === focusedOption ? 'menu' : 'value',
|
|
5111
|
-
selectValue: selectValue
|
|
5112
|
+
selectValue: selectValue,
|
|
5113
|
+
isAppleDevice: isAppleDevice
|
|
5112
5114
|
};
|
|
5113
5115
|
focusMsg = messages.onFocus(onFocusProps);
|
|
5114
5116
|
}
|
|
5115
5117
|
return focusMsg;
|
|
5116
|
-
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
|
|
5118
|
+
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
|
|
5117
5119
|
var ariaResults = useMemo(function () {
|
|
5118
5120
|
var resultsMsg = '';
|
|
5119
|
-
if (menuIsOpen && options.length && messages.onFilter) {
|
|
5121
|
+
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
5120
5122
|
var resultsMessage = screenReaderStatus({
|
|
5121
5123
|
count: focusableOptions.length
|
|
5122
5124
|
});
|
|
@@ -5126,7 +5128,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5126
5128
|
});
|
|
5127
5129
|
}
|
|
5128
5130
|
return resultsMsg;
|
|
5129
|
-
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
|
|
5131
|
+
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
5132
|
+
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
5130
5133
|
var ariaGuidance = useMemo(function () {
|
|
5131
5134
|
var guidanceMsg = '';
|
|
5132
5135
|
if (messages.guidance) {
|
|
@@ -5137,24 +5140,28 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5137
5140
|
isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
|
|
5138
5141
|
isMulti: isMulti,
|
|
5139
5142
|
isSearchable: isSearchable,
|
|
5140
|
-
tabSelectsValue: tabSelectsValue
|
|
5143
|
+
tabSelectsValue: tabSelectsValue,
|
|
5144
|
+
isInitialFocus: isInitialFocus
|
|
5141
5145
|
});
|
|
5142
5146
|
}
|
|
5143
5147
|
return guidanceMsg;
|
|
5144
|
-
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
|
|
5145
|
-
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
|
|
5148
|
+
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
5146
5149
|
var ScreenReaderText = jsx(Fragment, null, jsx("span", {
|
|
5147
5150
|
id: "aria-selection"
|
|
5148
5151
|
}, ariaSelected), jsx("span", {
|
|
5149
|
-
id: "aria-
|
|
5150
|
-
},
|
|
5151
|
-
|
|
5152
|
+
id: "aria-focused"
|
|
5153
|
+
}, ariaFocused), jsx("span", {
|
|
5154
|
+
id: "aria-results"
|
|
5155
|
+
}, ariaResults), jsx("span", {
|
|
5156
|
+
id: "aria-guidance"
|
|
5157
|
+
}, ariaGuidance));
|
|
5152
5158
|
return jsx(Fragment, null, jsx(A11yText$1, {
|
|
5153
5159
|
id: id
|
|
5154
5160
|
}, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
|
|
5155
5161
|
"aria-live": ariaLive,
|
|
5156
5162
|
"aria-atomic": "false",
|
|
5157
|
-
"aria-relevant": "additions text"
|
|
5163
|
+
"aria-relevant": "additions text",
|
|
5164
|
+
role: "log"
|
|
5158
5165
|
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
5159
5166
|
};
|
|
5160
5167
|
var LiveRegion$1 = LiveRegion;
|
|
@@ -5499,7 +5506,7 @@ function DummyInput(_ref) {
|
|
|
5499
5506
|
}
|
|
5500
5507
|
|
|
5501
5508
|
var cancelScroll = function cancelScroll(event) {
|
|
5502
|
-
event.preventDefault();
|
|
5509
|
+
if (event.cancelable) event.preventDefault();
|
|
5503
5510
|
event.stopPropagation();
|
|
5504
5511
|
};
|
|
5505
5512
|
function useScrollCapture(_ref) {
|
|
@@ -5794,6 +5801,30 @@ var RequiredInput = function RequiredInput(_ref) {
|
|
|
5794
5801
|
};
|
|
5795
5802
|
var RequiredInput$1 = RequiredInput;
|
|
5796
5803
|
|
|
5804
|
+
/// <reference types="user-agent-data-types" />
|
|
5805
|
+
|
|
5806
|
+
function testPlatform(re) {
|
|
5807
|
+
var _window$navigator$use;
|
|
5808
|
+
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;
|
|
5809
|
+
}
|
|
5810
|
+
function isIPhone() {
|
|
5811
|
+
return testPlatform(/^iPhone/i);
|
|
5812
|
+
}
|
|
5813
|
+
function isMac() {
|
|
5814
|
+
return testPlatform(/^Mac/i);
|
|
5815
|
+
}
|
|
5816
|
+
function isIPad() {
|
|
5817
|
+
return testPlatform(/^iPad/i) ||
|
|
5818
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
5819
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
5820
|
+
}
|
|
5821
|
+
function isIOS() {
|
|
5822
|
+
return isIPhone() || isIPad();
|
|
5823
|
+
}
|
|
5824
|
+
function isAppleDevice() {
|
|
5825
|
+
return isMac() || isIOS();
|
|
5826
|
+
}
|
|
5827
|
+
|
|
5797
5828
|
var formatGroupLabel = function formatGroupLabel(group) {
|
|
5798
5829
|
return group.label;
|
|
5799
5830
|
};
|
|
@@ -5963,6 +5994,24 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
|
|
|
5963
5994
|
return optionsAccumulator;
|
|
5964
5995
|
}, []);
|
|
5965
5996
|
}
|
|
5997
|
+
function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
|
|
5998
|
+
return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
|
|
5999
|
+
if (categorizedOption.type === 'group') {
|
|
6000
|
+
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
|
|
6001
|
+
return {
|
|
6002
|
+
data: option.data,
|
|
6003
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
|
|
6004
|
+
};
|
|
6005
|
+
})));
|
|
6006
|
+
} else {
|
|
6007
|
+
optionsAccumulator.push({
|
|
6008
|
+
data: categorizedOption.data,
|
|
6009
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index)
|
|
6010
|
+
});
|
|
6011
|
+
}
|
|
6012
|
+
return optionsAccumulator;
|
|
6013
|
+
}, []);
|
|
6014
|
+
}
|
|
5966
6015
|
function buildFocusableOptions(props, selectValue) {
|
|
5967
6016
|
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
|
|
5968
6017
|
}
|
|
@@ -6000,6 +6049,13 @@ function getNextFocusedOption(state, options) {
|
|
|
6000
6049
|
var lastFocusedOption = state.focusedOption;
|
|
6001
6050
|
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
|
|
6002
6051
|
}
|
|
6052
|
+
var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
|
|
6053
|
+
var _focusableOptionsWith;
|
|
6054
|
+
var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
|
|
6055
|
+
return option.data === focusedOption;
|
|
6056
|
+
})) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
|
|
6057
|
+
return focusedOptionId || null;
|
|
6058
|
+
};
|
|
6003
6059
|
var getOptionLabel = function getOptionLabel(props, data) {
|
|
6004
6060
|
return props.getOptionLabel(data);
|
|
6005
6061
|
};
|
|
@@ -6050,6 +6106,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6050
6106
|
_this.state = {
|
|
6051
6107
|
ariaSelection: null,
|
|
6052
6108
|
focusedOption: null,
|
|
6109
|
+
focusedOptionId: null,
|
|
6110
|
+
focusableOptionsWithIds: [],
|
|
6053
6111
|
focusedValue: null,
|
|
6054
6112
|
inputIsHidden: false,
|
|
6055
6113
|
isFocused: false,
|
|
@@ -6057,17 +6115,18 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6057
6115
|
clearFocusValueOnUpdate: false,
|
|
6058
6116
|
prevWasFocused: false,
|
|
6059
6117
|
inputIsHiddenAfterUpdate: undefined,
|
|
6060
|
-
prevProps: undefined
|
|
6118
|
+
prevProps: undefined,
|
|
6119
|
+
instancePrefix: ''
|
|
6061
6120
|
};
|
|
6062
6121
|
_this.blockOptionHover = false;
|
|
6063
6122
|
_this.isComposing = false;
|
|
6064
6123
|
_this.commonProps = void 0;
|
|
6065
6124
|
_this.initialTouchX = 0;
|
|
6066
6125
|
_this.initialTouchY = 0;
|
|
6067
|
-
_this.instancePrefix = '';
|
|
6068
6126
|
_this.openAfterFocus = false;
|
|
6069
6127
|
_this.scrollToFocusedOptionOnUpdate = false;
|
|
6070
6128
|
_this.userIsDragging = void 0;
|
|
6129
|
+
_this.isAppleDevice = isAppleDevice();
|
|
6071
6130
|
_this.controlRef = null;
|
|
6072
6131
|
_this.getControlRef = function (ref) {
|
|
6073
6132
|
_this.controlRef = ref;
|
|
@@ -6182,6 +6241,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6182
6241
|
removedValue: lastSelectedValue
|
|
6183
6242
|
});
|
|
6184
6243
|
};
|
|
6244
|
+
_this.getFocusedOptionId = function (focusedOption) {
|
|
6245
|
+
return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
|
|
6246
|
+
};
|
|
6247
|
+
_this.getFocusableOptionsWithIds = function () {
|
|
6248
|
+
return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
|
|
6249
|
+
};
|
|
6185
6250
|
_this.getValue = function () {
|
|
6186
6251
|
return _this.state.selectValue;
|
|
6187
6252
|
};
|
|
@@ -6209,7 +6274,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6209
6274
|
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);
|
|
6210
6275
|
};
|
|
6211
6276
|
_this.getElementId = function (element) {
|
|
6212
|
-
return "".concat(_this.instancePrefix, "-").concat(element);
|
|
6277
|
+
return "".concat(_this.state.instancePrefix, "-").concat(element);
|
|
6213
6278
|
};
|
|
6214
6279
|
_this.getComponents = function () {
|
|
6215
6280
|
return defaultComponents(_this.props);
|
|
@@ -6418,8 +6483,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6418
6483
|
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
|
|
6419
6484
|
return;
|
|
6420
6485
|
}
|
|
6486
|
+
var options = _this.getFocusableOptions();
|
|
6487
|
+
var focusedOptionIndex = options.indexOf(focusedOption);
|
|
6421
6488
|
_this.setState({
|
|
6422
|
-
focusedOption: focusedOption
|
|
6489
|
+
focusedOption: focusedOption,
|
|
6490
|
+
focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
|
|
6423
6491
|
});
|
|
6424
6492
|
};
|
|
6425
6493
|
_this.shouldHideSelectedOptions = function () {
|
|
@@ -6563,14 +6631,16 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6563
6631
|
}
|
|
6564
6632
|
event.preventDefault();
|
|
6565
6633
|
};
|
|
6566
|
-
_this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6634
|
+
_this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6567
6635
|
_this.state.selectValue = cleanValue(_props.value);
|
|
6568
|
-
|
|
6569
6636
|
// Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
|
|
6570
6637
|
if (_props.menuIsOpen && _this.state.selectValue.length) {
|
|
6638
|
+
var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
|
|
6571
6639
|
var focusableOptions = _this.buildFocusableOptions();
|
|
6572
6640
|
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
|
|
6641
|
+
_this.state.focusableOptionsWithIds = focusableOptionsWithIds;
|
|
6573
6642
|
_this.state.focusedOption = focusableOptions[optionIndex];
|
|
6643
|
+
_this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
|
|
6574
6644
|
}
|
|
6575
6645
|
return _this;
|
|
6576
6646
|
}
|
|
@@ -6695,7 +6765,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6695
6765
|
this.setState({
|
|
6696
6766
|
inputIsHiddenAfterUpdate: false,
|
|
6697
6767
|
focusedValue: null,
|
|
6698
|
-
focusedOption: focusableOptions[openAtIndex]
|
|
6768
|
+
focusedOption: focusableOptions[openAtIndex],
|
|
6769
|
+
focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
|
|
6699
6770
|
}, function () {
|
|
6700
6771
|
return _this2.onMenuOpen();
|
|
6701
6772
|
});
|
|
@@ -6771,7 +6842,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6771
6842
|
this.scrollToFocusedOptionOnUpdate = true;
|
|
6772
6843
|
this.setState({
|
|
6773
6844
|
focusedOption: options[nextFocus],
|
|
6774
|
-
focusedValue: null
|
|
6845
|
+
focusedValue: null,
|
|
6846
|
+
focusedOptionId: this.getFocusedOptionId(options[nextFocus])
|
|
6775
6847
|
});
|
|
6776
6848
|
}
|
|
6777
6849
|
}, {
|
|
@@ -6967,10 +7039,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6967
7039
|
'aria-label': this.props['aria-label'],
|
|
6968
7040
|
'aria-labelledby': this.props['aria-labelledby'],
|
|
6969
7041
|
'aria-required': required,
|
|
6970
|
-
role: 'combobox'
|
|
7042
|
+
role: 'combobox',
|
|
7043
|
+
'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
|
|
6971
7044
|
}, menuIsOpen && {
|
|
6972
|
-
'aria-controls': this.getElementId('listbox')
|
|
6973
|
-
'aria-owns': this.getElementId('listbox')
|
|
7045
|
+
'aria-controls': this.getElementId('listbox')
|
|
6974
7046
|
}), !isSearchable && {
|
|
6975
7047
|
'aria-readonly': true
|
|
6976
7048
|
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
|
|
@@ -7215,8 +7287,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7215
7287
|
onClick: onSelect,
|
|
7216
7288
|
onMouseMove: onHover,
|
|
7217
7289
|
onMouseOver: onHover,
|
|
7218
|
-
tabIndex: -1
|
|
7290
|
+
tabIndex: -1,
|
|
7291
|
+
role: 'option',
|
|
7292
|
+
'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
|
|
7219
7293
|
};
|
|
7294
|
+
|
|
7220
7295
|
return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
|
|
7221
7296
|
innerProps: innerProps,
|
|
7222
7297
|
data: data,
|
|
@@ -7285,8 +7360,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7285
7360
|
innerRef: ref,
|
|
7286
7361
|
innerProps: {
|
|
7287
7362
|
onMouseDown: _this4.onMenuMouseDown,
|
|
7288
|
-
onMouseMove: _this4.onMenuMouseMove
|
|
7289
|
-
id: _this4.getElementId('listbox')
|
|
7363
|
+
onMouseMove: _this4.onMenuMouseMove
|
|
7290
7364
|
},
|
|
7291
7365
|
isLoading: isLoading,
|
|
7292
7366
|
placement: placement
|
|
@@ -7301,6 +7375,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7301
7375
|
_this4.getMenuListRef(instance);
|
|
7302
7376
|
scrollTargetRef(instance);
|
|
7303
7377
|
},
|
|
7378
|
+
innerProps: {
|
|
7379
|
+
role: 'listbox',
|
|
7380
|
+
'aria-multiselectable': commonProps.isMulti,
|
|
7381
|
+
id: _this4.getElementId('listbox')
|
|
7382
|
+
},
|
|
7304
7383
|
isLoading: isLoading,
|
|
7305
7384
|
maxHeight: maxHeight,
|
|
7306
7385
|
focusedOption: focusedOption
|
|
@@ -7388,7 +7467,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7388
7467
|
focusedValue: focusedValue,
|
|
7389
7468
|
isFocused: isFocused,
|
|
7390
7469
|
selectValue: selectValue,
|
|
7391
|
-
focusableOptions: focusableOptions
|
|
7470
|
+
focusableOptions: focusableOptions,
|
|
7471
|
+
isAppleDevice: this.isAppleDevice
|
|
7392
7472
|
}));
|
|
7393
7473
|
}
|
|
7394
7474
|
}, {
|
|
@@ -7437,7 +7517,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7437
7517
|
inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
|
|
7438
7518
|
ariaSelection = state.ariaSelection,
|
|
7439
7519
|
isFocused = state.isFocused,
|
|
7440
|
-
prevWasFocused = state.prevWasFocused
|
|
7520
|
+
prevWasFocused = state.prevWasFocused,
|
|
7521
|
+
instancePrefix = state.instancePrefix;
|
|
7441
7522
|
var options = props.options,
|
|
7442
7523
|
value = props.value,
|
|
7443
7524
|
menuIsOpen = props.menuIsOpen,
|
|
@@ -7447,11 +7528,15 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7447
7528
|
var newMenuOptionsState = {};
|
|
7448
7529
|
if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
|
|
7449
7530
|
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
|
|
7531
|
+
var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
|
|
7450
7532
|
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
|
|
7451
7533
|
var focusedOption = getNextFocusedOption(state, focusableOptions);
|
|
7534
|
+
var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
|
|
7452
7535
|
newMenuOptionsState = {
|
|
7453
7536
|
selectValue: selectValue,
|
|
7454
7537
|
focusedOption: focusedOption,
|
|
7538
|
+
focusedOptionId: focusedOptionId,
|
|
7539
|
+
focusableOptionsWithIds: focusableOptionsWithIds,
|
|
7455
7540
|
focusedValue: focusedValue,
|
|
7456
7541
|
clearFocusValueOnUpdate: false
|
|
7457
7542
|
};
|
|
@@ -7669,39 +7754,57 @@ var classnames = {exports: {}};
|
|
|
7669
7754
|
|
|
7670
7755
|
var hasOwn = {}.hasOwnProperty;
|
|
7671
7756
|
|
|
7672
|
-
function classNames() {
|
|
7673
|
-
var classes =
|
|
7757
|
+
function classNames () {
|
|
7758
|
+
var classes = '';
|
|
7674
7759
|
|
|
7675
7760
|
for (var i = 0; i < arguments.length; i++) {
|
|
7676
7761
|
var arg = arguments[i];
|
|
7677
|
-
if (
|
|
7678
|
-
|
|
7679
|
-
var argType = typeof arg;
|
|
7680
|
-
|
|
7681
|
-
if (argType === 'string' || argType === 'number') {
|
|
7682
|
-
classes.push(arg);
|
|
7683
|
-
} else if (Array.isArray(arg)) {
|
|
7684
|
-
if (arg.length) {
|
|
7685
|
-
var inner = classNames.apply(null, arg);
|
|
7686
|
-
if (inner) {
|
|
7687
|
-
classes.push(inner);
|
|
7688
|
-
}
|
|
7689
|
-
}
|
|
7690
|
-
} else if (argType === 'object') {
|
|
7691
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
7692
|
-
classes.push(arg.toString());
|
|
7693
|
-
continue;
|
|
7694
|
-
}
|
|
7695
|
-
|
|
7696
|
-
for (var key in arg) {
|
|
7697
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
7698
|
-
classes.push(key);
|
|
7699
|
-
}
|
|
7700
|
-
}
|
|
7762
|
+
if (arg) {
|
|
7763
|
+
classes = appendClass(classes, parseValue(arg));
|
|
7701
7764
|
}
|
|
7702
7765
|
}
|
|
7703
7766
|
|
|
7704
|
-
return classes
|
|
7767
|
+
return classes;
|
|
7768
|
+
}
|
|
7769
|
+
|
|
7770
|
+
function parseValue (arg) {
|
|
7771
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
7772
|
+
return arg;
|
|
7773
|
+
}
|
|
7774
|
+
|
|
7775
|
+
if (typeof arg !== 'object') {
|
|
7776
|
+
return '';
|
|
7777
|
+
}
|
|
7778
|
+
|
|
7779
|
+
if (Array.isArray(arg)) {
|
|
7780
|
+
return classNames.apply(null, arg);
|
|
7781
|
+
}
|
|
7782
|
+
|
|
7783
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
7784
|
+
return arg.toString();
|
|
7785
|
+
}
|
|
7786
|
+
|
|
7787
|
+
var classes = '';
|
|
7788
|
+
|
|
7789
|
+
for (var key in arg) {
|
|
7790
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
7791
|
+
classes = appendClass(classes, key);
|
|
7792
|
+
}
|
|
7793
|
+
}
|
|
7794
|
+
|
|
7795
|
+
return classes;
|
|
7796
|
+
}
|
|
7797
|
+
|
|
7798
|
+
function appendClass (value, newClass) {
|
|
7799
|
+
if (!newClass) {
|
|
7800
|
+
return value;
|
|
7801
|
+
}
|
|
7802
|
+
|
|
7803
|
+
if (value) {
|
|
7804
|
+
return value + ' ' + newClass;
|
|
7805
|
+
}
|
|
7806
|
+
|
|
7807
|
+
return value + newClass;
|
|
7705
7808
|
}
|
|
7706
7809
|
|
|
7707
7810
|
if (module.exports) {
|