@vchasno/ui-kit 0.2.13 → 0.2.14
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 +7 -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 +9 -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 +12652 -0
- package/dist/ProjectsPopover/index.cjs.js.map +1 -0
- package/dist/ProjectsPopover/index.d.ts +27 -0
- package/dist/ProjectsPopover/index.js +12632 -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 +9 -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 +9 -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 +9 -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 +9 -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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
export interface BlackTooltipProps extends TooltipProps {
|
|
3
|
+
}
|
|
4
|
+
declare const BlackTooltip: import("@emotion/styled").StyledComponent<TooltipProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
+
export default BlackTooltip;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AllProducts } from './types';
|
|
3
|
+
export interface ProductLinkProps {
|
|
4
|
+
product: AllProducts;
|
|
5
|
+
ctxProduct: string;
|
|
6
|
+
edrpou?: string;
|
|
7
|
+
queryParams?: Record<string, string>;
|
|
8
|
+
onLinkClick?: (product: AllProducts, event: React.MouseEvent) => void;
|
|
9
|
+
overrideHint?: (product: AllProducts) => string;
|
|
10
|
+
}
|
|
11
|
+
declare const ProductLink: React.FC<ProductLinkProps>;
|
|
12
|
+
export default ProductLink;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductLinkProps } from './ProductLink';
|
|
3
|
+
import { AllProducts } from './types';
|
|
4
|
+
import './ProjectsPopover.global.css';
|
|
5
|
+
export interface ProjectsPopoverProps extends Omit<ProductLinkProps, 'product' | 'ctxProduct'> {
|
|
6
|
+
product: AllProducts;
|
|
7
|
+
className?: string;
|
|
8
|
+
vchasnoTitle?: string;
|
|
9
|
+
zakupivliTitle?: string;
|
|
10
|
+
hideProduct?: (product: AllProducts) => boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ProjectsPopover: React.FC<ProjectsPopoverProps>;
|
|
13
|
+
export default ProjectsPopover;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AllProducts, VchasnoProduct, ZakupivliProduct } from './types';
|
|
3
|
+
export declare const hrefMap: Record<VchasnoProduct | ZakupivliProduct, string>;
|
|
4
|
+
export declare const tooltipHintMap: Record<AllProducts, string>;
|
|
5
|
+
export declare const titleMap: Record<VchasnoProduct, string>;
|
|
6
|
+
export declare const iconMap: Record<VchasnoProduct | ZakupivliProduct, React.ReactElement>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const vchasnoProductsList: readonly ["edo", "kep", "kasa", "edi", "ttn"];
|
|
2
|
+
export declare const zakupivliProductsList: readonly ["zakupivli", "prozorroSale", "prozorroMarket", "prozorroRRO"];
|
|
3
|
+
export type VchasnoProduct = (typeof vchasnoProductsList)[number];
|
|
4
|
+
export declare const isVchasnoProduct: (product: string) => product is "edo" | "edi" | "ttn" | "kep" | "kasa";
|
|
5
|
+
export type ZakupivliProduct = (typeof zakupivliProductsList)[number];
|
|
6
|
+
export declare const isZakupivliProduct: (product: string) => product is "zakupivli" | "prozorroSale" | "prozorroMarket" | "prozorroRRO";
|
|
7
|
+
export type AllProducts = VchasnoProduct | ZakupivliProduct;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AllProducts } from './types';
|
|
2
|
+
interface ComposeLinkOptions {
|
|
3
|
+
edrpou?: string;
|
|
4
|
+
ctxProduct: string;
|
|
5
|
+
targetProduct: AllProducts;
|
|
6
|
+
queryParams?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export declare const composeLink: ({ targetProduct, ctxProduct, queryParams, edrpou, }: ComposeLinkOptions) => string;
|
|
9
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithH
|
|
|
10
10
|
}
|
|
11
11
|
declare const Select: React.FC<SelectProps>;
|
|
12
12
|
export declare const SelectComponents: {
|
|
13
|
-
ClearIndicator: <
|
|
13
|
+
ClearIndicator: <Option, IsMulti extends boolean, Group extends import("react-select").GroupBase<Option>>(props: import("react-select").ClearIndicatorProps<Option, IsMulti, Group>) => import("@emotion/react").jsx.JSX.Element;
|
|
14
14
|
Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends import("react-select").GroupBase<Option_1>>(props: import("react-select").ControlProps<Option_1, IsMulti_1, Group_1>) => import("@emotion/react").jsx.JSX.Element;
|
|
15
15
|
DropdownIndicator: <Option_2, IsMulti_2 extends boolean, Group_2 extends import("react-select").GroupBase<Option_2>>(props: import("react-select").DropdownIndicatorProps<Option_2, IsMulti_2, Group_2>) => import("@emotion/react").jsx.JSX.Element;
|
|
16
16
|
DownChevron: (props: import("react-select/dist/declarations/src/components/indicators").DownChevronProps) => import("@emotion/react").jsx.JSX.Element;
|
|
@@ -38,3 +38,5 @@ export { default as SvgBorder, composeRoundedBorderPath } from './SvgBorder';
|
|
|
38
38
|
export type { SvgBorderProps } from './SvgBorder';
|
|
39
39
|
export { default as SplashLogo } from './SplashLogo';
|
|
40
40
|
export type { SplashLogoProps } from './SplashLogo';
|
|
41
|
+
export { default as BlackTooltip } from './BlackTooltip';
|
|
42
|
+
export type { BlackTooltipProps } from './BlackTooltip';
|
|
@@ -92,24 +92,24 @@ function _typeof(o) {
|
|
|
92
92
|
}, _typeof(o);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
97
|
-
var
|
|
98
|
-
if (
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
95
|
+
function toPrimitive(t, r) {
|
|
96
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
97
|
+
var e = t[Symbol.toPrimitive];
|
|
98
|
+
if (void 0 !== e) {
|
|
99
|
+
var i = e.call(t, r || "default");
|
|
100
|
+
if ("object" != _typeof(i)) return i;
|
|
101
101
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
102
102
|
}
|
|
103
|
-
return (
|
|
103
|
+
return ("string" === r ? String : Number)(t);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function
|
|
107
|
-
var
|
|
108
|
-
return _typeof(
|
|
106
|
+
function toPropertyKey(t) {
|
|
107
|
+
var i = toPrimitive(t, "string");
|
|
108
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function _defineProperty(obj, key, value) {
|
|
112
|
-
key =
|
|
112
|
+
key = toPropertyKey(key);
|
|
113
113
|
if (key in obj) {
|
|
114
114
|
Object.defineProperty(obj, key, {
|
|
115
115
|
value: value,
|
|
@@ -157,7 +157,7 @@ function _defineProperties(target, props) {
|
|
|
157
157
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
158
158
|
descriptor.configurable = true;
|
|
159
159
|
if ("value" in descriptor) descriptor.writable = true;
|
|
160
|
-
Object.defineProperty(target,
|
|
160
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -202,15 +202,12 @@ function _getPrototypeOf(o) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function _isNativeReflectConstruct() {
|
|
205
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
206
|
-
if (Reflect.construct.sham) return false;
|
|
207
|
-
if (typeof Proxy === "function") return true;
|
|
208
205
|
try {
|
|
209
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return
|
|
213
|
-
}
|
|
206
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
207
|
+
} catch (t) {}
|
|
208
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
209
|
+
return !!t;
|
|
210
|
+
})();
|
|
214
211
|
}
|
|
215
212
|
|
|
216
213
|
function _assertThisInitialized(self) {
|
|
@@ -3116,12 +3113,11 @@ function _slicedToArray(arr, i) {
|
|
|
3116
3113
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3117
3114
|
if (source == null) return {};
|
|
3118
3115
|
var target = {};
|
|
3119
|
-
var
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
target[key] = source[key];
|
|
3116
|
+
for (var key in source) {
|
|
3117
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3118
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3119
|
+
target[key] = source[key];
|
|
3120
|
+
}
|
|
3125
3121
|
}
|
|
3126
3122
|
return target;
|
|
3127
3123
|
}
|
|
@@ -4557,7 +4553,9 @@ var Control = function Control(props) {
|
|
|
4557
4553
|
'control--is-disabled': isDisabled,
|
|
4558
4554
|
'control--is-focused': isFocused,
|
|
4559
4555
|
'control--menu-is-open': menuIsOpen
|
|
4560
|
-
}), innerProps
|
|
4556
|
+
}), innerProps, {
|
|
4557
|
+
"aria-disabled": isDisabled || undefined
|
|
4558
|
+
}), children);
|
|
4561
4559
|
};
|
|
4562
4560
|
var Control$1 = Control;
|
|
4563
4561
|
|
|
@@ -4993,14 +4991,14 @@ var defaultAriaLiveMessages = {
|
|
|
4993
4991
|
guidance: function guidance(props) {
|
|
4994
4992
|
var isSearchable = props.isSearchable,
|
|
4995
4993
|
isMulti = props.isMulti,
|
|
4996
|
-
isDisabled = props.isDisabled,
|
|
4997
4994
|
tabSelectsValue = props.tabSelectsValue,
|
|
4998
|
-
context = props.context
|
|
4995
|
+
context = props.context,
|
|
4996
|
+
isInitialFocus = props.isInitialFocus;
|
|
4999
4997
|
switch (context) {
|
|
5000
4998
|
case 'menu':
|
|
5001
|
-
return "Use Up and Down to choose options
|
|
4999
|
+
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' : '', ".");
|
|
5002
5000
|
case 'input':
|
|
5003
|
-
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' : '');
|
|
5001
|
+
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' : '') : '';
|
|
5004
5002
|
case 'value':
|
|
5005
5003
|
return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
|
|
5006
5004
|
default:
|
|
@@ -5036,17 +5034,18 @@ var defaultAriaLiveMessages = {
|
|
|
5036
5034
|
label = _props$label2 === void 0 ? '' : _props$label2,
|
|
5037
5035
|
selectValue = props.selectValue,
|
|
5038
5036
|
isDisabled = props.isDisabled,
|
|
5039
|
-
isSelected = props.isSelected
|
|
5037
|
+
isSelected = props.isSelected,
|
|
5038
|
+
isAppleDevice = props.isAppleDevice;
|
|
5040
5039
|
var getArrayIndex = function getArrayIndex(arr, item) {
|
|
5041
5040
|
return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
|
|
5042
5041
|
};
|
|
5043
5042
|
if (context === 'value' && selectValue) {
|
|
5044
5043
|
return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
|
|
5045
5044
|
}
|
|
5046
|
-
if (context === 'menu') {
|
|
5045
|
+
if (context === 'menu' && isAppleDevice) {
|
|
5047
5046
|
var disabled = isDisabled ? ' disabled' : '';
|
|
5048
|
-
var status = "".concat(isSelected ? 'selected' : '
|
|
5049
|
-
return "
|
|
5047
|
+
var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
|
|
5048
|
+
return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
|
|
5050
5049
|
}
|
|
5051
5050
|
return '';
|
|
5052
5051
|
},
|
|
@@ -5065,7 +5064,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5065
5064
|
isFocused = props.isFocused,
|
|
5066
5065
|
selectValue = props.selectValue,
|
|
5067
5066
|
selectProps = props.selectProps,
|
|
5068
|
-
id = props.id
|
|
5067
|
+
id = props.id,
|
|
5068
|
+
isAppleDevice = props.isAppleDevice;
|
|
5069
5069
|
var ariaLiveMessages = selectProps.ariaLiveMessages,
|
|
5070
5070
|
getOptionLabel = selectProps.getOptionLabel,
|
|
5071
5071
|
inputValue = selectProps.inputValue,
|
|
@@ -5075,7 +5075,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5075
5075
|
menuIsOpen = selectProps.menuIsOpen,
|
|
5076
5076
|
options = selectProps.options,
|
|
5077
5077
|
screenReaderStatus = selectProps.screenReaderStatus,
|
|
5078
|
-
tabSelectsValue = selectProps.tabSelectsValue
|
|
5078
|
+
tabSelectsValue = selectProps.tabSelectsValue,
|
|
5079
|
+
isLoading = selectProps.isLoading;
|
|
5079
5080
|
var ariaLabel = selectProps['aria-label'];
|
|
5080
5081
|
var ariaLive = selectProps['aria-live'];
|
|
5081
5082
|
|
|
@@ -5128,15 +5129,16 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5128
5129
|
isSelected: isSelected,
|
|
5129
5130
|
options: focusableOptions,
|
|
5130
5131
|
context: focused === focusedOption ? 'menu' : 'value',
|
|
5131
|
-
selectValue: selectValue
|
|
5132
|
+
selectValue: selectValue,
|
|
5133
|
+
isAppleDevice: isAppleDevice
|
|
5132
5134
|
};
|
|
5133
5135
|
focusMsg = messages.onFocus(onFocusProps);
|
|
5134
5136
|
}
|
|
5135
5137
|
return focusMsg;
|
|
5136
|
-
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
|
|
5138
|
+
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
|
|
5137
5139
|
var ariaResults = React.useMemo(function () {
|
|
5138
5140
|
var resultsMsg = '';
|
|
5139
|
-
if (menuIsOpen && options.length && messages.onFilter) {
|
|
5141
|
+
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
5140
5142
|
var resultsMessage = screenReaderStatus({
|
|
5141
5143
|
count: focusableOptions.length
|
|
5142
5144
|
});
|
|
@@ -5146,7 +5148,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5146
5148
|
});
|
|
5147
5149
|
}
|
|
5148
5150
|
return resultsMsg;
|
|
5149
|
-
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
|
|
5151
|
+
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
5152
|
+
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
5150
5153
|
var ariaGuidance = React.useMemo(function () {
|
|
5151
5154
|
var guidanceMsg = '';
|
|
5152
5155
|
if (messages.guidance) {
|
|
@@ -5157,24 +5160,28 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5157
5160
|
isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
|
|
5158
5161
|
isMulti: isMulti,
|
|
5159
5162
|
isSearchable: isSearchable,
|
|
5160
|
-
tabSelectsValue: tabSelectsValue
|
|
5163
|
+
tabSelectsValue: tabSelectsValue,
|
|
5164
|
+
isInitialFocus: isInitialFocus
|
|
5161
5165
|
});
|
|
5162
5166
|
}
|
|
5163
5167
|
return guidanceMsg;
|
|
5164
|
-
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
|
|
5165
|
-
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
|
|
5168
|
+
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
5166
5169
|
var ScreenReaderText = jsx(React.Fragment, null, jsx("span", {
|
|
5167
5170
|
id: "aria-selection"
|
|
5168
5171
|
}, ariaSelected), jsx("span", {
|
|
5169
|
-
id: "aria-
|
|
5170
|
-
},
|
|
5171
|
-
|
|
5172
|
+
id: "aria-focused"
|
|
5173
|
+
}, ariaFocused), jsx("span", {
|
|
5174
|
+
id: "aria-results"
|
|
5175
|
+
}, ariaResults), jsx("span", {
|
|
5176
|
+
id: "aria-guidance"
|
|
5177
|
+
}, ariaGuidance));
|
|
5172
5178
|
return jsx(React.Fragment, null, jsx(A11yText$1, {
|
|
5173
5179
|
id: id
|
|
5174
5180
|
}, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
|
|
5175
5181
|
"aria-live": ariaLive,
|
|
5176
5182
|
"aria-atomic": "false",
|
|
5177
|
-
"aria-relevant": "additions text"
|
|
5183
|
+
"aria-relevant": "additions text",
|
|
5184
|
+
role: "log"
|
|
5178
5185
|
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
5179
5186
|
};
|
|
5180
5187
|
var LiveRegion$1 = LiveRegion;
|
|
@@ -5519,7 +5526,7 @@ function DummyInput(_ref) {
|
|
|
5519
5526
|
}
|
|
5520
5527
|
|
|
5521
5528
|
var cancelScroll = function cancelScroll(event) {
|
|
5522
|
-
event.preventDefault();
|
|
5529
|
+
if (event.cancelable) event.preventDefault();
|
|
5523
5530
|
event.stopPropagation();
|
|
5524
5531
|
};
|
|
5525
5532
|
function useScrollCapture(_ref) {
|
|
@@ -5814,6 +5821,30 @@ var RequiredInput = function RequiredInput(_ref) {
|
|
|
5814
5821
|
};
|
|
5815
5822
|
var RequiredInput$1 = RequiredInput;
|
|
5816
5823
|
|
|
5824
|
+
/// <reference types="user-agent-data-types" />
|
|
5825
|
+
|
|
5826
|
+
function testPlatform(re) {
|
|
5827
|
+
var _window$navigator$use;
|
|
5828
|
+
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;
|
|
5829
|
+
}
|
|
5830
|
+
function isIPhone() {
|
|
5831
|
+
return testPlatform(/^iPhone/i);
|
|
5832
|
+
}
|
|
5833
|
+
function isMac() {
|
|
5834
|
+
return testPlatform(/^Mac/i);
|
|
5835
|
+
}
|
|
5836
|
+
function isIPad() {
|
|
5837
|
+
return testPlatform(/^iPad/i) ||
|
|
5838
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
5839
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
5840
|
+
}
|
|
5841
|
+
function isIOS() {
|
|
5842
|
+
return isIPhone() || isIPad();
|
|
5843
|
+
}
|
|
5844
|
+
function isAppleDevice() {
|
|
5845
|
+
return isMac() || isIOS();
|
|
5846
|
+
}
|
|
5847
|
+
|
|
5817
5848
|
var formatGroupLabel = function formatGroupLabel(group) {
|
|
5818
5849
|
return group.label;
|
|
5819
5850
|
};
|
|
@@ -5983,6 +6014,24 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
|
|
|
5983
6014
|
return optionsAccumulator;
|
|
5984
6015
|
}, []);
|
|
5985
6016
|
}
|
|
6017
|
+
function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
|
|
6018
|
+
return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
|
|
6019
|
+
if (categorizedOption.type === 'group') {
|
|
6020
|
+
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
|
|
6021
|
+
return {
|
|
6022
|
+
data: option.data,
|
|
6023
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
|
|
6024
|
+
};
|
|
6025
|
+
})));
|
|
6026
|
+
} else {
|
|
6027
|
+
optionsAccumulator.push({
|
|
6028
|
+
data: categorizedOption.data,
|
|
6029
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index)
|
|
6030
|
+
});
|
|
6031
|
+
}
|
|
6032
|
+
return optionsAccumulator;
|
|
6033
|
+
}, []);
|
|
6034
|
+
}
|
|
5986
6035
|
function buildFocusableOptions(props, selectValue) {
|
|
5987
6036
|
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
|
|
5988
6037
|
}
|
|
@@ -6020,6 +6069,13 @@ function getNextFocusedOption(state, options) {
|
|
|
6020
6069
|
var lastFocusedOption = state.focusedOption;
|
|
6021
6070
|
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
|
|
6022
6071
|
}
|
|
6072
|
+
var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
|
|
6073
|
+
var _focusableOptionsWith;
|
|
6074
|
+
var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
|
|
6075
|
+
return option.data === focusedOption;
|
|
6076
|
+
})) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
|
|
6077
|
+
return focusedOptionId || null;
|
|
6078
|
+
};
|
|
6023
6079
|
var getOptionLabel = function getOptionLabel(props, data) {
|
|
6024
6080
|
return props.getOptionLabel(data);
|
|
6025
6081
|
};
|
|
@@ -6070,6 +6126,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6070
6126
|
_this.state = {
|
|
6071
6127
|
ariaSelection: null,
|
|
6072
6128
|
focusedOption: null,
|
|
6129
|
+
focusedOptionId: null,
|
|
6130
|
+
focusableOptionsWithIds: [],
|
|
6073
6131
|
focusedValue: null,
|
|
6074
6132
|
inputIsHidden: false,
|
|
6075
6133
|
isFocused: false,
|
|
@@ -6077,17 +6135,18 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6077
6135
|
clearFocusValueOnUpdate: false,
|
|
6078
6136
|
prevWasFocused: false,
|
|
6079
6137
|
inputIsHiddenAfterUpdate: undefined,
|
|
6080
|
-
prevProps: undefined
|
|
6138
|
+
prevProps: undefined,
|
|
6139
|
+
instancePrefix: ''
|
|
6081
6140
|
};
|
|
6082
6141
|
_this.blockOptionHover = false;
|
|
6083
6142
|
_this.isComposing = false;
|
|
6084
6143
|
_this.commonProps = void 0;
|
|
6085
6144
|
_this.initialTouchX = 0;
|
|
6086
6145
|
_this.initialTouchY = 0;
|
|
6087
|
-
_this.instancePrefix = '';
|
|
6088
6146
|
_this.openAfterFocus = false;
|
|
6089
6147
|
_this.scrollToFocusedOptionOnUpdate = false;
|
|
6090
6148
|
_this.userIsDragging = void 0;
|
|
6149
|
+
_this.isAppleDevice = isAppleDevice();
|
|
6091
6150
|
_this.controlRef = null;
|
|
6092
6151
|
_this.getControlRef = function (ref) {
|
|
6093
6152
|
_this.controlRef = ref;
|
|
@@ -6202,6 +6261,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6202
6261
|
removedValue: lastSelectedValue
|
|
6203
6262
|
});
|
|
6204
6263
|
};
|
|
6264
|
+
_this.getFocusedOptionId = function (focusedOption) {
|
|
6265
|
+
return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
|
|
6266
|
+
};
|
|
6267
|
+
_this.getFocusableOptionsWithIds = function () {
|
|
6268
|
+
return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
|
|
6269
|
+
};
|
|
6205
6270
|
_this.getValue = function () {
|
|
6206
6271
|
return _this.state.selectValue;
|
|
6207
6272
|
};
|
|
@@ -6229,7 +6294,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6229
6294
|
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);
|
|
6230
6295
|
};
|
|
6231
6296
|
_this.getElementId = function (element) {
|
|
6232
|
-
return "".concat(_this.instancePrefix, "-").concat(element);
|
|
6297
|
+
return "".concat(_this.state.instancePrefix, "-").concat(element);
|
|
6233
6298
|
};
|
|
6234
6299
|
_this.getComponents = function () {
|
|
6235
6300
|
return defaultComponents(_this.props);
|
|
@@ -6438,8 +6503,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6438
6503
|
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
|
|
6439
6504
|
return;
|
|
6440
6505
|
}
|
|
6506
|
+
var options = _this.getFocusableOptions();
|
|
6507
|
+
var focusedOptionIndex = options.indexOf(focusedOption);
|
|
6441
6508
|
_this.setState({
|
|
6442
|
-
focusedOption: focusedOption
|
|
6509
|
+
focusedOption: focusedOption,
|
|
6510
|
+
focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
|
|
6443
6511
|
});
|
|
6444
6512
|
};
|
|
6445
6513
|
_this.shouldHideSelectedOptions = function () {
|
|
@@ -6583,14 +6651,16 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6583
6651
|
}
|
|
6584
6652
|
event.preventDefault();
|
|
6585
6653
|
};
|
|
6586
|
-
_this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6654
|
+
_this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6587
6655
|
_this.state.selectValue = cleanValue(_props.value);
|
|
6588
|
-
|
|
6589
6656
|
// Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
|
|
6590
6657
|
if (_props.menuIsOpen && _this.state.selectValue.length) {
|
|
6658
|
+
var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
|
|
6591
6659
|
var focusableOptions = _this.buildFocusableOptions();
|
|
6592
6660
|
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
|
|
6661
|
+
_this.state.focusableOptionsWithIds = focusableOptionsWithIds;
|
|
6593
6662
|
_this.state.focusedOption = focusableOptions[optionIndex];
|
|
6663
|
+
_this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
|
|
6594
6664
|
}
|
|
6595
6665
|
return _this;
|
|
6596
6666
|
}
|
|
@@ -6715,7 +6785,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6715
6785
|
this.setState({
|
|
6716
6786
|
inputIsHiddenAfterUpdate: false,
|
|
6717
6787
|
focusedValue: null,
|
|
6718
|
-
focusedOption: focusableOptions[openAtIndex]
|
|
6788
|
+
focusedOption: focusableOptions[openAtIndex],
|
|
6789
|
+
focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
|
|
6719
6790
|
}, function () {
|
|
6720
6791
|
return _this2.onMenuOpen();
|
|
6721
6792
|
});
|
|
@@ -6791,7 +6862,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6791
6862
|
this.scrollToFocusedOptionOnUpdate = true;
|
|
6792
6863
|
this.setState({
|
|
6793
6864
|
focusedOption: options[nextFocus],
|
|
6794
|
-
focusedValue: null
|
|
6865
|
+
focusedValue: null,
|
|
6866
|
+
focusedOptionId: this.getFocusedOptionId(options[nextFocus])
|
|
6795
6867
|
});
|
|
6796
6868
|
}
|
|
6797
6869
|
}, {
|
|
@@ -6987,10 +7059,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6987
7059
|
'aria-label': this.props['aria-label'],
|
|
6988
7060
|
'aria-labelledby': this.props['aria-labelledby'],
|
|
6989
7061
|
'aria-required': required,
|
|
6990
|
-
role: 'combobox'
|
|
7062
|
+
role: 'combobox',
|
|
7063
|
+
'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
|
|
6991
7064
|
}, menuIsOpen && {
|
|
6992
|
-
'aria-controls': this.getElementId('listbox')
|
|
6993
|
-
'aria-owns': this.getElementId('listbox')
|
|
7065
|
+
'aria-controls': this.getElementId('listbox')
|
|
6994
7066
|
}), !isSearchable && {
|
|
6995
7067
|
'aria-readonly': true
|
|
6996
7068
|
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
|
|
@@ -7235,8 +7307,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7235
7307
|
onClick: onSelect,
|
|
7236
7308
|
onMouseMove: onHover,
|
|
7237
7309
|
onMouseOver: onHover,
|
|
7238
|
-
tabIndex: -1
|
|
7310
|
+
tabIndex: -1,
|
|
7311
|
+
role: 'option',
|
|
7312
|
+
'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
|
|
7239
7313
|
};
|
|
7314
|
+
|
|
7240
7315
|
return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
|
|
7241
7316
|
innerProps: innerProps,
|
|
7242
7317
|
data: data,
|
|
@@ -7305,8 +7380,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7305
7380
|
innerRef: ref,
|
|
7306
7381
|
innerProps: {
|
|
7307
7382
|
onMouseDown: _this4.onMenuMouseDown,
|
|
7308
|
-
onMouseMove: _this4.onMenuMouseMove
|
|
7309
|
-
id: _this4.getElementId('listbox')
|
|
7383
|
+
onMouseMove: _this4.onMenuMouseMove
|
|
7310
7384
|
},
|
|
7311
7385
|
isLoading: isLoading,
|
|
7312
7386
|
placement: placement
|
|
@@ -7321,6 +7395,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7321
7395
|
_this4.getMenuListRef(instance);
|
|
7322
7396
|
scrollTargetRef(instance);
|
|
7323
7397
|
},
|
|
7398
|
+
innerProps: {
|
|
7399
|
+
role: 'listbox',
|
|
7400
|
+
'aria-multiselectable': commonProps.isMulti,
|
|
7401
|
+
id: _this4.getElementId('listbox')
|
|
7402
|
+
},
|
|
7324
7403
|
isLoading: isLoading,
|
|
7325
7404
|
maxHeight: maxHeight,
|
|
7326
7405
|
focusedOption: focusedOption
|
|
@@ -7408,7 +7487,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7408
7487
|
focusedValue: focusedValue,
|
|
7409
7488
|
isFocused: isFocused,
|
|
7410
7489
|
selectValue: selectValue,
|
|
7411
|
-
focusableOptions: focusableOptions
|
|
7490
|
+
focusableOptions: focusableOptions,
|
|
7491
|
+
isAppleDevice: this.isAppleDevice
|
|
7412
7492
|
}));
|
|
7413
7493
|
}
|
|
7414
7494
|
}, {
|
|
@@ -7457,7 +7537,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7457
7537
|
inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
|
|
7458
7538
|
ariaSelection = state.ariaSelection,
|
|
7459
7539
|
isFocused = state.isFocused,
|
|
7460
|
-
prevWasFocused = state.prevWasFocused
|
|
7540
|
+
prevWasFocused = state.prevWasFocused,
|
|
7541
|
+
instancePrefix = state.instancePrefix;
|
|
7461
7542
|
var options = props.options,
|
|
7462
7543
|
value = props.value,
|
|
7463
7544
|
menuIsOpen = props.menuIsOpen,
|
|
@@ -7467,11 +7548,15 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7467
7548
|
var newMenuOptionsState = {};
|
|
7468
7549
|
if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
|
|
7469
7550
|
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
|
|
7551
|
+
var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
|
|
7470
7552
|
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
|
|
7471
7553
|
var focusedOption = getNextFocusedOption(state, focusableOptions);
|
|
7554
|
+
var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
|
|
7472
7555
|
newMenuOptionsState = {
|
|
7473
7556
|
selectValue: selectValue,
|
|
7474
7557
|
focusedOption: focusedOption,
|
|
7558
|
+
focusedOptionId: focusedOptionId,
|
|
7559
|
+
focusableOptionsWithIds: focusableOptionsWithIds,
|
|
7475
7560
|
focusedValue: focusedValue,
|
|
7476
7561
|
clearFocusValueOnUpdate: false
|
|
7477
7562
|
};
|
|
@@ -7689,39 +7774,57 @@ var classnames = {exports: {}};
|
|
|
7689
7774
|
|
|
7690
7775
|
var hasOwn = {}.hasOwnProperty;
|
|
7691
7776
|
|
|
7692
|
-
function classNames() {
|
|
7693
|
-
var classes =
|
|
7777
|
+
function classNames () {
|
|
7778
|
+
var classes = '';
|
|
7694
7779
|
|
|
7695
7780
|
for (var i = 0; i < arguments.length; i++) {
|
|
7696
7781
|
var arg = arguments[i];
|
|
7697
|
-
if (
|
|
7698
|
-
|
|
7699
|
-
var argType = typeof arg;
|
|
7700
|
-
|
|
7701
|
-
if (argType === 'string' || argType === 'number') {
|
|
7702
|
-
classes.push(arg);
|
|
7703
|
-
} else if (Array.isArray(arg)) {
|
|
7704
|
-
if (arg.length) {
|
|
7705
|
-
var inner = classNames.apply(null, arg);
|
|
7706
|
-
if (inner) {
|
|
7707
|
-
classes.push(inner);
|
|
7708
|
-
}
|
|
7709
|
-
}
|
|
7710
|
-
} else if (argType === 'object') {
|
|
7711
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
7712
|
-
classes.push(arg.toString());
|
|
7713
|
-
continue;
|
|
7714
|
-
}
|
|
7715
|
-
|
|
7716
|
-
for (var key in arg) {
|
|
7717
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
7718
|
-
classes.push(key);
|
|
7719
|
-
}
|
|
7720
|
-
}
|
|
7782
|
+
if (arg) {
|
|
7783
|
+
classes = appendClass(classes, parseValue(arg));
|
|
7721
7784
|
}
|
|
7722
7785
|
}
|
|
7723
7786
|
|
|
7724
|
-
return classes
|
|
7787
|
+
return classes;
|
|
7788
|
+
}
|
|
7789
|
+
|
|
7790
|
+
function parseValue (arg) {
|
|
7791
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
7792
|
+
return arg;
|
|
7793
|
+
}
|
|
7794
|
+
|
|
7795
|
+
if (typeof arg !== 'object') {
|
|
7796
|
+
return '';
|
|
7797
|
+
}
|
|
7798
|
+
|
|
7799
|
+
if (Array.isArray(arg)) {
|
|
7800
|
+
return classNames.apply(null, arg);
|
|
7801
|
+
}
|
|
7802
|
+
|
|
7803
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
7804
|
+
return arg.toString();
|
|
7805
|
+
}
|
|
7806
|
+
|
|
7807
|
+
var classes = '';
|
|
7808
|
+
|
|
7809
|
+
for (var key in arg) {
|
|
7810
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
7811
|
+
classes = appendClass(classes, key);
|
|
7812
|
+
}
|
|
7813
|
+
}
|
|
7814
|
+
|
|
7815
|
+
return classes;
|
|
7816
|
+
}
|
|
7817
|
+
|
|
7818
|
+
function appendClass (value, newClass) {
|
|
7819
|
+
if (!newClass) {
|
|
7820
|
+
return value;
|
|
7821
|
+
}
|
|
7822
|
+
|
|
7823
|
+
if (value) {
|
|
7824
|
+
return value + ' ' + newClass;
|
|
7825
|
+
}
|
|
7826
|
+
|
|
7827
|
+
return value + newClass;
|
|
7725
7828
|
}
|
|
7726
7829
|
|
|
7727
7830
|
if (module.exports) {
|