dhx-react-suite 1.1.9 → 1.2.0

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.
@@ -1,4 +1,4 @@
1
- (function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("recharts")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","recharts"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V.DhxReactSuite={},V.ReactJSXRuntime,V.React,V.Recharts))})(this,function(V,e,g,Q){"use strict";const t={primary:"#0288d1",primaryDk:"#01579b",primaryLt:"#e1f5fe",success:"#43a047",danger:"#e53935",warning:"#fb8c00",bg:"#f5f7fa",surface:"#ffffff",border:"#dde3ea",borderDk:"#b0bec5",text:"#3d4a5c",textSec:"#6b7a8d",textMut:"#9aa5b1",shadow:"0 2px 8px rgba(0,0,0,.10)",shadowLg:"0 8px 28px rgba(0,0,0,.14)",r:"4px",rMd:"8px",font:"'Segoe UI', system-ui, -apple-system, sans-serif"},De="dhx-react-styles";function Z(){if(typeof document>"u"||document.getElementById(De))return;const r=document.createElement("style");r.id=De,r.textContent=`
1
+ (function(q,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("recharts")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","recharts"],e):(q=typeof globalThis<"u"?globalThis:q||self,e(q.DhxReactSuite={},q.ReactJSXRuntime,q.React,q.Recharts))})(this,function(q,e,g,Z){"use strict";const t={primary:"#0288d1",primaryDk:"#01579b",primaryLt:"#e1f5fe",success:"#43a047",danger:"#e53935",warning:"#fb8c00",bg:"#f5f7fa",surface:"#ffffff",border:"#dde3ea",borderDk:"#b0bec5",text:"#3d4a5c",textSec:"#6b7a8d",textMut:"#9aa5b1",shadow:"0 2px 8px rgba(0,0,0,.10)",shadowLg:"0 8px 28px rgba(0,0,0,.14)",r:"4px",rMd:"8px",font:"'Segoe UI', system-ui, -apple-system, sans-serif"},Te="dhx-react-styles";function R(){if(typeof document>"u"||document.getElementById(Te))return;const r=document.createElement("style");r.id=Te,r.textContent=`
2
2
  *,*::before,*::after{box-sizing:border-box}
3
3
  .dhx{font-family:${t.font};font-size:14px;color:${t.text}}
4
4
  .dhx *{box-sizing:border-box}
@@ -38,5 +38,4 @@
38
38
  .dhx-tag-success{background:#e8f5e9;color:#1b5e20}
39
39
  .dhx-tag-danger{background:#ffebee;color:#b71c1c}
40
40
  .dhx-tag-warning{background:#fff3e0;color:#e65100}
41
- `,document.head.appendChild(r)}const _e={sm:{height:24,padding:"0 8px",fontSize:12},md:{},lg:{height:38,padding:"0 18px",fontSize:14}};function Ve({children:r,variant:s="primary",size:d="md",icon:l,disabled:p,onClick:i,style:u,className:h=""}){return g.useEffect(Z,[]),e.jsxs("button",{className:`dhx dhx-btn dhx-btn-${s} ${h}`,style:{..._e[d],...u},disabled:p,onClick:i,children:[l&&e.jsx("span",{style:{fontSize:16},children:l}),r]})}function de(r,s){g.useEffect(()=>{const d=l=>{r.current&&!r.current.contains(l.target)&&s(l)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r,s])}function Le(r){const s=g.useRef(!1),d=g.useRef({x:0,y:0,ox:0,oy:0});return g.useCallback((l,p=0,i=0)=>{s.current=!0,d.current={x:l.clientX,y:l.clientY,ox:p,oy:i};const u=x=>{if(!s.current)return;const{x:z,y:n,ox:b,oy:f}=d.current;r(b+x.clientX-z,f+x.clientY-n)},h=()=>{s.current=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h),l.preventDefault()},[r])}function ce({items:r,onSelect:s,style:d}){const[l,p]=g.useState(null);return e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:180,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,zIndex:200,padding:"4px 0",...d},children:r.map((i,u)=>{var x,z;if(i.type==="separator")return e.jsx("div",{style:{height:1,background:t.border,margin:"4px 0"}},u);const h=l===u;return e.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>p(u),onMouseLeave:()=>p(null),children:[e.jsxs("div",{onClick:()=>{var n;return!i.disabled&&!((n=i.items)!=null&&n.length)&&s(i)},style:{display:"flex",alignItems:"center",gap:8,padding:"8px 14px",cursor:i.disabled?"not-allowed":"pointer",fontSize:13,color:i.disabled?t.textMut:t.text,background:h&&!i.disabled?t.bg:"transparent",opacity:i.disabled?.5:1},children:[i.icon&&e.jsx("span",{style:{fontSize:15,width:18,textAlign:"center"},children:i.icon}),e.jsx("span",{style:{flex:1},children:i.value||i.id}),i.hotkey&&e.jsx("span",{style:{fontSize:11,color:t.textMut},children:i.hotkey}),(x=i.items)!=null&&x.length?e.jsx("span",{style:{fontSize:10,color:t.textMut},children:"▶"}):null]}),h&&((z=i.items)!=null&&z.length)?e.jsx(ce,{items:i.items,onSelect:s,style:{position:"absolute",left:"100%",top:-4}}):null]},i.id||u)})})}function Xe({items:r=[],label:s="Menu",onSelect:d,style:l}){const[p,i]=g.useState(!1),u=g.useRef(null);return g.useEffect(Z,[]),de(u,g.useCallback(()=>i(!1),[])),e.jsxs("div",{ref:u,className:"dhx",style:{position:"relative",display:"inline-block",...l},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:()=>i(h=>!h),children:[s," ",e.jsx("span",{style:{fontSize:10},children:p?"▲":"▼"})]}),p&&e.jsx(ce,{items:r,onSelect:h=>{d==null||d(h),i(!1)}})]})}function qe({items:r=[],onSelect:s,children:d}){const[l,p]=g.useState(null),i=g.useRef(null);g.useEffect(Z,[]),de(i,g.useCallback(()=>p(null),[]));const u=h=>{h.preventDefault(),p({x:h.clientX,y:h.clientY})};return e.jsxs("div",{ref:i,onContextMenu:u,style:{position:"relative",display:"contents"},children:[d,l&&e.jsx("div",{style:{position:"fixed",left:l.x,top:l.y,zIndex:9999},children:e.jsx(ce,{items:r,onSelect:h=>{s==null||s(h),p(null)}})})]})}function Te({count:r}){return e.jsx("span",{style:{position:"absolute",top:2,right:2,minWidth:16,height:16,background:t.danger,color:"#fff",borderRadius:8,fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,pointerEvents:"none"},children:r})}function Ge({items:r=[],onAction:s,style:d}){const[l,p]=g.useState(null),[i,u]=g.useState(()=>{const n={};return r.forEach(b=>{b.id&&(b.twoState||b.group)&&b.active&&(n[b.id]=!0)}),n}),h=g.useRef(null);g.useEffect(Z,[]),de(h,g.useCallback(()=>p(null),[]));const x=(n,b)=>{var f,M;if(!n.disabled){if(n.twoState&&n.id&&u(I=>({...I,[n.id]:!I[n.id]})),n.group&&n.id&&u(I=>{const a={...I};return r.forEach(w=>{w.group===n.group&&w.id&&(a[w.id]=!1)}),a[n.id]=!0,a}),(f=n.items)!=null&&f.length){p(I=>I===b?null:b);return}(M=n.onClick)==null||M.call(n,n.id||""),s==null||s(n.id||"")}},z=(n,b)=>{var a,w;if(n.hidden)return null;if(n.type==="separator")return e.jsx("div",{style:{width:1,background:t.border,margin:"6px 4px",alignSelf:"stretch"}},b);if(n.type==="spacer")return e.jsx("div",{style:{flex:1}},b);if(n.type==="input")return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[n.label&&e.jsx("span",{style:{fontSize:12,color:t.textSec,fontWeight:500},children:n.label}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[n.icon&&e.jsx("span",{style:{position:"absolute",left:8,color:t.textMut,fontSize:15,pointerEvents:"none",zIndex:1},children:n.icon}),e.jsx("input",{className:"dhx dhx-input",style:{width:n.width||140,height:28,paddingLeft:n.icon?30:void 0},placeholder:n.placeholder,defaultValue:n.value,onChange:$=>{var L;return(L=n.onChange)==null?void 0:L.call(n,$.target.value)}})]})]},b);if(n.type==="select")return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[n.label&&e.jsx("span",{style:{fontSize:12,color:t.textSec,fontWeight:500},children:n.label}),e.jsx("select",{className:"dhx dhx-input",style:{width:n.width||100,height:28,cursor:"pointer"},defaultValue:n.value,onChange:$=>{var L;return(L=n.onChange)==null?void 0:L.call(n,$.target.value)},children:(a=n.options)==null?void 0:a.map($=>e.jsx("option",{value:$.value,children:$.label},$.value))})]},b);if(n.type==="imageButton")return e.jsxs("button",{title:n.tooltip,disabled:n.disabled,style:{position:"relative",width:32,height:32,padding:2,border:"none",borderRadius:"50%",overflow:"hidden",cursor:n.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0},onClick:()=>x(n,b),children:[n.src&&e.jsx("img",{src:n.src,alt:n.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),n.count!==void 0&&e.jsx(Te,{count:n.count})]},b);const f=!!(n.id&&i[n.id]),M=n.value??n.text,I=!!((w=n.items)!=null&&w.length);return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-ghost",title:n.tooltip,disabled:n.disabled,style:{height:32,gap:4,position:"relative",background:f?t.primaryLt:"transparent",color:f?t.primary:n.disabled?t.textMut:t.text,opacity:n.disabled?.55:1,cursor:n.disabled?"not-allowed":"pointer"},onClick:()=>x(n,b),children:[n.icon&&e.jsx("span",{style:{fontSize:16},children:n.icon}),M&&e.jsx("span",{style:{fontSize:13},children:M}),I&&e.jsx("span",{style:{fontSize:9,opacity:.55,marginLeft:2},children:"▼"}),n.count!==void 0&&e.jsx(Te,{count:n.count})]}),I&&l===b&&e.jsx(ce,{items:n.items,onSelect:()=>p(null),style:{top:"100%",left:0}})]},b)};return e.jsx("div",{ref:h,className:"dhx",style:{display:"flex",alignItems:"center",gap:2,padding:"4px 8px",background:t.surface,borderBottom:`1px solid ${t.border}`,minHeight:44,flexWrap:"wrap",...d},children:r.map(z)})}function Je(r){return r==="primary"?t.primary:r==="success"?"#43a047":r==="secondary"?"#9e9e9e":"#e53935"}function Ue(r,s){const d=[],l=p=>{var i;p.id&&p.group===s&&d.push(p.id),(i=p.items)==null||i.forEach(l)};return r.forEach(l),d}function Qe(r){const s={},d=l=>{var p;l.id&&l.twoState&&l.active&&(s[l.id]=!0),(p=l.items)==null||p.forEach(d)};return r.forEach(d),s}function Ze({items:r=[],width:s=240,minWidth:d=64,header:l,footer:p,collapsed:i,defaultCollapsed:u,selected:h,defaultSelected:x,onSelect:z,onCollapse:n,onExpand:b,onBeforeCollapse:f,onBeforeExpand:M,onToggleItem:I,style:a}){const w=i!==void 0,$=h!==void 0,[L,A]=g.useState(u??!1),[C,D]=g.useState(x??null),[K,c]=g.useState({}),[N,H]=g.useState(()=>Qe(r));g.useEffect(Z,[]);const k=w?i:L,U=$?h??null:C,R=k?d:s,o=()=>{if(k){if((M==null?void 0:M())===!1)return;w||A(!1),b==null||b()}else{if((f==null?void 0:f())===!1)return;w||A(!0),n==null||n()}},W=v=>{$||D(v.id??null),z==null||z(v),v.id&&v.onClick&&v.onClick(v.id)},_=v=>{if(!v.id)return;const j=!N[v.id];let Y={...N,[v.id]:j};v.group&&j&&Ue(r,v.group).forEach(J=>{J!==v.id&&(Y[J]=!1)}),H(Y),I==null||I(v.id,j)},m=(v,j)=>{if(v.count===void 0)return null;const Y=Je(v.countColor),J=v.count>99?"99+":String(v.count);return j?e.jsx("span",{style:{position:"absolute",top:1,right:1,background:Y,color:"#fff",borderRadius:8,fontSize:9,fontWeight:700,padding:"0 3px",minWidth:14,textAlign:"center",lineHeight:"14px",pointerEvents:"none"},children:J}):e.jsx("span",{style:{background:Y,color:"#fff",borderRadius:10,padding:"1px 6px",fontSize:11,fontWeight:700,flexShrink:0},children:J})},S=(v,j,Y)=>{var ae;if(v.hidden)return null;const J=v.id??`${v.type??"navItem"}-${j}-${Y}`,X=v.type??"navItem";if(X==="separator")return e.jsx("div",{style:{height:1,background:t.border,margin:"6px 8px",flexShrink:0}},J);if(X==="spacer")return e.jsx("div",{style:{flex:1}},J);if(X==="title")return k?null:e.jsx("div",{style:{padding:"10px 14px 4px",fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:1,color:t.textMut,flexShrink:0},children:v.value},J);if(X==="customHTML")return e.jsx("div",{dangerouslySetInnerHTML:{__html:v.html??""},style:{padding:"8px 12px",flexShrink:0}},J);const G=(((ae=v.items)==null?void 0:ae.length)??0)>0,ee=!!K[v.id??""],te=v.twoState?!!N[v.id??""]:!1,re=!v.twoState&&U===v.id||te,P=!!v.disabled,ie=k?0:12+j*16,Me=()=>{P||(v.twoState?(_(v),W(v)):(G&&c(le=>({...le,[v.id??""]:!le[v.id??""]})),W(v)))};return e.jsxs("div",{style:{flexShrink:0},children:[e.jsxs("div",{title:v.tooltip,onClick:Me,style:{display:"flex",alignItems:"center",gap:k?0:8,justifyContent:k?"center":"flex-start",paddingTop:8,paddingBottom:8,paddingLeft:k?0:ie,paddingRight:k?0:10,borderRadius:t.r,margin:"1px 6px",cursor:P?"not-allowed":"pointer",userSelect:"none",transition:"background .15s",background:re?t.primaryLt:"transparent",color:P?t.textMut:re?t.primary:t.text,opacity:P?.55:1},onMouseEnter:le=>{!re&&!P&&(le.currentTarget.style.background=t.bg)},onMouseLeave:le=>{!re&&!P&&(le.currentTarget.style.background="transparent")},children:[e.jsxs("span",{style:{position:"relative",minWidth:22,textAlign:"center",fontSize:18,flexShrink:0,lineHeight:1},children:[v.icon??(v.value&&!v.icon,null),k&&m(v,!0)]}),!k&&e.jsx("span",{style:{flex:1,fontSize:13,fontWeight:re?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.value}),!k&&m(v,!1),!k&&v.twoState&&e.jsx("span",{style:{width:14,height:14,borderRadius:2,border:`2px solid ${re?t.primary:t.borderDk}`,background:re?t.primary:"transparent",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:re&&e.jsx("span",{style:{color:"#fff",fontSize:8,fontWeight:700,lineHeight:1},children:"✓"})}),!k&&G&&!v.twoState&&e.jsx("span",{style:{fontSize:11,color:t.textMut,flexShrink:0,transition:"transform .2s",transform:ee?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})]}),G&&ee&&!k&&e.jsx("div",{children:v.items.map((le,ge)=>S(le,j+1,ge))})]},J)},T=e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:k?"center":"flex-start",gap:8,padding:k?"8px 0":"8px 14px",margin:"4px 6px",borderRadius:t.r,cursor:"pointer",color:t.textMut,fontSize:13,userSelect:"none",transition:"background .15s",flexShrink:0},onMouseEnter:v=>v.currentTarget.style.background=t.bg,onMouseLeave:v=>v.currentTarget.style.background="transparent",children:[e.jsx("span",{style:{fontSize:16,fontWeight:700,lineHeight:1},children:k?"›":"‹"}),!k&&e.jsx("span",{children:"Collapse"})]});return e.jsxs("div",{className:"dhx",style:{width:R,minWidth:R,background:t.surface,borderRight:`1px solid ${t.border}`,display:"flex",flexDirection:"column",transition:"width .2s ease, min-width .2s ease",overflow:"hidden",...a},children:[l&&e.jsx("div",{style:{padding:k?"12px 0":"12px 14px",borderBottom:`1px solid ${t.border}`,fontWeight:700,fontSize:15,display:"flex",alignItems:"center",justifyContent:k?"center":"flex-start",overflow:"hidden",flexShrink:0},children:l}),e.jsx("div",{className:"dhx-scroll",style:{flex:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:r.map((v,j)=>S(v,0,j))}),T,p&&!k&&e.jsx("div",{style:{padding:"10px 14px",borderTop:`1px solid ${t.border}`,flexShrink:0},children:p})]})}function Re({config:r}){const[s,d]=g.useState(!1),l={position:"relative",background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden",...r.width?{width:r.width,minWidth:r.width}:{flex:1},...r.height?{height:r.height,minHeight:r.height}:{minHeight:40},...s?{flex:"0 0 auto"}:{}};return e.jsxs("div",{style:l,children:[r.header&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",background:t.bg,borderBottom:`1px solid ${t.border}`,fontSize:12,fontWeight:600,color:t.textSec,userSelect:"none"},children:[e.jsx("span",{children:r.header}),r.collapsable&&e.jsx("button",{onClick:()=>d(p=>!p),style:{background:"none",border:"none",cursor:"pointer",color:t.textMut,fontSize:16,lineHeight:1},children:s?"▼":"▲"})]}),!s&&e.jsxs("div",{style:{padding:r.padding||0,height:r.header?"calc(100% - 33px)":"100%",overflow:"auto"},children:[r.html?e.jsx("div",{dangerouslySetInnerHTML:{__html:r.html}}):r.content,(r.rows||r.cols)&&e.jsx(Ee,{rows:r.rows,cols:r.cols,style:{height:"100%"}})]})]})}function Ee({rows:r,cols:s,type:d="line",style:l,children:p}){g.useEffect(Z,[]);const i=d==="space"?12:d==="wide"?8:1,u=r||s,h=!!r;return u?e.jsx("div",{className:"dhx",style:{display:"flex",flexDirection:h?"column":"row",gap:i,width:"100%",height:"100%",...l},children:u.map((x,z)=>e.jsx(Re,{config:x},x.id||z))}):e.jsx("div",{className:"dhx",style:{width:"100%",height:"100%",...l},children:p})}function et({views:r=[],mode:s="top",tabAlign:d="left",closable:l=[],disabled:p=[],defaultActive:i,onBeforeChange:u,onChange:h,style:x}){var C;const[z,n]=g.useState(i||((C=r[0])==null?void 0:C.id)),[b,f]=g.useState(r.map(D=>D.id));g.useEffect(Z,[]);const M=(D,K)=>{D.stopPropagation(),f(c=>c.filter(N=>N!==K)),z===K&&n(b.find(c=>c!==K)??"")},I=D=>{p.includes(D)||u&&u(D)===!1||(n(D),h==null||h(D))},a=s==="left"||s==="right",w=r.filter(D=>b.includes(D.id)),$=e.jsx("div",{style:{display:"flex",flexDirection:a?"column":"row",justifyContent:d==="center"?"center":d==="right"?"flex-end":"flex-start",background:t.surface,borderBottom:!a&&s!=="bottom"?`2px solid ${t.border}`:"none",borderTop:s==="bottom"?`2px solid ${t.border}`:"none",borderRight:s==="left"?`2px solid ${t.border}`:"none",borderLeft:s==="right"?`2px solid ${t.border}`:"none",overflowX:"auto",flexShrink:0},children:w.map(D=>{const K=z===D.id,c=p.includes(D.id),N=s==="bottom"?{borderTop:`2px solid ${t.primary}`,color:t.primary,fontWeight:600}:a?{color:t.primary,fontWeight:600,background:t.primaryLt,[s==="left"?"borderRight":"borderLeft"]:`2px solid ${t.primary}`}:{borderBottom:`2px solid ${t.primary}`,color:t.primary,fontWeight:600};return e.jsxs("div",{onClick:()=>I(D.id),style:{display:"flex",alignItems:"center",gap:6,padding:"10px 16px",cursor:c?"not-allowed":"pointer",whiteSpace:"nowrap",fontSize:13,transition:"color .15s",userSelect:"none",minWidth:a?120:"auto",...K?N:{color:c?t.textMut:t.textSec}},children:[D.icon&&e.jsx("span",{style:{fontSize:16},children:D.icon}),e.jsx("span",{children:D.tab}),l.includes(D.id)&&e.jsx("span",{onClick:H=>M(H,D.id),style:{marginLeft:4,opacity:.6,fontSize:12,cursor:"pointer"},children:"✕"})]},D.id)})}),L=w.find(D=>D.id===z),A=e.jsxs("div",{className:"dhx-scroll",style:{flex:1,overflow:"auto"},children:[L==null?void 0:L.content,(L==null?void 0:L.html)&&e.jsx("div",{dangerouslySetInnerHTML:{__html:L.html},style:{padding:16}})]});return e.jsxs("div",{className:"dhx",style:{display:"flex",flexDirection:s==="top"?"column":s==="bottom"?"column-reverse":s==="left"?"row":"row-reverse",width:"100%",height:"100%",background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden",...x},children:[$,A]})}const ue=`1px solid ${t.border}`;function tt({active:r,dir:s}){return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:1,flexShrink:0,marginLeft:4},children:[e.jsx("svg",{width:"7",height:"4",viewBox:"0 0 7 4",children:e.jsx("path",{d:"M3.5 0L7 4H0z",fill:r&&s==="asc"?t.primary:t.borderDk})}),e.jsx("svg",{width:"7",height:"4",viewBox:"0 0 7 4",children:e.jsx("path",{d:"M3.5 4L0 0H7z",fill:r&&s==="desc"?t.primary:t.borderDk})})]})}function rt({options:r,value:s,onChange:d,onCommit:l,onCancel:p}){const[i,u]=g.useState(s),[h,x]=g.useState(!0),z=g.useRef(null);g.useEffect(()=>{const b=f=>{z.current&&!z.current.contains(f.target)&&l()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[l]);const n=r.filter(b=>!i||b.toLowerCase().includes(i.toLowerCase()));return e.jsxs("div",{ref:z,style:{width:"100%",position:"relative"},children:[e.jsx("input",{autoFocus:!0,value:i,onChange:b=>{u(b.target.value),d(b.target.value),x(!0)},onKeyDown:b=>{b.key==="Enter"&&l(),b.key==="Escape"&&p()},onClick:b=>b.stopPropagation(),style:{width:"100%",border:"none",outline:`2px solid ${t.primary}`,borderRadius:2,fontSize:13,padding:"2px 4px",background:t.surface,color:t.text}}),h&&n.length>0&&e.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,maxHeight:160,overflowY:"auto"},children:n.map(b=>e.jsx("div",{onMouseDown:f=>{f.preventDefault(),d(b),u(b),x(!1),l()},style:{padding:"6px 10px",cursor:"pointer",fontSize:13,color:t.text},onMouseEnter:f=>f.currentTarget.style.background=t.bg,onMouseLeave:f=>f.currentTarget.style.background=t.surface,children:b},b))})]})}function nt(r,s){if(r==null)return"";if(s==="number")return typeof r=="number"?r.toLocaleString():String(r);if(s==="date"){const d=r instanceof Date?r:new Date(String(r));return isNaN(d.getTime())?String(r):d.toLocaleDateString()}return String(r)}function ot(r,s,d){return r==null?1:s==null?-1:d==="date"?new Date(String(r)).getTime()-new Date(String(s)).getTime():d==="number"?Number(r)-Number(s):String(r)<String(s)?-1:String(r)>String(s)?1:0}function ye(r){var s;return Array.isArray(r.header)&&((s=r.header[1])==null?void 0:s.content)!=null?r.header[1].content:r.filterable?r.filterType==="select"?"selectFilter":"inputFilter":null}function st(r,s,d,l,p){const i={width:"100%",border:"none",outline:`2px solid ${t.primary}`,borderRadius:2,fontSize:13,padding:"2px 4px",background:t.surface,color:t.text},u=r.editorType??"input";if(u==="select")return e.jsx("select",{autoFocus:!0,value:s,onChange:x=>d(x.target.value),onBlur:l,onKeyDown:x=>{x.key==="Enter"&&l(),x.key==="Escape"&&p()},onClick:x=>x.stopPropagation(),style:{...i,cursor:"pointer"},children:(r.options??[]).map(x=>e.jsx("option",{value:x,children:x},x))});if(u==="combobox")return e.jsx(rt,{options:r.options??[],value:s,onChange:d,onCommit:l,onCancel:p});const h=r.type==="number"?"number":r.type==="date"?"date":"text";return e.jsx("input",{autoFocus:!0,type:h,value:s,onChange:x=>d(x.target.value),onBlur:l,onKeyDown:x=>{x.key==="Enter"&&l(),x.key==="Escape"&&p()},onClick:x=>x.stopPropagation(),style:i})}function lt({columns:r,data:s=[],height:d=400,rowHeight:l=40,headerRowHeight:p=40,footerRowHeight:i=40,sortable:u=!0,resizable:h=!0,editable:x=!1,stripe:z=!1,autoWidth:n=!1,keyNavigation:b=!1,selection:f,multiselect:M,leftSplit:I=0,onSelect:a,onChange:w,style:$}){var Pe;const[L,A]=g.useState(null),[C,D]=g.useState("asc"),[K,c]=g.useState({}),[N,H]=g.useState(new Set),[k,U]=g.useState(-1),[R,o]=g.useState(()=>Object.fromEntries(r.map(y=>[y.id,y.width??y.minWidth??150]))),[W,_]=g.useState(null),[m,S]=g.useState(""),[T,v]=g.useState({}),j=g.useRef(null),[Y,J]=g.useState(0);g.useEffect(Z,[]),g.useEffect(()=>{if(!n||!j.current)return;const y=new ResizeObserver(()=>{var E;return J(((E=j.current)==null?void 0:E.offsetWidth)??0)});return y.observe(j.current),()=>y.disconnect()},[n]);const X=g.useMemo(()=>r.map(y=>y.summary&&(!y.footer||y.footer.length===0)?{...y,footer:[{summary:y.summary}]}:y),[r]),G=g.useMemo(()=>X.filter(y=>!y.hidden),[X]),ee=g.useMemo(()=>{if(!n||Y===0)return R;const y=G.reduce((B,F)=>B+(R[F.id]??150),0);if(Y<=y)return R;const E=(Y-y)/G.length;return Object.fromEntries(G.map(B=>[B.id,(R[B.id]??150)+E]))},[n,Y,R,G]),te=g.useMemo(()=>{let y=s.map((E,B)=>{const F=String(E.id??B);return T[F]?{...E,...T[F]}:E}).filter(E=>Object.entries(K).every(([B,F])=>!F||String(E[B]??"").toLowerCase().includes(F.toLowerCase())));if(L){const E=X.find(B=>B.id===L);y=[...y].sort((B,F)=>{const q=ot(B[L],F[L],E==null?void 0:E.type);return C==="asc"?q:-q})}return y},[s,L,C,K,T,X]),pe=g.useMemo(()=>{const y={};return X.forEach(E=>{var B;if((B=E.footer)!=null&&B.some(F=>F.summary)){const F=te.map(O=>Number(O[E.id])).filter(O=>!isNaN(O)),q=F.reduce((O,ne)=>O+ne,0);y[E.id]={sum:q,avg:F.length?q/F.length:0,count:te.length,min:F.length?Math.min(...F):0,max:F.length?Math.max(...F):0}}}),y},[te,X]),re=g.useMemo(()=>{const y={};return G.filter(E=>{const B=ye(E);return B==="selectFilter"||B==="comboFilter"}).forEach(E=>{y[E.id]=[...new Set(s.map(B=>String(B[E.id]??"")))].sort()}),y},[s,G]),P=G.some(y=>ye(y)!==null),ie=X.some(y=>{var E;return(E=y.footer)==null?void 0:E.length}),Me=G.reduce((y,E)=>y+(ee[E.id]??150),0),ae=g.useMemo(()=>{if(!I)return{};let y=0;const E={};return G.forEach((B,F)=>{F<I&&(E[B.id]=y,y+=ee[B.id]??150)}),E},[I,G,ee]),le=I>0?(Pe=G[I-1])==null?void 0:Pe.id:null,ge=(y,E)=>y.id??E,Et=y=>{!u||y.sortable===!1||(D(E=>L===y.id&&E==="asc"?"desc":"asc"),A(y.id))},Ce=(y,E)=>{if(!f)return;const B=ge(y,E);U(E),H(F=>{const q=M?new Set(F):new Set;return q.has(B)?q.delete(B):q.add(B),q}),a==null||a(y)},It=()=>{if(!W)return;const{key:y,colId:E}=W;v(F=>({...F,[String(y)]:{...F[String(y)]||{},[E]:m}}));const B=te.find((F,q)=>ge(F,q)===y);B&&(w==null||w(B,E,m)),_(null)},Nt=y=>{if(W&&y.key==="Escape"){_(null);return}if(!(!b||!f)){if(y.key==="ArrowDown"){y.preventDefault();const E=Math.min(k+1,te.length-1);E>=0&&Ce(te[E],E)}else if(y.key==="ArrowUp"){y.preventDefault();const E=Math.max(k-1,0);E>=0&&Ce(te[E],E)}}},Wt=(y,E)=>{y.preventDefault(),y.stopPropagation();const B=y.clientX,F=R[E]??150,q=r.find(oe=>oe.id===E),O=oe=>o(he=>({...he,[E]:Math.max((q==null?void 0:q.minWidth)||50,F+oe.clientX-B)})),ne=()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",ne)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",ne)},$e=(y,E,B,F,q,O="hidden")=>{const ne=y in ae;return{width:E,minWidth:E,flexShrink:0,boxSizing:"border-box",padding:"0 12px",height:q,display:"flex",alignItems:"center",overflow:O,textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:13,textAlign:B,justifyContent:B==="center"?"center":B==="right"?"flex-end":"flex-start",borderLeft:F?"none":ue,position:ne?"sticky":"relative",...ne?{left:ae[y],zIndex:1,boxShadow:y===le?"2px 0 6px rgba(0,0,0,0.1)":void 0}:{}}};return e.jsx("div",{ref:j,className:"dhx",tabIndex:b?0:void 0,onKeyDown:Nt,style:{width:"100%",height:d,display:"flex",flexDirection:"column",border:ue,borderRadius:t.r,overflow:"hidden",outline:"none",...$},children:e.jsx("div",{className:"dhx-scroll",style:{overflow:"auto",flex:1},children:e.jsxs("div",{style:{minWidth:Me,display:"flex",flexDirection:"column",minHeight:"100%"},children:[e.jsx("div",{style:{display:"flex",background:t.bg,borderBottom:ue,flexShrink:0,position:"sticky",top:0,zIndex:3},children:G.map((y,E)=>{const B=Array.isArray(y.header)?y.header[0]:null,F=(B==null?void 0:B.text)??(typeof y.header=="string"?y.header:y.id),q=(B==null?void 0:B.align)??y.align,O=ee[y.id]??150,ne=y.id in ae;return e.jsxs("div",{onClick:()=>Et(y),style:{...$e(y.id,O,q,E===0,p),fontWeight:500,color:t.text,background:t.bg,cursor:u&&y.sortable!==!1?"pointer":"default",userSelect:"none",...ne?{zIndex:4}:{}},children:[B!=null&&B.htmlEnable?e.jsx("span",{style:{flex:1,overflow:"hidden"},dangerouslySetInnerHTML:{__html:F}}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F}),u&&y.sortable!==!1&&e.jsx(tt,{active:L===y.id,dir:C}),h&&y.resizable!==!1&&E<G.length-1&&e.jsx("div",{onMouseDown:oe=>Wt(oe,y.id),onClick:oe=>oe.stopPropagation(),style:{position:"absolute",right:0,top:0,bottom:0,width:4,cursor:"col-resize",zIndex:1},onMouseEnter:oe=>oe.currentTarget.style.background=t.primary+"55",onMouseLeave:oe=>oe.currentTarget.style.background="transparent"})]},y.id)})}),P&&e.jsx("div",{style:{display:"flex",borderBottom:ue,background:t.surface,flexShrink:0,...I?{position:"sticky",top:p,zIndex:3}:{}},children:G.map((y,E)=>{const B=ye(y),F=ee[y.id]??150,q=y.id in ae;return e.jsx("div",{style:{width:F,minWidth:F,flexShrink:0,padding:"4px 6px",boxSizing:"border-box",borderLeft:E===0?"none":ue,background:t.surface,...q?{position:"sticky",left:ae[y.id],zIndex:4,boxShadow:y.id===le?"2px 0 6px rgba(0,0,0,0.1)":void 0}:{}},children:B==="selectFilter"||B==="comboFilter"?e.jsxs("select",{className:"dhx dhx-input",style:{height:26,fontSize:12,padding:"0 4px"},value:K[y.id]||"",onChange:O=>c(ne=>({...ne,[y.id]:O.target.value})),children:[e.jsx("option",{value:"",children:"All"}),(re[y.id]||[]).map(O=>e.jsx("option",{value:O,children:O},O))]}):B==="inputFilter"?e.jsx("input",{className:"dhx dhx-input",style:{height:26,fontSize:12},placeholder:"Filter...",value:K[y.id]||"",onChange:O=>c(ne=>({...ne,[y.id]:O.target.value}))}):null},y.id)})}),e.jsxs("div",{style:{flex:1},children:[te.map((y,E)=>{const B=ge(y,E),F=N.has(B),q=F?t.primaryLt:z&&E%2!==0?t.bg:t.surface;return e.jsx("div",{style:{display:"flex",height:l,borderBottom:ue,flexShrink:0,background:q,transition:"background .1s",cursor:f?"pointer":"default"},onMouseEnter:O=>!F&&(O.currentTarget.style.background=t.primaryLt+"80"),onMouseLeave:O=>!F&&(O.currentTarget.style.background=q),children:G.map((O,ne)=>{const oe=(W==null?void 0:W.key)===B&&(W==null?void 0:W.colId)===O.id,he=y[O.id],Bt=ee[O.id]??150,Fe=(x||O.editable)&&O.editable!==!1;let fe;return oe?fe=st(O,m,S,It,()=>_(null)):O.template?fe=O.template(he,y):O.htmlEnable?fe=e.jsx("span",{dangerouslySetInnerHTML:{__html:String(he??"")}}):O.type==="boolean"?fe=e.jsx("input",{type:"checkbox",readOnly:!0,checked:!!he,style:{width:16,height:16,accentColor:t.primary,cursor:Fe?"pointer":"default"}}):fe=nt(he,O.type),e.jsx("div",{onClick:()=>{if(Ce(y,E),!!Fe)if(O.type==="boolean"){const Oe=!he,Ye=String(B);v(Ke=>({...Ke,[Ye]:{...Ke[Ye]||{},[O.id]:Oe}})),w==null||w(y,O.id,Oe)}else _({key:B,colId:O.id}),S(String(he??""))},style:{...$e(O.id,Bt,O.align,ne===0,l,oe?"visible":"hidden"),background:q},children:fe},O.id)})},String(B))}),te.length===0&&e.jsx("div",{style:{textAlign:"center",padding:40,color:t.textMut,fontSize:13},children:"No data"})]}),ie&&e.jsx("div",{style:{display:"flex",borderTop:ue,background:t.bg,flexShrink:0,position:"sticky",bottom:0,zIndex:2},children:G.map((y,E)=>{var oe;const B=(oe=y.footer)==null?void 0:oe[0],F=pe[y.id]??{sum:0,avg:0,count:0,min:0,max:0};let q="";B&&(typeof B.text=="function"?q=B.text(F):B.text?q=B.text:B.summary&&(q=String(Math.round(F[B.summary]*100)/100)));const O=ee[y.id]??150,ne=y.id in ae;return e.jsx("div",{style:{...$e(y.id,O,y.align,E===0,i),fontWeight:600,color:t.text,background:t.bg,...ne?{zIndex:3}:{}},children:q},y.id)})})]})})})}const se=["#0288d1","#43a047","#f57c00","#e53935","#8e24aa","#00838f","#ef6c00","#2e7d32"];function it(r,s,d){const l=r.filter(i=>!i.parent),p=r.filter(i=>!!i.parent);return l.map(i=>({name:i[d],children:p.filter(u=>u.parent===i.id).map(u=>({name:u[d],value:Number(u[s]??0)}))}))}function at({type:r="bar",data:s=[],series:d=[],scales:l={},legend:p,height:i=280,style:u}){var w,$,L,A,C,D,K,c,N,H,k,U,R,o,W,_;g.useEffect(Z,[]);const h=((w=l.bottom)==null?void 0:w.text)||s[0]&&Object.keys(s[0])[0]||"x",x=e.jsx(Q.Tooltip,{contentStyle:{fontSize:12,borderRadius:t.r,border:`1px solid ${t.border}`}}),z=p?e.jsx(Q.Legend,{iconSize:10,wrapperStyle:{fontSize:12},verticalAlign:p.valign==="bottom"?"bottom":p.valign==="middle"?"middle":"top",align:p.halign??"center"}):null,n=e.jsx(Q.CartesianGrid,{strokeDasharray:"3 3",stroke:t.border}),b=e.jsx(Q.XAxis,{dataKey:h,tick:{fontSize:11,fill:t.textSec},axisLine:{stroke:t.border},tickLine:!1,label:($=l.bottom)!=null&&$.title?{value:l.bottom.title,position:"insideBottom",offset:-4,fontSize:11}:void 0}),f=e.jsx(Q.YAxis,{tick:{fontSize:11,fill:t.textSec},axisLine:!1,tickLine:!1,domain:[((L=l.left)==null?void 0:L.min)??"auto",((A=l.left)==null?void 0:A.max)??"auto"],tickCount:(C=l.left)==null?void 0:C.maxTicks,label:(D=l.left)!=null&&D.title?{value:l.left.title,angle:-90,position:"insideLeft",fontSize:11}:void 0}),M={top:10,right:20,left:0,bottom:(K=l.bottom)!=null&&K.title?20:0},I={data:s,margin:M};let a;if(r==="bar")a=e.jsxs(Q.BarChart,{...I,children:[n,b,f,x,z,d.map((m,S)=>e.jsx(Q.Bar,{dataKey:m.value||m.id||"",name:m.label||m.id,fill:m.fill||m.color||se[S%se.length],radius:[3,3,0,0]},m.id??S))]});else if(r==="line")a=e.jsxs(Q.LineChart,{...I,children:[n,b,f,x,z,d.map((m,S)=>{const T=m.color||se[S%se.length];return e.jsx(Q.Line,{type:"monotone",dataKey:m.value||m.id||"",name:m.label||m.id,stroke:T,strokeWidth:m.strokeWidth??2,dot:{r:3,fill:T}},m.id??S)})]});else if(r==="area")a=e.jsxs(Q.AreaChart,{...I,children:[n,b,f,x,z,d.map((m,S)=>{const T=m.color||se[S%se.length];return e.jsx(Q.Area,{type:"monotone",dataKey:m.value||m.id||"",name:m.label||m.id,stroke:T,fill:(m.fill||T)+"33",strokeWidth:m.strokeWidth??2},m.id??S)})]});else if(r==="pie"||r==="donut"){const m=d[0]||{},S=m.value||"value",T=m.text||"name",v=m.color&&s[0]&&m.color in s[0]?m.color:null;a=e.jsxs(Q.PieChart,{children:[e.jsx(Q.Pie,{data:s,cx:"50%",cy:"50%",outerRadius:r==="donut"?"70%":"80%",innerRadius:r==="donut"?"40%":0,dataKey:S,nameKey:T,stroke:m.stroke||"none",strokeWidth:m.strokeWidth??0,label:({name:j,percent:Y})=>`${j??""} ${((Y??0)*100).toFixed(0)}%`,labelLine:!0,paddingAngle:2,children:s.map((j,Y)=>e.jsx(Q.Cell,{fill:v?j[v]:se[Y%se.length]},Y))}),x,z]})}else if(r==="radar"){const m=((c=l.radial)==null?void 0:c.value)||h;a=e.jsxs(Q.RadarChart,{...I,cx:"50%",cy:"50%",children:[e.jsx(Q.PolarGrid,{}),e.jsx(Q.PolarAngleAxis,{dataKey:m,tick:{fontSize:11}}),e.jsx(Q.PolarRadiusAxis,{tick:{fontSize:9,fill:t.textMut},axisLine:!1}),d.map((S,T)=>{const v=S.color||S.pointColor||se[T%se.length];return e.jsx(Q.Radar,{dataKey:S.value||S.id||"",name:S.label||S.id,stroke:v,fill:v+"44"},S.id??T)}),x,z]})}else if(r==="scatter")a=e.jsxs(Q.ScatterChart,{margin:M,children:[n,e.jsx(Q.XAxis,{type:"number",dataKey:"x",name:((N=l.bottom)==null?void 0:N.title)||"x",tick:{fontSize:11,fill:t.textSec},tickLine:!1,domain:[((H=l.bottom)==null?void 0:H.min)??"auto",((k=l.bottom)==null?void 0:k.max)??"auto"],label:(U=l.bottom)!=null&&U.title?{value:l.bottom.title,position:"insideBottom",offset:-4,fontSize:11}:void 0}),e.jsx(Q.YAxis,{type:"number",dataKey:"y",name:((R=l.left)==null?void 0:R.title)||"y",tick:{fontSize:11,fill:t.textSec},tickLine:!1,axisLine:!1,domain:[((o=l.left)==null?void 0:o.min)??"auto",((W=l.left)==null?void 0:W.max)??"auto"],label:(_=l.left)!=null&&_.title?{value:l.left.title,angle:-90,position:"insideLeft",fontSize:11}:void 0}),x,z,d.map((m,S)=>{const T=m.value||"x",v=m.valueY||"y",j=(m.data||s).map(Y=>({x:Y[T],y:Y[v]}));return e.jsx(Q.Scatter,{data:j,name:m.label||m.id,fill:m.color||se[S%se.length]},m.id??S)})]});else if(r==="treeMap"){const m=d[0]||{},S=m.value||"value",T=m.text||"name",v=it(s,S,T),j=m.stroke||t.surface,Y=m.strokeWidth??2;a=e.jsx(Q.Treemap,{data:v,dataKey:"value",aspectRatio:4/3,stroke:j,content:J=>{const{x:X,y:G,width:ee,height:te,depth:pe,index:re,name:P}=J;if(pe===0)return null;const ie=se[re%se.length];return e.jsxs("g",{children:[e.jsx("rect",{x:X,y:G,width:ee,height:te,fill:ie,stroke:j,strokeWidth:Y,style:{borderRadius:3}}),ee>40&&te>20&&e.jsx("text",{x:X+ee/2,y:G+te/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#fff",fontSize:11,pointerEvents:"none",children:P})]})}})}return e.jsx("div",{className:"dhx",style:{width:"100%",height:i,padding:12,background:t.surface,borderRadius:t.rMd,...u},children:e.jsx(Q.ResponsiveContainer,{width:"100%",height:"100%",children:a})})}const dt=["January","February","March","April","May","June","July","August","September","October","November","December"],ct=["Su","Mo","Tu","We","Th","Fr","Sa"];function pt({value:r,range:s=!1,timepicker:d=!1,onChange:l,style:p}){const i=new Date,u=r?new Date(Array.isArray(r)?r[0]:r):i,[h,x]=g.useState(u),[z,n]=g.useState(r??(s?[null,null]:null)),[b,f]=g.useState(null),[M,I]=g.useState({h:0,m:0});g.useEffect(Z,[]);const a=h.getFullYear(),w=h.getMonth(),$=new Date(a,w,1).getDay(),L=new Date(a,w+1,0).getDate(),A=[];for(let c=0;c<$;c++)A.push(null);for(let c=1;c<=L;c++)A.push(new Date(a,w,c));const C=c=>c.toDateString()===i.toDateString(),D=c=>{if(!z)return!1;if(s&&Array.isArray(z)){const[N,H]=z;if(!N)return!1;const k=c.getTime();return H?k>=N.getTime()&&k<=H.getTime():c.toDateString()===N.toDateString()}return c.toDateString()===z.toDateString()},K=c=>{if(s){const[N,H]=Array.isArray(z)?z:[null,null];if(!N||H)n([c,null]);else{const k=c<N?[c,N]:[N,c];n(k),l==null||l(k)}}else n(c),l==null||l(c)};return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...p},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{onClick:()=>x(c=>new Date(c.getFullYear(),c.getMonth()-1,1)),className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,padding:"0 8px",fontSize:16},children:"‹"}),e.jsxs("div",{style:{fontWeight:700,fontSize:14},children:[dt[w]," ",a]}),e.jsx("button",{onClick:()=>x(c=>new Date(c.getFullYear(),c.getMonth()+1,1)),className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,padding:"0 8px",fontSize:16},children:"›"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 32px)",gap:2},children:[ct.map(c=>e.jsx("div",{style:{textAlign:"center",fontSize:11,fontWeight:600,color:t.textMut,paddingBottom:4},children:c},c)),A.map((c,N)=>{const H=c?D(c):!1,k=c&&b&&c.toDateString()===b.toDateString();return e.jsx("div",{onClick:()=>c&&K(c),onMouseEnter:()=>c&&f(c),onMouseLeave:()=>f(null),style:{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:t.r,cursor:c?"pointer":"default",fontSize:12,fontWeight:c&&C(c)?700:400,background:H?t.primary:k?t.bg:"transparent",color:H?"#fff":c&&C(c)?t.primary:c?t.text:"transparent",border:c&&C(c)&&!H?`1px solid ${t.primary}`:"1px solid transparent",transition:"all .1s"},children:c==null?void 0:c.getDate()},N)})]}),d&&e.jsxs("div",{style:{borderTop:`1px solid ${t.border}`,marginTop:12,paddingTop:12,display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx("input",{type:"number",min:0,max:23,value:M.h,onChange:c=>I(N=>({...N,h:+c.target.value})),className:"dhx dhx-input",style:{width:50,textAlign:"center"}}),e.jsx("span",{style:{fontWeight:700,color:t.textSec},children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:M.m,onChange:c=>I(N=>({...N,m:+c.target.value})),className:"dhx dhx-input",style:{width:50,textAlign:"center"}})]})]})}function Ie({value:r,onChange:s,timeFormat:d=12,controls:l=!1,minuteStep:p=5,style:i}){const[u,h]=g.useState((r==null?void 0:r.h)??(d===24?0:12)),[x,z]=g.useState((r==null?void 0:r.m)??0),[n,b]=g.useState((r==null?void 0:r.ampm)??"AM"),[f,M]=g.useState(null);g.useEffect(Z,[]);const I=d===24?Array.from({length:24},(C,D)=>D):Array.from({length:12},(C,D)=>D+1),a=Array.from({length:Math.ceil(60/p)},(C,D)=>D*p),w=(C,D,K)=>{const c=d===24?{h:C,m:D}:{h:C,m:D,ampm:K};l?M(c):s==null||s(c)},$=()=>{M(null),h((r==null?void 0:r.h)??(d===24?0:12)),z((r==null?void 0:r.m)??0),b((r==null?void 0:r.ampm)??"AM")},L={display:"flex",flexDirection:"column",alignItems:"center",gap:4},A=C=>({height:32,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:13,fontWeight:C?700:400,background:C?t.primaryLt:"transparent",color:C?t.primary:t.text});return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...i},children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"stretch"},children:[e.jsxs("div",{style:L,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"Hours"}),e.jsx("div",{className:"dhx-scroll",style:{height:160,overflowY:"auto",width:48,border:`1px solid ${t.border}`,borderRadius:t.r},children:I.map(C=>e.jsx("div",{onClick:()=>{h(C),w(C,x,n)},style:A(u===C),onMouseEnter:D=>u!==C&&(D.currentTarget.style.background=t.bg),onMouseLeave:D=>u!==C&&(D.currentTarget.style.background="transparent"),children:String(C).padStart(2,"0")},C))})]}),e.jsxs("div",{style:L,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"Minutes"}),e.jsx("div",{className:"dhx-scroll",style:{height:160,overflowY:"auto",width:48,border:`1px solid ${t.border}`,borderRadius:t.r},children:a.map(C=>e.jsx("div",{onClick:()=>{z(C),w(u,C,n)},style:A(x===C),onMouseEnter:D=>x!==C&&(D.currentTarget.style.background=t.bg),onMouseLeave:D=>x!==C&&(D.currentTarget.style.background="transparent"),children:String(C).padStart(2,"0")},C))})]}),d===12&&e.jsxs("div",{style:L,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"AM/PM"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden"},children:["AM","PM"].map(C=>e.jsx("div",{onClick:()=>{b(C),w(u,x,C)},style:{height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"0 12px",fontSize:13,fontWeight:n===C?700:400,background:n===C?t.primary:t.surface,color:n===C?"#fff":t.text},children:C},C))})]})]}),e.jsxs("div",{style:{textAlign:"center",marginTop:12,fontSize:22,fontWeight:700,color:t.primary,letterSpacing:2},children:[String(u).padStart(2,"0"),":",String(x).padStart(2,"0"),d===12?` ${n}`:""]}),l&&e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:12},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:$,children:"Cancel"}),e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",onClick:()=>{const C=f??(d===24?{h:u,m:x}:{h:u,m:x,ampm:n});s==null||s(C)},children:"Apply"})]})]})}const ht=({open:r})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",style:{flexShrink:0,transition:"transform .15s",transform:r?"rotate(180deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:t.textMut,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})});function be({data:r=[],value:s,placeholder:d="Select or type...",multiselection:l=!1,label:p,onChange:i,style:u}){var K;const[h,x]=g.useState(!1),[z,n]=g.useState(""),[b,f]=g.useState(l?s?[].concat(s):[]:s||null),M=g.useRef(null),I=g.useRef(null);g.useEffect(Z,[]),de(M,g.useCallback(()=>{x(!1),n("")},[]));const a=g.useMemo(()=>r.filter(c=>!z||c.value.toLowerCase().includes(z.toLowerCase())),[r,z]),w=c=>l?(b||[]).includes(c):b===c,$=c=>{const N=c.id||c.value;if(l){const H=w(N)?b.filter(k=>k!==N):[...b||[],N];f(H),i==null||i(H)}else f(N),n(""),x(!1),i==null||i(N)},L=c=>{const N=b.filter(H=>H!==c);f(N),i==null||i(N)},A=()=>{x(!0),setTimeout(()=>{var c;return(c=I.current)==null?void 0:c.focus()},0)},C=((K=r.find(c=>(c.id||c.value)===b))==null?void 0:K.value)||"",D=l?b||[]:[];return e.jsxs("div",{ref:M,className:"dhx",style:{position:"relative",...u},children:[p&&e.jsx("label",{className:"dhx dhx-label",children:p}),e.jsxs("div",{onClick:A,style:{display:"flex",alignItems:"center",flexWrap:l?"wrap":"nowrap",border:`1px solid ${h?t.primary:t.border}`,borderRadius:t.r,minHeight:34,padding:"4px 8px",cursor:"text",background:t.surface,gap:4,transition:"border-color .15s",boxShadow:h?`0 0 0 3px ${t.primary}22`:"none"},children:[l&&e.jsxs(e.Fragment,{children:[D.map(c=>{var N;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:t.primary,color:"#fff",borderRadius:12,padding:"2px 10px 2px 8px",fontSize:12,lineHeight:1.5,whiteSpace:"nowrap"},children:[((N=r.find(H=>(H.id||H.value)===c))==null?void 0:N.value)||c,e.jsx("span",{onClick:H=>{H.stopPropagation(),L(c)},style:{cursor:"pointer",fontSize:15,lineHeight:1,opacity:.75,marginLeft:2},children:"×"})]},c)}),e.jsx("input",{ref:I,value:z,onChange:c=>{n(c.target.value),x(!0)},onFocus:()=>x(!0),onClick:c=>c.stopPropagation(),placeholder:D.length?"":d,style:{flex:1,minWidth:60,border:"none",outline:"none",fontSize:13,background:"transparent",color:t.text,padding:0}})]}),!l&&e.jsx("input",{ref:I,value:h?z:C,onChange:c=>{n(c.target.value),x(!0)},onFocus:()=>{x(!0),n("")},onClick:c=>c.stopPropagation(),placeholder:d,style:{flex:1,border:"none",outline:"none",fontSize:13,background:"transparent",color:t.text,padding:0}}),e.jsx(ht,{open:h})]}),h&&e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,zIndex:100},children:e.jsxs("div",{className:"dhx-scroll",style:{maxHeight:220,overflowY:"auto"},children:[a.map(c=>{const N=c.id||c.value,H=w(N);return e.jsxs("div",{onClick:()=>$(c),style:{padding:"8px 12px",cursor:"pointer",display:"flex",alignItems:"center",gap:8,fontSize:13,background:H?t.primaryLt:"transparent",color:H?t.primary:t.text},onMouseEnter:k=>!H&&(k.currentTarget.style.background=t.bg),onMouseLeave:k=>!H&&(k.currentTarget.style.background="transparent"),children:[l&&e.jsx("span",{style:{width:14,height:14,flexShrink:0,border:`2px solid ${H?t.primary:t.borderDk}`,borderRadius:3,display:"flex",alignItems:"center",justifyContent:"center",background:H?t.primary:"transparent"},children:H&&e.jsx("span",{style:{color:"#fff",fontSize:9,lineHeight:1},children:"✓"})}),e.jsx("span",{style:{flex:1},children:c.value}),!l&&H&&e.jsx("span",{style:{color:t.primary,fontSize:12,fontWeight:700},children:"✓"}),c.count!==void 0&&e.jsxs("span",{style:{fontSize:11,color:t.textMut},children:["(",c.count,")"]})]},N)}),a.length===0&&e.jsx("div",{style:{padding:16,textAlign:"center",color:t.textMut,fontSize:13},children:"No matches"})]})})]})}function ve({min:r=0,max:s=100,step:d=1,value:l,range:p=!1,label:i,tick:u,disabled:h=!1,onChange:x,style:z}){const[n,b]=g.useState(l??(p?[r,s]:r));g.useEffect(Z,[]);const f=($,L)=>{if(!h)if(p){const A=[...n];A[$]=L,b(A),x==null||x(A)}else b(L),x==null||x(L)},M=$=>($-r)/(s-r)*100,I=p?n:[n],a=p?{left:`${M(I[0])}%`,width:`${M(I[1])-M(I[0])}%`}:{left:0,width:`${M(I[0])}%`},w=h?t.border:t.primary;return e.jsxs("div",{className:"dhx",style:{width:"100%",opacity:h?.5:1,...z},children:[i&&e.jsx("label",{className:"dhx dhx-label",children:i}),e.jsx("div",{style:{position:"relative",height:36,display:"flex",alignItems:"center"},children:e.jsxs("div",{style:{position:"relative",flex:1,height:4,background:t.border,borderRadius:2},children:[e.jsx("div",{style:{position:"absolute",...a,height:"100%",background:w,borderRadius:2}}),I.map(($,L)=>e.jsx("input",{type:"range",min:r,max:s,step:d,value:$,disabled:h,onChange:A=>{const C=+A.target.value;p&&L===0&&C>=n[1]||p&&L===1&&C<=n[0]||f(L,C)},style:{position:"absolute",width:"100%",height:"100%",opacity:0,cursor:h?"not-allowed":"pointer",top:0,left:0,margin:0}},L)),I.map(($,L)=>e.jsx("div",{style:{position:"absolute",left:`${M($)}%`,top:"50%",transform:"translate(-50%, -50%)",width:16,height:16,borderRadius:"50%",background:t.surface,border:`2px solid ${w}`,boxShadow:"0 1px 4px rgba(0,0,0,.2)",pointerEvents:"none"},children:e.jsx("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",background:h?t.textMut:t.primaryDk,color:"#fff",padding:"2px 6px",borderRadius:t.r,fontSize:11,fontWeight:700,whiteSpace:"nowrap"},children:$})},L))]})}),u&&e.jsx("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[r,Math.round((s+r)/2),s].map($=>e.jsx("span",{style:{fontSize:10,color:t.textMut},children:$},$))})]})}const ut=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#607d8b","#9e9e9e","#000000","#ffffff","#0288d1","#01579b","#43a047","#e53935","#f57c00"];function Se(r){const s=parseInt(r.slice(1,3),16)/255,d=parseInt(r.slice(3,5),16)/255,l=parseInt(r.slice(5,7),16)/255,p=Math.max(s,d,l),i=Math.min(s,d,l);let u=0,h=0;const x=(p+i)/2;if(p!==i){const z=p-i;h=x>.5?z/(2-p-i):z/(p+i),u=p===s?((d-l)/z+(d<l?6:0))/6:p===d?((l-s)/z+2)/6:((s-d)/z+4)/6}return[Math.round(u*360),Math.round(h*100),Math.round(x*100)]}function Ne(r,s,d){s/=100,d/=100;const l=s*Math.min(d,1-d),p=i=>{const u=(i+r/30)%12,h=d-l*Math.max(Math.min(u-3,9-u,1),-1);return Math.round(255*h).toString(16).padStart(2,"0")};return"#"+p(0)+p(8)+p(4)}function ft({value:r="#0288d1",onChange:s,style:d}){const[l,p]=g.useState(()=>Se(r)),i=Ne(...l);g.useEffect(Z,[]);const u=h=>{p(h),s==null||s(Ne(...h))};return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...d},children:[e.jsx("div",{style:{width:200,height:120,borderRadius:t.r,marginBottom:12,background:`linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, hsl(${l[0]},100%,50%))`,cursor:"crosshair"}}),[["Hue",0,360,l[0]],["Saturation",0,100,l[1]],["Lightness",0,100,l[2]]].map(([h,x,z,n],b)=>e.jsxs("div",{style:{marginBottom:b<2?8:12},children:[e.jsxs("div",{className:"dhx dhx-label",children:[h,b>0?` (${n}%)`:""]}),e.jsx("input",{type:"range",min:x,max:z,value:n,onChange:f=>{const M=[...l];M[b]=+f.target.value,u(M)},style:{width:"100%",accentColor:t.primary}})]},h)),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx("div",{style:{width:36,height:36,borderRadius:t.r,background:i,border:`1px solid ${t.border}`,flexShrink:0}}),e.jsx("input",{className:"dhx dhx-input",style:{flex:1,fontFamily:"monospace",fontSize:12},value:i,onChange:h=>{try{u(Se(h.target.value)),s==null||s(h.target.value)}catch{}}})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(13, 1fr)",gap:3},children:ut.map(h=>e.jsx("div",{onClick:()=>{p(Se(h)),s==null||s(h)},style:{width:14,height:14,borderRadius:2,background:h,cursor:"pointer",border:i===h?`2px solid ${t.text}`:"1px solid rgba(0,0,0,.15)",transition:"transform .1s"},onMouseEnter:x=>x.currentTarget.style.transform="scale(1.3)",onMouseLeave:x=>x.currentTarget.style.transform="scale(1)"},h))})]})}function gt({trigger:r,children:s,placement:d="bottom-start",style:l}){const[p,i]=g.useState(!1),[u,h]=g.useState({top:"100%",left:0}),x=g.useRef(null),z=g.useRef(null);g.useEffect(Z,[]),de(x,g.useCallback(()=>i(!1),[]));const n=()=>{i(b=>{if(!b&&z.current){const f=z.current.getBoundingClientRect(),M={"bottom-start":{top:f.height+4,left:0},"bottom-end":{top:f.height+4,right:0,left:"auto"},"top-start":{bottom:f.height+4,top:"auto",left:0}};h(M[d]||M["bottom-start"])}return!b})};return e.jsxs("div",{ref:x,className:"dhx",style:{position:"relative",display:"inline-block"},children:[e.jsx("div",{ref:z,onClick:n,children:r}),p&&e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",...u,zIndex:200,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,boxShadow:t.shadowLg,...l},children:s})]})}function xt({title:r,children:s,width:d=480,height:l,closable:p=!0,movable:i=!0,modal:u=!1,defaultOpen:h=!0,footer:x,onClose:z,style:n}){const[b,f]=g.useState(h),[M,I]=g.useState({x:0,y:0});g.useEffect(Z,[]);const a=Le(g.useCallback(($,L)=>i&&I({x:$,y:L}),[i])),w=()=>{f(!1),z==null||z()};return b?e.jsxs(e.Fragment,{children:[u&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:900},onClick:p?w:void 0}),e.jsxs("div",{className:"dhx",style:{position:u?"fixed":"absolute",left:"50%",top:"50%",transform:`translate(calc(-50% + ${M.x}px), calc(-50% + ${M.y}px))`,width:d,...l?{height:l}:{},background:t.surface,borderRadius:t.rMd,boxShadow:t.shadowLg,zIndex:901,display:"flex",flexDirection:"column",overflow:"hidden",...n},children:[e.jsxs("div",{onMouseDown:$=>a($,M.x,M.y),style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:`1px solid ${t.border}`,cursor:i?"grab":"default",background:t.bg,gap:8,userSelect:"none"},children:[e.jsx("span",{style:{flex:1,fontWeight:700,fontSize:15},children:r}),p&&e.jsx("button",{onClick:w,style:{background:"none",border:"none",cursor:"pointer",width:28,height:28,borderRadius:t.r,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:t.textSec},onMouseEnter:$=>$.currentTarget.style.background=t.border,onMouseLeave:$=>$.currentTarget.style.background="none",children:"×"})]}),e.jsx("div",{className:"dhx-scroll",style:{flex:1,minHeight:0,padding:20,overflowY:"auto"},children:s}),x&&e.jsx("div",{style:{padding:"12px 16px",borderTop:`1px solid ${t.border}`,display:"flex",justifyContent:"flex-end",gap:8,background:t.bg},children:x})]})]}):null}const ke=g.createContext(null),yt={success:"✓",error:"✕",warning:"⚠",info:"ℹ"},We={success:t.success,error:t.danger,warning:t.warning,info:t.primary};function bt({children:r}){const[s,d]=g.useState([]);g.useEffect(Z,[]);const l=g.useCallback(u=>d(h=>h.filter(x=>x.id!==u)),[]),p=g.useCallback(u=>{const h=Date.now();return d(x=>[...x,{id:h,...u}]),u.duration!==0&&setTimeout(()=>l(h),u.duration||4e3),h},[l]),i={message:p,alert:(u,h)=>p({type:"info",title:u,...h}),confirm:(u,h,x)=>p({type:"warning",title:u,confirm:h,...x})};return e.jsxs(ke.Provider,{value:i,children:[r,e.jsx("div",{style:{position:"fixed",top:20,right:20,zIndex:9999,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none"},children:s.map(u=>{const h=u.type||"info";return e.jsxs("div",{style:{background:t.surface,border:`1px solid ${t.border}`,borderLeft:`4px solid ${We[h]}`,borderRadius:t.r,boxShadow:t.shadowLg,padding:"12px 16px",minWidth:280,maxWidth:380,pointerEvents:"all",display:"flex",gap:10,alignItems:"flex-start",animation:"dhx-toast .3s ease"},children:[e.jsx("span",{style:{fontSize:18,color:We[h],lineHeight:1},children:yt[h]}),e.jsxs("div",{style:{flex:1},children:[u.title&&e.jsx("div",{style:{fontWeight:600,fontSize:13,marginBottom:u.text?3:0},children:u.title}),u.text&&e.jsx("div",{style:{fontSize:12,color:t.textSec,lineHeight:1.5},children:u.text}),u.confirm&&e.jsxs("div",{style:{display:"flex",gap:6,marginTop:8},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",style:{height:26,fontSize:12},onClick:()=>{u.confirm(!0),l(u.id)},children:"Confirm"}),e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",style:{height:26,fontSize:12},onClick:()=>{u.confirm(!1),l(u.id)},children:"Cancel"})]})]}),e.jsx("button",{onClick:()=>l(u.id),style:{background:"none",border:"none",cursor:"pointer",color:t.textMut,fontSize:14,lineHeight:1,padding:0},children:"×"})]},u.id)})})]})}function vt(){const r=g.useContext(ke);if(!r)throw new Error("useMessage must be used inside <MessageProvider>");return r}function St({data:r=[],template:s,keyNavigation:d=!0,multiselection:l=!1,editable:p=!1,height:i=400,onSelect:u,onEdit:h,style:x}){const[z,n]=g.useState(new Set),[b,f]=g.useState(null),[M,I]=g.useState(""),[a,w]=g.useState(null);g.useEffect(Z,[]);const $=(A,C)=>{const D=A.id??C;n(K=>{const c=l?new Set(K):new Set;return c.has(D)?c.delete(D):c.add(D),c}),w(C),u==null||u(A)},L=(A,C)=>{h==null||h({...A,value:M},C),f(null)};return e.jsxs("div",{className:"dhx dhx-scroll",style:{height:i,overflowY:"auto",border:`1px solid ${t.border}`,borderRadius:t.r,background:t.surface,...x},tabIndex:0,onKeyDown:A=>{d&&(A.key==="ArrowDown"&&w(C=>Math.min((C??-1)+1,r.length-1)),A.key==="ArrowUp"&&w(C=>Math.max((C??1)-1,0)))},children:[r.map((A,C)=>{const D=A.id??C,K=z.has(D),c=a===C;return e.jsx("div",{onClick:()=>$(A,C),onDoubleClick:()=>p&&(f(C),I(String(A.value||""))),style:{display:"flex",alignItems:"center",padding:"0 12px",height:40,cursor:"pointer",fontSize:13,borderBottom:`1px solid ${t.border}`,background:K?t.primaryLt:c?t.bg:t.surface,color:K?t.primary:t.text,outline:c?`2px solid ${t.primary}44`:"none",transition:"background .1s"},children:b===C?e.jsx("input",{autoFocus:!0,className:"dhx dhx-input",style:{height:28,flex:1},value:M,onChange:N=>I(N.target.value),onBlur:()=>L(A,C),onKeyDown:N=>{N.key==="Enter"&&L(A,C),N.key==="Escape"&&f(null)},onClick:N=>N.stopPropagation()}):s?e.jsx("div",{dangerouslySetInnerHTML:{__html:s(A)},style:{flex:1}}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:String(A.value??"")})},String(D))}),r.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:t.textMut},children:"No items"})]})}function kt({data:r=[],template:s,itemsInRow:d=3,gap:l=12,multiselection:p=!1,onSelect:i,style:u}){const[h,x]=g.useState(new Set);g.useEffect(Z,[]);const z=n=>{const b=n.id??String(n.title);x(f=>{const M=p?new Set(f):new Set;return M.has(b)?M.delete(b):M.add(b),M}),i==null||i(n)};return e.jsx("div",{className:"dhx",style:{display:"grid",gridTemplateColumns:`repeat(${d}, 1fr)`,gap:l,padding:l,...u},children:r.map((n,b)=>{const f=n.id??b,M=h.has(f);return e.jsx("div",{onClick:()=>z(n),style:{background:t.surface,border:`2px solid ${M?t.primary:t.border}`,borderRadius:t.rMd,overflow:"hidden",cursor:"pointer",transition:"all .15s",boxShadow:M?`0 0 0 3px ${t.primary}33`:t.shadow,transform:M?"translateY(-2px)":"none"},onMouseEnter:I=>{I.currentTarget.style.boxShadow=t.shadowLg,I.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:I=>{I.currentTarget.style.boxShadow=M?`0 0 0 3px ${t.primary}33`:t.shadow,I.currentTarget.style.transform=M?"translateY(-2px)":"none"},children:s?e.jsx("div",{dangerouslySetInnerHTML:{__html:s(n)}}):e.jsxs("div",{style:{padding:16},children:[n.img&&e.jsx("img",{src:n.img,alt:n.title||"",style:{width:"100%",borderRadius:t.r,marginBottom:8,display:"block"}}),e.jsx("div",{style:{fontWeight:600,fontSize:14,marginBottom:4},children:n.title||n.value}),n.subtitle&&e.jsx("div",{style:{fontSize:12,color:t.textSec},children:n.subtitle})]})},String(f))})})}function we(r){return r.map(s=>({...s,items:s.items?we(s.items):void 0}))}function me(r,s={}){return r.forEach(d=>{d.opened&&(s[d.id]=!0),d.items&&me(d.items,s)}),s}function Be(r,s){let d=null;return[r.filter(p=>p.id===s?(d=p,!1):!0).map(p=>{if(p.items){const[i,u]=Be(p.items,s);return u&&(d=u),{...p,items:i}}return p}),d]}function ze(r,s,d,l){if(l==="inside")return r.map(i=>i.id===s?{...i,items:[...i.items||[],d]}:i.items?{...i,items:ze(i.items,s,d,l)}:i);if(r.some(i=>i.id===s)){const i=[];for(const u of r)u.id===s?l==="before"?(i.push(d),i.push(u)):(i.push(u),i.push(d)):i.push(u);return i}return r.map(i=>i.items?{...i,items:ze(i.items,s,d,l)}:i)}function wt(r,s,d){function l(p){var i,u;if(p.id===s){const h=x=>{var z;return x.id===d||(((z=x.items)==null?void 0:z.some(h))??!1)};return((i=p.items)==null?void 0:i.some(h))??!1}return((u=p.items)==null?void 0:u.some(l))??!1}return r.some(l)}function Ae(r,s,d){return r.map(l=>l.id===s?{...l,value:d}:{...l,items:l.items?Ae(l.items,s,d):void 0})}function mt(r,s){var i;let d=0,l=0;const p=u=>{var h;d++,s[u.id]&&l++,(h=u.items)==null||h.forEach(p)};return(i=r.items)==null||i.forEach(p),{total:d,checkedCount:l}}function zt({data:r=[],checkbox:s=!1,editable:d=!1,dragMode:l,tooltip:p,onSelect:i,onCheck:u,onChange:h,style:x}){const[z,n]=g.useState(()=>we(r)),[b,f]=g.useState(()=>me(r)),[M,I]=g.useState(null),[a,w]=g.useState({}),[$,L]=g.useState(null),[A,C]=g.useState(""),[D,K]=g.useState(null),[c,N]=g.useState(null);g.useEffect(Z,[]),g.useEffect(()=>{n(we(r)),f(S=>({...me(r),...S}))},[r]);const H=S=>f(T=>({...T,[S]:!T[S]})),k=(S,T)=>{w(v=>({...v,[S]:T})),u==null||u(S,T)},U=()=>{if(!$)return;const S=$,T=A;L(null),n(v=>{const j=Ae(v,S,T);return h==null||h(j),j})},R=(S,T)=>{S.dataTransfer.effectAllowed="move",K(T)},o=(S,T)=>{if(!D||D===T||wt(z,D,T))return;S.preventDefault();const v=S.currentTarget.getBoundingClientRect(),j=S.clientY-v.top,Y=v.height,J=j<Y*.25?"before":j>Y*.75?"after":"inside";N(X=>(X==null?void 0:X.id)===T&&(X==null?void 0:X.pos)===J?X:{id:T,pos:J})},W=(S,T)=>{if(S.preventDefault(),!D||!c||D===T){N(null),K(null);return}n(v=>{const[j,Y]=Be(v,D);if(!Y)return v;const J=ze(j,T,Y,c.pos);return h==null||h(J),J}),c.pos==="inside"&&f(v=>({...v,[T]:!0})),N(null),K(null)},_=()=>{K(null),N(null)},m=(S,T=0)=>{var re;const v=(((re=S.items)==null?void 0:re.length)??0)>0,j=b[S.id],Y=M===S.id,J=D===S.id,X=(c==null?void 0:c.id)===S.id;let G=!!a[S.id],ee=!1;if(s&&v){const{total:P,checkedCount:ie}=mt(S,a);ie>0&&ie<P?ee=!0:P>0&&ie===P&&(G=!0)}const te=X&&c.pos!=="inside"?{boxShadow:c.pos==="before"?`inset 0 2px 0 0 ${t.primary}`:`inset 0 -2px 0 0 ${t.primary}`}:{},pe=X&&c.pos==="inside"||Y?t.primaryLt:"transparent";return e.jsxs("div",{style:{opacity:J?.4:1},children:[e.jsxs("div",{draggable:!!l,onDragStart:l?P=>R(P,S.id):void 0,onDragOver:l?P=>o(P,S.id):void 0,onDrop:l?P=>W(P,S.id):void 0,onDragEnd:l?_:void 0,title:p==null?void 0:p(S),onClick:()=>{I(S.id),i==null||i(S),v&&H(S.id)},onDoubleClick:()=>{d&&(L(S.id),C(S.value||""))},style:{display:"flex",alignItems:"center",gap:4,padding:`5px 8px 5px ${12+T*18}px`,cursor:l?"grab":"pointer",borderRadius:t.r,margin:"1px 4px",background:pe,color:Y?t.primary:t.text,userSelect:"none",fontSize:13,...te},onMouseEnter:P=>!Y&&!X&&(P.currentTarget.style.background=t.bg),onMouseLeave:P=>!Y&&!X&&(P.currentTarget.style.background="transparent"),children:[e.jsx("span",{style:{width:16,textAlign:"center",fontSize:11,color:t.textMut,flexShrink:0},onClick:P=>{P.stopPropagation(),v&&H(S.id)},children:v?j?"▾":"▸":""}),e.jsx("span",{style:{fontSize:15,flexShrink:0},children:v?j?"📂":"📁":"📄"}),s&&e.jsx("input",{ref:P=>{P&&(P.indeterminate=ee)},type:"checkbox",checked:G,onChange:P=>{P.stopPropagation(),k(S.id,P.target.checked)},style:{cursor:"pointer",accentColor:t.primary,flexShrink:0},onClick:P=>P.stopPropagation()}),$===S.id?e.jsx("input",{autoFocus:!0,className:"dhx dhx-input",style:{height:24,fontSize:12,flex:1},value:A,onChange:P=>C(P.target.value),onBlur:U,onKeyDown:P=>{P.key==="Enter"&&U(),P.key==="Escape"&&L(null)},onClick:P=>P.stopPropagation()}):e.jsx("span",{style:{flex:1},children:S.value}),S.count!==void 0&&e.jsxs("span",{style:{fontSize:11,color:t.textMut},children:["(",S.count,")"]})]}),v&&j&&e.jsx("div",{children:S.items.map(P=>m(P,T+1))})]},S.id)};return e.jsx("div",{className:"dhx dhx-scroll",style:{overflowY:"auto",...x},onDragOver:l?S=>S.preventDefault():void 0,onDrop:l?S=>{S.preventDefault(),N(null),K(null)}:void 0,children:z.map(S=>m(S))})}function Mt({total:r,pageSize:s=10,page:d,onChange:l,style:p}){const[i,u]=g.useState(d||1),h=Math.ceil(r/s);g.useEffect(Z,[]);const x=n=>{const b=Math.min(Math.max(1,n),h);u(b),l==null||l(b)},z=g.useMemo(()=>{const n=[];for(let f=Math.max(1,i-2);f<=Math.min(h,i+2);f++)n.push(f);return n[0]>1&&(n[0]>2&&n.unshift("..."),n.unshift(1)),n[n.length-1]<h&&(n[n.length-1]<h-1&&n.push("..."),n.push(h)),n},[i,h]);return e.jsxs("div",{className:"dhx",style:{display:"flex",alignItems:"center",gap:4,padding:"8px 12px",...p},children:[e.jsxs("span",{style:{fontSize:12,color:t.textSec,marginRight:8},children:[(i-1)*s+1,"–",Math.min(i*s,r)," of ",r]}),[["«",1],["‹",i-1]].map(([n,b])=>e.jsx("button",{className:"dhx dhx-btn dhx-btn-ghost",style:{height:30,padding:"0 8px",fontSize:14},disabled:i===1,onClick:()=>x(b),children:n},n)),z.map((n,b)=>e.jsx("button",{onClick:()=>typeof n=="number"&&x(n),className:`dhx dhx-btn ${n===i?"dhx-btn-primary":"dhx-btn-ghost"}`,style:{height:30,minWidth:30,padding:"0 8px",fontSize:13},disabled:n==="...",children:n},b)),[["›",i+1],["»",h]].map(([n,b])=>e.jsx("button",{className:"dhx dhx-btn dhx-btn-ghost",style:{height:30,padding:"0 8px",fontSize:14},disabled:i===h,onClick:()=>x(b),children:n},n))]})}function Ct({config:r={},defaultValues:s={},onSubmit:d,style:l}){const[p,i]=g.useState(s),[u,h]=g.useState({}),[x,z]=g.useState(null);g.useEffect(Z,[]);const n=(a,w)=>{i($=>({...$,[a]:w})),h($=>({...$,[a]:null}))},b=a=>{const w=[];return a.flat().forEach($=>{!$||typeof $!="object"||!("name"in $)||(w.push($),$.type==="fieldset"&&$.rows&&w.push(...b($.rows)))}),w},f=()=>{const a={};return b(r.rows||[]).forEach(w=>{w.required&&!p[w.name]&&(a[w.name]=`${w.label||w.name} is required`)}),h(a),Object.keys(a).length===0},M=a=>{const w=p[a.name]??a.value??"",$=u[a.name],L=a.labelWidth??r.labelWidth,A=L!==void 0||a.labelPosition==="left";if(a.type==="fieldset")return e.jsxs("fieldset",{style:{border:`1px solid ${t.border}`,borderRadius:t.r,padding:"12px 16px",marginBottom:14},children:[e.jsx("legend",{style:{fontSize:12,fontWeight:700,color:t.textSec,padding:"0 6px"},children:a.label}),(a.rows||[]).map(k=>M(k))]},a.name);if(a.type==="spacer")return e.jsx("div",{style:{height:a.height||16}},a.name);const C=L?{minWidth:L,width:L,flexShrink:0,paddingTop:8,boxSizing:"border-box"}:{},D=a.label?e.jsxs("label",{className:"dhx dhx-label",style:{display:"flex",gap:4,...C},children:[a.label,a.required&&e.jsx("span",{style:{color:t.danger},children:"*"})]},"lbl"):null,K=$?e.jsx("div",{style:{fontSize:11,color:t.danger,marginTop:3},children:$}):null,c=a.helpMessage?e.jsxs("div",{style:{fontSize:11,color:t.textMut,marginTop:3},children:["ⓘ ",a.helpMessage]}):null,N={key:a.name,className:"dhx-form-group"},H=k=>A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[D,e.jsxs("div",{style:{flex:1,minWidth:0},children:[k,K,c]})]}):e.jsxs("div",{...N,children:[D,k,K,c]});if(!a.type||a.type==="input")return H(e.jsxs("div",{className:"dhx-input-wrap",children:[a.icon&&e.jsx("span",{className:"dhx-input-icon",children:a.icon}),e.jsx("input",{className:`dhx dhx-input${a.icon?" dhx-input--with-icon":""}`,style:{borderColor:$?t.danger:void 0},type:a.inputType||"text",placeholder:a.placeholder,value:w,onChange:k=>n(a.name,k.target.value),disabled:a.disabled})]}));if(a.type==="textarea")return H(e.jsx("textarea",{className:"dhx dhx-input",style:{height:80,resize:"vertical",padding:"8px 10px"},placeholder:a.placeholder,value:w,onChange:k=>n(a.name,k.target.value)}));if(a.type==="select")return H(e.jsxs("select",{className:"dhx dhx-input",value:w,onChange:k=>n(a.name,k.target.value),style:{cursor:"pointer"},children:[e.jsx("option",{value:"",children:"— Select —"}),(a.options||[]).map(k=>e.jsx("option",{value:k.value,children:k.label||k.value},k.value))]}));if(a.type==="datepicker")return H(e.jsx("input",{type:"date",className:"dhx dhx-input",value:w,onChange:k=>n(a.name,k.target.value)}));if(a.type==="timepicker"){const k=p[a.name]??{h:12,m:0,ampm:"AM"},U=!!p[a.name],R=U?`${String(k.h).padStart(2,"0")}:${String(k.m).padStart(2,"0")}${k.ampm?" "+k.ampm:""}`:a.placeholder||"Click to select",o=e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("div",{className:"dhx dhx-input",style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between"},onClick:()=>z(x===a.name?null:a.name),children:[e.jsx("span",{style:{color:U?t.text:t.textMut},children:R}),e.jsx("span",{style:{fontSize:13,color:t.textSec},children:"🕐"})]}),x===a.name&&e.jsx("div",{style:{position:"absolute",zIndex:100,top:"calc(100% + 4px)",left:0},children:e.jsx(Ie,{value:k,controls:!0,onChange:W=>{n(a.name,W),z(null)}})})]});return H(o)}if(a.type==="colorpicker")return H(e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("input",{type:"color",value:w||"#000000",onChange:k=>n(a.name,k.target.value),style:{width:36,height:36,padding:2,border:`1px solid ${t.border}`,borderRadius:t.r,cursor:"pointer",background:"none"}}),e.jsx("span",{style:{fontSize:12,color:t.textSec,fontFamily:"monospace"},children:w||"#000000"})]}));if(a.type==="text")return H(e.jsx("p",{style:{margin:"6px 0",fontSize:13,color:t.text},children:a.value}));if(a.type==="checkbox")return e.jsxs("div",{...N,children:[A?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[L&&e.jsx("div",{style:{width:L,flexShrink:0}}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:!!w,onChange:k=>n(a.name,k.target.checked),style:{width:16,height:16,accentColor:t.primary,cursor:"pointer"}}),e.jsx("span",{style:{fontSize:13},children:a.label})]})]}):e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:!!w,onChange:k=>n(a.name,k.target.checked),style:{width:16,height:16,accentColor:t.primary,cursor:"pointer"}}),e.jsx("span",{style:{fontSize:13},children:a.label})]}),c]});if(a.type==="radio"){const k=(a.options||[]).map(U=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:13},children:[e.jsx("input",{type:"radio",name:a.name,value:U.value,checked:w===U.value,onChange:()=>n(a.name,U.value),style:{accentColor:t.primary,cursor:"pointer"}}),U.label||U.value]},U.value));return H(e.jsx("div",{style:{display:"flex",gap:16,flexWrap:"wrap",paddingTop:8},children:k}))}if(a.type==="slider")return A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[D,e.jsxs("div",{style:{flex:1},children:[e.jsx(ve,{min:a.min,max:a.max,step:a.step,value:w||a.min,range:a.range,onChange:k=>n(a.name,k)}),c]})]}):e.jsxs("div",{...N,children:[e.jsx(ve,{label:a.label,min:a.min,max:a.max,step:a.step,value:w||a.min,range:a.range,onChange:k=>n(a.name,k)}),c]});if(a.type==="combo")return A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[D,e.jsxs("div",{style:{flex:1},children:[e.jsx(be,{data:a.data||[],multiselection:a.multiselection,placeholder:a.placeholder||"Select...",value:w||(a.multiselection?[]:null),onChange:k=>n(a.name,k)}),K,c]})]}):e.jsxs("div",{...N,children:[e.jsx(be,{label:a.label,data:a.data||[],multiselection:a.multiselection,placeholder:a.placeholder||"Select...",value:w||(a.multiselection?[]:null),onChange:k=>n(a.name,k)}),K,c]});if(a.type==="toggle"){const k=!!w,U=k?a.icon:a.offIcon||a.icon,R=k?a.text||a.label:a.offText||a.text||a.label;return e.jsxs("div",{...N,children:[A&&L&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:L,flexShrink:0}}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx(He,{on:k,onClick:()=>n(a.name,!w)}),U&&e.jsx("span",{style:{fontSize:16},children:U}),R&&e.jsx("span",{style:{fontSize:13},children:R})]})]}),!A&&e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},children:[e.jsx(He,{on:k,onClick:()=>n(a.name,!w)}),U&&e.jsx("span",{style:{fontSize:16},children:U}),R&&e.jsx("span",{style:{fontSize:13},children:R})]}),c]})}return null},I=a=>a.map((w,$)=>Array.isArray(w)?e.jsx("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:w.map(M)},$):M(w));return e.jsxs("div",{className:"dhx",style:{padding:r.padding||0,width:r.width||"100%",...l},children:[I(r.rows||[]),(r.buttons||d)&&e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:r.buttonAlign||"flex-start",marginTop:8},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",onClick:()=>f()&&(d==null?void 0:d(p)),children:r.submitText||"Submit"}),r.resetButton!==!1&&e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:()=>{i(s),h({})},children:r.resetText||"Reset"})]})]})}function He({on:r,onClick:s}){return e.jsxs("div",{style:{position:"relative",width:40,height:22,flexShrink:0},onClick:s,children:[e.jsx("div",{style:{width:40,height:22,borderRadius:11,background:r?t.primary:t.border,transition:"background 0.2s"}}),e.jsx("div",{style:{position:"absolute",top:3,left:r?21:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,.3)"}})]})}function xe(r){const s=[];for(const d of r)d.type==="block"?s.push(...xe(d.items||[])):s.push(d);return s}function $t(r){return r==="primary"?t.primary:r==="success"?t.success:r==="secondary"?t.borderDk:t.danger}function Dt(r,s){switch(r){case"primary":return{background:t.primary,color:"#fff",borderColor:t.primary};case"danger":return{background:t.danger,color:"#fff",borderColor:t.danger};case"success":return{background:t.success,color:"#fff",borderColor:t.success};case"secondary":return{background:t.bg,color:t.text,borderColor:t.border};default:return s?{background:t.primaryLt,color:t.primary}:{}}}function Lt({items:r=[],css:s,menuCss:d,style:l,onAction:p,onInputChange:i,onInputBlur:u,onInputFocus:h,onOpenMenu:x}){g.useEffect(Z,[]);const[z,n]=g.useState(()=>{const o={};for(const W of xe(r))W.id&&(o[W.id]=!!W.active);return o}),[b,f]=g.useState(null),[M,I]=g.useState(()=>{const o={};for(const W of xe(r))W.type==="selectButton"&&W.id&&W.value&&(o[W.id]=W.value);return o}),a=xe(r),w=g.useRef(null);de(w,g.useCallback(()=>f(null),[]));const $=o=>{var W,_;if(!o.disabled){if(o.id){if(o.group){const m=a.filter(S=>S.group===o.group&&S.id);n(S=>{const T={...S};for(const v of m)T[v.id]=!1;return T[o.id]=!0,T})}else o.twoState&&n(m=>({...m,[o.id]:!m[o.id]}));if((W=o.items)!=null&&W.length){const m=o.id;f(S=>S===m?null:m),x==null||x(o.id);return}}(_=o.onClick)==null||_.call(o,o),o.id&&(p==null||p(o.id,o))}},L=({count:o,color:W})=>e.jsx("span",{style:{position:"absolute",top:2,right:2,minWidth:14,height:14,background:$t(W),color:"#fff",borderRadius:7,fontSize:9,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 2px",pointerEvents:"none"},children:o>99?"99+":o}),A=(o,W)=>{var re;const _=o.id!==void 0?z[o.id]??!!o.active:!!o.active,m=o.value??o.text,S=o.size??"medium",T=S==="auto",v=S==="small",j=!!((re=o.items)!=null&&re.length),Y=o.id!==void 0&&b===o.id,J=Dt(o.color,_&&!o.color),X=T?void 0:v?26:32,G=T?22:v?13:16,ee=[o.tooltip,o.hotkey?`(${o.hotkey})`:""].filter(Boolean).join(" "),te=o.circle?{borderRadius:"50%",padding:T?"8px":"0",aspectRatio:"1",justifyContent:"center"}:{},pe=o.view==="link"?{background:"transparent",border:"none",textDecoration:"underline",padding:"0 4px"}:o.view==="flat"?{borderRadius:0}:{};return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("button",{title:ee||void 0,disabled:o.disabled,className:"dhx dhx-btn dhx-btn-ghost",style:{flexDirection:T?"column":"row",alignSelf:T?"stretch":"center",justifyContent:"center",minHeight:T?56:X,height:T?void 0:X,padding:T?"6px 10px":v?"0 6px":"0 8px",gap:4,position:"relative",background:_&&!o.color?t.primaryLt:"transparent",color:_&&!o.color?t.primary:o.disabled?t.textMut:t.text,opacity:o.disabled?.55:1,cursor:o.disabled?"not-allowed":"pointer",borderColor:Y?t.primary:void 0,...J,...te,...pe},onClick:()=>$(o),children:[o.loading?e.jsx("span",{style:{fontSize:G,lineHeight:1,flexShrink:0,display:"inline-block",animation:"dhx-spin 1s linear infinite"},children:"⟳"}):o.icon&&e.jsx("span",{style:{fontSize:G,lineHeight:1,flexShrink:0},children:o.icon}),m&&!o.html&&e.jsx("span",{style:{fontSize:T?10:v?11:12,maxWidth:T?64:void 0,textAlign:T?"center":"left",lineHeight:T?1.2:1,whiteSpace:T?"normal":"nowrap"},children:m}),o.html&&e.jsx("span",{dangerouslySetInnerHTML:{__html:o.html}}),j&&e.jsx("span",{style:{fontSize:8,opacity:.6,marginLeft:1},children:"▼"}),o.hotkey&&T&&e.jsx("span",{style:{fontSize:9,color:t.textMut,lineHeight:1},children:o.hotkey}),o.count!==void 0&&e.jsx(L,{count:o.count,color:o.countColor})]}),j&&Y&&e.jsx(ce,{items:o.items,onSelect:P=>{f(null),P.id&&(p==null||p(String(P.id),o))},style:{top:"100%",left:0,minWidth:160}})]},W)},C=(o,W)=>{const _=o.size??"medium",m=_==="auto"?48:_==="small"?28:36,S=o.id!==void 0?z[o.id]??!!o.active:!!o.active;return e.jsx("div",{style:{position:"relative",display:"flex",alignSelf:"center"},children:e.jsxs("button",{title:o.tooltip,disabled:o.disabled,style:{width:m,height:m,padding:2,border:S?`2px solid ${t.primary}`:"2px solid transparent",borderRadius:"50%",overflow:"hidden",cursor:o.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0,opacity:o.disabled?.55:1},onClick:()=>$(o),children:[o.src&&e.jsx("img",{src:o.src,alt:o.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),o.count!==void 0&&e.jsx(L,{count:o.count,color:o.countColor})]})},W)},D=(o,W)=>{var T,v;const _=o.id!==void 0&&b===`sel:${o.id}`,m=(o.id&&M[o.id])??o.value??((v=(T=o.items)==null?void 0:T[0])==null?void 0:v.value)??"",S=(o.items??[]).map(j=>({id:j.value,value:j.value,icon:j.icon}));return e.jsxs("div",{style:{position:"relative",alignSelf:"center"},children:[e.jsxs("button",{title:o.tooltip,disabled:o.disabled,className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,gap:4,padding:"0 8px",opacity:o.disabled?.55:1,cursor:o.disabled?"not-allowed":"pointer",borderColor:_?t.primary:void 0},onClick:()=>{if(o.disabled||!o.id)return;const j=`sel:${o.id}`;f(Y=>Y===j?null:j)},children:[o.icon&&e.jsx("span",{style:{fontSize:14},children:o.icon}),e.jsx("span",{style:{fontSize:12},children:m}),e.jsx("span",{style:{fontSize:8,opacity:.6},children:"▼"})]}),_&&e.jsx(ce,{items:S,onSelect:j=>{var J;const Y=String(j.value??j.id??"");o.id&&I(X=>({...X,[o.id]:Y})),f(null),(J=o.onChange)==null||J.call(o,Y),o.id&&(p==null||p(o.id,o))},style:{top:"100%",left:0,minWidth:100}})]},W)},K=(o,W)=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",padding:"2px 4px",gap:2},children:[o.label&&e.jsx("span",{style:{fontSize:10,color:t.textMut},children:o.label}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[o.icon&&e.jsx("span",{style:{position:"absolute",left:6,fontSize:13,color:t.textMut,pointerEvents:"none",zIndex:1},children:o.icon}),e.jsx("input",{className:"dhx dhx-input",disabled:o.disabled,style:{width:o.width||110,height:26,fontSize:12,paddingLeft:o.icon?24:void 0},placeholder:o.placeholder,defaultValue:o.value,onChange:_=>{var m;(m=o.onChange)==null||m.call(o,_.target.value),o.id&&(i==null||i(o.id,_.target.value))},onBlur:_=>{var m;(m=o.onBlur)==null||m.call(o,_.target.value),o.id&&(u==null||u(o.id,_.target.value))},onFocus:_=>{var m;(m=o.onFocus)==null||m.call(o,_.target.value),o.id&&(h==null||h(o.id,_.target.value))}})]})]},W),c=(o,W)=>o.hidden?null:e.jsx("div",{title:o.tooltip,style:{padding:"2px 6px",fontSize:11,color:o.disabled?t.textMut:t.textSec,display:"flex",alignItems:"center",alignSelf:"center",userSelect:"none",opacity:o.disabled?.5:1},children:o.html?e.jsx("span",{dangerouslySetInnerHTML:{__html:o.html}}):o.value},W),N=(o,W)=>o.hidden?null:e.jsx("div",{style:{display:"flex",alignItems:"center",alignSelf:"center",padding:"0 4px"},dangerouslySetInnerHTML:{__html:o.html??""}},W),H=(o,W)=>o.hidden?null:o.type==="separator"||o.type==="sep"?e.jsx("div",{style:{width:1,background:t.border,margin:"4px 2px",alignSelf:"stretch"}},W):o.type==="spacer"?e.jsx("div",{style:{flex:1}},W):o.type==="title"?c(o,W):o.type==="customHTML"?N(o,W):o.type==="imageButton"?C(o,W):o.type==="input"?K(o,W):o.type==="selectButton"?D(o,W):A(o,W),k=(o,W,_)=>{var S;if(o.hidden)return null;const m=_||o.disabled;return e.jsx("div",{style:{display:"flex",flexDirection:o.direction==="col"?"column":"row",alignItems:o.direction==="col"?"flex-start":"center",gap:2,opacity:o.disabled&&!_?.55:1,pointerEvents:m?"none":void 0},children:(S=o.items)==null?void 0:S.map((T,v)=>T.type==="block"?k(T,`${W}-${v}`,m):H(T,`${W}-${v}`))},W)},U=(o,W)=>{var m;if(o.hidden)return null;const _=o.title||o.label;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",borderRight:`1px solid ${t.border}`,padding:"4px 6px 0",minWidth:40,opacity:o.disabled?.55:1,pointerEvents:o.disabled?"none":void 0},children:[e.jsx("div",{style:{display:"flex",flexDirection:o.direction==="col"?"column":"row",alignItems:o.direction==="col"?"stretch":"center",gap:2,flex:1},children:(m=o.items)==null?void 0:m.map((S,T)=>S.type==="block"?k(S,T,o.disabled):H(S,T))}),_&&e.jsx("div",{style:{fontSize:10,color:t.textMut,textAlign:"center",padding:"3px 0 4px",marginTop:2,borderTop:`1px solid ${t.border}`},children:_})]},W)},R=(o,W)=>o.type==="block"?U(o,W):H(o,W);return e.jsx("div",{ref:w,className:["dhx",s].filter(Boolean).join(" "),style:{display:"flex",alignItems:"stretch",background:t.surface,borderBottom:`1px solid ${t.border}`,overflowX:"auto",gap:0,minHeight:72,...l},children:r.map(R)})}function je({count:r}){return e.jsx("span",{style:{position:"absolute",top:3,right:3,minWidth:16,height:16,background:t.danger,color:"#fff",borderRadius:8,fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,pointerEvents:"none"},children:r})}function Tt({logo:r,items:s=[],vertical:d=!1,onAction:l,style:p}){const[i,u]=g.useState(null),[h,x]=g.useState(()=>{const f={};return s.forEach(M=>{M.id&&M.twoState&&M.active&&(f[M.id]=!0)}),f}),z=g.useRef(null);g.useEffect(Z,[]),de(z,g.useCallback(()=>u(null),[]));const n=(f,M)=>{var I,a;if(!f.disabled){if(f.twoState&&f.id&&x(w=>({...w,[f.id]:!w[f.id]})),(I=f.items)!=null&&I.length){u(w=>w===M?null:M);return}(a=f.onClick)==null||a.call(f,f.id||""),l==null||l(f.id||"")}},b=(f,M)=>{var $;if(f.hidden)return null;if(f.type==="separator")return e.jsx("div",{style:{[d?"height":"width"]:1,background:t.border,margin:d?"4px 8px":"0 6px",alignSelf:"stretch"}},M);if(f.type==="spacer")return e.jsx("div",{style:{flex:1}},M);if(f.type==="input")return e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",margin:"0 4px"},children:[f.icon&&e.jsx("span",{style:{position:"absolute",left:8,color:t.textMut,fontSize:15,pointerEvents:"none",zIndex:1},children:f.icon}),e.jsx("input",{className:"dhx dhx-input",style:{width:f.width||200,height:28,paddingLeft:f.icon?30:void 0},placeholder:f.placeholder,onChange:L=>{var A;return(A=f.onChange)==null?void 0:A.call(f,L.target.value)}})]},M);if(f.type==="imageButton")return e.jsxs("button",{title:f.tooltip,disabled:f.disabled,style:{position:"relative",width:36,height:36,padding:2,border:"none",borderRadius:"50%",overflow:"hidden",cursor:f.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0},onClick:()=>n(f,M),children:[f.src&&e.jsx("img",{src:f.src,alt:f.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),f.count!==void 0&&e.jsx(je,{count:f.count})]},M);const I=!!(f.twoState&&f.id&&h[f.id]),a=!!(($=f.items)!=null&&$.length),w={position:"relative",height:d?40:36,gap:6,background:I?t.primaryLt:"transparent",color:I?t.primary:f.disabled?t.textMut:t.text,opacity:f.disabled?.55:1,cursor:f.disabled?"not-allowed":"pointer",...d?{width:"100%",justifyContent:"flex-start",padding:"0 16px",borderRadius:0}:{}};return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-ghost",title:f.tooltip,disabled:f.disabled,style:w,onClick:()=>n(f,M),children:[f.icon&&e.jsx("span",{style:{fontSize:16,flexShrink:0},children:f.icon}),f.value&&e.jsx("span",{style:{fontSize:13},children:f.value}),a&&e.jsx("span",{style:{fontSize:9,opacity:.55,marginLeft:2},children:"▼"}),f.count!==void 0&&e.jsx(je,{count:f.count})]}),a&&i===M&&e.jsx(ce,{items:f.items,onSelect:L=>{var A;u(null),L.id&&((A=f.onClick)==null||A.call(f,L.id),l==null||l(L.id))},style:d?{left:"100%",top:0}:{top:"100%"}})]},M)};return e.jsxs("nav",{ref:z,className:"dhx",style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"stretch":"center",background:t.surface,borderBottom:d?"none":`1px solid ${t.border}`,borderRight:d?`1px solid ${t.border}`:"none",padding:d?"8px 0":"0 12px",minHeight:d?void 0:48,gap:2,...p},children:[r&&e.jsx("div",{style:{color:t.text,fontWeight:800,fontSize:16,padding:d?"8px 16px 12px":"0 12px 0 4px",borderBottom:d?`1px solid ${t.border}`:"none",borderRight:d?"none":`1px solid ${t.border}`,marginRight:d?0:8,marginBottom:d?4:0,flexShrink:0},children:r}),s.map(b)]})}V.Button=Ve,V.Calendar=pt,V.Chart=at,V.Colorpicker=ft,V.Combobox=be,V.ContextMenu=qe,V.DataView=kt,V.Form=Ct,V.Grid=lt,V.Layout=Ee,V.List=St,V.Menu=Xe,V.MenuDropdown=ce,V.MessageContext=ke,V.MessageProvider=bt,V.Navbar=Tt,V.Pagination=Mt,V.Popup=gt,V.Ribbon=Lt,V.Sidebar=Ze,V.Slider=ve,V.Tabbar=et,V.Timepicker=Ie,V.Toolbar=Ge,V.Tree=zt,V.Window=xt,V.tokens=t,V.useClickOutside=de,V.useDrag=Le,V.useMessage=vt,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
42
- //# sourceMappingURL=dhx-react-suite.umd.cjs.map
41
+ `,document.head.appendChild(r)}const Ve={sm:{height:24,padding:"0 8px",fontSize:12},md:{},lg:{height:38,padding:"0 18px",fontSize:14}};function Xe({children:r,variant:s="primary",size:d="md",icon:i,disabled:f,onClick:a,style:u,className:h=""}){return g.useEffect(R,[]),e.jsxs("button",{className:`dhx dhx-btn dhx-btn-${s} ${h}`,style:{...Ve[d],...u},disabled:f,onClick:a,children:[i&&e.jsx("span",{style:{fontSize:16},children:i}),r]})}function ce(r,s){g.useEffect(()=>{const d=i=>{r.current&&!r.current.contains(i.target)&&s(i)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r,s])}function Ee(r){const s=g.useRef(!1),d=g.useRef({x:0,y:0,ox:0,oy:0});return g.useCallback((i,f=0,a=0)=>{s.current=!0,d.current={x:i.clientX,y:i.clientY,ox:f,oy:a};const u=y=>{if(!s.current)return;const{x:M,y:o,ox:b,oy:C}=d.current;r(b+y.clientX-M,C+y.clientY-o)},h=()=>{s.current=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h),i.preventDefault()},[r])}function ie({items:r,onSelect:s,style:d}){const[i,f]=g.useState(null);return e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:180,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,zIndex:200,padding:"4px 0",...d},children:r.map((a,u)=>{var y,M;if(a.type==="separator")return e.jsx("div",{style:{height:1,background:t.border,margin:"4px 0"}},u);const h=i===u;return e.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>f(u),onMouseLeave:()=>f(null),children:[e.jsxs("div",{onClick:()=>{var o;return!a.disabled&&!((o=a.items)!=null&&o.length)&&s(a)},style:{display:"flex",alignItems:"center",gap:8,padding:"8px 14px",cursor:a.disabled?"not-allowed":"pointer",fontSize:13,color:a.disabled?t.textMut:t.text,background:h&&!a.disabled?t.bg:"transparent",opacity:a.disabled?.5:1},children:[a.icon&&e.jsx("span",{style:{fontSize:15,width:18,textAlign:"center"},children:a.icon}),e.jsx("span",{style:{flex:1},children:a.value||a.id}),a.hotkey&&e.jsx("span",{style:{fontSize:11,color:t.textMut},children:a.hotkey}),(y=a.items)!=null&&y.length?e.jsx("span",{style:{fontSize:10,color:t.textMut},children:"▶"}):null]}),h&&((M=a.items)!=null&&M.length)?e.jsx(ie,{items:a.items,onSelect:s,style:{position:"absolute",left:"100%",top:-4}}):null]},a.id||u)})})}function qe({items:r=[],label:s="Menu",onSelect:d,style:i}){const[f,a]=g.useState(!1),u=g.useRef(null);return g.useEffect(R,[]),ce(u,g.useCallback(()=>a(!1),[])),e.jsxs("div",{ref:u,className:"dhx",style:{position:"relative",display:"inline-block",...i},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:()=>a(h=>!h),children:[s," ",e.jsx("span",{style:{fontSize:10},children:f?"▲":"▼"})]}),f&&e.jsx(ie,{items:r,onSelect:h=>{d==null||d(h),a(!1)}})]})}function Ge({items:r=[],onSelect:s,children:d}){const[i,f]=g.useState(null),a=g.useRef(null);g.useEffect(R,[]),ce(a,g.useCallback(()=>f(null),[]));const u=h=>{h.preventDefault(),f({x:h.clientX,y:h.clientY})};return e.jsxs("div",{ref:a,onContextMenu:u,style:{position:"relative",display:"contents"},children:[d,i&&e.jsx("div",{style:{position:"fixed",left:i.x,top:i.y,zIndex:9999},children:e.jsx(ie,{items:r,onSelect:h=>{s==null||s(h),f(null)}})})]})}function Ne({count:r}){return e.jsx("span",{style:{position:"absolute",top:2,right:2,minWidth:16,height:16,background:t.danger,color:"#fff",borderRadius:8,fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,pointerEvents:"none"},children:r})}function Je({items:r=[],onAction:s,style:d}){const[i,f]=g.useState(null),[a,u]=g.useState(()=>{const o={};return r.forEach(b=>{b.id&&(b.twoState||b.group)&&b.active&&(o[b.id]=!0)}),o}),h=g.useRef(null);g.useEffect(R,[]),ce(h,g.useCallback(()=>f(null),[]));const y=(o,b)=>{var C,I;if(!o.disabled){if(o.twoState&&o.id&&u(H=>({...H,[o.id]:!H[o.id]})),o.group&&o.id&&u(H=>{const c={...H};return r.forEach(z=>{z.group===o.group&&z.id&&(c[z.id]=!1)}),c[o.id]=!0,c}),(C=o.items)!=null&&C.length){f(H=>H===b?null:b);return}(I=o.onClick)==null||I.call(o,o.id||""),s==null||s(o.id||"")}},M=(o,b)=>{var c,z;if(o.hidden)return null;if(o.type==="separator")return e.jsx("div",{style:{width:1,background:t.border,margin:"6px 4px",alignSelf:"stretch"}},b);if(o.type==="spacer")return e.jsx("div",{style:{flex:1}},b);if(o.type==="input")return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.label&&e.jsx("span",{style:{fontSize:12,color:t.textSec,fontWeight:500},children:o.label}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[o.icon&&e.jsx("span",{style:{position:"absolute",left:8,color:t.textMut,fontSize:15,pointerEvents:"none",zIndex:1},children:o.icon}),e.jsx("input",{className:"dhx dhx-input",style:{width:o.width||140,height:28,paddingLeft:o.icon?30:void 0},placeholder:o.placeholder,defaultValue:o.value,onChange:L=>{var E;return(E=o.onChange)==null?void 0:E.call(o,L.target.value)}})]})]},b);if(o.type==="select")return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.label&&e.jsx("span",{style:{fontSize:12,color:t.textSec,fontWeight:500},children:o.label}),e.jsx("select",{className:"dhx dhx-input",style:{width:o.width||100,height:28,cursor:"pointer"},defaultValue:o.value,onChange:L=>{var E;return(E=o.onChange)==null?void 0:E.call(o,L.target.value)},children:(c=o.options)==null?void 0:c.map(L=>e.jsx("option",{value:L.value,children:L.label},L.value))})]},b);if(o.type==="imageButton")return e.jsxs("button",{title:o.tooltip,disabled:o.disabled,style:{position:"relative",width:32,height:32,padding:2,border:"none",borderRadius:"50%",overflow:"hidden",cursor:o.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0},onClick:()=>y(o,b),children:[o.src&&e.jsx("img",{src:o.src,alt:o.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),o.count!==void 0&&e.jsx(Ne,{count:o.count})]},b);const C=!!(o.id&&a[o.id]),I=o.value??o.text,H=!!((z=o.items)!=null&&z.length);return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-ghost",title:o.tooltip,disabled:o.disabled,style:{height:32,gap:4,position:"relative",background:C?t.primaryLt:"transparent",color:C?t.primary:o.disabled?t.textMut:t.text,opacity:o.disabled?.55:1,cursor:o.disabled?"not-allowed":"pointer"},onClick:()=>y(o,b),children:[o.icon&&e.jsx("span",{style:{fontSize:16},children:o.icon}),I&&e.jsx("span",{style:{fontSize:13},children:I}),H&&e.jsx("span",{style:{fontSize:9,opacity:.55,marginLeft:2},children:"▼"}),o.count!==void 0&&e.jsx(Ne,{count:o.count})]}),H&&i===b&&e.jsx(ie,{items:o.items,onSelect:()=>f(null),style:{top:"100%",left:0}})]},b)};return e.jsx("div",{ref:h,className:"dhx",style:{display:"flex",alignItems:"center",gap:2,padding:"4px 8px",background:t.surface,borderBottom:`1px solid ${t.border}`,minHeight:44,flexWrap:"wrap",...d},children:r.map(M)})}function Ue(r){return r==="primary"?t.primary:r==="success"?"#43a047":r==="secondary"?"#9e9e9e":"#e53935"}function Qe(r,s){const d=[],i=f=>{var a;f.id&&f.group===s&&d.push(f.id),(a=f.items)==null||a.forEach(i)};return r.forEach(i),d}function Ze(r){const s={},d=i=>{var f;i.id&&i.twoState&&i.active&&(s[i.id]=!0),(f=i.items)==null||f.forEach(d)};return r.forEach(d),s}function Re({items:r=[],width:s=240,minWidth:d=64,header:i,footer:f,collapsed:a,defaultCollapsed:u,selected:h,defaultSelected:y,onSelect:M,onCollapse:o,onExpand:b,onBeforeCollapse:C,onBeforeExpand:I,onToggleItem:H,style:c}){const z=a!==void 0,L=h!==void 0,[E,A]=g.useState(u??!1),[m,$]=g.useState(y??null),[V,p]=g.useState({}),[N,l]=g.useState(()=>Ze(r));g.useEffect(R,[]);const x=z?a:E,K=L?h??null:m,P=x?d:s,n=()=>{if(x){if((I==null?void 0:I())===!1)return;z||A(!1),b==null||b()}else{if((C==null?void 0:C())===!1)return;z||A(!0),o==null||o()}},T=S=>{L||$(S.id??null),M==null||M(S),S.id&&S.onClick&&S.onClick(S.id)},F=S=>{if(!S.id)return;const j=!N[S.id];let X={...N,[S.id]:j};S.group&&j&&Qe(r,S.group).forEach(Q=>{Q!==S.id&&(X[Q]=!1)}),l(X),H==null||H(S.id,j)},w=(S,j)=>{if(S.count===void 0)return null;const X=Ue(S.countColor),Q=S.count>99?"99+":String(S.count);return j?e.jsx("span",{style:{position:"absolute",top:1,right:1,background:X,color:"#fff",borderRadius:8,fontSize:9,fontWeight:700,padding:"0 3px",minWidth:14,textAlign:"center",lineHeight:"14px",pointerEvents:"none"},children:Q}):e.jsx("span",{style:{background:X,color:"#fff",borderRadius:10,padding:"1px 6px",fontSize:11,fontWeight:700,flexShrink:0},children:Q})},k=(S,j,X)=>{var de;if(S.hidden)return null;const Q=S.id??`${S.type??"navItem"}-${j}-${X}`,G=S.type??"navItem";if(G==="separator")return e.jsx("div",{style:{height:1,background:t.border,margin:"6px 8px",flexShrink:0}},Q);if(G==="spacer")return e.jsx("div",{style:{flex:1}},Q);if(G==="title")return x?null:e.jsx("div",{style:{padding:"10px 14px 4px",fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:1,color:t.textMut,flexShrink:0},children:S.value},Q);if(G==="customHTML")return e.jsx("div",{dangerouslySetInnerHTML:{__html:S.html??""},style:{padding:"8px 12px",flexShrink:0}},Q);const U=(((de=S.items)==null?void 0:de.length)??0)>0,ee=!!V[S.id??""],te=S.twoState?!!N[S.id??""]:!1,re=!S.twoState&&K===S.id||te,O=!!S.disabled,ae=x?0:12+j*16,$e=()=>{O||(S.twoState?(F(S),T(S)):(U&&p(le=>({...le,[S.id??""]:!le[S.id??""]})),T(S)))};return e.jsxs("div",{style:{flexShrink:0},children:[e.jsxs("div",{title:S.tooltip,onClick:$e,style:{display:"flex",alignItems:"center",gap:x?0:8,justifyContent:x?"center":"flex-start",paddingTop:8,paddingBottom:8,paddingLeft:x?0:ae,paddingRight:x?0:10,borderRadius:t.r,margin:"1px 6px",cursor:O?"not-allowed":"pointer",userSelect:"none",transition:"background .15s",background:re?t.primaryLt:"transparent",color:O?t.textMut:re?t.primary:t.text,opacity:O?.55:1},onMouseEnter:le=>{!re&&!O&&(le.currentTarget.style.background=t.bg)},onMouseLeave:le=>{!re&&!O&&(le.currentTarget.style.background="transparent")},children:[e.jsxs("span",{style:{position:"relative",minWidth:22,textAlign:"center",fontSize:18,flexShrink:0,lineHeight:1},children:[S.icon??(S.value&&!S.icon,null),x&&w(S,!0)]}),!x&&e.jsx("span",{style:{flex:1,fontSize:13,fontWeight:re?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:S.value}),!x&&w(S,!1),!x&&S.twoState&&e.jsx("span",{style:{width:14,height:14,borderRadius:2,border:`2px solid ${re?t.primary:t.borderDk}`,background:re?t.primary:"transparent",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:re&&e.jsx("span",{style:{color:"#fff",fontSize:8,fontWeight:700,lineHeight:1},children:"✓"})}),!x&&U&&!S.twoState&&e.jsx("span",{style:{fontSize:11,color:t.textMut,flexShrink:0,transition:"transform .2s",transform:ee?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})]}),U&&ee&&!x&&e.jsx("div",{children:S.items.map((le,ge)=>k(le,j+1,ge))})]},Q)},D=e.jsxs("div",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:x?"center":"flex-start",gap:8,padding:x?"8px 0":"8px 14px",margin:"4px 6px",borderRadius:t.r,cursor:"pointer",color:t.textMut,fontSize:13,userSelect:"none",transition:"background .15s",flexShrink:0},onMouseEnter:S=>S.currentTarget.style.background=t.bg,onMouseLeave:S=>S.currentTarget.style.background="transparent",children:[e.jsx("span",{style:{fontSize:16,fontWeight:700,lineHeight:1},children:x?"›":"‹"}),!x&&e.jsx("span",{children:"Collapse"})]});return e.jsxs("div",{className:"dhx",style:{width:P,minWidth:P,background:t.surface,borderRight:`1px solid ${t.border}`,display:"flex",flexDirection:"column",transition:"width .2s ease, min-width .2s ease",overflow:"hidden",...c},children:[i&&e.jsx("div",{style:{padding:x?"12px 0":"12px 14px",borderBottom:`1px solid ${t.border}`,fontWeight:700,fontSize:15,display:"flex",alignItems:"center",justifyContent:x?"center":"flex-start",overflow:"hidden",flexShrink:0},children:i}),e.jsx("div",{className:"dhx-scroll",style:{flex:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:r.map((S,j)=>k(S,0,j))}),D,f&&!x&&e.jsx("div",{style:{padding:"10px 14px",borderTop:`1px solid ${t.border}`,flexShrink:0},children:f})]})}function et({config:r}){const[s,d]=g.useState(!1),i={position:"relative",background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden",...r.width?{width:r.width,minWidth:r.width}:{flex:1},...r.height?{height:r.height,minHeight:r.height}:{minHeight:40},...s?{flex:"0 0 auto"}:{}};return e.jsxs("div",{style:i,children:[r.header&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",background:t.bg,borderBottom:`1px solid ${t.border}`,fontSize:12,fontWeight:600,color:t.textSec,userSelect:"none"},children:[e.jsx("span",{children:r.header}),r.collapsable&&e.jsx("button",{onClick:()=>d(f=>!f),style:{background:"none",border:"none",cursor:"pointer",color:t.textMut,fontSize:16,lineHeight:1},children:s?"▼":"▲"})]}),!s&&e.jsxs("div",{style:{padding:r.padding||0,height:r.header?"calc(100% - 33px)":"100%",overflow:"auto"},children:[r.html?e.jsx("div",{dangerouslySetInnerHTML:{__html:r.html}}):r.content,(r.rows||r.cols)&&e.jsx(Ie,{rows:r.rows,cols:r.cols,style:{height:"100%"}})]})]})}function Ie({rows:r,cols:s,type:d="line",style:i,children:f}){g.useEffect(R,[]);const a=d==="space"?12:d==="wide"?8:1,u=r||s,h=!!r;return u?e.jsx("div",{className:"dhx",style:{display:"flex",flexDirection:h?"column":"row",gap:a,width:"100%",height:"100%",...i},children:u.map((y,M)=>e.jsx(et,{config:y},y.id||M))}):e.jsx("div",{className:"dhx",style:{width:"100%",height:"100%",...i},children:f})}function tt({views:r=[],mode:s="top",tabAlign:d="left",closable:i=[],disabled:f=[],defaultActive:a,onBeforeChange:u,onChange:h,style:y}){var m;const[M,o]=g.useState(a||((m=r[0])==null?void 0:m.id)),[b,C]=g.useState(r.map($=>$.id));g.useEffect(R,[]);const I=($,V)=>{$.stopPropagation(),C(p=>p.filter(N=>N!==V)),M===V&&o(b.find(p=>p!==V)??"")},H=$=>{f.includes($)||u&&u($)===!1||(o($),h==null||h($))},c=s==="left"||s==="right",z=r.filter($=>b.includes($.id)),L=e.jsx("div",{style:{display:"flex",flexDirection:c?"column":"row",justifyContent:d==="center"?"center":d==="right"?"flex-end":"flex-start",background:t.surface,borderBottom:!c&&s!=="bottom"?`2px solid ${t.border}`:"none",borderTop:s==="bottom"?`2px solid ${t.border}`:"none",borderRight:s==="left"?`2px solid ${t.border}`:"none",borderLeft:s==="right"?`2px solid ${t.border}`:"none",overflowX:"auto",flexShrink:0},children:z.map($=>{const V=M===$.id,p=f.includes($.id),N=s==="bottom"?{borderTop:`2px solid ${t.primary}`,color:t.primary,fontWeight:600}:c?{color:t.primary,fontWeight:600,background:t.primaryLt,[s==="left"?"borderRight":"borderLeft"]:`2px solid ${t.primary}`}:{borderBottom:`2px solid ${t.primary}`,color:t.primary,fontWeight:600};return e.jsxs("div",{onClick:()=>H($.id),style:{display:"flex",alignItems:"center",gap:6,padding:"10px 16px",cursor:p?"not-allowed":"pointer",whiteSpace:"nowrap",fontSize:13,transition:"color .15s",userSelect:"none",minWidth:c?120:"auto",...V?N:{color:p?t.textMut:t.textSec}},children:[$.icon&&e.jsx("span",{style:{fontSize:16},children:$.icon}),e.jsx("span",{children:$.tab}),i.includes($.id)&&e.jsx("span",{onClick:l=>I(l,$.id),style:{marginLeft:4,opacity:.6,fontSize:12,cursor:"pointer"},children:"✕"})]},$.id)})}),E=z.find($=>$.id===M),A=e.jsxs("div",{className:"dhx-scroll",style:{flex:1,overflow:"auto"},children:[E==null?void 0:E.content,(E==null?void 0:E.html)&&e.jsx("div",{dangerouslySetInnerHTML:{__html:E.html},style:{padding:16}})]});return e.jsxs("div",{className:"dhx",style:{display:"flex",flexDirection:s==="top"?"column":s==="bottom"?"column-reverse":s==="left"?"row":"row-reverse",width:"100%",height:"100%",background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden",...y},children:[L,A]})}const ue=`1px solid ${t.border}`;function rt({active:r,dir:s}){return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:1,flexShrink:0,marginLeft:4},children:[e.jsx("svg",{width:"7",height:"4",viewBox:"0 0 7 4",children:e.jsx("path",{d:"M3.5 0L7 4H0z",fill:r&&s==="asc"?t.primary:t.borderDk})}),e.jsx("svg",{width:"7",height:"4",viewBox:"0 0 7 4",children:e.jsx("path",{d:"M3.5 4L0 0H7z",fill:r&&s==="desc"?t.primary:t.borderDk})})]})}function nt({options:r,value:s,onChange:d,onCommit:i,onCancel:f}){const[a,u]=g.useState(s),[h,y]=g.useState(!0),M=g.useRef(null);g.useEffect(()=>{const b=C=>{M.current&&!M.current.contains(C.target)&&i()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i]);const o=r.filter(b=>!a||b.toLowerCase().includes(a.toLowerCase()));return e.jsxs("div",{ref:M,style:{width:"100%",position:"relative"},children:[e.jsx("input",{autoFocus:!0,value:a,onChange:b=>{u(b.target.value),d(b.target.value),y(!0)},onKeyDown:b=>{b.key==="Enter"&&i(),b.key==="Escape"&&f()},onClick:b=>b.stopPropagation(),style:{width:"100%",border:"none",outline:`2px solid ${t.primary}`,borderRadius:2,fontSize:13,padding:"2px 4px",background:t.surface,color:t.text}}),h&&o.length>0&&e.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,maxHeight:160,overflowY:"auto"},children:o.map(b=>e.jsx("div",{onMouseDown:C=>{C.preventDefault(),d(b),u(b),y(!1),i()},style:{padding:"6px 10px",cursor:"pointer",fontSize:13,color:t.text},onMouseEnter:C=>C.currentTarget.style.background=t.bg,onMouseLeave:C=>C.currentTarget.style.background=t.surface,children:b},b))})]})}function ot(r,s){if(r==null)return"";if(s==="number")return typeof r=="number"?r.toLocaleString():String(r);if(s==="date"){const d=r instanceof Date?r:new Date(String(r));return isNaN(d.getTime())?String(r):d.toLocaleDateString()}return String(r)}function st(r,s,d){return r==null?1:s==null?-1:d==="date"?new Date(String(r)).getTime()-new Date(String(s)).getTime():d==="number"?Number(r)-Number(s):String(r)<String(s)?-1:String(r)>String(s)?1:0}function ye(r){var s;return Array.isArray(r.header)&&((s=r.header[1])==null?void 0:s.content)!=null?r.header[1].content:r.filterable?r.filterType==="select"?"selectFilter":"inputFilter":null}function lt(r,s,d,i,f){const a={width:"100%",border:"none",outline:`2px solid ${t.primary}`,borderRadius:2,fontSize:13,padding:"2px 4px",background:t.surface,color:t.text},u=r.editorType??"input";if(u==="select")return e.jsx("select",{autoFocus:!0,value:s,onChange:y=>d(y.target.value),onBlur:i,onKeyDown:y=>{y.key==="Enter"&&i(),y.key==="Escape"&&f()},onClick:y=>y.stopPropagation(),style:{...a,cursor:"pointer"},children:(r.options??[]).map(y=>e.jsx("option",{value:y,children:y},y))});if(u==="combobox")return e.jsx(nt,{options:r.options??[],value:s,onChange:d,onCommit:i,onCancel:f});const h=r.type==="number"?"number":r.type==="date"?"date":"text";return e.jsx("input",{autoFocus:!0,type:h,value:s,onChange:y=>d(y.target.value),onBlur:i,onKeyDown:y=>{y.key==="Enter"&&i(),y.key==="Escape"&&f()},onClick:y=>y.stopPropagation(),style:a})}function it({columns:r,data:s=[],height:d=400,rowHeight:i=40,headerRowHeight:f=40,footerRowHeight:a=40,sortable:u=!0,resizable:h=!0,editable:y=!1,stripe:M=!1,autoWidth:o=!1,keyNavigation:b=!1,selection:C,multiselect:I,leftSplit:H=0,onSelect:c,onChange:z,style:L}){var Oe;const[E,A]=g.useState(null),[m,$]=g.useState("asc"),[V,p]=g.useState({}),[N,l]=g.useState(new Set),[x,K]=g.useState(-1),[P,n]=g.useState(()=>Object.fromEntries(r.map(v=>[v.id,v.width??v.minWidth??150]))),[T,F]=g.useState(null),[w,k]=g.useState(""),[D,S]=g.useState({}),j=g.useRef(null),[X,Q]=g.useState(0);g.useEffect(R,[]),g.useEffect(()=>{if(!o||!j.current)return;const v=new ResizeObserver(()=>{var W;return Q(((W=j.current)==null?void 0:W.offsetWidth)??0)});return v.observe(j.current),()=>v.disconnect()},[o]);const G=g.useMemo(()=>r.map(v=>v.summary&&(!v.footer||v.footer.length===0)?{...v,footer:[{summary:v.summary}]}:v),[r]),U=g.useMemo(()=>G.filter(v=>!v.hidden),[G]),ee=g.useMemo(()=>{if(!o||X===0)return P;const v=U.reduce((B,Y)=>B+(P[Y.id]??150),0);if(X<=v)return P;const W=(X-v)/U.length;return Object.fromEntries(U.map(B=>[B.id,(P[B.id]??150)+W]))},[o,X,P,U]),te=g.useMemo(()=>{let v=s.map((W,B)=>{const Y=String(W.id??B);return D[Y]?{...W,...D[Y]}:W}).filter(W=>Object.entries(V).every(([B,Y])=>!Y||String(W[B]??"").toLowerCase().includes(Y.toLowerCase())));if(E){const W=G.find(B=>B.id===E);v=[...v].sort((B,Y)=>{const J=st(B[E],Y[E],W==null?void 0:W.type);return m==="asc"?J:-J})}return v},[s,E,m,V,D,G]),pe=g.useMemo(()=>{const v={};return G.forEach(W=>{var B;if((B=W.footer)!=null&&B.some(Y=>Y.summary)){const Y=te.map(_=>Number(_[W.id])).filter(_=>!isNaN(_)),J=Y.reduce((_,ne)=>_+ne,0);v[W.id]={sum:J,avg:Y.length?J/Y.length:0,count:te.length,min:Y.length?Math.min(...Y):0,max:Y.length?Math.max(...Y):0}}}),v},[te,G]),re=g.useMemo(()=>{const v={};return U.filter(W=>{const B=ye(W);return B==="selectFilter"||B==="comboFilter"}).forEach(W=>{v[W.id]=[...new Set(s.map(B=>String(B[W.id]??"")))].sort()}),v},[s,U]),O=U.some(v=>ye(v)!==null),ae=G.some(v=>{var W;return(W=v.footer)==null?void 0:W.length}),$e=U.reduce((v,W)=>v+(ee[W.id]??150),0),de=g.useMemo(()=>{if(!H)return{};let v=0;const W={};return U.forEach((B,Y)=>{Y<H&&(W[B.id]=v,v+=ee[B.id]??150)}),W},[H,U,ee]),le=H>0?(Oe=U[H-1])==null?void 0:Oe.id:null,ge=(v,W)=>v.id??W,It=v=>{!u||v.sortable===!1||($(W=>E===v.id&&W==="asc"?"desc":"asc"),A(v.id))},De=(v,W)=>{if(!C)return;const B=ge(v,W);K(W),l(Y=>{const J=I?new Set(Y):new Set;return J.has(B)?J.delete(B):J.add(B),J}),c==null||c(v)},Wt=()=>{if(!T)return;const{key:v,colId:W}=T;S(Y=>({...Y,[String(v)]:{...Y[String(v)]||{},[W]:w}}));const B=te.find((Y,J)=>ge(Y,J)===v);B&&(z==null||z(B,W,w)),F(null)},Bt=v=>{if(T&&v.key==="Escape"){F(null);return}if(!(!b||!C)){if(v.key==="ArrowDown"){v.preventDefault();const W=Math.min(x+1,te.length-1);W>=0&&De(te[W],W)}else if(v.key==="ArrowUp"){v.preventDefault();const W=Math.max(x-1,0);W>=0&&De(te[W],W)}}},Ht=(v,W)=>{v.preventDefault(),v.stopPropagation();const B=v.clientX,Y=P[W]??150,J=r.find(oe=>oe.id===W),_=oe=>n(he=>({...he,[W]:Math.max((J==null?void 0:J.minWidth)||50,Y+oe.clientX-B)})),ne=()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",ne)};document.addEventListener("mousemove",_),document.addEventListener("mouseup",ne)},Le=(v,W,B,Y,J,_="hidden")=>{const ne=v in de;return{width:W,minWidth:W,flexShrink:0,boxSizing:"border-box",padding:"0 12px",height:J,display:"flex",alignItems:"center",overflow:_,textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:13,textAlign:B,justifyContent:B==="center"?"center":B==="right"?"flex-end":"flex-start",borderLeft:Y?"none":ue,position:ne?"sticky":"relative",...ne?{left:de[v],zIndex:1,boxShadow:v===le?"2px 0 6px rgba(0,0,0,0.1)":void 0}:{}}};return e.jsx("div",{ref:j,className:"dhx",tabIndex:b?0:void 0,onKeyDown:Bt,style:{width:"100%",height:d,display:"flex",flexDirection:"column",border:ue,borderRadius:t.r,overflow:"hidden",outline:"none",...L},children:e.jsx("div",{className:"dhx-scroll",style:{overflow:"auto",flex:1},children:e.jsxs("div",{style:{minWidth:$e,display:"flex",flexDirection:"column",minHeight:"100%"},children:[e.jsx("div",{style:{display:"flex",background:t.bg,borderBottom:ue,flexShrink:0,position:"sticky",top:0,zIndex:3},children:U.map((v,W)=>{const B=Array.isArray(v.header)?v.header[0]:null,Y=(B==null?void 0:B.text)??(typeof v.header=="string"?v.header:v.id),J=(B==null?void 0:B.align)??v.align,_=ee[v.id]??150,ne=v.id in de;return e.jsxs("div",{onClick:()=>It(v),style:{...Le(v.id,_,J,W===0,f),fontWeight:500,color:t.text,background:t.bg,cursor:u&&v.sortable!==!1?"pointer":"default",userSelect:"none",...ne?{zIndex:4}:{}},children:[B!=null&&B.htmlEnable?e.jsx("span",{style:{flex:1,overflow:"hidden"},dangerouslySetInnerHTML:{__html:Y}}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Y}),u&&v.sortable!==!1&&e.jsx(rt,{active:E===v.id,dir:m}),h&&v.resizable!==!1&&W<U.length-1&&e.jsx("div",{onMouseDown:oe=>Ht(oe,v.id),onClick:oe=>oe.stopPropagation(),style:{position:"absolute",right:0,top:0,bottom:0,width:4,cursor:"col-resize",zIndex:1},onMouseEnter:oe=>oe.currentTarget.style.background=t.primary+"55",onMouseLeave:oe=>oe.currentTarget.style.background="transparent"})]},v.id)})}),O&&e.jsx("div",{style:{display:"flex",borderBottom:ue,background:t.surface,flexShrink:0,...H?{position:"sticky",top:f,zIndex:3}:{}},children:U.map((v,W)=>{const B=ye(v),Y=ee[v.id]??150,J=v.id in de;return e.jsx("div",{style:{width:Y,minWidth:Y,flexShrink:0,padding:"4px 6px",boxSizing:"border-box",borderLeft:W===0?"none":ue,background:t.surface,...J?{position:"sticky",left:de[v.id],zIndex:4,boxShadow:v.id===le?"2px 0 6px rgba(0,0,0,0.1)":void 0}:{}},children:B==="selectFilter"||B==="comboFilter"?e.jsxs("select",{className:"dhx dhx-input",style:{height:26,fontSize:12,padding:"0 4px"},value:V[v.id]||"",onChange:_=>p(ne=>({...ne,[v.id]:_.target.value})),children:[e.jsx("option",{value:"",children:"All"}),(re[v.id]||[]).map(_=>e.jsx("option",{value:_,children:_},_))]}):B==="inputFilter"?e.jsx("input",{className:"dhx dhx-input",style:{height:26,fontSize:12},placeholder:"Filter...",value:V[v.id]||"",onChange:_=>p(ne=>({...ne,[v.id]:_.target.value}))}):null},v.id)})}),e.jsxs("div",{style:{flex:1},children:[te.map((v,W)=>{const B=ge(v,W),Y=N.has(B),J=Y?t.primaryLt:M&&W%2!==0?t.bg:t.surface;return e.jsx("div",{style:{display:"flex",height:i,borderBottom:ue,flexShrink:0,background:J,transition:"background .1s",cursor:C?"pointer":"default"},onMouseEnter:_=>!Y&&(_.currentTarget.style.background=t.primaryLt+"80"),onMouseLeave:_=>!Y&&(_.currentTarget.style.background=J),children:U.map((_,ne)=>{const oe=(T==null?void 0:T.key)===B&&(T==null?void 0:T.colId)===_.id,he=v[_.id],At=ee[_.id]??150,Fe=(y||_.editable)&&_.editable!==!1;let fe;return oe?fe=lt(_,w,k,Wt,()=>F(null)):_.template?fe=_.template(he,v):_.htmlEnable?fe=e.jsx("span",{dangerouslySetInnerHTML:{__html:String(he??"")}}):_.type==="boolean"?fe=e.jsx("input",{type:"checkbox",readOnly:!0,checked:!!he,style:{width:16,height:16,accentColor:t.primary,cursor:Fe?"pointer":"default"}}):fe=ot(he,_.type),e.jsx("div",{onClick:()=>{if(De(v,W),!!Fe)if(_.type==="boolean"){const Ye=!he,_e=String(B);S(Ke=>({...Ke,[_e]:{...Ke[_e]||{},[_.id]:Ye}})),z==null||z(v,_.id,Ye)}else F({key:B,colId:_.id}),k(String(he??""))},style:{...Le(_.id,At,_.align,ne===0,i,oe?"visible":"hidden"),background:J},children:fe},_.id)})},String(B))}),te.length===0&&e.jsx("div",{style:{textAlign:"center",padding:40,color:t.textMut,fontSize:13},children:"No data"})]}),ae&&e.jsx("div",{style:{display:"flex",borderTop:ue,background:t.bg,flexShrink:0,position:"sticky",bottom:0,zIndex:2},children:U.map((v,W)=>{var oe;const B=(oe=v.footer)==null?void 0:oe[0],Y=pe[v.id]??{sum:0,avg:0,count:0,min:0,max:0};let J="";B&&(typeof B.text=="function"?J=B.text(Y):B.text?J=B.text:B.summary&&(J=String(Math.round(Y[B.summary]*100)/100)));const _=ee[v.id]??150,ne=v.id in de;return e.jsx("div",{style:{...Le(v.id,_,v.align,W===0,a),fontWeight:600,color:t.text,background:t.bg,...ne?{zIndex:3}:{}},children:J},v.id)})})]})})})}const se=["#0288d1","#43a047","#f57c00","#e53935","#8e24aa","#00838f","#ef6c00","#2e7d32"];function at(r,s,d){const i=r.filter(a=>!a.parent),f=r.filter(a=>!!a.parent);return i.map(a=>({name:a[d],children:f.filter(u=>u.parent===a.id).map(u=>({name:u[d],value:Number(u[s]??0)}))}))}function dt({type:r="bar",data:s=[],series:d=[],scales:i={},legend:f,height:a=280,style:u}){var z,L,E,A,m,$,V,p,N,l,x,K,P,n,T,F;g.useEffect(R,[]);const h=((z=i.bottom)==null?void 0:z.text)||s[0]&&Object.keys(s[0])[0]||"x",y=e.jsx(Z.Tooltip,{contentStyle:{fontSize:12,borderRadius:t.r,border:`1px solid ${t.border}`}}),M=f?e.jsx(Z.Legend,{iconSize:10,wrapperStyle:{fontSize:12},verticalAlign:f.valign==="bottom"?"bottom":f.valign==="middle"?"middle":"top",align:f.halign??"center"}):null,o=e.jsx(Z.CartesianGrid,{strokeDasharray:"3 3",stroke:t.border}),b=e.jsx(Z.XAxis,{dataKey:h,tick:{fontSize:11,fill:t.textSec},axisLine:{stroke:t.border},tickLine:!1,label:(L=i.bottom)!=null&&L.title?{value:i.bottom.title,position:"insideBottom",offset:-4,fontSize:11}:void 0}),C=e.jsx(Z.YAxis,{tick:{fontSize:11,fill:t.textSec},axisLine:!1,tickLine:!1,domain:[((E=i.left)==null?void 0:E.min)??"auto",((A=i.left)==null?void 0:A.max)??"auto"],tickCount:(m=i.left)==null?void 0:m.maxTicks,label:($=i.left)!=null&&$.title?{value:i.left.title,angle:-90,position:"insideLeft",fontSize:11}:void 0}),I={top:10,right:20,left:0,bottom:(V=i.bottom)!=null&&V.title?20:0},H={data:s,margin:I};let c;if(r==="bar")c=e.jsxs(Z.BarChart,{...H,children:[o,b,C,y,M,d.map((w,k)=>e.jsx(Z.Bar,{dataKey:w.value||w.id||"",name:w.label||w.id,fill:w.fill||w.color||se[k%se.length],radius:[3,3,0,0]},w.id??k))]});else if(r==="line")c=e.jsxs(Z.LineChart,{...H,children:[o,b,C,y,M,d.map((w,k)=>{const D=w.color||se[k%se.length];return e.jsx(Z.Line,{type:"monotone",dataKey:w.value||w.id||"",name:w.label||w.id,stroke:D,strokeWidth:w.strokeWidth??2,dot:{r:3,fill:D}},w.id??k)})]});else if(r==="area")c=e.jsxs(Z.AreaChart,{...H,children:[o,b,C,y,M,d.map((w,k)=>{const D=w.color||se[k%se.length];return e.jsx(Z.Area,{type:"monotone",dataKey:w.value||w.id||"",name:w.label||w.id,stroke:D,fill:(w.fill||D)+"33",strokeWidth:w.strokeWidth??2},w.id??k)})]});else if(r==="pie"||r==="donut"){const w=d[0]||{},k=w.value||"value",D=w.text||"name",S=w.color&&s[0]&&w.color in s[0]?w.color:null;c=e.jsxs(Z.PieChart,{children:[e.jsx(Z.Pie,{data:s,cx:"50%",cy:"50%",outerRadius:r==="donut"?"70%":"80%",innerRadius:r==="donut"?"40%":0,dataKey:k,nameKey:D,stroke:w.stroke||"none",strokeWidth:w.strokeWidth??0,label:({name:j,percent:X})=>`${j??""} ${((X??0)*100).toFixed(0)}%`,labelLine:!0,paddingAngle:2,children:s.map((j,X)=>e.jsx(Z.Cell,{fill:S?j[S]:se[X%se.length]},X))}),y,M]})}else if(r==="radar"){const w=((p=i.radial)==null?void 0:p.value)||h;c=e.jsxs(Z.RadarChart,{...H,cx:"50%",cy:"50%",children:[e.jsx(Z.PolarGrid,{}),e.jsx(Z.PolarAngleAxis,{dataKey:w,tick:{fontSize:11}}),e.jsx(Z.PolarRadiusAxis,{tick:{fontSize:9,fill:t.textMut},axisLine:!1}),d.map((k,D)=>{const S=k.color||k.pointColor||se[D%se.length];return e.jsx(Z.Radar,{dataKey:k.value||k.id||"",name:k.label||k.id,stroke:S,fill:S+"44"},k.id??D)}),y,M]})}else if(r==="scatter")c=e.jsxs(Z.ScatterChart,{margin:I,children:[o,e.jsx(Z.XAxis,{type:"number",dataKey:"x",name:((N=i.bottom)==null?void 0:N.title)||"x",tick:{fontSize:11,fill:t.textSec},tickLine:!1,domain:[((l=i.bottom)==null?void 0:l.min)??"auto",((x=i.bottom)==null?void 0:x.max)??"auto"],label:(K=i.bottom)!=null&&K.title?{value:i.bottom.title,position:"insideBottom",offset:-4,fontSize:11}:void 0}),e.jsx(Z.YAxis,{type:"number",dataKey:"y",name:((P=i.left)==null?void 0:P.title)||"y",tick:{fontSize:11,fill:t.textSec},tickLine:!1,axisLine:!1,domain:[((n=i.left)==null?void 0:n.min)??"auto",((T=i.left)==null?void 0:T.max)??"auto"],label:(F=i.left)!=null&&F.title?{value:i.left.title,angle:-90,position:"insideLeft",fontSize:11}:void 0}),y,M,d.map((w,k)=>{const D=w.value||"x",S=w.valueY||"y",j=(w.data||s).map(X=>({x:X[D],y:X[S]}));return e.jsx(Z.Scatter,{data:j,name:w.label||w.id,fill:w.color||se[k%se.length]},w.id??k)})]});else if(r==="treeMap"){const w=d[0]||{},k=w.value||"value",D=w.text||"name",S=at(s,k,D),j=w.stroke||t.surface,X=w.strokeWidth??2;c=e.jsx(Z.Treemap,{data:S,dataKey:"value",aspectRatio:4/3,stroke:j,content:Q=>{const{x:G,y:U,width:ee,height:te,depth:pe,index:re,name:O}=Q;if(pe===0)return null;const ae=se[re%se.length];return e.jsxs("g",{children:[e.jsx("rect",{x:G,y:U,width:ee,height:te,fill:ae,stroke:j,strokeWidth:X,style:{borderRadius:3}}),ee>40&&te>20&&e.jsx("text",{x:G+ee/2,y:U+te/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#fff",fontSize:11,pointerEvents:"none",children:O})]})}})}return e.jsx("div",{className:"dhx",style:{width:"100%",height:a,padding:12,background:t.surface,borderRadius:t.rMd,...u},children:e.jsx(Z.ResponsiveContainer,{width:"100%",height:"100%",children:c})})}const ct=["January","February","March","April","May","June","July","August","September","October","November","December"],pt=["Su","Mo","Tu","We","Th","Fr","Sa"];function ht({value:r,range:s=!1,timepicker:d=!1,onChange:i,style:f}){const a=new Date,u=r?new Date(Array.isArray(r)?r[0]:r):a,[h,y]=g.useState(u),[M,o]=g.useState(r??(s?[null,null]:null)),[b,C]=g.useState(null),[I,H]=g.useState({h:0,m:0});g.useEffect(R,[]);const c=h.getFullYear(),z=h.getMonth(),L=new Date(c,z,1).getDay(),E=new Date(c,z+1,0).getDate(),A=[];for(let p=0;p<L;p++)A.push(null);for(let p=1;p<=E;p++)A.push(new Date(c,z,p));const m=p=>p.toDateString()===a.toDateString(),$=p=>{if(!M)return!1;if(s&&Array.isArray(M)){const[N,l]=M;if(!N)return!1;const x=p.getTime();return l?x>=N.getTime()&&x<=l.getTime():p.toDateString()===N.toDateString()}return p.toDateString()===M.toDateString()},V=p=>{if(s){const[N,l]=Array.isArray(M)?M:[null,null];if(!N||l)o([p,null]);else{const x=p<N?[p,N]:[N,p];o(x),i==null||i(x)}}else o(p),i==null||i(p)};return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...f},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{onClick:()=>y(p=>new Date(p.getFullYear(),p.getMonth()-1,1)),className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,padding:"0 8px",fontSize:16},children:"‹"}),e.jsxs("div",{style:{fontWeight:700,fontSize:14},children:[ct[z]," ",c]}),e.jsx("button",{onClick:()=>y(p=>new Date(p.getFullYear(),p.getMonth()+1,1)),className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,padding:"0 8px",fontSize:16},children:"›"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 32px)",gap:2},children:[pt.map(p=>e.jsx("div",{style:{textAlign:"center",fontSize:11,fontWeight:600,color:t.textMut,paddingBottom:4},children:p},p)),A.map((p,N)=>{const l=p?$(p):!1,x=p&&b&&p.toDateString()===b.toDateString();return e.jsx("div",{onClick:()=>p&&V(p),onMouseEnter:()=>p&&C(p),onMouseLeave:()=>C(null),style:{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:t.r,cursor:p?"pointer":"default",fontSize:12,fontWeight:p&&m(p)?700:400,background:l?t.primary:x?t.bg:"transparent",color:l?"#fff":p&&m(p)?t.primary:p?t.text:"transparent",border:p&&m(p)&&!l?`1px solid ${t.primary}`:"1px solid transparent",transition:"all .1s"},children:p==null?void 0:p.getDate()},N)})]}),d&&e.jsxs("div",{style:{borderTop:`1px solid ${t.border}`,marginTop:12,paddingTop:12,display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx("input",{type:"number",min:0,max:23,value:I.h,onChange:p=>H(N=>({...N,h:+p.target.value})),className:"dhx dhx-input",style:{width:50,textAlign:"center"}}),e.jsx("span",{style:{fontWeight:700,color:t.textSec},children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:I.m,onChange:p=>H(N=>({...N,m:+p.target.value})),className:"dhx dhx-input",style:{width:50,textAlign:"center"}})]})]})}function We({value:r,onChange:s,timeFormat:d=12,controls:i=!1,minuteStep:f=5,style:a}){const[u,h]=g.useState((r==null?void 0:r.h)??(d===24?0:12)),[y,M]=g.useState((r==null?void 0:r.m)??0),[o,b]=g.useState((r==null?void 0:r.ampm)??"AM"),[C,I]=g.useState(null);g.useEffect(R,[]);const H=d===24?Array.from({length:24},(m,$)=>$):Array.from({length:12},(m,$)=>$+1),c=Array.from({length:Math.ceil(60/f)},(m,$)=>$*f),z=(m,$,V)=>{const p=d===24?{h:m,m:$}:{h:m,m:$,ampm:V};i?I(p):s==null||s(p)},L=()=>{I(null),h((r==null?void 0:r.h)??(d===24?0:12)),M((r==null?void 0:r.m)??0),b((r==null?void 0:r.ampm)??"AM")},E={display:"flex",flexDirection:"column",alignItems:"center",gap:4},A=m=>({height:32,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:13,fontWeight:m?700:400,background:m?t.primaryLt:"transparent",color:m?t.primary:t.text});return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...a},children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"stretch"},children:[e.jsxs("div",{style:E,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"Hours"}),e.jsx("div",{className:"dhx-scroll",style:{height:160,overflowY:"auto",width:48,border:`1px solid ${t.border}`,borderRadius:t.r},children:H.map(m=>e.jsx("div",{onClick:()=>{h(m),z(m,y,o)},style:A(u===m),onMouseEnter:$=>u!==m&&($.currentTarget.style.background=t.bg),onMouseLeave:$=>u!==m&&($.currentTarget.style.background="transparent"),children:String(m).padStart(2,"0")},m))})]}),e.jsxs("div",{style:E,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"Minutes"}),e.jsx("div",{className:"dhx-scroll",style:{height:160,overflowY:"auto",width:48,border:`1px solid ${t.border}`,borderRadius:t.r},children:c.map(m=>e.jsx("div",{onClick:()=>{M(m),z(u,m,o)},style:A(y===m),onMouseEnter:$=>y!==m&&($.currentTarget.style.background=t.bg),onMouseLeave:$=>y!==m&&($.currentTarget.style.background="transparent"),children:String(m).padStart(2,"0")},m))})]}),d===12&&e.jsxs("div",{style:E,children:[e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textMut},children:"AM/PM"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",border:`1px solid ${t.border}`,borderRadius:t.r,overflow:"hidden"},children:["AM","PM"].map(m=>e.jsx("div",{onClick:()=>{b(m),z(u,y,m)},style:{height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"0 12px",fontSize:13,fontWeight:o===m?700:400,background:o===m?t.primary:t.surface,color:o===m?"#fff":t.text},children:m},m))})]})]}),e.jsxs("div",{style:{textAlign:"center",marginTop:12,fontSize:22,fontWeight:700,color:t.primary,letterSpacing:2},children:[String(u).padStart(2,"0"),":",String(y).padStart(2,"0"),d===12?` ${o}`:""]}),i&&e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:12},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:L,children:"Cancel"}),e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",onClick:()=>{const m=C??(d===24?{h:u,m:y}:{h:u,m:y,ampm:o});s==null||s(m)},children:"Apply"})]})]})}const ut=({open:r})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",style:{flexShrink:0,transition:"transform .15s",transform:r?"rotate(180deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:t.textMut,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})});function be({data:r=[],value:s,placeholder:d="Select or type...",multiselection:i=!1,label:f,onChange:a,style:u}){var V;const[h,y]=g.useState(!1),[M,o]=g.useState(""),[b,C]=g.useState(i?s?[].concat(s):[]:s||null),I=g.useRef(null),H=g.useRef(null);g.useEffect(R,[]),ce(I,g.useCallback(()=>{y(!1),o("")},[]));const c=g.useMemo(()=>r.filter(p=>!M||p.value.toLowerCase().includes(M.toLowerCase())),[r,M]),z=p=>i?(b||[]).includes(p):b===p,L=p=>{const N=p.id||p.value;if(i){const l=z(N)?b.filter(x=>x!==N):[...b||[],N];C(l),a==null||a(l)}else C(N),o(""),y(!1),a==null||a(N)},E=p=>{const N=b.filter(l=>l!==p);C(N),a==null||a(N)},A=()=>{y(!0),setTimeout(()=>{var p;return(p=H.current)==null?void 0:p.focus()},0)},m=((V=r.find(p=>(p.id||p.value)===b))==null?void 0:V.value)||"",$=i?b||[]:[];return e.jsxs("div",{ref:I,className:"dhx",style:{position:"relative",...u},children:[f&&e.jsx("label",{className:"dhx dhx-label",children:f}),e.jsxs("div",{onClick:A,style:{display:"flex",alignItems:"center",flexWrap:i?"wrap":"nowrap",border:`1px solid ${h?t.primary:t.border}`,borderRadius:t.r,minHeight:34,padding:"4px 8px",cursor:"text",background:t.surface,gap:4,transition:"border-color .15s",boxShadow:h?`0 0 0 3px ${t.primary}22`:"none"},children:[i&&e.jsxs(e.Fragment,{children:[$.map(p=>{var N;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:t.primary,color:"#fff",borderRadius:12,padding:"2px 10px 2px 8px",fontSize:12,lineHeight:1.5,whiteSpace:"nowrap"},children:[((N=r.find(l=>(l.id||l.value)===p))==null?void 0:N.value)||p,e.jsx("span",{onClick:l=>{l.stopPropagation(),E(p)},style:{cursor:"pointer",fontSize:15,lineHeight:1,opacity:.75,marginLeft:2},children:"×"})]},p)}),e.jsx("input",{ref:H,value:M,onChange:p=>{o(p.target.value),y(!0)},onFocus:()=>y(!0),onClick:p=>p.stopPropagation(),placeholder:$.length?"":d,style:{flex:1,minWidth:60,border:"none",outline:"none",fontSize:13,background:"transparent",color:t.text,padding:0}})]}),!i&&e.jsx("input",{ref:H,value:h?M:m,onChange:p=>{o(p.target.value),y(!0)},onFocus:()=>{y(!0),o("")},onClick:p=>p.stopPropagation(),placeholder:d,style:{flex:1,border:"none",outline:"none",fontSize:13,background:"transparent",color:t.text,padding:0}}),e.jsx(ut,{open:h})]}),h&&e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.r,boxShadow:t.shadowLg,zIndex:100},children:e.jsxs("div",{className:"dhx-scroll",style:{maxHeight:220,overflowY:"auto"},children:[c.map(p=>{const N=p.id||p.value,l=z(N);return e.jsxs("div",{onClick:()=>L(p),style:{padding:"8px 12px",cursor:"pointer",display:"flex",alignItems:"center",gap:8,fontSize:13,background:l?t.primaryLt:"transparent",color:l?t.primary:t.text},onMouseEnter:x=>!l&&(x.currentTarget.style.background=t.bg),onMouseLeave:x=>!l&&(x.currentTarget.style.background="transparent"),children:[i&&e.jsx("span",{style:{width:14,height:14,flexShrink:0,border:`2px solid ${l?t.primary:t.borderDk}`,borderRadius:3,display:"flex",alignItems:"center",justifyContent:"center",background:l?t.primary:"transparent"},children:l&&e.jsx("span",{style:{color:"#fff",fontSize:9,lineHeight:1},children:"✓"})}),e.jsx("span",{style:{flex:1},children:p.value}),!i&&l&&e.jsx("span",{style:{color:t.primary,fontSize:12,fontWeight:700},children:"✓"}),p.count!==void 0&&e.jsxs("span",{style:{fontSize:11,color:t.textMut},children:["(",p.count,")"]})]},N)}),c.length===0&&e.jsx("div",{style:{padding:16,textAlign:"center",color:t.textMut,fontSize:13},children:"No matches"})]})})]})}function ve({min:r=0,max:s=100,step:d=1,value:i,range:f=!1,label:a,tick:u,disabled:h=!1,onChange:y,style:M}){const[o,b]=g.useState(i??(f?[r,s]:r));g.useEffect(R,[]);const C=(L,E)=>{if(!h)if(f){const A=[...o];A[L]=E,b(A),y==null||y(A)}else b(E),y==null||y(E)},I=L=>(L-r)/(s-r)*100,H=f?o:[o],c=f?{left:`${I(H[0])}%`,width:`${I(H[1])-I(H[0])}%`}:{left:0,width:`${I(H[0])}%`},z=h?t.border:t.primary;return e.jsxs("div",{className:"dhx",style:{width:"100%",opacity:h?.5:1,...M},children:[a&&e.jsx("label",{className:"dhx dhx-label",children:a}),e.jsx("div",{style:{position:"relative",height:36,display:"flex",alignItems:"center"},children:e.jsxs("div",{style:{position:"relative",flex:1,height:4,background:t.border,borderRadius:2},children:[e.jsx("div",{style:{position:"absolute",...c,height:"100%",background:z,borderRadius:2}}),H.map((L,E)=>e.jsx("input",{type:"range",min:r,max:s,step:d,value:L,disabled:h,onChange:A=>{const m=+A.target.value;f&&E===0&&m>=o[1]||f&&E===1&&m<=o[0]||C(E,m)},style:{position:"absolute",width:"100%",height:"100%",opacity:0,cursor:h?"not-allowed":"pointer",top:0,left:0,margin:0}},E)),H.map((L,E)=>e.jsx("div",{style:{position:"absolute",left:`${I(L)}%`,top:"50%",transform:"translate(-50%, -50%)",width:16,height:16,borderRadius:"50%",background:t.surface,border:`2px solid ${z}`,boxShadow:"0 1px 4px rgba(0,0,0,.2)",pointerEvents:"none"},children:e.jsx("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",background:h?t.textMut:t.primaryDk,color:"#fff",padding:"2px 6px",borderRadius:t.r,fontSize:11,fontWeight:700,whiteSpace:"nowrap"},children:L})},E))]})}),u&&e.jsx("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[r,Math.round((s+r)/2),s].map(L=>e.jsx("span",{style:{fontSize:10,color:t.textMut},children:L},L))})]})}const ft=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#607d8b","#9e9e9e","#000000","#ffffff","#0288d1","#01579b","#43a047","#e53935","#f57c00"];function Se(r){const s=parseInt(r.slice(1,3),16)/255,d=parseInt(r.slice(3,5),16)/255,i=parseInt(r.slice(5,7),16)/255,f=Math.max(s,d,i),a=Math.min(s,d,i);let u=0,h=0;const y=(f+a)/2;if(f!==a){const M=f-a;h=y>.5?M/(2-f-a):M/(f+a),u=f===s?((d-i)/M+(d<i?6:0))/6:f===d?((i-s)/M+2)/6:((s-d)/M+4)/6}return[Math.round(u*360),Math.round(h*100),Math.round(y*100)]}function Be(r,s,d){s/=100,d/=100;const i=s*Math.min(d,1-d),f=a=>{const u=(a+r/30)%12,h=d-i*Math.max(Math.min(u-3,9-u,1),-1);return Math.round(255*h).toString(16).padStart(2,"0")};return"#"+f(0)+f(8)+f(4)}function gt({value:r="#0288d1",onChange:s,style:d}){const[i,f]=g.useState(()=>Se(r)),a=Be(...i);g.useEffect(R,[]);const u=h=>{f(h),s==null||s(Be(...h))};return e.jsxs("div",{className:"dhx",style:{background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,padding:16,display:"inline-block",boxShadow:t.shadow,...d},children:[e.jsx("div",{style:{width:200,height:120,borderRadius:t.r,marginBottom:12,background:`linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, hsl(${i[0]},100%,50%))`,cursor:"crosshair"}}),[["Hue",0,360,i[0]],["Saturation",0,100,i[1]],["Lightness",0,100,i[2]]].map(([h,y,M,o],b)=>e.jsxs("div",{style:{marginBottom:b<2?8:12},children:[e.jsxs("div",{className:"dhx dhx-label",children:[h,b>0?` (${o}%)`:""]}),e.jsx("input",{type:"range",min:y,max:M,value:o,onChange:C=>{const I=[...i];I[b]=+C.target.value,u(I)},style:{width:"100%",accentColor:t.primary}})]},h)),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx("div",{style:{width:36,height:36,borderRadius:t.r,background:a,border:`1px solid ${t.border}`,flexShrink:0}}),e.jsx("input",{className:"dhx dhx-input",style:{flex:1,fontFamily:"monospace",fontSize:12},value:a,onChange:h=>{try{u(Se(h.target.value)),s==null||s(h.target.value)}catch{}}})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(13, 1fr)",gap:3},children:ft.map(h=>e.jsx("div",{onClick:()=>{f(Se(h)),s==null||s(h)},style:{width:14,height:14,borderRadius:2,background:h,cursor:"pointer",border:a===h?`2px solid ${t.text}`:"1px solid rgba(0,0,0,.15)",transition:"transform .1s"},onMouseEnter:y=>y.currentTarget.style.transform="scale(1.3)",onMouseLeave:y=>y.currentTarget.style.transform="scale(1)"},h))})]})}function xt({trigger:r,children:s,placement:d="bottom-start",style:i}){const[f,a]=g.useState(!1),[u,h]=g.useState({top:"100%",left:0}),y=g.useRef(null),M=g.useRef(null);g.useEffect(R,[]),ce(y,g.useCallback(()=>a(!1),[]));const o=()=>{a(b=>{if(!b&&M.current){const C=M.current.getBoundingClientRect(),I={"bottom-start":{top:C.height+4,left:0},"bottom-end":{top:C.height+4,right:0,left:"auto"},"top-start":{bottom:C.height+4,top:"auto",left:0}};h(I[d]||I["bottom-start"])}return!b})};return e.jsxs("div",{ref:y,className:"dhx",style:{position:"relative",display:"inline-block"},children:[e.jsx("div",{ref:M,onClick:o,children:r}),f&&e.jsx("div",{className:"dhx dhx-anim-fade",style:{position:"absolute",...u,zIndex:200,background:t.surface,border:`1px solid ${t.border}`,borderRadius:t.rMd,boxShadow:t.shadowLg,...i},children:s})]})}function yt({title:r,children:s,width:d=480,height:i,closable:f=!0,movable:a=!0,modal:u=!1,defaultOpen:h=!0,footer:y,onClose:M,style:o}){const[b,C]=g.useState(h),[I,H]=g.useState({x:0,y:0});g.useEffect(R,[]);const c=Ee(g.useCallback((L,E)=>a&&H({x:L,y:E}),[a])),z=()=>{C(!1),M==null||M()};return b?e.jsxs(e.Fragment,{children:[u&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:900},onClick:f?z:void 0}),e.jsxs("div",{className:"dhx",style:{position:u?"fixed":"absolute",left:"50%",top:"50%",transform:`translate(calc(-50% + ${I.x}px), calc(-50% + ${I.y}px))`,width:d,...i?{height:i}:{},background:t.surface,borderRadius:t.rMd,boxShadow:t.shadowLg,zIndex:901,display:"flex",flexDirection:"column",overflow:"hidden",...o},children:[e.jsxs("div",{onMouseDown:L=>c(L,I.x,I.y),style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:`1px solid ${t.border}`,cursor:a?"grab":"default",background:t.bg,gap:8,userSelect:"none"},children:[e.jsx("span",{style:{flex:1,fontWeight:700,fontSize:15},children:r}),f&&e.jsx("button",{onClick:z,style:{background:"none",border:"none",cursor:"pointer",width:28,height:28,borderRadius:t.r,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:t.textSec},onMouseEnter:L=>L.currentTarget.style.background=t.border,onMouseLeave:L=>L.currentTarget.style.background="none",children:"×"})]}),e.jsx("div",{className:"dhx-scroll",style:{flex:1,minHeight:0,padding:20,overflowY:"auto"},children:s}),y&&e.jsx("div",{style:{padding:"12px 16px",borderTop:`1px solid ${t.border}`,display:"flex",justifyContent:"flex-end",gap:8,background:t.bg},children:y})]})]}):null}const ke=g.createContext(null),bt={success:"✓",error:"✕",warning:"⚠",info:"ℹ"},He={success:t.success,error:t.danger,warning:t.warning,info:t.primary};function vt({children:r}){const[s,d]=g.useState([]);g.useEffect(R,[]);const i=g.useCallback(u=>d(h=>h.filter(y=>y.id!==u)),[]),f=g.useCallback(u=>{const h=Date.now();return d(y=>[...y,{id:h,...u}]),u.duration!==0&&setTimeout(()=>i(h),u.duration||4e3),h},[i]),a={message:f,alert:(u,h)=>f({type:"info",title:u,...h}),confirm:(u,h,y)=>f({type:"warning",title:u,confirm:h,...y})};return e.jsxs(ke.Provider,{value:a,children:[r,e.jsx("div",{style:{position:"fixed",top:20,right:20,zIndex:9999,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none"},children:s.map(u=>{const h=u.type||"info";return e.jsxs("div",{style:{background:t.surface,border:`1px solid ${t.border}`,borderLeft:`4px solid ${He[h]}`,borderRadius:t.r,boxShadow:t.shadowLg,padding:"12px 16px",minWidth:280,maxWidth:380,pointerEvents:"all",display:"flex",gap:10,alignItems:"flex-start",animation:"dhx-toast .3s ease"},children:[e.jsx("span",{style:{fontSize:18,color:He[h],lineHeight:1},children:bt[h]}),e.jsxs("div",{style:{flex:1},children:[u.title&&e.jsx("div",{style:{fontWeight:600,fontSize:13,marginBottom:u.text?3:0},children:u.title}),u.text&&e.jsx("div",{style:{fontSize:12,color:t.textSec,lineHeight:1.5},children:u.text}),u.confirm&&e.jsxs("div",{style:{display:"flex",gap:6,marginTop:8},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",style:{height:26,fontSize:12},onClick:()=>{u.confirm(!0),i(u.id)},children:"Confirm"}),e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",style:{height:26,fontSize:12},onClick:()=>{u.confirm(!1),i(u.id)},children:"Cancel"})]})]}),e.jsx("button",{onClick:()=>i(u.id),style:{background:"none",border:"none",cursor:"pointer",color:t.textMut,fontSize:14,lineHeight:1,padding:0},children:"×"})]},u.id)})})]})}function St(){const r=g.useContext(ke);if(!r)throw new Error("useMessage must be used inside <MessageProvider>");return r}function kt({data:r=[],template:s,keyNavigation:d=!0,multiselection:i=!1,editable:f=!1,height:a=400,onSelect:u,onEdit:h,style:y}){const[M,o]=g.useState(new Set),[b,C]=g.useState(null),[I,H]=g.useState(""),[c,z]=g.useState(null);g.useEffect(R,[]);const L=(A,m)=>{const $=A.id??m;o(V=>{const p=i?new Set(V):new Set;return p.has($)?p.delete($):p.add($),p}),z(m),u==null||u(A)},E=(A,m)=>{h==null||h({...A,value:I},m),C(null)};return e.jsxs("div",{className:"dhx dhx-scroll",style:{height:a,overflowY:"auto",border:`1px solid ${t.border}`,borderRadius:t.r,background:t.surface,...y},tabIndex:0,onKeyDown:A=>{d&&(A.key==="ArrowDown"&&z(m=>Math.min((m??-1)+1,r.length-1)),A.key==="ArrowUp"&&z(m=>Math.max((m??1)-1,0)))},children:[r.map((A,m)=>{const $=A.id??m,V=M.has($),p=c===m;return e.jsx("div",{onClick:()=>L(A,m),onDoubleClick:()=>f&&(C(m),H(String(A.value||""))),style:{display:"flex",alignItems:"center",padding:"0 12px",height:40,cursor:"pointer",fontSize:13,borderBottom:`1px solid ${t.border}`,background:V?t.primaryLt:p?t.bg:t.surface,color:V?t.primary:t.text,outline:p?`2px solid ${t.primary}44`:"none",transition:"background .1s"},children:b===m?e.jsx("input",{autoFocus:!0,className:"dhx dhx-input",style:{height:28,flex:1},value:I,onChange:N=>H(N.target.value),onBlur:()=>E(A,m),onKeyDown:N=>{N.key==="Enter"&&E(A,m),N.key==="Escape"&&C(null)},onClick:N=>N.stopPropagation()}):s?e.jsx("div",{dangerouslySetInnerHTML:{__html:s(A)},style:{flex:1}}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:String(A.value??"")})},String($))}),r.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:t.textMut},children:"No items"})]})}function wt({data:r=[],template:s,itemsInRow:d=3,gap:i=12,multiselection:f=!1,onSelect:a,style:u}){const[h,y]=g.useState(new Set);g.useEffect(R,[]);const M=o=>{const b=o.id??String(o.title);y(C=>{const I=f?new Set(C):new Set;return I.has(b)?I.delete(b):I.add(b),I}),a==null||a(o)};return e.jsx("div",{className:"dhx",style:{display:"grid",gridTemplateColumns:`repeat(${d}, 1fr)`,gap:i,padding:i,...u},children:r.map((o,b)=>{const C=o.id??b,I=h.has(C);return e.jsx("div",{onClick:()=>M(o),style:{background:t.surface,border:`2px solid ${I?t.primary:t.border}`,borderRadius:t.rMd,overflow:"hidden",cursor:"pointer",transition:"all .15s",boxShadow:I?`0 0 0 3px ${t.primary}33`:t.shadow,transform:I?"translateY(-2px)":"none"},onMouseEnter:H=>{H.currentTarget.style.boxShadow=t.shadowLg,H.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:H=>{H.currentTarget.style.boxShadow=I?`0 0 0 3px ${t.primary}33`:t.shadow,H.currentTarget.style.transform=I?"translateY(-2px)":"none"},children:s?e.jsx("div",{dangerouslySetInnerHTML:{__html:s(o)}}):e.jsxs("div",{style:{padding:16},children:[o.img&&e.jsx("img",{src:o.img,alt:o.title||"",style:{width:"100%",borderRadius:t.r,marginBottom:8,display:"block"}}),e.jsx("div",{style:{fontWeight:600,fontSize:14,marginBottom:4},children:o.title||o.value}),o.subtitle&&e.jsx("div",{style:{fontSize:12,color:t.textSec},children:o.subtitle})]})},String(C))})})}function we(r){return r.map(s=>({...s,items:s.items?we(s.items):void 0}))}function ze(r,s={}){return r.forEach(d=>{d.opened&&(s[d.id]=!0),d.items&&ze(d.items,s)}),s}function Ae(r,s){let d=null;return[r.filter(f=>f.id===s?(d=f,!1):!0).map(f=>{if(f.items){const[a,u]=Ae(f.items,s);return u&&(d=u),{...f,items:a}}return f}),d]}function Me(r,s,d,i){if(i==="inside")return r.map(a=>a.id===s?{...a,items:[...a.items||[],d]}:a.items?{...a,items:Me(a.items,s,d,i)}:a);if(r.some(a=>a.id===s)){const a=[];for(const u of r)u.id===s?i==="before"?(a.push(d),a.push(u)):(a.push(u),a.push(d)):a.push(u);return a}return r.map(a=>a.items?{...a,items:Me(a.items,s,d,i)}:a)}function zt(r,s,d){function i(f){var a,u;if(f.id===s){const h=y=>{var M;return y.id===d||(((M=y.items)==null?void 0:M.some(h))??!1)};return((a=f.items)==null?void 0:a.some(h))??!1}return((u=f.items)==null?void 0:u.some(i))??!1}return r.some(i)}function je(r,s,d){return r.map(i=>i.id===s?{...i,value:d}:{...i,items:i.items?je(i.items,s,d):void 0})}function Mt(r,s){var a;let d=0,i=0;const f=u=>{var h;d++,s[u.id]&&i++,(h=u.items)==null||h.forEach(f)};return(a=r.items)==null||a.forEach(f),{total:d,checkedCount:i}}function mt({data:r=[],checkbox:s=!1,editable:d=!1,dragMode:i,tooltip:f,onSelect:a,onCheck:u,onChange:h,style:y}){const[M,o]=g.useState(()=>we(r)),[b,C]=g.useState(()=>ze(r)),[I,H]=g.useState(null),[c,z]=g.useState({}),[L,E]=g.useState(null),[A,m]=g.useState(""),[$,V]=g.useState(null),[p,N]=g.useState(null);g.useEffect(R,[]),g.useEffect(()=>{o(we(r)),C(k=>({...ze(r),...k}))},[r]);const l=k=>C(D=>({...D,[k]:!D[k]})),x=(k,D)=>{z(S=>({...S,[k]:D})),u==null||u(k,D)},K=()=>{if(!L)return;const k=L,D=A;E(null),o(S=>{const j=je(S,k,D);return h==null||h(j),j})},P=(k,D)=>{k.dataTransfer.effectAllowed="move",V(D)},n=(k,D)=>{if(!$||$===D||zt(M,$,D))return;k.preventDefault();const S=k.currentTarget.getBoundingClientRect(),j=k.clientY-S.top,X=S.height,Q=j<X*.25?"before":j>X*.75?"after":"inside";N(G=>(G==null?void 0:G.id)===D&&(G==null?void 0:G.pos)===Q?G:{id:D,pos:Q})},T=(k,D)=>{if(k.preventDefault(),!$||!p||$===D){N(null),V(null);return}o(S=>{const[j,X]=Ae(S,$);if(!X)return S;const Q=Me(j,D,X,p.pos);return h==null||h(Q),Q}),p.pos==="inside"&&C(S=>({...S,[D]:!0})),N(null),V(null)},F=()=>{V(null),N(null)},w=(k,D=0)=>{var re;const S=(((re=k.items)==null?void 0:re.length)??0)>0,j=b[k.id],X=I===k.id,Q=$===k.id,G=(p==null?void 0:p.id)===k.id;let U=!!c[k.id],ee=!1;if(s&&S){const{total:O,checkedCount:ae}=Mt(k,c);ae>0&&ae<O?ee=!0:O>0&&ae===O&&(U=!0)}const te=G&&p.pos!=="inside"?{boxShadow:p.pos==="before"?`inset 0 2px 0 0 ${t.primary}`:`inset 0 -2px 0 0 ${t.primary}`}:{},pe=G&&p.pos==="inside"||X?t.primaryLt:"transparent";return e.jsxs("div",{style:{opacity:Q?.4:1},children:[e.jsxs("div",{draggable:!!i,onDragStart:i?O=>P(O,k.id):void 0,onDragOver:i?O=>n(O,k.id):void 0,onDrop:i?O=>T(O,k.id):void 0,onDragEnd:i?F:void 0,title:f==null?void 0:f(k),onClick:()=>{H(k.id),a==null||a(k),S&&l(k.id)},onDoubleClick:()=>{d&&(E(k.id),m(k.value||""))},style:{display:"flex",alignItems:"center",gap:4,padding:`5px 8px 5px ${12+D*18}px`,cursor:i?"grab":"pointer",borderRadius:t.r,margin:"1px 4px",background:pe,color:X?t.primary:t.text,userSelect:"none",fontSize:13,...te},onMouseEnter:O=>!X&&!G&&(O.currentTarget.style.background=t.bg),onMouseLeave:O=>!X&&!G&&(O.currentTarget.style.background="transparent"),children:[e.jsx("span",{style:{width:16,textAlign:"center",fontSize:11,color:t.textMut,flexShrink:0},onClick:O=>{O.stopPropagation(),S&&l(k.id)},children:S?j?"▾":"▸":""}),e.jsx("span",{style:{fontSize:15,flexShrink:0},children:S?j?"📂":"📁":"📄"}),s&&e.jsx("input",{ref:O=>{O&&(O.indeterminate=ee)},type:"checkbox",checked:U,onChange:O=>{O.stopPropagation(),x(k.id,O.target.checked)},style:{cursor:"pointer",accentColor:t.primary,flexShrink:0},onClick:O=>O.stopPropagation()}),L===k.id?e.jsx("input",{autoFocus:!0,className:"dhx dhx-input",style:{height:24,fontSize:12,flex:1},value:A,onChange:O=>m(O.target.value),onBlur:K,onKeyDown:O=>{O.key==="Enter"&&K(),O.key==="Escape"&&E(null)},onClick:O=>O.stopPropagation()}):e.jsx("span",{style:{flex:1},children:k.value}),k.count!==void 0&&e.jsxs("span",{style:{fontSize:11,color:t.textMut},children:["(",k.count,")"]})]}),S&&j&&e.jsx("div",{children:k.items.map(O=>w(O,D+1))})]},k.id)};return e.jsx("div",{className:"dhx dhx-scroll",style:{overflowY:"auto",...y},onDragOver:i?k=>k.preventDefault():void 0,onDrop:i?k=>{k.preventDefault(),N(null),V(null)}:void 0,children:M.map(k=>w(k))})}function Ct({total:r,pageSize:s=10,page:d,onChange:i,style:f}){const[a,u]=g.useState(d||1),h=Math.ceil(r/s);g.useEffect(R,[]);const y=o=>{const b=Math.min(Math.max(1,o),h);u(b),i==null||i(b)},M=g.useMemo(()=>{const o=[];for(let C=Math.max(1,a-2);C<=Math.min(h,a+2);C++)o.push(C);return o[0]>1&&(o[0]>2&&o.unshift("..."),o.unshift(1)),o[o.length-1]<h&&(o[o.length-1]<h-1&&o.push("..."),o.push(h)),o},[a,h]);return e.jsxs("div",{className:"dhx",style:{display:"flex",alignItems:"center",gap:4,padding:"8px 12px",...f},children:[e.jsxs("span",{style:{fontSize:12,color:t.textSec,marginRight:8},children:[(a-1)*s+1,"–",Math.min(a*s,r)," of ",r]}),[["«",1],["‹",a-1]].map(([o,b])=>e.jsx("button",{className:"dhx dhx-btn dhx-btn-ghost",style:{height:30,padding:"0 8px",fontSize:14},disabled:a===1,onClick:()=>y(b),children:o},o)),M.map((o,b)=>e.jsx("button",{onClick:()=>typeof o=="number"&&y(o),className:`dhx dhx-btn ${o===a?"dhx-btn-primary":"dhx-btn-ghost"}`,style:{height:30,minWidth:30,padding:"0 8px",fontSize:13},disabled:o==="...",children:o},b)),[["›",a+1],["»",h]].map(([o,b])=>e.jsx("button",{className:"dhx dhx-btn dhx-btn-ghost",style:{height:30,padding:"0 8px",fontSize:14},disabled:a===h,onClick:()=>y(b),children:o},o))]})}function $t({config:r={},defaultValues:s={},onSubmit:d,style:i}){const[f,a]=g.useState(s),[u,h]=g.useState({}),[y,M]=g.useState(null);g.useEffect(R,[]);const o=(c,z)=>{a(L=>({...L,[c]:z})),h(L=>({...L,[c]:null}))},b=c=>{const z=[];return c.flat().forEach(L=>{!L||typeof L!="object"||!("name"in L)||(z.push(L),L.type==="fieldset"&&L.rows&&z.push(...b(L.rows)))}),z},C=()=>{const c={};return b(r.rows||[]).forEach(z=>{z.required&&!f[z.name]&&(c[z.name]=`${z.label||z.name} is required`)}),h(c),Object.keys(c).length===0},I=c=>{const z=f[c.name]??c.value??"",L=u[c.name],E=c.labelWidth??r.labelWidth,A=E!==void 0||c.labelPosition==="left";if(c.type==="fieldset")return e.jsxs("fieldset",{style:{border:`1px solid ${t.border}`,borderRadius:t.r,padding:"12px 16px",marginBottom:14},children:[e.jsx("legend",{style:{fontSize:12,fontWeight:700,color:t.textSec,padding:"0 6px"},children:c.label}),(c.rows||[]).map(x=>I(x))]},c.name);if(c.type==="spacer")return e.jsx("div",{style:{height:c.height||16}},c.name);const m=E?{minWidth:E,width:E,flexShrink:0,paddingTop:8,boxSizing:"border-box"}:{},$=c.label?e.jsxs("label",{className:"dhx dhx-label",style:{display:"flex",gap:4,...m},children:[c.label,c.required&&e.jsx("span",{style:{color:t.danger},children:"*"})]},"lbl"):null,V=L?e.jsx("div",{style:{fontSize:11,color:t.danger,marginTop:3},children:L}):null,p=c.helpMessage?e.jsxs("div",{style:{fontSize:11,color:t.textMut,marginTop:3},children:["ⓘ ",c.helpMessage]}):null,N={key:c.name,className:"dhx-form-group"},l=x=>A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[$,e.jsxs("div",{style:{flex:1,minWidth:0},children:[x,V,p]})]}):e.jsxs("div",{...N,children:[$,x,V,p]});if(!c.type||c.type==="input")return l(e.jsxs("div",{className:"dhx-input-wrap",children:[c.icon&&e.jsx("span",{className:"dhx-input-icon",children:c.icon}),e.jsx("input",{className:`dhx dhx-input${c.icon?" dhx-input--with-icon":""}`,style:{borderColor:L?t.danger:void 0},type:c.inputType||"text",placeholder:c.placeholder,value:z,onChange:x=>o(c.name,x.target.value),disabled:c.disabled})]}));if(c.type==="textarea")return l(e.jsx("textarea",{className:"dhx dhx-input",style:{height:80,resize:"vertical",padding:"8px 10px"},placeholder:c.placeholder,value:z,onChange:x=>o(c.name,x.target.value)}));if(c.type==="select")return l(e.jsxs("select",{className:"dhx dhx-input",value:z,onChange:x=>o(c.name,x.target.value),style:{cursor:"pointer"},children:[e.jsx("option",{value:"",children:"— Select —"}),(c.options||[]).map(x=>e.jsx("option",{value:x.value,children:x.label||x.value},x.value))]}));if(c.type==="datepicker")return l(e.jsx("input",{type:"date",className:"dhx dhx-input",value:z,onChange:x=>o(c.name,x.target.value)}));if(c.type==="timepicker"){const x=f[c.name]??{h:12,m:0,ampm:"AM"},K=!!f[c.name],P=K?`${String(x.h).padStart(2,"0")}:${String(x.m).padStart(2,"0")}${x.ampm?" "+x.ampm:""}`:c.placeholder||"Click to select",n=e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("div",{className:"dhx dhx-input",style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between"},onClick:()=>M(y===c.name?null:c.name),children:[e.jsx("span",{style:{color:K?t.text:t.textMut},children:P}),e.jsx("span",{style:{fontSize:13,color:t.textSec},children:"🕐"})]}),y===c.name&&e.jsx("div",{style:{position:"absolute",zIndex:100,top:"calc(100% + 4px)",left:0},children:e.jsx(We,{value:x,controls:!0,onChange:T=>{o(c.name,T),M(null)}})})]});return l(n)}if(c.type==="colorpicker")return l(e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("input",{type:"color",value:z||"#000000",onChange:x=>o(c.name,x.target.value),style:{width:36,height:36,padding:2,border:`1px solid ${t.border}`,borderRadius:t.r,cursor:"pointer",background:"none"}}),e.jsx("span",{style:{fontSize:12,color:t.textSec,fontFamily:"monospace"},children:z||"#000000"})]}));if(c.type==="text")return l(e.jsx("p",{style:{margin:"6px 0",fontSize:13,color:t.text},children:c.value}));if(c.type==="checkbox")return e.jsxs("div",{...N,children:[A?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[E&&e.jsx("div",{style:{width:E,flexShrink:0}}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:!!z,onChange:x=>o(c.name,x.target.checked),style:{width:16,height:16,accentColor:t.primary,cursor:"pointer"}}),e.jsx("span",{style:{fontSize:13},children:c.label})]})]}):e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:!!z,onChange:x=>o(c.name,x.target.checked),style:{width:16,height:16,accentColor:t.primary,cursor:"pointer"}}),e.jsx("span",{style:{fontSize:13},children:c.label})]}),p]});if(c.type==="radio"){const x=(c.options||[]).map(K=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:13},children:[e.jsx("input",{type:"radio",name:c.name,value:K.value,checked:z===K.value,onChange:()=>o(c.name,K.value),style:{accentColor:t.primary,cursor:"pointer"}}),K.label||K.value]},K.value));return l(e.jsx("div",{style:{display:"flex",gap:16,flexWrap:"wrap",paddingTop:8},children:x}))}if(c.type==="slider")return A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[$,e.jsxs("div",{style:{flex:1},children:[e.jsx(ve,{min:c.min,max:c.max,step:c.step,value:z||c.min,range:c.range,onChange:x=>o(c.name,x)}),p]})]}):e.jsxs("div",{...N,children:[e.jsx(ve,{label:c.label,min:c.min,max:c.max,step:c.step,value:z||c.min,range:c.range,onChange:x=>o(c.name,x)}),p]});if(c.type==="combo")return A?e.jsxs("div",{...N,style:{display:"flex",alignItems:"flex-start",gap:8},children:[$,e.jsxs("div",{style:{flex:1},children:[e.jsx(be,{data:c.data||[],multiselection:c.multiselection,placeholder:c.placeholder||"Select...",value:z||(c.multiselection?[]:null),onChange:x=>o(c.name,x)}),V,p]})]}):e.jsxs("div",{...N,children:[e.jsx(be,{label:c.label,data:c.data||[],multiselection:c.multiselection,placeholder:c.placeholder||"Select...",value:z||(c.multiselection?[]:null),onChange:x=>o(c.name,x)}),V,p]});if(c.type==="toggle"){const x=!!z,K=x?c.icon:c.offIcon||c.icon,P=x?c.text||c.label:c.offText||c.text||c.label;return e.jsxs("div",{...N,children:[A&&E&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:E,flexShrink:0}}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx(Pe,{on:x,onClick:()=>o(c.name,!z)}),K&&e.jsx("span",{style:{fontSize:16},children:K}),P&&e.jsx("span",{style:{fontSize:13},children:P})]})]}),!A&&e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},children:[e.jsx(Pe,{on:x,onClick:()=>o(c.name,!z)}),K&&e.jsx("span",{style:{fontSize:16},children:K}),P&&e.jsx("span",{style:{fontSize:13},children:P})]}),p]})}return null},H=c=>c.map((z,L)=>Array.isArray(z)?e.jsx("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:z.map(I)},L):I(z));return e.jsxs("div",{className:"dhx",style:{padding:r.padding||0,width:r.width||"100%",...i},children:[H(r.rows||[]),(r.buttons||d)&&e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:r.buttonAlign||"flex-start",marginTop:8},children:[e.jsx("button",{className:"dhx dhx-btn dhx-btn-primary",onClick:()=>C()&&(d==null?void 0:d(f)),children:r.submitText||"Submit"}),r.resetButton!==!1&&e.jsx("button",{className:"dhx dhx-btn dhx-btn-secondary",onClick:()=>{a(s),h({})},children:r.resetText||"Reset"})]})]})}function Pe({on:r,onClick:s}){return e.jsxs("div",{style:{position:"relative",width:40,height:22,flexShrink:0},onClick:s,children:[e.jsx("div",{style:{width:40,height:22,borderRadius:11,background:r?t.primary:t.border,transition:"background 0.2s"}}),e.jsx("div",{style:{position:"absolute",top:3,left:r?21:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,.3)"}})]})}function xe(r){const s=[];for(const d of r)d.type==="block"?s.push(...xe(d.items||[])):s.push(d);return s}function Dt(r){return r==="primary"?t.primary:r==="success"?t.success:r==="secondary"?t.borderDk:t.danger}function Lt(r,s){switch(r){case"primary":return{background:t.primary,color:"#fff",borderColor:t.primary};case"danger":return{background:t.danger,color:"#fff",borderColor:t.danger};case"success":return{background:t.success,color:"#fff",borderColor:t.success};case"secondary":return{background:t.bg,color:t.text,borderColor:t.border};default:return s?{background:t.primaryLt,color:t.primary}:{}}}function Tt({items:r=[],css:s,menuCss:d,style:i,onAction:f,onInputChange:a,onInputBlur:u,onInputFocus:h,onOpenMenu:y}){g.useEffect(R,[]);const[M,o]=g.useState(()=>{const n={};for(const T of xe(r))T.id&&(n[T.id]=!!T.active);return n}),[b,C]=g.useState(null),[I,H]=g.useState(()=>{const n={};for(const T of xe(r))T.type==="selectButton"&&T.id&&T.value&&(n[T.id]=T.value);return n}),c=xe(r),z=g.useRef(null);ce(z,g.useCallback(()=>C(null),[]));const L=n=>{var T,F;if(!n.disabled){if(n.id){if(n.group){const w=c.filter(k=>k.group===n.group&&k.id);o(k=>{const D={...k};for(const S of w)D[S.id]=!1;return D[n.id]=!0,D})}else n.twoState&&o(w=>({...w,[n.id]:!w[n.id]}));if((T=n.items)!=null&&T.length){const w=n.id;C(k=>k===w?null:w),y==null||y(n.id);return}}(F=n.onClick)==null||F.call(n,n),n.id&&(f==null||f(n.id,n))}},E=({count:n,color:T})=>e.jsx("span",{style:{position:"absolute",top:2,right:2,minWidth:14,height:14,background:Dt(T),color:"#fff",borderRadius:7,fontSize:9,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 2px",pointerEvents:"none"},children:n>99?"99+":n}),A=(n,T)=>{var re;const F=n.id!==void 0?M[n.id]??!!n.active:!!n.active,w=n.value??n.text,k=n.size??"medium",D=k==="auto",S=k==="small",j=!!((re=n.items)!=null&&re.length),X=n.id!==void 0&&b===n.id,Q=Lt(n.color,F&&!n.color),G=D?void 0:S?26:32,U=D?22:S?13:16,ee=[n.tooltip,n.hotkey?`(${n.hotkey})`:""].filter(Boolean).join(" "),te=n.circle?{borderRadius:"50%",padding:D?"8px":"0",aspectRatio:"1",justifyContent:"center"}:{},pe=n.view==="link"?{background:"transparent",border:"none",textDecoration:"underline",padding:"0 4px"}:n.view==="flat"?{borderRadius:0}:{};return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("button",{title:ee||void 0,disabled:n.disabled,className:"dhx dhx-btn dhx-btn-ghost",style:{flexDirection:D?"column":"row",alignSelf:D?"stretch":"center",justifyContent:"center",minHeight:D?56:G,height:D?void 0:G,padding:D?"6px 10px":S?"0 6px":"0 8px",gap:4,position:"relative",background:F&&!n.color?t.primaryLt:"transparent",color:F&&!n.color?t.primary:n.disabled?t.textMut:t.text,opacity:n.disabled?.55:1,cursor:n.disabled?"not-allowed":"pointer",borderColor:X?t.primary:void 0,...Q,...te,...pe},onClick:()=>L(n),children:[n.loading?e.jsx("span",{style:{fontSize:U,lineHeight:1,flexShrink:0,display:"inline-block",animation:"dhx-spin 1s linear infinite"},children:"⟳"}):n.icon&&e.jsx("span",{style:{fontSize:U,lineHeight:1,flexShrink:0},children:n.icon}),w&&!n.html&&e.jsx("span",{style:{fontSize:D?10:S?11:12,maxWidth:D?64:void 0,textAlign:D?"center":"left",lineHeight:D?1.2:1,whiteSpace:D?"normal":"nowrap"},children:w}),n.html&&e.jsx("span",{dangerouslySetInnerHTML:{__html:n.html}}),j&&e.jsx("span",{style:{fontSize:8,opacity:.6,marginLeft:1},children:"▼"}),n.hotkey&&D&&e.jsx("span",{style:{fontSize:9,color:t.textMut,lineHeight:1},children:n.hotkey}),n.count!==void 0&&e.jsx(E,{count:n.count,color:n.countColor})]}),j&&X&&e.jsx(ie,{items:n.items,onSelect:O=>{C(null),O.id&&(f==null||f(String(O.id),n))},style:{top:"100%",left:0,minWidth:160}})]},T)},m=(n,T)=>{const F=n.size??"medium",w=F==="auto"?48:F==="small"?28:36,k=n.id!==void 0?M[n.id]??!!n.active:!!n.active;return e.jsx("div",{style:{position:"relative",display:"flex",alignSelf:"center"},children:e.jsxs("button",{title:n.tooltip,disabled:n.disabled,style:{width:w,height:w,padding:2,border:k?`2px solid ${t.primary}`:"2px solid transparent",borderRadius:"50%",overflow:"hidden",cursor:n.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0,opacity:n.disabled?.55:1},onClick:()=>L(n),children:[n.src&&e.jsx("img",{src:n.src,alt:n.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),n.count!==void 0&&e.jsx(E,{count:n.count,color:n.countColor})]})},T)},$=(n,T)=>{var D,S;const F=n.id!==void 0&&b===`sel:${n.id}`,w=(n.id&&I[n.id])??n.value??((S=(D=n.items)==null?void 0:D[0])==null?void 0:S.value)??"",k=(n.items??[]).map(j=>({id:j.value,value:j.value,icon:j.icon}));return e.jsxs("div",{style:{position:"relative",alignSelf:"center"},children:[e.jsxs("button",{title:n.tooltip,disabled:n.disabled,className:"dhx dhx-btn dhx-btn-ghost",style:{height:28,gap:4,padding:"0 8px",opacity:n.disabled?.55:1,cursor:n.disabled?"not-allowed":"pointer",borderColor:F?t.primary:void 0},onClick:()=>{if(n.disabled||!n.id)return;const j=`sel:${n.id}`;C(X=>X===j?null:j)},children:[n.icon&&e.jsx("span",{style:{fontSize:14},children:n.icon}),e.jsx("span",{style:{fontSize:12},children:w}),e.jsx("span",{style:{fontSize:8,opacity:.6},children:"▼"})]}),F&&e.jsx(ie,{items:k,onSelect:j=>{var Q;const X=String(j.value??j.id??"");n.id&&H(G=>({...G,[n.id]:X})),C(null),(Q=n.onChange)==null||Q.call(n,X),n.id&&(f==null||f(n.id,n))},style:{top:"100%",left:0,minWidth:100}})]},T)},V=(n,T)=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",padding:"2px 4px",gap:2},children:[n.label&&e.jsx("span",{style:{fontSize:10,color:t.textMut},children:n.label}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[n.icon&&e.jsx("span",{style:{position:"absolute",left:6,fontSize:13,color:t.textMut,pointerEvents:"none",zIndex:1},children:n.icon}),e.jsx("input",{className:"dhx dhx-input",disabled:n.disabled,style:{width:n.width||110,height:26,fontSize:12,paddingLeft:n.icon?24:void 0},placeholder:n.placeholder,defaultValue:n.value,onChange:F=>{var w;(w=n.onChange)==null||w.call(n,F.target.value),n.id&&(a==null||a(n.id,F.target.value))},onBlur:F=>{var w;(w=n.onBlur)==null||w.call(n,F.target.value),n.id&&(u==null||u(n.id,F.target.value))},onFocus:F=>{var w;(w=n.onFocus)==null||w.call(n,F.target.value),n.id&&(h==null||h(n.id,F.target.value))}})]})]},T),p=(n,T)=>n.hidden?null:e.jsx("div",{title:n.tooltip,style:{padding:"2px 6px",fontSize:11,color:n.disabled?t.textMut:t.textSec,display:"flex",alignItems:"center",alignSelf:"center",userSelect:"none",opacity:n.disabled?.5:1},children:n.html?e.jsx("span",{dangerouslySetInnerHTML:{__html:n.html}}):n.value},T),N=(n,T)=>n.hidden?null:e.jsx("div",{style:{display:"flex",alignItems:"center",alignSelf:"center",padding:"0 4px"},dangerouslySetInnerHTML:{__html:n.html??""}},T),l=(n,T)=>n.hidden?null:n.type==="separator"||n.type==="sep"?e.jsx("div",{style:{width:1,background:t.border,margin:"4px 2px",alignSelf:"stretch"}},T):n.type==="spacer"?e.jsx("div",{style:{flex:1}},T):n.type==="title"?p(n,T):n.type==="customHTML"?N(n,T):n.type==="imageButton"?m(n,T):n.type==="input"?V(n,T):n.type==="selectButton"?$(n,T):A(n,T),x=(n,T,F)=>{var k;if(n.hidden)return null;const w=F||n.disabled;return e.jsx("div",{style:{display:"flex",flexDirection:n.direction==="col"?"column":"row",alignItems:n.direction==="col"?"flex-start":"center",gap:2,opacity:n.disabled&&!F?.55:1,pointerEvents:w?"none":void 0},children:(k=n.items)==null?void 0:k.map((D,S)=>D.type==="block"?x(D,`${T}-${S}`,w):l(D,`${T}-${S}`))},T)},K=(n,T)=>{var w;if(n.hidden)return null;const F=n.title||n.label;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",borderRight:`1px solid ${t.border}`,padding:"4px 6px 0",minWidth:40,opacity:n.disabled?.55:1,pointerEvents:n.disabled?"none":void 0},children:[e.jsx("div",{style:{display:"flex",flexDirection:n.direction==="col"?"column":"row",alignItems:n.direction==="col"?"stretch":"center",gap:2,flex:1},children:(w=n.items)==null?void 0:w.map((k,D)=>k.type==="block"?x(k,D,n.disabled):l(k,D))}),F&&e.jsx("div",{style:{fontSize:10,color:t.textMut,textAlign:"center",padding:"3px 0 4px",marginTop:2,borderTop:`1px solid ${t.border}`},children:F})]},T)},P=(n,T)=>n.type==="block"?K(n,T):l(n,T);return e.jsx("div",{ref:z,className:["dhx",s].filter(Boolean).join(" "),style:{display:"flex",alignItems:"stretch",background:t.surface,borderBottom:`1px solid ${t.border}`,overflowX:"auto",gap:0,minHeight:72,...i},children:r.map(P)})}function me(r){return r==="primary"?t.primary:r==="success"?t.success:r==="secondary"?t.borderDk:t.danger}function Et(r,s,d){if(!r&&!s)return d?{background:t.primaryLt,color:t.primary}:{};const i=r==="primary"?t.primary:r==="danger"?t.danger:r==="success"?t.success:t.borderDk;return s==="link"?{background:"transparent",color:i,border:"none",boxShadow:"none"}:s==="flat"?{background:i,color:"#fff",border:"none",boxShadow:"none"}:{color:i}}function Ce({count:r,bg:s}){return e.jsx("span",{style:{position:"absolute",top:3,right:3,minWidth:16,height:16,background:s??t.danger,color:"#fff",borderRadius:8,fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,pointerEvents:"none"},children:r})}function Nt({logo:r,items:s=[],vertical:d=!1,css:i,menuCss:f,onAction:a,onInputChange:u,onInputBlur:h,onInputFocus:y,style:M}){const[o,b]=g.useState(null),[C,I]=g.useState(()=>{const l={};return s.forEach(x=>{x.id&&(x.twoState||x.group)&&x.active&&(l[x.id]=!0)}),l}),[H,c]=g.useState(()=>{const l={};return s.forEach(x=>{x.type==="selectButton"&&x.id&&x.value&&(l[x.id]=x.value)}),l}),z=g.useRef(null);g.useEffect(R,[]),ce(z,g.useCallback(()=>b(null),[]));const L=l=>{var x,K;if(!l.disabled){if(l.twoState&&l.id&&I(P=>({...P,[l.id]:!P[l.id]})),l.group&&l.id&&I(P=>{const n={...P};return s.forEach(T=>{T.group===l.group&&T.id&&(n[T.id]=!1)}),n[l.id]=!0,n}),(x=l.items)!=null&&x.length||l.type==="selectButton"){const P=l.id;b(n=>n===P?null:P);return}(K=l.onClick)==null||K.call(l,l.id||""),a==null||a(l.id||"")}},E=(l,x)=>e.jsx("span",{style:{fontSize:12,color:t.textSec,padding:"0 8px",fontWeight:500,whiteSpace:"nowrap",alignSelf:"center"},children:l.value??l.text},l.id??x),A=(l,x)=>e.jsx("div",{dangerouslySetInnerHTML:{__html:l.html??""}},l.id??x),m=(l,x)=>e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",margin:"0 4px",gap:4},children:[l.label&&e.jsx("span",{style:{fontSize:12,color:t.textSec,whiteSpace:"nowrap"},children:l.label}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[l.icon&&e.jsx("span",{style:{position:"absolute",left:8,color:t.textMut,fontSize:15,pointerEvents:"none",zIndex:1},children:l.icon}),e.jsx("input",{className:"dhx dhx-input",style:{width:l.width||200,height:28,paddingLeft:l.icon?30:void 0},placeholder:l.placeholder,defaultValue:l.value,onChange:K=>{var P;(P=l.onChange)==null||P.call(l,K.target.value),u==null||u(l.id||"",K.target.value)},onBlur:K=>{var P;(P=l.onBlur)==null||P.call(l,K.target.value),h==null||h(l.id||"",K.target.value)},onFocus:K=>{var P;(P=l.onFocus)==null||P.call(l,K.target.value),y==null||y(l.id||"",K.target.value)}})]})]},l.id??x),$=(l,x)=>e.jsxs("button",{title:l.tooltip,disabled:l.disabled,style:{position:"relative",width:36,height:36,padding:2,border:"none",borderRadius:"50%",overflow:"hidden",cursor:l.disabled?"not-allowed":"pointer",background:"transparent",flexShrink:0},onClick:()=>L(l),children:[l.src&&e.jsx("img",{src:l.src,alt:l.value||"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}),l.count!==void 0&&e.jsx(Ce,{count:l.count,bg:me(l.countColor)})]},l.id??x),V=(l,x)=>{var P;const K=o===l.id;return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-ghost",title:l.tooltip,disabled:l.disabled,style:{position:"relative",height:d?40:36,gap:4,cursor:l.disabled?"not-allowed":"pointer",...d?{width:"100%",justifyContent:"flex-start",padding:"0 16px",borderRadius:0}:{}},onClick:()=>L(l),children:[l.icon&&e.jsx("span",{style:{fontSize:16,flexShrink:0},children:l.icon}),e.jsx("span",{style:{fontSize:13},children:H[l.id]??l.value??l.text}),e.jsx("span",{style:{fontSize:9,opacity:.55},children:"▼"}),l.count!==void 0&&e.jsx(Ce,{count:l.count,bg:me(l.countColor)})]}),K&&((P=l.items)==null?void 0:P.length)&&e.jsx(ie,{items:l.items,onSelect:n=>{var T;if(b(null),n.id!==void 0){const F=String(n.value??n.id);c(w=>({...w,[l.id]:F})),(T=l.onChange)==null||T.call(l,F),u==null||u(l.id,F)}},style:d?{left:"100%",top:0}:{top:"100%",left:0}})]},l.id??x)},p=(l,x)=>{var D;const K=!!(l.id&&(l.twoState||l.group)&&C[l.id]),P=!!((D=l.items)!=null&&D.length),n=!!l.circle,T=!!l.loading,F=Et(l.color,l.view,K),w={position:"relative",height:d?40:36,gap:6,background:K?t.primaryLt:"transparent",color:K?t.primary:l.disabled?t.textMut:t.text,opacity:l.disabled?.55:1,cursor:l.disabled?"not-allowed":"pointer",...d?{width:"100%",justifyContent:"flex-start",padding:"0 16px",borderRadius:0}:{},...n?{borderRadius:"50%",width:36,height:36,padding:0,minWidth:0,justifyContent:"center"}:{},...F},k=l.value??l.text;return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{className:"dhx dhx-btn dhx-btn-ghost",title:l.tooltip,disabled:l.disabled,style:w,onClick:()=>L(l),children:[T?e.jsx("span",{style:{fontSize:16,animation:"dhx-spin 1s linear infinite",display:"inline-block"},children:"⟳"}):l.icon&&e.jsx("span",{style:{fontSize:16,flexShrink:0},children:l.icon}),!n&&k&&e.jsx("span",{style:{fontSize:13},children:k}),!n&&l.hotkey&&e.jsx("span",{style:{fontSize:10,opacity:.45,marginLeft:4},children:l.hotkey}),P&&!n&&e.jsx("span",{style:{fontSize:9,opacity:.55,marginLeft:2},children:"▼"}),l.count!==void 0&&e.jsx(Ce,{count:l.count,bg:me(l.countColor)})]}),P&&o===l.id&&e.jsx(ie,{items:l.items,onSelect:S=>{var j;b(null),S.id&&((j=l.onClick)==null||j.call(l,S.id),a==null||a(S.id))},style:d?{left:"100%",top:0}:{top:"100%"}})]},l.id??x)},N=(l,x)=>l.hidden?null:l.type==="separator"?e.jsx("div",{style:{[d?"height":"width"]:1,background:t.border,margin:d?"4px 8px":"0 6px",alignSelf:"stretch"}},l.id??x):l.type==="spacer"?e.jsx("div",{style:{flex:1}},l.id??x):l.type==="title"?E(l,x):l.type==="customHTML"?A(l,x):l.type==="input"?m(l,x):l.type==="selectButton"?V(l,x):l.type==="imageButton"?$(l,x):p(l,x);return e.jsxs("nav",{ref:z,className:["dhx",i].filter(Boolean).join(" "),style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"stretch":"center",background:t.surface,borderBottom:d?"none":`1px solid ${t.border}`,borderRight:d?`1px solid ${t.border}`:"none",padding:d?"8px 0":"0 12px",minHeight:d?void 0:48,gap:2,...M},children:[r&&e.jsx("div",{style:{color:t.text,fontWeight:800,fontSize:16,padding:d?"8px 16px 12px":"0 12px 0 4px",borderBottom:d?`1px solid ${t.border}`:"none",borderRight:d?"none":`1px solid ${t.border}`,marginRight:d?0:8,marginBottom:d?4:0,flexShrink:0},children:r}),s.map(N)]})}q.Button=Xe,q.Calendar=ht,q.Chart=dt,q.Colorpicker=gt,q.Combobox=be,q.ContextMenu=Ge,q.DataView=wt,q.Form=$t,q.Grid=it,q.Layout=Ie,q.List=kt,q.Menu=qe,q.MenuDropdown=ie,q.MessageContext=ke,q.MessageProvider=vt,q.Navbar=Nt,q.Pagination=Ct,q.Popup=xt,q.Ribbon=Tt,q.Sidebar=Re,q.Slider=ve,q.Tabbar=tt,q.Timepicker=We,q.Toolbar=Je,q.Tree=mt,q.Window=yt,q.tokens=t,q.useClickOutside=ce,q.useDrag=Ee,q.useMessage=St,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
package/dist/index.d.ts CHANGED
@@ -361,14 +361,19 @@ export declare function MessageProvider({ children }: {
361
361
 
362
362
  export declare type MessageType = "success" | "error" | "warning" | "info";
363
363
 
364
- export declare function Navbar({ logo, items, vertical, onAction, style }: NavbarProps): JSX_2.Element;
364
+ export declare function Navbar({ logo, items, vertical, css: cssProp, menuCss, onAction, onInputChange, onInputBlur, onInputFocus, style, }: NavbarProps): JSX_2.Element;
365
+
366
+ export declare type NavbarColor = "danger" | "secondary" | "primary" | "success";
365
367
 
366
368
  export declare interface NavbarItem {
367
369
  id?: string;
368
- type?: "navItem" | "separator" | "spacer" | "input" | "imageButton";
370
+ type?: "navItem" | "separator" | "spacer" | "input" | "imageButton" | "selectButton" | "customHTML" | "title";
369
371
  value?: string;
372
+ text?: string;
373
+ html?: string;
370
374
  icon?: React.ReactNode;
371
375
  src?: string;
376
+ label?: string;
372
377
  items?: MenuItem[];
373
378
  width?: number;
374
379
  placeholder?: string;
@@ -378,15 +383,30 @@ export declare interface NavbarItem {
378
383
  disabled?: boolean;
379
384
  hidden?: boolean;
380
385
  count?: number;
386
+ countColor?: NavbarColor;
387
+ color?: NavbarColor;
388
+ view?: "flat" | "link";
389
+ circle?: boolean;
390
+ loading?: boolean;
391
+ hotkey?: string;
392
+ group?: string;
393
+ css?: string | string[];
381
394
  onClick?: (id: string) => void;
382
395
  onChange?: (value: string) => void;
396
+ onBlur?: (value: string) => void;
397
+ onFocus?: (value: string) => void;
383
398
  }
384
399
 
385
400
  export declare interface NavbarProps {
386
401
  logo?: React.ReactNode;
387
402
  items?: NavbarItem[];
388
403
  vertical?: boolean;
404
+ css?: string;
405
+ menuCss?: string;
389
406
  onAction?: (id: string) => void;
407
+ onInputChange?: (id: string, value: string) => void;
408
+ onInputBlur?: (id: string, value: string) => void;
409
+ onInputFocus?: (id: string, value: string) => void;
390
410
  style?: React.CSSProperties;
391
411
  }
392
412
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhx-react-suite",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "description": "TypeScript ui-components",
5
5
  "type": "module",
6
6
  "main": "./dist/dhx-react-suite.umd.cjs",