@ifhover/leaf-ui 0.17.2 → 0.17.3
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/browser/modules/popover/popover.cjs +32 -41
- package/dist/cjs/browser/modules/popover/popover.cjs.map +1 -1
- package/dist/cjs/browser/modules/shared/floating.cjs +121 -0
- package/dist/cjs/browser/modules/shared/floating.cjs.map +1 -1
- package/dist/cjs/browser/modules/tooltip/tooltip.cjs +29 -40
- package/dist/cjs/browser/modules/tooltip/tooltip.cjs.map +1 -1
- package/dist/cjs/popover/popover.cjs +32 -41
- package/dist/cjs/popover/popover.cjs.map +1 -1
- package/dist/cjs/popover/popover.d.cts.map +1 -1
- package/dist/cjs/shared/floating.cjs +121 -0
- package/dist/cjs/shared/floating.cjs.map +1 -1
- package/dist/cjs/shared/floating.d.cts +22 -1
- package/dist/cjs/shared/floating.d.cts.map +1 -1
- package/dist/cjs/styles/colorpicker.css +1 -1
- package/dist/cjs/styles/components/popover.css +1 -1
- package/dist/cjs/styles/components/tooltip.css +1 -1
- package/dist/cjs/styles/floatbutton.css +1 -1
- package/dist/cjs/styles/index.css +24 -16
- package/dist/cjs/styles/index.css.map +1 -1
- package/dist/cjs/styles/popconfirm.css +1 -1
- package/dist/cjs/styles/popover.css +1 -1
- package/dist/cjs/styles/slider.css +1 -1
- package/dist/cjs/styles/tooltip.css +1 -1
- package/dist/cjs/tooltip/tooltip.cjs +29 -40
- package/dist/cjs/tooltip/tooltip.cjs.map +1 -1
- package/dist/cjs/tooltip/tooltip.d.cts.map +1 -1
- package/dist/esm/browser/modules/popover/popover.js +33 -42
- package/dist/esm/browser/modules/popover/popover.js.map +1 -1
- package/dist/esm/browser/modules/shared/floating.js +119 -1
- package/dist/esm/browser/modules/shared/floating.js.map +1 -1
- package/dist/esm/browser/modules/tooltip/tooltip.js +30 -41
- package/dist/esm/browser/modules/tooltip/tooltip.js.map +1 -1
- package/dist/esm/popover/popover.d.ts.map +1 -1
- package/dist/esm/popover/popover.js +33 -42
- package/dist/esm/popover/popover.js.map +1 -1
- package/dist/esm/shared/floating.d.ts +22 -1
- package/dist/esm/shared/floating.d.ts.map +1 -1
- package/dist/esm/shared/floating.js +119 -1
- package/dist/esm/shared/floating.js.map +1 -1
- package/dist/esm/styles/colorpicker.css +1 -1
- package/dist/esm/styles/components/popover.css +1 -1
- package/dist/esm/styles/components/tooltip.css +1 -1
- package/dist/esm/styles/floatbutton.css +1 -1
- package/dist/esm/styles/index.css +24 -16
- package/dist/esm/styles/index.css.map +1 -1
- package/dist/esm/styles/popconfirm.css +1 -1
- package/dist/esm/styles/popover.css +1 -1
- package/dist/esm/styles/slider.css +1 -1
- package/dist/esm/styles/tooltip.css +1 -1
- package/dist/esm/tooltip/tooltip.d.ts.map +1 -1
- package/dist/esm/tooltip/tooltip.js +30 -41
- package/dist/esm/tooltip/tooltip.js.map +1 -1
- package/package.json +2 -2
|
@@ -44,8 +44,10 @@ const presence_cjs_namespaceObject = require("../shared/presence.cjs");
|
|
|
44
44
|
require('../../../styles/components/popover.css');
|
|
45
45
|
function PopoverControl({ children, title, content, trigger: mode = 'click', placement = 'top', open: controlled, defaultOpen = false, onOpenChange, disabled = false, autoFocus = true, enterDelay = 100, leaveDelay = 100, width = 'max-content', maxWidth = 320, className, popupPlacement, popupClassName, popupStyle, popupRender, getPopupContainer, style, 'aria-label': label }) {
|
|
46
46
|
const [internal, setInternal] = (0, external_react_namespaceObject.useState)(defaultOpen);
|
|
47
|
-
const inactive = disabled || children.props.disabled;
|
|
47
|
+
const inactive = Boolean(disabled || children.props.disabled);
|
|
48
48
|
const open = !inactive && (controlled ?? internal);
|
|
49
|
+
const openRef = (0, external_react_namespaceObject.useRef)(open);
|
|
50
|
+
openRef.current = open;
|
|
49
51
|
const trigger = (0, external_react_namespaceObject.useRef)(null);
|
|
50
52
|
const panel = (0, external_react_namespaceObject.useRef)(null);
|
|
51
53
|
const body = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -53,28 +55,28 @@ function PopoverControl({ children, title, content, trigger: mode = 'click', pla
|
|
|
53
55
|
const childRef = external_react_namespaceObject.version.startsWith('18.') ? children.ref : children.props.ref;
|
|
54
56
|
const ref = (0, field_cjs_namespaceObject.useMergedRef)(trigger, childRef);
|
|
55
57
|
const id = `${(0, external_react_namespaceObject.useId)()}-popover`;
|
|
56
|
-
const timer = (0, external_react_namespaceObject.useRef)(void 0);
|
|
57
|
-
const focused = (0, external_react_namespaceObject.useRef)(false);
|
|
58
|
-
const hovered = (0, external_react_namespaceObject.useRef)(false);
|
|
59
58
|
const change = (next)=>{
|
|
60
|
-
if (
|
|
61
|
-
if (next
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const schedule = (next, delay)=>{
|
|
68
|
-
clearTimeout(timer.current);
|
|
69
|
-
timer.current = setTimeout(()=>change(next), Math.max(0, delay));
|
|
59
|
+
if (inactive && next) return;
|
|
60
|
+
if (next === openRef.current) return;
|
|
61
|
+
if (void 0 === controlled) {
|
|
62
|
+
openRef.current = next;
|
|
63
|
+
setInternal(next);
|
|
64
|
+
}
|
|
65
|
+
onOpenChange?.(next);
|
|
70
66
|
};
|
|
71
|
-
(0, floating_cjs_namespaceObject.
|
|
72
|
-
|
|
67
|
+
const hoverFocus = (0, floating_cjs_namespaceObject.useHoverFocus)({
|
|
68
|
+
enabled: 'hover' === mode,
|
|
69
|
+
inactive,
|
|
70
|
+
open,
|
|
71
|
+
change,
|
|
72
|
+
enterDelay,
|
|
73
|
+
leaveDelay,
|
|
74
|
+
triggerRef: trigger,
|
|
75
|
+
panelRef: panel,
|
|
76
|
+
keepPanelFocus: true
|
|
77
|
+
});
|
|
73
78
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
74
|
-
if (inactive)
|
|
75
|
-
clearTimeout(timer.current);
|
|
76
|
-
setInternal(false);
|
|
77
|
-
}
|
|
79
|
+
if (inactive) setInternal(false);
|
|
78
80
|
}, [
|
|
79
81
|
inactive
|
|
80
82
|
]);
|
|
@@ -114,28 +116,23 @@ function PopoverControl({ children, title, content, trigger: mode = 'click', pla
|
|
|
114
116
|
},
|
|
115
117
|
onPointerEnter: (event)=>{
|
|
116
118
|
children.props.onPointerEnter?.(event);
|
|
117
|
-
|
|
118
|
-
hovered.current = true;
|
|
119
|
-
schedule(true, enterDelay);
|
|
120
|
-
}
|
|
119
|
+
hoverFocus.onTriggerPointerEnter(event);
|
|
121
120
|
},
|
|
122
121
|
onPointerLeave: (event)=>{
|
|
123
122
|
children.props.onPointerLeave?.(event);
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
hoverFocus.onTriggerPointerLeave();
|
|
124
|
+
},
|
|
125
|
+
onPointerDown: (event)=>{
|
|
126
|
+
children.props.onPointerDown?.(event);
|
|
127
|
+
hoverFocus.onTriggerPointerDown(event);
|
|
126
128
|
},
|
|
127
129
|
onFocus: (event)=>{
|
|
128
130
|
children.props.onFocus?.(event);
|
|
129
|
-
|
|
130
|
-
focused.current = true;
|
|
131
|
-
clearTimeout(timer.current);
|
|
132
|
-
change(true);
|
|
133
|
-
}
|
|
131
|
+
hoverFocus.onTriggerFocus(event);
|
|
134
132
|
},
|
|
135
133
|
onBlur: (event)=>{
|
|
136
134
|
children.props.onBlur?.(event);
|
|
137
|
-
|
|
138
|
-
if ('hover' === mode && !hovered.current && !panel.current?.contains(event.relatedTarget)) schedule(false, leaveDelay);
|
|
135
|
+
hoverFocus.onTriggerBlur(event);
|
|
139
136
|
}
|
|
140
137
|
}),
|
|
141
138
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(floating_cjs_namespaceObject.FloatingPanel, {
|
|
@@ -158,14 +155,8 @@ function PopoverControl({ children, title, content, trigger: mode = 'click', pla
|
|
|
158
155
|
},
|
|
159
156
|
"aria-label": label ?? ('string' == typeof title ? title : void 0),
|
|
160
157
|
"aria-labelledby": null != title ? `${id}-title` : void 0,
|
|
161
|
-
onPointerEnter:
|
|
162
|
-
|
|
163
|
-
clearTimeout(timer.current);
|
|
164
|
-
},
|
|
165
|
-
onPointerLeave: ()=>{
|
|
166
|
-
hovered.current = false;
|
|
167
|
-
if ('hover' === mode && !focused.current && !panel.current?.contains(document.activeElement)) schedule(false, leaveDelay);
|
|
168
|
-
},
|
|
158
|
+
onPointerEnter: hoverFocus.onPanelPointerEnter,
|
|
159
|
+
onPointerLeave: hoverFocus.onPanelPointerLeave,
|
|
169
160
|
children: [
|
|
170
161
|
null != title && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
171
162
|
id: `${id}-title`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover/popover.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../../../../../src/popover/popover.tsx"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n type CSSProperties,\n cloneElement,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n useEffect,\n useId,\n useRef,\n useState,\n version,\n} from 'react';\nimport { tabbable } from 'tabbable';\nimport { useComponentProps } from '../config-provider/component-defaults';\nimport { classes } from '../shared/classes';\nimport { useMergedRef } from '../shared/field';\nimport { FloatingPanel, type PopupOptions, useFloatingDismiss } from '../shared/floating';\nimport { useNaturalHeightTransition } from '../shared/presence';\n\nexport interface PopoverProps extends PopupOptions {\n children: ReactElement<\n HTMLAttributes<HTMLElement> & { ref?: Ref<HTMLElement>; disabled?: boolean }\n >;\n title?: ReactNode;\n content: ReactNode;\n trigger?: 'click' | 'hover';\n placement?:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n autoFocus?: boolean;\n enterDelay?: number;\n leaveDelay?: number;\n width?: number | string;\n maxWidth?: number | string;\n className?: string;\n style?: CSSProperties;\n 'aria-label'?: string;\n}\nexport function PopoverControl({\n children,\n title,\n content,\n trigger: mode = 'click',\n placement = 'top',\n open: controlled,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n autoFocus = true,\n enterDelay = 100,\n leaveDelay = 100,\n width = 'max-content',\n maxWidth = 320,\n className,\n popupPlacement,\n popupClassName,\n popupStyle,\n popupRender,\n getPopupContainer,\n style,\n 'aria-label': label,\n}: PopoverProps) {\n const [internal, setInternal] = useState(defaultOpen);\n const inactive = disabled || children.props.disabled;\n const open = !inactive && (controlled ?? internal);\n const trigger = useRef<HTMLElement>(null);\n const panel = useRef<HTMLDivElement>(null);\n const body = useRef<HTMLDivElement>(null);\n useNaturalHeightTransition(panel, body, open);\n const childRef = version.startsWith('18.')\n ? (children as typeof children & { ref?: Ref<HTMLElement> }).ref\n : children.props.ref;\n const ref = useMergedRef(trigger, childRef);\n const id = `${useId()}-popover`;\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const focused = useRef(false);\n const hovered = useRef(false);\n const change = (next: boolean) => {\n if (controlled === undefined) setInternal(next);\n if (next !== open) onOpenChange?.(next);\n };\n const dismiss = () => {\n clearTimeout(timer.current);\n change(false);\n };\n const schedule = (next: boolean, delay: number) => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => change(next), Math.max(0, delay));\n };\n useFloatingDismiss(open, dismiss, trigger, panel);\n useEffect(() => () => clearTimeout(timer.current), []);\n useEffect(() => {\n if (inactive) {\n clearTimeout(timer.current);\n setInternal(false);\n }\n }, [inactive]);\n useEffect(() => {\n const node = panel.current;\n if (!open || mode !== 'click' || !node || !autoFocus) return;\n (tabbable(node)[0] ?? node).focus();\n return () => {\n if (node.contains(document.activeElement)) trigger.current?.focus();\n };\n }, [open, mode, autoFocus]);\n return (\n <>\n {cloneElement(children, {\n ref,\n 'aria-haspopup': mode === 'click' ? 'dialog' : children.props['aria-haspopup'],\n 'aria-expanded': mode === 'click' ? open : children.props['aria-expanded'],\n 'aria-controls': open ? id : children.props['aria-controls'],\n 'aria-describedby':\n mode === 'hover' && open\n ? [children.props['aria-describedby'], id].filter(Boolean).join(' ')\n : children.props['aria-describedby'],\n onClick: (event) => {\n children.props.onClick?.(event);\n if (mode === 'click' && !inactive && !event.defaultPrevented) change(!open);\n },\n onKeyDown: (event) => {\n children.props.onKeyDown?.(event);\n if (\n mode === 'click' &&\n !inactive &&\n !event.defaultPrevented &&\n event.key === 'ArrowDown'\n ) {\n event.preventDefault();\n change(true);\n }\n },\n onPointerEnter: (event) => {\n children.props.onPointerEnter?.(event);\n if (\n mode === 'hover' &&\n !inactive &&\n !event.defaultPrevented &&\n event.pointerType !== 'touch'\n ) {\n hovered.current = true;\n schedule(true, enterDelay);\n }\n },\n onPointerLeave: (event) => {\n children.props.onPointerLeave?.(event);\n hovered.current = false;\n if (mode === 'hover' && !focused.current) schedule(false, leaveDelay);\n },\n onFocus: (event) => {\n children.props.onFocus?.(event);\n if (mode === 'hover' && !inactive && !event.defaultPrevented) {\n focused.current = true;\n clearTimeout(timer.current);\n change(true);\n }\n },\n onBlur: (event) => {\n children.props.onBlur?.(event);\n focused.current = false;\n if (mode === 'hover' && !hovered.current && !panel.current?.contains(event.relatedTarget))\n schedule(false, leaveDelay);\n },\n })}\n <FloatingPanel\n open={open}\n render={popupRender}\n container={getPopupContainer}\n triggerRef={trigger}\n panelRef={panel}\n id={id}\n role={mode === 'click' ? 'dialog' : 'tooltip'}\n tabIndex={-1}\n data-arrow=\"true\"\n placement={popupPlacement ?? placement}\n width={width}\n maxWidth={maxWidth}\n className={classes('leaf-floating', 'leaf-popover', className, popupClassName)}\n style={{ ...style, ...popupStyle }}\n aria-label={label ?? (typeof title === 'string' ? title : undefined)}\n aria-labelledby={title != null ? `${id}-title` : undefined}\n onPointerEnter={() => {\n hovered.current = true;\n clearTimeout(timer.current);\n }}\n onPointerLeave={() => {\n hovered.current = false;\n if (\n mode === 'hover' &&\n !focused.current &&\n !panel.current?.contains(document.activeElement)\n )\n schedule(false, leaveDelay);\n }}\n >\n {title != null && (\n <div id={`${id}-title`} className=\"leaf-popover__title\">\n {title}\n </div>\n )}\n <div ref={body} className=\"leaf-popover__content\">\n {content}\n </div>\n </FloatingPanel>\n </>\n );\n}\n\nexport function Popover(rawProps: PopoverProps) {\n const props = useComponentProps('Popover', rawProps);\n return <PopoverControl {...props} />;\n}\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","PopoverControl","children","title","content","mode","placement","controlled","defaultOpen","onOpenChange","disabled","autoFocus","enterDelay","leaveDelay","width","maxWidth","className","popupPlacement","popupClassName","popupStyle","popupRender","getPopupContainer","style","label","internal","setInternal","useState","inactive","open","trigger","useRef","panel","body","useNaturalHeightTransition","childRef","version","ref","useMergedRef","id","useId","timer","undefined","focused","hovered","change","next","dismiss","clearTimeout","schedule","delay","setTimeout","Math","useFloatingDismiss","useEffect","node","tabbable","document","cloneElement","Boolean","event","FloatingPanel","classes","Popover","rawProps","props","useComponentProps"],"mappings":";;;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,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BAAC;gBACjC,cAAYI,SAAU,CAAiB,YAAjB,OAAOpB,QAAqBA,QAAQsC,MAAQ;gBAClE,mBAAiBtC,AAAS,QAATA,QAAgB,GAAGmC,GAAG,MAAM,CAAC,GAAGG;gBACjD,gBAAgB;oBACdE,QAAQ,OAAO,GAAG;oBAClBI,aAAaP,MAAM,OAAO;gBAC5B;gBACA,gBAAgB;oBACdG,QAAQ,OAAO,GAAG;oBAClB,IACEtC,AAAS,YAATA,QACA,CAACqC,QAAQ,OAAO,IAChB,CAACX,MAAM,OAAO,EAAE,SAASyB,SAAS,aAAa,GAE/CR,SAAS,OAAOnC;gBACpB;;oBAEU,QAATV,SACC,AADgB,WAAR,GACR,qCAAC;wBAAI,IAAI,GAAGmC,GAAG,MAAM,CAAC;wBAAE,WAAU;kCAC/BnC;;kCAGL,qCAAC;wBAAI,KAAK6B;wBAAM,WAAU;kCACvB5B;;;;;;AAKX;AAEO,SAAS0D,QAAQC,QAAsB;IAC5C,MAAMC,QAAQC,AAAAA,IAAAA,uCAAAA,iBAAAA,AAAAA,EAAkB,WAAWF;IAC3C,OAAO,WAAP,GAAO,qCAAC9D,gBAAAA;QAAgB,GAAG+D,KAAK;;AAClC"}
|
|
1
|
+
{"version":3,"file":"popover/popover.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../../../../../src/popover/popover.tsx"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n type CSSProperties,\n cloneElement,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n useEffect,\n useId,\n useRef,\n useState,\n version,\n} from 'react';\nimport { tabbable } from 'tabbable';\nimport { useComponentProps } from '../config-provider/component-defaults';\nimport { classes } from '../shared/classes';\nimport { useMergedRef } from '../shared/field';\nimport { FloatingPanel, type PopupOptions, useHoverFocus } from '../shared/floating';\nimport { useNaturalHeightTransition } from '../shared/presence';\n\nexport interface PopoverProps extends PopupOptions {\n children: ReactElement<\n HTMLAttributes<HTMLElement> & { ref?: Ref<HTMLElement>; disabled?: boolean }\n >;\n title?: ReactNode;\n content: ReactNode;\n trigger?: 'click' | 'hover';\n placement?:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n autoFocus?: boolean;\n enterDelay?: number;\n leaveDelay?: number;\n width?: number | string;\n maxWidth?: number | string;\n className?: string;\n style?: CSSProperties;\n 'aria-label'?: string;\n}\nexport function PopoverControl({\n children,\n title,\n content,\n trigger: mode = 'click',\n placement = 'top',\n open: controlled,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n autoFocus = true,\n enterDelay = 100,\n leaveDelay = 100,\n width = 'max-content',\n maxWidth = 320,\n className,\n popupPlacement,\n popupClassName,\n popupStyle,\n popupRender,\n getPopupContainer,\n style,\n 'aria-label': label,\n}: PopoverProps) {\n const [internal, setInternal] = useState(defaultOpen);\n const inactive = Boolean(disabled || children.props.disabled);\n const open = !inactive && (controlled ?? internal);\n const openRef = useRef(open);\n openRef.current = open;\n const trigger = useRef<HTMLElement>(null);\n const panel = useRef<HTMLDivElement>(null);\n const body = useRef<HTMLDivElement>(null);\n useNaturalHeightTransition(panel, body, open);\n const childRef = version.startsWith('18.')\n ? (children as typeof children & { ref?: Ref<HTMLElement> }).ref\n : children.props.ref;\n const ref = useMergedRef(trigger, childRef);\n const id = `${useId()}-popover`;\n const change = (next: boolean) => {\n if (inactive && next) return;\n if (next === openRef.current) return;\n if (controlled === undefined) {\n openRef.current = next;\n setInternal(next);\n }\n onOpenChange?.(next);\n };\n const hoverFocus = useHoverFocus({\n enabled: mode === 'hover',\n inactive,\n open,\n change,\n enterDelay,\n leaveDelay,\n triggerRef: trigger,\n panelRef: panel,\n keepPanelFocus: true,\n });\n useEffect(() => {\n if (inactive) setInternal(false);\n }, [inactive]);\n useEffect(() => {\n const node = panel.current;\n if (!open || mode !== 'click' || !node || !autoFocus) return;\n (tabbable(node)[0] ?? node).focus();\n return () => {\n if (node.contains(document.activeElement)) trigger.current?.focus();\n };\n }, [open, mode, autoFocus]);\n return (\n <>\n {cloneElement(children, {\n ref,\n 'aria-haspopup': mode === 'click' ? 'dialog' : children.props['aria-haspopup'],\n 'aria-expanded': mode === 'click' ? open : children.props['aria-expanded'],\n 'aria-controls': open ? id : children.props['aria-controls'],\n 'aria-describedby':\n mode === 'hover' && open\n ? [children.props['aria-describedby'], id].filter(Boolean).join(' ')\n : children.props['aria-describedby'],\n onClick: (event) => {\n children.props.onClick?.(event);\n if (mode === 'click' && !inactive && !event.defaultPrevented) change(!open);\n },\n onKeyDown: (event) => {\n children.props.onKeyDown?.(event);\n if (\n mode === 'click' &&\n !inactive &&\n !event.defaultPrevented &&\n event.key === 'ArrowDown'\n ) {\n event.preventDefault();\n change(true);\n }\n },\n onPointerEnter: (event) => {\n children.props.onPointerEnter?.(event);\n hoverFocus.onTriggerPointerEnter(event);\n },\n onPointerLeave: (event) => {\n children.props.onPointerLeave?.(event);\n hoverFocus.onTriggerPointerLeave();\n },\n onPointerDown: (event) => {\n children.props.onPointerDown?.(event);\n hoverFocus.onTriggerPointerDown(event);\n },\n onFocus: (event) => {\n children.props.onFocus?.(event);\n hoverFocus.onTriggerFocus(event);\n },\n onBlur: (event) => {\n children.props.onBlur?.(event);\n hoverFocus.onTriggerBlur(event);\n },\n })}\n <FloatingPanel\n open={open}\n render={popupRender}\n container={getPopupContainer}\n triggerRef={trigger}\n panelRef={panel}\n id={id}\n role={mode === 'click' ? 'dialog' : 'tooltip'}\n tabIndex={-1}\n data-arrow=\"true\"\n placement={popupPlacement ?? placement}\n width={width}\n maxWidth={maxWidth}\n className={classes('leaf-floating', 'leaf-popover', className, popupClassName)}\n style={{ ...style, ...popupStyle }}\n aria-label={label ?? (typeof title === 'string' ? title : undefined)}\n aria-labelledby={title != null ? `${id}-title` : undefined}\n onPointerEnter={hoverFocus.onPanelPointerEnter}\n onPointerLeave={hoverFocus.onPanelPointerLeave}\n >\n {title != null && (\n <div id={`${id}-title`} className=\"leaf-popover__title\">\n {title}\n </div>\n )}\n <div ref={body} className=\"leaf-popover__content\">\n {content}\n </div>\n </FloatingPanel>\n </>\n );\n}\n\nexport function Popover(rawProps: PopoverProps) {\n const props = useComponentProps('Popover', rawProps);\n return <PopoverControl {...props} />;\n}\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","PopoverControl","children","title","content","mode","placement","controlled","defaultOpen","onOpenChange","disabled","autoFocus","enterDelay","leaveDelay","width","maxWidth","className","popupPlacement","popupClassName","popupStyle","popupRender","getPopupContainer","style","label","internal","setInternal","useState","inactive","Boolean","open","openRef","useRef","trigger","panel","body","useNaturalHeightTransition","childRef","version","ref","useMergedRef","id","useId","change","next","undefined","hoverFocus","useHoverFocus","useEffect","node","tabbable","document","cloneElement","event","FloatingPanel","classes","Popover","rawProps","props","useComponentProps"],"mappings":";;;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ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atingPanel,
|
|
33
33
|
useActiveOption: ()=>useActiveOption,
|
|
34
34
|
useFloatingDismiss: ()=>useFloatingDismiss,
|
|
35
|
+
useHoverFocus: ()=>useHoverFocus,
|
|
35
36
|
usePopupState: ()=>usePopupState
|
|
36
37
|
});
|
|
37
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
@@ -348,14 +349,134 @@ function useActiveOption(open, optionId, panelRef) {
|
|
|
348
349
|
panelRef
|
|
349
350
|
]);
|
|
350
351
|
}
|
|
352
|
+
const MODIFIER_KEYS = new Set([
|
|
353
|
+
'Shift',
|
|
354
|
+
'Control',
|
|
355
|
+
'Alt',
|
|
356
|
+
'Meta'
|
|
357
|
+
]);
|
|
358
|
+
const pointerModalities = new WeakMap();
|
|
359
|
+
const modalityRefs = new WeakMap();
|
|
360
|
+
const modalityCleanups = new WeakMap();
|
|
361
|
+
function markPointerModality(doc) {
|
|
362
|
+
if (doc) pointerModalities.set(doc, true);
|
|
363
|
+
}
|
|
364
|
+
function isPointerModality(doc) {
|
|
365
|
+
return doc ? pointerModalities.get(doc) ?? false : false;
|
|
366
|
+
}
|
|
367
|
+
function subscribeModality(doc) {
|
|
368
|
+
const count = modalityRefs.get(doc) ?? 0;
|
|
369
|
+
if (0 === count) {
|
|
370
|
+
const onPointer = ()=>{
|
|
371
|
+
pointerModalities.set(doc, true);
|
|
372
|
+
};
|
|
373
|
+
const onKey = (event)=>{
|
|
374
|
+
if (!MODIFIER_KEYS.has(event.key)) pointerModalities.set(doc, false);
|
|
375
|
+
};
|
|
376
|
+
doc.addEventListener('pointerdown', onPointer, true);
|
|
377
|
+
doc.addEventListener('mousedown', onPointer, true);
|
|
378
|
+
doc.addEventListener('keydown', onKey, true);
|
|
379
|
+
modalityCleanups.set(doc, ()=>{
|
|
380
|
+
doc.removeEventListener('pointerdown', onPointer, true);
|
|
381
|
+
doc.removeEventListener('mousedown', onPointer, true);
|
|
382
|
+
doc.removeEventListener('keydown', onKey, true);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
modalityRefs.set(doc, count + 1);
|
|
386
|
+
return ()=>{
|
|
387
|
+
const next = (modalityRefs.get(doc) ?? 1) - 1;
|
|
388
|
+
if (next <= 0) {
|
|
389
|
+
modalityRefs.delete(doc);
|
|
390
|
+
modalityCleanups.get(doc)?.();
|
|
391
|
+
modalityCleanups.delete(doc);
|
|
392
|
+
pointerModalities.delete(doc);
|
|
393
|
+
} else modalityRefs.set(doc, next);
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function useHoverFocus({ enabled = true, inactive, open, change, enterDelay, leaveDelay, triggerRef, panelRef, keepPanelFocus = false }) {
|
|
397
|
+
const timer = (0, external_react_namespaceObject.useRef)(void 0);
|
|
398
|
+
const focused = (0, external_react_namespaceObject.useRef)(false);
|
|
399
|
+
const hovered = (0, external_react_namespaceObject.useRef)(false);
|
|
400
|
+
const changeRef = (0, external_react_namespaceObject.useRef)(change);
|
|
401
|
+
changeRef.current = change;
|
|
402
|
+
const schedule = (0, external_react_namespaceObject.useCallback)((next, delay)=>{
|
|
403
|
+
clearTimeout(timer.current);
|
|
404
|
+
timer.current = setTimeout(()=>changeRef.current(next), Math.max(0, delay));
|
|
405
|
+
}, []);
|
|
406
|
+
const dismiss = (0, external_react_namespaceObject.useCallback)((reason)=>{
|
|
407
|
+
clearTimeout(timer.current);
|
|
408
|
+
focused.current = false;
|
|
409
|
+
if ('outside' === reason) hovered.current = false;
|
|
410
|
+
changeRef.current(false);
|
|
411
|
+
}, []);
|
|
412
|
+
useFloatingDismiss(open, dismiss, triggerRef, panelRef);
|
|
413
|
+
(0, external_react_namespaceObject.useEffect)(()=>()=>clearTimeout(timer.current), []);
|
|
414
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
415
|
+
if (!enabled || inactive) {
|
|
416
|
+
clearTimeout(timer.current);
|
|
417
|
+
focused.current = false;
|
|
418
|
+
hovered.current = false;
|
|
419
|
+
}
|
|
420
|
+
}, [
|
|
421
|
+
enabled,
|
|
422
|
+
inactive
|
|
423
|
+
]);
|
|
424
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
425
|
+
if (!enabled || "u" < typeof document) return;
|
|
426
|
+
return subscribeModality(triggerRef.current?.ownerDocument ?? document);
|
|
427
|
+
}, [
|
|
428
|
+
enabled,
|
|
429
|
+
triggerRef
|
|
430
|
+
]);
|
|
431
|
+
const panelContains = (node)=>keepPanelFocus && node instanceof Node && Boolean(panelRef.current?.contains(node));
|
|
432
|
+
return {
|
|
433
|
+
onTriggerPointerEnter: (event)=>{
|
|
434
|
+
if (enabled && !inactive && !event.defaultPrevented && 'touch' !== event.pointerType) {
|
|
435
|
+
hovered.current = true;
|
|
436
|
+
schedule(true, enterDelay);
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
onTriggerPointerLeave: ()=>{
|
|
440
|
+
hovered.current = false;
|
|
441
|
+
if (enabled && !focused.current && !(keepPanelFocus && panelContains((0, external_dom_cjs_namespaceObject.deepActiveElement)()))) schedule(false, leaveDelay);
|
|
442
|
+
},
|
|
443
|
+
onTriggerPointerDown: (event)=>{
|
|
444
|
+
if (!enabled) return;
|
|
445
|
+
markPointerModality(event.currentTarget.ownerDocument);
|
|
446
|
+
focused.current = false;
|
|
447
|
+
},
|
|
448
|
+
onTriggerFocus: (event)=>{
|
|
449
|
+
if (enabled && !inactive && !event.defaultPrevented && !isPointerModality(event.currentTarget.ownerDocument)) {
|
|
450
|
+
focused.current = true;
|
|
451
|
+
clearTimeout(timer.current);
|
|
452
|
+
changeRef.current(true);
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
onTriggerBlur: (event)=>{
|
|
456
|
+
focused.current = false;
|
|
457
|
+
if (enabled && !hovered.current && !panelContains(event.relatedTarget)) schedule(false, leaveDelay);
|
|
458
|
+
},
|
|
459
|
+
onPanelPointerEnter: ()=>{
|
|
460
|
+
if (!enabled) return;
|
|
461
|
+
hovered.current = true;
|
|
462
|
+
clearTimeout(timer.current);
|
|
463
|
+
},
|
|
464
|
+
onPanelPointerLeave: ()=>{
|
|
465
|
+
hovered.current = false;
|
|
466
|
+
if (enabled && !focused.current && !panelContains((0, external_dom_cjs_namespaceObject.deepActiveElement)())) schedule(false, leaveDelay);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
}
|
|
351
470
|
exports.FloatingPanel = __webpack_exports__.FloatingPanel;
|
|
352
471
|
exports.useActiveOption = __webpack_exports__.useActiveOption;
|
|
353
472
|
exports.useFloatingDismiss = __webpack_exports__.useFloatingDismiss;
|
|
473
|
+
exports.useHoverFocus = __webpack_exports__.useHoverFocus;
|
|
354
474
|
exports.usePopupState = __webpack_exports__.usePopupState;
|
|
355
475
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
356
476
|
"FloatingPanel",
|
|
357
477
|
"useActiveOption",
|
|
358
478
|
"useFloatingDismiss",
|
|
479
|
+
"useHoverFocus",
|
|
359
480
|
"usePopupState"
|
|
360
481
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
361
482
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared/floating.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../../../../../src/shared/floating.tsx"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n autoUpdate,\n flip,\n offset,\n type Placement,\n shift,\n size,\n useFloating,\n} from '@floating-ui/react-dom';\nimport {\n type CSSProperties,\n createContext,\n type HTMLAttributes,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { tabbable } from 'tabbable';\nimport { useLeafConfig } from '../config-provider/context';\nimport { ScrollbarControl } from '../scrollbar/scrollbar';\nimport type { LeafThemeStyle } from '../theme';\nimport { composedEventTarget, composedParent, deepActiveElement } from './dom';\nimport { assignRef } from './field';\nimport { inertProps } from './inert';\nimport { OverlayOwner } from './overlay-owner';\nimport { usePresence } from './presence';\nimport { readThemeVariables } from './theme-variables';\n\nconst useBrowserLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\nconst PopupParent = createContext<string | undefined>(undefined);\nconst popupNodes = new Map<string, HTMLElement>();\nconst dismissStack: RefObject<HTMLElement | null>[] = [];\nfunction insidePopup(target: Node, panel: HTMLElement | null) {\n if (!panel) return false;\n const boundary = panel.closest<HTMLElement>('[data-leaf-popup]') ?? panel;\n if (boundary.contains(target)) return true;\n let popup = target instanceof Element ? target.closest<HTMLElement>('[data-leaf-popup]') : null;\n const visited = new Set<string>();\n while (popup?.dataset.leafPopupParent) {\n const parent = popup.dataset.leafPopupParent;\n if (visited.has(parent)) break;\n visited.add(parent);\n popup = popupNodes.get(parent) ?? null;\n if (popup === boundary) return true;\n }\n return false;\n}\n\n/** Close disabled fields immediately and report each open-state change once. */\nexport function usePopupState(\n disabled?: boolean,\n onOpenChange?: (open: boolean) => void,\n controlledOpen?: boolean,\n defaultOpen = false,\n) {\n const [internalOpen, setRequestedOpen] = useState(defaultOpen);\n const requestedOpen = controlledOpen ?? internalOpen;\n const requestedRef = useRef(requestedOpen);\n requestedRef.current = requestedOpen;\n const open = requestedOpen && !disabled;\n const setOpen = useCallback(\n (next: boolean) => {\n if (next === requestedRef.current || (next && disabled)) return;\n requestedRef.current = next;\n if (controlledOpen === undefined) setRequestedOpen(next);\n onOpenChange?.(next);\n },\n [disabled, onOpenChange, controlledOpen],\n );\n useEffect(() => {\n if (disabled && requestedOpen) setOpen(false);\n }, [disabled, requestedOpen, setOpen]);\n return [open, setOpen] as const;\n}\n\nexport interface PopupOptions {\n popupPlacement?: Placement;\n popupClassName?: string;\n popupStyle?: CSSProperties;\n popupRender?: (content: React.ReactNode) => React.ReactNode;\n getPopupContainer?: () => Element | DocumentFragment;\n}\ninterface FloatingPanelProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n triggerRef: RefObject<HTMLElement | null>;\n panelRef: RefObject<HTMLDivElement | null>;\n matchWidth?: boolean;\n width?: CSSProperties['width'];\n minWidth?: CSSProperties['minWidth'] | 'trigger';\n maxWidth?: CSSProperties['maxWidth'];\n maxHeight?: CSSProperties['maxHeight'];\n placement?: Placement;\n sideFallback?: boolean;\n resetSurfaceGeometry?: boolean;\n container?: Element | DocumentFragment | (() => Element | DocumentFragment);\n render?: (content: React.ReactNode) => React.ReactNode;\n position?: { x: number; y: number };\n}\n\n/** Position a lazily mounted portal, preserving the trigger's scoped theme. */\nexport function FloatingPanel({\n open,\n triggerRef,\n panelRef,\n matchWidth,\n width,\n minWidth,\n maxWidth,\n maxHeight,\n placement = 'bottom-start',\n sideFallback = false,\n resetSurfaceGeometry = false,\n container,\n render,\n position,\n style,\n children,\n ...props\n}: FloatingPanelProps) {\n const popupId = useId();\n const parentPopup = useContext(PopupParent);\n const config = useLeafConfig();\n const owner = useContext(OverlayOwner);\n const floatingRef = useRef<HTMLDivElement>(null);\n const present = usePresence(open, floatingRef);\n const [theme, setTheme] = useState<LeafThemeStyle>({});\n const [inheritedMotion, setInheritedMotion] = useState<string>();\n const openRef = useRef(open);\n openRef.current = open;\n const previousPosition = useRef<CSSProperties>({});\n const closingContent = useRef(children);\n const referenceElement = triggerRef.current;\n if (open) closingContent.current = children;\n const {\n refs,\n floatingStyles,\n isPositioned,\n update,\n placement: resolvedPlacement,\n } = useFloating({\n open,\n placement,\n strategy: 'fixed',\n // Keep viewport positioning outside the popup's local scale/translate motion.\n transform: false,\n whileElementsMounted: (reference, floating, update) =>\n autoUpdate(reference, floating, () => {\n if (openRef.current) update();\n }),\n middleware: [\n offset(6),\n flip({ padding: 12, fallbackAxisSideDirection: sideFallback ? 'end' : 'none' }),\n shift({ padding: 12 }),\n size(\n {\n padding: 12,\n apply({ availableHeight, availableWidth, rects, elements }) {\n if (!openRef.current) return;\n const length = (value: string | number) =>\n typeof value === 'number' ? `${value}px` : value;\n const widthMaximum = maxWidth ?? style?.maxWidth;\n const heightMaximum = maxHeight ?? style?.maxHeight;\n const viewportWidth = `${Math.max(0, availableWidth)}px`;\n const viewportHeight = `${Math.max(0, availableHeight)}px`;\n const widthLimit =\n widthMaximum === undefined\n ? viewportWidth\n : `min(${length(widthMaximum)}, ${viewportWidth})`;\n Object.assign(elements.floating.style, {\n maxHeight:\n heightMaximum === undefined\n ? viewportHeight\n : `min(${length(heightMaximum)}, ${viewportHeight})`,\n maxWidth: widthLimit,\n width: matchWidth\n ? `${Math.min(rects.reference.width, availableWidth)}px`\n : length(width ?? style?.width ?? ''),\n minWidth:\n minWidth === 'trigger'\n ? `min(${rects.reference.width}px, ${widthLimit})`\n : length(minWidth ?? style?.minWidth ?? ''),\n });\n },\n },\n [\n matchWidth,\n width,\n minWidth,\n maxWidth,\n maxHeight,\n style?.width,\n style?.minWidth,\n style?.maxWidth,\n style?.maxHeight,\n ],\n ),\n ],\n });\n if (open) previousPosition.current = floatingStyles;\n const setPanelRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node) popupNodes.set(popupId, node);\n else popupNodes.delete(popupId);\n assignRef(floatingRef, node);\n refs.setFloating(node);\n },\n [refs.setFloating, popupId],\n );\n const setViewportRef = useCallback(\n (node: HTMLDivElement | null) => assignRef(panelRef, node),\n [panelRef],\n );\n\n useBrowserLayoutEffect(() => {\n const trigger = referenceElement ?? triggerRef.current;\n if (!trigger || !present) return;\n refs.setReference(\n position\n ? {\n getBoundingClientRect: () => ({\n x: position.x,\n y: position.y,\n top: position.y,\n bottom: position.y,\n left: position.x,\n right: position.x,\n width: 0,\n height: 0,\n }),\n }\n : trigger,\n );\n const syncTheme = () => {\n let motionAncestor: HTMLElement | null = trigger;\n while (motionAncestor && !motionAncestor.hasAttribute('data-leaf-motion'))\n motionAncestor = composedParent(motionAncestor);\n setInheritedMotion(motionAncestor?.getAttribute('data-leaf-motion') ?? undefined);\n const variables = readThemeVariables(trigger);\n if (resetSurfaceGeometry) {\n // Popups solve their own corners, not the enclosing card/field's inset\n // geometry. Keep scoped component theme inputs and paint/shadows.\n for (const key of Object.keys(variables)) {\n if (\n /^--leaf-surface-(?:radius$|border$|padding(?:-|$)|inner-)/.test(key) ||\n key === '--leaf-floating-option-radius'\n ) {\n delete variables[key as `--leaf-${string}`];\n }\n }\n }\n setTheme(variables);\n };\n syncTheme();\n const observer = new MutationObserver(syncTheme);\n let ancestor: HTMLElement | null = trigger;\n while (ancestor) {\n observer.observe(ancestor, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-leaf-theme', 'data-leaf-motion', 'dir'],\n });\n ancestor = composedParent(ancestor);\n }\n return () => observer.disconnect();\n }, [triggerRef, referenceElement, refs.setReference, present, position, resetSurfaceGeometry]);\n\n useBrowserLayoutEffect(() => {\n // A quick reopen can reuse the exit-presence node without remounting autoUpdate.\n if (open && present) void update();\n }, [open, present, update]);\n\n if (!present || typeof document === 'undefined') return null;\n const viewportProps: HTMLAttributes<HTMLDivElement> = {};\n const rootProps = { ...props };\n for (const key of Object.keys(rootProps)) {\n if (key === 'id' || key === 'role' || key === 'tabIndex' || key.startsWith('aria-')) {\n Object.assign(viewportProps, { [key]: rootProps[key as keyof typeof rootProps] });\n delete rootProps[key as keyof typeof rootProps];\n }\n }\n return createPortal(\n <PopupParent.Provider value={popupId}>\n <ScrollbarControl\n {...rootProps}\n ref={setViewportRef}\n rootRef={setPanelRef}\n viewportProps={viewportProps}\n viewportClassName=\"leaf-floating__viewport\"\n role={props.role ?? 'presentation'}\n tabIndex={props.tabIndex ?? -1}\n scrollbarTabIndex={-1}\n data-leaf-owner={owner}\n data-leaf-popup={popupId}\n data-leaf-popup-parent={parentPopup}\n data-leaf-motion={config.theme.motion === false ? 'off' : inheritedMotion}\n data-side={resolvedPlacement.split('-')[0]}\n data-align={resolvedPlacement.split('-')[1] ?? 'center'}\n dir={props.dir ?? theme.direction ?? config.direction}\n lang={props.lang ?? config.locale}\n data-state={open ? 'open' : 'closing'}\n data-positioned={isPositioned || !open}\n aria-hidden={!open || undefined}\n {...inertProps(!open)}\n style={{ ...theme, ...style, ...(open ? floatingStyles : previousPosition.current) }}\n >\n {render\n ? render(open ? children : closingContent.current)\n : open\n ? children\n : closingContent.current}\n </ScrollbarControl>\n </PopupParent.Provider>,\n (typeof container === 'function' ? container() : container) ??\n config.getPopupContainer?.() ??\n document.body,\n );\n}\n\n/** Close a custom floating panel when focus leaves it or Escape is pressed. */\nexport function useFloatingDismiss(\n open: boolean,\n onClose: (reason?: 'escape' | 'outside' | 'focus' | 'tab') => void,\n triggerRef: RefObject<HTMLElement | null>,\n panelRef: RefObject<HTMLElement | null>,\n boundaryRef: RefObject<HTMLElement | null> = triggerRef,\n) {\n const closeRef = useRef(onClose);\n closeRef.current = onClose;\n useEffect(() => {\n if (!open) {\n return;\n }\n dismissStack.push(panelRef);\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.composedPath()[0] ?? event.target;\n if (!(target instanceof Node)) {\n return;\n }\n const label = target instanceof Element ? target.closest('label') : null;\n const labelledControl = label?.control;\n if (\n boundaryRef.current?.contains(target) ||\n insidePopup(target, panelRef.current) ||\n (labelledControl && boundaryRef.current?.contains(labelledControl))\n ) {\n return;\n }\n closeRef.current('outside');\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || dismissStack.at(-1) !== panelRef) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n closeRef.current('escape');\n triggerRef.current?.focus();\n } else if (event.key === 'Tab') {\n const panel = panelRef.current;\n const trigger = triggerRef.current;\n const active = deepActiveElement();\n if (!panel || !trigger || !panel.contains(active)) return;\n const items = tabbable(panel, {\n getShadowRoot: (element) => element.shadowRoot ?? undefined,\n });\n const index = active instanceof HTMLElement ? items.indexOf(active) : -1;\n const leaving = event.shiftKey ? index <= 0 : index === items.length - 1;\n if (!leaving) return;\n event.preventDefault();\n closeRef.current('tab');\n if (event.shiftKey) trigger.focus();\n else {\n const pageItems = tabbable(document.body, {\n getShadowRoot: (element) => element.shadowRoot ?? undefined,\n }).filter((item) => !panel.contains(item));\n const triggerIndex = pageItems.indexOf(trigger);\n (pageItems[triggerIndex + 1] ?? trigger).focus();\n }\n }\n };\n\n const handleFocus = (event: FocusEvent) => {\n const target = composedEventTarget(event);\n if (\n target instanceof Node &&\n !boundaryRef.current?.contains(target) &&\n !insidePopup(target, panelRef.current)\n )\n closeRef.current('focus');\n };\n\n document.addEventListener('pointerdown', handlePointerDown);\n document.addEventListener('keydown', handleKeyDown, true);\n document.addEventListener('focusin', handleFocus);\n return () => {\n const index = dismissStack.indexOf(panelRef);\n if (index >= 0) dismissStack.splice(index, 1);\n document.removeEventListener('pointerdown', handlePointerDown);\n document.removeEventListener('keydown', handleKeyDown, true);\n document.removeEventListener('focusin', handleFocus);\n };\n }, [open, panelRef, triggerRef, boundaryRef]);\n}\n\n/** Keep keyboard-highlighted options visible without animated scrolling. */\nexport function useActiveOption(\n open: boolean,\n optionId: string | undefined,\n panelRef?: RefObject<HTMLElement | null>,\n) {\n useEffect(() => {\n if (!open || !optionId) return;\n const root = panelRef?.current?.getRootNode();\n const scope = root instanceof ShadowRoot ? root : document;\n scope.getElementById(optionId)?.scrollIntoView?.({ block: 'nearest' });\n }, [open, optionId, panelRef]);\n}\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","useBrowserLayoutEffect","window","useEffect","useLayoutEffect","PopupParent","createContext","undefined","popupNodes","Map","dismissStack","insidePopup","target","panel","boundary","popup","Element","visited","Set","parent","usePopupState","disabled","onOpenChange","controlledOpen","defaultOpen","internalOpen","setRequestedOpen","useState","requestedOpen","requestedRef","useRef","open","setOpen","useCallback","next","FloatingPanel","triggerRef","panelRef","matchWidth","width","minWidth","maxWidth","maxHeight","placement","sideFallback","resetSurfaceGeometry","container","render","position","style","children","props","popupId","useId","parentPopup","useContext","config","useLeafConfig","owner","OverlayOwner","floatingRef","present","usePresence","theme","setTheme","inheritedMotion","setInheritedMotion","openRef","previousPosition","closingContent","referenceElement","refs","floatingStyles","isPositioned","update","resolvedPlacement","useFloating","reference","floating","autoUpdate","offset","flip","shift","size","availableHeight","availableWidth","rects","elements","length","value","widthMaximum","heightMaximum","viewportWidth","Math","viewportHeight","widthLimit","setPanelRef","node","assignRef","setViewportRef","trigger","syncTheme","motionAncestor","composedParent","variables","readThemeVariables","observer","MutationObserver","ancestor","document","viewportProps","rootProps","createPortal","ScrollbarControl","inertProps","useFloatingDismiss","onClose","boundaryRef","closeRef","handlePointerDown","event","Node","label","labelledControl","handleKeyDown","active","deepActiveElement","items","tabbable","element","index","HTMLElement","leaving","pageItems","item","triggerIndex","handleFocus","composedEventTarget","useActiveOption","optionId","root","scope","ShadowRoot"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,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Ae,EAAE,IAAInC,OAAM,EAAG,KAAK;gBAChD;YACF;QACF;QAEA,MAAMoC,cAAc,CAAChB;YACnB,MAAM5G,SAAS6H,AAAAA,IAAAA,iCAAAA,mBAAAA,AAAAA,EAAoBjB;YACnC,IACE5G,kBAAkB6G,QAClB,CAACJ,YAAY,OAAO,EAAE,SAASzG,WAC/B,CAACD,YAAYC,QAAQyB,SAAS,OAAO,GAErCiF,SAAS,OAAO,CAAC;QACrB;QAEAT,SAAS,gBAAgB,CAAC,eAAeU;QACzCV,SAAS,gBAAgB,CAAC,WAAWe,eAAe;QACpDf,SAAS,gBAAgB,CAAC,WAAW2B;QACrC,OAAO;YACL,MAAMN,QAAQxH,aAAa,OAAO,CAAC2B;YACnC,IAAI6F,SAAS,GAAGxH,aAAa,MAAM,CAACwH,OAAO;YAC3CrB,SAAS,mBAAmB,CAAC,eAAeU;YAC5CV,SAAS,mBAAmB,CAAC,WAAWe,eAAe;YACvDf,SAAS,mBAAmB,CAAC,WAAW2B;QAC1C;IACF,GAAG;QAACzG;QAAMM;QAAUD;QAAYiF;KAAY;AAC9C;AAGO,SAASqB,gBACd3G,IAAa,EACb4G,QAA4B,EAC5BtG,QAAwC;IAExClC,IAAAA,+BAAAA,SAAAA,AAAAA,EAAU;QACR,IAAI,CAAC4B,QAAQ,CAAC4G,UAAU;QACxB,MAAMC,OAAOvG,UAAU,SAAS;QAChC,MAAMwG,QAAQD,gBAAgBE,aAAaF,OAAO/B;QAClDgC,MAAM,cAAc,CAACF,WAAW,iBAAiB;YAAE,OAAO;QAAU;IACtE,GAAG;QAAC5G;QAAM4G;QAAUtG;KAAS;AAC/B"}
|
|
1
|
+
{"version":3,"file":"shared/floating.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../../../../../src/shared/floating.tsx"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n autoUpdate,\n flip,\n offset,\n type Placement,\n shift,\n size,\n useFloating,\n} from '@floating-ui/react-dom';\nimport {\n type CSSProperties,\n createContext,\n type HTMLAttributes,\n type FocusEvent as ReactFocusEvent,\n type PointerEvent as ReactPointerEvent,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { tabbable } from 'tabbable';\nimport { useLeafConfig } from '../config-provider/context';\nimport { ScrollbarControl } from '../scrollbar/scrollbar';\nimport type { LeafThemeStyle } from '../theme';\nimport { composedEventTarget, composedParent, deepActiveElement } from './dom';\nimport { assignRef } from './field';\nimport { inertProps } from './inert';\nimport { OverlayOwner } from './overlay-owner';\nimport { usePresence } from './presence';\nimport { readThemeVariables } from './theme-variables';\n\nconst useBrowserLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\nconst PopupParent = createContext<string | undefined>(undefined);\nconst popupNodes = new Map<string, HTMLElement>();\nconst dismissStack: RefObject<HTMLElement | null>[] = [];\nfunction insidePopup(target: Node, panel: HTMLElement | null) {\n if (!panel) return false;\n const boundary = panel.closest<HTMLElement>('[data-leaf-popup]') ?? panel;\n if (boundary.contains(target)) return true;\n let popup = target instanceof Element ? target.closest<HTMLElement>('[data-leaf-popup]') : null;\n const visited = new Set<string>();\n while (popup?.dataset.leafPopupParent) {\n const parent = popup.dataset.leafPopupParent;\n if (visited.has(parent)) break;\n visited.add(parent);\n popup = popupNodes.get(parent) ?? null;\n if (popup === boundary) return true;\n }\n return false;\n}\n\n/** Close disabled fields immediately and report each open-state change once. */\nexport function usePopupState(\n disabled?: boolean,\n onOpenChange?: (open: boolean) => void,\n controlledOpen?: boolean,\n defaultOpen = false,\n) {\n const [internalOpen, setRequestedOpen] = useState(defaultOpen);\n const requestedOpen = controlledOpen ?? internalOpen;\n const requestedRef = useRef(requestedOpen);\n requestedRef.current = requestedOpen;\n const open = requestedOpen && !disabled;\n const setOpen = useCallback(\n (next: boolean) => {\n if (next === requestedRef.current || (next && disabled)) return;\n requestedRef.current = next;\n if (controlledOpen === undefined) setRequestedOpen(next);\n onOpenChange?.(next);\n },\n [disabled, onOpenChange, controlledOpen],\n );\n useEffect(() => {\n if (disabled && requestedOpen) setOpen(false);\n }, [disabled, requestedOpen, setOpen]);\n return [open, setOpen] as const;\n}\n\nexport interface PopupOptions {\n popupPlacement?: Placement;\n popupClassName?: string;\n popupStyle?: CSSProperties;\n popupRender?: (content: React.ReactNode) => React.ReactNode;\n getPopupContainer?: () => Element | DocumentFragment;\n}\ninterface FloatingPanelProps extends HTMLAttributes<HTMLDivElement> {\n open: boolean;\n triggerRef: RefObject<HTMLElement | null>;\n panelRef: RefObject<HTMLDivElement | null>;\n matchWidth?: boolean;\n width?: CSSProperties['width'];\n minWidth?: CSSProperties['minWidth'] | 'trigger';\n maxWidth?: CSSProperties['maxWidth'];\n maxHeight?: CSSProperties['maxHeight'];\n placement?: Placement;\n sideFallback?: boolean;\n resetSurfaceGeometry?: boolean;\n container?: Element | DocumentFragment | (() => Element | DocumentFragment);\n render?: (content: React.ReactNode) => React.ReactNode;\n position?: { x: number; y: number };\n}\n\n/** Position a lazily mounted portal, preserving the trigger's scoped theme. */\nexport function FloatingPanel({\n open,\n triggerRef,\n panelRef,\n matchWidth,\n width,\n minWidth,\n maxWidth,\n maxHeight,\n placement = 'bottom-start',\n sideFallback = false,\n resetSurfaceGeometry = false,\n container,\n render,\n position,\n style,\n children,\n ...props\n}: FloatingPanelProps) {\n const popupId = useId();\n const parentPopup = useContext(PopupParent);\n const config = useLeafConfig();\n const owner = useContext(OverlayOwner);\n const floatingRef = useRef<HTMLDivElement>(null);\n const present = usePresence(open, floatingRef);\n const [theme, setTheme] = useState<LeafThemeStyle>({});\n const [inheritedMotion, setInheritedMotion] = useState<string>();\n const openRef = useRef(open);\n openRef.current = open;\n const previousPosition = useRef<CSSProperties>({});\n const closingContent = useRef(children);\n const referenceElement = triggerRef.current;\n if (open) closingContent.current = children;\n const {\n refs,\n floatingStyles,\n isPositioned,\n update,\n placement: resolvedPlacement,\n } = useFloating({\n open,\n placement,\n strategy: 'fixed',\n // Keep viewport positioning outside the popup's local scale/translate motion.\n transform: false,\n whileElementsMounted: (reference, floating, update) =>\n autoUpdate(reference, floating, () => {\n if (openRef.current) update();\n }),\n middleware: [\n offset(6),\n flip({ padding: 12, fallbackAxisSideDirection: sideFallback ? 'end' : 'none' }),\n shift({ padding: 12 }),\n size(\n {\n padding: 12,\n apply({ availableHeight, availableWidth, rects, elements }) {\n if (!openRef.current) return;\n const length = (value: string | number) =>\n typeof value === 'number' ? `${value}px` : value;\n const widthMaximum = maxWidth ?? style?.maxWidth;\n const heightMaximum = maxHeight ?? style?.maxHeight;\n const viewportWidth = `${Math.max(0, availableWidth)}px`;\n const viewportHeight = `${Math.max(0, availableHeight)}px`;\n const widthLimit =\n widthMaximum === undefined\n ? viewportWidth\n : `min(${length(widthMaximum)}, ${viewportWidth})`;\n Object.assign(elements.floating.style, {\n maxHeight:\n heightMaximum === undefined\n ? viewportHeight\n : `min(${length(heightMaximum)}, ${viewportHeight})`,\n maxWidth: widthLimit,\n width: matchWidth\n ? `${Math.min(rects.reference.width, availableWidth)}px`\n : length(width ?? style?.width ?? ''),\n minWidth:\n minWidth === 'trigger'\n ? `min(${rects.reference.width}px, ${widthLimit})`\n : length(minWidth ?? style?.minWidth ?? ''),\n });\n },\n },\n [\n matchWidth,\n width,\n minWidth,\n maxWidth,\n maxHeight,\n style?.width,\n style?.minWidth,\n style?.maxWidth,\n style?.maxHeight,\n ],\n ),\n ],\n });\n if (open) previousPosition.current = floatingStyles;\n const setPanelRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node) popupNodes.set(popupId, node);\n else popupNodes.delete(popupId);\n assignRef(floatingRef, node);\n refs.setFloating(node);\n },\n [refs.setFloating, popupId],\n );\n const setViewportRef = useCallback(\n (node: HTMLDivElement | null) => assignRef(panelRef, node),\n [panelRef],\n );\n\n useBrowserLayoutEffect(() => {\n const trigger = referenceElement ?? triggerRef.current;\n if (!trigger || !present) return;\n refs.setReference(\n position\n ? {\n getBoundingClientRect: () => ({\n x: position.x,\n y: position.y,\n top: position.y,\n bottom: position.y,\n left: position.x,\n right: position.x,\n width: 0,\n height: 0,\n }),\n }\n : trigger,\n );\n const syncTheme = () => {\n let motionAncestor: HTMLElement | null = trigger;\n while (motionAncestor && !motionAncestor.hasAttribute('data-leaf-motion'))\n motionAncestor = composedParent(motionAncestor);\n setInheritedMotion(motionAncestor?.getAttribute('data-leaf-motion') ?? undefined);\n const variables = readThemeVariables(trigger);\n if (resetSurfaceGeometry) {\n // Popups solve their own corners, not the enclosing card/field's inset\n // geometry. Keep scoped component theme inputs and paint/shadows.\n for (const key of Object.keys(variables)) {\n if (\n /^--leaf-surface-(?:radius$|border$|padding(?:-|$)|inner-)/.test(key) ||\n key === '--leaf-floating-option-radius'\n ) {\n delete variables[key as `--leaf-${string}`];\n }\n }\n }\n setTheme(variables);\n };\n syncTheme();\n const observer = new MutationObserver(syncTheme);\n let ancestor: HTMLElement | null = trigger;\n while (ancestor) {\n observer.observe(ancestor, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-leaf-theme', 'data-leaf-motion', 'dir'],\n });\n ancestor = composedParent(ancestor);\n }\n return () => observer.disconnect();\n }, [triggerRef, referenceElement, refs.setReference, present, position, resetSurfaceGeometry]);\n\n useBrowserLayoutEffect(() => {\n // A quick reopen can reuse the exit-presence node without remounting autoUpdate.\n if (open && present) void update();\n }, [open, present, update]);\n\n if (!present || typeof document === 'undefined') return null;\n const viewportProps: HTMLAttributes<HTMLDivElement> = {};\n const rootProps = { ...props };\n for (const key of Object.keys(rootProps)) {\n if (key === 'id' || key === 'role' || key === 'tabIndex' || key.startsWith('aria-')) {\n Object.assign(viewportProps, { [key]: rootProps[key as keyof typeof rootProps] });\n delete rootProps[key as keyof typeof rootProps];\n }\n }\n return createPortal(\n <PopupParent.Provider value={popupId}>\n <ScrollbarControl\n {...rootProps}\n ref={setViewportRef}\n rootRef={setPanelRef}\n viewportProps={viewportProps}\n viewportClassName=\"leaf-floating__viewport\"\n role={props.role ?? 'presentation'}\n tabIndex={props.tabIndex ?? -1}\n scrollbarTabIndex={-1}\n data-leaf-owner={owner}\n data-leaf-popup={popupId}\n data-leaf-popup-parent={parentPopup}\n data-leaf-motion={config.theme.motion === false ? 'off' : inheritedMotion}\n data-side={resolvedPlacement.split('-')[0]}\n data-align={resolvedPlacement.split('-')[1] ?? 'center'}\n dir={props.dir ?? theme.direction ?? config.direction}\n lang={props.lang ?? config.locale}\n data-state={open ? 'open' : 'closing'}\n data-positioned={isPositioned || !open}\n aria-hidden={!open || undefined}\n {...inertProps(!open)}\n style={{ ...theme, ...style, ...(open ? floatingStyles : previousPosition.current) }}\n >\n {render\n ? render(open ? children : closingContent.current)\n : open\n ? children\n : closingContent.current}\n </ScrollbarControl>\n </PopupParent.Provider>,\n (typeof container === 'function' ? container() : container) ??\n config.getPopupContainer?.() ??\n document.body,\n );\n}\n\n/** Close a custom floating panel when focus leaves it or Escape is pressed. */\nexport function useFloatingDismiss(\n open: boolean,\n onClose: (reason?: 'escape' | 'outside' | 'focus' | 'tab') => void,\n triggerRef: RefObject<HTMLElement | null>,\n panelRef: RefObject<HTMLElement | null>,\n boundaryRef: RefObject<HTMLElement | null> = triggerRef,\n) {\n const closeRef = useRef(onClose);\n closeRef.current = onClose;\n useEffect(() => {\n if (!open) {\n return;\n }\n dismissStack.push(panelRef);\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.composedPath()[0] ?? event.target;\n if (!(target instanceof Node)) {\n return;\n }\n const label = target instanceof Element ? target.closest('label') : null;\n const labelledControl = label?.control;\n if (\n boundaryRef.current?.contains(target) ||\n insidePopup(target, panelRef.current) ||\n (labelledControl && boundaryRef.current?.contains(labelledControl))\n ) {\n return;\n }\n closeRef.current('outside');\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || dismissStack.at(-1) !== panelRef) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n closeRef.current('escape');\n triggerRef.current?.focus();\n } else if (event.key === 'Tab') {\n const panel = panelRef.current;\n const trigger = triggerRef.current;\n const active = deepActiveElement();\n if (!panel || !trigger || !panel.contains(active)) return;\n const items = tabbable(panel, {\n getShadowRoot: (element) => element.shadowRoot ?? undefined,\n });\n const index = active instanceof HTMLElement ? items.indexOf(active) : -1;\n const leaving = event.shiftKey ? index <= 0 : index === items.length - 1;\n if (!leaving) return;\n event.preventDefault();\n closeRef.current('tab');\n if (event.shiftKey) trigger.focus();\n else {\n const pageItems = tabbable(document.body, {\n getShadowRoot: (element) => element.shadowRoot ?? undefined,\n }).filter((item) => !panel.contains(item));\n const triggerIndex = pageItems.indexOf(trigger);\n (pageItems[triggerIndex + 1] ?? trigger).focus();\n }\n }\n };\n\n const handleFocus = (event: FocusEvent) => {\n const target = composedEventTarget(event);\n if (\n target instanceof Node &&\n !boundaryRef.current?.contains(target) &&\n !insidePopup(target, panelRef.current)\n )\n closeRef.current('focus');\n };\n\n document.addEventListener('pointerdown', handlePointerDown);\n document.addEventListener('keydown', handleKeyDown, true);\n document.addEventListener('focusin', handleFocus);\n return () => {\n const index = dismissStack.indexOf(panelRef);\n if (index >= 0) dismissStack.splice(index, 1);\n document.removeEventListener('pointerdown', handlePointerDown);\n document.removeEventListener('keydown', handleKeyDown, true);\n document.removeEventListener('focusin', handleFocus);\n };\n }, [open, panelRef, triggerRef, boundaryRef]);\n}\n\n/** Keep keyboard-highlighted options visible without animated scrolling. */\nexport function useActiveOption(\n open: boolean,\n optionId: string | undefined,\n panelRef?: RefObject<HTMLElement | null>,\n) {\n useEffect(() => {\n if (!open || !optionId) return;\n const root = panelRef?.current?.getRootNode();\n const scope = root instanceof ShadowRoot ? root : document;\n scope.getElementById(optionId)?.scrollIntoView?.({ block: 'nearest' });\n }, [open, optionId, panelRef]);\n}\n\nconst MODIFIER_KEYS = new Set(['Shift', 'Control', 'Alt', 'Meta']);\nconst pointerModalities = new WeakMap<Document, boolean>();\nconst modalityRefs = new WeakMap<Document, number>();\nconst modalityCleanups = new WeakMap<Document, () => void>();\n\nfunction markPointerModality(doc: Document | null | undefined) {\n if (doc) pointerModalities.set(doc, true);\n}\n\nfunction isPointerModality(doc: Document | null | undefined) {\n return doc ? (pointerModalities.get(doc) ?? false) : false;\n}\n\n// 按 Document 引用计数监听最近输入方式,区分指针点击聚焦与键盘聚焦\nfunction subscribeModality(doc: Document) {\n const count = modalityRefs.get(doc) ?? 0;\n if (count === 0) {\n const onPointer = () => {\n pointerModalities.set(doc, true);\n };\n const onKey = (event: KeyboardEvent) => {\n if (!MODIFIER_KEYS.has(event.key)) pointerModalities.set(doc, false);\n };\n doc.addEventListener('pointerdown', onPointer, true);\n doc.addEventListener('mousedown', onPointer, true);\n doc.addEventListener('keydown', onKey, true);\n modalityCleanups.set(doc, () => {\n doc.removeEventListener('pointerdown', onPointer, true);\n doc.removeEventListener('mousedown', onPointer, true);\n doc.removeEventListener('keydown', onKey, true);\n });\n }\n modalityRefs.set(doc, count + 1);\n return () => {\n const next = (modalityRefs.get(doc) ?? 1) - 1;\n if (next <= 0) {\n modalityRefs.delete(doc);\n modalityCleanups.get(doc)?.();\n modalityCleanups.delete(doc);\n pointerModalities.delete(doc);\n } else {\n modalityRefs.set(doc, next);\n }\n };\n}\n\nexport interface HoverFocusOptions {\n enabled?: boolean;\n inactive: boolean;\n open: boolean;\n change: (next: boolean) => void;\n enterDelay: number;\n leaveDelay: number;\n triggerRef: RefObject<HTMLElement | null>;\n panelRef: RefObject<HTMLElement | null>;\n keepPanelFocus?: boolean;\n}\n\n/** 管理悬停与键盘聚焦浮层的展开、延时收起及外部/Escape 关闭。 */\nexport function useHoverFocus({\n enabled = true,\n inactive,\n open,\n change,\n enterDelay,\n leaveDelay,\n triggerRef,\n panelRef,\n keepPanelFocus = false,\n}: HoverFocusOptions) {\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const focused = useRef(false);\n const hovered = useRef(false);\n const changeRef = useRef(change);\n changeRef.current = change;\n\n const schedule = useCallback((next: boolean, delay: number) => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => changeRef.current(next), Math.max(0, delay));\n }, []);\n\n const dismiss = useCallback((reason?: 'escape' | 'outside' | 'focus' | 'tab') => {\n clearTimeout(timer.current);\n // Escape 或外部关闭后解除聚焦锁定,避免后续悬停移开时无法自动收起\n focused.current = false;\n if (reason === 'outside') hovered.current = false;\n changeRef.current(false);\n }, []);\n\n useFloatingDismiss(open, dismiss, triggerRef, panelRef);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!enabled || inactive) {\n clearTimeout(timer.current);\n focused.current = false;\n hovered.current = false;\n }\n }, [enabled, inactive]);\n\n useEffect(() => {\n if (!enabled || typeof document === 'undefined') return;\n return subscribeModality(triggerRef.current?.ownerDocument ?? document);\n }, [enabled, triggerRef]);\n\n const panelContains = (node: EventTarget | null) =>\n keepPanelFocus && node instanceof Node && Boolean(panelRef.current?.contains(node));\n\n return {\n onTriggerPointerEnter: (event: ReactPointerEvent<HTMLElement>) => {\n if (enabled && !inactive && !event.defaultPrevented && event.pointerType !== 'touch') {\n hovered.current = true;\n schedule(true, enterDelay);\n }\n },\n onTriggerPointerLeave: () => {\n hovered.current = false;\n if (enabled && !focused.current && !(keepPanelFocus && panelContains(deepActiveElement())))\n schedule(false, leaveDelay);\n },\n onTriggerPointerDown: (event: ReactPointerEvent<HTMLElement>) => {\n if (!enabled) return;\n markPointerModality(event.currentTarget.ownerDocument);\n focused.current = false;\n },\n onTriggerFocus: (event: ReactFocusEvent<HTMLElement>) => {\n if (\n enabled &&\n !inactive &&\n !event.defaultPrevented &&\n !isPointerModality(event.currentTarget.ownerDocument)\n ) {\n focused.current = true;\n clearTimeout(timer.current);\n changeRef.current(true);\n }\n },\n onTriggerBlur: (event: ReactFocusEvent<HTMLElement>) => {\n focused.current = false;\n if (enabled && !hovered.current && !panelContains(event.relatedTarget))\n schedule(false, leaveDelay);\n },\n onPanelPointerEnter: () => {\n if (!enabled) return;\n hovered.current = true;\n clearTimeout(timer.current);\n },\n onPanelPointerLeave: () => {\n hovered.current = false;\n if (enabled && !focused.current && !panelContains(deepActiveElement()))\n schedule(false, leaveDelay);\n },\n };\n}\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","useBrowserLayoutEffect","window","useEffect","useLayoutEffect","PopupParent","createContext","undefined","popupNodes","Map","dismissStack","insidePopup","target","panel","boundary","popup","Element","visited","Set","parent","usePopupState","disabled","onOpenChange","controlledOpen","defaultOpen","internalOpen","setRequestedOpen","useState","requestedOpen","requestedRef","useRef","open","setOpen","useCallback","next","FloatingPanel","triggerRef","panelRef","matchWidth","width","minWidth","maxWidth","maxHeight","placement","sideFallback","resetSurfaceGeometry","container","render","position","style","children","props","popupId","useId","parentPopup","useContext","config","useLeafConfig","owner","OverlayOwner","floatingRef","present","usePresence","theme","setTheme","inheritedMotion","setInheritedMotion","openRef","previousPosition","closingContent","referenceElement","refs","floatingStyles","isPositioned","update","resolvedPlacement","useFloating","reference","floating","autoUpdate","offset","flip","shift","size","availableHeight","availableWidth","rects","elements","length","value","widthMaximum","heightMaximum","viewportWidth","Math","viewportHeight","widthLimit","setPanelRef","node","assignRef","setViewportRef","trigger","syncTheme","motionAncestor","composedParent","variables","readThemeVariables","observer","MutationObserver","ancestor","document","viewportProps","rootProps","createPortal","ScrollbarControl","inertProps","useFloatingDismiss","onClose","boundaryRef","closeRef","handlePointerDown","event","Node","label","labelledControl","handleKeyDown","active","deepActiveElement","items","tabbable","element","index","HTMLElement","leaving","pageItems","item","triggerIndex","handleFocus","composedEventTarget","useActiveOption","optionId","root","scope","ShadowRoot","MODIFIER_KEYS","pointerModalities","WeakMap","modalityRefs","modalityCleanups","markPointerModality","doc","isPointerModality","subscribeModality","count","onPointer","onKey","useHoverFocus","enabled","inactive","change","enterDelay","leaveDelay","keepPanelFocus","timer","focused","hovered","changeRef","schedule","delay","clearTimeout","setTimeout","dismiss","reason","panelContains","Boolean"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAF,oBAAoB,CAAC,GAAG,CAACQ,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFT,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOU,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;AC8BA,MAAMI,yBAAyB,AAAkB,MAAlB,OAAOC,SAAyBC,+BAAAA,SAASA,GAAGC,+BA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AsB,CAACxC;YACrB,IAAI,CAACoC,SAAS;YACdR,oBAAoB5B,MAAM,aAAa,CAAC,aAAa;YACrD2C,QAAQ,OAAO,GAAG;QACpB;QACA,gBAAgB,CAAC3C;YACf,IACEoC,WACA,CAACC,YACD,CAACrC,MAAM,gBAAgB,IACvB,CAAC8B,kBAAkB9B,MAAM,aAAa,CAAC,aAAa,GACpD;gBACA2C,QAAQ,OAAO,GAAG;gBAClBK,aAAaN,MAAM,OAAO;gBAC1BG,UAAU,OAAO,CAAC;YACpB;QACF;QACA,eAAe,CAAC7C;YACd2C,QAAQ,OAAO,GAAG;YAClB,IAAIP,WAAW,CAACQ,QAAQ,OAAO,IAAI,CAACQ,cAAcpD,MAAM,aAAa,GACnE8C,SAAS,OAAON;QACpB;QACA,qBAAqB;YACnB,IAAI,CAACJ,SAAS;YACdQ,QAAQ,OAAO,GAAG;YAClBI,aAAaN,MAAM,OAAO;QAC5B;QACA,qBAAqB;YACnBE,QAAQ,OAAO,GAAG;YAClB,IAAIR,WAAW,CAACO,QAAQ,OAAO,IAAI,CAACS,cAAc9C,AAAAA,IAAAA,iCAAAA,iBAAAA,AAAAA,MAChDwC,SAAS,OAAON;QACpB;IACF;AACF"}
|
|
@@ -44,33 +44,33 @@ function TooltipControl({ content, children, placement = 'top', arrow = true, op
|
|
|
44
44
|
const [internal, setInternal] = (0, external_react_namespaceObject.useState)(defaultOpen);
|
|
45
45
|
const inactive = disabled || children.props.disabled || null == content || '' === content;
|
|
46
46
|
const open = !inactive && (controlled ?? internal);
|
|
47
|
+
const openRef = (0, external_react_namespaceObject.useRef)(open);
|
|
48
|
+
openRef.current = open;
|
|
47
49
|
const trigger = (0, external_react_namespaceObject.useRef)(null);
|
|
48
50
|
const panel = (0, external_react_namespaceObject.useRef)(null);
|
|
49
51
|
const childRef = external_react_namespaceObject.version.startsWith('18.') ? children.ref : children.props.ref;
|
|
50
52
|
const ref = (0, field_cjs_namespaceObject.useMergedRef)(trigger, childRef);
|
|
51
53
|
const id = `${(0, external_react_namespaceObject.useId)()}-tooltip`;
|
|
52
|
-
const timer = (0, external_react_namespaceObject.useRef)(void 0);
|
|
53
|
-
const focused = (0, external_react_namespaceObject.useRef)(false);
|
|
54
|
-
const hovered = (0, external_react_namespaceObject.useRef)(false);
|
|
55
54
|
const change = (next)=>{
|
|
56
|
-
if (
|
|
57
|
-
if (next
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const dismiss = ()=>{
|
|
64
|
-
clearTimeout(timer.current);
|
|
65
|
-
change(false);
|
|
55
|
+
if (inactive && next) return;
|
|
56
|
+
if (next === openRef.current) return;
|
|
57
|
+
if (void 0 === controlled) {
|
|
58
|
+
openRef.current = next;
|
|
59
|
+
setInternal(next);
|
|
60
|
+
}
|
|
61
|
+
onOpenChange?.(next);
|
|
66
62
|
};
|
|
67
|
-
(0, floating_cjs_namespaceObject.
|
|
68
|
-
|
|
63
|
+
const hoverFocus = (0, floating_cjs_namespaceObject.useHoverFocus)({
|
|
64
|
+
inactive,
|
|
65
|
+
open,
|
|
66
|
+
change,
|
|
67
|
+
enterDelay,
|
|
68
|
+
leaveDelay,
|
|
69
|
+
triggerRef: trigger,
|
|
70
|
+
panelRef: panel
|
|
71
|
+
});
|
|
69
72
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
70
|
-
if (inactive)
|
|
71
|
-
clearTimeout(timer.current);
|
|
72
|
-
setInternal(false);
|
|
73
|
-
}
|
|
73
|
+
if (inactive) setInternal(false);
|
|
74
74
|
}, [
|
|
75
75
|
inactive
|
|
76
76
|
]);
|
|
@@ -84,28 +84,23 @@ function TooltipControl({ content, children, placement = 'top', arrow = true, op
|
|
|
84
84
|
].filter(Boolean).join(' ') || void 0,
|
|
85
85
|
onPointerEnter: (event)=>{
|
|
86
86
|
children.props.onPointerEnter?.(event);
|
|
87
|
-
|
|
88
|
-
hovered.current = true;
|
|
89
|
-
schedule(true, enterDelay);
|
|
90
|
-
}
|
|
87
|
+
hoverFocus.onTriggerPointerEnter(event);
|
|
91
88
|
},
|
|
92
89
|
onPointerLeave: (event)=>{
|
|
93
90
|
children.props.onPointerLeave?.(event);
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
hoverFocus.onTriggerPointerLeave();
|
|
92
|
+
},
|
|
93
|
+
onPointerDown: (event)=>{
|
|
94
|
+
children.props.onPointerDown?.(event);
|
|
95
|
+
hoverFocus.onTriggerPointerDown(event);
|
|
96
96
|
},
|
|
97
97
|
onFocus: (event)=>{
|
|
98
98
|
children.props.onFocus?.(event);
|
|
99
|
-
|
|
100
|
-
focused.current = true;
|
|
101
|
-
clearTimeout(timer.current);
|
|
102
|
-
change(true);
|
|
103
|
-
}
|
|
99
|
+
hoverFocus.onTriggerFocus(event);
|
|
104
100
|
},
|
|
105
101
|
onBlur: (event)=>{
|
|
106
102
|
children.props.onBlur?.(event);
|
|
107
|
-
|
|
108
|
-
if (!hovered.current) schedule(false, leaveDelay);
|
|
103
|
+
hoverFocus.onTriggerBlur(event);
|
|
109
104
|
}
|
|
110
105
|
}),
|
|
111
106
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(floating_cjs_namespaceObject.FloatingPanel, {
|
|
@@ -120,14 +115,8 @@ function TooltipControl({ content, children, placement = 'top', arrow = true, op
|
|
|
120
115
|
placement: popupPlacement ?? placement,
|
|
121
116
|
className: (0, classes_cjs_namespaceObject.classes)('leaf-floating', 'leaf-tooltip', className, popupClassName),
|
|
122
117
|
style: popupStyle,
|
|
123
|
-
onPointerEnter:
|
|
124
|
-
|
|
125
|
-
clearTimeout(timer.current);
|
|
126
|
-
},
|
|
127
|
-
onPointerLeave: ()=>{
|
|
128
|
-
hovered.current = false;
|
|
129
|
-
if (!focused.current) schedule(false, leaveDelay);
|
|
130
|
-
},
|
|
118
|
+
onPointerEnter: hoverFocus.onPanelPointerEnter,
|
|
119
|
+
onPointerLeave: hoverFocus.onPanelPointerLeave,
|
|
131
120
|
children: content
|
|
132
121
|
})
|
|
133
122
|
]
|