@jobber/components 6.123.1 → 6.123.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AtlantisThemeContext-cjs.js +1 -1
- package/dist/AtlantisThemeContext-es.js +9 -9
- package/dist/Autocomplete/Autocomplete.types.d.ts +33 -0
- package/dist/Autocomplete/index.cjs +5 -5
- package/dist/Autocomplete/index.mjs +8 -8
- package/dist/Autocomplete/useAutocomplete.d.ts +2 -57
- package/dist/Body-cjs.js +1 -1
- package/dist/Body-es.js +2 -2
- package/dist/BottomSheet-cjs.js +1 -1
- package/dist/BottomSheet-es.js +1 -1
- package/dist/Box-cjs.js +2 -2
- package/dist/Box-es.js +2 -2
- package/dist/Button/index.mjs +1 -1
- package/dist/Button-es.js +1 -1
- package/dist/Card-cjs.js +1 -1
- package/dist/Card-es.js +1 -1
- package/dist/Checkbox/index.cjs +1 -1
- package/dist/Checkbox/index.mjs +1 -1
- package/dist/Chip/index.mjs +1 -1
- package/dist/Chip-cjs.js +2 -2
- package/dist/Chip-es.js +2 -2
- package/dist/ChipDismissible-es.js +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -1
- package/dist/Combobox-cjs.js +1 -1
- package/dist/Combobox-es.js +1 -1
- package/dist/ComboboxAction-cjs.js +1 -1
- package/dist/ComboboxAction-es.js +1 -1
- package/dist/ComboboxContent-cjs.js +1 -1
- package/dist/ComboboxContent-es.js +2 -2
- package/dist/ComboboxContentHeader-cjs.js +1 -1
- package/dist/ComboboxContentHeader-es.js +1 -1
- package/dist/ComboboxContentList-es.js +1 -1
- package/dist/ComboboxContentSearch-cjs.js +1 -1
- package/dist/ComboboxContentSearch-es.js +1 -1
- package/dist/ComboboxLoadMore-cjs.js +1 -1
- package/dist/ComboboxLoadMore-es.js +1 -1
- package/dist/ComboboxOption-cjs.js +1 -1
- package/dist/ComboboxOption-es.js +1 -1
- package/dist/Container-cjs.js +1 -1
- package/dist/Container-es.js +1 -1
- package/dist/Content-cjs.js +1 -1
- package/dist/Content-es.js +1 -1
- package/dist/ContentBlock-cjs.js +1 -1
- package/dist/ContentBlock-es.js +1 -1
- package/dist/Countdown-cjs.js +7 -3
- package/dist/Countdown-es.js +8 -4
- package/dist/Cover-cjs.js +1 -1
- package/dist/Cover-es.js +1 -1
- package/dist/DataList-es.js +3 -3
- package/dist/DataList.const-cjs.js +0 -1
- package/dist/DataList.const-es.js +1 -2
- package/dist/DataList.module-cjs.js +1 -1
- package/dist/DataList.module-es.js +1 -1
- package/dist/DataList.utils-es.js +6 -6
- package/dist/DataListAction-cjs.js +1 -1
- package/dist/DataListAction-es.js +1 -1
- package/dist/DataListActionsMenu-cjs.js +1 -1
- package/dist/DataListActionsMenu-es.js +2 -2
- package/dist/DataListBulkActions-cjs.js +1 -1
- package/dist/DataListBulkActions-es.js +1 -1
- package/dist/DataListContext-cjs.js +6 -5
- package/dist/DataListContext-es.js +6 -5
- package/dist/DataListEmptyState-cjs.js +1 -1
- package/dist/DataListEmptyState-es.js +1 -1
- package/dist/DataListHeaderTile-cjs.js +2 -2
- package/dist/DataListHeaderTile-es.js +2 -2
- package/dist/DataListItemActions-cjs.js +1 -1
- package/dist/DataListItemActions-es.js +2 -2
- package/dist/DataListLayoutActions-cjs.js +1 -1
- package/dist/DataListLayoutActions-es.js +2 -2
- package/dist/DataListLoadMore-cjs.js +1 -1
- package/dist/DataListLoadMore-es.js +1 -1
- package/dist/DataListLoadingState-cjs.js +1 -1
- package/dist/DataListLoadingState-es.js +2 -2
- package/dist/DataListOverflowFade-cjs.js +1 -1
- package/dist/DataListOverflowFade-es.js +1 -1
- package/dist/DataListSearch-cjs.js +1 -1
- package/dist/DataListSearch-es.js +1 -1
- package/dist/DataListSortingOptions-cjs.js +1 -1
- package/dist/DataListSortingOptions-es.js +1 -1
- package/dist/DataListStickyHeader-cjs.js +1 -1
- package/dist/DataListStickyHeader-es.js +1 -1
- package/dist/DataListTags-cjs.js +1 -1
- package/dist/DataListTags-es.js +1 -1
- package/dist/DataListTotalCount-cjs.js +1 -1
- package/dist/DataListTotalCount-es.js +2 -2
- package/dist/DataTable/index.mjs +1 -1
- package/dist/DataTable-cjs.js +3 -3
- package/dist/DataTable-es.js +5 -5
- package/dist/DataTableTable-cjs.js +2 -2
- package/dist/DataTableTable-es.js +3 -3
- package/dist/DatePicker-cjs.js +266 -81
- package/dist/DatePicker-es.js +268 -83
- package/dist/DayOfMonthSelect-cjs.js +5 -5
- package/dist/DayOfMonthSelect-es.js +6 -6
- package/dist/DescriptionList-cjs.js +1 -1
- package/dist/DescriptionList-es.js +1 -1
- package/dist/Disclosure-cjs.js +1 -1
- package/dist/Disclosure-es.js +1 -1
- package/dist/Divider-cjs.js +1 -1
- package/dist/Divider-es.js +1 -1
- package/dist/DrawerGrid-cjs.js +2 -2
- package/dist/DrawerGrid-es.js +2 -2
- package/dist/DrawerRoot-cjs.js +10 -48
- package/dist/DrawerRoot-es.js +12 -50
- package/dist/FeatureSwitch-cjs.js +1 -1
- package/dist/FeatureSwitch-es.js +1 -1
- package/dist/FormField/index.mjs +1 -1
- package/dist/FormField-cjs.js +1 -1
- package/dist/FormField-es.js +2 -2
- package/dist/FormatEmail-cjs.js +1 -1
- package/dist/FormatEmail-es.js +1 -1
- package/dist/FormatFile-cjs.js +1 -6
- package/dist/FormatFile-es.js +1 -6
- package/dist/Frame-cjs.js +1 -1
- package/dist/Frame-es.js +1 -1
- package/dist/Glimmer/index.mjs +1 -1
- package/dist/Glimmer-cjs.js +1 -1
- package/dist/Glimmer-es.js +2 -2
- package/dist/Grid-cjs.js +1 -1
- package/dist/Grid-es.js +1 -1
- package/dist/GridCell-cjs.js +1 -1
- package/dist/GridCell-es.js +1 -1
- package/dist/InputAvatar-cjs.js +1 -1
- package/dist/InputAvatar-es.js +1 -1
- package/dist/InputDate/index.mjs +1 -1
- package/dist/InputEmail/index.mjs +1 -1
- package/dist/InputFile-cjs.js +8 -3
- package/dist/InputFile-es.js +8 -3
- package/dist/InputNumber/index.cjs +181 -69
- package/dist/InputNumber/index.mjs +184 -72
- package/dist/InputPassword-es.js +1 -1
- package/dist/InputPhoneNumber/index.cjs +1 -1
- package/dist/InputPhoneNumber/index.mjs +2 -2
- package/dist/InputText/InputText.d.ts +2 -70
- package/dist/InputText/index.mjs +1 -1
- package/dist/InputTime/index.cjs +0 -1
- package/dist/InputTime/index.mjs +1 -2
- package/dist/InputValidation-cjs.js +1 -1
- package/dist/InputValidation-es.js +1 -1
- package/dist/InternalChipDismissible-cjs.js +1 -1
- package/dist/InternalChipDismissible-es.js +2 -2
- package/dist/LightBox-cjs.js +1 -1
- package/dist/LightBox-es.js +1 -1
- package/dist/Link-cjs.js +1 -1
- package/dist/Link-es.js +1 -1
- package/dist/List-cjs.js +3 -3
- package/dist/List-es.js +7 -7
- package/dist/Markdown-cjs.js +604 -961
- package/dist/Markdown-es.js +610 -967
- package/dist/Menu/Menu.d.ts +1 -1
- package/dist/Menu-cjs.js +859 -629
- package/dist/Menu-es.js +855 -625
- package/dist/Modal/index.cjs +2 -2
- package/dist/Modal/index.mjs +2 -2
- package/dist/Modal/useModal.d.ts +9 -29
- package/dist/MultiSelect-cjs.js +2 -2
- package/dist/MultiSelect-es.js +2 -2
- package/dist/OverlaySeparator-cjs.js +1 -1
- package/dist/OverlaySeparator-es.js +1 -1
- package/dist/Popover-cjs.js +1 -1
- package/dist/Popover-es.js +2 -2
- package/dist/ProgressBar-cjs.js +1 -1
- package/dist/ProgressBar-es.js +1 -1
- package/dist/RadioGroup-cjs.js +1 -1
- package/dist/RadioGroup-es.js +1 -1
- package/dist/RecurringSelect/components/index.mjs +1 -1
- package/dist/RecurringSelect/index.cjs +1 -0
- package/dist/RecurringSelect/index.mjs +1 -0
- package/dist/RecurringSelect-cjs.js +1 -1
- package/dist/RecurringSelect-es.js +2 -2
- package/dist/SegmentedControl-cjs.js +1 -1
- package/dist/SegmentedControl-es.js +2 -2
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.mjs +2 -2
- package/dist/SideDrawer-cjs.js +1 -1
- package/dist/SideDrawer-es.js +1 -1
- package/dist/Spinner-cjs.js +1 -1
- package/dist/Spinner-es.js +1 -1
- package/dist/StatusIndicator-cjs.js +1 -1
- package/dist/StatusIndicator-es.js +1 -1
- package/dist/Switch-cjs.js +1 -1
- package/dist/Switch-es.js +1 -1
- package/dist/Table/index.mjs +1 -1
- package/dist/Tabs/index.mjs +1 -1
- package/dist/Tabs-cjs.js +1 -1
- package/dist/Tabs-es.js +6 -6
- package/dist/Text-cjs2.js +365 -175
- package/dist/Text-es2.js +361 -175
- package/dist/Thumbnail-cjs.js +1 -1
- package/dist/Thumbnail-es.js +2 -2
- package/dist/Tiles-cjs.js +1 -1
- package/dist/Tiles-es.js +1 -1
- package/dist/Tooltip-cjs.js +1 -1
- package/dist/Tooltip-es.js +2 -2
- package/dist/Typography-cjs.js +3 -3
- package/dist/Typography-es.js +3 -3
- package/dist/_baseEach-cjs.js +1 -1
- package/dist/_baseEach-es.js +7 -7
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/_getAllKeys-cjs.js +2 -8
- package/dist/_getAllKeys-es.js +4 -10
- package/dist/_getTag-es.js +1 -1
- package/dist/_isIterateeCall-es.js +3 -3
- package/dist/_setToString-es.js +2 -2
- package/dist/debounce-es.js +4 -4
- package/dist/floating-ui.react-cjs.js +35 -16
- package/dist/floating-ui.react-dom-es.js +2 -2
- package/dist/floating-ui.react-es.js +37 -18
- package/dist/identity-es.js +5 -5
- package/dist/index-cjs.js +6 -6
- package/dist/index-es.js +6 -6
- package/dist/index.esm-es.js +1 -1
- package/dist/index.mjs +6 -6
- package/dist/isSymbol-es.js +1 -1
- package/dist/isTypedArray-cjs.js +4 -4
- package/dist/isTypedArray-es.js +6 -6
- package/dist/keysIn-cjs.js +2 -2
- package/dist/keysIn-es.js +5 -5
- package/dist/noop-es.js +4 -4
- package/dist/omit-cjs.js +37 -5
- package/dist/omit-es.js +46 -14
- package/dist/showToast-cjs.js +1 -1
- package/dist/showToast-es.js +1 -1
- package/dist/styles.css +56 -124
- package/dist/unstyledPrimitives/index.mjs +3 -3
- package/dist/useScrollToActive-cjs.js +1 -1
- package/dist/useScrollToActive-es.js +8 -8
- package/package.json +32 -15
- package/rollup.config.mjs +4 -1
package/dist/Text-cjs2.js
CHANGED
|
@@ -16,36 +16,6 @@ var clsx = require('./clsx-cjs.js');
|
|
|
16
16
|
*/
|
|
17
17
|
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (React).useLayoutEffect : ()=>{};
|
|
18
18
|
|
|
19
|
-
/*
|
|
20
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
21
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
-
* governing permissions and limitations under the License.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
|
|
32
|
-
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
|
|
33
|
-
// before all layout effects, but is available only in React 18 and later.
|
|
34
|
-
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = (React)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
|
|
35
|
-
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
36
|
-
const ref = (React.useRef)(null);
|
|
37
|
-
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
|
|
38
|
-
ref.current = fn;
|
|
39
|
-
}, [
|
|
40
|
-
fn
|
|
41
|
-
]);
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
return (React.useCallback)((...args)=>{
|
|
44
|
-
const f = ref.current;
|
|
45
|
-
return f === null || f === void 0 ? void 0 : f(...args);
|
|
46
|
-
}, []);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
19
|
/*
|
|
50
20
|
* Copyright 2020 Adobe. All rights reserved.
|
|
51
21
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -60,10 +30,13 @@ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
|
60
30
|
|
|
61
31
|
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
62
32
|
let [value, setValue] = (React.useState)(defaultValue);
|
|
33
|
+
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
|
|
34
|
+
// This allows us to maintain a stable queue function.
|
|
35
|
+
let currValue = (React.useRef)(value);
|
|
63
36
|
let effect = (React.useRef)(null);
|
|
64
37
|
// Store the function in a ref so we can always access the current version
|
|
65
38
|
// which has the proper `value` in scope.
|
|
66
|
-
let nextRef = (
|
|
39
|
+
let nextRef = (React.useRef)(()=>{
|
|
67
40
|
if (!effect.current) return;
|
|
68
41
|
// Run the generator to the next yield.
|
|
69
42
|
let newValue = effect.current.next();
|
|
@@ -75,17 +48,20 @@ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
|
75
48
|
// If the value is the same as the current value,
|
|
76
49
|
// then continue to the next yield. Otherwise,
|
|
77
50
|
// set the value in state and wait for the next layout effect.
|
|
78
|
-
if (
|
|
51
|
+
if (currValue.current === newValue.value) nextRef.current();
|
|
79
52
|
else setValue(newValue.value);
|
|
80
53
|
});
|
|
81
54
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
55
|
+
currValue.current = value;
|
|
82
56
|
// If there is an effect currently running, continue to the next yield.
|
|
83
|
-
if (effect.current) nextRef();
|
|
84
|
-
});
|
|
85
|
-
let queue = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((fn)=>{
|
|
86
|
-
effect.current = fn(value);
|
|
87
|
-
nextRef();
|
|
57
|
+
if (effect.current) nextRef.current();
|
|
88
58
|
});
|
|
59
|
+
let queue = (React.useCallback)((fn)=>{
|
|
60
|
+
effect.current = fn(currValue.current);
|
|
61
|
+
nextRef.current();
|
|
62
|
+
}, [
|
|
63
|
+
nextRef
|
|
64
|
+
]);
|
|
89
65
|
return [
|
|
90
66
|
value,
|
|
91
67
|
queue
|
|
@@ -326,7 +302,7 @@ function $f4e2df6bd15f8569$export$98658e8c59125e6a() {
|
|
|
326
302
|
}
|
|
327
303
|
|
|
328
304
|
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
|
|
329
|
-
|
|
305
|
+
/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */
|
|
330
306
|
|
|
331
307
|
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
|
|
332
308
|
if (!($f4e2df6bd15f8569$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
|
|
@@ -350,11 +326,55 @@ const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
|
|
|
350
326
|
return activeElement;
|
|
351
327
|
};
|
|
352
328
|
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
|
|
353
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)() && event.target.shadowRoot) {
|
|
354
|
-
|
|
329
|
+
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
|
|
330
|
+
var _event_composedPath_, _event_nativeEvent_composedPath_;
|
|
331
|
+
if ('composedPath' in event) return (_event_composedPath_ = event.composedPath()[0]) !== null && _event_composedPath_ !== void 0 ? _event_composedPath_ : null;
|
|
332
|
+
else if ('composedPath' in event.nativeEvent) return (_event_nativeEvent_composedPath_ = event.nativeEvent.composedPath()[0]) !== null && _event_nativeEvent_composedPath_ !== void 0 ? _event_nativeEvent_composedPath_ : null;
|
|
355
333
|
}
|
|
356
334
|
return event.target;
|
|
357
335
|
}
|
|
336
|
+
function $d4ee10de306f2510$export$b4f377a2b6254582(node) {
|
|
337
|
+
if (!node) return false;
|
|
338
|
+
// Get the active element within the node's parent shadow root (or the document). Can return null.
|
|
339
|
+
let root = node.getRootNode();
|
|
340
|
+
let ownerWindow = ($431fbd86ca7dc216$export$f21a1ffae260145a)(node);
|
|
341
|
+
if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) return false;
|
|
342
|
+
let activeElement = root.activeElement;
|
|
343
|
+
// Check if the active element is within this node. These nodes are within the same shadow root.
|
|
344
|
+
return activeElement != null && node.contains(activeElement);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/*
|
|
348
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
349
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
350
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
351
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
352
|
+
*
|
|
353
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
354
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
355
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
356
|
+
* governing permissions and limitations under the License.
|
|
357
|
+
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
|
|
358
|
+
if (refs.length === 1 && refs[0]) return refs[0];
|
|
359
|
+
return (value)=>{
|
|
360
|
+
let hasCleanup = false;
|
|
361
|
+
const cleanups = refs.map((ref)=>{
|
|
362
|
+
const cleanup = $5dc95899b306f630$var$setRef(ref, value);
|
|
363
|
+
hasCleanup || (hasCleanup = typeof cleanup == 'function');
|
|
364
|
+
return cleanup;
|
|
365
|
+
});
|
|
366
|
+
if (hasCleanup) return ()=>{
|
|
367
|
+
cleanups.forEach((cleanup, i)=>{
|
|
368
|
+
if (typeof cleanup === 'function') cleanup();
|
|
369
|
+
else $5dc95899b306f630$var$setRef(refs[i], null);
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function $5dc95899b306f630$var$setRef(ref, value) {
|
|
375
|
+
if (typeof ref === 'function') return ref(value);
|
|
376
|
+
else if (ref != null) ref.current = value;
|
|
377
|
+
}
|
|
358
378
|
|
|
359
379
|
/*
|
|
360
380
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -369,6 +389,7 @@ function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
|
|
|
369
389
|
*/
|
|
370
390
|
|
|
371
391
|
|
|
392
|
+
|
|
372
393
|
function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
|
|
373
394
|
// Start with a base clone of the first argument. This is a lot faster than starting
|
|
374
395
|
// with an empty object and adding properties as we go.
|
|
@@ -385,44 +406,13 @@ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
|
|
|
385
406
|
key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = ($ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
|
|
386
407
|
else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (clsx.clsx)(a, b);
|
|
387
408
|
else if (key === 'id' && a && b) result.id = ($bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
|
|
409
|
+
else if (key === 'ref' && a && b) result.ref = ($5dc95899b306f630$export$c9058316764c140e)(a, b);
|
|
388
410
|
else result[key] = b !== undefined ? b : a;
|
|
389
411
|
}
|
|
390
412
|
}
|
|
391
413
|
return result;
|
|
392
414
|
}
|
|
393
415
|
|
|
394
|
-
/*
|
|
395
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
396
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
397
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
398
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
399
|
-
*
|
|
400
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
401
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
402
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
403
|
-
* governing permissions and limitations under the License.
|
|
404
|
-
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
|
|
405
|
-
if (refs.length === 1 && refs[0]) return refs[0];
|
|
406
|
-
return (value)=>{
|
|
407
|
-
let hasCleanup = false;
|
|
408
|
-
const cleanups = refs.map((ref)=>{
|
|
409
|
-
const cleanup = $5dc95899b306f630$var$setRef(ref, value);
|
|
410
|
-
hasCleanup || (hasCleanup = typeof cleanup == 'function');
|
|
411
|
-
return cleanup;
|
|
412
|
-
});
|
|
413
|
-
if (hasCleanup) return ()=>{
|
|
414
|
-
cleanups.forEach((cleanup, i)=>{
|
|
415
|
-
if (typeof cleanup === 'function') cleanup();
|
|
416
|
-
else $5dc95899b306f630$var$setRef(refs[i], null);
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
function $5dc95899b306f630$var$setRef(ref, value) {
|
|
422
|
-
if (typeof ref === 'function') return ref(value);
|
|
423
|
-
else if (ref != null) ref.current = value;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
416
|
/*
|
|
427
417
|
* Copyright 2020 Adobe. All rights reserved.
|
|
428
418
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -499,7 +489,7 @@ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
|
|
|
499
489
|
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
500
490
|
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
|
|
501
491
|
let filteredProps = {};
|
|
502
|
-
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];
|
|
492
|
+
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];
|
|
503
493
|
return filteredProps;
|
|
504
494
|
}
|
|
505
495
|
|
|
@@ -624,6 +614,110 @@ const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(f
|
|
|
624
614
|
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
625
615
|
});
|
|
626
616
|
|
|
617
|
+
/*
|
|
618
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
619
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
620
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
621
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
622
|
+
*
|
|
623
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
624
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
625
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
626
|
+
* governing permissions and limitations under the License.
|
|
627
|
+
*/
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (React.createContext)({
|
|
631
|
+
isNative: true,
|
|
632
|
+
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
|
|
633
|
+
useHref: (href)=>href
|
|
634
|
+
});
|
|
635
|
+
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
|
|
636
|
+
return (React.useContext)($ea8dcbcb9ea1b556$var$RouterContext);
|
|
637
|
+
}
|
|
638
|
+
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
|
|
639
|
+
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
|
|
640
|
+
let target = link.getAttribute('target');
|
|
641
|
+
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
|
|
642
|
+
!modifiers.ctrlKey && // open in new tab (windows)
|
|
643
|
+
!modifiers.altKey && // download
|
|
644
|
+
!modifiers.shiftKey;
|
|
645
|
+
}
|
|
646
|
+
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
647
|
+
var _window_event_type, _window_event;
|
|
648
|
+
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
649
|
+
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
650
|
+
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
651
|
+
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
652
|
+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
653
|
+
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') {
|
|
654
|
+
if (($c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
655
|
+
else ctrlKey = true;
|
|
656
|
+
}
|
|
657
|
+
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
|
|
658
|
+
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
|
|
659
|
+
let event = ($c87311424ea30a05$export$78551043582a6a98)() && ($c87311424ea30a05$export$9ac100e40613ea10)() && !($c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
|
|
660
|
+
keyIdentifier: 'Enter',
|
|
661
|
+
metaKey: metaKey,
|
|
662
|
+
ctrlKey: ctrlKey,
|
|
663
|
+
altKey: altKey,
|
|
664
|
+
shiftKey: shiftKey
|
|
665
|
+
}) : new MouseEvent('click', {
|
|
666
|
+
metaKey: metaKey,
|
|
667
|
+
ctrlKey: ctrlKey,
|
|
668
|
+
altKey: altKey,
|
|
669
|
+
shiftKey: shiftKey,
|
|
670
|
+
detail: 1,
|
|
671
|
+
bubbles: true,
|
|
672
|
+
cancelable: true
|
|
673
|
+
});
|
|
674
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
|
|
675
|
+
($7215afc6de606d6b$export$de79e2c695e052f3)(target);
|
|
676
|
+
target.dispatchEvent(event);
|
|
677
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
678
|
+
}
|
|
679
|
+
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
680
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
681
|
+
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
682
|
+
if (target instanceof HTMLAnchorElement) open(target);
|
|
683
|
+
else if (target.hasAttribute('data-href')) {
|
|
684
|
+
let link = document.createElement('a');
|
|
685
|
+
link.href = target.getAttribute('data-href');
|
|
686
|
+
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
|
|
687
|
+
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
|
|
688
|
+
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
|
|
689
|
+
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
|
|
690
|
+
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
|
|
691
|
+
target.appendChild(link);
|
|
692
|
+
open(link);
|
|
693
|
+
target.removeChild(link);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
697
|
+
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
698
|
+
}
|
|
699
|
+
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
700
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
701
|
+
var _props_href;
|
|
702
|
+
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
703
|
+
return {
|
|
704
|
+
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
|
|
705
|
+
target: props === null || props === void 0 ? void 0 : props.target,
|
|
706
|
+
rel: props === null || props === void 0 ? void 0 : props.rel,
|
|
707
|
+
download: props === null || props === void 0 ? void 0 : props.download,
|
|
708
|
+
ping: props === null || props === void 0 ? void 0 : props.ping,
|
|
709
|
+
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
|
|
713
|
+
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
714
|
+
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
|
|
715
|
+
!e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
|
|
716
|
+
e.preventDefault();
|
|
717
|
+
router.open(e.currentTarget, e, href, routerOptions);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
627
721
|
/*
|
|
628
722
|
* Copyright 2020 Adobe. All rights reserved.
|
|
629
723
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -640,6 +734,7 @@ const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(f
|
|
|
640
734
|
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
|
|
641
735
|
// than one or the other. So we need to track what's actually transitioning so that
|
|
642
736
|
// we can ignore these duplicate events.
|
|
737
|
+
|
|
643
738
|
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
|
|
644
739
|
// A list of callbacks to call once there are no transitioning elements.
|
|
645
740
|
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
|
|
@@ -649,31 +744,33 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
|
649
744
|
return 'propertyName' in event;
|
|
650
745
|
}
|
|
651
746
|
let onTransitionStart = (e)=>{
|
|
652
|
-
|
|
747
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
748
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
653
749
|
// Add the transitioning property to the list for this element.
|
|
654
|
-
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(
|
|
750
|
+
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(eventTarget);
|
|
655
751
|
if (!transitions) {
|
|
656
752
|
transitions = new Set();
|
|
657
|
-
$bbed8b41f857bcc0$var$transitionsByElement.set(
|
|
753
|
+
$bbed8b41f857bcc0$var$transitionsByElement.set(eventTarget, transitions);
|
|
658
754
|
// The transitioncancel event must be registered on the element itself, rather than as a global
|
|
659
755
|
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
|
|
660
756
|
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
|
|
661
|
-
|
|
757
|
+
eventTarget.addEventListener('transitioncancel', onTransitionEnd, {
|
|
662
758
|
once: true
|
|
663
759
|
});
|
|
664
760
|
}
|
|
665
761
|
transitions.add(e.propertyName);
|
|
666
762
|
};
|
|
667
763
|
let onTransitionEnd = (e)=>{
|
|
668
|
-
|
|
764
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
765
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
669
766
|
// Remove property from list of transitioning properties.
|
|
670
|
-
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(
|
|
767
|
+
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(eventTarget);
|
|
671
768
|
if (!properties) return;
|
|
672
769
|
properties.delete(e.propertyName);
|
|
673
770
|
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
|
|
674
771
|
if (properties.size === 0) {
|
|
675
|
-
|
|
676
|
-
$bbed8b41f857bcc0$var$transitionsByElement.delete(
|
|
772
|
+
eventTarget.removeEventListener('transitioncancel', onTransitionEnd);
|
|
773
|
+
$bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
|
|
677
774
|
}
|
|
678
775
|
// If no transitioning elements, call all of the queued callbacks.
|
|
679
776
|
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
|
|
@@ -842,6 +939,36 @@ function $df56164dff5785e2$export$4338b53315abf666(ref) {
|
|
|
842
939
|
]);
|
|
843
940
|
}
|
|
844
941
|
|
|
942
|
+
/*
|
|
943
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
944
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
945
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
946
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
947
|
+
*
|
|
948
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
949
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
950
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
951
|
+
* governing permissions and limitations under the License.
|
|
952
|
+
*/
|
|
953
|
+
|
|
954
|
+
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
|
|
955
|
+
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
|
|
956
|
+
// before all layout effects, but is available only in React 18 and later.
|
|
957
|
+
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = (React)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
|
|
958
|
+
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
959
|
+
const ref = (React.useRef)(null);
|
|
960
|
+
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
|
|
961
|
+
ref.current = fn;
|
|
962
|
+
}, [
|
|
963
|
+
fn
|
|
964
|
+
]);
|
|
965
|
+
// @ts-ignore
|
|
966
|
+
return (React.useCallback)((...args)=>{
|
|
967
|
+
const f = ref.current;
|
|
968
|
+
return f === null || f === void 0 ? void 0 : f(...args);
|
|
969
|
+
}, []);
|
|
970
|
+
}
|
|
971
|
+
|
|
845
972
|
/*
|
|
846
973
|
* Copyright 2020 Adobe. All rights reserved.
|
|
847
974
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -890,8 +1017,7 @@ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options)
|
|
|
890
1017
|
ref,
|
|
891
1018
|
event,
|
|
892
1019
|
options,
|
|
893
|
-
isDisabled
|
|
894
|
-
handleEvent
|
|
1020
|
+
isDisabled
|
|
895
1021
|
]);
|
|
896
1022
|
}
|
|
897
1023
|
|
|
@@ -954,7 +1080,9 @@ function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
|
|
|
954
1080
|
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
955
1081
|
}
|
|
956
1082
|
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
|
|
957
|
-
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility(
|
|
1083
|
+
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
|
|
1084
|
+
visibilityProperty: true
|
|
1085
|
+
}) && !element.closest('[data-react-aria-prevent-focus]');
|
|
958
1086
|
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
959
1087
|
}
|
|
960
1088
|
|
|
@@ -1014,8 +1142,14 @@ function $b4b717babfbb907b$var$isInert(element) {
|
|
|
1014
1142
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1015
1143
|
* governing permissions and limitations under the License.
|
|
1016
1144
|
*/
|
|
1145
|
+
var $458b0a5536c1a7cf$var$_React_useInsertionEffect;
|
|
1146
|
+
// Use the earliest effect possible to reset the ref below.
|
|
1147
|
+
const $458b0a5536c1a7cf$var$useEarlyEffect = typeof document !== 'undefined' ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = (React)['useInsertionEffect']) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : (React).useLayoutEffect : ()=>{};
|
|
1017
1148
|
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
1149
|
+
// Store the value in both state and a ref. The state value will only be used when uncontrolled.
|
|
1150
|
+
// The ref is used to track the most current value, which is passed to the function setState callback.
|
|
1018
1151
|
let [stateValue, setStateValue] = (React.useState)(value || defaultValue);
|
|
1152
|
+
let valueRef = (React.useRef)(stateValue);
|
|
1019
1153
|
let isControlledRef = (React.useRef)(value !== undefined);
|
|
1020
1154
|
let isControlled = value !== undefined;
|
|
1021
1155
|
(React.useEffect)(()=>{
|
|
@@ -1025,40 +1159,28 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
1025
1159
|
}, [
|
|
1026
1160
|
isControlled
|
|
1027
1161
|
]);
|
|
1162
|
+
// After each render, update the ref to the current value.
|
|
1163
|
+
// This ensures that the setState callback argument is reset.
|
|
1164
|
+
// Note: the effect should not have any dependencies so that controlled values always reset.
|
|
1028
1165
|
let currentValue = isControlled ? value : stateValue;
|
|
1166
|
+
$458b0a5536c1a7cf$var$useEarlyEffect(()=>{
|
|
1167
|
+
valueRef.current = currentValue;
|
|
1168
|
+
});
|
|
1169
|
+
let [, forceUpdate] = (React.useReducer)(()=>({}), {});
|
|
1029
1170
|
let setValue = (React.useCallback)((value, ...args)=>{
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
//
|
|
1037
|
-
|
|
1038
|
-
//
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
if (typeof value === 'function') {
|
|
1042
|
-
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');
|
|
1043
|
-
// this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
|
|
1044
|
-
// when someone using useControlledState calls setControlledState(myFunc)
|
|
1045
|
-
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
|
|
1046
|
-
// 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
|
|
1047
|
-
// 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
|
|
1048
|
-
let updateFunction = (oldValue, ...functionArgs)=>{
|
|
1049
|
-
let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
1050
|
-
onChangeCaller(interceptedValue, ...args);
|
|
1051
|
-
if (!isControlled) return interceptedValue;
|
|
1052
|
-
return oldValue;
|
|
1053
|
-
};
|
|
1054
|
-
setStateValue(updateFunction);
|
|
1055
|
-
} else {
|
|
1056
|
-
if (!isControlled) setStateValue(value);
|
|
1057
|
-
onChangeCaller(value, ...args);
|
|
1171
|
+
// @ts-ignore - TS doesn't know that T cannot be a function.
|
|
1172
|
+
let newValue = typeof value === 'function' ? value(valueRef.current) : value;
|
|
1173
|
+
if (!Object.is(valueRef.current, newValue)) {
|
|
1174
|
+
// Update the ref so that the next setState callback has the most recent value.
|
|
1175
|
+
valueRef.current = newValue;
|
|
1176
|
+
setStateValue(newValue);
|
|
1177
|
+
// Always trigger a re-render, even when controlled, so that the layout effect above runs to reset the value.
|
|
1178
|
+
forceUpdate();
|
|
1179
|
+
// Trigger onChange. Note that if setState is called multiple times in a single event,
|
|
1180
|
+
// onChange will be called for each one instead of only once.
|
|
1181
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue, ...args);
|
|
1058
1182
|
}
|
|
1059
1183
|
}, [
|
|
1060
|
-
isControlled,
|
|
1061
|
-
currentValue,
|
|
1062
1184
|
onChange
|
|
1063
1185
|
]);
|
|
1064
1186
|
return [
|
|
@@ -1135,7 +1257,7 @@ function $64fa3d84918910a7$export$2881499e37b75b9a({ values: values, children: c
|
|
|
1135
1257
|
return children;
|
|
1136
1258
|
}
|
|
1137
1259
|
function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
1138
|
-
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values } = props;
|
|
1260
|
+
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values, render: render } = props;
|
|
1139
1261
|
return (React.useMemo)(()=>{
|
|
1140
1262
|
let computedClassName;
|
|
1141
1263
|
let computedStyle;
|
|
@@ -1163,7 +1285,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
1163
1285
|
...computedStyle
|
|
1164
1286
|
} : undefined,
|
|
1165
1287
|
children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
|
|
1166
|
-
'data-rac': ''
|
|
1288
|
+
'data-rac': '',
|
|
1289
|
+
render: render ? (props)=>render(props, values) : undefined
|
|
1167
1290
|
};
|
|
1168
1291
|
}, [
|
|
1169
1292
|
className,
|
|
@@ -1172,7 +1295,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
1172
1295
|
defaultClassName,
|
|
1173
1296
|
defaultChildren,
|
|
1174
1297
|
defaultStyle,
|
|
1175
|
-
values
|
|
1298
|
+
values,
|
|
1299
|
+
render
|
|
1176
1300
|
]);
|
|
1177
1301
|
}
|
|
1178
1302
|
function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
|
|
@@ -1193,7 +1317,6 @@ function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
|
|
|
1193
1317
|
}
|
|
1194
1318
|
function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
|
|
1195
1319
|
let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {};
|
|
1196
|
-
// @ts-ignore - TS says "Type 'unique symbol' cannot be used as an index type." but not sure why.
|
|
1197
1320
|
let { ref: contextRef, ...contextProps } = ctx;
|
|
1198
1321
|
let mergedRef = ($df56164dff5785e2$export$4338b53315abf666)((React.useMemo)(()=>($5dc95899b306f630$export$c9058316764c140e)(ref, contextRef), [
|
|
1199
1322
|
ref,
|
|
@@ -1255,6 +1378,41 @@ function $64fa3d84918910a7$export$ef03459518577ad4(props) {
|
|
|
1255
1378
|
for(const prop in props)if (!prefix.test(prop)) filteredProps[prop] = props[prop];
|
|
1256
1379
|
return filteredProps;
|
|
1257
1380
|
}
|
|
1381
|
+
function $64fa3d84918910a7$var$DOMElement(ElementType, props, forwardedRef) {
|
|
1382
|
+
let { render: render, ...otherProps } = props;
|
|
1383
|
+
let elementRef = (React.useRef)(null);
|
|
1384
|
+
let ref = (React.useMemo)(()=>($5dc95899b306f630$export$c9058316764c140e)(forwardedRef, elementRef), [
|
|
1385
|
+
forwardedRef,
|
|
1386
|
+
elementRef
|
|
1387
|
+
]);
|
|
1388
|
+
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
1389
|
+
if (process.env.NODE_ENV !== 'production' && render) {
|
|
1390
|
+
if (!elementRef.current) console.warn('Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?');
|
|
1391
|
+
else if (elementRef.current.localName !== ElementType) console.warn(`Unexpected DOM element returned by custom \`render\` function. Expected <${ElementType}>, got <${elementRef.current.localName}>. This may break the component behavior and accessibility.`);
|
|
1392
|
+
}
|
|
1393
|
+
}, [
|
|
1394
|
+
ElementType,
|
|
1395
|
+
render
|
|
1396
|
+
]);
|
|
1397
|
+
let domProps = {
|
|
1398
|
+
...otherProps,
|
|
1399
|
+
ref: ref
|
|
1400
|
+
};
|
|
1401
|
+
if (render) return render(domProps, undefined);
|
|
1402
|
+
return /*#__PURE__*/ (React).createElement(ElementType, domProps);
|
|
1403
|
+
}
|
|
1404
|
+
const $64fa3d84918910a7$var$domComponentCache = {};
|
|
1405
|
+
const $64fa3d84918910a7$export$df3a06d6289f983e = new Proxy({}, {
|
|
1406
|
+
get (target, elementType) {
|
|
1407
|
+
if (typeof elementType !== 'string') return undefined;
|
|
1408
|
+
let res = $64fa3d84918910a7$var$domComponentCache[elementType];
|
|
1409
|
+
if (!res) {
|
|
1410
|
+
res = /*#__PURE__*/ (React.forwardRef)($64fa3d84918910a7$var$DOMElement.bind(null, elementType));
|
|
1411
|
+
$64fa3d84918910a7$var$domComponentCache[elementType] = res;
|
|
1412
|
+
}
|
|
1413
|
+
return res;
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1258
1416
|
|
|
1259
1417
|
/*
|
|
1260
1418
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -1366,10 +1524,13 @@ function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
|
|
|
1366
1524
|
}, []);
|
|
1367
1525
|
// We cannot determine the browser's language on the server, so default to
|
|
1368
1526
|
// en-US. This will be updated after hydration on the client to the correct value.
|
|
1369
|
-
if (isSSR)
|
|
1370
|
-
locale
|
|
1371
|
-
|
|
1372
|
-
|
|
1527
|
+
if (isSSR) {
|
|
1528
|
+
let locale = typeof window !== 'undefined' && window[$1e5a04cdaf7d1af8$var$localeSymbol];
|
|
1529
|
+
return {
|
|
1530
|
+
locale: locale || 'en-US',
|
|
1531
|
+
direction: 'ltr'
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1373
1534
|
return defaultLocale;
|
|
1374
1535
|
}
|
|
1375
1536
|
|
|
@@ -1594,24 +1755,22 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
1594
1755
|
}
|
|
1595
1756
|
};
|
|
1596
1757
|
}, []);
|
|
1597
|
-
let dispatchBlur = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
1598
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
1599
|
-
});
|
|
1600
1758
|
// This function is called during a React onFocus event.
|
|
1601
1759
|
return (React.useCallback)((e)=>{
|
|
1602
1760
|
// React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
|
|
1603
1761
|
// Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
|
|
1604
1762
|
// MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
|
|
1605
1763
|
// For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
|
|
1606
|
-
|
|
1764
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1765
|
+
if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
|
|
1607
1766
|
stateRef.current.isFocused = true;
|
|
1608
|
-
let target =
|
|
1767
|
+
let target = eventTarget;
|
|
1609
1768
|
let onBlurHandler = (e)=>{
|
|
1610
1769
|
stateRef.current.isFocused = false;
|
|
1611
1770
|
if (target.disabled) {
|
|
1612
1771
|
// For backward compatibility, dispatch a (fake) React synthetic event.
|
|
1613
1772
|
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e);
|
|
1614
|
-
|
|
1773
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
1615
1774
|
}
|
|
1616
1775
|
// We no longer need the MutationObserver once the target is blurred.
|
|
1617
1776
|
if (stateRef.current.observer) {
|
|
@@ -1626,7 +1785,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
1626
1785
|
if (stateRef.current.isFocused && target.disabled) {
|
|
1627
1786
|
var _stateRef_current_observer;
|
|
1628
1787
|
(_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
|
|
1629
|
-
let relatedTargetEl = target ===
|
|
1788
|
+
let relatedTargetEl = target === ($d4ee10de306f2510$export$cd4e5573fbe2b576)() ? null : ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
1630
1789
|
target.dispatchEvent(new FocusEvent('blur', {
|
|
1631
1790
|
relatedTarget: relatedTargetEl
|
|
1632
1791
|
}));
|
|
@@ -1644,7 +1803,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
1644
1803
|
});
|
|
1645
1804
|
}
|
|
1646
1805
|
}, [
|
|
1647
|
-
|
|
1806
|
+
onBlur
|
|
1648
1807
|
]);
|
|
1649
1808
|
}
|
|
1650
1809
|
let $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
|
|
@@ -1657,10 +1816,10 @@ function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
|
|
|
1657
1816
|
$8a9cb279dc87e130$export$fda7da73ab5d4c48 = true;
|
|
1658
1817
|
let isRefocusing = false;
|
|
1659
1818
|
let onBlur = (e)=>{
|
|
1660
|
-
if (e
|
|
1819
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === activeElement || isRefocusing) e.stopImmediatePropagation();
|
|
1661
1820
|
};
|
|
1662
1821
|
let onFocusOut = (e)=>{
|
|
1663
|
-
if (e
|
|
1822
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === activeElement || isRefocusing) {
|
|
1664
1823
|
e.stopImmediatePropagation();
|
|
1665
1824
|
// If there was no focusable ancestor, we don't expect a focus event.
|
|
1666
1825
|
// Re-focus the original active element here.
|
|
@@ -1672,10 +1831,10 @@ function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
|
|
|
1672
1831
|
}
|
|
1673
1832
|
};
|
|
1674
1833
|
let onFocus = (e)=>{
|
|
1675
|
-
if (e
|
|
1834
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === target || isRefocusing) e.stopImmediatePropagation();
|
|
1676
1835
|
};
|
|
1677
1836
|
let onFocusIn = (e)=>{
|
|
1678
|
-
if (e
|
|
1837
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === target || isRefocusing) {
|
|
1679
1838
|
e.stopImmediatePropagation();
|
|
1680
1839
|
if (!isRefocusing) {
|
|
1681
1840
|
isRefocusing = true;
|
|
@@ -1720,7 +1879,7 @@ function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
|
|
|
1720
1879
|
|
|
1721
1880
|
|
|
1722
1881
|
let $507fabe10e71c6fb$var$currentModality = null;
|
|
1723
|
-
|
|
1882
|
+
const $507fabe10e71c6fb$export$901e90a13c50a14e = new Set();
|
|
1724
1883
|
let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
|
|
1725
1884
|
let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
|
|
1726
1885
|
let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
|
|
@@ -1730,7 +1889,7 @@ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
|
|
|
1730
1889
|
Escape: true
|
|
1731
1890
|
};
|
|
1732
1891
|
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
|
|
1733
|
-
for (let handler of $507fabe10e71c6fb$
|
|
1892
|
+
for (let handler of $507fabe10e71c6fb$export$901e90a13c50a14e)handler(modality, e);
|
|
1734
1893
|
}
|
|
1735
1894
|
/**
|
|
1736
1895
|
* Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
|
|
@@ -1740,20 +1899,21 @@ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
|
|
|
1740
1899
|
}
|
|
1741
1900
|
function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
|
|
1742
1901
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
1743
|
-
if ($507fabe10e71c6fb$var$isValidKey(e)) {
|
|
1902
|
+
if (!($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening && $507fabe10e71c6fb$var$isValidKey(e)) {
|
|
1744
1903
|
$507fabe10e71c6fb$var$currentModality = 'keyboard';
|
|
1745
1904
|
$507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
|
|
1746
1905
|
}
|
|
1747
1906
|
}
|
|
1748
1907
|
function $507fabe10e71c6fb$var$handlePointerEvent(e) {
|
|
1749
1908
|
$507fabe10e71c6fb$var$currentModality = 'pointer';
|
|
1909
|
+
'pointerType' in e ? e.pointerType : 'mouse';
|
|
1750
1910
|
if (e.type === 'mousedown' || e.type === 'pointerdown') {
|
|
1751
1911
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
1752
1912
|
$507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
|
|
1753
1913
|
}
|
|
1754
1914
|
}
|
|
1755
1915
|
function $507fabe10e71c6fb$var$handleClickEvent(e) {
|
|
1756
|
-
if (($6a7db85432448f7f$export$60278871457622de)(e)) {
|
|
1916
|
+
if (!($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening && ($6a7db85432448f7f$export$60278871457622de)(e)) {
|
|
1757
1917
|
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
|
|
1758
1918
|
$507fabe10e71c6fb$var$currentModality = 'virtual';
|
|
1759
1919
|
}
|
|
@@ -1762,7 +1922,7 @@ function $507fabe10e71c6fb$var$handleFocusEvent(e) {
|
|
|
1762
1922
|
// Firefox fires two extra focus events when the user first clicks into an iframe:
|
|
1763
1923
|
// first on the window, then on the document. We ignore these events so they don't
|
|
1764
1924
|
// cause keyboard focus rings to appear.
|
|
1765
|
-
if (e
|
|
1925
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === window || ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === document || ($8a9cb279dc87e130$export$fda7da73ab5d4c48) || !e.isTrusted) return;
|
|
1766
1926
|
// If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
|
|
1767
1927
|
// This occurs, for example, when navigating a form with the next/previous buttons on iOS.
|
|
1768
1928
|
if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
|
|
@@ -1882,27 +2042,30 @@ const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
|
|
|
1882
2042
|
* If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
|
|
1883
2043
|
* focus visible style can be properly set.
|
|
1884
2044
|
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
|
|
1885
|
-
let document1 = ($431fbd86ca7dc216$export$b204af158042fbac)(e
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
const
|
|
1889
|
-
const
|
|
2045
|
+
let document1 = ($431fbd86ca7dc216$export$b204af158042fbac)(e ? ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) : undefined);
|
|
2046
|
+
let eventTarget = e ? ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) : undefined;
|
|
2047
|
+
const IHTMLInputElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(eventTarget).HTMLInputElement : HTMLInputElement;
|
|
2048
|
+
const IHTMLTextAreaElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(eventTarget).HTMLTextAreaElement : HTMLTextAreaElement;
|
|
2049
|
+
const IHTMLElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(eventTarget).HTMLElement : HTMLElement;
|
|
2050
|
+
const IKeyboardEvent = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(eventTarget).KeyboardEvent : KeyboardEvent;
|
|
1890
2051
|
// 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)
|
|
1891
2052
|
// we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element
|
|
1892
|
-
|
|
2053
|
+
let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(document1);
|
|
2054
|
+
isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
|
|
1893
2055
|
return !(isTextInput && modality === 'keyboard' && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
|
|
1894
2056
|
}
|
|
1895
2057
|
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
1896
2058
|
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
|
|
1897
2059
|
(React.useEffect)(()=>{
|
|
2060
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.enabled) === false) return;
|
|
1898
2061
|
let handler = (modality, e)=>{
|
|
1899
2062
|
// We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape
|
|
1900
2063
|
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
|
|
1901
2064
|
fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
|
|
1902
2065
|
};
|
|
1903
|
-
$507fabe10e71c6fb$
|
|
2066
|
+
$507fabe10e71c6fb$export$901e90a13c50a14e.add(handler);
|
|
1904
2067
|
return ()=>{
|
|
1905
|
-
$507fabe10e71c6fb$
|
|
2068
|
+
$507fabe10e71c6fb$export$901e90a13c50a14e.delete(handler);
|
|
1906
2069
|
};
|
|
1907
2070
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1908
2071
|
}, deps);
|
|
@@ -1921,18 +2084,19 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
|
1921
2084
|
*/
|
|
1922
2085
|
|
|
1923
2086
|
function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
|
|
2087
|
+
if (!element.isConnected) return;
|
|
1924
2088
|
// If the user is interacting with a virtual cursor, e.g. screen reader, then
|
|
1925
2089
|
// wait until after any animated transitions that are currently occurring on
|
|
1926
2090
|
// the page before shifting focus. This avoids issues with VoiceOver on iOS
|
|
1927
2091
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
1928
2092
|
// from off the screen.
|
|
1929
2093
|
const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
|
|
1930
|
-
const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
1931
2094
|
if (($507fabe10e71c6fb$export$630ff653c5ada6a9)() === 'virtual') {
|
|
1932
|
-
let lastFocusedElement =
|
|
2095
|
+
let lastFocusedElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
1933
2096
|
($bbed8b41f857bcc0$export$24490316f764c430)(()=>{
|
|
1934
|
-
|
|
1935
|
-
|
|
2097
|
+
const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
2098
|
+
// If focus did not move or focus was lost to the body, and the element is still in the document, focus it.
|
|
2099
|
+
if ((activeElement === lastFocusedElement || activeElement === ownerDocument.body) && element.isConnected) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
1936
2100
|
});
|
|
1937
2101
|
} else ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
1938
2102
|
}
|
|
@@ -1957,7 +2121,7 @@ function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
|
|
|
1957
2121
|
function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
1958
2122
|
let { isDisabled: isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange: onFocusChange } = props;
|
|
1959
2123
|
const onBlur = (React.useCallback)((e)=>{
|
|
1960
|
-
if (e
|
|
2124
|
+
if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
|
|
1961
2125
|
if (onBlurProp) onBlurProp(e);
|
|
1962
2126
|
if (onFocusChange) onFocusChange(false);
|
|
1963
2127
|
return true;
|
|
@@ -1970,9 +2134,10 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
|
1970
2134
|
const onFocus = (React.useCallback)((e)=>{
|
|
1971
2135
|
// Double check that document.activeElement actually matches e.target in case a previously chained
|
|
1972
2136
|
// focus handler already moved focus somewhere else.
|
|
1973
|
-
|
|
2137
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
2138
|
+
const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(eventTarget);
|
|
1974
2139
|
const activeElement = ownerDocument ? ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument) : ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
1975
|
-
if (
|
|
2140
|
+
if (eventTarget === e.currentTarget && eventTarget === activeElement) {
|
|
1976
2141
|
if (onFocusProp) onFocusProp(e);
|
|
1977
2142
|
if (onFocusChange) onFocusChange(true);
|
|
1978
2143
|
onSyntheticFocus(e);
|
|
@@ -2120,11 +2285,11 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
2120
2285
|
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
2121
2286
|
let onBlur = (React.useCallback)((e)=>{
|
|
2122
2287
|
// Ignore events bubbling through portals.
|
|
2123
|
-
if (!e.currentTarget
|
|
2288
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
2124
2289
|
// We don't want to trigger onBlurWithin and then immediately onFocusWithin again
|
|
2125
2290
|
// when moving focus inside the element. Only trigger if the currentTarget doesn't
|
|
2126
2291
|
// include the relatedTarget (where focus is moving).
|
|
2127
|
-
if (state.current.isFocusWithin && !e.currentTarget
|
|
2292
|
+
if (state.current.isFocusWithin && !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, e.relatedTarget)) {
|
|
2128
2293
|
state.current.isFocusWithin = false;
|
|
2129
2294
|
removeAllGlobalListeners();
|
|
2130
2295
|
if (onBlurWithin) onBlurWithin(e);
|
|
@@ -2139,12 +2304,13 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
2139
2304
|
let onSyntheticFocus = ($8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
|
|
2140
2305
|
let onFocus = (React.useCallback)((e)=>{
|
|
2141
2306
|
// Ignore events bubbling through portals.
|
|
2142
|
-
if (!e.currentTarget
|
|
2307
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
2143
2308
|
// Double check that document.activeElement actually matches e.target in case a previously chained
|
|
2144
2309
|
// focus handler already moved focus somewhere else.
|
|
2145
|
-
|
|
2310
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
2311
|
+
const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(eventTarget);
|
|
2146
2312
|
const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
|
|
2147
|
-
if (!state.current.isFocusWithin && activeElement ===
|
|
2313
|
+
if (!state.current.isFocusWithin && activeElement === eventTarget) {
|
|
2148
2314
|
if (onFocusWithin) onFocusWithin(e);
|
|
2149
2315
|
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
2150
2316
|
state.current.isFocusWithin = true;
|
|
@@ -2154,9 +2320,10 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
2154
2320
|
// can manually fire onBlur.
|
|
2155
2321
|
let currentTarget = e.currentTarget;
|
|
2156
2322
|
addGlobalListener(ownerDocument, 'focus', (e)=>{
|
|
2157
|
-
|
|
2323
|
+
let eventTarget = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
2324
|
+
if (state.current.isFocusWithin && !($d4ee10de306f2510$export$4282f70798064fe0)(currentTarget, eventTarget)) {
|
|
2158
2325
|
let nativeEvent = new ownerDocument.defaultView.FocusEvent('blur', {
|
|
2159
|
-
relatedTarget:
|
|
2326
|
+
relatedTarget: eventTarget
|
|
2160
2327
|
});
|
|
2161
2328
|
($8a9cb279dc87e130$export$c2b7abe5d61ec696)(nativeEvent, currentTarget);
|
|
2162
2329
|
let event = ($8a9cb279dc87e130$export$525bc4921d56d4a)(nativeEvent);
|
|
@@ -2250,7 +2417,7 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
2250
2417
|
let { hoverProps: hoverProps, triggerHoverEnd: triggerHoverEnd } = (React.useMemo)(()=>{
|
|
2251
2418
|
let triggerHoverStart = (event, pointerType)=>{
|
|
2252
2419
|
state.pointerType = pointerType;
|
|
2253
|
-
if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget
|
|
2420
|
+
if (isDisabled || pointerType === 'touch' || state.isHovered || !($d4ee10de306f2510$export$4282f70798064fe0)(event.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(event))) return;
|
|
2254
2421
|
state.isHovered = true;
|
|
2255
2422
|
let target = event.currentTarget;
|
|
2256
2423
|
state.target = target;
|
|
@@ -2258,8 +2425,8 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
2258
2425
|
// even though the originally hovered target may have shrunk in size so it is no longer hovered.
|
|
2259
2426
|
// However, a pointerover event will be fired on the new target the mouse is over.
|
|
2260
2427
|
// In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
|
|
2261
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(event
|
|
2262
|
-
if (state.isHovered && state.target && !($d4ee10de306f2510$export$4282f70798064fe0)(state.target, e
|
|
2428
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(event)), 'pointerover', (e)=>{
|
|
2429
|
+
if (state.isHovered && state.target && !($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) triggerHoverEnd(e, e.pointerType);
|
|
2263
2430
|
}, {
|
|
2264
2431
|
capture: true
|
|
2265
2432
|
});
|
|
@@ -2293,7 +2460,7 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
2293
2460
|
triggerHoverStart(e, e.pointerType);
|
|
2294
2461
|
};
|
|
2295
2462
|
hoverProps.onPointerLeave = (e)=>{
|
|
2296
|
-
if (!isDisabled && e.currentTarget
|
|
2463
|
+
if (!isDisabled && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) triggerHoverEnd(e, e.pointerType);
|
|
2297
2464
|
};
|
|
2298
2465
|
} else if (process.env.NODE_ENV === 'test') {
|
|
2299
2466
|
hoverProps.onTouchStart = ()=>{
|
|
@@ -2304,7 +2471,7 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
2304
2471
|
state.ignoreEmulatedMouseEvents = false;
|
|
2305
2472
|
};
|
|
2306
2473
|
hoverProps.onMouseLeave = (e)=>{
|
|
2307
|
-
if (!isDisabled && e.currentTarget
|
|
2474
|
+
if (!isDisabled && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) triggerHoverEnd(e, 'mouse');
|
|
2308
2475
|
};
|
|
2309
2476
|
}
|
|
2310
2477
|
return {
|
|
@@ -2351,15 +2518,35 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
|
|
|
2351
2518
|
// It will throw an error during hydration when it expects the firstChild to contain content rendered
|
|
2352
2519
|
// on the server, when in reality, the browser will have placed this inside the `content` document fragment.
|
|
2353
2520
|
// This monkey patches the firstChild property for our special hidden template elements to work around this error.
|
|
2521
|
+
// does the same for appendChild/removeChild/insertBefore as per the issue below
|
|
2354
2522
|
// See https://github.com/facebook/react/issues/19932
|
|
2355
2523
|
if (typeof HTMLTemplateElement !== 'undefined') {
|
|
2356
|
-
const getFirstChild = Object.getOwnPropertyDescriptor(Node.prototype, 'firstChild').get;
|
|
2357
2524
|
Object.defineProperty(HTMLTemplateElement.prototype, 'firstChild', {
|
|
2358
2525
|
configurable: true,
|
|
2359
2526
|
enumerable: true,
|
|
2360
2527
|
get: function() {
|
|
2361
|
-
|
|
2362
|
-
|
|
2528
|
+
return this.content.firstChild;
|
|
2529
|
+
}
|
|
2530
|
+
});
|
|
2531
|
+
Object.defineProperty(HTMLTemplateElement.prototype, 'appendChild', {
|
|
2532
|
+
configurable: true,
|
|
2533
|
+
enumerable: true,
|
|
2534
|
+
value: function(node) {
|
|
2535
|
+
return this.content.appendChild(node);
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
Object.defineProperty(HTMLTemplateElement.prototype, 'removeChild', {
|
|
2539
|
+
configurable: true,
|
|
2540
|
+
enumerable: true,
|
|
2541
|
+
value: function(node) {
|
|
2542
|
+
return this.content.removeChild(node);
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
Object.defineProperty(HTMLTemplateElement.prototype, 'insertBefore', {
|
|
2546
|
+
configurable: true,
|
|
2547
|
+
enumerable: true,
|
|
2548
|
+
value: function(node, child) {
|
|
2549
|
+
return this.content.insertBefore(node, child);
|
|
2363
2550
|
}
|
|
2364
2551
|
});
|
|
2365
2552
|
}
|
|
@@ -2374,9 +2561,7 @@ function $f39a9eba43920ace$export$8dc98ba7eadeaa56(props) {
|
|
|
2374
2561
|
// In SSR, portals are not supported by React. Instead, always render into a <template>
|
|
2375
2562
|
// element, which the browser will never display to the user. In addition, the
|
|
2376
2563
|
// content is not part of the accessible DOM tree, so it won't affect ids or other accessibility attributes.
|
|
2377
|
-
return /*#__PURE__*/ (React).createElement("template",
|
|
2378
|
-
"data-react-aria-hidden": true
|
|
2379
|
-
}, children);
|
|
2564
|
+
return /*#__PURE__*/ (React).createElement("template", null, children);
|
|
2380
2565
|
}
|
|
2381
2566
|
function $f39a9eba43920ace$export$86427a43e3e48ebb(fn) {
|
|
2382
2567
|
let Wrapper = (props, ref)=>{
|
|
@@ -2407,7 +2592,8 @@ function $f39a9eba43920ace$export$b5d7cc18bb8d2b59() {
|
|
|
2407
2592
|
const $514c0188e459b4c0$export$9afb8bc826b033ea = /*#__PURE__*/ (React.createContext)({});
|
|
2408
2593
|
const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (React.forwardRef)(function Text(props, ref) {
|
|
2409
2594
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $514c0188e459b4c0$export$9afb8bc826b033ea);
|
|
2410
|
-
let { elementType:
|
|
2595
|
+
let { elementType: elementType = 'span', ...domProps } = props;
|
|
2596
|
+
let ElementType = ($64fa3d84918910a7$export$df3a06d6289f983e)[elementType];
|
|
2411
2597
|
// @ts-ignore
|
|
2412
2598
|
return /*#__PURE__*/ (React).createElement(ElementType, {
|
|
2413
2599
|
className: "react-aria-Text",
|
|
@@ -2438,6 +2624,7 @@ exports.$64fa3d84918910a7$export$29f1550f4b0d4415 = $64fa3d84918910a7$export$29f
|
|
|
2438
2624
|
exports.$64fa3d84918910a7$export$4d86445c2cf5e3 = $64fa3d84918910a7$export$4d86445c2cf5e3;
|
|
2439
2625
|
exports.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8 = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8;
|
|
2440
2626
|
exports.$64fa3d84918910a7$export$c62b8e45d58ddad9 = $64fa3d84918910a7$export$c62b8e45d58ddad9;
|
|
2627
|
+
exports.$64fa3d84918910a7$export$df3a06d6289f983e = $64fa3d84918910a7$export$df3a06d6289f983e;
|
|
2441
2628
|
exports.$64fa3d84918910a7$export$ef03459518577ad4 = $64fa3d84918910a7$export$ef03459518577ad4;
|
|
2442
2629
|
exports.$64fa3d84918910a7$export$fabf2dc03a41866e = $64fa3d84918910a7$export$fabf2dc03a41866e;
|
|
2443
2630
|
exports.$65484d02dcb7eb3e$export$457c3d6518dd4c6f = $65484d02dcb7eb3e$export$457c3d6518dd4c6f;
|
|
@@ -2461,18 +2648,21 @@ exports.$bdb11010cef70236$export$f680877a34711e37 = $bdb11010cef70236$export$f68
|
|
|
2461
2648
|
exports.$c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$export$186c6964ca17d99;
|
|
2462
2649
|
exports.$c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$export$6446a186d09e379e;
|
|
2463
2650
|
exports.$c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$export$78551043582a6a98;
|
|
2464
|
-
exports.$c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$export$7bef049ce92e4224;
|
|
2465
2651
|
exports.$c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$export$9ac100e40613ea10;
|
|
2466
2652
|
exports.$c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$export$a11b0059900ceec8;
|
|
2467
|
-
exports.$c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$export$b7d78993b74f766d;
|
|
2468
2653
|
exports.$c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$export$e1865c3bedcd822b;
|
|
2469
2654
|
exports.$c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$export$fedb369cb70207f1;
|
|
2470
2655
|
exports.$d4ee10de306f2510$export$4282f70798064fe0 = $d4ee10de306f2510$export$4282f70798064fe0;
|
|
2656
|
+
exports.$d4ee10de306f2510$export$b4f377a2b6254582 = $d4ee10de306f2510$export$b4f377a2b6254582;
|
|
2471
2657
|
exports.$d4ee10de306f2510$export$cd4e5573fbe2b576 = $d4ee10de306f2510$export$cd4e5573fbe2b576;
|
|
2472
2658
|
exports.$d4ee10de306f2510$export$e58f029f0fbfdb29 = $d4ee10de306f2510$export$e58f029f0fbfdb29;
|
|
2473
2659
|
exports.$df56164dff5785e2$export$4338b53315abf666 = $df56164dff5785e2$export$4338b53315abf666;
|
|
2474
2660
|
exports.$e7801be82b4b2a53$export$4debdb1a3f0fa79e = $e7801be82b4b2a53$export$4debdb1a3f0fa79e;
|
|
2475
2661
|
exports.$e9faafb641e167db$export$90fc3a17d93f704c = $e9faafb641e167db$export$90fc3a17d93f704c;
|
|
2662
|
+
exports.$ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f = $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f;
|
|
2663
|
+
exports.$ea8dcbcb9ea1b556$export$7e924b3091a3bd18 = $ea8dcbcb9ea1b556$export$7e924b3091a3bd18;
|
|
2664
|
+
exports.$ea8dcbcb9ea1b556$export$95185d699e05d4d7 = $ea8dcbcb9ea1b556$export$95185d699e05d4d7;
|
|
2665
|
+
exports.$ea8dcbcb9ea1b556$export$9a302a45f65d0572 = $ea8dcbcb9ea1b556$export$9a302a45f65d0572;
|
|
2476
2666
|
exports.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
|
|
2477
2667
|
exports.$f39a9eba43920ace$export$86427a43e3e48ebb = $f39a9eba43920ace$export$86427a43e3e48ebb;
|
|
2478
2668
|
exports.$f39a9eba43920ace$export$8dc98ba7eadeaa56 = $f39a9eba43920ace$export$8dc98ba7eadeaa56;
|