@sito/dashboard 0.0.38 → 0.0.39

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 +1 @@
1
- var ke=require("./main.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react");function W(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})}function q(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"})})}function V(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})})}function J(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})})}const G=t=>{const{className:n=""}=t;return e.jsx("svg",{className:n,viewBox:"0 0 16 16",children:e.jsx("path",{d:"M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z"})})};function _(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",children:e.jsx("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})}var L=(t=>(t.error="error",t.good="good",t.default="default",t))(L||{});const D=t=>{switch(t){case"error":return"input-error";case"good":return"input-good";default:return"input-normal"}},B=t=>{switch(t){case"error":return"input-label-error";case"good":return"input-label-good";default:return"input-label-normal"}},I=t=>{switch(t){case"error":return"input-helper-text-error";case"good":return"input-helper-text-good";default:return"input-helper-text-normal"}};const R=o.forwardRef(function(t,n){const{value:r,onChange:s,options:a,containerClassName:l="",inputClassName:c="",labelClassName:i="",helperText:u="",helperTextClassName:v="",placeholder:p="",label:m="",name:x="",id:d="",state:h=L.default,children:b,...j}=t;return e.jsxs("div",{className:`select-input-container ${l}`,children:[e.jsx("select",{...j,id:d,ref:n,name:x,value:r,onChange:s,className:`select-input ${D(h)} peer ${c}`,children:a==null?void 0:a.map(C=>e.jsx("option",{value:C.id,children:C.value??C.name??C.id},C.id))}),e.jsx("label",{htmlFor:x,className:`select-input-label ${B(h)} ${i}`,children:m}),b,e.jsx("p",{className:`select-input-helper-text ${I(h)} ${v}`,children:h!=="error"&&h!=="good"?p:u})]})});const z=o.forwardRef(function(t,n){const{children:r,value:s,onChange:a,state:l=L.default,name:c="",id:i="",type:u="text",label:v="",required:p=!1,placeholder:m="",containerClassName:x="",inputClassName:d="",labelClassName:h="",helperText:b="",helperTextClassName:j="",...C}=t;return e.jsxs("div",{className:`text-input-container ${x}`,children:[e.jsx("input",{ref:n,type:u,name:c,id:i,className:`text-input ${D(l)} peer ${d}`,placeholder:"",required:p,value:s,onChange:a,...C}),e.jsxs("label",{htmlFor:c,className:`text-input-label ${B(l)} ${h}`,children:[v,p?" *":""]}),r,e.jsx("p",{className:`text-input-helper-text ${I(l)} ${j}`,children:l!=="error"&&l!=="good"?m:b})]})});const K=o.forwardRef(function(t,n){const{checked:r,onChange:s,state:a=L.default,name:l="",id:c="",type:i="text",label:u="",containerClassName:v="",inputClassName:p="",labelClassName:m="",helperText:x="",helperTextClassName:d="",...h}=t;return e.jsxs("label",{className:`input-check-container ${v}`,children:[e.jsx("input",{id:c,ref:n,name:l,type:"checkbox",checked:r,onChange:s,className:`input-check ${p}`,...h}),e.jsx("span",{className:`input-check-label ${m}`,children:u})]})});const Q=o.forwardRef(function(t,n){const{state:r,value:s,onChange:a,options:l=[],name:c="",id:i="",label:u="",containerClassName:v="",inputContainerClassName:p="",helperText:m="",placeholder:x="",multiple:d=!1,...h}=t,[b,j]=o.useState(""),[C,f]=o.useState(!1),w=l.filter(g=>{const N=String(g.value).toLowerCase().includes(b==null?void 0:b.toLowerCase());return s&&s.length?s!=null&&s.some?!(s!=null&&s.some(A=>A.id===g.id)):(s==null?void 0:s.id)!==g.id:N}),E=o.useRef(null);o.useEffect(()=>{const g=F=>{E.current&&!E.current.contains(F.target)&&f(!1)},N=F=>{F.key==="Escape"&&f(!1)};return document.addEventListener("mousedown",g),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",N)}},[]);const M=g=>{j(g.target.value)},U=o.useCallback(g=>{j(""),g?d?Array.isArray(s)&&s.length?a([...s,g]):a([g]):a(g):a(null),f(!1)},[d,a,s]),xe=o.useCallback(g=>{const N=s.filter((F,A)=>A!==g);N.length?a(N):a(null)},[a,s]);return e.jsxs("div",{className:`autocomplete-input-container ${v}`,ref:E,children:[e.jsx(z,{state:r,name:c,id:i,value:!d&&s?s:b,onChange:M,placeholder:x,helperText:m,onFocus:()=>f(!0),label:u,containerClassName:`autocomplete-text-input ${p}`,ref:n,...h,children:!d&&s&&e.jsx("button",{type:"button",className:"autocomplete-delete-button",onClick:g=>{U(),g.stopPropagation()},children:e.jsx(_,{})})}),C&&e.jsx("ul",{className:"autocomplete-suggestions-container",children:w.map(g=>e.jsx("li",{className:"autocomplete-suggestion-item hover:bg-primary/20",onClick:N=>{U(g),N.stopPropagation()},children:g.value},g.id))}),d&&Array.isArray(s)&&s.length?e.jsx("ul",{className:"autocomplete-value-container",children:s.map((g,N)=>e.jsx("li",{children:e.jsx(me,{label:String(g.value),onDelete:F=>{xe(N),F.stopPropagation()}})},g.value))}):null]})});function X(t){const{color:n="stroke-blue-800",className:r="",loaderClass:s="",strokeWidth:a="4",...l}=t;return e.jsx("div",{...l,className:`loading ${r}`,children:e.jsx("div",{className:"loader-container",children:e.jsx("div",{className:`loader ${s}`,children:e.jsx("svg",{className:"circular",viewBox:"25 25 50 50",children:e.jsx("circle",{className:`path ${n}`,cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:a,strokeMiterlimit:"10"})})})})})}const Y=o.createContext({});function be(t){const{children:n,t:r}=t;return e.jsx(Y.Provider,{value:{t:r},children:n})}const $=()=>{const t=o.useContext(Y);if(t===void 0)throw new Error("translationContext must be used within a Provider");return t};var k=(t=>(t[t.text=0]="text",t[t.number=1]="number",t[t.select=2]="select",t[t.autocomplete=3]="autocomplete",t[t.date=4]="date",t[t.check=5]="check",t))(k||{}),O=(t=>(t.ASC="ASC",t.DESC="DESC",t))(O||{});const ge=[20,50,100],Z=o.createContext({}),ve=t=>{const{children:n}=t,[r,s]=o.useState(0),[a,l]=o.useState(20),[c,i]=o.useState(0),[u,v]=o.useState("id"),[p,m]=o.useState(O.DESC),[x,d]=o.useState({}),h=o.useCallback((C,f)=>{let w=p;if(u===C)switch(p){case O.ASC:w=O.DESC;break;default:w=O.ASC;break}v(C),m(w),f&&f(C,w)},[u,p]),b=o.useCallback(C=>{const f=Object.entries(C).reduce((w,[E,M])=>(M&&typeof M.value<"u"&&(w[E]=M.value),w),{});d(f)},[]),j={onSort:h,total:r,setTotal:s,sortingBy:u,setSortingBy:v,sortingOrder:p,setSortingOrder:m,pageSize:a,pageSizes:ge,setPageSize:l,currentPage:c,setCurrentPage:i,filters:x,onFilterApply:b};return e.jsx(Z.Provider,{value:j,children:n})},P=()=>{const t=o.useContext(Z);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t};var y=(t=>(t[t.update=0]="update",t[t.reset=1]="reset",t))(y||{});const ee=t=>{if(t){const n={},r=Object.keys(t);return r==null||r.forEach(s=>{n[s]={value:t[s]}}),n}return{}};function te(t,n){const{type:r}=n;switch(r){case y.reset:{const{filters:s}=n,a={};return s==null||s.forEach(({propertyName:l,defaultValue:c})=>{a[l]={value:c}}),{...t,...a}}case y.update:{const{toUpdate:s}=n;return{...t,...s}}default:return t}}const se=o.createContext({}),ne=t=>{const{children:n}=t,{filters:r}=P(),[s,a]=o.useReducer(te,ee(r)),l={currentFilters:s,setCurrentFilters:a};return e.jsx(se.Provider,{value:l,children:n})},T=()=>{const t=o.useContext(se);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t};function ae(t){const{t:n}=$(),{entity:r="",columns:s=[],hasAction:a=!0,onSortCallback:l}=t,{onSort:c,sortingOrder:i,sortingBy:u}=P(),v=o.useMemo(()=>{var p;return(p=s.sort((m,x)=>(x.pos??0)-(m.pos??0)).filter(m=>m.display!=="none"))==null?void 0:p.map(m=>({id:m.key,label:m.label,className:m.className??"",sortable:m.sortable??!0,sortOptions:m.sortOptions}))},[s,r,n]);return e.jsx("thead",{className:"table-headers-row",children:e.jsxs("tr",{children:[v.map(p=>{var m,x,d,h,b,j,C,f;return e.jsx("th",{scope:"col",className:`table-headers-column ${p.className}`,children:e.jsxs("button",{disabled:!p.sortable,onClick:()=>c(p.id,l),className:"table-headers-cell",children:[e.jsx("span",{className:"table-headers-label",children:p.label}),p.sortable&&e.jsx("span",{className:`${u===p.id?"table-headers-sort-on":"table-headers-sort"}`,children:i===O.ASC?((x=(m=p.sortOptions)==null?void 0:m.icons)==null?void 0:x.asc)??e.jsx(q,{className:((h=(d=p.sortOptions)==null?void 0:d.icons)==null?void 0:h.className)??"table-headers-sort-indicator"}):((j=(b=p.sortOptions)==null?void 0:b.icons)==null?void 0:j.desc)??e.jsx(W,{className:((f=(C=p.sortOptions)==null?void 0:C.icons)==null?void 0:f.className)??"table-headers-sort-indicator"})})]})},p.id)}),a&&e.jsx("th",{scope:"col",className:"table-headers-action",children:n("_accessibility:labels.actions")})]})})}function re(){const{t}=$();return e.jsx("div",{className:"table-empty",children:e.jsx("p",{children:t("_accessibility:components.table.empty")})})}const le=()=>{const{t}=$(),{total:n,pageSize:r,currentPage:s,setCurrentPage:a}=P();return e.jsxs("div",{className:"table-navigation-pages",children:[e.jsx("button",{className:"table-navigation-buttons",disabled:s===0,"aria-label":t("_accessibility:buttons.previous"),name:t("_accessibility:buttons.previous"),onClick:()=>a(s-1),children:e.jsx(J,{className:"w-2.5"})}),e.jsx("button",{disabled:Math.floor(n/((s+1)*r))===0,className:"table-navigation-buttons",name:t("_accessibility:buttons.next"),"aria-label":t("_accessibility:buttons.next"),onClick:()=>a(s+1),children:e.jsx(V,{className:"w-2.5"})})]})},oe=()=>{const{t}=$(),{total:n,pageSize:r,pageSizes:s,currentPage:a}=P(),l=(a+1)*r>n?n:(a+1)*r;return e.jsxs("div",{className:"table-navigation-sizes",children:[s[0]<n&&e.jsx(e.Fragment,{children:e.jsxs("p",{children:[a*r+1," - ",l," ",t("_accessibility:components.table.of")]})}),e.jsx("p",{children:n})]})};function ce(){const{t}=$(),{pageSizes:n,pageSize:r,setPageSize:s}=P(),a=o.useMemo(()=>n==null?void 0:n.map(l=>({id:l,value:l})),[n]);return e.jsxs("div",{className:"page-size",children:[e.jsx("p",{children:t("_accessibility:components.table.pageSizes")}),e.jsx(R,{value:r,options:a,inputClassName:"page-size-input",containerClassName:"page-size-input-container",helperTextClassName:"hidden",onChange:l=>s(Number(l.target.value))})]})}function Ce(){const{t}=$(),{total:n,pageSize:r,currentPage:s,setCurrentPage:a}=P(),l=o.useMemo(()=>{const c=Math.ceil(n/r);return Array.from({length:c},(i,u)=>({id:u,value:u+1}))},[n,r]);return e.jsxs("div",{className:"jump-to-page",children:[e.jsx("p",{children:t("_accessibility:components.table.jumpToPage")}),e.jsx(R,{value:s,options:l,inputClassName:"jump-to-page-input",containerClassName:"jump-to-page-input-container",helperTextClassName:"hidden",onChange:c=>a(Number(c.target.value))})]})}function ie(){return e.jsxs("div",{className:"table-footer",children:[e.jsx(Ce,{}),e.jsx(ce,{}),e.jsx(oe,{}),e.jsx(le,{})]})}function je(t){const{propertyName:n,options:r,label:s}=t,{currentFilters:a,setCurrentFilters:l}=T(),c=o.useMemo(()=>{var u;return((u=a[n])==null?void 0:u.value)??r[0]},[a]),i=o.useCallback(u=>{l({type:y.update,toUpdate:{[n]:{value:u.target.value}}})},[]);return e.jsx(R,{value:c,label:s,options:r,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:i})}const fe=t=>{const{propertyName:n,label:r}=t,{currentFilters:s,setCurrentFilters:a}=T(),l=o.useMemo(()=>{var i;return((i=s[n])==null?void 0:i.value)??""},[s]),c=o.useCallback(i=>{a({type:y.update,toUpdate:{[n]:{value:i.target.value}}})},[]);return e.jsx(z,{value:l??"",label:r,onChange:c,containerClassName:"input-widget-container",helperTextClassName:""})},Ne=t=>{const{propertyName:n,label:r}=t,{currentFilters:s,setCurrentFilters:a}=T(),l=o.useMemo(()=>{var i;return((i=s[n])==null?void 0:i.value)??""},[s]),c=o.useCallback(i=>{a({type:y.update,toUpdate:{[n]:{value:i.target.checked}}})},[]);return e.jsx(K,{label:r,checked:l??!1,onChange:c})};function ye(t){const{propertyName:n,label:r,options:s,multiple:a=!0}=t,{currentFilters:l,setCurrentFilters:c}=T(),i=o.useMemo(()=>l[n]??s[0],[l]),u=o.useCallback(v=>{c({type:y.update,toUpdate:{[n]:{value:v}}})},[a]);return e.jsx(Q,{value:i==null?void 0:i.value,label:r,options:s,multiple:a,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:u})}const H=t=>{const{propertyName:n,label:r,inputType:s}=t,{currentFilters:a,setCurrentFilters:l}=T(),c=o.useRef(null),i=o.useRef(null),u=o.useMemo(()=>{var d,h,b;const x=(h=(d=a[n])==null?void 0:d.value)==null?void 0:h.start;return x?s==="date"?new Date(String(x)).toISOString().slice(0,10):(b=a[n])==null?void 0:b.value:""},[a]),v=o.useMemo(()=>{var d,h,b;const x=(h=(d=a[n])==null?void 0:d.value)==null?void 0:h.end;return x?s==="date"?new Date(String(x)).toISOString().slice(0,10):(b=a[n])==null?void 0:b.value:""},[a]),p=o.useCallback(x=>{var d;l({type:y.update,toUpdate:{[n]:{value:{end:((d=i==null?void 0:i.current)==null?void 0:d.value)??null,start:x.target.value}}}})},[]),m=o.useCallback(x=>{var d;l({type:y.update,toUpdate:{[n]:{value:{start:((d=c==null?void 0:c.current)==null?void 0:d.value)??null,end:x.target.value}}}})},[]);return e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(z,{value:u??"",label:r,type:s,ref:c,onChange:p,containerClassName:"input-widget-container",helperTextClassName:""}),e.jsx(z,{value:v??"",label:r,type:s,ref:i,onChange:m,containerClassName:"input-widget-container",helperTextClassName:""})]})},ue=t=>{switch(t.type){case k.text:return e.jsx(fe,{...t});case k.number:return e.jsx(H,{...t});case k.date:return e.jsx(H,{...t});case k.select:return e.jsx(je,{...t});case k.autocomplete:return e.jsx(ye,{...t});case k.check:return e.jsx(Ne,{...t})}return e.jsx(e.Fragment,{})};const de=t=>{const{align:n="right",filters:r=[],icon:s}=t,[a,l]=o.useState(!1),{onFilterApply:c,filters:i}=P(),{currentFilters:u,setCurrentFilters:v}=T(),{t:p}=$(),m=o.useRef(null),x=o.useRef(null);return o.useEffect(()=>{const d=({target:h})=>{var b,j;x.current&&(!a||(b=x.current)!=null&&b.contains(h)||(j=m==null?void 0:m.current)!=null&&j.contains(h)||l(!1))};return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}),o.useEffect(()=>{const d=h=>{!a||h.code!=="Escape"||l(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)}),e.jsxs("div",{className:"filter-dropdown-main",children:[e.jsxs("button",{ref:m,className:"filter-dropdown-button normal filter-dropdown-trigger","aria-haspopup":"true",onClick:()=>l(!a),"aria-expanded":a,children:[e.jsx("span",{className:"sr-only",children:p("_accessibility:buttons.filters")}),e.jsx("wbr",{}),s??e.jsx(G,{className:"filter-dropdown-trigger-icon"})]}),e.jsx("div",{className:`filter-dropdown-transition ${a?"opened":"closed"} ${n==="right"?"right":"left"}`,children:e.jsxs("div",{ref:x,children:[e.jsx("div",{className:"filter-title",children:p("_accessibility:buttons.filters")}),e.jsx("ul",{className:"filter-container",children:r.map(d=>e.jsx("li",{className:"filter-container-item",children:ue(d)},d.propertyName))}),e.jsx("div",{className:"filter-footer",children:e.jsxs("ul",{className:"filter-buttons-row",children:[e.jsx("li",{children:e.jsx("button",{onClick:()=>v({type:y.reset,filters:r}),className:"filter-dropdown-button small filter-dropdown-cancel",children:p("_accessibility:buttons.clear")})}),e.jsx("li",{children:e.jsx("button",{className:"filter-dropdown-button small filter-dropdown-submit bg-primary hover:bg-light-primary",onClick:()=>{l(!1),c(u)},onBlur:()=>l(!1),children:p("_accessibility:buttons.applyFilters")})})]})})]})})]})},we=t=>t,pe=t=>{const{columns:n,softDeleteProperty:r="deleted",data:s,actions:a}=t,l=o.useMemo(()=>n.sort((c,i)=>(i.pos??0)-(c.pos??0)).filter(c=>c.display!=="none"),[n]);return s==null?void 0:s.map(c=>{var i;return e.jsxs("tr",{className:`table-row ${c[r]?"deleted-class":""}`,children:[l==null?void 0:l.map((u,v)=>e.jsx("td",{className:`table-row-cell ${v===0?"basic":""} ${u.className??""}`,children:u.renderBody?u.renderBody(c[u.key],c):we(c[u.key])},u.key)),a?e.jsx("td",{children:e.jsx("div",{className:"table-row-cell-action",children:(i=a(c).filter(u=>!u.hidden))==null?void 0:i.map(u=>e.jsx(he,{content:u.tooltip,children:e.jsx("button",{onClick:()=>u.onClick(c),children:u.icon})},u.id))})}):null]},c.id)})};function Se(t){const{title:n="",data:r,onSort:s,entity:a="",isLoading:l=!1,actions:c,columns:i=[],contentClassName:u="",className:v="",toolbar:p=e.jsx(e.Fragment,{}),softDeleteProperty:m="deleted"}=t,x=o.useMemo(()=>i?i.sort((h,b)=>(b.pos??0)-(h.pos??0)).filter(h=>!!h.filterOptions).map(h=>{var b;return{...h.filterOptions,label:((b=h.filterOptions)==null?void 0:b.label)??h.label,propertyName:h.key}}):[],[i]),d=o.useMemo(()=>!(r!=null&&r.length),[r]);return e.jsx(ne,{children:e.jsxs("div",{className:`${v} table-main`,children:[e.jsxs("div",{className:"table-header",children:[e.jsx("h1",{className:"table-header-title",children:n}),l?null:e.jsxs("div",{className:"table-header-right",children:[p,!!x&&!!x.length&&e.jsx(de,{filters:x})]})]}),l?e.jsx(X,{className:"table-loading"}):e.jsx(e.Fragment,{children:d?e.jsx(re,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${u} table-body`,children:e.jsxs("table",{className:"table-content",children:[e.jsx(ae,{entity:a,columns:i,onSortCallback:s,hasAction:!!c}),e.jsx("tbody",{children:e.jsx(pe,{data:r,actions:c,columns:i,softDeleteProperty:m})})]})}),e.jsx(ie,{})]})})]})})}function he(t){const{content:n,children:r}=t;return e.jsxs("div",{className:"tooltip-container",children:[r,e.jsx("div",{className:"tooltip-text",children:n})]})}var S=(t=>(t.empty="empty",t.outlined="outlined",t.default="default",t))(S||{});function me(t){const{label:n,onDelete:r,className:s="",spanClassName:a="",variant:l=S.default}=t,c=o.useMemo(()=>{switch(l){case S.empty:return"text-primary bg-transparent";case S.outlined:return"border border-primary";case S.default:default:return"text-white bg-primary"}},[l]),i=o.useMemo(()=>{switch(l){case S.empty:case S.outlined:return"chip-delete-button-svg";case S.default:default:return"filled-chip-delete-button-svg"}},[l]);return e.jsxs("div",{className:`chip-main ${c} ${s}`,children:[e.jsx("span",{className:a,children:n}),r?e.jsx("button",{type:"button",className:"chip-delete-button",onClick:r,children:e.jsx(_,{className:i})}):null]})}exports.AutocompleteInput=Q;exports.CheckInput=K;exports.ChevronDown=W;exports.ChevronLeft=J;exports.ChevronRight=V;exports.ChevronUp=q;exports.Chip=me;exports.ChipVariant=S;exports.Close=_;exports.Columns=ae;exports.CountOfTotal=oe;exports.Empty=re;exports.FilterPopup=de;exports.FilterTypes=k;exports.Filters=G;exports.FiltersActions=y;exports.FiltersProvider=ne;exports.Footer=ie;exports.Loading=X;exports.Navigation=le;exports.PageSize=ce;exports.Rows=pe;exports.SelectInput=R;exports.SortOrder=O;exports.State=L;exports.Table=Se;exports.TableOptionsProvider=ve;exports.TextInput=z;exports.Tooltip=he;exports.TranslationProvider=be;exports.filtersReducer=te;exports.helperTextStateClassName=I;exports.initializer=ee;exports.inputStateClassName=D;exports.labelStateClassName=B;exports.renderFilterComponent=ue;exports.useFilters=T;exports.useTableOptions=P;exports.useTranslation=$;
1
+ var ke=require("./main.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react");function W(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})}function q(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"})})}function V(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})})}function J(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})})}const G=t=>{const{className:n=""}=t;return e.jsx("svg",{className:n,viewBox:"0 0 16 16",children:e.jsx("path",{d:"M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z"})})};function _(t){const{className:n=""}=t;return e.jsx("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",children:e.jsx("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})}var L=(t=>(t.error="error",t.good="good",t.default="default",t))(L||{});const D=t=>{switch(t){case"error":return"input-error";case"good":return"input-good";default:return"input-normal"}},B=t=>{switch(t){case"error":return"input-label-error";case"good":return"input-label-good";default:return"input-label-normal"}},I=t=>{switch(t){case"error":return"input-helper-text-error";case"good":return"input-helper-text-good";default:return"input-helper-text-normal"}};const R=o.forwardRef(function(t,n){const{value:r,onChange:s,options:a,containerClassName:l="",inputClassName:c="",labelClassName:i="",helperText:u="",helperTextClassName:v="",placeholder:p="",label:m="",name:x="",id:d="",state:h=L.default,children:g,...j}=t;return e.jsxs("div",{className:`select-input-container ${l}`,children:[e.jsx("select",{...j,id:d,ref:n,name:x,value:r,onChange:s,className:`select-input ${D(h)} peer ${c}`,children:a==null?void 0:a.map(C=>e.jsx("option",{value:C.id,children:C.value??C.name??C.id},C.id))}),e.jsx("label",{htmlFor:x,className:`select-input-label ${B(h)} ${i}`,children:m}),g,e.jsx("p",{className:`select-input-helper-text ${I(h)} ${v}`,children:h!=="error"&&h!=="good"?p:u})]})});const z=o.forwardRef(function(t,n){const{children:r,value:s,onChange:a,state:l=L.default,name:c="",id:i="",type:u="text",label:v="",required:p=!1,placeholder:m="",containerClassName:x="",inputClassName:d="",labelClassName:h="",helperText:g="",helperTextClassName:j="",...C}=t;return e.jsxs("div",{className:`text-input-container ${x}`,children:[e.jsx("input",{ref:n,type:u,name:c,id:i,className:`text-input ${D(l)} peer ${d}`,placeholder:"",required:p,value:s,onChange:a,...C}),e.jsxs("label",{htmlFor:c,className:`text-input-label ${B(l)} ${h}`,children:[v,p?" *":""]}),r,e.jsx("p",{className:`text-input-helper-text ${I(l)} ${j}`,children:l!=="error"&&l!=="good"?m:g})]})});const K=o.forwardRef(function(t,n){const{checked:r,onChange:s,state:a=L.default,name:l="",id:c="",type:i="text",label:u="",containerClassName:v="",inputClassName:p="",labelClassName:m="",helperText:x="",helperTextClassName:d="",...h}=t;return e.jsxs("label",{className:`input-check-container ${v}`,children:[e.jsx("input",{id:c,ref:n,name:l,type:"checkbox",checked:r,onChange:s,className:`input-check ${p}`,...h}),e.jsx("span",{className:`input-check-label ${m}`,children:u})]})});const Q=o.forwardRef(function(t,n){const{state:r,value:s,onChange:a,options:l=[],name:c="",id:i="",label:u="",containerClassName:v="",inputContainerClassName:p="",helperText:m="",placeholder:x="",multiple:d=!1,...h}=t,[g,j]=o.useState(""),[C,f]=o.useState(!1),w=l.filter(b=>{const N=String(b.value).toLowerCase().includes(g==null?void 0:g.toLowerCase());return s&&s.length?s!=null&&s.some?!(s!=null&&s.some(A=>A.id===b.id)):(s==null?void 0:s.id)!==b.id:N}),E=o.useRef(null);o.useEffect(()=>{const b=F=>{E.current&&!E.current.contains(F.target)&&f(!1)},N=F=>{F.key==="Escape"&&f(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[]);const M=b=>{j(b.target.value)},U=o.useCallback(b=>{j(""),b?d?Array.isArray(s)&&s.length?a([...s,b]):a([b]):a(b):a(null),f(!1)},[d,a,s]),xe=o.useCallback(b=>{const N=s.filter((F,A)=>A!==b);N.length?a(N):a(null)},[a,s]);return e.jsxs("div",{className:`autocomplete-input-container ${v}`,ref:E,children:[e.jsx(z,{state:r,name:c,id:i,value:!d&&s?s:g,onChange:M,placeholder:x,helperText:m,onFocus:()=>f(!0),label:u,containerClassName:`autocomplete-text-input ${p}`,ref:n,...h,children:!d&&s&&e.jsx("button",{type:"button",className:"autocomplete-delete-button",onClick:b=>{U(),b.stopPropagation()},children:e.jsx(_,{})})}),C&&e.jsx("ul",{className:"autocomplete-suggestions-container",children:w.map(b=>e.jsx("li",{className:"autocomplete-suggestion-item hover:bg-primary/20",onClick:N=>{U(b),N.stopPropagation()},children:b.value??b.name},b.id??b.value??b.name))}),d&&Array.isArray(s)&&s.length?e.jsx("ul",{className:"autocomplete-value-container",children:s.map((b,N)=>e.jsx("li",{children:e.jsx(me,{label:String(b.value??b.name),onDelete:F=>{xe(N),F.stopPropagation()}})},b.id??b.value??b.name))}):null]})});function X(t){const{color:n="stroke-blue-800",className:r="",loaderClass:s="",strokeWidth:a="4",...l}=t;return e.jsx("div",{...l,className:`loading ${r}`,children:e.jsx("div",{className:"loader-container",children:e.jsx("div",{className:`loader ${s}`,children:e.jsx("svg",{className:"circular",viewBox:"25 25 50 50",children:e.jsx("circle",{className:`path ${n}`,cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:a,strokeMiterlimit:"10"})})})})})}const Y=o.createContext({});function be(t){const{children:n,t:r}=t;return e.jsx(Y.Provider,{value:{t:r},children:n})}const $=()=>{const t=o.useContext(Y);if(t===void 0)throw new Error("translationContext must be used within a Provider");return t};var k=(t=>(t[t.text=0]="text",t[t.number=1]="number",t[t.select=2]="select",t[t.autocomplete=3]="autocomplete",t[t.date=4]="date",t[t.check=5]="check",t))(k||{}),O=(t=>(t.ASC="ASC",t.DESC="DESC",t))(O||{});const ge=[20,50,100],Z=o.createContext({}),ve=t=>{const{children:n}=t,[r,s]=o.useState(0),[a,l]=o.useState(20),[c,i]=o.useState(0),[u,v]=o.useState("id"),[p,m]=o.useState(O.DESC),[x,d]=o.useState({}),h=o.useCallback((C,f)=>{let w=p;if(u===C)switch(p){case O.ASC:w=O.DESC;break;default:w=O.ASC;break}v(C),m(w),f&&f(C,w)},[u,p]),g=o.useCallback(C=>{const f=Object.entries(C).reduce((w,[E,M])=>(M&&typeof M.value<"u"&&(w[E]=M.value),w),{});d(f)},[]),j={onSort:h,total:r,setTotal:s,sortingBy:u,setSortingBy:v,sortingOrder:p,setSortingOrder:m,pageSize:a,pageSizes:ge,setPageSize:l,currentPage:c,setCurrentPage:i,filters:x,onFilterApply:g};return e.jsx(Z.Provider,{value:j,children:n})},P=()=>{const t=o.useContext(Z);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t};var y=(t=>(t[t.update=0]="update",t[t.reset=1]="reset",t))(y||{});const ee=t=>{if(t){const n={},r=Object.keys(t);return r==null||r.forEach(s=>{n[s]={value:t[s]}}),n}return{}};function te(t,n){const{type:r}=n;switch(r){case y.reset:{const{filters:s}=n,a={};return s==null||s.forEach(({propertyName:l,defaultValue:c})=>{a[l]={value:c}}),{...t,...a}}case y.update:{const{toUpdate:s}=n;return{...t,...s}}default:return t}}const se=o.createContext({}),ne=t=>{const{children:n}=t,{filters:r}=P(),[s,a]=o.useReducer(te,ee(r)),l={currentFilters:s,setCurrentFilters:a};return e.jsx(se.Provider,{value:l,children:n})},T=()=>{const t=o.useContext(se);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t};function ae(t){const{t:n}=$(),{entity:r="",columns:s=[],hasAction:a=!0,onSortCallback:l}=t,{onSort:c,sortingOrder:i,sortingBy:u}=P(),v=o.useMemo(()=>{var p;return(p=s.sort((m,x)=>(x.pos??0)-(m.pos??0)).filter(m=>m.display!=="none"))==null?void 0:p.map(m=>({id:m.key,label:m.label,className:m.className??"",sortable:m.sortable??!0,sortOptions:m.sortOptions}))},[s,r,n]);return e.jsx("thead",{className:"table-headers-row",children:e.jsxs("tr",{children:[v.map(p=>{var m,x,d,h,g,j,C,f;return e.jsx("th",{scope:"col",className:`table-headers-column ${p.className}`,children:e.jsxs("button",{disabled:!p.sortable,onClick:()=>c(p.id,l),className:"table-headers-cell",children:[e.jsx("span",{className:"table-headers-label",children:p.label}),p.sortable&&e.jsx("span",{className:`${u===p.id?"table-headers-sort-on":"table-headers-sort"}`,children:i===O.ASC?((x=(m=p.sortOptions)==null?void 0:m.icons)==null?void 0:x.asc)??e.jsx(q,{className:((h=(d=p.sortOptions)==null?void 0:d.icons)==null?void 0:h.className)??"table-headers-sort-indicator"}):((j=(g=p.sortOptions)==null?void 0:g.icons)==null?void 0:j.desc)??e.jsx(W,{className:((f=(C=p.sortOptions)==null?void 0:C.icons)==null?void 0:f.className)??"table-headers-sort-indicator"})})]})},p.id)}),a&&e.jsx("th",{scope:"col",className:"table-headers-action",children:n("_accessibility:labels.actions")})]})})}function re(){const{t}=$();return e.jsx("div",{className:"table-empty",children:e.jsx("p",{children:t("_accessibility:components.table.empty")})})}const le=()=>{const{t}=$(),{total:n,pageSize:r,currentPage:s,setCurrentPage:a}=P();return e.jsxs("div",{className:"table-navigation-pages",children:[e.jsx("button",{className:"table-navigation-buttons",disabled:s===0,"aria-label":t("_accessibility:buttons.previous"),name:t("_accessibility:buttons.previous"),onClick:()=>a(s-1),children:e.jsx(J,{className:"w-2.5"})}),e.jsx("button",{disabled:Math.floor(n/((s+1)*r))===0,className:"table-navigation-buttons",name:t("_accessibility:buttons.next"),"aria-label":t("_accessibility:buttons.next"),onClick:()=>a(s+1),children:e.jsx(V,{className:"w-2.5"})})]})},oe=()=>{const{t}=$(),{total:n,pageSize:r,pageSizes:s,currentPage:a}=P(),l=(a+1)*r>n?n:(a+1)*r;return e.jsxs("div",{className:"table-navigation-sizes",children:[s[0]<n&&e.jsx(e.Fragment,{children:e.jsxs("p",{children:[a*r+1," - ",l," ",t("_accessibility:components.table.of")]})}),e.jsx("p",{children:n})]})};function ce(){const{t}=$(),{pageSizes:n,pageSize:r,setPageSize:s}=P(),a=o.useMemo(()=>n==null?void 0:n.map(l=>({id:l,value:l})),[n]);return e.jsxs("div",{className:"page-size",children:[e.jsx("p",{children:t("_accessibility:components.table.pageSizes")}),e.jsx(R,{value:r,options:a,inputClassName:"page-size-input",containerClassName:"page-size-input-container",helperTextClassName:"hidden",onChange:l=>s(Number(l.target.value))})]})}function Ce(){const{t}=$(),{total:n,pageSize:r,currentPage:s,setCurrentPage:a}=P(),l=o.useMemo(()=>{const c=Math.ceil(n/r);return Array.from({length:c},(i,u)=>({id:u,value:u+1}))},[n,r]);return e.jsxs("div",{className:"jump-to-page",children:[e.jsx("p",{children:t("_accessibility:components.table.jumpToPage")}),e.jsx(R,{value:s,options:l,inputClassName:"jump-to-page-input",containerClassName:"jump-to-page-input-container",helperTextClassName:"hidden",onChange:c=>a(Number(c.target.value))})]})}function ie(){return e.jsxs("div",{className:"table-footer",children:[e.jsx(Ce,{}),e.jsx(ce,{}),e.jsx(oe,{}),e.jsx(le,{})]})}function je(t){const{propertyName:n,options:r,label:s}=t,{currentFilters:a,setCurrentFilters:l}=T(),c=o.useMemo(()=>{var u;return((u=a[n])==null?void 0:u.value)??r[0]},[a]),i=o.useCallback(u=>{l({type:y.update,toUpdate:{[n]:{value:u.target.value}}})},[]);return e.jsx(R,{value:c,label:s,options:r,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:i})}const fe=t=>{const{propertyName:n,label:r}=t,{currentFilters:s,setCurrentFilters:a}=T(),l=o.useMemo(()=>{var i;return((i=s[n])==null?void 0:i.value)??""},[s]),c=o.useCallback(i=>{a({type:y.update,toUpdate:{[n]:{value:i.target.value}}})},[]);return e.jsx(z,{value:l??"",label:r,onChange:c,containerClassName:"input-widget-container",helperTextClassName:""})},Ne=t=>{const{propertyName:n,label:r}=t,{currentFilters:s,setCurrentFilters:a}=T(),l=o.useMemo(()=>{var i;return((i=s[n])==null?void 0:i.value)??""},[s]),c=o.useCallback(i=>{a({type:y.update,toUpdate:{[n]:{value:i.target.checked}}})},[]);return e.jsx(K,{label:r,checked:l??!1,onChange:c})};function ye(t){const{propertyName:n,label:r,options:s,multiple:a=!0}=t,{currentFilters:l,setCurrentFilters:c}=T(),i=o.useMemo(()=>l[n]??s[0],[l]),u=o.useCallback(v=>{c({type:y.update,toUpdate:{[n]:{value:v}}})},[a]);return e.jsx(Q,{value:i==null?void 0:i.value,label:r,options:s,multiple:a,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:u})}const H=t=>{const{propertyName:n,label:r,inputType:s}=t,{currentFilters:a,setCurrentFilters:l}=T(),c=o.useRef(null),i=o.useRef(null),u=o.useMemo(()=>{var d,h,g;const x=(h=(d=a[n])==null?void 0:d.value)==null?void 0:h.start;return x?s==="date"?new Date(String(x)).toISOString().slice(0,10):(g=a[n])==null?void 0:g.value:""},[a]),v=o.useMemo(()=>{var d,h,g;const x=(h=(d=a[n])==null?void 0:d.value)==null?void 0:h.end;return x?s==="date"?new Date(String(x)).toISOString().slice(0,10):(g=a[n])==null?void 0:g.value:""},[a]),p=o.useCallback(x=>{var d;l({type:y.update,toUpdate:{[n]:{value:{end:((d=i==null?void 0:i.current)==null?void 0:d.value)??null,start:x.target.value}}}})},[]),m=o.useCallback(x=>{var d;l({type:y.update,toUpdate:{[n]:{value:{start:((d=c==null?void 0:c.current)==null?void 0:d.value)??null,end:x.target.value}}}})},[]);return e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(z,{value:u??"",label:r,type:s,ref:c,onChange:p,containerClassName:"input-widget-container",helperTextClassName:""}),e.jsx(z,{value:v??"",label:r,type:s,ref:i,onChange:m,containerClassName:"input-widget-container",helperTextClassName:""})]})},ue=t=>{switch(t.type){case k.text:return e.jsx(fe,{...t});case k.number:return e.jsx(H,{...t});case k.date:return e.jsx(H,{...t});case k.select:return e.jsx(je,{...t});case k.autocomplete:return e.jsx(ye,{...t});case k.check:return e.jsx(Ne,{...t})}return e.jsx(e.Fragment,{})};const de=t=>{const{align:n="right",filters:r=[],icon:s}=t,[a,l]=o.useState(!1),{onFilterApply:c,filters:i}=P(),{currentFilters:u,setCurrentFilters:v}=T(),{t:p}=$(),m=o.useRef(null),x=o.useRef(null);return o.useEffect(()=>{const d=({target:h})=>{var g,j;x.current&&(!a||(g=x.current)!=null&&g.contains(h)||(j=m==null?void 0:m.current)!=null&&j.contains(h)||l(!1))};return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}),o.useEffect(()=>{const d=h=>{!a||h.code!=="Escape"||l(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)}),e.jsxs("div",{className:"filter-dropdown-main",children:[e.jsxs("button",{ref:m,className:"filter-dropdown-button normal filter-dropdown-trigger","aria-haspopup":"true",onClick:()=>l(!a),"aria-expanded":a,children:[e.jsx("span",{className:"sr-only",children:p("_accessibility:buttons.filters")}),e.jsx("wbr",{}),s??e.jsx(G,{className:"filter-dropdown-trigger-icon"})]}),e.jsx("div",{className:`filter-dropdown-transition ${a?"opened":"closed"} ${n==="right"?"right":"left"}`,children:e.jsxs("div",{ref:x,children:[e.jsx("div",{className:"filter-title",children:p("_accessibility:buttons.filters")}),e.jsx("ul",{className:"filter-container",children:r.map(d=>e.jsx("li",{className:"filter-container-item",children:ue(d)},d.propertyName))}),e.jsx("div",{className:"filter-footer",children:e.jsxs("ul",{className:"filter-buttons-row",children:[e.jsx("li",{children:e.jsx("button",{onClick:()=>v({type:y.reset,filters:r}),className:"filter-dropdown-button small filter-dropdown-cancel",children:p("_accessibility:buttons.clear")})}),e.jsx("li",{children:e.jsx("button",{className:"filter-dropdown-button small filter-dropdown-submit bg-primary hover:bg-light-primary",onClick:()=>{l(!1),c(u)},onBlur:()=>l(!1),children:p("_accessibility:buttons.applyFilters")})})]})})]})})]})},we=t=>t,pe=t=>{const{columns:n,softDeleteProperty:r="deleted",data:s,actions:a}=t,l=o.useMemo(()=>n.sort((c,i)=>(i.pos??0)-(c.pos??0)).filter(c=>c.display!=="none"),[n]);return s==null?void 0:s.map(c=>{var i;return e.jsxs("tr",{className:`table-row ${c[r]?"deleted-class":""}`,children:[l==null?void 0:l.map((u,v)=>e.jsx("td",{className:`table-row-cell ${v===0?"basic":""} ${u.className??""}`,children:u.renderBody?u.renderBody(c[u.key],c):we(c[u.key])},u.key)),a?e.jsx("td",{children:e.jsx("div",{className:"table-row-cell-action",children:(i=a(c).filter(u=>!u.hidden))==null?void 0:i.map(u=>e.jsx(he,{content:u.tooltip,children:e.jsx("button",{onClick:()=>u.onClick(c),children:u.icon})},u.id))})}):null]},c.id)})};function Se(t){const{title:n="",data:r,onSort:s,entity:a="",isLoading:l=!1,actions:c,columns:i=[],contentClassName:u="",className:v="",toolbar:p=e.jsx(e.Fragment,{}),softDeleteProperty:m="deleted"}=t,x=o.useMemo(()=>i?i.sort((h,g)=>(g.pos??0)-(h.pos??0)).filter(h=>!!h.filterOptions).map(h=>{var g;return{...h.filterOptions,label:((g=h.filterOptions)==null?void 0:g.label)??h.label,propertyName:h.key}}):[],[i]),d=o.useMemo(()=>!(r!=null&&r.length),[r]);return e.jsx(ne,{children:e.jsxs("div",{className:`${v} table-main`,children:[e.jsxs("div",{className:"table-header",children:[e.jsx("h1",{className:"table-header-title",children:n}),l?null:e.jsxs("div",{className:"table-header-right",children:[p,!!x&&!!x.length&&e.jsx(de,{filters:x})]})]}),l?e.jsx(X,{className:"table-loading"}):e.jsx(e.Fragment,{children:d?e.jsx(re,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${u} table-body`,children:e.jsxs("table",{className:"table-content",children:[e.jsx(ae,{entity:a,columns:i,onSortCallback:s,hasAction:!!c}),e.jsx("tbody",{children:e.jsx(pe,{data:r,actions:c,columns:i,softDeleteProperty:m})})]})}),e.jsx(ie,{})]})})]})})}function he(t){const{content:n,children:r}=t;return e.jsxs("div",{className:"tooltip-container",children:[r,e.jsx("div",{className:"tooltip-text",children:n})]})}var S=(t=>(t.empty="empty",t.outlined="outlined",t.default="default",t))(S||{});function me(t){const{label:n,onDelete:r,className:s="",spanClassName:a="",variant:l=S.default}=t,c=o.useMemo(()=>{switch(l){case S.empty:return"text-primary bg-transparent";case S.outlined:return"border border-primary";case S.default:default:return"text-white bg-primary"}},[l]),i=o.useMemo(()=>{switch(l){case S.empty:case S.outlined:return"chip-delete-button-svg";case S.default:default:return"filled-chip-delete-button-svg"}},[l]);return e.jsxs("div",{className:`chip-main ${c} ${s}`,children:[e.jsx("span",{className:a,children:n}),r?e.jsx("button",{type:"button",className:"chip-delete-button",onClick:r,children:e.jsx(_,{className:i})}):null]})}exports.AutocompleteInput=Q;exports.CheckInput=K;exports.ChevronDown=W;exports.ChevronLeft=J;exports.ChevronRight=V;exports.ChevronUp=q;exports.Chip=me;exports.ChipVariant=S;exports.Close=_;exports.Columns=ae;exports.CountOfTotal=oe;exports.Empty=re;exports.FilterPopup=de;exports.FilterTypes=k;exports.Filters=G;exports.FiltersActions=y;exports.FiltersProvider=ne;exports.Footer=ie;exports.Loading=X;exports.Navigation=le;exports.PageSize=ce;exports.Rows=pe;exports.SelectInput=R;exports.SortOrder=O;exports.State=L;exports.Table=Se;exports.TableOptionsProvider=ve;exports.TextInput=z;exports.Tooltip=he;exports.TranslationProvider=be;exports.filtersReducer=te;exports.helperTextStateClassName=I;exports.initializer=ee;exports.inputStateClassName=D;exports.labelStateClassName=B;exports.renderFilterComponent=ue;exports.useFilters=T;exports.useTableOptions=P;exports.useTranslation=$;
package/dist/dashboard.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import "./main.css";
2
- import { jsx as t, jsxs as g, Fragment as D } from "react/jsx-runtime";
3
- import { forwardRef as I, useState as P, useRef as M, useEffect as H, useCallback as S, createContext as W, useContext as V, useReducer as se, useMemo as y } from "react";
4
- function ae(e) {
5
- const { className: s = "" } = e;
2
+ import { jsx as t, jsxs as v, Fragment as D } from "react/jsx-runtime";
3
+ import { forwardRef as I, useState as P, useRef as M, useEffect as H, useCallback as S, createContext as W, useContext as V, useReducer as ae, useMemo as y } from "react";
4
+ function se(e) {
5
+ const { className: a = "" } = e;
6
6
  return /* @__PURE__ */ t(
7
7
  "svg",
8
8
  {
9
- className: s,
9
+ className: a,
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  viewBox: "0 0 512 512",
12
12
  fill: "currentColor",
@@ -15,11 +15,11 @@ function ae(e) {
15
15
  );
16
16
  }
17
17
  function re(e) {
18
- const { className: s = "" } = e;
18
+ const { className: a = "" } = e;
19
19
  return /* @__PURE__ */ t(
20
20
  "svg",
21
21
  {
22
- className: s,
22
+ className: a,
23
23
  xmlns: "http://www.w3.org/2000/svg",
24
24
  viewBox: "0 0 512 512",
25
25
  fill: "currentColor",
@@ -28,11 +28,11 @@ function re(e) {
28
28
  );
29
29
  }
30
30
  function le(e) {
31
- const { className: s = "" } = e;
31
+ const { className: a = "" } = e;
32
32
  return /* @__PURE__ */ t(
33
33
  "svg",
34
34
  {
35
- className: s,
35
+ className: a,
36
36
  xmlns: "http://www.w3.org/2000/svg",
37
37
  viewBox: "0 0 320 512",
38
38
  fill: "currentColor",
@@ -41,11 +41,11 @@ function le(e) {
41
41
  );
42
42
  }
43
43
  function oe(e) {
44
- const { className: s = "" } = e;
44
+ const { className: a = "" } = e;
45
45
  return /* @__PURE__ */ t(
46
46
  "svg",
47
47
  {
48
- className: s,
48
+ className: a,
49
49
  xmlns: "http://www.w3.org/2000/svg",
50
50
  viewBox: "0 0 320 512",
51
51
  fill: "currentColor",
@@ -54,15 +54,15 @@ function oe(e) {
54
54
  );
55
55
  }
56
56
  const ce = (e) => {
57
- const { className: s = "" } = e;
58
- return /* @__PURE__ */ t("svg", { className: s, viewBox: "0 0 16 16", children: /* @__PURE__ */ t("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
57
+ const { className: a = "" } = e;
58
+ return /* @__PURE__ */ t("svg", { className: a, viewBox: "0 0 16 16", children: /* @__PURE__ */ t("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
59
59
  };
60
60
  function K(e) {
61
- const { className: s = "" } = e;
61
+ const { className: a = "" } = e;
62
62
  return /* @__PURE__ */ t(
63
63
  "svg",
64
64
  {
65
- className: s,
65
+ className: a,
66
66
  xmlns: "http://www.w3.org/2000/svg",
67
67
  viewBox: "0 0 384 512",
68
68
  fill: "currentColor",
@@ -99,11 +99,11 @@ const Q = (e) => {
99
99
  return "input-helper-text-normal";
100
100
  }
101
101
  };
102
- const q = I(function(e, s) {
102
+ const q = I(function(e, a) {
103
103
  const {
104
104
  value: r,
105
105
  onChange: n,
106
- options: a,
106
+ options: s,
107
107
  containerClassName: l = "",
108
108
  inputClassName: o = "",
109
109
  labelClassName: c = "",
@@ -114,21 +114,21 @@ const q = I(function(e, s) {
114
114
  name: m = "",
115
115
  id: d = "",
116
116
  state: p = U.default,
117
- children: b,
117
+ children: g,
118
118
  ...C
119
119
  } = e;
120
- return /* @__PURE__ */ g("div", { className: `select-input-container ${l}`, children: [
120
+ return /* @__PURE__ */ v("div", { className: `select-input-container ${l}`, children: [
121
121
  /* @__PURE__ */ t(
122
122
  "select",
123
123
  {
124
124
  ...C,
125
125
  id: d,
126
- ref: s,
126
+ ref: a,
127
127
  name: m,
128
128
  value: r,
129
129
  onChange: n,
130
130
  className: `select-input ${Q(p)} peer ${o}`,
131
- children: a == null ? void 0 : a.map((f) => /* @__PURE__ */ t("option", { value: f.id, children: f.value ?? f.name ?? f.id }, f.id))
131
+ children: s == null ? void 0 : s.map((f) => /* @__PURE__ */ t("option", { value: f.id, children: f.value ?? f.name ?? f.id }, f.id))
132
132
  }
133
133
  ),
134
134
  /* @__PURE__ */ t(
@@ -139,7 +139,7 @@ const q = I(function(e, s) {
139
139
  children: h
140
140
  }
141
141
  ),
142
- b,
142
+ g,
143
143
  /* @__PURE__ */ t(
144
144
  "p",
145
145
  {
@@ -149,11 +149,11 @@ const q = I(function(e, s) {
149
149
  )
150
150
  ] });
151
151
  });
152
- const j = I(function(e, s) {
152
+ const j = I(function(e, a) {
153
153
  const {
154
154
  children: r,
155
155
  value: n,
156
- onChange: a,
156
+ onChange: s,
157
157
  state: l = U.default,
158
158
  name: o = "",
159
159
  id: c = "",
@@ -164,15 +164,15 @@ const j = I(function(e, s) {
164
164
  containerClassName: m = "",
165
165
  inputClassName: d = "",
166
166
  labelClassName: p = "",
167
- helperText: b = "",
167
+ helperText: g = "",
168
168
  helperTextClassName: C = "",
169
169
  ...f
170
170
  } = e;
171
- return /* @__PURE__ */ g("div", { className: `text-input-container ${m}`, children: [
171
+ return /* @__PURE__ */ v("div", { className: `text-input-container ${m}`, children: [
172
172
  /* @__PURE__ */ t(
173
173
  "input",
174
174
  {
175
- ref: s,
175
+ ref: a,
176
176
  type: i,
177
177
  name: o,
178
178
  id: c,
@@ -180,11 +180,11 @@ const j = I(function(e, s) {
180
180
  placeholder: "",
181
181
  required: u,
182
182
  value: n,
183
- onChange: a,
183
+ onChange: s,
184
184
  ...f
185
185
  }
186
186
  ),
187
- /* @__PURE__ */ g(
187
+ /* @__PURE__ */ v(
188
188
  "label",
189
189
  {
190
190
  htmlFor: o,
@@ -200,16 +200,16 @@ const j = I(function(e, s) {
200
200
  "p",
201
201
  {
202
202
  className: `text-input-helper-text ${Y(l)} ${C}`,
203
- children: l !== "error" && l !== "good" ? h : b
203
+ children: l !== "error" && l !== "good" ? h : g
204
204
  }
205
205
  )
206
206
  ] });
207
207
  });
208
- const ie = I(function(e, s) {
208
+ const ie = I(function(e, a) {
209
209
  const {
210
210
  checked: r,
211
211
  onChange: n,
212
- state: a = U.default,
212
+ state: s = U.default,
213
213
  name: l = "",
214
214
  id: o = "",
215
215
  type: c = "text",
@@ -221,12 +221,12 @@ const ie = I(function(e, s) {
221
221
  helperTextClassName: d = "",
222
222
  ...p
223
223
  } = e;
224
- return /* @__PURE__ */ g("label", { className: `input-check-container ${N}`, children: [
224
+ return /* @__PURE__ */ v("label", { className: `input-check-container ${N}`, children: [
225
225
  /* @__PURE__ */ t(
226
226
  "input",
227
227
  {
228
228
  id: o,
229
- ref: s,
229
+ ref: a,
230
230
  name: l,
231
231
  type: "checkbox",
232
232
  checked: r,
@@ -238,11 +238,11 @@ const ie = I(function(e, s) {
238
238
  /* @__PURE__ */ t("span", { className: `input-check-label ${h}`, children: i })
239
239
  ] });
240
240
  });
241
- const de = I(function(e, s) {
241
+ const de = I(function(e, a) {
242
242
  const {
243
243
  state: r,
244
244
  value: n,
245
- onChange: a,
245
+ onChange: s,
246
246
  options: l = [],
247
247
  name: o = "",
248
248
  id: c = "",
@@ -253,35 +253,35 @@ const de = I(function(e, s) {
253
253
  placeholder: m = "",
254
254
  multiple: d = !1,
255
255
  ...p
256
- } = e, [b, C] = P(""), [f, w] = P(!1), $ = l.filter((v) => {
257
- const x = String(v.value).toLowerCase().includes(b == null ? void 0 : b.toLowerCase());
258
- return n && n.length ? n != null && n.some ? !(n != null && n.some((R) => R.id === v.id)) : (n == null ? void 0 : n.id) !== v.id : x;
256
+ } = e, [g, C] = P(""), [f, w] = P(!1), $ = l.filter((b) => {
257
+ const x = String(b.value).toLowerCase().includes(g == null ? void 0 : g.toLowerCase());
258
+ return n && n.length ? n != null && n.some ? !(n != null && n.some((R) => R.id === b.id)) : (n == null ? void 0 : n.id) !== b.id : x;
259
259
  }), A = M(null);
260
260
  H(() => {
261
- const v = (z) => {
261
+ const b = (z) => {
262
262
  A.current && !A.current.contains(z.target) && w(!1);
263
263
  }, x = (z) => {
264
264
  z.key === "Escape" && w(!1);
265
265
  };
266
- return document.addEventListener("mousedown", v), document.addEventListener("keydown", x), () => {
267
- document.removeEventListener("mousedown", v), document.removeEventListener("keydown", x);
266
+ return document.addEventListener("mousedown", b), document.addEventListener("keydown", x), () => {
267
+ document.removeEventListener("mousedown", b), document.removeEventListener("keydown", x);
268
268
  };
269
269
  }, []);
270
- const B = (v) => {
271
- C(v.target.value);
270
+ const B = (b) => {
271
+ C(b.target.value);
272
272
  }, J = S(
273
- (v) => {
274
- C(""), v ? d ? Array.isArray(n) && n.length ? a([...n, v]) : a([v]) : a(v) : a(null), w(!1);
273
+ (b) => {
274
+ C(""), b ? d ? Array.isArray(n) && n.length ? s([...n, b]) : s([b]) : s(b) : s(null), w(!1);
275
275
  },
276
- [d, a, n]
276
+ [d, s, n]
277
277
  ), ne = S(
278
- (v) => {
279
- const x = n.filter((z, R) => R !== v);
280
- x.length ? a(x) : a(null);
278
+ (b) => {
279
+ const x = n.filter((z, R) => R !== b);
280
+ x.length ? s(x) : s(null);
281
281
  },
282
- [a, n]
282
+ [s, n]
283
283
  );
284
- return /* @__PURE__ */ g(
284
+ return /* @__PURE__ */ v(
285
285
  "div",
286
286
  {
287
287
  className: `autocomplete-input-container ${N}`,
@@ -293,77 +293,77 @@ const de = I(function(e, s) {
293
293
  state: r,
294
294
  name: o,
295
295
  id: c,
296
- value: !d && n ? n : b,
296
+ value: !d && n ? n : g,
297
297
  onChange: B,
298
298
  placeholder: m,
299
299
  helperText: h,
300
300
  onFocus: () => w(!0),
301
301
  label: i,
302
302
  containerClassName: `autocomplete-text-input ${u}`,
303
- ref: s,
303
+ ref: a,
304
304
  ...p,
305
305
  children: !d && n && /* @__PURE__ */ t(
306
306
  "button",
307
307
  {
308
308
  type: "button",
309
309
  className: "autocomplete-delete-button",
310
- onClick: (v) => {
311
- J(), v.stopPropagation();
310
+ onClick: (b) => {
311
+ J(), b.stopPropagation();
312
312
  },
313
313
  children: /* @__PURE__ */ t(K, {})
314
314
  }
315
315
  )
316
316
  }
317
317
  ),
318
- f && /* @__PURE__ */ t("ul", { className: "autocomplete-suggestions-container", children: $.map((v) => /* @__PURE__ */ t(
318
+ f && /* @__PURE__ */ t("ul", { className: "autocomplete-suggestions-container", children: $.map((b) => /* @__PURE__ */ t(
319
319
  "li",
320
320
  {
321
321
  className: "autocomplete-suggestion-item hover:bg-primary/20",
322
322
  onClick: (x) => {
323
- J(v), x.stopPropagation();
323
+ J(b), x.stopPropagation();
324
324
  },
325
- children: v.value
325
+ children: b.value ?? b.name
326
326
  },
327
- v.id
327
+ b.id ?? b.value ?? b.name
328
328
  )) }),
329
- d && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((v, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
329
+ d && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((b, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
330
330
  Te,
331
331
  {
332
- label: String(v.value),
332
+ label: String(b.value ?? b.name),
333
333
  onDelete: (z) => {
334
334
  ne(x), z.stopPropagation();
335
335
  }
336
336
  }
337
- ) }, v.value)) }) : null
337
+ ) }, b.id ?? b.value ?? b.name)) }) : null
338
338
  ]
339
339
  }
340
340
  );
341
341
  });
342
342
  function ue(e) {
343
343
  const {
344
- color: s = "stroke-blue-800",
344
+ color: a = "stroke-blue-800",
345
345
  className: r = "",
346
346
  loaderClass: n = "",
347
- strokeWidth: a = "4",
347
+ strokeWidth: s = "4",
348
348
  ...l
349
349
  } = e;
350
350
  return /* @__PURE__ */ t("div", { ...l, className: `loading ${r}`, children: /* @__PURE__ */ t("div", { className: "loader-container", children: /* @__PURE__ */ t("div", { className: `loader ${n}`, children: /* @__PURE__ */ t("svg", { className: "circular", viewBox: "25 25 50 50", children: /* @__PURE__ */ t(
351
351
  "circle",
352
352
  {
353
- className: `path ${s}`,
353
+ className: `path ${a}`,
354
354
  cx: "50",
355
355
  cy: "50",
356
356
  r: "20",
357
357
  fill: "none",
358
- strokeWidth: a,
358
+ strokeWidth: s,
359
359
  strokeMiterlimit: "10"
360
360
  }
361
361
  ) }) }) }) });
362
362
  }
363
363
  const Z = W({});
364
364
  function Be(e) {
365
- const { children: s, t: r } = e;
366
- return /* @__PURE__ */ t(Z.Provider, { value: { t: r }, children: s });
365
+ const { children: a, t: r } = e;
366
+ return /* @__PURE__ */ t(Z.Provider, { value: { t: r }, children: a });
367
367
  }
368
368
  const L = () => {
369
369
  const e = V(Z);
@@ -373,7 +373,7 @@ const L = () => {
373
373
  };
374
374
  var E = /* @__PURE__ */ ((e) => (e[e.text = 0] = "text", e[e.number = 1] = "number", e[e.select = 2] = "select", e[e.autocomplete = 3] = "autocomplete", e[e.date = 4] = "date", e[e.check = 5] = "check", e))(E || {}), F = /* @__PURE__ */ ((e) => (e.ASC = "ASC", e.DESC = "DESC", e))(F || {});
375
375
  const pe = [20, 50, 100], ee = W({}), De = (e) => {
376
- const { children: s } = e, [r, n] = P(0), [a, l] = P(20), [o, c] = P(0), [i, N] = P("id"), [u, h] = P(F.DESC), [m, d] = P({}), p = S(
376
+ const { children: a } = e, [r, n] = P(0), [s, l] = P(20), [o, c] = P(0), [i, N] = P("id"), [u, h] = P(F.DESC), [m, d] = P({}), p = S(
377
377
  (f, w) => {
378
378
  let $ = u;
379
379
  if (i === f)
@@ -388,7 +388,7 @@ const pe = [20, 50, 100], ee = W({}), De = (e) => {
388
388
  N(f), h($), w && w(f, $);
389
389
  },
390
390
  [i, u]
391
- ), b = S((f) => {
391
+ ), g = S((f) => {
392
392
  const w = Object.entries(f).reduce(
393
393
  ($, [A, B]) => (B && typeof B.value < "u" && ($[A] = B.value), $),
394
394
  {}
@@ -402,15 +402,15 @@ const pe = [20, 50, 100], ee = W({}), De = (e) => {
402
402
  setSortingBy: N,
403
403
  sortingOrder: u,
404
404
  setSortingOrder: h,
405
- pageSize: a,
405
+ pageSize: s,
406
406
  pageSizes: pe,
407
407
  setPageSize: l,
408
408
  currentPage: o,
409
409
  setCurrentPage: c,
410
410
  filters: m,
411
- onFilterApply: b
411
+ onFilterApply: g
412
412
  };
413
- return /* @__PURE__ */ t(ee.Provider, { value: C, children: s });
413
+ return /* @__PURE__ */ t(ee.Provider, { value: C, children: a });
414
414
  }, T = () => {
415
415
  const e = V(ee);
416
416
  if (e === void 0)
@@ -420,24 +420,24 @@ const pe = [20, 50, 100], ee = W({}), De = (e) => {
420
420
  var k = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))(k || {});
421
421
  const he = (e) => {
422
422
  if (e) {
423
- const s = {}, r = Object.keys(e);
423
+ const a = {}, r = Object.keys(e);
424
424
  return r == null || r.forEach((n) => {
425
- s[n] = { value: e[n] };
426
- }), s;
425
+ a[n] = { value: e[n] };
426
+ }), a;
427
427
  }
428
428
  return {};
429
429
  };
430
- function me(e, s) {
431
- const { type: r } = s;
430
+ function me(e, a) {
431
+ const { type: r } = a;
432
432
  switch (r) {
433
433
  case k.reset: {
434
- const { filters: n } = s, a = {};
434
+ const { filters: n } = a, s = {};
435
435
  return n == null || n.forEach(({ propertyName: l, defaultValue: o }) => {
436
- a[l] = { value: o };
437
- }), { ...e, ...a };
436
+ s[l] = { value: o };
437
+ }), { ...e, ...s };
438
438
  }
439
439
  case k.update: {
440
- const { toUpdate: n } = s;
440
+ const { toUpdate: n } = a;
441
441
  return { ...e, ...n };
442
442
  }
443
443
  default:
@@ -445,14 +445,14 @@ function me(e, s) {
445
445
  }
446
446
  }
447
447
  const te = W({}), be = (e) => {
448
- const { children: s } = e, { filters: r } = T(), [n, a] = se(
448
+ const { children: a } = e, { filters: r } = T(), [n, s] = ae(
449
449
  me,
450
450
  he(r)
451
451
  ), l = {
452
452
  currentFilters: n,
453
- setCurrentFilters: a
453
+ setCurrentFilters: s
454
454
  };
455
- return /* @__PURE__ */ t(te.Provider, { value: l, children: s });
455
+ return /* @__PURE__ */ t(te.Provider, { value: l, children: a });
456
456
  }, _ = () => {
457
457
  const e = V(te);
458
458
  if (e === void 0)
@@ -460,7 +460,7 @@ const te = W({}), be = (e) => {
460
460
  return e;
461
461
  };
462
462
  function ge(e) {
463
- const { t: s } = L(), { entity: r = "", columns: n = [], hasAction: a = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } = T(), N = y(() => {
463
+ const { t: a } = L(), { entity: r = "", columns: n = [], hasAction: s = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } = T(), N = y(() => {
464
464
  var u;
465
465
  return (u = n.sort((h, m) => (m.pos ?? 0) - (h.pos ?? 0)).filter((h) => h.display !== "none")) == null ? void 0 : u.map((h) => ({
466
466
  id: h.key,
@@ -469,16 +469,16 @@ function ge(e) {
469
469
  sortable: h.sortable ?? !0,
470
470
  sortOptions: h.sortOptions
471
471
  }));
472
- }, [n, r, s]);
473
- return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ g("tr", { children: [
472
+ }, [n, r, a]);
473
+ return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ v("tr", { children: [
474
474
  N.map((u) => {
475
- var h, m, d, p, b, C, f, w;
475
+ var h, m, d, p, g, C, f, w;
476
476
  return /* @__PURE__ */ t(
477
477
  "th",
478
478
  {
479
479
  scope: "col",
480
480
  className: `table-headers-column ${u.className}`,
481
- children: /* @__PURE__ */ g(
481
+ children: /* @__PURE__ */ v(
482
482
  "button",
483
483
  {
484
484
  disabled: !u.sortable,
@@ -495,8 +495,8 @@ function ge(e) {
495
495
  {
496
496
  className: ((p = (d = u.sortOptions) == null ? void 0 : d.icons) == null ? void 0 : p.className) ?? "table-headers-sort-indicator"
497
497
  }
498
- ) : ((C = (b = u.sortOptions) == null ? void 0 : b.icons) == null ? void 0 : C.desc) ?? /* @__PURE__ */ t(
499
- ae,
498
+ ) : ((C = (g = u.sortOptions) == null ? void 0 : g.icons) == null ? void 0 : C.desc) ?? /* @__PURE__ */ t(
499
+ se,
500
500
  {
501
501
  className: ((w = (f = u.sortOptions) == null ? void 0 : f.icons) == null ? void 0 : w.className) ?? "table-headers-sort-indicator"
502
502
  }
@@ -510,7 +510,7 @@ function ge(e) {
510
510
  u.id
511
511
  );
512
512
  }),
513
- a && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: s("_accessibility:labels.actions") })
513
+ s && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: a("_accessibility:labels.actions") })
514
514
  ] }) });
515
515
  }
516
516
  function ve() {
@@ -518,8 +518,8 @@ function ve() {
518
518
  return /* @__PURE__ */ t("div", { className: "table-empty", children: /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.empty") }) });
519
519
  }
520
520
  const Ne = () => {
521
- const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = T();
522
- return /* @__PURE__ */ g("div", { className: "table-navigation-pages", children: [
521
+ const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T();
522
+ return /* @__PURE__ */ v("div", { className: "table-navigation-pages", children: [
523
523
  /* @__PURE__ */ t(
524
524
  "button",
525
525
  {
@@ -527,47 +527,47 @@ const Ne = () => {
527
527
  disabled: n === 0,
528
528
  "aria-label": e("_accessibility:buttons.previous"),
529
529
  name: e("_accessibility:buttons.previous"),
530
- onClick: () => a(n - 1),
530
+ onClick: () => s(n - 1),
531
531
  children: /* @__PURE__ */ t(oe, { className: "w-2.5" })
532
532
  }
533
533
  ),
534
534
  /* @__PURE__ */ t(
535
535
  "button",
536
536
  {
537
- disabled: Math.floor(s / ((n + 1) * r)) === 0,
537
+ disabled: Math.floor(a / ((n + 1) * r)) === 0,
538
538
  className: "table-navigation-buttons",
539
539
  name: e("_accessibility:buttons.next"),
540
540
  "aria-label": e("_accessibility:buttons.next"),
541
- onClick: () => a(n + 1),
541
+ onClick: () => s(n + 1),
542
542
  children: /* @__PURE__ */ t(le, { className: "w-2.5" })
543
543
  }
544
544
  )
545
545
  ] });
546
546
  }, fe = () => {
547
- const { t: e } = L(), { total: s, pageSize: r, pageSizes: n, currentPage: a } = T(), l = (a + 1) * r > s ? s : (a + 1) * r;
548
- return /* @__PURE__ */ g("div", { className: "table-navigation-sizes", children: [
549
- n[0] < s && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ g("p", { children: [
550
- a * r + 1,
547
+ const { t: e } = L(), { total: a, pageSize: r, pageSizes: n, currentPage: s } = T(), l = (s + 1) * r > a ? a : (s + 1) * r;
548
+ return /* @__PURE__ */ v("div", { className: "table-navigation-sizes", children: [
549
+ n[0] < a && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ v("p", { children: [
550
+ s * r + 1,
551
551
  " - ",
552
552
  l,
553
553
  " ",
554
554
  e("_accessibility:components.table.of")
555
555
  ] }) }),
556
- /* @__PURE__ */ t("p", { children: s })
556
+ /* @__PURE__ */ t("p", { children: a })
557
557
  ] });
558
558
  };
559
559
  function Ce() {
560
- const { t: e } = L(), { pageSizes: s, pageSize: r, setPageSize: n } = T(), a = y(
561
- () => s == null ? void 0 : s.map((l) => ({ id: l, value: l })),
562
- [s]
560
+ const { t: e } = L(), { pageSizes: a, pageSize: r, setPageSize: n } = T(), s = y(
561
+ () => a == null ? void 0 : a.map((l) => ({ id: l, value: l })),
562
+ [a]
563
563
  );
564
- return /* @__PURE__ */ g("div", { className: "page-size", children: [
564
+ return /* @__PURE__ */ v("div", { className: "page-size", children: [
565
565
  /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.pageSizes") }),
566
566
  /* @__PURE__ */ t(
567
567
  q,
568
568
  {
569
569
  value: r,
570
- options: a,
570
+ options: s,
571
571
  inputClassName: "page-size-input",
572
572
  containerClassName: "page-size-input-container",
573
573
  helperTextClassName: "hidden",
@@ -577,14 +577,14 @@ function Ce() {
577
577
  ] });
578
578
  }
579
579
  function ye() {
580
- const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = T(), l = y(() => {
581
- const o = Math.ceil(s / r);
580
+ const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T(), l = y(() => {
581
+ const o = Math.ceil(a / r);
582
582
  return Array.from({ length: o }, (c, i) => ({
583
583
  id: i,
584
584
  value: i + 1
585
585
  }));
586
- }, [s, r]);
587
- return /* @__PURE__ */ g("div", { className: "jump-to-page", children: [
586
+ }, [a, r]);
587
+ return /* @__PURE__ */ v("div", { className: "jump-to-page", children: [
588
588
  /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.jumpToPage") }),
589
589
  /* @__PURE__ */ t(
590
590
  q,
@@ -594,13 +594,13 @@ function ye() {
594
594
  inputClassName: "jump-to-page-input",
595
595
  containerClassName: "jump-to-page-input-container",
596
596
  helperTextClassName: "hidden",
597
- onChange: (o) => a(Number(o.target.value))
597
+ onChange: (o) => s(Number(o.target.value))
598
598
  }
599
599
  )
600
600
  ] });
601
601
  }
602
602
  function we() {
603
- return /* @__PURE__ */ g("div", { className: "table-footer", children: [
603
+ return /* @__PURE__ */ v("div", { className: "table-footer", children: [
604
604
  /* @__PURE__ */ t(ye, {}),
605
605
  /* @__PURE__ */ t(Ce, {}),
606
606
  /* @__PURE__ */ t(fe, {}),
@@ -608,13 +608,13 @@ function we() {
608
608
  ] });
609
609
  }
610
610
  function xe(e) {
611
- const { propertyName: s, options: r, label: n } = e, { currentFilters: a, setCurrentFilters: l } = _(), o = y(() => {
611
+ const { propertyName: a, options: r, label: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = y(() => {
612
612
  var i;
613
- return ((i = a[s]) == null ? void 0 : i.value) ?? r[0];
614
- }, [a]), c = S((i) => {
613
+ return ((i = s[a]) == null ? void 0 : i.value) ?? r[0];
614
+ }, [s]), c = S((i) => {
615
615
  l({
616
616
  type: k.update,
617
- toUpdate: { [s]: { value: i.target.value } }
617
+ toUpdate: { [a]: { value: i.target.value } }
618
618
  });
619
619
  }, []);
620
620
  return /* @__PURE__ */ t(
@@ -630,13 +630,13 @@ function xe(e) {
630
630
  );
631
631
  }
632
632
  const Se = (e) => {
633
- const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = _(), l = y(() => {
633
+ const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
634
634
  var c;
635
- return ((c = n[s]) == null ? void 0 : c.value) ?? "";
635
+ return ((c = n[a]) == null ? void 0 : c.value) ?? "";
636
636
  }, [n]), o = S((c) => {
637
- a({
637
+ s({
638
638
  type: k.update,
639
- toUpdate: { [s]: { value: c.target.value } }
639
+ toUpdate: { [a]: { value: c.target.value } }
640
640
  });
641
641
  }, []);
642
642
  return /* @__PURE__ */ t(
@@ -650,30 +650,30 @@ const Se = (e) => {
650
650
  }
651
651
  );
652
652
  }, ke = (e) => {
653
- const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = _(), l = y(() => {
653
+ const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
654
654
  var c;
655
- return ((c = n[s]) == null ? void 0 : c.value) ?? "";
655
+ return ((c = n[a]) == null ? void 0 : c.value) ?? "";
656
656
  }, [n]), o = S((c) => {
657
- a({
657
+ s({
658
658
  type: k.update,
659
- toUpdate: { [s]: { value: c.target.checked } }
659
+ toUpdate: { [a]: { value: c.target.checked } }
660
660
  });
661
661
  }, []);
662
662
  return /* @__PURE__ */ t(ie, { label: r, checked: l ?? !1, onChange: o });
663
663
  };
664
664
  function $e(e) {
665
- const { propertyName: s, label: r, options: n, multiple: a = !0 } = e, { currentFilters: l, setCurrentFilters: o } = _(), c = y(() => l[s] ?? n[0], [l]), i = S(
665
+ const { propertyName: a, label: r, options: n, multiple: s = !0 } = e, { currentFilters: l, setCurrentFilters: o } = _(), c = y(() => l[a] ?? n[0], [l]), i = S(
666
666
  (N) => {
667
667
  o({
668
668
  type: k.update,
669
669
  toUpdate: {
670
- [s]: {
670
+ [a]: {
671
671
  value: N
672
672
  }
673
673
  }
674
674
  });
675
675
  },
676
- [a]
676
+ [s]
677
677
  );
678
678
  return /* @__PURE__ */ t(
679
679
  de,
@@ -681,7 +681,7 @@ function $e(e) {
681
681
  value: c == null ? void 0 : c.value,
682
682
  label: r,
683
683
  options: n,
684
- multiple: a,
684
+ multiple: s,
685
685
  helperTextClassName: "hidden",
686
686
  containerClassName: "options-widget-container",
687
687
  onChange: i
@@ -689,20 +689,20 @@ function $e(e) {
689
689
  );
690
690
  }
691
691
  const G = (e) => {
692
- const { propertyName: s, label: r, inputType: n } = e, { currentFilters: a, setCurrentFilters: l } = _(), o = M(null), c = M(null), i = y(() => {
693
- var d, p, b;
694
- const m = (p = (d = a[s]) == null ? void 0 : d.value) == null ? void 0 : p.start;
695
- return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (b = a[s]) == null ? void 0 : b.value : "";
696
- }, [a]), N = y(() => {
697
- var d, p, b;
698
- const m = (p = (d = a[s]) == null ? void 0 : d.value) == null ? void 0 : p.end;
699
- return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (b = a[s]) == null ? void 0 : b.value : "";
700
- }, [a]), u = S((m) => {
692
+ const { propertyName: a, label: r, inputType: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = M(null), c = M(null), i = y(() => {
693
+ var d, p, g;
694
+ const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.start;
695
+ return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
696
+ }, [s]), N = y(() => {
697
+ var d, p, g;
698
+ const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.end;
699
+ return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
700
+ }, [s]), u = S((m) => {
701
701
  var d;
702
702
  l({
703
703
  type: k.update,
704
704
  toUpdate: {
705
- [s]: {
705
+ [a]: {
706
706
  value: { end: ((d = c == null ? void 0 : c.current) == null ? void 0 : d.value) ?? null, start: m.target.value }
707
707
  }
708
708
  }
@@ -712,7 +712,7 @@ const G = (e) => {
712
712
  l({
713
713
  type: k.update,
714
714
  toUpdate: {
715
- [s]: {
715
+ [a]: {
716
716
  value: {
717
717
  start: ((d = o == null ? void 0 : o.current) == null ? void 0 : d.value) ?? null,
718
718
  end: m.target.value
@@ -721,7 +721,7 @@ const G = (e) => {
721
721
  }
722
722
  });
723
723
  }, []);
724
- return /* @__PURE__ */ g("div", { className: "flex gap-2 items-center", children: [
724
+ return /* @__PURE__ */ v("div", { className: "flex gap-2 items-center", children: [
725
725
  /* @__PURE__ */ t(
726
726
  j,
727
727
  {
@@ -765,27 +765,27 @@ const G = (e) => {
765
765
  return /* @__PURE__ */ t(D, {});
766
766
  };
767
767
  const Oe = (e) => {
768
- const { align: s = "right", filters: r = [], icon: n } = e, [a, l] = P(!1), { onFilterApply: o, filters: c } = T(), { currentFilters: i, setCurrentFilters: N } = _(), { t: u } = L(), h = M(null), m = M(null);
768
+ const { align: a = "right", filters: r = [], icon: n } = e, [s, l] = P(!1), { onFilterApply: o, filters: c } = T(), { currentFilters: i, setCurrentFilters: N } = _(), { t: u } = L(), h = M(null), m = M(null);
769
769
  return H(() => {
770
770
  const d = ({ target: p }) => {
771
- var b, C;
772
- m.current && (!a || (b = m.current) != null && b.contains(p) || (C = h == null ? void 0 : h.current) != null && C.contains(p) || l(!1));
771
+ var g, C;
772
+ m.current && (!s || (g = m.current) != null && g.contains(p) || (C = h == null ? void 0 : h.current) != null && C.contains(p) || l(!1));
773
773
  };
774
774
  return document.addEventListener("click", d), () => document.removeEventListener("click", d);
775
775
  }), H(() => {
776
776
  const d = (p) => {
777
- !a || p.code !== "Escape" || l(!1);
777
+ !s || p.code !== "Escape" || l(!1);
778
778
  };
779
779
  return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
780
- }), /* @__PURE__ */ g("div", { className: "filter-dropdown-main", children: [
781
- /* @__PURE__ */ g(
780
+ }), /* @__PURE__ */ v("div", { className: "filter-dropdown-main", children: [
781
+ /* @__PURE__ */ v(
782
782
  "button",
783
783
  {
784
784
  ref: h,
785
785
  className: "filter-dropdown-button normal filter-dropdown-trigger",
786
786
  "aria-haspopup": "true",
787
- onClick: () => l(!a),
788
- "aria-expanded": a,
787
+ onClick: () => l(!s),
788
+ "aria-expanded": s,
789
789
  children: [
790
790
  /* @__PURE__ */ t("span", { className: "sr-only", children: u("_accessibility:buttons.filters") }),
791
791
  /* @__PURE__ */ t("wbr", {}),
@@ -796,11 +796,11 @@ const Oe = (e) => {
796
796
  /* @__PURE__ */ t(
797
797
  "div",
798
798
  {
799
- className: `filter-dropdown-transition ${a ? "opened" : "closed"} ${s === "right" ? "right" : "left"}`,
800
- children: /* @__PURE__ */ g("div", { ref: m, children: [
799
+ className: `filter-dropdown-transition ${s ? "opened" : "closed"} ${a === "right" ? "right" : "left"}`,
800
+ children: /* @__PURE__ */ v("div", { ref: m, children: [
801
801
  /* @__PURE__ */ t("div", { className: "filter-title", children: u("_accessibility:buttons.filters") }),
802
802
  /* @__PURE__ */ t("ul", { className: "filter-container", children: r.map((d) => /* @__PURE__ */ t("li", { className: "filter-container-item", children: Pe(d) }, d.propertyName)) }),
803
- /* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */ g("ul", { className: "filter-buttons-row", children: [
803
+ /* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */ v("ul", { className: "filter-buttons-row", children: [
804
804
  /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
805
805
  "button",
806
806
  {
@@ -826,13 +826,13 @@ const Oe = (e) => {
826
826
  )
827
827
  ] });
828
828
  }, ze = (e) => e, Ee = (e) => {
829
- const { columns: s, softDeleteProperty: r = "deleted", data: n, actions: a } = e, l = y(
830
- () => s.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
831
- [s]
829
+ const { columns: a, softDeleteProperty: r = "deleted", data: n, actions: s } = e, l = y(
830
+ () => a.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
831
+ [a]
832
832
  );
833
833
  return n == null ? void 0 : n.map((o) => {
834
834
  var c;
835
- return /* @__PURE__ */ g(
835
+ return /* @__PURE__ */ v(
836
836
  "tr",
837
837
  {
838
838
  className: `table-row ${o[r] ? "deleted-class" : ""}`,
@@ -845,7 +845,7 @@ const Oe = (e) => {
845
845
  },
846
846
  i.key
847
847
  )),
848
- a ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = a(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(Le, { content: i.tooltip, children: /* @__PURE__ */ t("button", { onClick: () => i.onClick(o), children: i.icon }) }, i.id)) }) }) : null
848
+ s ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = s(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(Le, { content: i.tooltip, children: /* @__PURE__ */ t("button", { onClick: () => i.onClick(o), children: i.icon }) }, i.id)) }) }) : null
849
849
  ]
850
850
  },
851
851
  o.id
@@ -854,10 +854,10 @@ const Oe = (e) => {
854
854
  };
855
855
  function Me(e) {
856
856
  const {
857
- title: s = "",
857
+ title: a = "",
858
858
  data: r,
859
859
  onSort: n,
860
- entity: a = "",
860
+ entity: s = "",
861
861
  isLoading: l = !1,
862
862
  actions: o,
863
863
  columns: c = [],
@@ -865,28 +865,28 @@ function Me(e) {
865
865
  className: N = "",
866
866
  toolbar: u = /* @__PURE__ */ t(D, {}),
867
867
  softDeleteProperty: h = "deleted"
868
- } = e, m = y(() => c ? c.sort((p, b) => (b.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
869
- var b;
868
+ } = e, m = y(() => c ? c.sort((p, g) => (g.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
869
+ var g;
870
870
  return {
871
871
  ...p.filterOptions,
872
- label: ((b = p.filterOptions) == null ? void 0 : b.label) ?? p.label,
872
+ label: ((g = p.filterOptions) == null ? void 0 : g.label) ?? p.label,
873
873
  propertyName: p.key
874
874
  };
875
875
  }) : [], [c]), d = y(() => !(r != null && r.length), [r]);
876
- return /* @__PURE__ */ t(be, { children: /* @__PURE__ */ g("div", { className: `${N} table-main`, children: [
877
- /* @__PURE__ */ g("div", { className: "table-header", children: [
878
- /* @__PURE__ */ t("h1", { className: "table-header-title", children: s }),
879
- l ? null : /* @__PURE__ */ g("div", { className: "table-header-right", children: [
876
+ return /* @__PURE__ */ t(be, { children: /* @__PURE__ */ v("div", { className: `${N} table-main`, children: [
877
+ /* @__PURE__ */ v("div", { className: "table-header", children: [
878
+ /* @__PURE__ */ t("h1", { className: "table-header-title", children: a }),
879
+ l ? null : /* @__PURE__ */ v("div", { className: "table-header-right", children: [
880
880
  u,
881
881
  !!m && !!m.length && /* @__PURE__ */ t(Oe, { filters: m })
882
882
  ] })
883
883
  ] }),
884
- l ? /* @__PURE__ */ t(ue, { className: "table-loading" }) : /* @__PURE__ */ t(D, { children: d ? /* @__PURE__ */ t(ve, {}) : /* @__PURE__ */ g(D, { children: [
885
- /* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ g("table", { className: "table-content", children: [
884
+ l ? /* @__PURE__ */ t(ue, { className: "table-loading" }) : /* @__PURE__ */ t(D, { children: d ? /* @__PURE__ */ t(ve, {}) : /* @__PURE__ */ v(D, { children: [
885
+ /* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ v("table", { className: "table-content", children: [
886
886
  /* @__PURE__ */ t(
887
887
  ge,
888
888
  {
889
- entity: a,
889
+ entity: s,
890
890
  columns: c,
891
891
  onSortCallback: n,
892
892
  hasAction: !!o
@@ -907,19 +907,19 @@ function Me(e) {
907
907
  ] }) });
908
908
  }
909
909
  function Le(e) {
910
- const { content: s, children: r } = e;
911
- return /* @__PURE__ */ g("div", { className: "tooltip-container", children: [
910
+ const { content: a, children: r } = e;
911
+ return /* @__PURE__ */ v("div", { className: "tooltip-container", children: [
912
912
  r,
913
- /* @__PURE__ */ t("div", { className: "tooltip-text", children: s })
913
+ /* @__PURE__ */ t("div", { className: "tooltip-text", children: a })
914
914
  ] });
915
915
  }
916
916
  var O = /* @__PURE__ */ ((e) => (e.empty = "empty", e.outlined = "outlined", e.default = "default", e))(O || {});
917
917
  function Te(e) {
918
918
  const {
919
- label: s,
919
+ label: a,
920
920
  onDelete: r,
921
921
  className: n = "",
922
- spanClassName: a = "",
922
+ spanClassName: s = "",
923
923
  variant: l = O.default
924
924
  } = e, o = y(() => {
925
925
  switch (l) {
@@ -941,15 +941,15 @@ function Te(e) {
941
941
  return "filled-chip-delete-button-svg";
942
942
  }
943
943
  }, [l]);
944
- return /* @__PURE__ */ g("div", { className: `chip-main ${o} ${n}`, children: [
945
- /* @__PURE__ */ t("span", { className: a, children: s }),
944
+ return /* @__PURE__ */ v("div", { className: `chip-main ${o} ${n}`, children: [
945
+ /* @__PURE__ */ t("span", { className: s, children: a }),
946
946
  r ? /* @__PURE__ */ t("button", { type: "button", className: "chip-delete-button", onClick: r, children: /* @__PURE__ */ t(K, { className: c }) }) : null
947
947
  ] });
948
948
  }
949
949
  export {
950
950
  de as AutocompleteInput,
951
951
  ie as CheckInput,
952
- ae as ChevronDown,
952
+ se as ChevronDown,
953
953
  oe as ChevronLeft,
954
954
  le as ChevronRight,
955
955
  re as ChevronUp,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sito/dashboard",
3
3
  "private": false,
4
- "version": "0.0.38",
4
+ "version": "0.0.39",
5
5
  "type": "module",
6
6
  "description": "UI library with custom components for dashboards",
7
7
  "main": "dist/dashboard.cjs",