mantine-datatable
Advanced tools
Comparing version 7.11.0 to 7.11.1
@@ -264,2 +264,3 @@ import * as react from 'react'; | ||
paginationWithEdges?: never; | ||
paginationWithControls?: never; | ||
page?: never; | ||
@@ -278,6 +279,10 @@ onPageChange?: never; | ||
/** | ||
* Whenther to show first and last page navigation buttons. | ||
* Whether to show first and last page navigation buttons. | ||
*/ | ||
paginationWithEdges?: boolean; | ||
/** | ||
* Whether to show next and previous page navigation buttons. | ||
*/ | ||
paginationWithControls?: boolean; | ||
/** | ||
* Current page number (1-based). | ||
@@ -860,3 +865,3 @@ * If provided, a pagination component is shown. | ||
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, maxHeight, shadow, verticalAlign, fetching, columns, storeColumnsKey, groups, pinFirstColumn, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, selectionColumnClassName, selectionColumnStyle, isRecordSelectable, selectionCheckboxProps, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowDoubleClick, onRowContextMenu, onCellClick, onCellDoubleClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef, scrollAreaProps, tableRef, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element; | ||
declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, maxHeight, shadow, verticalAlign, fetching, columns, storeColumnsKey, groups, pinFirstColumn, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, selectionColumnClassName, selectionColumnStyle, isRecordSelectable, selectionCheckboxProps, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationWithControls, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowDoubleClick, onRowContextMenu, onCellClick, onCellDoubleClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef, scrollAreaProps, tableRef, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element; | ||
@@ -863,0 +868,0 @@ type DataTableColumnToggle = { |
@@ -1,2 +0,2 @@ | ||
"use strict";"use client";var En=Object.create;var ot=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var In=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty;var On=(e,t)=>{for(var o in t)ot(e,o,{get:t[o],enumerable:!0})},no=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ln(t))!Hn.call(e,a)&&a!==o&&ot(e,a,{get:()=>t[a],enumerable:!(n=Nn(t,a))||n.enumerable});return e};var V=(e,t,o)=>(o=e!=null?En(In(e)):{},no(t||!e||!e.__esModule?ot(o,"default",{value:e,enumerable:!0}):o,e)),Wn=e=>no(ot({},"__esModule",{value:!0}),e);var Vn={};On(Vn,{DataTable:()=>Pa,differenceBy:()=>It,getRecordId:()=>L,getValueAtPath:()=>it,humanize:()=>he,uniqBy:()=>Xe,useDataTableColumns:()=>Nt});module.exports=Wn(Vn);var Tt=require("@mantine/core"),Ze=require("@mantine/hooks"),_t=V(require("clsx")),G=require("react");var Rt=require("react");var ro=require("@mantine/core"),[lo,xe]=(0,ro.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var io=require("react/jsx-runtime"),kt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:c,resetColumnsWidth:m}=e,[b,p]=(0,Rt.useState)(""),[T,g]=(0,Rt.useState)("");return(0,io.jsx)(lo,{value:{sourceColumn:b,setSourceColumn:p,targetColumn:T,setTargetColumn:g,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!b||!T)return;let k=o.indexOf(b),y=o.indexOf(T);if(k!==-1&&y!==-1){let w=o.splice(k,1)[0];o.splice(y,0,w),n([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:c,resetColumnsWidth:m},children:t})};var Et=require("react/jsx-runtime");function so(){return(0,Et.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Et.jsx)("td",{})})}var at=require("@mantine/core");var ae=require("react/jsx-runtime");function co(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("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"}),(0,ae.jsx)("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"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function uo({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,ee.jsx)(at.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(co,{})}),(0,ee.jsx)(at.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Lo=V(require("clsx")),Io=require("react");var vo=require("@mantine/core"),xo=V(require("clsx"));var nt=require("@mantine/hooks"),mo=require("react"),Nt=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(s,S){let d=[];return s.forEach(u=>{S.find(C=>C.accessor===u)&&d.push(u)}),S.forEach(u=>{d.includes(u.accessor)||d.push(u.accessor)}),d}function a(s,S){let d=[];return s.forEach(u=>{S.find(C=>C.accessor===u.accessor)&&d.push(u)}),S.forEach(u=>{d.find(C=>C.accessor===u.accessor)||d.push({accessor:u.accessor,defaultToggle:u.defaultToggle||!0,toggleable:u.toggleable,toggled:u.defaultToggle===void 0?!0:u.defaultToggle})}),d}function l(s,S){let d=[];return s.forEach(u=>{let C=Object.keys(u)[0];S.find(f=>f.accessor===C)&&d.push(u)}),S.forEach(u=>{let C=u.accessor;if(!d.find(f=>Object.keys(f)[0]===C)){let f={};f[C]="",d.push(f)}}),d}function r(){let[s,S]=(0,nt.useLocalStorage)({key:e?`${e}-columns-order`:"",defaultValue:e?m:void 0,getInitialValueInEffect:o});function d(f){e&&S(f)}if(!e)return[s,d];let u=n(s,t),C=JSON.stringify(s);return JSON.stringify(u)!==C&&d(u),[u,d]}function i(){let[s,S]=(0,nt.useLocalStorage)({key:e?`${e}-columns-toggle`:"",defaultValue:e?p:void 0,getInitialValueInEffect:o});function d(f){e&&S(f)}if(!e)return[s,d];let u=a(s,t),C=JSON.stringify(s);return JSON.stringify(u)!==C&&d(u),[a(s,t),d]}function c(){let[s,S]=(0,nt.useLocalStorage)({key:e?`${e}-columns-width`:"",defaultValue:e?b:void 0,getInitialValueInEffect:o});function d(f){e&&S(f)}if(!e)return[s,d];let u=l(s,t),C=JSON.stringify(s);return JSON.stringify(u)!==C&&d(u),[l(s,t),d]}let m=t&&t.map(s=>s.accessor)||[],b=t&&t.map(s=>({[s.accessor]:s.width??"initial"}))||[],p=t&&t.map(s=>({accessor:s.accessor,defaultToggle:s.defaultToggle||!0,toggleable:s.toggleable,toggled:s.defaultToggle===void 0?!0:s.defaultToggle})),[T,g]=r(),[h,k]=i(),[y,w]=c(),P=()=>g(m),v=()=>{k(p)},x=()=>w(b);return{effectiveColumns:(0,mo.useMemo)(()=>T?T.map(d=>t.find(u=>u.accessor===d)).map(d=>({...d,hidden:!h.find(u=>u.accessor===d?.accessor)?.toggled})).map(d=>({...d,width:y.find(u=>u[d?.accessor])?.[d?.accessor]})):t,[t,T,h,y]),setColumnsOrder:g,columnsOrder:T,resetColumnsOrder:P,columnsToggle:h,setColumnsToggle:k,resetColumnsToggle:v,columnsWidth:y,setColumnsWidth:w,setColumnWidth:(s,S)=>{let d=y.map(u=>u[s]?{[s]:S}:u);w(d)},resetColumnsWidth:x}};var po=require("@mantine/hooks");function ge(){let[e]=(0,po.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),fo=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function bo(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Me=require("react");function An(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 zn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function To(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Me.useState)(o?t:zn(e,t)),l=(0,Me.useRef)();return(0,Me.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),a(l.current.map(r=>r.matches)),An(l.current,r=>{a(r)})},[e]),n}var go=require("@mantine/core"),Lt=require("react");function ho(e){let t=(0,go.useMantineTheme)(),o=(0,Lt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Lt.useMemo)(()=>e.map(()=>!0),[e]);return To(o,n)}var Co=require("@mantine/core"),Do=require("@mantine/hooks");function ne(e){let t=(0,Co.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,Do.useMediaQuery)(o||"",!0)}var yo=require("react");function he(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 It(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Xe(e,t){return e.filter((o,n,a)=>n===a.findIndex(l=>t(o)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function L(e,t){return typeof t=="string"?it(e,t):t(e)}function So({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:c,initiallyExpanded:m}=e;t&&i==="always"?n=t.map(b=>L(b,o)):m&&(n=t.filter((b,p)=>m({record:b,index:p})).map(b=>L(b,o)),c||(n=[n[0]]))}let a,l,r=(0,yo.useState)(n);if(e){let{expandable:i,trigger:c,allowMultiple:m,collapseProps:b,content:p}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=r;let T=g=>l?.(a.filter(h=>h!==L(g,o)));return{expandOnClick:c!=="always"&&c!=="never",isRowExpanded:g=>c==="always"?!0:a.includes(L(g,o)),isExpandable:({record:g,index:h})=>i?i({record:g,index:h}):!0,expandRow:g=>{let h=L(g,o);l?.(m?[...a,h]:[h])},collapseRow:T,collapseProps:b,content:({record:g,index:h})=>()=>p({record:g,index:h,collapse:()=>T(g)})}}}var Ht=require("@mantine/hooks"),Qe=require("react");function wo(e,t){let[o,n]=(0,Qe.useState)(e),[a,l]=(0,Qe.useState)(e),r=(0,Ht.useTimeout)(()=>n(!0),0),i=(0,Ht.useTimeout)(()=>l(!1),t||200);return(0,Qe.useEffect)(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),n(!1),i.start())},[r,i,e]),{expanded:o,visible:a}}var Re="mantine-datatable-nowrap",ke="mantine-datatable-ellipsis",J="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",Po="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var Ro=require("react/jsx-runtime");function Mo({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:r,width:i}){return ne(o)?(0,Ro.jsx)(vo.TableTh,{className:(0,xo.default)({[Re]:a||l,[ke]:l,[re]:r==="left",[le]:r==="center",[ie]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var ko=require("@mantine/core"),No=require("react/jsx-runtime");function Eo({shadowVisible:e}){return(0,No.jsx)(ko.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),Ho=(0,Io.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},c){let m=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:c,className:(0,Lo.default)("mantine-datatable-footer",t),style:[{position:m?"relative":"sticky",bottom:(0,Ne.rem)(m?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[l&&(0,Ee.jsx)(Eo,{shadowVisible:r}),n.map(({hidden:b,...p})=>{if(b)return null;let{accessor:T,visibleMediaQuery:g,textAlign:h,width:k,footer:y,footerClassName:w,footerStyle:P,noWrap:v,ellipsis:x}={...a,...p};return(0,Ee.jsx)(Mo,{className:w,style:P,visibleMediaQuery:g,textAlign:h,width:k,title:y,noWrap:v,ellipsis:x},T)})]})})});var O=require("@mantine/core"),ea=V(require("clsx")),mt=require("react");var Oo=require("@mantine/core"),Wo=V(require("clsx")),Ot=require("react");var zo=require("react/jsx-runtime");function Ao({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let r=(0,Ot.useMemo)(()=>t.map(({visibleMediaQuery:m})=>m),[t]),i=ho(r),c=(0,Ot.useMemo)(()=>t.filter(({hidden:m},b)=>!m&&i?.[b]).length,[t,i]);return c>0?(0,zo.jsx)(Oo.TableTh,{colSpan:c,className:(0,Wo.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:l,children:o??he(e)}):null}var W=require("@mantine/core"),Ke=V(require("clsx")),ct=require("react");var se=require("@mantine/core"),Fo=require("@mantine/hooks");var Ue=require("react/jsx-runtime");function Vo(){return(0,Ue.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ue.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ue.jsx)("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"})]})}var $e=require("react/jsx-runtime");function _o(){return(0,$e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,$e.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,$e.jsx)("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"})]})}var Ce=require("react/jsx-runtime");function Bo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Fo.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:r=>{r.preventDefault(),a()},children:(0,Ce.jsx)(t?_o:Vo,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:r=>r.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Go=require("@mantine/core"),dt=require("react");var Qo=require("react/jsx-runtime"),Xo=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:r}=xe(),i=p=>{p.preventDefault(),p.stopPropagation(),document.addEventListener("mousemove",c),document.addEventListener("mouseup",m),document.body.style.cursor="col-resize"},c=p=>{if(!o.current)return;let T=p.clientX-o.current.getBoundingClientRect().right,h=`${o.current.getBoundingClientRect().width+T}px`;o.current.style.width=h,r(t,o.current.style.width),l(-T)},m=()=>{o.current&&(document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return(0,Qo.jsx)("div",{ref:n,onClick:p=>p.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",r(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Go.rem)(a)}})};var De=require("react/jsx-runtime");function Uo(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M12 5l0 14"}),(0,De.jsx)("path",{d:"M16 9l-4 -4"}),(0,De.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function $o(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var Z=require("react/jsx-runtime");function Ko(){return(0,Z.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Z.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function Jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var M=require("react/jsx-runtime");function Zo({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:r,toggleable:i,resizable:c,sortIcons:m,textAlign:b,width:p,sortStatus:T,onSortStatusChange:g,filter:h,filtering:k,sortKey:y}){let{setSourceColumn:w,setTargetColumn:P,swapColumns:v,setColumnsToggle:x}=xe(),[F,I]=(0,ct.useState)(!1),s=(0,ct.useRef)(null);if(!ne(n))return null;let S=a??he(o),d=typeof S=="string"?S:void 0,u=l&&g?H=>{H?.defaultPrevented||g({sortKey:y,columnAccessor:o,direction:T?.columnAccessor===o?T.direction==="asc"?"desc":"asc":T?.direction??"asc"})}:void 0,C=H=>{H.stopPropagation(),w(o),I(!1)},f=H=>{H.preventDefault(),P(o),I(!0)},N=()=>{P(o),I(!1),v()},A=()=>{I(!0)},X=()=>{I(!1)},K=H=>{H.stopPropagation(),x(ue=>ue.map(q=>q.accessor===o?{...q,toggled:!1}:q))};return(0,M.jsxs)(W.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":c},e),style:[{width:p,...c?{minWidth:"1px"}:{minWidth:p,maxWidth:p}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:u,onKeyDown:H=>H.key==="Enter"&&u?.(),ref:s,children:[(0,M.jsxs)(W.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,M.jsxs)(W.Flex,{align:"center",w:"100%",className:(0,Ke.default)({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":F}),draggable:r,onDragStart:r?C:void 0,onDragEnter:r?A:void 0,onDragOver:r?f:void 0,onDrop:r?N:void 0,onDragLeave:r?X:void 0,children:[r?(0,M.jsx)(W.Center,{role:"img","aria-label":"Drag column",children:(0,M.jsx)(W.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:H=>{H.stopPropagation()},children:(0,M.jsx)(Ko,{})})}):null,(0,M.jsx)(W.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[re]:b==="left",[le]:b==="center",[ie]:b==="right"},Re,ke),title:d,children:S})]}),i?(0,M.jsx)(W.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,M.jsx)(W.ActionIcon,{size:"xs",variant:"light",onClick:K,children:(0,M.jsx)(Jo,{})})}):null,l||T?.columnAccessor===o?(0,M.jsx)(M.Fragment,{children:T?.columnAccessor===o?(0,M.jsx)(W.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":T.direction==="desc"}),role:"img","aria-label":`Sorted ${T.direction==="desc"?"descending":"ascending"}`,children:m?.sorted||(0,M.jsx)(Uo,{})}):(0,M.jsx)(W.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:m?.unsorted||(0,M.jsx)($o,{})})}):null,h?(0,M.jsx)(Bo,{isActive:!!k,children:h}):null]}),c?(0,M.jsx)(Xo,{accessor:o,columnRef:s}):null]})}var ut=require("@mantine/core"),Yo=V(require("clsx")),qo=require("react");var Wt=require("react/jsx-runtime"),jo=(0,qo.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:l,indeterminate:r,checkboxProps:i,onChange:c,rowSpan:m},b){let p=!i.disabled;return(0,Wt.jsx)(ut.TableTh,{ref:b,className:(0,Yo.default)("mantine-datatable-header-selector-cell",{[J]:n==="cell"&&p},t),style:o,rowSpan:m,"data-shadow-visible":a||void 0,onClick:n==="cell"&&p?c:void 0,children:(0,Wt.jsx)(ut.Checkbox,{classNames:p?{input:J}:void 0,checked:l,indeterminate:r,onChange:c,...i,disabled:!(c||i.onChange)||i.disabled})})});var _=require("react/jsx-runtime"),ta=(0,mt.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:l,onSortStatusChange:r,columns:i,defaultColumnProps:c,groups:m,selectionTrigger:b,selectionVisible:p,selectionChecked:T,selectionIndeterminate:g,onSelectionChange:h,selectionCheckboxProps:k,selectorCellShadowVisible:y,selectionColumnClassName:w,selectionColumnStyle:P},v){let x=p?(0,_.jsx)(jo,{ref:t,className:w,style:P,trigger:b,shadowVisible:y,checked:T,indeterminate:g,checkboxProps:k,onChange:h,rowSpan:m?2:void 0}):null,{columnsToggle:F,setColumnsToggle:I}=xe(),[s,S]=(0,mt.useState)(!1),d=i.some(f=>f.toggleable),u=d?Object.fromEntries(i.map(({accessor:f,title:N})=>[f,N??he(String(f))])):void 0,C=(0,_.jsxs)(O.TableThead,{className:(0,ea.default)("mantine-datatable-header",o),style:n,ref:v,onContextMenu:d?f=>{f.preventDefault(),S(N=>!N)}:void 0,children:[m&&(0,_.jsxs)(O.TableTr,{children:[x,m.map(f=>(0,_.jsx)(Ao,{group:f},f.id))]}),(0,_.jsxs)(O.TableTr,{children:[!m&&x,i.map(({hidden:f,...N},A)=>{if(f)return null;let{accessor:X,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae,titleClassName:j,titleStyle:gt,filter:ht,filtering:Ct,sortKey:Dt}={...c,...N};return(0,_.jsx)(Zo,{accessor:X,className:j,style:gt,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae&&A<i.length-1,sortStatus:a,sortIcons:l,sortKey:Dt,onSortStatusChange:r,filter:ht,filtering:Ct},X)})]})]});return d?(0,_.jsxs)(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:s,onChange:S,children:[(0,_.jsx)(O.PopoverTarget,{children:C}),(0,_.jsx)(O.PopoverDropdown,{children:(0,_.jsx)(O.Stack,{children:F.filter(f=>f.toggleable).map(f=>(0,_.jsx)(O.Group,{children:(0,_.jsx)(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:u[f.accessor],checked:f.toggled,onChange:N=>{I(F.map(A=>A.accessor===f.accessor?{...A,toggled:N.currentTarget.checked}:A))}})},f.accessor))})})]}):C});var pt=require("@mantine/core"),oa=V(require("clsx")),At=require("react/jsx-runtime");function aa({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:r,color:i}){return(0,At.jsx)(pt.Center,{pt:e,pb:t,className:(0,oa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,At.jsx)(pt.Loader,{size:l,type:r,color:i}))})}var de=require("@mantine/core"),zt=V(require("clsx")),ua=require("react");var R=require("@mantine/core"),da=V(require("clsx"));var na=require("@mantine/core");function E(e,t,o){return e?(0,na.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function ra({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":E(t,e,"light"),"--mantine-datatable-color-dark":E(t,e,"dark"),"--mantine-datatable-background-color-light":E(o,e,"light"),"--mantine-datatable-background-color-dark":E(o,e,"dark"),"--mantine-datatable-border-color-light":E(n,e,"light"),"--mantine-datatable-border-color-dark":E(n,e,"dark"),"--mantine-datatable-row-border-color-light":E(a,e,"light"),"--mantine-datatable-row-border-color-dark":E(a,e,"dark"),"--mantine-datatable-striped-color-light":E(l,e,"light"),"--mantine-datatable-striped-color-dark":E(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":E(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":E(r,e,"dark")}}function ft({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":E(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":E(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":E(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":E(o,e,"dark")}}function la({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":E(t,e,"light"),"--mantine-datatable-row-color-dark":E(t,e,"dark"),"--mantine-datatable-row-background-color-light":E(o,e,"light"),"--mantine-datatable-row-background-color-dark":E(o,e,"dark")}}var Ie=require("react/jsx-runtime");function ia(){return(0,Ie.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ie.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ie.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Ie.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var $=require("react/jsx-runtime"),sa={xs:(0,R.rem)(22),sm:(0,R.rem)(26),md:(0,R.rem)(32),lg:(0,R.rem)(38),xl:(0,R.rem)(44)};function ca({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:r}){return(0,$.jsxs)(R.Group,{gap:"xs",children:[(0,$.jsx)(R.Text,{component:"div",size:e,children:t}),(0,$.jsxs)(R.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,$.jsx)(R.MenuTarget,{children:(0,$.jsx)(R.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,$.jsx)(ia,{}),style:[{fontWeight:"normal"},i=>({height:sa[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,$.jsx)(R.MenuDropdown,{children:o.map(i=>{let c=i===n;return(0,$.jsx)(R.MenuItem,{className:(0,da.default)({"mantine-datatable-page-size-selector-active":c}),style:[{height:sa[e]},c&&(a||l)?m=>ft({theme:m,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:c,onClick:()=>r(i),children:(0,$.jsx)(R.Text,{component:"div",size:e,children:i})},i)})})]})]})}var He=require("react/jsx-runtime"),ma=(0,ua.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:r,paginationActiveTextColor:i,paginationActiveBackgroundColor:c,paginationSize:m,loadingText:b,noRecordsText:p,paginationText:T,totalRecords:g,recordsPerPage:h,onRecordsPerPageChange:k,recordsPerPageLabel:y,recordsPerPageOptions:w,recordsLength:P,horizontalSpacing:v,paginationWrapBreakpoint:x,getPaginationControlProps:F},I){let s;if(n)s=b;else if(!g)s=p;else{let d=(a-1)*h+1,u=d+P-1;s=T({from:d,to:u,totalRecords:g})}let S=ne(({breakpoints:d})=>`(min-width: ${typeof x=="number"?`${(0,de.rem)(x)}rem`:d[x]||x})`);return(0,He.jsxs)(de.Box,{ref:I,px:v??"xs",py:"xs",className:(0,zt.default)("mantine-datatable-pagination",t),style:[{flexDirection:S?"row":"column"},o],children:[(0,He.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:m,children:s}),w&&(0,He.jsx)(ca,{activeTextColor:i,activeBackgroundColor:c,size:m,label:y,values:w,value:h,onChange:k}),(0,He.jsx)(de.Pagination,{classNames:{root:(0,zt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:i||c?d=>ft({theme:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:c}):void 0,withEdges:r,value:a,onChange:l,size:m,total:Math.ceil(g/h),getControlProps:F})]})});var Da=require("@mantine/core"),ya=V(require("clsx"));var pa=require("@mantine/core"),fa=V(require("clsx"));var Ta=require("react/jsx-runtime");function ba({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:c,ellipsis:m,textAlign:b,width:p,accessor:T,render:g,defaultRender:h,customCellAttributes:k}){return ne(o)?(0,Ta.jsx)(pa.TableTd,{className:(0,fa.default)({[Re]:c||m,[ke]:m,[J]:l||r,[st]:i,[re]:b==="left",[le]:b==="center",[ie]:b==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onDoubleClick:r,onContextMenu:i,...k?.(n,a),children:g?g(n,a):h?h(n,a,T):it(n,T)}):null}var Se=require("@mantine/core");var Y=require("react/jsx-runtime");function ga({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=wo(e,n?.transitionDuration);return l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Se.TableTr,{}),(0,Y.jsx)(Se.TableTr,{children:(0,Y.jsx)(Se.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,Y.jsx)(Se.Collapse,{in:a,...n,children:(0,Y.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var bt=require("@mantine/core"),ha=V(require("clsx"));var Vt=require("react/jsx-runtime");function Ca({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:r,checkboxProps:i,getCheckboxProps:c,...m}){let b={...i,...c(o,n)},p=!m.disabled&&!b.disabled,T=g=>{g.stopPropagation(),a==="cell"&&p&&l?.(g)};return(0,Vt.jsx)(bt.TableTd,{className:(0,ha.default)("mantine-datatable-row-selector-cell",{[J]:a==="cell"&&p},e),style:t,"data-shadow-visible":r||void 0,onClick:T,children:(0,Vt.jsx)(bt.Checkbox,{classNames:p?{input:J}:void 0,onChange:l,...m,...b})})}var te=require("react/jsx-runtime");function Sa({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:c,isRecordSelectable:m,selectionCheckboxProps:b,getSelectionCheckboxProps:p,onClick:T,onDoubleClick:g,onContextMenu:h,onCellClick:k,onCellDoubleClick:y,onCellContextMenu:w,expansion:P,customAttributes:v,color:x,backgroundColor:F,className:I,style:s,selectorCellShadowVisible:S,selectionColumnClassName:d,selectionColumnStyle:u}){return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(Da.TableTr,{className:(0,ya.default)("mantine-datatable-row",{[J]:T||g||P?.isExpandable({record:e,index:t})&&P?.expandOnClick},{[st]:h},typeof I=="function"?I(e,t):I),"data-selected":i||void 0,onClick:C=>{if(P){let{isExpandable:f,isRowExpanded:N,expandOnClick:A,expandRow:X,collapseRow:K}=P;f({record:e,index:t})&&A&&(N(e)?K(e):X(e))}T?.({event:C,record:e,index:t})},onDoubleClick:g?C=>g({event:C,record:e,index:t}):void 0,onContextMenu:h?C=>h({event:C,record:e,index:t}):void 0,style:[x||F?C=>{let f=x?.(e,t),N=F?.(e,t);return la({theme:C,color:f,backgroundColor:N})}:void 0,s?.(e,t)],...v?.(e,t),children:[r&&(0,te.jsx)(Ca,{className:d,style:u,record:e,index:t,trigger:l,withRightShadow:S,checked:i,disabled:!c||(m?!m(e,t):!1),onChange:c,checkboxProps:b,getCheckboxProps:p}),o.map(({hidden:C,...f},N)=>{if(C)return null;let{accessor:A,visibleMediaQuery:X,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,cellsClassName:me,cellsStyle:We,customCellAttributes:Ae}={...n,...f};return(0,te.jsx)(ba,{className:typeof me=="function"?me(e,t):me,style:We?.(e,t),visibleMediaQuery:X,record:e,index:t,onClick:k?j=>k({event:j,record:e,index:t,column:f,columnIndex:N}):void 0,onDoubleClick:y?j=>y({event:j,record:e,index:t,column:f,columnIndex:N}):void 0,onContextMenu:w?j=>w({event:j,record:e,index:t,column:f,columnIndex:N}):void 0,accessor:A,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,defaultRender:a,customCellAttributes:Ae},A)})]}),P&&(0,te.jsx)(ga,{colSpan:o.filter(({hidden:C})=>!C).length+(r?1:0),open:P.isRowExpanded(e),content:P.content({record:e,index:t}),collapseProps:P.collapseProps})]})}var ce=require("@mantine/core"),Je=V(require("clsx")),we=require("react/jsx-runtime");function wa({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:c,children:m,viewportRef:b,scrollAreaProps:p}){return(0,we.jsxs)(ce.ScrollArea,{...p,viewportRef:b,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:c,children:[m,(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,ce.rem)(r):0}}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var z=require("react/jsx-runtime");function Pa({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:l,shadow:r,verticalAlign:i="center",fetching:c,columns:m,storeColumnsKey:b,groups:p,pinFirstColumn:T,pinLastColumn:g,defaultColumnProps:h,defaultColumnRender:k,idAccessor:y="id",records:w,selectionTrigger:P="checkbox",selectedRecords:v,onSelectedRecordsChange:x,selectionColumnClassName:F,selectionColumnStyle:I,isRecordSelectable:s,selectionCheckboxProps:S,allRecordsSelectionCheckboxProps:d={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:u=(B,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:C,sortIcons:f,onSortStatusChange:N,horizontalSpacing:A,page:X,onPageChange:K,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me="Records per page",paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt="sm",paginationText:ht=({from:B,to:pe,totalRecords:fe})=>`${B} - ${pe} / ${fe}`,paginationWrapBreakpoint:Ct="sm",getPaginationControlProps:Dt=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:va,customLoader:xa,loaderSize:Ma,loaderType:Ra,loaderColor:ka,loadingText:Ea="...",emptyState:Na,noRecordsText:Ft="No records",noRecordsIcon:La,highlightOnHover:Ia,striped:Ha,noHeader:Oa,onRowClick:Wa,onRowDoubleClick:Aa,onRowContextMenu:za,onCellClick:Va,onCellDoubleClick:_a,onCellContextMenu:Fa,onScroll:Bt,onScrollToTop:Gt,onScrollToBottom:Xt,onScrollToLeft:Qt,onScrollToRight:Ut,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a,rowColor:Ka,rowBackgroundColor:Ja,rowExpansion:Za,rowClassName:Ya,rowStyle:qa,customRowAttributes:ja,scrollViewportRef:en,scrollAreaProps:tn,tableRef:on,bodyRef:an,m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:un,className:mn,classNames:ze,style:pn,styles:Ve,...$t}){let{ref:B,width:pe,height:fe}=ge(),_e=(0,G.useMemo)(()=>p?.flatMap(D=>D.columns)??m,[m,p]),Kt=Nt({key:b,columns:_e}),{ref:fn,height:yt}=ge(),{ref:bn,width:St,height:Fe}=ge(),{ref:Tn,height:gn}=ge(),{ref:hn,height:Jt}=ge(),{ref:Cn,width:Dn}=ge(),yn=(0,Ze.useMergedRef)(bn,on),Sn=(0,Ze.useMergedRef)(B,en),[wt,Zt]=(0,G.useState)(!0),[Pt,Yt]=(0,G.useState)(!0),[Be,qt]=(0,G.useState)(!0),[Ye,jt]=(0,G.useState)(!0),wn=So({rowExpansion:Za,records:w,idAccessor:y}),vt=(0,G.useCallback)(()=>{let D=B.current?.scrollTop||0,oe=B.current?.scrollLeft||0;if(c||Fe<=fe)Zt(!0),Yt(!0);else{let Q=D===0,U=Fe-D-fe<1;Zt(Q),Yt(U),Q&&Q!==wt&&Gt?.(),U&&U!==Pt&&Xt?.()}if(c||St===pe)qt(!0),jt(!0);else{let Q=oe===0,U=St-oe-pe<1;qt(Q),jt(U),Q&&Q!==Be&&Qt?.(),U&&U!==Ye&&Ut?.()}},[c,Xt,Qt,Ut,Gt,fe,B,pe,Pt,Be,Ye,wt,Fe,St]);fo(vt,[vt]);let eo=(0,Ze.useDebouncedCallback)(vt,50),Pn=(0,G.useCallback)(D=>{Bt?.(D),eo()},[eo,Bt]),vn=(0,G.useCallback)(D=>{B.current?.scrollTo({top:0,left:0}),K(D)},[K,B]),qe=w?.length,to=w?.map(D=>L(D,y)),Pe=!!v,Ge=v?.map(D=>L(D,y)),oo=to!==void 0&&Ge!==void 0&&Ge.length>0,xt=s?w?.filter(s):w,je=xt?.map(D=>L(D,y)),et=oo&&je.every(D=>Ge.includes(D)),xn=oo&&je.some(D=>Ge.includes(D)),Mn=(0,G.useCallback)(()=>{v&&x&&x(et?v.filter(D=>!je.includes(L(D,y))):Xe([...v,...xt],D=>L(D,y)))},[et,y,x,je,xt,v]),{lastSelectionChangeIndex:tt,setLastSelectionChangeIndex:Rn}=bo(to),Mt=Pe&&!Be&&!T;return(0,z.jsx)(kt,{...Kt,children:(0,z.jsxs)(Tt.Box,{...{m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:un},className:(0,_t.default)("mantine-datatable",{"mantine-datatable-with-border":e},mn,ze?.root),style:[D=>({...ra({theme:D,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a}),borderRadius:D.radius[t]||t,boxShadow:D.shadows[r]||r,height:n,minHeight:a,maxHeight:l}),pn,Ve?.root],children:[(0,z.jsx)(wa,{viewportRef:Sn,topShadowVisible:!wt,leftShadowVisible:!Be,leftShadowBehind:Pe||!!T,rightShadowVisible:!Ye,rightShadowBehind:g,bottomShadowVisible:!Pt,headerHeight:yt,footerHeight:gn,onScrollPositionChange:Pn,scrollAreaProps:tn,children:(0,z.jsxs)(Tt.Table,{ref:yn,horizontalSpacing:A,className:(0,_t.default)("mantine-datatable-table",{[Po]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":$t.withRowBorders&&Fe<fe,"mantine-datatable-pin-last-column":g,"mantine-datatable-pin-last-column-scrolled":!Ye&&g,"mantine-datatable-selection-column-visible":Pe,"mantine-datatable-pin-first-column":T,"mantine-datatable-pin-first-column-scrolled":!Be&&T},ze?.table),style:{...Ve?.table,"--mantine-datatable-selection-column-width":`${Dn}px`},"data-striped":qe&&Ha||void 0,"data-highlight-on-hover":Ia||void 0,...$t,children:[Oa?null:(0,z.jsx)(kt,{...Kt,children:(0,z.jsx)(ta,{ref:fn,selectionColumnHeaderRef:Cn,className:ze?.header,style:Ve?.header,columns:_e,defaultColumnProps:h,groups:p,sortStatus:C,sortIcons:f,onSortStatusChange:N,selectionTrigger:P,selectionVisible:Pe,selectionChecked:et,selectionIndeterminate:xn&&!et,onSelectionChange:Mn,selectionCheckboxProps:{...S,...d},selectorCellShadowVisible:Mt,selectionColumnClassName:F,selectionColumnStyle:I})}),(0,z.jsx)("tbody",{ref:an,children:qe?w.map((D,oe)=>{let Q=L(D,y),U=Ge?.includes(Q)||!1,ao;return x&&v&&(ao=kn=>{if(kn.nativeEvent.shiftKey&&tt!==null){let ve=w.filter(oe>tt?(be,Te)=>Te>=tt&&Te<=oe&&(s?s(be,Te):!0):(be,Te)=>Te>=oe&&Te<=tt&&(s?s(be,Te):!0));x(U?It(v,ve,be=>L(be,y)):Xe([...v,...ve],be=>L(be,y)))}else x(U?v.filter(ve=>L(ve,y)!==Q):Xe([...v,D],ve=>L(ve,y)));Rn(oe)}),(0,z.jsx)(Sa,{record:D,index:oe,columns:_e,defaultColumnProps:h,defaultColumnRender:k,selectionTrigger:P,selectionVisible:Pe,selectionChecked:U,onSelectionChange:ao,isRecordSelectable:s,selectionCheckboxProps:S,getSelectionCheckboxProps:u,onClick:Wa,onDoubleClick:Aa,onCellClick:Va,onCellDoubleClick:_a,onContextMenu:za,onCellContextMenu:Fa,expansion:wn,color:Ka,backgroundColor:Ja,className:Ya,style:qa,customAttributes:ja,selectorCellShadowVisible:Mt,selectionColumnClassName:F,selectionColumnStyle:I},Q)}):(0,z.jsx)(so,{})}),_e.some(({footer:D})=>D)&&(0,z.jsx)(Ho,{ref:Tn,className:ze?.footer,style:Ve?.footer,columns:_e,defaultColumnProps:h,selectionVisible:Pe,selectorCellShadowVisible:Mt,scrollDiff:Fe-fe})]})}),X&&(0,z.jsx)(ma,{ref:hn,className:ze?.pagination,style:Ve?.pagination,horizontalSpacing:A,fetching:c,page:X,onPageChange:vn,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me,paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt,paginationText:ht,paginationWrapBreakpoint:Ct,getPaginationControlProps:Dt,noRecordsText:Ft,loadingText:Ea,recordsLength:qe}),(0,z.jsx)(aa,{pt:yt,pb:Jt,fetching:c,backgroundBlur:va,customContent:xa,size:Ma,type:Ra,color:ka}),(0,z.jsx)(uo,{pt:yt,pb:Jt,icon:La,text:Ft,active:!c&&!qe,children:Na})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns}); | ||
"use strict";"use client";var Nn=Object.create;var ot=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var Hn=Object.getPrototypeOf,On=Object.prototype.hasOwnProperty;var Wn=(e,t)=>{for(var o in t)ot(e,o,{get:t[o],enumerable:!0})},no=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of In(t))!On.call(e,a)&&a!==o&&ot(e,a,{get:()=>t[a],enumerable:!(n=Ln(t,a))||n.enumerable});return e};var _=(e,t,o)=>(o=e!=null?Nn(Hn(e)):{},no(t||!e||!e.__esModule?ot(o,"default",{value:e,enumerable:!0}):o,e)),An=e=>no(ot({},"__esModule",{value:!0}),e);var _n={};Wn(_n,{DataTable:()=>Pa,differenceBy:()=>It,getRecordId:()=>L,getValueAtPath:()=>it,humanize:()=>he,uniqBy:()=>Xe,useDataTableColumns:()=>Nt});module.exports=An(_n);var Tt=require("@mantine/core"),Ze=require("@mantine/hooks"),_t=_(require("clsx")),G=require("react");var Rt=require("react");var ro=require("@mantine/core"),[lo,xe]=(0,ro.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var io=require("react/jsx-runtime"),kt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u}=e,[f,p]=(0,Rt.useState)(""),[T,g]=(0,Rt.useState)("");return(0,io.jsx)(lo,{value:{sourceColumn:f,setSourceColumn:p,targetColumn:T,setTargetColumn:g,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!f||!T)return;let x=o.indexOf(f),S=o.indexOf(T);if(x!==-1&&S!==-1){let w=o.splice(x,1)[0];o.splice(S,0,w),n([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u},children:t})};var Et=require("react/jsx-runtime");function so(){return(0,Et.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Et.jsx)("td",{})})}var at=require("@mantine/core");var ae=require("react/jsx-runtime");function co(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("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"}),(0,ae.jsx)("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"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function uo({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,ee.jsx)(at.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(co,{})}),(0,ee.jsx)(at.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Lo=_(require("clsx")),Io=require("react");var vo=require("@mantine/core"),xo=_(require("clsx"));var nt=require("@mantine/hooks"),mo=require("react"),Nt=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(c,D){let m=[];return c.forEach(s=>{D.find(C=>C.accessor===s)&&m.push(s)}),D.forEach(s=>{m.includes(s.accessor)||m.push(s.accessor)}),m}function a(c,D){let m=[];return c.forEach(s=>{D.find(C=>C.accessor===s.accessor)&&m.push(s)}),D.forEach(s=>{m.find(C=>C.accessor===s.accessor)||m.push({accessor:s.accessor,defaultToggle:s.defaultToggle||!0,toggleable:s.toggleable,toggled:s.defaultToggle===void 0?!0:s.defaultToggle})}),m}function l(c,D){let m=[];return c.forEach(s=>{let C=Object.keys(s)[0];D.find(b=>b.accessor===C)&&m.push(s)}),D.forEach(s=>{let C=s.accessor;if(!m.find(b=>Object.keys(b)[0]===C)){let b={};b[C]="",m.push(b)}}),m}function r(){let[c,D]=(0,nt.useLocalStorage)({key:e?`${e}-columns-order`:"",defaultValue:e?u:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=n(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[s,m]}function i(){let[c,D]=(0,nt.useLocalStorage)({key:e?`${e}-columns-toggle`:"",defaultValue:e?p:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=a(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[a(c,t),m]}function d(){let[c,D]=(0,nt.useLocalStorage)({key:e?`${e}-columns-width`:"",defaultValue:e?f:void 0,getInitialValueInEffect:o});function m(b){e&&D(b)}if(!e)return[c,m];let s=l(c,t),C=JSON.stringify(c);return JSON.stringify(s)!==C&&m(s),[l(c,t),m]}let u=t&&t.map(c=>c.accessor)||[],f=t&&t.map(c=>({[c.accessor]:c.width??"initial"}))||[],p=t&&t.map(c=>({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})),[T,g]=r(),[h,x]=i(),[S,w]=d(),v=()=>g(u),P=()=>{x(p)},k=()=>w(f);return{effectiveColumns:(0,mo.useMemo)(()=>T?T.map(m=>t.find(s=>s.accessor===m)).map(m=>({...m,hidden:!h.find(s=>s.accessor===m?.accessor)?.toggled})).map(m=>({...m,width:S.find(s=>s[m?.accessor])?.[m?.accessor]})):t,[t,T,h,S]),setColumnsOrder:g,columnsOrder:T,resetColumnsOrder:v,columnsToggle:h,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:S,setColumnsWidth:w,setColumnWidth:(c,D)=>{let m=S.map(s=>s[c]?{[c]:D}:s);w(m)},resetColumnsWidth:k}};var po=require("@mantine/hooks");function ge(){let[e]=(0,po.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),fo=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function bo(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Me=require("react");function zn(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 Vn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function To(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Me.useState)(o?t:Vn(e,t)),l=(0,Me.useRef)();return(0,Me.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),a(l.current.map(r=>r.matches)),zn(l.current,r=>{a(r)})},[e]),n}var go=require("@mantine/core"),Lt=require("react");function ho(e){let t=(0,go.useMantineTheme)(),o=(0,Lt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Lt.useMemo)(()=>e.map(()=>!0),[e]);return To(o,n)}var Co=require("@mantine/core"),Do=require("@mantine/hooks");function ne(e){let t=(0,Co.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,Do.useMediaQuery)(o||"",!0)}var yo=require("react");function he(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 It(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Xe(e,t){return e.filter((o,n,a)=>n===a.findIndex(l=>t(o)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function L(e,t){return typeof t=="string"?it(e,t):t(e)}function So({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:d,initiallyExpanded:u}=e;t&&i==="always"?n=t.map(f=>L(f,o)):u&&(n=t.filter((f,p)=>u({record:f,index:p})).map(f=>L(f,o)),d||(n=[n[0]]))}let a,l,r=(0,yo.useState)(n);if(e){let{expandable:i,trigger:d,allowMultiple:u,collapseProps:f,content:p}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=r;let T=g=>l?.(a.filter(h=>h!==L(g,o)));return{expandOnClick:d!=="always"&&d!=="never",isRowExpanded:g=>d==="always"?!0:a.includes(L(g,o)),isExpandable:({record:g,index:h})=>i?i({record:g,index:h}):!0,expandRow:g=>{let h=L(g,o);l?.(u?[...a,h]:[h])},collapseRow:T,collapseProps:f,content:({record:g,index:h})=>()=>p({record:g,index:h,collapse:()=>T(g)})}}}var Ht=require("@mantine/hooks"),Qe=require("react");function wo(e,t){let[o,n]=(0,Qe.useState)(e),[a,l]=(0,Qe.useState)(e),r=(0,Ht.useTimeout)(()=>n(!0),0),i=(0,Ht.useTimeout)(()=>l(!1),t||200);return(0,Qe.useEffect)(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),n(!1),i.start())},[r,i,e]),{expanded:o,visible:a}}var Re="mantine-datatable-nowrap",ke="mantine-datatable-ellipsis",J="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",Po="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var Ro=require("react/jsx-runtime");function Mo({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:r,width:i}){return ne(o)?(0,Ro.jsx)(vo.TableTh,{className:(0,xo.default)({[Re]:a||l,[ke]:l,[re]:r==="left",[le]:r==="center",[ie]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var ko=require("@mantine/core"),No=require("react/jsx-runtime");function Eo({shadowVisible:e}){return(0,No.jsx)(ko.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),Ho=(0,Io.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},d){let u=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:d,className:(0,Lo.default)("mantine-datatable-footer",t),style:[{position:u?"relative":"sticky",bottom:(0,Ne.rem)(u?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[l&&(0,Ee.jsx)(Eo,{shadowVisible:r}),n.map(({hidden:f,...p})=>{if(f)return null;let{accessor:T,visibleMediaQuery:g,textAlign:h,width:x,footer:S,footerClassName:w,footerStyle:v,noWrap:P,ellipsis:k}={...a,...p};return(0,Ee.jsx)(Mo,{className:w,style:v,visibleMediaQuery:g,textAlign:h,width:x,title:S,noWrap:P,ellipsis:k},T)})]})})});var O=require("@mantine/core"),ea=_(require("clsx")),mt=require("react");var Oo=require("@mantine/core"),Wo=_(require("clsx")),Ot=require("react");var zo=require("react/jsx-runtime");function Ao({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let r=(0,Ot.useMemo)(()=>t.map(({visibleMediaQuery:u})=>u),[t]),i=ho(r),d=(0,Ot.useMemo)(()=>t.filter(({hidden:u},f)=>!u&&i?.[f]).length,[t,i]);return d>0?(0,zo.jsx)(Oo.TableTh,{colSpan:d,className:(0,Wo.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:l,children:o??he(e)}):null}var A=require("@mantine/core"),Ke=_(require("clsx")),ct=require("react");var se=require("@mantine/core"),Fo=require("@mantine/hooks");var Ue=require("react/jsx-runtime");function Vo(){return(0,Ue.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ue.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ue.jsx)("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"})]})}var $e=require("react/jsx-runtime");function _o(){return(0,$e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,$e.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,$e.jsx)("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"})]})}var Ce=require("react/jsx-runtime");function Bo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Fo.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:r=>{r.preventDefault(),a()},children:(0,Ce.jsx)(t?_o:Vo,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:r=>r.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Go=require("@mantine/core"),dt=require("react");var Qo=require("react/jsx-runtime"),Xo=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:r}=xe(),i=p=>{p.preventDefault(),p.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",u),document.body.style.cursor="col-resize"},d=p=>{if(!o.current)return;let T=p.clientX-o.current.getBoundingClientRect().right,h=`${o.current.getBoundingClientRect().width+T}px`;o.current.style.width=h,r(t,o.current.style.width),l(-T)},u=()=>{o.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return(0,Qo.jsx)("div",{ref:n,onClick:p=>p.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",r(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Go.rem)(a)}})};var De=require("react/jsx-runtime");function Uo(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M12 5l0 14"}),(0,De.jsx)("path",{d:"M16 9l-4 -4"}),(0,De.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function $o(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var Z=require("react/jsx-runtime");function Ko(){return(0,Z.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Z.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function Jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var M=require("react/jsx-runtime");function Zo({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:r,toggleable:i,resizable:d,sortIcons:u,textAlign:f,width:p,sortStatus:T,onSortStatusChange:g,filter:h,filtering:x,sortKey:S}){let{setSourceColumn:w,setTargetColumn:v,swapColumns:P,setColumnsToggle:k}=xe(),[W,I]=(0,ct.useState)(!1),c=(0,ct.useRef)(null);if(!ne(n))return null;let D=a??he(o),m=typeof D=="string"?D:void 0,s=l&&g?H=>{H?.defaultPrevented||g({sortKey:S,columnAccessor:o,direction:T?.columnAccessor===o?T.direction==="asc"?"desc":"asc":T?.direction??"asc"})}:void 0,C=H=>{H.stopPropagation(),w(o),I(!1)},b=H=>{H.preventDefault(),v(o),I(!0)},N=()=>{v(o),I(!1),P()},z=()=>{I(!0)},X=()=>{I(!1)},K=H=>{H.stopPropagation(),k(ue=>ue.map(q=>q.accessor===o?{...q,toggled:!1}:q))};return(0,M.jsxs)(A.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":d},e),style:[{width:p,...d?{minWidth:"1px"}:{minWidth:p,maxWidth:p}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:s,onKeyDown:H=>H.key==="Enter"&&s?.(),ref:c,children:[(0,M.jsxs)(A.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,M.jsxs)(A.Flex,{align:"center",w:"100%",className:(0,Ke.default)({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":W}),draggable:r,onDragStart:r?C:void 0,onDragEnter:r?z:void 0,onDragOver:r?b:void 0,onDrop:r?N:void 0,onDragLeave:r?X:void 0,children:[r?(0,M.jsx)(A.Center,{role:"img","aria-label":"Drag column",children:(0,M.jsx)(A.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:H=>{H.stopPropagation()},children:(0,M.jsx)(Ko,{})})}):null,(0,M.jsx)(A.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[re]:f==="left",[le]:f==="center",[ie]:f==="right"},Re,ke),title:m,children:D})]}),i?(0,M.jsx)(A.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,M.jsx)(A.ActionIcon,{size:"xs",variant:"light",onClick:K,children:(0,M.jsx)(Jo,{})})}):null,l||T?.columnAccessor===o?(0,M.jsx)(M.Fragment,{children:T?.columnAccessor===o?(0,M.jsx)(A.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":T.direction==="desc"}),role:"img","aria-label":`Sorted ${T.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||(0,M.jsx)(Uo,{})}):(0,M.jsx)(A.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:u?.unsorted||(0,M.jsx)($o,{})})}):null,h?(0,M.jsx)(Bo,{isActive:!!x,children:h}):null]}),d?(0,M.jsx)(Xo,{accessor:o,columnRef:c}):null]})}var ut=require("@mantine/core"),Yo=_(require("clsx")),qo=require("react");var Wt=require("react/jsx-runtime"),jo=(0,qo.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:l,indeterminate:r,checkboxProps:i,onChange:d,rowSpan:u},f){let p=!i.disabled;return(0,Wt.jsx)(ut.TableTh,{ref:f,className:(0,Yo.default)("mantine-datatable-header-selector-cell",{[J]:n==="cell"&&p},t),style:o,rowSpan:u,"data-shadow-visible":a||void 0,onClick:n==="cell"&&p?d:void 0,children:(0,Wt.jsx)(ut.Checkbox,{classNames:p?{input:J}:void 0,checked:l,indeterminate:r,onChange:d,...i,disabled:!(d||i.onChange)||i.disabled})})});var F=require("react/jsx-runtime"),ta=(0,mt.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:l,onSortStatusChange:r,columns:i,defaultColumnProps:d,groups:u,selectionTrigger:f,selectionVisible:p,selectionChecked:T,selectionIndeterminate:g,onSelectionChange:h,selectionCheckboxProps:x,selectorCellShadowVisible:S,selectionColumnClassName:w,selectionColumnStyle:v},P){let k=p?(0,F.jsx)(jo,{ref:t,className:w,style:v,trigger:f,shadowVisible:S,checked:T,indeterminate:g,checkboxProps:x,onChange:h,rowSpan:u?2:void 0}):null,{columnsToggle:W,setColumnsToggle:I}=xe(),[c,D]=(0,mt.useState)(!1),m=i.some(b=>b.toggleable),s=m?Object.fromEntries(i.map(({accessor:b,title:N})=>[b,N??he(String(b))])):void 0,C=(0,F.jsxs)(O.TableThead,{className:(0,ea.default)("mantine-datatable-header",o),style:n,ref:P,onContextMenu:m?b=>{b.preventDefault(),D(N=>!N)}:void 0,children:[u&&(0,F.jsxs)(O.TableTr,{children:[k,u.map(b=>(0,F.jsx)(Ao,{group:b},b.id))]}),(0,F.jsxs)(O.TableTr,{children:[!u&&k,i.map(({hidden:b,...N},z)=>{if(b)return null;let{accessor:X,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae,titleClassName:j,titleStyle:gt,filter:ht,filtering:Ct,sortKey:Dt}={...d,...N};return(0,F.jsx)(Zo,{accessor:X,className:j,style:gt,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae&&z<i.length-1,sortStatus:a,sortIcons:l,sortKey:Dt,onSortStatusChange:r,filter:ht,filtering:Ct},X)})]})]});return m?(0,F.jsxs)(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:c,onChange:D,children:[(0,F.jsx)(O.PopoverTarget,{children:C}),(0,F.jsx)(O.PopoverDropdown,{children:(0,F.jsx)(O.Stack,{children:W.filter(b=>b.toggleable).map(b=>(0,F.jsx)(O.Group,{children:(0,F.jsx)(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:s[b.accessor],checked:b.toggled,onChange:N=>{I(W.map(z=>z.accessor===b.accessor?{...z,toggled:N.currentTarget.checked}:z))}})},b.accessor))})})]}):C});var pt=require("@mantine/core"),oa=_(require("clsx")),At=require("react/jsx-runtime");function aa({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:r,color:i}){return(0,At.jsx)(pt.Center,{pt:e,pb:t,className:(0,oa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,At.jsx)(pt.Loader,{size:l,type:r,color:i}))})}var de=require("@mantine/core"),zt=_(require("clsx")),ua=require("react");var R=require("@mantine/core"),da=_(require("clsx"));var na=require("@mantine/core");function E(e,t,o){return e?(0,na.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function ra({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":E(t,e,"light"),"--mantine-datatable-color-dark":E(t,e,"dark"),"--mantine-datatable-background-color-light":E(o,e,"light"),"--mantine-datatable-background-color-dark":E(o,e,"dark"),"--mantine-datatable-border-color-light":E(n,e,"light"),"--mantine-datatable-border-color-dark":E(n,e,"dark"),"--mantine-datatable-row-border-color-light":E(a,e,"light"),"--mantine-datatable-row-border-color-dark":E(a,e,"dark"),"--mantine-datatable-striped-color-light":E(l,e,"light"),"--mantine-datatable-striped-color-dark":E(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":E(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":E(r,e,"dark")}}function ft({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":E(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":E(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":E(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":E(o,e,"dark")}}function la({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":E(t,e,"light"),"--mantine-datatable-row-color-dark":E(t,e,"dark"),"--mantine-datatable-row-background-color-light":E(o,e,"light"),"--mantine-datatable-row-background-color-dark":E(o,e,"dark")}}var Ie=require("react/jsx-runtime");function ia(){return(0,Ie.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ie.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ie.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Ie.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var $=require("react/jsx-runtime"),sa={xs:(0,R.rem)(22),sm:(0,R.rem)(26),md:(0,R.rem)(32),lg:(0,R.rem)(38),xl:(0,R.rem)(44)};function ca({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:r}){return(0,$.jsxs)(R.Group,{gap:"xs",children:[(0,$.jsx)(R.Text,{component:"div",size:e,children:t}),(0,$.jsxs)(R.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,$.jsx)(R.MenuTarget,{children:(0,$.jsx)(R.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,$.jsx)(ia,{}),style:[{fontWeight:"normal"},i=>({height:sa[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,$.jsx)(R.MenuDropdown,{children:o.map(i=>{let d=i===n;return(0,$.jsx)(R.MenuItem,{className:(0,da.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:sa[e]},d&&(a||l)?u=>ft({theme:u,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>r(i),children:(0,$.jsx)(R.Text,{component:"div",size:e,children:i})},i)})})]})]})}var He=require("react/jsx-runtime"),ma=(0,ua.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:r,paginationWithControls:i,paginationActiveTextColor:d,paginationActiveBackgroundColor:u,paginationSize:f,loadingText:p,noRecordsText:T,paginationText:g,totalRecords:h,recordsPerPage:x,onRecordsPerPageChange:S,recordsPerPageLabel:w,recordsPerPageOptions:v,recordsLength:P,horizontalSpacing:k,paginationWrapBreakpoint:W,getPaginationControlProps:I},c){let D;if(n)D=p;else if(!h)D=T;else{let s=(a-1)*x+1,C=s+P-1;D=g({from:s,to:C,totalRecords:h})}let m=ne(({breakpoints:s})=>`(min-width: ${typeof W=="number"?`${(0,de.rem)(W)}rem`:s[W]||W})`);return(0,He.jsxs)(de.Box,{ref:c,px:k??"xs",py:"xs",className:(0,zt.default)("mantine-datatable-pagination",t),style:[{flexDirection:m?"row":"column"},o],children:[(0,He.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:f,children:D}),v&&(0,He.jsx)(ca,{activeTextColor:d,activeBackgroundColor:u,size:f,label:w,values:v,value:x,onChange:S}),(0,He.jsx)(de.Pagination,{classNames:{root:(0,zt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:d||u?s=>ft({theme:s,paginationActiveTextColor:d,paginationActiveBackgroundColor:u}):void 0,withEdges:r,withControls:i,value:a,onChange:l,size:f,total:Math.ceil(h/x),getControlProps:I})]})});var Da=require("@mantine/core"),ya=_(require("clsx"));var pa=require("@mantine/core"),fa=_(require("clsx"));var Ta=require("react/jsx-runtime");function ba({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:d,ellipsis:u,textAlign:f,width:p,accessor:T,render:g,defaultRender:h,customCellAttributes:x}){return ne(o)?(0,Ta.jsx)(pa.TableTd,{className:(0,fa.default)({[Re]:d||u,[ke]:u,[J]:l||r,[st]:i,[re]:f==="left",[le]:f==="center",[ie]:f==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onDoubleClick:r,onContextMenu:i,...x?.(n,a),children:g?g(n,a):h?h(n,a,T):it(n,T)}):null}var Se=require("@mantine/core");var Y=require("react/jsx-runtime");function ga({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=wo(e,n?.transitionDuration);return l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Se.TableTr,{}),(0,Y.jsx)(Se.TableTr,{children:(0,Y.jsx)(Se.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,Y.jsx)(Se.Collapse,{in:a,...n,children:(0,Y.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var bt=require("@mantine/core"),ha=_(require("clsx"));var Vt=require("react/jsx-runtime");function Ca({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:r,checkboxProps:i,getCheckboxProps:d,...u}){let f={...i,...d(o,n)},p=!u.disabled&&!f.disabled,T=g=>{g.stopPropagation(),a==="cell"&&p&&l?.(g)};return(0,Vt.jsx)(bt.TableTd,{className:(0,ha.default)("mantine-datatable-row-selector-cell",{[J]:a==="cell"&&p},e),style:t,"data-shadow-visible":r||void 0,onClick:T,children:(0,Vt.jsx)(bt.Checkbox,{classNames:p?{input:J}:void 0,onChange:l,...u,...f})})}var te=require("react/jsx-runtime");function Sa({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:d,isRecordSelectable:u,selectionCheckboxProps:f,getSelectionCheckboxProps:p,onClick:T,onDoubleClick:g,onContextMenu:h,onCellClick:x,onCellDoubleClick:S,onCellContextMenu:w,expansion:v,customAttributes:P,color:k,backgroundColor:W,className:I,style:c,selectorCellShadowVisible:D,selectionColumnClassName:m,selectionColumnStyle:s}){return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(Da.TableTr,{className:(0,ya.default)("mantine-datatable-row",{[J]:T||g||v?.isExpandable({record:e,index:t})&&v?.expandOnClick},{[st]:h},typeof I=="function"?I(e,t):I),"data-selected":i||void 0,onClick:C=>{if(v){let{isExpandable:b,isRowExpanded:N,expandOnClick:z,expandRow:X,collapseRow:K}=v;b({record:e,index:t})&&z&&(N(e)?K(e):X(e))}T?.({event:C,record:e,index:t})},onDoubleClick:g?C=>g({event:C,record:e,index:t}):void 0,onContextMenu:h?C=>h({event:C,record:e,index:t}):void 0,style:[k||W?C=>{let b=k?.(e,t),N=W?.(e,t);return la({theme:C,color:b,backgroundColor:N})}:void 0,c?.(e,t)],...P?.(e,t),children:[r&&(0,te.jsx)(Ca,{className:m,style:s,record:e,index:t,trigger:l,withRightShadow:D,checked:i,disabled:!d||(u?!u(e,t):!1),onChange:d,checkboxProps:f,getCheckboxProps:p}),o.map(({hidden:C,...b},N)=>{if(C)return null;let{accessor:z,visibleMediaQuery:X,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,cellsClassName:me,cellsStyle:We,customCellAttributes:Ae}={...n,...b};return(0,te.jsx)(ba,{className:typeof me=="function"?me(e,t):me,style:We?.(e,t),visibleMediaQuery:X,record:e,index:t,onClick:x?j=>x({event:j,record:e,index:t,column:b,columnIndex:N}):void 0,onDoubleClick:S?j=>S({event:j,record:e,index:t,column:b,columnIndex:N}):void 0,onContextMenu:w?j=>w({event:j,record:e,index:t,column:b,columnIndex:N}):void 0,accessor:z,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,defaultRender:a,customCellAttributes:Ae},z)})]}),v&&(0,te.jsx)(ga,{colSpan:o.filter(({hidden:C})=>!C).length+(r?1:0),open:v.isRowExpanded(e),content:v.content({record:e,index:t}),collapseProps:v.collapseProps})]})}var ce=require("@mantine/core"),Je=_(require("clsx")),we=require("react/jsx-runtime");function wa({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:d,children:u,viewportRef:f,scrollAreaProps:p}){return(0,we.jsxs)(ce.ScrollArea,{...p,viewportRef:f,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:d,children:[u,(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,ce.rem)(r):0}}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var V=require("react/jsx-runtime");function Pa({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:l,shadow:r,verticalAlign:i="center",fetching:d,columns:u,storeColumnsKey:f,groups:p,pinFirstColumn:T,pinLastColumn:g,defaultColumnProps:h,defaultColumnRender:x,idAccessor:S="id",records:w,selectionTrigger:v="checkbox",selectedRecords:P,onSelectedRecordsChange:k,selectionColumnClassName:W,selectionColumnStyle:I,isRecordSelectable:c,selectionCheckboxProps:D,allRecordsSelectionCheckboxProps:m={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:s=(B,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:C,sortIcons:b,onSortStatusChange:N,horizontalSpacing:z,page:X,onPageChange:K,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me="Records per page",paginationWithEdges:We,paginationWithControls:Ae,paginationActiveTextColor:j,paginationActiveBackgroundColor:gt,paginationSize:ht="sm",paginationText:Ct=({from:B,to:pe,totalRecords:fe})=>`${B} - ${pe} / ${fe}`,paginationWrapBreakpoint:Dt="sm",getPaginationControlProps:va=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:xa,customLoader:Ma,loaderSize:Ra,loaderType:ka,loaderColor:Ea,loadingText:Na="...",emptyState:La,noRecordsText:Ft="No records",noRecordsIcon:Ia,highlightOnHover:Ha,striped:Oa,noHeader:Wa,onRowClick:Aa,onRowDoubleClick:za,onRowContextMenu:Va,onCellClick:_a,onCellDoubleClick:Fa,onCellContextMenu:Ba,onScroll:Bt,onScrollToTop:Gt,onScrollToBottom:Xt,onScrollToLeft:Qt,onScrollToRight:Ut,c:Ga,backgroundColor:Xa,borderColor:Qa,rowBorderColor:Ua,stripedColor:$a,highlightOnHoverColor:Ka,rowColor:Ja,rowBackgroundColor:Za,rowExpansion:Ya,rowClassName:qa,rowStyle:ja,customRowAttributes:en,scrollViewportRef:tn,scrollAreaProps:on,tableRef:an,bodyRef:nn,m:rn,my:ln,mx:sn,mt:dn,mb:cn,ml:un,mr:mn,className:pn,classNames:ze,style:fn,styles:Ve,...$t}){let{ref:B,width:pe,height:fe}=ge(),_e=(0,G.useMemo)(()=>p?.flatMap(y=>y.columns)??u,[u,p]),Kt=Nt({key:f,columns:_e}),{ref:bn,height:yt}=ge(),{ref:Tn,width:St,height:Fe}=ge(),{ref:gn,height:hn}=ge(),{ref:Cn,height:Jt}=ge(),{ref:Dn,width:yn}=ge(),Sn=(0,Ze.useMergedRef)(Tn,an),wn=(0,Ze.useMergedRef)(B,tn),[wt,Zt]=(0,G.useState)(!0),[Pt,Yt]=(0,G.useState)(!0),[Be,qt]=(0,G.useState)(!0),[Ye,jt]=(0,G.useState)(!0),Pn=So({rowExpansion:Ya,records:w,idAccessor:S}),vt=(0,G.useCallback)(()=>{let y=B.current?.scrollTop||0,oe=B.current?.scrollLeft||0;if(d||Fe<=fe)Zt(!0),Yt(!0);else{let Q=y===0,U=Fe-y-fe<1;Zt(Q),Yt(U),Q&&Q!==wt&&Gt?.(),U&&U!==Pt&&Xt?.()}if(d||St===pe)qt(!0),jt(!0);else{let Q=oe===0,U=St-oe-pe<1;qt(Q),jt(U),Q&&Q!==Be&&Qt?.(),U&&U!==Ye&&Ut?.()}},[d,Xt,Qt,Ut,Gt,fe,B,pe,Pt,Be,Ye,wt,Fe,St]);fo(vt,[vt]);let eo=(0,Ze.useDebouncedCallback)(vt,50),vn=(0,G.useCallback)(y=>{Bt?.(y),eo()},[eo,Bt]),xn=(0,G.useCallback)(y=>{B.current?.scrollTo({top:0,left:0}),K(y)},[K,B]),qe=w?.length,to=w?.map(y=>L(y,S)),Pe=!!P,Ge=P?.map(y=>L(y,S)),oo=to!==void 0&&Ge!==void 0&&Ge.length>0,xt=c?w?.filter(c):w,je=xt?.map(y=>L(y,S)),et=oo&&je.every(y=>Ge.includes(y)),Mn=oo&&je.some(y=>Ge.includes(y)),Rn=(0,G.useCallback)(()=>{P&&k&&k(et?P.filter(y=>!je.includes(L(y,S))):Xe([...P,...xt],y=>L(y,S)))},[et,S,k,je,xt,P]),{lastSelectionChangeIndex:tt,setLastSelectionChangeIndex:kn}=bo(to),Mt=Pe&&!Be&&!T;return(0,V.jsx)(kt,{...Kt,children:(0,V.jsxs)(Tt.Box,{...{m:rn,my:ln,mx:sn,mt:dn,mb:cn,ml:un,mr:mn},className:(0,_t.default)("mantine-datatable",{"mantine-datatable-with-border":e},pn,ze?.root),style:[y=>({...ra({theme:y,c:Ga,backgroundColor:Xa,borderColor:Qa,rowBorderColor:Ua,stripedColor:$a,highlightOnHoverColor:Ka}),borderRadius:y.radius[t]||t,boxShadow:y.shadows[r]||r,height:n,minHeight:a,maxHeight:l}),fn,Ve?.root],children:[(0,V.jsx)(wa,{viewportRef:wn,topShadowVisible:!wt,leftShadowVisible:!Be,leftShadowBehind:Pe||!!T,rightShadowVisible:!Ye,rightShadowBehind:g,bottomShadowVisible:!Pt,headerHeight:yt,footerHeight:hn,onScrollPositionChange:vn,scrollAreaProps:on,children:(0,V.jsxs)(Tt.Table,{ref:Sn,horizontalSpacing:z,className:(0,_t.default)("mantine-datatable-table",{[Po]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":$t.withRowBorders&&Fe<fe,"mantine-datatable-pin-last-column":g,"mantine-datatable-pin-last-column-scrolled":!Ye&&g,"mantine-datatable-selection-column-visible":Pe,"mantine-datatable-pin-first-column":T,"mantine-datatable-pin-first-column-scrolled":!Be&&T},ze?.table),style:{...Ve?.table,"--mantine-datatable-selection-column-width":`${yn}px`},"data-striped":qe&&Oa||void 0,"data-highlight-on-hover":Ha||void 0,...$t,children:[Wa?null:(0,V.jsx)(kt,{...Kt,children:(0,V.jsx)(ta,{ref:bn,selectionColumnHeaderRef:Dn,className:ze?.header,style:Ve?.header,columns:_e,defaultColumnProps:h,groups:p,sortStatus:C,sortIcons:b,onSortStatusChange:N,selectionTrigger:v,selectionVisible:Pe,selectionChecked:et,selectionIndeterminate:Mn&&!et,onSelectionChange:Rn,selectionCheckboxProps:{...D,...m},selectorCellShadowVisible:Mt,selectionColumnClassName:W,selectionColumnStyle:I})}),(0,V.jsx)("tbody",{ref:nn,children:qe?w.map((y,oe)=>{let Q=L(y,S),U=Ge?.includes(Q)||!1,ao;return k&&P&&(ao=En=>{if(En.nativeEvent.shiftKey&&tt!==null){let ve=w.filter(oe>tt?(be,Te)=>Te>=tt&&Te<=oe&&(c?c(be,Te):!0):(be,Te)=>Te>=oe&&Te<=tt&&(c?c(be,Te):!0));k(U?It(P,ve,be=>L(be,S)):Xe([...P,...ve],be=>L(be,S)))}else k(U?P.filter(ve=>L(ve,S)!==Q):Xe([...P,y],ve=>L(ve,S)));kn(oe)}),(0,V.jsx)(Sa,{record:y,index:oe,columns:_e,defaultColumnProps:h,defaultColumnRender:x,selectionTrigger:v,selectionVisible:Pe,selectionChecked:U,onSelectionChange:ao,isRecordSelectable:c,selectionCheckboxProps:D,getSelectionCheckboxProps:s,onClick:Aa,onDoubleClick:za,onCellClick:_a,onCellDoubleClick:Fa,onContextMenu:Va,onCellContextMenu:Ba,expansion:Pn,color:Ja,backgroundColor:Za,className:qa,style:ja,customAttributes:en,selectorCellShadowVisible:Mt,selectionColumnClassName:W,selectionColumnStyle:I},Q)}):(0,V.jsx)(so,{})}),_e.some(({footer:y})=>y)&&(0,V.jsx)(Ho,{ref:gn,className:ze?.footer,style:Ve?.footer,columns:_e,defaultColumnProps:h,selectionVisible:Pe,selectorCellShadowVisible:Mt,scrollDiff:Fe-fe})]})}),X&&(0,V.jsx)(ma,{ref:Cn,className:ze?.pagination,style:Ve?.pagination,horizontalSpacing:z,fetching:d,page:X,onPageChange:xn,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me,paginationWithEdges:We,paginationWithControls:Ae,paginationActiveTextColor:j,paginationActiveBackgroundColor:gt,paginationSize:ht,paginationText:Ct,paginationWrapBreakpoint:Dt,getPaginationControlProps:va,noRecordsText:Ft,loadingText:Na,recordsLength:qe}),(0,V.jsx)(aa,{pt:yt,pb:Jt,fetching:d,backgroundBlur:xa,customContent:Ma,size:Ra,type:ka,color:Ea}),(0,V.jsx)(uo,{pt:yt,pb:Jt,icon:Ia,text:Ft,active:!d&&!qe,children:La})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "mantine-datatable", | ||
"version": "7.11.0", | ||
"version": "7.11.1", | ||
"description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -143,3 +143,3 @@ # Mantine DataTable | ||
See the [contributing guide in the documentation website](https://icflorescu.github.io/mantine-datatable/contribute-and-support) or the repo [CONTRIBUTING.md](https://github.com/icflorescu/mantine-datatable/blob/master/CONTRIBUTING.md) file for details. | ||
See the [contributing guide in the documentation website](https://icflorescu.github.io/mantine-datatable/contribute-and-support) or the repo [CONTRIBUTING.md](https://github.com/icflorescu/mantine-datatable/blob/master/CONTRIBUTING.md) file for details. **Most importantly, remember to make your PRs against the `next` branch.** | ||
@@ -146,0 +146,0 @@ Here's the list of people who have already contributed to Mantine DataTable: |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
537761
2743