mantine-datatable 2.4.18 → 2.5.1
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/DataTableHeader.d.ts.map +1 -1
- package/dist/DataTableHeaderCell.d.ts +2 -2
- package/dist/DataTableHeaderCell.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/dist/types/DataTableColumn.d.ts +33 -0
- package/dist/types/DataTableColumn.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ea=Object.create;var Re=Object.defineProperty;var ra=Object.getOwnPropertyDescriptor;var aa=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,fa=Object.prototype.hasOwnProperty;var na=(o,e)=>()=>(o&&(e=o(o=0)),e);var zo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var la=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of aa(e))!fa.call(o,f)&&f!==r&&Re(o,f,{get:()=>e[f],enumerable:!(t=ra(e,f))||t.enumerable});return o};var sa=(o,e,r)=>(r=o!=null?ea(ta(o)):{},la(e||!o||!o.__esModule?Re(r,"default",{value:o,enumerable:!0}):r,o));import*as d from"react";var a=na(()=>{"use strict"});var ve=zo((cf,Oe)=>{"use strict";a();var ua="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Oe.exports=ua});var Ee=zo((pf,He)=>{"use strict";a();var pa=ve();function Ae(){}function Le(){}Le.resetWarningCache=Ae;He.exports=function(){function o(t,f,l,n,s,m){if(m!==pa){var x=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 x.name="Invariant Violation",x}}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:Le,resetWarningCache:Ae};return r.PropTypes=r,r}});var qe=zo((gf,Ne)=>{a();Ne.exports=Ee()();var xf,If});a();a();import{Box as jt,createStyles as Jt,packSx as of,Table as ef}from"@mantine/core";import{useElementSize as fo,useMergedRef as rf}from"@mantine/hooks";import{useCallback as Ie,useState as yo}from"react";a();import{createStyles as da}from"@mantine/core";import{jsx as Fe}from"react/jsx-runtime";var ca=da({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Vo(){let{classes:o}=ca();return Fe("tr",{className:o.root,children:Fe("td",{})})}a();import{Center as Sa,createStyles as ha,Text as ba}from"@mantine/core";a();a();var E=sa(qe());import{forwardRef as ma,createElement as Ue}from"react";a();var We={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 xa=Object.defineProperty,Ia=Object.defineProperties,ia=Object.getOwnPropertyDescriptors,So=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,ze=(o,e,r)=>e in o?xa(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ve=(o,e)=>{for(var r in e||(e={}))Ge.call(e,r)&&ze(o,r,e[r]);if(So)for(var r of So(e))Xe.call(e,r)&&ze(o,r,e[r]);return o},ga=(o,e)=>Ia(o,ia(e)),Ca=(o,e)=>{var r={};for(var t in o)Ge.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&So)for(var t of So(o))e.indexOf(t)<0&&Xe.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:m=24,stroke:x=2,children:u}=n,p=Ca(n,["color","size","stroke","children"]);return Ue("svg",Ve(ga(Ve({ref:l},We),{width:m,height:m,stroke:s,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),p),[...r.map(([I,c])=>Ue(I,c)),...u||[]])});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 Go=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 Xo=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 Qo=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"}]]);import{Fragment as Da,jsx as ho,jsxs as ya}from"react/jsx-runtime";var Ba=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 Zo({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:s}=Ba();return ho(Sa,{pt:r,pb:t,className:s(n.root,{[n.active]:f}),children:l||ya(Da,{children:[o||ho("div",{className:n.standardIcon,children:ho(Qo,{})}),ho(ba,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Ea,createStyles as Na}from"@mantine/core";import{forwardRef as qa}from"react";a();import{Box as Ma,createStyles as Ra}from"@mantine/core";a();import{useMantineTheme as Ta}from"@mantine/core";import{useMediaQuery as wa}from"@mantine/hooks";import{useEffect as Pa,useLayoutEffect as ka}from"react";var Qe=typeof window<"u"?ka:Pa;function Z(o){let e=Ta(),r=typeof o=="function"?o(e):o;return wa(r||"",!0)}function ro(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 Ko(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function ao(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function D(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as Oa}from"react/jsx-runtime";var Fa=Ra({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function $o({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:s,width:m}){let{cx:x,classes:u}=Fa();return Z(t)?Oa(Ma,{component:"th",className:x({[u.noWrap]:l||n,[u.ellipsis]:n},o),sx:[{"&&":{textAlign:s},width:m,minWidth:m,maxWidth:m},e],style:r,children:f}):null}a();import{createStyles as va,px as Aa}from"@mantine/core";import{jsx as Ha}from"react/jsx-runtime";var La=va(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:-Aa(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 Yo({shadowVisible:o}){let{cx:e,classes:r}=La();return Ha("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as _o,jsxs as Ua}from"react/jsx-runtime";var Wa=Na((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"}}}),Ze=qa(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:s},m){let{cx:x,classes:u}=Wa({scrollDiff:s,borderColor:t});return _o(Ea,{component:"tfoot",ref:m,className:x(u.root,e),style:r,children:Ua("tr",{children:[l&&_o(Yo,{shadowVisible:n}),f.map(({accessor:p,hidden:I,visibleMediaQuery:c,textAlignment:C,width:g,footer:h,footerClassName:S,footerStyle:A,footerSx:L,noWrap:R,ellipsis:T})=>I?null:_o($o,{className:S,style:A,sx:L,visibleMediaQuery:c,textAlignment:C,width:g,title:h,noWrap:R,ellipsis:T},p))]})})});a();import{createStyles as Ya}from"@mantine/core";import{forwardRef as _a}from"react";a();import{Box as jo,Center as Ke,createStyles as za,Group as Va}from"@mantine/core";import{jsx as V,jsxs as Xa}from"react/jsx-runtime";var Ga=za(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&: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 Jo({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:s,textAlignment:m,width:x,sortStatus:u,onSortStatusChange:p}){let{cx:I,classes:c}=Ga();if(!Z(f))return null;let C=l??ro(t),g=typeof C=="string"?C:void 0,h=n&&p?()=>{p({columnAccessor:t,direction:u?.direction==="asc"?"desc":"asc"})}:void 0;return V(jo,{component:"th",className:I({[c.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:m},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:h,onKeyDown:S=>S.key==="Enter"&&h?.(),children:n||u?.columnAccessor===t?Xa(Va,{className:c.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[V(jo,{className:I(c.columnHeaderText,c.sortableColumnHeaderText),title:g,children:C}),u?.columnAccessor===t?V(Ke,{className:I(c.sortableColumnHeaderIcon,{[c.sortableColumnHeaderIconRotated]:u.direction==="desc"}),role:"img","aria-label":`Sorted ${u.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||V(Go,{size:14})}):V(Ke,{className:c.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:s?.unsorted||V(Xo,{size:14})})]}):V(jo,{className:c.columnHeaderText,title:g,children:C})})}a();import{Checkbox as Qa,createStyles as Za,px as Ka}from"@mantine/core";import{jsx as $e}from"react/jsx-runtime";var $a=Za(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:-Ka(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 oe({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=$a();return $e("th",{className:l(n.root,{[n.shadowVisible]:o}),children:$e(Qa,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as ee,jsxs as Ja}from"react/jsx-runtime";var ja=Ya(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Ye=_a(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:s,selectionChecked:m,selectionIndeterminate:x,onSelectionChange:u,selectionCheckboxProps:p,leftShadowVisible:I},c){let{classes:C,cx:g}=ja();return ee("thead",{className:g(C.root,e),style:r,ref:c,children:Ja("tr",{children:[s&&ee(oe,{shadowVisible:I,checked:m,indeterminate:x,checkboxProps:p,onChange:u}),n.map(({accessor:h,hidden:S,visibleMediaQuery:A,textAlignment:L,width:R,title:T,sortable:k,titleClassName:w,titleStyle:F,titleSx:O})=>S?null:ee(Jo,{className:w,style:F,sx:O,accessor:h,visibleMediaQuery:A,textAlignment:L,width:R,title:T,sortable:k,sortStatus:t,sortIcons:f,onSortStatusChange:l},h))]})})});a();import{Center as ot,createStyles as et,Loader as rt}from"@mantine/core";import{jsx as _e}from"react/jsx-runtime";var at=et(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 re({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:s}){let{classes:m,cx:x}=at();return _e(ot,{pt:o,pb:e,className:x(m.root,{[m.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||_e(rt,{size:l,variant:n,color:s}))})}a();import{Box as nt,Pagination as lt,Text as st,createStyles as dt}from"@mantine/core";import{forwardRef as ct}from"react";a();import{Button as tt,Group as ft,Menu as bo,Text as je}from"@mantine/core";import{jsx as K,jsxs as or}from"react/jsx-runtime";var Je={xs:22,sm:26,md:32,lg:38,xl:44};function ae({size:o,label:e,values:r,value:t,onChange:f,color:l}){return or(ft,{spacing:"xs",children:[K(je,{size:o,children:e}),or(bo,{withinPortal:!0,withArrow:!0,children:[K(bo.Target,{children:K(tt,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:Je[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),K(bo.Dropdown,{children:r.map(n=>{let s=n===t;return K(bo.Item,{sx:[{height:Je[o]},m=>({"&&":{color:s?m.white:void 0},background:s?m.colors[l||m.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(n),children:K(je,{size:o,children:n})},n)})})]})]})}import{jsx as te,jsxs as pt}from"react/jsx-runtime";var ut=dt((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}})),er=ct(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:s,paginationSize:m,loadingText:x,noRecordsText:u,paginationText:p,totalRecords:I,recordsPerPage:c,onRecordsPerPageChange:C,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:S,horizontalSpacing:A,paginationWrapBreakpoint:L,getPaginationControlProps:R},T){let k;if(f)k=x;else if(!I)k=u;else{let O=(l-1)*c+1,$=O+S-1;k=p({from:O,to:$,totalRecords:I})}let{classes:w,cx:F}=ut({topBorderColor:t,paginationWrapBreakpoint:L});return pt(nt,{ref:T,px:A??"xs",py:"xs",className:F(w.root,e),style:r,children:[te(st,{className:w.text,size:m,children:k}),h&&te(ae,{size:m,label:g,values:h,color:s,value:c,onChange:C}),te(lt,{color:s,className:F(w.pagination,{[w.paginationFetching]:f||!S}),value:l,onChange:n,size:m,total:Math.ceil(I/c),getControlProps:R})]})});a();import{Box as wt,createStyles as Pt}from"@mantine/core";a();import{Box as mt,createStyles as xt}from"@mantine/core";import{jsx as it}from"react/jsx-runtime";var It=xt({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function fe({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:s,ellipsis:m,textAlignment:x,width:u,accessor:p,render:I,defaultRender:c,customCellAttributes:C}){let{cx:g,classes:h}=It();return Z(t)?it(mt,{component:"td",className:g({[h.noWrap]:s||m,[h.ellipsis]:m,[h.withPointerCursor]:n},o),sx:[{width:u,minWidth:u,maxWidth:u,textAlign:x},e],style:r,onClick:n,...C?.(f,l),children:I?I(f,l):c?c(f,l,p):D(f,p)}):null}a();import{Collapse as gt,createStyles as Ct}from"@mantine/core";a();import{useTimeout as rr}from"@mantine/hooks";import{useEffect as ne,useState as to}from"react";function ar(o){let[e,r]=to(null),t=o?.join(":")||"";return ne(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function tr(o){let[e,r]=to(null);return ne(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function fr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:m,initiallyExpanded:x}=o;e&&s==="always"?t=e.map(u=>D(u,r)):x&&(t=e.filter(x).map(u=>D(u,r)),m||(t=[t[0]]))}let f,l,n=to(t);if(o){let{trigger:s,allowMultiple:m,collapseProps:x,content:u}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let p=I=>l?.(f.filter(c=>c!==D(I,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:I=>s==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let c=D(I,r);l?.(m?[...f,c]:[c])},collapseRow:p,collapseProps:x,content:(I,c)=>()=>u({record:I,recordIndex:c,collapse:()=>p(I)})}}}function nr(o,e){let[r,t]=to(o),[f,l]=to(o),n=rr(()=>t(!0),0),s=rr(()=>l(!1),e||200);return ne(()=>{o?(s.clear(),l(!0),n.start()):(n.clear(),t(!1),s.start())},[n,s,o]),{expanded:r,visible:f}}import{Fragment as ht,jsx as Bo,jsxs as bt}from"react/jsx-runtime";var St=Ct({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function le({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=nr(o,t?.transitionDuration),{cx:n,classes:s}=St();return l?bt(ht,{children:[Bo("tr",{}),Bo("tr",{children:Bo("td",{className:n(s.cell,{[s.expandedCell]:f}),colSpan:e,children:Bo(gt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as Bt,createStyles as Dt,px as yt}from"@mantine/core";import{jsx as lr}from"react/jsx-runtime";var Tt=Dt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,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 se({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Tt();return lr("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:lr(Bt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Mt,jsx as de,jsxs as sr}from"react/jsx-runtime";var kt=Pt(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,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:s,getSelectionCheckboxProps:m,onClick:x,onCellClick:u,onContextMenu:p,expansion:I,customRowAttributes:c,className:C,style:g,sx:h,contextMenuVisible:S,leftShadowVisible:A}){let{cx:L,classes:R}=kt();return sr(Mt,{children:[sr(wt,{component:"tr",className:L({[R.withPointerCursor]:x||I?.expandOnClick,[R.selected]:l,[R.contextMenuVisible]:S},typeof C=="function"?C(o,e):C),onClick:T=>{if(I){let{isRowExpanded:k,expandOnClick:w,expandRow:F,collapseRow:O}=I;w&&(k(o)?O(o):F(o))}x?.(T)},style:typeof g=="function"?g(o,e):g,sx:h,...c?.(o,e),onContextMenu:p,children:[f&&de(se,{record:o,recordIndex:e,withRightShadow:A,checked:l,disabled:!n||(s?!s(o,e):!1),onChange:n,getCheckboxProps:m}),r.map((T,k)=>{let{accessor:w,hidden:F,visibleMediaQuery:O,textAlignment:$,noWrap:To,ellipsis:wo,width:Po,render:ko,cellsClassName:Y,cellsStyle:_,cellsSx:Mo,customCellAttributes:Ro}=T,no;return u&&(no=Fo=>u({event:Fo,record:o,recordIndex:e,column:T,columnIndex:k})),F?null:de(fe,{className:typeof Y=="function"?Y(o,e):Y,style:typeof _=="function"?_(o,e):_,sx:Mo,visibleMediaQuery:O,record:o,recordIndex:e,onClick:no,accessor:w,textAlignment:$,noWrap:To,ellipsis:wo,width:Po,render:ko,defaultRender:t,customCellAttributes:Ro},w)})]}),I&&de(le,{colSpan:r.filter(T=>!T.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Rt,Paper as Ft,px as Ot}from"@mantine/core";import{useClickOutside as vt,useElementSize as At,useMergedRef as Lt,useWindowEvent as dr}from"@mantine/hooks";import{jsx as Et}from"react/jsx-runtime";var Ht=Rt(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 ue({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=vt(l),{ref:m,width:x,height:u}=At(),p=Lt(s,m),{innerWidth:I,innerHeight:c}=window,{classes:C,theme:{dir:g,spacing:h}}=Ht(),S=Ot(h.md);return Et(Ft,{ref:p,shadow:e,radius:o,className:C.root,sx:{zIndex:r,top:t+u+S>c?c-u-S:t,left:g==="ltr"?f+x+S>I?I-x-S:f:I-S-(f-x-S<0?x+S:f)},children:n})}a();import{createStyles as Nt}from"@mantine/core";import{jsx as Wt}from"react/jsx-runtime";var qt=Nt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function pe(){let{classes:o}=qt();return Wt("div",{className:o.root})}a();import{Box as Ut,Text as zt,UnstyledButton as Vt,createStyles as Gt,px as Xt}from"@mantine/core";import{jsx as cr,jsxs as Zt}from"react/jsx-runtime";var Qt=Gt((o,{color:e})=>{let r=Xt(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 me({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=Qt({color:r});return Zt(Vt,{className:l.root,disabled:t,onClick:f,children:[o&&cr(Ut,{className:l.icon,children:o}),cr(zt,{className:l.title,size:"sm",children:e})]})}a();import{Box as ur,createStyles as Kt,ScrollArea as $t}from"@mantine/core";import{jsx as Do,jsxs as _t}from"react/jsx-runtime";var Yt=Kt(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 xe({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:s,viewportRef:m}){let x=l?l-1:0,{cx:u,classes:p}=Yt();return _t($t,{viewportRef:m,classNames:{root:p.root,scrollbar:p.scrollbar,thumb:p.thumb,corner:p.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[s,Do(ur,{className:u(p.shadow,p.topShadow,{[p.shadowVisible]:o}),sx:{top:f}}),Do("div",{className:u(p.shadow,p.leftShadow,{[p.shadowVisible]:e})}),Do("div",{className:u(p.shadow,p.rightShadow,{[p.shadowVisible]:r})}),Do(ur,{className:u(p.shadow,p.bottomShadow,{[p.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as M,jsxs as mr}from"react/jsx-runtime";var pr={},af=Jt((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}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function xr({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:m,verticalAlignment:x="center",fetching:u,columns:p,defaultColumnRender:I,idAccessor:c="id",records:C,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:S,allRecordsSelectionCheckboxProps:A={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:L=(B,N)=>({"aria-label":`Select record ${N+1}`}),sortStatus:R,sortIcons:T,onSortStatusChange:k,horizontalSpacing:w,page:F,onPageChange:O,totalRecords:$,recordsPerPage:To,onRecordsPerPageChange:wo,recordsPerPageOptions:Po,recordsPerPageLabel:ko="Records per page",paginationColor:Y,paginationSize:_="sm",paginationText:Mo=({from:B,to:N,totalRecords:q})=>`${B} - ${N} / ${q}`,paginationWrapBreakpoint:Ro="sm",getPaginationControlProps:no=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Fo,customLoader:Ir,loaderSize:ir,loaderVariant:gr,loaderColor:Cr,loadingText:Sr="...",emptyState:hr,noRecordsText:ie="No records",noRecordsIcon:br,striped:Br,noHeader:Dr,onRowClick:Oo,onCellClick:yr,onScrollToTop:ge,onScrollToBottom:Ce,onScrollToLeft:Se,onScrollToRight:he,rowContextMenu:v,rowExpansion:Tr,rowClassName:wr,rowStyle:Pr,rowSx:kr,customRowAttributes:Mr,scrollViewportRef:Rr,bodyRef:Fr,m:Or,my:vr,mx:Ar,mt:Lr,mb:Hr,ml:Er,mr:Nr,sx:qr,className:Wr,classNames:lo,style:Ur,styles:vo,...zr}){let{ref:B,width:N,height:q}=fo(),{ref:Vr,height:Ao}=fo(),{ref:Gr,width:Lo,height:j}=fo(),{ref:Xr,height:Qr}=fo(),{ref:Zr,height:be}=fo(),[Ho,Be]=yo(!0),[Eo,De]=yo(!0),[so,ye]=yo(!0),[No,Te]=yo(!0),{rowContextMenuInfo:W,setRowContextMenuInfo:G}=tr(u),Kr=fr({rowExpansion:Tr,records:C,idAccessor:c}),qo=Ie(()=>{if(!u&&v&&G(null),u||j<=q)Be(!0),De(!0);else{let i=B.current.scrollTop,b=i===0,P=j-i-q<1;Be(b),De(P),b&&b!==Ho&&ge?.(),P&&P!==Eo&&Ce?.()}if(u||Lo===N)ye(!0),Te(!0);else{let i=B.current.scrollLeft,b=i===0,P=Lo-i-N<1;ye(b),Te(P),b&&b!==so&&Se?.(),P&&P!==No&&he?.()}},[u,Ce,Se,he,ge,v,q,B,N,Eo,so,No,Ho,G,j,Lo]);Qe(qo,[qo]);let $r=Ie(i=>{B.current.scrollTo({top:0,left:0}),O(i)},[O,B]),co=C?.length,we=C?.map(i=>D(i,c)),uo=!!g,J=g?.map(i=>D(i,c)),Pe=we!==void 0&&J!==void 0&&J.length>0,Wo=S?C?.filter(S):C,po=Wo?.map(i=>D(i,c)),mo=Pe&&po.every(i=>J.includes(i)),Yr=Pe&&po.some(i=>J.includes(i)),_r=Ie(()=>{h?.(mo?g.filter(i=>!po.includes(D(i,c))):ao([...g,...Wo],i=>D(i,c)))},[mo,c,h,po,Wo,g]),{lastSelectionChangeIndex:xo,setLastSelectionChangeIndex:jr}=ar(we),Uo=uo&&!so,{cx:ke,classes:H,theme:Jr}=af({borderColor:r,rowBorderColor:t}),oa={m:Or,my:vr,mx:Ar,mt:Lr,mb:Hr,ml:Er,mr:Nr},Io=typeof vo=="function"?vo(Jr,pr,pr):vo;return mr(jt,{...oa,className:ke(H.root,{[H.tableWithBorder]:o},Wr,lo?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[m]||m,height:n,minHeight:s}),...of(qr)],style:{...Io?.root,...Ur},children:[M(xe,{viewportRef:rf(B,Rr||null),topShadowVisible:!Ho,leftShadowVisible:!(g||so),rightShadowVisible:!No,bottomShadowVisible:!Eo,headerHeight:Ao,footerHeight:Qr,onScrollPositionChange:qo,children:mr(ef,{ref:Gr,horizontalSpacing:w,className:ke(H.table,{[H.tableWithColumnBorders]:f,[H.lastRowBorderBottomVisible]:j<q,[H.textSelectionDisabled]:l,[H.verticalAlignmentTop]:x==="top",[H.verticalAlignmentBottom]:x==="bottom"}),striped:co?Br:!1,...zr,children:[Dr?null:M(Ye,{ref:Vr,className:lo?.header,style:Io?.header,columns:p,sortStatus:R,sortIcons:T,onSortStatusChange:k,selectionVisible:uo,selectionChecked:mo,selectionIndeterminate:Yr&&!mo,onSelectionChange:_r,selectionCheckboxProps:A,leftShadowVisible:Uo}),M("tbody",{ref:Fr,children:co?C.map((i,b)=>{let P=D(i,c),oo=J?.includes(P)||!1,io=!1,go=!1;if(v){let{hidden:y}=v;(!y||!(typeof y=="function"?y(i,b):y))&&(v.trigger==="click"?io=!0:go=!0)}let Co;h&&(Co=y=>{if(y.nativeEvent.shiftKey&&xo!==null){let X=C.filter(b>xo?(U,z)=>z>=xo&&z<=b&&(S?S(U,z):!0):(U,z)=>z>=b&&z<=xo&&(S?S(U,z):!0));h(oo?Ko(g,X,U=>D(U,c)):ao([...g,...X],U=>D(U,c)))}else h(oo?g.filter(X=>D(X,c)!==P):ao([...g,i],X=>D(X,c)));jr(b)});let eo;io?eo=y=>{G({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),Oo?.(i,b,y)}:Oo&&(eo=y=>{Oo(i,b,y)});let Me;return go&&(Me=y=>{y.preventDefault(),G({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),M(ce,{record:i,recordIndex:b,columns:p,defaultColumnRender:I,selectionVisible:uo,selectionChecked:oo,onSelectionChange:Co,isRecordSelectable:S,getSelectionCheckboxProps:L,onClick:eo,onCellClick:yr,onContextMenu:Me,contextMenuVisible:W?D(W.record,c)===P:!1,expansion:Kr,className:wr,style:Pr,sx:kr,customRowAttributes:Mr,leftShadowVisible:Uo},P)}):M(Vo,{})}),p.some(i=>i.footer)&&M(Ze,{ref:Xr,className:lo?.footer,style:Io?.footer,borderColor:r,columns:p,selectionVisible:uo,leftShadowVisible:Uo,scrollDiff:j-q})]})}),F&&M(er,{ref:Zr,className:lo?.pagination,style:Io?.pagination,topBorderColor:r,horizontalSpacing:w,fetching:u,page:F,onPageChange:$r,totalRecords:$,recordsPerPage:To,onRecordsPerPageChange:wo,recordsPerPageOptions:Po,recordsPerPageLabel:ko,paginationColor:Y,paginationSize:_,paginationText:Mo,paginationWrapBreakpoint:Ro,getPaginationControlProps:no,noRecordsText:ie,loadingText:Sr,recordsLength:co}),M(re,{pt:Ao,pb:be,fetching:u,backgroundBlur:Fo,customContent:Ir,size:ir,variant:gr,color:Cr}),M(Zo,{pt:Ao,pb:be,icon:br,text:ie,active:!u&&!co,children:hr}),v&&W&&M(ue,{zIndex:v.zIndex,borderRadius:v.borderRadius,shadow:v.shadow,y:W.y,x:W.x,onDestroy:()=>G(null),children:v.items(W.record,W.recordIndex).map(({divider:i,key:b,title:P,icon:oo,color:io,hidden:go,disabled:Co,onClick:eo})=>i?M(pe,{},b):go?null:M(me,{title:P??ro(b),icon:oo,color:io,disabled:Co,onClick:()=>{G(null),eo()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{xr as DataTable,Ko as differenceBy,D as getValueAtPath,ro as humanize,ao as uniqBy};
|
|
1
|
+
var ta=Object.create;var Me=Object.defineProperty;var fa=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var la=Object.getPrototypeOf,sa=Object.prototype.hasOwnProperty;var da=(o,e)=>()=>(o&&(e=o(o=0)),e);var Uo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ca=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of na(e))!sa.call(o,f)&&f!==r&&Me(o,f,{get:()=>e[f],enumerable:!(t=fa(e,f))||t.enumerable});return o};var ua=(o,e,r)=>(r=o!=null?ta(la(o)):{},ca(e||!o||!o.__esModule?Me(r,"default",{value:o,enumerable:!0}):r,o));import*as s from"react";var a=da(()=>{"use strict"});var Ae=Uo((gf,ve)=>{"use strict";a();var xa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ve.exports=xa});var Ne=Uo((Sf,Ee)=>{"use strict";a();var Ia=Ae();function Le(){}function He(){}He.resetWarningCache=Le;Ee.exports=function(){function o(t,f,l,n,d,p){if(p!==Ia){var x=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 x.name="Invariant Violation",x}}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:He,resetWarningCache:Le};return r.PropTypes=r,r}});var We=Uo((Df,qe)=>{a();qe.exports=Ne()();var bf,Bf});a();a();import{Box as tf,createStyles as ff,packSx as nf,Table as lf}from"@mantine/core";import{useElementSize as no,useMergedRef as sf}from"@mantine/hooks";import{useCallback as ie,useState as To}from"react";a();import{createStyles as pa}from"@mantine/core";import{jsx as Oe}from"react/jsx-runtime";var ma=pa({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Vo(){let{classes:o}=ma();return Oe("tr",{className:o.root,children:Oe("td",{})})}a();import{Center as Ba,createStyles as Da,Text as ya}from"@mantine/core";a();a();var N=ua(We());import{forwardRef as ia,createElement as Ue}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 ga=Object.defineProperty,Ca=Object.defineProperties,Sa=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ve=(o,e,r)=>e in o?ga(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e)=>{for(var r in e||(e={}))Xe.call(e,r)&&Ve(o,r,e[r]);if(ho)for(var r of ho(e))Qe.call(e,r)&&Ve(o,r,e[r]);return o},ha=(o,e)=>Ca(o,Sa(e)),ba=(o,e)=>{var r={};for(var t in o)Xe.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&ho)for(var t of ho(o))e.indexOf(t)<0&&Qe.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=ia((f,l)=>{var n=f,{color:d="currentColor",size:p=24,stroke:x=2,children:c}=n,u=ba(n,["color","size","stroke","children"]);return Ue("svg",Ge(ha(Ge({ref:l},ze),{width:p,height:p,stroke:d,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),u),[...r.map(([I,m])=>Ue(I,m)),...c||[]])});return t.propTypes={color:N.default.string,size:N.default.oneOfType([N.default.string,N.default.number]),stroke:N.default.oneOfType([N.default.string,N.default.number])},t.displayName=`${e}`,t};a();var Go=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 Xo=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 Qo=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 Zo=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 Pa,jsx as bo,jsxs as wa}from"react/jsx-runtime";var Ta=Da(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 Ko({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:d}=Ta();return bo(Ba,{pt:r,pb:t,className:d(n.root,{[n.active]:f}),children:l||wa(Pa,{children:[o||bo("div",{className:n.standardIcon,children:bo(Qo,{})}),bo(ya,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Wa,createStyles as za}from"@mantine/core";import{forwardRef as Ua}from"react";a();import{Box as Oa,createStyles as va}from"@mantine/core";a();import{useMantineTheme as ka}from"@mantine/core";import{useMediaQuery as Ra}from"@mantine/hooks";import{useEffect as Fa,useLayoutEffect as Ma}from"react";var Ze=typeof window<"u"?Ma:Fa;function K(o){let e=ka(),r=typeof o=="function"?o(e):o;return Ra(r||"",!0)}function ao(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 $o(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function to(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function D(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as La}from"react/jsx-runtime";var Aa=va({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Yo({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:d,width:p}){let{cx:x,classes:c}=Aa();return K(t)?La(Oa,{component:"th",className:x({[c.noWrap]:l||n,[c.ellipsis]:n},o),sx:[{"&&":{textAlign:d},width:p,minWidth:p,maxWidth:p},e],style:r,children:f}):null}a();import{createStyles as Ha,px as Ea}from"@mantine/core";import{jsx as qa}from"react/jsx-runtime";var Na=Ha(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:-Ea(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 _o({shadowVisible:o}){let{cx:e,classes:r}=Na();return qa("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as jo,jsxs as Ga}from"react/jsx-runtime";var Va=za((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"}}}),Ke=Ua(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:d},p){let{cx:x,classes:c}=Va({scrollDiff:d,borderColor:t});return jo(Wa,{component:"tfoot",ref:p,className:x(c.root,e),style:r,children:Ga("tr",{children:[l&&jo(_o,{shadowVisible:n}),f.map(({accessor:u,hidden:I,visibleMediaQuery:m,textAlignment:S,width:g,footer:h,footerClassName:C,footerStyle:R,footerSx:k,noWrap:v,ellipsis:T})=>I?null:jo(Yo,{className:C,style:R,sx:k,visibleMediaQuery:m,textAlignment:S,width:g,title:h,noWrap:v,ellipsis:T},u))]})})});a();import{createStyles as rt}from"@mantine/core";import{forwardRef as at}from"react";a();import{Box as $e,Center as Ye,createStyles as Xa,Group as Qa,ActionIcon as Za,Popover as Jo}from"@mantine/core";import{useDisclosure as Ka}from"@mantine/hooks";import{Fragment as _a,jsx as M,jsxs as _e}from"react/jsx-runtime";var $a=Xa(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 Ya({children:o,isActive:e}){let[r,{close:t,toggle:f}]=Ka(!1);return _e(Jo,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[M(Jo.Target,{children:M(Za,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:M(Zo,{size:14})})}),M(Jo.Dropdown,{children:typeof o=="function"?o({close:t}):o})]})}function oe({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:d,textAlignment:p,width:x,sortStatus:c,onSortStatusChange:u,filter:I,filtering:m}){let{cx:S,classes:g}=$a();if(!K(f))return null;let h=l??ao(t),C=typeof h=="string"?h:void 0,R=n&&u?k=>{k?.defaultPrevented||u({columnAccessor:t,direction:c?.columnAccessor===t?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0;return M($e,{component:"th",className:S({[g.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:p},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:R,onKeyDown:k=>k.key==="Enter"&&R?.(),children:_e(Qa,{className:g.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[M($e,{className:S(g.columnHeaderText,g.sortableColumnHeaderText),title:C,children:h}),n||c?.columnAccessor===t?M(_a,{children:c?.columnAccessor===t?M(Ye,{className:S(g.sortableColumnHeaderIcon,{[g.sortableColumnHeaderIconRotated]:c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||M(Go,{size:14})}):M(Ye,{className:g.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:d?.unsorted||M(Xo,{size:14})})}):null,I?M(Ya,{isActive:!!m,children:I}):null]})})}a();import{Checkbox as ja,createStyles as Ja,px as ot}from"@mantine/core";import{jsx as je}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}},checkboxInput:{cursor:"pointer"}}});function ee({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=et();return je("th",{className:l(n.root,{[n.shadowVisible]:o}),children:je(ja,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as re,jsxs as ft}from"react/jsx-runtime";var tt=rt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Je=at(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:d,selectionChecked:p,selectionIndeterminate:x,onSelectionChange:c,selectionCheckboxProps:u,leftShadowVisible:I},m){let{classes:S,cx:g}=tt();return re("thead",{className:g(S.root,e),style:r,ref:m,children:ft("tr",{children:[d&&re(ee,{shadowVisible:I,checked:p,indeterminate:x,checkboxProps:u,onChange:c}),n.map(({accessor:h,hidden:C,visibleMediaQuery:R,textAlignment:k,width:v,title:T,sortable:F,titleClassName:P,titleStyle:A,titleSx:L,filter:W,filtering:Y})=>C?null:re(oe,{className:P,style:A,sx:L,accessor:h,visibleMediaQuery:R,textAlignment:k,width:v,title:T,sortable:F,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:W,filtering:Y},h))]})})});a();import{Center as nt,createStyles as lt,Loader as st}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var dt=lt(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 ae({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:d}){let{classes:p,cx:x}=dt();return or(nt,{pt:o,pb:e,className:x(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||or(st,{size:l,variant:n,color:d}))})}a();import{Box as pt,Pagination as mt,Text as xt,createStyles as It}from"@mantine/core";import{forwardRef as it}from"react";a();import{Button as ct,Group as ut,Menu as Bo,Text as er}from"@mantine/core";import{jsx as $,jsxs as ar}from"react/jsx-runtime";var rr={xs:22,sm:26,md:32,lg:38,xl:44};function te({size:o,label:e,values:r,value:t,onChange:f,color:l}){return ar(ut,{spacing:"xs",children:[$(er,{size:o,children:e}),ar(Bo,{withinPortal:!0,withArrow:!0,children:[$(Bo.Target,{children:$(ct,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:rr[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),$(Bo.Dropdown,{children:r.map(n=>{let d=n===t;return $(Bo.Item,{sx:[{height:rr[o]},p=>({"&&":{color:d?p.white:void 0},background:d?p.colors[l||p.primaryColor][6]:void 0})],disabled:d,onClick:()=>f(n),children:$(er,{size:o,children:n})},n)})})]})]})}import{jsx as fe,jsxs as Ct}from"react/jsx-runtime";var gt=It((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}})),tr=it(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:d,paginationSize:p,loadingText:x,noRecordsText:c,paginationText:u,totalRecords:I,recordsPerPage:m,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:C,horizontalSpacing:R,paginationWrapBreakpoint:k,getPaginationControlProps:v},T){let F;if(f)F=x;else if(!I)F=c;else{let L=(l-1)*m+1,W=L+C-1;F=u({from:L,to:W,totalRecords:I})}let{classes:P,cx:A}=gt({topBorderColor:t,paginationWrapBreakpoint:k});return Ct(pt,{ref:T,px:R??"xs",py:"xs",className:A(P.root,e),style:r,children:[fe(xt,{className:P.text,size:p,children:F}),h&&fe(te,{size:p,label:g,values:h,color:d,value:m,onChange:S}),fe(mt,{color:d,className:A(P.pagination,{[P.paginationFetching]:f||!C}),value:l,onChange:n,size:p,total:Math.ceil(I/m),getControlProps:v})]})});a();import{Box as Ot,createStyles as vt}from"@mantine/core";a();import{Box as St,createStyles as ht}from"@mantine/core";import{jsx as Bt}from"react/jsx-runtime";var bt=ht({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function ne({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:d,ellipsis:p,textAlignment:x,width:c,accessor:u,render:I,defaultRender:m,customCellAttributes:S}){let{cx:g,classes:h}=bt();return K(t)?Bt(St,{component:"td",className:g({[h.noWrap]:d||p,[h.ellipsis]:p,[h.withPointerCursor]:n},o),sx:[{width:c,minWidth:c,maxWidth:c,textAlign:x},e],style:r,onClick:n,...S?.(f,l),children:I?I(f,l):m?m(f,l,u):D(f,u)}):null}a();import{Collapse as Dt,createStyles as yt}from"@mantine/core";a();import{useTimeout as fr}from"@mantine/hooks";import{useEffect as le,useState as fo}from"react";function nr(o){let[e,r]=fo(null),t=o?.join(":")||"";return le(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function lr(o){let[e,r]=fo(null);return le(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:d,allowMultiple:p,initiallyExpanded:x}=o;e&&d==="always"?t=e.map(c=>D(c,r)):x&&(t=e.filter(x).map(c=>D(c,r)),p||(t=[t[0]]))}let f,l,n=fo(t);if(o){let{trigger:d,allowMultiple:p,collapseProps:x,content:c}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let u=I=>l?.(f.filter(m=>m!==D(I,r)));return{expandOnClick:d!=="always"&&d!=="never",isRowExpanded:I=>d==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let m=D(I,r);l?.(p?[...f,m]:[m])},collapseRow:u,collapseProps:x,content:(I,m)=>()=>c({record:I,recordIndex:m,collapse:()=>u(I)})}}}function dr(o,e){let[r,t]=fo(o),[f,l]=fo(o),n=fr(()=>t(!0),0),d=fr(()=>l(!1),e||200);return le(()=>{o?(d.clear(),l(!0),n.start()):(n.clear(),t(!1),d.start())},[n,d,o]),{expanded:r,visible:f}}import{Fragment as Pt,jsx as Do,jsxs as wt}from"react/jsx-runtime";var Tt=yt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function se({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=dr(o,t?.transitionDuration),{cx:n,classes:d}=Tt();return l?wt(Pt,{children:[Do("tr",{}),Do("tr",{children:Do("td",{className:n(d.cell,{[d.expandedCell]:f}),colSpan:e,children:Do(Dt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as kt,createStyles as Rt,px as Ft}from"@mantine/core";import{jsx as cr}from"react/jsx-runtime";var Mt=Rt(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-Ft(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 de({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Mt();return cr("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:d=>d.stopPropagation(),children:cr(kt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Lt,jsx as ce,jsxs as ur}from"react/jsx-runtime";var At=vt(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 ue({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:d,getSelectionCheckboxProps:p,onClick:x,onCellClick:c,onContextMenu:u,expansion:I,customRowAttributes:m,className:S,style:g,sx:h,contextMenuVisible:C,leftShadowVisible:R}){let{cx:k,classes:v}=At();return ur(Lt,{children:[ur(Ot,{component:"tr",className:k({[v.withPointerCursor]:x||I?.expandOnClick,[v.selected]:l,[v.contextMenuVisible]:C},typeof S=="function"?S(o,e):S),onClick:T=>{if(I){let{isRowExpanded:F,expandOnClick:P,expandRow:A,collapseRow:L}=I;P&&(F(o)?L(o):A(o))}x?.(T)},style:typeof g=="function"?g(o,e):g,sx:h,...m?.(o,e),onContextMenu:u,children:[f&&ce(de,{record:o,recordIndex:e,withRightShadow:R,checked:l,disabled:!n||(d?!d(o,e):!1),onChange:n,getCheckboxProps:p}),r.map((T,F)=>{let{accessor:P,hidden:A,visibleMediaQuery:L,textAlignment:W,noWrap:Y,ellipsis:Po,width:wo,render:ko,cellsClassName:_,cellsStyle:j,cellsSx:Ro,customCellAttributes:Fo}=T,lo;return c&&(lo=Mo=>c({event:Mo,record:o,recordIndex:e,column:T,columnIndex:F})),A?null:ce(ne,{className:typeof _=="function"?_(o,e):_,style:typeof j=="function"?j(o,e):j,sx:Ro,visibleMediaQuery:L,record:o,recordIndex:e,onClick:lo,accessor:P,textAlignment:W,noWrap:Y,ellipsis:Po,width:wo,render:ko,defaultRender:t,customCellAttributes:Fo},P)})]}),I&&ce(se,{colSpan:r.filter(T=>!T.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Ht,Paper as Et,px as Nt}from"@mantine/core";import{useClickOutside as qt,useElementSize as Wt,useMergedRef as zt,useWindowEvent as pr}from"@mantine/hooks";import{jsx as Vt}from"react/jsx-runtime";var Ut=Ht(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 pe({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){pr("resize",l),pr("scroll",l);let d=qt(l),{ref:p,width:x,height:c}=Wt(),u=zt(d,p),{innerWidth:I,innerHeight:m}=window,{classes:S,theme:{dir:g,spacing:h}}=Ut(),C=Nt(h.md);return Vt(Et,{ref:u,shadow:e,radius:o,className:S.root,sx:{zIndex:r,top:t+c+C>m?m-c-C:t,left:g==="ltr"?f+x+C>I?I-x-C:f:I-C-(f-x-C<0?x+C:f)},children:n})}a();import{createStyles as Gt}from"@mantine/core";import{jsx as Qt}from"react/jsx-runtime";var Xt=Gt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function me(){let{classes:o}=Xt();return Qt("div",{className:o.root})}a();import{Box as Zt,Text as Kt,UnstyledButton as $t,createStyles as Yt,px as _t}from"@mantine/core";import{jsx as mr,jsxs as Jt}from"react/jsx-runtime";var jt=Yt((o,{color:e})=>{let r=_t(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 xe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=jt({color:r});return Jt($t,{className:l.root,disabled:t,onClick:f,children:[o&&mr(Zt,{className:l.icon,children:o}),mr(Kt,{className:l.title,size:"sm",children:e})]})}a();import{Box as xr,createStyles as of,ScrollArea as ef}from"@mantine/core";import{jsx as yo,jsxs as af}from"react/jsx-runtime";var rf=of(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 Ie({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:d,viewportRef:p}){let x=l?l-1:0,{cx:c,classes:u}=rf();return af(ef,{viewportRef:p,classNames:{root:u.root,scrollbar:u.scrollbar,thumb:u.thumb,corner:u.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[d,yo(xr,{className:c(u.shadow,u.topShadow,{[u.shadowVisible]:o}),sx:{top:f}}),yo("div",{className:c(u.shadow,u.leftShadow,{[u.shadowVisible]:e})}),yo("div",{className:c(u.shadow,u.rightShadow,{[u.shadowVisible]:r})}),yo(xr,{className:c(u.shadow,u.bottomShadow,{[u.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as O,jsxs as ir}from"react/jsx-runtime";var Ir={},df=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}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function gr({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:d,shadow:p,verticalAlignment:x="center",fetching:c,columns:u,defaultColumnRender:I,idAccessor:m="id",records:S,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:C,allRecordsSelectionCheckboxProps:R={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:k=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:v,sortIcons:T,onSortStatusChange:F,horizontalSpacing:P,page:A,onPageChange:L,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:wo,recordsPerPageLabel:ko="Records per page",paginationColor:_,paginationSize:j="sm",paginationText:Ro=({from:B,to:z,totalRecords:U})=>`${B} - ${z} / ${U}`,paginationWrapBreakpoint:Fo="sm",getPaginationControlProps:lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Mo,customLoader:Cr,loaderSize:Sr,loaderVariant:hr,loaderColor:br,loadingText:Br="...",emptyState:Dr,noRecordsText:ge="No records",noRecordsIcon:yr,striped:Tr,noHeader:Pr,onRowClick:Oo,onCellClick:wr,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:he,onScrollToRight:be,rowContextMenu:H,rowExpansion:kr,rowClassName:Rr,rowStyle:Fr,rowSx:Mr,customRowAttributes:Or,scrollViewportRef:vr,bodyRef:Ar,m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr,sx:Ur,className:Vr,classNames:so,style:Gr,styles:vo,...Xr}){let{ref:B,width:z,height:U}=no(),{ref:Qr,height:Ao}=no(),{ref:Zr,width:Lo,height:J}=no(),{ref:Kr,height:$r}=no(),{ref:Yr,height:Be}=no(),[Ho,De]=To(!0),[Eo,ye]=To(!0),[co,Te]=To(!0),[No,Pe]=To(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:Q}=lr(c),_r=sr({rowExpansion:kr,records:S,idAccessor:m}),qo=ie(()=>{if(!c&&H&&Q(null),c||J<=U)De(!0),ye(!0);else{let i=B.current.scrollTop,b=i===0,w=J-i-U<1;De(b),ye(w),b&&b!==Ho&&Ce?.(),w&&w!==Eo&&Se?.()}if(c||Lo===z)Te(!0),Pe(!0);else{let i=B.current.scrollLeft,b=i===0,w=Lo-i-z<1;Te(b),Pe(w),b&&b!==co&&he?.(),w&&w!==No&&be?.()}},[c,Se,he,be,Ce,H,U,B,z,Eo,co,No,Ho,Q,J,Lo]);Ze(qo,[qo]);let jr=ie(i=>{B.current.scrollTo({top:0,left:0}),L(i)},[L,B]),uo=S?.length,we=S?.map(i=>D(i,m)),po=!!g,oo=g?.map(i=>D(i,m)),ke=we!==void 0&&oo!==void 0&&oo.length>0,Wo=C?S?.filter(C):S,mo=Wo?.map(i=>D(i,m)),xo=ke&&mo.every(i=>oo.includes(i)),Jr=ke&&mo.some(i=>oo.includes(i)),oa=ie(()=>{h?.(xo?g.filter(i=>!mo.includes(D(i,m))):to([...g,...Wo],i=>D(i,m)))},[xo,m,h,mo,Wo,g]),{lastSelectionChangeIndex:Io,setLastSelectionChangeIndex:ea}=nr(we),zo=po&&!co,{cx:Re,classes:E,theme:ra}=df({borderColor:r,rowBorderColor:t}),aa={m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr},io=typeof vo=="function"?vo(ra,Ir,Ir):vo;return ir(tf,{...aa,className:Re(E.root,{[E.tableWithBorder]:o},Vr,so?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[p]||p,height:n,minHeight:d}),...nf(Ur)],style:{...io?.root,...Gr},children:[O(Ie,{viewportRef:sf(B,vr||null),topShadowVisible:!Ho,leftShadowVisible:!(g||co),rightShadowVisible:!No,bottomShadowVisible:!Eo,headerHeight:Ao,footerHeight:$r,onScrollPositionChange:qo,children:ir(lf,{ref:Zr,horizontalSpacing:P,className:Re(E.table,{[E.tableWithColumnBorders]:f,[E.lastRowBorderBottomVisible]:J<U,[E.textSelectionDisabled]:l,[E.verticalAlignmentTop]:x==="top",[E.verticalAlignmentBottom]:x==="bottom"}),striped:uo?Tr:!1,...Xr,children:[Pr?null:O(Je,{ref:Qr,className:so?.header,style:io?.header,columns:u,sortStatus:v,sortIcons:T,onSortStatusChange:F,selectionVisible:po,selectionChecked:xo,selectionIndeterminate:Jr&&!xo,onSelectionChange:oa,selectionCheckboxProps:R,leftShadowVisible:zo}),O("tbody",{ref:Ar,children:uo?S.map((i,b)=>{let w=D(i,m),eo=oo?.includes(w)||!1,go=!1,Co=!1;if(H){let{hidden:y}=H;(!y||!(typeof y=="function"?y(i,b):y))&&(H.trigger==="click"?go=!0:Co=!0)}let So;h&&(So=y=>{if(y.nativeEvent.shiftKey&&Io!==null){let Z=S.filter(b>Io?(G,X)=>X>=Io&&X<=b&&(C?C(G,X):!0):(G,X)=>X>=b&&X<=Io&&(C?C(G,X):!0));h(eo?$o(g,Z,G=>D(G,m)):to([...g,...Z],G=>D(G,m)))}else h(eo?g.filter(Z=>D(Z,m)!==w):to([...g,i],Z=>D(Z,m)));ea(b)});let ro;go?ro=y=>{Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),Oo?.(i,b,y)}:Oo&&(ro=y=>{Oo(i,b,y)});let Fe;return Co&&(Fe=y=>{y.preventDefault(),Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),O(ue,{record:i,recordIndex:b,columns:u,defaultColumnRender:I,selectionVisible:po,selectionChecked:eo,onSelectionChange:So,isRecordSelectable:C,getSelectionCheckboxProps:k,onClick:ro,onCellClick:wr,onContextMenu:Fe,contextMenuVisible:V?D(V.record,m)===w:!1,expansion:_r,className:Rr,style:Fr,sx:Mr,customRowAttributes:Or,leftShadowVisible:zo},w)}):O(Vo,{})}),u.some(i=>i.footer)&&O(Ke,{ref:Kr,className:so?.footer,style:io?.footer,borderColor:r,columns:u,selectionVisible:po,leftShadowVisible:zo,scrollDiff:J-U})]})}),A&&O(tr,{ref:Yr,className:so?.pagination,style:io?.pagination,topBorderColor:r,horizontalSpacing:P,fetching:c,page:A,onPageChange:jr,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:wo,recordsPerPageLabel:ko,paginationColor:_,paginationSize:j,paginationText:Ro,paginationWrapBreakpoint:Fo,getPaginationControlProps:lo,noRecordsText:ge,loadingText:Br,recordsLength:uo}),O(ae,{pt:Ao,pb:Be,fetching:c,backgroundBlur:Mo,customContent:Cr,size:Sr,variant:hr,color:br}),O(Ko,{pt:Ao,pb:Be,icon:yr,text:ge,active:!c&&!uo,children:Dr}),H&&V&&O(pe,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:V.y,x:V.x,onDestroy:()=>Q(null),children:H.items(V.record,V.recordIndex).map(({divider:i,key:b,title:w,icon:eo,color:go,hidden:Co,disabled:So,onClick:ro})=>i?O(me,{},b):Co?null:O(xe,{title:w??ao(b),icon:eo,color:go,disabled:So,onClick:()=>{Q(null),ro()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{gr as DataTable,$o as differenceBy,D as getValueAtPath,ao as humanize,to as uniqBy};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|