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