@jobber/components 7.1.2-MIKElock--7916eb4.2 → 7.1.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/index.cjs +2 -2
- package/dist/Autocomplete/index.mjs +5 -5
- package/dist/Body-cjs.js +1 -1
- package/dist/Body-es.js +2 -2
- package/dist/BottomSheet-cjs.js +1 -1
- package/dist/BottomSheet-es.js +1 -1
- package/dist/Box-cjs.js +2 -2
- package/dist/Box-es.js +2 -2
- package/dist/Button/index.mjs +1 -1
- package/dist/Button-es.js +1 -1
- package/dist/Card-cjs.js +1 -1
- package/dist/Card-es.js +1 -1
- package/dist/Checkbox/index.cjs +1 -1
- package/dist/Checkbox/index.mjs +1 -1
- package/dist/Chip/index.mjs +1 -1
- package/dist/Chip-cjs.js +2 -2
- package/dist/Chip-es.js +2 -2
- package/dist/ChipDismissible-es.js +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -1
- package/dist/Combobox-cjs.js +1 -1
- package/dist/Combobox-es.js +1 -1
- package/dist/ComboboxAction-cjs.js +1 -1
- package/dist/ComboboxAction-es.js +1 -1
- package/dist/ComboboxContent-cjs.js +1 -1
- package/dist/ComboboxContent-es.js +2 -2
- package/dist/ComboboxContentHeader-cjs.js +1 -1
- package/dist/ComboboxContentHeader-es.js +1 -1
- package/dist/ComboboxContentList-es.js +1 -1
- package/dist/ComboboxContentSearch-cjs.js +1 -1
- package/dist/ComboboxContentSearch-es.js +1 -1
- package/dist/ComboboxLoadMore-cjs.js +1 -1
- package/dist/ComboboxLoadMore-es.js +1 -1
- package/dist/ComboboxOption-cjs.js +1 -1
- package/dist/ComboboxOption-es.js +1 -1
- package/dist/Container-cjs.js +1 -1
- package/dist/Container-es.js +1 -1
- package/dist/Content-cjs.js +1 -1
- package/dist/Content-es.js +1 -1
- package/dist/ContentBlock-cjs.js +1 -1
- package/dist/ContentBlock-es.js +1 -1
- package/dist/Countdown-cjs.js +3 -7
- package/dist/Countdown-es.js +4 -8
- 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 +1 -0
- package/dist/DataList.const-es.js +2 -1
- 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/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 +81 -266
- package/dist/DatePicker-es.js +83 -268
- 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 +48 -10
- package/dist/DrawerRoot-es.js +50 -12
- 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 +6 -1
- package/dist/FormatFile-es.js +6 -1
- 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 +3 -8
- package/dist/InputFile-es.js +3 -8
- package/dist/InputNumber/index.cjs +59 -165
- package/dist/InputNumber/index.mjs +62 -168
- 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 +70 -2
- package/dist/InputText/index.mjs +1 -1
- package/dist/InputTime/index.cjs +1 -0
- package/dist/InputTime/index.mjs +2 -1
- 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 +392 -466
- package/dist/Markdown-es.js +398 -472
- package/dist/Menu-cjs.js +577 -739
- package/dist/Menu-es.js +573 -735
- package/dist/Modal/index.cjs +2 -2
- package/dist/Modal/index.mjs +2 -2
- 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 +0 -1
- package/dist/RecurringSelect/index.mjs +0 -1
- 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 +164 -298
- package/dist/Text-es2.js +164 -295
- 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 +8 -2
- package/dist/_getAllKeys-es.js +10 -4
- 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/docs/Autocomplete/AutocompleteV1.md +1 -1
- package/dist/docs/Autocomplete/AutocompleteV2.md +1 -1
- package/dist/docs/Banner/Banner.md +1 -1
- package/dist/docs/DataList/DataList.md +1 -1
- package/dist/docs/FormField/FormField.md +2 -2
- package/dist/docs/InputEmail/InputEmail.md +1 -1
- package/dist/docs/InputNumber/InputNumber.md +2 -2
- package/dist/docs/InputPhoneNumber/InputPhoneNumber.md +1 -1
- package/dist/docs/InputText/InputText.md +2 -2
- package/dist/docs/Modal/Modal.md +3 -3
- package/dist/docs/Select/Select.md +2 -2
- package/dist/floating-ui.react-cjs.js +16 -35
- package/dist/floating-ui.react-dom-es.js +2 -2
- package/dist/floating-ui.react-es.js +18 -37
- 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 +5 -37
- package/dist/omit-es.js +14 -46
- package/dist/showToast-cjs.js +1 -1
- package/dist/showToast-es.js +1 -1
- package/dist/styles.css +117 -54
- package/dist/unstyledPrimitives/index.mjs +3 -3
- package/dist/useScrollToActive-cjs.js +1 -1
- package/dist/useScrollToActive-es.js +8 -8
- package/package.json +3 -4
package/dist/Menu-es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React__default, { createContext, useRef, useEffect, useState, useCallback, useMemo,
|
|
1
|
+
import React__default, { createContext, useContext, useRef, useEffect, useState, useCallback, useMemo, cloneElement, forwardRef, isValidElement, useId } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
4
4
|
import { useWindowDimensions, useRefocusOnActivator, useIsMounted } from '@jobber/hooks';
|
|
5
5
|
import { u as useFloating, c as useDismiss, k as useListNavigation, d as useInteractions, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
6
|
-
import {
|
|
6
|
+
import { I as $f4e2df6bd15f8569$export$98658e8c59125e6a, J as $d4ee10de306f2510$export$4282f70798064fe0, K as $c87311424ea30a05$export$b7d78993b74f766d, L as $c87311424ea30a05$export$9ac100e40613ea10, M as $c87311424ea30a05$export$78551043582a6a98, N as $c87311424ea30a05$export$7bef049ce92e4224, O as $7215afc6de606d6b$export$de79e2c695e052f3, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, r as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, x as $c87311424ea30a05$export$fedb369cb70207f1, P as $431fbd86ca7dc216$export$b204af158042fbac, Q as $bbed8b41f857bcc0$export$24490316f764c430, t as $03deb23ff14920c4$export$4eaf04e54aa8eed6, $ as $8ae05eaa5c114e9c$export$7f54fc3180508a52, R as $8a9cb279dc87e130$export$c2b7abe5d61ec696, S as $8a9cb279dc87e130$export$525bc4921d56d4a, T as $d4ee10de306f2510$export$e58f029f0fbfdb29, U as $6a7db85432448f7f$export$29bf1b5f2c56cf63, V as $8a9cb279dc87e130$export$cabe61c495ee3649, W as $6a7db85432448f7f$export$60278871457622de, p as $431fbd86ca7dc216$export$f21a1ffae260145a, j as $3ef42575df84b30b$export$9d1611c77c2fe928, X as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, w as $ff5963eb1fccf552$export$e08e3b67e392101e, Y as $df56164dff5785e2$export$4338b53315abf666, n as $f645667febf57a63$export$4c014de7c8940b4c, Z as $b4b717babfbb907b$export$4c063cf1350e6fed, _ as $5dc95899b306f630$export$c9058316764c140e, a0 as $d4ee10de306f2510$export$cd4e5573fbe2b576, a1 as $3ad3f6e1647bc98d$export$80f3e147d781571c, a2 as $b4b717babfbb907b$export$bebd5a1431fec25d, v as $c87311424ea30a05$export$a11b0059900ceec8, a3 as $c87311424ea30a05$export$6446a186d09e379e, a4 as $507fabe10e71c6fb$export$630ff653c5ada6a9, f as $9ab94262bd0047c7$export$420e68273165f4ec, g as $bdb11010cef70236$export$f680877a34711e37, s as $fca6afa0e843324b$export$f12b703ca79dfbb1, h as $313b98861ee5dd6c$export$d6875122194c7b44, a5 as $b5e257d569688ac6$export$535bd6ca7f90a273, a6 as $c87311424ea30a05$export$e1865c3bedcd822b, b as $e9faafb641e167db$export$90fc3a17d93f704c, o as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, i as $bdb11010cef70236$export$b4cc09c592e8fdb8, C as $6179b936705e76d3$export$ae780daf29e6d456, c as $507fabe10e71c6fb$export$b9b3dfddab17db27, a7 as $46d819fcbaf35654$export$8f71654801c2f7cd, e as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, a8 as $f39a9eba43920ace$export$8dc98ba7eadeaa56, a9 as $f645667febf57a63$export$f9762fab77588ecb, m as $458b0a5536c1a7cf$export$40bfa8c7b0832715, z as $64fa3d84918910a7$export$29f1550f4b0d4415, aa as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, A as $64fa3d84918910a7$export$4d86445c2cf5e3, G as $64fa3d84918910a7$export$2881499e37b75b9a, E as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, D as $64fa3d84918910a7$export$fabf2dc03a41866e, H as $514c0188e459b4c0$export$9afb8bc826b033ea, ab as $64fa3d84918910a7$export$c62b8e45d58ddad9 } from './Text-es2.js';
|
|
7
7
|
import ReactDOM__default, { flushSync, createPortal } from 'react-dom';
|
|
8
8
|
import { s as shimExports } from './index-es.js';
|
|
9
9
|
import { B as Button } from './Button-es.js';
|
|
@@ -11,7 +11,7 @@ import { T as Typography } from './Typography-es.js';
|
|
|
11
11
|
import { I as Icon } from './Icon-es.js';
|
|
12
12
|
import { f as formFieldFocusAttribute } from './useFormFieldFocus-es.js';
|
|
13
13
|
import { c as calculateMaxHeight } from './maxHeight-es.js';
|
|
14
|
-
import { o as offset, f as flip, d as size,
|
|
14
|
+
import { o as offset, f as flip, d as size, b as autoUpdate } from './floating-ui.react-dom-es.js';
|
|
15
15
|
|
|
16
16
|
/*
|
|
17
17
|
* Copyright 2025 Adobe. All rights reserved.
|
|
@@ -215,6 +215,109 @@ function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter
|
|
|
215
215
|
return doc.createTreeWalker(root, whatToShow, filter);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
/*
|
|
219
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
220
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
221
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
222
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
223
|
+
*
|
|
224
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
225
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
226
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
227
|
+
* governing permissions and limitations under the License.
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (createContext)({
|
|
232
|
+
isNative: true,
|
|
233
|
+
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
|
|
234
|
+
useHref: (href)=>href
|
|
235
|
+
});
|
|
236
|
+
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
|
|
237
|
+
return (useContext)($ea8dcbcb9ea1b556$var$RouterContext);
|
|
238
|
+
}
|
|
239
|
+
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
|
|
240
|
+
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
|
|
241
|
+
let target = link.getAttribute('target');
|
|
242
|
+
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
|
|
243
|
+
!modifiers.ctrlKey && // open in new tab (windows)
|
|
244
|
+
!modifiers.altKey && // download
|
|
245
|
+
!modifiers.shiftKey;
|
|
246
|
+
}
|
|
247
|
+
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
248
|
+
var _window_event_type, _window_event;
|
|
249
|
+
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
250
|
+
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
251
|
+
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
252
|
+
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
253
|
+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
254
|
+
if (($c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith('key')) && target.target === '_blank') {
|
|
255
|
+
if (($c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
256
|
+
else ctrlKey = true;
|
|
257
|
+
}
|
|
258
|
+
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
|
|
259
|
+
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
|
|
260
|
+
let event = ($c87311424ea30a05$export$78551043582a6a98)() && ($c87311424ea30a05$export$9ac100e40613ea10)() && !($c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
|
|
261
|
+
keyIdentifier: 'Enter',
|
|
262
|
+
metaKey: metaKey,
|
|
263
|
+
ctrlKey: ctrlKey,
|
|
264
|
+
altKey: altKey,
|
|
265
|
+
shiftKey: shiftKey
|
|
266
|
+
}) : new MouseEvent('click', {
|
|
267
|
+
metaKey: metaKey,
|
|
268
|
+
ctrlKey: ctrlKey,
|
|
269
|
+
altKey: altKey,
|
|
270
|
+
shiftKey: shiftKey,
|
|
271
|
+
bubbles: true,
|
|
272
|
+
cancelable: true
|
|
273
|
+
});
|
|
274
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
|
|
275
|
+
($7215afc6de606d6b$export$de79e2c695e052f3)(target);
|
|
276
|
+
target.dispatchEvent(event);
|
|
277
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
278
|
+
}
|
|
279
|
+
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
280
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
281
|
+
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
282
|
+
if (target instanceof HTMLAnchorElement) open(target);
|
|
283
|
+
else if (target.hasAttribute('data-href')) {
|
|
284
|
+
let link = document.createElement('a');
|
|
285
|
+
link.href = target.getAttribute('data-href');
|
|
286
|
+
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
|
|
287
|
+
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
|
|
288
|
+
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
|
|
289
|
+
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
|
|
290
|
+
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
|
|
291
|
+
target.appendChild(link);
|
|
292
|
+
open(link);
|
|
293
|
+
target.removeChild(link);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
297
|
+
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
298
|
+
}
|
|
299
|
+
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
300
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
301
|
+
var _props_href;
|
|
302
|
+
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
303
|
+
return {
|
|
304
|
+
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
|
|
305
|
+
target: props === null || props === void 0 ? void 0 : props.target,
|
|
306
|
+
rel: props === null || props === void 0 ? void 0 : props.rel,
|
|
307
|
+
download: props === null || props === void 0 ? void 0 : props.download,
|
|
308
|
+
ping: props === null || props === void 0 ? void 0 : props.ping,
|
|
309
|
+
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
|
|
313
|
+
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
314
|
+
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.
|
|
315
|
+
!e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
|
|
316
|
+
e.preventDefault();
|
|
317
|
+
router.open(e.currentTarget, e, href, routerOptions);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
218
321
|
/*
|
|
219
322
|
* Copyright 2024 Adobe. All rights reserved.
|
|
220
323
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -248,22 +351,19 @@ function $9daab02d461809db$var$hasResizeObserver() {
|
|
|
248
351
|
return typeof window.ResizeObserver !== 'undefined';
|
|
249
352
|
}
|
|
250
353
|
function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
251
|
-
// Only call onResize from inside the effect, otherwise we'll void our assumption that
|
|
252
|
-
// useEffectEvents are safe to pass in.
|
|
253
354
|
const { ref: ref, box: box, onResize: onResize } = options;
|
|
254
|
-
let onResizeEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
|
|
255
355
|
(useEffect)(()=>{
|
|
256
356
|
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
257
357
|
if (!element) return;
|
|
258
358
|
if (!$9daab02d461809db$var$hasResizeObserver()) {
|
|
259
|
-
window.addEventListener('resize',
|
|
359
|
+
window.addEventListener('resize', onResize, false);
|
|
260
360
|
return ()=>{
|
|
261
|
-
window.removeEventListener('resize',
|
|
361
|
+
window.removeEventListener('resize', onResize, false);
|
|
262
362
|
};
|
|
263
363
|
} else {
|
|
264
364
|
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
|
|
265
365
|
if (!entries.length) return;
|
|
266
|
-
|
|
366
|
+
onResize();
|
|
267
367
|
});
|
|
268
368
|
resizeObserverInstance.observe(element, {
|
|
269
369
|
box: box
|
|
@@ -273,6 +373,7 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
273
373
|
};
|
|
274
374
|
}
|
|
275
375
|
}, [
|
|
376
|
+
onResize,
|
|
276
377
|
ref,
|
|
277
378
|
box
|
|
278
379
|
]);
|
|
@@ -291,10 +392,7 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
291
392
|
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
292
393
|
if (!node) return false;
|
|
293
394
|
let style = window.getComputedStyle(node);
|
|
294
|
-
let root = document.scrollingElement || document.documentElement;
|
|
295
395
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
296
|
-
// Root element has `visible` overflow by default, but is scrollable nonetheless.
|
|
297
|
-
if (node === root && style.overflow !== 'hidden') isScrollable = true;
|
|
298
396
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
299
397
|
return isScrollable;
|
|
300
398
|
}
|
|
@@ -329,44 +427,12 @@ function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
|
|
|
329
427
|
* governing permissions and limitations under the License.
|
|
330
428
|
*/
|
|
331
429
|
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (($cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) parentElements.push(node);
|
|
430
|
+
const scrollParents = [];
|
|
431
|
+
while(node && node !== document.documentElement){
|
|
432
|
+
if (($cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) scrollParents.push(node);
|
|
336
433
|
node = node.parentElement;
|
|
337
|
-
}
|
|
338
|
-
return
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/*
|
|
342
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
343
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
344
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
345
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
346
|
-
*
|
|
347
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
348
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
349
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
350
|
-
* governing permissions and limitations under the License.
|
|
351
|
-
*/
|
|
352
|
-
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
353
|
-
if (($c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
354
|
-
return e.ctrlKey;
|
|
355
|
-
}
|
|
356
|
-
// HTML input types that do not cause the software keyboard to appear.
|
|
357
|
-
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
|
|
358
|
-
'checkbox',
|
|
359
|
-
'radio',
|
|
360
|
-
'range',
|
|
361
|
-
'color',
|
|
362
|
-
'file',
|
|
363
|
-
'image',
|
|
364
|
-
'button',
|
|
365
|
-
'submit',
|
|
366
|
-
'reset'
|
|
367
|
-
]);
|
|
368
|
-
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
|
|
369
|
-
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
434
|
+
}
|
|
435
|
+
return scrollParents;
|
|
370
436
|
}
|
|
371
437
|
|
|
372
438
|
/*
|
|
@@ -428,84 +494,59 @@ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
|
428
494
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
429
495
|
* governing permissions and limitations under the License.
|
|
430
496
|
*/
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
let
|
|
434
|
-
|
|
435
|
-
let
|
|
497
|
+
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
498
|
+
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
|
|
499
|
+
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
|
|
500
|
+
let width = element.offsetWidth;
|
|
501
|
+
let height = element.offsetHeight;
|
|
436
502
|
let x = scrollView.scrollLeft;
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
let
|
|
440
|
-
let
|
|
441
|
-
let
|
|
442
|
-
|
|
443
|
-
let
|
|
444
|
-
let
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
let
|
|
448
|
-
let
|
|
449
|
-
let
|
|
450
|
-
let
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
let borderRightWidth = parseInt(viewStyle.borderRightWidth, 10) || 0;
|
|
458
|
-
let scrollAreaTop = target.top - scrollMarginTop;
|
|
459
|
-
let scrollAreaBottom = target.bottom + scrollMarginBottom;
|
|
460
|
-
let scrollAreaLeft = target.left - scrollMarginLeft;
|
|
461
|
-
let scrollAreaRight = target.right + scrollMarginRight;
|
|
462
|
-
let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
|
|
463
|
-
let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
|
|
464
|
-
let scrollBarWidth = scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
|
|
465
|
-
let scrollBarHeight = scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
|
|
466
|
-
let scrollPortTop = viewTop + borderTopWidth + scrollPaddingTop;
|
|
467
|
-
let scrollPortBottom = viewBottom - borderBottomWidth - scrollPaddingBottom - scrollBarHeight;
|
|
468
|
-
let scrollPortLeft = viewLeft + borderLeftWidth + scrollPaddingLeft;
|
|
469
|
-
let scrollPortRight = viewRight - borderRightWidth - scrollPaddingRight;
|
|
470
|
-
// IOS always positions the scrollbar on the right ¯\_(ツ)_/¯
|
|
471
|
-
if (viewStyle.direction === 'rtl' && !($c87311424ea30a05$export$fedb369cb70207f1)()) scrollPortLeft += scrollBarWidth;
|
|
472
|
-
else scrollPortRight -= scrollBarWidth;
|
|
473
|
-
let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
|
|
474
|
-
let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
|
|
475
|
-
if (shouldScrollBlock && block === 'start') y += scrollAreaTop - scrollPortTop;
|
|
476
|
-
else if (shouldScrollBlock && block === 'center') y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
|
|
477
|
-
else if (shouldScrollBlock && block === 'end') y += scrollAreaBottom - scrollPortBottom;
|
|
478
|
-
else if (shouldScrollBlock && block === 'nearest') {
|
|
479
|
-
let start = scrollAreaTop - scrollPortTop;
|
|
480
|
-
let end = scrollAreaBottom - scrollPortBottom;
|
|
481
|
-
y += Math.abs(start) <= Math.abs(end) ? start : end;
|
|
482
|
-
}
|
|
483
|
-
if (shouldScrollInline && inline === 'start') x += scrollAreaLeft - scrollPortLeft;
|
|
484
|
-
else if (shouldScrollInline && inline === 'center') x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
|
|
485
|
-
else if (shouldScrollInline && inline === 'end') x += scrollAreaRight - scrollPortRight;
|
|
486
|
-
else if (shouldScrollInline && inline === 'nearest') {
|
|
487
|
-
let start = scrollAreaLeft - scrollPortLeft;
|
|
488
|
-
let end = scrollAreaRight - scrollPortRight;
|
|
489
|
-
x += Math.abs(start) <= Math.abs(end) ? start : end;
|
|
490
|
-
}
|
|
491
|
-
if (process.env.NODE_ENV === 'test') {
|
|
492
|
-
scrollView.scrollLeft = x;
|
|
493
|
-
scrollView.scrollTop = y;
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
scrollView.scrollTo({
|
|
497
|
-
left: x,
|
|
498
|
-
top: y
|
|
499
|
-
});
|
|
503
|
+
let y = scrollView.scrollTop;
|
|
504
|
+
// Account for top/left border offsetting the scroll top/Left + scroll padding
|
|
505
|
+
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
506
|
+
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
507
|
+
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
508
|
+
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
|
|
509
|
+
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
510
|
+
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
511
|
+
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
|
|
512
|
+
// is used.
|
|
513
|
+
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
|
|
514
|
+
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
515
|
+
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
516
|
+
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
517
|
+
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
518
|
+
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
|
|
519
|
+
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
520
|
+
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
|
|
521
|
+
scrollView.scrollLeft = x;
|
|
522
|
+
scrollView.scrollTop = y;
|
|
500
523
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
524
|
+
/**
|
|
525
|
+
* Computes the offset left or top from child to ancestor by accumulating
|
|
526
|
+
* offsetLeft or offsetTop through intervening offsetParents.
|
|
527
|
+
*/ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
528
|
+
const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
|
|
529
|
+
let sum = 0;
|
|
530
|
+
while(child.offsetParent){
|
|
531
|
+
sum += child[prop];
|
|
532
|
+
if (child.offsetParent === ancestor) break;
|
|
533
|
+
else if (child.offsetParent.contains(ancestor)) {
|
|
534
|
+
// If the ancestor is not `position:relative`, then we stop at
|
|
535
|
+
// _its_ offset parent, and we subtract off _its_ offset, so that
|
|
536
|
+
// we end up with the proper offset from child to ancestor.
|
|
537
|
+
sum -= ancestor[prop];
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
child = child.offsetParent;
|
|
541
|
+
}
|
|
542
|
+
return sum;
|
|
543
|
+
}
|
|
544
|
+
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
545
|
+
if (targetElement && document.contains(targetElement)) {
|
|
504
546
|
let root = document.scrollingElement || document.documentElement;
|
|
505
547
|
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
|
|
506
|
-
// If scrolling is not currently prevented then we aren
|
|
507
|
-
|
|
508
|
-
if (!isScrollPrevented && !($c87311424ea30a05$export$6446a186d09e379e)()) {
|
|
548
|
+
// 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
|
|
549
|
+
if (!isScrollPrevented) {
|
|
509
550
|
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
|
|
510
551
|
// 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
|
|
511
552
|
_targetElement_scrollIntoView;
|
|
@@ -516,8 +557,8 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
|
|
|
516
557
|
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
517
558
|
// Account for sub pixel differences from rounding
|
|
518
559
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
519
|
-
var
|
|
520
|
-
|
|
560
|
+
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
561
|
+
opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
|
|
521
562
|
block: 'center',
|
|
522
563
|
inline: 'center'
|
|
523
564
|
});
|
|
@@ -526,19 +567,9 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
|
|
|
526
567
|
});
|
|
527
568
|
}
|
|
528
569
|
} else {
|
|
529
|
-
let
|
|
570
|
+
let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement);
|
|
530
571
|
// 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.
|
|
531
|
-
let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement, true);
|
|
532
572
|
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
533
|
-
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
534
|
-
// Account for sub pixel differences from rounding
|
|
535
|
-
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
536
|
-
scrollParents = containingElement ? ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(containingElement, true) : [];
|
|
537
|
-
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, containingElement, {
|
|
538
|
-
block: 'center',
|
|
539
|
-
inline: 'center'
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
573
|
}
|
|
543
574
|
}
|
|
544
575
|
}
|
|
@@ -557,6 +588,22 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
|
|
|
557
588
|
const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
|
|
558
589
|
const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
|
|
559
590
|
|
|
591
|
+
/*
|
|
592
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
593
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
594
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
595
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
596
|
+
*
|
|
597
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
598
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
599
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
600
|
+
* governing permissions and limitations under the License.
|
|
601
|
+
*/
|
|
602
|
+
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
603
|
+
if (($c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
|
|
604
|
+
return e.ctrlKey;
|
|
605
|
+
}
|
|
606
|
+
|
|
560
607
|
/*
|
|
561
608
|
* Copyright 2020 Adobe. All rights reserved.
|
|
562
609
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -677,31 +724,28 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
|
677
724
|
height: 'totalHeight'
|
|
678
725
|
};
|
|
679
726
|
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
680
|
-
let $edcf132a9284368a$var$
|
|
681
|
-
function $edcf132a9284368a$var$getContainerDimensions(containerNode
|
|
727
|
+
let $edcf132a9284368a$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
728
|
+
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
682
729
|
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
683
730
|
let scroll = {};
|
|
684
731
|
var _visualViewport_scale;
|
|
685
|
-
let isPinchZoomedIn = ((_visualViewport_scale = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
|
|
686
|
-
|
|
687
|
-
// then position absolute will be positioned relative to the viewport, also known as the `initial containing block`.
|
|
688
|
-
// That's why we use the visual viewport instead.
|
|
689
|
-
if (containerNode.tagName === 'BODY' || containerNode.tagName === 'HTML') {
|
|
732
|
+
let isPinchZoomedIn = ((_visualViewport_scale = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
|
|
733
|
+
if (containerNode.tagName === 'BODY') {
|
|
690
734
|
let documentElement = document.documentElement;
|
|
691
735
|
totalWidth = documentElement.clientWidth;
|
|
692
736
|
totalHeight = documentElement.clientHeight;
|
|
693
737
|
var _visualViewport_width;
|
|
694
|
-
width = (_visualViewport_width = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
|
|
738
|
+
width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
|
|
695
739
|
var _visualViewport_height;
|
|
696
|
-
height = (_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
|
|
740
|
+
height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
|
|
697
741
|
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
698
742
|
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
699
743
|
// The goal of the below is to get a top/left value that represents the top/left of the visual viewport with
|
|
700
744
|
// respect to the layout viewport origin. This combined with the scrollTop/scrollLeft will allow us to calculate
|
|
701
745
|
// coordinates/values with respect to the visual viewport or with respect to the layout viewport.
|
|
702
|
-
if (visualViewport) {
|
|
703
|
-
top = visualViewport.offsetTop;
|
|
704
|
-
left = visualViewport.offsetLeft;
|
|
746
|
+
if ($edcf132a9284368a$var$visualViewport) {
|
|
747
|
+
top = $edcf132a9284368a$var$visualViewport.offsetTop;
|
|
748
|
+
left = $edcf132a9284368a$var$visualViewport.offsetLeft;
|
|
705
749
|
}
|
|
706
750
|
} else {
|
|
707
751
|
({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode, false));
|
|
@@ -718,9 +762,9 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode, visualViewp
|
|
|
718
762
|
scroll.top = 0;
|
|
719
763
|
scroll.left = 0;
|
|
720
764
|
var _visualViewport_pageTop;
|
|
721
|
-
top = (_visualViewport_pageTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
|
|
765
|
+
top = (_visualViewport_pageTop = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
|
|
722
766
|
var _visualViewport_pageLeft;
|
|
723
|
-
left = (_visualViewport_pageLeft = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
|
|
767
|
+
left = (_visualViewport_pageLeft = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
|
|
724
768
|
}
|
|
725
769
|
return {
|
|
726
770
|
width: width,
|
|
@@ -755,12 +799,10 @@ containerDimensions, padding, containerOffsetWithBoundary) {
|
|
|
755
799
|
let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
756
800
|
// Calculate the edges of the boundary (accomodating for the boundary padding) and the edges of the overlay.
|
|
757
801
|
// Note that these values are with respect to the visual viewport (aka 0,0 is the top left of the viewport)
|
|
758
|
-
let boundaryStartEdge =
|
|
759
|
-
let boundaryEndEdge =
|
|
760
|
-
|
|
761
|
-
let
|
|
762
|
-
// transformed value of the right edge of the overlay
|
|
763
|
-
let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
802
|
+
let boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
803
|
+
let boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding;
|
|
804
|
+
let startEdgeOffset = offset - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
805
|
+
let endEdgeOffset = offset - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
764
806
|
// If any of the overlay edges falls outside of the boundary, shift the overlay the required amount to align one of the overlay's
|
|
765
807
|
// edges with the closest boundary edge.
|
|
766
808
|
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
@@ -794,7 +836,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
794
836
|
};
|
|
795
837
|
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
796
838
|
}
|
|
797
|
-
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset
|
|
839
|
+
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
798
840
|
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
799
841
|
let position = {};
|
|
800
842
|
var _childOffset_crossAxis;
|
|
@@ -811,9 +853,9 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
811
853
|
the overlay top should match the button top
|
|
812
854
|
} */
|
|
813
855
|
position[crossAxis] += crossOffset;
|
|
814
|
-
// overlay top
|
|
856
|
+
// overlay top overlapping arrow with button bottom
|
|
815
857
|
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
816
|
-
// overlay bottom
|
|
858
|
+
// overlay bottom overlapping arrow with button top
|
|
817
859
|
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
818
860
|
position[crossAxis] = ($9446cca9a3875146$export$7d15b64cf5a3a4c4)(position[crossAxis], minPosition, maxPosition);
|
|
819
861
|
// 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.
|
|
@@ -821,61 +863,46 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
821
863
|
// If the container is positioned (non-static), then we use the container's actual
|
|
822
864
|
// height, as `bottom` will be relative to this height. But if the container is static,
|
|
823
865
|
// then it can only be the `document.body`, and `bottom` will be relative to _its_
|
|
824
|
-
// container.
|
|
825
|
-
|
|
866
|
+
// container, which should be as large as boundaryDimensions.
|
|
867
|
+
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
|
|
826
868
|
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
827
869
|
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
828
870
|
return position;
|
|
829
871
|
}
|
|
830
|
-
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
// with respect to the
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
var _visualViewport_offsetTop, _visualViewport_offsetTop1, _visualViewport_height;
|
|
838
|
-
let boundingRect = {
|
|
839
|
-
// This should be boundary top in container coord system vs viewport top in container coord system
|
|
840
|
-
// For the viewport top, there are several cases
|
|
841
|
-
// 1. pinchzoom case where we want the viewports offset top as top here
|
|
842
|
-
// 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
|
|
843
|
-
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),
|
|
844
|
-
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))
|
|
845
|
-
};
|
|
846
|
-
var _margins_top, _margins_bottom, _margins_top1, _margins_bottom1;
|
|
872
|
+
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
873
|
+
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height];
|
|
874
|
+
var _position_bottom;
|
|
875
|
+
// For cases where position is set via "bottom" instead of "top", we need to calculate the true overlay top with respect to the boundary. Reverse calculate this with the same method
|
|
876
|
+
// used in computePosition.
|
|
877
|
+
let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight);
|
|
878
|
+
var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1;
|
|
847
879
|
let maxHeight = heightGrowthDirection !== 'top' ? // We want the distance between the top of the overlay to the bottom of the boundary
|
|
848
|
-
Math.max(0,
|
|
849
|
-
- overlayTop // this is the top of the overlay
|
|
880
|
+
Math.max(0, boundaryDimensions.height + boundaryDimensions.top + ((_boundaryDimensions_scroll_top = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top !== void 0 ? _boundaryDimensions_scroll_top : 0) - overlayTop // this is the top of the overlay
|
|
850
881
|
- (((_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
|
|
851
882
|
)) : Math.max(0, overlayTop + overlayHeight // this is the bottom of the overlay
|
|
852
|
-
-
|
|
853
|
-
|
|
883
|
+
- (boundaryDimensions.top + ((_boundaryDimensions_scroll_top1 = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top1 !== void 0 ? _boundaryDimensions_scroll_top1 : 0) // this is the top of the boundary
|
|
884
|
+
) - (((_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
|
|
854
885
|
));
|
|
855
|
-
return maxHeight;
|
|
886
|
+
return Math.min(boundaryDimensions.height - padding * 2, maxHeight);
|
|
856
887
|
}
|
|
857
|
-
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo
|
|
888
|
+
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
858
889
|
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
859
|
-
var
|
|
860
|
-
if (placement === axis) return Math.max(0, childOffset[axis]
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
var _containerDimensions_scroll_axis1, _margins_axis1;
|
|
866
|
-
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);
|
|
867
|
-
}
|
|
868
|
-
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
890
|
+
var _boundaryDimensions_scroll_axis, _margins_axis;
|
|
891
|
+
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - ((_boundaryDimensions_scroll_axis = boundaryDimensions.scroll[axis]) !== null && _boundaryDimensions_scroll_axis !== void 0 ? _boundaryDimensions_scroll_axis : 0) + containerOffsetWithBoundary[axis] - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
892
|
+
var _margins_axis1;
|
|
893
|
+
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
894
|
+
}
|
|
895
|
+
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
869
896
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
870
897
|
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
871
|
-
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset
|
|
898
|
+
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
872
899
|
let normalizedOffset = offset;
|
|
873
|
-
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo
|
|
900
|
+
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
874
901
|
// Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
|
|
875
|
-
if (flip &&
|
|
902
|
+
if (flip && scrollSize[size] > space) {
|
|
876
903
|
let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
877
|
-
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset
|
|
878
|
-
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo
|
|
904
|
+
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
905
|
+
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
|
|
879
906
|
// If the available space for the flipped position is greater than the original available space, flip.
|
|
880
907
|
if (flippedSpace > space) {
|
|
881
908
|
placementInfo = flippedPlacementInfo;
|
|
@@ -894,10 +921,10 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
894
921
|
}
|
|
895
922
|
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
896
923
|
position[crossAxis] += delta;
|
|
897
|
-
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection
|
|
924
|
+
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
|
|
898
925
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
899
926
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
900
|
-
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset
|
|
927
|
+
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
901
928
|
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
902
929
|
position[crossAxis] += delta;
|
|
903
930
|
let arrowPosition = {};
|
|
@@ -943,7 +970,6 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
943
970
|
}
|
|
944
971
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
945
972
|
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;
|
|
946
|
-
let visualViewport = $edcf132a9284368a$var$getVisualViewport();
|
|
947
973
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
948
974
|
let isViewportContainer = container === document.documentElement;
|
|
949
975
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
@@ -961,46 +987,21 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
961
987
|
var _margins_top, _margins_bottom;
|
|
962
988
|
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);
|
|
963
989
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
//
|
|
967
|
-
//
|
|
968
|
-
|
|
969
|
-
let
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
let containerOffsetWithBoundary;
|
|
976
|
-
if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && !isViewportContainer) {
|
|
977
|
-
// Use getRect instead of getOffset because boundaryDimensions for BODY/HTML is in viewport coordinate space,
|
|
978
|
-
// not document coordinate space
|
|
979
|
-
let containerRect = $edcf132a9284368a$export$4b834cebd9e5cebe(container, false);
|
|
980
|
-
// the offset should be negative because if container is at viewport position x,y, then viewport top (aka 0)
|
|
981
|
-
// is at position -x,y in container-relative coordinates
|
|
982
|
-
containerOffsetWithBoundary = {
|
|
983
|
-
top: -(containerRect.top - boundaryDimensions.top),
|
|
984
|
-
left: -(containerRect.left - boundaryDimensions.left),
|
|
985
|
-
width: 0,
|
|
986
|
-
height: 0
|
|
987
|
-
};
|
|
988
|
-
} else if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && isViewportContainer) // both are the same viewport container, no offset needed
|
|
989
|
-
containerOffsetWithBoundary = {
|
|
990
|
-
top: 0,
|
|
991
|
-
left: 0,
|
|
992
|
-
width: 0,
|
|
993
|
-
height: 0
|
|
994
|
-
};
|
|
995
|
-
else // This returns the boundary's coordinate with respect to the container. This case captures cases such as when you provide a custom boundary
|
|
996
|
-
// like in ScrollingBoundaryContainerExample in Popover.stories.
|
|
997
|
-
containerOffsetWithBoundary = $edcf132a9284368a$var$getPosition(boundaryElement, container, false);
|
|
998
|
-
let isContainerDescendentOfBoundary = ($d4ee10de306f2510$export$4282f70798064fe0)(boundaryElement, container);
|
|
999
|
-
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
|
|
990
|
+
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
991
|
+
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
|
|
992
|
+
// If the container is the HTML element wrapping the body element, the retrieved scrollTop/scrollLeft will be equal to the
|
|
993
|
+
// body element's scroll. Set the container's scroll values to 0 since the overlay's edge position value in getDelta don't then need to be further offset
|
|
994
|
+
// by the container scroll since they are essentially the same containing element and thus in the same coordinate system
|
|
995
|
+
let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? $edcf132a9284368a$var$getOffset(container, false) : $edcf132a9284368a$var$getPosition(container, boundaryElement, false);
|
|
996
|
+
if (container.tagName === 'HTML' && boundaryElement.tagName === 'BODY') {
|
|
997
|
+
containerDimensions.scroll.top = 0;
|
|
998
|
+
containerDimensions.scroll.left = 0;
|
|
999
|
+
}
|
|
1000
|
+
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
1000
1001
|
}
|
|
1001
1002
|
function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) {
|
|
1002
1003
|
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
1003
|
-
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
1004
|
+
// Use offsetWidth and offsetHeight if this is an HTML element, so that
|
|
1004
1005
|
// the size is not affected by scale transforms.
|
|
1005
1006
|
if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
|
1006
1007
|
width = node.offsetWidth;
|
|
@@ -1079,7 +1080,6 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
|
1079
1080
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1080
1081
|
* governing permissions and limitations under the License.
|
|
1081
1082
|
*/
|
|
1082
|
-
|
|
1083
1083
|
const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
|
|
1084
1084
|
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
1085
1085
|
let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
|
|
@@ -1087,13 +1087,13 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
1087
1087
|
if (!isOpen || onClose === null) return;
|
|
1088
1088
|
let onScroll = (e)=>{
|
|
1089
1089
|
// Ignore if scrolling an scrollable region outside the trigger's tree.
|
|
1090
|
-
let target =
|
|
1090
|
+
let target = e.target;
|
|
1091
1091
|
// window is not a Node and doesn't have contain, but window contains everything
|
|
1092
|
-
if (!triggerRef.current || target instanceof Node && !(
|
|
1092
|
+
if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
|
|
1093
1093
|
// Ignore scroll events on any input or textarea as the cursor position can cause it to scroll
|
|
1094
1094
|
// such as in a combobox. Clicking the dropdown button places focus on the input, and if the
|
|
1095
1095
|
// text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.
|
|
1096
|
-
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;
|
|
1096
|
+
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
|
|
1097
1097
|
let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
|
|
1098
1098
|
if (onCloseHandler) onCloseHandler();
|
|
1099
1099
|
};
|
|
@@ -1195,9 +1195,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
1195
1195
|
// so it can be restored after repositioning. This way if the overlay height
|
|
1196
1196
|
// changes, the focused element appears to stay in the same position.
|
|
1197
1197
|
let anchor = null;
|
|
1198
|
-
if (scrollRef.current &&
|
|
1199
|
-
var
|
|
1200
|
-
let anchorRect = (
|
|
1198
|
+
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
|
|
1199
|
+
var _document_activeElement;
|
|
1200
|
+
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
|
|
1201
1201
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
1202
1202
|
var _anchorRect_top;
|
|
1203
1203
|
// Anchor from the top if the offset is in the top half of the scrollable element,
|
|
@@ -1246,9 +1246,8 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
1246
1246
|
Object.keys(position.position).forEach((key)=>overlay.style[key] = position.position[key] + 'px');
|
|
1247
1247
|
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
|
|
1248
1248
|
// Restore scroll position relative to anchor element.
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
let anchorRect = activeElement.getBoundingClientRect();
|
|
1249
|
+
if (anchor && document.activeElement && scrollRef.current) {
|
|
1250
|
+
let anchorRect = document.activeElement.getBoundingClientRect();
|
|
1252
1251
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
1253
1252
|
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
1254
1253
|
scrollRef.current.scrollTop += newOffset - anchor.offset;
|
|
@@ -1497,9 +1496,7 @@ function $f6c31cce2adf654f$var$usePressResponderContext(props) {
|
|
|
1497
1496
|
// Consume context from <PressResponder> and merge with props.
|
|
1498
1497
|
let context = (useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
|
|
1499
1498
|
if (context) {
|
|
1500
|
-
|
|
1501
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1502
|
-
let { register: register, ref: ref, ...contextProps } = context;
|
|
1499
|
+
let { register: register, ...contextProps } = context;
|
|
1503
1500
|
props = ($3ef42575df84b30b$export$9d1611c77c2fe928)(contextProps, props);
|
|
1504
1501
|
register();
|
|
1505
1502
|
}
|
|
@@ -1547,7 +1544,6 @@ class $f6c31cce2adf654f$var$PressEvent {
|
|
|
1547
1544
|
this.altKey = originalEvent.altKey;
|
|
1548
1545
|
this.x = x;
|
|
1549
1546
|
this.y = y;
|
|
1550
|
-
this.key = originalEvent.key;
|
|
1551
1547
|
}
|
|
1552
1548
|
}
|
|
1553
1549
|
const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
|
|
@@ -1567,8 +1563,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1567
1563
|
pointerType: null,
|
|
1568
1564
|
disposables: []
|
|
1569
1565
|
});
|
|
1570
|
-
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners
|
|
1571
|
-
let triggerPressStart = (
|
|
1566
|
+
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
|
|
1567
|
+
let triggerPressStart = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType)=>{
|
|
1572
1568
|
let state = ref.current;
|
|
1573
1569
|
if (isDisabled || state.didFirePressStart) return false;
|
|
1574
1570
|
let shouldStopPropagation = true;
|
|
@@ -1583,12 +1579,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1583
1579
|
state.didFirePressStart = true;
|
|
1584
1580
|
setPressed(true);
|
|
1585
1581
|
return shouldStopPropagation;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
onPressStart,
|
|
1589
|
-
onPressChange
|
|
1590
|
-
]);
|
|
1591
|
-
let triggerPressEnd = (useCallback)((originalEvent, pointerType, wasPressed = true)=>{
|
|
1582
|
+
});
|
|
1583
|
+
let triggerPressEnd = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType, wasPressed = true)=>{
|
|
1592
1584
|
let state = ref.current;
|
|
1593
1585
|
if (!state.didFirePressStart) return false;
|
|
1594
1586
|
state.didFirePressStart = false;
|
|
@@ -1608,14 +1600,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1608
1600
|
}
|
|
1609
1601
|
state.isTriggeringEvent = false;
|
|
1610
1602
|
return shouldStopPropagation;
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
onPressEnd,
|
|
1614
|
-
onPressChange,
|
|
1615
|
-
onPress
|
|
1616
|
-
]);
|
|
1617
|
-
let triggerPressEndEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressEnd);
|
|
1618
|
-
let triggerPressUp = (useCallback)((originalEvent, pointerType)=>{
|
|
1603
|
+
});
|
|
1604
|
+
let triggerPressUp = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType)=>{
|
|
1619
1605
|
let state = ref.current;
|
|
1620
1606
|
if (isDisabled) return false;
|
|
1621
1607
|
if (onPressUp) {
|
|
@@ -1626,17 +1612,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1626
1612
|
return event.shouldStopPropagation;
|
|
1627
1613
|
}
|
|
1628
1614
|
return true;
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
onPressUp
|
|
1632
|
-
]);
|
|
1633
|
-
let triggerPressUpEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressUp);
|
|
1634
|
-
let cancel = (useCallback)((e)=>{
|
|
1615
|
+
});
|
|
1616
|
+
let cancel = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
1635
1617
|
let state = ref.current;
|
|
1636
1618
|
if (state.isPressed && state.target) {
|
|
1637
1619
|
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
1638
1620
|
state.isPressed = false;
|
|
1639
|
-
setIsPointerPressed(null);
|
|
1640
1621
|
state.isOverTarget = false;
|
|
1641
1622
|
state.activePointerId = null;
|
|
1642
1623
|
state.pointerType = null;
|
|
@@ -1645,27 +1626,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1645
1626
|
for (let dispose of state.disposables)dispose();
|
|
1646
1627
|
state.disposables = [];
|
|
1647
1628
|
}
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
removeAllGlobalListeners,
|
|
1651
|
-
triggerPressEnd
|
|
1652
|
-
]);
|
|
1653
|
-
let cancelEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(cancel);
|
|
1654
|
-
let cancelOnPointerExit = (useCallback)((e)=>{
|
|
1629
|
+
});
|
|
1630
|
+
let cancelOnPointerExit = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
1655
1631
|
if (shouldCancelOnPointerExit) cancel(e);
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
cancel
|
|
1659
|
-
]);
|
|
1660
|
-
let triggerClick = (useCallback)((e)=>{
|
|
1661
|
-
if (isDisabled) return;
|
|
1632
|
+
});
|
|
1633
|
+
let triggerClick = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
1662
1634
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
onClick
|
|
1666
|
-
]);
|
|
1667
|
-
let triggerSyntheticClick = (useCallback)((e, target)=>{
|
|
1668
|
-
if (isDisabled) return;
|
|
1635
|
+
});
|
|
1636
|
+
let triggerSyntheticClick = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e, target)=>{
|
|
1669
1637
|
// Some third-party libraries pass in onClick instead of onPress.
|
|
1670
1638
|
// Create a fake mouse event and trigger onClick as well.
|
|
1671
1639
|
// This matches the browser's native activation behavior for certain elements (e.g. button).
|
|
@@ -1676,154 +1644,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1676
1644
|
($8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
|
|
1677
1645
|
onClick(($8a9cb279dc87e130$export$525bc4921d56d4a)(event));
|
|
1678
1646
|
}
|
|
1679
|
-
}
|
|
1680
|
-
isDisabled,
|
|
1681
|
-
onClick
|
|
1682
|
-
]);
|
|
1683
|
-
let triggerSyntheticClickEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerSyntheticClick);
|
|
1684
|
-
let [isElemKeyPressed, setIsElemKeyPressed] = (useState)(false);
|
|
1685
|
-
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
1686
|
-
let state = ref.current;
|
|
1687
|
-
if (isElemKeyPressed) {
|
|
1688
|
-
let onKeyUp = (e)=>{
|
|
1689
|
-
var _state_metaKeyEvents;
|
|
1690
|
-
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
1691
|
-
var _state_metaKeyEvents1;
|
|
1692
|
-
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1693
|
-
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1694
|
-
let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target);
|
|
1695
|
-
triggerPressEndEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
1696
|
-
if (wasPressed) triggerSyntheticClickEvent(e, state.target);
|
|
1697
|
-
removeAllGlobalListeners();
|
|
1698
|
-
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
1699
|
-
// This means the link has a role override, and the default browser behavior
|
|
1700
|
-
// only applies when using the Enter key.
|
|
1701
|
-
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
1702
|
-
// Store a hidden property on the event so we only trigger link click once,
|
|
1703
|
-
// even if there are multiple usePress instances attached to the element.
|
|
1704
|
-
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
1705
|
-
($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
1706
|
-
}
|
|
1707
|
-
state.isPressed = false;
|
|
1708
|
-
setIsElemKeyPressed(false);
|
|
1709
|
-
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
|
|
1710
|
-
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
|
|
1711
|
-
var _state_target;
|
|
1712
|
-
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
1713
|
-
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
1714
|
-
// See comment above for more info about the macOS bug causing this.
|
|
1715
|
-
let events = state.metaKeyEvents;
|
|
1716
|
-
state.metaKeyEvents = undefined;
|
|
1717
|
-
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
1718
|
-
}
|
|
1719
|
-
};
|
|
1720
|
-
// Focus may move before the key up event, so register the event on the document
|
|
1721
|
-
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
1722
|
-
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
1723
|
-
let originalTarget = state.target;
|
|
1724
|
-
let pressUp = (e)=>{
|
|
1725
|
-
if (originalTarget && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUpEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
1726
|
-
};
|
|
1727
|
-
let listener = ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp);
|
|
1728
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
1729
|
-
return ()=>{
|
|
1730
|
-
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
|
|
1731
|
-
};
|
|
1732
|
-
}
|
|
1733
|
-
}, [
|
|
1734
|
-
isElemKeyPressed,
|
|
1735
|
-
addGlobalListener,
|
|
1736
|
-
removeAllGlobalListeners,
|
|
1737
|
-
removeGlobalListener
|
|
1738
|
-
]);
|
|
1739
|
-
let [isPointerPressed, setIsPointerPressed] = (useState)(null);
|
|
1740
|
-
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
1741
|
-
let state = ref.current;
|
|
1742
|
-
if (isPointerPressed === 'pointer') {
|
|
1743
|
-
let onPointerUp = (e)=>{
|
|
1744
|
-
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
1745
|
-
if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
1746
|
-
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
1747
|
-
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
1748
|
-
// https://github.com/adobe/react-spectrum/issues/1513
|
|
1749
|
-
// https://issues.chromium.org/issues/40732224
|
|
1750
|
-
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
1751
|
-
// We work around this by triggering a click ourselves after a timeout.
|
|
1752
|
-
// This timeout is canceled during the click event in case the real one fires first.
|
|
1753
|
-
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
1754
|
-
// non-form elements without certain ARIA roles (for hover emulation).
|
|
1755
|
-
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
1756
|
-
let clicked = false;
|
|
1757
|
-
let timeout = setTimeout(()=>{
|
|
1758
|
-
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
1759
|
-
if (clicked) cancelEvent(e);
|
|
1760
|
-
else {
|
|
1761
|
-
($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
1762
|
-
state.target.click();
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
}, 80);
|
|
1766
|
-
// Use a capturing listener to track if a click occurred.
|
|
1767
|
-
// If stopPropagation is called it may never reach our handler.
|
|
1768
|
-
if (e.currentTarget) addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
1769
|
-
state.disposables.push(()=>clearTimeout(timeout));
|
|
1770
|
-
} else cancelEvent(e);
|
|
1771
|
-
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
1772
|
-
state.isOverTarget = false;
|
|
1773
|
-
}
|
|
1774
|
-
};
|
|
1775
|
-
let onPointerCancel = (e)=>{
|
|
1776
|
-
cancelEvent(e);
|
|
1777
|
-
};
|
|
1778
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
1779
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
1780
|
-
return ()=>{
|
|
1781
|
-
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
|
|
1782
|
-
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
|
|
1783
|
-
};
|
|
1784
|
-
} else if (isPointerPressed === 'mouse' && process.env.NODE_ENV === 'test') {
|
|
1785
|
-
let onMouseUp = (e)=>{
|
|
1786
|
-
// Only handle left clicks
|
|
1787
|
-
if (e.button !== 0) return;
|
|
1788
|
-
if (state.ignoreEmulatedMouseEvents) {
|
|
1789
|
-
state.ignoreEmulatedMouseEvents = false;
|
|
1790
|
-
return;
|
|
1791
|
-
}
|
|
1792
|
-
if (state.target && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, e.target) && state.pointerType != null) ;
|
|
1793
|
-
else cancelEvent(e);
|
|
1794
|
-
state.isOverTarget = false;
|
|
1795
|
-
};
|
|
1796
|
-
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
1797
|
-
return ()=>{
|
|
1798
|
-
removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
|
|
1799
|
-
};
|
|
1800
|
-
} else if (isPointerPressed === 'touch' && process.env.NODE_ENV === 'test') {
|
|
1801
|
-
let onScroll = (e)=>{
|
|
1802
|
-
if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancelEvent({
|
|
1803
|
-
currentTarget: state.target,
|
|
1804
|
-
shiftKey: false,
|
|
1805
|
-
ctrlKey: false,
|
|
1806
|
-
metaKey: false,
|
|
1807
|
-
altKey: false
|
|
1808
|
-
});
|
|
1809
|
-
};
|
|
1810
|
-
addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
1811
|
-
return ()=>{
|
|
1812
|
-
removeGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
|
|
1813
|
-
};
|
|
1814
|
-
}
|
|
1815
|
-
}, [
|
|
1816
|
-
isPointerPressed,
|
|
1817
|
-
addGlobalListener,
|
|
1818
|
-
removeGlobalListener
|
|
1819
|
-
]);
|
|
1647
|
+
});
|
|
1820
1648
|
let pressProps = (useMemo)(()=>{
|
|
1821
1649
|
let state = ref.current;
|
|
1822
1650
|
let pressProps = {
|
|
1823
1651
|
onKeyDown (e) {
|
|
1824
|
-
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
|
|
1652
|
+
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) {
|
|
1825
1653
|
var _state_metaKeyEvents;
|
|
1826
|
-
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1654
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent), e.key)) e.preventDefault();
|
|
1827
1655
|
// If the event is repeating, it may have started on a different element
|
|
1828
1656
|
// after which focus moved to the current element. Ignore these events and
|
|
1829
1657
|
// only handle the first key down event.
|
|
@@ -1831,9 +1659,16 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1831
1659
|
if (!state.isPressed && !e.repeat) {
|
|
1832
1660
|
state.target = e.currentTarget;
|
|
1833
1661
|
state.isPressed = true;
|
|
1834
|
-
setIsElemKeyPressed(true);
|
|
1835
1662
|
state.pointerType = 'keyboard';
|
|
1836
1663
|
shouldStopPropagation = triggerPressStart(e, 'keyboard');
|
|
1664
|
+
// Focus may move before the key up event, so register the event on the document
|
|
1665
|
+
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
|
|
1666
|
+
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
|
|
1667
|
+
let originalTarget = e.currentTarget;
|
|
1668
|
+
let pressUp = (e)=>{
|
|
1669
|
+
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
|
|
1670
|
+
};
|
|
1671
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'keyup', ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
|
|
1837
1672
|
}
|
|
1838
1673
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1839
1674
|
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
|
|
@@ -1847,7 +1682,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1847
1682
|
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
|
|
1848
1683
|
},
|
|
1849
1684
|
onClick (e) {
|
|
1850
|
-
if (e && !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1685
|
+
if (e && !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1851
1686
|
if (e && e.button === 0 && !state.isTriggeringEvent && !($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
|
|
1852
1687
|
let shouldStopPropagation = true;
|
|
1853
1688
|
if (isDisabled) e.preventDefault();
|
|
@@ -1873,10 +1708,41 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1873
1708
|
}
|
|
1874
1709
|
}
|
|
1875
1710
|
};
|
|
1711
|
+
let onKeyUp = (e)=>{
|
|
1712
|
+
var _state_metaKeyEvents;
|
|
1713
|
+
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
|
|
1714
|
+
var _state_metaKeyEvents1;
|
|
1715
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
|
|
1716
|
+
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1717
|
+
let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e));
|
|
1718
|
+
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
|
|
1719
|
+
if (wasPressed) triggerSyntheticClick(e, state.target);
|
|
1720
|
+
removeAllGlobalListeners();
|
|
1721
|
+
// If a link was triggered with a key other than Enter, open the URL ourselves.
|
|
1722
|
+
// This means the link has a role override, and the default browser behavior
|
|
1723
|
+
// only applies when using the Enter key.
|
|
1724
|
+
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
|
|
1725
|
+
// Store a hidden property on the event so we only trigger link click once,
|
|
1726
|
+
// even if there are multiple usePress instances attached to the element.
|
|
1727
|
+
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
|
|
1728
|
+
($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
|
|
1729
|
+
}
|
|
1730
|
+
state.isPressed = false;
|
|
1731
|
+
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
|
|
1732
|
+
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
|
|
1733
|
+
var _state_target;
|
|
1734
|
+
// If we recorded keydown events that occurred while the Meta key was pressed,
|
|
1735
|
+
// and those haven't received keyup events already, fire keyup events ourselves.
|
|
1736
|
+
// See comment above for more info about the macOS bug causing this.
|
|
1737
|
+
let events = state.metaKeyEvents;
|
|
1738
|
+
state.metaKeyEvents = undefined;
|
|
1739
|
+
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
|
|
1740
|
+
}
|
|
1741
|
+
};
|
|
1876
1742
|
if (typeof PointerEvent !== 'undefined') {
|
|
1877
1743
|
pressProps.onPointerDown = (e)=>{
|
|
1878
1744
|
// Only handle left clicks, and ignore events that bubbled through portals.
|
|
1879
|
-
if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1745
|
+
if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1880
1746
|
// iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
|
|
1881
1747
|
// Ignore and let the onClick handler take care of it instead.
|
|
1882
1748
|
// https://bugs.webkit.org/show_bug.cgi?id=222627
|
|
@@ -1889,7 +1755,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1889
1755
|
let shouldStopPropagation = true;
|
|
1890
1756
|
if (!state.isPressed) {
|
|
1891
1757
|
state.isPressed = true;
|
|
1892
|
-
setIsPointerPressed('pointer');
|
|
1893
1758
|
state.isOverTarget = true;
|
|
1894
1759
|
state.activePointerId = e.pointerId;
|
|
1895
1760
|
state.target = e.currentTarget;
|
|
@@ -1897,17 +1762,15 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1897
1762
|
shouldStopPropagation = triggerPressStart(e, state.pointerType);
|
|
1898
1763
|
// Release pointer capture so that touch interactions can leave the original target.
|
|
1899
1764
|
// This enables onPointerLeave and onPointerEnter to fire.
|
|
1900
|
-
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
1901
|
-
if ('releasePointerCapture' in target)
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
} else target.releasePointerCapture(e.pointerId);
|
|
1905
|
-
}
|
|
1765
|
+
let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent);
|
|
1766
|
+
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId);
|
|
1767
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointerup', onPointerUp, false);
|
|
1768
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointercancel', onPointerCancel, false);
|
|
1906
1769
|
}
|
|
1907
1770
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1908
1771
|
};
|
|
1909
1772
|
pressProps.onMouseDown = (e)=>{
|
|
1910
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1773
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1911
1774
|
if (e.button === 0) {
|
|
1912
1775
|
if (preventFocusOnPress) {
|
|
1913
1776
|
let dispose = ($8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
|
|
@@ -1918,7 +1781,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1918
1781
|
};
|
|
1919
1782
|
pressProps.onPointerUp = (e)=>{
|
|
1920
1783
|
// iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
|
|
1921
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) || state.pointerType === 'virtual') return;
|
|
1784
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent)) || state.pointerType === 'virtual') return;
|
|
1922
1785
|
// Only handle left clicks. If isPressed is true, delay until onClick.
|
|
1923
1786
|
if (e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || e.pointerType);
|
|
1924
1787
|
};
|
|
@@ -1935,8 +1798,43 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1935
1798
|
cancelOnPointerExit(e);
|
|
1936
1799
|
}
|
|
1937
1800
|
};
|
|
1801
|
+
let onPointerUp = (e)=>{
|
|
1802
|
+
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
1803
|
+
if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
|
|
1804
|
+
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
|
|
1805
|
+
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
|
|
1806
|
+
// https://github.com/adobe/react-spectrum/issues/1513
|
|
1807
|
+
// https://issues.chromium.org/issues/40732224
|
|
1808
|
+
// However, iOS and Android do not focus or fire onClick after a long press.
|
|
1809
|
+
// We work around this by triggering a click ourselves after a timeout.
|
|
1810
|
+
// This timeout is canceled during the click event in case the real one fires first.
|
|
1811
|
+
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
|
|
1812
|
+
// non-form elements without certain ARIA roles (for hover emulation).
|
|
1813
|
+
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
|
|
1814
|
+
let clicked = false;
|
|
1815
|
+
let timeout = setTimeout(()=>{
|
|
1816
|
+
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
1817
|
+
if (clicked) cancel(e);
|
|
1818
|
+
else {
|
|
1819
|
+
($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
|
|
1820
|
+
state.target.click();
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
}, 80);
|
|
1824
|
+
// Use a capturing listener to track if a click occurred.
|
|
1825
|
+
// If stopPropagation is called it may never reach our handler.
|
|
1826
|
+
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
|
|
1827
|
+
state.disposables.push(()=>clearTimeout(timeout));
|
|
1828
|
+
} else cancel(e);
|
|
1829
|
+
// Ignore subsequent onPointerLeave event before onClick on touch devices.
|
|
1830
|
+
state.isOverTarget = false;
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
let onPointerCancel = (e)=>{
|
|
1834
|
+
cancel(e);
|
|
1835
|
+
};
|
|
1938
1836
|
pressProps.onDragStart = (e)=>{
|
|
1939
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1837
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1940
1838
|
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
|
|
1941
1839
|
cancel(e);
|
|
1942
1840
|
};
|
|
@@ -1945,13 +1843,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1945
1843
|
// All browsers now support pointer events, but JSDOM still does not.
|
|
1946
1844
|
pressProps.onMouseDown = (e)=>{
|
|
1947
1845
|
// Only handle left clicks
|
|
1948
|
-
if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1846
|
+
if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1949
1847
|
if (state.ignoreEmulatedMouseEvents) {
|
|
1950
1848
|
e.stopPropagation();
|
|
1951
1849
|
return;
|
|
1952
1850
|
}
|
|
1953
1851
|
state.isPressed = true;
|
|
1954
|
-
setIsPointerPressed('mouse');
|
|
1955
1852
|
state.isOverTarget = true;
|
|
1956
1853
|
state.target = e.currentTarget;
|
|
1957
1854
|
state.pointerType = ($6a7db85432448f7f$export$60278871457622de)(e.nativeEvent) ? 'virtual' : 'mouse';
|
|
@@ -1962,9 +1859,10 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1962
1859
|
let dispose = ($8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
|
|
1963
1860
|
if (dispose) state.disposables.push(dispose);
|
|
1964
1861
|
}
|
|
1862
|
+
addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'mouseup', onMouseUp, false);
|
|
1965
1863
|
};
|
|
1966
1864
|
pressProps.onMouseEnter = (e)=>{
|
|
1967
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1865
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1968
1866
|
let shouldStopPropagation = true;
|
|
1969
1867
|
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
1970
1868
|
state.isOverTarget = true;
|
|
@@ -1973,7 +1871,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1973
1871
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1974
1872
|
};
|
|
1975
1873
|
pressProps.onMouseLeave = (e)=>{
|
|
1976
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1874
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1977
1875
|
let shouldStopPropagation = true;
|
|
1978
1876
|
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
1979
1877
|
state.isOverTarget = false;
|
|
@@ -1983,26 +1881,37 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
1983
1881
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1984
1882
|
};
|
|
1985
1883
|
pressProps.onMouseUp = (e)=>{
|
|
1986
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1884
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1987
1885
|
if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || 'mouse');
|
|
1988
1886
|
};
|
|
1887
|
+
let onMouseUp = (e)=>{
|
|
1888
|
+
// Only handle left clicks
|
|
1889
|
+
if (e.button !== 0) return;
|
|
1890
|
+
if (state.ignoreEmulatedMouseEvents) {
|
|
1891
|
+
state.ignoreEmulatedMouseEvents = false;
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
|
|
1895
|
+
else cancel(e);
|
|
1896
|
+
state.isOverTarget = false;
|
|
1897
|
+
};
|
|
1989
1898
|
pressProps.onTouchStart = (e)=>{
|
|
1990
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1899
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
1991
1900
|
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
|
|
1992
1901
|
if (!touch) return;
|
|
1993
1902
|
state.activePointerId = touch.identifier;
|
|
1994
1903
|
state.ignoreEmulatedMouseEvents = true;
|
|
1995
1904
|
state.isOverTarget = true;
|
|
1996
1905
|
state.isPressed = true;
|
|
1997
|
-
setIsPointerPressed('touch');
|
|
1998
1906
|
state.target = e.currentTarget;
|
|
1999
1907
|
state.pointerType = 'touch';
|
|
2000
1908
|
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$16a4697467175487)(state.target);
|
|
2001
1909
|
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
|
|
2002
1910
|
if (shouldStopPropagation) e.stopPropagation();
|
|
1911
|
+
addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(e.currentTarget), 'scroll', onScroll, true);
|
|
2003
1912
|
};
|
|
2004
1913
|
pressProps.onTouchMove = (e)=>{
|
|
2005
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1914
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
2006
1915
|
if (!state.isPressed) {
|
|
2007
1916
|
e.stopPropagation();
|
|
2008
1917
|
return;
|
|
@@ -2022,7 +1931,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
2022
1931
|
if (shouldStopPropagation) e.stopPropagation();
|
|
2023
1932
|
};
|
|
2024
1933
|
pressProps.onTouchEnd = (e)=>{
|
|
2025
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1934
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
2026
1935
|
if (!state.isPressed) {
|
|
2027
1936
|
e.stopPropagation();
|
|
2028
1937
|
return;
|
|
@@ -2036,7 +1945,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
2036
1945
|
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
|
|
2037
1946
|
if (shouldStopPropagation) e.stopPropagation();
|
|
2038
1947
|
state.isPressed = false;
|
|
2039
|
-
setIsPointerPressed(null);
|
|
2040
1948
|
state.activePointerId = null;
|
|
2041
1949
|
state.isOverTarget = false;
|
|
2042
1950
|
state.ignoreEmulatedMouseEvents = true;
|
|
@@ -2044,17 +1952,27 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
2044
1952
|
removeAllGlobalListeners();
|
|
2045
1953
|
};
|
|
2046
1954
|
pressProps.onTouchCancel = (e)=>{
|
|
2047
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1955
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
2048
1956
|
e.stopPropagation();
|
|
2049
1957
|
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
|
|
2050
1958
|
};
|
|
1959
|
+
let onScroll = (e)=>{
|
|
1960
|
+
if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancel({
|
|
1961
|
+
currentTarget: state.target,
|
|
1962
|
+
shiftKey: false,
|
|
1963
|
+
ctrlKey: false,
|
|
1964
|
+
metaKey: false,
|
|
1965
|
+
altKey: false
|
|
1966
|
+
});
|
|
1967
|
+
};
|
|
2051
1968
|
pressProps.onDragStart = (e)=>{
|
|
2052
|
-
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
|
|
1969
|
+
if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
|
|
2053
1970
|
cancel(e);
|
|
2054
1971
|
};
|
|
2055
1972
|
}
|
|
2056
1973
|
return pressProps;
|
|
2057
1974
|
}, [
|
|
1975
|
+
addGlobalListener,
|
|
2058
1976
|
isDisabled,
|
|
2059
1977
|
preventFocusOnPress,
|
|
2060
1978
|
removeAllGlobalListeners,
|
|
@@ -2159,8 +2077,7 @@ function $f6c31cce2adf654f$var$createEvent(target, e) {
|
|
|
2159
2077
|
metaKey: e.metaKey,
|
|
2160
2078
|
altKey: e.altKey,
|
|
2161
2079
|
clientX: clientX,
|
|
2162
|
-
clientY: clientY
|
|
2163
|
-
key: e.key
|
|
2080
|
+
clientY: clientY
|
|
2164
2081
|
};
|
|
2165
2082
|
}
|
|
2166
2083
|
function $f6c31cce2adf654f$var$getPointClientRect(point) {
|
|
@@ -2283,15 +2200,16 @@ const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (React__default)
|
|
|
2283
2200
|
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (React__default).forwardRef(({ children: children, ...props }, ref)=>{
|
|
2284
2201
|
let isRegistered = (useRef)(false);
|
|
2285
2202
|
let prevContext = (useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
|
|
2203
|
+
ref = ($df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
|
|
2286
2204
|
let context = ($3ef42575df84b30b$export$9d1611c77c2fe928)(prevContext || {}, {
|
|
2287
2205
|
...props,
|
|
2206
|
+
ref: ref,
|
|
2288
2207
|
register () {
|
|
2289
2208
|
isRegistered.current = true;
|
|
2290
2209
|
if (prevContext) prevContext.register();
|
|
2291
2210
|
}
|
|
2292
2211
|
});
|
|
2293
|
-
|
|
2294
|
-
($e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, context.ref);
|
|
2212
|
+
($e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, ref);
|
|
2295
2213
|
(useEffect)(()=>{
|
|
2296
2214
|
if (!isRegistered.current) {
|
|
2297
2215
|
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.");
|
|
@@ -2386,18 +2304,19 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
2386
2304
|
}
|
|
2387
2305
|
}, [
|
|
2388
2306
|
ref,
|
|
2389
|
-
isDisabled
|
|
2307
|
+
isDisabled,
|
|
2308
|
+
onPointerDown,
|
|
2309
|
+
triggerInteractOutside
|
|
2390
2310
|
]);
|
|
2391
2311
|
}
|
|
2392
2312
|
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
2393
2313
|
if (event.button > 0) return false;
|
|
2394
|
-
|
|
2395
|
-
if (target) {
|
|
2314
|
+
if (event.target) {
|
|
2396
2315
|
// if the event target is no longer in the document, ignore
|
|
2397
|
-
const ownerDocument = target.ownerDocument;
|
|
2398
|
-
if (!ownerDocument || !
|
|
2316
|
+
const ownerDocument = event.target.ownerDocument;
|
|
2317
|
+
if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;
|
|
2399
2318
|
// If the target is within a top layer element (e.g. toasts), ignore.
|
|
2400
|
-
if (target.closest('[data-react-aria-top-layer]')) return false;
|
|
2319
|
+
if (event.target.closest('[data-react-aria-top-layer]')) return false;
|
|
2401
2320
|
}
|
|
2402
2321
|
if (!ref.current) return false;
|
|
2403
2322
|
// When the event source is inside a Shadow DOM, event.target is just the shadow root.
|
|
@@ -2684,23 +2603,22 @@ function $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {
|
|
|
2684
2603
|
}
|
|
2685
2604
|
return true;
|
|
2686
2605
|
}
|
|
2687
|
-
function $9bf71ea28793e738$var$getRadiosInGroup(element) {
|
|
2688
|
-
if (!element.form) // Radio buttons outside a form - query the document
|
|
2689
|
-
return Array.from(($431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)).filter((radio)=>!radio.form);
|
|
2690
|
-
// namedItem returns RadioNodeList (iterable) for 2+ elements, but a single Element for exactly 1.
|
|
2691
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection/namedItem
|
|
2692
|
-
const radioList = element.form.elements.namedItem(element.name);
|
|
2693
|
-
let ownerWindow = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
|
|
2694
|
-
if (radioList instanceof ownerWindow.RadioNodeList) return Array.from(radioList).filter((el)=>el instanceof ownerWindow.HTMLInputElement);
|
|
2695
|
-
if (radioList instanceof ownerWindow.HTMLInputElement) return [
|
|
2696
|
-
radioList
|
|
2697
|
-
];
|
|
2698
|
-
return [];
|
|
2699
|
-
}
|
|
2700
2606
|
function $9bf71ea28793e738$var$isTabbableRadio(element) {
|
|
2701
2607
|
if (element.checked) return true;
|
|
2702
|
-
|
|
2703
|
-
|
|
2608
|
+
let radios = [];
|
|
2609
|
+
if (!element.form) radios = [
|
|
2610
|
+
...($431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)
|
|
2611
|
+
].filter((radio)=>!radio.form);
|
|
2612
|
+
else {
|
|
2613
|
+
var _element_form_elements, _element_form;
|
|
2614
|
+
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);
|
|
2615
|
+
radios = [
|
|
2616
|
+
...radioList !== null && radioList !== void 0 ? radioList : []
|
|
2617
|
+
];
|
|
2618
|
+
}
|
|
2619
|
+
if (!radios) return false;
|
|
2620
|
+
let anyChecked = radios.some((radio)=>radio.checked);
|
|
2621
|
+
return !anyChecked;
|
|
2704
2622
|
}
|
|
2705
2623
|
function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
2706
2624
|
let focusedNode = (useRef)(undefined);
|
|
@@ -2800,7 +2718,7 @@ function $9bf71ea28793e738$var$isElementInAnyScope(element) {
|
|
|
2800
2718
|
function $9bf71ea28793e738$var$isElementInScope(element, scope) {
|
|
2801
2719
|
if (!element) return false;
|
|
2802
2720
|
if (!scope) return false;
|
|
2803
|
-
return scope.some((node)=>(
|
|
2721
|
+
return scope.some((node)=>node.contains(element));
|
|
2804
2722
|
}
|
|
2805
2723
|
function $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {
|
|
2806
2724
|
// If the element is within a top layer element (e.g. toasts), always allow moving focus there.
|
|
@@ -3047,8 +2965,9 @@ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
|
3047
2965
|
// Create a TreeWalker, ensuring the root is an Element or Document
|
|
3048
2966
|
let walker = ($dfc540311bf7f109$export$4d0f8be8b12a7ef6)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {
|
|
3049
2967
|
acceptNode (node) {
|
|
2968
|
+
var _opts_from;
|
|
3050
2969
|
// Skip nodes inside the starting node.
|
|
3051
|
-
if (
|
|
2970
|
+
if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;
|
|
3052
2971
|
if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {
|
|
3053
2972
|
// If the radio is in a form, we can get all the other radios by name
|
|
3054
2973
|
if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;
|
|
@@ -3181,11 +3100,9 @@ function $55f9b1ae81f22853$export$759df0d867455a91(document) {
|
|
|
3181
3100
|
*/
|
|
3182
3101
|
|
|
3183
3102
|
|
|
3184
|
-
|
|
3185
3103
|
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
3186
3104
|
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
3187
3105
|
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
3188
|
-
let lastVisibleOverlay = (useRef)(undefined);
|
|
3189
3106
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
3190
3107
|
(useEffect)(()=>{
|
|
3191
3108
|
if (isOpen && !$a11501f3d1d39e6c$var$visibleOverlays.includes(ref)) {
|
|
@@ -3204,24 +3121,21 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
3204
3121
|
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose) onClose();
|
|
3205
3122
|
};
|
|
3206
3123
|
let onInteractOutsideStart = (e)=>{
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
|
|
3210
|
-
if (topMostOverlay === ref) {
|
|
3124
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
3125
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
3211
3126
|
e.stopPropagation();
|
|
3212
3127
|
e.preventDefault();
|
|
3213
3128
|
}
|
|
3214
3129
|
}
|
|
3215
3130
|
};
|
|
3216
3131
|
let onInteractOutside = (e)=>{
|
|
3217
|
-
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(
|
|
3132
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
3218
3133
|
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
3219
3134
|
e.stopPropagation();
|
|
3220
3135
|
e.preventDefault();
|
|
3221
3136
|
}
|
|
3222
|
-
|
|
3137
|
+
onHide();
|
|
3223
3138
|
}
|
|
3224
|
-
lastVisibleOverlay.current = undefined;
|
|
3225
3139
|
};
|
|
3226
3140
|
// Handle the escape key
|
|
3227
3141
|
let onKeyDown = (e)=>{
|
|
@@ -3255,7 +3169,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
3255
3169
|
});
|
|
3256
3170
|
let onPointerDownUnderlay = (e)=>{
|
|
3257
3171
|
// fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
|
|
3258
|
-
if (
|
|
3172
|
+
if (e.target === e.currentTarget) e.preventDefault();
|
|
3259
3173
|
};
|
|
3260
3174
|
return {
|
|
3261
3175
|
overlayProps: {
|
|
@@ -3322,6 +3236,18 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
3322
3236
|
* governing permissions and limitations under the License.
|
|
3323
3237
|
*/
|
|
3324
3238
|
const $49c51c25361d4cd2$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
3239
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
3240
|
+
const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
3241
|
+
'checkbox',
|
|
3242
|
+
'radio',
|
|
3243
|
+
'range',
|
|
3244
|
+
'color',
|
|
3245
|
+
'file',
|
|
3246
|
+
'image',
|
|
3247
|
+
'button',
|
|
3248
|
+
'submit',
|
|
3249
|
+
'reset'
|
|
3250
|
+
]);
|
|
3325
3251
|
// The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
|
|
3326
3252
|
let $49c51c25361d4cd2$var$preventScrollCount = 0;
|
|
3327
3253
|
let $49c51c25361d4cd2$var$restore;
|
|
@@ -3366,46 +3292,29 @@ function $49c51c25361d4cd2$var$preventScrollStandard() {
|
|
|
3366
3292
|
// on the window.
|
|
3367
3293
|
// 2. Set `overscroll-behavior: contain` on nested scrollable regions so they do not scroll the page when at
|
|
3368
3294
|
// the top or bottom. Work around a bug where this does not work when the element does not actually overflow
|
|
3369
|
-
// by preventing default in a `touchmove` event.
|
|
3370
|
-
// zooming or when an element contains text selection, which may allow scrolling in some cases.
|
|
3295
|
+
// by preventing default in a `touchmove` event.
|
|
3371
3296
|
// 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
|
|
3372
|
-
// 4. When
|
|
3373
|
-
//
|
|
3374
|
-
// ourselves, without scrolling the whole page.
|
|
3297
|
+
// 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
|
|
3298
|
+
// of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
|
|
3299
|
+
// into view ourselves, without scrolling the whole page.
|
|
3300
|
+
// 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
|
|
3301
|
+
// same visually, but makes the actual scroll position always zero. This is required to make all of the
|
|
3302
|
+
// above work or Safari will still try to scroll the page when focusing an input.
|
|
3303
|
+
// 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
|
|
3304
|
+
// to navigate to an input with the next/previous buttons that's outside a modal.
|
|
3375
3305
|
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
3376
|
-
// Set overflow hidden so scrollIntoViewport() (useSelectableCollection) sees isScrollPrevented and
|
|
3377
|
-
// scrolls only scroll parents instead of calling native scrollIntoView() which moves the window.
|
|
3378
|
-
let restoreOverflow = $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden');
|
|
3379
3306
|
let scrollable;
|
|
3380
|
-
let
|
|
3307
|
+
let restoreScrollableStyles;
|
|
3381
3308
|
let onTouchStart = (e)=>{
|
|
3382
3309
|
// Store the nearest scrollable parent element from the element that the user touched.
|
|
3383
|
-
|
|
3384
|
-
scrollable
|
|
3385
|
-
|
|
3386
|
-
//
|
|
3387
|
-
|
|
3388
|
-
if (
|
|
3389
|
-
// If this is a range input, allow touch move to allow user to adjust the slider value
|
|
3390
|
-
if (e.composedPath().some((el)=>el instanceof HTMLInputElement && el.type === 'range')) allowTouchMove = true;
|
|
3391
|
-
// If this is a focused input element with a selected range, allow user to drag the selection handles.
|
|
3392
|
-
if ('selectionStart' in target && 'selectionEnd' in target && target.selectionStart < target.selectionEnd && target.ownerDocument.activeElement === target) allowTouchMove = true;
|
|
3310
|
+
scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(e.target, true);
|
|
3311
|
+
if (scrollable === document.documentElement && scrollable === document.body) return;
|
|
3312
|
+
// Prevent scrolling up when at the top and scrolling down when at the bottom
|
|
3313
|
+
// of a nested scrollable area, otherwise mobile Safari will start scrolling
|
|
3314
|
+
// the window instead.
|
|
3315
|
+
if (scrollable instanceof HTMLElement && window.getComputedStyle(scrollable).overscrollBehavior === 'auto') restoreScrollableStyles = $49c51c25361d4cd2$var$setStyle(scrollable, 'overscrollBehavior', 'contain');
|
|
3393
3316
|
};
|
|
3394
|
-
// Prevent scrolling up when at the top and scrolling down when at the bottom
|
|
3395
|
-
// of a nested scrollable area, otherwise mobile Safari will start scrolling
|
|
3396
|
-
// the window instead.
|
|
3397
|
-
// This must be applied before the touchstart event as of iOS 26, so inject it as a <style> element.
|
|
3398
|
-
let style = document.createElement('style');
|
|
3399
|
-
style.textContent = `
|
|
3400
|
-
@layer {
|
|
3401
|
-
* {
|
|
3402
|
-
overscroll-behavior: contain;
|
|
3403
|
-
}
|
|
3404
|
-
}`.trim();
|
|
3405
|
-
document.head.prepend(style);
|
|
3406
3317
|
let onTouchMove = (e)=>{
|
|
3407
|
-
// Allow pinch-zooming.
|
|
3408
|
-
if (e.touches.length === 2 || allowTouchMove) return;
|
|
3409
3318
|
// Prevent scrolling the window.
|
|
3410
3319
|
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
3411
3320
|
e.preventDefault();
|
|
@@ -3419,40 +3328,53 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
3419
3328
|
// because it must be set before the touchstart event.
|
|
3420
3329
|
if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) e.preventDefault();
|
|
3421
3330
|
};
|
|
3422
|
-
let
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3331
|
+
let onTouchEnd = ()=>{
|
|
3332
|
+
if (restoreScrollableStyles) restoreScrollableStyles();
|
|
3333
|
+
};
|
|
3334
|
+
let onFocus = (e)=>{
|
|
3335
|
+
let target = e.target;
|
|
3336
|
+
if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
|
|
3337
|
+
setupStyles();
|
|
3338
|
+
// Apply a transform to trick Safari into thinking the input is at the top of the page
|
|
3339
|
+
// so it doesn't try to scroll it into view.
|
|
3340
|
+
target.style.transform = 'translateY(-2000px)';
|
|
3341
|
+
requestAnimationFrame(()=>{
|
|
3342
|
+
target.style.transform = '';
|
|
3343
|
+
// This will have prevented the browser from scrolling the focused element into view,
|
|
3344
|
+
// so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
|
|
3345
|
+
if ($49c51c25361d4cd2$var$visualViewport) {
|
|
3346
|
+
if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight) // If the keyboard is already visible, do this after one additional frame
|
|
3347
|
+
// to wait for the transform to be removed.
|
|
3348
|
+
requestAnimationFrame(()=>{
|
|
3349
|
+
$49c51c25361d4cd2$var$scrollIntoView(target);
|
|
3350
|
+
});
|
|
3351
|
+
else // Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
3352
|
+
// measure the correct position to scroll to.
|
|
3353
|
+
$49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
|
|
3354
|
+
once: true
|
|
3355
|
+
});
|
|
3356
|
+
}
|
|
3441
3357
|
});
|
|
3442
3358
|
}
|
|
3443
3359
|
};
|
|
3444
|
-
|
|
3445
|
-
let
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3360
|
+
let restoreStyles = null;
|
|
3361
|
+
let setupStyles = ()=>{
|
|
3362
|
+
if (restoreStyles) return;
|
|
3363
|
+
let onWindowScroll = ()=>{
|
|
3364
|
+
// Last resort. If the window scrolled, scroll it back to the top.
|
|
3365
|
+
// It should always be at the top because the body will have a negative margin (see below).
|
|
3366
|
+
window.scrollTo(0, 0);
|
|
3367
|
+
};
|
|
3368
|
+
// Record the original scroll position so we can restore it.
|
|
3369
|
+
// Then apply a negative margin to the body to offset it by the scroll position. This will
|
|
3370
|
+
// enable us to scroll the window to the top, which is required for the rest of this to work.
|
|
3371
|
+
let scrollX = window.pageXOffset;
|
|
3372
|
+
let scrollY = window.pageYOffset;
|
|
3373
|
+
restoreStyles = ($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`), ()=>{
|
|
3374
|
+
window.scrollTo(scrollX, scrollY);
|
|
3454
3375
|
});
|
|
3455
|
-
|
|
3376
|
+
// Scroll to the top. The negative margin on the body will make this appear the same.
|
|
3377
|
+
window.scrollTo(0, 0);
|
|
3456
3378
|
};
|
|
3457
3379
|
let removeEvents = ($ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(document, 'touchstart', onTouchStart, {
|
|
3458
3380
|
passive: false,
|
|
@@ -3460,12 +3382,15 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
3460
3382
|
}), $49c51c25361d4cd2$var$addEvent(document, 'touchmove', onTouchMove, {
|
|
3461
3383
|
passive: false,
|
|
3462
3384
|
capture: true
|
|
3463
|
-
}), $49c51c25361d4cd2$var$addEvent(document, '
|
|
3385
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'touchend', onTouchEnd, {
|
|
3386
|
+
passive: false,
|
|
3387
|
+
capture: true
|
|
3388
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'focus', onFocus, true));
|
|
3464
3389
|
return ()=>{
|
|
3465
|
-
|
|
3390
|
+
// Restore styles and scroll the page back to where it was.
|
|
3391
|
+
restoreScrollableStyles === null || restoreScrollableStyles === void 0 ? void 0 : restoreScrollableStyles();
|
|
3392
|
+
restoreStyles === null || restoreStyles === void 0 ? void 0 : restoreStyles();
|
|
3466
3393
|
removeEvents();
|
|
3467
|
-
style.remove();
|
|
3468
|
-
HTMLElement.prototype.focus = focus;
|
|
3469
3394
|
};
|
|
3470
3395
|
}
|
|
3471
3396
|
// Sets a CSS property on an element, and returns a function to revert it to the previous value.
|
|
@@ -3486,15 +3411,6 @@ function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
|
|
|
3486
3411
|
target.removeEventListener(event, handler, options);
|
|
3487
3412
|
};
|
|
3488
3413
|
}
|
|
3489
|
-
function $49c51c25361d4cd2$var$scrollIntoViewWhenReady(target, wasKeyboardVisible) {
|
|
3490
|
-
if (wasKeyboardVisible || !$49c51c25361d4cd2$var$visualViewport) // If the keyboard was already visible, scroll the target into view immediately.
|
|
3491
|
-
$49c51c25361d4cd2$var$scrollIntoView(target);
|
|
3492
|
-
else // Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
3493
|
-
// measure the correct position to scroll to.
|
|
3494
|
-
$49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
|
|
3495
|
-
once: true
|
|
3496
|
-
});
|
|
3497
|
-
}
|
|
3498
3414
|
function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
3499
3415
|
let root = document.scrollingElement || document.documentElement;
|
|
3500
3416
|
let nextTarget = target;
|
|
@@ -3502,23 +3418,16 @@ function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
|
3502
3418
|
// Find the parent scrollable element and adjust the scroll position if the target is not already in view.
|
|
3503
3419
|
let scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(nextTarget);
|
|
3504
3420
|
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
|
|
3505
|
-
let
|
|
3506
|
-
let
|
|
3507
|
-
if (
|
|
3508
|
-
let bottom = scrollableRect.bottom;
|
|
3509
|
-
if ($49c51c25361d4cd2$var$visualViewport) bottom = Math.min(bottom, $49c51c25361d4cd2$var$visualViewport.offsetTop + $49c51c25361d4cd2$var$visualViewport.height);
|
|
3510
|
-
// Center within the viewport.
|
|
3511
|
-
let adjustment = targetRect.top - scrollableRect.top - ((bottom - scrollableRect.top) / 2 - targetRect.height / 2);
|
|
3512
|
-
scrollable.scrollTo({
|
|
3513
|
-
// Clamp to the valid range to prevent over-scrolling.
|
|
3514
|
-
top: Math.max(0, Math.min(scrollable.scrollHeight - scrollable.clientHeight, scrollable.scrollTop + adjustment)),
|
|
3515
|
-
behavior: 'smooth'
|
|
3516
|
-
});
|
|
3517
|
-
}
|
|
3421
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
3422
|
+
let targetTop = nextTarget.getBoundingClientRect().top;
|
|
3423
|
+
if (targetTop > scrollableTop + nextTarget.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
|
|
3518
3424
|
}
|
|
3519
3425
|
nextTarget = scrollable.parentElement;
|
|
3520
3426
|
}
|
|
3521
3427
|
}
|
|
3428
|
+
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
3429
|
+
return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
3430
|
+
}
|
|
3522
3431
|
|
|
3523
3432
|
/*
|
|
3524
3433
|
* Copyright 2024 Adobe. All rights reserved.
|
|
@@ -3884,7 +3793,6 @@ function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
|
3884
3793
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
3885
3794
|
* governing permissions and limitations under the License.
|
|
3886
3795
|
*/
|
|
3887
|
-
|
|
3888
3796
|
const $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;
|
|
3889
3797
|
// Keeps a ref count of all hidden elements. Added to when hiding an element, and
|
|
3890
3798
|
// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
|
|
@@ -3913,17 +3821,6 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3913
3821
|
element.inert = false;
|
|
3914
3822
|
}
|
|
3915
3823
|
};
|
|
3916
|
-
let shadowRootsToWatch = new Set();
|
|
3917
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) // find all shadow roots that are ancestors of the targets
|
|
3918
|
-
// traverse upwards until the root is reached
|
|
3919
|
-
for (let target of targets){
|
|
3920
|
-
let node = target;
|
|
3921
|
-
while(node && node !== root){
|
|
3922
|
-
let root = node.getRootNode();
|
|
3923
|
-
if ('shadowRoot' in root) shadowRootsToWatch.add(root.shadowRoot);
|
|
3924
|
-
node = root.parentNode;
|
|
3925
|
-
}
|
|
3926
|
-
}
|
|
3927
3824
|
let walk = (root)=>{
|
|
3928
3825
|
// Keep live announcer and top layer elements (e.g. toasts) visible.
|
|
3929
3826
|
for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]'))visibleNodes.add(element);
|
|
@@ -3935,11 +3832,11 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3935
3832
|
if (hiddenNodes.has(node) || visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
|
|
3936
3833
|
// Skip this node but continue to children if one of the targets is inside the node.
|
|
3937
3834
|
for (let target of visibleNodes){
|
|
3938
|
-
if ((
|
|
3835
|
+
if (node.contains(target)) return NodeFilter.FILTER_SKIP;
|
|
3939
3836
|
}
|
|
3940
3837
|
return NodeFilter.FILTER_ACCEPT;
|
|
3941
3838
|
};
|
|
3942
|
-
let walker = (
|
|
3839
|
+
let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
3943
3840
|
acceptNode: acceptNode
|
|
3944
3841
|
});
|
|
3945
3842
|
// TreeWalker does not include the root.
|
|
@@ -3972,56 +3869,19 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
3972
3869
|
if (change.type !== 'childList') continue;
|
|
3973
3870
|
// If the parent element of the added nodes is not within one of the targets,
|
|
3974
3871
|
// and not already inside a hidden node, hide all of the new children.
|
|
3975
|
-
if (
|
|
3872
|
+
if (![
|
|
3976
3873
|
...visibleNodes,
|
|
3977
3874
|
...hiddenNodes
|
|
3978
|
-
].some((node)=>(
|
|
3875
|
+
].some((node)=>node.contains(change.target))) for (let node of change.addedNodes){
|
|
3979
3876
|
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
|
|
3980
3877
|
else if (node instanceof Element) walk(node);
|
|
3981
3878
|
}
|
|
3982
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
|
|
3983
|
-
// if any of the observed shadow roots were removed, stop observing them
|
|
3984
|
-
for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
|
|
3985
|
-
observer.disconnect();
|
|
3986
|
-
break;
|
|
3987
|
-
}
|
|
3988
|
-
}
|
|
3989
3879
|
}
|
|
3990
3880
|
});
|
|
3991
3881
|
observer.observe(root, {
|
|
3992
3882
|
childList: true,
|
|
3993
3883
|
subtree: true
|
|
3994
3884
|
});
|
|
3995
|
-
let shadowObservers = new Set();
|
|
3996
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowRoot of shadowRootsToWatch){
|
|
3997
|
-
// Disconnect single target instead of all https://github.com/whatwg/dom/issues/126
|
|
3998
|
-
let shadowObserver = new MutationObserver((changes)=>{
|
|
3999
|
-
for (let change of changes){
|
|
4000
|
-
if (change.type !== 'childList') continue;
|
|
4001
|
-
// If the parent element of the added nodes is not within one of the targets,
|
|
4002
|
-
// and not already inside a hidden node, hide all of the new children.
|
|
4003
|
-
if (change.target.isConnected && ![
|
|
4004
|
-
...visibleNodes,
|
|
4005
|
-
...hiddenNodes
|
|
4006
|
-
].some((node)=>($d4ee10de306f2510$export$4282f70798064fe0)(node, change.target))) for (let node of change.addedNodes){
|
|
4007
|
-
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
|
|
4008
|
-
else if (node instanceof Element) walk(node);
|
|
4009
|
-
}
|
|
4010
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
|
|
4011
|
-
// if any of the observed shadow roots were removed, stop observing them
|
|
4012
|
-
for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
|
|
4013
|
-
observer.disconnect();
|
|
4014
|
-
break;
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
}
|
|
4018
|
-
});
|
|
4019
|
-
shadowObserver.observe(shadowRoot, {
|
|
4020
|
-
childList: true,
|
|
4021
|
-
subtree: true
|
|
4022
|
-
});
|
|
4023
|
-
shadowObservers.add(shadowObserver);
|
|
4024
|
-
}
|
|
4025
3885
|
let observerWrapper = {
|
|
4026
3886
|
visibleNodes: visibleNodes,
|
|
4027
3887
|
hiddenNodes: hiddenNodes,
|
|
@@ -4038,7 +3898,6 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
|
|
|
4038
3898
|
$5e3802645cc19319$var$observerStack.push(observerWrapper);
|
|
4039
3899
|
return ()=>{
|
|
4040
3900
|
observer.disconnect();
|
|
4041
|
-
if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowObserver of shadowObservers)shadowObserver.disconnect();
|
|
4042
3901
|
for (let node of hiddenNodes){
|
|
4043
3902
|
let count = $5e3802645cc19319$var$refCountMap.get(node);
|
|
4044
3903
|
if (count == null) continue;
|
|
@@ -4213,7 +4072,6 @@ function $feb5ffebff200149$export$6aeb1680a0ae8741(collection) {
|
|
|
4213
4072
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
4214
4073
|
* governing permissions and limitations under the License.
|
|
4215
4074
|
*/
|
|
4216
|
-
|
|
4217
4075
|
/**
|
|
4218
4076
|
* Controls how long to wait before clearing the typeahead buffer.
|
|
4219
4077
|
*/ const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1000; // 1 second
|
|
@@ -4225,7 +4083,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
4225
4083
|
}).current;
|
|
4226
4084
|
let onKeyDown = (e)=>{
|
|
4227
4085
|
let character = $fb3050f43d946246$var$getStringForKey(e.key);
|
|
4228
|
-
if (!character || e.ctrlKey || e.metaKey || !
|
|
4086
|
+
if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target) || state.search.length === 0 && character === ' ') return;
|
|
4229
4087
|
// Do not propagate the Spacebar event if it's meant to be part of the search.
|
|
4230
4088
|
// When we time out, the search term becomes empty, hence the check on length.
|
|
4231
4089
|
// Trimming is to account for the case of pressing the Spacebar more than once,
|
|
@@ -4287,16 +4145,17 @@ function $fb3050f43d946246$var$getStringForKey(key) {
|
|
|
4287
4145
|
|
|
4288
4146
|
|
|
4289
4147
|
function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
4290
|
-
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
|
|
4148
|
+
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, isVirtualized: isVirtualized, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
|
|
4291
4149
|
scrollRef = ref, linkBehavior: linkBehavior = 'action' } = options;
|
|
4292
4150
|
let { direction: direction } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
4293
4151
|
let router = ($ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
|
|
4294
4152
|
let onKeyDown = (e)=>{
|
|
4153
|
+
var _ref_current;
|
|
4295
4154
|
// Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
|
|
4296
4155
|
if (e.altKey && e.key === 'Tab') e.preventDefault();
|
|
4297
4156
|
// Keyboard events bubble through portals. Don't handle keyboard events
|
|
4298
4157
|
// for elements outside the collection (e.g. menus).
|
|
4299
|
-
if (!ref.current ||
|
|
4158
|
+
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
|
|
4300
4159
|
const navigateToKey = (key, childFocus)=>{
|
|
4301
4160
|
if (key != null) {
|
|
4302
4161
|
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) {
|
|
@@ -4434,11 +4293,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4434
4293
|
last = walker.lastChild();
|
|
4435
4294
|
if (last) next = last;
|
|
4436
4295
|
}while (last);
|
|
4437
|
-
|
|
4438
|
-
// the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between
|
|
4439
|
-
// focusing the containing cell and back to the non-tabbable child element
|
|
4440
|
-
let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
4441
|
-
if (next && (!($d4ee10de306f2510$export$b4f377a2b6254582)(next) || activeElement && !($b4b717babfbb907b$export$bebd5a1431fec25d)(activeElement))) ($7215afc6de606d6b$export$de79e2c695e052f3)(next);
|
|
4296
|
+
if (next && !next.contains(document.activeElement)) ($7215afc6de606d6b$export$de79e2c695e052f3)(next);
|
|
4442
4297
|
}
|
|
4443
4298
|
break;
|
|
4444
4299
|
}
|
|
@@ -4450,7 +4305,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4450
4305
|
top: 0,
|
|
4451
4306
|
left: 0
|
|
4452
4307
|
});
|
|
4453
|
-
($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', ()=>{
|
|
4308
|
+
($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', isVirtualized ? undefined : ()=>{
|
|
4454
4309
|
var _scrollRef_current, _scrollRef_current1;
|
|
4455
4310
|
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
4456
4311
|
scrollPos.current = {
|
|
@@ -4461,11 +4316,11 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4461
4316
|
let onFocus = (e)=>{
|
|
4462
4317
|
if (manager.isFocused) {
|
|
4463
4318
|
// If a focus event bubbled through a portal, reset focus state.
|
|
4464
|
-
if (!
|
|
4319
|
+
if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
|
|
4465
4320
|
return;
|
|
4466
4321
|
}
|
|
4467
4322
|
// Focus events can bubble through portals. Ignore these events.
|
|
4468
|
-
if (!
|
|
4323
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
4469
4324
|
manager.setFocused(true);
|
|
4470
4325
|
if (manager.focusedKey == null) {
|
|
4471
4326
|
var _delegate_getLastKey, _delegate_getFirstKey;
|
|
@@ -4482,7 +4337,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4482
4337
|
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
4483
4338
|
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));
|
|
4484
4339
|
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));
|
|
4485
|
-
} else if (scrollRef.current) {
|
|
4340
|
+
} else if (!isVirtualized && scrollRef.current) {
|
|
4486
4341
|
// Restore the scroll position to what it was before.
|
|
4487
4342
|
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
4488
4343
|
scrollRef.current.scrollLeft = scrollPos.current.left;
|
|
@@ -4492,7 +4347,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4492
4347
|
let element = ($feb5ffebff200149$export$c3d8340acf92597f)(ref, manager.focusedKey);
|
|
4493
4348
|
if (element instanceof HTMLElement) {
|
|
4494
4349
|
// This prevents a flash of focus on the first/last element in the collection, or the collection itself.
|
|
4495
|
-
if (!(
|
|
4350
|
+
if (!element.contains(document.activeElement) && !shouldUseVirtualFocus) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
|
|
4496
4351
|
let modality = ($507fabe10e71c6fb$export$630ff653c5ada6a9)();
|
|
4497
4352
|
if (modality === 'keyboard') ($2f04cbc44ee30ce0$export$c826860796309d1b)(element, {
|
|
4498
4353
|
containingElement: ref.current
|
|
@@ -4502,7 +4357,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4502
4357
|
};
|
|
4503
4358
|
let onBlur = (e)=>{
|
|
4504
4359
|
// Don't set blurred and then focused again if moving focus within the collection.
|
|
4505
|
-
if (!
|
|
4360
|
+
if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
|
|
4506
4361
|
};
|
|
4507
4362
|
// Ref to track whether the first item in the collection should be automatically focused. Specifically used for autocomplete when user types
|
|
4508
4363
|
// to focus the first key AFTER the collection updates.
|
|
@@ -4518,40 +4373,44 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4518
4373
|
// If the user is typing forwards, autofocus the first option in the list.
|
|
4519
4374
|
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === 'first') shouldVirtualFocusFirst.current = true;
|
|
4520
4375
|
});
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
// after the collection updates after load
|
|
4541
|
-
shouldVirtualFocusFirst.current = false;
|
|
4542
|
-
}
|
|
4376
|
+
let updateActiveDescendant = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
4377
|
+
var _delegate_getFirstKey;
|
|
4378
|
+
var _delegate_getFirstKey1;
|
|
4379
|
+
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;
|
|
4380
|
+
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
4381
|
+
// the original active element (e.g. the autocomplete input)
|
|
4382
|
+
if (keyToFocus == null) {
|
|
4383
|
+
let previousActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
|
|
4384
|
+
($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
4385
|
+
($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
|
|
4386
|
+
// 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.
|
|
4387
|
+
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
4388
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
4389
|
+
} else {
|
|
4390
|
+
manager.setFocusedKey(keyToFocus);
|
|
4391
|
+
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
4392
|
+
// 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
|
|
4393
|
+
// after the collection updates after load
|
|
4394
|
+
shouldVirtualFocusFirst.current = false;
|
|
4543
4395
|
}
|
|
4396
|
+
});
|
|
4397
|
+
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4398
|
+
if (shouldVirtualFocusFirst.current) updateActiveDescendant();
|
|
4544
4399
|
}, [
|
|
4545
|
-
manager.collection
|
|
4400
|
+
manager.collection,
|
|
4401
|
+
updateActiveDescendant
|
|
4546
4402
|
]);
|
|
4547
|
-
|
|
4548
|
-
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4403
|
+
let resetFocusFirstFlag = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
4549
4404
|
// If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't
|
|
4550
4405
|
// accidentally move focus from under them. Skip this if the collection was empty because we might be in a load
|
|
4551
4406
|
// state and will still want to focus the first item after load
|
|
4552
4407
|
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
4408
|
+
});
|
|
4409
|
+
($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
|
|
4410
|
+
resetFocusFirstFlag();
|
|
4553
4411
|
}, [
|
|
4554
|
-
manager.focusedKey
|
|
4412
|
+
manager.focusedKey,
|
|
4413
|
+
resetFocusFirstFlag
|
|
4555
4414
|
]);
|
|
4556
4415
|
($e9faafb641e167db$export$90fc3a17d93f704c)(ref, ($5671b20cf9b562b2$export$447a38995de2c711), !shouldUseVirtualFocus ? undefined : (e)=>{
|
|
4557
4416
|
var _e_detail;
|
|
@@ -4633,7 +4492,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
4633
4492
|
onBlur: onBlur,
|
|
4634
4493
|
onMouseDown (e) {
|
|
4635
4494
|
// Ignore events that bubbled through portals.
|
|
4636
|
-
if (scrollRef.current ===
|
|
4495
|
+
if (scrollRef.current === e.target) // Prevent focus going to the collection when clicking on the scrollbar.
|
|
4637
4496
|
e.preventDefault();
|
|
4638
4497
|
}
|
|
4639
4498
|
};
|
|
@@ -4705,7 +4564,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4705
4564
|
if (isFocused && manager.isFocused) {
|
|
4706
4565
|
if (!shouldUseVirtualFocus) {
|
|
4707
4566
|
if (focus) focus();
|
|
4708
|
-
else if (
|
|
4567
|
+
else if (document.activeElement !== ref.current && ref.current) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
|
|
4709
4568
|
} else ($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
|
|
4710
4569
|
}
|
|
4711
4570
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -4725,28 +4584,20 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4725
4584
|
if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
|
|
4726
4585
|
tabIndex: key === manager.focusedKey ? 0 : -1,
|
|
4727
4586
|
onFocus (e) {
|
|
4728
|
-
if (
|
|
4587
|
+
if (e.target === ref.current) manager.setFocusedKey(key);
|
|
4729
4588
|
}
|
|
4730
4589
|
};
|
|
4731
4590
|
else if (isDisabled) itemProps.onMouseDown = (e)=>{
|
|
4732
4591
|
// Prevent focus going to the body when clicking on a disabled item.
|
|
4733
4592
|
e.preventDefault();
|
|
4734
4593
|
};
|
|
4735
|
-
(useEffect)(()=>{
|
|
4736
|
-
if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
|
|
4737
|
-
}, [
|
|
4738
|
-
manager,
|
|
4739
|
-
isDisabled,
|
|
4740
|
-
key
|
|
4741
|
-
]);
|
|
4742
4594
|
// With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
|
|
4743
4595
|
// Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
|
|
4744
4596
|
// With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
|
|
4745
4597
|
// With touch, onAction occurs on single tap, and long press enters selection mode.
|
|
4746
4598
|
let isLinkOverride = manager.isLink(key) && linkBehavior === 'override';
|
|
4747
|
-
let isActionOverride = onAction && options['UNSTABLE_itemBehavior'] === 'action';
|
|
4748
4599
|
let hasLinkAction = manager.isLink(key) && linkBehavior !== 'selection' && linkBehavior !== 'none';
|
|
4749
|
-
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride
|
|
4600
|
+
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
|
|
4750
4601
|
let allowsActions = (onAction || hasLinkAction) && !isDisabled;
|
|
4751
4602
|
let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : !allowsSelection || manager.isEmpty);
|
|
4752
4603
|
let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
|
|
@@ -4757,13 +4608,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4757
4608
|
let hadPrimaryActionOnPressStart = (useRef)(false);
|
|
4758
4609
|
let collectionItemProps = manager.getItemProps(key);
|
|
4759
4610
|
let performAction = (e)=>{
|
|
4760
|
-
if (onAction)
|
|
4761
|
-
var _ref_current;
|
|
4762
|
-
onAction();
|
|
4763
|
-
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent('react-aria-item-action', {
|
|
4764
|
-
bubbles: true
|
|
4765
|
-
}));
|
|
4766
|
-
}
|
|
4611
|
+
if (onAction) onAction();
|
|
4767
4612
|
if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
|
|
4768
4613
|
};
|
|
4769
4614
|
// By default, selection occurs on pointer down. This can be strange if selecting an
|
|
@@ -4780,13 +4625,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4780
4625
|
itemPressProps.onPressStart = (e)=>{
|
|
4781
4626
|
modality.current = e.pointerType;
|
|
4782
4627
|
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
4783
|
-
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey(
|
|
4628
|
+
if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
|
|
4784
4629
|
};
|
|
4785
4630
|
// 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.)
|
|
4786
4631
|
// Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
|
|
4787
4632
|
if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
|
|
4788
4633
|
if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
|
|
4789
|
-
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey(
|
|
4634
|
+
if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
|
|
4790
4635
|
performAction(e);
|
|
4791
4636
|
} else if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
|
|
4792
4637
|
};
|
|
@@ -4806,13 +4651,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4806
4651
|
// Select on mouse down unless there is a primary action which will occur on mouse up.
|
|
4807
4652
|
// For keyboard, select on key down. If there is an action, the Space key selects on key down,
|
|
4808
4653
|
// and the Enter key performs onAction on key up.
|
|
4809
|
-
if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey(
|
|
4654
|
+
if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
|
|
4810
4655
|
};
|
|
4811
4656
|
itemPressProps.onPress = (e)=>{
|
|
4812
4657
|
// Selection occurs on touch up. Primary actions always occur on pointer up.
|
|
4813
4658
|
// Both primary and secondary actions occur on Enter key up. The only exception
|
|
4814
4659
|
// is secondary actions, which occur on double click with a mouse.
|
|
4815
|
-
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey(
|
|
4660
|
+
if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
|
|
4816
4661
|
if (hasAction) performAction(e);
|
|
4817
4662
|
else if (allowsSelection) onSelect(e);
|
|
4818
4663
|
}
|
|
@@ -4897,11 +4742,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
4897
4742
|
hasAction: hasAction
|
|
4898
4743
|
};
|
|
4899
4744
|
}
|
|
4900
|
-
function $880e95eb8b93ba9a$var$isActionKey(
|
|
4901
|
-
|
|
4745
|
+
function $880e95eb8b93ba9a$var$isActionKey() {
|
|
4746
|
+
let event = window.event;
|
|
4747
|
+
return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
|
|
4902
4748
|
}
|
|
4903
|
-
function $880e95eb8b93ba9a$var$isSelectionKey(
|
|
4904
|
-
|
|
4749
|
+
function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
4750
|
+
let event = window.event;
|
|
4751
|
+
return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
|
|
4905
4752
|
}
|
|
4906
4753
|
|
|
4907
4754
|
/*
|
|
@@ -4924,8 +4771,8 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
4924
4771
|
let containerRect = container.getBoundingClientRect();
|
|
4925
4772
|
let itemRect = item.getBoundingClientRect();
|
|
4926
4773
|
return {
|
|
4927
|
-
x: itemRect.left - containerRect.left
|
|
4928
|
-
y: itemRect.top - containerRect.top
|
|
4774
|
+
x: itemRect.left - containerRect.left + container.scrollLeft,
|
|
4775
|
+
y: itemRect.top - containerRect.top + container.scrollTop,
|
|
4929
4776
|
width: itemRect.width,
|
|
4930
4777
|
height: itemRect.height
|
|
4931
4778
|
};
|
|
@@ -4940,12 +4787,12 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
|
4940
4787
|
}
|
|
4941
4788
|
getVisibleRect() {
|
|
4942
4789
|
let container = this.ref.current;
|
|
4943
|
-
var _container_scrollLeft, _container_scrollTop,
|
|
4790
|
+
var _container_scrollLeft, _container_scrollTop, _container_offsetWidth, _container_offsetHeight;
|
|
4944
4791
|
return {
|
|
4945
4792
|
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
4946
4793
|
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
4947
|
-
width: (
|
|
4948
|
-
height: (
|
|
4794
|
+
width: (_container_offsetWidth = container === null || container === void 0 ? void 0 : container.offsetWidth) !== null && _container_offsetWidth !== void 0 ? _container_offsetWidth : 0,
|
|
4795
|
+
height: (_container_offsetHeight = container === null || container === void 0 ? void 0 : container.offsetHeight) !== null && _container_offsetHeight !== void 0 ? _container_offsetHeight : 0
|
|
4949
4796
|
};
|
|
4950
4797
|
}
|
|
4951
4798
|
constructor(ref){
|
|
@@ -5592,7 +5439,7 @@ $a89a74a39eba465a$exports = {
|
|
|
5592
5439
|
|
|
5593
5440
|
var $edc7c66594a0ae8a$exports = {};
|
|
5594
5441
|
$edc7c66594a0ae8a$exports = {
|
|
5595
|
-
"longPressMessage": `
|
|
5442
|
+
"longPressMessage": `Premere a lungo o premere Alt + Freccia gi\xf9 per aprire il menu`
|
|
5596
5443
|
};
|
|
5597
5444
|
|
|
5598
5445
|
var $f1ab51510712db52$exports = {};
|
|
@@ -5942,7 +5789,7 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
|
5942
5789
|
|
|
5943
5790
|
|
|
5944
5791
|
function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
5945
|
-
let { id: id, key: key, closeOnSelect: closeOnSelect,
|
|
5792
|
+
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;
|
|
5946
5793
|
let isTrigger = !!hasPopup;
|
|
5947
5794
|
let isTriggerExpanded = isTrigger && props['aria-expanded'] === 'true';
|
|
5948
5795
|
var _props_isDisabled;
|
|
@@ -5979,7 +5826,6 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5979
5826
|
'aria-label': props['aria-label'],
|
|
5980
5827
|
'aria-labelledby': labelId,
|
|
5981
5828
|
'aria-describedby': [
|
|
5982
|
-
props['aria-describedby'],
|
|
5983
5829
|
descriptionId,
|
|
5984
5830
|
keyboardId
|
|
5985
5831
|
].filter(Boolean).join(' ') || undefined,
|
|
@@ -5989,8 +5835,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
5989
5835
|
};
|
|
5990
5836
|
if (selectionManager.selectionMode !== 'none' && !isTrigger) ariaProps['aria-checked'] = isSelected;
|
|
5991
5837
|
if (isVirtualized) {
|
|
5992
|
-
|
|
5993
|
-
ariaProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
|
|
5838
|
+
ariaProps['aria-posinset'] = item === null || item === void 0 ? void 0 : item.index;
|
|
5994
5839
|
ariaProps['aria-setsize'] = ($453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
|
|
5995
5840
|
}
|
|
5996
5841
|
let isPressedRef = (useRef)(false);
|
|
@@ -6016,8 +5861,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
6016
5861
|
performAction();
|
|
6017
5862
|
($ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f)(e, router, item.props.href, item === null || item === void 0 ? void 0 : item.props.routerOptions);
|
|
6018
5863
|
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);
|
|
6019
|
-
|
|
6020
|
-
shouldClose = (_ref = shouldCloseOnSelect !== null && shouldCloseOnSelect !== void 0 ? shouldCloseOnSelect : closeOnSelect) !== null && _ref !== void 0 ? _ref : shouldClose;
|
|
5864
|
+
shouldClose = closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : shouldClose;
|
|
6021
5865
|
if (onClose && !isTrigger && shouldClose) onClose();
|
|
6022
5866
|
interaction.current = null;
|
|
6023
5867
|
};
|
|
@@ -6070,10 +5914,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
6070
5914
|
pointerType: 'keyboard',
|
|
6071
5915
|
key: ' '
|
|
6072
5916
|
};
|
|
6073
|
-
|
|
6074
|
-
// click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
|
|
6075
|
-
// to the newly opened submenu's first item.
|
|
6076
|
-
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5917
|
+
e.target.click();
|
|
6077
5918
|
break;
|
|
6078
5919
|
case 'Enter':
|
|
6079
5920
|
interaction.current = {
|
|
@@ -6081,10 +5922,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
6081
5922
|
key: 'Enter'
|
|
6082
5923
|
};
|
|
6083
5924
|
// Trigger click unless this is a link. Links trigger click natively.
|
|
6084
|
-
if (
|
|
6085
|
-
// click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
|
|
6086
|
-
// to the newly opened submenu's first item.
|
|
6087
|
-
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5925
|
+
if (e.target.tagName !== 'A') e.target.click();
|
|
6088
5926
|
break;
|
|
6089
5927
|
default:
|
|
6090
5928
|
if (!isTrigger) e.continuePropagation();
|
|
@@ -6094,11 +5932,11 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
6094
5932
|
},
|
|
6095
5933
|
onKeyUp: onKeyUp
|
|
6096
5934
|
});
|
|
6097
|
-
let {
|
|
5935
|
+
let { focusProps: focusProps } = ($a1ea59d68270f0dd$export$f8168d8dd8fd66e6)({
|
|
6098
5936
|
onBlur: onBlur,
|
|
6099
5937
|
onFocus: onFocus,
|
|
6100
5938
|
onFocusChange: onFocusChange
|
|
6101
|
-
}
|
|
5939
|
+
});
|
|
6102
5940
|
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item === void 0 ? void 0 : item.props);
|
|
6103
5941
|
delete domProps.id;
|
|
6104
5942
|
let linkProps = ($ea8dcbcb9ea1b556$export$7e924b3091a3bd18)(item === null || item === void 0 ? void 0 : item.props);
|
|
@@ -6109,7 +5947,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
6109
5947
|
onFocus: itemProps.onFocus,
|
|
6110
5948
|
'data-collection': itemProps['data-collection'],
|
|
6111
5949
|
'data-key': itemProps['data-key']
|
|
6112
|
-
} : itemProps, pressProps, hoverProps, keyboardProps,
|
|
5950
|
+
} : itemProps, pressProps, hoverProps, keyboardProps, focusProps, // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
|
|
6113
5951
|
data.shouldUseVirtualFocus || isTrigger ? {
|
|
6114
5952
|
onMouseDown: (e)=>e.preventDefault()
|
|
6115
5953
|
} : undefined, isDisabled ? undefined : {
|
|
@@ -8444,7 +8282,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
|
|
|
8444
8282
|
|
|
8445
8283
|
const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ (createContext)(null);
|
|
8446
8284
|
|
|
8447
|
-
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-"};
|
|
8285
|
+
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-","spinning":"_0-VzuzHdi8o-"};
|
|
8448
8286
|
|
|
8449
8287
|
const SMALL_SCREEN_BREAKPOINT = 490;
|
|
8450
8288
|
const MENU_OFFSET = 6;
|