@jobber/components 6.123.0 → 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 +42 -12
- package/dist/BottomSheet-es.js +43 -13
- 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/primitives/BottomSheet/BottomSheet.d.ts +13 -8
- 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/Menu-cjs.js
CHANGED
|
@@ -16,18 +16,24 @@ var maxHeight = require('./maxHeight-cjs.js');
|
|
|
16
16
|
var floatingUi_reactDom = require('./floating-ui.react-dom-cjs.js');
|
|
17
17
|
|
|
18
18
|
/*
|
|
19
|
-
* Copyright
|
|
20
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the
|
|
19
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the 'License');
|
|
21
21
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
22
22
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
23
23
|
*
|
|
24
24
|
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
25
|
-
* the License is distributed on an
|
|
25
|
+
* the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
26
26
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
27
27
|
* governing permissions and limitations under the License.
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
(React.createContext)(null);
|
|
30
|
+
(React.createContext)(null);
|
|
31
|
+
(React.createContext)(null);
|
|
32
|
+
(React.createContext)(null);
|
|
33
|
+
(React.createContext)(null);
|
|
34
|
+
(React.createContext)({});
|
|
35
|
+
const $4e85f108e88277b8$export$b0d3ecf7112093a7 = (React.createContext)(null);
|
|
36
|
+
const $4e85f108e88277b8$export$698f465ec27e93df = (React.createContext)(null);
|
|
31
37
|
|
|
32
38
|
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
|
|
33
39
|
|
|
@@ -217,109 +223,6 @@ function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter
|
|
|
217
223
|
return doc.createTreeWalker(root, whatToShow, filter);
|
|
218
224
|
}
|
|
219
225
|
|
|
220
|
-
/*
|
|
221
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
222
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
223
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
224
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
225
|
-
*
|
|
226
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
227
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
228
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
229
|
-
* governing permissions and limitations under the License.
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (React.createContext)({
|
|
234
|
-
isNative: true,
|
|
235
|
-
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
|
|
236
|
-
useHref: (href)=>href
|
|
237
|
-
});
|
|
238
|
-
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
|
|
239
|
-
return (React.useContext)($ea8dcbcb9ea1b556$var$RouterContext);
|
|
240
|
-
}
|
|
241
|
-
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
|
|
242
|
-
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
|
|
243
|
-
let target = link.getAttribute('target');
|
|
244
|
-
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
|
|
245
|
-
!modifiers.ctrlKey && // open in new tab (windows)
|
|
246
|
-
!modifiers.altKey && // download
|
|
247
|
-
!modifiers.shiftKey;
|
|
248
|
-
}
|
|
249
|
-
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
250
|
-
var _window_event_type, _window_event;
|
|
251
|
-
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
252
|
-
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
253
|
-
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
254
|
-
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
255
|
-
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
256
|
-
if ((Text.$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') {
|
|
257
|
-
if ((Text.$c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
258
|
-
else ctrlKey = true;
|
|
259
|
-
}
|
|
260
|
-
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
|
|
261
|
-
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
|
|
262
|
-
let event = (Text.$c87311424ea30a05$export$78551043582a6a98)() && (Text.$c87311424ea30a05$export$9ac100e40613ea10)() && !(Text.$c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
|
|
263
|
-
keyIdentifier: 'Enter',
|
|
264
|
-
metaKey: metaKey,
|
|
265
|
-
ctrlKey: ctrlKey,
|
|
266
|
-
altKey: altKey,
|
|
267
|
-
shiftKey: shiftKey
|
|
268
|
-
}) : new MouseEvent('click', {
|
|
269
|
-
metaKey: metaKey,
|
|
270
|
-
ctrlKey: ctrlKey,
|
|
271
|
-
altKey: altKey,
|
|
272
|
-
shiftKey: shiftKey,
|
|
273
|
-
bubbles: true,
|
|
274
|
-
cancelable: true
|
|
275
|
-
});
|
|
276
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
|
|
277
|
-
(Text.$7215afc6de606d6b$export$de79e2c695e052f3)(target);
|
|
278
|
-
target.dispatchEvent(event);
|
|
279
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
280
|
-
}
|
|
281
|
-
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
282
|
-
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
283
|
-
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
284
|
-
if (target instanceof HTMLAnchorElement) open(target);
|
|
285
|
-
else if (target.hasAttribute('data-href')) {
|
|
286
|
-
let link = document.createElement('a');
|
|
287
|
-
link.href = target.getAttribute('data-href');
|
|
288
|
-
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
|
|
289
|
-
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
|
|
290
|
-
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
|
|
291
|
-
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
|
|
292
|
-
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
|
|
293
|
-
target.appendChild(link);
|
|
294
|
-
open(link);
|
|
295
|
-
target.removeChild(link);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
299
|
-
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
300
|
-
}
|
|
301
|
-
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
302
|
-
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
303
|
-
var _props_href;
|
|
304
|
-
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
305
|
-
return {
|
|
306
|
-
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
|
|
307
|
-
target: props === null || props === void 0 ? void 0 : props.target,
|
|
308
|
-
rel: props === null || props === void 0 ? void 0 : props.rel,
|
|
309
|
-
download: props === null || props === void 0 ? void 0 : props.download,
|
|
310
|
-
ping: props === null || props === void 0 ? void 0 : props.ping,
|
|
311
|
-
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
|
|
315
|
-
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
316
|
-
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.
|
|
317
|
-
!e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
|
|
318
|
-
e.preventDefault();
|
|
319
|
-
router.open(e.currentTarget, e, href, routerOptions);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
226
|
/*
|
|
324
227
|
* Copyright 2024 Adobe. All rights reserved.
|
|
325
228
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -353,19 +256,22 @@ function $9daab02d461809db$var$hasResizeObserver() {
|
|
|
353
256
|
return typeof window.ResizeObserver !== 'undefined';
|
|
354
257
|
}
|
|
355
258
|
function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
259
|
+
// Only call onResize from inside the effect, otherwise we'll void our assumption that
|
|
260
|
+
// useEffectEvents are safe to pass in.
|
|
356
261
|
const { ref: ref, box: box, onResize: onResize } = options;
|
|
262
|
+
let onResizeEvent = (Text.$8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
|
|
357
263
|
(React.useEffect)(()=>{
|
|
358
264
|
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
359
265
|
if (!element) return;
|
|
360
266
|
if (!$9daab02d461809db$var$hasResizeObserver()) {
|
|
361
|
-
window.addEventListener('resize',
|
|
267
|
+
window.addEventListener('resize', onResizeEvent, false);
|
|
362
268
|
return ()=>{
|
|
363
|
-
window.removeEventListener('resize',
|
|
269
|
+
window.removeEventListener('resize', onResizeEvent, false);
|
|
364
270
|
};
|
|
365
271
|
} else {
|
|
366
272
|
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
|
|
367
273
|
if (!entries.length) return;
|
|
368
|
-
|
|
274
|
+
onResizeEvent();
|
|
369
275
|
});
|
|
370
276
|
resizeObserverInstance.observe(element, {
|
|
371
277
|
box: box
|
|
@@ -375,7 +281,6 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
375
281
|
};
|
|
376
282
|
}
|
|
377
283
|
}, [
|
|
378
|
-
onResize,
|
|
379
284
|
ref,
|
|
380
285
|
box
|
|
381
286
|
]);
|
|
@@ -394,7 +299,10 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
394
299
|
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
395
300
|
if (!node) return false;
|
|
396
301
|
let style = window.getComputedStyle(node);
|
|
302
|
+
let root = document.scrollingElement || document.documentElement;
|
|
397
303
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
304
|
+
// Root element has `visible` overflow by default, but is scrollable nonetheless.
|
|
305
|
+
if (node === root && style.overflow !== 'hidden') isScrollable = true;
|
|
398
306
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
399
307
|
return isScrollable;
|
|
400
308
|
}
|
|
@@ -429,12 +337,44 @@ function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
|
|
|
429
337
|
* governing permissions and limitations under the License.
|
|
430
338
|
*/
|
|
431
339
|
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
340
|
+
let parentElements = [];
|
|
341
|
+
let root = document.scrollingElement || document.documentElement;
|
|
342
|
+
do {
|
|
343
|
+
if (($cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) parentElements.push(node);
|
|
435
344
|
node = node.parentElement;
|
|
436
|
-
}
|
|
437
|
-
return
|
|
345
|
+
}while (node && node !== root);
|
|
346
|
+
return parentElements;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
351
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
352
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
353
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
354
|
+
*
|
|
355
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
356
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
357
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
358
|
+
* governing permissions and limitations under the License.
|
|
359
|
+
*/
|
|
360
|
+
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
361
|
+
if ((Text.$c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
362
|
+
return e.ctrlKey;
|
|
363
|
+
}
|
|
364
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
365
|
+
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
|
|
366
|
+
'checkbox',
|
|
367
|
+
'radio',
|
|
368
|
+
'range',
|
|
369
|
+
'color',
|
|
370
|
+
'file',
|
|
371
|
+
'image',
|
|
372
|
+
'button',
|
|
373
|
+
'submit',
|
|
374
|
+
'reset'
|
|
375
|
+
]);
|
|
376
|
+
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
|
|
377
|
+
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
438
378
|
}
|
|
439
379
|
|
|
440
380
|
/*
|
|
@@ -496,59 +436,84 @@ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
|
496
436
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
497
437
|
* governing permissions and limitations under the License.
|
|
498
438
|
*/
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
let
|
|
502
|
-
|
|
503
|
-
let height = element.offsetHeight;
|
|
504
|
-
let x = scrollView.scrollLeft;
|
|
439
|
+
|
|
440
|
+
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element, opts = {}) {
|
|
441
|
+
let { block: block = 'nearest', inline: inline = 'nearest' } = opts;
|
|
442
|
+
if (scrollView === element) return;
|
|
505
443
|
let y = scrollView.scrollTop;
|
|
506
|
-
|
|
507
|
-
let
|
|
508
|
-
let
|
|
509
|
-
let
|
|
510
|
-
|
|
511
|
-
let
|
|
512
|
-
let
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
let
|
|
516
|
-
let
|
|
517
|
-
let
|
|
518
|
-
let
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
let
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
444
|
+
let x = scrollView.scrollLeft;
|
|
445
|
+
let target = element.getBoundingClientRect();
|
|
446
|
+
let view = scrollView.getBoundingClientRect();
|
|
447
|
+
let itemStyle = window.getComputedStyle(element);
|
|
448
|
+
let viewStyle = window.getComputedStyle(scrollView);
|
|
449
|
+
let root = document.scrollingElement || document.documentElement;
|
|
450
|
+
let viewTop = scrollView === root ? 0 : view.top;
|
|
451
|
+
let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
|
|
452
|
+
let viewLeft = scrollView === root ? 0 : view.left;
|
|
453
|
+
let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
|
|
454
|
+
let scrollMarginTop = parseInt(itemStyle.scrollMarginTop, 10) || 0;
|
|
455
|
+
let scrollMarginBottom = parseInt(itemStyle.scrollMarginBottom, 10) || 0;
|
|
456
|
+
let scrollMarginLeft = parseInt(itemStyle.scrollMarginLeft, 10) || 0;
|
|
457
|
+
let scrollMarginRight = parseInt(itemStyle.scrollMarginRight, 10) || 0;
|
|
458
|
+
let scrollPaddingTop = parseInt(viewStyle.scrollPaddingTop, 10) || 0;
|
|
459
|
+
let scrollPaddingBottom = parseInt(viewStyle.scrollPaddingBottom, 10) || 0;
|
|
460
|
+
let scrollPaddingLeft = parseInt(viewStyle.scrollPaddingLeft, 10) || 0;
|
|
461
|
+
let scrollPaddingRight = parseInt(viewStyle.scrollPaddingRight, 10) || 0;
|
|
462
|
+
let borderTopWidth = parseInt(viewStyle.borderTopWidth, 10) || 0;
|
|
463
|
+
let borderBottomWidth = parseInt(viewStyle.borderBottomWidth, 10) || 0;
|
|
464
|
+
let borderLeftWidth = parseInt(viewStyle.borderLeftWidth, 10) || 0;
|
|
465
|
+
let borderRightWidth = parseInt(viewStyle.borderRightWidth, 10) || 0;
|
|
466
|
+
let scrollAreaTop = target.top - scrollMarginTop;
|
|
467
|
+
let scrollAreaBottom = target.bottom + scrollMarginBottom;
|
|
468
|
+
let scrollAreaLeft = target.left - scrollMarginLeft;
|
|
469
|
+
let scrollAreaRight = target.right + scrollMarginRight;
|
|
470
|
+
let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
|
|
471
|
+
let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
|
|
472
|
+
let scrollBarWidth = scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
|
|
473
|
+
let scrollBarHeight = scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
|
|
474
|
+
let scrollPortTop = viewTop + borderTopWidth + scrollPaddingTop;
|
|
475
|
+
let scrollPortBottom = viewBottom - borderBottomWidth - scrollPaddingBottom - scrollBarHeight;
|
|
476
|
+
let scrollPortLeft = viewLeft + borderLeftWidth + scrollPaddingLeft;
|
|
477
|
+
let scrollPortRight = viewRight - borderRightWidth - scrollPaddingRight;
|
|
478
|
+
// IOS always positions the scrollbar on the right ¯\_(ツ)_/¯
|
|
479
|
+
if (viewStyle.direction === 'rtl' && !(Text.$c87311424ea30a05$export$fedb369cb70207f1)()) scrollPortLeft += scrollBarWidth;
|
|
480
|
+
else scrollPortRight -= scrollBarWidth;
|
|
481
|
+
let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
|
|
482
|
+
let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
|
|
483
|
+
if (shouldScrollBlock && block === 'start') y += scrollAreaTop - scrollPortTop;
|
|
484
|
+
else if (shouldScrollBlock && block === 'center') y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
|
|
485
|
+
else if (shouldScrollBlock && block === 'end') y += scrollAreaBottom - scrollPortBottom;
|
|
486
|
+
else if (shouldScrollBlock && block === 'nearest') {
|
|
487
|
+
let start = scrollAreaTop - scrollPortTop;
|
|
488
|
+
let end = scrollAreaBottom - scrollPortBottom;
|
|
489
|
+
y += Math.abs(start) <= Math.abs(end) ? start : end;
|
|
490
|
+
}
|
|
491
|
+
if (shouldScrollInline && inline === 'start') x += scrollAreaLeft - scrollPortLeft;
|
|
492
|
+
else if (shouldScrollInline && inline === 'center') x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
|
|
493
|
+
else if (shouldScrollInline && inline === 'end') x += scrollAreaRight - scrollPortRight;
|
|
494
|
+
else if (shouldScrollInline && inline === 'nearest') {
|
|
495
|
+
let start = scrollAreaLeft - scrollPortLeft;
|
|
496
|
+
let end = scrollAreaRight - scrollPortRight;
|
|
497
|
+
x += Math.abs(start) <= Math.abs(end) ? start : end;
|
|
498
|
+
}
|
|
499
|
+
if (process.env.NODE_ENV === 'test') {
|
|
500
|
+
scrollView.scrollLeft = x;
|
|
501
|
+
scrollView.scrollTop = y;
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
scrollView.scrollTo({
|
|
505
|
+
left: x,
|
|
506
|
+
top: y
|
|
507
|
+
});
|
|
545
508
|
}
|
|
546
|
-
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
547
|
-
|
|
509
|
+
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
|
|
510
|
+
let { containingElement: containingElement } = opts;
|
|
511
|
+
if (targetElement && targetElement.isConnected) {
|
|
548
512
|
let root = document.scrollingElement || document.documentElement;
|
|
549
513
|
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
|
|
550
|
-
// If scrolling is not currently prevented then we aren
|
|
551
|
-
|
|
514
|
+
// 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
|
|
515
|
+
// Also ignore in chrome because of this bug: https://issues.chromium.org/issues/40074749
|
|
516
|
+
if (!isScrollPrevented && !(Text.$c87311424ea30a05$export$6446a186d09e379e)()) {
|
|
552
517
|
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
|
|
553
518
|
// 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
|
|
554
519
|
_targetElement_scrollIntoView;
|
|
@@ -559,8 +524,8 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
559
524
|
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
560
525
|
// Account for sub pixel differences from rounding
|
|
561
526
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
562
|
-
var
|
|
563
|
-
|
|
527
|
+
var _containingElement_scrollIntoView, _targetElement_scrollIntoView1;
|
|
528
|
+
containingElement === null || containingElement === void 0 ? void 0 : (_containingElement_scrollIntoView = containingElement.scrollIntoView) === null || _containingElement_scrollIntoView === void 0 ? void 0 : _containingElement_scrollIntoView.call(containingElement, {
|
|
564
529
|
block: 'center',
|
|
565
530
|
inline: 'center'
|
|
566
531
|
});
|
|
@@ -569,9 +534,19 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
569
534
|
});
|
|
570
535
|
}
|
|
571
536
|
} else {
|
|
572
|
-
let
|
|
537
|
+
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
573
538
|
// 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.
|
|
539
|
+
let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement, true);
|
|
574
540
|
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
541
|
+
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
542
|
+
// Account for sub pixel differences from rounding
|
|
543
|
+
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
544
|
+
scrollParents = containingElement ? ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(containingElement, true) : [];
|
|
545
|
+
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, containingElement, {
|
|
546
|
+
block: 'center',
|
|
547
|
+
inline: 'center'
|
|
548
|
+
});
|
|
549
|
+
}
|
|
575
550
|
}
|
|
576
551
|
}
|
|
577
552
|
}
|
|
@@ -590,22 +565,6 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
590
565
|
const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
|
|
591
566
|
const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
|
|
592
567
|
|
|
593
|
-
/*
|
|
594
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
595
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
596
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
597
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
598
|
-
*
|
|
599
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
600
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
601
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
602
|
-
* governing permissions and limitations under the License.
|
|
603
|
-
*/
|
|
604
|
-
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
605
|
-
if ((Text.$c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
606
|
-
return e.ctrlKey;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
568
|
/*
|
|
610
569
|
* Copyright 2020 Adobe. All rights reserved.
|
|
611
570
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -726,28 +685,31 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
|
726
685
|
height: 'totalHeight'
|
|
727
686
|
};
|
|
728
687
|
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
729
|
-
let $edcf132a9284368a$var$
|
|
730
|
-
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
688
|
+
let $edcf132a9284368a$var$getVisualViewport = ()=>typeof document !== 'undefined' ? window.visualViewport : null;
|
|
689
|
+
function $edcf132a9284368a$var$getContainerDimensions(containerNode, visualViewport) {
|
|
731
690
|
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
732
691
|
let scroll = {};
|
|
733
692
|
var _visualViewport_scale;
|
|
734
|
-
let isPinchZoomedIn = ((_visualViewport_scale =
|
|
735
|
-
|
|
693
|
+
let isPinchZoomedIn = ((_visualViewport_scale = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
|
|
694
|
+
// In the case where the container is `html` or `body` and the container doesn't have something like `position: relative`,
|
|
695
|
+
// then position absolute will be positioned relative to the viewport, also known as the `initial containing block`.
|
|
696
|
+
// That's why we use the visual viewport instead.
|
|
697
|
+
if (containerNode.tagName === 'BODY' || containerNode.tagName === 'HTML') {
|
|
736
698
|
let documentElement = document.documentElement;
|
|
737
699
|
totalWidth = documentElement.clientWidth;
|
|
738
700
|
totalHeight = documentElement.clientHeight;
|
|
739
701
|
var _visualViewport_width;
|
|
740
|
-
width = (_visualViewport_width =
|
|
702
|
+
width = (_visualViewport_width = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
|
|
741
703
|
var _visualViewport_height;
|
|
742
|
-
height = (_visualViewport_height =
|
|
704
|
+
height = (_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
|
|
743
705
|
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
744
706
|
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
745
707
|
// The goal of the below is to get a top/left value that represents the top/left of the visual viewport with
|
|
746
708
|
// respect to the layout viewport origin. This combined with the scrollTop/scrollLeft will allow us to calculate
|
|
747
709
|
// coordinates/values with respect to the visual viewport or with respect to the layout viewport.
|
|
748
|
-
if (
|
|
749
|
-
top =
|
|
750
|
-
left =
|
|
710
|
+
if (visualViewport) {
|
|
711
|
+
top = visualViewport.offsetTop;
|
|
712
|
+
left = visualViewport.offsetLeft;
|
|
751
713
|
}
|
|
752
714
|
} else {
|
|
753
715
|
({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode, false));
|
|
@@ -764,9 +726,9 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
|
764
726
|
scroll.top = 0;
|
|
765
727
|
scroll.left = 0;
|
|
766
728
|
var _visualViewport_pageTop;
|
|
767
|
-
top = (_visualViewport_pageTop =
|
|
729
|
+
top = (_visualViewport_pageTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
|
|
768
730
|
var _visualViewport_pageLeft;
|
|
769
|
-
left = (_visualViewport_pageLeft =
|
|
731
|
+
left = (_visualViewport_pageLeft = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
|
|
770
732
|
}
|
|
771
733
|
return {
|
|
772
734
|
width: width,
|
|
@@ -801,10 +763,12 @@ containerDimensions, padding, containerOffsetWithBoundary) {
|
|
|
801
763
|
let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
802
764
|
// Calculate the edges of the boundary (accomodating for the boundary padding) and the edges of the overlay.
|
|
803
765
|
// Note that these values are with respect to the visual viewport (aka 0,0 is the top left of the viewport)
|
|
804
|
-
let boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
805
|
-
let boundaryEndEdge =
|
|
806
|
-
|
|
807
|
-
let
|
|
766
|
+
let boundaryStartEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
767
|
+
let boundaryEndEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + boundarySize - padding;
|
|
768
|
+
// transformed value of the left edge of the overlay
|
|
769
|
+
let startEdgeOffset = offset - containerScroll + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
770
|
+
// transformed value of the right edge of the overlay
|
|
771
|
+
let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
808
772
|
// If any of the overlay edges falls outside of the boundary, shift the overlay the required amount to align one of the overlay's
|
|
809
773
|
// edges with the closest boundary edge.
|
|
810
774
|
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
@@ -838,7 +802,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
838
802
|
};
|
|
839
803
|
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
840
804
|
}
|
|
841
|
-
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
805
|
+
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
|
|
842
806
|
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
843
807
|
let position = {};
|
|
844
808
|
var _childOffset_crossAxis;
|
|
@@ -855,9 +819,9 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
855
819
|
the overlay top should match the button top
|
|
856
820
|
} */
|
|
857
821
|
position[crossAxis] += crossOffset;
|
|
858
|
-
// overlay top overlapping arrow with button bottom
|
|
822
|
+
// overlay top or left overlapping arrow with button bottom or right
|
|
859
823
|
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
860
|
-
// overlay bottom overlapping arrow with button top
|
|
824
|
+
// overlay bottom or right overlapping arrow with button top or left
|
|
861
825
|
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
862
826
|
position[crossAxis] = (Text.$9446cca9a3875146$export$7d15b64cf5a3a4c4)(position[crossAxis], minPosition, maxPosition);
|
|
863
827
|
// 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.
|
|
@@ -865,46 +829,61 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
865
829
|
// If the container is positioned (non-static), then we use the container's actual
|
|
866
830
|
// height, as `bottom` will be relative to this height. But if the container is static,
|
|
867
831
|
// then it can only be the `document.body`, and `bottom` will be relative to _its_
|
|
868
|
-
// container
|
|
869
|
-
|
|
832
|
+
// container.
|
|
833
|
+
let containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
|
|
870
834
|
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
871
835
|
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
872
836
|
return position;
|
|
873
837
|
}
|
|
874
|
-
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
//
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
838
|
+
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
|
|
839
|
+
var _position_bottom, _containerDimensions_scroll_top;
|
|
840
|
+
// For cases where position is set via "bottom" instead of "top", we need to calculate the true overlay top
|
|
841
|
+
// with respect to the container.
|
|
842
|
+
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);
|
|
843
|
+
// calculate the dimentions of the "boundingRect" which is most restrictive top/bottom of the boundaryRect and the visual view port
|
|
844
|
+
let boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
|
|
845
|
+
var _visualViewport_offsetTop, _visualViewport_offsetTop1, _visualViewport_height;
|
|
846
|
+
let boundingRect = {
|
|
847
|
+
// This should be boundary top in container coord system vs viewport top in container coord system
|
|
848
|
+
// For the viewport top, there are several cases
|
|
849
|
+
// 1. pinchzoom case where we want the viewports offset top as top here
|
|
850
|
+
// 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
|
|
851
|
+
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),
|
|
852
|
+
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))
|
|
853
|
+
};
|
|
854
|
+
var _margins_top, _margins_bottom, _margins_top1, _margins_bottom1;
|
|
881
855
|
let maxHeight = heightGrowthDirection !== 'top' ? // We want the distance between the top of the overlay to the bottom of the boundary
|
|
882
|
-
Math.max(0,
|
|
856
|
+
Math.max(0, boundingRect.bottom // this is the bottom of the boundary
|
|
857
|
+
- overlayTop // this is the top of the overlay
|
|
883
858
|
- (((_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
|
|
884
859
|
)) : Math.max(0, overlayTop + overlayHeight // this is the bottom of the overlay
|
|
885
|
-
-
|
|
886
|
-
|
|
860
|
+
- boundingRect.top // this is the top of the boundary
|
|
861
|
+
- (((_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
|
|
887
862
|
));
|
|
888
|
-
return
|
|
863
|
+
return maxHeight;
|
|
889
864
|
}
|
|
890
|
-
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
865
|
+
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
|
|
891
866
|
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
892
|
-
var
|
|
893
|
-
if (placement === axis) return Math.max(0, childOffset[axis]
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
867
|
+
var _containerDimensions_scroll_axis, _margins_axis;
|
|
868
|
+
if (placement === axis) return Math.max(0, childOffset[axis] // trigger start
|
|
869
|
+
- ((_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
|
|
870
|
+
) - (boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) // boundary start
|
|
871
|
+
) - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0 // margins usually for arrows or other decorations
|
|
872
|
+
) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding); // padding between overlay and boundary
|
|
873
|
+
var _containerDimensions_scroll_axis1, _margins_axis1;
|
|
874
|
+
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);
|
|
875
|
+
}
|
|
876
|
+
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
898
877
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
899
878
|
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
900
|
-
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
879
|
+
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
901
880
|
let normalizedOffset = offset;
|
|
902
|
-
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
881
|
+
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
903
882
|
// Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
|
|
904
|
-
if (flip &&
|
|
883
|
+
if (flip && overlaySize[size] > space) {
|
|
905
884
|
let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
906
|
-
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
907
|
-
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
|
|
885
|
+
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
886
|
+
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
908
887
|
// If the available space for the flipped position is greater than the original available space, flip.
|
|
909
888
|
if (flippedSpace > space) {
|
|
910
889
|
placementInfo = flippedPlacementInfo;
|
|
@@ -923,10 +902,10 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
923
902
|
}
|
|
924
903
|
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
925
904
|
position[crossAxis] += delta;
|
|
926
|
-
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
|
|
905
|
+
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
|
|
927
906
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
928
907
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
929
|
-
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
908
|
+
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
930
909
|
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
931
910
|
position[crossAxis] += delta;
|
|
932
911
|
let arrowPosition = {};
|
|
@@ -972,6 +951,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
972
951
|
}
|
|
973
952
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
974
953
|
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;
|
|
954
|
+
let visualViewport = $edcf132a9284368a$var$getVisualViewport();
|
|
975
955
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
976
956
|
let isViewportContainer = container === document.documentElement;
|
|
977
957
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
@@ -989,21 +969,46 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
989
969
|
var _margins_top, _margins_bottom;
|
|
990
970
|
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);
|
|
991
971
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
//
|
|
995
|
-
//
|
|
996
|
-
|
|
997
|
-
let
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
972
|
+
// Note that due to logic inside getContainerDimensions, for cases where the boundary element is the body, we will return
|
|
973
|
+
// 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)
|
|
974
|
+
// 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)
|
|
975
|
+
// 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)
|
|
976
|
+
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement, visualViewport);
|
|
977
|
+
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container, visualViewport);
|
|
978
|
+
// There are several difference cases of how to calculate the containerOffsetWithBoundary:
|
|
979
|
+
// - boundaryElement is body or HTML and the container is an arbitrary element in the boundary (aka submenu with parent menu as container in v3)
|
|
980
|
+
// - boundaryElement and container are both body or HTML element (aka standard popover case)
|
|
981
|
+
// - boundaryElement is customized by the user. Container can also be arbitrary (either body/HTML or some other element)
|
|
982
|
+
// containerOffsetWithBoundary should always return a value that is the boundary's coordinate offset with respect to the container coord system (container is 0, 0)
|
|
983
|
+
let containerOffsetWithBoundary;
|
|
984
|
+
if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && !isViewportContainer) {
|
|
985
|
+
// Use getRect instead of getOffset because boundaryDimensions for BODY/HTML is in viewport coordinate space,
|
|
986
|
+
// not document coordinate space
|
|
987
|
+
let containerRect = $edcf132a9284368a$export$4b834cebd9e5cebe(container, false);
|
|
988
|
+
// the offset should be negative because if container is at viewport position x,y, then viewport top (aka 0)
|
|
989
|
+
// is at position -x,y in container-relative coordinates
|
|
990
|
+
containerOffsetWithBoundary = {
|
|
991
|
+
top: -(containerRect.top - boundaryDimensions.top),
|
|
992
|
+
left: -(containerRect.left - boundaryDimensions.left),
|
|
993
|
+
width: 0,
|
|
994
|
+
height: 0
|
|
995
|
+
};
|
|
996
|
+
} else if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && isViewportContainer) // both are the same viewport container, no offset needed
|
|
997
|
+
containerOffsetWithBoundary = {
|
|
998
|
+
top: 0,
|
|
999
|
+
left: 0,
|
|
1000
|
+
width: 0,
|
|
1001
|
+
height: 0
|
|
1002
|
+
};
|
|
1003
|
+
else // This returns the boundary's coordinate with respect to the container. This case captures cases such as when you provide a custom boundary
|
|
1004
|
+
// like in ScrollingBoundaryContainerExample in Popover.stories.
|
|
1005
|
+
containerOffsetWithBoundary = $edcf132a9284368a$var$getPosition(boundaryElement, container, false);
|
|
1006
|
+
let isContainerDescendentOfBoundary = (Text.$d4ee10de306f2510$export$4282f70798064fe0)(boundaryElement, container);
|
|
1007
|
+
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
|
|
1003
1008
|
}
|
|
1004
1009
|
function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) {
|
|
1005
1010
|
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
1006
|
-
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
1011
|
+
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
1007
1012
|
// the size is not affected by scale transforms.
|
|
1008
1013
|
if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
|
1009
1014
|
width = node.offsetWidth;
|
|
@@ -1082,6 +1087,7 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
|
1082
1087
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1083
1088
|
* governing permissions and limitations under the License.
|
|
1084
1089
|
*/
|
|
1090
|
+
|
|
1085
1091
|
const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
|
|
1086
1092
|
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
1087
1093
|
let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
|
|
@@ -1089,13 +1095,13 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
1089
1095
|
if (!isOpen || onClose === null) return;
|
|
1090
1096
|
let onScroll = (e)=>{
|
|
1091
1097
|
// Ignore if scrolling an scrollable region outside the trigger's tree.
|
|
1092
|
-
let target = e
|
|
1098
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1093
1099
|
// window is not a Node and doesn't have contain, but window contains everything
|
|
1094
|
-
if (!triggerRef.current || target instanceof Node && !target
|
|
1100
|
+
if (!triggerRef.current || target instanceof Node && !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(target, triggerRef.current)) return;
|
|
1095
1101
|
// Ignore scroll events on any input or textarea as the cursor position can cause it to scroll
|
|
1096
1102
|
// such as in a combobox. Clicking the dropdown button places focus on the input, and if the
|
|
1097
1103
|
// text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.
|
|
1098
|
-
if (
|
|
1104
|
+
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;
|
|
1099
1105
|
let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
|
|
1100
1106
|
if (onCloseHandler) onCloseHandler();
|
|
1101
1107
|
};
|
|
@@ -1197,9 +1203,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
1197
1203
|
// so it can be restored after repositioning. This way if the overlay height
|
|
1198
1204
|
// changes, the focused element appears to stay in the same position.
|
|
1199
1205
|
let anchor = null;
|
|
1200
|
-
if (scrollRef.current && scrollRef.current
|
|
1201
|
-
var
|
|
1202
|
-
let anchorRect = (
|
|
1206
|
+
if (scrollRef.current && (Text.$d4ee10de306f2510$export$b4f377a2b6254582)(scrollRef.current)) {
|
|
1207
|
+
var _getActiveElement;
|
|
1208
|
+
let anchorRect = (_getActiveElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)()) === null || _getActiveElement === void 0 ? void 0 : _getActiveElement.getBoundingClientRect();
|
|
1203
1209
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
1204
1210
|
var _anchorRect_top;
|
|
1205
1211
|
// Anchor from the top if the offset is in the top half of the scrollable element,
|
|
@@ -1248,8 +1254,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
1248
1254
|
Object.keys(position.position).forEach((key)=>overlay.style[key] = position.position[key] + 'px');
|
|
1249
1255
|
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
|
|
1250
1256
|
// Restore scroll position relative to anchor element.
|
|
1251
|
-
|
|
1252
|
-
|
|
1257
|
+
let activeElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
1258
|
+
if (anchor && activeElement && scrollRef.current) {
|
|
1259
|
+
let anchorRect = activeElement.getBoundingClientRect();
|
|
1253
1260
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
1254
1261
|
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
1255
1262
|
scrollRef.current.scrollTop += newOffset - anchor.offset;
|
|
@@ -1498,7 +1505,9 @@ function $f6c31cce2adf654f$var$usePressResponderContext(props) {
|
|
|
1498
1505
|
// Consume context from <PressResponder> and merge with props.
|
|
1499
1506
|
let context = (React.useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
|
|
1500
1507
|
if (context) {
|
|
1501
|
-
|
|
1508
|
+
// Prevent mergeProps from merging ref.
|
|
1509
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1510
|
+
let { register: register, ref: ref, ...contextProps } = context;
|
|
1502
1511
|
props = (Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(contextProps, props);
|
|
1503
1512
|
register();
|
|
1504
1513
|
}
|
|
@@ -1546,6 +1555,7 @@ class $f6c31cce2adf654f$var$PressEvent {
|
|
|
1546
1555
|
this.altKey = originalEvent.altKey;
|
|
1547
1556
|
this.x = x;
|
|
1548
1557
|
this.y = y;
|
|
1558
|
+
this.key = originalEvent.key;
|
|
1549
1559
|
}
|
|
1550
1560
|
}
|
|
1551
1561
|
const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
|
|
@@ -1565,8 +1575,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1565
1575
|
pointerType: null,
|
|
1566
1576
|
disposables: []
|
|
1567
1577
|
});
|
|
1568
|
-
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (Text.$03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
1569
|
-
let triggerPressStart = (
|
|
1578
|
+
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners, removeGlobalListener: removeGlobalListener } = (Text.$03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
1579
|
+
let triggerPressStart = (React.useCallback)((originalEvent, pointerType)=>{
|
|
1570
1580
|
let state = ref.current;
|
|
1571
1581
|
if (isDisabled || state.didFirePressStart) return false;
|
|
1572
1582
|
let shouldStopPropagation = true;
|
|
@@ -1581,8 +1591,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1581
1591
|
state.didFirePressStart = true;
|
|
1582
1592
|
setPressed(true);
|
|
1583
1593
|
return shouldStopPropagation;
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1594
|
+
}, [
|
|
1595
|
+
isDisabled,
|
|
1596
|
+
onPressStart,
|
|
1597
|
+
onPressChange
|
|
1598
|
+
]);
|
|
1599
|
+
let triggerPressEnd = (React.useCallback)((originalEvent, pointerType, wasPressed = true)=>{
|
|
1586
1600
|
let state = ref.current;
|
|
1587
1601
|
if (!state.didFirePressStart) return false;
|
|
1588
1602
|
state.didFirePressStart = false;
|
|
@@ -1602,8 +1616,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1602
1616
|
}
|
|
1603
1617
|
state.isTriggeringEvent = false;
|
|
1604
1618
|
return shouldStopPropagation;
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1619
|
+
}, [
|
|
1620
|
+
isDisabled,
|
|
1621
|
+
onPressEnd,
|
|
1622
|
+
onPressChange,
|
|
1623
|
+
onPress
|
|
1624
|
+
]);
|
|
1625
|
+
let triggerPressEndEvent = (Text.$8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressEnd);
|
|
1626
|
+
let triggerPressUp = (React.useCallback)((originalEvent, pointerType)=>{
|
|
1607
1627
|
let state = ref.current;
|
|
1608
1628
|
if (isDisabled) return false;
|
|
1609
1629
|
if (onPressUp) {
|
|
@@ -1614,12 +1634,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1614
1634
|
return event.shouldStopPropagation;
|
|
1615
1635
|
}
|
|
1616
1636
|
return true;
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1637
|
+
}, [
|
|
1638
|
+
isDisabled,
|
|
1639
|
+
onPressUp
|
|
1640
|
+
]);
|
|
1641
|
+
let triggerPressUpEvent = (Text.$8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressUp);
|
|
1642
|
+
let cancel = (React.useCallback)((e)=>{
|
|
1619
1643
|
let state = ref.current;
|
|
1620
1644
|
if (state.isPressed && state.target) {
|
|
1621
1645
|
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
1622
1646
|
state.isPressed = false;
|
|
1647
|
+
setIsPointerPressed(null);
|
|
1623
1648
|
state.isOverTarget = false;
|
|
1624
1649
|
state.activePointerId = null;
|
|
1625
1650
|
state.pointerType = null;
|
|
@@ -1628,14 +1653,27 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1628
1653
|
for (let dispose of state.disposables)dispose();
|
|
1629
1654
|
state.disposables = [];
|
|
1630
1655
|
}
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1656
|
+
}, [
|
|
1657
|
+
allowTextSelectionOnPress,
|
|
1658
|
+
removeAllGlobalListeners,
|
|
1659
|
+
triggerPressEnd
|
|
1660
|
+
]);
|
|
1661
|
+
let cancelEvent = (Text.$8ae05eaa5c114e9c$export$7f54fc3180508a52)(cancel);
|
|
1662
|
+
let cancelOnPointerExit = (React.useCallback)((e)=>{
|
|
1633
1663
|
if (shouldCancelOnPointerExit) cancel(e);
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1664
|
+
}, [
|
|
1665
|
+
shouldCancelOnPointerExit,
|
|
1666
|
+
cancel
|
|
1667
|
+
]);
|
|
1668
|
+
let triggerClick = (React.useCallback)((e)=>{
|
|
1669
|
+
if (isDisabled) return;
|
|
1636
1670
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1671
|
+
}, [
|
|
1672
|
+
isDisabled,
|
|
1673
|
+
onClick
|
|
1674
|
+
]);
|
|
1675
|
+
let triggerSyntheticClick = (React.useCallback)((e, target)=>{
|
|
1676
|
+
if (isDisabled) return;
|
|
1639
1677
|
// Some third-party libraries pass in onClick instead of onPress.
|
|
1640
1678
|
// Create a fake mouse event and trigger onClick as well.
|
|
1641
1679
|
// This matches the browser's native activation behavior for certain elements (e.g. button).
|
|
@@ -1646,14 +1684,154 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1646
1684
|
(Text.$8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
|
|
1647
1685
|
onClick((Text.$8a9cb279dc87e130$export$525bc4921d56d4a)(event));
|
|
1648
1686
|
}
|
|
1649
|
-
}
|
|
1687
|
+
}, [
|
|
1688
|
+
isDisabled,
|
|
1689
|
+
onClick
|
|
1690
|
+
]);
|
|
1691
|
+
let triggerSyntheticClickEvent = (Text.$8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerSyntheticClick);
|
|
1692
|
+
let [isElemKeyPressed, setIsElemKeyPressed] = (React.useState)(false);
|
|
1693
|
+
(Text.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
1694
|
+
let state = ref.current;
|
|
1695
|
+
if (isElemKeyPressed) {
|
|
1696
|
+
let onKeyUp = (e)=>{
|
|
1697
|
+
var _state_metaKeyEvents;
|
|
1698
|
+
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
1699
|
+
var _state_metaKeyEvents1;
|
|
1700
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1701
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1702
|
+
let wasPressed = (Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, target);
|
|
1703
|
+
triggerPressEndEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
1704
|
+
if (wasPressed) triggerSyntheticClickEvent(e, state.target);
|
|
1705
|
+
removeAllGlobalListeners();
|
|
1706
|
+
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
1707
|
+
// This means the link has a role override, and the default browser behavior
|
|
1708
|
+
// only applies when using the Enter key.
|
|
1709
|
+
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
1710
|
+
// Store a hidden property on the event so we only trigger link click once,
|
|
1711
|
+
// even if there are multiple usePress instances attached to the element.
|
|
1712
|
+
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
1713
|
+
(Text.$ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
1714
|
+
}
|
|
1715
|
+
state.isPressed = false;
|
|
1716
|
+
setIsElemKeyPressed(false);
|
|
1717
|
+
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
|
|
1718
|
+
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
|
|
1719
|
+
var _state_target;
|
|
1720
|
+
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
1721
|
+
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
1722
|
+
// See comment above for more info about the macOS bug causing this.
|
|
1723
|
+
let events = state.metaKeyEvents;
|
|
1724
|
+
state.metaKeyEvents = undefined;
|
|
1725
|
+
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
// Focus may move before the key up event, so register the event on the document
|
|
1729
|
+
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
1730
|
+
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
1731
|
+
let originalTarget = state.target;
|
|
1732
|
+
let pressUp = (e)=>{
|
|
1733
|
+
if (originalTarget && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUpEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
1734
|
+
};
|
|
1735
|
+
let listener = (Text.$ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp);
|
|
1736
|
+
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
1737
|
+
return ()=>{
|
|
1738
|
+
removeGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
}, [
|
|
1742
|
+
isElemKeyPressed,
|
|
1743
|
+
addGlobalListener,
|
|
1744
|
+
removeAllGlobalListeners,
|
|
1745
|
+
removeGlobalListener
|
|
1746
|
+
]);
|
|
1747
|
+
let [isPointerPressed, setIsPointerPressed] = (React.useState)(null);
|
|
1748
|
+
(Text.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
1749
|
+
let state = ref.current;
|
|
1750
|
+
if (isPointerPressed === 'pointer') {
|
|
1751
|
+
let onPointerUp = (e)=>{
|
|
1752
|
+
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
1753
|
+
if ((Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
1754
|
+
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
1755
|
+
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
1756
|
+
// https://github.com/adobe/react-spectrum/issues/1513
|
|
1757
|
+
// https://issues.chromium.org/issues/40732224
|
|
1758
|
+
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
1759
|
+
// We work around this by triggering a click ourselves after a timeout.
|
|
1760
|
+
// This timeout is canceled during the click event in case the real one fires first.
|
|
1761
|
+
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
1762
|
+
// non-form elements without certain ARIA roles (for hover emulation).
|
|
1763
|
+
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
1764
|
+
let clicked = false;
|
|
1765
|
+
let timeout = setTimeout(()=>{
|
|
1766
|
+
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
1767
|
+
if (clicked) cancelEvent(e);
|
|
1768
|
+
else {
|
|
1769
|
+
(Text.$7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
1770
|
+
state.target.click();
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}, 80);
|
|
1774
|
+
// Use a capturing listener to track if a click occurred.
|
|
1775
|
+
// If stopPropagation is called it may never reach our handler.
|
|
1776
|
+
if (e.currentTarget) addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
1777
|
+
state.disposables.push(()=>clearTimeout(timeout));
|
|
1778
|
+
} else cancelEvent(e);
|
|
1779
|
+
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
1780
|
+
state.isOverTarget = false;
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
let onPointerCancel = (e)=>{
|
|
1784
|
+
cancelEvent(e);
|
|
1785
|
+
};
|
|
1786
|
+
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
1787
|
+
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
1788
|
+
return ()=>{
|
|
1789
|
+
removeGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
1790
|
+
removeGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
1791
|
+
};
|
|
1792
|
+
} else if (isPointerPressed === 'mouse' && process.env.NODE_ENV === 'test') {
|
|
1793
|
+
let onMouseUp = (e)=>{
|
|
1794
|
+
// Only handle left clicks
|
|
1795
|
+
if (e.button !== 0) return;
|
|
1796
|
+
if (state.ignoreEmulatedMouseEvents) {
|
|
1797
|
+
state.ignoreEmulatedMouseEvents = false;
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1800
|
+
if (state.target && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, e.target) && state.pointerType != null) ;
|
|
1801
|
+
else cancelEvent(e);
|
|
1802
|
+
state.isOverTarget = false;
|
|
1803
|
+
};
|
|
1804
|
+
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
1805
|
+
return ()=>{
|
|
1806
|
+
removeGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
1807
|
+
};
|
|
1808
|
+
} else if (isPointerPressed === 'touch' && process.env.NODE_ENV === 'test') {
|
|
1809
|
+
let onScroll = (e)=>{
|
|
1810
|
+
if (state.isPressed && (Text.$d4ee10de306f2510$export$4282f70798064fe0)((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancelEvent({
|
|
1811
|
+
currentTarget: state.target,
|
|
1812
|
+
shiftKey: false,
|
|
1813
|
+
ctrlKey: false,
|
|
1814
|
+
metaKey: false,
|
|
1815
|
+
altKey: false
|
|
1816
|
+
});
|
|
1817
|
+
};
|
|
1818
|
+
addGlobalListener((Text.$431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
1819
|
+
return ()=>{
|
|
1820
|
+
removeGlobalListener((Text.$431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
}, [
|
|
1824
|
+
isPointerPressed,
|
|
1825
|
+
addGlobalListener,
|
|
1826
|
+
removeGlobalListener
|
|
1827
|
+
]);
|
|
1650
1828
|
let pressProps = (React.useMemo)(()=>{
|
|
1651
1829
|
let state = ref.current;
|
|
1652
1830
|
let pressProps = {
|
|
1653
1831
|
onKeyDown (e) {
|
|
1654
|
-
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1832
|
+
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
|
|
1655
1833
|
var _state_metaKeyEvents;
|
|
1656
|
-
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1834
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1657
1835
|
// If the event is repeating, it may have started on a different element
|
|
1658
1836
|
// after which focus moved to the current element. Ignore these events and
|
|
1659
1837
|
// only handle the first key down event.
|
|
@@ -1661,16 +1839,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1661
1839
|
if (!state.isPressed && !e.repeat) {
|
|
1662
1840
|
state.target = e.currentTarget;
|
|
1663
1841
|
state.isPressed = true;
|
|
1842
|
+
setIsElemKeyPressed(true);
|
|
1664
1843
|
state.pointerType = 'keyboard';
|
|
1665
1844
|
shouldStopPropagation = triggerPressStart(e, 'keyboard');
|
|
1666
|
-
// Focus may move before the key up event, so register the event on the document
|
|
1667
|
-
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
1668
|
-
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
1669
|
-
let originalTarget = e.currentTarget;
|
|
1670
|
-
let pressUp = (e)=>{
|
|
1671
|
-
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
1672
|
-
};
|
|
1673
|
-
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'keyup', (Text.$ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
|
|
1674
1845
|
}
|
|
1675
1846
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1676
1847
|
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
|
|
@@ -1684,8 +1855,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1684
1855
|
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
|
|
1685
1856
|
},
|
|
1686
1857
|
onClick (e) {
|
|
1687
|
-
if (e && !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1688
|
-
if (e && e.button === 0 && !state.isTriggeringEvent && !(
|
|
1858
|
+
if (e && !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1859
|
+
if (e && e.button === 0 && !state.isTriggeringEvent && !(Text.$ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
|
|
1689
1860
|
let shouldStopPropagation = true;
|
|
1690
1861
|
if (isDisabled) e.preventDefault();
|
|
1691
1862
|
// If triggered from a screen reader or by using element.click(),
|
|
@@ -1710,41 +1881,10 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1710
1881
|
}
|
|
1711
1882
|
}
|
|
1712
1883
|
};
|
|
1713
|
-
let onKeyUp = (e)=>{
|
|
1714
|
-
var _state_metaKeyEvents;
|
|
1715
|
-
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
1716
|
-
var _state_metaKeyEvents1;
|
|
1717
|
-
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1718
|
-
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1719
|
-
let wasPressed = (Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e));
|
|
1720
|
-
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
1721
|
-
if (wasPressed) triggerSyntheticClick(e, state.target);
|
|
1722
|
-
removeAllGlobalListeners();
|
|
1723
|
-
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
1724
|
-
// This means the link has a role override, and the default browser behavior
|
|
1725
|
-
// only applies when using the Enter key.
|
|
1726
|
-
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && (Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
1727
|
-
// Store a hidden property on the event so we only trigger link click once,
|
|
1728
|
-
// even if there are multiple usePress instances attached to the element.
|
|
1729
|
-
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
1730
|
-
($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
1731
|
-
}
|
|
1732
|
-
state.isPressed = false;
|
|
1733
|
-
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
|
|
1734
|
-
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
|
|
1735
|
-
var _state_target;
|
|
1736
|
-
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
1737
|
-
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
1738
|
-
// See comment above for more info about the macOS bug causing this.
|
|
1739
|
-
let events = state.metaKeyEvents;
|
|
1740
|
-
state.metaKeyEvents = undefined;
|
|
1741
|
-
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
1744
1884
|
if (typeof PointerEvent !== 'undefined') {
|
|
1745
1885
|
pressProps.onPointerDown = (e)=>{
|
|
1746
1886
|
// Only handle left clicks, and ignore events that bubbled through portals.
|
|
1747
|
-
if (e.button !== 0 || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1887
|
+
if (e.button !== 0 || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1748
1888
|
// iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
|
|
1749
1889
|
// Ignore and let the onClick handler take care of it instead.
|
|
1750
1890
|
// https://bugs.webkit.org/show_bug.cgi?id=222627
|
|
@@ -1757,6 +1897,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1757
1897
|
let shouldStopPropagation = true;
|
|
1758
1898
|
if (!state.isPressed) {
|
|
1759
1899
|
state.isPressed = true;
|
|
1900
|
+
setIsPointerPressed('pointer');
|
|
1760
1901
|
state.isOverTarget = true;
|
|
1761
1902
|
state.activePointerId = e.pointerId;
|
|
1762
1903
|
state.target = e.currentTarget;
|
|
@@ -1764,15 +1905,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1764
1905
|
shouldStopPropagation = triggerPressStart(e, state.pointerType);
|
|
1765
1906
|
// Release pointer capture so that touch interactions can leave the original target.
|
|
1766
1907
|
// This enables onPointerLeave and onPointerEnter to fire.
|
|
1767
|
-
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1768
|
-
if ('releasePointerCapture' in target)
|
|
1769
|
-
|
|
1770
|
-
|
|
1908
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1909
|
+
if ('releasePointerCapture' in target) {
|
|
1910
|
+
if ('hasPointerCapture' in target) {
|
|
1911
|
+
if (target.hasPointerCapture(e.pointerId)) target.releasePointerCapture(e.pointerId);
|
|
1912
|
+
} else target.releasePointerCapture(e.pointerId);
|
|
1913
|
+
}
|
|
1771
1914
|
}
|
|
1772
1915
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1773
1916
|
};
|
|
1774
1917
|
pressProps.onMouseDown = (e)=>{
|
|
1775
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1918
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1776
1919
|
if (e.button === 0) {
|
|
1777
1920
|
if (preventFocusOnPress) {
|
|
1778
1921
|
let dispose = (Text.$8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
|
|
@@ -1783,7 +1926,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1783
1926
|
};
|
|
1784
1927
|
pressProps.onPointerUp = (e)=>{
|
|
1785
1928
|
// iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
|
|
1786
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1929
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) || state.pointerType === 'virtual') return;
|
|
1787
1930
|
// Only handle left clicks. If isPressed is true, delay until onClick.
|
|
1788
1931
|
if (e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || e.pointerType);
|
|
1789
1932
|
};
|
|
@@ -1800,43 +1943,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1800
1943
|
cancelOnPointerExit(e);
|
|
1801
1944
|
}
|
|
1802
1945
|
};
|
|
1803
|
-
let onPointerUp = (e)=>{
|
|
1804
|
-
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
1805
|
-
if ((Text.$d4ee10de306f2510$export$4282f70798064fe0)(state.target, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
1806
|
-
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
1807
|
-
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
1808
|
-
// https://github.com/adobe/react-spectrum/issues/1513
|
|
1809
|
-
// https://issues.chromium.org/issues/40732224
|
|
1810
|
-
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
1811
|
-
// We work around this by triggering a click ourselves after a timeout.
|
|
1812
|
-
// This timeout is canceled during the click event in case the real one fires first.
|
|
1813
|
-
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
1814
|
-
// non-form elements without certain ARIA roles (for hover emulation).
|
|
1815
|
-
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
1816
|
-
let clicked = false;
|
|
1817
|
-
let timeout = setTimeout(()=>{
|
|
1818
|
-
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
1819
|
-
if (clicked) cancel(e);
|
|
1820
|
-
else {
|
|
1821
|
-
(Text.$7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
1822
|
-
state.target.click();
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
}, 80);
|
|
1826
|
-
// Use a capturing listener to track if a click occurred.
|
|
1827
|
-
// If stopPropagation is called it may never reach our handler.
|
|
1828
|
-
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
1829
|
-
state.disposables.push(()=>clearTimeout(timeout));
|
|
1830
|
-
} else cancel(e);
|
|
1831
|
-
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
1832
|
-
state.isOverTarget = false;
|
|
1833
|
-
}
|
|
1834
|
-
};
|
|
1835
|
-
let onPointerCancel = (e)=>{
|
|
1836
|
-
cancel(e);
|
|
1837
|
-
};
|
|
1838
1946
|
pressProps.onDragStart = (e)=>{
|
|
1839
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1947
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1840
1948
|
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
|
|
1841
1949
|
cancel(e);
|
|
1842
1950
|
};
|
|
@@ -1845,12 +1953,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1845
1953
|
// All browsers now support pointer events, but JSDOM still does not.
|
|
1846
1954
|
pressProps.onMouseDown = (e)=>{
|
|
1847
1955
|
// Only handle left clicks
|
|
1848
|
-
if (e.button !== 0 || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1956
|
+
if (e.button !== 0 || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1849
1957
|
if (state.ignoreEmulatedMouseEvents) {
|
|
1850
1958
|
e.stopPropagation();
|
|
1851
1959
|
return;
|
|
1852
1960
|
}
|
|
1853
1961
|
state.isPressed = true;
|
|
1962
|
+
setIsPointerPressed('mouse');
|
|
1854
1963
|
state.isOverTarget = true;
|
|
1855
1964
|
state.target = e.currentTarget;
|
|
1856
1965
|
state.pointerType = (Text.$6a7db85432448f7f$export$60278871457622de)(e.nativeEvent) ? 'virtual' : 'mouse';
|
|
@@ -1861,10 +1970,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1861
1970
|
let dispose = (Text.$8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
|
|
1862
1971
|
if (dispose) state.disposables.push(dispose);
|
|
1863
1972
|
}
|
|
1864
|
-
addGlobalListener((Text.$431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'mouseup', onMouseUp, false);
|
|
1865
1973
|
};
|
|
1866
1974
|
pressProps.onMouseEnter = (e)=>{
|
|
1867
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1975
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1868
1976
|
let shouldStopPropagation = true;
|
|
1869
1977
|
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
1870
1978
|
state.isOverTarget = true;
|
|
@@ -1873,7 +1981,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1873
1981
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1874
1982
|
};
|
|
1875
1983
|
pressProps.onMouseLeave = (e)=>{
|
|
1876
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1984
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1877
1985
|
let shouldStopPropagation = true;
|
|
1878
1986
|
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
1879
1987
|
state.isOverTarget = false;
|
|
@@ -1883,37 +1991,26 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1883
1991
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1884
1992
|
};
|
|
1885
1993
|
pressProps.onMouseUp = (e)=>{
|
|
1886
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1994
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1887
1995
|
if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || 'mouse');
|
|
1888
1996
|
};
|
|
1889
|
-
let onMouseUp = (e)=>{
|
|
1890
|
-
// Only handle left clicks
|
|
1891
|
-
if (e.button !== 0) return;
|
|
1892
|
-
if (state.ignoreEmulatedMouseEvents) {
|
|
1893
|
-
state.ignoreEmulatedMouseEvents = false;
|
|
1894
|
-
return;
|
|
1895
|
-
}
|
|
1896
|
-
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
|
|
1897
|
-
else cancel(e);
|
|
1898
|
-
state.isOverTarget = false;
|
|
1899
|
-
};
|
|
1900
1997
|
pressProps.onTouchStart = (e)=>{
|
|
1901
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
1998
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1902
1999
|
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
|
|
1903
2000
|
if (!touch) return;
|
|
1904
2001
|
state.activePointerId = touch.identifier;
|
|
1905
2002
|
state.ignoreEmulatedMouseEvents = true;
|
|
1906
2003
|
state.isOverTarget = true;
|
|
1907
2004
|
state.isPressed = true;
|
|
2005
|
+
setIsPointerPressed('touch');
|
|
1908
2006
|
state.target = e.currentTarget;
|
|
1909
2007
|
state.pointerType = 'touch';
|
|
1910
2008
|
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$16a4697467175487)(state.target);
|
|
1911
2009
|
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
|
|
1912
2010
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1913
|
-
addGlobalListener((Text.$431fbd86ca7dc216$export$f21a1ffae260145a)(e.currentTarget), 'scroll', onScroll, true);
|
|
1914
2011
|
};
|
|
1915
2012
|
pressProps.onTouchMove = (e)=>{
|
|
1916
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
2013
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1917
2014
|
if (!state.isPressed) {
|
|
1918
2015
|
e.stopPropagation();
|
|
1919
2016
|
return;
|
|
@@ -1933,7 +2030,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1933
2030
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1934
2031
|
};
|
|
1935
2032
|
pressProps.onTouchEnd = (e)=>{
|
|
1936
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
2033
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1937
2034
|
if (!state.isPressed) {
|
|
1938
2035
|
e.stopPropagation();
|
|
1939
2036
|
return;
|
|
@@ -1947,6 +2044,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1947
2044
|
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
|
|
1948
2045
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1949
2046
|
state.isPressed = false;
|
|
2047
|
+
setIsPointerPressed(null);
|
|
1950
2048
|
state.activePointerId = null;
|
|
1951
2049
|
state.isOverTarget = false;
|
|
1952
2050
|
state.ignoreEmulatedMouseEvents = true;
|
|
@@ -1954,27 +2052,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1954
2052
|
removeAllGlobalListeners();
|
|
1955
2053
|
};
|
|
1956
2054
|
pressProps.onTouchCancel = (e)=>{
|
|
1957
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
2055
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1958
2056
|
e.stopPropagation();
|
|
1959
2057
|
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
|
|
1960
2058
|
};
|
|
1961
|
-
let onScroll = (e)=>{
|
|
1962
|
-
if (state.isPressed && (Text.$d4ee10de306f2510$export$4282f70798064fe0)((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancel({
|
|
1963
|
-
currentTarget: state.target,
|
|
1964
|
-
shiftKey: false,
|
|
1965
|
-
ctrlKey: false,
|
|
1966
|
-
metaKey: false,
|
|
1967
|
-
altKey: false
|
|
1968
|
-
});
|
|
1969
|
-
};
|
|
1970
2059
|
pressProps.onDragStart = (e)=>{
|
|
1971
|
-
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e
|
|
2060
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1972
2061
|
cancel(e);
|
|
1973
2062
|
};
|
|
1974
2063
|
}
|
|
1975
2064
|
return pressProps;
|
|
1976
2065
|
}, [
|
|
1977
|
-
addGlobalListener,
|
|
1978
2066
|
isDisabled,
|
|
1979
2067
|
preventFocusOnPress,
|
|
1980
2068
|
removeAllGlobalListeners,
|
|
@@ -2079,7 +2167,8 @@ function $f6c31cce2adf654f$var$createEvent(target, e) {
|
|
|
2079
2167
|
metaKey: e.metaKey,
|
|
2080
2168
|
altKey: e.altKey,
|
|
2081
2169
|
clientX: clientX,
|
|
2082
|
-
clientY: clientY
|
|
2170
|
+
clientY: clientY,
|
|
2171
|
+
key: e.key
|
|
2083
2172
|
};
|
|
2084
2173
|
}
|
|
2085
2174
|
function $f6c31cce2adf654f$var$getPointClientRect(point) {
|
|
@@ -2202,16 +2291,15 @@ const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (React).forwardR
|
|
|
2202
2291
|
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (React).forwardRef(({ children: children, ...props }, ref)=>{
|
|
2203
2292
|
let isRegistered = (React.useRef)(false);
|
|
2204
2293
|
let prevContext = (React.useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
|
|
2205
|
-
ref = (Text.$df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
|
|
2206
2294
|
let context = (Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(prevContext || {}, {
|
|
2207
2295
|
...props,
|
|
2208
|
-
ref: ref,
|
|
2209
2296
|
register () {
|
|
2210
2297
|
isRegistered.current = true;
|
|
2211
2298
|
if (prevContext) prevContext.register();
|
|
2212
2299
|
}
|
|
2213
2300
|
});
|
|
2214
|
-
(Text.$
|
|
2301
|
+
context.ref = (Text.$df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
|
|
2302
|
+
(Text.$e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, context.ref);
|
|
2215
2303
|
(React.useEffect)(()=>{
|
|
2216
2304
|
if (!isRegistered.current) {
|
|
2217
2305
|
if (process.env.NODE_ENV !== 'production') console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.");
|
|
@@ -2306,19 +2394,18 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
2306
2394
|
}
|
|
2307
2395
|
}, [
|
|
2308
2396
|
ref,
|
|
2309
|
-
isDisabled
|
|
2310
|
-
onPointerDown,
|
|
2311
|
-
triggerInteractOutside
|
|
2397
|
+
isDisabled
|
|
2312
2398
|
]);
|
|
2313
2399
|
}
|
|
2314
2400
|
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
2315
2401
|
if (event.button > 0) return false;
|
|
2316
|
-
|
|
2402
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(event);
|
|
2403
|
+
if (target) {
|
|
2317
2404
|
// if the event target is no longer in the document, ignore
|
|
2318
|
-
const ownerDocument =
|
|
2319
|
-
if (!ownerDocument || !ownerDocument.documentElement
|
|
2405
|
+
const ownerDocument = target.ownerDocument;
|
|
2406
|
+
if (!ownerDocument || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(ownerDocument.documentElement, target)) return false;
|
|
2320
2407
|
// If the target is within a top layer element (e.g. toasts), ignore.
|
|
2321
|
-
if (
|
|
2408
|
+
if (target.closest('[data-react-aria-top-layer]')) return false;
|
|
2322
2409
|
}
|
|
2323
2410
|
if (!ref.current) return false;
|
|
2324
2411
|
// When the event source is inside a Shadow DOM, event.target is just the shadow root.
|
|
@@ -2605,22 +2692,23 @@ function $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {
|
|
|
2605
2692
|
}
|
|
2606
2693
|
return true;
|
|
2607
2694
|
}
|
|
2695
|
+
function $9bf71ea28793e738$var$getRadiosInGroup(element) {
|
|
2696
|
+
if (!element.form) // Radio buttons outside a form - query the document
|
|
2697
|
+
return Array.from((Text.$431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)).filter((radio)=>!radio.form);
|
|
2698
|
+
// namedItem returns RadioNodeList (iterable) for 2+ elements, but a single Element for exactly 1.
|
|
2699
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection/namedItem
|
|
2700
|
+
const radioList = element.form.elements.namedItem(element.name);
|
|
2701
|
+
let ownerWindow = (Text.$431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
2702
|
+
if (radioList instanceof ownerWindow.RadioNodeList) return Array.from(radioList).filter((el)=>el instanceof ownerWindow.HTMLInputElement);
|
|
2703
|
+
if (radioList instanceof ownerWindow.HTMLInputElement) return [
|
|
2704
|
+
radioList
|
|
2705
|
+
];
|
|
2706
|
+
return [];
|
|
2707
|
+
}
|
|
2608
2708
|
function $9bf71ea28793e738$var$isTabbableRadio(element) {
|
|
2609
2709
|
if (element.checked) return true;
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
...(Text.$431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)
|
|
2613
|
-
].filter((radio)=>!radio.form);
|
|
2614
|
-
else {
|
|
2615
|
-
var _element_form_elements, _element_form;
|
|
2616
|
-
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);
|
|
2617
|
-
radios = [
|
|
2618
|
-
...radioList !== null && radioList !== void 0 ? radioList : []
|
|
2619
|
-
];
|
|
2620
|
-
}
|
|
2621
|
-
if (!radios) return false;
|
|
2622
|
-
let anyChecked = radios.some((radio)=>radio.checked);
|
|
2623
|
-
return !anyChecked;
|
|
2710
|
+
const radios = $9bf71ea28793e738$var$getRadiosInGroup(element);
|
|
2711
|
+
return radios.length > 0 && !radios.some((radio)=>radio.checked);
|
|
2624
2712
|
}
|
|
2625
2713
|
function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
2626
2714
|
let focusedNode = (React.useRef)(undefined);
|
|
@@ -2720,7 +2808,7 @@ function $9bf71ea28793e738$var$isElementInAnyScope(element) {
|
|
|
2720
2808
|
function $9bf71ea28793e738$var$isElementInScope(element, scope) {
|
|
2721
2809
|
if (!element) return false;
|
|
2722
2810
|
if (!scope) return false;
|
|
2723
|
-
return scope.some((node)=>node
|
|
2811
|
+
return scope.some((node)=>(Text.$d4ee10de306f2510$export$4282f70798064fe0)(node, element));
|
|
2724
2812
|
}
|
|
2725
2813
|
function $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {
|
|
2726
2814
|
// If the element is within a top layer element (e.g. toasts), always allow moving focus there.
|
|
@@ -2967,9 +3055,8 @@ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
|
2967
3055
|
// Create a TreeWalker, ensuring the root is an Element or Document
|
|
2968
3056
|
let walker = ($dfc540311bf7f109$export$4d0f8be8b12a7ef6)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {
|
|
2969
3057
|
acceptNode (node) {
|
|
2970
|
-
var _opts_from;
|
|
2971
3058
|
// Skip nodes inside the starting node.
|
|
2972
|
-
if (opts === null || opts === void 0 ? void 0 :
|
|
3059
|
+
if ((Text.$d4ee10de306f2510$export$4282f70798064fe0)(opts === null || opts === void 0 ? void 0 : opts.from, node)) return NodeFilter.FILTER_REJECT;
|
|
2973
3060
|
if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {
|
|
2974
3061
|
// If the radio is in a form, we can get all the other radios by name
|
|
2975
3062
|
if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;
|
|
@@ -3102,9 +3189,11 @@ function $55f9b1ae81f22853$export$759df0d867455a91(document) {
|
|
|
3102
3189
|
*/
|
|
3103
3190
|
|
|
3104
3191
|
|
|
3192
|
+
|
|
3105
3193
|
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
3106
3194
|
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
3107
3195
|
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
3196
|
+
let lastVisibleOverlay = (React.useRef)(undefined);
|
|
3108
3197
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
3109
3198
|
(React.useEffect)(()=>{
|
|
3110
3199
|
if (isOpen && !$a11501f3d1d39e6c$var$visibleOverlays.includes(ref)) {
|
|
@@ -3123,21 +3212,24 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
3123
3212
|
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose) onClose();
|
|
3124
3213
|
};
|
|
3125
3214
|
let onInteractOutsideStart = (e)=>{
|
|
3126
|
-
|
|
3127
|
-
|
|
3215
|
+
const topMostOverlay = $a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1];
|
|
3216
|
+
lastVisibleOverlay.current = topMostOverlay;
|
|
3217
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
|
|
3218
|
+
if (topMostOverlay === ref) {
|
|
3128
3219
|
e.stopPropagation();
|
|
3129
3220
|
e.preventDefault();
|
|
3130
3221
|
}
|
|
3131
3222
|
}
|
|
3132
3223
|
};
|
|
3133
3224
|
let onInteractOutside = (e)=>{
|
|
3134
|
-
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e
|
|
3225
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
|
|
3135
3226
|
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
3136
3227
|
e.stopPropagation();
|
|
3137
3228
|
e.preventDefault();
|
|
3138
3229
|
}
|
|
3139
|
-
onHide();
|
|
3230
|
+
if (lastVisibleOverlay.current === ref) onHide();
|
|
3140
3231
|
}
|
|
3232
|
+
lastVisibleOverlay.current = undefined;
|
|
3141
3233
|
};
|
|
3142
3234
|
// Handle the escape key
|
|
3143
3235
|
let onKeyDown = (e)=>{
|
|
@@ -3171,7 +3263,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
3171
3263
|
});
|
|
3172
3264
|
let onPointerDownUnderlay = (e)=>{
|
|
3173
3265
|
// fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
|
|
3174
|
-
if (e
|
|
3266
|
+
if ((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === e.currentTarget) e.preventDefault();
|
|
3175
3267
|
};
|
|
3176
3268
|
return {
|
|
3177
3269
|
overlayProps: {
|
|
@@ -3238,18 +3330,6 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
3238
3330
|
* governing permissions and limitations under the License.
|
|
3239
3331
|
*/
|
|
3240
3332
|
const $49c51c25361d4cd2$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
3241
|
-
// HTML input types that do not cause the software keyboard to appear.
|
|
3242
|
-
const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
3243
|
-
'checkbox',
|
|
3244
|
-
'radio',
|
|
3245
|
-
'range',
|
|
3246
|
-
'color',
|
|
3247
|
-
'file',
|
|
3248
|
-
'image',
|
|
3249
|
-
'button',
|
|
3250
|
-
'submit',
|
|
3251
|
-
'reset'
|
|
3252
|
-
]);
|
|
3253
3333
|
// The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
|
|
3254
3334
|
let $49c51c25361d4cd2$var$preventScrollCount = 0;
|
|
3255
3335
|
let $49c51c25361d4cd2$var$restore;
|
|
@@ -3294,29 +3374,46 @@ function $49c51c25361d4cd2$var$preventScrollStandard() {
|
|
|
3294
3374
|
// on the window.
|
|
3295
3375
|
// 2. Set `overscroll-behavior: contain` on nested scrollable regions so they do not scroll the page when at
|
|
3296
3376
|
// the top or bottom. Work around a bug where this does not work when the element does not actually overflow
|
|
3297
|
-
// by preventing default in a `touchmove` event.
|
|
3377
|
+
// by preventing default in a `touchmove` event. This is best effort: we can't prevent default when pinch
|
|
3378
|
+
// zooming or when an element contains text selection, which may allow scrolling in some cases.
|
|
3298
3379
|
// 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
|
|
3299
|
-
// 4. When
|
|
3300
|
-
//
|
|
3301
|
-
//
|
|
3302
|
-
// 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
|
|
3303
|
-
// same visually, but makes the actual scroll position always zero. This is required to make all of the
|
|
3304
|
-
// above work or Safari will still try to scroll the page when focusing an input.
|
|
3305
|
-
// 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
|
|
3306
|
-
// to navigate to an input with the next/previous buttons that's outside a modal.
|
|
3380
|
+
// 4. When focus moves to an input, create an off screen input and focus that temporarily. This prevents
|
|
3381
|
+
// Safari from scrolling the page. After a small delay, focus the real input and scroll it into view
|
|
3382
|
+
// ourselves, without scrolling the whole page.
|
|
3307
3383
|
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
3384
|
+
// Set overflow hidden so scrollIntoViewport() (useSelectableCollection) sees isScrollPrevented and
|
|
3385
|
+
// scrolls only scroll parents instead of calling native scrollIntoView() which moves the window.
|
|
3386
|
+
let restoreOverflow = $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden');
|
|
3308
3387
|
let scrollable;
|
|
3309
|
-
let
|
|
3388
|
+
let allowTouchMove = false;
|
|
3310
3389
|
let onTouchStart = (e)=>{
|
|
3311
3390
|
// Store the nearest scrollable parent element from the element that the user touched.
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
//
|
|
3316
|
-
|
|
3317
|
-
if (
|
|
3391
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
3392
|
+
scrollable = ($cc38e7bd3fc7b213$export$2bb74740c4e19def)(target) ? target : ($62d8ded9296f3872$export$cfa2225e87938781)(target, true);
|
|
3393
|
+
allowTouchMove = false;
|
|
3394
|
+
// If the target is selected, don't preventDefault in touchmove to allow user to adjust selection.
|
|
3395
|
+
let selection = target.ownerDocument.defaultView.getSelection();
|
|
3396
|
+
if (selection && !selection.isCollapsed && selection.containsNode(target, true)) allowTouchMove = true;
|
|
3397
|
+
// If this is a range input, allow touch move to allow user to adjust the slider value
|
|
3398
|
+
if (e.composedPath().some((el)=>el instanceof HTMLInputElement && el.type === 'range')) allowTouchMove = true;
|
|
3399
|
+
// If this is a focused input element with a selected range, allow user to drag the selection handles.
|
|
3400
|
+
if ('selectionStart' in target && 'selectionEnd' in target && target.selectionStart < target.selectionEnd && target.ownerDocument.activeElement === target) allowTouchMove = true;
|
|
3318
3401
|
};
|
|
3402
|
+
// Prevent scrolling up when at the top and scrolling down when at the bottom
|
|
3403
|
+
// of a nested scrollable area, otherwise mobile Safari will start scrolling
|
|
3404
|
+
// the window instead.
|
|
3405
|
+
// This must be applied before the touchstart event as of iOS 26, so inject it as a <style> element.
|
|
3406
|
+
let style = document.createElement('style');
|
|
3407
|
+
style.textContent = `
|
|
3408
|
+
@layer {
|
|
3409
|
+
* {
|
|
3410
|
+
overscroll-behavior: contain;
|
|
3411
|
+
}
|
|
3412
|
+
}`.trim();
|
|
3413
|
+
document.head.prepend(style);
|
|
3319
3414
|
let onTouchMove = (e)=>{
|
|
3415
|
+
// Allow pinch-zooming.
|
|
3416
|
+
if (e.touches.length === 2 || allowTouchMove) return;
|
|
3320
3417
|
// Prevent scrolling the window.
|
|
3321
3418
|
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
3322
3419
|
e.preventDefault();
|
|
@@ -3330,53 +3427,40 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
3330
3427
|
// because it must be set before the touchstart event.
|
|
3331
3428
|
if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) e.preventDefault();
|
|
3332
3429
|
};
|
|
3333
|
-
let
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
});
|
|
3353
|
-
else // Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
3354
|
-
// measure the correct position to scroll to.
|
|
3355
|
-
$49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
|
|
3356
|
-
once: true
|
|
3357
|
-
});
|
|
3358
|
-
}
|
|
3430
|
+
let onBlur = (e)=>{
|
|
3431
|
+
let target = (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
3432
|
+
let relatedTarget = e.relatedTarget;
|
|
3433
|
+
if (relatedTarget && ($21f1aa98acb08317$export$c57958e35f31ed73)(relatedTarget)) {
|
|
3434
|
+
// Focus without scrolling the whole page, and then scroll into view manually.
|
|
3435
|
+
relatedTarget.focus({
|
|
3436
|
+
preventScroll: true
|
|
3437
|
+
});
|
|
3438
|
+
$49c51c25361d4cd2$var$scrollIntoViewWhenReady(relatedTarget, ($21f1aa98acb08317$export$c57958e35f31ed73)(target));
|
|
3439
|
+
} else if (!relatedTarget) {
|
|
3440
|
+
var _target_parentElement;
|
|
3441
|
+
// When tapping the Done button on the keyboard, focus moves to the body.
|
|
3442
|
+
// FocusScope will then restore focus back to the input. Later when tapping
|
|
3443
|
+
// the same input again, it is already focused, so no blur event will fire,
|
|
3444
|
+
// resulting in the flow above never running and Safari's native scrolling occurring.
|
|
3445
|
+
// Instead, move focus to the parent focusable element (e.g. the dialog).
|
|
3446
|
+
let focusable = (_target_parentElement = target.parentElement) === null || _target_parentElement === void 0 ? void 0 : _target_parentElement.closest('[tabindex]');
|
|
3447
|
+
focusable === null || focusable === void 0 ? void 0 : focusable.focus({
|
|
3448
|
+
preventScroll: true
|
|
3359
3449
|
});
|
|
3360
3450
|
}
|
|
3361
3451
|
};
|
|
3362
|
-
|
|
3363
|
-
let
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
// enable us to scroll the window to the top, which is required for the rest of this to work.
|
|
3373
|
-
let scrollX = window.pageXOffset;
|
|
3374
|
-
let scrollY = window.pageYOffset;
|
|
3375
|
-
restoreStyles = (Text.$ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(window, 'scroll', onWindowScroll), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'), $49c51c25361d4cd2$var$setStyle(document.body, 'marginTop', `-${scrollY}px`), ()=>{
|
|
3376
|
-
window.scrollTo(scrollX, scrollY);
|
|
3452
|
+
// Override programmatic focus to scroll into view without scrolling the whole page.
|
|
3453
|
+
let focus = HTMLElement.prototype.focus;
|
|
3454
|
+
HTMLElement.prototype.focus = function(opts) {
|
|
3455
|
+
// Track whether the keyboard was already visible before.
|
|
3456
|
+
let activeElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
3457
|
+
let wasKeyboardVisible = activeElement != null && ($21f1aa98acb08317$export$c57958e35f31ed73)(activeElement);
|
|
3458
|
+
// Focus the element without scrolling the page.
|
|
3459
|
+
focus.call(this, {
|
|
3460
|
+
...opts,
|
|
3461
|
+
preventScroll: true
|
|
3377
3462
|
});
|
|
3378
|
-
|
|
3379
|
-
window.scrollTo(0, 0);
|
|
3463
|
+
if (!opts || !opts.preventScroll) $49c51c25361d4cd2$var$scrollIntoViewWhenReady(this, wasKeyboardVisible);
|
|
3380
3464
|
};
|
|
3381
3465
|
let removeEvents = (Text.$ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(document, 'touchstart', onTouchStart, {
|
|
3382
3466
|
passive: false,
|
|
@@ -3384,15 +3468,12 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
3384
3468
|
}), $49c51c25361d4cd2$var$addEvent(document, 'touchmove', onTouchMove, {
|
|
3385
3469
|
passive: false,
|
|
3386
3470
|
capture: true
|
|
3387
|
-
}), $49c51c25361d4cd2$var$addEvent(document, '
|
|
3388
|
-
passive: false,
|
|
3389
|
-
capture: true
|
|
3390
|
-
}), $49c51c25361d4cd2$var$addEvent(document, 'focus', onFocus, true));
|
|
3471
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'blur', onBlur, true));
|
|
3391
3472
|
return ()=>{
|
|
3392
|
-
|
|
3393
|
-
restoreScrollableStyles === null || restoreScrollableStyles === void 0 ? void 0 : restoreScrollableStyles();
|
|
3394
|
-
restoreStyles === null || restoreStyles === void 0 ? void 0 : restoreStyles();
|
|
3473
|
+
restoreOverflow();
|
|
3395
3474
|
removeEvents();
|
|
3475
|
+
style.remove();
|
|
3476
|
+
HTMLElement.prototype.focus = focus;
|
|
3396
3477
|
};
|
|
3397
3478
|
}
|
|
3398
3479
|
// Sets a CSS property on an element, and returns a function to revert it to the previous value.
|
|
@@ -3413,6 +3494,15 @@ function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
|
|
|
3413
3494
|
target.removeEventListener(event, handler, options);
|
|
3414
3495
|
};
|
|
3415
3496
|
}
|
|
3497
|
+
function $49c51c25361d4cd2$var$scrollIntoViewWhenReady(target, wasKeyboardVisible) {
|
|
3498
|
+
if (wasKeyboardVisible || !$49c51c25361d4cd2$var$visualViewport) // If the keyboard was already visible, scroll the target into view immediately.
|
|
3499
|
+
$49c51c25361d4cd2$var$scrollIntoView(target);
|
|
3500
|
+
else // Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
3501
|
+
// measure the correct position to scroll to.
|
|
3502
|
+
$49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
|
|
3503
|
+
once: true
|
|
3504
|
+
});
|
|
3505
|
+
}
|
|
3416
3506
|
function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
3417
3507
|
let root = document.scrollingElement || document.documentElement;
|
|
3418
3508
|
let nextTarget = target;
|
|
@@ -3420,16 +3510,23 @@ function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
|
3420
3510
|
// Find the parent scrollable element and adjust the scroll position if the target is not already in view.
|
|
3421
3511
|
let scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(nextTarget);
|
|
3422
3512
|
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
|
|
3423
|
-
let
|
|
3424
|
-
let
|
|
3425
|
-
if (
|
|
3513
|
+
let scrollableRect = scrollable.getBoundingClientRect();
|
|
3514
|
+
let targetRect = nextTarget.getBoundingClientRect();
|
|
3515
|
+
if (targetRect.top < scrollableRect.top || targetRect.bottom > scrollableRect.top + nextTarget.clientHeight) {
|
|
3516
|
+
let bottom = scrollableRect.bottom;
|
|
3517
|
+
if ($49c51c25361d4cd2$var$visualViewport) bottom = Math.min(bottom, $49c51c25361d4cd2$var$visualViewport.offsetTop + $49c51c25361d4cd2$var$visualViewport.height);
|
|
3518
|
+
// Center within the viewport.
|
|
3519
|
+
let adjustment = targetRect.top - scrollableRect.top - ((bottom - scrollableRect.top) / 2 - targetRect.height / 2);
|
|
3520
|
+
scrollable.scrollTo({
|
|
3521
|
+
// Clamp to the valid range to prevent over-scrolling.
|
|
3522
|
+
top: Math.max(0, Math.min(scrollable.scrollHeight - scrollable.clientHeight, scrollable.scrollTop + adjustment)),
|
|
3523
|
+
behavior: 'smooth'
|
|
3524
|
+
});
|
|
3525
|
+
}
|
|
3426
3526
|
}
|
|
3427
3527
|
nextTarget = scrollable.parentElement;
|
|
3428
3528
|
}
|
|
3429
3529
|
}
|
|
3430
|
-
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
3431
|
-
return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
3432
|
-
}
|
|
3433
3530
|
|
|
3434
3531
|
/*
|
|
3435
3532
|
* Copyright 2024 Adobe. All rights reserved.
|
|
@@ -3795,6 +3892,7 @@ function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
|
3795
3892
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
3796
3893
|
* governing permissions and limitations under the License.
|
|
3797
3894
|
*/
|
|
3895
|
+
|
|
3798
3896
|
const $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;
|
|
3799
3897
|
// Keeps a ref count of all hidden elements. Added to when hiding an element, and
|
|
3800
3898
|
// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
|
|
@@ -3823,6 +3921,17 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3823
3921
|
element.inert = false;
|
|
3824
3922
|
}
|
|
3825
3923
|
};
|
|
3924
|
+
let shadowRootsToWatch = new Set();
|
|
3925
|
+
if ((Text.$f4e2df6bd15f8569$export$98658e8c59125e6a)()) // find all shadow roots that are ancestors of the targets
|
|
3926
|
+
// traverse upwards until the root is reached
|
|
3927
|
+
for (let target of targets){
|
|
3928
|
+
let node = target;
|
|
3929
|
+
while(node && node !== root){
|
|
3930
|
+
let root = node.getRootNode();
|
|
3931
|
+
if ('shadowRoot' in root) shadowRootsToWatch.add(root.shadowRoot);
|
|
3932
|
+
node = root.parentNode;
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3826
3935
|
let walk = (root)=>{
|
|
3827
3936
|
// Keep live announcer and top layer elements (e.g. toasts) visible.
|
|
3828
3937
|
for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]'))visibleNodes.add(element);
|
|
@@ -3834,11 +3943,11 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3834
3943
|
if (hiddenNodes.has(node) || visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
|
|
3835
3944
|
// Skip this node but continue to children if one of the targets is inside the node.
|
|
3836
3945
|
for (let target of visibleNodes){
|
|
3837
|
-
if (node
|
|
3946
|
+
if ((Text.$d4ee10de306f2510$export$4282f70798064fe0)(node, target)) return NodeFilter.FILTER_SKIP;
|
|
3838
3947
|
}
|
|
3839
3948
|
return NodeFilter.FILTER_ACCEPT;
|
|
3840
3949
|
};
|
|
3841
|
-
let walker =
|
|
3950
|
+
let walker = ($dfc540311bf7f109$export$4d0f8be8b12a7ef6)((Text.$431fbd86ca7dc216$export$b204af158042fbac)(root), root, NodeFilter.SHOW_ELEMENT, {
|
|
3842
3951
|
acceptNode: acceptNode
|
|
3843
3952
|
});
|
|
3844
3953
|
// TreeWalker does not include the root.
|
|
@@ -3871,19 +3980,56 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3871
3980
|
if (change.type !== 'childList') continue;
|
|
3872
3981
|
// If the parent element of the added nodes is not within one of the targets,
|
|
3873
3982
|
// and not already inside a hidden node, hide all of the new children.
|
|
3874
|
-
if (![
|
|
3983
|
+
if (change.target.isConnected && ![
|
|
3875
3984
|
...visibleNodes,
|
|
3876
3985
|
...hiddenNodes
|
|
3877
|
-
].some((node)=>node
|
|
3986
|
+
].some((node)=>(Text.$d4ee10de306f2510$export$4282f70798064fe0)(node, change.target))) for (let node of change.addedNodes){
|
|
3878
3987
|
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
|
|
3879
3988
|
else if (node instanceof Element) walk(node);
|
|
3880
3989
|
}
|
|
3990
|
+
if ((Text.$f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
|
|
3991
|
+
// if any of the observed shadow roots were removed, stop observing them
|
|
3992
|
+
for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
|
|
3993
|
+
observer.disconnect();
|
|
3994
|
+
break;
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3881
3997
|
}
|
|
3882
3998
|
});
|
|
3883
3999
|
observer.observe(root, {
|
|
3884
4000
|
childList: true,
|
|
3885
4001
|
subtree: true
|
|
3886
4002
|
});
|
|
4003
|
+
let shadowObservers = new Set();
|
|
4004
|
+
if ((Text.$f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowRoot of shadowRootsToWatch){
|
|
4005
|
+
// Disconnect single target instead of all https://github.com/whatwg/dom/issues/126
|
|
4006
|
+
let shadowObserver = new MutationObserver((changes)=>{
|
|
4007
|
+
for (let change of changes){
|
|
4008
|
+
if (change.type !== 'childList') continue;
|
|
4009
|
+
// If the parent element of the added nodes is not within one of the targets,
|
|
4010
|
+
// and not already inside a hidden node, hide all of the new children.
|
|
4011
|
+
if (change.target.isConnected && ![
|
|
4012
|
+
...visibleNodes,
|
|
4013
|
+
...hiddenNodes
|
|
4014
|
+
].some((node)=>(Text.$d4ee10de306f2510$export$4282f70798064fe0)(node, change.target))) for (let node of change.addedNodes){
|
|
4015
|
+
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
|
|
4016
|
+
else if (node instanceof Element) walk(node);
|
|
4017
|
+
}
|
|
4018
|
+
if ((Text.$f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
|
|
4019
|
+
// if any of the observed shadow roots were removed, stop observing them
|
|
4020
|
+
for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
|
|
4021
|
+
observer.disconnect();
|
|
4022
|
+
break;
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
});
|
|
4027
|
+
shadowObserver.observe(shadowRoot, {
|
|
4028
|
+
childList: true,
|
|
4029
|
+
subtree: true
|
|
4030
|
+
});
|
|
4031
|
+
shadowObservers.add(shadowObserver);
|
|
4032
|
+
}
|
|
3887
4033
|
let observerWrapper = {
|
|
3888
4034
|
visibleNodes: visibleNodes,
|
|
3889
4035
|
hiddenNodes: hiddenNodes,
|
|
@@ -3900,6 +4046,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3900
4046
|
$5e3802645cc19319$var$observerStack.push(observerWrapper);
|
|
3901
4047
|
return ()=>{
|
|
3902
4048
|
observer.disconnect();
|
|
4049
|
+
if ((Text.$f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowObserver of shadowObservers)shadowObserver.disconnect();
|
|
3903
4050
|
for (let node of hiddenNodes){
|
|
3904
4051
|
let count = $5e3802645cc19319$var$refCountMap.get(node);
|
|
3905
4052
|
if (count == null) continue;
|
|
@@ -4074,6 +4221,7 @@ function $feb5ffebff200149$export$6aeb1680a0ae8741(collection) {
|
|
|
4074
4221
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
4075
4222
|
* governing permissions and limitations under the License.
|
|
4076
4223
|
*/
|
|
4224
|
+
|
|
4077
4225
|
/**
|
|
4078
4226
|
* Controls how long to wait before clearing the typeahead buffer.
|
|
4079
4227
|
*/ const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1000; // 1 second
|
|
@@ -4085,7 +4233,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
4085
4233
|
}).current;
|
|
4086
4234
|
let onKeyDown = (e)=>{
|
|
4087
4235
|
let character = $fb3050f43d946246$var$getStringForKey(e.key);
|
|
4088
|
-
if (!character || e.ctrlKey || e.metaKey || !e.currentTarget
|
|
4236
|
+
if (!character || e.ctrlKey || e.metaKey || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) || state.search.length === 0 && character === ' ') return;
|
|
4089
4237
|
// Do not propagate the Spacebar event if it's meant to be part of the search.
|
|
4090
4238
|
// When we time out, the search term becomes empty, hence the check on length.
|
|
4091
4239
|
// Trimming is to account for the case of pressing the Spacebar more than once,
|
|
@@ -4147,17 +4295,16 @@ function $fb3050f43d946246$var$getStringForKey(key) {
|
|
|
4147
4295
|
|
|
4148
4296
|
|
|
4149
4297
|
function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
4150
|
-
let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false,
|
|
4298
|
+
let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
|
|
4151
4299
|
scrollRef = ref, linkBehavior: linkBehavior = 'action' } = options;
|
|
4152
4300
|
let { direction: direction } = (Text.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
4153
|
-
let router = (
|
|
4301
|
+
let router = (Text.$ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
|
|
4154
4302
|
let onKeyDown = (e)=>{
|
|
4155
|
-
var _ref_current;
|
|
4156
4303
|
// Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
|
|
4157
4304
|
if (e.altKey && e.key === 'Tab') e.preventDefault();
|
|
4158
4305
|
// Keyboard events bubble through portals. Don't handle keyboard events
|
|
4159
4306
|
// for elements outside the collection (e.g. menus).
|
|
4160
|
-
if (!
|
|
4307
|
+
if (!ref.current || !(Text.$d4ee10de306f2510$export$4282f70798064fe0)(ref.current, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
4161
4308
|
const navigateToKey = (key, childFocus)=>{
|
|
4162
4309
|
if (key != null) {
|
|
4163
4310
|
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) {
|
|
@@ -4295,7 +4442,11 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4295
4442
|
last = walker.lastChild();
|
|
4296
4443
|
if (last) next = last;
|
|
4297
4444
|
}while (last);
|
|
4298
|
-
|
|
4445
|
+
// 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
|
|
4446
|
+
// the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between
|
|
4447
|
+
// focusing the containing cell and back to the non-tabbable child element
|
|
4448
|
+
let activeElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
4449
|
+
if (next && (!(Text.$d4ee10de306f2510$export$b4f377a2b6254582)(next) || activeElement && !(Text.$b4b717babfbb907b$export$bebd5a1431fec25d)(activeElement))) (Text.$7215afc6de606d6b$export$de79e2c695e052f3)(next);
|
|
4299
4450
|
}
|
|
4300
4451
|
break;
|
|
4301
4452
|
}
|
|
@@ -4307,7 +4458,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4307
4458
|
top: 0,
|
|
4308
4459
|
left: 0
|
|
4309
4460
|
});
|
|
4310
|
-
(Text.$e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll',
|
|
4461
|
+
(Text.$e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', ()=>{
|
|
4311
4462
|
var _scrollRef_current, _scrollRef_current1;
|
|
4312
4463
|
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
4313
4464
|
scrollPos.current = {
|
|
@@ -4318,11 +4469,11 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4318
4469
|
let onFocus = (e)=>{
|
|
4319
4470
|
if (manager.isFocused) {
|
|
4320
4471
|
// If a focus event bubbled through a portal, reset focus state.
|
|
4321
|
-
if (!e.currentTarget
|
|
4472
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) manager.setFocused(false);
|
|
4322
4473
|
return;
|
|
4323
4474
|
}
|
|
4324
4475
|
// Focus events can bubble through portals. Ignore these events.
|
|
4325
|
-
if (!e.currentTarget
|
|
4476
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
4326
4477
|
manager.setFocused(true);
|
|
4327
4478
|
if (manager.focusedKey == null) {
|
|
4328
4479
|
var _delegate_getLastKey, _delegate_getFirstKey;
|
|
@@ -4339,7 +4490,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4339
4490
|
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
4340
4491
|
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));
|
|
4341
4492
|
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));
|
|
4342
|
-
} else if (
|
|
4493
|
+
} else if (scrollRef.current) {
|
|
4343
4494
|
// Restore the scroll position to what it was before.
|
|
4344
4495
|
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
4345
4496
|
scrollRef.current.scrollLeft = scrollPos.current.left;
|
|
@@ -4349,7 +4500,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4349
4500
|
let element = ($feb5ffebff200149$export$c3d8340acf92597f)(ref, manager.focusedKey);
|
|
4350
4501
|
if (element instanceof HTMLElement) {
|
|
4351
4502
|
// This prevents a flash of focus on the first/last element in the collection, or the collection itself.
|
|
4352
|
-
if (!
|
|
4503
|
+
if (!(Text.$d4ee10de306f2510$export$b4f377a2b6254582)(element) && !shouldUseVirtualFocus) (Text.$7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
4353
4504
|
let modality = (Text.$507fabe10e71c6fb$export$630ff653c5ada6a9)();
|
|
4354
4505
|
if (modality === 'keyboard') ($2f04cbc44ee30ce0$export$c826860796309d1b)(element, {
|
|
4355
4506
|
containingElement: ref.current
|
|
@@ -4359,7 +4510,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4359
4510
|
};
|
|
4360
4511
|
let onBlur = (e)=>{
|
|
4361
4512
|
// Don't set blurred and then focused again if moving focus within the collection.
|
|
4362
|
-
if (!e.currentTarget
|
|
4513
|
+
if (!(Text.$d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
|
|
4363
4514
|
};
|
|
4364
4515
|
// Ref to track whether the first item in the collection should be automatically focused. Specifically used for autocomplete when user types
|
|
4365
4516
|
// to focus the first key AFTER the collection updates.
|
|
@@ -4375,44 +4526,40 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4375
4526
|
// If the user is typing forwards, autofocus the first option in the list.
|
|
4376
4527
|
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === 'first') shouldVirtualFocusFirst.current = true;
|
|
4377
4528
|
});
|
|
4378
|
-
|
|
4379
|
-
var _delegate_getFirstKey;
|
|
4380
|
-
var _delegate_getFirstKey1;
|
|
4381
|
-
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;
|
|
4382
|
-
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
4383
|
-
// the original active element (e.g. the autocomplete input)
|
|
4384
|
-
if (keyToFocus == null) {
|
|
4385
|
-
let previousActiveElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
4386
|
-
($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
4387
|
-
($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
|
|
4388
|
-
// 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.
|
|
4389
|
-
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
4390
|
-
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
4391
|
-
} else {
|
|
4392
|
-
manager.setFocusedKey(keyToFocus);
|
|
4393
|
-
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
4394
|
-
// 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
|
|
4395
|
-
// after the collection updates after load
|
|
4396
|
-
shouldVirtualFocusFirst.current = false;
|
|
4397
|
-
}
|
|
4398
|
-
});
|
|
4529
|
+
// update active descendant
|
|
4399
4530
|
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4400
|
-
if (shouldVirtualFocusFirst.current)
|
|
4531
|
+
if (shouldVirtualFocusFirst.current) {
|
|
4532
|
+
var _delegate_getFirstKey;
|
|
4533
|
+
var _delegate_getFirstKey1;
|
|
4534
|
+
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;
|
|
4535
|
+
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
4536
|
+
// the original active element (e.g. the autocomplete input)
|
|
4537
|
+
if (keyToFocus == null) {
|
|
4538
|
+
let previousActiveElement = (Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
4539
|
+
($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
4540
|
+
($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
|
|
4541
|
+
// 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.
|
|
4542
|
+
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
4543
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
4544
|
+
} else {
|
|
4545
|
+
manager.setFocusedKey(keyToFocus);
|
|
4546
|
+
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
4547
|
+
// 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
|
|
4548
|
+
// after the collection updates after load
|
|
4549
|
+
shouldVirtualFocusFirst.current = false;
|
|
4550
|
+
}
|
|
4551
|
+
}
|
|
4401
4552
|
}, [
|
|
4402
|
-
manager.collection
|
|
4403
|
-
updateActiveDescendant
|
|
4553
|
+
manager.collection
|
|
4404
4554
|
]);
|
|
4405
|
-
|
|
4555
|
+
// reset focus first flag
|
|
4556
|
+
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4406
4557
|
// If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't
|
|
4407
4558
|
// accidentally move focus from under them. Skip this if the collection was empty because we might be in a load
|
|
4408
4559
|
// state and will still want to focus the first item after load
|
|
4409
4560
|
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
4410
|
-
});
|
|
4411
|
-
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4412
|
-
resetFocusFirstFlag();
|
|
4413
4561
|
}, [
|
|
4414
|
-
manager.focusedKey
|
|
4415
|
-
resetFocusFirstFlag
|
|
4562
|
+
manager.focusedKey
|
|
4416
4563
|
]);
|
|
4417
4564
|
(Text.$e9faafb641e167db$export$90fc3a17d93f704c)(ref, ($5671b20cf9b562b2$export$447a38995de2c711), !shouldUseVirtualFocus ? undefined : (e)=>{
|
|
4418
4565
|
var _e_detail;
|
|
@@ -4494,7 +4641,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4494
4641
|
onBlur: onBlur,
|
|
4495
4642
|
onMouseDown (e) {
|
|
4496
4643
|
// Ignore events that bubbled through portals.
|
|
4497
|
-
if (scrollRef.current === e
|
|
4644
|
+
if (scrollRef.current === (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) // Prevent focus going to the collection when clicking on the scrollbar.
|
|
4498
4645
|
e.preventDefault();
|
|
4499
4646
|
}
|
|
4500
4647
|
};
|
|
@@ -4533,7 +4680,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4533
4680
|
|
|
4534
4681
|
function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
4535
4682
|
let { id: id, selectionManager: manager, key: key, ref: ref, shouldSelectOnPressUp: shouldSelectOnPressUp, shouldUseVirtualFocus: shouldUseVirtualFocus, focus: focus, isDisabled: isDisabled, onAction: onAction, allowsDifferentPressOrigin: allowsDifferentPressOrigin, linkBehavior: linkBehavior = 'action' } = options;
|
|
4536
|
-
let router = (
|
|
4683
|
+
let router = (Text.$ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
|
|
4537
4684
|
id = (Text.$bdb11010cef70236$export$f680877a34711e37)(id);
|
|
4538
4685
|
let onSelect = (e)=>{
|
|
4539
4686
|
if (e.pointerType === 'keyboard' && ($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) manager.toggleSelection(key);
|
|
@@ -4566,7 +4713,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4566
4713
|
if (isFocused && manager.isFocused) {
|
|
4567
4714
|
if (!shouldUseVirtualFocus) {
|
|
4568
4715
|
if (focus) focus();
|
|
4569
|
-
else if (
|
|
4716
|
+
else if ((Text.$d4ee10de306f2510$export$cd4e5573fbe2b576)() !== ref.current && ref.current) (Text.$3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
|
|
4570
4717
|
} else ($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
4571
4718
|
}
|
|
4572
4719
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -4586,20 +4733,28 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4586
4733
|
if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
|
|
4587
4734
|
tabIndex: key === manager.focusedKey ? 0 : -1,
|
|
4588
4735
|
onFocus (e) {
|
|
4589
|
-
if (e
|
|
4736
|
+
if ((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === ref.current) manager.setFocusedKey(key);
|
|
4590
4737
|
}
|
|
4591
4738
|
};
|
|
4592
4739
|
else if (isDisabled) itemProps.onMouseDown = (e)=>{
|
|
4593
4740
|
// Prevent focus going to the body when clicking on a disabled item.
|
|
4594
4741
|
e.preventDefault();
|
|
4595
4742
|
};
|
|
4743
|
+
(React.useEffect)(()=>{
|
|
4744
|
+
if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
|
|
4745
|
+
}, [
|
|
4746
|
+
manager,
|
|
4747
|
+
isDisabled,
|
|
4748
|
+
key
|
|
4749
|
+
]);
|
|
4596
4750
|
// With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
|
|
4597
4751
|
// Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
|
|
4598
4752
|
// With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
|
|
4599
4753
|
// With touch, onAction occurs on single tap, and long press enters selection mode.
|
|
4600
4754
|
let isLinkOverride = manager.isLink(key) && linkBehavior === 'override';
|
|
4755
|
+
let isActionOverride = onAction && options['UNSTABLE_itemBehavior'] === 'action';
|
|
4601
4756
|
let hasLinkAction = manager.isLink(key) && linkBehavior !== 'selection' && linkBehavior !== 'none';
|
|
4602
|
-
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
|
|
4757
|
+
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
|
|
4603
4758
|
let allowsActions = (onAction || hasLinkAction) && !isDisabled;
|
|
4604
4759
|
let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : !allowsSelection || manager.isEmpty);
|
|
4605
4760
|
let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
|
|
@@ -4610,7 +4765,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4610
4765
|
let hadPrimaryActionOnPressStart = (React.useRef)(false);
|
|
4611
4766
|
let collectionItemProps = manager.getItemProps(key);
|
|
4612
4767
|
let performAction = (e)=>{
|
|
4613
|
-
if (onAction)
|
|
4768
|
+
if (onAction) {
|
|
4769
|
+
var _ref_current;
|
|
4770
|
+
onAction();
|
|
4771
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent('react-aria-item-action', {
|
|
4772
|
+
bubbles: true
|
|
4773
|
+
}));
|
|
4774
|
+
}
|
|
4614
4775
|
if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
|
|
4615
4776
|
};
|
|
4616
4777
|
// By default, selection occurs on pointer down. This can be strange if selecting an
|
|
@@ -4627,13 +4788,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4627
4788
|
itemPressProps.onPressStart = (e)=>{
|
|
4628
4789
|
modality.current = e.pointerType;
|
|
4629
4790
|
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
4630
|
-
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
|
|
4791
|
+
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey(e.key))) onSelect(e);
|
|
4631
4792
|
};
|
|
4632
4793
|
// If allowsDifferentPressOrigin and interacting with mouse, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
|
|
4633
4794
|
// Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
|
|
4634
4795
|
if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
|
|
4635
4796
|
if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
|
|
4636
|
-
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
|
|
4797
|
+
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey(e.key)) return;
|
|
4637
4798
|
performAction(e);
|
|
4638
4799
|
} else if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
|
|
4639
4800
|
};
|
|
@@ -4653,13 +4814,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4653
4814
|
// Select on mouse down unless there is a primary action which will occur on mouse up.
|
|
4654
4815
|
// For keyboard, select on key down. If there is an action, the Space key selects on key down,
|
|
4655
4816
|
// and the Enter key performs onAction on key up.
|
|
4656
|
-
if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
|
|
4817
|
+
if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey(e.key)))) onSelect(e);
|
|
4657
4818
|
};
|
|
4658
4819
|
itemPressProps.onPress = (e)=>{
|
|
4659
4820
|
// Selection occurs on touch up. Primary actions always occur on pointer up.
|
|
4660
4821
|
// Both primary and secondary actions occur on Enter key up. The only exception
|
|
4661
4822
|
// is secondary actions, which occur on double click with a mouse.
|
|
4662
|
-
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
|
|
4823
|
+
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey(e.key) || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
|
|
4663
4824
|
if (hasAction) performAction(e);
|
|
4664
4825
|
else if (allowsSelection) onSelect(e);
|
|
4665
4826
|
}
|
|
@@ -4724,7 +4885,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4724
4885
|
// Prevent default on link clicks so that we control exactly
|
|
4725
4886
|
// when they open (to match selection behavior).
|
|
4726
4887
|
let onClick = linkBehavior !== 'none' && manager.isLink(key) ? (e)=>{
|
|
4727
|
-
if (!(
|
|
4888
|
+
if (!(Text.$ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) e.preventDefault();
|
|
4728
4889
|
} : undefined;
|
|
4729
4890
|
return {
|
|
4730
4891
|
itemProps: (Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(itemProps, allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
|
|
@@ -4744,13 +4905,11 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4744
4905
|
hasAction: hasAction
|
|
4745
4906
|
};
|
|
4746
4907
|
}
|
|
4747
|
-
function $880e95eb8b93ba9a$var$isActionKey() {
|
|
4748
|
-
|
|
4749
|
-
return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
|
|
4908
|
+
function $880e95eb8b93ba9a$var$isActionKey(key) {
|
|
4909
|
+
return key === 'Enter';
|
|
4750
4910
|
}
|
|
4751
|
-
function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
4752
|
-
|
|
4753
|
-
return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
|
|
4911
|
+
function $880e95eb8b93ba9a$var$isSelectionKey(key) {
|
|
4912
|
+
return key === ' ';
|
|
4754
4913
|
}
|
|
4755
4914
|
|
|
4756
4915
|
/*
|
|
@@ -4773,8 +4932,8 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
4773
4932
|
let containerRect = container.getBoundingClientRect();
|
|
4774
4933
|
let itemRect = item.getBoundingClientRect();
|
|
4775
4934
|
return {
|
|
4776
|
-
x: itemRect.left - containerRect.left + container.scrollLeft,
|
|
4777
|
-
y: itemRect.top - containerRect.top + container.scrollTop,
|
|
4935
|
+
x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
|
|
4936
|
+
y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
|
|
4778
4937
|
width: itemRect.width,
|
|
4779
4938
|
height: itemRect.height
|
|
4780
4939
|
};
|
|
@@ -4789,12 +4948,12 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
4789
4948
|
}
|
|
4790
4949
|
getVisibleRect() {
|
|
4791
4950
|
let container = this.ref.current;
|
|
4792
|
-
var _container_scrollLeft, _container_scrollTop,
|
|
4951
|
+
var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
|
|
4793
4952
|
return {
|
|
4794
4953
|
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
4795
4954
|
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
4796
|
-
width: (
|
|
4797
|
-
height: (
|
|
4955
|
+
width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
|
|
4956
|
+
height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
|
|
4798
4957
|
};
|
|
4799
4958
|
}
|
|
4800
4959
|
constructor(ref){
|
|
@@ -5441,7 +5600,7 @@ $a89a74a39eba465a$exports = {
|
|
|
5441
5600
|
|
|
5442
5601
|
var $edc7c66594a0ae8a$exports = {};
|
|
5443
5602
|
$edc7c66594a0ae8a$exports = {
|
|
5444
|
-
"longPressMessage": `
|
|
5603
|
+
"longPressMessage": `Premi a lungo o premi Alt + Freccia gi\xf9 per aprire il menu`
|
|
5445
5604
|
};
|
|
5446
5605
|
|
|
5447
5606
|
var $f1ab51510712db52$exports = {};
|
|
@@ -5791,7 +5950,7 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
|
5791
5950
|
|
|
5792
5951
|
|
|
5793
5952
|
function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
5794
|
-
let { id: id, key: key, closeOnSelect: closeOnSelect, isVirtualized: isVirtualized, 'aria-haspopup': hasPopup, onPressStart: onPressStart, onPressUp: pressUpProp, onPress: onPress, onPressChange: pressChangeProp, onPressEnd: onPressEnd, onClick: onClickProp, onHoverStart: hoverStartProp, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onFocus: onFocus, onFocusChange: onFocusChange, onBlur: onBlur, selectionManager: selectionManager = state.selectionManager } = props;
|
|
5953
|
+
let { id: id, key: key, closeOnSelect: closeOnSelect, shouldCloseOnSelect: shouldCloseOnSelect, isVirtualized: isVirtualized, 'aria-haspopup': hasPopup, onPressStart: onPressStart, onPressUp: pressUpProp, onPress: onPress, onPressChange: pressChangeProp, onPressEnd: onPressEnd, onClick: onClickProp, onHoverStart: hoverStartProp, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onFocus: onFocus, onFocusChange: onFocusChange, onBlur: onBlur, selectionManager: selectionManager = state.selectionManager } = props;
|
|
5795
5954
|
let isTrigger = !!hasPopup;
|
|
5796
5955
|
let isTriggerExpanded = isTrigger && props['aria-expanded'] === 'true';
|
|
5797
5956
|
var _props_isDisabled;
|
|
@@ -5801,7 +5960,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5801
5960
|
let data = ($fc79756100351201$export$6f49b4016bfc8d56).get(state);
|
|
5802
5961
|
let item = state.collection.getItem(key);
|
|
5803
5962
|
let onClose = props.onClose || data.onClose;
|
|
5804
|
-
let router = (
|
|
5963
|
+
let router = (Text.$ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
|
|
5805
5964
|
let performAction = ()=>{
|
|
5806
5965
|
var _item_props;
|
|
5807
5966
|
if (isTrigger) return;
|
|
@@ -5828,6 +5987,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5828
5987
|
'aria-label': props['aria-label'],
|
|
5829
5988
|
'aria-labelledby': labelId,
|
|
5830
5989
|
'aria-describedby': [
|
|
5990
|
+
props['aria-describedby'],
|
|
5831
5991
|
descriptionId,
|
|
5832
5992
|
keyboardId
|
|
5833
5993
|
].filter(Boolean).join(' ') || undefined,
|
|
@@ -5837,7 +5997,8 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5837
5997
|
};
|
|
5838
5998
|
if (selectionManager.selectionMode !== 'none' && !isTrigger) ariaProps['aria-checked'] = isSelected;
|
|
5839
5999
|
if (isVirtualized) {
|
|
5840
|
-
|
|
6000
|
+
let index = Number(item === null || item === void 0 ? void 0 : item.index);
|
|
6001
|
+
ariaProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
|
|
5841
6002
|
ariaProps['aria-setsize'] = ($453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
|
|
5842
6003
|
}
|
|
5843
6004
|
let isPressedRef = (React.useRef)(false);
|
|
@@ -5861,9 +6022,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5861
6022
|
var _interaction_current, _interaction_current1;
|
|
5862
6023
|
onClickProp === null || onClickProp === void 0 ? void 0 : onClickProp(e);
|
|
5863
6024
|
performAction();
|
|
5864
|
-
(
|
|
6025
|
+
(Text.$ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f)(e, router, item.props.href, item === null || item === void 0 ? void 0 : item.props.routerOptions);
|
|
5865
6026
|
let shouldClose = ((_interaction_current = interaction.current) === null || _interaction_current === void 0 ? void 0 : _interaction_current.pointerType) === 'keyboard' ? ((_interaction_current1 = interaction.current) === null || _interaction_current1 === void 0 ? void 0 : _interaction_current1.key) === 'Enter' || selectionManager.selectionMode === 'none' || selectionManager.isLink(key) : selectionManager.selectionMode !== 'multiple' || selectionManager.isLink(key);
|
|
5866
|
-
|
|
6027
|
+
var _ref;
|
|
6028
|
+
shouldClose = (_ref = shouldCloseOnSelect !== null && shouldCloseOnSelect !== void 0 ? shouldCloseOnSelect : closeOnSelect) !== null && _ref !== void 0 ? _ref : shouldClose;
|
|
5867
6029
|
if (onClose && !isTrigger && shouldClose) onClose();
|
|
5868
6030
|
interaction.current = null;
|
|
5869
6031
|
};
|
|
@@ -5916,7 +6078,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5916
6078
|
pointerType: 'keyboard',
|
|
5917
6079
|
key: ' '
|
|
5918
6080
|
};
|
|
5919
|
-
e.
|
|
6081
|
+
(Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e).click();
|
|
6082
|
+
// click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
|
|
6083
|
+
// to the newly opened submenu's first item.
|
|
6084
|
+
(Text.$507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5920
6085
|
break;
|
|
5921
6086
|
case 'Enter':
|
|
5922
6087
|
interaction.current = {
|
|
@@ -5924,7 +6089,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5924
6089
|
key: 'Enter'
|
|
5925
6090
|
};
|
|
5926
6091
|
// Trigger click unless this is a link. Links trigger click natively.
|
|
5927
|
-
if (e.
|
|
6092
|
+
if ((Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e).tagName !== 'A') (Text.$d4ee10de306f2510$export$e58f029f0fbfdb29)(e).click();
|
|
6093
|
+
// click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
|
|
6094
|
+
// to the newly opened submenu's first item.
|
|
6095
|
+
(Text.$507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5928
6096
|
break;
|
|
5929
6097
|
default:
|
|
5930
6098
|
if (!isTrigger) e.continuePropagation();
|
|
@@ -5934,14 +6102,14 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5934
6102
|
},
|
|
5935
6103
|
onKeyUp: onKeyUp
|
|
5936
6104
|
});
|
|
5937
|
-
let {
|
|
6105
|
+
let { focusableProps: focusableProps } = (Text.$f645667febf57a63$export$4c014de7c8940b4c)({
|
|
5938
6106
|
onBlur: onBlur,
|
|
5939
6107
|
onFocus: onFocus,
|
|
5940
6108
|
onFocusChange: onFocusChange
|
|
5941
|
-
});
|
|
6109
|
+
}, ref);
|
|
5942
6110
|
let domProps = (Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item === void 0 ? void 0 : item.props);
|
|
5943
6111
|
delete domProps.id;
|
|
5944
|
-
let linkProps = (
|
|
6112
|
+
let linkProps = (Text.$ea8dcbcb9ea1b556$export$7e924b3091a3bd18)(item === null || item === void 0 ? void 0 : item.props);
|
|
5945
6113
|
return {
|
|
5946
6114
|
menuItemProps: {
|
|
5947
6115
|
...ariaProps,
|
|
@@ -5949,7 +6117,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5949
6117
|
onFocus: itemProps.onFocus,
|
|
5950
6118
|
'data-collection': itemProps['data-collection'],
|
|
5951
6119
|
'data-key': itemProps['data-key']
|
|
5952
|
-
} : itemProps, pressProps, hoverProps, keyboardProps,
|
|
6120
|
+
} : itemProps, pressProps, hoverProps, keyboardProps, focusableProps, // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
|
|
5953
6121
|
data.shouldUseVirtualFocus || isTrigger ? {
|
|
5954
6122
|
onMouseDown: (e)=>e.preventDefault()
|
|
5955
6123
|
} : undefined, isDisabled ? undefined : {
|
|
@@ -6371,7 +6539,7 @@ function $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, firstCh
|
|
|
6371
6539
|
if (this.isConnected) this.ownerDocument.queueUpdate();
|
|
6372
6540
|
}
|
|
6373
6541
|
removeChild(child) {
|
|
6374
|
-
if (child.parentNode !== this
|
|
6542
|
+
if (child.parentNode !== this) return;
|
|
6375
6543
|
if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
|
|
6376
6544
|
if (child.nextSibling) {
|
|
6377
6545
|
this.invalidateChildIndices(child.nextSibling);
|
|
@@ -6428,8 +6596,8 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
6428
6596
|
this.ownerDocument.markDirty(this);
|
|
6429
6597
|
}
|
|
6430
6598
|
get level() {
|
|
6431
|
-
var
|
|
6432
|
-
if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((
|
|
6599
|
+
var _this_parentNode_node;
|
|
6600
|
+
if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node === void 0 ? void 0 : _this_parentNode_node.type) === 'item' ? 1 : 0);
|
|
6433
6601
|
return 0;
|
|
6434
6602
|
}
|
|
6435
6603
|
/**
|
|
@@ -6485,6 +6653,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
6485
6653
|
node.rendered = rendered;
|
|
6486
6654
|
node.render = render;
|
|
6487
6655
|
node.value = value1;
|
|
6656
|
+
if (obj['aria-label']) node['aria-label'] = obj['aria-label'];
|
|
6488
6657
|
node.textValue = textValue || (typeof props.children === 'string' ? props.children : '') || obj['aria-label'] || '';
|
|
6489
6658
|
if (id != null && id !== node.key) throw new Error('Cannot change the id of an item');
|
|
6490
6659
|
if (props.colSpan != null) node.colSpan = props.colSpan;
|
|
@@ -6530,7 +6699,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
6530
6699
|
}
|
|
6531
6700
|
class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export$410b0c854570d131 {
|
|
6532
6701
|
get isConnected() {
|
|
6533
|
-
return
|
|
6702
|
+
return true;
|
|
6534
6703
|
}
|
|
6535
6704
|
createElement(type) {
|
|
6536
6705
|
return new $681cc3c98f569e39$export$dc064fe9e59310fd(type, this);
|
|
@@ -6549,17 +6718,16 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
6549
6718
|
collection.addNode(element.node);
|
|
6550
6719
|
}
|
|
6551
6720
|
removeNode(node) {
|
|
6552
|
-
if (node.node == null) return;
|
|
6553
6721
|
for (let child of node)this.removeNode(child);
|
|
6554
|
-
|
|
6555
|
-
|
|
6722
|
+
if (node.node) {
|
|
6723
|
+
let collection = this.getMutableCollection();
|
|
6724
|
+
collection.removeNode(node.node.key);
|
|
6725
|
+
}
|
|
6556
6726
|
}
|
|
6557
6727
|
/** Finalizes the collection update, updating all nodes and freezing the collection. */ getCollection() {
|
|
6558
|
-
// If in a subscription update, return
|
|
6559
|
-
//
|
|
6560
|
-
|
|
6561
|
-
// the new collection.
|
|
6562
|
-
if (this.inSubscription) return this.collection.clone();
|
|
6728
|
+
// If in a subscription update, return return the existing collection.
|
|
6729
|
+
// React will call getCollection again during render, at which point all the updates will be complete.
|
|
6730
|
+
if (this.inSubscription) return this.collection;
|
|
6563
6731
|
// Reset queuedRender to false when getCollection is called during render.
|
|
6564
6732
|
this.queuedRender = false;
|
|
6565
6733
|
this.updateCollection();
|
|
@@ -6575,9 +6743,9 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
6575
6743
|
element.updateNode();
|
|
6576
6744
|
this.addNode(element);
|
|
6577
6745
|
}
|
|
6746
|
+
if (element.node) this.dirtyNodes.delete(element);
|
|
6578
6747
|
element.isMutated = false;
|
|
6579
|
-
}
|
|
6580
|
-
this.dirtyNodes.clear();
|
|
6748
|
+
} else this.dirtyNodes.delete(element);
|
|
6581
6749
|
// Finally, update the collection.
|
|
6582
6750
|
if (this.nextCollection) {
|
|
6583
6751
|
var _this_firstVisibleChild_node, _this_firstVisibleChild, _this_lastVisibleChild_node, _this_lastVisibleChild;
|
|
@@ -6598,6 +6766,10 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
6598
6766
|
// we reset queuedRender back to false.
|
|
6599
6767
|
this.queuedRender = true;
|
|
6600
6768
|
this.inSubscription = true;
|
|
6769
|
+
// Clone the collection to ensure that React queues a render. It will call getCollection again
|
|
6770
|
+
// during render, at which point all the updates will be complete and we can return
|
|
6771
|
+
// the new collection.
|
|
6772
|
+
if (!this.isSSR) this.collection = this.collection.clone();
|
|
6601
6773
|
for (let fn of this.subscriptions)fn();
|
|
6602
6774
|
this.inSubscription = false;
|
|
6603
6775
|
}
|
|
@@ -6616,7 +6788,7 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
6616
6788
|
constructor(collection){
|
|
6617
6789
|
// @ts-ignore
|
|
6618
6790
|
super(null), this.nodeType = 11 // DOCUMENT_FRAGMENT_NODE
|
|
6619
|
-
, this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.
|
|
6791
|
+
, this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
|
|
6620
6792
|
this.collection = collection;
|
|
6621
6793
|
this.nextCollection = collection;
|
|
6622
6794
|
}
|
|
@@ -6649,7 +6821,7 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
6649
6821
|
// @ts-ignore
|
|
6650
6822
|
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;
|
|
6651
6823
|
if (key == null) throw new Error('Could not determine key for item');
|
|
6652
|
-
if (idScope) key = idScope + ':' + key;
|
|
6824
|
+
if (idScope != null) key = idScope + ':' + key;
|
|
6653
6825
|
// Note: only works if wrapped Item passes through id...
|
|
6654
6826
|
rendered = (React.cloneElement)(rendered, addIdAndValue ? {
|
|
6655
6827
|
key: key,
|
|
@@ -6692,7 +6864,6 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
6692
6864
|
|
|
6693
6865
|
|
|
6694
6866
|
|
|
6695
|
-
|
|
6696
6867
|
const $e1995378a142960e$var$ShallowRenderContext = /*#__PURE__*/ (React.createContext)(false);
|
|
6697
6868
|
const $e1995378a142960e$var$CollectionDocumentContext = /*#__PURE__*/ (React.createContext)(null);
|
|
6698
6869
|
function $e1995378a142960e$export$bf788dd355e3a401(props) {
|
|
@@ -6762,16 +6933,6 @@ function $e1995378a142960e$var$useCollectionDocument(createCollection) {
|
|
|
6762
6933
|
document
|
|
6763
6934
|
]);
|
|
6764
6935
|
let collection = $e1995378a142960e$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
6765
|
-
(Text.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
6766
|
-
document.isMounted = true;
|
|
6767
|
-
return ()=>{
|
|
6768
|
-
// Mark unmounted so we can skip all of the collection updates caused by
|
|
6769
|
-
// React calling removeChild on every item in the collection.
|
|
6770
|
-
document.isMounted = false;
|
|
6771
|
-
};
|
|
6772
|
-
}, [
|
|
6773
|
-
document
|
|
6774
|
-
]);
|
|
6775
6936
|
return {
|
|
6776
6937
|
collection: collection,
|
|
6777
6938
|
document: document
|
|
@@ -6864,7 +7025,8 @@ const $e1995378a142960e$var$CollectionContext = /*#__PURE__*/ (React.createConte
|
|
|
6864
7025
|
function $e1995378a142960e$export$fb8073518f34e6ec(props) {
|
|
6865
7026
|
let ctx = (React.useContext)($e1995378a142960e$var$CollectionContext);
|
|
6866
7027
|
let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
|
|
6867
|
-
|
|
7028
|
+
var _props_idScope;
|
|
7029
|
+
let idScope = (_props_idScope = props.idScope) !== null && _props_idScope !== void 0 ? _props_idScope : ctx === null || ctx === void 0 ? void 0 : ctx.idScope;
|
|
6868
7030
|
let children = $e1995378a142960e$var$useCollectionChildren({
|
|
6869
7031
|
...props,
|
|
6870
7032
|
idScope: idScope,
|
|
@@ -6928,6 +7090,9 @@ function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDro
|
|
|
6928
7090
|
renderDropIndicator
|
|
6929
7091
|
],
|
|
6930
7092
|
children (node) {
|
|
7093
|
+
// Return a empty fragment since we don't want to render the content twice
|
|
7094
|
+
// If we don't skip the content node here, we end up rendering them twice in a Tree since we also render the content node in TreeItem
|
|
7095
|
+
if (node.type === 'content') return /*#__PURE__*/ (React).createElement((React).Fragment, null);
|
|
6931
7096
|
let rendered = node.render(node);
|
|
6932
7097
|
if (!renderDropIndicator || node.type !== 'item') return rendered;
|
|
6933
7098
|
return /*#__PURE__*/ (React).createElement((React).Fragment, null, renderDropIndicator({
|
|
@@ -6954,7 +7119,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
|
|
|
6954
7119
|
let afterIndicators = [];
|
|
6955
7120
|
if (nextItemInSameLevel == null) {
|
|
6956
7121
|
let current = node;
|
|
6957
|
-
while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
|
|
7122
|
+
while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
|
|
6958
7123
|
let indicator = renderDropIndicator({
|
|
6959
7124
|
type: 'item',
|
|
6960
7125
|
key: current.key,
|
|
@@ -7676,13 +7841,53 @@ function $875d6693e12af071$var$toggleKey(set, key) {
|
|
|
7676
7841
|
const $72a5793c14baf454$export$e0e4026c12a8bdbb = /*#__PURE__*/ (React.createContext)({});
|
|
7677
7842
|
const $72a5793c14baf454$export$8b251419efc915eb = /*#__PURE__*/ ($e1995378a142960e$export$18af5c7a9e9b3664)(($23b9f4fcf0fe224b$export$5ae2504e948afce5), function Header(props, ref) {
|
|
7678
7843
|
[props, ref] = (Text.$64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $72a5793c14baf454$export$e0e4026c12a8bdbb);
|
|
7679
|
-
return /*#__PURE__*/ (React).createElement(
|
|
7844
|
+
return /*#__PURE__*/ (React).createElement((Text.$64fa3d84918910a7$export$df3a06d6289f983e).header, {
|
|
7680
7845
|
className: "react-aria-Header",
|
|
7681
7846
|
...props,
|
|
7682
7847
|
ref: ref
|
|
7683
7848
|
}, props.children);
|
|
7684
7849
|
});
|
|
7685
7850
|
|
|
7851
|
+
/*
|
|
7852
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
7853
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7854
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7855
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7856
|
+
*
|
|
7857
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
7858
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
7859
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
7860
|
+
* governing permissions and limitations under the License.
|
|
7861
|
+
*/
|
|
7862
|
+
|
|
7863
|
+
|
|
7864
|
+
|
|
7865
|
+
|
|
7866
|
+
const $c8a5a149f625efcf$var$SharedElementContext = /*#__PURE__*/ (React.createContext)(null);
|
|
7867
|
+
function $c8a5a149f625efcf$export$758399f318e6385a(props) {
|
|
7868
|
+
let ref = (React.useRef)({});
|
|
7869
|
+
return /*#__PURE__*/ (React).createElement($c8a5a149f625efcf$var$SharedElementContext.Provider, {
|
|
7870
|
+
value: ref
|
|
7871
|
+
}, props.children);
|
|
7872
|
+
}
|
|
7873
|
+
|
|
7874
|
+
/*
|
|
7875
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
7876
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7877
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7878
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7879
|
+
*
|
|
7880
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
7881
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
7882
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
7883
|
+
* governing permissions and limitations under the License.
|
|
7884
|
+
*/
|
|
7885
|
+
|
|
7886
|
+
|
|
7887
|
+
const $1d5b8b8664671ef2$export$c9549807523555e0 = /*#__PURE__*/ (React.createContext)({
|
|
7888
|
+
isSelected: false
|
|
7889
|
+
});
|
|
7890
|
+
|
|
7686
7891
|
/*
|
|
7687
7892
|
* Copyright 2022 Adobe. All rights reserved.
|
|
7688
7893
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -7716,6 +7921,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ ($e1995378a14296
|
|
|
7716
7921
|
let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
|
|
7717
7922
|
let Element = elementType || 'hr';
|
|
7718
7923
|
if (Element === 'hr' && orientation === 'vertical') Element = 'div';
|
|
7924
|
+
let ElementType = (Text.$64fa3d84918910a7$export$df3a06d6289f983e)[Element];
|
|
7719
7925
|
let { separatorProps: separatorProps } = ($f4b273590fab9f93$export$52210f68a14655d0)({
|
|
7720
7926
|
...otherProps,
|
|
7721
7927
|
elementType: elementType,
|
|
@@ -7724,7 +7930,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ ($e1995378a14296
|
|
|
7724
7930
|
let DOMProps = (Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
7725
7931
|
global: true
|
|
7726
7932
|
});
|
|
7727
|
-
return /*#__PURE__*/ (React).createElement(
|
|
7933
|
+
return /*#__PURE__*/ (React).createElement(ElementType, {
|
|
7934
|
+
render: props.render,
|
|
7728
7935
|
...(Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, separatorProps),
|
|
7729
7936
|
style: style,
|
|
7730
7937
|
className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
|
|
@@ -7843,7 +8050,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
7843
8050
|
// Focus the popover itself on mount, unless a child element is already focused.
|
|
7844
8051
|
// Skip this for submenus since hovering a submenutrigger should keep focus on the trigger
|
|
7845
8052
|
(React.useEffect)(()=>{
|
|
7846
|
-
if (isDialog && props.trigger !== 'SubmenuTrigger' && ref.current && !ref.current
|
|
8053
|
+
if (isDialog && (props.trigger !== 'SubmenuTrigger' || (Text.$507fabe10e71c6fb$export$630ff653c5ada6a9)() !== 'pointer') && ref.current && !(Text.$d4ee10de306f2510$export$b4f377a2b6254582)(ref.current)) (Text.$3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
|
|
7847
8054
|
}, [
|
|
7848
8055
|
isDialog,
|
|
7849
8056
|
ref,
|
|
@@ -7864,7 +8071,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
7864
8071
|
'--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,
|
|
7865
8072
|
...renderProps.style
|
|
7866
8073
|
};
|
|
7867
|
-
let overlay = /*#__PURE__*/ (React).createElement(
|
|
8074
|
+
let overlay = /*#__PURE__*/ (React).createElement((Text.$64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
7868
8075
|
...(Text.$3ef42575df84b30b$export$9d1611c77c2fe928)((Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
7869
8076
|
global: true
|
|
7870
8077
|
}), popoverProps),
|
|
@@ -7963,6 +8170,8 @@ const $63df2425e2108aa8$export$744d98a3b8a94e1c = /*#__PURE__*/ (React.createCon
|
|
|
7963
8170
|
|
|
7964
8171
|
|
|
7965
8172
|
|
|
8173
|
+
|
|
8174
|
+
|
|
7966
8175
|
const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (React.createContext)(null);
|
|
7967
8176
|
const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (React.createContext)(null);
|
|
7968
8177
|
const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (React.createContext)(null);
|
|
@@ -8048,7 +8257,7 @@ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (React.forwardRe
|
|
|
8048
8257
|
}));
|
|
8049
8258
|
});
|
|
8050
8259
|
function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
|
|
8051
|
-
[props, ref] = (Text.$64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, ($
|
|
8260
|
+
[props, ref] = (Text.$64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, ($4e85f108e88277b8$export$b0d3ecf7112093a7));
|
|
8052
8261
|
let { filter: filter, ...autocompleteMenuProps } = props;
|
|
8053
8262
|
let filteredCollection = (React.useMemo)(()=>filter ? collection.filter(filter) : collection, [
|
|
8054
8263
|
collection,
|
|
@@ -8067,9 +8276,9 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
8067
8276
|
onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
|
|
8068
8277
|
}, state, ref);
|
|
8069
8278
|
let renderProps = (Text.$64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
8279
|
+
...props,
|
|
8280
|
+
children: undefined,
|
|
8070
8281
|
defaultClassName: 'react-aria-Menu',
|
|
8071
|
-
className: props.className,
|
|
8072
|
-
style: props.style,
|
|
8073
8282
|
values: {
|
|
8074
8283
|
isEmpty: state.collection.size === 0
|
|
8075
8284
|
}
|
|
@@ -8084,7 +8293,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
8084
8293
|
let DOMProps = (Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
8085
8294
|
global: true
|
|
8086
8295
|
});
|
|
8087
|
-
return /*#__PURE__*/ (React).createElement(($9bf71ea28793e738$export$20e40289641fbbb6), null, /*#__PURE__*/ (React).createElement(
|
|
8296
|
+
return /*#__PURE__*/ (React).createElement(($9bf71ea28793e738$export$20e40289641fbbb6), null, /*#__PURE__*/ (React).createElement((Text.$64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
8088
8297
|
...(Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, menuProps),
|
|
8089
8298
|
ref: ref,
|
|
8090
8299
|
slot: props.slot || undefined,
|
|
@@ -8118,14 +8327,16 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
8118
8327
|
],
|
|
8119
8328
|
[
|
|
8120
8329
|
$3674c52c6b3c5bce$var$MenuItemContext,
|
|
8121
|
-
|
|
8330
|
+
{
|
|
8331
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect
|
|
8332
|
+
}
|
|
8122
8333
|
],
|
|
8123
8334
|
[
|
|
8124
|
-
($
|
|
8335
|
+
($4e85f108e88277b8$export$b0d3ecf7112093a7),
|
|
8125
8336
|
null
|
|
8126
8337
|
],
|
|
8127
8338
|
[
|
|
8128
|
-
($
|
|
8339
|
+
($4e85f108e88277b8$export$698f465ec27e93df),
|
|
8129
8340
|
null
|
|
8130
8341
|
],
|
|
8131
8342
|
[
|
|
@@ -8137,11 +8348,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
8137
8348
|
triggerState !== null && triggerState !== void 0 ? triggerState : ($a28c903ee9ad8dc5$export$79fefeb1c2091ac3)({})
|
|
8138
8349
|
]
|
|
8139
8350
|
]
|
|
8140
|
-
}, /*#__PURE__*/ (React).createElement(CollectionRoot, {
|
|
8351
|
+
}, /*#__PURE__*/ (React).createElement(($c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (React).createElement(CollectionRoot, {
|
|
8141
8352
|
collection: state.collection,
|
|
8142
8353
|
persistedKeys: ($7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
|
|
8143
8354
|
scrollRef: ref
|
|
8144
|
-
})), emptyState));
|
|
8355
|
+
}))), emptyState));
|
|
8145
8356
|
}
|
|
8146
8357
|
// A subclass of SelectionManager that forwards focus-related properties to the parent,
|
|
8147
8358
|
// but has its own local selection state.
|
|
@@ -8167,7 +8378,7 @@ class $3674c52c6b3c5bce$var$GroupSelectionManager extends ($d496c0a20b6e58ec$exp
|
|
|
8167
8378
|
}
|
|
8168
8379
|
}
|
|
8169
8380
|
function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className = 'react-aria-MenuSection') {
|
|
8170
|
-
var _section_props, _section_props1;
|
|
8381
|
+
var _section_props, _section_props1, _useSlottedContext;
|
|
8171
8382
|
let state = (React.useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
|
|
8172
8383
|
let { CollectionBranch: CollectionBranch } = (React.useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
8173
8384
|
let [headingRef, heading] = (Text.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
@@ -8177,19 +8388,24 @@ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className =
|
|
|
8177
8388
|
'aria-label': (_section_props_arialabel = section.props['aria-label']) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : undefined
|
|
8178
8389
|
});
|
|
8179
8390
|
let renderProps = (Text.$64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
8391
|
+
...props,
|
|
8392
|
+
id: undefined,
|
|
8393
|
+
children: undefined,
|
|
8180
8394
|
defaultClassName: className,
|
|
8181
8395
|
className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
|
|
8182
8396
|
style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
|
|
8183
|
-
values:
|
|
8397
|
+
values: undefined
|
|
8184
8398
|
});
|
|
8185
8399
|
let parent = (React.useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
|
|
8186
8400
|
let selectionState = ($7af3f5b51489e0b5$export$253fe78d46329472)(props);
|
|
8187
8401
|
let manager = props.selectionMode != null ? new $3674c52c6b3c5bce$var$GroupSelectionManager(parent, selectionState) : parent;
|
|
8402
|
+
let closeOnSelect = (_useSlottedContext = (Text.$64fa3d84918910a7$export$fabf2dc03a41866e)($3674c52c6b3c5bce$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.shouldCloseOnSelect;
|
|
8188
8403
|
let DOMProps = (Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
8189
8404
|
global: true
|
|
8190
8405
|
});
|
|
8191
8406
|
delete DOMProps.id;
|
|
8192
|
-
|
|
8407
|
+
var _props_shouldCloseOnSelect;
|
|
8408
|
+
return /*#__PURE__*/ (React).createElement((Text.$64fa3d84918910a7$export$df3a06d6289f983e).section, {
|
|
8193
8409
|
...(Text.$3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, groupProps),
|
|
8194
8410
|
ref: ref
|
|
8195
8411
|
}, /*#__PURE__*/ (React).createElement((Text.$64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
@@ -8204,6 +8420,12 @@ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className =
|
|
|
8204
8420
|
[
|
|
8205
8421
|
$3674c52c6b3c5bce$var$SelectionManagerContext,
|
|
8206
8422
|
manager
|
|
8423
|
+
],
|
|
8424
|
+
[
|
|
8425
|
+
$3674c52c6b3c5bce$var$MenuItemContext,
|
|
8426
|
+
{
|
|
8427
|
+
shouldCloseOnSelect: (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : closeOnSelect
|
|
8428
|
+
}
|
|
8207
8429
|
]
|
|
8208
8430
|
]
|
|
8209
8431
|
}, /*#__PURE__*/ (React).createElement(CollectionBranch, {
|
|
@@ -8220,11 +8442,13 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
|
|
|
8220
8442
|
let state = (React.useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
|
|
8221
8443
|
let ref = (Text.$df56164dff5785e2$export$4338b53315abf666)(forwardedRef);
|
|
8222
8444
|
let selectionManager = (React.useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
|
|
8445
|
+
let { isVirtualized: isVirtualized } = (React.useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
8223
8446
|
let { menuItemProps: menuItemProps, labelProps: labelProps, descriptionProps: descriptionProps, keyboardShortcutProps: keyboardShortcutProps, ...states } = ($a2e5df62f93c7633$export$9d32628fc2aea7da)({
|
|
8224
8447
|
...props,
|
|
8225
8448
|
id: id,
|
|
8226
8449
|
key: item.key,
|
|
8227
|
-
selectionManager: selectionManager
|
|
8450
|
+
selectionManager: selectionManager,
|
|
8451
|
+
isVirtualized: isVirtualized
|
|
8228
8452
|
}, state, ref);
|
|
8229
8453
|
let { hoverProps: hoverProps, isHovered: isHovered } = (Text.$6179b936705e76d3$export$ae780daf29e6d456)({
|
|
8230
8454
|
isDisabled: states.isDisabled
|
|
@@ -8244,7 +8468,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
|
|
|
8244
8468
|
isOpen: props['aria-expanded'] === 'true'
|
|
8245
8469
|
}
|
|
8246
8470
|
});
|
|
8247
|
-
let ElementType = props.href ?
|
|
8471
|
+
let ElementType = props.href ? (Text.$64fa3d84918910a7$export$df3a06d6289f983e).a : (Text.$64fa3d84918910a7$export$df3a06d6289f983e).div;
|
|
8248
8472
|
let DOMProps = (Text.$65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
8249
8473
|
global: true
|
|
8250
8474
|
});
|
|
@@ -8277,6 +8501,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
|
|
|
8277
8501
|
[
|
|
8278
8502
|
($63df2425e2108aa8$export$744d98a3b8a94e1c),
|
|
8279
8503
|
keyboardShortcutProps
|
|
8504
|
+
],
|
|
8505
|
+
[
|
|
8506
|
+
($1d5b8b8664671ef2$export$c9549807523555e0),
|
|
8507
|
+
{
|
|
8508
|
+
isSelected: states.isSelected
|
|
8509
|
+
}
|
|
8280
8510
|
]
|
|
8281
8511
|
]
|
|
8282
8512
|
}, renderProps.children));
|
|
@@ -8284,7 +8514,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
|
|
|
8284
8514
|
|
|
8285
8515
|
const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ (React.createContext)(null);
|
|
8286
8516
|
|
|
8287
|
-
var styles = {"wrapper":"fpi0W91w2ag-","floatingContainer":"ba-Kj6mvQUw-","menu":"-DayvgvIcVo-","legacySection":"VsRRunpS6Yo-","separator":"jnggqK3YTIU-","triggerWrapper":"oRQQVVq-yxA-","ariaMenu":"QInUBKqkrl0-","ariaItem":"bWR8m7-LKg4-","ariaSection":"PH5vvtLgvXI-","ariaSectionHeader":"iJjIifpa9bk-","sectionHeader":"Bq7pLWj3jm4-","legacyAction":"P4Sdaq0-lZs-","action":"M1BgN-oCmKw-","destructive":"U9ihZZavz9w-","overlay":"_7we5hh6kYs8-","fullWidth":"_5OJ7B6mFcwk-","screenReaderOnly":"Bzvkz60bwWE-"
|
|
8517
|
+
var styles = {"wrapper":"fpi0W91w2ag-","floatingContainer":"ba-Kj6mvQUw-","menu":"-DayvgvIcVo-","legacySection":"VsRRunpS6Yo-","separator":"jnggqK3YTIU-","triggerWrapper":"oRQQVVq-yxA-","ariaMenu":"QInUBKqkrl0-","ariaItem":"bWR8m7-LKg4-","ariaSection":"PH5vvtLgvXI-","ariaSectionHeader":"iJjIifpa9bk-","sectionHeader":"Bq7pLWj3jm4-","legacyAction":"P4Sdaq0-lZs-","action":"M1BgN-oCmKw-","destructive":"U9ihZZavz9w-","overlay":"_7we5hh6kYs8-","fullWidth":"_5OJ7B6mFcwk-","screenReaderOnly":"Bzvkz60bwWE-"};
|
|
8288
8518
|
|
|
8289
8519
|
const SMALL_SCREEN_BREAKPOINT = 490;
|
|
8290
8520
|
const MENU_OFFSET = 6;
|