@nice2dev/ui 1.0.18 → 1.0.19
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/CHANGELOG.md +64 -0
- package/dist/NiceErrorBoundary-DBCCmeyl.js +770 -0
- package/dist/NiceErrorBoundary-V6wkSSLP.cjs +1 -0
- package/dist/NiceForm-DLADlHAQ.js +5383 -0
- package/dist/NiceForm-DUkduLqG.cjs +382 -0
- package/dist/NiceForm.css +1 -1
- package/dist/NiceModal-CUdeVj-j.js +95 -0
- package/dist/NiceModal-Cc8R-DpX.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-4UEsYB5r.js +6553 -0
- package/dist/NiceModuleLifecyclePanel-C6agdtTI.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-Cqr3Pe_F.js +171 -0
- package/dist/NicePagination-DyWWdtb3.cjs +1 -0
- package/dist/NicePinCodeInput-C6zJxUVf.cjs +419 -0
- package/dist/NicePinCodeInput-ltwzQf4r.js +12240 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-BIXW0y1X.js +6455 -0
- package/dist/NiceSavedQueryPanel-CFHwMDIx.cjs +596 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceTabs-B9zxj6qd.js +1657 -0
- package/dist/NiceTabs-CNauJ4fu.cjs +1 -0
- package/dist/NiceWindow-Bo_yCa1o.js +1418 -0
- package/dist/NiceWindow-DPzJxOfx.cjs +1 -0
- package/dist/charts-C60va95_.js +4657 -0
- package/dist/charts-D_I1iwel.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-Bcc4sz15.cjs +96 -0
- package/dist/core-Da1dGJN3.js +22401 -0
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +5 -0
- package/dist/data.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +44 -1
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-DCDfWfAt.js +64336 -0
- package/dist/index-DpiCo0_e.cjs +5194 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +166 -3
- package/dist/index.mjs +47 -47
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +3 -3
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +15 -1
- package/dist/navigation.mjs +30 -30
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +53 -53
- package/dist/style.css +6 -6
- package/package.json +3 -3
package/dist/navigation.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./NiceModuleLifecyclePanel-F1uN0gMh.cjs"),e=require("react/jsx-runtime"),v=require("./core-DQYnL6uf.cjs"),_=require("react"),U=require("./NiceTabs-32xjguOv.cjs"),V=require("./NicePagination-CGQf54a9.cjs"),P=_.forwardRef(({items:b,activeKey:N,collapsed:a=!1,width:p=240,collapsedWidth:t=52,onItemClick:k,onCollapseChange:D,header:y,footer:d,size:m="md",className:g,style:M,id:j,accessMode:S,...w},x)=>{const c=v.ks(j),o=v._s(S,j),[l,u]=_.useState(new Set),r=_.useCallback(i=>{u($=>{const s=new Set($);return s.has(i)?s.delete(i):s.add(i),s})},[]);if(o==="hidden")return null;const h=(i,$=0)=>{const s=i.children&&i.children.length>0,E=l.has(i.key),C=i.key===N;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${C?"nice-sidebar-menu__btn--active":""} ${i.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:a?void 0:12+$*16},onClick:()=>s?r(i.key):k?.(i),disabled:i.disabled,title:a?i.text:void 0,type:"button",children:[i.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:i.icon}),!a&&e.jsx("span",{className:"nice-sidebar-menu__label",children:i.text}),!a&&i.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:i.badge}),!a&&s&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:E?"▾":"▸"})]}),s&&E&&!a&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:i.children.map(T=>h(T,$+1))})]},i.key)};return e.jsxs("nav",{ref:x,id:c,className:`nice-sidebar-menu nice-sidebar-menu--${m} ${a?"nice-sidebar-menu--collapsed":""} ${g??""}`,style:{...M,width:a?t:p},...w,children:[y&&e.jsx("div",{className:"nice-sidebar-menu__header",children:y}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:b.map(i=>h(i))}),d&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:d})]})});P.displayName="NiceSidebarMenu";const I=_.forwardRef(({items:b,activeKey:N,onItemClick:a,brand:p,actions:t,size:k="md",className:D,style:y,id:d,accessMode:m,...g},M)=>{const j=v.ks(d),S=v._s(m,d),[w,x]=_.useState(null);return S==="hidden"?null:e.jsxs("nav",{ref:M,id:j,className:`nice-top-menu nice-top-menu--${k} ${D??""}`,style:y,...g,children:[p&&e.jsx("div",{className:"nice-top-menu__brand",children:p}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",children:b.map(c=>{const o=c.children&&c.children.length>0,l=w===c.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>o&&x(c.key),onMouseLeave:()=>o&&x(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${c.key===N?"nice-top-menu__btn--active":""}`,onClick:()=>o?x(l?null:c.key):a?.(c),role:"menuitem","aria-haspopup":o,"aria-expanded":l,disabled:c.disabled,type:"button",children:[c.icon&&e.jsx("span",{children:c.icon}),e.jsx("span",{children:c.text}),o&&e.jsx("span",{className:"nice-top-menu__chevron",children:"▾"})]}),o&&l&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",children:c.children.map(u=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${u.key===N?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{a?.(u),x(null)},disabled:u.disabled,role:"menuitem",type:"button",children:[u.icon&&e.jsx("span",{children:u.icon}),e.jsx("span",{children:u.text}),u.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:u.badge})]})},u.key))})]},c.key)})}),t&&e.jsx("div",{className:"nice-top-menu__actions",children:t})]})});I.displayName="NiceTopMenu";const B=_.forwardRef(({tabs:b,activeTab:N,onTabChange:a,onItemClick:p,minimized:t=!1,onMinimizeToggle:k,size:D="md",className:y,style:d,id:m,accessMode:g,...M},j)=>{const S=v.ks(m),w=v._s(g,m),[x,c]=_.useState(N??b[0]?.key),o=N??x,l=b.find(r=>r.key===o),u=_.useCallback(r=>{c(r),a?.(r)},[a]);return w==="hidden"?null:e.jsxs("div",{ref:j,id:S,className:`nice-ribbon-menu nice-ribbon-menu--${D} ${t?"nice-ribbon-menu--minimized":""} ${y??""}`,style:d,...M,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",role:"tablist",children:[b.map(r=>e.jsx("button",{className:`nice-ribbon-menu__tab ${r.key===o?"nice-ribbon-menu__tab--active":""}`,onClick:()=>u(r.key),role:"tab","aria-selected":r.key===o,type:"button",children:r.label},r.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>k?.(!t),type:"button","aria-label":t?"Expand":"Minimize",children:t?"▼":"▲"})]}),!t&&l&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:l.groups.map((r,h)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:r.items.map(i=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>p?.(i),disabled:i.disabled,type:"button",children:[i.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:i.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:i.text})]},i.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:r.label})]},h))})]})});B.displayName="NiceRibbonMenu";const L=_.forwardRef(({items:b,activeKey:N,onItemClick:a,position:p="bottom",autoHide:t=!1,iconSize:k=40,size:D="md",className:y,style:d,id:m,accessMode:g,...M},j)=>{const S=v.ks(m),w=v._s(g,m),[x,c]=_.useState(!1),o=!t||x;return w==="hidden"?null:e.jsx("div",{ref:j,id:S,className:`nice-dock-menu nice-dock-menu--${p} nice-dock-menu--${D} ${t&&!o?"nice-dock-menu--hidden":""} ${y??""}`,style:d,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),...M,children:e.jsx("div",{className:"nice-dock-menu__items",children:b.map(l=>e.jsxs("button",{className:`nice-dock-menu__item ${l.key===N?"nice-dock-menu__item--active":""}`,onClick:()=>a?.(l),disabled:l.disabled,title:l.text,type:"button",style:{width:k,height:k},children:[l.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:l.icon}):e.jsx("span",{children:l.text[0]}),l.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:l.badge})]},l.key))})})});L.displayName="NiceDockMenu";const W=_.forwardRef(({items:b,activeKey:N,onItemClick:a,open:p,onOpenChange:t,position:k="left",panelWidth:D=280,header:y,footer:d,size:m="md",className:g,style:M,id:j,accessMode:S,...w},x)=>{const c=v.ks(j),o=v._s(S,j),{t:l}=v.$o(),[u,r]=_.useState(!1),h=p??u,i=_.useCallback(()=>{const s=!h;r(s),t?.(s)},[h,t]),$=_.useCallback(s=>{a?.(s),r(!1),t?.(!1)},[a,t]);return o==="hidden"?null:e.jsxs("div",{ref:x,id:c,className:`nice-hamburger-menu nice-hamburger-menu--${m} ${g??""}`,style:M,...w,children:[e.jsx("button",{className:"nice-hamburger-menu__trigger",onClick:i,"aria-label":l("nav.menu","Menu"),"aria-expanded":h,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${h?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),h&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:i,"aria-hidden":!0}),e.jsxs("div",{className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${k} ${h?"nice-hamburger-menu__panel--open":""}`,style:{width:D},children:[y&&e.jsx("div",{className:"nice-hamburger-menu__header",children:y}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",children:b.map(s=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${s.key===N?"nice-hamburger-menu__item--active":""}`,onClick:()=>$(s),disabled:s.disabled,role:"menuitem",type:"button",children:[s.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:s.icon}),e.jsx("span",{children:s.text}),s.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:s.badge})]})},s.key))}),d&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:d})]})]})});W.displayName="NiceHamburgerMenu";const O=_.forwardRef(({canGoBack:b=!1,canGoForward:N=!1,onBack:a,onForward:p,onRefresh:t,enableShortcuts:k=!0,showRefresh:D=!0,showStop:y=!0,isLoading:d=!1,onStop:m,size:g="md",variant:M="default",tooltipPosition:j="bottom",backIcon:S,forwardIcon:w,refreshIcon:x,stopIcon:c,className:o,style:l,id:u,accessMode:r,disabled:h,...i},$)=>{const s=v.ks(u),E=v._s(r,u),{t:C}=v.$o();if(_.useEffect(()=>{if(!k||h)return;const A=f=>{const R=f.altKey,H=f.ctrlKey||f.metaKey;R&&f.key==="ArrowLeft"?(f.preventDefault(),b&&a?.()):R&&f.key==="ArrowRight"?(f.preventDefault(),N&&p?.()):f.key==="F5"||H&&f.key==="r"?(f.preventDefault(),d?m?.():t?.()):f.key==="Escape"&&d&&(f.preventDefault(),m?.())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[k,h,b,N,d,a,p,t,m]),E==="hidden")return null;const T=E==="disabled"||h,q=S??e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),z=w??e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),F=x??e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),K=c??e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});return e.jsxs("div",{ref:$,id:s,className:`nice-nav-controls nice-nav-controls--${g} nice-nav-controls--${M}${T?" nice-nav-controls--disabled":""}${o?` ${o}`:""}`,style:l,role:"navigation","aria-label":C("nav.controls","Navigation controls"),...i,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${b?"":" nice-nav-controls__btn--disabled"}`,onClick:a,disabled:T||!b,"aria-label":C("nav.back","Back"),title:`${C("nav.back","Back")} (Alt+←)`,children:q}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${N?"":" nice-nav-controls__btn--disabled"}`,onClick:p,disabled:T||!N,"aria-label":C("nav.forward","Forward"),title:`${C("nav.forward","Forward")} (Alt+→)`,children:z}),(D||y&&d)&&(d?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:m,disabled:T,"aria-label":C("nav.stop","Stop"),title:`${C("nav.stop","Stop")} (Esc)`,children:K}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:t,disabled:T,"aria-label":C("nav.refresh","Refresh"),title:`${C("nav.refresh","Refresh")} (F5)`,children:F}))]})});O.displayName="NiceNavigationControls";exports.DEFAULT_SIDEBAR_PREFS=n.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=n.DesktopContextMenu;exports.DesktopGrid=n.DesktopGrid;exports.DesktopStartMenu=n.DesktopStartMenu;exports.DesktopSystemTray=n.DesktopSystemTray;exports.DesktopTaskbar=n.DesktopTaskbar;exports.NiceAccordion=n.NiceAccordion;exports.NiceAppLayout=n.NiceAppLayout;exports.NiceAuthButtons=n.NiceAuthButtons;exports.NiceBottomNavigation=n.NiceBottomNavigation;exports.NiceBreadcrumb=n.NiceBreadcrumb;exports.NiceCard=n.NiceCard;exports.NiceClassicShell=n.NiceClassicShell;exports.NiceCompactShell=n.NiceCompactShell;exports.NiceConsole=n.NiceConsole;exports.NiceContextMenu=n.NiceContextMenu;exports.NiceDashboardLayout=n.NiceDashboardLayout;exports.NiceDashboardShell=n.NiceDashboardShell;exports.NiceDesktop=n.NiceDesktop;exports.NiceDock=n.NiceDock;exports.NiceDynamicSidebar=n.NiceDynamicSidebar;exports.NiceHybridShell=n.NiceHybridShell;exports.NiceKioskShell=n.NiceKioskShell;exports.NiceMdiWorkspace=n.NiceMdiWorkspace;exports.NiceMenu=n.NiceMenu;exports.NiceMinimalShell=n.NiceMinimalShell;exports.NiceModeSelector=n.NiceModeSelector;exports.NiceModernShell=n.NiceModernShell;exports.NiceModuleLifecyclePanel=n.NiceModuleLifecyclePanel;exports.NiceMultiView=n.NiceMultiView;exports.NiceNavMenu=n.NiceNavMenu;exports.NiceNavbar=n.NiceNavbar;exports.NiceOnboardingWizard=n.NiceOnboardingWizard;exports.NiceOrganizationProfileForm=n.NiceOrganizationProfileForm;exports.NicePwaShell=n.NicePwaShell;exports.NiceSetupWizard=n.NiceSetupWizard;exports.NiceSidebarNav=n.NiceSidebarNav;exports.NiceSplitter=n.NiceSplitter;exports.NiceTabPanel=n.NiceTabPanel;exports.NiceTenantSwitcher=n.NiceTenantSwitcher;exports.NiceToolbar=n.NiceToolbar;exports.NiceUserMenu=n.NiceUserMenu;exports.NiceWizard=n.NiceWizard;exports.SIDEBAR_MODE_META=n.SIDEBAR_MODE_META;exports.NiceTabs=U.NiceTabs;exports.NicePagination=V.NicePagination;exports.NiceDockMenu=L;exports.NiceHamburgerMenu=W;exports.NiceNavigationControls=O;exports.NiceRibbonMenu=B;exports.NiceSidebarMenu=P;exports.NiceTopMenu=I;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./NiceModuleLifecyclePanel-C6agdtTI.cjs"),e=require("react/jsx-runtime"),v=require("./core-Bcc4sz15.cjs"),h=require("react"),Z=require("./NiceTabs-CNauJ4fu.cjs"),U=require("./NicePagination-DyWWdtb3.cjs"),I=h.forwardRef(({items:b,activeKey:N,collapsed:a=!1,width:p=240,collapsedWidth:l=52,onItemClick:k,onCollapseChange:D,header:j,footer:d,size:m="md",className:g,style:M,id:y,accessMode:S,...C},x)=>{const c=v.Hs(y),o=v.Zs(S,y),[t,u]=h.useState(new Set),r=h.useCallback(i=>{u($=>{const s=new Set($);return s.has(i)?s.delete(i):s.add(i),s})},[]);if(o==="hidden")return null;const _=(i,$=0)=>{const s=i.children&&i.children.length>0,E=t.has(i.key),w=i.key===N;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${w?"nice-sidebar-menu__btn--active":""} ${i.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:a?void 0:12+$*16},onClick:()=>s?r(i.key):k?.(i),disabled:i.disabled,title:a?i.text:void 0,type:"button",children:[i.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:i.icon}),!a&&e.jsx("span",{className:"nice-sidebar-menu__label",children:i.text}),!a&&i.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:i.badge}),!a&&s&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:E?"▾":"▸"})]}),s&&E&&!a&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:i.children.map(T=>_(T,$+1))})]},i.key)};return e.jsxs("nav",{ref:x,id:c,className:`nice-sidebar-menu nice-sidebar-menu--${m} ${a?"nice-sidebar-menu--collapsed":""} ${g??""}`,style:{...M,width:a?l:p},...C,children:[j&&e.jsx("div",{className:"nice-sidebar-menu__header",children:j}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:b.map(i=>_(i))}),d&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:d})]})});I.displayName="NiceSidebarMenu";const P=h.forwardRef(({items:b,activeKey:N,onItemClick:a,brand:p,actions:l,size:k="md",className:D,style:j,id:d,accessMode:m,...g},M)=>{const y=v.Hs(d),S=v.Zs(m,d),[C,x]=h.useState(null);return S==="hidden"?null:e.jsxs("nav",{ref:M,id:y,className:`nice-top-menu nice-top-menu--${k} ${D??""}`,style:j,...g,children:[p&&e.jsx("div",{className:"nice-top-menu__brand",children:p}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",children:b.map(c=>{const o=c.children&&c.children.length>0,t=C===c.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>o&&x(c.key),onMouseLeave:()=>o&&x(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${c.key===N?"nice-top-menu__btn--active":""}`,onClick:()=>o?x(t?null:c.key):a?.(c),role:"menuitem","aria-haspopup":o,"aria-expanded":t,disabled:c.disabled,type:"button",children:[c.icon&&e.jsx("span",{children:c.icon}),e.jsx("span",{children:c.text}),o&&e.jsx("span",{className:"nice-top-menu__chevron",children:"▾"})]}),o&&t&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",children:c.children.map(u=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${u.key===N?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{a?.(u),x(null)},disabled:u.disabled,role:"menuitem",type:"button",children:[u.icon&&e.jsx("span",{children:u.icon}),e.jsx("span",{children:u.text}),u.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:u.badge})]})},u.key))})]},c.key)})}),l&&e.jsx("div",{className:"nice-top-menu__actions",children:l})]})});P.displayName="NiceTopMenu";const B=h.forwardRef(({tabs:b,activeTab:N,onTabChange:a,onItemClick:p,minimized:l=!1,onMinimizeToggle:k,size:D="md",className:j,style:d,id:m,accessMode:g,...M},y)=>{const S=v.Hs(m),C=v.Zs(g,m),[x,c]=h.useState(N??b[0]?.key),o=N??x,t=b.find(r=>r.key===o),u=h.useCallback(r=>{c(r),a?.(r)},[a]);return C==="hidden"?null:e.jsxs("div",{ref:y,id:S,className:`nice-ribbon-menu nice-ribbon-menu--${D} ${l?"nice-ribbon-menu--minimized":""} ${j??""}`,style:d,...M,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",role:"tablist",children:[b.map(r=>e.jsx("button",{className:`nice-ribbon-menu__tab ${r.key===o?"nice-ribbon-menu__tab--active":""}`,onClick:()=>u(r.key),role:"tab","aria-selected":r.key===o,type:"button",children:r.label},r.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>k?.(!l),type:"button","aria-label":l?"Expand":"Minimize",children:l?"▼":"▲"})]}),!l&&t&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:t.groups.map((r,_)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:r.items.map(i=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>p?.(i),disabled:i.disabled,type:"button",children:[i.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:i.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:i.text})]},i.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:r.label})]},_))})]})});B.displayName="NiceRibbonMenu";const W=h.forwardRef(({items:b,activeKey:N,onItemClick:a,position:p="bottom",autoHide:l=!1,iconSize:k=40,size:D="md",className:j,style:d,id:m,accessMode:g,...M},y)=>{const S=v.Hs(m),C=v.Zs(g,m),[x,c]=h.useState(!1),o=!l||x;return C==="hidden"?null:e.jsx("div",{ref:y,id:S,className:`nice-dock-menu nice-dock-menu--${p} nice-dock-menu--${D} ${l&&!o?"nice-dock-menu--hidden":""} ${j??""}`,style:d,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),...M,children:e.jsx("div",{className:"nice-dock-menu__items",children:b.map(t=>e.jsxs("button",{className:`nice-dock-menu__item ${t.key===N?"nice-dock-menu__item--active":""}`,onClick:()=>a?.(t),disabled:t.disabled,title:t.text,type:"button",style:{width:k,height:k},children:[t.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:t.icon}):e.jsx("span",{children:t.text[0]}),t.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:t.badge})]},t.key))})})});W.displayName="NiceDockMenu";const H=h.forwardRef(({items:b,activeKey:N,onItemClick:a,open:p,onOpenChange:l,position:k="left",panelWidth:D=280,header:j,footer:d,size:m="md",className:g,style:M,id:y,accessMode:S,...C},x)=>{const c=v.Hs(y),o=v.Zs(S,y),{t}=v.$o(),[u,r]=h.useState(!1),_=p??u,i=h.useCallback(()=>{const s=!_;r(s),l?.(s)},[_,l]),$=h.useCallback(s=>{a?.(s),r(!1),l?.(!1)},[a,l]);return o==="hidden"?null:e.jsxs("div",{ref:x,id:c,className:`nice-hamburger-menu nice-hamburger-menu--${m} ${g??""}`,style:M,...C,children:[e.jsx("button",{className:"nice-hamburger-menu__trigger",onClick:i,"aria-label":t("nav.menu","Menu"),"aria-expanded":_,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${_?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),_&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:i,"aria-hidden":!0}),e.jsxs("div",{className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${k} ${_?"nice-hamburger-menu__panel--open":""}`,style:{width:D},children:[j&&e.jsx("div",{className:"nice-hamburger-menu__header",children:j}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",children:b.map(s=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${s.key===N?"nice-hamburger-menu__item--active":""}`,onClick:()=>$(s),disabled:s.disabled,role:"menuitem",type:"button",children:[s.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:s.icon}),e.jsx("span",{children:s.text}),s.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:s.badge})]})},s.key))}),d&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:d})]})]})});H.displayName="NiceHamburgerMenu";const L=h.forwardRef(({canGoBack:b=!1,canGoForward:N=!1,onBack:a,onForward:p,onRefresh:l,enableShortcuts:k=!0,showRefresh:D=!0,showStop:j=!0,isLoading:d=!1,onStop:m,size:g="md",variant:M="default",tooltipPosition:y="bottom",backIcon:S,forwardIcon:C,refreshIcon:x,stopIcon:c,className:o,style:t,id:u,accessMode:r,disabled:_,...i},$)=>{const s=v.Hs(u),E=v.Zs(r,u),{t:w}=v.$o();if(h.useEffect(()=>{if(!k||_)return;const A=f=>{const R=f.altKey,K=f.ctrlKey||f.metaKey;R&&f.key==="ArrowLeft"?(f.preventDefault(),b&&a?.()):R&&f.key==="ArrowRight"?(f.preventDefault(),N&&p?.()):f.key==="F5"||K&&f.key==="r"?(f.preventDefault(),d?m?.():l?.()):f.key==="Escape"&&d&&(f.preventDefault(),m?.())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[k,_,b,N,d,a,p,l,m]),E==="hidden")return null;const T=E==="disabled"||_,O=S??e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),q=C??e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),z=x??e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),F=c??e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});return e.jsxs("div",{ref:$,id:s,className:`nice-nav-controls nice-nav-controls--${g} nice-nav-controls--${M}${T?" nice-nav-controls--disabled":""}${o?` ${o}`:""}`,style:t,role:"navigation","aria-label":w("nav.controls","Navigation controls"),...i,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${b?"":" nice-nav-controls__btn--disabled"}`,onClick:a,disabled:T||!b,"aria-label":w("nav.back","Back"),title:`${w("nav.back","Back")} (Alt+←)`,children:O}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${N?"":" nice-nav-controls__btn--disabled"}`,onClick:p,disabled:T||!N,"aria-label":w("nav.forward","Forward"),title:`${w("nav.forward","Forward")} (Alt+→)`,children:q}),(D||j&&d)&&(d?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:m,disabled:T,"aria-label":w("nav.stop","Stop"),title:`${w("nav.stop","Stop")} (Esc)`,children:F}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:l,disabled:T,"aria-label":w("nav.refresh","Refresh"),title:`${w("nav.refresh","Refresh")} (F5)`,children:z}))]})});L.displayName="NiceNavigationControls";exports.DEFAULT_SIDEBAR_PREFS=n.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=n.DesktopContextMenu;exports.DesktopGrid=n.DesktopGrid;exports.DesktopStartMenu=n.DesktopStartMenu;exports.DesktopSystemTray=n.DesktopSystemTray;exports.DesktopTaskbar=n.DesktopTaskbar;exports.NiceAccordion=n.NiceAccordion;exports.NiceAppLayout=n.NiceAppLayout;exports.NiceAuthButtons=n.NiceAuthButtons;exports.NiceBottomNavigation=n.NiceBottomNavigation;exports.NiceBreadcrumb=n.NiceBreadcrumb;exports.NiceCard=n.NiceCard;exports.NiceClassicShell=n.NiceClassicShell;exports.NiceCompactShell=n.NiceCompactShell;exports.NiceConsole=n.NiceConsole;exports.NiceContextMenu=n.NiceContextMenu;exports.NiceDashboardLayout=n.NiceDashboardLayout;exports.NiceDashboardShell=n.NiceDashboardShell;exports.NiceDesktop=n.NiceDesktop;exports.NiceDock=n.NiceDock;exports.NiceDynamicSidebar=n.NiceDynamicSidebar;exports.NiceHybridShell=n.NiceHybridShell;exports.NiceKioskShell=n.NiceKioskShell;exports.NiceMdiWorkspace=n.NiceMdiWorkspace;exports.NiceMenu=n.NiceMenu;exports.NiceMinimalShell=n.NiceMinimalShell;exports.NiceModeSelector=n.NiceModeSelector;exports.NiceModernShell=n.NiceModernShell;exports.NiceModuleLifecyclePanel=n.NiceModuleLifecyclePanel;exports.NiceMultiView=n.NiceMultiView;exports.NiceNavMenu=n.NiceNavMenu;exports.NiceNavbar=n.NiceNavbar;exports.NiceOnboardingWizard=n.NiceOnboardingWizard;exports.NiceOrganizationProfileForm=n.NiceOrganizationProfileForm;exports.NicePwaShell=n.NicePwaShell;exports.NiceSetupWizard=n.NiceSetupWizard;exports.NiceSidebarNav=n.NiceSidebarNav;exports.NiceSplitter=n.NiceSplitter;exports.NiceTabPanel=n.NiceTabPanel;exports.NiceTenantSwitcher=n.NiceTenantSwitcher;exports.NiceToolbar=n.NiceToolbar;exports.NiceUserMenu=n.NiceUserMenu;exports.NiceWizard=n.NiceWizard;exports.SIDEBAR_MODE_META=n.SIDEBAR_MODE_META;exports.NiceTabs=Z.NiceTabs;exports.NicePagination=U.NicePagination;exports.NiceDockMenu=W;exports.NiceHamburgerMenu=H;exports.NiceNavigationControls=L;exports.NiceRibbonMenu=B;exports.NiceSidebarMenu=I;exports.NiceTopMenu=P;
|
package/dist/navigation.d.ts
CHANGED
|
@@ -794,6 +794,12 @@ export declare interface NiceMenuProps extends NiceBaseProps {
|
|
|
794
794
|
renderTriggerLabel?: (item: NiceMenuItem) => default_2.ReactNode;
|
|
795
795
|
/** Optional renderer for panel-entry label. */
|
|
796
796
|
renderEntryLabel?: (item: NiceMenuItem) => default_2.ReactNode;
|
|
797
|
+
/**
|
|
798
|
+
* Maximum depth of nested flyouts rendered. `1` = top-level only, `2` = level-1 panel,
|
|
799
|
+
* `3` = level-2 subpanel (default — preserves legacy behavior), up to `10`. Items with
|
|
800
|
+
* `children` beyond this depth are rendered as leaves (no flyout arrow, no hover-open).
|
|
801
|
+
*/
|
|
802
|
+
maxDepth?: number;
|
|
797
803
|
}
|
|
798
804
|
|
|
799
805
|
/**
|
|
@@ -1409,6 +1415,14 @@ export declare interface NiceSidebarNavProps {
|
|
|
1409
1415
|
* Default `false`.
|
|
1410
1416
|
*/
|
|
1411
1417
|
minimal?: boolean;
|
|
1418
|
+
/**
|
|
1419
|
+
* **Embedded mode** — render the sidebar inside another container (e.g. a
|
|
1420
|
+
* mobile drawer / hamburger menu). Forces full width, drops the footer with
|
|
1421
|
+
* the collapse-btn (there is nothing to collapse to inside a drawer) and
|
|
1422
|
+
* ignores `collapsed` / `width` / `collapsedWidth`. The mode strip and the
|
|
1423
|
+
* full navigation tree stay intact. Default `false`.
|
|
1424
|
+
*/
|
|
1425
|
+
embedded?: boolean;
|
|
1412
1426
|
/** Optional header slot rendered above the mode strip / tree (e.g. workspace switcher). */
|
|
1413
1427
|
header?: ReactNode;
|
|
1414
1428
|
/** Optional footer slot rendered below the standard footer-toggle row. */
|
|
@@ -1884,7 +1898,7 @@ export declare interface SidebarNavHiddenItem {
|
|
|
1884
1898
|
}
|
|
1885
1899
|
|
|
1886
1900
|
/** Display mode for the sidebar navigation */
|
|
1887
|
-
export declare type SidebarNavMode = 'all' | 'by-role' | 'by-unit' | 'favorites' | 'preferences';
|
|
1901
|
+
export declare type SidebarNavMode = 'all' | 'by-role' | 'by-unit' | 'favorites' | 'search' | 'preferences';
|
|
1888
1902
|
|
|
1889
1903
|
/** A module containing multiple views */
|
|
1890
1904
|
export declare interface SidebarNavModule {
|
package/dist/navigation.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as ae, a as ie, b as ce, c as se, d as le, e as te, N as re, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as we, w as Me, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as Pe, G as Be, H as Le, I as Re, J as We, K as
|
|
1
|
+
import { D as ae, a as ie, b as ce, c as se, d as le, e as te, N as re, f as oe, g as de, h as ue, i as be, j as me, k as _e, l as he, m as pe, n as Ne, o as ve, p as ke, q as ye, r as fe, s as ge, t as $e, u as xe, v as we, w as Me, x as Ce, y as De, z as Se, A as Ee, B as Ie, C as Te, E as Ae, F as Pe, G as Be, H as Le, I as Re, J as We, K as He, L as Ke, M as Oe, O as Fe, P as je, Q as ze, S as Ue } from "./NiceModuleLifecyclePanel-4UEsYB5r.js";
|
|
2
2
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { H as E, Z as I, $ as W } from "./core-Da1dGJN3.js";
|
|
4
4
|
import { forwardRef as T, useState as P, useCallback as B, useEffect as z } from "react";
|
|
5
|
-
import { f as
|
|
6
|
-
import { N as
|
|
5
|
+
import { f as Ze } from "./NiceTabs-B9zxj6qd.js";
|
|
6
|
+
import { N as Je } from "./NicePagination-Cqr3Pe_F.js";
|
|
7
7
|
const U = T(
|
|
8
8
|
({
|
|
9
9
|
items: b,
|
|
@@ -151,7 +151,7 @@ const V = T(
|
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
153
|
V.displayName = "NiceTopMenu";
|
|
154
|
-
const
|
|
154
|
+
const Z = T(
|
|
155
155
|
({
|
|
156
156
|
tabs: b,
|
|
157
157
|
activeTab: m,
|
|
@@ -227,8 +227,8 @@ const q = T(
|
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
|
-
|
|
231
|
-
const
|
|
230
|
+
Z.displayName = "NiceRibbonMenu";
|
|
231
|
+
const q = T(
|
|
232
232
|
({
|
|
233
233
|
items: b,
|
|
234
234
|
activeKey: m,
|
|
@@ -274,8 +274,8 @@ const J = T(
|
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
);
|
|
277
|
-
|
|
278
|
-
const
|
|
277
|
+
q.displayName = "NiceDockMenu";
|
|
278
|
+
const J = T(
|
|
279
279
|
({
|
|
280
280
|
items: b,
|
|
281
281
|
activeKey: m,
|
|
@@ -364,8 +364,8 @@ const Q = T(
|
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
|
-
|
|
368
|
-
const
|
|
367
|
+
J.displayName = "NiceHamburgerMenu";
|
|
368
|
+
const Q = T(
|
|
369
369
|
({
|
|
370
370
|
canGoBack: b = !1,
|
|
371
371
|
canGoForward: m = !1,
|
|
@@ -412,7 +412,7 @@ const X = T(
|
|
|
412
412
|
_
|
|
413
413
|
]), A === "hidden")
|
|
414
414
|
return null;
|
|
415
|
-
const S = A === "disabled" || h,
|
|
415
|
+
const S = A === "disabled" || h, H = x ?? /* @__PURE__ */ e(
|
|
416
416
|
"svg",
|
|
417
417
|
{
|
|
418
418
|
width: "16",
|
|
@@ -423,7 +423,7 @@ const X = T(
|
|
|
423
423
|
strokeWidth: "2",
|
|
424
424
|
children: /* @__PURE__ */ e("polyline", { points: "15 18 9 12 15 6" })
|
|
425
425
|
}
|
|
426
|
-
),
|
|
426
|
+
), K = w ?? /* @__PURE__ */ e(
|
|
427
427
|
"svg",
|
|
428
428
|
{
|
|
429
429
|
width: "16",
|
|
@@ -434,7 +434,7 @@ const X = T(
|
|
|
434
434
|
strokeWidth: "2",
|
|
435
435
|
children: /* @__PURE__ */ e("polyline", { points: "9 18 15 12 9 6" })
|
|
436
436
|
}
|
|
437
|
-
),
|
|
437
|
+
), O = N ?? /* @__PURE__ */ o(
|
|
438
438
|
"svg",
|
|
439
439
|
{
|
|
440
440
|
width: "16",
|
|
@@ -448,7 +448,7 @@ const X = T(
|
|
|
448
448
|
/* @__PURE__ */ e("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
|
|
449
449
|
]
|
|
450
450
|
}
|
|
451
|
-
),
|
|
451
|
+
), F = i ?? /* @__PURE__ */ o(
|
|
452
452
|
"svg",
|
|
453
453
|
{
|
|
454
454
|
width: "16",
|
|
@@ -483,7 +483,7 @@ const X = T(
|
|
|
483
483
|
disabled: S || !b,
|
|
484
484
|
"aria-label": M("nav.back", "Back"),
|
|
485
485
|
title: `${M("nav.back", "Back")} (Alt+←)`,
|
|
486
|
-
children:
|
|
486
|
+
children: H
|
|
487
487
|
}
|
|
488
488
|
),
|
|
489
489
|
/* @__PURE__ */ e(
|
|
@@ -495,7 +495,7 @@ const X = T(
|
|
|
495
495
|
disabled: S || !m,
|
|
496
496
|
"aria-label": M("nav.forward", "Forward"),
|
|
497
497
|
title: `${M("nav.forward", "Forward")} (Alt+→)`,
|
|
498
|
-
children:
|
|
498
|
+
children: K
|
|
499
499
|
}
|
|
500
500
|
),
|
|
501
501
|
(C || k && d) && (d ? /* @__PURE__ */ e(
|
|
@@ -507,7 +507,7 @@ const X = T(
|
|
|
507
507
|
disabled: S,
|
|
508
508
|
"aria-label": M("nav.stop", "Stop"),
|
|
509
509
|
title: `${M("nav.stop", "Stop")} (Esc)`,
|
|
510
|
-
children:
|
|
510
|
+
children: F
|
|
511
511
|
}
|
|
512
512
|
) : /* @__PURE__ */ e(
|
|
513
513
|
"button",
|
|
@@ -518,7 +518,7 @@ const X = T(
|
|
|
518
518
|
disabled: S,
|
|
519
519
|
"aria-label": M("nav.refresh", "Refresh"),
|
|
520
520
|
title: `${M("nav.refresh", "Refresh")} (F5)`,
|
|
521
|
-
children:
|
|
521
|
+
children: O
|
|
522
522
|
}
|
|
523
523
|
))
|
|
524
524
|
]
|
|
@@ -526,7 +526,7 @@ const X = T(
|
|
|
526
526
|
);
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
|
-
|
|
529
|
+
Q.displayName = "NiceNavigationControls";
|
|
530
530
|
export {
|
|
531
531
|
ae as DEFAULT_SIDEBAR_PREFS,
|
|
532
532
|
ie as DesktopContextMenu,
|
|
@@ -548,9 +548,9 @@ export {
|
|
|
548
548
|
ke as NiceDashboardShell,
|
|
549
549
|
ye as NiceDesktop,
|
|
550
550
|
fe as NiceDock,
|
|
551
|
-
|
|
551
|
+
q as NiceDockMenu,
|
|
552
552
|
ge as NiceDynamicSidebar,
|
|
553
|
-
|
|
553
|
+
J as NiceHamburgerMenu,
|
|
554
554
|
$e as NiceHybridShell,
|
|
555
555
|
xe as NiceKioskShell,
|
|
556
556
|
we as NiceMdiWorkspace,
|
|
@@ -562,20 +562,20 @@ export {
|
|
|
562
562
|
Ie as NiceMultiView,
|
|
563
563
|
Te as NiceNavMenu,
|
|
564
564
|
Ae as NiceNavbar,
|
|
565
|
-
|
|
565
|
+
Q as NiceNavigationControls,
|
|
566
566
|
Pe as NiceOnboardingWizard,
|
|
567
567
|
Be as NiceOrganizationProfileForm,
|
|
568
|
-
|
|
568
|
+
Je as NicePagination,
|
|
569
569
|
Le as NicePwaShell,
|
|
570
|
-
|
|
570
|
+
Z as NiceRibbonMenu,
|
|
571
571
|
Re as NiceSetupWizard,
|
|
572
572
|
U as NiceSidebarMenu,
|
|
573
573
|
We as NiceSidebarNav,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
574
|
+
He as NiceSplitter,
|
|
575
|
+
Ke as NiceTabPanel,
|
|
576
|
+
Ze as NiceTabs,
|
|
577
|
+
Oe as NiceTenantSwitcher,
|
|
578
|
+
Fe as NiceToolbar,
|
|
579
579
|
V as NiceTopMenu,
|
|
580
580
|
je as NiceUserMenu,
|
|
581
581
|
ze as NiceWizard,
|
package/dist/overlays.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-DPzJxOfx.cjs"),r=require("react/jsx-runtime"),M=require("./core-Bcc4sz15.cjs"),e=require("react"),B=require("react-dom");function Y(){const t=e.useContext(M.lr);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const H=({open:t,onClose:s,children:v,title:a,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:j=!0,zIndex:_=1e3,className:p,style:P})=>{const w=e.useRef(null);M.Ps(w,t&&!u);const y=Y();e.useEffect(()=>{if(!j&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,j]),e.useEffect(()=>{if(!d||!t)return;const n=x=>{x.key==="Escape"&&(x.preventDefault(),s())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,s]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&s()},[l,s]);if(!t)return null;const i={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return B.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:_},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${i} ${p||""}`,role:"dialog","aria-modal":"true","aria-label":a,style:P,tabIndex:-1,children:v})}),y)},W=({children:t,showClose:s=!0,onClose:v,className:a})=>r.jsxs("div",{className:`nice-modal__header ${a||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),s&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),O=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__body ${s||""}`,children:t}),q=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__footer ${s||""}`,children:t}),K=({open:t,onClose:s,children:v,position:a="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:j=!0,zIndex:_=1e3,className:p,style:P})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[i,n]=e.useState(0);M.Ps(w,t);const x=Y();e.useEffect(()=>{if(!u||!t)return;const o=k=>{k.key==="Escape"&&(k.preventDefault(),s())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[u,t,s]);const h=e.useCallback(o=>{let k=0;switch(a){case"left":k=Math.min(0,o.deltaX);break;case"right":k=Math.max(0,o.deltaX);break;case"top":k=Math.min(0,o.deltaY);break;case"bottom":k=Math.max(0,o.deltaY);break}n(k)},[a]),D=e.useCallback(o=>{let $=!1;switch(a){case"left":$=o.deltaX<-100;break;case"right":$=o.deltaX>100;break;case"top":$=o.deltaY<-100;break;case"bottom":$=o.deltaY>100;break}$&&(M.Xr("light"),s()),n(0),f(!1)},[a,s]),{ref:C}=M.ac({enabled:j&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),E=e.useCallback(o=>{d&&o.target===o.currentTarget&&s()},[d,s]);if(!t)return null;const S=a==="left"||a==="right",L=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${i}px)`:`translateY(${i}px)`};return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:_},onClick:E}),r.jsx("div",{ref:o=>{w.current=o,C.current=o},className:`nice-drawer nice-drawer--${a} ${t?"nice-drawer--open":""} ${p||""}`,style:{...L,zIndex:_+1,transform:c(),transition:y?"none":void 0,...P},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),x)},F=({open:t,onClose:s,children:v,title:a,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:j=!0,closeOnEscape:_=!0,hapticFeedback:p=!0,zIndex:P=1e3,className:w,style:y})=>{const f=e.useRef(null),i=e.useRef(null),[n,x]=e.useState(d),[h,D]=e.useState(!1),[C,E]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(x(d),E(0))},[t,d]),M.Ps(f,t);const L=Y();e.useEffect(()=>{if(!_||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),s())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[_,t,s]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),I=i.current,X=!I||I.scrollTop<=0;!b&&!X||(D(!0),S.current=m.touches[0].clientY)},[]),o=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-S.current;(b>0||n<l.length-1)&&E(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-C,I=m*.15;b>I&&u&&n<l.length-1?(x(n+1),p&&M.Xr("selection")):b<-I&&(n>0?(x(n-1),p&&M.Xr("selection")):(p&&M.Xr("light"),s())),D(!1),E(0)},[h,C,n,l,u,p,s]),$=e.useCallback(()=>{j&&s()},[j,s]);if(!t)return null;const R=l[n]*100,T=h?C:0;return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:P},onClick:$}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:P+1,height:`${R}vh`,transform:`translateY(${Math.max(0,T)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,onTouchStart:c,onTouchMove:o,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),a&&r.jsx("div",{className:"nice-bottom-sheet__title",children:a}),r.jsx("div",{ref:i,className:"nice-bottom-sheet__content",children:v})]})]}),L)},z=({trigger:t,children:s,placement:v="bottom",triggerMode:a="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:j,showArrow:_=!0})=>{const[p,P]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),i=Y(),n=g!==void 0,x=n?g:p,h=e.useCallback(c=>{n||P(c),l?.(c)},[n,l]);M.$s(y,()=>{a!=="manual"&&x&&h(!1)});const D=e.useCallback(()=>{a==="click"&&h(!x)},[a,x,h]),C=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[a,d,h]),E=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[a,d,h]),[S,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!x||!w.current||!y.current)return;const c=w.current.getBoundingClientRect(),o=y.current.getBoundingClientRect(),k=window.innerWidth,$=window.innerHeight;let R=0,T=0;const[m,b="center"]=v.split("-");switch(m){case"top":R=c.top-o.height-u,T=c.left+(c.width-o.width)/2;break;case"bottom":R=c.bottom+u,T=c.left+(c.width-o.width)/2;break;case"left":R=c.top+(c.height-o.height)/2,T=c.left-o.width-u;break;case"right":R=c.top+(c.height-o.height)/2,T=c.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(T=c.left),b==="end"&&(T=c.right-o.width)):(b==="start"&&(R=c.top),b==="end"&&(R=c.bottom-o.height)),T=Math.max(8,Math.min(k-o.width-8,T)),R=Math.max(8,Math.min($-o.height-8,R)),L({top:R,left:T})},[x,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:D,onMouseEnter:C,onMouseLeave:E,style:{display:"inline-block"},children:t}),x&&B.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${j||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:C,onMouseLeave:E,role:"tooltip",children:[_&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:s})]}),i)]})},A=({items:t,children:s,onOpen:v,onClose:a,className:g})=>{const[l,d]=e.useState(!1),[u,j]=e.useState({x:0,y:0}),_=e.useRef(null),p=e.useRef(null),P=Y();M.$s(_,()=>{l&&(d(!1),a?.())});const w=e.useCallback(i=>{i.preventDefault(),j({x:i.clientX,y:i.clientY}),d(!0),v?.()},[v]),y=e.useCallback(i=>{!i.disabled&&i.onClick&&(i.onClick(),d(!1),a?.())},[a]);e.useEffect(()=>{if(!l)return;const i=n=>{n.key==="Escape"&&(d(!1),a?.())};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[l,a]);const f=i=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:i.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,onContextMenu:w,style:{display:"contents"},children:s}),l&&B.createPortal(r.jsx("div",{ref:_,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),P)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=F;exports.NiceContextMenu=A;exports.NiceDrawer=K;exports.NiceModal=H;exports.NiceModalBody=O;exports.NiceModalFooter=q;exports.NiceModalHeader=W;exports.NiceOverlayPopover=z;
|
package/dist/overlays.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as E, useState as
|
|
5
|
-
import { createPortal as
|
|
1
|
+
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-Bo_yCa1o.js";
|
|
2
|
+
import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { P as j, X as K, b as z, c as U, l as V } from "./core-Da1dGJN3.js";
|
|
4
|
+
import { useRef as E, useState as P, useEffect as Y, useCallback as b, useContext as q } from "react";
|
|
5
|
+
import { createPortal as C } from "react-dom";
|
|
6
6
|
function W() {
|
|
7
|
-
const e = V
|
|
7
|
+
const e = q(V);
|
|
8
8
|
return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
|
|
9
9
|
}
|
|
10
10
|
const F = ({
|
|
@@ -54,7 +54,7 @@ const F = ({
|
|
|
54
54
|
xl: "nice-modal--xl",
|
|
55
55
|
full: "nice-modal--full"
|
|
56
56
|
}[v];
|
|
57
|
-
return
|
|
57
|
+
return C(
|
|
58
58
|
/* @__PURE__ */ a(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
@@ -84,7 +84,7 @@ const F = ({
|
|
|
84
84
|
showClose: o = !0,
|
|
85
85
|
onClose: m,
|
|
86
86
|
className: r
|
|
87
|
-
}) => /* @__PURE__ */
|
|
87
|
+
}) => /* @__PURE__ */ H("div", { className: `nice-modal__header ${r || ""}`, children: [
|
|
88
88
|
/* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
|
|
89
89
|
o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
|
|
90
90
|
"svg",
|
|
@@ -112,7 +112,7 @@ const F = ({
|
|
|
112
112
|
className: k,
|
|
113
113
|
style: M
|
|
114
114
|
}) => {
|
|
115
|
-
const y = E(null), [p, u] =
|
|
115
|
+
const y = E(null), [p, u] = P(!1), [c, t] = P(0);
|
|
116
116
|
j(y, e);
|
|
117
117
|
const g = W();
|
|
118
118
|
Y(() => {
|
|
@@ -143,7 +143,7 @@ const F = ({
|
|
|
143
143
|
t(_);
|
|
144
144
|
},
|
|
145
145
|
[r]
|
|
146
|
-
),
|
|
146
|
+
), S = b(
|
|
147
147
|
(n) => {
|
|
148
148
|
let R = !1;
|
|
149
149
|
switch (r) {
|
|
@@ -163,12 +163,12 @@ const F = ({
|
|
|
163
163
|
R && (K("light"), o()), t(0), u(!1);
|
|
164
164
|
},
|
|
165
165
|
[r, o]
|
|
166
|
-
), { ref:
|
|
166
|
+
), { ref: D } = U({
|
|
167
167
|
enabled: x && e,
|
|
168
168
|
onPanStart: () => u(!0),
|
|
169
169
|
onPan: h,
|
|
170
|
-
onPanEnd:
|
|
171
|
-
}),
|
|
170
|
+
onPanEnd: S
|
|
171
|
+
}), L = b(
|
|
172
172
|
(n) => {
|
|
173
173
|
s && n.target === n.currentTarget && o();
|
|
174
174
|
},
|
|
@@ -176,29 +176,29 @@ const F = ({
|
|
|
176
176
|
);
|
|
177
177
|
if (!e)
|
|
178
178
|
return null;
|
|
179
|
-
const I = r === "left" || r === "right",
|
|
179
|
+
const I = r === "left" || r === "right", X = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
|
|
180
180
|
if (p)
|
|
181
181
|
return I ? `translateX(${c}px)` : `translateY(${c}px)`;
|
|
182
182
|
};
|
|
183
|
-
return
|
|
184
|
-
/* @__PURE__ */
|
|
183
|
+
return C(
|
|
184
|
+
/* @__PURE__ */ H(O, { children: [
|
|
185
185
|
/* @__PURE__ */ a(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
188
|
className: `nice-drawer__overlay ${e ? "nice-drawer__overlay--visible" : ""}`,
|
|
189
189
|
style: { zIndex: N },
|
|
190
|
-
onClick:
|
|
190
|
+
onClick: L
|
|
191
191
|
}
|
|
192
192
|
),
|
|
193
193
|
/* @__PURE__ */ a(
|
|
194
194
|
"div",
|
|
195
195
|
{
|
|
196
196
|
ref: (n) => {
|
|
197
|
-
y.current = n,
|
|
197
|
+
y.current = n, D.current = n;
|
|
198
198
|
},
|
|
199
199
|
className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
|
|
200
200
|
style: {
|
|
201
|
-
...
|
|
201
|
+
...X,
|
|
202
202
|
zIndex: N + 1,
|
|
203
203
|
transform: i(),
|
|
204
204
|
transition: p ? "none" : void 0,
|
|
@@ -230,11 +230,11 @@ const F = ({
|
|
|
230
230
|
className: y,
|
|
231
231
|
style: p
|
|
232
232
|
}) => {
|
|
233
|
-
const u = E(null), c = E(null), [t, g] =
|
|
233
|
+
const u = E(null), c = E(null), [t, g] = P(s), [h, S] = P(!1), [D, L] = P(0), I = E(0);
|
|
234
234
|
Y(() => {
|
|
235
|
-
e && (g(s),
|
|
235
|
+
e && (g(s), L(0));
|
|
236
236
|
}, [e, s]), j(u, e);
|
|
237
|
-
const
|
|
237
|
+
const X = W();
|
|
238
238
|
Y(() => {
|
|
239
239
|
if (!N || !e)
|
|
240
240
|
return;
|
|
@@ -251,14 +251,14 @@ const F = ({
|
|
|
251
251
|
}
|
|
252
252
|
}, [e]);
|
|
253
253
|
const i = b((f) => {
|
|
254
|
-
const w = f.target.closest(".nice-bottom-sheet__handle"), B = c.current,
|
|
255
|
-
!w && !
|
|
254
|
+
const w = f.target.closest(".nice-bottom-sheet__handle"), B = c.current, A = !B || B.scrollTop <= 0;
|
|
255
|
+
!w && !A || (S(!0), I.current = f.touches[0].clientY);
|
|
256
256
|
}, []), n = b(
|
|
257
257
|
(f) => {
|
|
258
258
|
if (!h)
|
|
259
259
|
return;
|
|
260
260
|
const w = f.touches[0].clientY - I.current;
|
|
261
|
-
(w > 0 || t < l.length - 1) &&
|
|
261
|
+
(w > 0 || t < l.length - 1) && L(w);
|
|
262
262
|
},
|
|
263
263
|
[h, t, l.length]
|
|
264
264
|
), _ = b(() => {
|
|
@@ -266,16 +266,16 @@ const F = ({
|
|
|
266
266
|
return;
|
|
267
267
|
const f = window.innerHeight;
|
|
268
268
|
l[t] * f;
|
|
269
|
-
const w = -
|
|
270
|
-
w > B && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -B && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())),
|
|
271
|
-
}, [h,
|
|
269
|
+
const w = -D, B = f * 0.15;
|
|
270
|
+
w > B && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -B && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())), S(!1), L(0);
|
|
271
|
+
}, [h, D, t, l, d, k, o]), R = b(() => {
|
|
272
272
|
x && o();
|
|
273
273
|
}, [x, o]);
|
|
274
274
|
if (!e)
|
|
275
275
|
return null;
|
|
276
|
-
const T = l[t] * 100, $ = h ?
|
|
277
|
-
return
|
|
278
|
-
/* @__PURE__ */
|
|
276
|
+
const T = l[t] * 100, $ = h ? D : 0;
|
|
277
|
+
return C(
|
|
278
|
+
/* @__PURE__ */ H(O, { children: [
|
|
279
279
|
/* @__PURE__ */ a(
|
|
280
280
|
"div",
|
|
281
281
|
{
|
|
@@ -284,7 +284,7 @@ const F = ({
|
|
|
284
284
|
onClick: R
|
|
285
285
|
}
|
|
286
286
|
),
|
|
287
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ H(
|
|
288
288
|
"div",
|
|
289
289
|
{
|
|
290
290
|
ref: u,
|
|
@@ -311,7 +311,7 @@ const F = ({
|
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
313
|
] }),
|
|
314
|
-
|
|
314
|
+
X
|
|
315
315
|
);
|
|
316
316
|
}, ae = ({
|
|
317
317
|
trigger: e,
|
|
@@ -325,22 +325,22 @@ const F = ({
|
|
|
325
325
|
className: x,
|
|
326
326
|
showArrow: N = !0
|
|
327
327
|
}) => {
|
|
328
|
-
const [k, M] =
|
|
328
|
+
const [k, M] = P(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
|
|
329
329
|
(i) => {
|
|
330
330
|
t || M(i), l?.(i);
|
|
331
331
|
},
|
|
332
332
|
[t, l]
|
|
333
333
|
);
|
|
334
|
-
|
|
334
|
+
z(p, () => {
|
|
335
335
|
r !== "manual" && g && h(!1);
|
|
336
336
|
});
|
|
337
|
-
const
|
|
337
|
+
const S = b(() => {
|
|
338
338
|
r === "click" && h(!g);
|
|
339
|
-
}, [r, g, h]),
|
|
339
|
+
}, [r, g, h]), D = b(() => {
|
|
340
340
|
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
|
|
341
|
-
}, [r, s, h]),
|
|
341
|
+
}, [r, s, h]), L = b(() => {
|
|
342
342
|
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
|
|
343
|
-
}, [r, s, h]), [I,
|
|
343
|
+
}, [r, s, h]), [I, X] = P({ top: 0, left: 0 });
|
|
344
344
|
return Y(() => {
|
|
345
345
|
if (!g || !y.current || !p.current)
|
|
346
346
|
return;
|
|
@@ -361,22 +361,22 @@ const F = ({
|
|
|
361
361
|
T = i.top + (i.height - n.height) / 2, $ = i.right + d;
|
|
362
362
|
break;
|
|
363
363
|
}
|
|
364
|
-
f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)),
|
|
365
|
-
}, [g, m, d]), /* @__PURE__ */
|
|
364
|
+
f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), X({ top: T, left: $ });
|
|
365
|
+
}, [g, m, d]), /* @__PURE__ */ H(O, { children: [
|
|
366
366
|
/* @__PURE__ */ a(
|
|
367
367
|
"div",
|
|
368
368
|
{
|
|
369
369
|
ref: y,
|
|
370
370
|
className: "nice-popover__trigger",
|
|
371
|
-
onClick:
|
|
372
|
-
onMouseEnter:
|
|
373
|
-
onMouseLeave:
|
|
371
|
+
onClick: S,
|
|
372
|
+
onMouseEnter: D,
|
|
373
|
+
onMouseLeave: L,
|
|
374
374
|
style: { display: "inline-block" },
|
|
375
375
|
children: e
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
g &&
|
|
379
|
-
/* @__PURE__ */
|
|
378
|
+
g && C(
|
|
379
|
+
/* @__PURE__ */ H(
|
|
380
380
|
"div",
|
|
381
381
|
{
|
|
382
382
|
ref: p,
|
|
@@ -387,8 +387,8 @@ const F = ({
|
|
|
387
387
|
left: I.left,
|
|
388
388
|
zIndex: 1100
|
|
389
389
|
},
|
|
390
|
-
onMouseEnter:
|
|
391
|
-
onMouseLeave:
|
|
390
|
+
onMouseEnter: D,
|
|
391
|
+
onMouseLeave: L,
|
|
392
392
|
role: "tooltip",
|
|
393
393
|
children: [
|
|
394
394
|
N && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
|
|
@@ -406,8 +406,8 @@ const F = ({
|
|
|
406
406
|
onClose: r,
|
|
407
407
|
className: v
|
|
408
408
|
}) => {
|
|
409
|
-
const [l, s] =
|
|
410
|
-
|
|
409
|
+
const [l, s] = P(!1), [d, x] = P({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
|
|
410
|
+
z(N, () => {
|
|
411
411
|
l && (s(!1), r?.());
|
|
412
412
|
});
|
|
413
413
|
const y = b(
|
|
@@ -429,7 +429,7 @@ const F = ({
|
|
|
429
429
|
};
|
|
430
430
|
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
431
431
|
}, [l, r]);
|
|
432
|
-
const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */
|
|
432
|
+
const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ H(
|
|
433
433
|
"button",
|
|
434
434
|
{
|
|
435
435
|
type: "button",
|
|
@@ -443,9 +443,9 @@ const F = ({
|
|
|
443
443
|
]
|
|
444
444
|
}
|
|
445
445
|
) }, t.key)) });
|
|
446
|
-
return /* @__PURE__ */
|
|
446
|
+
return /* @__PURE__ */ H(O, { children: [
|
|
447
447
|
/* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
|
|
448
|
-
l &&
|
|
448
|
+
l && C(
|
|
449
449
|
/* @__PURE__ */ a(
|
|
450
450
|
"div",
|
|
451
451
|
{
|