mantine-datatable 2.4.2 → 2.4.3
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 +1 -0
- package/dist/DataTableHeader.d.ts.map +1 -1
- package/dist/DataTableHeaderSelectorCell.d.ts +2 -1
- package/dist/DataTableHeaderSelectorCell.d.ts.map +1 -1
- package/dist/DataTablePaginationFooter.d.ts +1 -1
- package/dist/DataTablePaginationFooter.d.ts.map +1 -1
- package/dist/DataTableRow.d.ts +2 -1
- package/dist/DataTableRow.d.ts.map +1 -1
- package/dist/DataTableRowSelectorCell.d.ts +5 -2
- package/dist/DataTableRowSelectorCell.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/dist/tests/DataTableFooter/DefaultProps.d.ts +5 -0
- package/dist/tests/DataTableFooter/DefaultProps.d.ts.map +1 -1
- package/dist/types/DataTablePaginationProps.d.ts +6 -1
- package/dist/types/DataTablePaginationProps.d.ts.map +1 -1
- package/dist/types/DataTableSelectionProps.d.ts +10 -0
- package/dist/types/DataTableSelectionProps.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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};
|
|
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};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|