Files
NapCatQQ/.pnpm-store/v3/files/b5/3e0f0bee2d76e0d499185364c32727fc2fcfe2423404cc4d2f38c2cac4b4607b7697a1688aa05e9c99e2262d71b6e985a8dcccc4f66649922d324f5560ceda
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

68 lines
2.9 KiB
Plaintext

var $08ef1685902b6011$exports = require("./ariaHideOutside.main.js");
var $cd94b4896dd97759$exports = require("./useOverlayPosition.main.js");
var $82711f9cb668ecdb$exports = require("./useOverlay.main.js");
var $5c2f5cd01815d369$exports = require("./usePreventScroll.main.js");
var $jkVOI$reactariautils = require("@react-aria/utils");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "usePopover", () => $6c2dfcdee3e15e20$export$542a6fd13ac93354);
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6c2dfcdee3e15e20$export$542a6fd13ac93354(props, state) {
let { triggerRef: triggerRef, popoverRef: popoverRef, isNonModal: isNonModal, isKeyboardDismissDisabled: isKeyboardDismissDisabled, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside, ...otherProps } = props;
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $82711f9cb668ecdb$exports.useOverlay)({
// If popover is in the top layer, it should not prevent other popovers from being dismissed.
isOpen: state.isOpen && !otherProps['data-react-aria-top-layer'],
onClose: state.close,
shouldCloseOnBlur: true,
isDismissable: !isNonModal,
isKeyboardDismissDisabled: isKeyboardDismissDisabled,
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside
}, popoverRef);
let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement } = (0, $cd94b4896dd97759$exports.useOverlayPosition)({
...otherProps,
targetRef: triggerRef,
overlayRef: popoverRef,
isOpen: state.isOpen,
onClose: isNonModal ? state.close : undefined
});
(0, $5c2f5cd01815d369$exports.usePreventScroll)({
isDisabled: isNonModal || !state.isOpen
});
(0, $jkVOI$reactariautils.useLayoutEffect)(()=>{
if (state.isOpen && !isNonModal && popoverRef.current) return (0, $08ef1685902b6011$exports.ariaHideOutside)([
popoverRef.current
]);
}, [
isNonModal,
state.isOpen,
popoverRef
]);
return {
popoverProps: (0, $jkVOI$reactariautils.mergeProps)(overlayProps, positionProps),
arrowProps: arrowProps,
underlayProps: underlayProps,
placement: placement
};
}
//# sourceMappingURL=usePopover.main.js.map