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