@bcgov/design-system-react-components 0.5.2-pr587 → 0.5.2-pr595
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/README.md +31 -1
- package/dist/cjs/index.cjs +787 -708
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +788 -709
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +52 -39
- package/dist/cjs/types/components/Accordion/Accordion.d.ts +0 -6
- package/dist/cjs/types/components/Accordion/index.d.ts +0 -2
- package/dist/cjs/types/components/AccordionGroup/AccordionGroup.d.ts +0 -7
- package/dist/cjs/types/components/AccordionGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/AlertBanner/AlertBanner.d.ts +0 -10
- package/dist/cjs/types/components/AlertBanner/index.d.ts +0 -2
- package/dist/cjs/types/components/AlertDialog/AlertDialog.d.ts +0 -11
- package/dist/cjs/types/components/AlertDialog/AlertDialog.test.d.ts +0 -1
- package/dist/cjs/types/components/AlertDialog/index.d.ts +0 -2
- package/dist/cjs/types/components/Button/Button.d.ts +0 -21
- package/dist/cjs/types/components/Button/Button.test.d.ts +0 -1
- package/dist/cjs/types/components/Button/index.d.ts +0 -2
- package/dist/cjs/types/components/ButtonGroup/ButtonGroup.d.ts +0 -7
- package/dist/cjs/types/components/ButtonGroup/ButtonGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/ButtonGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Callout/Callout.d.ts +0 -10
- package/dist/cjs/types/components/Callout/index.d.ts +0 -2
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/cjs/types/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/cjs/types/components/Checkbox/index.d.ts +0 -2
- package/dist/cjs/types/components/CheckboxGroup/CheckboxGroup.d.ts +0 -11
- package/dist/cjs/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +0 -11
- package/dist/cjs/types/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/cjs/types/components/Dialog/index.d.ts +0 -2
- package/dist/cjs/types/components/Footer/Footer.d.ts +0 -62
- package/dist/cjs/types/components/Footer/Footer.test.d.ts +0 -1
- package/dist/cjs/types/components/Footer/index.d.ts +0 -2
- package/dist/cjs/types/components/Form/Form.d.ts +0 -2
- package/dist/cjs/types/components/Form/Form.test.d.ts +0 -1
- package/dist/cjs/types/components/Form/index.d.ts +0 -2
- package/dist/cjs/types/components/Header/Header.d.ts +0 -29
- package/dist/cjs/types/components/Header/Header.test.d.ts +0 -1
- package/dist/cjs/types/components/Header/index.d.ts +0 -2
- package/dist/cjs/types/components/Heading/Heading.d.ts +0 -7
- package/dist/cjs/types/components/Heading/index.d.ts +0 -2
- package/dist/cjs/types/components/Icons/SvgBcLogo/SvgBcLogo.d.ts +0 -4
- package/dist/cjs/types/components/Icons/SvgBcLogo/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgBcOutlineIcon/SvgBcOutlineIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgBcOutlineIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgBetaIcon/SvgBetaIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgBetaIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCheckIcon/SvgCheckIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCheckIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgChevronDownIcon/SvgChevronDownIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgChevronDownIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgChevronUpIcon/SvgChevronUpIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgChevronUpIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCloseIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgDashIcon/SvgDashIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgDashIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgExclamationIcon/SvgExclamationIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgExclamationIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgInfoIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgTooltipArrowUp/SvgTooltipArrowUp.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgTooltipArrowUp/index.d.ts +0 -1
- package/dist/cjs/types/components/InlineAlert/InlineAlert.d.ts +0 -12
- package/dist/cjs/types/components/InlineAlert/InlineAlert.test.d.ts +0 -1
- package/dist/cjs/types/components/InlineAlert/index.d.ts +0 -2
- package/dist/cjs/types/components/Link/Link.d.ts +0 -15
- package/dist/cjs/types/components/Link/index.d.ts +0 -2
- package/dist/cjs/types/components/Modal/Modal.d.ts +0 -3
- package/dist/cjs/types/components/Modal/Modal.test.d.ts +0 -1
- package/dist/cjs/types/components/Modal/index.d.ts +0 -2
- package/dist/cjs/types/components/Radio/Radio.d.ts +0 -3
- package/dist/cjs/types/components/Radio/Radio.test.d.ts +0 -1
- package/dist/cjs/types/components/Radio/index.d.ts +0 -2
- package/dist/cjs/types/components/RadioGroup/RadioGroup.d.ts +0 -12
- package/dist/cjs/types/components/RadioGroup/RadioGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/RadioGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Select/Select.d.ts +0 -39
- package/dist/cjs/types/components/Select/index.d.ts +0 -2
- package/dist/cjs/types/components/Switch/Switch.d.ts +0 -6
- package/dist/cjs/types/components/Switch/Switch.test.d.ts +0 -1
- package/dist/cjs/types/components/Switch/index.d.ts +0 -2
- package/dist/cjs/types/components/Tag/Tag.d.ts +0 -21
- package/dist/cjs/types/components/Tag/index.d.ts +0 -2
- package/dist/cjs/types/components/TagGroup/TagGroup.d.ts +0 -17
- package/dist/cjs/types/components/TagGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/TagList/TagList.d.ts +0 -11
- package/dist/cjs/types/components/TagList/index.d.ts +0 -2
- package/dist/cjs/types/components/Text/Text.d.ts +0 -8
- package/dist/cjs/types/components/Text/index.d.ts +0 -2
- package/dist/cjs/types/components/TextArea/TextArea.d.ts +0 -8
- package/dist/cjs/types/components/TextArea/index.d.ts +0 -2
- package/dist/cjs/types/components/TextField/TextField.d.ts +0 -11
- package/dist/cjs/types/components/TextField/index.d.ts +0 -2
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +0 -5
- package/dist/cjs/types/components/Tooltip/index.d.ts +0 -2
- package/dist/cjs/types/components/index.d.ts +0 -42
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/esm/types/components/Accordion/Accordion.d.ts +0 -6
- package/dist/esm/types/components/Accordion/index.d.ts +0 -2
- package/dist/esm/types/components/AccordionGroup/AccordionGroup.d.ts +0 -7
- package/dist/esm/types/components/AccordionGroup/index.d.ts +0 -2
- package/dist/esm/types/components/AlertBanner/AlertBanner.d.ts +0 -10
- package/dist/esm/types/components/AlertBanner/index.d.ts +0 -2
- package/dist/esm/types/components/AlertDialog/AlertDialog.d.ts +0 -11
- package/dist/esm/types/components/AlertDialog/AlertDialog.test.d.ts +0 -1
- package/dist/esm/types/components/AlertDialog/index.d.ts +0 -2
- package/dist/esm/types/components/Button/Button.d.ts +0 -21
- package/dist/esm/types/components/Button/Button.test.d.ts +0 -1
- package/dist/esm/types/components/Button/index.d.ts +0 -2
- package/dist/esm/types/components/ButtonGroup/ButtonGroup.d.ts +0 -7
- package/dist/esm/types/components/ButtonGroup/ButtonGroup.test.d.ts +0 -1
- package/dist/esm/types/components/ButtonGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Callout/Callout.d.ts +0 -10
- package/dist/esm/types/components/Callout/index.d.ts +0 -2
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/esm/types/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -2
- package/dist/esm/types/components/CheckboxGroup/CheckboxGroup.d.ts +0 -11
- package/dist/esm/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +0 -1
- package/dist/esm/types/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Dialog/Dialog.d.ts +0 -11
- package/dist/esm/types/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/esm/types/components/Dialog/index.d.ts +0 -2
- package/dist/esm/types/components/Footer/Footer.d.ts +0 -62
- package/dist/esm/types/components/Footer/Footer.test.d.ts +0 -1
- package/dist/esm/types/components/Footer/index.d.ts +0 -2
- package/dist/esm/types/components/Form/Form.d.ts +0 -2
- package/dist/esm/types/components/Form/Form.test.d.ts +0 -1
- package/dist/esm/types/components/Form/index.d.ts +0 -2
- package/dist/esm/types/components/Header/Header.d.ts +0 -29
- package/dist/esm/types/components/Header/Header.test.d.ts +0 -1
- package/dist/esm/types/components/Header/index.d.ts +0 -2
- package/dist/esm/types/components/Heading/Heading.d.ts +0 -7
- package/dist/esm/types/components/Heading/index.d.ts +0 -2
- package/dist/esm/types/components/Icons/SvgBcLogo/SvgBcLogo.d.ts +0 -4
- package/dist/esm/types/components/Icons/SvgBcLogo/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgBcOutlineIcon/SvgBcOutlineIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgBcOutlineIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgBetaIcon/SvgBetaIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgBetaIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCheckIcon/SvgCheckIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCheckIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgChevronDownIcon/SvgChevronDownIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgChevronDownIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgChevronUpIcon/SvgChevronUpIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgChevronUpIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCloseIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgDashIcon/SvgDashIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgDashIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgExclamationIcon/SvgExclamationIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgExclamationIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgInfoIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgTooltipArrowUp/SvgTooltipArrowUp.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgTooltipArrowUp/index.d.ts +0 -1
- package/dist/esm/types/components/InlineAlert/InlineAlert.d.ts +0 -12
- package/dist/esm/types/components/InlineAlert/InlineAlert.test.d.ts +0 -1
- package/dist/esm/types/components/InlineAlert/index.d.ts +0 -2
- package/dist/esm/types/components/Link/Link.d.ts +0 -15
- package/dist/esm/types/components/Link/index.d.ts +0 -2
- package/dist/esm/types/components/Modal/Modal.d.ts +0 -3
- package/dist/esm/types/components/Modal/Modal.test.d.ts +0 -1
- package/dist/esm/types/components/Modal/index.d.ts +0 -2
- package/dist/esm/types/components/Radio/Radio.d.ts +0 -3
- package/dist/esm/types/components/Radio/Radio.test.d.ts +0 -1
- package/dist/esm/types/components/Radio/index.d.ts +0 -2
- package/dist/esm/types/components/RadioGroup/RadioGroup.d.ts +0 -12
- package/dist/esm/types/components/RadioGroup/RadioGroup.test.d.ts +0 -1
- package/dist/esm/types/components/RadioGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Select/Select.d.ts +0 -39
- package/dist/esm/types/components/Select/index.d.ts +0 -2
- package/dist/esm/types/components/Switch/Switch.d.ts +0 -6
- package/dist/esm/types/components/Switch/Switch.test.d.ts +0 -1
- package/dist/esm/types/components/Switch/index.d.ts +0 -2
- package/dist/esm/types/components/Tag/Tag.d.ts +0 -21
- package/dist/esm/types/components/Tag/index.d.ts +0 -2
- package/dist/esm/types/components/TagGroup/TagGroup.d.ts +0 -17
- package/dist/esm/types/components/TagGroup/index.d.ts +0 -2
- package/dist/esm/types/components/TagList/TagList.d.ts +0 -11
- package/dist/esm/types/components/TagList/index.d.ts +0 -2
- package/dist/esm/types/components/Text/Text.d.ts +0 -8
- package/dist/esm/types/components/Text/index.d.ts +0 -2
- package/dist/esm/types/components/TextArea/TextArea.d.ts +0 -8
- package/dist/esm/types/components/TextArea/index.d.ts +0 -2
- package/dist/esm/types/components/TextField/TextField.d.ts +0 -11
- package/dist/esm/types/components/TextField/index.d.ts +0 -2
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +0 -5
- package/dist/esm/types/components/Tooltip/index.d.ts +0 -2
- package/dist/esm/types/components/index.d.ts +0 -42
- package/dist/esm/types/index.d.ts +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import $dbSRa$react, { createContext, useRef, useCallback,
|
|
2
|
+
import $dbSRa$react, { createContext, useState, useRef, useCallback, useContext, useEffect, useMemo, version, useReducer, cloneElement, forwardRef, isValidElement, Fragment, createElement } from 'react';
|
|
3
3
|
import $4AOtR$reactdom, { flushSync, createPortal } from 'react-dom';
|
|
4
4
|
|
|
5
5
|
function styleInject(css, ref) {
|
|
6
|
-
if ( ref ===
|
|
6
|
+
if ( ref === void 0 ) ref = {};
|
|
7
7
|
var insertAt = ref.insertAt;
|
|
8
8
|
|
|
9
9
|
if (!css || typeof document === 'undefined') { return; }
|
|
@@ -65,36 +65,6 @@ const $4e85f108e88277b8$export$698f465ec27e93df = (createContext)(null);
|
|
|
65
65
|
*/
|
|
66
66
|
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? ($dbSRa$react).useLayoutEffect : ()=>{};
|
|
67
67
|
|
|
68
|
-
/*
|
|
69
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
70
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
71
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
72
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
73
|
-
*
|
|
74
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
75
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
76
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
77
|
-
* governing permissions and limitations under the License.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
|
|
81
|
-
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
|
|
82
|
-
// before all layout effects, but is available only in React 18 and later.
|
|
83
|
-
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = ($dbSRa$react)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== undefined ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
|
|
84
|
-
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
85
|
-
const ref = (useRef)(null);
|
|
86
|
-
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
|
|
87
|
-
ref.current = fn;
|
|
88
|
-
}, [
|
|
89
|
-
fn
|
|
90
|
-
]);
|
|
91
|
-
// @ts-ignore
|
|
92
|
-
return (useCallback)((...args)=>{
|
|
93
|
-
const f = ref.current;
|
|
94
|
-
return f === null || f === undefined ? undefined : f(...args);
|
|
95
|
-
}, []);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
68
|
/*
|
|
99
69
|
* Copyright 2020 Adobe. All rights reserved.
|
|
100
70
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -109,10 +79,13 @@ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
|
109
79
|
|
|
110
80
|
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
111
81
|
let [value, setValue] = (useState)(defaultValue);
|
|
82
|
+
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
|
|
83
|
+
// This allows us to maintain a stable queue function.
|
|
84
|
+
let currValue = (useRef)(value);
|
|
112
85
|
let effect = (useRef)(null);
|
|
113
86
|
// Store the function in a ref so we can always access the current version
|
|
114
87
|
// which has the proper `value` in scope.
|
|
115
|
-
let nextRef = (
|
|
88
|
+
let nextRef = (useRef)(()=>{
|
|
116
89
|
if (!effect.current) return;
|
|
117
90
|
// Run the generator to the next yield.
|
|
118
91
|
let newValue = effect.current.next();
|
|
@@ -124,17 +97,20 @@ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
|
124
97
|
// If the value is the same as the current value,
|
|
125
98
|
// then continue to the next yield. Otherwise,
|
|
126
99
|
// set the value in state and wait for the next layout effect.
|
|
127
|
-
if (
|
|
100
|
+
if (currValue.current === newValue.value) nextRef.current();
|
|
128
101
|
else setValue(newValue.value);
|
|
129
102
|
});
|
|
130
103
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
104
|
+
currValue.current = value;
|
|
131
105
|
// If there is an effect currently running, continue to the next yield.
|
|
132
|
-
if (effect.current) nextRef();
|
|
133
|
-
});
|
|
134
|
-
let queue = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((fn)=>{
|
|
135
|
-
effect.current = fn(value);
|
|
136
|
-
nextRef();
|
|
106
|
+
if (effect.current) nextRef.current();
|
|
137
107
|
});
|
|
108
|
+
let queue = (useCallback)((fn)=>{
|
|
109
|
+
effect.current = fn(currValue.current);
|
|
110
|
+
nextRef.current();
|
|
111
|
+
}, [
|
|
112
|
+
nextRef
|
|
113
|
+
]);
|
|
138
114
|
return [
|
|
139
115
|
value,
|
|
140
116
|
queue
|
|
@@ -184,7 +160,7 @@ function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
|
|
|
184
160
|
// a weak map associated with the Fiber. On the second render, we reset the global counter to this value.
|
|
185
161
|
// Since React runs the second render immediately after the first, this is safe.
|
|
186
162
|
// @ts-ignore
|
|
187
|
-
let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ($dbSRa$react).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ===
|
|
163
|
+
let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ($dbSRa$react).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
|
|
188
164
|
if (currentOwner) {
|
|
189
165
|
let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
|
|
190
166
|
if (prevComponentValue == null) // On the first render, and first call to useId, store the id and state in our weak map.
|
|
@@ -353,7 +329,7 @@ function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
|
|
|
353
329
|
|
|
354
330
|
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
|
|
355
331
|
var _el_ownerDocument;
|
|
356
|
-
return (_el_ownerDocument = el === null || el ===
|
|
332
|
+
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
|
|
357
333
|
};
|
|
358
334
|
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
|
|
359
335
|
if (el && 'window' in el && el.window === el) return el;
|
|
@@ -395,7 +371,7 @@ const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
|
|
|
395
371
|
var _activeElement_shadowRoot;
|
|
396
372
|
if (!($f4e2df6bd15f8569$export$98658e8c59125e6a)()) return doc.activeElement;
|
|
397
373
|
let activeElement = doc.activeElement;
|
|
398
|
-
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot ===
|
|
374
|
+
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
|
|
399
375
|
return activeElement;
|
|
400
376
|
};
|
|
401
377
|
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
|
|
@@ -463,7 +439,7 @@ class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
|
|
|
463
439
|
var _this_filter;
|
|
464
440
|
let nodeResult;
|
|
465
441
|
if (typeof this.filter === 'function') nodeResult = this.filter(nextNode);
|
|
466
|
-
else if ((_this_filter = this.filter) === null || _this_filter ===
|
|
442
|
+
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
|
|
467
443
|
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
|
|
468
444
|
this.currentNode = nextNode;
|
|
469
445
|
return nextNode;
|
|
@@ -506,7 +482,7 @@ class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
|
|
|
506
482
|
var _this_filter;
|
|
507
483
|
let nodeResult;
|
|
508
484
|
if (typeof this.filter === 'function') nodeResult = this.filter(previousNode);
|
|
509
|
-
else if ((_this_filter = this.filter) === null || _this_filter ===
|
|
485
|
+
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
|
|
510
486
|
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
|
|
511
487
|
if (previousNode) this.currentNode = previousNode;
|
|
512
488
|
return previousNode;
|
|
@@ -567,7 +543,7 @@ class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
|
|
|
567
543
|
} else {
|
|
568
544
|
var _this_filter;
|
|
569
545
|
if (typeof this.filter === 'function') return this.filter(node);
|
|
570
|
-
else if ((_this_filter = this.filter) === null || _this_filter ===
|
|
546
|
+
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) return this.filter.acceptNode(node);
|
|
571
547
|
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
|
|
572
548
|
}
|
|
573
549
|
}
|
|
@@ -575,8 +551,8 @@ class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
|
|
|
575
551
|
};
|
|
576
552
|
this._doc = doc;
|
|
577
553
|
this.root = root;
|
|
578
|
-
this.filter = filter !== null && filter !==
|
|
579
|
-
this.whatToShow = whatToShow !== null && whatToShow !==
|
|
554
|
+
this.filter = filter !== null && filter !== void 0 ? filter : null;
|
|
555
|
+
this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL;
|
|
580
556
|
this._currentNode = root;
|
|
581
557
|
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
|
|
582
558
|
const shadowRoot = root.shadowRoot;
|
|
@@ -738,7 +714,7 @@ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
|
|
|
738
714
|
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
739
715
|
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
|
|
740
716
|
let filteredProps = {};
|
|
741
|
-
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames ===
|
|
717
|
+
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
742
718
|
return filteredProps;
|
|
743
719
|
}
|
|
744
720
|
|
|
@@ -819,12 +795,12 @@ function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
|
|
|
819
795
|
*/ function $c87311424ea30a05$var$testUserAgent(re) {
|
|
820
796
|
var _window_navigator_userAgentData;
|
|
821
797
|
if (typeof window === 'undefined' || window.navigator == null) return false;
|
|
822
|
-
let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData ===
|
|
798
|
+
let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
|
|
823
799
|
return Array.isArray(brands) && brands.some((brand)=>re.test(brand.brand)) || re.test(window.navigator.userAgent);
|
|
824
800
|
}
|
|
825
801
|
function $c87311424ea30a05$var$testPlatform(re) {
|
|
826
802
|
var _window_navigator_userAgentData;
|
|
827
|
-
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData ===
|
|
803
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
828
804
|
}
|
|
829
805
|
function $c87311424ea30a05$var$cached(fn) {
|
|
830
806
|
if (process.env.NODE_ENV === 'test') return fn;
|
|
@@ -899,7 +875,7 @@ function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening
|
|
|
899
875
|
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
900
876
|
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
901
877
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
902
|
-
if (($c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event ===
|
|
878
|
+
if (($c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith('key')) && target.target === '_blank') {
|
|
903
879
|
if (($c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
904
880
|
else ctrlKey = true;
|
|
905
881
|
}
|
|
@@ -916,6 +892,7 @@ function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening
|
|
|
916
892
|
ctrlKey: ctrlKey,
|
|
917
893
|
altKey: altKey,
|
|
918
894
|
shiftKey: shiftKey,
|
|
895
|
+
detail: 1,
|
|
919
896
|
bubbles: true,
|
|
920
897
|
cancelable: true
|
|
921
898
|
});
|
|
@@ -947,7 +924,7 @@ function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
|
947
924
|
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
948
925
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
949
926
|
var _props_href;
|
|
950
|
-
const href = router.useHref((_props_href = props.href) !== null && _props_href !==
|
|
927
|
+
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
951
928
|
return {
|
|
952
929
|
'data-href': props.href ? href : undefined,
|
|
953
930
|
'data-target': props.target,
|
|
@@ -960,14 +937,14 @@ function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
|
960
937
|
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
961
938
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
962
939
|
var _props_href;
|
|
963
|
-
const href = router.useHref((_props_href = props === null || props ===
|
|
940
|
+
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
964
941
|
return {
|
|
965
|
-
href: (props === null || props ===
|
|
966
|
-
target: props === null || props ===
|
|
967
|
-
rel: props === null || props ===
|
|
968
|
-
download: props === null || props ===
|
|
969
|
-
ping: props === null || props ===
|
|
970
|
-
referrerPolicy: props === null || props ===
|
|
942
|
+
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
|
|
943
|
+
target: props === null || props === void 0 ? void 0 : props.target,
|
|
944
|
+
rel: props === null || props === void 0 ? void 0 : props.rel,
|
|
945
|
+
download: props === null || props === void 0 ? void 0 : props.download,
|
|
946
|
+
ping: props === null || props === void 0 ? void 0 : props.ping,
|
|
947
|
+
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
|
|
971
948
|
};
|
|
972
949
|
}
|
|
973
950
|
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
|
|
@@ -1078,7 +1055,7 @@ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
|
1078
1055
|
let globalListeners = (useRef)(new Map());
|
|
1079
1056
|
let addGlobalListener = (useCallback)((eventTarget, type, listener, options)=>{
|
|
1080
1057
|
// Make sure we remove the listener after it is called with the `once` option.
|
|
1081
|
-
let fn = (options === null || options ===
|
|
1058
|
+
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
|
|
1082
1059
|
globalListeners.current.delete(listener);
|
|
1083
1060
|
listener(...args);
|
|
1084
1061
|
} : listener;
|
|
@@ -1092,7 +1069,7 @@ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
|
1092
1069
|
}, []);
|
|
1093
1070
|
let removeGlobalListener = (useCallback)((eventTarget, type, listener, options)=>{
|
|
1094
1071
|
var _globalListeners_current_get;
|
|
1095
|
-
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get ===
|
|
1072
|
+
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
|
|
1096
1073
|
eventTarget.removeEventListener(type, fn, options);
|
|
1097
1074
|
globalListeners.current.delete(listener);
|
|
1098
1075
|
}, []);
|
|
@@ -1197,6 +1174,36 @@ function $df56164dff5785e2$export$4338b53315abf666(ref) {
|
|
|
1197
1174
|
]);
|
|
1198
1175
|
}
|
|
1199
1176
|
|
|
1177
|
+
/*
|
|
1178
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
1179
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1180
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1181
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1182
|
+
*
|
|
1183
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1184
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1185
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1186
|
+
* governing permissions and limitations under the License.
|
|
1187
|
+
*/
|
|
1188
|
+
|
|
1189
|
+
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
|
|
1190
|
+
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
|
|
1191
|
+
// before all layout effects, but is available only in React 18 and later.
|
|
1192
|
+
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = ($dbSRa$react)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
|
|
1193
|
+
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
1194
|
+
const ref = (useRef)(null);
|
|
1195
|
+
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
|
|
1196
|
+
ref.current = fn;
|
|
1197
|
+
}, [
|
|
1198
|
+
fn
|
|
1199
|
+
]);
|
|
1200
|
+
// @ts-ignore
|
|
1201
|
+
return (useCallback)((...args)=>{
|
|
1202
|
+
const f = ref.current;
|
|
1203
|
+
return f === null || f === void 0 ? void 0 : f(...args);
|
|
1204
|
+
}, []);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1200
1207
|
/*
|
|
1201
1208
|
* Copyright 2020 Adobe. All rights reserved.
|
|
1202
1209
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -1208,9 +1215,11 @@ function $df56164dff5785e2$export$4338b53315abf666(ref) {
|
|
|
1208
1215
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1209
1216
|
* governing permissions and limitations under the License.
|
|
1210
1217
|
*/
|
|
1211
|
-
|
|
1218
|
+
|
|
1219
|
+
function $4f58c5f72bcf79f7$export$496315a1608d9602(cb, dependencies) {
|
|
1212
1220
|
const isInitialMount = (useRef)(true);
|
|
1213
1221
|
const lastDeps = (useRef)(null);
|
|
1222
|
+
let cbEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(cb);
|
|
1214
1223
|
(useEffect)(()=>{
|
|
1215
1224
|
isInitialMount.current = true;
|
|
1216
1225
|
return ()=>{
|
|
@@ -1220,7 +1229,7 @@ function $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {
|
|
|
1220
1229
|
(useEffect)(()=>{
|
|
1221
1230
|
let prevDeps = lastDeps.current;
|
|
1222
1231
|
if (isInitialMount.current) isInitialMount.current = false;
|
|
1223
|
-
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i])))
|
|
1232
|
+
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i]))) cbEvent();
|
|
1224
1233
|
lastDeps.current = dependencies;
|
|
1225
1234
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1226
1235
|
}, dependencies);
|
|
@@ -1259,19 +1268,22 @@ function $9daab02d461809db$var$hasResizeObserver() {
|
|
|
1259
1268
|
return typeof window.ResizeObserver !== 'undefined';
|
|
1260
1269
|
}
|
|
1261
1270
|
function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
1271
|
+
// Only call onResize from inside the effect, otherwise we'll void our assumption that
|
|
1272
|
+
// useEffectEvents are safe to pass in.
|
|
1262
1273
|
const { ref: ref, box: box, onResize: onResize } = options;
|
|
1274
|
+
let onResizeEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
|
|
1263
1275
|
(useEffect)(()=>{
|
|
1264
|
-
let element = ref === null || ref ===
|
|
1276
|
+
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
1265
1277
|
if (!element) return;
|
|
1266
1278
|
if (!$9daab02d461809db$var$hasResizeObserver()) {
|
|
1267
|
-
window.addEventListener('resize',
|
|
1279
|
+
window.addEventListener('resize', onResizeEvent, false);
|
|
1268
1280
|
return ()=>{
|
|
1269
|
-
window.removeEventListener('resize',
|
|
1281
|
+
window.removeEventListener('resize', onResizeEvent, false);
|
|
1270
1282
|
};
|
|
1271
1283
|
} else {
|
|
1272
1284
|
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
|
|
1273
1285
|
if (!entries.length) return;
|
|
1274
|
-
|
|
1286
|
+
onResizeEvent();
|
|
1275
1287
|
});
|
|
1276
1288
|
resizeObserverInstance.observe(element, {
|
|
1277
1289
|
box: box
|
|
@@ -1281,7 +1293,6 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
1281
1293
|
};
|
|
1282
1294
|
}
|
|
1283
1295
|
}, [
|
|
1284
|
-
onResize,
|
|
1285
1296
|
ref,
|
|
1286
1297
|
box
|
|
1287
1298
|
]);
|
|
@@ -1538,8 +1549,7 @@ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options)
|
|
|
1538
1549
|
ref,
|
|
1539
1550
|
event,
|
|
1540
1551
|
options,
|
|
1541
|
-
isDisabled
|
|
1542
|
-
handleEvent
|
|
1552
|
+
isDisabled
|
|
1543
1553
|
]);
|
|
1544
1554
|
}
|
|
1545
1555
|
|
|
@@ -1554,7 +1564,6 @@ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options)
|
|
|
1554
1564
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1555
1565
|
* governing permissions and limitations under the License.
|
|
1556
1566
|
*/
|
|
1557
|
-
|
|
1558
1567
|
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
1559
1568
|
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
|
|
1560
1569
|
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
|
|
@@ -1564,48 +1573,23 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
1564
1573
|
let y = scrollView.scrollTop;
|
|
1565
1574
|
// Account for top/left border offsetting the scroll top/Left + scroll padding
|
|
1566
1575
|
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
1567
|
-
// Account for scroll margin of the element
|
|
1568
|
-
let { scrollMarginTop: scrollMarginTop, scrollMarginRight: scrollMarginRight, scrollMarginBottom: scrollMarginBottom, scrollMarginLeft: scrollMarginLeft } = getComputedStyle(element);
|
|
1569
1576
|
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
1570
1577
|
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
1571
1578
|
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
|
|
1572
1579
|
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
1573
1580
|
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
1574
|
-
// Get scroll padding
|
|
1581
|
+
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
|
|
1575
1582
|
// is used.
|
|
1576
1583
|
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
|
|
1577
1584
|
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
1578
1585
|
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
1579
1586
|
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
let targetTop = offsetY - scrollMarginTopNumber;
|
|
1587
|
-
let targetBottom = offsetY + height + scrollMarginBottomNumber;
|
|
1588
|
-
let scrollPortLeft = x + parseInt(borderLeftWidth, 10) + scrollPaddingLeftNumber;
|
|
1589
|
-
let scrollPortRight = maxX - scrollPaddingRightNumber;
|
|
1590
|
-
let scrollPortTop = y + parseInt(borderTopWidth, 10) + scrollPaddingTopNumber;
|
|
1591
|
-
let scrollPortBottom = maxY - scrollPaddingBottomNumber;
|
|
1592
|
-
if (targetLeft > scrollPortLeft || targetRight < scrollPortRight) {
|
|
1593
|
-
if (targetLeft <= x + scrollPaddingLeftNumber) x = targetLeft - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
1594
|
-
else if (targetRight > maxX - scrollPaddingRightNumber) x += targetRight - maxX + scrollPaddingRightNumber;
|
|
1595
|
-
}
|
|
1596
|
-
if (targetTop > scrollPortTop || targetBottom < scrollPortBottom) {
|
|
1597
|
-
if (targetTop <= borderAdjustedY + scrollPaddingTopNumber) y = targetTop - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
1598
|
-
else if (targetBottom > maxY - scrollPaddingBottomNumber) y += targetBottom - maxY + scrollPaddingBottomNumber;
|
|
1599
|
-
}
|
|
1600
|
-
if (process.env.NODE_ENV === 'test') {
|
|
1601
|
-
scrollView.scrollLeft = x;
|
|
1602
|
-
scrollView.scrollTop = y;
|
|
1603
|
-
return;
|
|
1604
|
-
}
|
|
1605
|
-
scrollView.scrollTo({
|
|
1606
|
-
left: x,
|
|
1607
|
-
top: y
|
|
1608
|
-
});
|
|
1587
|
+
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
1588
|
+
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
|
|
1589
|
+
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
1590
|
+
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
|
|
1591
|
+
scrollView.scrollLeft = x;
|
|
1592
|
+
scrollView.scrollTop = y;
|
|
1609
1593
|
}
|
|
1610
1594
|
/**
|
|
1611
1595
|
* Computes the offset left or top from child to ancestor by accumulating
|
|
@@ -1631,31 +1615,31 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
1631
1615
|
if (targetElement && document.contains(targetElement)) {
|
|
1632
1616
|
let root = document.scrollingElement || document.documentElement;
|
|
1633
1617
|
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
|
|
1634
|
-
// If scrolling is not currently prevented then we aren
|
|
1635
|
-
|
|
1636
|
-
if (!isScrollPrevented && !($c87311424ea30a05$export$6446a186d09e379e)()) {
|
|
1618
|
+
// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
|
|
1619
|
+
if (!isScrollPrevented) {
|
|
1637
1620
|
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
|
|
1638
1621
|
// won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically
|
|
1639
1622
|
_targetElement_scrollIntoView;
|
|
1640
1623
|
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
1641
|
-
targetElement === null || targetElement ===
|
|
1624
|
+
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
1642
1625
|
block: 'nearest'
|
|
1643
1626
|
});
|
|
1644
1627
|
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
1645
1628
|
// Account for sub pixel differences from rounding
|
|
1646
1629
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
1647
1630
|
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
1648
|
-
opts === null || opts ===
|
|
1631
|
+
opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
|
|
1649
1632
|
block: 'center',
|
|
1650
1633
|
inline: 'center'
|
|
1651
1634
|
});
|
|
1652
|
-
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 ===
|
|
1635
|
+
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
|
|
1653
1636
|
block: 'nearest'
|
|
1654
1637
|
});
|
|
1655
1638
|
}
|
|
1656
1639
|
} else {
|
|
1657
1640
|
let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement);
|
|
1658
1641
|
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
|
|
1642
|
+
if (!isScrollPrevented) scrollParents.push(root);
|
|
1659
1643
|
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
1660
1644
|
}
|
|
1661
1645
|
}
|
|
@@ -1709,14 +1693,13 @@ function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
|
1709
1693
|
});
|
|
1710
1694
|
(useEffect)(()=>{
|
|
1711
1695
|
var _ref_current;
|
|
1712
|
-
let form = ref === null || ref ===
|
|
1713
|
-
form === null || form ===
|
|
1696
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
1697
|
+
form === null || form === void 0 ? void 0 : form.addEventListener('reset', handleReset);
|
|
1714
1698
|
return ()=>{
|
|
1715
|
-
form === null || form ===
|
|
1699
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', handleReset);
|
|
1716
1700
|
};
|
|
1717
1701
|
}, [
|
|
1718
|
-
ref
|
|
1719
|
-
handleReset
|
|
1702
|
+
ref
|
|
1720
1703
|
]);
|
|
1721
1704
|
}
|
|
1722
1705
|
|
|
@@ -1750,7 +1733,7 @@ function $a5fa973c1850dd36$export$ccaea96c28e8b9e7(props, ref) {
|
|
|
1750
1733
|
// Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
|
|
1751
1734
|
// https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
|
|
1752
1735
|
sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
|
|
1753
|
-
root: ($62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref ===
|
|
1736
|
+
root: ($62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref === void 0 ? void 0 : ref.current),
|
|
1754
1737
|
rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
|
|
1755
1738
|
});
|
|
1756
1739
|
sentinelObserver.current.observe(ref.current);
|
|
@@ -1760,7 +1743,6 @@ function $a5fa973c1850dd36$export$ccaea96c28e8b9e7(props, ref) {
|
|
|
1760
1743
|
};
|
|
1761
1744
|
}, [
|
|
1762
1745
|
collection,
|
|
1763
|
-
triggerLoadMore,
|
|
1764
1746
|
ref,
|
|
1765
1747
|
scrollOffset
|
|
1766
1748
|
]);
|
|
@@ -1963,8 +1945,14 @@ function $b4b717babfbb907b$var$isInert(element) {
|
|
|
1963
1945
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1964
1946
|
* governing permissions and limitations under the License.
|
|
1965
1947
|
*/
|
|
1948
|
+
var $458b0a5536c1a7cf$var$_React_useInsertionEffect;
|
|
1949
|
+
// Use the earliest effect possible to reset the ref below.
|
|
1950
|
+
const $458b0a5536c1a7cf$var$useEarlyEffect = typeof document !== 'undefined' ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = ($dbSRa$react)['useInsertionEffect']) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : ($dbSRa$react).useLayoutEffect : ()=>{};
|
|
1966
1951
|
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
1952
|
+
// Store the value in both state and a ref. The state value will only be used when uncontrolled.
|
|
1953
|
+
// The ref is used to track the most current value, which is passed to the function setState callback.
|
|
1967
1954
|
let [stateValue, setStateValue] = (useState)(value || defaultValue);
|
|
1955
|
+
let valueRef = (useRef)(stateValue);
|
|
1968
1956
|
let isControlledRef = (useRef)(value !== undefined);
|
|
1969
1957
|
let isControlled = value !== undefined;
|
|
1970
1958
|
(useEffect)(()=>{
|
|
@@ -1974,40 +1962,28 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
1974
1962
|
}, [
|
|
1975
1963
|
isControlled
|
|
1976
1964
|
]);
|
|
1965
|
+
// After each render, update the ref to the current value.
|
|
1966
|
+
// This ensures that the setState callback argument is reset.
|
|
1967
|
+
// Note: the effect should not have any dependencies so that controlled values always reset.
|
|
1977
1968
|
let currentValue = isControlled ? value : stateValue;
|
|
1969
|
+
$458b0a5536c1a7cf$var$useEarlyEffect(()=>{
|
|
1970
|
+
valueRef.current = currentValue;
|
|
1971
|
+
});
|
|
1972
|
+
let [, forceUpdate] = (useReducer)(()=>({}), {});
|
|
1978
1973
|
let setValue = (useCallback)((value, ...args)=>{
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
//
|
|
1986
|
-
|
|
1987
|
-
//
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
if (typeof value === 'function') {
|
|
1991
|
-
if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
|
|
1992
|
-
// this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
|
|
1993
|
-
// when someone using useControlledState calls setControlledState(myFunc)
|
|
1994
|
-
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
|
|
1995
|
-
// if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
|
|
1996
|
-
// otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
|
|
1997
|
-
let updateFunction = (oldValue, ...functionArgs)=>{
|
|
1998
|
-
let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
1999
|
-
onChangeCaller(interceptedValue, ...args);
|
|
2000
|
-
if (!isControlled) return interceptedValue;
|
|
2001
|
-
return oldValue;
|
|
2002
|
-
};
|
|
2003
|
-
setStateValue(updateFunction);
|
|
2004
|
-
} else {
|
|
2005
|
-
if (!isControlled) setStateValue(value);
|
|
2006
|
-
onChangeCaller(value, ...args);
|
|
1974
|
+
// @ts-ignore - TS doesn't know that T cannot be a function.
|
|
1975
|
+
let newValue = typeof value === 'function' ? value(valueRef.current) : value;
|
|
1976
|
+
if (!Object.is(valueRef.current, newValue)) {
|
|
1977
|
+
// Update the ref so that the next setState callback has the most recent value.
|
|
1978
|
+
valueRef.current = newValue;
|
|
1979
|
+
setStateValue(newValue);
|
|
1980
|
+
// Always trigger a re-render, even when controlled, so that the layout effect above runs to reset the value.
|
|
1981
|
+
forceUpdate();
|
|
1982
|
+
// Trigger onChange. Note that if setState is called multiple times in a single event,
|
|
1983
|
+
// onChange will be called for each one instead of only once.
|
|
1984
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue, ...args);
|
|
2007
1985
|
}
|
|
2008
1986
|
}, [
|
|
2009
|
-
isControlled,
|
|
2010
|
-
currentValue,
|
|
2011
1987
|
onChange
|
|
2012
1988
|
]);
|
|
2013
1989
|
return [
|
|
@@ -2076,12 +2052,12 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
2076
2052
|
else if (children == null) computedChildren = defaultChildren;
|
|
2077
2053
|
else computedChildren = children;
|
|
2078
2054
|
return {
|
|
2079
|
-
className: computedClassName !== null && computedClassName !==
|
|
2055
|
+
className: computedClassName !== null && computedClassName !== void 0 ? computedClassName : defaultClassName,
|
|
2080
2056
|
style: computedStyle || defaultStyle ? {
|
|
2081
2057
|
...defaultStyle,
|
|
2082
2058
|
...computedStyle
|
|
2083
2059
|
} : undefined,
|
|
2084
|
-
children: computedChildren !== null && computedChildren !==
|
|
2060
|
+
children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
|
|
2085
2061
|
'data-rac': ''
|
|
2086
2062
|
};
|
|
2087
2063
|
}, [
|
|
@@ -2112,7 +2088,6 @@ function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
|
|
|
2112
2088
|
}
|
|
2113
2089
|
function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
|
|
2114
2090
|
let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {};
|
|
2115
|
-
// @ts-ignore - TS says "Type 'unique symbol' cannot be used as an index type." but not sure why.
|
|
2116
2091
|
let { ref: contextRef, ...contextProps } = ctx;
|
|
2117
2092
|
let mergedRef = ($df56164dff5785e2$export$4338b53315abf666)((useMemo)(()=>($5dc95899b306f630$export$c9058316764c140e)(ref, contextRef), [
|
|
2118
2093
|
ref,
|
|
@@ -2198,7 +2173,7 @@ function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = 'ass
|
|
|
2198
2173
|
// if we're in a test environment, announce without waiting
|
|
2199
2174
|
// @ts-ignore
|
|
2200
2175
|
if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) setTimeout(()=>{
|
|
2201
|
-
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer ===
|
|
2176
|
+
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
2202
2177
|
}, 100);
|
|
2203
2178
|
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
2204
2179
|
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
@@ -2212,7 +2187,7 @@ function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = 'ass
|
|
|
2212
2187
|
class $319e236875307eab$var$LiveAnnouncer {
|
|
2213
2188
|
isAttached() {
|
|
2214
2189
|
var _this_node;
|
|
2215
|
-
return (_this_node = this.node) === null || _this_node ===
|
|
2190
|
+
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
2216
2191
|
}
|
|
2217
2192
|
createLog(ariaLive) {
|
|
2218
2193
|
let node = document.createElement('div');
|
|
@@ -2235,8 +2210,8 @@ class $319e236875307eab$var$LiveAnnouncer {
|
|
|
2235
2210
|
node.setAttribute('role', 'img');
|
|
2236
2211
|
node.setAttribute('aria-labelledby', message['aria-labelledby']);
|
|
2237
2212
|
} else node.textContent = message;
|
|
2238
|
-
if (assertiveness === 'assertive') (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog ===
|
|
2239
|
-
else (_this_politeLog = this.politeLog) === null || _this_politeLog ===
|
|
2213
|
+
if (assertiveness === 'assertive') (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
2214
|
+
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
2240
2215
|
if (message !== '') setTimeout(()=>{
|
|
2241
2216
|
node.remove();
|
|
2242
2217
|
}, timeout);
|
|
@@ -2311,28 +2286,31 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
|
2311
2286
|
height: 'totalHeight'
|
|
2312
2287
|
};
|
|
2313
2288
|
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
2314
|
-
let $edcf132a9284368a$var$
|
|
2315
|
-
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
2289
|
+
let $edcf132a9284368a$var$getVisualViewport = ()=>typeof document !== 'undefined' ? window.visualViewport : null;
|
|
2290
|
+
function $edcf132a9284368a$var$getContainerDimensions(containerNode, visualViewport) {
|
|
2316
2291
|
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
2317
2292
|
let scroll = {};
|
|
2318
2293
|
var _visualViewport_scale;
|
|
2319
|
-
let isPinchZoomedIn = ((_visualViewport_scale =
|
|
2320
|
-
|
|
2294
|
+
let isPinchZoomedIn = ((_visualViewport_scale = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
|
|
2295
|
+
// In the case where the container is `html` or `body` and the container doesn't have something like `position: relative`,
|
|
2296
|
+
// then position absolute will be positioned relative to the viewport, also known as the `initial containing block`.
|
|
2297
|
+
// That's why we use the visual viewport instead.
|
|
2298
|
+
if (containerNode.tagName === 'BODY' || containerNode.tagName === 'HTML') {
|
|
2321
2299
|
let documentElement = document.documentElement;
|
|
2322
2300
|
totalWidth = documentElement.clientWidth;
|
|
2323
2301
|
totalHeight = documentElement.clientHeight;
|
|
2324
2302
|
var _visualViewport_width;
|
|
2325
|
-
width = (_visualViewport_width =
|
|
2303
|
+
width = (_visualViewport_width = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
|
|
2326
2304
|
var _visualViewport_height;
|
|
2327
|
-
height = (_visualViewport_height =
|
|
2305
|
+
height = (_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
|
|
2328
2306
|
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
2329
2307
|
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
2330
2308
|
// The goal of the below is to get a top/left value that represents the top/left of the visual viewport with
|
|
2331
2309
|
// respect to the layout viewport origin. This combined with the scrollTop/scrollLeft will allow us to calculate
|
|
2332
2310
|
// coordinates/values with respect to the visual viewport or with respect to the layout viewport.
|
|
2333
|
-
if (
|
|
2334
|
-
top =
|
|
2335
|
-
left =
|
|
2311
|
+
if (visualViewport) {
|
|
2312
|
+
top = visualViewport.offsetTop;
|
|
2313
|
+
left = visualViewport.offsetLeft;
|
|
2336
2314
|
}
|
|
2337
2315
|
} else {
|
|
2338
2316
|
({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode, false));
|
|
@@ -2349,9 +2327,9 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
|
2349
2327
|
scroll.top = 0;
|
|
2350
2328
|
scroll.left = 0;
|
|
2351
2329
|
var _visualViewport_pageTop;
|
|
2352
|
-
top = (_visualViewport_pageTop =
|
|
2330
|
+
top = (_visualViewport_pageTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
|
|
2353
2331
|
var _visualViewport_pageLeft;
|
|
2354
|
-
left = (_visualViewport_pageLeft =
|
|
2332
|
+
left = (_visualViewport_pageLeft = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
|
|
2355
2333
|
}
|
|
2356
2334
|
return {
|
|
2357
2335
|
width: width,
|
|
@@ -2381,15 +2359,17 @@ boundaryDimensions, // The dimensions of the containing block element that the p
|
|
|
2381
2359
|
// position: relative/absolute, it will be different.
|
|
2382
2360
|
containerDimensions, padding, containerOffsetWithBoundary) {
|
|
2383
2361
|
var _containerDimensions_scroll_axis;
|
|
2384
|
-
let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !==
|
|
2362
|
+
let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0;
|
|
2385
2363
|
// The height/width of the boundary. Matches the axis along which we are adjusting the overlay position
|
|
2386
2364
|
let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
2387
2365
|
// Calculate the edges of the boundary (accomodating for the boundary padding) and the edges of the overlay.
|
|
2388
2366
|
// Note that these values are with respect to the visual viewport (aka 0,0 is the top left of the viewport)
|
|
2389
|
-
let boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
2390
|
-
let boundaryEndEdge =
|
|
2391
|
-
|
|
2392
|
-
let
|
|
2367
|
+
let boundaryStartEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
2368
|
+
let boundaryEndEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + boundarySize - padding;
|
|
2369
|
+
// transformed value of the left edge of the overlay
|
|
2370
|
+
let startEdgeOffset = offset - containerScroll + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
2371
|
+
// transformed value of the right edge of the overlay
|
|
2372
|
+
let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
2393
2373
|
// If any of the overlay edges falls outside of the boundary, shift the overlay the required amount to align one of the overlay's
|
|
2394
2374
|
// edges with the closest boundary edge.
|
|
2395
2375
|
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
@@ -2423,26 +2403,26 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
2423
2403
|
};
|
|
2424
2404
|
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
2425
2405
|
}
|
|
2426
|
-
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
2406
|
+
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
|
|
2427
2407
|
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
2428
2408
|
let position = {};
|
|
2429
2409
|
var _childOffset_crossAxis;
|
|
2430
2410
|
// button position
|
|
2431
|
-
position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !==
|
|
2411
|
+
position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !== void 0 ? _childOffset_crossAxis : 0;
|
|
2432
2412
|
var _childOffset_crossSize, _overlaySize_crossSize, _childOffset_crossSize1, _overlaySize_crossSize1;
|
|
2433
2413
|
if (crossPlacement === 'center') // + (button size / 2) - (overlay size / 2)
|
|
2434
2414
|
// at this point the overlay center should match the button center
|
|
2435
|
-
position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !==
|
|
2415
|
+
position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !== void 0 ? _childOffset_crossSize : 0) - ((_overlaySize_crossSize = overlaySize[crossSize]) !== null && _overlaySize_crossSize !== void 0 ? _overlaySize_crossSize : 0)) / 2;
|
|
2436
2416
|
else if (crossPlacement !== crossAxis) // + (button size) - (overlay size)
|
|
2437
2417
|
// at this point the overlay bottom should match the button bottom
|
|
2438
|
-
position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !==
|
|
2418
|
+
position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !== void 0 ? _childOffset_crossSize1 : 0) - ((_overlaySize_crossSize1 = overlaySize[crossSize]) !== null && _overlaySize_crossSize1 !== void 0 ? _overlaySize_crossSize1 : 0);
|
|
2439
2419
|
/* else {
|
|
2440
2420
|
the overlay top should match the button top
|
|
2441
2421
|
} */
|
|
2442
2422
|
position[crossAxis] += crossOffset;
|
|
2443
|
-
// overlay top overlapping arrow with button bottom
|
|
2423
|
+
// overlay top or left overlapping arrow with button bottom or right
|
|
2444
2424
|
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
2445
|
-
// overlay bottom overlapping arrow with button top
|
|
2425
|
+
// overlay bottom or right overlapping arrow with button top or left
|
|
2446
2426
|
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
2447
2427
|
position[crossAxis] = ($9446cca9a3875146$export$7d15b64cf5a3a4c4)(position[crossAxis], minPosition, maxPosition);
|
|
2448
2428
|
// Floor these so the position isn't placed on a partial pixel, only whole pixels. Shouldn't matter if it was floored or ceiled, so chose one.
|
|
@@ -2450,46 +2430,61 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
2450
2430
|
// If the container is positioned (non-static), then we use the container's actual
|
|
2451
2431
|
// height, as `bottom` will be relative to this height. But if the container is static,
|
|
2452
2432
|
// then it can only be the `document.body`, and `bottom` will be relative to _its_
|
|
2453
|
-
// container
|
|
2454
|
-
|
|
2433
|
+
// container.
|
|
2434
|
+
let containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
|
|
2455
2435
|
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
2456
2436
|
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
2457
2437
|
return position;
|
|
2458
2438
|
}
|
|
2459
|
-
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
//
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2439
|
+
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
|
|
2440
|
+
var _position_bottom, _containerDimensions_scroll_top;
|
|
2441
|
+
// For cases where position is set via "bottom" instead of "top", we need to calculate the true overlay top
|
|
2442
|
+
// with respect to the container.
|
|
2443
|
+
let overlayTop = (position.top != null ? position.top : containerDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height] - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight) - ((_containerDimensions_scroll_top = containerDimensions.scroll.top) !== null && _containerDimensions_scroll_top !== void 0 ? _containerDimensions_scroll_top : 0);
|
|
2444
|
+
// calculate the dimentions of the "boundingRect" which is most restrictive top/bottom of the boundaryRect and the visual view port
|
|
2445
|
+
let boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
|
|
2446
|
+
var _visualViewport_offsetTop, _visualViewport_offsetTop1, _visualViewport_height;
|
|
2447
|
+
let boundingRect = {
|
|
2448
|
+
// This should be boundary top in container coord system vs viewport top in container coord system
|
|
2449
|
+
// For the viewport top, there are several cases
|
|
2450
|
+
// 1. pinchzoom case where we want the viewports offset top as top here
|
|
2451
|
+
// 2. case where container is offset from the boundary and is contained by the boundary. In this case the top we want here is NOT 0, we want to take boundary's top even though is is a negative number OR the visual viewport, whichever is more restrictive
|
|
2452
|
+
top: Math.max(boundaryDimensions.top + boundaryToContainerTransformOffset, ((_visualViewport_offsetTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.offsetTop) !== null && _visualViewport_offsetTop !== void 0 ? _visualViewport_offsetTop : boundaryDimensions.top) + boundaryToContainerTransformOffset),
|
|
2453
|
+
bottom: Math.min(boundaryDimensions.top + boundaryDimensions.height + boundaryToContainerTransformOffset, ((_visualViewport_offsetTop1 = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.offsetTop) !== null && _visualViewport_offsetTop1 !== void 0 ? _visualViewport_offsetTop1 : 0) + ((_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : 0))
|
|
2454
|
+
};
|
|
2455
|
+
var _margins_top, _margins_bottom, _margins_top1, _margins_bottom1;
|
|
2466
2456
|
let maxHeight = heightGrowthDirection !== 'top' ? // We want the distance between the top of the overlay to the bottom of the boundary
|
|
2467
|
-
Math.max(0,
|
|
2468
|
-
-
|
|
2457
|
+
Math.max(0, boundingRect.bottom // this is the bottom of the boundary
|
|
2458
|
+
- overlayTop // this is the top of the overlay
|
|
2459
|
+
- (((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0) + padding // save additional space for margin and padding
|
|
2469
2460
|
)) : Math.max(0, overlayTop + overlayHeight // this is the bottom of the overlay
|
|
2470
|
-
-
|
|
2471
|
-
|
|
2461
|
+
- boundingRect.top // this is the top of the boundary
|
|
2462
|
+
- (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding // save additional space for margin and padding
|
|
2472
2463
|
));
|
|
2473
|
-
return
|
|
2464
|
+
return maxHeight;
|
|
2474
2465
|
}
|
|
2475
|
-
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
2466
|
+
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
|
|
2476
2467
|
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
2477
|
-
var
|
|
2478
|
-
if (placement === axis) return Math.max(0, childOffset[axis]
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2468
|
+
var _containerDimensions_scroll_axis, _margins_axis;
|
|
2469
|
+
if (placement === axis) return Math.max(0, childOffset[axis] // trigger start
|
|
2470
|
+
- ((_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0 // transform trigger position to be with respect to viewport 0,0
|
|
2471
|
+
) - (boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) // boundary start
|
|
2472
|
+
) - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0 // margins usually for arrows or other decorations
|
|
2473
|
+
) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding); // padding between overlay and boundary
|
|
2474
|
+
var _containerDimensions_scroll_axis1, _margins_axis1;
|
|
2475
|
+
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) - childOffset[axis] - childOffset[size] + ((_containerDimensions_scroll_axis1 = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis1 !== void 0 ? _containerDimensions_scroll_axis1 : 0) - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
2476
|
+
}
|
|
2477
|
+
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
2483
2478
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
2484
2479
|
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
2485
|
-
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
2480
|
+
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
2486
2481
|
let normalizedOffset = offset;
|
|
2487
|
-
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
2482
|
+
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
2488
2483
|
// Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
|
|
2489
|
-
if (flip &&
|
|
2484
|
+
if (flip && overlaySize[size] > space) {
|
|
2490
2485
|
let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
2491
|
-
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
2492
|
-
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
|
|
2486
|
+
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
2487
|
+
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
2493
2488
|
// If the available space for the flipped position is greater than the original available space, flip.
|
|
2494
2489
|
if (flippedSpace > space) {
|
|
2495
2490
|
placementInfo = flippedPlacementInfo;
|
|
@@ -2508,10 +2503,10 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
2508
2503
|
}
|
|
2509
2504
|
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
2510
2505
|
position[crossAxis] += delta;
|
|
2511
|
-
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
|
|
2506
|
+
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
|
|
2512
2507
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
2513
2508
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
2514
|
-
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
2509
|
+
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
2515
2510
|
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
2516
2511
|
position[crossAxis] += delta;
|
|
2517
2512
|
let arrowPosition = {};
|
|
@@ -2526,7 +2521,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
2526
2521
|
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
2527
2522
|
var _margins_left, _margins_right, _margins_top, _margins_bottom;
|
|
2528
2523
|
// overlaySize[crossSize] - margins = true size of the overlay
|
|
2529
|
-
const overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === 'left' ? ((_margins_left = margins.left) !== null && _margins_left !==
|
|
2524
|
+
const overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === 'left' ? ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0) : ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
|
|
2530
2525
|
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
2531
2526
|
// Min/Max position limits for the arrow with respect to the trigger/overlay anchor element
|
|
2532
2527
|
// Same margin accomodation done here as well as for the preferredArrowPosition
|
|
@@ -2557,6 +2552,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
2557
2552
|
}
|
|
2558
2553
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
2559
2554
|
let { placement: placement, targetNode: targetNode, overlayNode: overlayNode, scrollNode: scrollNode, padding: padding, shouldFlip: shouldFlip, boundaryElement: boundaryElement, offset: offset, crossOffset: crossOffset, maxHeight: maxHeight, arrowSize: arrowSize = 0, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
|
|
2555
|
+
let visualViewport = $edcf132a9284368a$var$getVisualViewport();
|
|
2560
2556
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
2561
2557
|
let isViewportContainer = container === document.documentElement;
|
|
2562
2558
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
@@ -2570,25 +2566,26 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
2570
2566
|
let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode, true);
|
|
2571
2567
|
let margins = $edcf132a9284368a$var$getMargins(overlayNode);
|
|
2572
2568
|
var _margins_left, _margins_right;
|
|
2573
|
-
overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !==
|
|
2569
|
+
overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0);
|
|
2574
2570
|
var _margins_top, _margins_bottom;
|
|
2575
|
-
overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !==
|
|
2571
|
+
overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
|
|
2576
2572
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
2577
|
-
|
|
2578
|
-
|
|
2573
|
+
// Note that due to logic inside getContainerDimensions, for cases where the boundary element is the body, we will return
|
|
2574
|
+
// a height/width that matches the visual viewport size rather than the body's height/width (aka for zoom it will be zoom adjusted size)
|
|
2575
|
+
// and a top/left that is adjusted as well (will return the top/left of the zoomed in viewport, or 0,0 for a non-zoomed body)
|
|
2576
|
+
// Otherwise this returns the height/width of a arbitrary boundary element, and its top/left with respect to the viewport (NOTE THIS MEANS IT DOESNT INCLUDE SCROLL)
|
|
2577
|
+
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement, visualViewport);
|
|
2578
|
+
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container, visualViewport);
|
|
2579
2579
|
// If the container is the HTML element wrapping the body element, the retrieved scrollTop/scrollLeft will be equal to the
|
|
2580
2580
|
// body element's scroll. Set the container's scroll values to 0 since the overlay's edge position value in getDelta don't then need to be further offset
|
|
2581
2581
|
// by the container scroll since they are essentially the same containing element and thus in the same coordinate system
|
|
2582
|
-
let containerOffsetWithBoundary =
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
containerDimensions.scroll.left = 0;
|
|
2586
|
-
}
|
|
2587
|
-
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
2582
|
+
let containerOffsetWithBoundary = $edcf132a9284368a$var$getPosition(boundaryElement, container, false);
|
|
2583
|
+
let isContainerDescendentOfBoundary = boundaryElement.contains(container);
|
|
2584
|
+
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
|
|
2588
2585
|
}
|
|
2589
2586
|
function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) {
|
|
2590
2587
|
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
2591
|
-
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
2588
|
+
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
2592
2589
|
// the size is not affected by scale transforms.
|
|
2593
2590
|
if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
|
2594
2591
|
width = node.offsetWidth;
|
|
@@ -2805,10 +2802,13 @@ function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
|
|
|
2805
2802
|
}, []);
|
|
2806
2803
|
// We cannot determine the browser's language on the server, so default to
|
|
2807
2804
|
// en-US. This will be updated after hydration on the client to the correct value.
|
|
2808
|
-
if (isSSR)
|
|
2809
|
-
locale
|
|
2810
|
-
|
|
2811
|
-
|
|
2805
|
+
if (isSSR) {
|
|
2806
|
+
let locale = typeof window !== 'undefined' && window[$1e5a04cdaf7d1af8$var$localeSymbol];
|
|
2807
|
+
return {
|
|
2808
|
+
locale: locale || 'en-US',
|
|
2809
|
+
direction: 'ltr'
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
2812
|
return defaultLocale;
|
|
2813
2813
|
}
|
|
2814
2814
|
|
|
@@ -2871,7 +2871,7 @@ class $5b160d28a433310d$export$c17fa47878dc55b6 {
|
|
|
2871
2871
|
[locale]: globalStrings[pkg]
|
|
2872
2872
|
}, locale);
|
|
2873
2873
|
}
|
|
2874
|
-
let dictionary = $5b160d28a433310d$var$cachedGlobalStrings === null || $5b160d28a433310d$var$cachedGlobalStrings ===
|
|
2874
|
+
let dictionary = $5b160d28a433310d$var$cachedGlobalStrings === null || $5b160d28a433310d$var$cachedGlobalStrings === void 0 ? void 0 : $5b160d28a433310d$var$cachedGlobalStrings[packageName];
|
|
2875
2875
|
if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
|
|
2876
2876
|
return dictionary;
|
|
2877
2877
|
}
|
|
@@ -3066,7 +3066,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3066
3066
|
placement,
|
|
3067
3067
|
overlayRef.current,
|
|
3068
3068
|
targetRef.current,
|
|
3069
|
-
arrowRef === null || arrowRef ===
|
|
3069
|
+
arrowRef === null || arrowRef === void 0 ? void 0 : arrowRef.current,
|
|
3070
3070
|
scrollRef.current,
|
|
3071
3071
|
containerPadding,
|
|
3072
3072
|
shouldFlip,
|
|
@@ -3082,15 +3082,15 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3082
3082
|
// Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might
|
|
3083
3083
|
// just be a non-realistic use case
|
|
3084
3084
|
// Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles
|
|
3085
|
-
let lastScale = (useRef)($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3085
|
+
let lastScale = (useRef)($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale);
|
|
3086
3086
|
(useEffect)(()=>{
|
|
3087
|
-
if (isOpen) lastScale.current = $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3087
|
+
if (isOpen) lastScale.current = $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale;
|
|
3088
3088
|
}, [
|
|
3089
3089
|
isOpen
|
|
3090
3090
|
]);
|
|
3091
3091
|
let updatePosition = (useCallback)(()=>{
|
|
3092
3092
|
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) return;
|
|
3093
|
-
if (($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3093
|
+
if (($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale) !== lastScale.current) return;
|
|
3094
3094
|
// Determine a scroll anchor based on the focused element.
|
|
3095
3095
|
// This stores the offset of the anchor element from the scroll container
|
|
3096
3096
|
// so it can be restored after repositioning. This way if the overlay height
|
|
@@ -3098,19 +3098,19 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3098
3098
|
let anchor = null;
|
|
3099
3099
|
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
|
|
3100
3100
|
var _document_activeElement;
|
|
3101
|
-
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement ===
|
|
3101
|
+
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
|
|
3102
3102
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
3103
3103
|
var _anchorRect_top;
|
|
3104
3104
|
// Anchor from the top if the offset is in the top half of the scrollable element,
|
|
3105
3105
|
// otherwise anchor from the bottom.
|
|
3106
3106
|
anchor = {
|
|
3107
3107
|
type: 'top',
|
|
3108
|
-
offset: ((_anchorRect_top = anchorRect === null || anchorRect ===
|
|
3108
|
+
offset: ((_anchorRect_top = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top
|
|
3109
3109
|
};
|
|
3110
3110
|
if (anchor.offset > scrollRect.height / 2) {
|
|
3111
3111
|
anchor.type = 'bottom';
|
|
3112
3112
|
var _anchorRect_bottom;
|
|
3113
|
-
anchor.offset = ((_anchorRect_bottom = anchorRect === null || anchorRect ===
|
|
3113
|
+
anchor.offset = ((_anchorRect_bottom = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom;
|
|
3114
3114
|
}
|
|
3115
3115
|
}
|
|
3116
3116
|
// Always reset the overlay's previous max height if not defined by the user so that we can compensate for
|
|
@@ -3121,7 +3121,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3121
3121
|
overlay.style.top = '0px';
|
|
3122
3122
|
overlay.style.bottom = '';
|
|
3123
3123
|
var _window_visualViewport_height;
|
|
3124
|
-
overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport ===
|
|
3124
|
+
overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.height) !== null && _window_visualViewport_height !== void 0 ? _window_visualViewport_height : window.innerHeight) + 'px';
|
|
3125
3125
|
}
|
|
3126
3126
|
let position = ($edcf132a9284368a$export$b3ceb0cbf1056d98)({
|
|
3127
3127
|
placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
|
|
@@ -3134,7 +3134,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3134
3134
|
offset: offset,
|
|
3135
3135
|
crossOffset: crossOffset,
|
|
3136
3136
|
maxHeight: maxHeight,
|
|
3137
|
-
arrowSize: arrowSize !== null && arrowSize !==
|
|
3137
|
+
arrowSize: arrowSize !== null && arrowSize !== void 0 ? arrowSize : (arrowRef === null || arrowRef === void 0 ? void 0 : arrowRef.current) ? ($edcf132a9284368a$export$4b834cebd9e5cebe)(arrowRef.current, true).width : 0,
|
|
3138
3138
|
arrowBoundaryOffset: arrowBoundaryOffset
|
|
3139
3139
|
});
|
|
3140
3140
|
if (!position.position) return;
|
|
@@ -3190,17 +3190,17 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3190
3190
|
let onScroll = ()=>{
|
|
3191
3191
|
if (isResizing.current) onResize();
|
|
3192
3192
|
};
|
|
3193
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3194
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3193
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener('resize', onResize);
|
|
3194
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener('scroll', onScroll);
|
|
3195
3195
|
return ()=>{
|
|
3196
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3197
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport ===
|
|
3196
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener('resize', onResize);
|
|
3197
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener('scroll', onScroll);
|
|
3198
3198
|
};
|
|
3199
3199
|
}, [
|
|
3200
3200
|
updatePosition
|
|
3201
3201
|
]);
|
|
3202
3202
|
let close = (useCallback)(()=>{
|
|
3203
|
-
if (!isResizing.current) onClose === null || onClose ===
|
|
3203
|
+
if (!isResizing.current) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3204
3204
|
}, [
|
|
3205
3205
|
onClose,
|
|
3206
3206
|
isResizing
|
|
@@ -3220,18 +3220,18 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
3220
3220
|
top: !position ? 0 : undefined,
|
|
3221
3221
|
left: !position ? 0 : undefined,
|
|
3222
3222
|
zIndex: 100000,
|
|
3223
|
-
...position === null || position ===
|
|
3224
|
-
maxHeight: (_position_maxHeight = position === null || position ===
|
|
3223
|
+
...position === null || position === void 0 ? void 0 : position.position,
|
|
3224
|
+
maxHeight: (_position_maxHeight = position === null || position === void 0 ? void 0 : position.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : '100vh'
|
|
3225
3225
|
}
|
|
3226
3226
|
},
|
|
3227
|
-
placement: (_position_placement = position === null || position ===
|
|
3228
|
-
triggerAnchorPoint: (_position_triggerAnchorPoint = position === null || position ===
|
|
3227
|
+
placement: (_position_placement = position === null || position === void 0 ? void 0 : position.placement) !== null && _position_placement !== void 0 ? _position_placement : null,
|
|
3228
|
+
triggerAnchorPoint: (_position_triggerAnchorPoint = position === null || position === void 0 ? void 0 : position.triggerAnchorPoint) !== null && _position_triggerAnchorPoint !== void 0 ? _position_triggerAnchorPoint : null,
|
|
3229
3229
|
arrowProps: {
|
|
3230
3230
|
'aria-hidden': 'true',
|
|
3231
3231
|
role: 'presentation',
|
|
3232
3232
|
style: {
|
|
3233
|
-
left: position === null || position ===
|
|
3234
|
-
top: position === null || position ===
|
|
3233
|
+
left: position === null || position === void 0 ? void 0 : position.arrowOffsetLeft,
|
|
3234
|
+
top: position === null || position === void 0 ? void 0 : position.arrowOffsetTop
|
|
3235
3235
|
}
|
|
3236
3236
|
},
|
|
3237
3237
|
updatePosition: updatePosition
|
|
@@ -3296,9 +3296,6 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
3296
3296
|
}
|
|
3297
3297
|
};
|
|
3298
3298
|
}, []);
|
|
3299
|
-
let dispatchBlur = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
3300
|
-
onBlur === null || onBlur === undefined ? undefined : onBlur(e);
|
|
3301
|
-
});
|
|
3302
3299
|
// This function is called during a React onFocus event.
|
|
3303
3300
|
return (useCallback)((e)=>{
|
|
3304
3301
|
// React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
|
|
@@ -3313,7 +3310,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
3313
3310
|
if (target.disabled) {
|
|
3314
3311
|
// For backward compatibility, dispatch a (fake) React synthetic event.
|
|
3315
3312
|
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e);
|
|
3316
|
-
|
|
3313
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
3317
3314
|
}
|
|
3318
3315
|
// We no longer need the MutationObserver once the target is blurred.
|
|
3319
3316
|
if (stateRef.current.observer) {
|
|
@@ -3327,7 +3324,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
3327
3324
|
stateRef.current.observer = new MutationObserver(()=>{
|
|
3328
3325
|
if (stateRef.current.isFocused && target.disabled) {
|
|
3329
3326
|
var _stateRef_current_observer;
|
|
3330
|
-
(_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer ===
|
|
3327
|
+
(_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
|
|
3331
3328
|
let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
|
|
3332
3329
|
target.dispatchEvent(new FocusEvent('blur', {
|
|
3333
3330
|
relatedTarget: relatedTargetEl
|
|
@@ -3346,7 +3343,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
3346
3343
|
});
|
|
3347
3344
|
}
|
|
3348
3345
|
}, [
|
|
3349
|
-
|
|
3346
|
+
onBlur
|
|
3350
3347
|
]);
|
|
3351
3348
|
}
|
|
3352
3349
|
let $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
|
|
@@ -3566,12 +3563,12 @@ class $f6c31cce2adf654f$var$PressEvent {
|
|
|
3566
3563
|
constructor(type, pointerType, originalEvent, state){
|
|
3567
3564
|
(_class_private_field_init)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
|
|
3568
3565
|
writable: true,
|
|
3569
|
-
value:
|
|
3566
|
+
value: void 0
|
|
3570
3567
|
});
|
|
3571
3568
|
(_class_private_field_set)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, true);
|
|
3572
3569
|
var _state_target;
|
|
3573
|
-
let currentTarget = (_state_target = state === null || state ===
|
|
3574
|
-
const rect = currentTarget === null || currentTarget ===
|
|
3570
|
+
let currentTarget = (_state_target = state === null || state === void 0 ? void 0 : state.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget;
|
|
3571
|
+
const rect = currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.getBoundingClientRect();
|
|
3575
3572
|
let x, y = 0;
|
|
3576
3573
|
let clientX, clientY = null;
|
|
3577
3574
|
if (originalEvent.clientX != null && originalEvent.clientY != null) {
|
|
@@ -3615,8 +3612,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3615
3612
|
pointerType: null,
|
|
3616
3613
|
disposables: []
|
|
3617
3614
|
});
|
|
3618
|
-
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
3619
|
-
let triggerPressStart = (
|
|
3615
|
+
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners, removeGlobalListener: removeGlobalListener } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
3616
|
+
let triggerPressStart = (useCallback)((originalEvent, pointerType)=>{
|
|
3620
3617
|
let state = ref.current;
|
|
3621
3618
|
if (isDisabled || state.didFirePressStart) return false;
|
|
3622
3619
|
let shouldStopPropagation = true;
|
|
@@ -3631,8 +3628,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3631
3628
|
state.didFirePressStart = true;
|
|
3632
3629
|
setPressed(true);
|
|
3633
3630
|
return shouldStopPropagation;
|
|
3634
|
-
}
|
|
3635
|
-
|
|
3631
|
+
}, [
|
|
3632
|
+
isDisabled,
|
|
3633
|
+
onPressStart,
|
|
3634
|
+
onPressChange
|
|
3635
|
+
]);
|
|
3636
|
+
let triggerPressEnd = (useCallback)((originalEvent, pointerType, wasPressed = true)=>{
|
|
3636
3637
|
let state = ref.current;
|
|
3637
3638
|
if (!state.didFirePressStart) return false;
|
|
3638
3639
|
state.didFirePressStart = false;
|
|
@@ -3652,8 +3653,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3652
3653
|
}
|
|
3653
3654
|
state.isTriggeringEvent = false;
|
|
3654
3655
|
return shouldStopPropagation;
|
|
3655
|
-
}
|
|
3656
|
-
|
|
3656
|
+
}, [
|
|
3657
|
+
isDisabled,
|
|
3658
|
+
onPressEnd,
|
|
3659
|
+
onPressChange,
|
|
3660
|
+
onPress
|
|
3661
|
+
]);
|
|
3662
|
+
let triggerPressEndEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressEnd);
|
|
3663
|
+
let triggerPressUp = (useCallback)((originalEvent, pointerType)=>{
|
|
3657
3664
|
let state = ref.current;
|
|
3658
3665
|
if (isDisabled) return false;
|
|
3659
3666
|
if (onPressUp) {
|
|
@@ -3664,12 +3671,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3664
3671
|
return event.shouldStopPropagation;
|
|
3665
3672
|
}
|
|
3666
3673
|
return true;
|
|
3667
|
-
}
|
|
3668
|
-
|
|
3674
|
+
}, [
|
|
3675
|
+
isDisabled,
|
|
3676
|
+
onPressUp
|
|
3677
|
+
]);
|
|
3678
|
+
let triggerPressUpEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressUp);
|
|
3679
|
+
let cancel = (useCallback)((e)=>{
|
|
3669
3680
|
let state = ref.current;
|
|
3670
3681
|
if (state.isPressed && state.target) {
|
|
3671
3682
|
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
3672
3683
|
state.isPressed = false;
|
|
3684
|
+
setIsPointerPressed(null);
|
|
3673
3685
|
state.isOverTarget = false;
|
|
3674
3686
|
state.activePointerId = null;
|
|
3675
3687
|
state.pointerType = null;
|
|
@@ -3678,15 +3690,26 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3678
3690
|
for (let dispose of state.disposables)dispose();
|
|
3679
3691
|
state.disposables = [];
|
|
3680
3692
|
}
|
|
3681
|
-
}
|
|
3682
|
-
|
|
3693
|
+
}, [
|
|
3694
|
+
allowTextSelectionOnPress,
|
|
3695
|
+
removeAllGlobalListeners,
|
|
3696
|
+
triggerPressEnd
|
|
3697
|
+
]);
|
|
3698
|
+
let cancelEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(cancel);
|
|
3699
|
+
let cancelOnPointerExit = (useCallback)((e)=>{
|
|
3683
3700
|
if (shouldCancelOnPointerExit) cancel(e);
|
|
3684
|
-
}
|
|
3685
|
-
|
|
3701
|
+
}, [
|
|
3702
|
+
shouldCancelOnPointerExit,
|
|
3703
|
+
cancel
|
|
3704
|
+
]);
|
|
3705
|
+
let triggerClick = (useCallback)((e)=>{
|
|
3686
3706
|
if (isDisabled) return;
|
|
3687
|
-
onClick === null || onClick ===
|
|
3688
|
-
}
|
|
3689
|
-
|
|
3707
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
3708
|
+
}, [
|
|
3709
|
+
isDisabled,
|
|
3710
|
+
onClick
|
|
3711
|
+
]);
|
|
3712
|
+
let triggerSyntheticClick = (useCallback)((e, target)=>{
|
|
3690
3713
|
if (isDisabled) return;
|
|
3691
3714
|
// Some third-party libraries pass in onClick instead of onPress.
|
|
3692
3715
|
// Create a fake mouse event and trigger onClick as well.
|
|
@@ -3698,7 +3721,147 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3698
3721
|
($8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
|
|
3699
3722
|
onClick(($8a9cb279dc87e130$export$525bc4921d56d4a)(event));
|
|
3700
3723
|
}
|
|
3701
|
-
}
|
|
3724
|
+
}, [
|
|
3725
|
+
isDisabled,
|
|
3726
|
+
onClick
|
|
3727
|
+
]);
|
|
3728
|
+
let triggerSyntheticClickEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerSyntheticClick);
|
|
3729
|
+
let [isElemKeyPressed, setIsElemKeyPressed] = (useState)(false);
|
|
3730
|
+
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
3731
|
+
let state = ref.current;
|
|
3732
|
+
if (isElemKeyPressed) {
|
|
3733
|
+
let onKeyUp = (e)=>{
|
|
3734
|
+
var _state_metaKeyEvents;
|
|
3735
|
+
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
3736
|
+
var _state_metaKeyEvents1;
|
|
3737
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
3738
|
+
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
3739
|
+
let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e));
|
|
3740
|
+
triggerPressEndEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
3741
|
+
if (wasPressed) triggerSyntheticClickEvent(e, state.target);
|
|
3742
|
+
removeAllGlobalListeners();
|
|
3743
|
+
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
3744
|
+
// This means the link has a role override, and the default browser behavior
|
|
3745
|
+
// only applies when using the Enter key.
|
|
3746
|
+
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
3747
|
+
// Store a hidden property on the event so we only trigger link click once,
|
|
3748
|
+
// even if there are multiple usePress instances attached to the element.
|
|
3749
|
+
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
3750
|
+
($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
3751
|
+
}
|
|
3752
|
+
state.isPressed = false;
|
|
3753
|
+
setIsElemKeyPressed(false);
|
|
3754
|
+
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
|
|
3755
|
+
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
|
|
3756
|
+
var _state_target;
|
|
3757
|
+
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
3758
|
+
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
3759
|
+
// See comment above for more info about the macOS bug causing this.
|
|
3760
|
+
let events = state.metaKeyEvents;
|
|
3761
|
+
state.metaKeyEvents = undefined;
|
|
3762
|
+
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
// Focus may move before the key up event, so register the event on the document
|
|
3766
|
+
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
3767
|
+
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
3768
|
+
let originalTarget = state.target;
|
|
3769
|
+
let pressUp = (e)=>{
|
|
3770
|
+
if (originalTarget && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUpEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
3771
|
+
};
|
|
3772
|
+
let listener = ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp);
|
|
3773
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
3774
|
+
return ()=>{
|
|
3775
|
+
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
3776
|
+
};
|
|
3777
|
+
}
|
|
3778
|
+
}, [
|
|
3779
|
+
isElemKeyPressed,
|
|
3780
|
+
addGlobalListener,
|
|
3781
|
+
removeAllGlobalListeners,
|
|
3782
|
+
removeGlobalListener
|
|
3783
|
+
]);
|
|
3784
|
+
let [isPointerPressed, setIsPointerPressed] = (useState)(null);
|
|
3785
|
+
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
3786
|
+
let state = ref.current;
|
|
3787
|
+
if (isPointerPressed === 'pointer') {
|
|
3788
|
+
let onPointerUp = (e)=>{
|
|
3789
|
+
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
3790
|
+
if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
3791
|
+
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
3792
|
+
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
3793
|
+
// https://github.com/adobe/react-spectrum/issues/1513
|
|
3794
|
+
// https://issues.chromium.org/issues/40732224
|
|
3795
|
+
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
3796
|
+
// We work around this by triggering a click ourselves after a timeout.
|
|
3797
|
+
// This timeout is canceled during the click event in case the real one fires first.
|
|
3798
|
+
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
3799
|
+
// non-form elements without certain ARIA roles (for hover emulation).
|
|
3800
|
+
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
3801
|
+
let clicked = false;
|
|
3802
|
+
let timeout = setTimeout(()=>{
|
|
3803
|
+
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
3804
|
+
if (clicked) cancelEvent(e);
|
|
3805
|
+
else {
|
|
3806
|
+
($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
3807
|
+
state.target.click();
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
}, 80);
|
|
3811
|
+
// Use a capturing listener to track if a click occurred.
|
|
3812
|
+
// If stopPropagation is called it may never reach our handler.
|
|
3813
|
+
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
3814
|
+
state.disposables.push(()=>clearTimeout(timeout));
|
|
3815
|
+
} else cancelEvent(e);
|
|
3816
|
+
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
3817
|
+
state.isOverTarget = false;
|
|
3818
|
+
}
|
|
3819
|
+
};
|
|
3820
|
+
let onPointerCancel = (e)=>{
|
|
3821
|
+
cancelEvent(e);
|
|
3822
|
+
};
|
|
3823
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
3824
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
3825
|
+
return ()=>{
|
|
3826
|
+
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
3827
|
+
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
3828
|
+
};
|
|
3829
|
+
} else if (isPointerPressed === 'mouse' && process.env.NODE_ENV === 'test') {
|
|
3830
|
+
let onMouseUp = (e)=>{
|
|
3831
|
+
// Only handle left clicks
|
|
3832
|
+
if (e.button !== 0) return;
|
|
3833
|
+
if (state.ignoreEmulatedMouseEvents) {
|
|
3834
|
+
state.ignoreEmulatedMouseEvents = false;
|
|
3835
|
+
return;
|
|
3836
|
+
}
|
|
3837
|
+
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
|
|
3838
|
+
else cancelEvent(e);
|
|
3839
|
+
state.isOverTarget = false;
|
|
3840
|
+
};
|
|
3841
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
3842
|
+
return ()=>{
|
|
3843
|
+
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
3844
|
+
};
|
|
3845
|
+
} else if (isPointerPressed === 'touch' && process.env.NODE_ENV === 'test') {
|
|
3846
|
+
let onScroll = (e)=>{
|
|
3847
|
+
if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancelEvent({
|
|
3848
|
+
currentTarget: state.target,
|
|
3849
|
+
shiftKey: false,
|
|
3850
|
+
ctrlKey: false,
|
|
3851
|
+
metaKey: false,
|
|
3852
|
+
altKey: false
|
|
3853
|
+
});
|
|
3854
|
+
};
|
|
3855
|
+
addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
3856
|
+
return ()=>{
|
|
3857
|
+
removeGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
3858
|
+
};
|
|
3859
|
+
}
|
|
3860
|
+
}, [
|
|
3861
|
+
isPointerPressed,
|
|
3862
|
+
addGlobalListener,
|
|
3863
|
+
removeGlobalListener
|
|
3864
|
+
]);
|
|
3702
3865
|
let pressProps = (useMemo)(()=>{
|
|
3703
3866
|
let state = ref.current;
|
|
3704
3867
|
let pressProps = {
|
|
@@ -3713,16 +3876,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3713
3876
|
if (!state.isPressed && !e.repeat) {
|
|
3714
3877
|
state.target = e.currentTarget;
|
|
3715
3878
|
state.isPressed = true;
|
|
3879
|
+
setIsElemKeyPressed(true);
|
|
3716
3880
|
state.pointerType = 'keyboard';
|
|
3717
3881
|
shouldStopPropagation = triggerPressStart(e, 'keyboard');
|
|
3718
|
-
// Focus may move before the key up event, so register the event on the document
|
|
3719
|
-
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
3720
|
-
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
3721
|
-
let originalTarget = e.currentTarget;
|
|
3722
|
-
let pressUp = (e)=>{
|
|
3723
|
-
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
3724
|
-
};
|
|
3725
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'keyup', ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
|
|
3726
3882
|
}
|
|
3727
3883
|
if (shouldStopPropagation) e.stopPropagation();
|
|
3728
3884
|
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
|
|
@@ -3732,7 +3888,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3732
3888
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1393524
|
|
3733
3889
|
// https://bugs.webkit.org/show_bug.cgi?id=55291
|
|
3734
3890
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
|
|
3735
|
-
if (e.metaKey && ($c87311424ea30a05$export$9ac100e40613ea10)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents ===
|
|
3891
|
+
if (e.metaKey && ($c87311424ea30a05$export$9ac100e40613ea10)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
|
|
3736
3892
|
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
|
|
3737
3893
|
},
|
|
3738
3894
|
onClick (e) {
|
|
@@ -3762,37 +3918,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3762
3918
|
}
|
|
3763
3919
|
}
|
|
3764
3920
|
};
|
|
3765
|
-
let onKeyUp = (e)=>{
|
|
3766
|
-
var _state_metaKeyEvents;
|
|
3767
|
-
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
3768
|
-
var _state_metaKeyEvents1;
|
|
3769
|
-
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
3770
|
-
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
3771
|
-
let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e));
|
|
3772
|
-
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
3773
|
-
if (wasPressed) triggerSyntheticClick(e, state.target);
|
|
3774
|
-
removeAllGlobalListeners();
|
|
3775
|
-
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
3776
|
-
// This means the link has a role override, and the default browser behavior
|
|
3777
|
-
// only applies when using the Enter key.
|
|
3778
|
-
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
3779
|
-
// Store a hidden property on the event so we only trigger link click once,
|
|
3780
|
-
// even if there are multiple usePress instances attached to the element.
|
|
3781
|
-
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
3782
|
-
($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
3783
|
-
}
|
|
3784
|
-
state.isPressed = false;
|
|
3785
|
-
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === undefined ? undefined : _state_metaKeyEvents1.delete(e.key);
|
|
3786
|
-
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === undefined ? undefined : _state_metaKeyEvents.size)) {
|
|
3787
|
-
var _state_target;
|
|
3788
|
-
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
3789
|
-
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
3790
|
-
// See comment above for more info about the macOS bug causing this.
|
|
3791
|
-
let events = state.metaKeyEvents;
|
|
3792
|
-
state.metaKeyEvents = undefined;
|
|
3793
|
-
for (let event of events.values())(_state_target = state.target) === null || _state_target === undefined ? undefined : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
3794
|
-
}
|
|
3795
|
-
};
|
|
3796
3921
|
if (typeof PointerEvent !== 'undefined') {
|
|
3797
3922
|
pressProps.onPointerDown = (e)=>{
|
|
3798
3923
|
// Only handle left clicks, and ignore events that bubbled through portals.
|
|
@@ -3809,6 +3934,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3809
3934
|
let shouldStopPropagation = true;
|
|
3810
3935
|
if (!state.isPressed) {
|
|
3811
3936
|
state.isPressed = true;
|
|
3937
|
+
setIsPointerPressed('pointer');
|
|
3812
3938
|
state.isOverTarget = true;
|
|
3813
3939
|
state.activePointerId = e.pointerId;
|
|
3814
3940
|
state.target = e.currentTarget;
|
|
@@ -3818,8 +3944,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3818
3944
|
// This enables onPointerLeave and onPointerEnter to fire.
|
|
3819
3945
|
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent);
|
|
3820
3946
|
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId);
|
|
3821
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointerup', onPointerUp, false);
|
|
3822
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointercancel', onPointerCancel, false);
|
|
3823
3947
|
}
|
|
3824
3948
|
if (shouldStopPropagation) e.stopPropagation();
|
|
3825
3949
|
};
|
|
@@ -3852,41 +3976,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3852
3976
|
cancelOnPointerExit(e);
|
|
3853
3977
|
}
|
|
3854
3978
|
};
|
|
3855
|
-
let onPointerUp = (e)=>{
|
|
3856
|
-
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
3857
|
-
if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
3858
|
-
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
3859
|
-
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
3860
|
-
// https://github.com/adobe/react-spectrum/issues/1513
|
|
3861
|
-
// https://issues.chromium.org/issues/40732224
|
|
3862
|
-
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
3863
|
-
// We work around this by triggering a click ourselves after a timeout.
|
|
3864
|
-
// This timeout is canceled during the click event in case the real one fires first.
|
|
3865
|
-
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
3866
|
-
// non-form elements without certain ARIA roles (for hover emulation).
|
|
3867
|
-
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
3868
|
-
let clicked = false;
|
|
3869
|
-
let timeout = setTimeout(()=>{
|
|
3870
|
-
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
3871
|
-
if (clicked) cancel(e);
|
|
3872
|
-
else {
|
|
3873
|
-
($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
3874
|
-
state.target.click();
|
|
3875
|
-
}
|
|
3876
|
-
}
|
|
3877
|
-
}, 80);
|
|
3878
|
-
// Use a capturing listener to track if a click occurred.
|
|
3879
|
-
// If stopPropagation is called it may never reach our handler.
|
|
3880
|
-
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
3881
|
-
state.disposables.push(()=>clearTimeout(timeout));
|
|
3882
|
-
} else cancel(e);
|
|
3883
|
-
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
3884
|
-
state.isOverTarget = false;
|
|
3885
|
-
}
|
|
3886
|
-
};
|
|
3887
|
-
let onPointerCancel = (e)=>{
|
|
3888
|
-
cancel(e);
|
|
3889
|
-
};
|
|
3890
3979
|
pressProps.onDragStart = (e)=>{
|
|
3891
3980
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
3892
3981
|
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
|
|
@@ -3903,6 +3992,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3903
3992
|
return;
|
|
3904
3993
|
}
|
|
3905
3994
|
state.isPressed = true;
|
|
3995
|
+
setIsPointerPressed('mouse');
|
|
3906
3996
|
state.isOverTarget = true;
|
|
3907
3997
|
state.target = e.currentTarget;
|
|
3908
3998
|
state.pointerType = ($6a7db85432448f7f$export$60278871457622de)(e.nativeEvent) ? 'virtual' : 'mouse';
|
|
@@ -3913,7 +4003,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3913
4003
|
let dispose = ($8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
|
|
3914
4004
|
if (dispose) state.disposables.push(dispose);
|
|
3915
4005
|
}
|
|
3916
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'mouseup', onMouseUp, false);
|
|
3917
4006
|
};
|
|
3918
4007
|
pressProps.onMouseEnter = (e)=>{
|
|
3919
4008
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
@@ -3938,17 +4027,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3938
4027
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
3939
4028
|
if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || 'mouse');
|
|
3940
4029
|
};
|
|
3941
|
-
let onMouseUp = (e)=>{
|
|
3942
|
-
// Only handle left clicks
|
|
3943
|
-
if (e.button !== 0) return;
|
|
3944
|
-
if (state.ignoreEmulatedMouseEvents) {
|
|
3945
|
-
state.ignoreEmulatedMouseEvents = false;
|
|
3946
|
-
return;
|
|
3947
|
-
}
|
|
3948
|
-
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
|
|
3949
|
-
else cancel(e);
|
|
3950
|
-
state.isOverTarget = false;
|
|
3951
|
-
};
|
|
3952
4030
|
pressProps.onTouchStart = (e)=>{
|
|
3953
4031
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
3954
4032
|
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
|
|
@@ -3957,12 +4035,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3957
4035
|
state.ignoreEmulatedMouseEvents = true;
|
|
3958
4036
|
state.isOverTarget = true;
|
|
3959
4037
|
state.isPressed = true;
|
|
4038
|
+
setIsPointerPressed('touch');
|
|
3960
4039
|
state.target = e.currentTarget;
|
|
3961
4040
|
state.pointerType = 'touch';
|
|
3962
4041
|
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$16a4697467175487)(state.target);
|
|
3963
4042
|
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
|
|
3964
4043
|
if (shouldStopPropagation) e.stopPropagation();
|
|
3965
|
-
addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(e.currentTarget), 'scroll', onScroll, true);
|
|
3966
4044
|
};
|
|
3967
4045
|
pressProps.onTouchMove = (e)=>{
|
|
3968
4046
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
@@ -3999,6 +4077,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3999
4077
|
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
|
|
4000
4078
|
if (shouldStopPropagation) e.stopPropagation();
|
|
4001
4079
|
state.isPressed = false;
|
|
4080
|
+
setIsPointerPressed(null);
|
|
4002
4081
|
state.activePointerId = null;
|
|
4003
4082
|
state.isOverTarget = false;
|
|
4004
4083
|
state.ignoreEmulatedMouseEvents = true;
|
|
@@ -4010,15 +4089,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4010
4089
|
e.stopPropagation();
|
|
4011
4090
|
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
|
|
4012
4091
|
};
|
|
4013
|
-
let onScroll = (e)=>{
|
|
4014
|
-
if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancel({
|
|
4015
|
-
currentTarget: state.target,
|
|
4016
|
-
shiftKey: false,
|
|
4017
|
-
ctrlKey: false,
|
|
4018
|
-
metaKey: false,
|
|
4019
|
-
altKey: false
|
|
4020
|
-
});
|
|
4021
|
-
};
|
|
4022
4092
|
pressProps.onDragStart = (e)=>{
|
|
4023
4093
|
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
4024
4094
|
cancel(e);
|
|
@@ -4026,7 +4096,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4026
4096
|
}
|
|
4027
4097
|
return pressProps;
|
|
4028
4098
|
}, [
|
|
4029
|
-
addGlobalListener,
|
|
4030
4099
|
isDisabled,
|
|
4031
4100
|
preventFocusOnPress,
|
|
4032
4101
|
removeAllGlobalListeners,
|
|
@@ -4065,7 +4134,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
4065
4134
|
let state = ref.current;
|
|
4066
4135
|
return ()=>{
|
|
4067
4136
|
var _state_target;
|
|
4068
|
-
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$b0d6fa1ab32e3295)((_state_target = state.target) !== null && _state_target !==
|
|
4137
|
+
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$b0d6fa1ab32e3295)((_state_target = state.target) !== null && _state_target !== void 0 ? _state_target : undefined);
|
|
4069
4138
|
for (let dispose of state.disposables)dispose();
|
|
4070
4139
|
state.disposables = [];
|
|
4071
4140
|
};
|
|
@@ -4225,20 +4294,21 @@ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
|
|
|
4225
4294
|
}
|
|
4226
4295
|
function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
|
|
4227
4296
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
4228
|
-
if ($507fabe10e71c6fb$var$isValidKey(e)) {
|
|
4297
|
+
if (!($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening && $507fabe10e71c6fb$var$isValidKey(e)) {
|
|
4229
4298
|
$507fabe10e71c6fb$var$currentModality = 'keyboard';
|
|
4230
4299
|
$507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
|
|
4231
4300
|
}
|
|
4232
4301
|
}
|
|
4233
4302
|
function $507fabe10e71c6fb$var$handlePointerEvent(e) {
|
|
4234
4303
|
$507fabe10e71c6fb$var$currentModality = 'pointer';
|
|
4304
|
+
'pointerType' in e ? e.pointerType : 'mouse';
|
|
4235
4305
|
if (e.type === 'mousedown' || e.type === 'pointerdown') {
|
|
4236
4306
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
4237
4307
|
$507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
|
|
4238
4308
|
}
|
|
4239
4309
|
}
|
|
4240
4310
|
function $507fabe10e71c6fb$var$handleClickEvent(e) {
|
|
4241
|
-
if (($6a7db85432448f7f$export$60278871457622de)(e)) {
|
|
4311
|
+
if (!($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening && ($6a7db85432448f7f$export$60278871457622de)(e)) {
|
|
4242
4312
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
4243
4313
|
$507fabe10e71c6fb$var$currentModality = 'virtual';
|
|
4244
4314
|
}
|
|
@@ -4381,11 +4451,11 @@ const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
|
|
|
4381
4451
|
* If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
|
|
4382
4452
|
* focus visible style can be properly set.
|
|
4383
4453
|
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
|
|
4384
|
-
let document1 = ($431fbd86ca7dc216$export$b204af158042fbac)(e === null || e ===
|
|
4385
|
-
const IHTMLInputElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e ===
|
|
4386
|
-
const IHTMLTextAreaElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e ===
|
|
4387
|
-
const IHTMLElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e ===
|
|
4388
|
-
const IKeyboardEvent = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e ===
|
|
4454
|
+
let document1 = ($431fbd86ca7dc216$export$b204af158042fbac)(e === null || e === void 0 ? void 0 : e.target);
|
|
4455
|
+
const IHTMLInputElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
|
|
4456
|
+
const IHTMLTextAreaElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
|
|
4457
|
+
const IHTMLElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
|
|
4458
|
+
const IKeyboardEvent = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
|
|
4389
4459
|
// For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)
|
|
4390
4460
|
// we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element
|
|
4391
4461
|
isTextInput = isTextInput || document1.activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(document1.activeElement.type) || document1.activeElement instanceof IHTMLTextAreaElement || document1.activeElement instanceof IHTMLElement && document1.activeElement.isContentEditable;
|
|
@@ -4396,7 +4466,7 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
|
4396
4466
|
(useEffect)(()=>{
|
|
4397
4467
|
let handler = (modality, e)=>{
|
|
4398
4468
|
// We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape
|
|
4399
|
-
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts ===
|
|
4469
|
+
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
|
|
4400
4470
|
fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
|
|
4401
4471
|
};
|
|
4402
4472
|
$507fabe10e71c6fb$var$changeHandlers.add(handler);
|
|
@@ -4426,12 +4496,12 @@ function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
|
|
|
4426
4496
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
4427
4497
|
// from off the screen.
|
|
4428
4498
|
const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
4429
|
-
const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
4430
4499
|
if (($507fabe10e71c6fb$export$630ff653c5ada6a9)() === 'virtual') {
|
|
4431
|
-
let lastFocusedElement =
|
|
4500
|
+
let lastFocusedElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
4432
4501
|
($bbed8b41f857bcc0$export$24490316f764c430)(()=>{
|
|
4433
|
-
|
|
4434
|
-
|
|
4502
|
+
const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
4503
|
+
// If focus did not move or focus was lost to the body, and the element is still in the document, focus it.
|
|
4504
|
+
if ((activeElement === lastFocusedElement || activeElement === ownerDocument.body) && element.isConnected) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
4435
4505
|
});
|
|
4436
4506
|
} else ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
4437
4507
|
}
|
|
@@ -4621,7 +4691,7 @@ function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) {
|
|
|
4621
4691
|
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ ($dbSRa$react).forwardRef(({ children: children, ...props }, ref)=>{
|
|
4622
4692
|
let isRegistered = (useRef)(false);
|
|
4623
4693
|
let prevContext = (useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
|
|
4624
|
-
ref = ($df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext ===
|
|
4694
|
+
ref = ($df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
|
|
4625
4695
|
let context = ($3ef42575df84b30b$export$9d1611c77c2fe928)(prevContext || {}, {
|
|
4626
4696
|
...props,
|
|
4627
4697
|
ref: ref,
|
|
@@ -4966,9 +5036,7 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
4966
5036
|
}
|
|
4967
5037
|
}, [
|
|
4968
5038
|
ref,
|
|
4969
|
-
isDisabled
|
|
4970
|
-
onPointerDown,
|
|
4971
|
-
triggerInteractOutside
|
|
5039
|
+
isDisabled
|
|
4972
5040
|
]);
|
|
4973
5041
|
}
|
|
4974
5042
|
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
@@ -5116,7 +5184,7 @@ function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
|
5116
5184
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
5117
5185
|
var _startRef_current;
|
|
5118
5186
|
// Find all rendered nodes between the sentinels and add them to the scope.
|
|
5119
|
-
let node = (_startRef_current = startRef.current) === null || _startRef_current ===
|
|
5187
|
+
let node = (_startRef_current = startRef.current) === null || _startRef_current === void 0 ? void 0 : _startRef_current.nextSibling;
|
|
5120
5188
|
let nodes = [];
|
|
5121
5189
|
let stopPropagation = (e)=>e.stopPropagation();
|
|
5122
5190
|
while(node && node !== endRef.current){
|
|
@@ -5157,7 +5225,7 @@ function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
|
5157
5225
|
var _focusScopeTree_getTreeNode_parent, _focusScopeTree_getTreeNode;
|
|
5158
5226
|
var _focusScopeTree_getTreeNode_parent_scopeRef;
|
|
5159
5227
|
// Scope may have been re-parented.
|
|
5160
|
-
let parentScope = (_focusScopeTree_getTreeNode_parent_scopeRef = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) === null || _focusScopeTree_getTreeNode ===
|
|
5228
|
+
let parentScope = (_focusScopeTree_getTreeNode_parent_scopeRef = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : (_focusScopeTree_getTreeNode_parent = _focusScopeTree_getTreeNode.parent) === null || _focusScopeTree_getTreeNode_parent === void 0 ? void 0 : _focusScopeTree_getTreeNode_parent.scopeRef) !== null && _focusScopeTree_getTreeNode_parent_scopeRef !== void 0 ? _focusScopeTree_getTreeNode_parent_scopeRef : null;
|
|
5161
5229
|
if ((scopeRef === $9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope(scopeRef, $9bf71ea28793e738$var$activeScope)) && (!parentScope || $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parentScope))) $9bf71ea28793e738$var$activeScope = parentScope;
|
|
5162
5230
|
$9bf71ea28793e738$export$d06fae2ee68b101e.removeTreeNode(scopeRef);
|
|
5163
5231
|
};
|
|
@@ -5190,7 +5258,7 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
5190
5258
|
let scope = scopeRef.current;
|
|
5191
5259
|
let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
|
|
5192
5260
|
var _scope_;
|
|
5193
|
-
let node = from || ($d4ee10de306f2510$export$cd4e5573fbe2b576)(($431fbd86ca7dc216$export$b204af158042fbac)((_scope_ = scope[0]) !== null && _scope_ !==
|
|
5261
|
+
let node = from || ($d4ee10de306f2510$export$cd4e5573fbe2b576)(($431fbd86ca7dc216$export$b204af158042fbac)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
|
|
5194
5262
|
let sentinel = scope[0].previousElementSibling;
|
|
5195
5263
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
5196
5264
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {
|
|
@@ -5210,7 +5278,7 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
5210
5278
|
let scope = scopeRef.current;
|
|
5211
5279
|
let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
|
|
5212
5280
|
var _scope_;
|
|
5213
|
-
let node = from || ($d4ee10de306f2510$export$cd4e5573fbe2b576)(($431fbd86ca7dc216$export$b204af158042fbac)((_scope_ = scope[0]) !== null && _scope_ !==
|
|
5281
|
+
let node = from || ($d4ee10de306f2510$export$cd4e5573fbe2b576)(($431fbd86ca7dc216$export$b204af158042fbac)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
|
|
5214
5282
|
let sentinel = scope[scope.length - 1].nextElementSibling;
|
|
5215
5283
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
5216
5284
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {
|
|
@@ -5273,9 +5341,9 @@ function $9bf71ea28793e738$var$isTabbableRadio(element) {
|
|
|
5273
5341
|
].filter((radio)=>!radio.form);
|
|
5274
5342
|
else {
|
|
5275
5343
|
var _element_form_elements, _element_form;
|
|
5276
|
-
let radioList = (_element_form = element.form) === null || _element_form ===
|
|
5344
|
+
let radioList = (_element_form = element.form) === null || _element_form === void 0 ? void 0 : (_element_form_elements = _element_form.elements) === null || _element_form_elements === void 0 ? void 0 : _element_form_elements.namedItem(element.name);
|
|
5277
5345
|
radios = [
|
|
5278
|
-
...radioList !== null && radioList !==
|
|
5346
|
+
...radioList !== null && radioList !== void 0 ? radioList : []
|
|
5279
5347
|
];
|
|
5280
5348
|
}
|
|
5281
5349
|
if (!radios) return false;
|
|
@@ -5346,20 +5414,20 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
5346
5414
|
if (target && target.isConnected) {
|
|
5347
5415
|
var _focusedNode_current;
|
|
5348
5416
|
focusedNode.current = target;
|
|
5349
|
-
(_focusedNode_current = focusedNode.current) === null || _focusedNode_current ===
|
|
5417
|
+
(_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();
|
|
5350
5418
|
} else if ($9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);
|
|
5351
5419
|
}
|
|
5352
5420
|
});
|
|
5353
5421
|
};
|
|
5354
5422
|
ownerDocument.addEventListener('keydown', onKeyDown, false);
|
|
5355
5423
|
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
5356
|
-
scope === null || scope ===
|
|
5357
|
-
scope === null || scope ===
|
|
5424
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
5425
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));
|
|
5358
5426
|
return ()=>{
|
|
5359
5427
|
ownerDocument.removeEventListener('keydown', onKeyDown, false);
|
|
5360
5428
|
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
5361
|
-
scope === null || scope ===
|
|
5362
|
-
scope === null || scope ===
|
|
5429
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
5430
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));
|
|
5363
5431
|
};
|
|
5364
5432
|
}, [
|
|
5365
5433
|
scopeRef,
|
|
@@ -5397,7 +5465,7 @@ function $9bf71ea28793e738$export$1258395f99bf9cbf(element) {
|
|
|
5397
5465
|
}
|
|
5398
5466
|
function $9bf71ea28793e738$var$isAncestorScope(ancestor, scope) {
|
|
5399
5467
|
var _focusScopeTree_getTreeNode;
|
|
5400
|
-
let parent = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope)) === null || _focusScopeTree_getTreeNode ===
|
|
5468
|
+
let parent = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : _focusScopeTree_getTreeNode.parent;
|
|
5401
5469
|
while(parent){
|
|
5402
5470
|
if (parent.scopeRef === ancestor) return true;
|
|
5403
5471
|
parent = parent.parent;
|
|
@@ -5464,10 +5532,10 @@ function $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain)
|
|
|
5464
5532
|
else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;
|
|
5465
5533
|
};
|
|
5466
5534
|
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
5467
|
-
scope === null || scope ===
|
|
5535
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
5468
5536
|
return ()=>{
|
|
5469
5537
|
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
5470
|
-
scope === null || scope ===
|
|
5538
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
5471
5539
|
};
|
|
5472
5540
|
}, [
|
|
5473
5541
|
scopeRef,
|
|
@@ -5481,7 +5549,7 @@ function $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {
|
|
|
5481
5549
|
if (scope.nodeToRestore) return false;
|
|
5482
5550
|
scope = scope.parent;
|
|
5483
5551
|
}
|
|
5484
|
-
return (scope === null || scope ===
|
|
5552
|
+
return (scope === null || scope === void 0 ? void 0 : scope.scopeRef) === scopeRef;
|
|
5485
5553
|
}
|
|
5486
5554
|
function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
|
|
5487
5555
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
@@ -5499,10 +5567,10 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
5499
5567
|
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument), scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
5500
5568
|
};
|
|
5501
5569
|
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
5502
|
-
scope === null || scope ===
|
|
5570
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
5503
5571
|
return ()=>{
|
|
5504
5572
|
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
5505
|
-
scope === null || scope ===
|
|
5573
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
5506
5574
|
};
|
|
5507
5575
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5508
5576
|
}, [
|
|
@@ -5567,7 +5635,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
5567
5635
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
5568
5636
|
if (!treeNode) return;
|
|
5569
5637
|
var _nodeToRestoreRef_current;
|
|
5570
|
-
treeNode.nodeToRestore = (_nodeToRestoreRef_current = nodeToRestoreRef.current) !== null && _nodeToRestoreRef_current !==
|
|
5638
|
+
treeNode.nodeToRestore = (_nodeToRestoreRef_current = nodeToRestoreRef.current) !== null && _nodeToRestoreRef_current !== void 0 ? _nodeToRestoreRef_current : undefined;
|
|
5571
5639
|
return ()=>{
|
|
5572
5640
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
5573
5641
|
if (!treeNode) return;
|
|
@@ -5619,9 +5687,9 @@ function $9bf71ea28793e738$var$restoreFocusToElement(node) {
|
|
|
5619
5687
|
}))) $9bf71ea28793e738$var$focusElement(node);
|
|
5620
5688
|
}
|
|
5621
5689
|
function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
5622
|
-
let filter = (opts === null || opts ===
|
|
5690
|
+
let filter = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? ($b4b717babfbb907b$export$bebd5a1431fec25d) : ($b4b717babfbb907b$export$4c063cf1350e6fed);
|
|
5623
5691
|
// Ensure that root is an Element or fall back appropriately
|
|
5624
|
-
let rootElement = (root === null || root ===
|
|
5692
|
+
let rootElement = (root === null || root === void 0 ? void 0 : root.nodeType) === Node.ELEMENT_NODE ? root : null;
|
|
5625
5693
|
// Determine the document to use
|
|
5626
5694
|
let doc = ($431fbd86ca7dc216$export$b204af158042fbac)(rootElement);
|
|
5627
5695
|
// Create a TreeWalker, ensuring the root is an Element or Document
|
|
@@ -5629,18 +5697,18 @@ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
|
5629
5697
|
acceptNode (node) {
|
|
5630
5698
|
var _opts_from;
|
|
5631
5699
|
// Skip nodes inside the starting node.
|
|
5632
|
-
if (opts === null || opts ===
|
|
5633
|
-
if ((opts === null || opts ===
|
|
5700
|
+
if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;
|
|
5701
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {
|
|
5634
5702
|
// If the radio is in a form, we can get all the other radios by name
|
|
5635
5703
|
if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;
|
|
5636
5704
|
// If the radio is in the same group as the current node and none are selected, we can skip it
|
|
5637
5705
|
if (walker.currentNode.tagName === 'INPUT' && walker.currentNode.type === 'radio' && walker.currentNode.name === node.name) return NodeFilter.FILTER_REJECT;
|
|
5638
5706
|
}
|
|
5639
|
-
if (filter(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts ===
|
|
5707
|
+
if (filter(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
|
|
5640
5708
|
return NodeFilter.FILTER_SKIP;
|
|
5641
5709
|
}
|
|
5642
5710
|
});
|
|
5643
|
-
if (opts === null || opts ===
|
|
5711
|
+
if (opts === null || opts === void 0 ? void 0 : opts.from) walker.currentNode = opts.from;
|
|
5644
5712
|
return walker;
|
|
5645
5713
|
}
|
|
5646
5714
|
class $9bf71ea28793e738$var$Tree {
|
|
@@ -5651,7 +5719,7 @@ class $9bf71ea28793e738$var$Tree {
|
|
|
5651
5719
|
return this.fastMap.get(data);
|
|
5652
5720
|
}
|
|
5653
5721
|
addTreeNode(scopeRef, parent, nodeToRestore) {
|
|
5654
|
-
let parentNode = this.fastMap.get(parent !== null && parent !==
|
|
5722
|
+
let parentNode = this.fastMap.get(parent !== null && parent !== void 0 ? parent : null);
|
|
5655
5723
|
if (!parentNode) return;
|
|
5656
5724
|
let node = new $9bf71ea28793e738$var$TreeNode({
|
|
5657
5725
|
scopeRef: scopeRef
|
|
@@ -5689,7 +5757,7 @@ class $9bf71ea28793e738$var$Tree {
|
|
|
5689
5757
|
var _node_parent;
|
|
5690
5758
|
let newTree = new $9bf71ea28793e738$var$Tree();
|
|
5691
5759
|
var _node_parent_scopeRef;
|
|
5692
|
-
for (let node of this.traverse())newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent ===
|
|
5760
|
+
for (let node of this.traverse())newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.scopeRef) !== null && _node_parent_scopeRef !== void 0 ? _node_parent_scopeRef : null, node.nodeToRestore);
|
|
5693
5761
|
return newTree;
|
|
5694
5762
|
}
|
|
5695
5763
|
constructor(){
|
|
@@ -5768,10 +5836,10 @@ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
|
5768
5836
|
|
|
5769
5837
|
|
|
5770
5838
|
function $83013635b024ae3d$export$eac1895992b9f3d6(ref, options) {
|
|
5771
|
-
let isDisabled = options === null || options ===
|
|
5839
|
+
let isDisabled = options === null || options === void 0 ? void 0 : options.isDisabled;
|
|
5772
5840
|
let [hasTabbableChild, setHasTabbableChild] = (useState)(false);
|
|
5773
5841
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
5774
|
-
if ((ref === null || ref ===
|
|
5842
|
+
if ((ref === null || ref === void 0 ? void 0 : ref.current) && !isDisabled) {
|
|
5775
5843
|
let update = ()=>{
|
|
5776
5844
|
if (ref.current) {
|
|
5777
5845
|
let walker = ($9bf71ea28793e738$export$2d6ec8fc375ceafa)(ref.current, {
|
|
@@ -5831,7 +5899,7 @@ function $55f9b1ae81f22853$export$2b35b76d2e30e129(to, from) {
|
|
|
5831
5899
|
}
|
|
5832
5900
|
function $55f9b1ae81f22853$export$759df0d867455a91(document) {
|
|
5833
5901
|
let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(document);
|
|
5834
|
-
let activeDescendant = activeElement === null || activeElement ===
|
|
5902
|
+
let activeDescendant = activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute('aria-activedescendant');
|
|
5835
5903
|
if (activeDescendant) return document.getElementById(activeDescendant) || activeElement;
|
|
5836
5904
|
return activeElement;
|
|
5837
5905
|
}
|
|
@@ -5913,7 +5981,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
5913
5981
|
// do not close the outer overlay. At this point, the active scope should
|
|
5914
5982
|
// still be the outer overlay, since blur events run before focus.
|
|
5915
5983
|
if (!e.relatedTarget || ($9bf71ea28793e738$export$1258395f99bf9cbf)(e.relatedTarget)) return;
|
|
5916
|
-
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose === null || onClose ===
|
|
5984
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
5917
5985
|
}
|
|
5918
5986
|
});
|
|
5919
5987
|
let onPointerDownUnderlay = (e)=>{
|
|
@@ -6093,8 +6161,8 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
6093
6161
|
// the same input again, it is already focused, so no blur event will fire,
|
|
6094
6162
|
// resulting in the flow above never running and Safari's native scrolling occurring.
|
|
6095
6163
|
// Instead, move focus to the parent focusable element (e.g. the dialog).
|
|
6096
|
-
let focusable = (_target_parentElement = target.parentElement) === null || _target_parentElement ===
|
|
6097
|
-
focusable === null || focusable ===
|
|
6164
|
+
let focusable = (_target_parentElement = target.parentElement) === null || _target_parentElement === void 0 ? void 0 : _target_parentElement.closest('[tabindex]');
|
|
6165
|
+
focusable === null || focusable === void 0 ? void 0 : focusable.focus({
|
|
6098
6166
|
preventScroll: true
|
|
6099
6167
|
});
|
|
6100
6168
|
}
|
|
@@ -6190,7 +6258,7 @@ function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
|
6190
6258
|
const $96b38030c423d352$export$60d741e20e0aa309 = /*#__PURE__*/ (createContext)({});
|
|
6191
6259
|
function $96b38030c423d352$export$9fc1347d4195ccb3() {
|
|
6192
6260
|
var _useContext;
|
|
6193
|
-
return (_useContext = (useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !==
|
|
6261
|
+
return (_useContext = (useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
6194
6262
|
}
|
|
6195
6263
|
|
|
6196
6264
|
/*
|
|
@@ -6258,7 +6326,7 @@ function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
|
6258
6326
|
let { getContainer: getContainer } = ($96b38030c423d352$export$9fc1347d4195ccb3)();
|
|
6259
6327
|
if (!props.portalContainer && getContainer) portalContainer = getContainer();
|
|
6260
6328
|
($dbSRa$react).useEffect(()=>{
|
|
6261
|
-
if (portalContainer === null || portalContainer ===
|
|
6329
|
+
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest('[data-overlay-container]')) throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
|
|
6262
6330
|
}, [
|
|
6263
6331
|
portalContainer
|
|
6264
6332
|
]);
|
|
@@ -6620,13 +6688,13 @@ const $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== 'undefined' &
|
|
|
6620
6688
|
let $5e3802645cc19319$var$refCountMap = new WeakMap();
|
|
6621
6689
|
let $5e3802645cc19319$var$observerStack = [];
|
|
6622
6690
|
function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
6623
|
-
let windowObj = ($431fbd86ca7dc216$export$f21a1ffae260145a)(targets === null || targets ===
|
|
6691
|
+
let windowObj = ($431fbd86ca7dc216$export$f21a1ffae260145a)(targets === null || targets === void 0 ? void 0 : targets[0]);
|
|
6624
6692
|
let opts = options instanceof windowObj.Element ? {
|
|
6625
6693
|
root: options
|
|
6626
6694
|
} : options;
|
|
6627
6695
|
var _opts_root;
|
|
6628
|
-
let root = (_opts_root = opts === null || opts ===
|
|
6629
|
-
let shouldUseInert = (opts === null || opts ===
|
|
6696
|
+
let root = (_opts_root = opts === null || opts === void 0 ? void 0 : opts.root) !== null && _opts_root !== void 0 ? _opts_root : document.body;
|
|
6697
|
+
let shouldUseInert = (opts === null || opts === void 0 ? void 0 : opts.shouldUseInert) && $5e3802645cc19319$var$supportsInert;
|
|
6630
6698
|
let visibleNodes = new Set(targets);
|
|
6631
6699
|
let hiddenNodes = new Set();
|
|
6632
6700
|
let getHidden = (element)=>{
|
|
@@ -6673,7 +6741,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
6673
6741
|
};
|
|
6674
6742
|
let hide = (node)=>{
|
|
6675
6743
|
var _refCountMap_get;
|
|
6676
|
-
let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !==
|
|
6744
|
+
let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;
|
|
6677
6745
|
// If already aria-hidden, and the ref count is zero, then this element
|
|
6678
6746
|
// was already hidden and there's nothing for us to do.
|
|
6679
6747
|
if (getHidden(node) && refCount === 0) return;
|
|
@@ -6770,7 +6838,7 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
6770
6838
|
isDismissable: !isNonModal || isSubmenu,
|
|
6771
6839
|
isKeyboardDismissDisabled: isKeyboardDismissDisabled,
|
|
6772
6840
|
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside
|
|
6773
|
-
}, groupRef !== null && groupRef !==
|
|
6841
|
+
}, groupRef !== null && groupRef !== void 0 ? groupRef : popoverRef);
|
|
6774
6842
|
let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement, triggerAnchorPoint: origin } = ($2a41e45df1593e64$export$d39e1813b3bdd0e1)({
|
|
6775
6843
|
...otherProps,
|
|
6776
6844
|
targetRef: triggerRef,
|
|
@@ -6784,9 +6852,9 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
6784
6852
|
(useEffect)(()=>{
|
|
6785
6853
|
if (state.isOpen && popoverRef.current) {
|
|
6786
6854
|
var _groupRef_current, _groupRef_current1;
|
|
6787
|
-
if (isNonModal) return ($5e3802645cc19319$export$1020fa7f77e17884)((_groupRef_current = groupRef === null || groupRef ===
|
|
6855
|
+
if (isNonModal) return ($5e3802645cc19319$export$1020fa7f77e17884)((_groupRef_current = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current !== void 0 ? _groupRef_current : popoverRef.current);
|
|
6788
6856
|
else return ($5e3802645cc19319$export$1c3ebcada18427bf)([
|
|
6789
|
-
(_groupRef_current1 = groupRef === null || groupRef ===
|
|
6857
|
+
(_groupRef_current1 = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current1 !== void 0 ? _groupRef_current1 : popoverRef.current
|
|
6790
6858
|
], {
|
|
6791
6859
|
shouldUseInert: true
|
|
6792
6860
|
});
|
|
@@ -6850,9 +6918,9 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
|
6850
6918
|
}
|
|
6851
6919
|
function $337b884510726a0d$export$14c98a7594375490() {
|
|
6852
6920
|
let ctx = (useContext)($337b884510726a0d$export$a2200b96afd16271);
|
|
6853
|
-
let setContain = ctx === null || ctx ===
|
|
6921
|
+
let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
|
|
6854
6922
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
6855
|
-
setContain === null || setContain ===
|
|
6923
|
+
setContain === null || setContain === void 0 ? void 0 : setContain(true);
|
|
6856
6924
|
}, [
|
|
6857
6925
|
setContain
|
|
6858
6926
|
]);
|
|
@@ -7021,9 +7089,9 @@ function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
|
|
|
7021
7089
|
function $feb5ffebff200149$export$c3d8340acf92597f(collectionRef, key) {
|
|
7022
7090
|
var _collectionRef_current, _collectionRef_current1;
|
|
7023
7091
|
let selector = `[data-key="${CSS.escape(String(key))}"]`;
|
|
7024
|
-
let collection = (_collectionRef_current = collectionRef.current) === null || _collectionRef_current ===
|
|
7092
|
+
let collection = (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dataset.collection;
|
|
7025
7093
|
if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
|
|
7026
|
-
return (_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 ===
|
|
7094
|
+
return (_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 === void 0 ? void 0 : _collectionRef_current1.querySelector(selector);
|
|
7027
7095
|
}
|
|
7028
7096
|
const $feb5ffebff200149$var$collectionMap = new WeakMap();
|
|
7029
7097
|
function $feb5ffebff200149$export$881eb0d9f3605d9d(collection) {
|
|
@@ -7129,7 +7197,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7129
7197
|
if (e.altKey && e.key === 'Tab') e.preventDefault();
|
|
7130
7198
|
// Keyboard events bubble through portals. Don't handle keyboard events
|
|
7131
7199
|
// for elements outside the collection (e.g. menus).
|
|
7132
|
-
if (!((_ref_current = ref.current) === null || _ref_current ===
|
|
7200
|
+
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
|
|
7133
7201
|
const navigateToKey = (key, childFocus)=>{
|
|
7134
7202
|
if (key != null) {
|
|
7135
7203
|
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) {
|
|
@@ -7152,8 +7220,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7152
7220
|
case 'ArrowDown':
|
|
7153
7221
|
if (delegate.getKeyBelow) {
|
|
7154
7222
|
var _delegate_getKeyBelow, _delegate_getFirstKey, _delegate_getFirstKey1;
|
|
7155
|
-
let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow ===
|
|
7156
|
-
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 ===
|
|
7223
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
7224
|
+
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
|
|
7157
7225
|
if (nextKey != null) {
|
|
7158
7226
|
e.preventDefault();
|
|
7159
7227
|
navigateToKey(nextKey);
|
|
@@ -7163,8 +7231,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7163
7231
|
case 'ArrowUp':
|
|
7164
7232
|
if (delegate.getKeyAbove) {
|
|
7165
7233
|
var _delegate_getKeyAbove, _delegate_getLastKey, _delegate_getLastKey1;
|
|
7166
|
-
let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove ===
|
|
7167
|
-
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 ===
|
|
7234
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
|
|
7235
|
+
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
|
|
7168
7236
|
if (nextKey != null) {
|
|
7169
7237
|
e.preventDefault();
|
|
7170
7238
|
navigateToKey(nextKey);
|
|
@@ -7174,8 +7242,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7174
7242
|
case 'ArrowLeft':
|
|
7175
7243
|
if (delegate.getKeyLeftOf) {
|
|
7176
7244
|
var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
|
|
7177
|
-
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf ===
|
|
7178
|
-
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 ===
|
|
7245
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
|
|
7246
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
|
|
7179
7247
|
if (nextKey != null) {
|
|
7180
7248
|
e.preventDefault();
|
|
7181
7249
|
navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
|
|
@@ -7185,8 +7253,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7185
7253
|
case 'ArrowRight':
|
|
7186
7254
|
if (delegate.getKeyRightOf) {
|
|
7187
7255
|
var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
|
|
7188
|
-
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf ===
|
|
7189
|
-
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 ===
|
|
7256
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
|
|
7257
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
|
|
7190
7258
|
if (nextKey != null) {
|
|
7191
7259
|
e.preventDefault();
|
|
7192
7260
|
navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
|
|
@@ -7267,7 +7335,10 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7267
7335
|
last = walker.lastChild();
|
|
7268
7336
|
if (last) next = last;
|
|
7269
7337
|
}while (last);
|
|
7270
|
-
|
|
7338
|
+
// If the active element is NOT tabbable but is contained by an element that IS tabbable (aka the cell), the browser will actually move focus to
|
|
7339
|
+
// the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between
|
|
7340
|
+
// focusing the containing cell and back to the non-tabbable child element
|
|
7341
|
+
if (next && (!next.contains(document.activeElement) || document.activeElement && !($b4b717babfbb907b$export$bebd5a1431fec25d)(document.activeElement))) ($7215afc6de606d6b$export$de79e2c695e052f3)(next);
|
|
7271
7342
|
}
|
|
7272
7343
|
break;
|
|
7273
7344
|
}
|
|
@@ -7283,8 +7354,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7283
7354
|
var _scrollRef_current, _scrollRef_current1;
|
|
7284
7355
|
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
7285
7356
|
scrollPos.current = {
|
|
7286
|
-
top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current ===
|
|
7287
|
-
left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 ===
|
|
7357
|
+
top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTop) !== null && _scrollRef_current_scrollTop !== void 0 ? _scrollRef_current_scrollTop : 0,
|
|
7358
|
+
left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 === void 0 ? void 0 : _scrollRef_current1.scrollLeft) !== null && _scrollRef_current_scrollLeft !== void 0 ? _scrollRef_current_scrollLeft : 0
|
|
7288
7359
|
};
|
|
7289
7360
|
});
|
|
7290
7361
|
let onFocus = (e)=>{
|
|
@@ -7309,8 +7380,8 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7309
7380
|
// and either focus the first or last item accordingly.
|
|
7310
7381
|
let relatedTarget = e.relatedTarget;
|
|
7311
7382
|
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
7312
|
-
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !==
|
|
7313
|
-
else navigateToKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !==
|
|
7383
|
+
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate));
|
|
7384
|
+
else navigateToKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate));
|
|
7314
7385
|
} else if (!isVirtualized && scrollRef.current) {
|
|
7315
7386
|
// Restore the scroll position to what it was before.
|
|
7316
7387
|
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
@@ -7345,52 +7416,48 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7345
7416
|
e.stopPropagation();
|
|
7346
7417
|
manager.setFocused(true);
|
|
7347
7418
|
// If the user is typing forwards, autofocus the first option in the list.
|
|
7348
|
-
if ((detail === null || detail ===
|
|
7349
|
-
});
|
|
7350
|
-
let updateActiveDescendant = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
7351
|
-
var _delegate_getFirstKey;
|
|
7352
|
-
var _delegate_getFirstKey1;
|
|
7353
|
-
let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === undefined ? undefined : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== undefined ? _delegate_getFirstKey1 : null;
|
|
7354
|
-
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
7355
|
-
// the original active element (e.g. the autocomplete input)
|
|
7356
|
-
if (keyToFocus == null) {
|
|
7357
|
-
let previousActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
7358
|
-
($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
7359
|
-
($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
|
|
7360
|
-
// If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.
|
|
7361
|
-
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
7362
|
-
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
7363
|
-
} else {
|
|
7364
|
-
manager.setFocusedKey(keyToFocus);
|
|
7365
|
-
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
7366
|
-
// If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key
|
|
7367
|
-
// after the collection updates after load
|
|
7368
|
-
shouldVirtualFocusFirst.current = false;
|
|
7369
|
-
}
|
|
7419
|
+
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === 'first') shouldVirtualFocusFirst.current = true;
|
|
7370
7420
|
});
|
|
7421
|
+
// update active descendant
|
|
7371
7422
|
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
7372
|
-
if (shouldVirtualFocusFirst.current)
|
|
7423
|
+
if (shouldVirtualFocusFirst.current) {
|
|
7424
|
+
var _delegate_getFirstKey;
|
|
7425
|
+
var _delegate_getFirstKey1;
|
|
7426
|
+
let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
7427
|
+
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
7428
|
+
// the original active element (e.g. the autocomplete input)
|
|
7429
|
+
if (keyToFocus == null) {
|
|
7430
|
+
let previousActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
7431
|
+
($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
7432
|
+
($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
|
|
7433
|
+
// If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.
|
|
7434
|
+
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
7435
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
7436
|
+
} else {
|
|
7437
|
+
manager.setFocusedKey(keyToFocus);
|
|
7438
|
+
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
7439
|
+
// If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key
|
|
7440
|
+
// after the collection updates after load
|
|
7441
|
+
shouldVirtualFocusFirst.current = false;
|
|
7442
|
+
}
|
|
7443
|
+
}
|
|
7373
7444
|
}, [
|
|
7374
|
-
manager.collection
|
|
7375
|
-
updateActiveDescendant
|
|
7445
|
+
manager.collection
|
|
7376
7446
|
]);
|
|
7377
|
-
|
|
7447
|
+
// reset focus first flag
|
|
7448
|
+
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
7378
7449
|
// If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't
|
|
7379
7450
|
// accidentally move focus from under them. Skip this if the collection was empty because we might be in a load
|
|
7380
7451
|
// state and will still want to focus the first item after load
|
|
7381
7452
|
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
7382
|
-
});
|
|
7383
|
-
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
7384
|
-
resetFocusFirstFlag();
|
|
7385
7453
|
}, [
|
|
7386
|
-
manager.focusedKey
|
|
7387
|
-
resetFocusFirstFlag
|
|
7454
|
+
manager.focusedKey
|
|
7388
7455
|
]);
|
|
7389
7456
|
($e9faafb641e167db$export$90fc3a17d93f704c)(ref, ($5671b20cf9b562b2$export$447a38995de2c711), !shouldUseVirtualFocus ? undefined : (e)=>{
|
|
7390
7457
|
var _e_detail;
|
|
7391
7458
|
e.stopPropagation();
|
|
7392
7459
|
manager.setFocused(false);
|
|
7393
|
-
if ((_e_detail = e.detail) === null || _e_detail ===
|
|
7460
|
+
if ((_e_detail = e.detail) === null || _e_detail === void 0 ? void 0 : _e_detail.clearFocusKey) manager.setFocusedKey(null);
|
|
7394
7461
|
});
|
|
7395
7462
|
const autoFocusRef = (useRef)(autoFocus);
|
|
7396
7463
|
const didAutoFocusRef = (useRef)(false);
|
|
@@ -7400,9 +7467,9 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7400
7467
|
let focusedKey = null;
|
|
7401
7468
|
var _delegate_getFirstKey1;
|
|
7402
7469
|
// Check focus strategy to determine which item to focus
|
|
7403
|
-
if (autoFocus === 'first') focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey ===
|
|
7470
|
+
if (autoFocus === 'first') focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
7404
7471
|
var _delegate_getLastKey1;
|
|
7405
|
-
if (autoFocus === 'last') focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey ===
|
|
7472
|
+
if (autoFocus === 'last') focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate)) !== null && _delegate_getLastKey1 !== void 0 ? _delegate_getLastKey1 : null;
|
|
7406
7473
|
// If there are any selected keys, make the first one the new focus target
|
|
7407
7474
|
let selectedKeys = manager.selectedKeys;
|
|
7408
7475
|
if (selectedKeys.size) {
|
|
@@ -7586,7 +7653,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
7586
7653
|
if (onAction) {
|
|
7587
7654
|
var _ref_current;
|
|
7588
7655
|
onAction();
|
|
7589
|
-
(_ref_current = ref.current) === null || _ref_current ===
|
|
7656
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent('react-aria-item-action', {
|
|
7590
7657
|
bubbles: true
|
|
7591
7658
|
}));
|
|
7592
7659
|
}
|
|
@@ -7725,11 +7792,11 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
7725
7792
|
}
|
|
7726
7793
|
function $880e95eb8b93ba9a$var$isActionKey() {
|
|
7727
7794
|
let event = window.event;
|
|
7728
|
-
return (event === null || event ===
|
|
7795
|
+
return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
|
|
7729
7796
|
}
|
|
7730
7797
|
function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
7731
7798
|
let event = window.event;
|
|
7732
|
-
return (event === null || event ===
|
|
7799
|
+
return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
|
|
7733
7800
|
}
|
|
7734
7801
|
|
|
7735
7802
|
/*
|
|
@@ -7762,18 +7829,18 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
7762
7829
|
let container = this.ref.current;
|
|
7763
7830
|
var _container_scrollWidth, _container_scrollHeight;
|
|
7764
7831
|
return {
|
|
7765
|
-
width: (_container_scrollWidth = container === null || container ===
|
|
7766
|
-
height: (_container_scrollHeight = container === null || container ===
|
|
7832
|
+
width: (_container_scrollWidth = container === null || container === void 0 ? void 0 : container.scrollWidth) !== null && _container_scrollWidth !== void 0 ? _container_scrollWidth : 0,
|
|
7833
|
+
height: (_container_scrollHeight = container === null || container === void 0 ? void 0 : container.scrollHeight) !== null && _container_scrollHeight !== void 0 ? _container_scrollHeight : 0
|
|
7767
7834
|
};
|
|
7768
7835
|
}
|
|
7769
7836
|
getVisibleRect() {
|
|
7770
7837
|
let container = this.ref.current;
|
|
7771
7838
|
var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
|
|
7772
7839
|
return {
|
|
7773
|
-
x: (_container_scrollLeft = container === null || container ===
|
|
7774
|
-
y: (_container_scrollTop = container === null || container ===
|
|
7775
|
-
width: (_container_clientWidth = container === null || container ===
|
|
7776
|
-
height: (_container_clientHeight = container === null || container ===
|
|
7840
|
+
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
7841
|
+
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
7842
|
+
width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
|
|
7843
|
+
height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
|
|
7777
7844
|
};
|
|
7778
7845
|
}
|
|
7779
7846
|
constructor(ref){
|
|
@@ -7796,13 +7863,13 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
7796
7863
|
class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
7797
7864
|
isDisabled(item) {
|
|
7798
7865
|
var _item_props;
|
|
7799
|
-
return this.disabledBehavior === 'all' && (((_item_props = item.props) === null || _item_props ===
|
|
7866
|
+
return this.disabledBehavior === 'all' && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
|
|
7800
7867
|
}
|
|
7801
7868
|
findNextNonDisabled(key, getNext) {
|
|
7802
7869
|
let nextKey = key;
|
|
7803
7870
|
while(nextKey != null){
|
|
7804
7871
|
let item = this.collection.getItem(nextKey);
|
|
7805
|
-
if ((item === null || item ===
|
|
7872
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 'item' && !this.isDisabled(item)) return nextKey;
|
|
7806
7873
|
nextKey = getNext(nextKey);
|
|
7807
7874
|
}
|
|
7808
7875
|
return null;
|
|
@@ -7900,7 +7967,7 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
7900
7967
|
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
7901
7968
|
}
|
|
7902
7969
|
}
|
|
7903
|
-
return nextKey !== null && nextKey !==
|
|
7970
|
+
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getFirstKey();
|
|
7904
7971
|
}
|
|
7905
7972
|
getKeyPageBelow(key) {
|
|
7906
7973
|
let menu = this.ref.current;
|
|
@@ -7921,7 +7988,7 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
7921
7988
|
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
7922
7989
|
}
|
|
7923
7990
|
}
|
|
7924
|
-
return nextKey !== null && nextKey !==
|
|
7991
|
+
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getLastKey();
|
|
7925
7992
|
}
|
|
7926
7993
|
getKeyForSearch(search, fromKey) {
|
|
7927
7994
|
if (!this.collator) return null;
|
|
@@ -8145,7 +8212,7 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8145
8212
|
let v = partialNode.value;
|
|
8146
8213
|
if (v != null) {
|
|
8147
8214
|
var _v_key;
|
|
8148
|
-
let key = (_v_key = v.key) !== null && _v_key !==
|
|
8215
|
+
let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
|
|
8149
8216
|
if (key == null) throw new Error('No key found for item');
|
|
8150
8217
|
return key;
|
|
8151
8218
|
}
|
|
@@ -8163,7 +8230,7 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8163
8230
|
children.push(child);
|
|
8164
8231
|
});
|
|
8165
8232
|
var _partialNode_index;
|
|
8166
|
-
let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !==
|
|
8233
|
+
let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
|
|
8167
8234
|
for (const child of children)yield* this.getFullNode({
|
|
8168
8235
|
element: child,
|
|
8169
8236
|
index: index++
|
|
@@ -8193,13 +8260,13 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8193
8260
|
}
|
|
8194
8261
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
8195
8262
|
var _partialNode_index1;
|
|
8196
|
-
let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !==
|
|
8263
|
+
let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
|
|
8197
8264
|
let result = childNodes.next();
|
|
8198
8265
|
while(!result.done && result.value){
|
|
8199
8266
|
let childNode = result.value;
|
|
8200
8267
|
partialNode.index = index;
|
|
8201
8268
|
var _childNode_key;
|
|
8202
|
-
let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !==
|
|
8269
|
+
let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
|
|
8203
8270
|
if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
|
|
8204
8271
|
let nodes = this.getFullNode({
|
|
8205
8272
|
...childNode,
|
|
@@ -8213,12 +8280,12 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8213
8280
|
for (let node of children){
|
|
8214
8281
|
var _childNode_value, _ref;
|
|
8215
8282
|
// Cache the node based on its value
|
|
8216
|
-
node.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !==
|
|
8283
|
+
node.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
|
|
8217
8284
|
if (node.value) this.cache.set(node.value, node);
|
|
8218
8285
|
var _parentNode_type;
|
|
8219
8286
|
// The partial node may have specified a type for the child in order to specify a constraint.
|
|
8220
8287
|
// Verify that the full node that was built recursively matches this type.
|
|
8221
|
-
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize((_parentNode_type = parentNode === null || parentNode ===
|
|
8288
|
+
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize((_parentNode_type = parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) !== null && _parentNode_type !== void 0 ? _parentNode_type : 'unknown parent type')}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
|
|
8222
8289
|
index++;
|
|
8223
8290
|
yield node;
|
|
8224
8291
|
}
|
|
@@ -8236,11 +8303,11 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8236
8303
|
props: partialNode.props,
|
|
8237
8304
|
key: partialNode.key,
|
|
8238
8305
|
parentKey: parentNode ? parentNode.key : null,
|
|
8239
|
-
value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !==
|
|
8306
|
+
value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
|
|
8240
8307
|
level: parentNode ? parentNode.level + 1 : 0,
|
|
8241
8308
|
index: partialNode.index,
|
|
8242
8309
|
rendered: partialNode.rendered,
|
|
8243
|
-
textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !==
|
|
8310
|
+
textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : '',
|
|
8244
8311
|
'aria-label': partialNode['aria-label'],
|
|
8245
8312
|
wrapper: partialNode.wrapper,
|
|
8246
8313
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
@@ -8383,7 +8450,7 @@ function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
|
|
|
8383
8450
|
function $c5a24bc478652b5f$var$getAncestors(collection, node) {
|
|
8384
8451
|
let parents = [];
|
|
8385
8452
|
let currNode = node;
|
|
8386
|
-
while((currNode === null || currNode ===
|
|
8453
|
+
while((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null){
|
|
8387
8454
|
currNode = collection.getItem(currNode.parentKey);
|
|
8388
8455
|
if (currNode) parents.unshift(currNode);
|
|
8389
8456
|
}
|
|
@@ -8438,17 +8505,17 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
|
|
|
8438
8505
|
let { key: key } = props;
|
|
8439
8506
|
let data = ($b1f0cad8af73213b$export$3585ede4d035bf14).get(state);
|
|
8440
8507
|
var _props_isDisabled;
|
|
8441
|
-
let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !==
|
|
8508
|
+
let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : state.selectionManager.isDisabled(key);
|
|
8442
8509
|
var _props_isSelected;
|
|
8443
|
-
let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !==
|
|
8510
|
+
let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : state.selectionManager.isSelected(key);
|
|
8444
8511
|
var _props_shouldSelectOnPressUp;
|
|
8445
|
-
let shouldSelectOnPressUp = (_props_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _props_shouldSelectOnPressUp !==
|
|
8512
|
+
let shouldSelectOnPressUp = (_props_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _props_shouldSelectOnPressUp !== void 0 ? _props_shouldSelectOnPressUp : data === null || data === void 0 ? void 0 : data.shouldSelectOnPressUp;
|
|
8446
8513
|
var _props_shouldFocusOnHover;
|
|
8447
|
-
let shouldFocusOnHover = (_props_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _props_shouldFocusOnHover !==
|
|
8514
|
+
let shouldFocusOnHover = (_props_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _props_shouldFocusOnHover !== void 0 ? _props_shouldFocusOnHover : data === null || data === void 0 ? void 0 : data.shouldFocusOnHover;
|
|
8448
8515
|
var _props_shouldUseVirtualFocus;
|
|
8449
|
-
let shouldUseVirtualFocus = (_props_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _props_shouldUseVirtualFocus !==
|
|
8516
|
+
let shouldUseVirtualFocus = (_props_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _props_shouldUseVirtualFocus !== void 0 ? _props_shouldUseVirtualFocus : data === null || data === void 0 ? void 0 : data.shouldUseVirtualFocus;
|
|
8450
8517
|
var _props_isVirtualized;
|
|
8451
|
-
let isVirtualized = (_props_isVirtualized = props.isVirtualized) !== null && _props_isVirtualized !==
|
|
8518
|
+
let isVirtualized = (_props_isVirtualized = props.isVirtualized) !== null && _props_isVirtualized !== void 0 ? _props_isVirtualized : data === null || data === void 0 ? void 0 : data.isVirtualized;
|
|
8452
8519
|
let labelId = ($bdb11010cef70236$export$b4cc09c592e8fdb8)();
|
|
8453
8520
|
let descriptionId = ($bdb11010cef70236$export$b4cc09c592e8fdb8)();
|
|
8454
8521
|
let optionProps = {
|
|
@@ -8466,13 +8533,13 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
|
|
|
8466
8533
|
}
|
|
8467
8534
|
let item = state.collection.getItem(key);
|
|
8468
8535
|
if (isVirtualized) {
|
|
8469
|
-
let index = Number(item === null || item ===
|
|
8536
|
+
let index = Number(item === null || item === void 0 ? void 0 : item.index);
|
|
8470
8537
|
optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
|
|
8471
8538
|
optionProps['aria-setsize'] = ($453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
|
|
8472
8539
|
}
|
|
8473
|
-
let onAction = (data === null || data ===
|
|
8540
|
+
let onAction = (data === null || data === void 0 ? void 0 : data.onAction) ? ()=>{
|
|
8474
8541
|
var _data_onAction;
|
|
8475
|
-
return data === null || data ===
|
|
8542
|
+
return data === null || data === void 0 ? void 0 : (_data_onAction = data.onAction) === null || _data_onAction === void 0 ? void 0 : _data_onAction.call(data, key);
|
|
8476
8543
|
} : undefined;
|
|
8477
8544
|
let id = ($b1f0cad8af73213b$export$9145995848b05025)(state, key);
|
|
8478
8545
|
let { itemProps: itemProps, isPressed: isPressed, isFocused: isFocused, hasAction: hasAction, allowsSelection: allowsSelection } = ($880e95eb8b93ba9a$export$ecf600387e221c37)({
|
|
@@ -8484,10 +8551,10 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
|
|
|
8484
8551
|
isVirtualized: isVirtualized,
|
|
8485
8552
|
shouldUseVirtualFocus: shouldUseVirtualFocus,
|
|
8486
8553
|
isDisabled: isDisabled,
|
|
8487
|
-
onAction: onAction || (item === null || item ===
|
|
8488
|
-
linkBehavior: data === null || data ===
|
|
8554
|
+
onAction: onAction || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.onAction) ? ($ff5963eb1fccf552$export$e08e3b67e392101e)(item === null || item === void 0 ? void 0 : (_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.onAction, onAction) : undefined,
|
|
8555
|
+
linkBehavior: data === null || data === void 0 ? void 0 : data.linkBehavior,
|
|
8489
8556
|
// @ts-ignore
|
|
8490
|
-
UNSTABLE_itemBehavior: data === null || data ===
|
|
8557
|
+
UNSTABLE_itemBehavior: data === null || data === void 0 ? void 0 : data['UNSTABLE_itemBehavior'],
|
|
8491
8558
|
id: id
|
|
8492
8559
|
});
|
|
8493
8560
|
let { hoverProps: hoverProps } = ($6179b936705e76d3$export$ae780daf29e6d456)({
|
|
@@ -8499,9 +8566,9 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
|
|
|
8499
8566
|
}
|
|
8500
8567
|
}
|
|
8501
8568
|
});
|
|
8502
|
-
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item ===
|
|
8569
|
+
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item === void 0 ? void 0 : item.props);
|
|
8503
8570
|
delete domProps.id;
|
|
8504
|
-
let linkProps = ($ea8dcbcb9ea1b556$export$7e924b3091a3bd18)(item === null || item ===
|
|
8571
|
+
let linkProps = ($ea8dcbcb9ea1b556$export$7e924b3091a3bd18)(item === null || item === void 0 ? void 0 : item.props);
|
|
8505
8572
|
return {
|
|
8506
8573
|
optionProps: {
|
|
8507
8574
|
...optionProps,
|
|
@@ -8627,7 +8694,7 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
|
8627
8694
|
validate,
|
|
8628
8695
|
value
|
|
8629
8696
|
]);
|
|
8630
|
-
if (builtinValidation === null || builtinValidation ===
|
|
8697
|
+
if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid) builtinValidation = undefined;
|
|
8631
8698
|
// Get relevant server errors from the form.
|
|
8632
8699
|
let serverErrors = (useContext)($e5be200c675c3b3a$export$571b5131b7e65c11);
|
|
8633
8700
|
let serverErrorMessages = (useMemo)(()=>{
|
|
@@ -8816,7 +8883,7 @@ $a89a74a39eba465a$exports = {
|
|
|
8816
8883
|
|
|
8817
8884
|
var $edc7c66594a0ae8a$exports = {};
|
|
8818
8885
|
$edc7c66594a0ae8a$exports = {
|
|
8819
|
-
"longPressMessage": `
|
|
8886
|
+
"longPressMessage": `Premi a lungo o premi Alt + Freccia gi\xf9 per aprire il menu`
|
|
8820
8887
|
};
|
|
8821
8888
|
|
|
8822
8889
|
var $f1ab51510712db52$exports = {};
|
|
@@ -9105,7 +9172,7 @@ function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
|
9105
9172
|
let { validationBehavior: validationBehavior, focus: focus } = props;
|
|
9106
9173
|
// This is a useLayoutEffect so that it runs before the useEffect in useFormValidationState, which commits the validation change.
|
|
9107
9174
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
9108
|
-
if (validationBehavior === 'native' && (ref === null || ref ===
|
|
9175
|
+
if (validationBehavior === 'native' && (ref === null || ref === void 0 ? void 0 : ref.current) && !ref.current.disabled) {
|
|
9109
9176
|
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(' ') || 'Invalid value.' : '';
|
|
9110
9177
|
ref.current.setCustomValidity(errorMessage);
|
|
9111
9178
|
// Prevent default tooltip for validation message.
|
|
@@ -9124,11 +9191,11 @@ function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
|
9124
9191
|
// This avoids clearing server errors that the user didn't actually fix.
|
|
9125
9192
|
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
9126
9193
|
// Auto focus the first invalid input in a form, unless the error already had its default prevented.
|
|
9127
|
-
let form = ref === null || ref ===
|
|
9194
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
9128
9195
|
if (!e.defaultPrevented && ref && form && $e93e671b31057976$var$getFirstInvalidInput(form) === ref.current) {
|
|
9129
9196
|
var _ref_current1;
|
|
9130
9197
|
if (focus) focus();
|
|
9131
|
-
else (_ref_current1 = ref.current) === null || _ref_current1 ===
|
|
9198
|
+
else (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.focus();
|
|
9132
9199
|
// Always show focus ring.
|
|
9133
9200
|
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
9134
9201
|
}
|
|
@@ -9139,10 +9206,10 @@ function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
|
9139
9206
|
state.commitValidation();
|
|
9140
9207
|
});
|
|
9141
9208
|
(useEffect)(()=>{
|
|
9142
|
-
let input = ref === null || ref ===
|
|
9209
|
+
let input = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
9143
9210
|
if (!input) return;
|
|
9144
9211
|
let form = input.form;
|
|
9145
|
-
let reset = form === null || form ===
|
|
9212
|
+
let reset = form === null || form === void 0 ? void 0 : form.reset;
|
|
9146
9213
|
if (form) // Try to detect React's automatic form reset behavior so we don't clear
|
|
9147
9214
|
// validation errors that are returned by server actions.
|
|
9148
9215
|
// To do this, we ignore programmatic form resets that occur outside a user event.
|
|
@@ -9150,24 +9217,21 @@ function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
|
9150
9217
|
form.reset = ()=>{
|
|
9151
9218
|
// React uses MessageChannel for scheduling, so ignore 'message' events.
|
|
9152
9219
|
isIgnoredReset.current = !window.event || window.event.type === 'message' && window.event.target instanceof MessagePort;
|
|
9153
|
-
reset === null || reset ===
|
|
9220
|
+
reset === null || reset === void 0 ? void 0 : reset.call(form);
|
|
9154
9221
|
isIgnoredReset.current = false;
|
|
9155
9222
|
};
|
|
9156
9223
|
input.addEventListener('invalid', onInvalid);
|
|
9157
9224
|
input.addEventListener('change', onChange);
|
|
9158
|
-
form === null || form ===
|
|
9225
|
+
form === null || form === void 0 ? void 0 : form.addEventListener('reset', onReset);
|
|
9159
9226
|
return ()=>{
|
|
9160
9227
|
input.removeEventListener('invalid', onInvalid);
|
|
9161
9228
|
input.removeEventListener('change', onChange);
|
|
9162
|
-
form === null || form ===
|
|
9229
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', onReset);
|
|
9163
9230
|
if (form) // @ts-ignore
|
|
9164
9231
|
form.reset = reset;
|
|
9165
9232
|
};
|
|
9166
9233
|
}, [
|
|
9167
9234
|
ref,
|
|
9168
|
-
onInvalid,
|
|
9169
|
-
onChange,
|
|
9170
|
-
onReset,
|
|
9171
9235
|
validationBehavior
|
|
9172
9236
|
]);
|
|
9173
9237
|
}
|
|
@@ -9246,27 +9310,8 @@ function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
|
|
|
9246
9310
|
};
|
|
9247
9311
|
let [initialValue] = (useState)(value);
|
|
9248
9312
|
var _props_defaultValue;
|
|
9249
|
-
($99facab73266f662$export$5add1d006293d136)(ref, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !==
|
|
9313
|
+
($99facab73266f662$export$5add1d006293d136)(ref, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : initialValue, setValue);
|
|
9250
9314
|
($e93e671b31057976$export$b8473d3665f3a75a)(props, validationState, ref);
|
|
9251
|
-
(useEffect)(()=>{
|
|
9252
|
-
// This works around a React/Chrome bug that prevents textarea elements from validating when controlled.
|
|
9253
|
-
// We prevent React from updating defaultValue (i.e. children) of textarea when `value` changes,
|
|
9254
|
-
// which causes Chrome to skip validation. Only updating `value` is ok in our case since our
|
|
9255
|
-
// textareas are always controlled. React is planning on removing this synchronization in a
|
|
9256
|
-
// future major version.
|
|
9257
|
-
// https://github.com/facebook/react/issues/19474
|
|
9258
|
-
// https://github.com/facebook/react/issues/11896
|
|
9259
|
-
if (ref.current instanceof ($431fbd86ca7dc216$export$f21a1ffae260145a)(ref.current).HTMLTextAreaElement) {
|
|
9260
|
-
let input = ref.current;
|
|
9261
|
-
Object.defineProperty(input, 'defaultValue', {
|
|
9262
|
-
get: ()=>input.value,
|
|
9263
|
-
set: ()=>{},
|
|
9264
|
-
configurable: true
|
|
9265
|
-
});
|
|
9266
|
-
}
|
|
9267
|
-
}, [
|
|
9268
|
-
ref
|
|
9269
|
-
]);
|
|
9270
9315
|
return {
|
|
9271
9316
|
labelProps: labelProps,
|
|
9272
9317
|
inputProps: ($3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, inputElementType === 'input' ? inputOnlyProps : undefined, {
|
|
@@ -9435,7 +9480,7 @@ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
|
9435
9480
|
return {
|
|
9436
9481
|
*[Symbol.iterator] () {
|
|
9437
9482
|
let parent = keyMap.get(key);
|
|
9438
|
-
let node = (parent === null || parent ===
|
|
9483
|
+
let node = (parent === null || parent === void 0 ? void 0 : parent.firstChildKey) != null ? keyMap.get(parent.firstChildKey) : null;
|
|
9439
9484
|
while(node){
|
|
9440
9485
|
yield node;
|
|
9441
9486
|
node = node.nextKey != null ? keyMap.get(node.nextKey) : undefined;
|
|
@@ -9450,7 +9495,7 @@ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
|
9450
9495
|
node = this.keyMap.get(node.prevKey);
|
|
9451
9496
|
while(node && node.type !== 'item' && node.lastChildKey != null)node = this.keyMap.get(node.lastChildKey);
|
|
9452
9497
|
var _node_key;
|
|
9453
|
-
return (_node_key = node === null || node ===
|
|
9498
|
+
return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
|
|
9454
9499
|
}
|
|
9455
9500
|
return node.parentKey;
|
|
9456
9501
|
}
|
|
@@ -9470,13 +9515,13 @@ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
|
9470
9515
|
}
|
|
9471
9516
|
getLastKey() {
|
|
9472
9517
|
let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
|
|
9473
|
-
while((node === null || node ===
|
|
9518
|
+
while((node === null || node === void 0 ? void 0 : node.lastChildKey) != null)node = this.keyMap.get(node.lastChildKey);
|
|
9474
9519
|
var _node_key;
|
|
9475
|
-
return (_node_key = node === null || node ===
|
|
9520
|
+
return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
|
|
9476
9521
|
}
|
|
9477
9522
|
getItem(key) {
|
|
9478
9523
|
var _this_keyMap_get;
|
|
9479
|
-
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !==
|
|
9524
|
+
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
|
|
9480
9525
|
}
|
|
9481
9526
|
at() {
|
|
9482
9527
|
throw new Error('Not implemented');
|
|
@@ -9519,7 +9564,7 @@ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
|
9519
9564
|
filter(filterFn) {
|
|
9520
9565
|
let newCollection = new this.constructor();
|
|
9521
9566
|
let [firstKey, lastKey] = $23b9f4fcf0fe224b$var$filterChildren(this, newCollection, this.firstKey, filterFn);
|
|
9522
|
-
newCollection === null || newCollection ===
|
|
9567
|
+
newCollection === null || newCollection === void 0 ? void 0 : newCollection.commit(firstKey, lastKey);
|
|
9523
9568
|
return newCollection;
|
|
9524
9569
|
}
|
|
9525
9570
|
constructor(){
|
|
@@ -9569,8 +9614,8 @@ function $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, firstCh
|
|
|
9569
9614
|
}
|
|
9570
9615
|
var _firstNode_key, _lastNode_key;
|
|
9571
9616
|
return [
|
|
9572
|
-
(_firstNode_key = firstNode === null || firstNode ===
|
|
9573
|
-
(_lastNode_key = lastNode === null || lastNode ===
|
|
9617
|
+
(_firstNode_key = firstNode === null || firstNode === void 0 ? void 0 : firstNode.key) !== null && _firstNode_key !== void 0 ? _firstNode_key : null,
|
|
9618
|
+
(_lastNode_key = lastNode === null || lastNode === void 0 ? void 0 : lastNode.key) !== null && _lastNode_key !== void 0 ? _lastNode_key : null
|
|
9574
9619
|
];
|
|
9575
9620
|
}
|
|
9576
9621
|
|
|
@@ -9629,7 +9674,7 @@ function $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, firstCh
|
|
|
9629
9674
|
}
|
|
9630
9675
|
get isConnected() {
|
|
9631
9676
|
var _this_parentNode;
|
|
9632
|
-
return ((_this_parentNode = this.parentNode) === null || _this_parentNode ===
|
|
9677
|
+
return ((_this_parentNode = this.parentNode) === null || _this_parentNode === void 0 ? void 0 : _this_parentNode.isConnected) || false;
|
|
9633
9678
|
}
|
|
9634
9679
|
invalidateChildIndices(child) {
|
|
9635
9680
|
if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
|
|
@@ -9738,7 +9783,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
9738
9783
|
}
|
|
9739
9784
|
get level() {
|
|
9740
9785
|
var _this_node;
|
|
9741
|
-
if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_node = this.node) === null || _this_node ===
|
|
9786
|
+
if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.type) === 'item' ? 1 : 0);
|
|
9742
9787
|
return 0;
|
|
9743
9788
|
}
|
|
9744
9789
|
/**
|
|
@@ -9761,21 +9806,21 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
9761
9806
|
node.index = this.index;
|
|
9762
9807
|
node.level = this.level;
|
|
9763
9808
|
var _this_parentNode_node_key;
|
|
9764
|
-
node.parentKey = this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd ? (_this_parentNode_node_key = (_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node ===
|
|
9809
|
+
node.parentKey = this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd ? (_this_parentNode_node_key = (_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node === void 0 ? void 0 : _this_parentNode_node.key) !== null && _this_parentNode_node_key !== void 0 ? _this_parentNode_node_key : null : null;
|
|
9765
9810
|
var _this_previousVisibleSibling_node_key;
|
|
9766
|
-
node.prevKey = (_this_previousVisibleSibling_node_key = (_this_previousVisibleSibling = this.previousVisibleSibling) === null || _this_previousVisibleSibling ===
|
|
9811
|
+
node.prevKey = (_this_previousVisibleSibling_node_key = (_this_previousVisibleSibling = this.previousVisibleSibling) === null || _this_previousVisibleSibling === void 0 ? void 0 : (_this_previousVisibleSibling_node = _this_previousVisibleSibling.node) === null || _this_previousVisibleSibling_node === void 0 ? void 0 : _this_previousVisibleSibling_node.key) !== null && _this_previousVisibleSibling_node_key !== void 0 ? _this_previousVisibleSibling_node_key : null;
|
|
9767
9812
|
var _nextSibling_node_key;
|
|
9768
|
-
node.nextKey = (_nextSibling_node_key = nextSibling === null || nextSibling ===
|
|
9813
|
+
node.nextKey = (_nextSibling_node_key = nextSibling === null || nextSibling === void 0 ? void 0 : (_nextSibling_node = nextSibling.node) === null || _nextSibling_node === void 0 ? void 0 : _nextSibling_node.key) !== null && _nextSibling_node_key !== void 0 ? _nextSibling_node_key : null;
|
|
9769
9814
|
node.hasChildNodes = !!this.firstChild;
|
|
9770
9815
|
var _this_firstVisibleChild_node_key;
|
|
9771
|
-
node.firstChildKey = (_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild ===
|
|
9816
|
+
node.firstChildKey = (_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : (_this_firstVisibleChild_node = _this_firstVisibleChild.node) === null || _this_firstVisibleChild_node === void 0 ? void 0 : _this_firstVisibleChild_node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null;
|
|
9772
9817
|
var _this_lastVisibleChild_node_key;
|
|
9773
|
-
node.lastChildKey = (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild ===
|
|
9818
|
+
node.lastChildKey = (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : (_this_lastVisibleChild_node = _this_lastVisibleChild.node) === null || _this_lastVisibleChild_node === void 0 ? void 0 : _this_lastVisibleChild_node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null;
|
|
9774
9819
|
// Update the colIndex of sibling nodes if this node has a colSpan.
|
|
9775
9820
|
if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
|
|
9776
9821
|
var _node_colIndex, _node_colSpan;
|
|
9777
9822
|
// This queues the next sibling for update, which means this happens recursively.
|
|
9778
|
-
let nextColIndex = ((_node_colIndex = node.colIndex) !== null && _node_colIndex !==
|
|
9823
|
+
let nextColIndex = ((_node_colIndex = node.colIndex) !== null && _node_colIndex !== void 0 ? _node_colIndex : node.index) + ((_node_colSpan = node.colSpan) !== null && _node_colSpan !== void 0 ? _node_colSpan : 1);
|
|
9779
9824
|
if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
|
|
9780
9825
|
let siblingNode = nextSibling.getMutableNode();
|
|
9781
9826
|
siblingNode.colIndex = nextColIndex;
|
|
@@ -9786,7 +9831,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
9786
9831
|
let node;
|
|
9787
9832
|
let { value: value1, textValue: textValue, id: id, ...props } = obj;
|
|
9788
9833
|
if (this.node == null) {
|
|
9789
|
-
node = new CollectionNodeClass(id !== null && id !==
|
|
9834
|
+
node = new CollectionNodeClass(id !== null && id !== void 0 ? id : `react-aria-${++this.ownerDocument.nodeId}`);
|
|
9790
9835
|
this.node = node;
|
|
9791
9836
|
} else node = this.getMutableNode();
|
|
9792
9837
|
props.ref = ref;
|
|
@@ -9794,6 +9839,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
9794
9839
|
node.rendered = rendered;
|
|
9795
9840
|
node.render = render;
|
|
9796
9841
|
node.value = value1;
|
|
9842
|
+
if (obj['aria-label']) node['aria-label'] = obj['aria-label'];
|
|
9797
9843
|
node.textValue = textValue || (typeof props.children === 'string' ? props.children : '') || obj['aria-label'] || '';
|
|
9798
9844
|
if (id != null && id !== node.key) throw new Error('Cannot change the id of an item');
|
|
9799
9845
|
if (props.colSpan != null) node.colSpan = props.colSpan;
|
|
@@ -9814,7 +9860,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
9814
9860
|
if (element.isHidden !== isHidden) {
|
|
9815
9861
|
var _element_parentNode, _element_parentNode1;
|
|
9816
9862
|
// Mark parent node dirty if this element is currently the first or last visible child.
|
|
9817
|
-
if (((_element_parentNode = element.parentNode) === null || _element_parentNode ===
|
|
9863
|
+
if (((_element_parentNode = element.parentNode) === null || _element_parentNode === void 0 ? void 0 : _element_parentNode.firstVisibleChild) === element || ((_element_parentNode1 = element.parentNode) === null || _element_parentNode1 === void 0 ? void 0 : _element_parentNode1.lastVisibleChild) === element) element.ownerDocument.markDirty(element.parentNode);
|
|
9818
9864
|
// Mark sibling visible elements dirty.
|
|
9819
9865
|
let prev = element.previousVisibleSibling;
|
|
9820
9866
|
let next = element.nextVisibleSibling;
|
|
@@ -9892,7 +9938,7 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
9892
9938
|
if (this.nextCollection) {
|
|
9893
9939
|
var _this_firstVisibleChild_node, _this_firstVisibleChild, _this_lastVisibleChild_node, _this_lastVisibleChild;
|
|
9894
9940
|
var _this_firstVisibleChild_node_key, _this_lastVisibleChild_node_key;
|
|
9895
|
-
this.nextCollection.commit((_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild ===
|
|
9941
|
+
this.nextCollection.commit((_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : (_this_firstVisibleChild_node = _this_firstVisibleChild.node) === null || _this_firstVisibleChild_node === void 0 ? void 0 : _this_firstVisibleChild_node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null, (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : (_this_lastVisibleChild_node = _this_lastVisibleChild.node) === null || _this_lastVisibleChild_node === void 0 ? void 0 : _this_lastVisibleChild_node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null, this.isSSR);
|
|
9896
9942
|
if (!this.isSSR) {
|
|
9897
9943
|
this.collection = this.nextCollection;
|
|
9898
9944
|
this.nextCollection = null;
|
|
@@ -9957,9 +10003,9 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
9957
10003
|
rendered = children(item);
|
|
9958
10004
|
var _rendered_props_id, _ref;
|
|
9959
10005
|
// @ts-ignore
|
|
9960
|
-
let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !==
|
|
10006
|
+
let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
|
|
9961
10007
|
if (key == null) throw new Error('Could not determine key for item');
|
|
9962
|
-
if (idScope) key = idScope + ':' + key;
|
|
10008
|
+
if (idScope != null) key = idScope + ':' + key;
|
|
9963
10009
|
// Note: only works if wrapped Item passes through id...
|
|
9964
10010
|
rendered = (cloneElement)(rendered, addIdAndValue ? {
|
|
9965
10011
|
key: key,
|
|
@@ -10112,7 +10158,7 @@ function requireUseSyncExternalStoreShim_production () {
|
|
|
10112
10158
|
? useSyncExternalStore$1
|
|
10113
10159
|
: useSyncExternalStore$2;
|
|
10114
10160
|
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
10115
|
-
|
|
10161
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
10116
10162
|
return useSyncExternalStoreShim_production;
|
|
10117
10163
|
}
|
|
10118
10164
|
|
|
@@ -10140,7 +10186,7 @@ function requireUseSyncExternalStoreShim_development () {
|
|
|
10140
10186
|
}
|
|
10141
10187
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
10142
10188
|
didWarnOld18Alpha ||
|
|
10143
|
-
|
|
10189
|
+
void 0 === React.startTransition ||
|
|
10144
10190
|
((didWarnOld18Alpha = true),
|
|
10145
10191
|
console.error(
|
|
10146
10192
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
@@ -10211,7 +10257,7 @@ function requireUseSyncExternalStoreShim_development () {
|
|
|
10211
10257
|
? useSyncExternalStore$1
|
|
10212
10258
|
: useSyncExternalStore$2;
|
|
10213
10259
|
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
10214
|
-
|
|
10260
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
10215
10261
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
10216
10262
|
"function" ===
|
|
10217
10263
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
@@ -10220,13 +10266,21 @@ function requireUseSyncExternalStoreShim_development () {
|
|
|
10220
10266
|
return useSyncExternalStoreShim_development;
|
|
10221
10267
|
}
|
|
10222
10268
|
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10269
|
+
var hasRequiredShim;
|
|
10270
|
+
|
|
10271
|
+
function requireShim () {
|
|
10272
|
+
if (hasRequiredShim) return shim.exports;
|
|
10273
|
+
hasRequiredShim = 1;
|
|
10274
|
+
|
|
10275
|
+
if (process.env.NODE_ENV === 'production') {
|
|
10276
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
10277
|
+
} else {
|
|
10278
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
10279
|
+
}
|
|
10280
|
+
return shim.exports;
|
|
10227
10281
|
}
|
|
10228
10282
|
|
|
10229
|
-
var shimExports =
|
|
10283
|
+
var shimExports = requireShim();
|
|
10230
10284
|
|
|
10231
10285
|
/*
|
|
10232
10286
|
* Copyright 2024 Adobe. All rights reserved.
|
|
@@ -10295,7 +10349,7 @@ const $e1995378a142960e$var$useSyncExternalStore = typeof ($dbSRa$react)['useSyn
|
|
|
10295
10349
|
function $e1995378a142960e$var$useCollectionDocument(createCollection) {
|
|
10296
10350
|
// The document instance is mutable, and should never change between renders.
|
|
10297
10351
|
// useSyncExternalStore is used to subscribe to updates, which vends immutable Collection objects.
|
|
10298
|
-
let [document] = (useState)(()=>new ($681cc3c98f569e39$export$b34a105447964f9f)((createCollection === null || createCollection ===
|
|
10352
|
+
let [document] = (useState)(()=>new ($681cc3c98f569e39$export$b34a105447964f9f)((createCollection === null || createCollection === void 0 ? void 0 : createCollection()) || new ($23b9f4fcf0fe224b$export$408d25a4e12db025)()));
|
|
10299
10353
|
let subscribe = (useCallback)((fn)=>document.subscribe(fn), [
|
|
10300
10354
|
document
|
|
10301
10355
|
]);
|
|
@@ -10337,7 +10391,7 @@ function $e1995378a142960e$var$useSSRCollectionNode(CollectionNodeClass, props,
|
|
|
10337
10391
|
// collection by the time we need to use the collection to render to the real DOM.
|
|
10338
10392
|
// After hydration, we switch to client rendering using the portal.
|
|
10339
10393
|
let itemRef = (useCallback)((element)=>{
|
|
10340
|
-
element === null || element ===
|
|
10394
|
+
element === null || element === void 0 ? void 0 : element.setProps(props, ref, CollectionNodeClass, rendered, render);
|
|
10341
10395
|
}, [
|
|
10342
10396
|
props,
|
|
10343
10397
|
ref,
|
|
@@ -10392,7 +10446,7 @@ function $e1995378a142960e$export$e953bb1cd0f19726(CollectionNodeClass, render,
|
|
|
10392
10446
|
var _useSSRCollectionNode;
|
|
10393
10447
|
return (_useSSRCollectionNode = $e1995378a142960e$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, children, (node)=>/*#__PURE__*/ ($dbSRa$react).createElement(Component, {
|
|
10394
10448
|
node: node
|
|
10395
|
-
}))) !== null && _useSSRCollectionNode !==
|
|
10449
|
+
}))) !== null && _useSSRCollectionNode !== void 0 ? _useSSRCollectionNode : /*#__PURE__*/ ($dbSRa$react).createElement(($dbSRa$react).Fragment, null);
|
|
10396
10450
|
});
|
|
10397
10451
|
// @ts-ignore
|
|
10398
10452
|
Result.displayName = render.name;
|
|
@@ -10407,8 +10461,9 @@ function $e1995378a142960e$var$useCollectionChildren(options) {
|
|
|
10407
10461
|
const $e1995378a142960e$var$CollectionContext = /*#__PURE__*/ (createContext)(null);
|
|
10408
10462
|
function $e1995378a142960e$export$fb8073518f34e6ec(props) {
|
|
10409
10463
|
let ctx = (useContext)($e1995378a142960e$var$CollectionContext);
|
|
10410
|
-
let dependencies = ((ctx === null || ctx ===
|
|
10411
|
-
|
|
10464
|
+
let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
|
|
10465
|
+
var _props_idScope;
|
|
10466
|
+
let idScope = (_props_idScope = props.idScope) !== null && _props_idScope !== void 0 ? _props_idScope : ctx === null || ctx === void 0 ? void 0 : ctx.idScope;
|
|
10412
10467
|
let children = $e1995378a142960e$var$useCollectionChildren({
|
|
10413
10468
|
...props,
|
|
10414
10469
|
idScope: idScope,
|
|
@@ -10498,7 +10553,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
|
|
|
10498
10553
|
let afterIndicators = [];
|
|
10499
10554
|
if (nextItemInSameLevel == null) {
|
|
10500
10555
|
let current = node;
|
|
10501
|
-
while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
|
|
10556
|
+
while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
|
|
10502
10557
|
let indicator = renderDropIndicator({
|
|
10503
10558
|
type: 'item',
|
|
10504
10559
|
key: current.key,
|
|
@@ -10564,7 +10619,7 @@ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
|
10564
10619
|
'aria-current': props['aria-current'],
|
|
10565
10620
|
onClick: (e)=>{
|
|
10566
10621
|
var _pressProps_onClick;
|
|
10567
|
-
(_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick ===
|
|
10622
|
+
(_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick === void 0 ? void 0 : _pressProps_onClick.call(pressProps, e);
|
|
10568
10623
|
($ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f)(e, router, props.href, props.routerOptions);
|
|
10569
10624
|
}
|
|
10570
10625
|
})
|
|
@@ -10679,9 +10734,9 @@ function $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref) {
|
|
|
10679
10734
|
onClick: onClick,
|
|
10680
10735
|
onPress (e) {
|
|
10681
10736
|
var _ref_current;
|
|
10682
|
-
onPress === null || onPress ===
|
|
10737
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
10683
10738
|
state.toggle();
|
|
10684
|
-
(_ref_current = ref.current) === null || _ref_current ===
|
|
10739
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
10685
10740
|
},
|
|
10686
10741
|
isDisabled: isDisabled || isReadOnly
|
|
10687
10742
|
});
|
|
@@ -10879,7 +10934,7 @@ function $3017fa7ffdddec74$export$8042c6c013fd5226(props = {}) {
|
|
|
10879
10934
|
var _props_defaultSelected;
|
|
10880
10935
|
return {
|
|
10881
10936
|
isSelected: isSelected,
|
|
10882
|
-
defaultSelected: (_props_defaultSelected = props.defaultSelected) !== null && _props_defaultSelected !==
|
|
10937
|
+
defaultSelected: (_props_defaultSelected = props.defaultSelected) !== null && _props_defaultSelected !== void 0 ? _props_defaultSelected : initialValue,
|
|
10883
10938
|
setSelected: updateSelected,
|
|
10884
10939
|
toggle: toggleState
|
|
10885
10940
|
};
|
|
@@ -10913,7 +10968,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
10913
10968
|
});
|
|
10914
10969
|
let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = ($1ae600c947479353$export$ec98120685d4f57d).get(state);
|
|
10915
10970
|
var _props_validationBehavior;
|
|
10916
|
-
validationBehavior = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
10971
|
+
validationBehavior = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : validationBehavior;
|
|
10917
10972
|
// Local validation for this checkbox.
|
|
10918
10973
|
let { realtimeValidation: realtimeValidation } = ($e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
10919
10974
|
...props,
|
|
@@ -10938,7 +10993,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
10938
10993
|
isDisabled: props.isDisabled || state.isDisabled,
|
|
10939
10994
|
name: props.name || name,
|
|
10940
10995
|
form: props.form || form,
|
|
10941
|
-
isRequired: (_props_isRequired = props.isRequired) !== null && _props_isRequired !==
|
|
10996
|
+
isRequired: (_props_isRequired = props.isRequired) !== null && _props_isRequired !== void 0 ? _props_isRequired : state.isRequired,
|
|
10942
10997
|
validationBehavior: validationBehavior,
|
|
10943
10998
|
[($e5be200c675c3b3a$export$a763b9476acd3eb)]: {
|
|
10944
10999
|
realtimeValidation: combinedRealtimeValidation,
|
|
@@ -11074,7 +11129,7 @@ function $5e910fae8e128ead$export$6e3e27031a30522f(props, state, ref) {
|
|
|
11074
11129
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
11075
11130
|
// Cancel any pending RAF to prevent stale updates
|
|
11076
11131
|
if (raf.current) cancelAnimationFrame(raf.current);
|
|
11077
|
-
if (ref.current && !
|
|
11132
|
+
if (ref.current && !isSSR) {
|
|
11078
11133
|
let panel = ref.current;
|
|
11079
11134
|
if (isExpandedRef.current == null || typeof panel.getAnimations !== 'function') {
|
|
11080
11135
|
// On initial render (and in tests), set attributes without animation.
|
|
@@ -11142,7 +11197,7 @@ function $5e910fae8e128ead$export$6e3e27031a30522f(props, state, ref) {
|
|
|
11142
11197
|
role: 'group',
|
|
11143
11198
|
'aria-labelledby': triggerId,
|
|
11144
11199
|
'aria-hidden': !state.isExpanded,
|
|
11145
|
-
hidden: isSSR
|
|
11200
|
+
hidden: isSSR ? !state.isExpanded : undefined
|
|
11146
11201
|
}
|
|
11147
11202
|
};
|
|
11148
11203
|
}
|
|
@@ -11160,7 +11215,7 @@ function $5e910fae8e128ead$export$6e3e27031a30522f(props, state, ref) {
|
|
|
11160
11215
|
*/ const $ce9b18daab526bbd$export$5b9bb410392e3991 = new WeakMap();
|
|
11161
11216
|
function $ce9b18daab526bbd$export$f45c25170b9a99c2(state, key) {
|
|
11162
11217
|
var _listMap_get;
|
|
11163
|
-
let { id: id } = (_listMap_get = $ce9b18daab526bbd$export$5b9bb410392e3991.get(state)) !== null && _listMap_get !==
|
|
11218
|
+
let { id: id } = (_listMap_get = $ce9b18daab526bbd$export$5b9bb410392e3991.get(state)) !== null && _listMap_get !== void 0 ? _listMap_get : {};
|
|
11164
11219
|
if (!id) throw new Error('Unknown list');
|
|
11165
11220
|
return `${id}-${$ce9b18daab526bbd$export$e0c709538cb8ae18(key)}`;
|
|
11166
11221
|
}
|
|
@@ -11739,14 +11794,14 @@ function $92599c3fd427b763$export$137e594ef3218a10(props, state) {
|
|
|
11739
11794
|
let { getRowText: getRowText = (key)=>{
|
|
11740
11795
|
var _state_collection_getTextValue, _state_collection, _state_collection_getItem;
|
|
11741
11796
|
var _state_collection_getTextValue1;
|
|
11742
|
-
return (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue ===
|
|
11797
|
+
return (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue === void 0 ? void 0 : _state_collection_getTextValue.call(_state_collection, key)) !== null && _state_collection_getTextValue1 !== void 0 ? _state_collection_getTextValue1 : (_state_collection_getItem = state.collection.getItem(key)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.textValue;
|
|
11743
11798
|
} } = props;
|
|
11744
11799
|
let stringFormatter = ($fca6afa0e843324b$export$f12b703ca79dfbb1)((($parcel$interopDefault$3($835c96616a7cb4f9$exports))), '@react-aria/grid');
|
|
11745
11800
|
// Many screen readers do not announce when items in a grid are selected/deselected.
|
|
11746
11801
|
// We do this using an ARIA live region.
|
|
11747
11802
|
let selection = state.selectionManager.rawSelection;
|
|
11748
11803
|
let lastSelection = (useRef)(selection);
|
|
11749
|
-
let announceSelectionChange = (
|
|
11804
|
+
let announceSelectionChange = (useCallback)(()=>{
|
|
11750
11805
|
var _lastSelection_current;
|
|
11751
11806
|
if (!state.selectionManager.isFocused || selection === lastSelection.current) {
|
|
11752
11807
|
lastSelection.current = selection;
|
|
@@ -11784,13 +11839,23 @@ function $92599c3fd427b763$export$137e594ef3218a10(props, state) {
|
|
|
11784
11839
|
}
|
|
11785
11840
|
// Announce how many items are selected, except when selecting the first item.
|
|
11786
11841
|
if (state.selectionManager.selectionMode === 'multiple') {
|
|
11787
|
-
if (messages.length === 0 || selection === 'all' || selection.size > 1 || lastSelection.current === 'all' || ((_lastSelection_current = lastSelection.current) === null || _lastSelection_current ===
|
|
11842
|
+
if (messages.length === 0 || selection === 'all' || selection.size > 1 || lastSelection.current === 'all' || ((_lastSelection_current = lastSelection.current) === null || _lastSelection_current === void 0 ? void 0 : _lastSelection_current.size) > 1) messages.push(selection === 'all' ? stringFormatter.format('selectedAll') : stringFormatter.format('selectedCount', {
|
|
11788
11843
|
count: selection.size
|
|
11789
11844
|
}));
|
|
11790
11845
|
}
|
|
11791
11846
|
if (messages.length > 0) ($319e236875307eab$export$a9b970dcc4ae71a9)(messages.join(' '));
|
|
11792
11847
|
lastSelection.current = selection;
|
|
11793
|
-
}
|
|
11848
|
+
}, [
|
|
11849
|
+
selection,
|
|
11850
|
+
state.selectionManager.selectedKeys,
|
|
11851
|
+
state.selectionManager.isFocused,
|
|
11852
|
+
state.selectionManager.selectionBehavior,
|
|
11853
|
+
state.selectionManager.selectionMode,
|
|
11854
|
+
state.collection,
|
|
11855
|
+
getRowText,
|
|
11856
|
+
stringFormatter
|
|
11857
|
+
]);
|
|
11858
|
+
// useUpdateEffect will handle using useEffectEvent, no need to stabilize anything on this end
|
|
11794
11859
|
($4f58c5f72bcf79f7$export$496315a1608d9602)(()=>{
|
|
11795
11860
|
if (state.selectionManager.isFocused) announceSelectionChange();
|
|
11796
11861
|
else {
|
|
@@ -11961,7 +12026,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
11961
12026
|
var _ref_current;
|
|
11962
12027
|
// Don't shift focus to the row if the active element is a element within the row already
|
|
11963
12028
|
// (e.g. clicking on a row button)
|
|
11964
|
-
if (ref.current !== null && (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !((_ref_current = ref.current) === null || _ref_current ===
|
|
12029
|
+
if (ref.current !== null && (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(document.activeElement)))) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
|
|
11965
12030
|
};
|
|
11966
12031
|
let treeGridRowProps = {};
|
|
11967
12032
|
let hasChildRows = props.hasChildItems;
|
|
@@ -11970,19 +12035,19 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
11970
12035
|
var _state_collection_getChildren, _state_collection;
|
|
11971
12036
|
// TODO: ideally node.hasChildNodes would be a way to tell if a row has child nodes, but the row's contents make it so that value is always
|
|
11972
12037
|
// true...
|
|
11973
|
-
let children = (_state_collection_getChildren = (_state_collection = state.collection).getChildren) === null || _state_collection_getChildren ===
|
|
12038
|
+
let children = (_state_collection_getChildren = (_state_collection = state.collection).getChildren) === null || _state_collection_getChildren === void 0 ? void 0 : _state_collection_getChildren.call(_state_collection, node.key);
|
|
11974
12039
|
hasChildRows = hasChildRows || [
|
|
11975
|
-
...children !== null && children !==
|
|
12040
|
+
...children !== null && children !== void 0 ? children : []
|
|
11976
12041
|
].length > 1;
|
|
11977
12042
|
if (onAction == null && !hasLink && state.selectionManager.selectionMode === 'none' && hasChildRows) onAction = ()=>state.toggleKey(node.key);
|
|
11978
12043
|
let isExpanded = hasChildRows ? state.expandedKeys.has(node.key) : undefined;
|
|
11979
12044
|
let setSize = 1;
|
|
11980
|
-
if (node.level > 0 && (node === null || node ===
|
|
12045
|
+
if (node.level > 0 && (node === null || node === void 0 ? void 0 : node.parentKey) != null) {
|
|
11981
12046
|
let parent = state.collection.getItem(node.parentKey);
|
|
11982
12047
|
if (parent) {
|
|
11983
12048
|
var _state_collection_getChildren1, _state_collection1;
|
|
11984
12049
|
// siblings must exist because our original node exists
|
|
11985
|
-
let siblings = (_state_collection_getChildren1 = (_state_collection1 = state.collection).getChildren) === null || _state_collection_getChildren1 ===
|
|
12050
|
+
let siblings = (_state_collection_getChildren1 = (_state_collection1 = state.collection).getChildren) === null || _state_collection_getChildren1 === void 0 ? void 0 : _state_collection_getChildren1.call(_state_collection1, parent.key);
|
|
11986
12051
|
setSize = [
|
|
11987
12052
|
...siblings
|
|
11988
12053
|
].filter((row)=>row.type === 'item').length;
|
|
@@ -11993,7 +12058,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
11993
12058
|
treeGridRowProps = {
|
|
11994
12059
|
'aria-expanded': isExpanded,
|
|
11995
12060
|
'aria-level': node.level + 1,
|
|
11996
|
-
'aria-posinset': (node === null || node ===
|
|
12061
|
+
'aria-posinset': (node === null || node === void 0 ? void 0 : node.index) + 1,
|
|
11997
12062
|
'aria-setsize': setSize
|
|
11998
12063
|
};
|
|
11999
12064
|
}
|
|
@@ -12003,7 +12068,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
12003
12068
|
ref: ref,
|
|
12004
12069
|
isVirtualized: isVirtualized,
|
|
12005
12070
|
shouldSelectOnPressUp: props.shouldSelectOnPressUp || shouldSelectOnPressUp,
|
|
12006
|
-
onAction: onAction || ((_node_props = node.props) === null || _node_props ===
|
|
12071
|
+
onAction: onAction || ((_node_props = node.props) === null || _node_props === void 0 ? void 0 : _node_props.onAction) ? ($ff5963eb1fccf552$export$e08e3b67e392101e)((_node_props1 = node.props) === null || _node_props1 === void 0 ? void 0 : _node_props1.onAction, onAction ? ()=>onAction(node.key) : undefined) : undefined,
|
|
12007
12072
|
focus: focus,
|
|
12008
12073
|
linkBehavior: linkBehavior
|
|
12009
12074
|
});
|
|
@@ -12096,7 +12161,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
12096
12161
|
var _ref_current_parentElement;
|
|
12097
12162
|
e.stopPropagation();
|
|
12098
12163
|
e.preventDefault();
|
|
12099
|
-
(_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement ===
|
|
12164
|
+
(_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
12100
12165
|
}
|
|
12101
12166
|
break;
|
|
12102
12167
|
}
|
|
@@ -12147,10 +12212,10 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
12147
12212
|
onKeyDown: onKeyDown,
|
|
12148
12213
|
onFocus: onFocus,
|
|
12149
12214
|
// 'aria-label': [(node.textValue || undefined), rowAnnouncement].filter(Boolean).join(', '),
|
|
12150
|
-
'aria-label': node.textValue || undefined,
|
|
12215
|
+
'aria-label': node['aria-label'] || node.textValue || undefined,
|
|
12151
12216
|
'aria-selected': state.selectionManager.canSelectItem(node.key) ? state.selectionManager.isSelected(node.key) : undefined,
|
|
12152
12217
|
'aria-disabled': state.selectionManager.isDisabled(node.key) || undefined,
|
|
12153
|
-
'aria-labelledby': descriptionId && node.textValue ? `${($ce9b18daab526bbd$export$f45c25170b9a99c2)(state, node.key)} ${descriptionId}` : undefined,
|
|
12218
|
+
'aria-labelledby': descriptionId && (node['aria-label'] || node.textValue) ? `${($ce9b18daab526bbd$export$f45c25170b9a99c2)(state, node.key)} ${descriptionId}` : undefined,
|
|
12154
12219
|
id: ($ce9b18daab526bbd$export$f45c25170b9a99c2)(state, node.key)
|
|
12155
12220
|
});
|
|
12156
12221
|
if (isVirtualized) {
|
|
@@ -12163,7 +12228,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
12163
12228
|
...collection.getKeys()
|
|
12164
12229
|
].filter((key)=>{
|
|
12165
12230
|
var _collection_getItem;
|
|
12166
|
-
return ((_collection_getItem = collection.getItem(key)) === null || _collection_getItem ===
|
|
12231
|
+
return ((_collection_getItem = collection.getItem(key)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.type) !== 'section';
|
|
12167
12232
|
}).findIndex((key)=>key === node.key) + 1 : node.index + 1;
|
|
12168
12233
|
}
|
|
12169
12234
|
let gridCellProps = {
|
|
@@ -12250,9 +12315,9 @@ function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
12250
12315
|
isDisabled: isDisabled,
|
|
12251
12316
|
onPress (e) {
|
|
12252
12317
|
var _ref_current;
|
|
12253
|
-
onPress === null || onPress ===
|
|
12318
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
12254
12319
|
state.setSelectedValue(value);
|
|
12255
|
-
(_ref_current = ref.current) === null || _ref_current ===
|
|
12320
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
12256
12321
|
}
|
|
12257
12322
|
});
|
|
12258
12323
|
let { focusableProps: focusableProps } = ($f645667febf57a63$export$4c014de7c8940b4c)(($3ef42575df84b30b$export$9d1611c77c2fe928)(props, {
|
|
@@ -12339,7 +12404,7 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
|
|
|
12339
12404
|
let { focusWithinProps: focusWithinProps } = ($9ab94262bd0047c7$export$420e68273165f4ec)({
|
|
12340
12405
|
onBlurWithin (e) {
|
|
12341
12406
|
var _props_onBlur;
|
|
12342
|
-
(_props_onBlur = props.onBlur) === null || _props_onBlur ===
|
|
12407
|
+
(_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);
|
|
12343
12408
|
if (!state.selectedValue) state.setLastFocusedValue(null);
|
|
12344
12409
|
},
|
|
12345
12410
|
onFocusWithin: props.onFocus,
|
|
@@ -12466,7 +12531,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
12466
12531
|
var _delegate_getKeyAbove, _delegate_getFirstKey;
|
|
12467
12532
|
// prevent scrolling containers
|
|
12468
12533
|
e.preventDefault();
|
|
12469
|
-
let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove ===
|
|
12534
|
+
let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, state.selectedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
12470
12535
|
if (key) state.setSelectedKey(key);
|
|
12471
12536
|
break;
|
|
12472
12537
|
}
|
|
@@ -12475,7 +12540,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
12475
12540
|
var _delegate_getKeyBelow, _delegate_getFirstKey1;
|
|
12476
12541
|
// prevent scrolling containers
|
|
12477
12542
|
e.preventDefault();
|
|
12478
|
-
let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow ===
|
|
12543
|
+
let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, state.selectedKey) : (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate);
|
|
12479
12544
|
if (key) state.setSelectedKey(key);
|
|
12480
12545
|
break;
|
|
12481
12546
|
}
|
|
@@ -12516,7 +12581,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
12516
12581
|
onClick: ()=>{
|
|
12517
12582
|
if (!props.isDisabled) {
|
|
12518
12583
|
var _ref_current;
|
|
12519
|
-
(_ref_current = ref.current) === null || _ref_current ===
|
|
12584
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
12520
12585
|
// Show the focus ring so the user knows where focus went
|
|
12521
12586
|
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
12522
12587
|
}
|
|
@@ -12614,7 +12679,7 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
12614
12679
|
validationBehavior: validationBehavior,
|
|
12615
12680
|
focus: ()=>{
|
|
12616
12681
|
var _triggerRef_current;
|
|
12617
|
-
return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current ===
|
|
12682
|
+
return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
|
|
12618
12683
|
}
|
|
12619
12684
|
}, state, props.selectRef);
|
|
12620
12685
|
let setValue = state.setValue;
|
|
@@ -12653,7 +12718,7 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
12653
12718
|
required: validationBehavior === 'native' && isRequired,
|
|
12654
12719
|
name: name,
|
|
12655
12720
|
form: form,
|
|
12656
|
-
value: (_state_value = state.value) !== null && _state_value !==
|
|
12721
|
+
value: (_state_value = state.value) !== null && _state_value !== void 0 ? _state_value : '',
|
|
12657
12722
|
onChange: onChange,
|
|
12658
12723
|
onInput: onChange
|
|
12659
12724
|
}
|
|
@@ -12702,7 +12767,7 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
12702
12767
|
name: name,
|
|
12703
12768
|
form: form,
|
|
12704
12769
|
disabled: isDisabled,
|
|
12705
|
-
value: value !== null && value !==
|
|
12770
|
+
value: value !== null && value !== void 0 ? value : ''
|
|
12706
12771
|
};
|
|
12707
12772
|
if (validationBehavior === 'native') // Use a hidden <input type="text"> rather than <input type="hidden">
|
|
12708
12773
|
// so that an empty value blocks HTML form submission when the field is required.
|
|
@@ -13138,8 +13203,8 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
13138
13203
|
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
13139
13204
|
if (isDisabled) return;
|
|
13140
13205
|
e.preventDefault();
|
|
13141
|
-
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove ===
|
|
13142
|
-
else onRemove === null || onRemove ===
|
|
13206
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
13207
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
13143
13208
|
item.key
|
|
13144
13209
|
]));
|
|
13145
13210
|
}
|
|
@@ -13198,8 +13263,8 @@ function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) {
|
|
|
13198
13263
|
labelable: true
|
|
13199
13264
|
});
|
|
13200
13265
|
let { hoverProps: hoverProps } = ($6179b936705e76d3$export$ae780daf29e6d456)({
|
|
13201
|
-
onHoverStart: ()=>state === null || state ===
|
|
13202
|
-
onHoverEnd: ()=>state === null || state ===
|
|
13266
|
+
onHoverStart: ()=>state === null || state === void 0 ? void 0 : state.open(true),
|
|
13267
|
+
onHoverEnd: ()=>state === null || state === void 0 ? void 0 : state.close()
|
|
13203
13268
|
});
|
|
13204
13269
|
return {
|
|
13205
13270
|
tooltipProps: ($3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, hoverProps, {
|
|
@@ -13222,7 +13287,7 @@ function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) {
|
|
|
13222
13287
|
|
|
13223
13288
|
|
|
13224
13289
|
function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
13225
|
-
let { isDisabled: isDisabled, trigger: trigger } = props;
|
|
13290
|
+
let { isDisabled: isDisabled, trigger: trigger, shouldCloseOnPress: shouldCloseOnPress = true } = props;
|
|
13226
13291
|
let tooltipId = ($bdb11010cef70236$export$f680877a34711e37)();
|
|
13227
13292
|
let isHovered = (useRef)(false);
|
|
13228
13293
|
let isFocused = (useRef)(false);
|
|
@@ -13271,6 +13336,8 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
13271
13336
|
handleHide();
|
|
13272
13337
|
};
|
|
13273
13338
|
let onPressStart = ()=>{
|
|
13339
|
+
// if shouldCloseOnPress is false, we should not close the tooltip
|
|
13340
|
+
if (!shouldCloseOnPress) return;
|
|
13274
13341
|
// no matter how the trigger is pressed, we should close the tooltip
|
|
13275
13342
|
isFocused.current = false;
|
|
13276
13343
|
isHovered.current = false;
|
|
@@ -13444,7 +13511,7 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ ($f39a9eba43920a
|
|
|
13444
13511
|
isFocused: isFocused,
|
|
13445
13512
|
isFocusVisible: isFocusVisible,
|
|
13446
13513
|
isDisabled: props.isDisabled || false,
|
|
13447
|
-
isPending: isPending !== null && isPending !==
|
|
13514
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
13448
13515
|
};
|
|
13449
13516
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
13450
13517
|
...props,
|
|
@@ -13561,7 +13628,7 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13561
13628
|
const state = {
|
|
13562
13629
|
...validation,
|
|
13563
13630
|
value: selectedValues,
|
|
13564
|
-
defaultValue: (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !==
|
|
13631
|
+
defaultValue: (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : initialValues,
|
|
13565
13632
|
setValue (value) {
|
|
13566
13633
|
if (props.isReadOnly || props.isDisabled) return;
|
|
13567
13634
|
setValue(value);
|
|
@@ -13573,10 +13640,10 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13573
13640
|
},
|
|
13574
13641
|
addValue (value) {
|
|
13575
13642
|
if (props.isReadOnly || props.isDisabled) return;
|
|
13576
|
-
|
|
13577
|
-
selectedValues
|
|
13578
|
-
|
|
13579
|
-
}
|
|
13643
|
+
setValue((selectedValues)=>{
|
|
13644
|
+
if (!selectedValues.includes(value)) return selectedValues.concat(value);
|
|
13645
|
+
return selectedValues;
|
|
13646
|
+
});
|
|
13580
13647
|
},
|
|
13581
13648
|
removeValue (value) {
|
|
13582
13649
|
if (props.isReadOnly || props.isDisabled) return;
|
|
@@ -13594,7 +13661,7 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13594
13661
|
invalidValues.current = s;
|
|
13595
13662
|
validation.updateValidation(($e5be200c675c3b3a$export$75ee7c75d68f5b0e)(...s.values()));
|
|
13596
13663
|
},
|
|
13597
|
-
validationState: (_props_validationState = props.validationState) !== null && _props_validationState !==
|
|
13664
|
+
validationState: (_props_validationState = props.validationState) !== null && _props_validationState !== void 0 ? _props_validationState : isInvalid ? 'invalid' : null,
|
|
13598
13665
|
isInvalid: isInvalid,
|
|
13599
13666
|
isRequired: isRequired
|
|
13600
13667
|
};
|
|
@@ -13624,12 +13691,12 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13624
13691
|
getKeyBefore(key) {
|
|
13625
13692
|
let node = this.keyMap.get(key);
|
|
13626
13693
|
var _node_prevKey;
|
|
13627
|
-
return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !==
|
|
13694
|
+
return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !== void 0 ? _node_prevKey : null : null;
|
|
13628
13695
|
}
|
|
13629
13696
|
getKeyAfter(key) {
|
|
13630
13697
|
let node = this.keyMap.get(key);
|
|
13631
13698
|
var _node_nextKey;
|
|
13632
|
-
return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !==
|
|
13699
|
+
return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !== void 0 ? _node_nextKey : null : null;
|
|
13633
13700
|
}
|
|
13634
13701
|
getFirstKey() {
|
|
13635
13702
|
return this.firstKey;
|
|
@@ -13639,7 +13706,7 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13639
13706
|
}
|
|
13640
13707
|
getItem(key) {
|
|
13641
13708
|
var _this_keyMap_get;
|
|
13642
|
-
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !==
|
|
13709
|
+
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
|
|
13643
13710
|
}
|
|
13644
13711
|
at(idx) {
|
|
13645
13712
|
const keys = [
|
|
@@ -13649,7 +13716,7 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13649
13716
|
}
|
|
13650
13717
|
getChildren(key) {
|
|
13651
13718
|
let node = this.keyMap.get(key);
|
|
13652
|
-
return (node === null || node ===
|
|
13719
|
+
return (node === null || node === void 0 ? void 0 : node.childNodes) || [];
|
|
13653
13720
|
}
|
|
13654
13721
|
constructor(nodes){
|
|
13655
13722
|
this.keyMap = new Map();
|
|
@@ -13683,7 +13750,7 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13683
13750
|
}
|
|
13684
13751
|
this._size = size;
|
|
13685
13752
|
var _last_key;
|
|
13686
|
-
this.lastKey = (_last_key = last === null || last ===
|
|
13753
|
+
this.lastKey = (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
13687
13754
|
}
|
|
13688
13755
|
}
|
|
13689
13756
|
|
|
@@ -13701,11 +13768,11 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
13701
13768
|
constructor(keys, anchorKey, currentKey){
|
|
13702
13769
|
super(keys);
|
|
13703
13770
|
if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
|
|
13704
|
-
this.anchorKey = anchorKey !== null && anchorKey !==
|
|
13705
|
-
this.currentKey = currentKey !== null && currentKey !==
|
|
13771
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
|
|
13772
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
|
|
13706
13773
|
} else {
|
|
13707
|
-
this.anchorKey = anchorKey !== null && anchorKey !==
|
|
13708
|
-
this.currentKey = currentKey !== null && currentKey !==
|
|
13774
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
|
|
13775
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
|
|
13709
13776
|
}
|
|
13710
13777
|
}
|
|
13711
13778
|
}
|
|
@@ -13897,7 +13964,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
13897
13964
|
if (!first || item && ($c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, first) < 0) first = item;
|
|
13898
13965
|
}
|
|
13899
13966
|
var _first_key;
|
|
13900
|
-
return (_first_key = first === null || first ===
|
|
13967
|
+
return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
|
|
13901
13968
|
}
|
|
13902
13969
|
get lastSelectedKey() {
|
|
13903
13970
|
let last = null;
|
|
@@ -13906,7 +13973,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
13906
13973
|
if (!last || item && ($c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, last) > 0) last = item;
|
|
13907
13974
|
}
|
|
13908
13975
|
var _last_key;
|
|
13909
|
-
return (_last_key = last === null || last ===
|
|
13976
|
+
return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
13910
13977
|
}
|
|
13911
13978
|
get disabledKeys() {
|
|
13912
13979
|
return this.state.disabledKeys;
|
|
@@ -13932,10 +13999,10 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
13932
13999
|
else {
|
|
13933
14000
|
let selectedKeys = this.state.selectedKeys;
|
|
13934
14001
|
var _selectedKeys_anchorKey;
|
|
13935
|
-
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !==
|
|
14002
|
+
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
|
|
13936
14003
|
selection = new ($e40ea825a81a3709$export$52baac22726c72bf)(selectedKeys, anchorKey, mappedToKey);
|
|
13937
14004
|
var _selectedKeys_currentKey;
|
|
13938
|
-
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !==
|
|
14005
|
+
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey))selection.delete(key);
|
|
13939
14006
|
for (let key of this.getKeyRange(mappedToKey, anchorKey))if (this.canSelectItem(key)) selection.add(key);
|
|
13940
14007
|
}
|
|
13941
14008
|
this.state.setSelectedKeys(selection);
|
|
@@ -13951,7 +14018,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
13951
14018
|
}
|
|
13952
14019
|
getKeyRangeInternal(from, to) {
|
|
13953
14020
|
var _this_layoutDelegate;
|
|
13954
|
-
if ((_this_layoutDelegate = this.layoutDelegate) === null || _this_layoutDelegate ===
|
|
14021
|
+
if ((_this_layoutDelegate = this.layoutDelegate) === null || _this_layoutDelegate === void 0 ? void 0 : _this_layoutDelegate.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
|
|
13955
14022
|
let keys = [];
|
|
13956
14023
|
let key = from;
|
|
13957
14024
|
while(key != null){
|
|
@@ -14025,10 +14092,10 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
14025
14092
|
if (this.canSelectItem(key)) {
|
|
14026
14093
|
var _getFirstItem;
|
|
14027
14094
|
let item = this.collection.getItem(key);
|
|
14028
|
-
if ((item === null || item ===
|
|
14095
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 'item') keys.push(key);
|
|
14029
14096
|
var _getFirstItem_key;
|
|
14030
14097
|
// Add child keys. If cell selection is allowed, then include item children too.
|
|
14031
|
-
if ((item === null || item ===
|
|
14098
|
+
if ((item === null || item === void 0 ? void 0 : item.hasChildNodes) && (this.allowsCellSelection || item.type !== 'item')) addKeys((_getFirstItem_key = (_getFirstItem = ($c5a24bc478652b5f$export$fbdeaa6a76694f71)(($c5a24bc478652b5f$export$1005530eda016c13)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null);
|
|
14032
14099
|
}
|
|
14033
14100
|
key = this.collection.getKeyAfter(key);
|
|
14034
14101
|
}
|
|
@@ -14080,20 +14147,20 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
14080
14147
|
var _item_props;
|
|
14081
14148
|
if (this.state.selectionMode === 'none' || this.state.disabledKeys.has(key)) return false;
|
|
14082
14149
|
let item = this.collection.getItem(key);
|
|
14083
|
-
if (!item || (item === null || item ===
|
|
14150
|
+
if (!item || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || item.type === 'cell' && !this.allowsCellSelection) return false;
|
|
14084
14151
|
return true;
|
|
14085
14152
|
}
|
|
14086
14153
|
isDisabled(key) {
|
|
14087
14154
|
var _this_collection_getItem_props, _this_collection_getItem;
|
|
14088
|
-
return this.state.disabledBehavior === 'all' && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem ===
|
|
14155
|
+
return this.state.disabledBehavior === 'all' && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled));
|
|
14089
14156
|
}
|
|
14090
14157
|
isLink(key) {
|
|
14091
14158
|
var _this_collection_getItem_props, _this_collection_getItem;
|
|
14092
|
-
return !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem ===
|
|
14159
|
+
return !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.href);
|
|
14093
14160
|
}
|
|
14094
14161
|
getItemProps(key) {
|
|
14095
14162
|
var _this_collection_getItem;
|
|
14096
|
-
return (_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem ===
|
|
14163
|
+
return (_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : _this_collection_getItem.props;
|
|
14097
14164
|
}
|
|
14098
14165
|
withCollection(collection) {
|
|
14099
14166
|
return new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(collection, this.state, {
|
|
@@ -14105,9 +14172,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
14105
14172
|
this.collection = collection;
|
|
14106
14173
|
this.state = state;
|
|
14107
14174
|
var _options_allowsCellSelection;
|
|
14108
|
-
this.allowsCellSelection = (_options_allowsCellSelection = options === null || options ===
|
|
14175
|
+
this.allowsCellSelection = (_options_allowsCellSelection = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && _options_allowsCellSelection !== void 0 ? _options_allowsCellSelection : false;
|
|
14109
14176
|
this._isSelectAll = null;
|
|
14110
|
-
this.layoutDelegate = (options === null || options ===
|
|
14177
|
+
this.layoutDelegate = (options === null || options === void 0 ? void 0 : options.layoutDelegate) || null;
|
|
14111
14178
|
}
|
|
14112
14179
|
}
|
|
14113
14180
|
|
|
@@ -14177,18 +14244,18 @@ function $e72dd72e1c76a225$var$useFocusedKeyReset(collection, selectionManager)
|
|
|
14177
14244
|
...cachedCollection.current.getKeys()
|
|
14178
14245
|
].map((key)=>{
|
|
14179
14246
|
const itemNode = cachedCollection.current.getItem(key);
|
|
14180
|
-
return (itemNode === null || itemNode ===
|
|
14247
|
+
return (itemNode === null || itemNode === void 0 ? void 0 : itemNode.type) === 'item' ? itemNode : null;
|
|
14181
14248
|
}).filter((node)=>node !== null);
|
|
14182
14249
|
const itemNodes = [
|
|
14183
14250
|
...collection.getKeys()
|
|
14184
14251
|
].map((key)=>{
|
|
14185
14252
|
const itemNode = collection.getItem(key);
|
|
14186
|
-
return (itemNode === null || itemNode ===
|
|
14253
|
+
return (itemNode === null || itemNode === void 0 ? void 0 : itemNode.type) === 'item' ? itemNode : null;
|
|
14187
14254
|
}).filter((node)=>node !== null);
|
|
14188
14255
|
var _cachedItemNodes_length, _itemNodes_length;
|
|
14189
|
-
const diff = ((_cachedItemNodes_length = cachedItemNodes === null || cachedItemNodes ===
|
|
14256
|
+
const diff = ((_cachedItemNodes_length = cachedItemNodes === null || cachedItemNodes === void 0 ? void 0 : cachedItemNodes.length) !== null && _cachedItemNodes_length !== void 0 ? _cachedItemNodes_length : 0) - ((_itemNodes_length = itemNodes === null || itemNodes === void 0 ? void 0 : itemNodes.length) !== null && _itemNodes_length !== void 0 ? _itemNodes_length : 0);
|
|
14190
14257
|
var _startItem_index, _startItem_index1, _itemNodes_length1;
|
|
14191
|
-
let index = Math.min(diff > 1 ? Math.max(((_startItem_index = startItem === null || startItem ===
|
|
14258
|
+
let index = Math.min(diff > 1 ? Math.max(((_startItem_index = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index !== void 0 ? _startItem_index : 0) - diff + 1, 0) : (_startItem_index1 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index1 !== void 0 ? _startItem_index1 : 0, ((_itemNodes_length1 = itemNodes === null || itemNodes === void 0 ? void 0 : itemNodes.length) !== null && _itemNodes_length1 !== void 0 ? _itemNodes_length1 : 0) - 1);
|
|
14192
14259
|
let newNode = null;
|
|
14193
14260
|
let isReverseSearching = false;
|
|
14194
14261
|
while(index >= 0){
|
|
@@ -14201,7 +14268,7 @@ function $e72dd72e1c76a225$var$useFocusedKeyReset(collection, selectionManager)
|
|
|
14201
14268
|
else {
|
|
14202
14269
|
isReverseSearching = true;
|
|
14203
14270
|
var _startItem_index2, _startItem_index3;
|
|
14204
|
-
if (index > ((_startItem_index2 = startItem === null || startItem ===
|
|
14271
|
+
if (index > ((_startItem_index2 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index2 !== void 0 ? _startItem_index2 : 0)) index = (_startItem_index3 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index3 !== void 0 ? _startItem_index3 : 0;
|
|
14205
14272
|
index--;
|
|
14206
14273
|
}
|
|
14207
14274
|
}
|
|
@@ -14416,7 +14483,7 @@ function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
|
|
|
14416
14483
|
props.name
|
|
14417
14484
|
]);
|
|
14418
14485
|
var _props_defaultValue;
|
|
14419
|
-
let [selectedValue, setSelected] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !==
|
|
14486
|
+
let [selectedValue, setSelected] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
|
|
14420
14487
|
let [initialValue] = (useState)(selectedValue);
|
|
14421
14488
|
let [lastFocusedValue, setLastFocusedValue] = (useState)(null);
|
|
14422
14489
|
let validation = ($e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
@@ -14435,7 +14502,7 @@ function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
|
|
|
14435
14502
|
...validation,
|
|
14436
14503
|
name: name,
|
|
14437
14504
|
selectedValue: selectedValue,
|
|
14438
|
-
defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !==
|
|
14505
|
+
defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !== void 0 ? _props_defaultValue1 : null,
|
|
14439
14506
|
setSelectedValue: setSelectedValue,
|
|
14440
14507
|
lastFocusedValue: lastFocusedValue,
|
|
14441
14508
|
setLastFocusedValue: setLastFocusedValue,
|
|
@@ -14468,7 +14535,7 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
|
14468
14535
|
let [focusStrategy, setFocusStrategy] = (useState)(null);
|
|
14469
14536
|
let defaultValue = (useMemo)(()=>{
|
|
14470
14537
|
var _props_defaultSelectedKey;
|
|
14471
|
-
return props.defaultValue !== undefined ? props.defaultValue : selectionMode === 'single' ? (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !==
|
|
14538
|
+
return props.defaultValue !== undefined ? props.defaultValue : selectionMode === 'single' ? (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : null : [];
|
|
14472
14539
|
}, [
|
|
14473
14540
|
props.defaultValue,
|
|
14474
14541
|
props.defaultSelectedKey,
|
|
@@ -14488,9 +14555,9 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
|
14488
14555
|
if (selectionMode === 'single') {
|
|
14489
14556
|
var _props_onSelectionChange;
|
|
14490
14557
|
var _value_;
|
|
14491
|
-
let key = Array.isArray(value) ? (_value_ = value[0]) !== null && _value_ !==
|
|
14558
|
+
let key = Array.isArray(value) ? (_value_ = value[0]) !== null && _value_ !== void 0 ? _value_ : null : value;
|
|
14492
14559
|
setControlledValue(key);
|
|
14493
|
-
if (key !== displayValue) (_props_onSelectionChange = props.onSelectionChange) === null || _props_onSelectionChange ===
|
|
14560
|
+
if (key !== displayValue) (_props_onSelectionChange = props.onSelectionChange) === null || _props_onSelectionChange === void 0 ? void 0 : _props_onSelectionChange.call(props, key);
|
|
14494
14561
|
} else {
|
|
14495
14562
|
let keys = [];
|
|
14496
14563
|
if (Array.isArray(value)) keys = value;
|
|
@@ -14513,7 +14580,7 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
|
14513
14580
|
if (keys === 'all') return;
|
|
14514
14581
|
if (selectionMode === 'single') {
|
|
14515
14582
|
var _keys_values_next_value;
|
|
14516
|
-
let key = (_keys_values_next_value = keys.values().next().value) !== null && _keys_values_next_value !==
|
|
14583
|
+
let key = (_keys_values_next_value = keys.values().next().value) !== null && _keys_values_next_value !== void 0 ? _keys_values_next_value : null;
|
|
14517
14584
|
setValue(key);
|
|
14518
14585
|
triggerState.close();
|
|
14519
14586
|
} else setValue([
|
|
@@ -14543,23 +14610,23 @@ function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
|
14543
14610
|
...listState,
|
|
14544
14611
|
...triggerState,
|
|
14545
14612
|
value: displayValue,
|
|
14546
|
-
defaultValue: defaultValue !== null && defaultValue !==
|
|
14613
|
+
defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : initialValue,
|
|
14547
14614
|
setValue: setValue,
|
|
14548
14615
|
selectedKey: selectedKey,
|
|
14549
14616
|
setSelectedKey: setValue,
|
|
14550
|
-
selectedItem: (_selectedItems_ = selectedItems[0]) !== null && _selectedItems_ !==
|
|
14617
|
+
selectedItem: (_selectedItems_ = selectedItems[0]) !== null && _selectedItems_ !== void 0 ? _selectedItems_ : null,
|
|
14551
14618
|
selectedItems: selectedItems,
|
|
14552
|
-
defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !==
|
|
14619
|
+
defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : props.selectionMode === 'single' ? initialValue : null,
|
|
14553
14620
|
focusStrategy: focusStrategy,
|
|
14554
14621
|
open (focusStrategy = null) {
|
|
14555
14622
|
// Don't open if the collection is empty.
|
|
14556
|
-
if (listState.collection.size !== 0) {
|
|
14623
|
+
if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
|
|
14557
14624
|
setFocusStrategy(focusStrategy);
|
|
14558
14625
|
triggerState.open();
|
|
14559
14626
|
}
|
|
14560
14627
|
},
|
|
14561
14628
|
toggle (focusStrategy = null) {
|
|
14562
|
-
if (listState.collection.size !== 0) {
|
|
14629
|
+
if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
|
|
14563
14630
|
setFocusStrategy(focusStrategy);
|
|
14564
14631
|
triggerState.toggle();
|
|
14565
14632
|
}
|
|
@@ -14699,7 +14766,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
14699
14766
|
const $ee014567cb39d3f0$export$ff05c3ac10437e03 = /*#__PURE__*/ (createContext)(null);
|
|
14700
14767
|
const $ee014567cb39d3f0$export$f551688fc98f2e09 = /*#__PURE__*/ (forwardRef)(function FieldError(props, ref) {
|
|
14701
14768
|
let validation = (useContext)($ee014567cb39d3f0$export$ff05c3ac10437e03);
|
|
14702
|
-
if (!(validation === null || validation ===
|
|
14769
|
+
if (!(validation === null || validation === void 0 ? void 0 : validation.isInvalid)) return null;
|
|
14703
14770
|
return /*#__PURE__*/ ($dbSRa$react).createElement($ee014567cb39d3f0$var$FieldErrorInner, {
|
|
14704
14771
|
...props,
|
|
14705
14772
|
ref: ref
|
|
@@ -14753,7 +14820,7 @@ const $d3e0e05bdfcf66bd$export$a7fed597f4b8afd8 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
14753
14820
|
validationBehavior: validationBehavior
|
|
14754
14821
|
}
|
|
14755
14822
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($e5be200c675c3b3a$export$571b5131b7e65c11).Provider, {
|
|
14756
|
-
value: validationErrors !== null && validationErrors !==
|
|
14823
|
+
value: validationErrors !== null && validationErrors !== void 0 ? validationErrors : {}
|
|
14757
14824
|
}, children)));
|
|
14758
14825
|
});
|
|
14759
14826
|
|
|
@@ -14783,7 +14850,7 @@ const $bc237834342dbd75$export$4aa08d5625cb8ead = /*#__PURE__*/ (forwardRef)(fun
|
|
|
14783
14850
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bc237834342dbd75$export$baf37c4be89255b8);
|
|
14784
14851
|
let { validationBehavior: formValidationBehavior } = ($64fa3d84918910a7$export$fabf2dc03a41866e)(($d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
14785
14852
|
var _props_validationBehavior, _ref;
|
|
14786
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
14853
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
14787
14854
|
let state = ($587d3ad58be6d31f$export$daff6da51032a415)({
|
|
14788
14855
|
...props,
|
|
14789
14856
|
validationBehavior: validationBehavior
|
|
@@ -14851,7 +14918,7 @@ const $bc237834342dbd75$export$48513f6b9f8ce62d = /*#__PURE__*/ (forwardRef)(fun
|
|
|
14851
14918
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, ($4e85f108e88277b8$export$b085522c77523c51));
|
|
14852
14919
|
let { validationBehavior: formValidationBehavior } = ($64fa3d84918910a7$export$fabf2dc03a41866e)(($d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
14853
14920
|
var _props_validationBehavior, _ref;
|
|
14854
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
14921
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
14855
14922
|
let groupState = (useContext)($bc237834342dbd75$export$139c5b8563afc1fc);
|
|
14856
14923
|
let inputRef = ($df56164dff5785e2$export$4338b53315abf666)((useMemo)(()=>($5dc95899b306f630$export$c9058316764c140e)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [
|
|
14857
14924
|
userProvidedInputRef,
|
|
@@ -14956,7 +15023,10 @@ let $3985021b0ad6602f$var$filterHoverProps = (props)=>{
|
|
|
14956
15023
|
};
|
|
14957
15024
|
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /*#__PURE__*/ ($f39a9eba43920ace$export$86427a43e3e48ebb)(function Input(props, ref) {
|
|
14958
15025
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
14959
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)(
|
|
15026
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)({
|
|
15027
|
+
...props,
|
|
15028
|
+
isDisabled: props.disabled
|
|
15029
|
+
});
|
|
14960
15030
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = ($f7dceffc5ad7768b$export$4e328f61c538687f)({
|
|
14961
15031
|
isTextInput: true,
|
|
14962
15032
|
autoFocus: props.autoFocus
|
|
@@ -15348,28 +15418,28 @@ const $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
15348
15418
|
});
|
|
15349
15419
|
function $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState) {
|
|
15350
15420
|
var _dragAndDropHooks_isVirtualDragging;
|
|
15351
|
-
let renderDropIndicator = dragAndDropHooks === null || dragAndDropHooks ===
|
|
15352
|
-
let isVirtualDragging = dragAndDropHooks === null || dragAndDropHooks ===
|
|
15421
|
+
let renderDropIndicator = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.renderDropIndicator;
|
|
15422
|
+
let isVirtualDragging = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks);
|
|
15353
15423
|
let fn = (useCallback)((target)=>{
|
|
15354
15424
|
// Only show drop indicators when virtual dragging or this is the current drop target.
|
|
15355
|
-
if (isVirtualDragging || (dropState === null || dropState ===
|
|
15425
|
+
if (isVirtualDragging || (dropState === null || dropState === void 0 ? void 0 : dropState.isDropTarget(target))) return renderDropIndicator ? renderDropIndicator(target) : /*#__PURE__*/ ($dbSRa$react).createElement($612b8eb6cb90e02d$export$62ed72bc21f6b8a6, {
|
|
15356
15426
|
target: target
|
|
15357
15427
|
});
|
|
15358
15428
|
// We invalidate whenever the target changes.
|
|
15359
15429
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15360
15430
|
}, [
|
|
15361
|
-
dropState === null || dropState ===
|
|
15431
|
+
dropState === null || dropState === void 0 ? void 0 : dropState.target,
|
|
15362
15432
|
isVirtualDragging,
|
|
15363
15433
|
renderDropIndicator
|
|
15364
15434
|
]);
|
|
15365
|
-
return (dragAndDropHooks === null || dragAndDropHooks ===
|
|
15435
|
+
return (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDropIndicator) ? fn : undefined;
|
|
15366
15436
|
}
|
|
15367
15437
|
function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropHooks, dropState) {
|
|
15368
15438
|
var _dragAndDropHooks_isVirtualDragging, _dropState_target;
|
|
15369
15439
|
// Persist the focused key and the drop target key.
|
|
15370
15440
|
let focusedKey = selectionManager.focusedKey;
|
|
15371
15441
|
let dropTargetKey = null;
|
|
15372
|
-
if ((dragAndDropHooks === null || dragAndDropHooks ===
|
|
15442
|
+
if ((dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks)) && (dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === 'item') {
|
|
15373
15443
|
dropTargetKey = dropState.target.key;
|
|
15374
15444
|
if (dropState.target.dropPosition === 'after') {
|
|
15375
15445
|
// Normalize to the "before" drop position since we only render those to the DOM.
|
|
@@ -15378,7 +15448,7 @@ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
|
|
|
15378
15448
|
if (nextKey != null) {
|
|
15379
15449
|
var _dropState_collection_getItem;
|
|
15380
15450
|
var _dropState_collection_getItem_level;
|
|
15381
|
-
let targetLevel = (_dropState_collection_getItem_level = (_dropState_collection_getItem = dropState.collection.getItem(dropTargetKey)) === null || _dropState_collection_getItem ===
|
|
15451
|
+
let targetLevel = (_dropState_collection_getItem_level = (_dropState_collection_getItem = dropState.collection.getItem(dropTargetKey)) === null || _dropState_collection_getItem === void 0 ? void 0 : _dropState_collection_getItem.level) !== null && _dropState_collection_getItem_level !== void 0 ? _dropState_collection_getItem_level : 0;
|
|
15382
15452
|
// Skip over any rows that are descendants of the target ("after" position should be after all children)
|
|
15383
15453
|
while(nextKey){
|
|
15384
15454
|
let node = dropState.collection.getItem(nextKey);
|
|
@@ -15393,14 +15463,14 @@ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
|
|
|
15393
15463
|
var _node_level;
|
|
15394
15464
|
// Stop once we find an item at the same level or higher
|
|
15395
15465
|
// eslint-disable-next-line max-depth
|
|
15396
|
-
if (((_node_level = node.level) !== null && _node_level !==
|
|
15466
|
+
if (((_node_level = node.level) !== null && _node_level !== void 0 ? _node_level : 0) <= targetLevel) break;
|
|
15397
15467
|
lastDescendantKey = nextKey;
|
|
15398
15468
|
nextKey = dropState.collection.getKeyAfter(nextKey);
|
|
15399
15469
|
}
|
|
15400
15470
|
}
|
|
15401
15471
|
var _ref;
|
|
15402
15472
|
// If nextKey is null (end of collection), use the last descendant
|
|
15403
|
-
dropTargetKey = (_ref = nextKey !== null && nextKey !==
|
|
15473
|
+
dropTargetKey = (_ref = nextKey !== null && nextKey !== void 0 ? nextKey : lastDescendantKey) !== null && _ref !== void 0 ? _ref : dropTargetKey;
|
|
15404
15474
|
}
|
|
15405
15475
|
}
|
|
15406
15476
|
return (useMemo)(()=>{
|
|
@@ -15576,8 +15646,8 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: inputState, props: props, l
|
|
|
15576
15646
|
let { dragAndDropHooks: dragAndDropHooks, layout: layout = 'stack', orientation: orientation = 'vertical', filter: filter } = props;
|
|
15577
15647
|
let state = ($e72dd72e1c76a225$export$ba9d38c0f1bf2b36)(inputState, filter);
|
|
15578
15648
|
let { collection: collection, selectionManager: selectionManager } = state;
|
|
15579
|
-
let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks ===
|
|
15580
|
-
let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks ===
|
|
15649
|
+
let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
15650
|
+
let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
|
|
15581
15651
|
let { direction: direction } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
15582
15652
|
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } = selectionManager;
|
|
15583
15653
|
let collator = ($325a3faab7a68acd$export$a16aca283550c30d)({
|
|
@@ -15687,7 +15757,7 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: inputState, props: props, l
|
|
|
15687
15757
|
global: true
|
|
15688
15758
|
});
|
|
15689
15759
|
return /*#__PURE__*/ ($dbSRa$react).createElement(($9bf71ea28793e738$export$20e40289641fbbb6), null, /*#__PURE__*/ ($dbSRa$react).createElement("div", {
|
|
15690
|
-
...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection === null || droppableCollection ===
|
|
15760
|
+
...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
|
|
15691
15761
|
ref: listBoxRef,
|
|
15692
15762
|
slot: props.slot || undefined,
|
|
15693
15763
|
onScroll: props.onScroll,
|
|
@@ -15750,7 +15820,7 @@ function $eed445e0843c11d0$var$ListBoxSectionInner(props, ref, section, classNam
|
|
|
15750
15820
|
var _props_arialabel;
|
|
15751
15821
|
let { headingProps: headingProps, groupProps: groupProps } = ($af383d3bef1cfdc9$export$c3f9f39876e4bc7)({
|
|
15752
15822
|
heading: heading,
|
|
15753
|
-
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !==
|
|
15823
|
+
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !== void 0 ? _props_arialabel : undefined
|
|
15754
15824
|
});
|
|
15755
15825
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
15756
15826
|
defaultClassName: className,
|
|
@@ -15783,7 +15853,7 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ ($e1995378a142960
|
|
|
15783
15853
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (useContext)(($612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
15784
15854
|
let { optionProps: optionProps, labelProps: labelProps, descriptionProps: descriptionProps, ...states } = ($293f70390ea03370$export$497855f14858aa34)({
|
|
15785
15855
|
key: item.key,
|
|
15786
|
-
'aria-label': props === null || props ===
|
|
15856
|
+
'aria-label': props === null || props === void 0 ? void 0 : props['aria-label']
|
|
15787
15857
|
}, state, ref);
|
|
15788
15858
|
let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)({
|
|
15789
15859
|
isDisabled: !states.allowsSelection && !states.hasAction,
|
|
@@ -15791,9 +15861,11 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ ($e1995378a142960
|
|
|
15791
15861
|
onHoverChange: item.props.onHoverChange,
|
|
15792
15862
|
onHoverEnd: item.props.onHoverEnd
|
|
15793
15863
|
});
|
|
15864
|
+
let { focusProps: focusProps } = ($a1ea59d68270f0dd$export$f8168d8dd8fd66e6)(props);
|
|
15794
15865
|
let draggableItem = null;
|
|
15795
15866
|
if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
|
|
15796
|
-
key: item.key
|
|
15867
|
+
key: item.key,
|
|
15868
|
+
hasAction: states.hasAction
|
|
15797
15869
|
}, dragState);
|
|
15798
15870
|
let droppableItem = null;
|
|
15799
15871
|
if (dropState && dragAndDropHooks) droppableItem = dragAndDropHooks.useDroppableItem({
|
|
@@ -15816,7 +15888,7 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ ($e1995378a142960
|
|
|
15816
15888
|
selectionBehavior: state.selectionManager.selectionBehavior,
|
|
15817
15889
|
allowsDragging: !!dragState,
|
|
15818
15890
|
isDragging: isDragging,
|
|
15819
|
-
isDropTarget: droppableItem === null || droppableItem ===
|
|
15891
|
+
isDropTarget: droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.isDropTarget
|
|
15820
15892
|
}
|
|
15821
15893
|
});
|
|
15822
15894
|
(useEffect)(()=>{
|
|
@@ -15830,8 +15902,9 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ ($e1995378a142960
|
|
|
15830
15902
|
});
|
|
15831
15903
|
delete DOMProps.id;
|
|
15832
15904
|
delete DOMProps.onClick;
|
|
15905
|
+
if (ElementType === 'a' && optionProps.tabIndex == null) optionProps.tabIndex = -1;
|
|
15833
15906
|
return /*#__PURE__*/ ($dbSRa$react).createElement(ElementType, {
|
|
15834
|
-
...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, optionProps, hoverProps, draggableItem === null || draggableItem ===
|
|
15907
|
+
...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, optionProps, hoverProps, focusProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
|
|
15835
15908
|
ref: ref,
|
|
15836
15909
|
"data-allows-dragging": !!dragState || undefined,
|
|
15837
15910
|
"data-selected": states.isSelected || undefined,
|
|
@@ -15841,7 +15914,7 @@ const $eed445e0843c11d0$export$a11e76429ed99b4 = /*#__PURE__*/ ($e1995378a142960
|
|
|
15841
15914
|
"data-focus-visible": states.isFocusVisible || undefined,
|
|
15842
15915
|
"data-pressed": states.isPressed || undefined,
|
|
15843
15916
|
"data-dragging": isDragging || undefined,
|
|
15844
|
-
"data-drop-target": (droppableItem === null || droppableItem ===
|
|
15917
|
+
"data-drop-target": (droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.isDropTarget) || undefined,
|
|
15845
15918
|
"data-selection-mode": state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode
|
|
15846
15919
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
15847
15920
|
values: [
|
|
@@ -15901,13 +15974,13 @@ const $eed445e0843c11d0$var$ListBoxDropIndicatorForwardRef = /*#__PURE__*/ (forw
|
|
|
15901
15974
|
let sentinelRef = (useRef)(null);
|
|
15902
15975
|
let memoedLoadMoreProps = (useMemo)(()=>({
|
|
15903
15976
|
onLoadMore: onLoadMore,
|
|
15904
|
-
collection: state === null || state ===
|
|
15977
|
+
collection: state === null || state === void 0 ? void 0 : state.collection,
|
|
15905
15978
|
sentinelRef: sentinelRef,
|
|
15906
15979
|
scrollOffset: scrollOffset
|
|
15907
15980
|
}), [
|
|
15908
15981
|
onLoadMore,
|
|
15909
15982
|
scrollOffset,
|
|
15910
|
-
state === null || state ===
|
|
15983
|
+
state === null || state === void 0 ? void 0 : state.collection
|
|
15911
15984
|
]);
|
|
15912
15985
|
($a5fa973c1850dd36$export$ccaea96c28e8b9e7)(memoedLoadMoreProps, sentinelRef);
|
|
15913
15986
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
@@ -16057,7 +16130,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
16057
16130
|
var _props_offset;
|
|
16058
16131
|
let { popoverProps: popoverProps, underlayProps: underlayProps, arrowProps: arrowProps, placement: placement, triggerAnchorPoint: triggerAnchorPoint } = ($f2f8a6077418541e$export$542a6fd13ac93354)({
|
|
16059
16132
|
...props,
|
|
16060
|
-
offset: (_props_offset = props.offset) !== null && _props_offset !==
|
|
16133
|
+
offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
|
|
16061
16134
|
arrowRef: arrowRef,
|
|
16062
16135
|
// If this is a submenu/subdialog, use the root popover's container
|
|
16063
16136
|
// to detect outside interaction and add aria-hidden.
|
|
@@ -16164,7 +16237,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
16164
16237
|
...props,
|
|
16165
16238
|
shouldContainFocus: isDialog,
|
|
16166
16239
|
isExiting: isExiting,
|
|
16167
|
-
portalContainer: (_ref = UNSTABLE_portalContainer !== null && UNSTABLE_portalContainer !==
|
|
16240
|
+
portalContainer: (_ref = UNSTABLE_portalContainer !== null && UNSTABLE_portalContainer !== void 0 ? UNSTABLE_portalContainer : groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.current) !== null && _ref !== void 0 ? _ref : undefined
|
|
16168
16241
|
}, overlay);
|
|
16169
16242
|
}
|
|
16170
16243
|
|
|
@@ -16283,7 +16356,7 @@ const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16283
16356
|
style: props.style,
|
|
16284
16357
|
children: props.children,
|
|
16285
16358
|
values: {
|
|
16286
|
-
close: (state === null || state ===
|
|
16359
|
+
close: (state === null || state === void 0 ? void 0 : state.close) || (()=>{})
|
|
16287
16360
|
}
|
|
16288
16361
|
});
|
|
16289
16362
|
let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
@@ -16313,7 +16386,7 @@ const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16313
16386
|
slots: {
|
|
16314
16387
|
[($64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
16315
16388
|
close: {
|
|
16316
|
-
onPress: ()=>state === null || state ===
|
|
16389
|
+
onPress: ()=>state === null || state === void 0 ? void 0 : state.close()
|
|
16317
16390
|
}
|
|
16318
16391
|
}
|
|
16319
16392
|
}
|
|
@@ -16379,11 +16452,11 @@ const $28f4fd908f0de97f$export$74a362b31437ec83 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16379
16452
|
onExpandedChange (isExpanded) {
|
|
16380
16453
|
var _props_onExpandedChange;
|
|
16381
16454
|
if (groupState) groupState.toggleKey(id);
|
|
16382
|
-
(_props_onExpandedChange = props.onExpandedChange) === null || _props_onExpandedChange ===
|
|
16455
|
+
(_props_onExpandedChange = props.onExpandedChange) === null || _props_onExpandedChange === void 0 ? void 0 : _props_onExpandedChange.call(props, isExpanded);
|
|
16383
16456
|
}
|
|
16384
16457
|
});
|
|
16385
16458
|
let panelRef = ($dbSRa$react).useRef(null);
|
|
16386
|
-
let isDisabled = props.isDisabled || (groupState === null || groupState ===
|
|
16459
|
+
let isDisabled = props.isDisabled || (groupState === null || groupState === void 0 ? void 0 : groupState.isDisabled) || false;
|
|
16387
16460
|
let { buttonProps: buttonProps, panelProps: panelProps } = ($5e910fae8e128ead$export$6e3e27031a30522f)({
|
|
16388
16461
|
...props,
|
|
16389
16462
|
isExpanded: isExpanded,
|
|
@@ -16451,7 +16524,8 @@ const $28f4fd908f0de97f$export$feabaa331e1d464c = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16451
16524
|
}
|
|
16452
16525
|
});
|
|
16453
16526
|
let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
16454
|
-
global: true
|
|
16527
|
+
global: true,
|
|
16528
|
+
labelable: true
|
|
16455
16529
|
});
|
|
16456
16530
|
return /*#__PURE__*/ ($dbSRa$react).createElement("div", {
|
|
16457
16531
|
...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, panelProps, focusWithinProps),
|
|
@@ -16488,7 +16562,7 @@ const $5cb03073d3f54797$export$a8a3e93435678ff9 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16488
16562
|
return /*#__PURE__*/ ($dbSRa$react).createElement(Element, {
|
|
16489
16563
|
...domProps,
|
|
16490
16564
|
ref: ref,
|
|
16491
|
-
className: className !== null && className !==
|
|
16565
|
+
className: className !== null && className !== void 0 ? className : 'react-aria-Heading'
|
|
16492
16566
|
}, children);
|
|
16493
16567
|
});
|
|
16494
16568
|
|
|
@@ -16690,7 +16764,7 @@ const $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (forwardRef)(fun
|
|
|
16690
16764
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $b6c3ddc6086f204d$export$a79eda4ff50e30b6);
|
|
16691
16765
|
let { validationBehavior: formValidationBehavior } = ($64fa3d84918910a7$export$fabf2dc03a41866e)(($d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
16692
16766
|
var _props_validationBehavior, _ref;
|
|
16693
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
16767
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
16694
16768
|
let state = ($a54cdc5c1942b639$export$bca9d026f8e704eb)({
|
|
16695
16769
|
...props,
|
|
16696
16770
|
validationBehavior: validationBehavior
|
|
@@ -16882,7 +16956,7 @@ const $82d7e5349645de74$var$CLEAR_CONTEXTS = [
|
|
|
16882
16956
|
function $82d7e5349645de74$var$SelectInner({ props: props, selectRef: ref, collection: collection }) {
|
|
16883
16957
|
let { validationBehavior: formValidationBehavior } = ($64fa3d84918910a7$export$fabf2dc03a41866e)(($d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
16884
16958
|
var _props_validationBehavior, _ref;
|
|
16885
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
16959
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
16886
16960
|
let state = ($2bc3a590c5373a4e$export$5159ec8b34d4ec12)({
|
|
16887
16961
|
...props,
|
|
16888
16962
|
collection: collection,
|
|
@@ -17034,7 +17108,7 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ ($f39a9eba43920a
|
|
|
17034
17108
|
let { placeholder: placeholder } = ($64fa3d84918910a7$export$fabf2dc03a41866e)($82d7e5349645de74$export$7540cee5be7dc19b);
|
|
17035
17109
|
let rendered = state.selectedItems.map((item)=>{
|
|
17036
17110
|
var _item_props;
|
|
17037
|
-
let rendered = (_item_props = item.props) === null || _item_props ===
|
|
17111
|
+
let rendered = (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.children;
|
|
17038
17112
|
// If the selected item has a function as a child, we need to call it to render to React.JSX.
|
|
17039
17113
|
if (typeof rendered === 'function') {
|
|
17040
17114
|
let fn = rendered;
|
|
@@ -17052,13 +17126,13 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ ($f39a9eba43920a
|
|
|
17052
17126
|
return rendered;
|
|
17053
17127
|
});
|
|
17054
17128
|
let formatter = ($33bf17300c498528$export$a2f47a3d2973640)();
|
|
17055
|
-
let textValue = (useMemo)(()=>state.selectedItems.map((item)=>item === null || item ===
|
|
17129
|
+
let textValue = (useMemo)(()=>state.selectedItems.map((item)=>item === null || item === void 0 ? void 0 : item.textValue), [
|
|
17056
17130
|
state.selectedItems
|
|
17057
17131
|
]);
|
|
17058
17132
|
let selectionMode = state.selectionManager.selectionMode;
|
|
17059
17133
|
let selectedText = (useMemo)(()=>{
|
|
17060
17134
|
var _textValue_;
|
|
17061
|
-
return selectionMode === 'single' ? (_textValue_ = textValue[0]) !== null && _textValue_ !==
|
|
17135
|
+
return selectionMode === 'single' ? (_textValue_ = textValue[0]) !== null && _textValue_ !== void 0 ? _textValue_ : '' : formatter.format(textValue);
|
|
17062
17136
|
}, [
|
|
17063
17137
|
selectionMode,
|
|
17064
17138
|
formatter,
|
|
@@ -17085,13 +17159,13 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /*#__PURE__*/ ($f39a9eba43920a
|
|
|
17085
17159
|
var _ref, _state_selectedItems__value;
|
|
17086
17160
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
17087
17161
|
...props,
|
|
17088
|
-
defaultChildren: (_ref = defaultChildren !== null && defaultChildren !==
|
|
17162
|
+
defaultChildren: (_ref = defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : placeholder) !== null && _ref !== void 0 ? _ref : stringFormatter.format('selectPlaceholder'),
|
|
17089
17163
|
defaultClassName: 'react-aria-SelectValue',
|
|
17090
17164
|
values: {
|
|
17091
|
-
selectedItem: (_state_selectedItems__value = (_state_selectedItems_ = state.selectedItems[0]) === null || _state_selectedItems_ ===
|
|
17165
|
+
selectedItem: (_state_selectedItems__value = (_state_selectedItems_ = state.selectedItems[0]) === null || _state_selectedItems_ === void 0 ? void 0 : _state_selectedItems_.value) !== null && _state_selectedItems__value !== void 0 ? _state_selectedItems__value : null,
|
|
17092
17166
|
selectedItems: (useMemo)(()=>state.selectedItems.map((item)=>{
|
|
17093
17167
|
var _item_value;
|
|
17094
|
-
return (_item_value = item.value) !== null && _item_value !==
|
|
17168
|
+
return (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : null;
|
|
17095
17169
|
}), [
|
|
17096
17170
|
state.selectedItems
|
|
17097
17171
|
]),
|
|
@@ -17254,7 +17328,7 @@ function $eaf9e70818b436db$var$TagGroupInner({ props: props, forwardedRef: ref,
|
|
|
17254
17328
|
id: id,
|
|
17255
17329
|
ref: ref,
|
|
17256
17330
|
slot: props.slot || undefined,
|
|
17257
|
-
className: (_props_className = props.className) !== null && _props_className !==
|
|
17331
|
+
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-TagGroup',
|
|
17258
17332
|
style: props.style
|
|
17259
17333
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
17260
17334
|
values: [
|
|
@@ -17471,7 +17545,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /*#__PURE__*/ ($f39a9eba43920a
|
|
|
17471
17545
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
17472
17546
|
let { validationBehavior: formValidationBehavior } = ($64fa3d84918910a7$export$fabf2dc03a41866e)(($d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
17473
17547
|
var _props_validationBehavior, _ref;
|
|
17474
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !==
|
|
17548
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
17475
17549
|
let inputRef = (useRef)(null);
|
|
17476
17550
|
[props, inputRef] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, inputRef, ($4e85f108e88277b8$export$698f465ec27e93df));
|
|
17477
17551
|
let [labelRef, label] = ($64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
@@ -17658,7 +17732,7 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
17658
17732
|
'--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,
|
|
17659
17733
|
...renderProps.style
|
|
17660
17734
|
},
|
|
17661
|
-
"data-placement": placement !== null && placement !==
|
|
17735
|
+
"data-placement": placement !== null && placement !== void 0 ? placement : undefined,
|
|
17662
17736
|
"data-entering": isEntering || undefined,
|
|
17663
17737
|
"data-exiting": props.isExiting || undefined
|
|
17664
17738
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($44f671af83e7d9e0$export$2de4954e8ae13b9f).Provider, {
|
|
@@ -17905,7 +17979,12 @@ function Header({ children, logoLinkElement, logoImage = jsx(SvgBcLogo, { id: "b
|
|
|
17905
17979
|
function getLogo() {
|
|
17906
17980
|
if (!logoLinkElement)
|
|
17907
17981
|
return (jsx("a", { href: "/", title: "Government of British Columbia", children: logoImage }));
|
|
17908
|
-
|
|
17982
|
+
// The `<any>` type below is necessary to allow users to specify their own
|
|
17983
|
+
// link elements from any router library.
|
|
17984
|
+
// eslint-disable-next-line
|
|
17985
|
+
return cloneElement(logoLinkElement, {
|
|
17986
|
+
children: logoImage,
|
|
17987
|
+
});
|
|
17909
17988
|
}
|
|
17910
17989
|
function getTitle() {
|
|
17911
17990
|
switch (titleElement) {
|
|
@@ -18056,7 +18135,7 @@ function Text({ elementType = "span", size = "medium", color = "primary", isUnst
|
|
|
18056
18135
|
return (jsx($514c0188e459b4c0$export$5f1af8db9871e1d6, { elementType: elementType, className: isUnstyled ? undefined : `bcds-react-aria-Text ${size} ${color}`, ...props, children: props.children }));
|
|
18057
18136
|
}
|
|
18058
18137
|
|
|
18059
|
-
var css_248z$3 = ".bcds-react-aria-TextArea {\n display: inline-flex;\n flex-direction: column;\n /* Hacks for `stretch`: https://caniuse.com/mdn-css_properties_max-width_stretch */\n align-self: stretch;\n max-width: -moz-available;\n max-width: -webkit-fill-available;\n}\n\n/* Styles for the text label above the input field */\n.bcds-react-aria-TextArea--Label {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-primary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n/* Styles for the description and character count slot below the input field */\n.bcds-react-aria-TextArea--Description {\n display: grid;\n gap: var(--layout-margin-medium);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n font: var(--typography-regular-small-body);\n color: var(--typography-color-secondary);\n}\n\n/* Description label */\n.bcds-react-aria-TextArea--Description > .text {\n justify-self: flex-start;\n grid-row: 1;\n}\n\n/* Character counter */\n.bcds-react-aria-TextArea--Description > .counter {\n justify-self: flex-end;\n grid-row: 1;\n}\n\n/* Styles for the input field container */\n.bcds-react-aria-TextArea--Container {\n color: var(--typography-color-primary);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--layout-margin-small);\n background: var(--surface-color-forms-default);\n box-sizing: border-box;\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-default);\n border-radius: var(--layout-border-radius-medium);\n padding: var(--layout-padding-small) 12px;\n}\n\n/* Text input field */\n.bcds-react-aria-TextArea--Input {\n font: var(--typography-regular-body);\n padding: var(--layout-padding-none);\n color: var(--typography-color-primary);\n border: none;\n flex-grow: 1;\n}\n\n.bcds-rect-aria-TextArea--Input::placeholder {\n color: var(--typography-color-placeholder);\n}\n\n/* Hover and focus states */\n.bcds-react-aria-TextArea--Container\n > .bcds-react-aria-TextArea--Input[data-focused] {\n outline: none;\n}\n\n.bcds-react-aria-TextArea--Container:focus-within {\n border-radius: var(--layout-border-radius-large);\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-active);\n outline: solid var(--layout-border-width-medium)\n var(--surface-color-border-active);\n outline-offset: var(--layout-margin-hair);\n}\n\n.bcds-react-aria-TextArea--Container:hover {\n border-color: var(--surface-color-border-dark);\n}\n\n/* Disabled and invalid states */\n.bcds-react-aria-TextArea[data-disabled]
|
|
18138
|
+
var css_248z$3 = ".bcds-react-aria-TextArea {\n display: inline-flex;\n flex-direction: column;\n /* Hacks for `stretch`: https://caniuse.com/mdn-css_properties_max-width_stretch */\n align-self: stretch;\n max-width: -moz-available;\n max-width: -webkit-fill-available;\n}\n\n/* Styles for the text label above the input field */\n.bcds-react-aria-TextArea--Label {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-primary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n/* Styles for the description and character count slot below the input field */\n.bcds-react-aria-TextArea--Description {\n display: grid;\n gap: var(--layout-margin-medium);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n font: var(--typography-regular-small-body);\n color: var(--typography-color-secondary);\n}\n\n/* Description label */\n.bcds-react-aria-TextArea--Description > .text {\n justify-self: flex-start;\n grid-row: 1;\n}\n\n/* Character counter */\n.bcds-react-aria-TextArea--Description > .counter {\n justify-self: flex-end;\n grid-row: 1;\n}\n\n/* Styles for the input field container */\n.bcds-react-aria-TextArea--Container {\n color: var(--typography-color-primary);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--layout-margin-small);\n background: var(--surface-color-forms-default);\n box-sizing: border-box;\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-default);\n border-radius: var(--layout-border-radius-medium);\n padding: var(--layout-padding-small) 12px;\n}\n\n/* Text input field */\n.bcds-react-aria-TextArea--Input {\n font: var(--typography-regular-body);\n padding: var(--layout-padding-none);\n color: var(--typography-color-primary);\n border: none;\n flex-grow: 1;\n}\n\n.bcds-rect-aria-TextArea--Input::placeholder {\n color: var(--typography-color-placeholder);\n}\n\n/* Hover and focus states */\n.bcds-react-aria-TextArea--Container\n > .bcds-react-aria-TextArea--Input[data-focused] {\n outline: none;\n}\n\n.bcds-react-aria-TextArea--Container:focus-within {\n border-radius: var(--layout-border-radius-large);\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-active);\n outline: solid var(--layout-border-width-medium)\n var(--surface-color-border-active);\n outline-offset: var(--layout-margin-hair);\n}\n\n.bcds-react-aria-TextArea--Container:hover {\n border-color: var(--surface-color-border-dark);\n}\n\n/* Disabled and invalid states */\n.bcds-react-aria-TextArea[data-disabled] > .bcds-react-aria-TextArea--Container,\n.bcds-react-aria-TextArea[data-disabled] .bcds-react-aria-TextArea--Input {\n background: var(--surface-color-forms-disabled);\n color: var(--typography-color-placeholder);\n cursor: not-allowed;\n}\n\n.bcds-react-aria-TextArea[data-invalid] > .bcds-react-aria-TextArea--Container {\n border-radius: var(--layout-border-radius-medium);\n border: var(--layout-border-width-small) solid\n var(--support-border-color-danger);\n background: var(--surface-color-forms-default);\n}\n\n.bcds-react-aria-TextArea[data-readonly] > .bcds-react-aria-TextArea--Container,\n.bcds-react-aria-TextArea[data-readonly] .bcds-react-aria-TextArea--Input {\n background: var(--surface-color-forms-disabled);\n}\n\n/* Styles for the error message slot */\n.bcds-react-aria-TextArea--Error {\n display: flex;\n font: var(--typography-regular-small-body);\n color: var(--typography-color-danger);\n}\n\n.bcds-react-aria-TextArea--Error > svg {\n padding-right: var(--layout-padding-xsmall);\n color: var(--icons-color-danger);\n width: var(--icons-size-medium);\n height: var(--icons-size-medium);\n}\n";
|
|
18060
18139
|
styleInject(css_248z$3);
|
|
18061
18140
|
|
|
18062
18141
|
function TextArea({ label, description, errorMessage, maxLength, onChange, value, ...props }) {
|
|
@@ -18070,7 +18149,7 @@ function TextArea({ label, description, errorMessage, maxLength, onChange, value
|
|
|
18070
18149
|
return (jsx($bcdf0525bf22703d$export$2c73285ae9390cec, { className: `bcds-react-aria-TextArea`, ...props, children: ({ isRequired, isInvalid }) => (jsxs(Fragment$1, { children: [label && (jsx($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: "bcds-react-aria-TextArea--Label", children: isRequired ? `${label} (required)` : label })), jsx("div", { className: "bcds-react-aria-TextArea--Container", children: jsx($216918bed6669f72$export$f5c9f3c2c4054eec, { className: "bcds-react-aria-TextArea--Input", value: value, onChange: (e) => handleChange(e.target.value) }) }), description || maxLength ? (jsxs("div", { className: "bcds-react-aria-TextArea--Description", children: [description && (jsx($514c0188e459b4c0$export$5f1af8db9871e1d6, { slot: "description", className: "text", children: description })), maxLength && (jsxs("div", { className: "counter", children: [charCount, "/", maxLength] }))] })) : null, isInvalid && (jsxs("div", { className: "bcds-react-aria-TextArea--Error", children: [jsx(SvgExclamationIcon, {}), jsx($ee014567cb39d3f0$export$f551688fc98f2e09, { children: errorMessage })] }))] })) }));
|
|
18071
18150
|
}
|
|
18072
18151
|
|
|
18073
|
-
var css_248z$2 = ".bcds-react-aria-TextField {\n display: inline-flex;\n flex-direction: column;\n /* Hacks for `stretch`: https://caniuse.com/mdn-css_properties_max-width_stretch */\n align-self: stretch;\n max-width: -moz-available;\n max-width: -webkit-fill-available;\n}\n\n/* Styles for the text label above the input field */\n.bcds-react-aria-TextField--Label {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-primary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n.bcds-react-aria-TextField--Label .required {\n color: var(--typography-color-secondary);\n padding: var(--layout-padding-none) var(--layout-padding-xsmall);\n}\n\n/* Styles for the text description below the input field */\n.bcds-react-aria-TextField--Description {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-secondary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n/* Styles for the input field container */\n.bcds-react-aria-TextField--container {\n color: var(--typography-color-primary);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--layout-margin-small);\n background: var(--surface-color-forms-default);\n box-sizing: border-box;\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-default);\n border-radius: var(--layout-border-radius-medium);\n padding: var(--layout-padding-small) 12px;\n}\n\n/* Sizes */\n.bcds-react-aria-TextField--container.small {\n height: var(--layout-margin-xlarge);\n min-height: var(--layout-margin-xlarge);\n}\n\n.bcds-react-aria-TextField--container.medium {\n height: var(--layout-margin-xxlarge);\n min-height: var(--layout-margin-xxlarge);\n}\n\n/* Text input field */\n.bcds-react-aria-TextField--Input {\n font: var(--typography-regular-body);\n padding: var(--layout-padding-none);\n color: var(--typography-color-primary);\n border: none;\n flex-grow: 1;\n}\n\n.bcds-react-aria-TextField--Input::placeholder {\n color: var(--typography-color-placeholder);\n}\n\n/* Hover and focus states */\n\n.bcds-react-aria-TextField--container\n > .bcds-react-aria-TextField--Input[data-focused] {\n outline: none;\n}\n\n.bcds-react-aria-TextField--container:focus-within {\n border-radius: var(--layout-border-radius-large);\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-active);\n outline: solid var(--layout-border-width-medium)\n var(--surface-color-border-active);\n outline-offset: var(--layout-margin-hair);\n}\n\n.bcds-react-aria-TextField--container:hover {\n border-color: var(--surface-color-border-dark);\n}\n\n/* Disabled and invalid states */\n\n.bcds-react-aria-TextField[data-disabled]\n > .bcds-react-aria-TextField--container {\n background: var(--surface-color-forms-disabled);\n
|
|
18152
|
+
var css_248z$2 = ".bcds-react-aria-TextField {\n display: inline-flex;\n flex-direction: column;\n /* Hacks for `stretch`: https://caniuse.com/mdn-css_properties_max-width_stretch */\n align-self: stretch;\n max-width: -moz-available;\n max-width: -webkit-fill-available;\n}\n\n/* Styles for the text label above the input field */\n.bcds-react-aria-TextField--Label {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-primary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n.bcds-react-aria-TextField--Label .required {\n color: var(--typography-color-secondary);\n padding: var(--layout-padding-none) var(--layout-padding-xsmall);\n}\n\n/* Styles for the text description below the input field */\n.bcds-react-aria-TextField--Description {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-secondary);\n padding: var(--layout-padding-xsmall) var(--layout-padding-none);\n}\n\n/* Styles for the input field container */\n.bcds-react-aria-TextField--container {\n color: var(--typography-color-primary);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--layout-margin-small);\n background: var(--surface-color-forms-default);\n box-sizing: border-box;\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-default);\n border-radius: var(--layout-border-radius-medium);\n padding: var(--layout-padding-small) 12px;\n}\n\n/* Sizes */\n.bcds-react-aria-TextField--container.small {\n height: var(--layout-margin-xlarge);\n min-height: var(--layout-margin-xlarge);\n}\n\n.bcds-react-aria-TextField--container.medium {\n height: var(--layout-margin-xxlarge);\n min-height: var(--layout-margin-xxlarge);\n}\n\n/* Text input field */\n.bcds-react-aria-TextField--Input {\n font: var(--typography-regular-body);\n padding: var(--layout-padding-none);\n color: var(--typography-color-primary);\n border: none;\n flex-grow: 1;\n}\n\n.bcds-react-aria-TextField--Input::placeholder {\n color: var(--typography-color-placeholder);\n}\n\n/* Hover and focus states */\n\n.bcds-react-aria-TextField--container\n > .bcds-react-aria-TextField--Input[data-focused] {\n outline: none;\n}\n\n.bcds-react-aria-TextField--container:focus-within {\n border-radius: var(--layout-border-radius-large);\n border: var(--layout-border-width-small) solid\n var(--surface-color-border-active);\n outline: solid var(--layout-border-width-medium)\n var(--surface-color-border-active);\n outline-offset: var(--layout-margin-hair);\n}\n\n.bcds-react-aria-TextField--container:hover {\n border-color: var(--surface-color-border-dark);\n}\n\n/* Disabled and invalid states */\n\n.bcds-react-aria-TextField[data-disabled]\n > .bcds-react-aria-TextField--container,\n.bcds-react-aria-TextField[data-disabled] .bcds-react-aria-TextField--Input {\n background: var(--surface-color-forms-disabled);\n color: var(--typography-color-placeholder);\n cursor: not-allowed;\n}\n\n.bcds-react-aria-TextField[data-invalid]\n > .bcds-react-aria-TextField--container {\n border-radius: var(--layout-border-radius-medium);\n border: var(--layout-border-width-small) solid\n var(--support-border-color-danger);\n background: var(--surface-color-forms-default);\n}\n\n.bcds-react-aria-TextField[data-readonly]\n > .bcds-react-aria-TextField--container,\n.bcds-react-aria-TextField[data-readonly] .bcds-react-aria-TextField--Input {\n background: var(--surface-color-forms-disabled);\n}\n\n.bcds-react-aria-TextField[data-readonly]\n > .bcds-react-aria-TextField--container\n > .bcds-react-aria-TextField--Input {\n background: var(--surface-color-forms-disabled);\n}\n\n/* Styles for the error message slot */\n.bcds-react-aria-TextField--Error {\n font: var(--typography-regular-small-body);\n color: var(--typography-color-danger);\n}\n\n.bcds-react-aria-TextField[data-invalid]\n > .bcds-react-aria-TextField--container\n > svg#exclamation-icon {\n color: var(--icons-color-danger);\n min-width: var(--icons-size-medium);\n height: var(--icons-size-medium);\n}\n";
|
|
18074
18153
|
styleInject(css_248z$2);
|
|
18075
18154
|
|
|
18076
18155
|
function TextField({ size, label, description, errorMessage, iconLeft, iconRight, ...props }) {
|