@bcgov/design-system-react-components 0.4.0-pr505 → 0.4.0-pr508
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/cjs/index.cjs +1059 -743
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1059 -743
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -392,11 +392,8 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
392
392
|
setAttributeNS() {}
|
|
393
393
|
removeAttribute() {}
|
|
394
394
|
constructor(type, ownerDocument){
|
|
395
|
-
super(ownerDocument)
|
|
396
|
-
this.
|
|
397
|
-
;
|
|
398
|
-
this._index = 0;
|
|
399
|
-
this.hasSetProps = false;
|
|
395
|
+
super(ownerDocument), this.nodeType = 8 // COMMENT_NODE (we'd use ELEMENT_NODE but React DevTools will fail to get its dimensions)
|
|
396
|
+
, this._index = 0, this.hasSetProps = false;
|
|
400
397
|
this.node = new ($23b9f4fcf0fe224b$export$d68d59712b04d9d1)(type, `react-aria-${++ownerDocument.nodeId}`);
|
|
401
398
|
// Start a transaction so that no updates are emitted from the collection
|
|
402
399
|
// until the props for this node are set. We don't know the real id for the
|
|
@@ -492,18 +489,8 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
492
489
|
}
|
|
493
490
|
constructor(collection){
|
|
494
491
|
// @ts-ignore
|
|
495
|
-
super(null)
|
|
496
|
-
this.
|
|
497
|
-
;
|
|
498
|
-
this.ownerDocument = this;
|
|
499
|
-
this.dirtyNodes = new Set();
|
|
500
|
-
this.isSSR = false;
|
|
501
|
-
this.nodeId = 0;
|
|
502
|
-
this.nodesByProps = new WeakMap();
|
|
503
|
-
this.isMounted = true;
|
|
504
|
-
this.mutatedNodes = new Set();
|
|
505
|
-
this.subscriptions = new Set();
|
|
506
|
-
this.transactionCount = 0;
|
|
492
|
+
super(null), this.nodeType = 11 // DOCUMENT_FRAGMENT_NODE
|
|
493
|
+
, this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.isMounted = true, this.mutatedNodes = new Set(), this.subscriptions = new Set(), this.transactionCount = 0;
|
|
507
494
|
this.collection = collection;
|
|
508
495
|
this.collectionMutated = true;
|
|
509
496
|
}
|
|
@@ -535,9 +522,7 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
535
522
|
var _rendered_props_id, _ref;
|
|
536
523
|
// @ts-ignore
|
|
537
524
|
let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
|
|
538
|
-
// eslint-disable-next-line max-depth
|
|
539
525
|
if (key == null) throw new Error('Could not determine key for item');
|
|
540
|
-
// eslint-disable-next-line max-depth
|
|
541
526
|
if (idScope) key = idScope + ':' + key;
|
|
542
527
|
// Note: only works if wrapped Item passes through id...
|
|
543
528
|
rendered = ($dbSRa$react.cloneElement)(rendered, addIdAndValue ? {
|
|
@@ -637,7 +622,6 @@ function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
|
|
|
637
622
|
return defaultId || `${prefix}-${counter}`;
|
|
638
623
|
}
|
|
639
624
|
function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
|
|
640
|
-
// @ts-ignore
|
|
641
625
|
let id = ($dbSRa$react).useId();
|
|
642
626
|
let [didSSR] = ($dbSRa$react.useState)($b5e257d569688ac6$export$535bd6ca7f90a273());
|
|
643
627
|
let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
|
|
@@ -832,7 +816,16 @@ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
|
|
|
832
816
|
let updateValue = ($dbSRa$react.useCallback)((val)=>{
|
|
833
817
|
nextId.current = val;
|
|
834
818
|
}, []);
|
|
835
|
-
if ($bdb11010cef70236$var$canUseDOM)
|
|
819
|
+
if ($bdb11010cef70236$var$canUseDOM) {
|
|
820
|
+
// TS not smart enough to know that `has` means the value exists
|
|
821
|
+
if ($bdb11010cef70236$var$idsUpdaterMap.has(res) && !$bdb11010cef70236$var$idsUpdaterMap.get(res).includes(updateValue)) $bdb11010cef70236$var$idsUpdaterMap.set(res, [
|
|
822
|
+
...$bdb11010cef70236$var$idsUpdaterMap.get(res),
|
|
823
|
+
updateValue
|
|
824
|
+
]);
|
|
825
|
+
else $bdb11010cef70236$var$idsUpdaterMap.set(res, [
|
|
826
|
+
updateValue
|
|
827
|
+
]);
|
|
828
|
+
}
|
|
836
829
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
837
830
|
let r = res;
|
|
838
831
|
return ()=>{
|
|
@@ -854,14 +847,14 @@ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
|
|
|
854
847
|
}
|
|
855
848
|
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
|
|
856
849
|
if (idA === idB) return idA;
|
|
857
|
-
let
|
|
858
|
-
if (
|
|
859
|
-
|
|
850
|
+
let setIdsA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
|
|
851
|
+
if (setIdsA) {
|
|
852
|
+
setIdsA.forEach((fn)=>fn(idB));
|
|
860
853
|
return idB;
|
|
861
854
|
}
|
|
862
|
-
let
|
|
863
|
-
if (
|
|
864
|
-
|
|
855
|
+
let setIdsB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
|
|
856
|
+
if (setIdsB) {
|
|
857
|
+
setIdsB.forEach((fn)=>fn(idA));
|
|
865
858
|
return idA;
|
|
866
859
|
}
|
|
867
860
|
return idB;
|
|
@@ -1040,7 +1033,7 @@ function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
|
1040
1033
|
return true;
|
|
1041
1034
|
}
|
|
1042
1035
|
});
|
|
1043
|
-
} catch
|
|
1036
|
+
} catch {
|
|
1044
1037
|
// Ignore
|
|
1045
1038
|
}
|
|
1046
1039
|
}
|
|
@@ -1202,8 +1195,10 @@ function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
|
1202
1195
|
}
|
|
1203
1196
|
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
1204
1197
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1198
|
+
var _props_href;
|
|
1199
|
+
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
1205
1200
|
return {
|
|
1206
|
-
'data-href': props.href ?
|
|
1201
|
+
'data-href': props.href ? href : undefined,
|
|
1207
1202
|
'data-target': props.target,
|
|
1208
1203
|
'data-rel': props.rel,
|
|
1209
1204
|
'data-download': props.download,
|
|
@@ -1213,8 +1208,10 @@ function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
|
|
|
1213
1208
|
}
|
|
1214
1209
|
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
|
|
1215
1210
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1211
|
+
var _props_href;
|
|
1212
|
+
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
|
|
1216
1213
|
return {
|
|
1217
|
-
href: (props === null || props === void 0 ? void 0 : props.href) ?
|
|
1214
|
+
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
|
|
1218
1215
|
target: props === null || props === void 0 ? void 0 : props.target,
|
|
1219
1216
|
rel: props === null || props === void 0 ? void 0 : props.rel,
|
|
1220
1217
|
download: props === null || props === void 0 ? void 0 : props.download,
|
|
@@ -1337,7 +1334,6 @@ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
|
1337
1334
|
}, [
|
|
1338
1335
|
removeGlobalListener
|
|
1339
1336
|
]);
|
|
1340
|
-
// eslint-disable-next-line arrow-body-style
|
|
1341
1337
|
($dbSRa$react.useEffect)(()=>{
|
|
1342
1338
|
return removeAllGlobalListeners;
|
|
1343
1339
|
}, [
|
|
@@ -1504,6 +1500,7 @@ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
|
|
|
1504
1500
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1505
1501
|
* governing permissions and limitations under the License.
|
|
1506
1502
|
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
1503
|
+
if (!node) return false;
|
|
1507
1504
|
let style = window.getComputedStyle(node);
|
|
1508
1505
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
1509
1506
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
@@ -1560,7 +1557,6 @@ function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
|
1560
1557
|
* governing permissions and limitations under the License.
|
|
1561
1558
|
*/
|
|
1562
1559
|
|
|
1563
|
-
// @ts-ignore
|
|
1564
1560
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
1565
1561
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
1566
1562
|
let isSSR = ($b5e257d569688ac6$export$535bd6ca7f90a273)();
|
|
@@ -1725,7 +1721,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
1725
1721
|
return sum;
|
|
1726
1722
|
}
|
|
1727
1723
|
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
1728
|
-
if (document.contains(targetElement)) {
|
|
1724
|
+
if (targetElement && document.contains(targetElement)) {
|
|
1729
1725
|
let root = document.scrollingElement || document.documentElement;
|
|
1730
1726
|
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
|
|
1731
1727
|
// 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
|
|
@@ -2403,8 +2399,9 @@ function $e1995378a142960e$var$CollectionRoot({ children: children }) {
|
|
|
2403
2399
|
|
|
2404
2400
|
const $7135fc7d473fd974$export$d40e14dec8b060a8 = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
2405
2401
|
const $7135fc7d473fd974$export$6e2c8f0811a474ce = /*#__PURE__*/ ($e1995378a142960e$export$e953bb1cd0f19726)('section', (props, ref, section)=>{
|
|
2406
|
-
let { render: render } = ($dbSRa$react.useContext)($7135fc7d473fd974$export$d40e14dec8b060a8);
|
|
2407
|
-
|
|
2402
|
+
let { name: name, render: render } = ($dbSRa$react.useContext)($7135fc7d473fd974$export$d40e14dec8b060a8);
|
|
2403
|
+
console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
|
|
2404
|
+
return render(props, ref, section, 'react-aria-Section');
|
|
2408
2405
|
});
|
|
2409
2406
|
const $7135fc7d473fd974$export$a164736487e3f0ae = {
|
|
2410
2407
|
CollectionRoot ({ collection: collection, renderDropIndicator: renderDropIndicator }) {
|
|
@@ -2664,7 +2661,6 @@ let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
|
|
|
2664
2661
|
function $14c0b72509d70225$export$16a4697467175487(target) {
|
|
2665
2662
|
if (($c87311424ea30a05$export$fedb369cb70207f1)()) {
|
|
2666
2663
|
if ($14c0b72509d70225$var$state === 'default') {
|
|
2667
|
-
// eslint-disable-next-line no-restricted-globals
|
|
2668
2664
|
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(target);
|
|
2669
2665
|
$14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
|
|
2670
2666
|
documentObject.documentElement.style.webkitUserSelect = 'none';
|
|
@@ -2691,7 +2687,6 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
|
2691
2687
|
($bbed8b41f857bcc0$export$24490316f764c430)(()=>{
|
|
2692
2688
|
// Avoid race conditions
|
|
2693
2689
|
if ($14c0b72509d70225$var$state === 'restoring') {
|
|
2694
|
-
// eslint-disable-next-line no-restricted-globals
|
|
2695
2690
|
const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(target);
|
|
2696
2691
|
if (documentObject.documentElement.style.webkitUserSelect === 'none') documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
|
|
2697
2692
|
$14c0b72509d70225$var$savedUserSelect = '';
|
|
@@ -3030,7 +3025,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3030
3025
|
}
|
|
3031
3026
|
// Due to browser inconsistencies, especially on mobile browsers, we prevent
|
|
3032
3027
|
// default on pointer down and handle focusing the pressable element ourselves.
|
|
3033
|
-
if ($f6c31cce2adf654f$var$
|
|
3028
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
|
|
3034
3029
|
state.pointerType = e.pointerType;
|
|
3035
3030
|
let shouldStopPropagation = true;
|
|
3036
3031
|
if (!state.isPressed) {
|
|
@@ -3053,7 +3048,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3053
3048
|
// Chrome and Firefox on touch Windows devices require mouse down events
|
|
3054
3049
|
// to be canceled in addition to pointer events, or an extra asynchronous
|
|
3055
3050
|
// focus event will be fired.
|
|
3056
|
-
if ($f6c31cce2adf654f$var$
|
|
3051
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
|
|
3057
3052
|
e.stopPropagation();
|
|
3058
3053
|
}
|
|
3059
3054
|
};
|
|
@@ -3091,8 +3086,23 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3091
3086
|
state.pointerType = null;
|
|
3092
3087
|
removeAllGlobalListeners();
|
|
3093
3088
|
if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
|
|
3089
|
+
// Prevent subsequent touchend event from triggering onClick on unrelated elements on Android. See below.
|
|
3090
|
+
// Both 'touch' and 'pen' pointerTypes trigger onTouchEnd, but 'mouse' does not.
|
|
3091
|
+
if ('ontouchend' in state.target && e.pointerType !== 'mouse') addGlobalListener(state.target, 'touchend', onTouchEnd, {
|
|
3092
|
+
once: true
|
|
3093
|
+
});
|
|
3094
3094
|
}
|
|
3095
3095
|
};
|
|
3096
|
+
// This is a workaround for an Android Chrome/Firefox issue where click events are fired on an incorrect element
|
|
3097
|
+
// if the original target is removed during onPointerUp (before onClick).
|
|
3098
|
+
// https://github.com/adobe/react-spectrum/issues/1513
|
|
3099
|
+
// https://issues.chromium.org/issues/40732224
|
|
3100
|
+
// Note: this event must be registered directly on the element, not via React props in order to work.
|
|
3101
|
+
// https://github.com/facebook/react/issues/9809
|
|
3102
|
+
let onTouchEnd = (e)=>{
|
|
3103
|
+
// Don't preventDefault if we actually want the default (e.g. submit/link click).
|
|
3104
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultUp(e.currentTarget)) e.preventDefault();
|
|
3105
|
+
};
|
|
3096
3106
|
let onPointerCancel = (e)=>{
|
|
3097
3107
|
cancel(e);
|
|
3098
3108
|
};
|
|
@@ -3107,7 +3117,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3107
3117
|
if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
|
|
3108
3118
|
// Due to browser inconsistencies, especially on mobile browsers, we prevent
|
|
3109
3119
|
// default on mouse down and handle focusing the pressable element ourselves.
|
|
3110
|
-
if ($f6c31cce2adf654f$var$
|
|
3120
|
+
if ($f6c31cce2adf654f$var$shouldPreventDefaultDown(e.currentTarget)) e.preventDefault();
|
|
3111
3121
|
if (state.ignoreEmulatedMouseEvents) {
|
|
3112
3122
|
e.stopPropagation();
|
|
3113
3123
|
return;
|
|
@@ -3248,7 +3258,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
3248
3258
|
triggerPressUp
|
|
3249
3259
|
]);
|
|
3250
3260
|
// Remove user-select: none in case component unmounts immediately after pressStart
|
|
3251
|
-
// eslint-disable-next-line arrow-body-style
|
|
3252
3261
|
($dbSRa$react.useEffect)(()=>{
|
|
3253
3262
|
return ()=>{
|
|
3254
3263
|
var _ref_current_target;
|
|
@@ -3344,16 +3353,20 @@ function $f6c31cce2adf654f$var$isOverTarget(point, target) {
|
|
|
3344
3353
|
let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
|
|
3345
3354
|
return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
|
|
3346
3355
|
}
|
|
3347
|
-
function $f6c31cce2adf654f$var$
|
|
3356
|
+
function $f6c31cce2adf654f$var$shouldPreventDefaultDown(target) {
|
|
3348
3357
|
// We cannot prevent default if the target is a draggable element.
|
|
3349
3358
|
return !(target instanceof HTMLElement) || !target.hasAttribute('draggable');
|
|
3350
3359
|
}
|
|
3351
|
-
function $f6c31cce2adf654f$var$
|
|
3352
|
-
if (target instanceof HTMLInputElement) return
|
|
3360
|
+
function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) {
|
|
3361
|
+
if (target instanceof HTMLInputElement) return false;
|
|
3353
3362
|
if (target instanceof HTMLButtonElement) return target.type !== 'submit' && target.type !== 'reset';
|
|
3354
3363
|
if ($f6c31cce2adf654f$var$isHTMLAnchorLink(target)) return false;
|
|
3355
3364
|
return true;
|
|
3356
3365
|
}
|
|
3366
|
+
function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
|
|
3367
|
+
if (target instanceof HTMLInputElement) return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
|
|
3368
|
+
return $f6c31cce2adf654f$var$shouldPreventDefaultUp(target);
|
|
3369
|
+
}
|
|
3357
3370
|
const $f6c31cce2adf654f$var$nonTextInputTypes = new Set([
|
|
3358
3371
|
'checkbox',
|
|
3359
3372
|
'radio',
|
|
@@ -3463,7 +3476,6 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
3463
3476
|
observer: null
|
|
3464
3477
|
});
|
|
3465
3478
|
// Clean up MutationObserver on unmount. See below.
|
|
3466
|
-
// eslint-disable-next-line arrow-body-style
|
|
3467
3479
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
3468
3480
|
const state = stateRef.current;
|
|
3469
3481
|
return ()=>{
|
|
@@ -4561,7 +4573,6 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
4561
4573
|
contain
|
|
4562
4574
|
]);
|
|
4563
4575
|
// This is a useLayoutEffect so it is guaranteed to run before our async synthetic blur
|
|
4564
|
-
// eslint-disable-next-line arrow-body-style
|
|
4565
4576
|
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
4566
4577
|
return ()=>{
|
|
4567
4578
|
if (raf.current) cancelAnimationFrame(raf.current);
|
|
@@ -4603,12 +4614,12 @@ function $9bf71ea28793e738$var$isAncestorScope(ancestor, scope) {
|
|
|
4603
4614
|
function $9bf71ea28793e738$var$focusElement(element, scroll = false) {
|
|
4604
4615
|
if (element != null && !scroll) try {
|
|
4605
4616
|
(0, $6a99195332edec8b$export$80f3e147d781571c)(element);
|
|
4606
|
-
} catch
|
|
4617
|
+
} catch {
|
|
4607
4618
|
// ignore
|
|
4608
4619
|
}
|
|
4609
4620
|
else if (element != null) try {
|
|
4610
4621
|
element.focus();
|
|
4611
|
-
} catch
|
|
4622
|
+
} catch {
|
|
4612
4623
|
// ignore
|
|
4613
4624
|
}
|
|
4614
4625
|
}
|
|
@@ -4715,7 +4726,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
4715
4726
|
let onKeyDown = (e)=>{
|
|
4716
4727
|
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
4717
4728
|
let focusedElement = ownerDocument.activeElement;
|
|
4718
|
-
if (!$9bf71ea28793e738$var$
|
|
4729
|
+
if (!$9bf71ea28793e738$var$isElementInChildScope(focusedElement, scopeRef) || !$9bf71ea28793e738$var$shouldRestoreFocus(scopeRef)) return;
|
|
4719
4730
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
4720
4731
|
if (!treeNode) return;
|
|
4721
4732
|
let nodeToRestore = treeNode.nodeToRestore;
|
|
@@ -4732,11 +4743,11 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
4732
4743
|
}
|
|
4733
4744
|
// If there is no next element, or it is outside the current scope, move focus to the
|
|
4734
4745
|
// next element after the node to restore to instead.
|
|
4735
|
-
if ((!nextElement || !$9bf71ea28793e738$var$
|
|
4746
|
+
if ((!nextElement || !$9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef)) && nodeToRestore) {
|
|
4736
4747
|
walker.currentNode = nodeToRestore;
|
|
4737
4748
|
// Skip over elements within the scope, in case the scope immediately follows the node to restore.
|
|
4738
4749
|
do nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
|
|
4739
|
-
while ($9bf71ea28793e738$var$
|
|
4750
|
+
while ($9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef));
|
|
4740
4751
|
e.preventDefault();
|
|
4741
4752
|
e.stopPropagation();
|
|
4742
4753
|
if (nextElement) $9bf71ea28793e738$var$focusElement(nextElement, true);
|
|
@@ -4769,8 +4780,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
4769
4780
|
if (!treeNode) return;
|
|
4770
4781
|
let nodeToRestore = treeNode.nodeToRestore;
|
|
4771
4782
|
// if we already lost focus to the body and this was the active scope, then we should attempt to restore
|
|
4772
|
-
if (restoreFocus && nodeToRestore &&
|
|
4773
|
-
($9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current) || ownerDocument.activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
|
|
4783
|
+
if (restoreFocus && nodeToRestore && (ownerDocument.activeElement && $9bf71ea28793e738$var$isElementInChildScope(ownerDocument.activeElement, scopeRef) || ownerDocument.activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
|
|
4774
4784
|
// freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it
|
|
4775
4785
|
let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();
|
|
4776
4786
|
requestAnimationFrame(()=>{
|
|
@@ -5092,7 +5102,6 @@ const $148a7a147e38ea7f$var$RTL_LANGS = new Set([
|
|
|
5092
5102
|
]);
|
|
5093
5103
|
function $148a7a147e38ea7f$export$702d680b21cbd764(localeString) {
|
|
5094
5104
|
// If the Intl.Locale API is available, use it to get the locale's text direction.
|
|
5095
|
-
// @ts-ignore
|
|
5096
5105
|
if (Intl.Locale) {
|
|
5097
5106
|
let locale = new Intl.Locale(localeString).maximize();
|
|
5098
5107
|
// Use the text info object to get the direction if possible.
|
|
@@ -5127,11 +5136,10 @@ const $1e5a04cdaf7d1af8$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
|
|
|
5127
5136
|
function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
|
|
5128
5137
|
let locale = typeof window !== 'undefined' && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
|
|
5129
5138
|
try {
|
|
5130
|
-
// @ts-ignore
|
|
5131
5139
|
Intl.DateTimeFormat.supportedLocalesOf([
|
|
5132
5140
|
locale
|
|
5133
5141
|
]);
|
|
5134
|
-
} catch
|
|
5142
|
+
} catch {
|
|
5135
5143
|
locale = 'en-US';
|
|
5136
5144
|
}
|
|
5137
5145
|
return {
|
|
@@ -5377,8 +5385,7 @@ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
|
|
|
5377
5385
|
|
|
5378
5386
|
|
|
5379
5387
|
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
5380
|
-
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: // @ts-ignore - undocumented
|
|
5381
|
-
preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
|
|
5388
|
+
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
|
|
5382
5389
|
allowFocusWhenDisabled, // @ts-ignore
|
|
5383
5390
|
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
|
|
5384
5391
|
let additionalProps;
|
|
@@ -5389,7 +5396,7 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
5389
5396
|
else additionalProps = {
|
|
5390
5397
|
role: 'button',
|
|
5391
5398
|
tabIndex: isDisabled ? undefined : 0,
|
|
5392
|
-
href: elementType === 'a' && isDisabled ?
|
|
5399
|
+
href: elementType === 'a' && !isDisabled ? href : undefined,
|
|
5393
5400
|
target: elementType === 'a' ? target : undefined,
|
|
5394
5401
|
type: elementType === 'input' ? type : undefined,
|
|
5395
5402
|
disabled: elementType === 'input' ? isDisabled : undefined,
|
|
@@ -5441,8 +5448,20 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
5441
5448
|
*/ /* Inspired by https://github.com/AlmeroSteyn/react-aria-live */ const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7000;
|
|
5442
5449
|
let $319e236875307eab$var$liveAnnouncer = null;
|
|
5443
5450
|
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = 'assertive', timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
5444
|
-
if (!$319e236875307eab$var$liveAnnouncer)
|
|
5445
|
-
|
|
5451
|
+
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
5452
|
+
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
5453
|
+
// wait for the live announcer regions to be added to the dom, then announce
|
|
5454
|
+
// otherwise Safari won't announce the message if it's added too quickly
|
|
5455
|
+
// found most times less than 100ms were not consistent when announcing with Safari
|
|
5456
|
+
// IS_REACT_ACT_ENVIRONMENT is used by React 18. Previous versions checked for the `jest` global.
|
|
5457
|
+
// https://github.com/reactwg/react-18/discussions/102
|
|
5458
|
+
// if we're in a test environment, announce without waiting
|
|
5459
|
+
// @ts-ignore
|
|
5460
|
+
if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) setTimeout(()=>{
|
|
5461
|
+
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
5462
|
+
}, 100);
|
|
5463
|
+
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
5464
|
+
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
5446
5465
|
}
|
|
5447
5466
|
// LiveAnnouncer is implemented using vanilla DOM, not React. That's because as of React 18
|
|
5448
5467
|
// ReactDOM.render is deprecated, and the replacement, ReactDOM.createRoot is moved into a
|
|
@@ -5451,6 +5470,10 @@ function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = 'ass
|
|
|
5451
5470
|
// is simple enough to implement without React, so that's what we do here.
|
|
5452
5471
|
// See this discussion for more details: https://github.com/reactwg/react-18/discussions/125#discussioncomment-2382638
|
|
5453
5472
|
class $319e236875307eab$var$LiveAnnouncer {
|
|
5473
|
+
isAttached() {
|
|
5474
|
+
var _this_node;
|
|
5475
|
+
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
5476
|
+
}
|
|
5454
5477
|
createLog(ariaLive) {
|
|
5455
5478
|
let node = document.createElement('div');
|
|
5456
5479
|
node.setAttribute('role', 'log');
|
|
@@ -5464,146 +5487,52 @@ class $319e236875307eab$var$LiveAnnouncer {
|
|
|
5464
5487
|
this.node = null;
|
|
5465
5488
|
}
|
|
5466
5489
|
announce(message, assertiveness = 'assertive', timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
5490
|
+
var _this_assertiveLog, _this_politeLog;
|
|
5467
5491
|
if (!this.node) return;
|
|
5468
5492
|
let node = document.createElement('div');
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5493
|
+
if (typeof message === 'object') {
|
|
5494
|
+
// To read an aria-labelledby, the element must have an appropriate role, such as img.
|
|
5495
|
+
node.setAttribute('role', 'img');
|
|
5496
|
+
node.setAttribute('aria-labelledby', message['aria-labelledby']);
|
|
5497
|
+
} else node.textContent = message;
|
|
5498
|
+
if (assertiveness === 'assertive') (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
5499
|
+
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
5472
5500
|
if (message !== '') setTimeout(()=>{
|
|
5473
5501
|
node.remove();
|
|
5474
5502
|
}, timeout);
|
|
5475
5503
|
}
|
|
5476
5504
|
clear(assertiveness) {
|
|
5477
5505
|
if (!this.node) return;
|
|
5478
|
-
if (!assertiveness || assertiveness === 'assertive') this.assertiveLog.innerHTML = '';
|
|
5479
|
-
if (!assertiveness || assertiveness === 'polite') this.politeLog.innerHTML = '';
|
|
5506
|
+
if ((!assertiveness || assertiveness === 'assertive') && this.assertiveLog) this.assertiveLog.innerHTML = '';
|
|
5507
|
+
if ((!assertiveness || assertiveness === 'polite') && this.politeLog) this.politeLog.innerHTML = '';
|
|
5480
5508
|
}
|
|
5481
5509
|
constructor(){
|
|
5482
|
-
this.node =
|
|
5483
|
-
this.
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
5507
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
5508
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5509
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
5510
|
-
*
|
|
5511
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
5512
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
5513
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
5514
|
-
* governing permissions and limitations under the License.
|
|
5515
|
-
*/
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
5519
|
-
let { validationBehavior: validationBehavior, focus: focus } = props;
|
|
5520
|
-
// This is a useLayoutEffect so that it runs before the useEffect in useFormValidationState, which commits the validation change.
|
|
5521
|
-
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
5522
|
-
if (validationBehavior === 'native' && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
5523
|
-
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(' ') || 'Invalid value.' : '';
|
|
5524
|
-
ref.current.setCustomValidity(errorMessage);
|
|
5525
|
-
// Prevent default tooltip for validation message.
|
|
5526
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=605277
|
|
5527
|
-
if (!ref.current.hasAttribute('title')) ref.current.title = '';
|
|
5528
|
-
if (!state.realtimeValidation.isInvalid) state.updateValidation($e93e671b31057976$var$getNativeValidity(ref.current));
|
|
5529
|
-
}
|
|
5530
|
-
});
|
|
5531
|
-
let onReset = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
5532
|
-
state.resetValidation();
|
|
5533
|
-
});
|
|
5534
|
-
let onInvalid = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
5535
|
-
var _ref_current;
|
|
5536
|
-
// Only commit validation if we are not already displaying one.
|
|
5537
|
-
// This avoids clearing server errors that the user didn't actually fix.
|
|
5538
|
-
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
5539
|
-
// Auto focus the first invalid input in a form, unless the error already had its default prevented.
|
|
5540
|
-
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
5541
|
-
if (!e.defaultPrevented && ref && form && $e93e671b31057976$var$getFirstInvalidInput(form) === ref.current) {
|
|
5542
|
-
var _ref_current1;
|
|
5543
|
-
if (focus) focus();
|
|
5544
|
-
else (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.focus();
|
|
5545
|
-
// Always show focus ring.
|
|
5546
|
-
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5510
|
+
this.node = null;
|
|
5511
|
+
this.assertiveLog = null;
|
|
5512
|
+
this.politeLog = null;
|
|
5513
|
+
if (typeof document !== 'undefined') {
|
|
5514
|
+
this.node = document.createElement('div');
|
|
5515
|
+
this.node.dataset.liveAnnouncer = 'true';
|
|
5516
|
+
// copied from VisuallyHidden
|
|
5517
|
+
Object.assign(this.node.style, {
|
|
5518
|
+
border: 0,
|
|
5519
|
+
clip: 'rect(0 0 0 0)',
|
|
5520
|
+
clipPath: 'inset(50%)',
|
|
5521
|
+
height: '1px',
|
|
5522
|
+
margin: '-1px',
|
|
5523
|
+
overflow: 'hidden',
|
|
5524
|
+
padding: 0,
|
|
5525
|
+
position: 'absolute',
|
|
5526
|
+
width: '1px',
|
|
5527
|
+
whiteSpace: 'nowrap'
|
|
5528
|
+
});
|
|
5529
|
+
this.assertiveLog = this.createLog('assertive');
|
|
5530
|
+
this.node.appendChild(this.assertiveLog);
|
|
5531
|
+
this.politeLog = this.createLog('polite');
|
|
5532
|
+
this.node.appendChild(this.politeLog);
|
|
5533
|
+
document.body.prepend(this.node);
|
|
5547
5534
|
}
|
|
5548
|
-
// Prevent default browser error UI from appearing.
|
|
5549
|
-
e.preventDefault();
|
|
5550
|
-
});
|
|
5551
|
-
let onChange = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
5552
|
-
state.commitValidation();
|
|
5553
|
-
});
|
|
5554
|
-
($dbSRa$react.useEffect)(()=>{
|
|
5555
|
-
let input = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
5556
|
-
if (!input) return;
|
|
5557
|
-
let form = input.form;
|
|
5558
|
-
input.addEventListener('invalid', onInvalid);
|
|
5559
|
-
input.addEventListener('change', onChange);
|
|
5560
|
-
form === null || form === void 0 ? void 0 : form.addEventListener('reset', onReset);
|
|
5561
|
-
return ()=>{
|
|
5562
|
-
input.removeEventListener('invalid', onInvalid);
|
|
5563
|
-
input.removeEventListener('change', onChange);
|
|
5564
|
-
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', onReset);
|
|
5565
|
-
};
|
|
5566
|
-
}, [
|
|
5567
|
-
ref,
|
|
5568
|
-
onInvalid,
|
|
5569
|
-
onChange,
|
|
5570
|
-
onReset,
|
|
5571
|
-
validationBehavior
|
|
5572
|
-
]);
|
|
5573
|
-
}
|
|
5574
|
-
function $e93e671b31057976$var$getValidity(input) {
|
|
5575
|
-
// The native ValidityState object is live, meaning each property is a getter that returns the current state.
|
|
5576
|
-
// We need to create a snapshot of the validity state at the time this function is called to avoid unpredictable React renders.
|
|
5577
|
-
let validity = input.validity;
|
|
5578
|
-
return {
|
|
5579
|
-
badInput: validity.badInput,
|
|
5580
|
-
customError: validity.customError,
|
|
5581
|
-
patternMismatch: validity.patternMismatch,
|
|
5582
|
-
rangeOverflow: validity.rangeOverflow,
|
|
5583
|
-
rangeUnderflow: validity.rangeUnderflow,
|
|
5584
|
-
stepMismatch: validity.stepMismatch,
|
|
5585
|
-
tooLong: validity.tooLong,
|
|
5586
|
-
tooShort: validity.tooShort,
|
|
5587
|
-
typeMismatch: validity.typeMismatch,
|
|
5588
|
-
valueMissing: validity.valueMissing,
|
|
5589
|
-
valid: validity.valid
|
|
5590
|
-
};
|
|
5591
|
-
}
|
|
5592
|
-
function $e93e671b31057976$var$getNativeValidity(input) {
|
|
5593
|
-
return {
|
|
5594
|
-
isInvalid: !input.validity.valid,
|
|
5595
|
-
validationDetails: $e93e671b31057976$var$getValidity(input),
|
|
5596
|
-
validationErrors: input.validationMessage ? [
|
|
5597
|
-
input.validationMessage
|
|
5598
|
-
] : []
|
|
5599
|
-
};
|
|
5600
|
-
}
|
|
5601
|
-
function $e93e671b31057976$var$getFirstInvalidInput(form) {
|
|
5602
|
-
for(let i = 0; i < form.elements.length; i++){
|
|
5603
|
-
let element = form.elements[i];
|
|
5604
|
-
if (!element.validity.valid) return element;
|
|
5605
5535
|
}
|
|
5606
|
-
return null;
|
|
5607
5536
|
}
|
|
5608
5537
|
|
|
5609
5538
|
/*
|
|
@@ -5668,11 +5597,15 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
|
5668
5597
|
validationDetails: $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE
|
|
5669
5598
|
} : null;
|
|
5670
5599
|
// Perform custom client side validation.
|
|
5671
|
-
let clientError = ($dbSRa$react.useMemo)(()
|
|
5600
|
+
let clientError = ($dbSRa$react.useMemo)(()=>{
|
|
5601
|
+
if (!validate || value == null) return null;
|
|
5602
|
+
let validateErrors = $e5be200c675c3b3a$var$runValidate(validate, value);
|
|
5603
|
+
return $e5be200c675c3b3a$var$getValidationResult(validateErrors);
|
|
5604
|
+
}, [
|
|
5672
5605
|
validate,
|
|
5673
5606
|
value
|
|
5674
5607
|
]);
|
|
5675
|
-
if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid) builtinValidation =
|
|
5608
|
+
if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid) builtinValidation = undefined;
|
|
5676
5609
|
// Get relevant server errors from the form.
|
|
5677
5610
|
let serverErrors = ($dbSRa$react.useContext)($e5be200c675c3b3a$export$571b5131b7e65c11);
|
|
5678
5611
|
let serverErrorMessages = ($dbSRa$react.useMemo)(()=>{
|
|
@@ -5764,7 +5697,7 @@ function $e5be200c675c3b3a$var$getValidationResult(errors) {
|
|
|
5764
5697
|
}
|
|
5765
5698
|
function $e5be200c675c3b3a$var$isEqualValidation(a, b) {
|
|
5766
5699
|
if (a === b) return true;
|
|
5767
|
-
return a && b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a, i)=>a === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v])=>b.validationDetails[k] === v);
|
|
5700
|
+
return !!a && !!b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a, i)=>a === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v])=>b.validationDetails[k] === v);
|
|
5768
5701
|
}
|
|
5769
5702
|
function $e5be200c675c3b3a$export$75ee7c75d68f5b0e(...results) {
|
|
5770
5703
|
let errors = new Set();
|
|
@@ -5789,6 +5722,110 @@ function $e5be200c675c3b3a$export$75ee7c75d68f5b0e(...results) {
|
|
|
5789
5722
|
};
|
|
5790
5723
|
}
|
|
5791
5724
|
|
|
5725
|
+
/*
|
|
5726
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
5727
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
5728
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5729
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
5730
|
+
*
|
|
5731
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
5732
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
5733
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
5734
|
+
* governing permissions and limitations under the License.
|
|
5735
|
+
*/
|
|
5736
|
+
|
|
5737
|
+
|
|
5738
|
+
function $e93e671b31057976$export$b8473d3665f3a75a(props, state, ref) {
|
|
5739
|
+
let { validationBehavior: validationBehavior, focus: focus } = props;
|
|
5740
|
+
// This is a useLayoutEffect so that it runs before the useEffect in useFormValidationState, which commits the validation change.
|
|
5741
|
+
($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
5742
|
+
if (validationBehavior === 'native' && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
5743
|
+
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(' ') || 'Invalid value.' : '';
|
|
5744
|
+
ref.current.setCustomValidity(errorMessage);
|
|
5745
|
+
// Prevent default tooltip for validation message.
|
|
5746
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=605277
|
|
5747
|
+
if (!ref.current.hasAttribute('title')) ref.current.title = '';
|
|
5748
|
+
if (!state.realtimeValidation.isInvalid) state.updateValidation($e93e671b31057976$var$getNativeValidity(ref.current));
|
|
5749
|
+
}
|
|
5750
|
+
});
|
|
5751
|
+
let onReset = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
5752
|
+
state.resetValidation();
|
|
5753
|
+
});
|
|
5754
|
+
let onInvalid = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
|
|
5755
|
+
var _ref_current;
|
|
5756
|
+
// Only commit validation if we are not already displaying one.
|
|
5757
|
+
// This avoids clearing server errors that the user didn't actually fix.
|
|
5758
|
+
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
5759
|
+
// Auto focus the first invalid input in a form, unless the error already had its default prevented.
|
|
5760
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
|
|
5761
|
+
if (!e.defaultPrevented && ref && form && $e93e671b31057976$var$getFirstInvalidInput(form) === ref.current) {
|
|
5762
|
+
var _ref_current1;
|
|
5763
|
+
if (focus) focus();
|
|
5764
|
+
else (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.focus();
|
|
5765
|
+
// Always show focus ring.
|
|
5766
|
+
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
5767
|
+
}
|
|
5768
|
+
// Prevent default browser error UI from appearing.
|
|
5769
|
+
e.preventDefault();
|
|
5770
|
+
});
|
|
5771
|
+
let onChange = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
|
|
5772
|
+
state.commitValidation();
|
|
5773
|
+
});
|
|
5774
|
+
($dbSRa$react.useEffect)(()=>{
|
|
5775
|
+
let input = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
5776
|
+
if (!input) return;
|
|
5777
|
+
let form = input.form;
|
|
5778
|
+
input.addEventListener('invalid', onInvalid);
|
|
5779
|
+
input.addEventListener('change', onChange);
|
|
5780
|
+
form === null || form === void 0 ? void 0 : form.addEventListener('reset', onReset);
|
|
5781
|
+
return ()=>{
|
|
5782
|
+
input.removeEventListener('invalid', onInvalid);
|
|
5783
|
+
input.removeEventListener('change', onChange);
|
|
5784
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', onReset);
|
|
5785
|
+
};
|
|
5786
|
+
}, [
|
|
5787
|
+
ref,
|
|
5788
|
+
onInvalid,
|
|
5789
|
+
onChange,
|
|
5790
|
+
onReset,
|
|
5791
|
+
validationBehavior
|
|
5792
|
+
]);
|
|
5793
|
+
}
|
|
5794
|
+
function $e93e671b31057976$var$getValidity(input) {
|
|
5795
|
+
// The native ValidityState object is live, meaning each property is a getter that returns the current state.
|
|
5796
|
+
// We need to create a snapshot of the validity state at the time this function is called to avoid unpredictable React renders.
|
|
5797
|
+
let validity = input.validity;
|
|
5798
|
+
return {
|
|
5799
|
+
badInput: validity.badInput,
|
|
5800
|
+
customError: validity.customError,
|
|
5801
|
+
patternMismatch: validity.patternMismatch,
|
|
5802
|
+
rangeOverflow: validity.rangeOverflow,
|
|
5803
|
+
rangeUnderflow: validity.rangeUnderflow,
|
|
5804
|
+
stepMismatch: validity.stepMismatch,
|
|
5805
|
+
tooLong: validity.tooLong,
|
|
5806
|
+
tooShort: validity.tooShort,
|
|
5807
|
+
typeMismatch: validity.typeMismatch,
|
|
5808
|
+
valueMissing: validity.valueMissing,
|
|
5809
|
+
valid: validity.valid
|
|
5810
|
+
};
|
|
5811
|
+
}
|
|
5812
|
+
function $e93e671b31057976$var$getNativeValidity(input) {
|
|
5813
|
+
return {
|
|
5814
|
+
isInvalid: !input.validity.valid,
|
|
5815
|
+
validationDetails: $e93e671b31057976$var$getValidity(input),
|
|
5816
|
+
validationErrors: input.validationMessage ? [
|
|
5817
|
+
input.validationMessage
|
|
5818
|
+
] : []
|
|
5819
|
+
};
|
|
5820
|
+
}
|
|
5821
|
+
function $e93e671b31057976$var$getFirstInvalidInput(form) {
|
|
5822
|
+
for(let i = 0; i < form.elements.length; i++){
|
|
5823
|
+
let element = form.elements[i];
|
|
5824
|
+
if (!element.validity.valid) return element;
|
|
5825
|
+
}
|
|
5826
|
+
return null;
|
|
5827
|
+
}
|
|
5828
|
+
|
|
5792
5829
|
/*
|
|
5793
5830
|
* Copyright 2020 Adobe. All rights reserved.
|
|
5794
5831
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -5870,6 +5907,8 @@ function $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref) {
|
|
|
5870
5907
|
|
|
5871
5908
|
|
|
5872
5909
|
|
|
5910
|
+
|
|
5911
|
+
|
|
5873
5912
|
function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
5874
5913
|
// Create validation state here because it doesn't make sense to add to general useToggleState.
|
|
5875
5914
|
let validationState = ($e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
@@ -5888,8 +5927,18 @@ function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
5888
5927
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
5889
5928
|
if (inputRef.current) inputRef.current.indeterminate = !!isIndeterminate;
|
|
5890
5929
|
});
|
|
5930
|
+
// Reset validation state on label press for checkbox with a hidden input.
|
|
5931
|
+
let { pressProps: pressProps } = ($f6c31cce2adf654f$export$45712eceda6fad21)({
|
|
5932
|
+
isDisabled: isDisabled || isReadOnly,
|
|
5933
|
+
onPress () {
|
|
5934
|
+
// @ts-expect-error
|
|
5935
|
+
let { [($e5be200c675c3b3a$export$a763b9476acd3eb)]: groupValidationState } = props;
|
|
5936
|
+
let { commitValidation: commitValidation } = groupValidationState ? groupValidationState : validationState;
|
|
5937
|
+
commitValidation();
|
|
5938
|
+
}
|
|
5939
|
+
});
|
|
5891
5940
|
return {
|
|
5892
|
-
labelProps: labelProps,
|
|
5941
|
+
labelProps: ($3ef42575df84b30b$export$9d1611c77c2fe928)(labelProps, pressProps),
|
|
5893
5942
|
inputProps: {
|
|
5894
5943
|
...inputProps,
|
|
5895
5944
|
checked: isSelected,
|
|
@@ -6171,13 +6220,175 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
6171
6220
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
6172
6221
|
* governing permissions and limitations under the License.
|
|
6173
6222
|
*/
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6223
|
+
|
|
6224
|
+
|
|
6225
|
+
const $5c3e21d68f1c4674$var$styles = {
|
|
6226
|
+
border: 0,
|
|
6227
|
+
clip: 'rect(0 0 0 0)',
|
|
6228
|
+
clipPath: 'inset(50%)',
|
|
6229
|
+
height: '1px',
|
|
6230
|
+
margin: '-1px',
|
|
6231
|
+
overflow: 'hidden',
|
|
6232
|
+
padding: 0,
|
|
6233
|
+
position: 'absolute',
|
|
6234
|
+
width: '1px',
|
|
6235
|
+
whiteSpace: 'nowrap'
|
|
6179
6236
|
};
|
|
6180
|
-
|
|
6237
|
+
function $5c3e21d68f1c4674$export$a966af930f325cab(props = {}) {
|
|
6238
|
+
let { style: style, isFocusable: isFocusable } = props;
|
|
6239
|
+
let [isFocused, setFocused] = ($dbSRa$react.useState)(false);
|
|
6240
|
+
let { focusWithinProps: focusWithinProps } = ($9ab94262bd0047c7$export$420e68273165f4ec)({
|
|
6241
|
+
isDisabled: !isFocusable,
|
|
6242
|
+
onFocusWithinChange: (val)=>setFocused(val)
|
|
6243
|
+
});
|
|
6244
|
+
// If focused, don't hide the element.
|
|
6245
|
+
let combinedStyles = ($dbSRa$react.useMemo)(()=>{
|
|
6246
|
+
if (isFocused) return style;
|
|
6247
|
+
else if (style) return {
|
|
6248
|
+
...$5c3e21d68f1c4674$var$styles,
|
|
6249
|
+
...style
|
|
6250
|
+
};
|
|
6251
|
+
else return $5c3e21d68f1c4674$var$styles;
|
|
6252
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6253
|
+
}, [
|
|
6254
|
+
isFocused
|
|
6255
|
+
]);
|
|
6256
|
+
return {
|
|
6257
|
+
visuallyHiddenProps: {
|
|
6258
|
+
...focusWithinProps,
|
|
6259
|
+
style: combinedStyles
|
|
6260
|
+
}
|
|
6261
|
+
};
|
|
6262
|
+
}
|
|
6263
|
+
function $5c3e21d68f1c4674$export$439d29a4e110a164(props) {
|
|
6264
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6265
|
+
let { children: children, elementType: Element = 'div', isFocusable: isFocusable, style: style, ...otherProps } = props;
|
|
6266
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = $5c3e21d68f1c4674$export$a966af930f325cab(props);
|
|
6267
|
+
return /*#__PURE__*/ ($dbSRa$react).createElement(Element, ($3ef42575df84b30b$export$9d1611c77c2fe928)(otherProps, visuallyHiddenProps), children);
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6270
|
+
/*
|
|
6271
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6272
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6273
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
6274
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6275
|
+
*
|
|
6276
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
6277
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
6278
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
6279
|
+
* governing permissions and limitations under the License.
|
|
6280
|
+
*/
|
|
6281
|
+
|
|
6282
|
+
|
|
6283
|
+
|
|
6284
|
+
|
|
6285
|
+
|
|
6286
|
+
|
|
6287
|
+
function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
|
|
6288
|
+
let { inputElementType: inputElementType = 'input', isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = 'text', validationBehavior: validationBehavior = 'aria' } = props;
|
|
6289
|
+
let [value, setValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue || '', props.onChange);
|
|
6290
|
+
let { focusableProps: focusableProps } = ($e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
|
|
6291
|
+
let validationState = ($e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
6292
|
+
...props,
|
|
6293
|
+
value: value
|
|
6294
|
+
});
|
|
6295
|
+
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = validationState.displayValidation;
|
|
6296
|
+
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = ($2baaea4c71418dea$export$294aa081a6c6f55d)({
|
|
6297
|
+
...props,
|
|
6298
|
+
isInvalid: isInvalid,
|
|
6299
|
+
errorMessage: props.errorMessage || validationErrors
|
|
6300
|
+
});
|
|
6301
|
+
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
6302
|
+
labelable: true
|
|
6303
|
+
});
|
|
6304
|
+
const inputOnlyProps = {
|
|
6305
|
+
type: type,
|
|
6306
|
+
pattern: props.pattern
|
|
6307
|
+
};
|
|
6308
|
+
($99facab73266f662$export$5add1d006293d136)(ref, value, setValue);
|
|
6309
|
+
($e93e671b31057976$export$b8473d3665f3a75a)(props, validationState, ref);
|
|
6310
|
+
($dbSRa$react.useEffect)(()=>{
|
|
6311
|
+
// This works around a React/Chrome bug that prevents textarea elements from validating when controlled.
|
|
6312
|
+
// We prevent React from updating defaultValue (i.e. children) of textarea when `value` changes,
|
|
6313
|
+
// which causes Chrome to skip validation. Only updating `value` is ok in our case since our
|
|
6314
|
+
// textareas are always controlled. React is planning on removing this synchronization in a
|
|
6315
|
+
// future major version.
|
|
6316
|
+
// https://github.com/facebook/react/issues/19474
|
|
6317
|
+
// https://github.com/facebook/react/issues/11896
|
|
6318
|
+
if (ref.current instanceof ($431fbd86ca7dc216$export$f21a1ffae260145a)(ref.current).HTMLTextAreaElement) {
|
|
6319
|
+
let input = ref.current;
|
|
6320
|
+
Object.defineProperty(input, 'defaultValue', {
|
|
6321
|
+
get: ()=>input.value,
|
|
6322
|
+
set: ()=>{},
|
|
6323
|
+
configurable: true
|
|
6324
|
+
});
|
|
6325
|
+
}
|
|
6326
|
+
}, [
|
|
6327
|
+
ref
|
|
6328
|
+
]);
|
|
6329
|
+
return {
|
|
6330
|
+
labelProps: labelProps,
|
|
6331
|
+
inputProps: ($3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, inputElementType === 'input' ? inputOnlyProps : undefined, {
|
|
6332
|
+
disabled: isDisabled,
|
|
6333
|
+
readOnly: isReadOnly,
|
|
6334
|
+
required: isRequired && validationBehavior === 'native',
|
|
6335
|
+
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
|
|
6336
|
+
'aria-invalid': isInvalid || undefined,
|
|
6337
|
+
'aria-errormessage': props['aria-errormessage'],
|
|
6338
|
+
'aria-activedescendant': props['aria-activedescendant'],
|
|
6339
|
+
'aria-autocomplete': props['aria-autocomplete'],
|
|
6340
|
+
'aria-haspopup': props['aria-haspopup'],
|
|
6341
|
+
value: value,
|
|
6342
|
+
onChange: (e)=>setValue(e.target.value),
|
|
6343
|
+
autoComplete: props.autoComplete,
|
|
6344
|
+
autoCapitalize: props.autoCapitalize,
|
|
6345
|
+
maxLength: props.maxLength,
|
|
6346
|
+
minLength: props.minLength,
|
|
6347
|
+
name: props.name,
|
|
6348
|
+
placeholder: props.placeholder,
|
|
6349
|
+
inputMode: props.inputMode,
|
|
6350
|
+
// Clipboard events
|
|
6351
|
+
onCopy: props.onCopy,
|
|
6352
|
+
onCut: props.onCut,
|
|
6353
|
+
onPaste: props.onPaste,
|
|
6354
|
+
// Composition events
|
|
6355
|
+
onCompositionEnd: props.onCompositionEnd,
|
|
6356
|
+
onCompositionStart: props.onCompositionStart,
|
|
6357
|
+
onCompositionUpdate: props.onCompositionUpdate,
|
|
6358
|
+
// Selection events
|
|
6359
|
+
onSelect: props.onSelect,
|
|
6360
|
+
// Input events
|
|
6361
|
+
onBeforeInput: props.onBeforeInput,
|
|
6362
|
+
onInput: props.onInput,
|
|
6363
|
+
...focusableProps,
|
|
6364
|
+
...fieldProps
|
|
6365
|
+
}),
|
|
6366
|
+
descriptionProps: descriptionProps,
|
|
6367
|
+
errorMessageProps: errorMessageProps,
|
|
6368
|
+
isInvalid: isInvalid,
|
|
6369
|
+
validationErrors: validationErrors,
|
|
6370
|
+
validationDetails: validationDetails
|
|
6371
|
+
};
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
/*
|
|
6375
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6376
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6377
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
6378
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6379
|
+
*
|
|
6380
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
6381
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
6382
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
6383
|
+
* governing permissions and limitations under the License.
|
|
6384
|
+
*/
|
|
6385
|
+
const $edcf132a9284368a$var$AXIS = {
|
|
6386
|
+
top: 'top',
|
|
6387
|
+
bottom: 'top',
|
|
6388
|
+
left: 'left',
|
|
6389
|
+
right: 'left'
|
|
6390
|
+
};
|
|
6391
|
+
const $edcf132a9284368a$var$FLIPPED_DIRECTION = {
|
|
6181
6392
|
top: 'bottom',
|
|
6182
6393
|
bottom: 'top',
|
|
6183
6394
|
left: 'right',
|
|
@@ -6196,12 +6407,12 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
|
6196
6407
|
height: 'totalHeight'
|
|
6197
6408
|
};
|
|
6198
6409
|
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
6199
|
-
|
|
6200
|
-
let $edcf132a9284368a$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
6410
|
+
let $edcf132a9284368a$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
6201
6411
|
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
6202
6412
|
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
6203
6413
|
let scroll = {};
|
|
6204
|
-
|
|
6414
|
+
var _visualViewport_scale;
|
|
6415
|
+
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;
|
|
6205
6416
|
if (containerNode.tagName === 'BODY') {
|
|
6206
6417
|
let documentElement = document.documentElement;
|
|
6207
6418
|
totalWidth = documentElement.clientWidth;
|
|
@@ -6233,8 +6444,10 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
|
6233
6444
|
// before pinch zoom happens
|
|
6234
6445
|
scroll.top = 0;
|
|
6235
6446
|
scroll.left = 0;
|
|
6236
|
-
|
|
6237
|
-
|
|
6447
|
+
var _visualViewport_pageTop;
|
|
6448
|
+
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;
|
|
6449
|
+
var _visualViewport_pageLeft;
|
|
6450
|
+
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;
|
|
6238
6451
|
}
|
|
6239
6452
|
return {
|
|
6240
6453
|
width: width,
|
|
@@ -6263,7 +6476,8 @@ boundaryDimensions, // The dimensions of the containing block element that the p
|
|
|
6263
6476
|
// is portaled somewhere other than the body and has an ancestor with
|
|
6264
6477
|
// position: relative/absolute, it will be different.
|
|
6265
6478
|
containerDimensions, padding, containerOffsetWithBoundary) {
|
|
6266
|
-
|
|
6479
|
+
var _containerDimensions_scroll_axis;
|
|
6480
|
+
let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0;
|
|
6267
6481
|
// The height/width of the boundary. Matches the axis along which we are adjusting the overlay position
|
|
6268
6482
|
let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
6269
6483
|
// Calculate the edges of the boundary (accomodating for the boundary padding) and the edges of the overlay.
|
|
@@ -6308,14 +6522,16 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
6308
6522
|
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
6309
6523
|
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
6310
6524
|
let position = {};
|
|
6525
|
+
var _childOffset_crossAxis;
|
|
6311
6526
|
// button position
|
|
6312
|
-
position[crossAxis] = childOffset[crossAxis];
|
|
6527
|
+
position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !== void 0 ? _childOffset_crossAxis : 0;
|
|
6528
|
+
var _childOffset_crossSize, _overlaySize_crossSize, _childOffset_crossSize1, _overlaySize_crossSize1;
|
|
6313
6529
|
if (crossPlacement === 'center') // + (button size / 2) - (overlay size / 2)
|
|
6314
6530
|
// at this point the overlay center should match the button center
|
|
6315
|
-
position[crossAxis] += (childOffset[crossSize] - overlaySize[crossSize]) / 2;
|
|
6531
|
+
position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !== void 0 ? _childOffset_crossSize : 0) - ((_overlaySize_crossSize = overlaySize[crossSize]) !== null && _overlaySize_crossSize !== void 0 ? _overlaySize_crossSize : 0)) / 2;
|
|
6316
6532
|
else if (crossPlacement !== crossAxis) // + (button size) - (overlay size)
|
|
6317
6533
|
// at this point the overlay bottom should match the button bottom
|
|
6318
|
-
position[crossAxis] += childOffset[crossSize] - overlaySize[crossSize];
|
|
6534
|
+
position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !== void 0 ? _childOffset_crossSize1 : 0) - ((_overlaySize_crossSize1 = overlaySize[crossSize]) !== null && _overlaySize_crossSize1 !== void 0 ? _overlaySize_crossSize1 : 0);
|
|
6319
6535
|
/* else {
|
|
6320
6536
|
the overlay top should match the button top
|
|
6321
6537
|
} */
|
|
@@ -6338,23 +6554,26 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
6338
6554
|
}
|
|
6339
6555
|
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
6340
6556
|
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height];
|
|
6557
|
+
var _position_bottom;
|
|
6341
6558
|
// 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
|
|
6342
6559
|
// used in computePosition.
|
|
6343
|
-
let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - position.bottom - overlayHeight);
|
|
6560
|
+
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);
|
|
6561
|
+
var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1;
|
|
6344
6562
|
let maxHeight = heightGrowthDirection !== 'top' ? // We want the distance between the top of the overlay to the bottom of the boundary
|
|
6345
|
-
Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top // this is the
|
|
6346
|
-
-
|
|
6347
|
-
- (margins.top + margins.bottom + padding // save additional space for margin and padding
|
|
6563
|
+
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
|
|
6564
|
+
- (((_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
|
|
6348
6565
|
)) : Math.max(0, overlayTop + overlayHeight // this is the bottom of the overlay
|
|
6349
|
-
- (boundaryDimensions.top + boundaryDimensions.scroll.top // this is the top of the boundary
|
|
6350
|
-
) - (margins.top + margins.bottom + padding // save additional space for margin and padding
|
|
6566
|
+
- (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
|
|
6567
|
+
) - (((_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
|
|
6351
6568
|
));
|
|
6352
6569
|
return Math.min(boundaryDimensions.height - padding * 2, maxHeight);
|
|
6353
6570
|
}
|
|
6354
6571
|
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
6355
6572
|
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
6356
|
-
|
|
6357
|
-
return Math.max(0,
|
|
6573
|
+
var _boundaryDimensions_scroll_axis, _margins_axis;
|
|
6574
|
+
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);
|
|
6575
|
+
var _margins_axis1;
|
|
6576
|
+
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);
|
|
6358
6577
|
}
|
|
6359
6578
|
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
6360
6579
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
@@ -6400,8 +6619,9 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
6400
6619
|
let preferredArrowPosition = childOffset[crossAxis] + .5 * childOffset[crossSize] - position[crossAxis] - margins[$edcf132a9284368a$var$AXIS[crossAxis]];
|
|
6401
6620
|
// Min/Max position limits for the arrow with respect to the overlay
|
|
6402
6621
|
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
6622
|
+
var _margins_left, _margins_right, _margins_top, _margins_bottom;
|
|
6403
6623
|
// overlaySize[crossSize] - margins = true size of the overlay
|
|
6404
|
-
const overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === 'left' ? margins.left + margins.right : margins.top + margins.bottom;
|
|
6624
|
+
const overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === 'left' ? ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0) : ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
|
|
6405
6625
|
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
6406
6626
|
// Min/Max position limits for the arrow with respect to the trigger/overlay anchor element
|
|
6407
6627
|
// Same margin accomodation done here as well as for the preferredArrowPosition
|
|
@@ -6432,8 +6652,10 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
6432
6652
|
}
|
|
6433
6653
|
let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode);
|
|
6434
6654
|
let margins = $edcf132a9284368a$var$getMargins(overlayNode);
|
|
6435
|
-
|
|
6436
|
-
overlaySize.
|
|
6655
|
+
var _margins_left, _margins_right;
|
|
6656
|
+
overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0);
|
|
6657
|
+
var _margins_top, _margins_bottom;
|
|
6658
|
+
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);
|
|
6437
6659
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
6438
6660
|
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
6439
6661
|
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
|
|
@@ -6506,9 +6728,7 @@ function $edcf132a9284368a$var$getContainingBlock(node) {
|
|
|
6506
6728
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
6507
6729
|
function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
6508
6730
|
let style = window.getComputedStyle(node);
|
|
6509
|
-
return style.transform !== 'none' || /transform|perspective/.test(style.willChange) || style.filter !== 'none' || style.contain === 'paint' ||
|
|
6510
|
-
'backdropFilter' in style && style.backdropFilter !== 'none' || // @ts-ignore
|
|
6511
|
-
'WebkitBackdropFilter' in style && style.WebkitBackdropFilter !== 'none';
|
|
6731
|
+
return style.transform !== 'none' || /transform|perspective/.test(style.willChange) || style.filter !== 'none' || style.contain === 'paint' || 'backdropFilter' in style && style.backdropFilter !== 'none' || 'WebkitBackdropFilter' in style && style.WebkitBackdropFilter !== 'none';
|
|
6512
6732
|
}
|
|
6513
6733
|
|
|
6514
6734
|
/*
|
|
@@ -6565,18 +6785,11 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
6565
6785
|
|
|
6566
6786
|
|
|
6567
6787
|
|
|
6568
|
-
|
|
6569
|
-
let $2a41e45df1593e64$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
6788
|
+
let $2a41e45df1593e64$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
6570
6789
|
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
6571
6790
|
let { direction: direction } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
6572
6791
|
let { arrowSize: arrowSize = 0, targetRef: targetRef, overlayRef: overlayRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
6573
|
-
let [position, setPosition] = ($dbSRa$react.useState)(
|
|
6574
|
-
position: {},
|
|
6575
|
-
arrowOffsetLeft: undefined,
|
|
6576
|
-
arrowOffsetTop: undefined,
|
|
6577
|
-
maxHeight: undefined,
|
|
6578
|
-
placement: undefined
|
|
6579
|
-
});
|
|
6792
|
+
let [position, setPosition] = ($dbSRa$react.useState)(null);
|
|
6580
6793
|
let deps = [
|
|
6581
6794
|
shouldUpdatePosition,
|
|
6582
6795
|
placement,
|
|
@@ -6612,17 +6825,20 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
6612
6825
|
// changes, the focused element appears to stay in the same position.
|
|
6613
6826
|
let anchor = null;
|
|
6614
6827
|
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
|
|
6615
|
-
|
|
6828
|
+
var _document_activeElement;
|
|
6829
|
+
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
|
|
6616
6830
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
6831
|
+
var _anchorRect_top;
|
|
6617
6832
|
// Anchor from the top if the offset is in the top half of the scrollable element,
|
|
6618
6833
|
// otherwise anchor from the bottom.
|
|
6619
6834
|
anchor = {
|
|
6620
6835
|
type: 'top',
|
|
6621
|
-
offset: anchorRect.top - scrollRect.top
|
|
6836
|
+
offset: ((_anchorRect_top = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top
|
|
6622
6837
|
};
|
|
6623
6838
|
if (anchor.offset > scrollRect.height / 2) {
|
|
6624
6839
|
anchor.type = 'bottom';
|
|
6625
|
-
|
|
6840
|
+
var _anchorRect_bottom;
|
|
6841
|
+
anchor.offset = ((_anchorRect_bottom = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom;
|
|
6626
6842
|
}
|
|
6627
6843
|
}
|
|
6628
6844
|
// Always reset the overlay's previous max height if not defined by the user so that we can compensate for
|
|
@@ -6649,6 +6865,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
6649
6865
|
arrowSize: arrowSize,
|
|
6650
6866
|
arrowBoundaryOffset: arrowBoundaryOffset
|
|
6651
6867
|
});
|
|
6868
|
+
if (!position.position) return;
|
|
6652
6869
|
// Modify overlay styles directly so positioning happens immediately without the need of a second render
|
|
6653
6870
|
// This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers
|
|
6654
6871
|
overlay.style.top = '';
|
|
@@ -6656,9 +6873,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
6656
6873
|
overlay.style.left = '';
|
|
6657
6874
|
overlay.style.right = '';
|
|
6658
6875
|
Object.keys(position.position).forEach((key)=>overlay.style[key] = position.position[key] + 'px');
|
|
6659
|
-
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' :
|
|
6876
|
+
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
|
|
6660
6877
|
// Restore scroll position relative to anchor element.
|
|
6661
|
-
if (anchor) {
|
|
6878
|
+
if (anchor && document.activeElement && scrollRef.current) {
|
|
6662
6879
|
let anchorRect = document.activeElement.getBoundingClientRect();
|
|
6663
6880
|
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
6664
6881
|
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
@@ -6711,7 +6928,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
6711
6928
|
updatePosition
|
|
6712
6929
|
]);
|
|
6713
6930
|
let close = ($dbSRa$react.useCallback)(()=>{
|
|
6714
|
-
if (!isResizing.current) onClose();
|
|
6931
|
+
if (!isResizing.current) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
6715
6932
|
}, [
|
|
6716
6933
|
onClose,
|
|
6717
6934
|
isResizing
|
|
@@ -6723,23 +6940,23 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
6723
6940
|
isOpen: isOpen,
|
|
6724
6941
|
onClose: onClose && close
|
|
6725
6942
|
});
|
|
6726
|
-
var _position_maxHeight;
|
|
6943
|
+
var _position_maxHeight, _position_placement;
|
|
6727
6944
|
return {
|
|
6728
6945
|
overlayProps: {
|
|
6729
6946
|
style: {
|
|
6730
6947
|
position: 'absolute',
|
|
6731
6948
|
zIndex: 100000,
|
|
6732
|
-
...position.position,
|
|
6733
|
-
maxHeight: (_position_maxHeight = position.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : '100vh'
|
|
6949
|
+
...position === null || position === void 0 ? void 0 : position.position,
|
|
6950
|
+
maxHeight: (_position_maxHeight = position === null || position === void 0 ? void 0 : position.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : '100vh'
|
|
6734
6951
|
}
|
|
6735
6952
|
},
|
|
6736
|
-
placement: position.placement,
|
|
6953
|
+
placement: (_position_placement = position === null || position === void 0 ? void 0 : position.placement) !== null && _position_placement !== void 0 ? _position_placement : null,
|
|
6737
6954
|
arrowProps: {
|
|
6738
6955
|
'aria-hidden': 'true',
|
|
6739
6956
|
role: 'presentation',
|
|
6740
6957
|
style: {
|
|
6741
|
-
left: position.arrowOffsetLeft,
|
|
6742
|
-
top: position.arrowOffsetTop
|
|
6958
|
+
left: position === null || position === void 0 ? void 0 : position.arrowOffsetLeft,
|
|
6959
|
+
top: position === null || position === void 0 ? void 0 : position.arrowOffsetTop
|
|
6743
6960
|
}
|
|
6744
6961
|
},
|
|
6745
6962
|
updatePosition: updatePosition
|
|
@@ -6819,7 +7036,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
6819
7036
|
// Handle clicking outside the overlay to close it
|
|
6820
7037
|
($e0b6e0b68ec7f50f$export$872b660ac5a1ff98)({
|
|
6821
7038
|
ref: ref,
|
|
6822
|
-
onInteractOutside: isDismissable && isOpen ? onInteractOutside :
|
|
7039
|
+
onInteractOutside: isDismissable && isOpen ? onInteractOutside : undefined,
|
|
6823
7040
|
onInteractOutsideStart: onInteractOutsideStart
|
|
6824
7041
|
});
|
|
6825
7042
|
let { focusWithinProps: focusWithinProps } = ($9ab94262bd0047c7$export$420e68273165f4ec)({
|
|
@@ -6835,7 +7052,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
6835
7052
|
// do not close the outer overlay. At this point, the active scope should
|
|
6836
7053
|
// still be the outer overlay, since blur events run before focus.
|
|
6837
7054
|
if (!e.relatedTarget || ($9bf71ea28793e738$export$1258395f99bf9cbf)(e.relatedTarget)) return;
|
|
6838
|
-
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
|
|
7055
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
6839
7056
|
}
|
|
6840
7057
|
});
|
|
6841
7058
|
let onPointerDownUnderlay = (e)=>{
|
|
@@ -6886,7 +7103,7 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
6886
7103
|
triggerProps: {
|
|
6887
7104
|
'aria-haspopup': ariaHasPopup,
|
|
6888
7105
|
'aria-expanded': isOpen,
|
|
6889
|
-
'aria-controls': isOpen ? overlayId :
|
|
7106
|
+
'aria-controls': isOpen ? overlayId : undefined,
|
|
6890
7107
|
onPress: state.toggle
|
|
6891
7108
|
},
|
|
6892
7109
|
overlayProps: {
|
|
@@ -6906,7 +7123,6 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
6906
7123
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
6907
7124
|
* governing permissions and limitations under the License.
|
|
6908
7125
|
*/
|
|
6909
|
-
// @ts-ignore
|
|
6910
7126
|
const $49c51c25361d4cd2$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
6911
7127
|
// HTML input types that do not cause the software keyboard to appear.
|
|
6912
7128
|
const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
@@ -7089,22 +7305,26 @@ function $49c51c25361d4cd2$var$setStyle(element, style, value) {
|
|
|
7089
7305
|
}
|
|
7090
7306
|
// Adds an event listener to an element, and returns a function to remove it.
|
|
7091
7307
|
function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
|
|
7308
|
+
// internal function, so it's ok to ignore the difficult to fix type error
|
|
7309
|
+
// @ts-ignore
|
|
7092
7310
|
target.addEventListener(event, handler, options);
|
|
7093
7311
|
return ()=>{
|
|
7312
|
+
// @ts-ignore
|
|
7094
7313
|
target.removeEventListener(event, handler, options);
|
|
7095
7314
|
};
|
|
7096
7315
|
}
|
|
7097
7316
|
function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
7098
7317
|
let root = document.scrollingElement || document.documentElement;
|
|
7099
|
-
|
|
7318
|
+
let nextTarget = target;
|
|
7319
|
+
while(nextTarget && nextTarget !== root){
|
|
7100
7320
|
// Find the parent scrollable element and adjust the scroll position if the target is not already in view.
|
|
7101
|
-
let scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(
|
|
7102
|
-
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !==
|
|
7321
|
+
let scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(nextTarget);
|
|
7322
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
|
|
7103
7323
|
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
7104
|
-
let targetTop =
|
|
7105
|
-
if (targetTop > scrollableTop +
|
|
7324
|
+
let targetTop = nextTarget.getBoundingClientRect().top;
|
|
7325
|
+
if (targetTop > scrollableTop + nextTarget.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
|
|
7106
7326
|
}
|
|
7107
|
-
|
|
7327
|
+
nextTarget = scrollable.parentElement;
|
|
7108
7328
|
}
|
|
7109
7329
|
}
|
|
7110
7330
|
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
@@ -7152,7 +7372,7 @@ function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
|
7152
7372
|
let context = ($dbSRa$react.useContext)($f57aed4a881a3485$var$Context);
|
|
7153
7373
|
return {
|
|
7154
7374
|
modalProviderProps: {
|
|
7155
|
-
'aria-hidden': context && context.modalCount > 0 ? true :
|
|
7375
|
+
'aria-hidden': context && context.modalCount > 0 ? true : undefined
|
|
7156
7376
|
}
|
|
7157
7377
|
};
|
|
7158
7378
|
}
|
|
@@ -7424,64 +7644,6 @@ $a2f21f5f14f60553$exports = {
|
|
|
7424
7644
|
"zh-TW": $2b2734393847c884$exports
|
|
7425
7645
|
};
|
|
7426
7646
|
|
|
7427
|
-
/*
|
|
7428
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
7429
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7430
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7431
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7432
|
-
*
|
|
7433
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
7434
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
7435
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
7436
|
-
* governing permissions and limitations under the License.
|
|
7437
|
-
*/
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
const $5c3e21d68f1c4674$var$styles = {
|
|
7441
|
-
border: 0,
|
|
7442
|
-
clip: 'rect(0 0 0 0)',
|
|
7443
|
-
clipPath: 'inset(50%)',
|
|
7444
|
-
height: '1px',
|
|
7445
|
-
margin: '-1px',
|
|
7446
|
-
overflow: 'hidden',
|
|
7447
|
-
padding: 0,
|
|
7448
|
-
position: 'absolute',
|
|
7449
|
-
width: '1px',
|
|
7450
|
-
whiteSpace: 'nowrap'
|
|
7451
|
-
};
|
|
7452
|
-
function $5c3e21d68f1c4674$export$a966af930f325cab(props = {}) {
|
|
7453
|
-
let { style: style, isFocusable: isFocusable } = props;
|
|
7454
|
-
let [isFocused, setFocused] = ($dbSRa$react.useState)(false);
|
|
7455
|
-
let { focusWithinProps: focusWithinProps } = ($9ab94262bd0047c7$export$420e68273165f4ec)({
|
|
7456
|
-
isDisabled: !isFocusable,
|
|
7457
|
-
onFocusWithinChange: (val)=>setFocused(val)
|
|
7458
|
-
});
|
|
7459
|
-
// If focused, don't hide the element.
|
|
7460
|
-
let combinedStyles = ($dbSRa$react.useMemo)(()=>{
|
|
7461
|
-
if (isFocused) return style;
|
|
7462
|
-
else if (style) return {
|
|
7463
|
-
...$5c3e21d68f1c4674$var$styles,
|
|
7464
|
-
...style
|
|
7465
|
-
};
|
|
7466
|
-
else return $5c3e21d68f1c4674$var$styles;
|
|
7467
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7468
|
-
}, [
|
|
7469
|
-
isFocused
|
|
7470
|
-
]);
|
|
7471
|
-
return {
|
|
7472
|
-
visuallyHiddenProps: {
|
|
7473
|
-
...focusWithinProps,
|
|
7474
|
-
style: combinedStyles
|
|
7475
|
-
}
|
|
7476
|
-
};
|
|
7477
|
-
}
|
|
7478
|
-
function $5c3e21d68f1c4674$export$439d29a4e110a164(props) {
|
|
7479
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7480
|
-
let { children: children, elementType: Element = 'div', isFocusable: isFocusable, style: style, ...otherProps } = props;
|
|
7481
|
-
let { visuallyHiddenProps: visuallyHiddenProps } = $5c3e21d68f1c4674$export$a966af930f325cab(props);
|
|
7482
|
-
return /*#__PURE__*/ ($dbSRa$react).createElement(Element, ($3ef42575df84b30b$export$9d1611c77c2fe928)(otherProps, visuallyHiddenProps), children);
|
|
7483
|
-
}
|
|
7484
|
-
|
|
7485
7647
|
function $parcel$interopDefault$5(a) {
|
|
7486
7648
|
return a && a.__esModule ? a.default : a;
|
|
7487
7649
|
}
|
|
@@ -7543,7 +7705,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
7543
7705
|
// Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is
|
|
7544
7706
|
// made for elements with role="row" since VoiceOver on iOS has issues hiding elements with role="row".
|
|
7545
7707
|
// For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).
|
|
7546
|
-
if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
|
|
7708
|
+
if (visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
|
|
7547
7709
|
// Skip this node but continue to children if one of the targets is inside the node.
|
|
7548
7710
|
for (let target of visibleNodes){
|
|
7549
7711
|
if (node.contains(target)) return NodeFilter.FILTER_SKIP;
|
|
@@ -7618,6 +7780,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
7618
7780
|
observer.disconnect();
|
|
7619
7781
|
for (let node of hiddenNodes){
|
|
7620
7782
|
let count = $5e3802645cc19319$var$refCountMap.get(node);
|
|
7783
|
+
if (count == null) continue;
|
|
7621
7784
|
if (count === 1) {
|
|
7622
7785
|
node.removeAttribute('aria-hidden');
|
|
7623
7786
|
$5e3802645cc19319$var$refCountMap.delete(node);
|
|
@@ -7649,7 +7812,8 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
7649
7812
|
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
7650
7813
|
let { triggerRef: triggerRef, popoverRef: popoverRef, isNonModal: isNonModal, isKeyboardDismissDisabled: isKeyboardDismissDisabled, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside, ...otherProps } = props;
|
|
7651
7814
|
let { overlayProps: overlayProps, underlayProps: underlayProps } = ($a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
7652
|
-
|
|
7815
|
+
// If popover is in the top layer, it should not prevent other popovers from being dismissed.
|
|
7816
|
+
isOpen: state.isOpen && !otherProps['data-react-aria-top-layer'],
|
|
7653
7817
|
onClose: state.close,
|
|
7654
7818
|
shouldCloseOnBlur: true,
|
|
7655
7819
|
isDismissable: !isNonModal,
|
|
@@ -7661,7 +7825,7 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
7661
7825
|
targetRef: triggerRef,
|
|
7662
7826
|
overlayRef: popoverRef,
|
|
7663
7827
|
isOpen: state.isOpen,
|
|
7664
|
-
onClose: isNonModal ? state.close :
|
|
7828
|
+
onClose: isNonModal ? state.close : undefined
|
|
7665
7829
|
});
|
|
7666
7830
|
($49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
|
|
7667
7831
|
isDisabled: isNonModal || !state.isOpen
|
|
@@ -7779,7 +7943,7 @@ function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
|
7779
7943
|
});
|
|
7780
7944
|
($337b884510726a0d$export$14c98a7594375490)();
|
|
7781
7945
|
($dbSRa$react.useEffect)(()=>{
|
|
7782
|
-
if (state.isOpen) return ($5e3802645cc19319$export$1c3ebcada18427bf)([
|
|
7946
|
+
if (state.isOpen && ref.current) return ($5e3802645cc19319$export$1c3ebcada18427bf)([
|
|
7783
7947
|
ref.current
|
|
7784
7948
|
]);
|
|
7785
7949
|
}, [
|
|
@@ -7852,7 +8016,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
7852
8016
|
let { keyboardDelegate: keyboardDelegate, selectionManager: selectionManager, onTypeSelect: onTypeSelect } = options;
|
|
7853
8017
|
let state = ($dbSRa$react.useRef)({
|
|
7854
8018
|
search: '',
|
|
7855
|
-
timeout:
|
|
8019
|
+
timeout: undefined
|
|
7856
8020
|
}).current;
|
|
7857
8021
|
let onKeyDown = (e)=>{
|
|
7858
8022
|
let character = $fb3050f43d946246$var$getStringForKey(e.key);
|
|
@@ -7866,14 +8030,16 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
7866
8030
|
if (!('continuePropagation' in e)) e.stopPropagation();
|
|
7867
8031
|
}
|
|
7868
8032
|
state.search += character;
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
8033
|
+
if (keyboardDelegate.getKeyForSearch != null) {
|
|
8034
|
+
// Use the delegate to find a key to focus.
|
|
8035
|
+
// Prioritize items after the currently focused item, falling back to searching the whole list.
|
|
8036
|
+
let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
|
|
8037
|
+
// If no key found, search from the top.
|
|
8038
|
+
if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
|
|
8039
|
+
if (key != null) {
|
|
8040
|
+
selectionManager.setFocusedKey(key);
|
|
8041
|
+
if (onTypeSelect) onTypeSelect(key);
|
|
8042
|
+
}
|
|
7877
8043
|
}
|
|
7878
8044
|
clearTimeout(state.timeout);
|
|
7879
8045
|
state.timeout = setTimeout(()=>{
|
|
@@ -7884,7 +8050,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
7884
8050
|
typeSelectProps: {
|
|
7885
8051
|
// Using a capturing listener to catch the keydown event before
|
|
7886
8052
|
// other hooks in order to handle the Spacebar event.
|
|
7887
|
-
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown :
|
|
8053
|
+
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : undefined
|
|
7888
8054
|
}
|
|
7889
8055
|
};
|
|
7890
8056
|
}
|
|
@@ -7921,21 +8087,23 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7921
8087
|
let { direction: direction } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
7922
8088
|
let router = ($ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
|
|
7923
8089
|
let onKeyDown = (e)=>{
|
|
8090
|
+
var _ref_current;
|
|
7924
8091
|
// Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
|
|
7925
8092
|
if (e.altKey && e.key === 'Tab') e.preventDefault();
|
|
7926
8093
|
// Keyboard events bubble through portals. Don't handle keyboard events
|
|
7927
8094
|
// for elements outside the collection (e.g. menus).
|
|
7928
|
-
if (!ref.current.contains(e.target)) return;
|
|
8095
|
+
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
|
|
7929
8096
|
const navigateToKey = (key, childFocus)=>{
|
|
7930
8097
|
if (key != null) {
|
|
7931
8098
|
if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) {
|
|
8099
|
+
var _scrollRef_current;
|
|
7932
8100
|
// Set focused key and re-render synchronously to bring item into view if needed.
|
|
7933
8101
|
($iETbY$reactdom.flushSync)(()=>{
|
|
7934
8102
|
manager.setFocusedKey(key, childFocus);
|
|
7935
8103
|
});
|
|
7936
|
-
let item = scrollRef.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
|
|
8104
|
+
let item = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
|
|
7937
8105
|
let itemProps = manager.getItemProps(key);
|
|
7938
|
-
router.open(item, e, itemProps.href, itemProps.routerOptions);
|
|
8106
|
+
if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
|
|
7939
8107
|
return;
|
|
7940
8108
|
}
|
|
7941
8109
|
manager.setFocusedKey(key, childFocus);
|
|
@@ -7947,38 +8115,46 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7947
8115
|
switch(e.key){
|
|
7948
8116
|
case 'ArrowDown':
|
|
7949
8117
|
if (delegate.getKeyBelow) {
|
|
7950
|
-
var _delegate_getFirstKey, _delegate_getFirstKey1;
|
|
7951
|
-
|
|
7952
|
-
let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
8118
|
+
var _delegate_getKeyBelow, _delegate_getFirstKey, _delegate_getFirstKey1;
|
|
8119
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
7953
8120
|
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
|
|
7954
|
-
|
|
8121
|
+
if (nextKey != null) {
|
|
8122
|
+
e.preventDefault();
|
|
8123
|
+
navigateToKey(nextKey);
|
|
8124
|
+
}
|
|
7955
8125
|
}
|
|
7956
8126
|
break;
|
|
7957
8127
|
case 'ArrowUp':
|
|
7958
8128
|
if (delegate.getKeyAbove) {
|
|
7959
|
-
var _delegate_getLastKey, _delegate_getLastKey1;
|
|
7960
|
-
|
|
7961
|
-
let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
|
|
8129
|
+
var _delegate_getKeyAbove, _delegate_getLastKey, _delegate_getLastKey1;
|
|
8130
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
|
|
7962
8131
|
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
|
|
7963
|
-
|
|
8132
|
+
if (nextKey != null) {
|
|
8133
|
+
e.preventDefault();
|
|
8134
|
+
navigateToKey(nextKey);
|
|
8135
|
+
}
|
|
7964
8136
|
}
|
|
7965
8137
|
break;
|
|
7966
8138
|
case 'ArrowLeft':
|
|
7967
8139
|
if (delegate.getKeyLeftOf) {
|
|
7968
|
-
var _delegate_getFirstKey2, _delegate_getLastKey2;
|
|
7969
|
-
|
|
7970
|
-
let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
|
|
8140
|
+
var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
|
|
8141
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
|
|
7971
8142
|
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
|
|
7972
|
-
|
|
8143
|
+
if (nextKey != null) {
|
|
8144
|
+
e.preventDefault();
|
|
8145
|
+
navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
|
|
8146
|
+
}
|
|
7973
8147
|
}
|
|
7974
8148
|
break;
|
|
7975
8149
|
case 'ArrowRight':
|
|
7976
8150
|
if (delegate.getKeyRightOf) {
|
|
7977
|
-
var _delegate_getLastKey3, _delegate_getFirstKey3;
|
|
7978
|
-
|
|
7979
|
-
let nextKey = delegate.getKeyRightOf(manager.focusedKey);
|
|
8151
|
+
var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
|
|
8152
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
|
|
7980
8153
|
if (nextKey == null && shouldFocusWrap) nextKey = direction === 'rtl' ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
|
|
7981
|
-
|
|
8154
|
+
if (nextKey != null) {
|
|
8155
|
+
e.preventDefault();
|
|
8156
|
+
navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
|
|
8157
|
+
}
|
|
7982
8158
|
}
|
|
7983
8159
|
break;
|
|
7984
8160
|
case 'Home':
|
|
@@ -7986,8 +8162,10 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7986
8162
|
e.preventDefault();
|
|
7987
8163
|
let firstKey = delegate.getFirstKey(manager.focusedKey, ($feb5ffebff200149$export$16792effe837dba3)(e));
|
|
7988
8164
|
manager.setFocusedKey(firstKey);
|
|
7989
|
-
if (
|
|
7990
|
-
|
|
8165
|
+
if (firstKey != null) {
|
|
8166
|
+
if (($feb5ffebff200149$export$16792effe837dba3)(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(firstKey);
|
|
8167
|
+
else if (selectOnFocus) manager.replaceSelection(firstKey);
|
|
8168
|
+
}
|
|
7991
8169
|
}
|
|
7992
8170
|
break;
|
|
7993
8171
|
case 'End':
|
|
@@ -7995,22 +8173,28 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
7995
8173
|
e.preventDefault();
|
|
7996
8174
|
let lastKey = delegate.getLastKey(manager.focusedKey, ($feb5ffebff200149$export$16792effe837dba3)(e));
|
|
7997
8175
|
manager.setFocusedKey(lastKey);
|
|
7998
|
-
if (
|
|
7999
|
-
|
|
8176
|
+
if (lastKey != null) {
|
|
8177
|
+
if (($feb5ffebff200149$export$16792effe837dba3)(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(lastKey);
|
|
8178
|
+
else if (selectOnFocus) manager.replaceSelection(lastKey);
|
|
8179
|
+
}
|
|
8000
8180
|
}
|
|
8001
8181
|
break;
|
|
8002
8182
|
case 'PageDown':
|
|
8003
|
-
if (delegate.getKeyPageBelow) {
|
|
8004
|
-
e.preventDefault();
|
|
8183
|
+
if (delegate.getKeyPageBelow && manager.focusedKey != null) {
|
|
8005
8184
|
let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
|
|
8006
|
-
|
|
8185
|
+
if (nextKey != null) {
|
|
8186
|
+
e.preventDefault();
|
|
8187
|
+
navigateToKey(nextKey);
|
|
8188
|
+
}
|
|
8007
8189
|
}
|
|
8008
8190
|
break;
|
|
8009
8191
|
case 'PageUp':
|
|
8010
|
-
if (delegate.getKeyPageAbove) {
|
|
8011
|
-
e.preventDefault();
|
|
8192
|
+
if (delegate.getKeyPageAbove && manager.focusedKey != null) {
|
|
8012
8193
|
let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
|
|
8013
|
-
|
|
8194
|
+
if (nextKey != null) {
|
|
8195
|
+
e.preventDefault();
|
|
8196
|
+
navigateToKey(nextKey);
|
|
8197
|
+
}
|
|
8014
8198
|
}
|
|
8015
8199
|
break;
|
|
8016
8200
|
case 'a':
|
|
@@ -8039,7 +8223,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8039
8223
|
let walker = ($9bf71ea28793e738$export$2d6ec8fc375ceafa)(ref.current, {
|
|
8040
8224
|
tabbable: true
|
|
8041
8225
|
});
|
|
8042
|
-
let next;
|
|
8226
|
+
let next = undefined;
|
|
8043
8227
|
let last;
|
|
8044
8228
|
do {
|
|
8045
8229
|
last = walker.lastChild();
|
|
@@ -8057,10 +8241,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8057
8241
|
top: 0,
|
|
8058
8242
|
left: 0
|
|
8059
8243
|
});
|
|
8060
|
-
($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', isVirtualized ?
|
|
8244
|
+
($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', isVirtualized ? undefined : ()=>{
|
|
8245
|
+
var _scrollRef_current, _scrollRef_current1;
|
|
8246
|
+
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
8061
8247
|
scrollPos.current = {
|
|
8062
|
-
top: scrollRef.current.scrollTop,
|
|
8063
|
-
left: scrollRef.current.scrollLeft
|
|
8248
|
+
top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTop) !== null && _scrollRef_current_scrollTop !== void 0 ? _scrollRef_current_scrollTop : 0,
|
|
8249
|
+
left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 === void 0 ? void 0 : _scrollRef_current1.scrollLeft) !== null && _scrollRef_current_scrollLeft !== void 0 ? _scrollRef_current_scrollLeft : 0
|
|
8064
8250
|
};
|
|
8065
8251
|
});
|
|
8066
8252
|
let onFocus = (e)=>{
|
|
@@ -8073,6 +8259,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8073
8259
|
if (!e.currentTarget.contains(e.target)) return;
|
|
8074
8260
|
manager.setFocused(true);
|
|
8075
8261
|
if (manager.focusedKey == null) {
|
|
8262
|
+
var _delegate_getLastKey, _delegate_getFirstKey;
|
|
8076
8263
|
let navigateToFirstKey = (key)=>{
|
|
8077
8264
|
if (key != null) {
|
|
8078
8265
|
manager.setFocusedKey(key);
|
|
@@ -8084,14 +8271,14 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8084
8271
|
// and either focus the first or last item accordingly.
|
|
8085
8272
|
let relatedTarget = e.relatedTarget;
|
|
8086
8273
|
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
8087
|
-
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : delegate.getLastKey());
|
|
8088
|
-
else navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : delegate.getFirstKey());
|
|
8089
|
-
} else if (!isVirtualized) {
|
|
8274
|
+
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_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));
|
|
8275
|
+
else navigateToFirstKey((_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));
|
|
8276
|
+
} else if (!isVirtualized && scrollRef.current) {
|
|
8090
8277
|
// Restore the scroll position to what it was before.
|
|
8091
8278
|
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
8092
8279
|
scrollRef.current.scrollLeft = scrollPos.current.left;
|
|
8093
8280
|
}
|
|
8094
|
-
if (manager.focusedKey != null) {
|
|
8281
|
+
if (manager.focusedKey != null && scrollRef.current) {
|
|
8095
8282
|
// Refocus and scroll the focused item into view if it exists within the scrollable region.
|
|
8096
8283
|
let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
|
|
8097
8284
|
if (element) {
|
|
@@ -8111,10 +8298,13 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8111
8298
|
const autoFocusRef = ($dbSRa$react.useRef)(autoFocus);
|
|
8112
8299
|
($dbSRa$react.useEffect)(()=>{
|
|
8113
8300
|
if (autoFocusRef.current) {
|
|
8301
|
+
var _delegate_getFirstKey, _delegate_getLastKey;
|
|
8114
8302
|
let focusedKey = null;
|
|
8303
|
+
var _delegate_getFirstKey1;
|
|
8115
8304
|
// Check focus strategy to determine which item to focus
|
|
8116
|
-
if (autoFocus === 'first') focusedKey = delegate.getFirstKey();
|
|
8117
|
-
|
|
8305
|
+
if (autoFocus === 'first') focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
8306
|
+
var _delegate_getLastKey1;
|
|
8307
|
+
if (autoFocus === 'last') focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate)) !== null && _delegate_getLastKey1 !== void 0 ? _delegate_getLastKey1 : null;
|
|
8118
8308
|
// If there are any selected keys, make the first one the new focus target
|
|
8119
8309
|
let selectedKeys = manager.selectedKeys;
|
|
8120
8310
|
if (selectedKeys.size) {
|
|
@@ -8126,14 +8316,14 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8126
8316
|
manager.setFocused(true);
|
|
8127
8317
|
manager.setFocusedKey(focusedKey);
|
|
8128
8318
|
// If no default focus key is selected, focus the collection itself.
|
|
8129
|
-
if (focusedKey == null && !shouldUseVirtualFocus) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8319
|
+
if (focusedKey == null && !shouldUseVirtualFocus && ref.current) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8130
8320
|
}
|
|
8131
8321
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8132
8322
|
}, []);
|
|
8133
8323
|
// Scroll the focused element into view when the focusedKey changes.
|
|
8134
8324
|
let lastFocusedKey = ($dbSRa$react.useRef)(manager.focusedKey);
|
|
8135
8325
|
($dbSRa$react.useEffect)(()=>{
|
|
8136
|
-
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) &&
|
|
8326
|
+
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && scrollRef.current && ref.current) {
|
|
8137
8327
|
let modality = ($507fabe10e71c6fb$export$630ff653c5ada6a9)();
|
|
8138
8328
|
let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
|
|
8139
8329
|
if (!element) // If item element wasn't found, return early (don't update autoFocusRef and lastFocusedKey).
|
|
@@ -8148,7 +8338,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8148
8338
|
}
|
|
8149
8339
|
}
|
|
8150
8340
|
// If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.
|
|
8151
|
-
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8341
|
+
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8152
8342
|
lastFocusedKey.current = manager.focusedKey;
|
|
8153
8343
|
autoFocusRef.current = false;
|
|
8154
8344
|
});
|
|
@@ -8176,7 +8366,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
8176
8366
|
// This will be marshalled to either the first or last item depending on where focus came from.
|
|
8177
8367
|
// If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try
|
|
8178
8368
|
// to move real DOM focus to the element anyway.
|
|
8179
|
-
let tabIndex;
|
|
8369
|
+
let tabIndex = undefined;
|
|
8180
8370
|
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
|
|
8181
8371
|
return {
|
|
8182
8372
|
collectionProps: {
|
|
@@ -8209,7 +8399,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
8209
8399
|
else {
|
|
8210
8400
|
if (manager.selectionMode === 'none') return;
|
|
8211
8401
|
if (manager.isLink(key)) {
|
|
8212
|
-
if (linkBehavior === 'selection') {
|
|
8402
|
+
if (linkBehavior === 'selection' && ref.current) {
|
|
8213
8403
|
let itemProps = manager.getItemProps(key);
|
|
8214
8404
|
router.open(ref.current, e, itemProps.href, itemProps.routerOptions);
|
|
8215
8405
|
// Always set selected keys back to what they were so that select and combobox close.
|
|
@@ -8231,7 +8421,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
8231
8421
|
let isFocused = key === manager.focusedKey;
|
|
8232
8422
|
if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
|
|
8233
8423
|
if (focus) focus();
|
|
8234
|
-
else if (document.activeElement !== ref.current) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8424
|
+
else if (document.activeElement !== ref.current && ref.current) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
8235
8425
|
}
|
|
8236
8426
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8237
8427
|
}, [
|
|
@@ -8274,7 +8464,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
8274
8464
|
let hadPrimaryActionOnPressStart = ($dbSRa$react.useRef)(false);
|
|
8275
8465
|
let performAction = (e)=>{
|
|
8276
8466
|
if (onAction) onAction();
|
|
8277
|
-
if (hasLinkAction) {
|
|
8467
|
+
if (hasLinkAction && ref.current) {
|
|
8278
8468
|
let itemProps = manager.getItemProps(key);
|
|
8279
8469
|
router.open(ref.current, e, itemProps.href, itemProps.routerOptions);
|
|
8280
8470
|
}
|
|
@@ -8302,10 +8492,10 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
8302
8492
|
} else if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
|
|
8303
8493
|
};
|
|
8304
8494
|
else {
|
|
8305
|
-
itemPressProps.onPressUp = hasPrimaryAction ?
|
|
8495
|
+
itemPressProps.onPressUp = hasPrimaryAction ? undefined : (e)=>{
|
|
8306
8496
|
if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
|
|
8307
8497
|
};
|
|
8308
|
-
itemPressProps.onPress = hasPrimaryAction ? performAction :
|
|
8498
|
+
itemPressProps.onPress = hasPrimaryAction ? performAction : undefined;
|
|
8309
8499
|
}
|
|
8310
8500
|
} else {
|
|
8311
8501
|
itemPressProps.onPressStart = (e)=>{
|
|
@@ -8398,6 +8588,7 @@ function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
|
8398
8588
|
*/ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
8399
8589
|
getItemRect(key) {
|
|
8400
8590
|
let container = this.ref.current;
|
|
8591
|
+
if (!container) return null;
|
|
8401
8592
|
let item = key != null ? container.querySelector(`[data-key="${CSS.escape(key.toString())}"]`) : null;
|
|
8402
8593
|
if (!item) return null;
|
|
8403
8594
|
let containerRect = container.getBoundingClientRect();
|
|
@@ -8411,18 +8602,20 @@ function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
|
8411
8602
|
}
|
|
8412
8603
|
getContentSize() {
|
|
8413
8604
|
let container = this.ref.current;
|
|
8605
|
+
var _container_scrollWidth, _container_scrollHeight;
|
|
8414
8606
|
return {
|
|
8415
|
-
width: container.scrollWidth,
|
|
8416
|
-
height: container.scrollHeight
|
|
8607
|
+
width: (_container_scrollWidth = container === null || container === void 0 ? void 0 : container.scrollWidth) !== null && _container_scrollWidth !== void 0 ? _container_scrollWidth : 0,
|
|
8608
|
+
height: (_container_scrollHeight = container === null || container === void 0 ? void 0 : container.scrollHeight) !== null && _container_scrollHeight !== void 0 ? _container_scrollHeight : 0
|
|
8417
8609
|
};
|
|
8418
8610
|
}
|
|
8419
8611
|
getVisibleRect() {
|
|
8420
8612
|
let container = this.ref.current;
|
|
8613
|
+
var _container_scrollLeft, _container_scrollTop, _container_offsetWidth, _container_offsetHeight;
|
|
8421
8614
|
return {
|
|
8422
|
-
x: container.scrollLeft,
|
|
8423
|
-
y: container.scrollTop,
|
|
8424
|
-
width: container.offsetWidth,
|
|
8425
|
-
height: container.offsetHeight
|
|
8615
|
+
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
8616
|
+
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
8617
|
+
width: (_container_offsetWidth = container === null || container === void 0 ? void 0 : container.offsetWidth) !== null && _container_offsetWidth !== void 0 ? _container_offsetWidth : 0,
|
|
8618
|
+
height: (_container_offsetHeight = container === null || container === void 0 ? void 0 : container.offsetHeight) !== null && _container_offsetHeight !== void 0 ? _container_offsetHeight : 0
|
|
8426
8619
|
};
|
|
8427
8620
|
}
|
|
8428
8621
|
constructor(ref){
|
|
@@ -8447,34 +8640,37 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
8447
8640
|
var _item_props;
|
|
8448
8641
|
return this.disabledBehavior === 'all' && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
|
|
8449
8642
|
}
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
while(
|
|
8453
|
-
let item = this.collection.getItem(
|
|
8454
|
-
if (item.type === 'item' && !this.isDisabled(item)) return
|
|
8455
|
-
|
|
8643
|
+
findNextNonDisabled(key, getNext) {
|
|
8644
|
+
let nextKey = key;
|
|
8645
|
+
while(nextKey != null){
|
|
8646
|
+
let item = this.collection.getItem(nextKey);
|
|
8647
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 'item' && !this.isDisabled(item)) return nextKey;
|
|
8648
|
+
nextKey = getNext(nextKey);
|
|
8456
8649
|
}
|
|
8457
8650
|
return null;
|
|
8458
8651
|
}
|
|
8652
|
+
getNextKey(key) {
|
|
8653
|
+
let nextKey = key;
|
|
8654
|
+
nextKey = this.collection.getKeyAfter(nextKey);
|
|
8655
|
+
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyAfter(key));
|
|
8656
|
+
}
|
|
8459
8657
|
getPreviousKey(key) {
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
if (item.type === 'item' && !this.isDisabled(item)) return key;
|
|
8464
|
-
key = this.collection.getKeyBefore(key);
|
|
8465
|
-
}
|
|
8466
|
-
return null;
|
|
8658
|
+
let nextKey = key;
|
|
8659
|
+
nextKey = this.collection.getKeyBefore(nextKey);
|
|
8660
|
+
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyBefore(key));
|
|
8467
8661
|
}
|
|
8468
8662
|
findKey(key, nextKey, shouldSkip) {
|
|
8469
|
-
let
|
|
8470
|
-
|
|
8663
|
+
let tempKey = key;
|
|
8664
|
+
let itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
8665
|
+
if (!itemRect || tempKey == null) return null;
|
|
8471
8666
|
// Find the item above or below in the same column.
|
|
8472
8667
|
let prevRect = itemRect;
|
|
8473
8668
|
do {
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8669
|
+
tempKey = nextKey(tempKey);
|
|
8670
|
+
if (tempKey == null) break;
|
|
8671
|
+
itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
8672
|
+
}while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
|
|
8673
|
+
return tempKey;
|
|
8478
8674
|
}
|
|
8479
8675
|
isSameRow(prevRect, itemRect) {
|
|
8480
8676
|
return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
|
|
@@ -8494,6 +8690,13 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
8494
8690
|
return right ? this.getPreviousKey(key) : this.getNextKey(key);
|
|
8495
8691
|
}
|
|
8496
8692
|
getKeyRightOf(key) {
|
|
8693
|
+
// This is a temporary solution for CardView until we refactor useSelectableCollection.
|
|
8694
|
+
// https://github.com/orgs/adobe/projects/19/views/32?pane=issue&itemId=77825042
|
|
8695
|
+
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyRightOf' : 'getKeyLeftOf';
|
|
8696
|
+
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
8697
|
+
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
8698
|
+
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
8699
|
+
}
|
|
8497
8700
|
if (this.layout === 'grid') {
|
|
8498
8701
|
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'rtl');
|
|
8499
8702
|
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'rtl'), this.isSameColumn);
|
|
@@ -8501,6 +8704,11 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
8501
8704
|
return null;
|
|
8502
8705
|
}
|
|
8503
8706
|
getKeyLeftOf(key) {
|
|
8707
|
+
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyLeftOf' : 'getKeyRightOf';
|
|
8708
|
+
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
8709
|
+
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
8710
|
+
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
8711
|
+
}
|
|
8504
8712
|
if (this.layout === 'grid') {
|
|
8505
8713
|
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'ltr');
|
|
8506
8714
|
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'ltr'), this.isSameColumn);
|
|
@@ -8509,61 +8717,53 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
8509
8717
|
}
|
|
8510
8718
|
getFirstKey() {
|
|
8511
8719
|
let key = this.collection.getFirstKey();
|
|
8512
|
-
|
|
8513
|
-
let item = this.collection.getItem(key);
|
|
8514
|
-
if ((item === null || item === void 0 ? void 0 : item.type) === 'item' && !this.isDisabled(item)) return key;
|
|
8515
|
-
key = this.collection.getKeyAfter(key);
|
|
8516
|
-
}
|
|
8517
|
-
return null;
|
|
8720
|
+
return this.findNextNonDisabled(key, (key)=>this.collection.getKeyAfter(key));
|
|
8518
8721
|
}
|
|
8519
8722
|
getLastKey() {
|
|
8520
8723
|
let key = this.collection.getLastKey();
|
|
8521
|
-
|
|
8522
|
-
let item = this.collection.getItem(key);
|
|
8523
|
-
if (item.type === 'item' && !this.isDisabled(item)) return key;
|
|
8524
|
-
key = this.collection.getKeyBefore(key);
|
|
8525
|
-
}
|
|
8526
|
-
return null;
|
|
8724
|
+
return this.findNextNonDisabled(key, (key)=>this.collection.getKeyBefore(key));
|
|
8527
8725
|
}
|
|
8528
8726
|
getKeyPageAbove(key) {
|
|
8529
8727
|
let menu = this.ref.current;
|
|
8530
8728
|
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
8531
8729
|
if (!itemRect) return null;
|
|
8532
|
-
if (!($cc38e7bd3fc7b213$export$2bb74740c4e19def)(menu)) return this.getFirstKey();
|
|
8730
|
+
if (menu && !($cc38e7bd3fc7b213$export$2bb74740c4e19def)(menu)) return this.getFirstKey();
|
|
8731
|
+
let nextKey = key;
|
|
8533
8732
|
if (this.orientation === 'horizontal') {
|
|
8534
8733
|
let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
|
|
8535
|
-
while(itemRect && itemRect.x > pageX){
|
|
8536
|
-
|
|
8537
|
-
itemRect =
|
|
8734
|
+
while(itemRect && itemRect.x > pageX && nextKey != null){
|
|
8735
|
+
nextKey = this.getKeyAbove(nextKey);
|
|
8736
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
8538
8737
|
}
|
|
8539
8738
|
} else {
|
|
8540
8739
|
let pageY = Math.max(0, itemRect.y + itemRect.height - this.layoutDelegate.getVisibleRect().height);
|
|
8541
|
-
while(itemRect && itemRect.y > pageY){
|
|
8542
|
-
|
|
8543
|
-
itemRect =
|
|
8740
|
+
while(itemRect && itemRect.y > pageY && nextKey != null){
|
|
8741
|
+
nextKey = this.getKeyAbove(nextKey);
|
|
8742
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
8544
8743
|
}
|
|
8545
8744
|
}
|
|
8546
|
-
return
|
|
8745
|
+
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getFirstKey();
|
|
8547
8746
|
}
|
|
8548
8747
|
getKeyPageBelow(key) {
|
|
8549
8748
|
let menu = this.ref.current;
|
|
8550
8749
|
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
8551
8750
|
if (!itemRect) return null;
|
|
8552
|
-
if (!($cc38e7bd3fc7b213$export$2bb74740c4e19def)(menu)) return this.getLastKey();
|
|
8751
|
+
if (menu && !($cc38e7bd3fc7b213$export$2bb74740c4e19def)(menu)) return this.getLastKey();
|
|
8752
|
+
let nextKey = key;
|
|
8553
8753
|
if (this.orientation === 'horizontal') {
|
|
8554
8754
|
let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.y - itemRect.width + this.layoutDelegate.getVisibleRect().width);
|
|
8555
|
-
while(itemRect && itemRect.x < pageX){
|
|
8556
|
-
|
|
8557
|
-
itemRect =
|
|
8755
|
+
while(itemRect && itemRect.x < pageX && nextKey != null){
|
|
8756
|
+
nextKey = this.getKeyBelow(nextKey);
|
|
8757
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
8558
8758
|
}
|
|
8559
8759
|
} else {
|
|
8560
8760
|
let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
|
|
8561
|
-
while(itemRect && itemRect.y < pageY){
|
|
8562
|
-
|
|
8563
|
-
itemRect =
|
|
8761
|
+
while(itemRect && itemRect.y < pageY && nextKey != null){
|
|
8762
|
+
nextKey = this.getKeyBelow(nextKey);
|
|
8763
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
8564
8764
|
}
|
|
8565
8765
|
}
|
|
8566
|
-
return
|
|
8766
|
+
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getLastKey();
|
|
8567
8767
|
}
|
|
8568
8768
|
getKeyForSearch(search, fromKey) {
|
|
8569
8769
|
if (!this.collator) return null;
|
|
@@ -8571,9 +8771,10 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
8571
8771
|
let key = fromKey || this.getFirstKey();
|
|
8572
8772
|
while(key != null){
|
|
8573
8773
|
let item = collection.getItem(key);
|
|
8774
|
+
if (!item) return null;
|
|
8574
8775
|
let substring = item.textValue.slice(0, search.length);
|
|
8575
8776
|
if (item.textValue && this.collator.compare(substring, search) === 0) return key;
|
|
8576
|
-
key = this.
|
|
8777
|
+
key = this.getNextKey(key);
|
|
8577
8778
|
}
|
|
8578
8779
|
return null;
|
|
8579
8780
|
}
|
|
@@ -8744,17 +8945,26 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8744
8945
|
}
|
|
8745
8946
|
*iterateCollection(props) {
|
|
8746
8947
|
let { children: children, items: items } = props;
|
|
8747
|
-
if (
|
|
8948
|
+
if (($dbSRa$react).isValidElement(children) && children.type === ($dbSRa$react).Fragment) yield* this.iterateCollection({
|
|
8949
|
+
children: children.props.children,
|
|
8950
|
+
items: items
|
|
8951
|
+
});
|
|
8952
|
+
else if (typeof children === 'function') {
|
|
8748
8953
|
if (!items) throw new Error('props.children was a function but props.items is missing');
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8954
|
+
let index = 0;
|
|
8955
|
+
for (let item of items){
|
|
8956
|
+
yield* this.getFullNode({
|
|
8957
|
+
value: item,
|
|
8958
|
+
index: index
|
|
8959
|
+
}, {
|
|
8960
|
+
renderer: children
|
|
8961
|
+
});
|
|
8962
|
+
index++;
|
|
8963
|
+
}
|
|
8754
8964
|
} else {
|
|
8755
8965
|
let items = [];
|
|
8756
8966
|
($dbSRa$react).Children.forEach(children, (child)=>{
|
|
8757
|
-
items.push(child);
|
|
8967
|
+
if (child) items.push(child);
|
|
8758
8968
|
});
|
|
8759
8969
|
let index = 0;
|
|
8760
8970
|
for (let item of items){
|
|
@@ -8787,6 +8997,19 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8787
8997
|
};
|
|
8788
8998
|
}
|
|
8789
8999
|
*getFullNode(partialNode, state, parentKey, parentNode) {
|
|
9000
|
+
if (($dbSRa$react).isValidElement(partialNode.element) && partialNode.element.type === ($dbSRa$react).Fragment) {
|
|
9001
|
+
let children = [];
|
|
9002
|
+
($dbSRa$react).Children.forEach(partialNode.element.props.children, (child)=>{
|
|
9003
|
+
children.push(child);
|
|
9004
|
+
});
|
|
9005
|
+
var _partialNode_index;
|
|
9006
|
+
let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
|
|
9007
|
+
for (const child of children)yield* this.getFullNode({
|
|
9008
|
+
element: child,
|
|
9009
|
+
index: index++
|
|
9010
|
+
}, state, parentKey, parentNode);
|
|
9011
|
+
return;
|
|
9012
|
+
}
|
|
8790
9013
|
// If there's a value instead of an element on the node, and a parent renderer function is available,
|
|
8791
9014
|
// use it to render an element for the value.
|
|
8792
9015
|
let element = partialNode.element;
|
|
@@ -8805,17 +9028,19 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8805
9028
|
if (($dbSRa$react).isValidElement(element)) {
|
|
8806
9029
|
let type = element.type;
|
|
8807
9030
|
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
|
|
8808
|
-
let name =
|
|
9031
|
+
let name = element.type;
|
|
8809
9032
|
throw new Error(`Unknown element <${name}> in collection.`);
|
|
8810
9033
|
}
|
|
8811
9034
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
8812
|
-
|
|
9035
|
+
var _partialNode_index1;
|
|
9036
|
+
let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
|
|
8813
9037
|
let result = childNodes.next();
|
|
8814
9038
|
while(!result.done && result.value){
|
|
8815
9039
|
let childNode = result.value;
|
|
8816
9040
|
partialNode.index = index;
|
|
8817
|
-
|
|
8818
|
-
|
|
9041
|
+
var _childNode_key;
|
|
9042
|
+
let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
|
|
9043
|
+
if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
|
|
8819
9044
|
let nodes = this.getFullNode({
|
|
8820
9045
|
...childNode,
|
|
8821
9046
|
key: nodeKey,
|
|
@@ -8826,12 +9051,14 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8826
9051
|
...nodes
|
|
8827
9052
|
];
|
|
8828
9053
|
for (let node of children){
|
|
9054
|
+
var _childNode_value, _ref;
|
|
8829
9055
|
// Cache the node based on its value
|
|
8830
|
-
node.value = childNode.value
|
|
9056
|
+
node.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
|
|
8831
9057
|
if (node.value) this.cache.set(node.value, node);
|
|
9058
|
+
var _parentNode_type;
|
|
8832
9059
|
// The partial node may have specified a type for the child in order to specify a constraint.
|
|
8833
9060
|
// Verify that the full node that was built recursively matches this type.
|
|
8834
|
-
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
|
|
9061
|
+
if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize((_parentNode_type = parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) !== null && _parentNode_type !== void 0 ? _parentNode_type : 'unknown parent type')}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
|
|
8835
9062
|
index++;
|
|
8836
9063
|
yield node;
|
|
8837
9064
|
}
|
|
@@ -8840,25 +9067,26 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8840
9067
|
return;
|
|
8841
9068
|
}
|
|
8842
9069
|
// Ignore invalid elements
|
|
8843
|
-
if (partialNode.key == null) return;
|
|
9070
|
+
if (partialNode.key == null || partialNode.type == null) return;
|
|
8844
9071
|
// Create full node
|
|
8845
9072
|
let builder = this;
|
|
9073
|
+
var _partialNode_value, _partialNode_textValue;
|
|
8846
9074
|
let node = {
|
|
8847
9075
|
type: partialNode.type,
|
|
8848
9076
|
props: partialNode.props,
|
|
8849
9077
|
key: partialNode.key,
|
|
8850
9078
|
parentKey: parentNode ? parentNode.key : null,
|
|
8851
|
-
value: partialNode.value,
|
|
9079
|
+
value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
|
|
8852
9080
|
level: parentNode ? parentNode.level + 1 : 0,
|
|
8853
9081
|
index: partialNode.index,
|
|
8854
9082
|
rendered: partialNode.rendered,
|
|
8855
|
-
textValue: partialNode.textValue,
|
|
9083
|
+
textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : '',
|
|
8856
9084
|
'aria-label': partialNode['aria-label'],
|
|
8857
9085
|
wrapper: partialNode.wrapper,
|
|
8858
9086
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
8859
|
-
hasChildNodes: partialNode.hasChildNodes,
|
|
9087
|
+
hasChildNodes: partialNode.hasChildNodes || false,
|
|
8860
9088
|
childNodes: $eb2240fc39a57fa5$var$iterable(function*() {
|
|
8861
|
-
if (!partialNode.hasChildNodes) return;
|
|
9089
|
+
if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
|
|
8862
9090
|
let index = 0;
|
|
8863
9091
|
for (let child of partialNode.childNodes()){
|
|
8864
9092
|
// Ensure child keys are globally unique by prepending the parent node's key
|
|
@@ -8867,8 +9095,10 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
8867
9095
|
// but another parent has key `ab` and its child has a key `c`. The combined keys would result in both
|
|
8868
9096
|
// children having a key of `abc`.
|
|
8869
9097
|
child.key = `${node.key}${child.key}`;
|
|
8870
|
-
|
|
8871
|
-
|
|
9098
|
+
let nodes = builder.getFullNode({
|
|
9099
|
+
...child,
|
|
9100
|
+
index: index
|
|
9101
|
+
}, builder.getChildState(state, child), node.key, node);
|
|
8872
9102
|
for (let node of nodes){
|
|
8873
9103
|
index++;
|
|
8874
9104
|
yield node;
|
|
@@ -8997,9 +9227,10 @@ function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
|
|
|
8997
9227
|
}
|
|
8998
9228
|
function $c5a24bc478652b5f$var$getAncestors(collection, node) {
|
|
8999
9229
|
let parents = [];
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9230
|
+
let currNode = node;
|
|
9231
|
+
while((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null){
|
|
9232
|
+
currNode = collection.getItem(currNode.parentKey);
|
|
9233
|
+
if (currNode) parents.unshift(currNode);
|
|
9003
9234
|
}
|
|
9004
9235
|
return parents;
|
|
9005
9236
|
}
|
|
@@ -9019,14 +9250,15 @@ const $453cc9f0df89c0a5$var$cache = new WeakMap();
|
|
|
9019
9250
|
function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
9020
9251
|
let count = $453cc9f0df89c0a5$var$cache.get(collection);
|
|
9021
9252
|
if (count != null) return count;
|
|
9022
|
-
count
|
|
9253
|
+
// TS isn't smart enough to know we've ensured count is a number, so use a new variable
|
|
9254
|
+
let counter = 0;
|
|
9023
9255
|
let countItems = (items)=>{
|
|
9024
9256
|
for (let item of items)if (item.type === 'section') countItems(($c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
|
|
9025
|
-
else
|
|
9257
|
+
else counter++;
|
|
9026
9258
|
};
|
|
9027
9259
|
countItems(collection);
|
|
9028
|
-
$453cc9f0df89c0a5$var$cache.set(collection,
|
|
9029
|
-
return
|
|
9260
|
+
$453cc9f0df89c0a5$var$cache.set(collection, counter);
|
|
9261
|
+
return counter;
|
|
9030
9262
|
}
|
|
9031
9263
|
|
|
9032
9264
|
/*
|
|
@@ -9460,141 +9692,38 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
9460
9692
|
accessibilityDescription: stringFormatter.format('longPressMessage'),
|
|
9461
9693
|
onLongPressStart () {
|
|
9462
9694
|
state.close();
|
|
9463
|
-
},
|
|
9464
|
-
onLongPress () {
|
|
9465
|
-
state.open('first');
|
|
9466
|
-
}
|
|
9467
|
-
});
|
|
9468
|
-
let pressProps = {
|
|
9469
|
-
onPressStart (e) {
|
|
9470
|
-
// For consistency with native, open the menu on mouse/key down, but touch up.
|
|
9471
|
-
if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) // If opened with a screen reader, auto focus the first item.
|
|
9472
|
-
// Otherwise, the menu itself will be focused.
|
|
9473
|
-
state.open(e.pointerType === 'virtual' ? 'first' : null);
|
|
9474
|
-
},
|
|
9475
|
-
onPress (e) {
|
|
9476
|
-
if (e.pointerType === 'touch' && !isDisabled) state.toggle();
|
|
9477
|
-
}
|
|
9478
|
-
};
|
|
9479
|
-
// omit onPress from triggerProps since we override it above.
|
|
9480
|
-
delete triggerProps.onPress;
|
|
9481
|
-
return {
|
|
9482
|
-
menuTriggerProps: {
|
|
9483
|
-
...triggerProps,
|
|
9484
|
-
...trigger === 'press' ? pressProps : longPressProps,
|
|
9485
|
-
id: menuTriggerId,
|
|
9486
|
-
onKeyDown: onKeyDown
|
|
9487
|
-
},
|
|
9488
|
-
menuProps: {
|
|
9489
|
-
...overlayProps,
|
|
9490
|
-
'aria-labelledby': menuTriggerId,
|
|
9491
|
-
autoFocus: state.focusStrategy || true,
|
|
9492
|
-
onClose: state.close
|
|
9493
|
-
}
|
|
9494
|
-
};
|
|
9495
|
-
}
|
|
9496
|
-
|
|
9497
|
-
/*
|
|
9498
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
9499
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9500
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9501
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9502
|
-
*
|
|
9503
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
9504
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9505
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
9506
|
-
* governing permissions and limitations under the License.
|
|
9507
|
-
*/
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
|
|
9515
|
-
let { inputElementType: inputElementType = 'input', isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = 'text', validationBehavior: validationBehavior = 'aria' } = props;
|
|
9516
|
-
let [value, setValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue || '', props.onChange);
|
|
9517
|
-
let { focusableProps: focusableProps } = ($e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
|
|
9518
|
-
let validationState = ($e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
9519
|
-
...props,
|
|
9520
|
-
value: value
|
|
9521
|
-
});
|
|
9522
|
-
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = validationState.displayValidation;
|
|
9523
|
-
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = ($2baaea4c71418dea$export$294aa081a6c6f55d)({
|
|
9524
|
-
...props,
|
|
9525
|
-
isInvalid: isInvalid,
|
|
9526
|
-
errorMessage: props.errorMessage || validationErrors
|
|
9527
|
-
});
|
|
9528
|
-
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
9529
|
-
labelable: true
|
|
9530
|
-
});
|
|
9531
|
-
const inputOnlyProps = {
|
|
9532
|
-
type: type,
|
|
9533
|
-
pattern: props.pattern
|
|
9534
|
-
};
|
|
9535
|
-
($99facab73266f662$export$5add1d006293d136)(ref, value, setValue);
|
|
9536
|
-
($e93e671b31057976$export$b8473d3665f3a75a)(props, validationState, ref);
|
|
9537
|
-
($dbSRa$react.useEffect)(()=>{
|
|
9538
|
-
// This works around a React/Chrome bug that prevents textarea elements from validating when controlled.
|
|
9539
|
-
// We prevent React from updating defaultValue (i.e. children) of textarea when `value` changes,
|
|
9540
|
-
// which causes Chrome to skip validation. Only updating `value` is ok in our case since our
|
|
9541
|
-
// textareas are always controlled. React is planning on removing this synchronization in a
|
|
9542
|
-
// future major version.
|
|
9543
|
-
// https://github.com/facebook/react/issues/19474
|
|
9544
|
-
// https://github.com/facebook/react/issues/11896
|
|
9545
|
-
if (ref.current instanceof ($431fbd86ca7dc216$export$f21a1ffae260145a)(ref.current).HTMLTextAreaElement) {
|
|
9546
|
-
let input = ref.current;
|
|
9547
|
-
Object.defineProperty(input, 'defaultValue', {
|
|
9548
|
-
get: ()=>input.value,
|
|
9549
|
-
set: ()=>{},
|
|
9550
|
-
configurable: true
|
|
9551
|
-
});
|
|
9695
|
+
},
|
|
9696
|
+
onLongPress () {
|
|
9697
|
+
state.open('first');
|
|
9552
9698
|
}
|
|
9553
|
-
}
|
|
9554
|
-
|
|
9555
|
-
|
|
9699
|
+
});
|
|
9700
|
+
let pressProps = {
|
|
9701
|
+
onPressStart (e) {
|
|
9702
|
+
// For consistency with native, open the menu on mouse/key down, but touch up.
|
|
9703
|
+
if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) // If opened with a screen reader, auto focus the first item.
|
|
9704
|
+
// Otherwise, the menu itself will be focused.
|
|
9705
|
+
state.open(e.pointerType === 'virtual' ? 'first' : null);
|
|
9706
|
+
},
|
|
9707
|
+
onPress (e) {
|
|
9708
|
+
if (e.pointerType === 'touch' && !isDisabled) state.toggle();
|
|
9709
|
+
}
|
|
9710
|
+
};
|
|
9711
|
+
// omit onPress from triggerProps since we override it above.
|
|
9712
|
+
delete triggerProps.onPress;
|
|
9556
9713
|
return {
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
'aria-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
autoComplete: props.autoComplete,
|
|
9571
|
-
autoCapitalize: props.autoCapitalize,
|
|
9572
|
-
maxLength: props.maxLength,
|
|
9573
|
-
minLength: props.minLength,
|
|
9574
|
-
name: props.name,
|
|
9575
|
-
placeholder: props.placeholder,
|
|
9576
|
-
inputMode: props.inputMode,
|
|
9577
|
-
// Clipboard events
|
|
9578
|
-
onCopy: props.onCopy,
|
|
9579
|
-
onCut: props.onCut,
|
|
9580
|
-
onPaste: props.onPaste,
|
|
9581
|
-
// Composition events
|
|
9582
|
-
onCompositionEnd: props.onCompositionEnd,
|
|
9583
|
-
onCompositionStart: props.onCompositionStart,
|
|
9584
|
-
onCompositionUpdate: props.onCompositionUpdate,
|
|
9585
|
-
// Selection events
|
|
9586
|
-
onSelect: props.onSelect,
|
|
9587
|
-
// Input events
|
|
9588
|
-
onBeforeInput: props.onBeforeInput,
|
|
9589
|
-
onInput: props.onInput,
|
|
9590
|
-
...focusableProps,
|
|
9591
|
-
...fieldProps
|
|
9592
|
-
}),
|
|
9593
|
-
descriptionProps: descriptionProps,
|
|
9594
|
-
errorMessageProps: errorMessageProps,
|
|
9595
|
-
isInvalid: isInvalid,
|
|
9596
|
-
validationErrors: validationErrors,
|
|
9597
|
-
validationDetails: validationDetails
|
|
9714
|
+
// @ts-ignore - TODO we pass out both DOMAttributes AND AriaButtonProps, but useButton will discard the longPress event handlers, it's only through PressResponder magic that this works for RSP and RAC. it does not work in aria examples
|
|
9715
|
+
menuTriggerProps: {
|
|
9716
|
+
...triggerProps,
|
|
9717
|
+
...trigger === 'press' ? pressProps : longPressProps,
|
|
9718
|
+
id: menuTriggerId,
|
|
9719
|
+
onKeyDown: onKeyDown
|
|
9720
|
+
},
|
|
9721
|
+
menuProps: {
|
|
9722
|
+
...overlayProps,
|
|
9723
|
+
'aria-labelledby': menuTriggerId,
|
|
9724
|
+
autoFocus: state.focusStrategy || true,
|
|
9725
|
+
onClose: state.close
|
|
9726
|
+
}
|
|
9598
9727
|
};
|
|
9599
9728
|
}
|
|
9600
9729
|
|
|
@@ -9680,7 +9809,8 @@ function $40df3f8667284809$export$d55e7ee900f34e93(props, ref) {
|
|
|
9680
9809
|
* governing permissions and limitations under the License.
|
|
9681
9810
|
*/ const $ce9b18daab526bbd$export$5b9bb410392e3991 = new WeakMap();
|
|
9682
9811
|
function $ce9b18daab526bbd$export$f45c25170b9a99c2(state, key) {
|
|
9683
|
-
|
|
9812
|
+
var _listMap_get;
|
|
9813
|
+
let { id: id } = (_listMap_get = $ce9b18daab526bbd$export$5b9bb410392e3991.get(state)) !== null && _listMap_get !== void 0 ? _listMap_get : {};
|
|
9684
9814
|
if (!id) throw new Error('Unknown list');
|
|
9685
9815
|
return `${id}-${$ce9b18daab526bbd$export$e0c709538cb8ae18(key)}`;
|
|
9686
9816
|
}
|
|
@@ -10342,7 +10472,7 @@ function $5b9b5b5723db6ae1$export$be42ebdab07ae4c2(props) {
|
|
|
10342
10472
|
let interactionDescription = ($dbSRa$react.useMemo)(()=>{
|
|
10343
10473
|
let selectionMode = props.selectionManager.selectionMode;
|
|
10344
10474
|
let selectionBehavior = props.selectionManager.selectionBehavior;
|
|
10345
|
-
let message
|
|
10475
|
+
let message;
|
|
10346
10476
|
if (shouldLongPress) message = stringFormatter.format('longPressToSelect');
|
|
10347
10477
|
return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;
|
|
10348
10478
|
}, [
|
|
@@ -10464,26 +10594,39 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
10464
10594
|
var _ref_current;
|
|
10465
10595
|
// Don't shift focus to the row if the active element is a element within the row already
|
|
10466
10596
|
// (e.g. clicking on a row button)
|
|
10467
|
-
if (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(document.activeElement))) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
10597
|
+
if (ref.current !== null && (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(document.activeElement)))) ($6a99195332edec8b$export$80f3e147d781571c)(ref.current);
|
|
10468
10598
|
};
|
|
10469
10599
|
let treeGridRowProps = {};
|
|
10470
10600
|
let hasChildRows;
|
|
10471
10601
|
let hasLink = state.selectionManager.isLink(node.key);
|
|
10472
10602
|
if (node != null && 'expandedKeys' in state) {
|
|
10603
|
+
var _state_collection_getChildren, _state_collection, _filter_at;
|
|
10473
10604
|
// TODO: ideally node.hasChildNodes would be a way to tell if a row has child nodes, but the row's contents make it so that value is always
|
|
10474
10605
|
// true...
|
|
10606
|
+
let children = (_state_collection_getChildren = (_state_collection = state.collection).getChildren) === null || _state_collection_getChildren === void 0 ? void 0 : _state_collection_getChildren.call(_state_collection, node.key);
|
|
10475
10607
|
hasChildRows = [
|
|
10476
|
-
...
|
|
10608
|
+
...children !== null && children !== void 0 ? children : []
|
|
10477
10609
|
].length > 1;
|
|
10478
10610
|
if (onAction == null && !hasLink && state.selectionManager.selectionMode === 'none' && hasChildRows) onAction = ()=>state.toggleKey(node.key);
|
|
10479
10611
|
let isExpanded = hasChildRows ? state.expandedKeys.has(node.key) : undefined;
|
|
10612
|
+
let setSize = 1;
|
|
10613
|
+
var _filter_at_index;
|
|
10614
|
+
if (node.level > 0 && (node === null || node === void 0 ? void 0 : node.parentKey) != null) {
|
|
10615
|
+
let parent = state.collection.getItem(node.parentKey);
|
|
10616
|
+
if (parent) {
|
|
10617
|
+
var _state_collection_getChildren1, _state_collection1;
|
|
10618
|
+
// siblings must exist because our original node exists, same with lastItem
|
|
10619
|
+
let siblings = (_state_collection_getChildren1 = (_state_collection1 = state.collection).getChildren) === null || _state_collection_getChildren1 === void 0 ? void 0 : _state_collection_getChildren1.call(_state_collection1, parent.key);
|
|
10620
|
+
setSize = ($c5a24bc478652b5f$export$7475b2c64539e4cf)(siblings).index + 1;
|
|
10621
|
+
}
|
|
10622
|
+
} else setSize = ((_filter_at_index = (_filter_at = [
|
|
10623
|
+
...state.collection
|
|
10624
|
+
].filter((row)=>row.level === 0).at(-1)) === null || _filter_at === void 0 ? void 0 : _filter_at.index) !== null && _filter_at_index !== void 0 ? _filter_at_index : 0) + 1;
|
|
10480
10625
|
treeGridRowProps = {
|
|
10481
10626
|
'aria-expanded': isExpanded,
|
|
10482
10627
|
'aria-level': node.level + 1,
|
|
10483
10628
|
'aria-posinset': (node === null || node === void 0 ? void 0 : node.index) + 1,
|
|
10484
|
-
'aria-setsize':
|
|
10485
|
-
...state.collection
|
|
10486
|
-
].filter((row)=>row.level === 0).at(-1).index + 1
|
|
10629
|
+
'aria-setsize': setSize
|
|
10487
10630
|
};
|
|
10488
10631
|
}
|
|
10489
10632
|
let { itemProps: itemProps, ...itemStates } = ($880e95eb8b93ba9a$export$ecf600387e221c37)({
|
|
@@ -10497,7 +10640,7 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
10497
10640
|
linkBehavior: linkBehavior
|
|
10498
10641
|
});
|
|
10499
10642
|
let onKeyDown = (e)=>{
|
|
10500
|
-
if (!e.currentTarget.contains(e.target)) return;
|
|
10643
|
+
if (!e.currentTarget.contains(e.target) || !ref.current || !document.activeElement) return;
|
|
10501
10644
|
let walker = ($9bf71ea28793e738$export$2d6ec8fc375ceafa)(ref.current);
|
|
10502
10645
|
walker.currentNode = document.activeElement;
|
|
10503
10646
|
if ('expandedKeys' in state && document.activeElement === ref.current) {
|
|
@@ -10582,9 +10725,10 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
10582
10725
|
// to the row above/below instead. We need to re-dispatch the event from a higher parent so it still
|
|
10583
10726
|
// bubbles and gets handled by useSelectableCollection.
|
|
10584
10727
|
if (!e.altKey && ref.current.contains(e.target)) {
|
|
10728
|
+
var _ref_current_parentElement;
|
|
10585
10729
|
e.stopPropagation();
|
|
10586
10730
|
e.preventDefault();
|
|
10587
|
-
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
10731
|
+
(_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
10588
10732
|
}
|
|
10589
10733
|
break;
|
|
10590
10734
|
case 'Tab':
|
|
@@ -10653,8 +10797,8 @@ function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
|
|
|
10653
10797
|
};
|
|
10654
10798
|
}
|
|
10655
10799
|
function $4e8b0456ef72939f$var$last(walker) {
|
|
10656
|
-
let next;
|
|
10657
|
-
let last;
|
|
10800
|
+
let next = null;
|
|
10801
|
+
let last = null;
|
|
10658
10802
|
do {
|
|
10659
10803
|
last = walker.lastChild();
|
|
10660
10804
|
if (last) next = last;
|
|
@@ -10896,7 +11040,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
10896
11040
|
usage: 'search',
|
|
10897
11041
|
sensitivity: 'base'
|
|
10898
11042
|
});
|
|
10899
|
-
let delegate = ($dbSRa$react.useMemo)(()=>keyboardDelegate || new ($2a25aae57d74318e$export$a05409b8bb224a5a)(state.collection, state.disabledKeys,
|
|
11043
|
+
let delegate = ($dbSRa$react.useMemo)(()=>keyboardDelegate || new ($2a25aae57d74318e$export$a05409b8bb224a5a)(state.collection, state.disabledKeys, ref, collator), [
|
|
10900
11044
|
keyboardDelegate,
|
|
10901
11045
|
state.collection,
|
|
10902
11046
|
state.disabledKeys,
|
|
@@ -10910,17 +11054,19 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
10910
11054
|
switch(e.key){
|
|
10911
11055
|
case 'ArrowLeft':
|
|
10912
11056
|
{
|
|
11057
|
+
var _delegate_getKeyAbove, _delegate_getFirstKey;
|
|
10913
11058
|
// prevent scrolling containers
|
|
10914
11059
|
e.preventDefault();
|
|
10915
|
-
let key = state.selectedKey != null ? delegate.getKeyAbove(state.selectedKey) : delegate.getFirstKey();
|
|
11060
|
+
let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, state.selectedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
10916
11061
|
if (key) state.setSelectedKey(key);
|
|
10917
11062
|
break;
|
|
10918
11063
|
}
|
|
10919
11064
|
case 'ArrowRight':
|
|
10920
11065
|
{
|
|
11066
|
+
var _delegate_getKeyBelow, _delegate_getFirstKey1;
|
|
10921
11067
|
// prevent scrolling containers
|
|
10922
11068
|
e.preventDefault();
|
|
10923
|
-
let key = state.selectedKey != null ? delegate.getKeyBelow(state.selectedKey) : delegate.getFirstKey();
|
|
11069
|
+
let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, state.selectedKey) : (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate);
|
|
10924
11070
|
if (key) state.setSelectedKey(key);
|
|
10925
11071
|
break;
|
|
10926
11072
|
}
|
|
@@ -10958,7 +11104,8 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
10958
11104
|
...labelProps,
|
|
10959
11105
|
onClick: ()=>{
|
|
10960
11106
|
if (!props.isDisabled) {
|
|
10961
|
-
|
|
11107
|
+
var _ref_current;
|
|
11108
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
10962
11109
|
// Show the focus ring so the user knows where focus went
|
|
10963
11110
|
($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
|
|
10964
11111
|
}
|
|
@@ -11031,17 +11178,18 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
11031
11178
|
|
|
11032
11179
|
|
|
11033
11180
|
|
|
11034
|
-
|
|
11035
11181
|
function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
11036
11182
|
let data = ($58aed456727eb0f3$export$703601b7e90536f8).get(state) || {};
|
|
11037
11183
|
let { autoComplete: autoComplete, name: name = data.name, isDisabled: isDisabled = data.isDisabled } = props;
|
|
11038
11184
|
let { validationBehavior: validationBehavior, isRequired: isRequired } = data;
|
|
11039
|
-
let modality = ($507fabe10e71c6fb$export$98e20ec92f614cfe)();
|
|
11040
11185
|
let { visuallyHiddenProps: visuallyHiddenProps } = ($5c3e21d68f1c4674$export$a966af930f325cab)();
|
|
11041
11186
|
($99facab73266f662$export$5add1d006293d136)(props.selectRef, state.selectedKey, state.setSelectedKey);
|
|
11042
11187
|
($e93e671b31057976$export$b8473d3665f3a75a)({
|
|
11043
11188
|
validationBehavior: validationBehavior,
|
|
11044
|
-
focus: ()=>
|
|
11189
|
+
focus: ()=>{
|
|
11190
|
+
var _triggerRef_current;
|
|
11191
|
+
return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
|
|
11192
|
+
}
|
|
11045
11193
|
}, state, props.selectRef);
|
|
11046
11194
|
var _state_selectedKey;
|
|
11047
11195
|
// In Safari, the <select> cannot have `display: none` or `hidden` for autofill to work.
|
|
@@ -11050,18 +11198,6 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
11050
11198
|
// The solution is to use <VisuallyHidden> to hide the elements, which clips the elements to a
|
|
11051
11199
|
// 1px rectangle. In addition, we hide from screen readers with aria-hidden, and make the <select>
|
|
11052
11200
|
// non tabbable with tabIndex={-1}.
|
|
11053
|
-
//
|
|
11054
|
-
// In mobile browsers, there are next/previous buttons above the software keyboard for navigating
|
|
11055
|
-
// between fields in a form. These only support native form inputs that are tabbable. In order to
|
|
11056
|
-
// support those, an additional hidden input is used to marshall focus to the button. It is tabbable
|
|
11057
|
-
// except when the button is focused, so that shift tab works properly to go to the actual previous
|
|
11058
|
-
// input in the form. Using the <select> for this also works, but Safari on iOS briefly flashes
|
|
11059
|
-
// the native menu on focus, so this isn't ideal. A font-size of 16px or greater is required to
|
|
11060
|
-
// prevent Safari from zooming in on the input when it is focused.
|
|
11061
|
-
//
|
|
11062
|
-
// If the current interaction modality is null, then the user hasn't interacted with the page yet.
|
|
11063
|
-
// In this case, we set the tabIndex to -1 on the input element so that automated accessibility
|
|
11064
|
-
// checkers don't throw false-positives about focusable elements inside an aria-hidden parent.
|
|
11065
11201
|
return {
|
|
11066
11202
|
containerProps: {
|
|
11067
11203
|
...visuallyHiddenProps,
|
|
@@ -11072,13 +11208,9 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
11072
11208
|
['data-a11y-ignore']: 'aria-hidden-focus'
|
|
11073
11209
|
},
|
|
11074
11210
|
inputProps: {
|
|
11075
|
-
type: 'text',
|
|
11076
|
-
tabIndex: modality == null || state.isFocused || state.isOpen ? -1 : 0,
|
|
11077
11211
|
style: {
|
|
11078
|
-
|
|
11079
|
-
}
|
|
11080
|
-
onFocus: ()=>triggerRef.current.focus(),
|
|
11081
|
-
disabled: isDisabled
|
|
11212
|
+
display: 'none'
|
|
11213
|
+
}
|
|
11082
11214
|
},
|
|
11083
11215
|
selectProps: {
|
|
11084
11216
|
tabIndex: -1,
|
|
@@ -11094,7 +11226,7 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
11094
11226
|
function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
11095
11227
|
let { state: state, triggerRef: triggerRef, label: label, name: name, isDisabled: isDisabled } = props;
|
|
11096
11228
|
let selectRef = ($dbSRa$react.useRef)(null);
|
|
11097
|
-
let { containerProps: containerProps,
|
|
11229
|
+
let { containerProps: containerProps, selectProps: selectProps } = $bdd25dc72710631f$export$f809e80f58e251d1({
|
|
11098
11230
|
...props,
|
|
11099
11231
|
selectRef: selectRef
|
|
11100
11232
|
}, state, triggerRef);
|
|
@@ -11105,14 +11237,14 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
11105
11237
|
if (state.collection.size <= 300) return /*#__PURE__*/ ($dbSRa$react).createElement("div", {
|
|
11106
11238
|
...containerProps,
|
|
11107
11239
|
"data-testid": "hidden-select-container"
|
|
11108
|
-
}, /*#__PURE__*/ ($dbSRa$react).createElement("
|
|
11240
|
+
}, /*#__PURE__*/ ($dbSRa$react).createElement("label", null, label, /*#__PURE__*/ ($dbSRa$react).createElement("select", {
|
|
11109
11241
|
...selectProps,
|
|
11110
11242
|
ref: selectRef
|
|
11111
11243
|
}, /*#__PURE__*/ ($dbSRa$react).createElement("option", null), [
|
|
11112
11244
|
...state.collection.getKeys()
|
|
11113
11245
|
].map((key)=>{
|
|
11114
11246
|
let item = state.collection.getItem(key);
|
|
11115
|
-
if (item.type === 'item') return /*#__PURE__*/ ($dbSRa$react).createElement("option", {
|
|
11247
|
+
if (item && item.type === 'item') return /*#__PURE__*/ ($dbSRa$react).createElement("option", {
|
|
11116
11248
|
key: item.key,
|
|
11117
11249
|
value: item.key
|
|
11118
11250
|
}, item.textValue);
|
|
@@ -11547,7 +11679,6 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
11547
11679
|
let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';
|
|
11548
11680
|
let descProps = ($ef06256079686ba0$export$f8aeda7b10753fa1)(description);
|
|
11549
11681
|
let isFocused = item.key === state.selectionManager.focusedKey;
|
|
11550
|
-
// @ts-ignore - data attributes are ok but TS doesn't know about them.
|
|
11551
11682
|
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item.props);
|
|
11552
11683
|
let linkProps = ($ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6)(item.props);
|
|
11553
11684
|
return {
|
|
@@ -11720,6 +11851,51 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
11720
11851
|
*/
|
|
11721
11852
|
|
|
11722
11853
|
|
|
11854
|
+
const $01b77f81d0f07f68$export$75b6ee27786ba447 = /*#__PURE__*/ ($dbSRa$react.createContext)({});
|
|
11855
|
+
function $01b77f81d0f07f68$var$Label(props, ref) {
|
|
11856
|
+
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $01b77f81d0f07f68$export$75b6ee27786ba447);
|
|
11857
|
+
let { elementType: ElementType = 'label', ...labelProps } = props;
|
|
11858
|
+
// @ts-ignore
|
|
11859
|
+
return /*#__PURE__*/ ($dbSRa$react).createElement(ElementType, {
|
|
11860
|
+
className: "react-aria-Label",
|
|
11861
|
+
...labelProps,
|
|
11862
|
+
ref: ref
|
|
11863
|
+
});
|
|
11864
|
+
}
|
|
11865
|
+
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ ($f39a9eba43920ace$export$86427a43e3e48ebb)($01b77f81d0f07f68$var$Label);
|
|
11866
|
+
|
|
11867
|
+
/*
|
|
11868
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11869
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
11870
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
11871
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11872
|
+
*
|
|
11873
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11874
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11875
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
11876
|
+
* governing permissions and limitations under the License.
|
|
11877
|
+
*/
|
|
11878
|
+
|
|
11879
|
+
|
|
11880
|
+
|
|
11881
|
+
|
|
11882
|
+
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
11883
|
+
|
|
11884
|
+
/*
|
|
11885
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11886
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
11887
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
11888
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11889
|
+
*
|
|
11890
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11891
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11892
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
11893
|
+
* governing permissions and limitations under the License.
|
|
11894
|
+
*/
|
|
11895
|
+
|
|
11896
|
+
|
|
11897
|
+
|
|
11898
|
+
|
|
11723
11899
|
|
|
11724
11900
|
|
|
11725
11901
|
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
|
|
@@ -11735,35 +11911,88 @@ const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
|
|
|
11735
11911
|
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ ($dbSRa$react.createContext)({});
|
|
11736
11912
|
function $d2b4bc8c273e7be6$var$Button(props, ref) {
|
|
11737
11913
|
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
11914
|
+
props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
|
|
11738
11915
|
let ctx = props;
|
|
11916
|
+
let { isPending: isPending } = ctx;
|
|
11739
11917
|
let { buttonProps: buttonProps, isPressed: isPressed } = ($701a24aa0da5b062$export$ea18c227d4417cc3)(props, ref);
|
|
11740
11918
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = ($f7dceffc5ad7768b$export$4e328f61c538687f)(props);
|
|
11741
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)(
|
|
11919
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)({
|
|
11920
|
+
...props,
|
|
11921
|
+
isDisabled: props.isDisabled || isPending
|
|
11922
|
+
});
|
|
11923
|
+
let renderValues = {
|
|
11924
|
+
isHovered: isHovered,
|
|
11925
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
11926
|
+
isFocused: isFocused,
|
|
11927
|
+
isFocusVisible: isFocusVisible,
|
|
11928
|
+
isDisabled: props.isDisabled || false,
|
|
11929
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
11930
|
+
};
|
|
11742
11931
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
11743
11932
|
...props,
|
|
11744
|
-
values:
|
|
11745
|
-
isHovered: isHovered,
|
|
11746
|
-
isPressed: isPressed,
|
|
11747
|
-
isFocused: isFocused,
|
|
11748
|
-
isFocusVisible: isFocusVisible,
|
|
11749
|
-
isDisabled: props.isDisabled || false
|
|
11750
|
-
},
|
|
11933
|
+
values: renderValues,
|
|
11751
11934
|
defaultClassName: 'react-aria-Button'
|
|
11752
11935
|
});
|
|
11936
|
+
let buttonId = ($bdb11010cef70236$export$f680877a34711e37)(buttonProps.id);
|
|
11937
|
+
let progressId = ($bdb11010cef70236$export$f680877a34711e37)();
|
|
11938
|
+
let ariaLabelledby = buttonProps['aria-labelledby'];
|
|
11939
|
+
if (isPending) {
|
|
11940
|
+
// aria-labelledby wins over aria-label
|
|
11941
|
+
// https://www.w3.org/TR/accname-1.2/#computation-steps
|
|
11942
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
11943
|
+
else if (buttonProps['aria-label']) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
11944
|
+
}
|
|
11945
|
+
let wasPending = ($dbSRa$react.useRef)(isPending);
|
|
11946
|
+
($dbSRa$react.useEffect)(()=>{
|
|
11947
|
+
let message = {
|
|
11948
|
+
'aria-labelledby': ariaLabelledby || buttonId
|
|
11949
|
+
};
|
|
11950
|
+
if (!wasPending.current && isFocused && isPending) ($319e236875307eab$export$a9b970dcc4ae71a9)(message, 'assertive');
|
|
11951
|
+
else if (wasPending.current && isFocused && !isPending) ($319e236875307eab$export$a9b970dcc4ae71a9)(message, 'assertive');
|
|
11952
|
+
wasPending.current = isPending;
|
|
11953
|
+
}, [
|
|
11954
|
+
isPending,
|
|
11955
|
+
isFocused,
|
|
11956
|
+
ariaLabelledby,
|
|
11957
|
+
buttonId
|
|
11958
|
+
]);
|
|
11753
11959
|
return /*#__PURE__*/ ($dbSRa$react).createElement("button", {
|
|
11754
11960
|
...($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
|
|
11755
11961
|
propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
|
|
11756
11962
|
}),
|
|
11757
11963
|
...($3ef42575df84b30b$export$9d1611c77c2fe928)(buttonProps, focusProps, hoverProps),
|
|
11758
11964
|
...renderProps,
|
|
11965
|
+
id: buttonId,
|
|
11759
11966
|
ref: ref,
|
|
11967
|
+
"aria-labelledby": ariaLabelledby,
|
|
11760
11968
|
slot: props.slot || undefined,
|
|
11969
|
+
"aria-disabled": isPending ? 'true' : buttonProps['aria-disabled'],
|
|
11761
11970
|
"data-disabled": props.isDisabled || undefined,
|
|
11762
|
-
"data-pressed":
|
|
11971
|
+
"data-pressed": renderValues.isPressed || undefined,
|
|
11763
11972
|
"data-hovered": isHovered || undefined,
|
|
11764
11973
|
"data-focused": isFocused || undefined,
|
|
11974
|
+
"data-pending": isPending || undefined,
|
|
11765
11975
|
"data-focus-visible": isFocusVisible || undefined
|
|
11766
|
-
})
|
|
11976
|
+
}, /*#__PURE__*/ ($dbSRa$react).createElement(($0393f8ab869a0f1a$export$e9f3bf65a26ce129).Provider, {
|
|
11977
|
+
value: {
|
|
11978
|
+
id: progressId
|
|
11979
|
+
}
|
|
11980
|
+
}, renderProps.children));
|
|
11981
|
+
}
|
|
11982
|
+
function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
|
|
11983
|
+
// Don't allow interaction while isPending is true
|
|
11984
|
+
if (props.isPending) {
|
|
11985
|
+
props.onPress = undefined;
|
|
11986
|
+
props.onPressStart = undefined;
|
|
11987
|
+
props.onPressEnd = undefined;
|
|
11988
|
+
props.onPressChange = undefined;
|
|
11989
|
+
props.onPressUp = undefined;
|
|
11990
|
+
props.onKeyDown = undefined;
|
|
11991
|
+
props.onKeyUp = undefined;
|
|
11992
|
+
props.onClick = undefined;
|
|
11993
|
+
props.href = undefined;
|
|
11994
|
+
}
|
|
11995
|
+
return props;
|
|
11767
11996
|
}
|
|
11768
11997
|
/**
|
|
11769
11998
|
* A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
|
|
@@ -11878,11 +12107,13 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
11878
12107
|
}
|
|
11879
12108
|
getKeyBefore(key) {
|
|
11880
12109
|
let node = this.keyMap.get(key);
|
|
11881
|
-
|
|
12110
|
+
var _node_prevKey;
|
|
12111
|
+
return node ? (_node_prevKey = node.prevKey) !== null && _node_prevKey !== void 0 ? _node_prevKey : null : null;
|
|
11882
12112
|
}
|
|
11883
12113
|
getKeyAfter(key) {
|
|
11884
12114
|
let node = this.keyMap.get(key);
|
|
11885
|
-
|
|
12115
|
+
var _node_nextKey;
|
|
12116
|
+
return node ? (_node_nextKey = node.nextKey) !== null && _node_nextKey !== void 0 ? _node_nextKey : null : null;
|
|
11886
12117
|
}
|
|
11887
12118
|
getFirstKey() {
|
|
11888
12119
|
return this.firstKey;
|
|
@@ -11891,7 +12122,8 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
11891
12122
|
return this.lastKey;
|
|
11892
12123
|
}
|
|
11893
12124
|
getItem(key) {
|
|
11894
|
-
|
|
12125
|
+
var _this_keyMap_get;
|
|
12126
|
+
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
|
|
11895
12127
|
}
|
|
11896
12128
|
at(idx) {
|
|
11897
12129
|
const keys = [
|
|
@@ -11905,13 +12137,15 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
11905
12137
|
}
|
|
11906
12138
|
constructor(nodes){
|
|
11907
12139
|
this.keyMap = new Map();
|
|
12140
|
+
this.firstKey = null;
|
|
12141
|
+
this.lastKey = null;
|
|
11908
12142
|
this.iterable = nodes;
|
|
11909
12143
|
let visit = (node)=>{
|
|
11910
12144
|
this.keyMap.set(node.key, node);
|
|
11911
12145
|
if (node.childNodes && node.type === 'section') for (let child of node.childNodes)visit(child);
|
|
11912
12146
|
};
|
|
11913
12147
|
for (let node of nodes)visit(node);
|
|
11914
|
-
let last;
|
|
12148
|
+
let last = null;
|
|
11915
12149
|
let index = 0;
|
|
11916
12150
|
for (let [key, node] of this.keyMap){
|
|
11917
12151
|
if (last) {
|
|
@@ -11927,7 +12161,8 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
11927
12161
|
// If it isn't the last node, last.nextKey will properly set at start of new loop
|
|
11928
12162
|
last.nextKey = undefined;
|
|
11929
12163
|
}
|
|
11930
|
-
|
|
12164
|
+
var _last_key;
|
|
12165
|
+
this.lastKey = (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
11931
12166
|
}
|
|
11932
12167
|
}
|
|
11933
12168
|
|
|
@@ -11945,11 +12180,11 @@ function $587d3ad58be6d31f$export$daff6da51032a415(props = {}) {
|
|
|
11945
12180
|
constructor(keys, anchorKey, currentKey){
|
|
11946
12181
|
super(keys);
|
|
11947
12182
|
if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
|
|
11948
|
-
this.anchorKey = anchorKey
|
|
11949
|
-
this.currentKey = currentKey
|
|
12183
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
|
|
12184
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
|
|
11950
12185
|
} else {
|
|
11951
|
-
this.anchorKey = anchorKey;
|
|
11952
|
-
this.currentKey = currentKey;
|
|
12186
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
|
|
12187
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
|
|
11953
12188
|
}
|
|
11954
12189
|
}
|
|
11955
12190
|
}
|
|
@@ -11975,7 +12210,7 @@ function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
|
|
|
11975
12210
|
return true;
|
|
11976
12211
|
}
|
|
11977
12212
|
function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
|
|
11978
|
-
let { selectionMode: selectionMode = 'none', disallowEmptySelection: disallowEmptySelection, allowDuplicateSelectionEvents: allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = 'toggle', disabledBehavior: disabledBehavior = 'all' } = props;
|
|
12213
|
+
let { selectionMode: selectionMode = 'none', disallowEmptySelection: disallowEmptySelection = false, allowDuplicateSelectionEvents: allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = 'toggle', disabledBehavior: disabledBehavior = 'all' } = props;
|
|
11979
12214
|
// We want synchronous updates to `isFocused` and `focusedKey` after their setters are called.
|
|
11980
12215
|
// But we also need to trigger a react re-render. So, we have both a ref (sync) and state (async).
|
|
11981
12216
|
let isFocusedRef = ($dbSRa$react.useRef)(false);
|
|
@@ -12114,8 +12349,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12114
12349
|
* Returns whether a key is selected.
|
|
12115
12350
|
*/ isSelected(key) {
|
|
12116
12351
|
if (this.state.selectionMode === 'none') return false;
|
|
12117
|
-
|
|
12118
|
-
|
|
12352
|
+
let mappedKey = this.getKey(key);
|
|
12353
|
+
if (mappedKey == null) return false;
|
|
12354
|
+
return this.state.selectedKeys === 'all' ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
|
|
12119
12355
|
}
|
|
12120
12356
|
/**
|
|
12121
12357
|
* Whether the selection is empty.
|
|
@@ -12139,7 +12375,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12139
12375
|
let item = this.collection.getItem(key);
|
|
12140
12376
|
if (!first || item && ($c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, first) < 0) first = item;
|
|
12141
12377
|
}
|
|
12142
|
-
|
|
12378
|
+
var _first_key;
|
|
12379
|
+
return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
|
|
12143
12380
|
}
|
|
12144
12381
|
get lastSelectedKey() {
|
|
12145
12382
|
let last = null;
|
|
@@ -12147,7 +12384,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12147
12384
|
let item = this.collection.getItem(key);
|
|
12148
12385
|
if (!last || item && ($c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, last) > 0) last = item;
|
|
12149
12386
|
}
|
|
12150
|
-
|
|
12387
|
+
var _last_key;
|
|
12388
|
+
return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
12151
12389
|
}
|
|
12152
12390
|
get disabledKeys() {
|
|
12153
12391
|
return this.state.disabledKeys;
|
|
@@ -12163,18 +12401,21 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12163
12401
|
this.replaceSelection(toKey);
|
|
12164
12402
|
return;
|
|
12165
12403
|
}
|
|
12166
|
-
|
|
12404
|
+
let mappedToKey = this.getKey(toKey);
|
|
12405
|
+
if (mappedToKey == null) return;
|
|
12167
12406
|
let selection;
|
|
12168
12407
|
// Only select the one key if coming from a select all.
|
|
12169
12408
|
if (this.state.selectedKeys === 'all') selection = new ($e40ea825a81a3709$export$52baac22726c72bf)([
|
|
12170
|
-
|
|
12171
|
-
],
|
|
12409
|
+
mappedToKey
|
|
12410
|
+
], mappedToKey, mappedToKey);
|
|
12172
12411
|
else {
|
|
12173
12412
|
let selectedKeys = this.state.selectedKeys;
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12413
|
+
var _selectedKeys_anchorKey;
|
|
12414
|
+
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
|
|
12415
|
+
selection = new ($e40ea825a81a3709$export$52baac22726c72bf)(selectedKeys, anchorKey, mappedToKey);
|
|
12416
|
+
var _selectedKeys_currentKey;
|
|
12417
|
+
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey))selection.delete(key);
|
|
12418
|
+
for (let key of this.getKeyRange(mappedToKey, anchorKey))if (this.canSelectItem(key)) selection.add(key);
|
|
12178
12419
|
}
|
|
12179
12420
|
this.state.setSelectedKeys(selection);
|
|
12180
12421
|
}
|
|
@@ -12188,11 +12429,13 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12188
12429
|
return [];
|
|
12189
12430
|
}
|
|
12190
12431
|
getKeyRangeInternal(from, to) {
|
|
12432
|
+
var _this_layoutDelegate;
|
|
12433
|
+
if ((_this_layoutDelegate = this.layoutDelegate) === null || _this_layoutDelegate === void 0 ? void 0 : _this_layoutDelegate.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
|
|
12191
12434
|
let keys = [];
|
|
12192
12435
|
let key = from;
|
|
12193
|
-
while(key){
|
|
12436
|
+
while(key != null){
|
|
12194
12437
|
let item = this.collection.getItem(key);
|
|
12195
|
-
if (item && item.type === 'item' || item.type === 'cell' && this.allowsCellSelection) keys.push(key);
|
|
12438
|
+
if (item && (item.type === 'item' || item.type === 'cell' && this.allowsCellSelection)) keys.push(key);
|
|
12196
12439
|
if (key === to) return keys;
|
|
12197
12440
|
key = this.collection.getKeyAfter(key);
|
|
12198
12441
|
}
|
|
@@ -12205,7 +12448,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12205
12448
|
// If cell selection is allowed, just return the key.
|
|
12206
12449
|
if (item.type === 'cell' && this.allowsCellSelection) return key;
|
|
12207
12450
|
// Find a parent item to select
|
|
12208
|
-
while(item.type !== 'item' && item.parentKey != null)item = this.collection.getItem(item.parentKey);
|
|
12451
|
+
while(item && item.type !== 'item' && item.parentKey != null)item = this.collection.getItem(item.parentKey);
|
|
12209
12452
|
if (!item || item.type !== 'item') return null;
|
|
12210
12453
|
return item.key;
|
|
12211
12454
|
}
|
|
@@ -12217,14 +12460,14 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12217
12460
|
this.replaceSelection(key);
|
|
12218
12461
|
return;
|
|
12219
12462
|
}
|
|
12220
|
-
|
|
12221
|
-
if (
|
|
12463
|
+
let mappedKey = this.getKey(key);
|
|
12464
|
+
if (mappedKey == null) return;
|
|
12222
12465
|
let keys = new ($e40ea825a81a3709$export$52baac22726c72bf)(this.state.selectedKeys === 'all' ? this.getSelectAllKeys() : this.state.selectedKeys);
|
|
12223
|
-
if (keys.has(
|
|
12224
|
-
else if (this.canSelectItem(
|
|
12225
|
-
keys.add(
|
|
12226
|
-
keys.anchorKey =
|
|
12227
|
-
keys.currentKey =
|
|
12466
|
+
if (keys.has(mappedKey)) keys.delete(mappedKey);
|
|
12467
|
+
else if (this.canSelectItem(mappedKey)) {
|
|
12468
|
+
keys.add(mappedKey);
|
|
12469
|
+
keys.anchorKey = mappedKey;
|
|
12470
|
+
keys.currentKey = mappedKey;
|
|
12228
12471
|
}
|
|
12229
12472
|
if (this.disallowEmptySelection && keys.size === 0) return;
|
|
12230
12473
|
this.state.setSelectedKeys(keys);
|
|
@@ -12233,11 +12476,11 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12233
12476
|
* Replaces the selection with only the given key.
|
|
12234
12477
|
*/ replaceSelection(key) {
|
|
12235
12478
|
if (this.selectionMode === 'none') return;
|
|
12236
|
-
|
|
12237
|
-
if (
|
|
12238
|
-
let selection = this.canSelectItem(
|
|
12239
|
-
|
|
12240
|
-
],
|
|
12479
|
+
let mappedKey = this.getKey(key);
|
|
12480
|
+
if (mappedKey == null) return;
|
|
12481
|
+
let selection = this.canSelectItem(mappedKey) ? new ($e40ea825a81a3709$export$52baac22726c72bf)([
|
|
12482
|
+
mappedKey
|
|
12483
|
+
], mappedKey, mappedKey) : new ($e40ea825a81a3709$export$52baac22726c72bf)();
|
|
12241
12484
|
this.state.setSelectedKeys(selection);
|
|
12242
12485
|
}
|
|
12243
12486
|
/**
|
|
@@ -12246,9 +12489,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12246
12489
|
if (this.selectionMode === 'none') return;
|
|
12247
12490
|
let selection = new ($e40ea825a81a3709$export$52baac22726c72bf)();
|
|
12248
12491
|
for (let key of keys){
|
|
12249
|
-
|
|
12250
|
-
if (
|
|
12251
|
-
selection.add(
|
|
12492
|
+
let mappedKey = this.getKey(key);
|
|
12493
|
+
if (mappedKey != null) {
|
|
12494
|
+
selection.add(mappedKey);
|
|
12252
12495
|
if (this.selectionMode === 'single') break;
|
|
12253
12496
|
}
|
|
12254
12497
|
}
|
|
@@ -12259,10 +12502,12 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12259
12502
|
let addKeys = (key)=>{
|
|
12260
12503
|
while(key != null){
|
|
12261
12504
|
if (this.canSelectItem(key)) {
|
|
12505
|
+
var _getFirstItem;
|
|
12262
12506
|
let item = this.collection.getItem(key);
|
|
12263
|
-
if (item.type === 'item') keys.push(key);
|
|
12507
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 'item') keys.push(key);
|
|
12508
|
+
var _getFirstItem_key;
|
|
12264
12509
|
// Add child keys. If cell selection is allowed, then include item children too.
|
|
12265
|
-
if (item.hasChildNodes && (this.allowsCellSelection || item.type !== 'item')) addKeys(($c5a24bc478652b5f$export$fbdeaa6a76694f71)(($c5a24bc478652b5f$export$1005530eda016c13)(item, this.collection)).key);
|
|
12510
|
+
if ((item === null || item === void 0 ? void 0 : item.hasChildNodes) && (this.allowsCellSelection || item.type !== 'item')) addKeys((_getFirstItem_key = (_getFirstItem = ($c5a24bc478652b5f$export$fbdeaa6a76694f71)(($c5a24bc478652b5f$export$1005530eda016c13)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null);
|
|
12266
12511
|
}
|
|
12267
12512
|
key = this.collection.getKeyAfter(key);
|
|
12268
12513
|
}
|
|
@@ -12335,6 +12580,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12335
12580
|
var _options_allowsCellSelection;
|
|
12336
12581
|
this.allowsCellSelection = (_options_allowsCellSelection = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && _options_allowsCellSelection !== void 0 ? _options_allowsCellSelection : false;
|
|
12337
12582
|
this._isSelectAll = null;
|
|
12583
|
+
this.layoutDelegate = (options === null || options === void 0 ? void 0 : options.layoutDelegate) || null;
|
|
12338
12584
|
}
|
|
12339
12585
|
}
|
|
12340
12586
|
|
|
@@ -12353,7 +12599,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
12353
12599
|
|
|
12354
12600
|
|
|
12355
12601
|
function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
|
|
12356
|
-
let { filter: filter } = props;
|
|
12602
|
+
let { filter: filter, layoutDelegate: layoutDelegate } = props;
|
|
12357
12603
|
let selectionState = ($7af3f5b51489e0b5$export$253fe78d46329472)(props);
|
|
12358
12604
|
let disabledKeys = ($dbSRa$react.useMemo)(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set(), [
|
|
12359
12605
|
props.disabledKeys
|
|
@@ -12367,30 +12613,35 @@ function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
|
|
|
12367
12613
|
props.suppressTextValueWarning
|
|
12368
12614
|
]);
|
|
12369
12615
|
let collection = ($7613b1592d41b092$export$6cd28814d92fa9c9)(props, factory, context);
|
|
12370
|
-
let selectionManager = ($dbSRa$react.useMemo)(()=>new ($d496c0a20b6e58ec$export$6c8a5aaad13c9852)(collection, selectionState
|
|
12616
|
+
let selectionManager = ($dbSRa$react.useMemo)(()=>new ($d496c0a20b6e58ec$export$6c8a5aaad13c9852)(collection, selectionState, {
|
|
12617
|
+
layoutDelegate: layoutDelegate
|
|
12618
|
+
}), [
|
|
12371
12619
|
collection,
|
|
12372
|
-
selectionState
|
|
12620
|
+
selectionState,
|
|
12621
|
+
layoutDelegate
|
|
12373
12622
|
]);
|
|
12374
12623
|
// Reset focused key if that item is deleted from the collection.
|
|
12375
12624
|
const cachedCollection = ($dbSRa$react.useRef)(null);
|
|
12376
12625
|
($dbSRa$react.useEffect)(()=>{
|
|
12377
|
-
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) {
|
|
12626
|
+
if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey) && cachedCollection.current) {
|
|
12378
12627
|
const startItem = cachedCollection.current.getItem(selectionState.focusedKey);
|
|
12379
12628
|
const cachedItemNodes = [
|
|
12380
12629
|
...cachedCollection.current.getKeys()
|
|
12381
12630
|
].map((key)=>{
|
|
12382
12631
|
const itemNode = cachedCollection.current.getItem(key);
|
|
12383
|
-
return itemNode.type === 'item' ? itemNode : null;
|
|
12632
|
+
return (itemNode === null || itemNode === void 0 ? void 0 : itemNode.type) === 'item' ? itemNode : null;
|
|
12384
12633
|
}).filter((node)=>node !== null);
|
|
12385
12634
|
const itemNodes = [
|
|
12386
12635
|
...collection.getKeys()
|
|
12387
12636
|
].map((key)=>{
|
|
12388
12637
|
const itemNode = collection.getItem(key);
|
|
12389
|
-
return itemNode.type === 'item' ? itemNode : null;
|
|
12638
|
+
return (itemNode === null || itemNode === void 0 ? void 0 : itemNode.type) === 'item' ? itemNode : null;
|
|
12390
12639
|
}).filter((node)=>node !== null);
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12640
|
+
var _cachedItemNodes_length, _itemNodes_length;
|
|
12641
|
+
const diff = ((_cachedItemNodes_length = cachedItemNodes === null || cachedItemNodes === void 0 ? void 0 : cachedItemNodes.length) !== null && _cachedItemNodes_length !== void 0 ? _cachedItemNodes_length : 0) - ((_itemNodes_length = itemNodes === null || itemNodes === void 0 ? void 0 : itemNodes.length) !== null && _itemNodes_length !== void 0 ? _itemNodes_length : 0);
|
|
12642
|
+
var _startItem_index, _startItem_index1, _itemNodes_length1;
|
|
12643
|
+
let index = Math.min(diff > 1 ? Math.max(((_startItem_index = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index !== void 0 ? _startItem_index : 0) - diff + 1, 0) : (_startItem_index1 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index1 !== void 0 ? _startItem_index1 : 0, ((_itemNodes_length1 = itemNodes === null || itemNodes === void 0 ? void 0 : itemNodes.length) !== null && _itemNodes_length1 !== void 0 ? _itemNodes_length1 : 0) - 1);
|
|
12644
|
+
let newNode = null;
|
|
12394
12645
|
let isReverseSearching = false;
|
|
12395
12646
|
while(index >= 0){
|
|
12396
12647
|
if (!selectionManager.isDisabled(itemNodes[index].key)) {
|
|
@@ -12401,7 +12652,8 @@ function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
|
|
|
12401
12652
|
if (index < itemNodes.length - 1 && !isReverseSearching) index++;
|
|
12402
12653
|
else {
|
|
12403
12654
|
isReverseSearching = true;
|
|
12404
|
-
|
|
12655
|
+
var _startItem_index2, _startItem_index3;
|
|
12656
|
+
if (index > ((_startItem_index2 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index2 !== void 0 ? _startItem_index2 : 0)) index = (_startItem_index3 = startItem === null || startItem === void 0 ? void 0 : startItem.index) !== null && _startItem_index3 !== void 0 ? _startItem_index3 : 0;
|
|
12405
12657
|
index--;
|
|
12406
12658
|
}
|
|
12407
12659
|
}
|
|
@@ -12449,6 +12701,8 @@ function $a0d645289fe9b86b$export$e7f05e985daf4b5f(props) {
|
|
|
12449
12701
|
allowDuplicateSelectionEvents: true,
|
|
12450
12702
|
selectedKeys: selectedKeys,
|
|
12451
12703
|
onSelectionChange: (keys)=>{
|
|
12704
|
+
// impossible, but TS doesn't know that
|
|
12705
|
+
if (keys === 'all') return;
|
|
12452
12706
|
var _keys_values_next_value;
|
|
12453
12707
|
let key = (_keys_values_next_value = keys.values().next().value) !== null && _keys_values_next_value !== void 0 ? _keys_values_next_value : null;
|
|
12454
12708
|
// Always fire onSelectionChange, even if the key is the same
|
|
@@ -12507,6 +12761,62 @@ function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
|
|
|
12507
12761
|
};
|
|
12508
12762
|
}
|
|
12509
12763
|
|
|
12764
|
+
/*
|
|
12765
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12766
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12767
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12768
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12769
|
+
*
|
|
12770
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12771
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12772
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12773
|
+
* governing permissions and limitations under the License.
|
|
12774
|
+
*/
|
|
12775
|
+
|
|
12776
|
+
function $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props) {
|
|
12777
|
+
let overlayTriggerState = ($fc909762b330b746$export$61c6a8c84e605fb6)(props);
|
|
12778
|
+
let [focusStrategy, setFocusStrategy] = ($dbSRa$react.useState)(null);
|
|
12779
|
+
let [expandedKeysStack, setExpandedKeysStack] = ($dbSRa$react.useState)([]);
|
|
12780
|
+
let closeAll = ()=>{
|
|
12781
|
+
setExpandedKeysStack([]);
|
|
12782
|
+
overlayTriggerState.close();
|
|
12783
|
+
};
|
|
12784
|
+
let openSubmenu = (triggerKey, level)=>{
|
|
12785
|
+
setExpandedKeysStack((oldStack)=>{
|
|
12786
|
+
if (level > oldStack.length) return oldStack;
|
|
12787
|
+
return [
|
|
12788
|
+
...oldStack.slice(0, level),
|
|
12789
|
+
triggerKey
|
|
12790
|
+
];
|
|
12791
|
+
});
|
|
12792
|
+
};
|
|
12793
|
+
let closeSubmenu = (triggerKey, level)=>{
|
|
12794
|
+
setExpandedKeysStack((oldStack)=>{
|
|
12795
|
+
let key = oldStack[level];
|
|
12796
|
+
if (key === triggerKey) return oldStack.slice(0, level);
|
|
12797
|
+
else return oldStack;
|
|
12798
|
+
});
|
|
12799
|
+
};
|
|
12800
|
+
return {
|
|
12801
|
+
focusStrategy: focusStrategy,
|
|
12802
|
+
...overlayTriggerState,
|
|
12803
|
+
open (focusStrategy = null) {
|
|
12804
|
+
setFocusStrategy(focusStrategy);
|
|
12805
|
+
overlayTriggerState.open();
|
|
12806
|
+
},
|
|
12807
|
+
toggle (focusStrategy = null) {
|
|
12808
|
+
setFocusStrategy(focusStrategy);
|
|
12809
|
+
overlayTriggerState.toggle();
|
|
12810
|
+
},
|
|
12811
|
+
close () {
|
|
12812
|
+
closeAll();
|
|
12813
|
+
},
|
|
12814
|
+
expandedKeysStack: expandedKeysStack,
|
|
12815
|
+
openSubmenu: openSubmenu,
|
|
12816
|
+
closeSubmenu: closeSubmenu
|
|
12817
|
+
};
|
|
12818
|
+
}
|
|
12819
|
+
|
|
12510
12820
|
/*
|
|
12511
12821
|
* Copyright 2020 Adobe. All rights reserved.
|
|
12512
12822
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -12632,7 +12942,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
12632
12942
|
let { delay: delay = $8796f90736e175cb$var$TOOLTIP_DELAY, closeDelay: closeDelay = $8796f90736e175cb$var$TOOLTIP_COOLDOWN } = props;
|
|
12633
12943
|
let { isOpen: isOpen, open: open, close: close } = ($fc909762b330b746$export$61c6a8c84e605fb6)(props);
|
|
12634
12944
|
let id = ($dbSRa$react.useMemo)(()=>`${++$8796f90736e175cb$var$tooltipId}`, []);
|
|
12635
|
-
let closeTimeout = ($dbSRa$react.useRef)(
|
|
12945
|
+
let closeTimeout = ($dbSRa$react.useRef)(null);
|
|
12636
12946
|
let closeCallback = ($dbSRa$react.useRef)(close);
|
|
12637
12947
|
let ensureTooltipEntry = ()=>{
|
|
12638
12948
|
$8796f90736e175cb$var$tooltips[id] = hideTooltip;
|
|
@@ -12644,7 +12954,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
12644
12954
|
}
|
|
12645
12955
|
};
|
|
12646
12956
|
let showTooltip = ()=>{
|
|
12647
|
-
clearTimeout(closeTimeout.current);
|
|
12957
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
12648
12958
|
closeTimeout.current = null;
|
|
12649
12959
|
closeOpenTooltips();
|
|
12650
12960
|
ensureTooltipEntry();
|
|
@@ -12661,7 +12971,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
12661
12971
|
};
|
|
12662
12972
|
let hideTooltip = (immediate)=>{
|
|
12663
12973
|
if (immediate || closeDelay <= 0) {
|
|
12664
|
-
clearTimeout(closeTimeout.current);
|
|
12974
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
12665
12975
|
closeTimeout.current = null;
|
|
12666
12976
|
closeCallback.current();
|
|
12667
12977
|
} else if (!closeTimeout.current) closeTimeout.current = setTimeout(()=>{
|
|
@@ -12696,10 +13006,9 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
12696
13006
|
}, [
|
|
12697
13007
|
close
|
|
12698
13008
|
]);
|
|
12699
|
-
// eslint-disable-next-line arrow-body-style
|
|
12700
13009
|
($dbSRa$react.useEffect)(()=>{
|
|
12701
13010
|
return ()=>{
|
|
12702
|
-
clearTimeout(closeTimeout.current);
|
|
13011
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
12703
13012
|
let tooltip = $8796f90736e175cb$var$tooltips[id];
|
|
12704
13013
|
if (tooltip) delete $8796f90736e175cb$var$tooltips[id];
|
|
12705
13014
|
};
|
|
@@ -12729,6 +13038,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
12729
13038
|
*/
|
|
12730
13039
|
|
|
12731
13040
|
|
|
13041
|
+
|
|
12732
13042
|
const $ee014567cb39d3f0$export$ff05c3ac10437e03 = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
12733
13043
|
function $ee014567cb39d3f0$var$FieldError(props, ref) {
|
|
12734
13044
|
let validation = ($dbSRa$react.useContext)($ee014567cb39d3f0$export$ff05c3ac10437e03);
|
|
@@ -12743,6 +13053,7 @@ function $ee014567cb39d3f0$var$FieldError(props, ref) {
|
|
|
12743
13053
|
*/ const $ee014567cb39d3f0$export$f551688fc98f2e09 = /*#__PURE__*/ ($dbSRa$react.forwardRef)($ee014567cb39d3f0$var$FieldError);
|
|
12744
13054
|
const $ee014567cb39d3f0$var$FieldErrorInner = /*#__PURE__*/ ($dbSRa$react.forwardRef)((props, ref)=>{
|
|
12745
13055
|
let validation = ($dbSRa$react.useContext)($ee014567cb39d3f0$export$ff05c3ac10437e03);
|
|
13056
|
+
let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props);
|
|
12746
13057
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
12747
13058
|
...props,
|
|
12748
13059
|
defaultClassName: 'react-aria-FieldError',
|
|
@@ -12752,6 +13063,7 @@ const $ee014567cb39d3f0$var$FieldErrorInner = /*#__PURE__*/ ($dbSRa$react.forwar
|
|
|
12752
13063
|
if (renderProps.children == null) return null;
|
|
12753
13064
|
return /*#__PURE__*/ ($dbSRa$react).createElement(($514c0188e459b4c0$export$5f1af8db9871e1d6), {
|
|
12754
13065
|
slot: "errorMessage",
|
|
13066
|
+
...domProps,
|
|
12755
13067
|
...renderProps,
|
|
12756
13068
|
ref: ref
|
|
12757
13069
|
});
|
|
@@ -12806,32 +13118,6 @@ function $d3e0e05bdfcf66bd$var$Form(props, ref) {
|
|
|
12806
13118
|
*/
|
|
12807
13119
|
|
|
12808
13120
|
|
|
12809
|
-
const $01b77f81d0f07f68$export$75b6ee27786ba447 = /*#__PURE__*/ ($dbSRa$react.createContext)({});
|
|
12810
|
-
function $01b77f81d0f07f68$var$Label(props, ref) {
|
|
12811
|
-
[props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $01b77f81d0f07f68$export$75b6ee27786ba447);
|
|
12812
|
-
let { elementType: ElementType = 'label', ...labelProps } = props;
|
|
12813
|
-
// @ts-ignore
|
|
12814
|
-
return /*#__PURE__*/ ($dbSRa$react).createElement(ElementType, {
|
|
12815
|
-
className: "react-aria-Label",
|
|
12816
|
-
...labelProps,
|
|
12817
|
-
ref: ref
|
|
12818
|
-
});
|
|
12819
|
-
}
|
|
12820
|
-
const $01b77f81d0f07f68$export$b04be29aa201d4f5 = /*#__PURE__*/ ($f39a9eba43920ace$export$86427a43e3e48ebb)($01b77f81d0f07f68$var$Label);
|
|
12821
|
-
|
|
12822
|
-
/*
|
|
12823
|
-
* Copyright 2022 Adobe. All rights reserved.
|
|
12824
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12825
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12826
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12827
|
-
*
|
|
12828
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12829
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12830
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12831
|
-
* governing permissions and limitations under the License.
|
|
12832
|
-
*/
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
13121
|
|
|
12836
13122
|
|
|
12837
13123
|
|
|
@@ -12915,7 +13201,7 @@ function $bc237834342dbd75$var$Checkbox(props, ref) {
|
|
|
12915
13201
|
let groupState = ($dbSRa$react.useContext)($bc237834342dbd75$export$139c5b8563afc1fc);
|
|
12916
13202
|
let inputRef = ($df56164dff5785e2$export$4338b53315abf666)(($5dc95899b306f630$export$c9058316764c140e)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null));
|
|
12917
13203
|
let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isReadOnly: isReadOnly, isPressed: isPressed, isInvalid: isInvalid } = groupState ? ($fba3e38d5ca8983f$export$353b32fc6898d37d)({
|
|
12918
|
-
...props,
|
|
13204
|
+
...($64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
12919
13205
|
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
12920
13206
|
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
12921
13207
|
// @ts-ignore
|
|
@@ -12923,7 +13209,7 @@ function $bc237834342dbd75$var$Checkbox(props, ref) {
|
|
|
12923
13209
|
// ReactNode type doesn't allow function children.
|
|
12924
13210
|
children: typeof props.children === 'function' ? true : props.children
|
|
12925
13211
|
}, groupState, inputRef) : ($406796ff087fe49b$export$e375f10ce42261c5)({
|
|
12926
|
-
...props,
|
|
13212
|
+
...($64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
12927
13213
|
children: typeof props.children === 'function' ? true : props.children,
|
|
12928
13214
|
validationBehavior: validationBehavior
|
|
12929
13215
|
}, ($3017fa7ffdddec74$export$8042c6c013fd5226)(props), inputRef);
|
|
@@ -12934,7 +13220,6 @@ function $bc237834342dbd75$var$Checkbox(props, ref) {
|
|
|
12934
13220
|
isDisabled: isInteractionDisabled
|
|
12935
13221
|
});
|
|
12936
13222
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
12937
|
-
// TODO: should data attrs go on the label or on the <input>? useCheckbox passes them to the input...
|
|
12938
13223
|
...props,
|
|
12939
13224
|
defaultClassName: 'react-aria-Checkbox',
|
|
12940
13225
|
values: {
|
|
@@ -13432,7 +13717,7 @@ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropH
|
|
|
13432
13717
|
return new Set([
|
|
13433
13718
|
focusedKey,
|
|
13434
13719
|
dropTargetKey
|
|
13435
|
-
].filter((k)=>k
|
|
13720
|
+
].filter((k)=>k != null));
|
|
13436
13721
|
}, [
|
|
13437
13722
|
focusedKey,
|
|
13438
13723
|
dropTargetKey
|
|
@@ -13530,7 +13815,11 @@ function $eed445e0843c11d0$var$StandaloneListBox({ props: props, listBoxRef: lis
|
|
|
13530
13815
|
children: null,
|
|
13531
13816
|
items: null
|
|
13532
13817
|
};
|
|
13533
|
-
let
|
|
13818
|
+
let { layoutDelegate: layoutDelegate } = ($dbSRa$react.useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
13819
|
+
let state = ($e72dd72e1c76a225$export$2f645645f7bca764)({
|
|
13820
|
+
...props,
|
|
13821
|
+
layoutDelegate: layoutDelegate
|
|
13822
|
+
});
|
|
13534
13823
|
return /*#__PURE__*/ ($dbSRa$react).createElement($eed445e0843c11d0$var$ListBoxInner, {
|
|
13535
13824
|
state: state,
|
|
13536
13825
|
props: props,
|
|
@@ -13694,6 +13983,7 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: state, props: props, listBo
|
|
|
13694
13983
|
[
|
|
13695
13984
|
($7135fc7d473fd974$export$d40e14dec8b060a8),
|
|
13696
13985
|
{
|
|
13986
|
+
name: 'ListBoxSection',
|
|
13697
13987
|
render: $eed445e0843c11d0$var$ListBoxSection
|
|
13698
13988
|
}
|
|
13699
13989
|
]
|
|
@@ -13705,7 +13995,7 @@ function $eed445e0843c11d0$var$ListBoxInner({ state: state, props: props, listBo
|
|
|
13705
13995
|
renderDropIndicator: ($612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
13706
13996
|
})), emptyState, dragPreview));
|
|
13707
13997
|
}
|
|
13708
|
-
function $eed445e0843c11d0$var$ListBoxSection(props, ref, section) {
|
|
13998
|
+
function $eed445e0843c11d0$var$ListBoxSection(props, ref, section, className = 'react-aria-ListBoxSection') {
|
|
13709
13999
|
let state = ($dbSRa$react.useContext)($eed445e0843c11d0$export$7c5906fe4f1f2af2);
|
|
13710
14000
|
let { dragAndDropHooks: dragAndDropHooks, dropState: dropState } = ($dbSRa$react.useContext)(($612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
13711
14001
|
let { CollectionBranch: CollectionBranch } = ($dbSRa$react.useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
@@ -13716,7 +14006,7 @@ function $eed445e0843c11d0$var$ListBoxSection(props, ref, section) {
|
|
|
13716
14006
|
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !== void 0 ? _props_arialabel : undefined
|
|
13717
14007
|
});
|
|
13718
14008
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
13719
|
-
defaultClassName:
|
|
14009
|
+
defaultClassName: className,
|
|
13720
14010
|
className: props.className,
|
|
13721
14011
|
style: props.style,
|
|
13722
14012
|
values: {}
|
|
@@ -13865,9 +14155,9 @@ function $44f671af83e7d9e0$var$OverlayArrow(props, ref) {
|
|
|
13865
14155
|
let placement = props.placement;
|
|
13866
14156
|
let style = {
|
|
13867
14157
|
position: 'absolute',
|
|
13868
|
-
[placement]: '100%',
|
|
13869
14158
|
transform: placement === 'top' || placement === 'bottom' ? 'translateX(-50%)' : 'translateY(-50%)'
|
|
13870
14159
|
};
|
|
14160
|
+
if (placement != null) style[placement] = '100%';
|
|
13871
14161
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
13872
14162
|
...props,
|
|
13873
14163
|
defaultClassName: 'react-aria-OverlayArrow',
|
|
@@ -13978,6 +14268,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
13978
14268
|
...renderProps.style
|
|
13979
14269
|
};
|
|
13980
14270
|
return /*#__PURE__*/ ($dbSRa$react).createElement(($337b884510726a0d$export$c6fdb837b070b4ff), {
|
|
14271
|
+
...props,
|
|
13981
14272
|
isExiting: isExiting,
|
|
13982
14273
|
portalContainer: UNSTABLE_portalContainer
|
|
13983
14274
|
}, !props.isNonModal && state.isOpen && /*#__PURE__*/ ($dbSRa$react).createElement("div", {
|
|
@@ -14010,6 +14301,8 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
14010
14301
|
})));
|
|
14011
14302
|
}
|
|
14012
14303
|
|
|
14304
|
+
const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
14305
|
+
|
|
14013
14306
|
/*
|
|
14014
14307
|
* Copyright 2022 Adobe. All rights reserved.
|
|
14015
14308
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14028,10 +14321,14 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
14028
14321
|
|
|
14029
14322
|
|
|
14030
14323
|
|
|
14324
|
+
|
|
14325
|
+
|
|
14031
14326
|
const $de32f1b87079253c$export$8b93a07348a7730c = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
14032
14327
|
const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ ($dbSRa$react.createContext)(null);
|
|
14033
14328
|
function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
14034
|
-
|
|
14329
|
+
// Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.
|
|
14330
|
+
// This is needed to handle submenus.
|
|
14331
|
+
let state = ($a28c903ee9ad8dc5$export$79fefeb1c2091ac3)(props);
|
|
14035
14332
|
let buttonRef = ($dbSRa$react.useRef)(null);
|
|
14036
14333
|
let { triggerProps: triggerProps, overlayProps: overlayProps } = ($628037886ba31236$export$f9d5c8beee7d008d)({
|
|
14037
14334
|
type: 'dialog'
|
|
@@ -14048,6 +14345,10 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
14048
14345
|
$de32f1b87079253c$export$d2f961adcb0afbe,
|
|
14049
14346
|
state
|
|
14050
14347
|
],
|
|
14348
|
+
[
|
|
14349
|
+
($3674c52c6b3c5bce$export$795aec4671cbae19),
|
|
14350
|
+
state
|
|
14351
|
+
],
|
|
14051
14352
|
[
|
|
14052
14353
|
$de32f1b87079253c$export$8b93a07348a7730c,
|
|
14053
14354
|
overlayProps
|
|
@@ -14076,24 +14377,27 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
|
|
|
14076
14377
|
'aria-labelledby': originalAriaLabelledby
|
|
14077
14378
|
}, ref);
|
|
14078
14379
|
let state = ($dbSRa$react.useContext)($de32f1b87079253c$export$d2f961adcb0afbe);
|
|
14079
|
-
let children = props.children;
|
|
14080
|
-
if (typeof children === 'function') children = children({
|
|
14081
|
-
close: (state === null || state === void 0 ? void 0 : state.close) || (()=>{})
|
|
14082
|
-
});
|
|
14083
14380
|
if (!dialogProps['aria-label'] && !dialogProps['aria-labelledby']) {
|
|
14084
14381
|
// If aria-labelledby exists on props, we know it came from context.
|
|
14085
14382
|
// Use that as a fallback in case there is no title slot.
|
|
14086
14383
|
if (props['aria-labelledby']) dialogProps['aria-labelledby'] = props['aria-labelledby'];
|
|
14087
14384
|
else console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.');
|
|
14088
14385
|
}
|
|
14089
|
-
|
|
14386
|
+
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
14387
|
+
defaultClassName: 'react-aria-Dialog',
|
|
14388
|
+
className: props.className,
|
|
14389
|
+
style: props.style,
|
|
14390
|
+
children: props.children,
|
|
14391
|
+
values: {
|
|
14392
|
+
close: (state === null || state === void 0 ? void 0 : state.close) || (()=>{})
|
|
14393
|
+
}
|
|
14394
|
+
});
|
|
14090
14395
|
return /*#__PURE__*/ ($dbSRa$react).createElement("section", {
|
|
14091
14396
|
...($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props),
|
|
14092
14397
|
...dialogProps,
|
|
14398
|
+
...renderProps,
|
|
14093
14399
|
ref: ref,
|
|
14094
|
-
slot: props.slot || undefined
|
|
14095
|
-
style: props.style,
|
|
14096
|
-
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Dialog'
|
|
14400
|
+
slot: props.slot || undefined
|
|
14097
14401
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
14098
14402
|
values: [
|
|
14099
14403
|
[
|
|
@@ -14107,9 +14411,20 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
|
|
|
14107
14411
|
}
|
|
14108
14412
|
}
|
|
14109
14413
|
}
|
|
14414
|
+
],
|
|
14415
|
+
[
|
|
14416
|
+
($d2b4bc8c273e7be6$export$24d547caef80ccd1),
|
|
14417
|
+
{
|
|
14418
|
+
slots: {
|
|
14419
|
+
[($64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
14420
|
+
close: {
|
|
14421
|
+
onPress: ()=>state === null || state === void 0 ? void 0 : state.close()
|
|
14422
|
+
}
|
|
14423
|
+
}
|
|
14424
|
+
}
|
|
14110
14425
|
]
|
|
14111
14426
|
]
|
|
14112
|
-
}, children));
|
|
14427
|
+
}, renderProps.children));
|
|
14113
14428
|
}
|
|
14114
14429
|
/**
|
|
14115
14430
|
* A dialog is an overlay shown above other content in an application.
|
|
@@ -14631,10 +14946,10 @@ function $82d7e5349645de74$var$SelectValue(props, ref) {
|
|
|
14631
14946
|
});
|
|
14632
14947
|
}
|
|
14633
14948
|
let stringFormatter = ($fca6afa0e843324b$export$f12b703ca79dfbb1)((($parcel$interopDefault($df39c1238ae2b5f3$exports))), 'react-aria-components');
|
|
14634
|
-
var _state_selectedItem_value, _state_selectedItem_textValue;
|
|
14949
|
+
var _ref, _state_selectedItem_value, _state_selectedItem_textValue;
|
|
14635
14950
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
14636
14951
|
...props,
|
|
14637
|
-
defaultChildren: rendered
|
|
14952
|
+
defaultChildren: (_ref = rendered !== null && rendered !== void 0 ? rendered : placeholder) !== null && _ref !== void 0 ? _ref : stringFormatter.format('selectPlaceholder'),
|
|
14638
14953
|
defaultClassName: 'react-aria-SelectValue',
|
|
14639
14954
|
values: {
|
|
14640
14955
|
selectedItem: (_state_selectedItem_value = (_state_selectedItem = state.selectedItem) === null || _state_selectedItem === void 0 ? void 0 : _state_selectedItem.value) !== null && _state_selectedItem_value !== void 0 ? _state_selectedItem_value : null,
|
|
@@ -15158,7 +15473,8 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
15158
15473
|
isOpen: state.isOpen,
|
|
15159
15474
|
arrowSize: arrowWidth,
|
|
15160
15475
|
arrowBoundaryOffset: props.arrowBoundaryOffset,
|
|
15161
|
-
shouldFlip: props.shouldFlip
|
|
15476
|
+
shouldFlip: props.shouldFlip,
|
|
15477
|
+
onClose: ()=>state.close(true)
|
|
15162
15478
|
});
|
|
15163
15479
|
let isEntering = ($64fa3d84918910a7$export$6d3443f2c48bfc20)(props.tooltipRef, !!placement) || props.isEntering || false;
|
|
15164
15480
|
let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
@@ -15181,7 +15497,7 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
15181
15497
|
...overlayProps.style,
|
|
15182
15498
|
...renderProps.style
|
|
15183
15499
|
},
|
|
15184
|
-
"data-placement": placement,
|
|
15500
|
+
"data-placement": placement !== null && placement !== void 0 ? placement : undefined,
|
|
15185
15501
|
"data-entering": isEntering || undefined,
|
|
15186
15502
|
"data-exiting": props.isExiting || undefined
|
|
15187
15503
|
}, /*#__PURE__*/ ($dbSRa$react).createElement(($44f671af83e7d9e0$export$2de4954e8ae13b9f).Provider, {
|
|
@@ -15277,7 +15593,7 @@ function AlertDialog({ children, variant = "info", role = "dialog", title, isClo
|
|
|
15277
15593
|
return (jsxRuntime.jsx($de32f1b87079253c$export$3ddf2d174ce01153, { className: `bcds-react-aria-AlertDialog ${variant}`, role: role, ...props, children: ({ close }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "bcds-react-aria-AlertDialog--Header", children: [!isIconHidden && (jsxRuntime.jsx("div", { className: "bcds-react-aria-AlertDialog--Icon", children: getIcon$1(variant) })), title && (jsxRuntime.jsx("div", { className: "bcds-react-aria-AlertDialog--Title", slot: "title", children: title })), isCloseable && (jsxRuntime.jsx("div", { className: "bcds-react-aria-AlertDialog--closeIcon", children: jsxRuntime.jsx(Button, { variant: "tertiary", isIconButton: true, size: "small", "aria-label": "Close", type: "button", onPress: close, children: jsxRuntime.jsx(SvgCloseIcon, {}) }) }))] }), children && (jsxRuntime.jsx("div", { className: "bcds-react-aria-AlertDialog--children", slot: "children", children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: children }) })), buttons && (jsxRuntime.jsx(ButtonGroup, { alignment: "end", orientation: "horizontal", children: buttons }))] })) }));
|
|
15278
15594
|
}
|
|
15279
15595
|
|
|
15280
|
-
var css_248z$h = ".bcds-Callout {\n display: flex;\n width: 100%;\n padding: var(--layout-padding-medium) var(--layout-padding-large);\n}\n\n.bcds-Callout--Container {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n gap: var(--layout-margin-small);\n}\n\n.bcds-Callout--Container > .bcds-Callout--Title {\n font: var(--typography-bold-large-body);\n color: var(--typography-color-primary);\n}\n\n.bcds-Callout--Container > .bcds-Callout--Description {\n font: var(--typography-regular-body);\n color: var(--typography-color-secondary);\n}\n\n/* Theme - light grey (default) */\n.bcds-Callout.lightGrey {\n background-color: var(--surface-color-background-light-gray);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-blue);\n
|
|
15596
|
+
var css_248z$h = ".bcds-Callout {\n display: flex;\n width: 100%;\n box-sizing: border-box;\n padding: var(--layout-padding-medium) var(--layout-padding-large);\n border-radius: var(--layout-border-radius-medium)\n var(--layout-border-radius-none) var(--layout-border-radius-none)\n var(--layout-border-radius-medium);\n}\n\n.bcds-Callout--Container {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n gap: var(--layout-margin-small);\n}\n\n.bcds-Callout--Container > .bcds-Callout--Title {\n font: var(--typography-bold-large-body);\n color: var(--typography-color-primary);\n}\n\n.bcds-Callout--Container > .bcds-Callout--Description {\n font: var(--typography-regular-body);\n color: var(--typography-color-secondary);\n}\n\n/* Theme - light grey (default) */\n.bcds-Callout.lightGrey {\n background-color: var(--surface-color-background-light-gray);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-blue);\n}\n\n/* Theme - light blue */\n.bcds-Callout.lightBlue {\n background-color: var(--theme-blue-10);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-blue);\n}\n\n/* Theme - light gold */\n.bcds-Callout.lightGold {\n background-color: var(--theme-gold-10);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-blue);\n}\n\n/* Theme - blue */\n.bcds-Callout.Blue {\n background-color: var(--surface-color-background-dark-blue);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-gold);\n}\n\n.bcds-Callout.Blue .bcds-Callout--Title {\n color: var(--typography-color-primary-invert);\n}\n\n.bcds-Callout.Blue .bcds-Callout--Description {\n color: var(--typography-color-secondary-invert);\n}\n\n/* Theme - grey */\n.bcds-Callout.Grey {\n background-color: var(--theme-gray-80);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-gold);\n}\n\n.bcds-Callout.Grey .bcds-Callout--Title {\n color: var(--typography-color-primary-invert);\n}\n\n.bcds-Callout.Grey .bcds-Callout--Description {\n color: var(--typography-color-secondary-invert);\n}\n\n/* Theme - black */\n.bcds-Callout.Black {\n background-color: var(--theme-gray-100);\n border-left: var(--layout-border-width-large) solid var(--theme-primary-gold);\n}\n\n.bcds-Callout.Black .bcds-Callout--Title {\n color: var(--typography-color-primary-invert);\n}\n\n.bcds-Callout.Black .bcds-Callout--Description {\n color: var(--typography-color-secondary-invert);\n}\n\n/* Border disabled */\n.bcds-Callout.lightGrey.noBorder,\n.bcds-Callout.lightGold.noBorder,\n.bcds-Callout.lightBlue.noBorder,\n.bcds-Callout.Blue.noBorder,\n.bcds-Callout.Grey.noBorder,\n.bcds-Callout.Black.noBorder {\n border-left: none;\n border-radius: var(--layout-border-radius-none);\n}\n";
|
|
15281
15597
|
styleInject(css_248z$h);
|
|
15282
15598
|
|
|
15283
15599
|
function Callout({ variant = "lightGrey", title, description, buttons, role = "note", isLeftBorderDisabled = false, children, ...props }) {
|