PageSourceSearch

https://help.kiges.cc/build/assets/popover-CJshZQkz.js

js kiges.cc collected 2026-10-09 21:42:28 UTC 5,332 bytes, 1 lines download raw bytes

vendor: 4,275 bytes, line 1
1import{b as c,j as s}from"./app-D8k9NREj.js";import{g as A,u as $,i as L,c as z,a as G,b as P,A as O,P as H,h as K,R as U,e as V,F as W,D as Z,C as q,j as B}from"./index-DooPfvXQ.js";import{u as _,a as J}from"./button-DVHqAccH.js";import{P as b}from"./index-BTif8ELF.js";import{P as w}from"./index-M4jReS4k.js";import{c as Q}from"./utils-0x0D5uyD.js";var C="Popover",[j]=z(C,[A]),g=A(),[X,l]=j(C),E=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:o,onOpenChange:r,modal:i=!1}=e,p=g(n),f=c.useRef(null),[v,h]=c.useState(!1),[m,u]=$({prop:a,defaultProp:o??!1,onChange:r,caller:C});return s.jsx(L,{...p,children:s.jsx(X,{scope:n,contentId:G(),triggerRef:f,open:m,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(x=>!x),[u]),hasCustomAnchor:v,onCustomAnchorAdd:c.useCallback(()=>h(!0),[]),onCustomAnchorRemove:c.useCallback(()=>h(!1),[]),modal:i,children:t})})};E.displayName=C;var N="PopoverAnchor",Y=c.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=l(N,t),r=g(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:p}=o;return c.useEffect(()=>(i(),()=>p()),[i,p]),s.jsx(O,{...r,...a,ref:n})});Y.displayName=N;var F="PopoverTrigger",y=c.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=l(F,t),r=g(t),i=_(n,o.triggerRef),p=s.jsx(w.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":k(o.open),...a,ref:i,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?p:s.jsx(O,{asChild:!0,...r,children:p})});y.displayName=F;var R="PopoverPortal",[ee,oe]=j(R,{forceMount:void 0}),S=e=>{const{__scopePopover:n,forceMount:t,children:a,container:o}=e,r=l(R,n);return s.jsx(ee,{scope:n,forceMount:t,children:s.jsx(b,{present:t||r.open,children:s.jsx(H,{asChild:!0,container:o,children:a})})})};S.displayName=R;var d="PopoverContent",D=c.forwardRef((e,n)=>{const t=oe(d,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,r=l(d,e.__scopePopover);return s.jsx(b,{present:a||r.open,children:r.modal?s.jsx(re,{...o,ref:n}):s.jsx(ne,{...o,ref:n})})});D.displayName=d;var te=J("PopoverContent.RemoveScroll"),re=c.forwardRef((e,n)=>{const t=l(d,e.__scopePopover),a=c.useRef(null),o=_(n,a),r=c.useRef(!1);return c.useEffect(()=>{const i=a.current;if(i)return K(i)},[]),s.jsx(U,{as:te,allowPinchZoom:!0,children:s.jsx(M,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,i=>{i.preventDefault(),r.current||t.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,i=>{const p=i.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0,v=p.button===2||f;r.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=c.forwardRef((e,n)=>{const t=l(d,e.__scopePopover),a=c.useRef(!1),o=c.useRef(!1);return s.jsx(M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(a.current||t.triggerRef.current?.focus(),r.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=r.target;t.triggerRef.current?.contains(i)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),M=c.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:i,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onInteractOutside:h,...m}=e,u=l(d,t),x=g(t);return V(),s.jsx(W,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:r,children:s.jsx(Z,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onDismiss:()=>u.onOpenChange(!1),children:s.jsx(q,{"data-state":k(u.open),role:"dialog",id:u.contentId,...x,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}
1),T="PopoverClose",ae=c.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=l(T,t);return s.jsx(w.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=c.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=g(t);return s.jsx(B,{...o,...a,ref:n})});ce.displayName=se;function k(e){return e?"open":"closed"}var ie=E,pe=y,le=S,I=D;const me=ie,Ce=pe,ue=c.forwardRef(({className:e,align:n="center",sideOffset:t=4,...a},o)=>s.jsx(le,{children:s.jsx(I,{ref:o,align:n,sideOffset:t,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ue.displayName=I.displayName;export{me as P,Ce as a,ue as b};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.