UEA-PRODEM

This commit is contained in:
2026-06-10 12:14:46 -03:00
parent f54126b9d8
commit 9947565694
5319 changed files with 148520 additions and 129332 deletions
+53 -10
View File
@@ -64,7 +64,18 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
var Popper = (props) => {
const { __scopePopper, children } = props;
const [anchor, setAnchor] = React.useState(null);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
const [placementState, setPlacementState] = React.useState(void 0);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
PopperProvider,
{
scope: __scopePopper,
anchor,
onAnchorChange: setAnchor,
placementState,
setPlacementState,
children
}
);
};
Popper.displayName = POPPER_NAME;
var ANCHOR_NAME = "PopperAnchor";
@@ -73,16 +84,40 @@ var PopperAnchor = React.forwardRef(
const { __scopePopper, virtualRef, ...anchorProps } = props;
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
const ref = React.useRef(null);
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
const onAnchorChange = context.onAnchorChange;
const callbackRef = React.useCallback(
(node) => {
ref.current = node;
if (node) {
onAnchorChange(node);
}
},
[onAnchorChange]
);
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, callbackRef);
const anchorRef = React.useRef(null);
React.useEffect(() => {
if (!virtualRef) {
return;
}
const previousAnchor = anchorRef.current;
anchorRef.current = virtualRef?.current || ref.current;
anchorRef.current = virtualRef.current;
if (previousAnchor !== anchorRef.current) {
context.onAnchorChange(anchorRef.current);
onAnchorChange(anchorRef.current);
}
});
return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...anchorProps, ref: composedRefs });
const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);
const placedSide = sideAndAlign?.[0];
const placedAlign = sideAndAlign?.[1];
return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_primitive.Primitive.div,
{
"data-radix-popper-side": placedSide,
"data-radix-popper-align": placedAlign,
...anchorProps,
ref: composedRefs
}
);
}
);
PopperAnchor.displayName = ANCHOR_NAME;
@@ -98,7 +133,7 @@ var PopperContent = React.forwardRef(
alignOffset = 0,
arrowPadding = 0,
avoidCollisions = true,
collisionBoundary = [],
collisionBoundary,
collisionPadding: collisionPaddingProp = 0,
sticky = "partial",
hideWhenDetached = false,
@@ -115,11 +150,11 @@ var PopperContent = React.forwardRef(
const arrowHeight = arrowSize?.height ?? 0;
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
const hasExplicitBoundaries = boundary.length > 0;
const boundary = collisionBoundary ? Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary] : void 0;
const hasExplicitBoundaries = boundary !== void 0 && boundary.length > 0;
const detectOverflowOptions = {
padding: collisionPadding,
boundary: boundary.filter(isNotNull),
boundary: boundary?.filter(isNotNull),
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
altBoundary: hasExplicitBoundaries
};
@@ -161,6 +196,13 @@ var PopperContent = React.forwardRef(
hideWhenDetached && (0, import_react_dom.hide)({ strategy: "referenceHidden", ...detectOverflowOptions })
]
});
const setPlacementState = context.setPlacementState;
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
setPlacementState(placement);
return () => {
setPlacementState(void 0);
};
}, [placement, setPlacementState]);
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
const handlePlaced = (0, import_react_use_callback_ref.useCallbackRef)(onPlaced);
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
@@ -186,7 +228,7 @@ var PopperContent = React.forwardRef(
// keep off the page when measuring
minWidth: "max-content",
zIndex: contentZIndex,
["--radix-popper-transform-origin"]: [
"--radix-popper-transform-origin": [
middlewareData.transformOrigin?.x,
middlewareData.transformOrigin?.y
].join(" "),
@@ -204,6 +246,7 @@ var PopperContent = React.forwardRef(
{
scope: __scopePopper,
placedSide,
placedAlign,
onArrowChange: setArrow,
arrowX,
arrowY,