PageSourceSearch

https://medon.lv/assets/Menu-Brjs-nDN.js

js medon.lv collected 2026-09-25 07:42:35 UTC 11,202 bytes, 1 lines download raw bytes

1import{f as ge,c as ee}from"./create-scoped-keydown-handler-DukexwkQ.js";import{j as K,N as k,B as te,z as oe,L as ne,x as se,P as he}from"./Box-Br96zz_6.js";import{a as ve,u as ye}from"./use-resolved-styles-api-B8pVLt1N.js";import{t as c}from"./chunk-62JRHF6Z-B_bjtN1J.js";import{P as O}from"./Popover-RI841kw4.js";import{c as we}from"./Card-BDsiwhVP.js";import{j as u}from"./jsx-runtime-u17CrQMm.js";import{J as V,B as q,r as be,D as xe,I as Me,H as Se,v as Ce,o as De}from"./NativeScrollArea-rWlNMW3d.js";import{U as re,a as Ie}from"./CloseButton-C0cYRRjU.js";import{g as ke}from"./get-floating-position-eABBu1-q.js";import{A as Pe}from"./AccordionChevron-DlFLjaHp.js";import{u as Te}from"./use-disclosure-BJc7i34T.js";function C(n,e){return r=>{n?.(r),e?.(r)}}function Re(n,e,r){return r?Array.from(ge(r,e)?.querySelectorAll(n)||[]).findIndex(i=>i===r):null}function Ne({open:n,close:e,openDelay:r,closeDelay:i}){const s=c.useRef(-1),a=c.useRef(-1),t=()=>{window.clearTimeout(s.current),window.clearTimeout(a.current)},d=()=>{t(),r===0||r===void 0?n():s.current=window.setTimeout(n,r)},g=()=>{t(),i===0||i===void 0?e():a.current=window.setTimeout(e,i)};return c.useEffect(()=>t,[]),{openDropdown:d,closeDropdown:g}}const[Ee,P]=we("Menu component was not found in the tree");var R={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const z=K(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,...t}=k("MenuDivider",null,n);return u.jsx(te,{...P().getStyles("divider",{className:r,style:i,styles:s,classNames:e}),...t})});z.classes=R;z.displayName="@mantine/core/MenuDivider";const J=K(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,onMouseEnter:t,onMouseLeave:d,onKeyDown:g,children:p,ref:w,...b}=k("MenuDropdown",null,n),v=c.useRef(null),f=P(),y=C(g,m=>{(m.key==="ArrowUp"||m.key==="ArrowDown")&&(m.preventDefault(),v.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),o=C(t,()=>(f.trigger==="hover"||f.trigger==="click-hover")&&f.openDropdown()),l=C(d,()=>(f.trigger==="hover"||f.trigger==="click-hover")&&f.closeDropdown());return u.jsxs(O.Dropdown,{...b,onMouseEnter:o,onMouseLeave:l,role:"menu","aria-orientation":"vertical",ref:V(w,v),...f.getStyles("dropdown",{className:r,style:i,styles:s,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:y,children:[f.withInitialFocusPlaceholder&&u.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),p]})});J.classes=R;J.displayName="@mantine/core/MenuDropdown";const A=c.createContext(null),G=oe(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,color:t,closeMenuOnClick:d,leftSection:g,rightSection:p,children:w,disabled:b,"data-disabled":v,ref:f,...y}=k("MenuItem",null,n),o=P(),l=c.use(A),m=ne(),{dir:T}=q(),E=c.useRef(null),x=y,M=C(x.onClick,()=>{v||(typeof d=="boolean"?d&&o.closeDropdownImmediately():o.closeOnItemClick&&o.closeDropdownImmediately())}),S=t?m.variantColorResolver({color:t,theme:m,variant:"light"}):void 0,D=t?se({color:t,theme:m}):null,j=C(x.onKeyDown,I=>{I.key==="ArrowLeft"&&l&&(l.close(),l.focusParentItem())});return u.jsxs(re,{onMouseDown:I=>I.preventDefault(),...y,unstyled:o.unstyled,tabIndex:o.menuItemTabIndex,...o.getStyles("item",{className:r,style:i,styles:s,classNames:e}),ref:V(E,f),role:"menuitem",disabled:b,"data-menu-item":!0,"data-disabled":b||v||void 0,"data-mantine-stop-propagation":!0,onClick:M,onKeyDown:ee({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:o.loop,dir:T,orientation:"vertical",onKeyDown:j}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[g&&u.jsx("div",{...o.getStyles("itemSection",{styles:s,classNames:e}),"data-position":"left",children:g}),w&&u.jsx("div",{...o.getStyles("itemLabel",{styles:s,classNames:e}),children:w}),p&&u.jsx("div",{...o.getStyles("itemSection",{styles:s,classNames:e}),"data-position":"right",children:p})]})});G.classes=R;G.displayName="@mantine/core/MenuItem";const Q=K(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,...t}=k("MenuLabel",null,n);return u.jsx(te,{...P().getStyles("label",{className:r,style:i,styles:s,classNames:e}),...t})});Q.classes=R;Q.displayName="@mantine/core/MenuLabel";const W=K(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,onMouseEnter:t,onMouseLeave:d,onPointerEnter:g,onPointerLeave:p,onKeyDown:w,children:b,ref:v,...f}=k("MenuSubDropdown",null,n),y=c.useRef(null),o=P(),l=c.use(A),m=l?.getFloatingProps({onMouseEnter:t,onMouseLeave:d,onPointerEnter:g,onPointerLeave:p});return u.jsx(O.Dropdown,{...f,...m,role:"menu","aria-orientation":"vertical",ref:V(v,y,l?.setFloating),...o.getStyles("dropdown",{className:r,style:i,styles:s,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:b})});W.classes=R;W.displayName="@mantine/core/MenuSubDropdown";const X=oe(n=>{const{classNames:e,className:r,style:i,styles:s,vars:a,color:t,leftSection:d,rightSection:g,children:p,disabled:w,"data-disabled":b,closeMenuOnClick:v,ref:f,...y}=k("MenuSubItem",null,n),o=P(),l=c.use(A),m=ne(),{dir:T}=q(),E=c.useRef(null),x=y,M=t?m.variantColorResolver({color:t,theme:m,variant:"light"}):void 0,S=t?se({color:t,theme:m}):null,D=C(x.onKeyDown,h=>{h.key==="ArrowRight"&&(l?.open(),l?.focusFirstItem()),h.key==="ArrowLeft"&&l?.parentContext&&(l.parentContext.close(),l.parentContext.focusParentItem())}),j=C(x.onClick,()=>{!b&&v&&o.closeDropdownImmediately()}),I=l?.getReferenceProps({onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onPointerEnter:x.onPointerEnter,onPointerLeave:x.onPointerLeave});return u.jsxs(re,{onMouseDown:h=>h.preventDefault(),...y,...I,unstyled:o.unstyled,tabIndex:o.menuItemTabIndex,...o.getStyles("item",{className:r,style:i,styles:s,classNames:e}),ref:V(E,f,l?.setReference),role:"menuitem",disabled:w,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":w||b||void 0,"data-mantine-stop-propagation":!0,onClick:j,onKeyDown:ee
1({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:o.loop,dir:T,orientation:"vertical",onKeyDown:D}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:M?.color,"--menu-item-hover":M?.hover},children:[d&&u.jsx("div",{...o.getStyles("itemSection",{styles:s,classNames:e}),"data-position":"left",children:d}),p&&u.jsx("div",{...o.getStyles("itemLabel",{styles:s,classNames:e}),children:p}),u.jsx("div",{...o.getStyles("itemSection",{styles:s,classNames:e}),"data-position":"right",children:g||u.jsx(Pe,{...o.getStyles("chevron"),size:14})})]})});X.classes=R;X.displayName="@mantine/core/MenuSubItem";function ae({children:n,refProp:e}){if(!be(n))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return P(),u.jsx(O.Target,{refProp:e,popupType:"menu",children:n})}ae.displayName="@mantine/core/MenuSubTarget";const je={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function _(n){const{children:e,closeDelay:r,openDelay:i,position:s,...a}=k("MenuSub",je,n),t=Ie(),[d,{open:g,close:p}]=Te(!1),w=c.use(A),b=P(),{dir:v}=q(),f=ke(v,s),y=w?.registerOpenSub??b.registerOpenSub,o=c.useRef(null),l=c.useRef(null),m=c.useCallback(h=>{const L=l.current;return L&&L!==h&&L(),l.current=h,()=>{l.current===h&&(l.current=null)}},[]),T=c.useCallback(()=>{o.current=y(p),g()},[p,y,g]),E=c.useCallback(()=>{o.current?.(),o.current=null,p()},[p]),{context:x,refs:M}=xe({placement:f,open:d,onOpenChange:h=>{h?T():E()}}),{getReferenceProps:S,getFloatingProps:D}=Me([Se(x,{handleClose:Ce(),delay:{open:i,close:r}})]),j=()=>window.setTimeout(()=>{document.getElementById(`${t}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),I=()=>window.setTimeout(()=>{document.getElementById(`${t}-target`)?.focus()},16);return u.jsx(A,{value:{opened:d,close:E,open:T,focusFirstItem:j,focusParentItem:I,parentContext:w,setReference:M.setReference,setFloating:M.setFloating,getReferenceProps:S,getFloatingProps:D,registerOpenSub:m},children:u.jsx(O,{opened:d,withinPortal:!1,withArrow:!1,id:t,position:s,...a,children:e})})}_.extend=n=>n;_.displayName="@mantine/core/MenuSub";_.Target=ae;_.Dropdown=W;_.Item=X;const Le={refProp:"ref"};function le(n){const{children:e,refProp:r,...i}=k("MenuTarget",Le,n),s=De(e);if(!s)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=P(),t=s.props,d=C(t.onClick,()=>{a.trigger==="click"?a.toggleDropdown():a.trigger==="click-hover"&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),g=C(t.onMouseEnter,()=>(a.trigger==="hover"||a.trigger==="click-hover")&&a.openDropdown()),p=C(t.onMouseLeave,()=>{(a.trigger==="hover"||a.trigger==="click-hover"&&!a.openedViaClick)&&a.closeDropdown()});return u.jsx(O.Target,{refProp:r,popupType:"menu",...i,children:c.cloneElement(s,{onClick:d,onMouseEnter:g,onMouseLeave:p,"data-expanded":a.opened?!0:void 0})})}le.displayName="@mantine/core/MenuTarget";const Oe={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1},N=K(n=>{const e=k("Menu",Oe,n),{children:r,onOpen:i,onClose:s,opened:a,defaultOpened:t,trapFocus:d,onChange:g,closeOnItemClick:p,loop:w,closeOnEscape:b,trigger:v,openDelay:f,closeDelay:y,classNames:o,styles:l,unstyled:m,variant:T,vars:E,menuItemTabIndex:x,keepMounted:M,withInitialFocusPlaceholder:S,attributes:D,...j}=e,I=he({name:"Menu",classes:R,props:e,classNames:o,styles:l,unstyled:m,attributes:D}),[h,L]=ve({value:a,defaultValue:t,finalValue:!1,onChange:g}),[ie,Y]=c.useState(!1),$=()=>{L(!1),Y(!1),h&&s?.()},H=()=>{L(!0),!h&&i?.()},Z=()=>{h?$():H()},{openDropdown:ce,closeDropdown:ue}=Ne({open:H,close:$,closeDelay:y,openDelay:f}),B=c.useRef(null),de=c.useCallback(F=>{const U=B.current;return U&&U!==F&&U(),B.current=F,()=>
1{B.current===F&&(B.current=null)}},[]),me=F=>Re("[data-menu-item]","[data-menu-dropdown]",F),{resolvedClassNames:pe,resolvedStyles:fe}=ye({classNames:o,styles:l,props:e});return u.jsx(Ee,{value:{getStyles:I,opened:h,toggleDropdown:Z,getItemIndex:me,openedViaClick:ie,setOpenedViaClick:Y,closeOnItemClick:p,closeDropdown:v==="click"?$:ue,openDropdown:v==="click"?H:ce,closeDropdownImmediately:$,loop:w,trigger:v,unstyled:m,menuItemTabIndex:x,withInitialFocusPlaceholder:S,registerOpenSub:de},children:u.jsx(O,{returnFocus:!0,...j,opened:h,onChange:Z,defaultOpened:t,trapFocus:M?!1:d,closeOnEscape:b,__staticSelector:"Menu",classNames:pe,styles:fe,unstyled:m,variant:T,keepMounted:M,children:r})})});N.displayName="@mantine/core/Menu";N.classes=R;N.Item=G;N.Label=Q;N.Dropdown=J;N.Target=le;N.Divider=z;N.Sub=_;export{N as M,C as c};

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.