UNPKG

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