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