mantine-datatable
Version:
The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data r
2 lines • 38.6 kB
JavaScript
"use client";import{Box as Kr,Table as Jr}from"@mantine/core";import{useDebouncedCallback as Zr,useMergedRef as Wo}from"@mantine/hooks";import Ao from"clsx";import{useCallback as ke,useMemo as Yr,useState as Ke}from"react";import{useState as kt}from"react";import{createSafeContext as $a}from"@mantine/core";var[Mt,de]=$a("useDataTableColumnsContext must be used within DataTableColumnProvider");import{jsx as Ka}from"react/jsx-runtime";var at=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:r,resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d}=e,[m,b]=kt(""),[p,T]=kt("");return Ka(Mt,{value:{sourceColumn:m,setSourceColumn:b,targetColumn:p,setTargetColumn:T,columnsToggle:a,setColumnsToggle:r,swapColumns:()=>{if(!o||!n||!m||!p)return;let x=o.indexOf(m),D=o.indexOf(p);if(x!==-1&&D!==-1){let S=o.splice(x,1)[0];o.splice(D,0,S),n([...o])}},resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d},children:t})};import{jsx as Et}from"react/jsx-runtime";function Nt(){return Et("tr",{className:"mantine-datatable-empty-row",children:Et("td",{})})}import{Center as Za,Text as Ya}from"@mantine/core";import{jsx as ve,jsxs as Ja}from"react/jsx-runtime";function Lt(){return Ja("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[ve("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),ve("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),ve("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),ve("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),ve("path",{d:"M3 3l18 18"})]})}import{Fragment as qa,jsx as Oe,jsxs as ja}from"react/jsx-runtime";function Ht({icon:e,text:t,pt:o,pb:n,active:a,children:r}){return Oe(Za,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:r||ja(qa,{children:[e||Oe("div",{className:"mantine-datatable-empty-state-icon",children:Oe(Lt,{})}),Oe(Ya,{component:"div",size:"sm",c:"dimmed",children:t})]})})}import{TableTfoot as wn,TableTr as Sn,rem as Pn}from"@mantine/core";import xn from"clsx";import{forwardRef as vn}from"react";import{TableTh as gn}from"@mantine/core";import hn from"clsx";import{useLocalStorage as nt}from"@mantine/hooks";import{useMemo as en}from"react";var It=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(c,y){let f=[];return c.forEach(u=>{y.find(w=>w.accessor===u)&&f.push(u)}),y.forEach(u=>{f.includes(u.accessor)||f.push(u.accessor)}),f}function a(c,y){let f=[];return c.forEach(u=>{y.find(w=>w.accessor===u.accessor)&&f.push(u)}),y.forEach(u=>{f.find(w=>w.accessor===u.accessor)||f.push({accessor:u.accessor,defaultToggle:u.defaultToggle||!0,toggleable:u.toggleable,toggled:u.defaultToggle===void 0?!0:u.defaultToggle})}),f}function r(c,y){let f=[];return c.forEach(u=>{let w=Object.keys(u)[0];y.find(h=>h.accessor===w)&&f.push(u)}),y.forEach(u=>{let w=u.accessor;if(!f.find(h=>Object.keys(h)[0]===w)){let h={};h[w]="",f.push(h)}}),f}function l(){let[c,y]=nt({key:e?`${e}-columns-order`:"",defaultValue:e?d:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[c,f];let u=n(c,t),w=JSON.stringify(c);return JSON.stringify(u)!==w&&f(u),[u,f]}function i(){let[c,y]=nt({key:e?`${e}-columns-toggle`:"",defaultValue:e?b:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[c,f];let u=a(c,t),w=JSON.stringify(c);return JSON.stringify(u)!==w&&f(u),[a(c,t),f]}function s(){let[c,y]=nt({key:e?`${e}-columns-width`:"",defaultValue:e?m:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[c,f];let u=r(c,t),w=JSON.stringify(c);return JSON.stringify(u)!==w&&f(u),[r(c,t),f]}let d=t&&t.map(c=>c.accessor)||[],m=t&&t.map(c=>({[c.accessor]:c.width??"initial"}))||[],b=t&&t.map(c=>({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})),[p,T]=l(),[g,x]=i(),[D,S]=s(),R=()=>T(d),P=()=>{x(b)},M=()=>S(m);return{effectiveColumns:en(()=>p?p.map(f=>t.find(u=>u.accessor===f)).map(f=>({...f,hidden:f?.hidden||!g.find(u=>u.accessor===f?.accessor)?.toggled})).map(f=>({...f,width:D.find(u=>u[f?.accessor])?.[f?.accessor]})):t,[t,p,g,D]),setColumnsOrder:T,columnsOrder:p,resetColumnsOrder:R,columnsToggle:g,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:D,setColumnsWidth:S,setColumnWidth:(c,y)=>{let f=D.map(u=>u[c]?{[c]:y}:u);S(f)},resetColumnsWidth:M}};import{useResizeObserver as tn}from"@mantine/hooks";function ne(){let[e]=tn(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}import{useEffect as on,useLayoutEffect as an}from"react";var Ot=typeof window<"u"?an:on;import{useEffect as nn,useState as rn}from"react";function Wt(e){let[t,o]=rn(null),n=e?.join(":")||"";return nn(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}import{useEffect as ln,useRef as sn,useState as dn}from"react";function cn(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function un(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function At(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=dn(o?t:un(e,t)),r=sn(null);return ln(()=>{if("matchMedia"in window)return r.current=e.map(l=>window.matchMedia(l)),a(r.current.map(l=>l.matches)),cn(r.current,l=>{a(l)})},[e]),n}import{useMantineTheme as mn}from"@mantine/core";import{useMemo as zt}from"react";function Vt(e){let t=mn(),o=zt(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=zt(()=>e.map(()=>!0),[e]);return At(o,n)}import{useMantineTheme as pn}from"@mantine/core";import{useMediaQuery as fn}from"@mantine/hooks";function K(e){let t=pn(),o=typeof e=="function"?e(t):e;return fn(o||"",!0)}import{useState as bn}from"react";function ce(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function _t(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function We(e,t){return e.filter((o,n,a)=>n===a.findIndex(r=>t(o)===t(r)))}function rt(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function E(e,t){return typeof t=="string"?rt(e,t):t(e)}function Al(e,t){let o=structuredClone(t),n=o[e.source.index];return e.destination&&(o.splice(e.source.index,1),o.splice(e.destination.index,0,n)),o}function zl(e,t){let o=structuredClone(t),n=e.destination;if(!n)return o;let a=o[e.source.index],r=o[n.index];return o.splice(n.index,1,a),o.splice(e.source.index,1,r),o}function Ft({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:s,initiallyExpanded:d}=e;t&&i==="always"?n=t.map(m=>E(m,o)):d&&(n=t.filter((m,b)=>d({record:m,index:b})).map(m=>E(m,o)),s||(n=[n[0]]))}let a,r,l=bn(n);if(e){let{expandable:i,trigger:s,allowMultiple:d,collapseProps:m,content:b}=e;e.expanded?{recordIds:a,onRecordIdsChange:r}=e.expanded:[a,r]=l;let p=T=>r?.(a.filter(g=>g!==E(T,o)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:T=>s==="always"?!0:a.includes(E(T,o)),isExpandable:({record:T,index:g})=>i?i({record:T,index:g}):!0,expandRow:T=>{let g=E(T,o);r?.(d?[...a,g]:[g])},collapseRow:p,collapseProps:m,content:({record:T,index:g})=>()=>b({record:T,index:g,collapse:()=>p(T)})}}}import{useTimeout as Bt}from"@mantine/hooks";import{useEffect as Tn,useState as Gt}from"react";function Xt(e,t){let[o,n]=Gt(e),[a,r]=Gt(e),l=Bt(()=>n(!0),0),i=Bt(()=>r(!1),t||200);return Tn(()=>{e?(i.clear(),r(!0),l.start()):(l.clear(),n(!1),i.start())},[l,i,e]),{expanded:o,visible:a}}var ue="mantine-datatable-nowrap",me="mantine-datatable-ellipsis",B="mantine-datatable-pointer-cursor",Ae="mantine-datatable-context-menu-cursor",Qt="mantine-datatable-text-selection-disabled",J="mantine-datatable-text-align-left",Z="mantine-datatable-text-align-center",Y="mantine-datatable-text-align-right";import{jsx as Cn}from"react/jsx-runtime";function Ut({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:r,textAlign:l,width:i}){return K(o)?Cn(gn,{className:hn({[ue]:a||r,[me]:r,[J]:l==="left",[Z]:l==="center",[Y]:l==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}import{TableTh as Dn}from"@mantine/core";import{jsx as yn}from"react/jsx-runtime";function $t({shadowVisible:e}){return yn(Dn,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}import{jsx as lt,jsxs as Rn}from"react/jsx-runtime";var Kt=vn(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:r,selectorCellShadowVisible:l,scrollDiff:i},s){let d=i<0;return lt(wn,{ref:s,className:xn("mantine-datatable-footer",t),style:[{position:d?"relative":"sticky",bottom:Pn(d?i:0)},o],children:Rn(Sn,{children:[r&<($t,{shadowVisible:l}),n.map(({hidden:m,...b})=>{if(m)return null;let{accessor:p,visibleMediaQuery:T,textAlign:g,width:x,footer:D,footerClassName:S,footerStyle:R,noWrap:P,ellipsis:M}={...a,...b};return lt(Ut,{className:S,style:R,visibleMediaQuery:T,textAlign:g,width:x,title:D,noWrap:P,ellipsis:M},p)})]})})});import{Checkbox as rr,Group as lr,Popover as ir,PopoverDropdown as sr,PopoverTarget as dr,Stack as cr,TableThead as ur,TableTr as mo}from"@mantine/core";import mr from"clsx";import{forwardRef as pr,useState as fr}from"react";import{TableTh as Mn}from"@mantine/core";import kn from"clsx";import{useMemo as Jt}from"react";import{jsx as En}from"react/jsx-runtime";function Zt({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:r}}){let l=Jt(()=>t.map(({visibleMediaQuery:d})=>d),[t]),i=Vt(l),s=Jt(()=>t.filter(({hidden:d},m)=>!d&&i?.[m]).length,[t,i]);return s>0?En(Mn,{colSpan:s,className:kn("mantine-datatable-column-group-header-cell",{[J]:n==="left",[Z]:n==="center",[Y]:n==="right"},a),style:r,children:o??ce(e)}):null}import{ActionIcon as io,Box as Kn,Center as Fe,Flex as Jn,Group as Zn,TableTh as Yn}from"@mantine/core";import Be from"clsx";import{useRef as qn,useState as jn}from"react";import{ActionIcon as Hn,Popover as In,PopoverDropdown as On,PopoverTarget as Wn}from"@mantine/core";import{useClickOutside as An,useDisclosure as zn}from"@mantine/hooks";import{jsx as Yt,jsxs as Nn}from"react/jsx-runtime";function qt(){return Nn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Yt("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}import{jsx as jt,jsxs as Ln}from"react/jsx-runtime";function eo(){return Ln("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[jt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),jt("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}import{jsx as ze,jsxs as Vn}from"react/jsx-runtime";function to({children:e,isActive:t,filterPopoverProps:o}){let[n,{close:a,toggle:r}]=zn(!1),l=t?eo:qt,i=An(a);return Vn(In,{withArrow:!0,shadow:"md",opened:n,onClose:a,trapFocus:!0,...o,children:[ze(Wn,{children:ze(Hn,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:s=>{s.preventDefault(),r()},onKeyDown:s=>s.stopPropagation(),children:ze(l,{})})}),ze(On,{ref:i,onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),children:typeof e=="function"?e({close:a}):e})]})}import{rem as _n}from"@mantine/core";import{useRef as Fn,useState as Bn}from"react";import{jsx as Gn}from"react/jsx-runtime";var oo=e=>{let{accessor:t,columnRef:o}=e,n=Fn(null),[a,r]=Bn(0),{setColumnWidth:l}=de(),i=b=>{b.preventDefault(),b.stopPropagation(),document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),document.body.style.cursor="col-resize"},s=b=>{if(!o.current)return;let p=b.clientX-o.current.getBoundingClientRect().right,g=`${o.current.getBoundingClientRect().width+p}px`;o.current.style.width=g,l(t,o.current.style.width),r(-p)},d=()=>{o.current&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),document.body.style.cursor="initial",l(t,o.current.style.width),r(0))};return Gn("div",{ref:n,onClick:b=>b.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",l(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:_n(a)}})};import{jsx as Ve,jsxs as Xn}from"react/jsx-runtime";function ao(){return Xn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[Ve("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Ve("path",{d:"M12 5l0 14"}),Ve("path",{d:"M16 9l-4 -4"}),Ve("path",{d:"M8 9l4 -4"})]})}import{jsx as _e,jsxs as Qn}from"react/jsx-runtime";function no(){return Qn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[_e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),_e("path",{d:"M8 7l4 -4l4 4"}),_e("path",{d:"M8 17l4 4l4 -4"}),_e("path",{d:"M12 3l0 18"})]})}import{jsx as re,jsxs as Un}from"react/jsx-runtime";function ro(){return Un("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[re("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),re("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),re("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),re("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),re("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),re("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),re("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}import{jsx as it,jsxs as $n}from"react/jsx-runtime";function lo(){return $n("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[it("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),it("path",{d:"M18 6l-12 12"}),it("path",{d:"M6 6l12 12"})]})}import{Fragment as er,jsx as H,jsxs as st}from"react/jsx-runtime";function so({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:r,draggable:l,toggleable:i,resizable:s,sortIcons:d,textAlign:m,width:b,sortStatus:p,onSortStatusChange:T,filter:g,filterPopoverProps:x,filtering:D,sortKey:S}){let{setSourceColumn:R,setTargetColumn:P,swapColumns:M,setColumnsToggle:N}=de(),[A,c]=jn(!1),y=qn(null);if(!K(n))return null;let f=a??ce(o),u=typeof f=="string"?f:void 0,w=r&&T?k=>{k?.defaultPrevented||T({sortKey:S,columnAccessor:o,direction:p?.columnAccessor===o?p.direction==="asc"?"desc":"asc":p?.direction??"asc"})}:void 0,h=k=>{k.stopPropagation(),R(o),c(!1)},L=k=>{k.preventDefault(),P(o),c(!0)},I=()=>{P(o),c(!1),M()},z=()=>{c(!0)},Q=()=>{c(!1)},F=k=>{k.stopPropagation(),N(U=>U.map(G=>G.accessor===o?{...G,toggled:!1}:G))};return st(Yn,{className:Be({"mantine-datatable-header-cell-sortable":r,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":s},e),style:[{width:b,...s?{minWidth:"1px"}:{minWidth:b,maxWidth:b}},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:w,onKeyDown:k=>k.key==="Enter"&&w?.(),ref:y,children:[st(Zn,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[st(Jn,{align:"center",w:"100%",className:Be({"mantine-datatable-header-cell-draggable":l,"mantine-datatable-header-cell-drag-over":A}),draggable:l,onDragStart:l?h:void 0,onDragEnter:l?z:void 0,onDragOver:l?L:void 0,onDrop:l?I:void 0,onDragLeave:l?Q:void 0,children:[l?H(Fe,{role:"img","aria-label":"Drag column",children:H(io,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:k=>{k.stopPropagation()},children:H(ro,{})})}):null,H(Kn,{className:Be("mantine-datatable-header-cell-sortable-text",{[J]:m==="left",[Z]:m==="center",[Y]:m==="right"},ue,me),title:u,children:f})]}),i?H(Fe,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:H(io,{size:"xs",variant:"light",onClick:F,children:H(lo,{})})}):null,r||p?.columnAccessor===o?H(er,{children:p?.columnAccessor===o?H(Fe,{className:Be("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":p.direction==="desc"}),role:"img","aria-label":`Sorted ${p.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||H(ao,{})}):H(Fe,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:d?.unsorted||H(no,{})})}):null,g?H(to,{filterPopoverProps:x,isActive:!!D,children:g}):null]}),s?H(oo,{accessor:o,columnRef:y}):null]})}import{Checkbox as tr,TableTh as or}from"@mantine/core";import ar from"clsx";import{forwardRef as nr}from"react";import{jsx as co}from"react/jsx-runtime";var uo=nr(function({className:t,style:o,trigger:n,shadowVisible:a,checked:r,indeterminate:l,checkboxProps:i,onChange:s,rowSpan:d},m){let b=!i.disabled;return co(or,{ref:m,className:ar("mantine-datatable-header-selector-cell",{[B]:n==="cell"&&b},t),style:o,rowSpan:d,"data-shadow-visible":a||void 0,onClick:n==="cell"&&b?s:void 0,children:co(tr,{classNames:b?{input:B}:void 0,checked:r,indeterminate:l,onChange:s,...i,disabled:!(s||i.onChange)||i.disabled})})});import{jsx as q,jsxs as Ge}from"react/jsx-runtime";var po=pr(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:r,onSortStatusChange:l,columns:i,defaultColumnProps:s,groups:d,selectionTrigger:m,selectionVisible:b,selectionChecked:p,selectionIndeterminate:T,onSelectionChange:g,selectionCheckboxProps:x,selectorCellShadowVisible:D,selectionColumnClassName:S,selectionColumnStyle:R},P){let M=b?q(uo,{ref:t,className:S,style:R,trigger:m,shadowVisible:D,checked:p,indeterminate:T,checkboxProps:x,onChange:g,rowSpan:d?2:void 0}):null,{columnsToggle:N,setColumnsToggle:A}=de(),[c,y]=fr(!1),f=i.some(h=>h.toggleable),u=f?Object.fromEntries(i.map(({accessor:h,title:L})=>[h,L??ce(String(h))])):void 0,w=Ge(ur,{className:mr("mantine-datatable-header",o),style:n,ref:P,onContextMenu:f?h=>{h.preventDefault(),y(L=>!L)}:void 0,children:[d&&Ge(mo,{children:[M,d.map(h=>q(Zt,{group:h},h.id))]}),Ge(mo,{children:[!d&&M,i.map(({hidden:h,...L},I)=>{if(h)return null;let{accessor:z,visibleMediaQuery:Q,textAlign:F,width:k,title:U,sortable:G,draggable:pe,toggleable:fe,resizable:be,titleClassName:Te,titleStyle:ge,filter:j,filterPopoverProps:he,filtering:Ce,sortKey:X}={...s,...L};return q(so,{accessor:z,className:Te,style:ge,visibleMediaQuery:Q,textAlign:F,width:k,title:U,sortable:G,draggable:pe,toggleable:fe,resizable:be&&I<i.length-1,sortStatus:a,sortIcons:r,sortKey:X,onSortStatusChange:l,filter:j,filterPopoverProps:he,filtering:Ce},z)})]})]});return f?Ge(ir,{position:"bottom",withArrow:!0,shadow:"md",opened:c,onChange:y,children:[q(dr,{children:w}),q(sr,{children:q(cr,{children:N.filter(h=>h.toggleable).map(h=>q(lr,{children:q(rr,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:u[h.accessor],checked:h.toggled,onChange:L=>{A(N.map(I=>I.accessor===h.accessor?{...I,toggled:L.currentTarget.checked}:I))}})},h.accessor))})})]}):w});import{Center as br,Loader as Tr}from"@mantine/core";import gr from"clsx";import{jsx as fo}from"react/jsx-runtime";function bo({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:r,type:l,color:i}){return fo(br,{pt:e,pb:t,className:gr("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||fo(Tr,{size:r,type:l,color:i}))})}import{Box as Rr,Pagination as Mr,Text as kr,rem as Er}from"@mantine/core";import So from"clsx";import{forwardRef as Nr}from"react";import{Button as Dr,Group as yr,Menu as wr,MenuDropdown as Sr,MenuItem as Pr,MenuTarget as xr,Text as Co,rem as Re}from"@mantine/core";import vr from"clsx";import{parseThemeColor as hr}from"@mantine/core";function v(e,t,o){return e?hr({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function To({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:r,highlightOnHoverColor:l}){return{"--mantine-datatable-color-light":v(t,e,"light"),"--mantine-datatable-color-dark":v(t,e,"dark"),"--mantine-datatable-background-color-light":v(o,e,"light"),"--mantine-datatable-background-color-dark":v(o,e,"dark"),"--mantine-datatable-border-color-light":v(n,e,"light"),"--mantine-datatable-border-color-dark":v(n,e,"dark"),"--mantine-datatable-row-border-color-light":v(a,e,"light"),"--mantine-datatable-row-border-color-dark":v(a,e,"dark"),"--mantine-datatable-striped-color-light":v(r,e,"light"),"--mantine-datatable-striped-color-dark":v(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":v(l,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":v(l,e,"dark")}}function Xe({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":v(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":v(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":v(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":v(o,e,"dark")}}function go({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":v(t,e,"light"),"--mantine-datatable-row-color-dark":v(t,e,"dark"),"--mantine-datatable-row-background-color-light":v(o,e,"light"),"--mantine-datatable-row-background-color-dark":v(o,e,"dark")}}import{jsx as dt,jsxs as Cr}from"react/jsx-runtime";function ho(){return Cr("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),dt("path",{d:"M8 9l4 -4l4 4"}),dt("path",{d:"M16 15l-4 4l-4 -4"})]})}import{jsx as le,jsxs as yo}from"react/jsx-runtime";var Do={xs:Re(22),sm:Re(26),md:Re(32),lg:Re(38),xl:Re(44)};function wo({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:r,onChange:l}){return yo(yr,{gap:"xs",children:[le(Co,{component:"div",size:e,children:t}),yo(wr,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[le(xr,{children:le(Dr,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:le(ho,{}),style:[{fontWeight:"normal"},i=>({height:Do[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),le(Sr,{children:o.map(i=>{let s=i===n;return le(Pr,{className:vr({"mantine-datatable-page-size-selector-active":s}),style:[{height:Do[e]},s&&(a||r)?d=>Xe({theme:d,paginationActiveTextColor:a,paginationActiveBackgroundColor:r}):void 0],disabled:s,onClick:()=>l(i),children:le(Co,{component:"div",size:e,children:i})},i)})})]})]})}import{jsx as ct,jsxs as Lr}from"react/jsx-runtime";var Po=Nr(function({className:t,style:o,fetching:n,page:a,onPageChange:r,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:s,paginationActiveBackgroundColor:d,paginationSize:m,loadingText:b,noRecordsText:p,paginationText:T,totalRecords:g,recordsPerPage:x,onRecordsPerPageChange:D,recordsPerPageLabel:S,recordsPerPageOptions:R,recordsLength:P,horizontalSpacing:M,paginationWrapBreakpoint:N,getPaginationControlProps:A},c){let y;if(g){let u=(a-1)*x+1,w=u+(P||0)-1;y=T({from:u,to:w,totalRecords:g})}else y=n?b:p;let f=K(({breakpoints:u})=>`(min-width: ${typeof N=="number"?`${Er(N)}rem`:u[N]||N})`);return Lr(Rr,{ref:c,px:M??"xs",py:"xs",className:So("mantine-datatable-pagination",t),style:[{flexDirection:f?"row":"column"},o],children:[ct(kr,{component:"div",className:"mantine-datatable-pagination-text",size:m,children:y}),R&&ct(wo,{activeTextColor:s,activeBackgroundColor:d,size:m,label:S,values:R,value:x,onChange:D}),ct(Mr,{classNames:{root:So("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:s||d?u=>Xe({theme:u,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0,withEdges:l,withControls:i,value:a,onChange:r,size:m,total:Math.ceil(g/x),getControlProps:A})]})});import{TableTr as Gr}from"@mantine/core";import Xr from"clsx";import{TableTd as Hr}from"@mantine/core";import Ir from"clsx";import{jsx as Or}from"react/jsx-runtime";function xo({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:r,onDoubleClick:l,onContextMenu:i,noWrap:s,ellipsis:d,textAlign:m,width:b,accessor:p,render:T,defaultRender:g,customCellAttributes:x}){return K(o)?Or(Hr,{className:Ir({[ue]:s||d,[me]:d,[B]:r||l,[Ae]:i,[J]:m==="left",[Z]:m==="center",[Y]:m==="right"},e),style:[{width:b,minWidth:b,maxWidth:b},t],onClick:r,onDoubleClick:l,onContextMenu:i,...x?.(n,a),children:T?T(n,a):g?g(n,a,p):rt(n,p)}):null}import{Collapse as Wr,TableTd as Ar,TableTr as vo}from"@mantine/core";import{Fragment as zr,jsx as Me,jsxs as Vr}from"react/jsx-runtime";function Ro({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:r}=Xt(e,n?.transitionDuration);return r?Vr(zr,{children:[Me(vo,{}),Me(vo,{children:Me(Ar,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:Me(Wr,{in:a,...n,children:Me("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}import{Checkbox as _r,TableTd as Fr}from"@mantine/core";import Br from"clsx";import{jsx as Mo}from"react/jsx-runtime";function ko({className:e,style:t,record:o,index:n,trigger:a,onChange:r,withRightShadow:l,checkboxProps:i,getCheckboxProps:s,...d}){let m={...i,...s(o,n)},b=!d.disabled&&!m.disabled,p=T=>{T.stopPropagation(),a==="cell"&&b&&r?.(T)};return Mo(Fr,{className:Br("mantine-datatable-row-selector-cell",{[B]:a==="cell"&&b},e),style:t,"data-shadow-visible":l||void 0,onClick:p,children:Mo(_r,{classNames:b?{input:B}:void 0,onChange:r,...d,...m})})}import{Fragment as Eo,jsx as Qe,jsxs as No}from"react/jsx-runtime";function Lo({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:r,selectionVisible:l,selectionChecked:i,onSelectionChange:s,isRecordSelectable:d,selectionCheckboxProps:m,getSelectionCheckboxProps:b,onClick:p,onDoubleClick:T,onContextMenu:g,onCellClick:x,onCellDoubleClick:D,onCellContextMenu:S,expansion:R,customAttributes:P,color:M,backgroundColor:N,className:A,style:c,selectorCellShadowVisible:y,selectionColumnClassName:f,selectionColumnStyle:u,rowFactory:w}){let h=No(Eo,{children:[l&&Qe(ko,{className:f,style:u,record:e,index:t,trigger:r,withRightShadow:y,checked:i,disabled:!s||(d?!d(e,t):!1),onChange:s,checkboxProps:m,getCheckboxProps:b}),o.map(({hidden:z,hiddenContent:Q,...F},k)=>{if(z||Q)return null;let{accessor:U,visibleMediaQuery:G,textAlign:pe,noWrap:fe,ellipsis:be,width:Te,render:ge,cellsClassName:j,cellsStyle:he,customCellAttributes:Ce}={...n,...F};return Qe(xo,{className:typeof j=="function"?j(e,t):j,style:he?.(e,t),visibleMediaQuery:G,record:e,index:t,onClick:x?X=>x({event:X,record:e,index:t,column:F,columnIndex:k}):void 0,onDoubleClick:D?X=>D({event:X,record:e,index:t,column:F,columnIndex:k}):void 0,onContextMenu:S?X=>S({event:X,record:e,index:t,column:F,columnIndex:k}):void 0,accessor:U,textAlign:pe,noWrap:fe,ellipsis:be,width:Te,render:ge,defaultRender:a,customCellAttributes:Ce},U)})]}),L=R&&Qe(Ro,{colSpan:o.filter(({hidden:z})=>!z).length+(l?1:0),open:R.isRowExpanded(e),content:R.content({record:e,index:t}),collapseProps:R.collapseProps}),I=Qr({record:e,index:t,selectionChecked:i,onClick:p,onDoubleClick:T,onContextMenu:g,expansion:R,customAttributes:P,color:M,backgroundColor:N,className:A,style:c});return w?w({record:e,index:t,rowProps:I,children:h,expandedElement:L}):No(Eo,{children:[Qe(Gr,{...I,children:h}),L]})}function Qr({record:e,index:t,selectionChecked:o,onClick:n,onDoubleClick:a,onContextMenu:r,expansion:l,customAttributes:i,color:s,backgroundColor:d,className:m,style:b}){return{className:Xr("mantine-datatable-row",{[B]:n||a||l?.isExpandable({record:e,index:t})&&l?.expandOnClick},{[Ae]:r},typeof m=="function"?m(e,t):m),"data-selected":o||void 0,onClick:p=>{if(l){let{isExpandable:T,isRowExpanded:g,expandOnClick:x,expandRow:D,collapseRow:S}=l;T({record:e,index:t})&&x&&(g(e)?S(e):D(e))}n?.({event:p,record:e,index:t})},onDoubleClick:a?p=>a({event:p,record:e,index:t}):void 0,onContextMenu:r?p=>r({event:p,record:e,index:t}):void 0,style:[s||d?p=>{let T=s?.(e,t),g=d?.(e,t);return go({theme:p,color:T,backgroundColor:g})}:void 0,b?.(e,t)],...i?.(e,t)??{}}}import{Box as Ho,ScrollArea as Ur,rem as Io}from"@mantine/core";import Ue from"clsx";import{jsx as $e,jsxs as $r}from"react/jsx-runtime";function Oo({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:r,headerHeight:l,footerHeight:i,onScrollPositionChange:s,children:d,viewportRef:m,scrollAreaProps:b}){return $r(Ur,{...b,viewportRef:m,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:s,children:[d,$e(Ho,{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:l?Io(l):0}}),$e("div",{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),$e("div",{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),$e(Ho,{className:Ue("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:i?Io(i+1):0}})]})}import{jsx as W,jsxs as zo}from"react/jsx-runtime";function qr({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:r,shadow:l,verticalAlign:i="center",fetching:s,columns:d,storeColumnsKey:m,groups:b,pinFirstColumn:p,pinLastColumn:T,defaultColumnProps:g,defaultColumnRender:x,idAccessor:D="id",records:S,selectionTrigger:R="checkbox",selectedRecords:P,onSelectedRecordsChange:M,selectionColumnClassName:N,selectionColumnStyle:A,isRecordSelectable:c,selectionCheckboxProps:y,allRecordsSelectionCheckboxProps:f={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:u=(O,ee)=>({"aria-label":`Select record ${ee+1}`}),sortStatus:w,sortIcons:h,onSortStatusChange:L,horizontalSpacing:I,page:z,onPageChange:Q,totalRecords:F,recordsPerPage:k,onRecordsPerPageChange:U,recordsPerPageOptions:G,recordsPerPageLabel:pe="Records per page",paginationWithEdges:fe,paginationWithControls:be,paginationActiveTextColor:Te,paginationActiveBackgroundColor:ge,paginationSize:j="sm",paginationText:he=({from:O,to:ee,totalRecords:te})=>`${O} - ${ee} / ${te}`,paginationWrapBreakpoint:Ce="sm",getPaginationControlProps:X=O=>O==="previous"?{"aria-label":"Previous page"}:O==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:_o,customLoader:Fo,loaderSize:Bo,loaderType:Go,loaderColor:Xo,loadingText:Qo="...",emptyState:Uo,noRecordsText:ut="No records",noRecordsIcon:$o,highlightOnHover:Ko,striped:Jo,noHeader:Zo,onRowClick:Yo,onRowDoubleClick:qo,onRowContextMenu:jo,onCellClick:ea,onCellDoubleClick:ta,onCellContextMenu:oa,onScroll:mt,onScrollToTop:pt,onScrollToBottom:ft,onScrollToLeft:bt,onScrollToRight:Tt,c:aa,backgroundColor:na,borderColor:ra,rowBorderColor:la,stripedColor:ia,highlightOnHoverColor:sa,rowColor:da,rowBackgroundColor:ca,rowExpansion:ua,rowClassName:ma,rowStyle:pa,customRowAttributes:fa,scrollViewportRef:ba,scrollAreaProps:Ta,tableRef:ga,bodyRef:ha,m:Ca,my:Da,mx:ya,mt:wa,mb:Sa,ml:Pa,mr:xa,className:va,classNames:De,style:Ra,styles:ye,rowFactory:Ma,tableWrapper:Je,...gt}){let{ref:O,width:ee,height:te}=ne(),we=Yr(()=>b?.flatMap(C=>C.columns)??d,[d,b]),ht=It({key:m,columns:we}),{ref:ka,height:Ze}=ne(),{ref:Ea,width:Ye,height:Se}=ne(),{ref:Na,height:La}=ne(),{ref:Ha,height:Ct}=ne(),{ref:Ia,width:Oa}=ne(),Wa=Wo(Ea,ga),Aa=Wo(O,ba),[qe,Dt]=Ke(!0),[je,yt]=Ke(!0),[Pe,wt]=Ke(!0),[Ee,St]=Ke(!0),za=Ft({rowExpansion:ua,records:S,idAccessor:D}),et=ke(()=>{let C=O.current?.scrollTop??0,$=O.current?.scrollLeft??0;if(s||Se<=te)Dt(!0),yt(!0);else{let V=C===0,_=Se-C-te<1;Dt(V),yt(_),V&&V!==qe&&pt?.(),_&&_!==je&&ft?.()}if(s||Ye===ee)wt(!0),St(!0);else{let V=$===0,_=Ye-$-ee<1;wt(V),St(_),V&&V!==Pe&&bt?.(),_&&_!==Ee&&Tt?.()}},[s,ft,bt,Tt,pt,te,O,ee,je,Pe,Ee,qe,Se,Ye]);Ot(et,[et]);let Pt=Zr(et,50),Va=ke(C=>{mt?.(C),Pt()},[Pt,mt]),_a=ke(C=>{O.current?.scrollTo({top:0,left:0}),Q(C)},[Q,O]),Ne=S?.length,xt=S?.map(C=>E(C,D)),ie=!!P,xe=P?.map(C=>E(C,D)),vt=xt!==void 0&&xe!==void 0&&xe.length>0,tt=c?S?.filter(c):S,Le=tt?.map(C=>E(C,D)),He=vt&&Le.every(C=>xe.includes(C)),Fa=vt&&Le.some(C=>xe.includes(C)),Ba=ke(()=>{P&&M&&M(He?P.filter(C=>!Le.includes(E(C,D))):We([...P,...tt],C=>E(C,D)))},[He,D,M,Le,tt,P]),{lastSelectionChangeIndex:Ie,setLastSelectionChangeIndex:Ga}=Wt(xt),ot=ie&&!Pe&&!p,Xa={m:Ca,my:Da,mx:ya,mt:wa,mb:Sa,ml:Pa,mr:xa},Qa=ke(({children:C})=>Je?Je({children:C}):C,[Je]);return W(at,{...ht,children:zo(Kr,{...Xa,className:Ao("mantine-datatable",{"mantine-datatable-with-border":e},va,De?.root),style:[C=>({...To({theme:C,c:aa,backgroundColor:na,borderColor:ra,rowBorderColor:la,stripedColor:ia,highlightOnHoverColor:sa}),borderRadius:C.radius[t]||t,boxShadow:C.shadows[l]||l,height:n,minHeight:a,maxHeight:r}),Ra,ye?.root,{position:"relative"}],children:[W(Oo,{viewportRef:Aa,topShadowVisible:!qe,leftShadowVisible:!Pe,leftShadowBehind:ie||!!p,rightShadowVisible:!Ee,rightShadowBehind:T,bottomShadowVisible:!je,headerHeight:Ze,footerHeight:La,onScrollPositionChange:Va,scrollAreaProps:Ta,children:W(Qa,{children:zo(Jr,{ref:Wa,horizontalSpacing:I,className:Ao("mantine-datatable-table",{[Qt]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":gt.withRowBorders&&Se<te,"mantine-datatable-pin-last-column":T,"mantine-datatable-pin-last-column-scrolled":!Ee&&T,"mantine-datatable-selection-column-visible":ie,"mantine-datatable-pin-first-column":p,"mantine-datatable-pin-first-column-scrolled":!Pe&&p},De?.table),style:{...ye?.table,"--mantine-datatable-selection-column-width":`${Oa}px`},"data-striped":Ne&&Jo||void 0,"data-highlight-on-hover":Ko||void 0,...gt,children:[Zo?null:W(at,{...ht,children:W(po,{ref:ka,selectionColumnHeaderRef:Ia,className:De?.header,style:ye?.header,columns:we,defaultColumnProps:g,groups:b,sortStatus:w,sortIcons:h,onSortStatusChange:L,selectionTrigger:R,selectionVisible:ie,selectionChecked:He,selectionIndeterminate:Fa&&!He,onSelectionChange:Ba,selectionCheckboxProps:{...y,...f},selectorCellShadowVisible:ot,selectionColumnClassName:N,selectionColumnStyle:A})}),W("tbody",{ref:ha,children:Ne?S.map((C,$)=>{let V=E(C,D),_=xe?.includes(V)||!1,Rt;return M&&P&&(Rt=Ua=>{if(Ua.nativeEvent.shiftKey&&Ie!==null){let se=S.filter($>Ie?(oe,ae)=>ae>=Ie&&ae<=$&&(c?c(oe,ae):!0):(oe,ae)=>ae>=$&&ae<=Ie&&(c?c(oe,ae):!0));M(_?_t(P,se,oe=>E(oe,D)):We([...P,...se],oe=>E(oe,D)))}else M(_?P.filter(se=>E(se,D)!==V):We([...P,C],se=>E(se,D)));Ga($)}),W(Lo,{record:C,index:$,columns:we,defaultColumnProps:g,defaultColumnRender:x,selectionTrigger:R,selectionVisible:ie,selectionChecked:_,onSelectionChange:Rt,isRecordSelectable:c,selectionCheckboxProps:y,getSelectionCheckboxProps:u,onClick:Yo,onDoubleClick:qo,onCellClick:ea,onCellDoubleClick:ta,onContextMenu:jo,onCellContextMenu:oa,expansion:za,color:da,backgroundColor:ca,className:ma,style:pa,customAttributes:fa,selectorCellShadowVisible:ot,selectionColumnClassName:N,selectionColumnStyle:A,idAccessor:D,rowFactory:Ma},V)}):W(Nt,{})}),we.some(({footer:C})=>C)&&W(Kt,{ref:Na,className:De?.footer,style:ye?.footer,columns:we,defaultColumnProps:g,selectionVisible:ie,selectorCellShadowVisible:ot,scrollDiff:Se-te})]})})}),z&&W(Po,{ref:Ha,className:De?.pagination,style:ye?.pagination,horizontalSpacing:I,fetching:s,page:z,onPageChange:_a,totalRecords:F,recordsPerPage:k,onRecordsPerPageChange:U,recordsPerPageOptions:G,recordsPerPageLabel:pe,paginationWithEdges:fe,paginationWithControls:be,paginationActiveTextColor:Te,paginationActiveBackgroundColor:ge,paginationSize:j,paginationText:he,paginationWrapBreakpoint:Ce,getPaginationControlProps:X,noRecordsText:ut,loadingText:Qo,recordsLength:Ne}),W(bo,{pt:Ze,pb:Ct,fetching:s,backgroundBlur:_o,customContent:Fo,size:Bo,type:Go,color:Xo}),W(Ht,{pt:Ze,pb:Ct,icon:$o,text:ut,active:!s&&!Ne,children:Uo})]})})}import{TableTr as jr}from"@mantine/core";import{useMergedRef as el}from"@mantine/hooks";import{forwardRef as tl,useEffect as ol,useRef as al}from"react";import{jsx as nl}from"react/jsx-runtime";var Vo=tl(function({children:e,isDragging:t,...o},n){let a=al(null),r=el(a,n);return ol(()=>{if(!a.current||!t)return;let d=a.current.parentElement.parentElement.children[0].children[0];for(let m=0;m<d.children.length;m++){let p=d.children[m].getBoundingClientRect(),T=a.current.children[m];T.style.height=p.height+"px",T.style.width=p.width+"px",T.style.minWidth=p.width+"px",T.style.maxWidth=p.width+"px"}},[t,e]),nl(jr,{"data-is-dragging":t,ref:r,...o,children:e})});Vo.displayName="DataTableDraggableRow";export{qr as DataTable,Vo as DataTableDraggableRow,_t as differenceBy,E as getRecordId,rt as getValueAtPath,ce as humanize,Al as reorderRecords,zl as swapRecords,We as uniqBy,It as useDataTableColumns};
//# sourceMappingURL=index.mjs.map