mantine-datatable 6.0.4 → 6.0.6
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/dist/DataTable.d.ts +1 -1
- package/dist/DataTable.d.ts.map +1 -1
- package/dist/DataTableDragToggleColumns.context.d.ts +21 -0
- package/dist/DataTableDragToggleColumns.context.d.ts.map +1 -0
- package/dist/DataTableDragToggleColumnsProvider.d.ts +16 -0
- package/dist/DataTableDragToggleColumnsProvider.d.ts.map +1 -0
- package/dist/DataTableHeader.d.ts.map +1 -1
- package/dist/DataTableHeaderCell.d.ts +3 -3
- package/dist/DataTableHeaderCell.d.ts.map +1 -1
- package/dist/DataTableResizableHeaderHandle.d.ts +8 -0
- package/dist/DataTableResizableHeaderHandle.d.ts.map +1 -0
- package/dist/hooks.d.ts +25 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/dist/types/DataTableColumn.d.ts +17 -1
- package/dist/types/DataTableColumn.d.ts.map +1 -1
- package/dist/types/DataTableProps.d.ts +9 -0
- package/dist/types/DataTableProps.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ga=Object.create;var Ee=Object.defineProperty;var Ca=Object.getOwnPropertyDescriptor;var Sa=Object.getOwnPropertyNames;var ha=Object.getPrototypeOf,ba=Object.prototype.hasOwnProperty;var Ba=(o,e)=>()=>(o&&(e=o(o=0)),e);var Qo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Da=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Sa(e))!ba.call(o,f)&&f!==r&&Ee(o,f,{get:()=>e[f],enumerable:!(t=Ca(e,f))||t.enumerable});return o};var ya=(o,e,r)=>(r=o!=null?ga(ha(o)):{},Da(e||!o||!o.__esModule?Ee(r,"default",{value:o,enumerable:!0}):r,o));import*as d from"react";var a=Ba(()=>{"use strict"});var Ue=Qo((Ef,We)=>{"use strict";a();var Fa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";We.exports=Fa});var Xe=Qo((Wf,Ve)=>{"use strict";a();var wa=Ue();function ze(){}function Ge(){}Ge.resetWarningCache=ze;Ve.exports=function(){function o(t,f,l,n,s,u){if(u!==wa){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Ge,resetWarningCache:ze};return r.PropTypes=r,r}});var Ke=Qo((Vf,Qe)=>{a();Qe.exports=Xe()();var zf,Gf});a();a();import{Box as yf,Portal as Pf,Table as Tf,createStyles as Ff,packSx as wf}from"@mantine/core";import{useMergedRef as Mf}from"@mantine/hooks";import{useCallback as De,useMemo as kf,useState as vo}from"react";a();import{createStyles as Pa}from"@mantine/core";import{jsx as qe}from"react/jsx-runtime";var Ta=Pa({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Ko(){let{classes:o}=Ta();return qe("tr",{className:o.root,children:qe("td",{})})}a();import{Center as La,createStyles as Ha,Text as Na}from"@mantine/core";a();a();var E=ya(Ke());import{forwardRef as Ma,createElement as $e}from"react";a();var Ze={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ka=Object.defineProperty,Ra=Object.defineProperties,va=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ye=(o,e,r)=>e in o?ka(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,_e=(o,e)=>{for(var r in e||(e={}))je.call(e,r)&&Ye(o,r,e[r]);if(Po)for(var r of Po(e))Je.call(e,r)&&Ye(o,r,e[r]);return o},Oa=(o,e)=>Ra(o,va(e)),Aa=(o,e)=>{var r={};for(var t in o)je.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Po)for(var t of Po(o))e.indexOf(t)<0&&Je.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=Ma((f,l)=>{var n=f,{color:s="currentColor",size:u=24,stroke:m=2,children:p}=n,C=Aa(n,["color","size","stroke","children"]);return $e("svg",_e(Oa(_e({ref:l},Ze),{width:u,height:u,stroke:s,strokeWidth:m,className:`tabler-icon tabler-icon-${o}`}),C),[...r.map(([c,I])=>$e(c,I)),...p||[]])});return t.propTypes={color:E.default.string,size:E.default.oneOfType([E.default.string,E.default.number]),stroke:E.default.oneOfType([E.default.string,E.default.number])},t.displayName=`${e}`,t};a();var Zo=q("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var $o=q("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var Yo=q("database-off","IconDatabaseOff",[["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",key:"svg-0"}],["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",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);a();var _o=q("filter","IconFilter",[["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",key:"svg-0"}]]);import{Fragment as qa,jsx as To,jsxs as Wa}from"react/jsx-runtime";var Ea=Ha(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function jo({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:s}=Ea();return To(La,{pt:r,pb:t,className:s(n.root,{[n.active]:f}),children:l||Wa(qa,{children:[o||To("div",{className:n.standardIcon,children:To(Yo,{})}),To(Na,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as at,createStyles as tt}from"@mantine/core";import{forwardRef as ft}from"react";a();import{Box as $a,createStyles as Ya}from"@mantine/core";a();import{useMantineTheme as rr}from"@mantine/core";import{useMediaQuery as Qa}from"@mantine/hooks";import{useEffect as Ka,useLayoutEffect as Za,useMemo as er}from"react";a();import{useEffect as Ua,useRef as za,useState as Ga}from"react";function Va(o,e){let r=()=>{e(o.map(f=>f.matches))},t=o.map(f=>{try{return f.addEventListener("change",r),()=>f.removeEventListener("change",r)}catch{return f.addListener(r),()=>f.removeListener(r)}});return()=>{t.forEach(f=>f())}}function Xa(o,e){return e||(typeof window<"u"&&"matchMedia"in window?o.map(r=>window.matchMedia(r).matches):o.map(()=>!1))}function or(o,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[t,f]=Ga(r?e:Xa(o,e)),l=za();return Ua(()=>{if("matchMedia"in window)return l.current=o.map(n=>window.matchMedia(n)),f(l.current.map(n=>n.matches)),Va(l.current,n=>{f(n)})},[o]),t}var ar=typeof window<"u"?Za:Ka;function _(o){let e=rr(),r=typeof o=="function"?o(e):o;return Qa(r||"",!0)}function tr(o){let e=rr(),r=er(()=>o.map(f=>(typeof f=="function"?f(e):f)??""),[o,e]),t=er(()=>o.map(()=>!0),[o]);return or(r,t)}function K(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Jo(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function uo(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function Fo(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}function y(o,e){return typeof e=="string"?Fo(o,e):e(o)}import{jsx as ja}from"react/jsx-runtime";var _a=Ya({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function oe({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:s,width:u}){let{cx:m,classes:p}=_a();return _(t)?ja($a,{component:"th",className:m({[p.noWrap]:l||n,[p.ellipsis]:n},o),sx:[{"&&":{textAlign:s},width:u,minWidth:u,maxWidth:u},e],style:r,children:f}):null}a();import{createStyles as Ja,px as ot}from"@mantine/core";import{jsx as rt}from"react/jsx-runtime";var et=Ja(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-ot(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}}}});function ee({shadowVisible:o}){let{cx:e,classes:r}=et();return rt("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as re,jsxs as nt}from"react/jsx-runtime";var lt=tt((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),fr=ft(function({className:e,style:r,borderColor:t,columns:f,defaultColumnProps:l,selectionVisible:n,leftShadowVisible:s,scrollDiff:u},m){let{cx:p,classes:C}=lt({scrollDiff:u,borderColor:t});return re(at,{component:"tfoot",ref:m,className:p(C.root,e),style:r,children:nt("tr",{children:[n&&re(ee,{shadowVisible:s}),f.map(({hidden:c,...I})=>{if(c)return null;let{accessor:P,visibleMediaQuery:i,textAlignment:S,width:g,footer:D,footerClassName:h,footerStyle:H,footerSx:R,noWrap:T,ellipsis:w}={...l,...I};return re(oe,{className:h,style:H,sx:R,visibleMediaQuery:i,textAlignment:S,width:g,title:D,noWrap:T,ellipsis:w},P)})]})})});a();import{createStyles as Bt}from"@mantine/core";import{forwardRef as Dt}from"react";a();import{Box as st}from"@mantine/core";import{useMemo as lr}from"react";import{jsx as dt}from"react/jsx-runtime";function ae({group:{id:o,columns:e,title:r,className:t,style:f,sx:l}}){let n=lr(()=>e.map(({visibleMediaQuery:m})=>m),[e]),s=tr(n),u=lr(()=>e.filter(({hidden:m},p)=>!m&&s?.[p]).length,[e,s]);return u>0?dt(st,{component:"th",colSpan:u,className:t,sx:l,style:f,children:r??K(o)}):null}a();import{Box as nr,Center as sr,Group as mt,createStyles as xt}from"@mantine/core";a();import{ActionIcon as ct,Popover as te}from"@mantine/core";import{useDisclosure as ut}from"@mantine/hooks";import{jsx as wo,jsxs as pt}from"react/jsx-runtime";function fe({children:o,isActive:e}){let[r,{close:t,toggle:f}]=ut(!1);return pt(te,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[wo(te.Target,{children:wo(ct,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:wo(_o,{size:14})})}),wo(te.Dropdown,{onClick:l=>l.preventDefault(),children:typeof o=="function"?o({close:t}):o})]})}import{Fragment as it,jsx as W,jsxs as gt}from"react/jsx-runtime";var It=xt(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button:hover))":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function le({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:s,textAlignment:u,width:m,sortStatus:p,onSortStatusChange:C,filter:c,filtering:I}){let{cx:P,classes:i}=It();if(!_(f))return null;let S=l??K(t),g=typeof S=="string"?S:void 0,D=n&&C?h=>{h?.defaultPrevented||C({columnAccessor:t,direction:p?.columnAccessor===t?p.direction==="asc"?"desc":"asc":p?.direction??"asc"})}:void 0;return W(nr,{component:"th",className:P({[i.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:u},width:m,minWidth:m,maxWidth:m},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:D,onKeyDown:h=>h.key==="Enter"&&D?.(),children:gt(mt,{className:i.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[W(nr,{className:P(i.columnHeaderText,i.sortableColumnHeaderText),title:g,children:S}),n||p?.columnAccessor===t?W(it,{children:p?.columnAccessor===t?W(sr,{className:P(i.sortableColumnHeaderIcon,{[i.sortableColumnHeaderIconRotated]:p.direction==="desc"}),role:"img","aria-label":`Sorted ${p.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||W(Zo,{size:14})}):W(sr,{className:i.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:s?.unsorted||W($o,{size:14})})}):null,c?W(fe,{isActive:!!I,children:c}):null]})})}a();import{Checkbox as Ct,createStyles as St,px as ht}from"@mantine/core";import{jsx as dr}from"react/jsx-runtime";var bt=St(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-ht(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function ne({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f,rowSpan:l}){let{cx:n,classes:s}=bt();return dr("th",{className:n(s.root,{[s.shadowVisible]:o}),rowSpan:l,children:dr(Ct,{classNames:{input:s.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as se,jsxs as de}from"react/jsx-runtime";var yt=Bt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),cr=Dt(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,defaultColumnProps:s,groups:u,selectionVisible:m,selectionChecked:p,selectionIndeterminate:C,onSelectionChange:c,selectionCheckboxProps:I,leftShadowVisible:P},i){let{classes:S,cx:g}=yt(),D=m?se(ne,{shadowVisible:P,checked:p,indeterminate:C,checkboxProps:I,onChange:c,rowSpan:u?2:void 0}):null;return de("thead",{className:g(S.root,e),style:r,ref:i,children:[u&&de("tr",{children:[D,u.map(h=>se(ae,{group:h},h.id))]}),de("tr",{children:[!u&&D,n.map(({hidden:h,...H})=>{if(h)return null;let{accessor:R,visibleMediaQuery:T,textAlignment:w,width:O,title:v,sortable:A,titleClassName:Z,titleStyle:J,titleSx:oo,filter:eo,filtering:ro}={...s,...H};return se(le,{accessor:R,className:Z,style:J,sx:oo,visibleMediaQuery:T,textAlignment:w,width:O,title:v,sortable:A,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:eo,filtering:ro},R)})]})]})});a();import{Center as Pt,createStyles as Tt,Loader as Ft}from"@mantine/core";import{jsx as ur}from"react/jsx-runtime";var wt=Tt(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function ce({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:s}){let{classes:u,cx:m}=wt();return ur(Pt,{pt:o,pb:e,className:m(u.root,{[u.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||ur(Ft,{size:l,variant:n,color:s}))})}a();import{Box as Rt,Pagination as vt,Text as Ot,createStyles as At}from"@mantine/core";import{forwardRef as Lt}from"react";a();import{Button as Mt,Group as kt,Menu as Mo,Text as pr}from"@mantine/core";import{jsx as j,jsxs as xr}from"react/jsx-runtime";var mr={xs:22,sm:26,md:32,lg:38,xl:44};function ue({size:o,label:e,values:r,value:t,onChange:f,color:l}){return xr(kt,{spacing:"xs",children:[j(pr,{size:o,children:e}),xr(Mo,{withinPortal:!0,withArrow:!0,children:[j(Mo.Target,{children:j(Mt,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:mr[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),j(Mo.Dropdown,{children:r.map(n=>{let s=n===t;return j(Mo.Item,{sx:[{height:mr[o]},u=>({"&&":{color:s?u.white:void 0},background:s?u.colors[l||u.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(n),children:j(pr,{size:o,children:n})},n)})})]})]})}import{jsx as pe,jsxs as Nt}from"react/jsx-runtime";var Ht=At((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),Ir=Lt(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:s,paginationSize:u,loadingText:m,noRecordsText:p,paginationText:C,totalRecords:c,recordsPerPage:I,onRecordsPerPageChange:P,recordsPerPageLabel:i,recordsPerPageOptions:S,recordsLength:g,horizontalSpacing:D,paginationWrapBreakpoint:h,getPaginationControlProps:H},R){let T;if(f)T=m;else if(!c)T=p;else{let v=(l-1)*I+1,A=v+g-1;T=C({from:v,to:A,totalRecords:c})}let{classes:w,cx:O}=Ht({topBorderColor:t,paginationWrapBreakpoint:h});return Nt(Rt,{ref:R,px:D??"xs",py:"xs",className:O(w.root,e),style:r,children:[pe(Ot,{className:w.text,size:u,children:T}),S&&pe(ue,{size:u,label:i,values:S,color:s,value:I,onChange:P}),pe(vt,{color:s,className:O(w.pagination,{[w.paginationFetching]:f||!g}),value:l,onChange:n,size:u,total:Math.ceil(c/I),getControlProps:H})]})});a();import{Box as jt,createStyles as Jt}from"@mantine/core";a();import{Box as Et,createStyles as qt}from"@mantine/core";import{jsx as Ut}from"react/jsx-runtime";var Wt=qt({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function me({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:s,ellipsis:u,textAlignment:m,width:p,accessor:C,render:c,defaultRender:I,customCellAttributes:P}){let{cx:i,classes:S}=Wt();return _(t)?Ut(Et,{component:"td",className:i({[S.noWrap]:s||u,[S.ellipsis]:u,[S.withPointerCursor]:n},o),sx:[{width:p,minWidth:p,maxWidth:p,textAlign:m},e],style:r,onClick:n,...P?.(f,l),children:c?c(f,l):I?I(f,l,C):Fo(f,C)}):null}a();import{Collapse as Gt,createStyles as Vt}from"@mantine/core";a();import{useResizeObserver as zt,useTimeout as ir}from"@mantine/hooks";import{useEffect as xe,useState as po}from"react";function gr(o){let[e,r]=po(null),t=o?.join(":")||"";return xe(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Cr(o){let[e,r]=po(null);return xe(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function Sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:u,initiallyExpanded:m}=o;e&&s==="always"?t=e.map(p=>y(p,r)):m&&(t=e.filter(m).map(p=>y(p,r)),u||(t=[t[0]]))}let f,l,n=po(t);if(o){let{trigger:s,allowMultiple:u,collapseProps:m,content:p}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let C=c=>l?.(f.filter(I=>I!==y(c,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:c=>s==="always"?!0:f.includes(y(c,r)),expandRow:c=>{let I=y(c,r);l?.(u?[...f,I]:[I])},collapseRow:C,collapseProps:m,content:(c,I)=>()=>p({record:c,recordIndex:I,collapse:()=>C(c)})}}}function hr(o,e){let[r,t]=po(o),[f,l]=po(o),n=ir(()=>t(!0),0),s=ir(()=>l(!1),e||200);return xe(()=>{o?(s.clear(),l(!0),n.start()):(n.clear(),t(!1),s.start())},[n,s,o]),{expanded:r,visible:f}}function U(){let[o]=zt(),{width:e,height:r}=o.current?.getBoundingClientRect()||{width:0,height:0};return{ref:o,width:e,height:r}}import{Fragment as Qt,jsx as ko,jsxs as Kt}from"react/jsx-runtime";var Xt=Vt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function Ie({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=hr(o,t?.transitionDuration),{cx:n,classes:s}=Xt();return l?Kt(Qt,{children:[ko("tr",{}),ko("tr",{children:ko("td",{className:n(s.cell,{[s.expandedCell]:f}),colSpan:e,children:ko(Gt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as Zt,createStyles as $t,px as Yt}from"@mantine/core";import{jsx as br}from"react/jsx-runtime";var _t=$t(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Yt(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function ie({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=_t();return br("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:br(Zt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as ef,jsx as ge,jsxs as Br}from"react/jsx-runtime";var of=Jt(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function Ce({record:o,recordIndex:e,columns:r,defaultColumnProps:t,defaultColumnRender:f,selectionVisible:l,selectionChecked:n,onSelectionChange:s,isRecordSelectable:u,getSelectionCheckboxProps:m,onClick:p,onCellClick:C,onContextMenu:c,expansion:I,customAttributes:P,className:i,style:S,sx:g,contextMenuVisible:D,leftShadowVisible:h}){let{cx:H,classes:R}=of();return Br(ef,{children:[Br(jt,{component:"tr",className:H({[R.withPointerCursor]:p||I?.expandOnClick,[R.selected]:n,[R.contextMenuVisible]:D},typeof i=="function"?i(o,e):i),onClick:T=>{if(I){let{isRowExpanded:w,expandOnClick:O,expandRow:v,collapseRow:A}=I;O&&(w(o)?A(o):v(o))}p?.(T)},style:typeof S=="function"?S(o,e):S,sx:g,...P?.(o,e),onContextMenu:c,children:[l&&ge(ie,{record:o,recordIndex:e,withRightShadow:h,checked:n,disabled:!s||(u?!u(o,e):!1),onChange:s,getCheckboxProps:m}),r.map(({hidden:T,...w},O)=>{if(T)return null;let{accessor:v,visibleMediaQuery:A,textAlignment:Z,noWrap:J,ellipsis:oo,width:eo,render:ro,cellsClassName:ao,cellsStyle:to,cellsSx:Oo,customCellAttributes:Ao}={...t,...w},mo;return C&&(mo=Lo=>C({event:Lo,record:o,recordIndex:e,column:w,columnIndex:O})),ge(me,{className:typeof ao=="function"?ao(o,e):ao,style:typeof to=="function"?to(o,e):to,sx:Oo,visibleMediaQuery:A,record:o,recordIndex:e,onClick:mo,accessor:v,textAlignment:Z,noWrap:J,ellipsis:oo,width:eo,render:ro,defaultRender:f,customCellAttributes:Ao},v)})]}),I&&ge(Ie,{colSpan:r.filter(({hidden:T})=>!T).length+(l?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{Paper as rf,createStyles as af,px as tf}from"@mantine/core";import{useClickOutside as ff,useMergedRef as lf,useWindowEvent as Dr}from"@mantine/hooks";import{jsx as sf}from"react/jsx-runtime";var nf=af(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Se({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){Dr("resize",l),Dr("scroll",l);let s=ff(l),{ref:u,width:m,height:p}=U(),C=lf(s,u),{innerWidth:c,innerHeight:I}=window,{classes:P,theme:{dir:i,spacing:S}}=nf(),g=tf(S.md);return sf(rf,{ref:C,shadow:e,radius:o,className:P.root,sx:{zIndex:r,top:t+p+g>I?I-p-g:t,left:i==="ltr"?f+m+g>c?c-m-g:f:c-g-(f-m-g<0?m+g:f)},children:n})}a();import{createStyles as df}from"@mantine/core";import{jsx as uf}from"react/jsx-runtime";var cf=df(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function he(){let{classes:o}=cf();return uf("div",{className:o.root})}a();import{Box as pf,Text as mf,UnstyledButton as xf,createStyles as If,px as gf}from"@mantine/core";import{jsx as yr,jsxs as Sf}from"react/jsx-runtime";var Cf=If((o,{color:e})=>{let r=gf(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function be({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=Cf({color:r});return Sf(xf,{className:l.root,disabled:t,onClick:f,children:[o&&yr(pf,{className:l.icon,children:o}),yr(mf,{className:l.title,size:"sm",children:e})]})}a();import{Box as Pr,createStyles as hf,ScrollArea as bf}from"@mantine/core";import{jsx as Ro,jsxs as Df}from"react/jsx-runtime";var Bf=hf(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function Be({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:s,viewportRef:u,scrollAreaProps:m}){let p=l?l-1:0,{cx:C,classes:c}=Bf();return Df(bf,{...m,viewportRef:u,classNames:{root:c.root,scrollbar:c.scrollbar,thumb:c.thumb,corner:c.corner},styles:{scrollbar:{marginTop:f,marginBottom:p}},onScrollPositionChange:n,children:[s,Ro(Pr,{className:C(c.shadow,c.topShadow,{[c.shadowVisible]:o}),sx:{top:f}}),Ro("div",{className:C(c.shadow,c.leftShadow,{[c.shadowVisible]:e})}),Ro("div",{className:C(c.shadow,c.rightShadow,{[c.shadowVisible]:r})}),Ro(Pr,{className:C(c.shadow,c.bottomShadow,{[c.shadowVisible]:t}),sx:{bottom:p}})]})}import{jsx as k,jsxs as Fr}from"react/jsx-runtime";var Tr={},Rf=Ff((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},tableWithColumnBordersAndSelectableRecords:{thead:{"tr + tr":{th:{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function wr({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:l,height:n="100%",minHeight:s,shadow:u,verticalAlignment:m="center",fetching:p,columns:C,groups:c,defaultColumnProps:I,defaultColumnRender:P,idAccessor:i="id",records:S,selectedRecords:g,onSelectedRecordsChange:D,isRecordSelectable:h,allRecordsSelectionCheckboxProps:H={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:R=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:T,sortIcons:w,onSortStatusChange:O,horizontalSpacing:v,page:A,onPageChange:Z,totalRecords:J,recordsPerPage:oo,onRecordsPerPageChange:eo,recordsPerPageOptions:ro,recordsPerPageLabel:ao="Records per page",paginationColor:to,paginationSize:Oo="sm",paginationText:Ao=({from:B,to:z,totalRecords:G})=>`${B} - ${z} / ${G}`,paginationWrapBreakpoint:mo="sm",getPaginationControlProps:Lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Mr,customLoader:kr,loaderSize:Rr,loaderVariant:vr,loaderColor:Or,loadingText:Ar="...",emptyState:Lr,noRecordsText:ye="No records",noRecordsIcon:Hr,striped:Nr,noHeader:Er,onRowClick:Ho,onCellClick:qr,onScrollToTop:Pe,onScrollToBottom:Te,onScrollToLeft:Fe,onScrollToRight:we,rowContextMenu:L,rowExpansion:Wr,rowClassName:Ur,rowStyle:zr,rowSx:Gr,customRowAttributes:Vr,scrollViewportRef:Xr,scrollAreaProps:Qr,bodyRef:Kr,m:Zr,my:$r,mx:Yr,mt:_r,mb:jr,ml:Jr,mr:oa,sx:ea,className:ra,classNames:xo,style:aa,styles:No,...ta}){let{ref:B,width:z,height:G}=U(),Io=kf(()=>c?.flatMap(x=>x.columns)??C,[C,c]),{ref:fa,height:Eo}=U(),{ref:la,width:qo,height:fo}=U(),{ref:na,height:sa}=U(),{ref:da,height:Me}=U(),[Wo,ke]=vo(!0),[Uo,Re]=vo(!0),[io,ve]=vo(!0),[zo,Oe]=vo(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:$}=Cr(p),ca=Sr({rowExpansion:Wr,records:S,idAccessor:i}),Go=De(()=>{if(!p&&L&&$(null),p||fo<=G)ke(!0),Re(!0);else{let x=B.current.scrollTop,b=x===0,M=fo-x-G<1;ke(b),Re(M),b&&b!==Wo&&Pe?.(),M&&M!==Uo&&Te?.()}if(p||qo===z)ve(!0),Oe(!0);else{let x=B.current.scrollLeft,b=x===0,M=qo-x-z<1;ve(b),Oe(M),b&&b!==io&&Fe?.(),M&&M!==zo&&we?.()}},[p,Te,Fe,we,Pe,L,G,B,z,Uo,io,zo,Wo,$,fo,qo]);ar(Go,[Go]);let ua=De(x=>{B.current.scrollTo({top:0,left:0}),Z(x)},[Z,B]),go=S?.length,Ae=S?.map(x=>y(x,i)),lo=!!g,no=g?.map(x=>y(x,i)),Le=Ae!==void 0&&no!==void 0&&no.length>0,Vo=h?S?.filter(h):S,Co=Vo?.map(x=>y(x,i)),So=Le&&Co.every(x=>no.includes(x)),pa=Le&&Co.some(x=>no.includes(x)),ma=De(()=>{g&&D&&D(So?g.filter(x=>!Co.includes(y(x,i))):uo([...g,...Vo],x=>y(x,i)))},[So,i,D,Co,Vo,g]),{lastSelectionChangeIndex:ho,setLastSelectionChangeIndex:xa}=gr(Ae),Xo=lo&&!io,{cx:He,classes:N,theme:Ia}=Rf({borderColor:r,rowBorderColor:t}),ia={m:Zr,my:$r,mx:Yr,mt:_r,mb:jr,ml:Jr,mr:oa},bo=typeof No=="function"?No(Ia,Tr,Tr):No;return Fr(yf,{...ia,className:He(N.root,{[N.tableWithBorder]:o},ra,xo?.root),sx:[x=>({borderRadius:x.radius[e]||e,boxShadow:x.shadows[u]||u,height:n,minHeight:s}),...wf(ea)],style:{...bo?.root,...aa},children:[k(Be,{viewportRef:Mf(B,Xr||null),topShadowVisible:!Wo,leftShadowVisible:!(g||io),rightShadowVisible:!zo,bottomShadowVisible:!Uo,headerHeight:Eo,footerHeight:sa,onScrollPositionChange:Go,scrollAreaProps:Qr,children:Fr(Tf,{ref:la,horizontalSpacing:v,className:He(N.table,{[N.tableWithColumnBorders]:f,[N.lastRowBorderBottomVisible]:fo<G,[N.textSelectionDisabled]:l,[N.verticalAlignmentTop]:m==="top",[N.verticalAlignmentBottom]:m==="bottom",[N.tableWithColumnBordersAndSelectableRecords]:lo&&f}),striped:go?Nr:!1,...ta,children:[Er?null:k(cr,{ref:fa,className:xo?.header,style:bo?.header,columns:Io,defaultColumnProps:I,groups:c,sortStatus:T,sortIcons:w,onSortStatusChange:O,selectionVisible:lo,selectionChecked:So,selectionIndeterminate:pa&&!So,onSelectionChange:ma,selectionCheckboxProps:H,leftShadowVisible:Xo}),k("tbody",{ref:Kr,children:go?S.map((x,b)=>{let M=y(x,i),so=no?.includes(M)||!1,Bo=!1,Do=!1;if(L){let{hidden:F}=L;(!F||!(typeof F=="function"?F(x,b):F))&&(L.trigger==="click"?Bo=!0:Do=!0)}let yo;D&&g&&(yo=F=>{if(F.nativeEvent.shiftKey&&ho!==null){let Y=S.filter(b>ho?(X,Q)=>Q>=ho&&Q<=b&&(h?h(X,Q):!0):(X,Q)=>Q>=b&&Q<=ho&&(h?h(X,Q):!0));D(so?Jo(g,Y,X=>y(X,i)):uo([...g,...Y],X=>y(X,i)))}else D(so?g.filter(Y=>y(Y,i)!==M):uo([...g,x],Y=>y(Y,i)));xa(b)});let co;Bo?co=F=>{$({y:F.clientY,x:F.clientX,record:x,recordIndex:b}),Ho?.(x,b,F)}:Ho&&(co=F=>{Ho(x,b,F)});let Ne;return Do&&(Ne=F=>{F.preventDefault(),$({y:F.clientY,x:F.clientX,record:x,recordIndex:b})}),k(Ce,{record:x,recordIndex:b,columns:Io,defaultColumnProps:I,defaultColumnRender:P,selectionVisible:lo,selectionChecked:so,onSelectionChange:yo,isRecordSelectable:h,getSelectionCheckboxProps:R,onClick:co,onCellClick:qr,onContextMenu:Ne,contextMenuVisible:V?y(V.record,i)===M:!1,expansion:ca,className:Ur,style:zr,sx:Gr,customAttributes:Vr,leftShadowVisible:Xo},M)}):k(Ko,{})}),Io.some(({footer:x})=>x)&&k(fr,{ref:na,className:xo?.footer,style:bo?.footer,borderColor:r,columns:Io,defaultColumnProps:I,selectionVisible:lo,leftShadowVisible:Xo,scrollDiff:fo-G})]})}),A&&k(Ir,{ref:da,className:xo?.pagination,style:bo?.pagination,topBorderColor:r,horizontalSpacing:v,fetching:p,page:A,onPageChange:ua,totalRecords:J,recordsPerPage:oo,onRecordsPerPageChange:eo,recordsPerPageOptions:ro,recordsPerPageLabel:ao,paginationColor:to,paginationSize:Oo,paginationText:Ao,paginationWrapBreakpoint:mo,getPaginationControlProps:Lo,noRecordsText:ye,loadingText:Ar,recordsLength:go}),k(ce,{pt:Eo,pb:Me,fetching:p,backgroundBlur:Mr,customContent:kr,size:Rr,variant:vr,color:Or}),k(jo,{pt:Eo,pb:Me,icon:Hr,text:ye,active:!p&&!go,children:Lr}),L&&V&&k(Pf,{children:k(Se,{zIndex:L.zIndex,borderRadius:L.borderRadius,shadow:L.shadow,y:V.y,x:V.x,onDestroy:()=>$(null),children:L.items(V.record,V.recordIndex).map(({divider:x,key:b,title:M,icon:so,color:Bo,hidden:Do,disabled:yo,onClick:co})=>x?k(he,{},b):Do?null:k(be,{title:M??K(b),icon:so,color:Bo,disabled:yo,onClick:()=>{$(null),co()}},b))})})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{wr as DataTable,Jo as differenceBy,Fo as getValueAtPath,K as humanize,uo as uniqBy};
|
|
1
|
+
var Ha=Object.create;var Ye=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ea=Object.getOwnPropertyNames;var qa=Object.getPrototypeOf,Wa=Object.prototype.hasOwnProperty;var Ua=(o,e)=>()=>(o&&(e=o(o=0)),e);var jo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var za=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Ea(e))!Wa.call(o,f)&&f!==r&&Ye(o,f,{get:()=>e[f],enumerable:!(t=Na(e,f))||t.enumerable});return o};var Ga=(o,e,r)=>(r=o!=null?Ha(qa(o)):{},za(e||!o||!o.__esModule?Ye(r,"default",{value:o,enumerable:!0}):r,o));import*as c from"react";var a=Ua(()=>{"use strict"});var rr=jo((An,er)=>{"use strict";a();var Ya="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";er.exports=Ya});var nr=jo((Nn,fr)=>{"use strict";a();var _a=rr();function ar(){}function tr(){}tr.resetWarningCache=ar;fr.exports=function(){function o(t,f,n,l,s,u){if(u!==_a){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:tr,resetWarningCache:ar};return r.PropTypes=r,r}});var sr=jo((Un,lr)=>{a();lr.exports=nr()();var qn,Wn});a();a();import{Box as rn,Portal as an,Table as tn,createStyles as fn,getStylesRef as nn,packSx as ln,px as sn}from"@mantine/core";import{useMergedRef as dn}from"@mantine/hooks";import{useCallback as Ae,useMemo as cn,useState as zo}from"react";a();import{useState as je}from"react";a();a();a();import Va,{createContext as Xa,useContext as Qa}from"react";function Jo(o){let e=Xa(null);return[({children:f,value:n})=>Va.createElement(e.Provider,{value:n},f),()=>{let f=Qa(e);if(f===null)throw new Error(o);return f}]}var[_e,Ro]=Jo("useDataTableDragToggleColumnsContext must be used within DataTableDragToggleColumnOrdersProvider");import{jsx as Ka}from"react/jsx-runtime";var Je=o=>{let{children:e,columnsOrder:r,setColumnsOrder:t,columnsToggle:f,setColumnsToggle:n,resetColumnsOrder:l,resetColumnsToggle:s,setColumnWidth:u,resetColumnsWidth:m}=o,[p,S]=je(""),[d,x]=je("");return Ka(_e,{value:{sourceColumn:p,setSourceColumn:S,targetColumn:d,setTargetColumn:x,columnsToggle:f,setColumnsToggle:n,swapColumns:()=>{if(!r||!t||!p||!d)return;let b=r.indexOf(p),I=r.indexOf(d);if(b!==-1&&I!==-1){let g=r.splice(b,1)[0];r.splice(I,0,g),t([...r])}},resetColumnsOrder:l,resetColumnsToggle:s,setColumnWidth:u,resetColumnsWidth:m},children:e})};a();import{createStyles as Za}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var $a=Za({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function oe(){let{classes:o}=$a();return or("tr",{className:o.root,children:or("td",{})})}a();import{Center as tt,createStyles as ft,Text as nt}from"@mantine/core";a();a();var Z=Ga(sr());import{forwardRef as ja,createElement as cr}from"react";a();var dr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Ja=Object.defineProperty,ot=Object.defineProperties,et=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,mr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,ur=(o,e,r)=>e in o?Ja(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,pr=(o,e)=>{for(var r in e||(e={}))mr.call(e,r)&&ur(o,r,e[r]);if(Oo)for(var r of Oo(e))xr.call(e,r)&&ur(o,r,e[r]);return o},rt=(o,e)=>ot(o,et(e)),at=(o,e)=>{var r={};for(var t in o)mr.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Oo)for(var t of Oo(o))e.indexOf(t)<0&&xr.call(o,t)&&(r[t]=o[t]);return r},W=(o,e,r)=>{let t=ja((f,n)=>{var l=f,{color:s="currentColor",size:u=24,stroke:m=2,children:p}=l,S=at(l,["color","size","stroke","children"]);return cr("svg",pr(rt(pr({ref:n},dr),{width:u,height:u,stroke:s,strokeWidth:m,className:`tabler-icon tabler-icon-${o}`}),S),[...r.map(([d,x])=>cr(d,x)),...p||[]])});return t.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number]),stroke:Z.default.oneOfType([Z.default.string,Z.default.number])},t.displayName=`${e}`,t};a();var ee=W("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var re=W("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var ae=W("database-off","IconDatabaseOff",[["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",key:"svg-0"}],["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",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);a();var te=W("filter","IconFilter",[["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",key:"svg-0"}]]);a();var fe=W("grip-vertical","IconGripVertical",[["path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]]);a();var ne=W("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);import{Fragment as st,jsx as Lo,jsxs as dt}from"react/jsx-runtime";var lt=ft(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function le({icon:o,text:e,pt:r,pb:t,active:f,children:n}){let{classes:l,cx:s}=lt();return Lo(tt,{pt:r,pb:t,className:s(l.root,{[l.active]:f}),children:n||dt(st,{children:[o||Lo("div",{className:l.standardIcon,children:Lo(ae,{})}),Lo(nt,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Pt,createStyles as wt}from"@mantine/core";import{forwardRef as Ft}from"react";a();import{Box as Ct,createStyles as St}from"@mantine/core";a();import{useMantineTheme as gr}from"@mantine/core";import{useMediaQuery as it}from"@mantine/hooks";import{useEffect as It,useLayoutEffect as gt,useMemo as Ir}from"react";a();import{useEffect as ct,useRef as ut,useState as pt}from"react";function mt(o,e){let r=()=>{e(o.map(f=>f.matches))},t=o.map(f=>{try{return f.addEventListener("change",r),()=>f.removeEventListener("change",r)}catch{return f.addListener(r),()=>f.removeListener(r)}});return()=>{t.forEach(f=>f())}}function xt(o,e){return e||(typeof window<"u"&&"matchMedia"in window?o.map(r=>window.matchMedia(r).matches):o.map(()=>!1))}function ir(o,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[t,f]=pt(r?e:xt(o,e)),n=ut();return ct(()=>{if("matchMedia"in window)return n.current=o.map(l=>window.matchMedia(l)),f(n.current.map(l=>l.matches)),mt(n.current,l=>{f(l)})},[o]),t}var Cr=typeof window<"u"?gt:It;function so(o){let e=gr(),r=typeof o=="function"?o(e):o;return it(r||"",!0)}function Sr(o){let e=gr(),r=Ir(()=>o.map(f=>(typeof f=="function"?f(e):f)??""),[o,e]),t=Ir(()=>o.map(()=>!0),[o]);return ir(r,t)}function to(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function se(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function So(o,e){return o.filter((r,t,f)=>t===f.findIndex(n=>e(r)===e(n)))}function Ao(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}function M(o,e){return typeof e=="string"?Ao(o,e):e(o)}import{jsx as bt}from"react/jsx-runtime";var ht=St({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function de({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:n,ellipsis:l,textAlignment:s,width:u}){let{cx:m,classes:p}=ht();return so(t)?bt(Ct,{component:"th",className:m({[p.noWrap]:n||l,[p.ellipsis]:l},o),sx:[{"&&":{textAlign:s},width:u,minWidth:u,maxWidth:u},e],style:r,children:f}):null}a();import{createStyles as Dt,px as Bt}from"@mantine/core";import{jsx as yt}from"react/jsx-runtime";var Tt=Dt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Bt(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}}}});function ce({shadowVisible:o}){let{cx:e,classes:r}=Tt();return yt("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as ue,jsxs as vt}from"react/jsx-runtime";var kt=wt((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),hr=Ft(function({className:e,style:r,borderColor:t,columns:f,defaultColumnProps:n,selectionVisible:l,leftShadowVisible:s,scrollDiff:u},m){let{cx:p,classes:S}=kt({scrollDiff:u,borderColor:t});return ue(Pt,{component:"tfoot",ref:m,className:p(S.root,e),style:r,children:vt("tr",{children:[l&&ue(ce,{shadowVisible:s}),f.map(({hidden:d,...x})=>{if(d)return null;let{accessor:T,visibleMediaQuery:b,textAlignment:I,width:g,footer:h,footerClassName:C,footerStyle:R,footerSx:w,noWrap:k,ellipsis:y}={...n,...x};return ue(de,{className:C,style:R,sx:w,visibleMediaQuery:b,textAlignment:I,width:g,title:h,noWrap:k,ellipsis:y},T)})]})})});a();import{createStyles as Jt}from"@mantine/core";import{forwardRef as of}from"react";a();import{Box as Mt}from"@mantine/core";import{useMemo as br}from"react";import{jsx as Rt}from"react/jsx-runtime";function pe({group:{id:o,columns:e,title:r,className:t,style:f,sx:n}}){let l=br(()=>e.map(({visibleMediaQuery:m})=>m),[e]),s=Sr(l),u=br(()=>e.filter(({hidden:m},p)=>!m&&s?.[p]).length,[e,s]);return u>0?Rt(Mt,{component:"th",colSpan:u,className:t,sx:n,style:f,children:r??to(o)}):null}a();import{ActionIcon as Br,Box as Tr,Center as No,Checkbox as zt,Flex as Gt,Group as yr,Popover as ie,Stack as Vt,createStyles as Xt,getStylesRef as Pr}from"@mantine/core";import{useRef as Qt,useState as wr}from"react";a();import{ActionIcon as Ot,Popover as me}from"@mantine/core";import{useDisclosure as Lt}from"@mantine/hooks";import{jsx as Ho,jsxs as At}from"react/jsx-runtime";function xe({children:o,isActive:e}){let[r,{close:t,toggle:f}]=Lt(!1);return At(me,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[Ho(me.Target,{children:Ho(Ot,{onClick:n=>{n.preventDefault(),f()},variant:e?"default":"subtle",children:Ho(te,{size:14})})}),Ho(me.Dropdown,{onClick:n=>n.preventDefault(),children:typeof o=="function"?o({close:t}):o})]})}a();import{createStyles as Ht,getStylesRef as Nt}from"@mantine/core";import{useRef as Et,useState as qt}from"react";import{jsx as Ut}from"react/jsx-runtime";var Wt=Ht(o=>({resizableColumnHeaderHandle:{ref:Nt("resizableColumnHeaderHandle"),position:"absolute",cursor:"col-resize",top:0,bottom:0,width:"7px",transform:"translateX(4px)",zIndex:1,"::after":{content:'""',position:"absolute",top:"1px",left:"2px",bottom:"1px",background:"inherit",borderLeft:`3px dotted ${o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[3]}`,opacity:0},"&:hover::after":{borderLeftColor:o.colors[o.primaryColor][o.colorScheme==="dark"?6:4]},"tr:hover &::after":{opacity:1}}})),Dr=o=>{let{accessor:e,columnRef:r}=o,{classes:t}=Wt(),f=Et(null),[n,l]=qt(0),{setColumnWidth:s}=Ro(),u=d=>{d.preventDefault(),d.stopPropagation(),document.addEventListener("mousemove",m),document.addEventListener("mouseup",p),document.body.style.cursor="col-resize"},m=d=>{if(!r.current)return;let x=d.clientX-r.current.getBoundingClientRect().right,b=`${r.current.getBoundingClientRect().width+x}px`;r.current.style.width=b,s(e,r.current.style.width),l(-x)},p=()=>{r.current&&(document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",p),document.body.style.cursor="initial",s(e,r.current.style.width),r.current.style.width="",l(0))};return Ut("div",{ref:f,onClick:d=>d.stopPropagation(),onMouseDown:u,onDoubleClick:()=>{r.current&&(r.current.style.maxWidth="initial",r.current.style.minWidth="initial",r.current.style.width="initial",s(e,"initial"))},className:t.resizableColumnHeaderHandle,style:{right:n}})};import{Fragment as Zt,jsx as v,jsxs as Eo}from"react/jsx-runtime";var Kt=Xt(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button:hover))":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},draggableColumnHeader:{cursor:"grab",borderRadius:6,transition:"all 0.2s","&:active":{cursor:"grabbing"},"&:hover:not(:has(button:hover))":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[2]}},draggableColumnHeaderIcon:{cursor:"inherit",margin:"-2px 2px 0"},draggableColumnHeaderOver:{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[2]},toggleableColumnHeaderIcon:{ref:Pr("toggleableColumnHeaderIcon"),transition:"opacity 0.2s",opacity:"0.1"},toggleableColumnHeader:{"&:hover":{[`& .${Pr("toggleableColumnHeaderIcon")}`]:{opacity:1}}},resizableColumnHeader:{position:"relative"},resizableColumnHeaderKnob:{position:"relative"},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function Ie({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:n,sortable:l,draggable:s,toggleable:u,resizable:m,sortIcons:p,textAlignment:S,width:d,sortStatus:x,onSortStatusChange:T,filter:b,filtering:I}){let{setSourceColumn:g,setTargetColumn:h,swapColumns:C,columnsToggle:R,setColumnsToggle:w}=Ro(),[k,y]=wr(!1),H=Qt(null),[N,E]=wr(!1),{cx:U,classes:F}=Kt();if(!so(f))return null;let z=n??to(t),Y=typeof z=="string"?z:void 0,K=l&&T?D=>{D?.defaultPrevented||T({columnAccessor:t,direction:x?.columnAccessor===t?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,V=D=>{D.stopPropagation(),g(t),y(!1)},X=D=>{D.preventDefault(),h(t),y(!0)},_=()=>{h(t),y(!1),C()},j=()=>{y(!0)},fo=()=>{y(!1)},uo=D=>{D.stopPropagation(),w(po=>po.map(Q=>Q.accessor===t?{...Q,toggled:!1}:Q))};return Eo(Tr,{component:"th",className:U({[F.sortableColumnHeader]:l,[F.toggleableColumnHeader]:u,[F.resizableColumnHeader]:m},o),sx:[{"&&":{textAlign:S},width:`${d} !important`,...m?{minWidth:"1px"}:{minWidth:d,maxWidth:d}},e],style:r,role:l?"button":void 0,tabIndex:l?0:void 0,onClick:K,onContextMenu:D=>{u&&(D.preventDefault(),E(!0))},onKeyDown:D=>D.key==="Enter"&&K?.(),ref:H,children:[Eo(yr,{className:F.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[Eo(ie,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:N,onChange:E,children:[v(ie.Target,{children:Eo(Gt,{align:"center",w:"100%",className:U({[F.draggableColumnHeader]:s,[F.draggableColumnHeaderOver]:k}),draggable:s,onDragStart:s?V:void 0,onDragEnter:s?j:void 0,onDragOver:s?X:void 0,onDrop:s?_:void 0,onDragLeave:s?fo:void 0,children:[s?v(No,{className:F.draggableColumnHeaderIcon,role:"img","aria-label":"Drag column",children:v(Br,{style:{cursor:"grab"},variant:"subtle",size:"xs",onClick:D=>{D.stopPropagation()},children:v(fe,{})})}):null,v(Tr,{className:U(F.columnHeaderText,F.sortableColumnHeaderText),title:Y,children:z})]})}),v(ie.Dropdown,{children:v(Vt,{children:R.filter(D=>D.toggleable).map(D=>v(yr,{children:v(zt,{size:"xs",label:D.accessor,checked:D.toggled,onChange:po=>{w(R.map(Q=>Q.accessor===D.accessor?{...Q,toggled:po.currentTarget.checked}:Q))}})},D.accessor))})})]}),u?v(No,{className:F.toggleableColumnHeaderIcon,role:"img","aria-label":"Toggle column",children:v(Br,{size:"xs",variant:"light",onClick:uo,children:v(ne,{})})}):null,l||x?.columnAccessor===t?v(Zt,{children:x?.columnAccessor===t?v(No,{className:U(F.sortableColumnHeaderIcon,{[F.sortableColumnHeaderIconRotated]:x.direction==="desc"}),role:"img","aria-label":`Sorted ${x.direction==="desc"?"descending":"ascending"}`,children:p?.sorted||v(ee,{size:14})}):v(No,{className:F.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:p?.unsorted||v(re,{size:14})})}):null,b?v(xe,{isActive:!!I,children:b}):null]}),m?v(Dr,{accessor:t,columnRef:H}):null]})}a();import{Checkbox as $t,createStyles as Yt,px as _t}from"@mantine/core";import{jsx as Fr}from"react/jsx-runtime";var jt=Yt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-_t(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function ge({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f,rowSpan:n}){let{cx:l,classes:s}=jt();return Fr("th",{className:l(s.root,{[s.shadowVisible]:o}),rowSpan:n,children:Fr($t,{classNames:{input:s.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as Ce,jsxs as Se}from"react/jsx-runtime";var ef=Jt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),kr=of(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:n,columns:l,defaultColumnProps:s,groups:u,selectionVisible:m,selectionChecked:p,selectionIndeterminate:S,onSelectionChange:d,selectionCheckboxProps:x,leftShadowVisible:T},b){let{classes:I,cx:g}=ef(),h=m?Ce(ge,{shadowVisible:T,checked:p,indeterminate:S,checkboxProps:x,onChange:d,rowSpan:u?2:void 0}):null;return Se("thead",{className:g(I.root,e),style:r,ref:b,children:[u&&Se("tr",{children:[h,u.map(C=>Ce(pe,{group:C},C.id))]}),Se("tr",{children:[!u&&h,l.map(({hidden:C,...R},w)=>{if(C)return null;let{accessor:k,visibleMediaQuery:y,textAlignment:H,width:N,title:E,sortable:U,draggable:F,toggleable:z,resizable:Y,titleClassName:K,titleStyle:V,titleSx:X,filter:_,filtering:j}={...s,...R};return Ce(Ie,{accessor:k,className:K,style:V,sx:X,visibleMediaQuery:y,textAlignment:H,width:N,title:E,sortable:U,draggable:F,resizable:Y&&w<l.length-1,toggleable:z,sortStatus:t,sortIcons:f,onSortStatusChange:n,filter:_,filtering:j},k)})]})]})});a();import{Center as rf,createStyles as af,Loader as tf}from"@mantine/core";import{jsx as vr}from"react/jsx-runtime";var ff=af(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function he({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:n,variant:l,color:s}){let{classes:u,cx:m}=ff();return vr(rf,{pt:o,pb:e,className:m(u.root,{[u.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||vr(tf,{size:n,variant:l,color:s}))})}a();import{Box as sf,Pagination as df,Text as cf,createStyles as uf}from"@mantine/core";import{forwardRef as pf}from"react";a();import{Button as nf,Group as lf,Menu as qo,Text as Mr}from"@mantine/core";import{jsx as co,jsxs as Or}from"react/jsx-runtime";var Rr={xs:22,sm:26,md:32,lg:38,xl:44};function be({size:o,label:e,values:r,value:t,onChange:f,color:n}){return Or(lf,{spacing:"xs",children:[co(Mr,{size:o,children:e}),Or(qo,{withinPortal:!0,withArrow:!0,children:[co(qo.Target,{children:co(nf,{size:o,variant:"default",sx:[{fontWeight:"normal"},l=>({height:Rr[o],paddingLeft:l.spacing[o],paddingRight:l.spacing[o]})],children:t})}),co(qo.Dropdown,{children:r.map(l=>{let s=l===t;return co(qo.Item,{sx:[{height:Rr[o]},u=>({"&&":{color:s?u.white:void 0},background:s?u.colors[n||u.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(l),children:co(Mr,{size:o,children:l})},l)})})]})]})}import{jsx as De,jsxs as xf}from"react/jsx-runtime";var mf=uf((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),Lr=pf(function({className:e,style:r,topBorderColor:t,fetching:f,page:n,onPageChange:l,paginationColor:s,paginationSize:u,loadingText:m,noRecordsText:p,paginationText:S,totalRecords:d,recordsPerPage:x,onRecordsPerPageChange:T,recordsPerPageLabel:b,recordsPerPageOptions:I,recordsLength:g,horizontalSpacing:h,paginationWrapBreakpoint:C,getPaginationControlProps:R},w){let k;if(f)k=m;else if(!d)k=p;else{let N=(n-1)*x+1,E=N+g-1;k=S({from:N,to:E,totalRecords:d})}let{classes:y,cx:H}=mf({topBorderColor:t,paginationWrapBreakpoint:C});return xf(sf,{ref:w,px:h??"xs",py:"xs",className:H(y.root,e),style:r,children:[De(cf,{className:y.text,size:u,children:k}),I&&De(be,{size:u,label:b,values:I,color:s,value:x,onChange:T}),De(df,{color:s,className:H(y.pagination,{[y.paginationFetching]:f||!g}),value:n,onChange:l,size:u,total:Math.ceil(d/x),getControlProps:R})]})});a();import{Box as Mf,createStyles as Rf}from"@mantine/core";a();import{Box as If,createStyles as gf}from"@mantine/core";import{jsx as Sf}from"react/jsx-runtime";var Cf=gf({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Be({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:n,onClick:l,noWrap:s,ellipsis:u,textAlignment:m,width:p,accessor:S,render:d,defaultRender:x,customCellAttributes:T}){let{cx:b,classes:I}=Cf();return so(t)?Sf(If,{component:"td",className:b({[I.noWrap]:s||u,[I.ellipsis]:u,[I.withPointerCursor]:l},o),sx:[{width:p,minWidth:p,maxWidth:p,textAlign:m},e],style:r,onClick:l,...T?.(f,n),children:d?d(f,n):x?x(f,n,S):Ao(f,S)}):null}a();import{Collapse as Df,createStyles as Bf}from"@mantine/core";a();import{useLocalStorage as Te,useResizeObserver as hf,useTimeout as Ar}from"@mantine/hooks";import{useEffect as ye,useMemo as bf,useState as ho}from"react";function Hr(o){let[e,r]=ho(null),t=o?.join(":")||"";return ye(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Nr(o){let[e,r]=ho(null);return ye(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function Er({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:u,initiallyExpanded:m}=o;e&&s==="always"?t=e.map(p=>M(p,r)):m&&(t=e.filter(m).map(p=>M(p,r)),u||(t=[t[0]]))}let f,n,l=ho(t);if(o){let{trigger:s,allowMultiple:u,collapseProps:m,content:p}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=l;let S=d=>n?.(f.filter(x=>x!==M(d,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:d=>s==="always"?!0:f.includes(M(d,r)),expandRow:d=>{let x=M(d,r);n?.(u?[...f,x]:[x])},collapseRow:S,collapseProps:m,content:(d,x)=>()=>p({record:d,recordIndex:x,collapse:()=>S(d)})}}}function qr(o,e){let[r,t]=ho(o),[f,n]=ho(o),l=Ar(()=>t(!0),0),s=Ar(()=>n(!1),e||200);return ye(()=>{o?(s.clear(),n(!0),l.start()):(l.clear(),t(!1),s.start())},[l,s,o]),{expanded:r,visible:f}}function $(){let[o]=hf(),{width:e,height:r}=o.current?.getBoundingClientRect()||{width:0,height:0};return{ref:o,width:e,height:r}}var Pe=({key:o,columns:e=[]})=>{let r=e&&e.map(I=>I.accessor)||[],t=e&&e.map(I=>({[I.accessor]:I.width??"auto"}))||[],f=e&&e.map(I=>({accessor:I.accessor,defaultToggle:I.defaultToggle||!0,toggleable:I.toggleable,toggled:I.defaultToggle||!0})),[n,l]=Te({key:`${o}-columns-order`,defaultValue:r,getInitialValueInEffect:!0}),[s,u]=Te({key:`${o}-columns-toggle`,defaultValue:f,getInitialValueInEffect:!0}),[m,p]=Te({key:`${o}-columns-width`,defaultValue:t,getInitialValueInEffect:!0}),S=()=>l(r),d=()=>u(f),x=()=>p(t);return{effectiveColumns:bf(()=>n?n.map(h=>e.find(C=>C.accessor===h)).filter(h=>s.find(C=>C.accessor===h?.accessor)?.toggled).map(h=>({...h,width:m.find(C=>C[h?.accessor])?.[h?.accessor]})):e,[e,n,s,m]),setColumnsOrder:l,columnsOrder:n,resetColumnsOrder:S,columnsToggle:s,setColumnsToggle:u,resetColumnsToggle:d,columnsWidth:m,setColumnsWidth:p,setColumnWidth:(I,g)=>{let h=m.map(C=>C[I]?{[I]:g}:C);p(h)},resetColumnsWidth:x}};import{Fragment as yf,jsx as Wo,jsxs as Pf}from"react/jsx-runtime";var Tf=Bf({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function we({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:n}=qr(o,t?.transitionDuration),{cx:l,classes:s}=Tf();return n?Pf(yf,{children:[Wo("tr",{}),Wo("tr",{children:Wo("td",{className:l(s.cell,{[s.expandedCell]:f}),colSpan:e,children:Wo(Df,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as wf,createStyles as Ff,px as kf}from"@mantine/core";import{jsx as Wr}from"react/jsx-runtime";var vf=Ff(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-kf(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function Fe({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:n,classes:l}=vf();return Wr("td",{className:n(l.root,{[l.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:Wr(wf,{classNames:{input:l.checkbox},...f,...t(o,e)})})}import{Fragment as Lf,jsx as ke,jsxs as Ur}from"react/jsx-runtime";var Of=Rf(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function ve({record:o,recordIndex:e,columns:r,defaultColumnProps:t,defaultColumnRender:f,selectionVisible:n,selectionChecked:l,onSelectionChange:s,isRecordSelectable:u,getSelectionCheckboxProps:m,onClick:p,onCellClick:S,onContextMenu:d,expansion:x,customAttributes:T,className:b,style:I,sx:g,contextMenuVisible:h,leftShadowVisible:C}){let{cx:R,classes:w}=Of();return Ur(Lf,{children:[Ur(Mf,{component:"tr",className:R({[w.withPointerCursor]:p||x?.expandOnClick,[w.selected]:l,[w.contextMenuVisible]:h},typeof b=="function"?b(o,e):b),onClick:k=>{if(x){let{isRowExpanded:y,expandOnClick:H,expandRow:N,collapseRow:E}=x;H&&(y(o)?E(o):N(o))}p?.(k)},style:typeof I=="function"?I(o,e):I,sx:g,...T?.(o,e),onContextMenu:d,children:[n&&ke(Fe,{record:o,recordIndex:e,withRightShadow:C,checked:l,disabled:!s||(u?!u(o,e):!1),onChange:s,getCheckboxProps:m}),r.map(({hidden:k,...y},H)=>{if(k)return null;let{accessor:N,visibleMediaQuery:E,textAlignment:U,noWrap:F,ellipsis:z,width:Y,render:K,cellsClassName:V,cellsStyle:X,cellsSx:_,customCellAttributes:j}={...t,...y},fo;return S&&(fo=uo=>S({event:uo,record:o,recordIndex:e,column:y,columnIndex:H})),ke(Be,{className:typeof V=="function"?V(o,e):V,style:typeof X=="function"?X(o,e):X,sx:_,visibleMediaQuery:E,record:o,recordIndex:e,onClick:fo,accessor:N,textAlignment:U,noWrap:F,ellipsis:z,width:Y,render:K,defaultRender:f,customCellAttributes:j},N)})]}),x&&ke(we,{colSpan:r.filter(({hidden:k})=>!k).length+(n?1:0),open:x.isRowExpanded(o),content:x.content(o,e),collapseProps:x.collapseProps})]})}a();import{Paper as Af,createStyles as Hf,px as Nf}from"@mantine/core";import{useClickOutside as Ef,useMergedRef as qf,useWindowEvent as zr}from"@mantine/hooks";import{jsx as Uf}from"react/jsx-runtime";var Wf=Hf(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Me({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:n,children:l}){zr("resize",n),zr("scroll",n);let s=Ef(n),{ref:u,width:m,height:p}=$(),S=qf(s,u),{innerWidth:d,innerHeight:x}=window,{classes:T,theme:{dir:b,spacing:I}}=Wf(),g=Nf(I.md);return Uf(Af,{ref:S,shadow:e,radius:o,className:T.root,sx:{zIndex:r,top:t+p+g>x?x-p-g:t,left:b==="ltr"?f+m+g>d?d-m-g:f:d-g-(f-m-g<0?m+g:f)},children:l})}a();import{createStyles as zf}from"@mantine/core";import{jsx as Vf}from"react/jsx-runtime";var Gf=zf(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function Re(){let{classes:o}=Gf();return Vf("div",{className:o.root})}a();import{Box as Xf,Text as Qf,UnstyledButton as Kf,createStyles as Zf,px as $f}from"@mantine/core";import{jsx as Gr,jsxs as _f}from"react/jsx-runtime";var Yf=Zf((o,{color:e})=>{let r=$f(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function Oe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:n}=Yf({color:r});return _f(Kf,{className:n.root,disabled:t,onClick:f,children:[o&&Gr(Xf,{className:n.icon,children:o}),Gr(Qf,{className:n.title,size:"sm",children:e})]})}a();import{Box as Vr,createStyles as jf,ScrollArea as Jf}from"@mantine/core";import{jsx as Uo,jsxs as en}from"react/jsx-runtime";var on=jf(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function Le({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:n,onScrollPositionChange:l,children:s,viewportRef:u,scrollAreaProps:m}){let p=n?n-1:0,{cx:S,classes:d}=on();return en(Jf,{...m,viewportRef:u,classNames:{root:d.root,scrollbar:d.scrollbar,thumb:d.thumb,corner:d.corner},styles:{scrollbar:{marginTop:f,marginBottom:p}},onScrollPositionChange:l,children:[s,Uo(Vr,{className:S(d.shadow,d.topShadow,{[d.shadowVisible]:o}),sx:{top:f}}),Uo("div",{className:S(d.shadow,d.leftShadow,{[d.shadowVisible]:e})}),Uo("div",{className:S(d.shadow,d.rightShadow,{[d.shadowVisible]:r})}),Uo(Vr,{className:S(d.shadow,d.bottomShadow,{[d.shadowVisible]:t}),sx:{bottom:p}})]})}import{jsx as A,jsxs as Qr}from"react/jsx-runtime";var Xr={},un=fn((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r,n=o.colorScheme==="dark"?.5:.05;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},resizableColumnHeaderKnobTransparent:{[`& .${nn("resizableColumnHeaderKnob")}`]:{background:"transparent"}},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},tableWithColumnBordersAndSelectableRecords:{thead:{"tr + tr":{th:{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}},pinLastColumn:{"th:last-of-type, td:last-of-type":{position:"sticky",right:0,zIndex:1,background:"inherit","&::after":{content:"''",position:"absolute",top:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,n)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,n)}, ${o.fn.rgba(o.black,0)} 30%)`,borderRight:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,left:-sn(o.spacing.sm),pointerEvents:"none",opacity:0,transition:"opacity 0.2s"}}},pinnedColumnShadowVisible:{"th:last-of-type, td:last-of-type":{"&::after":{opacity:1}}}}});function Kr({withBorder:o,borderRadius:e,borderColor:r=P=>P.colorScheme==="dark"?P.colors.dark[4]:P.colors.gray[3],rowBorderColor:t=P=>P.fn.rgba(P.colorScheme==="dark"?P.colors.dark[4]:P.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:l="100%",minHeight:s,shadow:u,verticalAlignment:m="center",fetching:p,columns:S,storeColumnsKey:d,groups:x,pinLastColumn:T,defaultColumnProps:b,defaultColumnRender:I,idAccessor:g="id",records:h,selectedRecords:C,onSelectedRecordsChange:R,isRecordSelectable:w,allRecordsSelectionCheckboxProps:k={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:y=(P,J)=>({"aria-label":`Select record ${J+1}`}),sortStatus:H,sortIcons:N,onSortStatusChange:E,horizontalSpacing:U,page:F,onPageChange:z,totalRecords:Y,recordsPerPage:K,onRecordsPerPageChange:V,recordsPerPageOptions:X,recordsPerPageLabel:_="Records per page",paginationColor:j,paginationSize:fo="sm",paginationText:uo=({from:P,to:J,totalRecords:oo})=>`${P} - ${J} / ${oo}`,paginationWrapBreakpoint:D="sm",getPaginationControlProps:po=P=>P==="previous"?{"aria-label":"Previous page"}:P==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Q,customLoader:Zr,loaderSize:$r,loaderVariant:Yr,loaderColor:_r,loadingText:jr="...",emptyState:Jr,noRecordsText:He="No records",noRecordsIcon:oa,striped:ea,noHeader:ra,onRowClick:Go,onCellClick:aa,onScrollToTop:Ne,onScrollToBottom:Ee,onScrollToLeft:qe,onScrollToRight:We,rowContextMenu:G,rowExpansion:ta,rowClassName:fa,rowStyle:na,rowSx:la,customRowAttributes:sa,scrollViewportRef:da,scrollAreaProps:ca,bodyRef:ua,m:pa,my:ma,mx:xa,mt:ia,mb:Ia,ml:ga,mr:Ca,sx:Sa,className:ha,classNames:bo,style:ba,styles:Vo,...Da}){let{ref:P,width:J,height:oo}=$(),mo=cn(()=>x?.flatMap(i=>i.columns)??S,[S,x]),Ba=Pe({key:d,columns:mo}),{ref:Ta,height:Xo}=$(),{ref:ya,width:Qo,height:xo}=$(),{ref:Pa,height:wa}=$(),{ref:Fa,height:Ue}=$(),[Ko,ze]=zo(!0),[Zo,Ge]=zo(!0),[Do,Ve]=zo(!0),[Bo,Xe]=zo(!0),{rowContextMenuInfo:eo,setRowContextMenuInfo:no}=Nr(p),ka=Er({rowExpansion:ta,records:h,idAccessor:g}),$o=Ae(()=>{if(!p&&G&&no(null),p||xo<=oo)ze(!0),Ge(!0);else{let i=P.current.scrollTop,B=i===0,L=xo-i-oo<1;ze(B),Ge(L),B&&B!==Ko&&Ne?.(),L&&L!==Zo&&Ee?.()}if(p||Qo===J)Ve(!0),Xe(!0);else{let i=P.current.scrollLeft,B=i===0,L=Qo-i-J<1;Ve(B),Xe(L),B&&B!==Do&&qe?.(),L&&L!==Bo&&We?.()}},[p,Ee,qe,We,Ne,G,oo,P,J,Zo,Do,Bo,Ko,no,xo,Qo]);Cr($o,[$o]);let va=Ae(i=>{P.current.scrollTo({top:0,left:0}),z(i)},[z,P]),To=h?.length,Qe=h?.map(i=>M(i,g)),io=!!C,Io=C?.map(i=>M(i,g)),Ke=Qe!==void 0&&Io!==void 0&&Io.length>0,Yo=w?h?.filter(w):h,yo=Yo?.map(i=>M(i,g)),Po=Ke&&yo.every(i=>Io.includes(i)),Ma=Ke&&yo.some(i=>Io.includes(i)),Ra=Ae(()=>{C&&R&&R(Po?C.filter(i=>!yo.includes(M(i,g))):So([...C,...Yo],i=>M(i,g)))},[Po,g,R,yo,Yo,C]),{lastSelectionChangeIndex:wo,setLastSelectionChangeIndex:Oa}=Hr(Qe),_o=io&&!Do,{cx:Ze,classes:q,theme:La}=un({borderColor:r,rowBorderColor:t}),Aa={m:pa,my:ma,mx:xa,mt:ia,mb:Ia,ml:ga,mr:Ca},Fo=typeof Vo=="function"?Vo(La,Xr,Xr):Vo;return A(Je,{...Ba,children:Qr(rn,{...Aa,className:Ze(q.root,{[q.tableWithBorder]:o,[q.resizableColumnHeaderKnobTransparent]:f},ha,bo?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[u]||u,height:l,minHeight:s}),...ln(Sa)],style:{...Fo?.root,...ba},children:[A(Le,{viewportRef:dn(P,da||null),topShadowVisible:!Ko,leftShadowVisible:!(C||Do),rightShadowVisible:!Bo&&!T,bottomShadowVisible:!Zo,headerHeight:Xo,footerHeight:wa,onScrollPositionChange:$o,scrollAreaProps:ca,children:Qr(tn,{ref:ya,horizontalSpacing:U,className:Ze(q.table,{[q.tableWithColumnBorders]:f,[q.lastRowBorderBottomVisible]:xo<oo,[q.textSelectionDisabled]:n,[q.verticalAlignmentTop]:m==="top",[q.verticalAlignmentBottom]:m==="bottom",[q.tableWithColumnBordersAndSelectableRecords]:io&&f,[q.pinLastColumn]:T,[q.pinnedColumnShadowVisible]:T&&!Bo}),striped:To?ea:!1,...Da,children:[ra?null:A(kr,{ref:Ta,className:bo?.header,style:Fo?.header,columns:mo,defaultColumnProps:b,groups:x,sortStatus:H,sortIcons:N,onSortStatusChange:E,selectionVisible:io,selectionChecked:Po,selectionIndeterminate:Ma&&!Po,onSelectionChange:Ra,selectionCheckboxProps:k,leftShadowVisible:_o}),A("tbody",{ref:ua,children:To?h.map((i,B)=>{let L=M(i,g),go=Io?.includes(L)||!1,ko=!1,vo=!1;if(G){let{hidden:O}=G;(!O||!(typeof O=="function"?O(i,B):O))&&(G.trigger==="click"?ko=!0:vo=!0)}let Mo;R&&C&&(Mo=O=>{if(O.nativeEvent.shiftKey&&wo!==null){let lo=h.filter(B>wo?(ro,ao)=>ao>=wo&&ao<=B&&(w?w(ro,ao):!0):(ro,ao)=>ao>=B&&ao<=wo&&(w?w(ro,ao):!0));R(go?se(C,lo,ro=>M(ro,g)):So([...C,...lo],ro=>M(ro,g)))}else R(go?C.filter(lo=>M(lo,g)!==L):So([...C,i],lo=>M(lo,g)));Oa(B)});let Co;ko?Co=O=>{no({y:O.clientY,x:O.clientX,record:i,recordIndex:B}),Go?.(i,B,O)}:Go&&(Co=O=>{Go(i,B,O)});let $e;return vo&&($e=O=>{O.preventDefault(),no({y:O.clientY,x:O.clientX,record:i,recordIndex:B})}),A(ve,{record:i,recordIndex:B,columns:mo,defaultColumnProps:b,defaultColumnRender:I,selectionVisible:io,selectionChecked:go,onSelectionChange:Mo,isRecordSelectable:w,getSelectionCheckboxProps:y,onClick:Co,onCellClick:aa,onContextMenu:$e,contextMenuVisible:eo?M(eo.record,g)===L:!1,expansion:ka,className:fa,style:na,sx:la,customAttributes:sa,leftShadowVisible:_o},L)}):A(oe,{})}),mo.some(({footer:i})=>i)&&A(hr,{ref:Pa,className:bo?.footer,style:Fo?.footer,borderColor:r,columns:mo,defaultColumnProps:b,selectionVisible:io,leftShadowVisible:_o,scrollDiff:xo-oo})]})}),F&&A(Lr,{ref:Fa,className:bo?.pagination,style:Fo?.pagination,topBorderColor:r,horizontalSpacing:U,fetching:p,page:F,onPageChange:va,totalRecords:Y,recordsPerPage:K,onRecordsPerPageChange:V,recordsPerPageOptions:X,recordsPerPageLabel:_,paginationColor:j,paginationSize:fo,paginationText:uo,paginationWrapBreakpoint:D,getPaginationControlProps:po,noRecordsText:He,loadingText:jr,recordsLength:To}),A(he,{pt:Xo,pb:Ue,fetching:p,backgroundBlur:Q,customContent:Zr,size:$r,variant:Yr,color:_r}),A(le,{pt:Xo,pb:Ue,icon:oa,text:He,active:!p&&!To,children:Jr}),G&&eo&&A(an,{children:A(Me,{zIndex:G.zIndex,borderRadius:G.borderRadius,shadow:G.shadow,y:eo.y,x:eo.x,onDestroy:()=>no(null),children:G.items(eo.record,eo.recordIndex).map(({divider:i,key:B,title:L,icon:go,color:ko,hidden:vo,disabled:Mo,onClick:Co})=>i?A(Re,{},B):vo?null:A(Oe,{title:L??to(B),icon:go,color:ko,disabled:Mo,onClick:()=>{no(null),Co()}},B))})})]})})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{Kr as DataTable,se as differenceBy,Ao as getValueAtPath,to as humanize,So as uniqBy,Pe as useDataTableColumns};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|