@nice2dev/ui 1.4.0 → 1.4.2

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/NiceCodeEditor-DhdjnDLV.cjs +289 -0
  3. package/dist/{NiceDataGrid-BT6iCUgP.cjs → NiceDataGrid-CrKDzMM1.cjs} +1 -1
  4. package/dist/{NiceForm-Bysp66Ef.cjs → NiceForm-CT9hEXpc.cjs} +1 -1
  5. package/dist/NiceLoginForm-C2-WgRn0.cjs +1 -0
  6. package/dist/NiceMention-BZEHqPrf.cjs +432 -0
  7. package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +1 -0
  8. package/dist/{NiceSavedQueryPanel-BbznsXFd.cjs → NiceSavedQueryPanel-C5Ab_NWx.cjs} +1 -1
  9. package/dist/NiceScheduler-BZQAKEVF.cjs +5 -0
  10. package/dist/{NiceWindow-pgR4c-kQ.cjs → NiceWindow-BklnkBpu.cjs} +1 -1
  11. package/dist/charts/NiceLinearGauge.mjs +96 -83
  12. package/dist/charts/NicePolarChart.mjs +47 -47
  13. package/dist/charts-BzlvCCg9.cjs +768 -0
  14. package/dist/charts.cjs +1 -1
  15. package/dist/{core-lazy-CL4ZIxF-.cjs → core-lazy-VTd5zfoZ.cjs} +1 -1
  16. package/dist/data.cjs +1 -1
  17. package/dist/display/NiceAvatar.mjs +40 -24
  18. package/dist/editors/pickers/NiceDateRangeBox.mjs +92 -92
  19. package/dist/editors/pickers/NiceDateTimePicker.mjs +173 -173
  20. package/dist/editors/rich/NiceCodeEditor.mjs +645 -584
  21. package/dist/editors/rich/NiceDocumentEditor.mjs +277 -254
  22. package/dist/editors.cjs +1 -1
  23. package/dist/feedback/NiceDrawer.mjs +15 -15
  24. package/dist/feedback.cjs +1 -1
  25. package/dist/index.cjs +202 -202
  26. package/dist/index.d.ts +18 -0
  27. package/dist/lazy.cjs +1 -1
  28. package/dist/navigation/NiceNavShell.mjs +646 -593
  29. package/dist/navigation/NiceSidebarNav.mjs +844 -823
  30. package/dist/navigation.cjs +1 -1
  31. package/dist/overlays/NiceWindow.mjs +91 -91
  32. package/dist/overlays.cjs +1 -1
  33. package/dist/planning/NiceScheduler.mjs +170 -169
  34. package/dist/planning/NiceSchedulerViews.mjs +242 -233
  35. package/dist/style.css +2 -2
  36. package/dist/utility/intlNames.mjs +26 -16
  37. package/package.json +4 -4
  38. package/dist/NiceCodeEditor-D0QZW88r.cjs +0 -268
  39. package/dist/NiceLoginForm-FGf32sro.cjs +0 -1
  40. package/dist/NiceMention-sc8W-DwH.cjs +0 -430
  41. package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +0 -1
  42. package/dist/NiceScheduler-3Ez0zSQJ.cjs +0 -5
  43. package/dist/charts-B0tHOpJ7.cjs +0 -768
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NiceModuleLifecyclePanel-DBQPCa_V.cjs"),e=require("react/jsx-runtime"),i=require("@nice2dev/ui-core"),a=require("react"),z=require("./pickerCommons-CwcCc8Qi.cjs"),K=require("./NicePagination-D7XxeNFz.cjs"),E=[],W=Object.assign(a.forwardRef(({items:p=E,activeKey:f,collapsed:l=!1,width:x=240,collapsedWidth:d=52,onItemClick:y,onCollapseChange:A,header:g,footer:b,size:_="md",className:R,style:I,id:S,accessMode:D,...C},m)=>{const j=i.useControlId(S),M=i.useNiceAccessMode(D,S),[k,h]=a.useState(new Set),c=a.useCallback(n=>{h(t=>{const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o})},[]);if(M==="hidden")return null;const u=(n,t=0)=>{const o=n.children&&n.children.length>0,r=k.has(n.key),N=n.key===f;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${N?"nice-sidebar-menu__btn--active":""} ${n.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:l?void 0:12+t*16},onClick:()=>o?c(n.key):y?.(n),disabled:n.disabled,title:l?n.text:void 0,type:"button",children:[n.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:n.icon}),!l&&e.jsx("span",{className:"nice-sidebar-menu__label",children:n.text}),!l&&n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:n.badge}),!l&&o&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:e.jsx(i.NiceIcon,{name:r?"chevron-down":"chevron-right",size:14})})]}),o&&r&&!l&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:n.children.map($=>u($,t+1))})]},n.key)};return e.jsxs("nav",{ref:m,id:j,className:`nice-sidebar-menu nice-sidebar-menu--${_} ${l?"nice-sidebar-menu--collapsed":""} ${R??""}`,style:{...I,width:l?d:x},...C,children:[g&&e.jsx("div",{className:"nice-sidebar-menu__header",children:g}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:p.map(n=>u(n))}),b&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:b})]})}),{displayName:"NiceSidebarMenu"}),q=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,brand:x,actions:d,size:y="md",className:A,style:g,id:b,accessMode:_,...R},I)=>{const S=i.useControlId(b),D=i.useNiceAccessMode(_,b),[C,m]=a.useState(null),[j,M]=a.useState(!1),k=a.useRef(null),h=a.useRef(null);i.useRovingFocus(k,{orientation:"horizontal",wrap:!0,typeahead:!0}),i.useRovingFocus(h,{orientation:"vertical",wrap:!0,typeahead:!0}),i.useOverlayFocus(h,{open:C!=null&&!j,modal:!1,onClose:()=>m(null)});const c=n=>{M(!1),m(n)},u=n=>{if(n.key!=="ArrowLeft"&&n.key!=="ArrowRight")return;n.preventDefault();const t=[...k.current?.querySelectorAll(".nice-top-menu__btn")??[]],o=t.findIndex(N=>N.getAttribute("aria-expanded")==="true"),r=t[(o+(n.key==="ArrowRight"?1:-1)+t.length)%t.length];m(null),r?.focus()};return D==="hidden"?null:e.jsxs("nav",{ref:I,id:S,className:`nice-top-menu nice-top-menu--${y} ${A??""}`,style:g,...R,children:[x&&e.jsx("div",{className:"nice-top-menu__brand",children:x}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",ref:k,children:p.map(n=>{const t=n.children&&n.children.length>0,o=C===n.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>{t&&(M(!0),m(n.key))},onMouseLeave:()=>t&&m(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${n.key===f?"nice-top-menu__btn--active":""}`,onClick:()=>t?o?m(null):c(n.key):l?.(n),onKeyDown:r=>{const N=r.nativeEvent.niceSource;t&&r.key==="ArrowDown"&&N!=="gamepad"&&(r.preventDefault(),c(n.key))},role:"menuitem","aria-haspopup":t,"aria-expanded":o,disabled:n.disabled,type:"button",children:[n.icon&&e.jsx("span",{children:n.icon}),e.jsx("span",{children:n.text}),t&&e.jsx("span",{className:"nice-top-menu__chevron",children:e.jsx(i.NiceIcon,{name:"chevron-down",size:14})})]}),t&&o&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",ref:h,onKeyDown:u,children:n.children.map(r=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${r.key===f?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{l?.(r),m(null)},disabled:r.disabled,role:"menuitem",type:"button",children:[r.icon&&e.jsx("span",{children:r.icon}),e.jsx("span",{children:r.text}),r.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:r.badge})]})},r.key))})]},n.key)})}),d&&e.jsx("div",{className:"nice-top-menu__actions",children:d})]})}),{displayName:"NiceTopMenu"}),U=[],H=Object.assign(a.forwardRef(({tabs:p=U,activeTab:f,onTabChange:l,onItemClick:x,minimized:d=!1,onMinimizeToggle:y,size:A="md",className:g,style:b,id:_,accessMode:R,...I},S)=>{const D=a.useRef(null);i.useRovingFocus(D,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const C=i.useControlId(_),m=i.useNiceAccessMode(R,_),{t:j}=i.useNiceTranslation(),[M,k]=a.useState(void 0),h=f??M??p[0]?.key,c=p.find(n=>n.key===h),u=a.useCallback(n=>{k(n),l?.(n)},[l]);return m==="hidden"?null:e.jsxs("div",{ref:S,id:C,className:`nice-ribbon-menu nice-ribbon-menu--${A} ${d?"nice-ribbon-menu--minimized":""} ${g??""}`,style:b,...I,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",ref:D,role:"tablist",children:[p.map(n=>e.jsx("button",{className:`nice-ribbon-menu__tab ${n.key===h?"nice-ribbon-menu__tab--active":""}`,onClick:()=>u(n.key),role:"tab","aria-selected":n.key===h,type:"button",children:n.label},n.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>y?.(!d),type:"button","aria-label":d?j("nav.expand","Expand"):j("nav.collapse","Collapse"),children:e.jsx(i.NiceIcon,{name:d?"chevron-down":"chevron-up",size:14})})]}),!d&&c&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:c.groups.map((n,t)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:n.items.map(o=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>x?.(o),disabled:o.disabled,type:"button",children:[o.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:o.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:o.text})]},o.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:n.label})]},t))})]})}),{displayName:"NiceRibbonMenu"}),V=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,position:x="bottom",autoHide:d=!1,iconSize:y=40,size:A="md",className:g,style:b,id:_,accessMode:R,...I},S)=>{const D=i.useControlId(_),C=i.useNiceAccessMode(R,_),[m,j]=a.useState(!1),[M,k]=a.useState(!1),h=!d||m||M;return C==="hidden"?null:e.jsx("div",{ref:S,id:D,className:`nice-dock-menu nice-dock-menu--${x} nice-dock-menu--${A} ${d&&!h?"nice-dock-menu--hidden":""} ${g??""}`,style:b,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),onFocus:()=>k(!0),onBlur:c=>{c.currentTarget.contains(c.relatedTarget)||k(!1)},...I,children:e.jsx("div",{className:"nice-dock-menu__items",children:p.map(c=>e.jsxs("button",{className:`nice-dock-menu__item ${c.key===f?"nice-dock-menu__item--active":""}`,onClick:()=>l?.(c),disabled:c.disabled,title:c.text,"aria-label":c.text,type:"button",style:{width:y,height:y},children:[c.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:c.icon}):e.jsx("span",{children:c.text[0]}),c.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:c.badge})]},c.key))})})}),{displayName:"NiceDockMenu"}),Y=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,open:x,onOpenChange:d,position:y="left",panelWidth:A=280,header:g,footer:b,size:_="md",className:R,style:I,id:S,accessMode:D,...C},m)=>{const j=i.useControlId(S),M=i.useNiceAccessMode(D,S),{t:k}=i.useNiceTranslation(),[h,c]=a.useState(!1),u=x??h,n=a.useCallback(v=>{c(v),d?.(v)},[d]),t=a.useCallback(()=>n(!u),[u,n]),o=a.useCallback(v=>{l?.(v),n(!1)},[l,n]),r=a.useRef(null),N=a.useRef(null),$=a.useRef(null);return a.useLayoutEffect(()=>{$.current?.toggleAttribute("inert",!u)},[u]),i.useMenuButton(r,N,{open:u,onOpenChange:n,closeOnFocusOut:!1,closeOnOutsidePress:!1}),M==="hidden"?null:e.jsxs("div",{ref:m,id:j,className:`nice-hamburger-menu nice-hamburger-menu--${_} ${R??""}`,style:I,...C,children:[e.jsx("button",{ref:r,className:"nice-hamburger-menu__trigger",onClick:t,"aria-label":k("nav.menu","Menu"),"aria-haspopup":"menu","aria-expanded":u,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${u?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),u&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:t,"aria-hidden":!0}),e.jsxs("div",{ref:$,className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${y} ${u?"nice-hamburger-menu__panel--open":""}`,style:{width:A},children:[g&&e.jsx("div",{className:"nice-hamburger-menu__header",children:g}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",ref:N,children:p.map(v=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${v.key===f?"nice-hamburger-menu__item--active":""}`,onClick:()=>o(v),disabled:v.disabled,role:"menuitem",type:"button",children:[v.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:v.icon}),e.jsx("span",{children:v.text}),v.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:v.badge})]})},v.key))}),b&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:b})]})]})}),{displayName:"NiceHamburgerMenu"}),J=Object.assign(a.forwardRef(({canGoBack:p=!1,canGoForward:f=!1,onBack:l,onForward:x,onRefresh:d,enableShortcuts:y=!0,showRefresh:A=!0,showStop:g=!0,isLoading:b=!1,onStop:_,size:R="md",variant:I="default",tooltipPosition:S="bottom",backIcon:D,forwardIcon:C,refreshIcon:m,stopIcon:j,className:M,style:k,id:h,accessMode:c,disabled:u,...n},t)=>{const o=i.useControlId(h),r=i.useNiceAccessMode(c,h),{t:N}=i.useNiceTranslation();if(a.useEffect(()=>{if(!y||u)return;const T=w=>{const O=w.altKey,B=w.ctrlKey||w.metaKey;O&&w.key==="ArrowLeft"?(w.preventDefault(),p&&l?.()):O&&w.key==="ArrowRight"?(w.preventDefault(),f&&x?.()):w.key==="F5"||B&&w.key==="r"?(w.preventDefault(),b?_?.():d?.()):w.key==="Escape"&&b&&(w.preventDefault(),_?.())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[y,u,p,f,b,l,x,d,_]),r==="hidden")return null;const $=r==="disabled"||u,v=D??e.jsx(i.NiceIcon,{name:"chevron-left",size:16}),F=C??e.jsx(i.NiceIcon,{name:"chevron-right",size:16}),L=m??e.jsx(i.NiceIcon,{name:"refresh",size:16}),P=j??e.jsx(i.NiceIcon,{name:"close",size:16});return e.jsxs("div",{ref:t,id:o,className:`nice-nav-controls nice-nav-controls--${R} nice-nav-controls--${I}${$?" nice-nav-controls--disabled":""}${M?` ${M}`:""}`,style:k,role:"navigation","aria-label":N("nav.controls","Navigation controls"),...n,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${p?"":" nice-nav-controls__btn--disabled"}`,onClick:l,disabled:$||!p,"aria-label":N("nav.back","Back"),title:`${N("nav.back","Back")} (Alt+←)`,children:v}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${f?"":" nice-nav-controls__btn--disabled"}`,onClick:x,disabled:$||!f,"aria-label":N("nav.forward","Forward"),title:`${N("nav.forward","Forward")} (Alt+→)`,children:F}),(A||g&&b)&&(b?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:_,disabled:$,"aria-label":N("nav.stop","Stop"),title:`${N("nav.stop","Stop")} (Esc)`,children:P}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:d,disabled:$,"aria-label":N("nav.refresh","Refresh"),title:`${N("nav.refresh","Refresh")} (F5)`,children:L}))]})}),{displayName:"NiceNavigationControls"});exports.DEFAULT_SIDEBAR_PREFS=s.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=s.DesktopContextMenu;exports.DesktopGrid=s.DesktopGrid;exports.DesktopStartMenu=s.DesktopStartMenu;exports.DesktopSystemTray=s.DesktopSystemTray;exports.DesktopTaskbar=s.DesktopTaskbar;exports.NiceAccordion=s.NiceAccordion;exports.NiceAppLayout=s.NiceAppLayout;exports.NiceAuthButtons=s.NiceAuthButtons;exports.NiceBreadcrumb=s.NiceBreadcrumb;exports.NiceCard=s.NiceCard;exports.NiceConsole=s.NiceConsole;exports.NiceContextMenu=s.NiceContextMenu;exports.NiceDashboardLayout=s.NiceDashboardLayout;exports.NiceDashboardShell=s.NiceDashboardShell;exports.NiceDesktop=s.NiceDesktop;exports.NiceDock=s.NiceDock;exports.NiceDynamicSidebar=s.NiceDynamicSidebar;exports.NiceHybridShell=s.NiceHybridShell;exports.NiceKioskShell=s.NiceKioskShell;exports.NiceMdiWorkspace=s.NiceMdiWorkspace;exports.NiceMenu=s.NiceMenu;exports.NiceMinimalShell=s.NiceMinimalShell;exports.NiceModeSelector=s.NiceModeSelector;exports.NiceModernShell=s.NiceModernShell;exports.NiceModuleLifecyclePanel=s.NiceModuleLifecyclePanel;exports.NiceNavMenu=s.NiceNavMenu;exports.NiceNavbar=s.NiceNavbar;exports.NiceOrganizationProfileForm=s.NiceOrganizationProfileForm;exports.NicePwaShell=s.NicePwaShell;exports.NiceSetupWizard=s.NiceSetupWizard;exports.NiceSidebarNav=s.NiceSidebarNav;exports.NiceSplitter=s.NiceSplitter;exports.NiceUserMenu=s.NiceUserMenu;exports.NiceWizard=s.NiceWizard;exports.SIDEBAR_DEFAULT_FAVORITE_LIST=s.SIDEBAR_DEFAULT_FAVORITE_LIST;exports.SIDEBAR_MODE_META=s.SIDEBAR_MODE_META;exports.findSidebarItemByRoute=s.findSidebarItemByRoute;exports.mapSidebarViews=s.mapSidebarViews;exports.sidebarModeLabel=s.sidebarModeLabel;exports.walkSidebarNav=s.walkSidebarNav;exports.NiceTabs=z.NiceTabs;exports.NicePagination=K.NicePagination;exports.NiceDockMenu=V;exports.NiceHamburgerMenu=Y;exports.NiceNavigationControls=J;exports.NiceRibbonMenu=H;exports.NiceSidebarMenu=W;exports.NiceTopMenu=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NiceModuleLifecyclePanel-DKlqKPy2.cjs"),e=require("react/jsx-runtime"),i=require("@nice2dev/ui-core"),a=require("react"),z=require("./pickerCommons-CwcCc8Qi.cjs"),K=require("./NicePagination-D7XxeNFz.cjs"),E=[],W=Object.assign(a.forwardRef(({items:p=E,activeKey:f,collapsed:l=!1,width:x=240,collapsedWidth:d=52,onItemClick:y,onCollapseChange:A,header:g,footer:b,size:_="md",className:R,style:I,id:S,accessMode:D,...C},m)=>{const j=i.useControlId(S),M=i.useNiceAccessMode(D,S),[k,h]=a.useState(new Set),c=a.useCallback(n=>{h(t=>{const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o})},[]);if(M==="hidden")return null;const u=(n,t=0)=>{const o=n.children&&n.children.length>0,r=k.has(n.key),N=n.key===f;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${N?"nice-sidebar-menu__btn--active":""} ${n.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:l?void 0:12+t*16},onClick:()=>o?c(n.key):y?.(n),disabled:n.disabled,title:l?n.text:void 0,type:"button",children:[n.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:n.icon}),!l&&e.jsx("span",{className:"nice-sidebar-menu__label",children:n.text}),!l&&n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:n.badge}),!l&&o&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:e.jsx(i.NiceIcon,{name:r?"chevron-down":"chevron-right",size:14})})]}),o&&r&&!l&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:n.children.map($=>u($,t+1))})]},n.key)};return e.jsxs("nav",{ref:m,id:j,className:`nice-sidebar-menu nice-sidebar-menu--${_} ${l?"nice-sidebar-menu--collapsed":""} ${R??""}`,style:{...I,width:l?d:x},...C,children:[g&&e.jsx("div",{className:"nice-sidebar-menu__header",children:g}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:p.map(n=>u(n))}),b&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:b})]})}),{displayName:"NiceSidebarMenu"}),q=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,brand:x,actions:d,size:y="md",className:A,style:g,id:b,accessMode:_,...R},I)=>{const S=i.useControlId(b),D=i.useNiceAccessMode(_,b),[C,m]=a.useState(null),[j,M]=a.useState(!1),k=a.useRef(null),h=a.useRef(null);i.useRovingFocus(k,{orientation:"horizontal",wrap:!0,typeahead:!0}),i.useRovingFocus(h,{orientation:"vertical",wrap:!0,typeahead:!0}),i.useOverlayFocus(h,{open:C!=null&&!j,modal:!1,onClose:()=>m(null)});const c=n=>{M(!1),m(n)},u=n=>{if(n.key!=="ArrowLeft"&&n.key!=="ArrowRight")return;n.preventDefault();const t=[...k.current?.querySelectorAll(".nice-top-menu__btn")??[]],o=t.findIndex(N=>N.getAttribute("aria-expanded")==="true"),r=t[(o+(n.key==="ArrowRight"?1:-1)+t.length)%t.length];m(null),r?.focus()};return D==="hidden"?null:e.jsxs("nav",{ref:I,id:S,className:`nice-top-menu nice-top-menu--${y} ${A??""}`,style:g,...R,children:[x&&e.jsx("div",{className:"nice-top-menu__brand",children:x}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",ref:k,children:p.map(n=>{const t=n.children&&n.children.length>0,o=C===n.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>{t&&(M(!0),m(n.key))},onMouseLeave:()=>t&&m(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${n.key===f?"nice-top-menu__btn--active":""}`,onClick:()=>t?o?m(null):c(n.key):l?.(n),onKeyDown:r=>{const N=r.nativeEvent.niceSource;t&&r.key==="ArrowDown"&&N!=="gamepad"&&(r.preventDefault(),c(n.key))},role:"menuitem","aria-haspopup":t,"aria-expanded":o,disabled:n.disabled,type:"button",children:[n.icon&&e.jsx("span",{children:n.icon}),e.jsx("span",{children:n.text}),t&&e.jsx("span",{className:"nice-top-menu__chevron",children:e.jsx(i.NiceIcon,{name:"chevron-down",size:14})})]}),t&&o&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",ref:h,onKeyDown:u,children:n.children.map(r=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${r.key===f?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{l?.(r),m(null)},disabled:r.disabled,role:"menuitem",type:"button",children:[r.icon&&e.jsx("span",{children:r.icon}),e.jsx("span",{children:r.text}),r.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:r.badge})]})},r.key))})]},n.key)})}),d&&e.jsx("div",{className:"nice-top-menu__actions",children:d})]})}),{displayName:"NiceTopMenu"}),U=[],H=Object.assign(a.forwardRef(({tabs:p=U,activeTab:f,onTabChange:l,onItemClick:x,minimized:d=!1,onMinimizeToggle:y,size:A="md",className:g,style:b,id:_,accessMode:R,...I},S)=>{const D=a.useRef(null);i.useRovingFocus(D,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const C=i.useControlId(_),m=i.useNiceAccessMode(R,_),{t:j}=i.useNiceTranslation(),[M,k]=a.useState(void 0),h=f??M??p[0]?.key,c=p.find(n=>n.key===h),u=a.useCallback(n=>{k(n),l?.(n)},[l]);return m==="hidden"?null:e.jsxs("div",{ref:S,id:C,className:`nice-ribbon-menu nice-ribbon-menu--${A} ${d?"nice-ribbon-menu--minimized":""} ${g??""}`,style:b,...I,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",ref:D,role:"tablist",children:[p.map(n=>e.jsx("button",{className:`nice-ribbon-menu__tab ${n.key===h?"nice-ribbon-menu__tab--active":""}`,onClick:()=>u(n.key),role:"tab","aria-selected":n.key===h,type:"button",children:n.label},n.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>y?.(!d),type:"button","aria-label":d?j("nav.expand","Expand"):j("nav.collapse","Collapse"),children:e.jsx(i.NiceIcon,{name:d?"chevron-down":"chevron-up",size:14})})]}),!d&&c&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:c.groups.map((n,t)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:n.items.map(o=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>x?.(o),disabled:o.disabled,type:"button",children:[o.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:o.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:o.text})]},o.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:n.label})]},t))})]})}),{displayName:"NiceRibbonMenu"}),V=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,position:x="bottom",autoHide:d=!1,iconSize:y=40,size:A="md",className:g,style:b,id:_,accessMode:R,...I},S)=>{const D=i.useControlId(_),C=i.useNiceAccessMode(R,_),[m,j]=a.useState(!1),[M,k]=a.useState(!1),h=!d||m||M;return C==="hidden"?null:e.jsx("div",{ref:S,id:D,className:`nice-dock-menu nice-dock-menu--${x} nice-dock-menu--${A} ${d&&!h?"nice-dock-menu--hidden":""} ${g??""}`,style:b,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),onFocus:()=>k(!0),onBlur:c=>{c.currentTarget.contains(c.relatedTarget)||k(!1)},...I,children:e.jsx("div",{className:"nice-dock-menu__items",children:p.map(c=>e.jsxs("button",{className:`nice-dock-menu__item ${c.key===f?"nice-dock-menu__item--active":""}`,onClick:()=>l?.(c),disabled:c.disabled,title:c.text,"aria-label":c.text,type:"button",style:{width:y,height:y},children:[c.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:c.icon}):e.jsx("span",{children:c.text[0]}),c.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:c.badge})]},c.key))})})}),{displayName:"NiceDockMenu"}),Y=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,open:x,onOpenChange:d,position:y="left",panelWidth:A=280,header:g,footer:b,size:_="md",className:R,style:I,id:S,accessMode:D,...C},m)=>{const j=i.useControlId(S),M=i.useNiceAccessMode(D,S),{t:k}=i.useNiceTranslation(),[h,c]=a.useState(!1),u=x??h,n=a.useCallback(v=>{c(v),d?.(v)},[d]),t=a.useCallback(()=>n(!u),[u,n]),o=a.useCallback(v=>{l?.(v),n(!1)},[l,n]),r=a.useRef(null),N=a.useRef(null),$=a.useRef(null);return a.useLayoutEffect(()=>{$.current?.toggleAttribute("inert",!u)},[u]),i.useMenuButton(r,N,{open:u,onOpenChange:n,closeOnFocusOut:!1,closeOnOutsidePress:!1}),M==="hidden"?null:e.jsxs("div",{ref:m,id:j,className:`nice-hamburger-menu nice-hamburger-menu--${_} ${R??""}`,style:I,...C,children:[e.jsx("button",{ref:r,className:"nice-hamburger-menu__trigger",onClick:t,"aria-label":k("nav.menu","Menu"),"aria-haspopup":"menu","aria-expanded":u,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${u?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),u&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:t,"aria-hidden":!0}),e.jsxs("div",{ref:$,className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${y} ${u?"nice-hamburger-menu__panel--open":""}`,style:{width:A},children:[g&&e.jsx("div",{className:"nice-hamburger-menu__header",children:g}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",ref:N,children:p.map(v=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${v.key===f?"nice-hamburger-menu__item--active":""}`,onClick:()=>o(v),disabled:v.disabled,role:"menuitem",type:"button",children:[v.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:v.icon}),e.jsx("span",{children:v.text}),v.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:v.badge})]})},v.key))}),b&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:b})]})]})}),{displayName:"NiceHamburgerMenu"}),J=Object.assign(a.forwardRef(({canGoBack:p=!1,canGoForward:f=!1,onBack:l,onForward:x,onRefresh:d,enableShortcuts:y=!0,showRefresh:A=!0,showStop:g=!0,isLoading:b=!1,onStop:_,size:R="md",variant:I="default",tooltipPosition:S="bottom",backIcon:D,forwardIcon:C,refreshIcon:m,stopIcon:j,className:M,style:k,id:h,accessMode:c,disabled:u,...n},t)=>{const o=i.useControlId(h),r=i.useNiceAccessMode(c,h),{t:N}=i.useNiceTranslation();if(a.useEffect(()=>{if(!y||u)return;const T=w=>{const O=w.altKey,B=w.ctrlKey||w.metaKey;O&&w.key==="ArrowLeft"?(w.preventDefault(),p&&l?.()):O&&w.key==="ArrowRight"?(w.preventDefault(),f&&x?.()):w.key==="F5"||B&&w.key==="r"?(w.preventDefault(),b?_?.():d?.()):w.key==="Escape"&&b&&(w.preventDefault(),_?.())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[y,u,p,f,b,l,x,d,_]),r==="hidden")return null;const $=r==="disabled"||u,v=D??e.jsx(i.NiceIcon,{name:"chevron-left",size:16}),F=C??e.jsx(i.NiceIcon,{name:"chevron-right",size:16}),L=m??e.jsx(i.NiceIcon,{name:"refresh",size:16}),P=j??e.jsx(i.NiceIcon,{name:"close",size:16});return e.jsxs("div",{ref:t,id:o,className:`nice-nav-controls nice-nav-controls--${R} nice-nav-controls--${I}${$?" nice-nav-controls--disabled":""}${M?` ${M}`:""}`,style:k,role:"navigation","aria-label":N("nav.controls","Navigation controls"),...n,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${p?"":" nice-nav-controls__btn--disabled"}`,onClick:l,disabled:$||!p,"aria-label":N("nav.back","Back"),title:`${N("nav.back","Back")} (Alt+←)`,children:v}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${f?"":" nice-nav-controls__btn--disabled"}`,onClick:x,disabled:$||!f,"aria-label":N("nav.forward","Forward"),title:`${N("nav.forward","Forward")} (Alt+→)`,children:F}),(A||g&&b)&&(b?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:_,disabled:$,"aria-label":N("nav.stop","Stop"),title:`${N("nav.stop","Stop")} (Esc)`,children:P}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:d,disabled:$,"aria-label":N("nav.refresh","Refresh"),title:`${N("nav.refresh","Refresh")} (F5)`,children:L}))]})}),{displayName:"NiceNavigationControls"});exports.DEFAULT_SIDEBAR_PREFS=s.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=s.DesktopContextMenu;exports.DesktopGrid=s.DesktopGrid;exports.DesktopStartMenu=s.DesktopStartMenu;exports.DesktopSystemTray=s.DesktopSystemTray;exports.DesktopTaskbar=s.DesktopTaskbar;exports.NiceAccordion=s.NiceAccordion;exports.NiceAppLayout=s.NiceAppLayout;exports.NiceAuthButtons=s.NiceAuthButtons;exports.NiceBreadcrumb=s.NiceBreadcrumb;exports.NiceCard=s.NiceCard;exports.NiceConsole=s.NiceConsole;exports.NiceContextMenu=s.NiceContextMenu;exports.NiceDashboardLayout=s.NiceDashboardLayout;exports.NiceDashboardShell=s.NiceDashboardShell;exports.NiceDesktop=s.NiceDesktop;exports.NiceDock=s.NiceDock;exports.NiceDynamicSidebar=s.NiceDynamicSidebar;exports.NiceHybridShell=s.NiceHybridShell;exports.NiceKioskShell=s.NiceKioskShell;exports.NiceMdiWorkspace=s.NiceMdiWorkspace;exports.NiceMenu=s.NiceMenu;exports.NiceMinimalShell=s.NiceMinimalShell;exports.NiceModeSelector=s.NiceModeSelector;exports.NiceModernShell=s.NiceModernShell;exports.NiceModuleLifecyclePanel=s.NiceModuleLifecyclePanel;exports.NiceNavMenu=s.NiceNavMenu;exports.NiceNavbar=s.NiceNavbar;exports.NiceOrganizationProfileForm=s.NiceOrganizationProfileForm;exports.NicePwaShell=s.NicePwaShell;exports.NiceSetupWizard=s.NiceSetupWizard;exports.NiceSidebarNav=s.NiceSidebarNav;exports.NiceSplitter=s.NiceSplitter;exports.NiceUserMenu=s.NiceUserMenu;exports.NiceWizard=s.NiceWizard;exports.SIDEBAR_DEFAULT_FAVORITE_LIST=s.SIDEBAR_DEFAULT_FAVORITE_LIST;exports.SIDEBAR_MODE_META=s.SIDEBAR_MODE_META;exports.findSidebarItemByRoute=s.findSidebarItemByRoute;exports.mapSidebarViews=s.mapSidebarViews;exports.sidebarModeLabel=s.sidebarModeLabel;exports.walkSidebarNav=s.walkSidebarNav;exports.NiceTabs=z.NiceTabs;exports.NicePagination=K.NicePagination;exports.NiceDockMenu=V;exports.NiceHamburgerMenu=Y;exports.NiceNavigationControls=J;exports.NiceRibbonMenu=H;exports.NiceSidebarMenu=W;exports.NiceTopMenu=q;
@@ -1,11 +1,11 @@
1
- import { jsxs as V, jsx as i, Fragment as rn } from "react/jsx-runtime";
2
- import { useControlId as cn, useNiceAccessMode as sn, useNiceTranslation as dn, NiceIcon as R } from "@nice2dev/ui-core";
3
- import { forwardRef as un, useRef as j, useState as v, useCallback as l, useEffect as Z } from "react";
4
- function ln(z, M, C, K, x) {
5
- const S = z <= x, X = z + x >= C, b = M <= x, Y = M + x >= K;
1
+ import { jsxs as V, jsx as i, Fragment as cn } from "react/jsx-runtime";
2
+ import { useControlId as dn, useNiceAccessMode as un, useNiceTranslation as ln, NiceIcon as R } from "@nice2dev/ui-core";
3
+ import { forwardRef as an, useRef as j, useState as x, useCallback as l, useEffect as Z } from "react";
4
+ function wn(z, M, C, K, _) {
5
+ const S = z <= _, X = z + _ >= C, b = M <= _, Y = M + _ >= K;
6
6
  return b && S ? "top-left" : b && X ? "top-right" : Y && S ? "bottom-left" : Y && X ? "bottom-right" : S ? "left" : X ? "right" : b ? "top" : Y ? "bottom" : "none";
7
7
  }
8
- function an(z) {
8
+ function hn(z) {
9
9
  switch (z) {
10
10
  case "left":
11
11
  return { left: 0, top: 0, width: "50%", height: "100%" };
@@ -27,75 +27,75 @@ function an(z) {
27
27
  return null;
28
28
  }
29
29
  }
30
- const fn = /* @__PURE__ */ Object.assign(
31
- /* @__PURE__ */ un(
30
+ const gn = /* @__PURE__ */ Object.assign(
31
+ /* @__PURE__ */ an(
32
32
  ({
33
33
  windowKey: z,
34
34
  title: M,
35
35
  icon: C,
36
36
  children: K,
37
- footer: x,
37
+ footer: _,
38
38
  x: S,
39
39
  y: X,
40
40
  defaultPosition: b,
41
41
  width: Y = 480,
42
- height: we = 360,
43
- minWidth: he = 200,
44
- minHeight: me = 120,
42
+ height: he = 360,
43
+ minWidth: me = 200,
44
+ minHeight: fe = 120,
45
45
  maxWidth: B,
46
46
  maxHeight: ee,
47
47
  zIndex: U = 1,
48
- closable: fe = !0,
49
- minimizable: pe = !0,
48
+ closable: pe = !0,
49
+ minimizable: ge = !0,
50
50
  maximizable: O = !0,
51
- fullscreenable: ge = !1,
52
- pinnable: xe = !1,
51
+ fullscreenable: xe = !1,
52
+ pinnable: _e = !1,
53
53
  resizable: P = !0,
54
54
  draggable: ne = !0,
55
- snappable: _e = !0,
56
- snapThreshold: ye = 20,
57
- minimized: ve,
58
- maximized: ze,
59
- fullscreen: Me,
60
- pinned: be,
61
- focused: Ne,
55
+ snappable: ye = !0,
56
+ snapThreshold: ve = 20,
57
+ minimized: ze,
58
+ maximized: Me,
59
+ fullscreen: be,
60
+ pinned: Ne,
61
+ focused: Ee,
62
62
  onClose: te,
63
63
  onMinimize: ie,
64
64
  onMaximize: oe,
65
65
  onFullscreen: re,
66
- onPin: ce,
67
- onFocus: se,
68
- onMove: Ee,
69
- onResize: Ie,
70
- onSnap: Se,
66
+ onPin: se,
67
+ onFocus: ce,
68
+ onMove: Ie,
69
+ onResize: Se,
70
+ onSnap: Xe,
71
71
  onTitleBarDoubleClick: T,
72
- size: Xe = "md",
72
+ size: Ye = "md",
73
73
  statusBar: de,
74
- titleBarActions: Ye,
75
- className: Le,
76
- style: $e,
74
+ titleBarActions: Le,
75
+ className: $e,
76
+ style: ke,
77
77
  id: ue,
78
- accessMode: ke,
79
- ...Re
80
- }, Ce) => {
81
- const Fe = cn(ue), De = sn(ke, ue), { t: a } = dn(), A = j(null);
78
+ accessMode: Re,
79
+ ...Ce
80
+ }, De) => {
81
+ const Fe = dn(ue), We = un(Re, ue), { t: a } = ln(), A = j(null);
82
82
  A.current == null && (A.current = `nice-window-${Math.random().toString(36).slice(2, 10)}`);
83
- const t = z ?? A.current, We = S ?? b?.x ?? 100, He = X ?? b?.y ?? 100, [F, N] = v({ x: We, y: He }), [D, W] = v({ width: Y, height: we }), [je, Ke] = v(!1), [Ue, Oe] = v(!1), [Pe, Te] = v(!1), [Ae, qe] = v(!1), [d, q] = v("none"), Ge = ve ?? je, s = ze ?? Ue, r = Me ?? Pe, L = be ?? Ae, H = Ne ?? !0, _ = F.x, y = F.y, w = D.width, h = D.height, m = j(null), c = j(null), n = j(null), Je = l(() => {
83
+ const t = z ?? A.current, He = S ?? b?.x ?? 100, je = X ?? b?.y ?? 100, [D, N] = x({ x: He, y: je }), [F, W] = x({ width: Y, height: he }), [Ke, Ue] = x(!1), [Oe, Pe] = x(!1), [Te, Ae] = x(!1), [qe, Ge] = x(!1), [d, q] = x("none"), Je = ze ?? Ke, c = Me ?? Oe, r = be ?? Te, L = Ne ?? qe, H = Ee ?? !0, y = D.x, v = D.y, w = F.width, h = F.height, m = j(null), s = j(null), n = j(null), [Qe, le] = x(!1), Ve = l(() => {
84
84
  te?.(t);
85
- }, [t, te]), Qe = l(() => {
86
- Ke(!0), ie?.(t);
85
+ }, [t, te]), Ze = l(() => {
86
+ Ue(!0), ie?.(t);
87
87
  }, [t, ie]), G = l(() => {
88
- const e = !s;
89
- Oe(e), !e && n.current ? (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h }), n.current = null) : e && (n.current = { x: _, y, w, h }), q("none"), oe?.(t, e);
90
- }, [t, s, _, y, w, h, oe]), J = l(() => {
88
+ const e = !c;
89
+ Pe(e), !e && n.current ? (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h }), n.current = null) : e && (n.current = { x: y, y: v, w, h }), q("none"), oe?.(t, e);
90
+ }, [t, c, y, v, w, h, oe]), J = l(() => {
91
91
  const e = !r;
92
- Te(e), e ? n.current = { x: _, y, w, h } : n.current && (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h }), n.current = null), re?.(t, e);
93
- }, [t, r, _, y, w, h, re]), Ve = l(() => {
92
+ Ae(e), e ? n.current = { x: y, y: v, w, h } : n.current && (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h }), n.current = null), re?.(t, e);
93
+ }, [t, r, y, v, w, h, re]), Be = l(() => {
94
94
  const e = !L;
95
- qe(e), ce?.(t, e);
96
- }, [t, L, ce]), E = l(() => {
97
- se?.(t);
98
- }, [t, se]), Ze = l(() => {
95
+ Ge(e), se?.(t, e);
96
+ }, [t, L, se]), E = l(() => {
97
+ ce?.(t);
98
+ }, [t, ce]), en = l(() => {
99
99
  T ? T(t) : O && G();
100
100
  }, [t, O, G, T]);
101
101
  Z(() => {
@@ -103,59 +103,59 @@ const fn = /* @__PURE__ */ Object.assign(
103
103
  if (!m.current)
104
104
  return;
105
105
  const u = f.clientX - m.current.startX + m.current.origX, $ = f.clientY - m.current.startY + m.current.origY;
106
- N({ x: u, y: $ }), Ee?.(t, { x: u, y: $ });
106
+ N({ x: u, y: $ }), Ie?.(t, { x: u, y: $ });
107
107
  }, o = (f) => {
108
108
  if (m.current) {
109
- if (_e) {
110
- const u = ln(
109
+ if (ye) {
110
+ const u = wn(
111
111
  f.clientX,
112
112
  f.clientY,
113
113
  window.innerWidth,
114
114
  window.innerHeight,
115
- ye
115
+ ve
116
116
  );
117
- u !== "none" && (n.current = { x: F.x, y: F.y, w, h }, q(u), Se?.(t, u));
117
+ u !== "none" && (n.current = { x: D.x, y: D.y, w, h }, q(u), Xe?.(t, u));
118
118
  }
119
- m.current = null;
119
+ m.current = null, le(!1);
120
120
  }
121
121
  };
122
122
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", o), () => {
123
123
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", o);
124
124
  };
125
125
  });
126
- const Be = l(
126
+ const nn = l(
127
127
  (e) => {
128
- !ne || s || r || (e.preventDefault(), d !== "none" && (n.current && (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h })), q("none")), E(), m.current = { startX: e.clientX, startY: e.clientY, origX: _, origY: y });
128
+ !ne || c || r || (e.preventDefault(), d !== "none" && (n.current && (N({ x: n.current.x, y: n.current.y }), W({ width: n.current.w, height: n.current.h })), q("none")), E(), m.current = { startX: e.clientX, startY: e.clientY, origX: y, origY: v }, le(!0));
129
129
  },
130
- [ne, s, r, d, _, y, E]
130
+ [ne, c, r, d, y, v, E]
131
131
  );
132
132
  Z(() => {
133
133
  const e = (f) => {
134
- if (!c.current)
134
+ if (!s.current)
135
135
  return;
136
- const u = f.clientX - c.current.startX, $ = f.clientY - c.current.startY, I = c.current.handle;
137
- let p = c.current.origW, g = c.current.origH;
138
- if (I.includes("e") && (p = c.current.origW + u), I.includes("w") && (p = c.current.origW - u), I.includes("s") && (g = c.current.origH + $), I.includes("n") && (g = c.current.origH - $), p = Math.max(he, B ? Math.min(B, p) : p), g = Math.max(me, ee ? Math.min(ee, g) : g), I.includes("w")) {
139
- const Q = D.width - p;
136
+ const u = f.clientX - s.current.startX, $ = f.clientY - s.current.startY, I = s.current.handle;
137
+ let p = s.current.origW, g = s.current.origH;
138
+ if (I.includes("e") && (p = s.current.origW + u), I.includes("w") && (p = s.current.origW - u), I.includes("s") && (g = s.current.origH + $), I.includes("n") && (g = s.current.origH - $), p = Math.max(me, B ? Math.min(B, p) : p), g = Math.max(fe, ee ? Math.min(ee, g) : g), I.includes("w")) {
139
+ const Q = F.width - p;
140
140
  N((k) => ({ ...k, x: k.x + Q }));
141
141
  }
142
142
  if (I.includes("n")) {
143
- const Q = D.height - g;
143
+ const Q = F.height - g;
144
144
  N((k) => ({ ...k, y: k.y + Q }));
145
145
  }
146
- W({ width: p, height: g }), Ie?.(t, { width: p, height: g });
146
+ W({ width: p, height: g }), Se?.(t, { width: p, height: g });
147
147
  }, o = () => {
148
- c.current = null;
148
+ s.current = null;
149
149
  };
150
150
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", o), () => {
151
151
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", o);
152
152
  };
153
153
  });
154
- const en = l(
154
+ const tn = l(
155
155
  (e, o) => {
156
- !P || s || r || d !== "none" || (o.preventDefault(), o.stopPropagation(), E(), c.current = { startX: o.clientX, startY: o.clientY, origW: w, origH: h, handle: e });
156
+ !P || c || r || d !== "none" || (o.preventDefault(), o.stopPropagation(), E(), s.current = { startX: o.clientX, startY: o.clientY, origW: w, origH: h, handle: e });
157
157
  },
158
- [P, s, r, d, w, h, E]
158
+ [P, c, r, d, w, h, E]
159
159
  );
160
160
  if (Z(() => {
161
161
  if (!H)
@@ -164,9 +164,9 @@ const fn = /* @__PURE__ */ Object.assign(
164
164
  o.key === "Escape" && r && J();
165
165
  };
166
166
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
167
- }, [H, r, J]), De === "hidden" || Ge)
167
+ }, [H, r, J]), We === "hidden" || Je)
168
168
  return null;
169
- const le = d !== "none" ? an(d) : null, ae = s || r, nn = r ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : s ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: U } : le ? { position: "absolute", ...le, zIndex: U } : { position: "absolute", top: y, left: _, width: w, height: h, zIndex: U }, tn = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], on = {
169
+ const ae = d !== "none" ? hn(d) : null, we = c || r, on = r ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : c ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: U } : ae ? { position: "absolute", ...ae, zIndex: U } : { position: "absolute", top: v, left: y, width: w, height: h, zIndex: U }, rn = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], sn = {
170
170
  n: "ns-resize",
171
171
  s: "ns-resize",
172
172
  e: "ew-resize",
@@ -181,10 +181,10 @@ const fn = /* @__PURE__ */ Object.assign(
181
181
  /* @__PURE__ */ V(
182
182
  "div",
183
183
  {
184
- ref: Ce,
184
+ ref: De,
185
185
  id: Fe,
186
- className: `nice-window nice-window--${Xe} ${H ? "nice-window--focused" : ""} ${L ? "nice-window--pinned" : ""} ${ae ? "nice-window--maximized" : ""} ${d !== "none" ? `nice-window--snapped-${d}` : ""} ${Le ?? ""}`,
187
- style: { ...nn, ...$e },
186
+ className: `nice-window nice-window--${Ye} ${H ? "nice-window--focused" : ""} ${L ? "nice-window--pinned" : ""} ${we ? "nice-window--maximized" : ""} ${Qe ? "nice-window--dragging" : ""} ${d !== "none" ? `nice-window--snapped-${d}` : ""} ${$e ?? ""}`,
187
+ style: { ...on, ...ke },
188
188
  onMouseDown: E,
189
189
  onFocus: H ? void 0 : E,
190
190
  role: "dialog",
@@ -192,35 +192,35 @@ const fn = /* @__PURE__ */ Object.assign(
192
192
  tabIndex: -1,
193
193
  "data-nice-focus-scope": "spatial",
194
194
  "data-nice-region": M,
195
- ...Re,
195
+ ...Ce,
196
196
  children: [
197
197
  /* @__PURE__ */ V(
198
198
  "div",
199
199
  {
200
200
  className: "nice-window__titlebar",
201
- onMouseDown: Be,
202
- onDoubleClick: Ze,
201
+ onMouseDown: nn,
202
+ onDoubleClick: en,
203
203
  children: [
204
204
  C && /* @__PURE__ */ i("span", { className: "nice-window__icon", children: C }),
205
205
  /* @__PURE__ */ i("span", { className: "nice-window__title", children: M }),
206
206
  /* @__PURE__ */ V("div", { className: "nice-window__actions", children: [
207
- Ye,
208
- xe && /* @__PURE__ */ i(
207
+ Le,
208
+ _e && /* @__PURE__ */ i(
209
209
  "button",
210
210
  {
211
211
  type: "button",
212
212
  className: `nice-window__action nice-window__action--pin ${L ? "nice-window__action--active" : ""}`,
213
- onClick: Ve,
213
+ onClick: Be,
214
214
  title: L ? a("window.unpin", "Unpin") : a("window.pin", "Pin"),
215
215
  children: /* @__PURE__ */ i(R, { name: "paperclip", size: 14 })
216
216
  }
217
217
  ),
218
- pe && /* @__PURE__ */ i(
218
+ ge && /* @__PURE__ */ i(
219
219
  "button",
220
220
  {
221
221
  type: "button",
222
222
  className: "nice-window__action nice-window__action--minimize",
223
- onClick: Qe,
223
+ onClick: Ze,
224
224
  title: a("window.minimize", "Minimize"),
225
225
  children: /* @__PURE__ */ i(R, { name: "minus", size: 14 })
226
226
  }
@@ -231,11 +231,11 @@ const fn = /* @__PURE__ */ Object.assign(
231
231
  type: "button",
232
232
  className: "nice-window__action nice-window__action--maximize",
233
233
  onClick: G,
234
- title: s ? a("window.restore", "Restore") : a("window.maximize", "Maximize"),
235
- children: /* @__PURE__ */ i(R, { name: s ? "copy" : "window", size: 14 })
234
+ title: c ? a("window.restore", "Restore") : a("window.maximize", "Maximize"),
235
+ children: /* @__PURE__ */ i(R, { name: c ? "copy" : "window", size: 14 })
236
236
  }
237
237
  ),
238
- ge && /* @__PURE__ */ i(
238
+ xe && /* @__PURE__ */ i(
239
239
  "button",
240
240
  {
241
241
  type: "button",
@@ -245,12 +245,12 @@ const fn = /* @__PURE__ */ Object.assign(
245
245
  children: /* @__PURE__ */ i(R, { name: r ? "collapse" : "expand", size: 14 })
246
246
  }
247
247
  ),
248
- fe && /* @__PURE__ */ i(
248
+ pe && /* @__PURE__ */ i(
249
249
  "button",
250
250
  {
251
251
  type: "button",
252
252
  className: "nice-window__action nice-window__action--close",
253
- onClick: Je,
253
+ onClick: Ve,
254
254
  title: a("window.close", "Close"),
255
255
  children: /* @__PURE__ */ i(R, { name: "close", size: 14 })
256
256
  }
@@ -260,14 +260,14 @@ const fn = /* @__PURE__ */ Object.assign(
260
260
  }
261
261
  ),
262
262
  /* @__PURE__ */ i("div", { className: "nice-window__body", children: K }),
263
- x && /* @__PURE__ */ i("div", { className: "nice-window__footer", children: x }),
263
+ _ && /* @__PURE__ */ i("div", { className: "nice-window__footer", children: _ }),
264
264
  de && /* @__PURE__ */ i("div", { className: "nice-window__statusbar", children: de }),
265
- P && !ae && d === "none" && /* @__PURE__ */ i(rn, { children: tn.map((e) => /* @__PURE__ */ i(
265
+ P && !we && d === "none" && /* @__PURE__ */ i(cn, { children: rn.map((e) => /* @__PURE__ */ i(
266
266
  "div",
267
267
  {
268
268
  className: `nice-window__resize nice-window__resize--${e}`,
269
- style: { cursor: on[e] },
270
- onMouseDown: (o) => en(e, o)
269
+ style: { cursor: sn[e] },
270
+ onMouseDown: (o) => tn(e, o)
271
271
  },
272
272
  e
273
273
  )) })
@@ -280,5 +280,5 @@ const fn = /* @__PURE__ */ Object.assign(
280
280
  { displayName: "NiceWindow" }
281
281
  );
282
282
  export {
283
- fn as NiceWindow
283
+ gn as NiceWindow
284
284
  };
package/dist/overlays.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NiceWindow-pgR4c-kQ.cjs");exports.NiceActionSheet=e.NiceActionSheet;exports.NiceBlockUI=e.NiceBlockUI;exports.NiceBox=e.NiceBox;exports.NiceCommandPaletteProvider=e.NiceCommandPaletteProvider;exports.NiceLoadPanel=e.NiceLoadPanel;exports.NiceModalBody=e.NiceModalBody;exports.NiceModalFooter=e.NiceModalFooter;exports.NiceModalHeader=e.NiceModalHeader;exports.NiceOverlayBottomSheet=e.NiceBottomSheet;exports.NiceOverlayContextMenu=e.NiceContextMenu;exports.NiceOverlayDrawer=e.NiceDrawer;exports.NiceOverlayModal=e.NiceModal;exports.NiceOverlayPopover=e.NicePopover;exports.NicePopover=e.NicePopover$1;exports.NiceResizable=e.NiceResizable;exports.NiceResponsiveBox=e.NiceResponsiveBox;exports.NiceScrollView=e.NiceScrollView;exports.NiceTutorial=e.NiceTutorial;exports.NiceTutorialProvider=e.NiceTutorialProvider;exports.NiceWindow=e.NiceWindow;exports.NiceWindowManager=e.NiceWindowManager;exports.useCommandPalette=e.useCommandPalette;exports.useRegisterCommands=e.useRegisterCommands;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NiceWindow-BklnkBpu.cjs");exports.NiceActionSheet=e.NiceActionSheet;exports.NiceBlockUI=e.NiceBlockUI;exports.NiceBox=e.NiceBox;exports.NiceCommandPaletteProvider=e.NiceCommandPaletteProvider;exports.NiceLoadPanel=e.NiceLoadPanel;exports.NiceModalBody=e.NiceModalBody;exports.NiceModalFooter=e.NiceModalFooter;exports.NiceModalHeader=e.NiceModalHeader;exports.NiceOverlayBottomSheet=e.NiceBottomSheet;exports.NiceOverlayContextMenu=e.NiceContextMenu;exports.NiceOverlayDrawer=e.NiceDrawer;exports.NiceOverlayModal=e.NiceModal;exports.NiceOverlayPopover=e.NicePopover;exports.NicePopover=e.NicePopover$1;exports.NiceResizable=e.NiceResizable;exports.NiceResponsiveBox=e.NiceResponsiveBox;exports.NiceScrollView=e.NiceScrollView;exports.NiceTutorial=e.NiceTutorial;exports.NiceTutorialProvider=e.NiceTutorialProvider;exports.NiceWindow=e.NiceWindow;exports.NiceWindowManager=e.NiceWindowManager;exports.useCommandPalette=e.useCommandPalette;exports.useRegisterCommands=e.useRegisterCommands;