mantine-datatable 2.0.2 → 2.1.0
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/README.md +2 -1
- package/dist/DataTable.d.ts +1 -1
- package/dist/DataTable.d.ts.map +1 -1
- package/dist/hooks.d.ts +0 -10
- package/dist/hooks.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/types/DataTableProps.d.ts +16 -0
- package/dist/types/DataTableProps.d.ts.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# Mantine DataTable
|
|
2
2
|
|
|
3
|
+

|
|
3
4
|
[![NPM version][npm-image]][npm-url]
|
|
4
5
|
[![License][license-image]][license-url]
|
|
5
6
|
[![Stars][stars-image]][stars-url]
|
|
6
7
|
[![Last commit][last-commit-image]][repo-url]
|
|
7
8
|
[![Closed issues][closed-issues-image]][closed-issues-url]
|
|
8
9
|
[![Downloads][downloads-image]][npm-url]
|
|
9
|
-
[![Language][language-image]][repo-url]
|
|
10
|
+
[![Language][language-image]][repo-url]
|
|
10
11
|
|
|
11
12
|
A "dark-theme aware" **table component** for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, multiple rows selection, column sorting, custom cell data rendering, row context menu, row expansion, and more.
|
|
12
13
|
|
package/dist/DataTable.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DataTableProps } from './types';
|
|
2
|
-
export default function DataTable<T>({ withBorder, borderRadius, borderColor, rowBorderColor, withColumnBorders, textSelectionDisabled, height, minHeight, shadow, verticalAlignment, fetching, columns, defaultColumnRender, idAccessor, records, selectedRecords, onSelectedRecordsChange, isRecordSelectable, sortStatus, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationColor, paginationSize, paginationText, paginationWrapBreakpoint, loaderBackgroundBlur, customLoader, loaderSize, loaderVariant, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, striped, onRowClick, onCellClick, rowContextMenu, rowExpansion, rowClassName, rowStyle, rowSx, customRowAttributes, bodyRef, m, my, mx, mt, mb, ml, mr, sx, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): JSX.Element;
|
|
2
|
+
export default function DataTable<T>({ withBorder, borderRadius, borderColor, rowBorderColor, withColumnBorders, textSelectionDisabled, height, minHeight, shadow, verticalAlignment, fetching, columns, defaultColumnRender, idAccessor, records, selectedRecords, onSelectedRecordsChange, isRecordSelectable, sortStatus, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationColor, paginationSize, paginationText, paginationWrapBreakpoint, loaderBackgroundBlur, customLoader, loaderSize, loaderVariant, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, striped, onRowClick, onCellClick, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, rowContextMenu, rowExpansion, rowClassName, rowStyle, rowSx, customRowAttributes, bodyRef, m, my, mx, mt, mb, ml, mr, sx, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): JSX.Element;
|
|
3
3
|
//# sourceMappingURL=DataTable.d.ts.map
|
package/dist/DataTable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2EzC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,EACnC,UAAU,EACV,YAAY,EACZ,WAAqG,EACrG,cACiG,EACjG,iBAAiB,EACjB,qBAAqB,EACrB,MAAe,EACf,SAAS,EACT,MAAM,EACN,iBAA4B,EAC5B,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,UAAiB,EACjB,OAAO,EACP,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,mBAAwC,EACxC,eAAe,EACf,cAAqB,EACrB,cAAoF,EACpF,wBAA+B,EAC/B,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAmB,EACnB,UAAU,EACV,aAA4B,EAC5B,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,OAAO,EACP,CAAC,EACD,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,GAAG,UAAU,EACd,EAAE,cAAc,CAAC,CAAC,CAAC,eA4UnB"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DataTableRowExpansionProps } from './types';
|
|
3
|
-
export declare function useScrollStatus(): {
|
|
4
|
-
scrolledToTop: boolean;
|
|
5
|
-
setScrolledToTop: (newValue: boolean) => void;
|
|
6
|
-
scrolledToBottom: boolean;
|
|
7
|
-
setScrolledToBottom: (newValue: boolean) => void;
|
|
8
|
-
scrolledToLeft: boolean;
|
|
9
|
-
setScrolledToLeft: (newValue: boolean) => void;
|
|
10
|
-
scrolledToRight: boolean;
|
|
11
|
-
setScrolledToRight: (newValue: boolean) => void;
|
|
12
|
-
};
|
|
13
3
|
export declare function useLastSelectionChangeIndex(recordIds: unknown[] | undefined): {
|
|
14
4
|
lastSelectionChangeIndex: number | null;
|
|
15
5
|
setLastSelectionChangeIndex: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../hooks.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../hooks.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAG1D,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS;;;EAQ3E;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO;;WAEhD,MAAM;WACN,MAAM;gBACD,CAAC;qBACI,MAAM;;;WAHhB,MAAM;WACN,MAAM;gBACD,CAAC;qBACI,MAAM;;EAMtB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,EACjC,YAAY,EACZ,OAAO,EACP,UAAU,GACX,EAAE;IACD,YAAY,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;;4BA+B6B,CAAC;wBAEL,CAAC;0BAPM,CAAC;;sBAaV,CAAC,eAAe,MAAM;cAI7C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,MAAM;;;EAoB/E"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var oa=Object.create;var Do=Object.defineProperty;var ea=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var aa=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var fa=(o,e)=>()=>(o&&(e=o(o=0)),e);var oe=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),na=(o,e)=>{for(var r in e)Do(o,r,{get:e[r],enumerable:!0})},ve=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of ra(e))!ta.call(o,f)&&f!==r&&Do(o,f,{get:()=>e[f],enumerable:!(t=ea(e,f))||t.enumerable});return o};var He=(o,e,r)=>(r=o!=null?oa(aa(o)):{},ve(e||!o||!o.__esModule?Do(r,"default",{value:o,enumerable:!0}):r,o)),la=o=>ve(Do({},"__esModule",{value:!0}),o);var s,a=fa(()=>{"use strict";s=He(require("react"),1)});var qe=oe((va,Ee)=>{"use strict";a();var sa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ee.exports=sa});var Ue=oe((Na,Ve)=>{"use strict";a();var ca=qe();function We(){}function ze(){}ze.resetWarningCache=We;Ve.exports=function(){function o(t,f,n,d,c,m){if(m!==ca){var p=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 p.name="Invariant Violation",p}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:ze,resetWarningCache:We};return r.PropTypes=r,r}});var Xe=oe((za,Ge)=>{a();Ge.exports=Ue()();var qa,Wa});var ka={};na(ka,{DataTable:()=>Se});module.exports=la(ka);a();a();var $=require("@mantine/core"),ho=require("@mantine/hooks"),gr=require("react");a();var Ne=require("@mantine/core"),ee=require("react/jsx-runtime"),da=(0,Ne.createStyles)({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function re(){let{classes:o}=da();return(0,ee.jsx)("tr",{className:o.root,children:(0,ee.jsx)("td",{})})}a();var fo=require("@mantine/core");a();a();var Co=require("react"),G=He(Xe());a();var Ze={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ua=Object.defineProperty,pa=Object.defineProperties,ma=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Ke=(o,e,r)=>e in o?ua(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,$e=(o,e)=>{for(var r in e||(e={}))_e.call(e,r)&&Ke(o,r,e[r]);if(Fo)for(var r of Fo(e))Ye.call(e,r)&&Ke(o,r,e[r]);return o},xa=(o,e)=>pa(o,ma(e)),Ia=(o,e)=>{var r={};for(var t in o)_e.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Fo)for(var t of Fo(o))e.indexOf(t)<0&&Ye.call(o,t)&&(r[t]=o[t]);return r},to=(o,e,r)=>{let t=(0,Co.forwardRef)((f,n)=>{var d=f,{color:c="currentColor",size:m=24,stroke:p=2,children:l}=d,g=Ia(d,["color","size","stroke","children"]);return(0,Co.createElement)("svg",$e(xa($e({ref:n},Ze),{width:m,height:m,stroke:c,strokeWidth:p,className:`tabler-icon tabler-icon-${o}`}),g),[...r.map(([x,u])=>(0,Co.createElement)(x,u)),...l||[]])});return t.propTypes={color:G.default.string,size:G.default.oneOfType([G.default.string,G.default.number]),stroke:G.default.oneOfType([G.default.string,G.default.number])},t.displayName=`${e}`,t};a();var ae=to("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var te=to("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var fe=to("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"}]]);var N=require("react/jsx-runtime"),ia=(0,fo.createStyles)(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 ne({icon:o,text:e,pt:r,pb:t,active:f,children:n}){let{classes:d,cx:c}=ia();return(0,N.jsx)(fo.Center,{pt:r,pb:t,className:c(d.root,{[d.active]:f}),children:n||(0,N.jsxs)(N.Fragment,{children:[o||(0,N.jsx)("div",{className:d.standardIcon,children:(0,N.jsx)(fe,{})}),(0,N.jsx)(fo.Text,{size:"sm",color:"dimmed",children:e})]})})}a();var X=require("@mantine/core"),Je=require("react");a();var F=require("@mantine/core"),A=require("react/jsx-runtime"),Qe={xs:22,sm:26,md:32,lg:38,xl:44};function le({size:o,label:e,values:r,value:t,onChange:f,color:n}){return(0,A.jsxs)(F.Group,{spacing:"xs",children:[(0,A.jsx)(F.Text,{size:o,children:e}),(0,A.jsxs)(F.Menu,{withinPortal:!0,withArrow:!0,children:[(0,A.jsx)(F.Menu.Target,{children:(0,A.jsx)(F.Button,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:Qe[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),(0,A.jsx)(F.Menu.Dropdown,{children:r.map(d=>{let c=d===t;return(0,A.jsx)(F.Menu.Item,{sx:[{height:Qe[o]},m=>({"&&":{color:c?m.white:void 0},background:c?m.colors[n||m.primaryColor][6]:void 0})],disabled:c,onClick:()=>f(d),children:(0,A.jsx)(F.Text,{size:o,children:d})},d)})})]})]})}var no=require("react/jsx-runtime"),ga=(0,X.createStyles)((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),je=(0,Je.forwardRef)(function({className:e,style:r,topBorderColor:t,fetching:f,page:n,onPageChange:d,paginationColor:c,paginationSize:m,loadingText:p,noRecordsText:l,paginationText:g,totalRecords:x,recordsPerPage:u,onRecordsPerPageChange:i,recordsPerPageLabel:C,recordsPerPageOptions:h,recordsLength:b,horizontalSpacing:_,paginationWrapBreakpoint:v},w){let R;if(f)R=p;else if(!x)R=l;else{let V=(n-1)*u+1,co=V+b-1;R=g({from:V,to:co,totalRecords:x})}let{classes:O,cx:k}=ga({topBorderColor:t,paginationWrapBreakpoint:v});return(0,no.jsxs)(X.Box,{ref:w,px:_??"xs",py:"xs",className:k(O.root,e),style:r,children:[(0,no.jsx)(X.Text,{className:O.text,size:m,children:R}),h&&(0,no.jsx)(le,{size:m,label:C,values:h,value:u,onChange:i}),(0,no.jsx)(X.Pagination,{color:c,className:k(O.pagination,{[O.paginationFetching]:f||!b}),value:n,onChange:d,size:m,total:Math.ceil(x/u)})]})});a();var Lo=require("@mantine/core"),ar=require("react");a();var P=require("@mantine/core");a();var or=require("@mantine/core"),er=require("@mantine/hooks");function ko(o){let e=(0,or.useMantineTheme)(),r=typeof o=="function"?o(e):o;return(0,er.useMediaQuery)(r||"",!0)}function Ao(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function rr(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function Po(o,e){return o.filter((r,t,f)=>t===f.findIndex(n=>e(r)===e(n)))}function S(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}var E=require("react/jsx-runtime"),Ca=(0,P.createStyles)(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 de({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:n,sortable:d,textAlignment:c,width:m,sortStatus:p,onSortStatusChange:l}){let{cx:g,classes:x}=Ca();if(!ko(f))return null;let u=n??Ao(t),i=typeof u=="string"?u:void 0;return(0,E.jsx)(P.Box,{component:"th",className:g({[x.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:c},width:m,minWidth:m,maxWidth:m},e],style:r,role:d?"button":void 0,onClick:d&&l?()=>{l({columnAccessor:t,direction:p?.direction==="asc"?"desc":"asc"})}:void 0,children:d||p?.columnAccessor===t?(0,E.jsxs)(P.Group,{className:x.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[(0,E.jsx)(P.Box,{className:g(x.columnHeaderText,x.sortableColumnHeaderText),title:i,children:u}),(0,E.jsx)(P.Center,{children:p?.columnAccessor===t?(0,E.jsx)(ae,{className:g(x.sortableColumnHeaderIcon,{[x.sortableColumnHeaderIconRotated]:p.direction==="desc"}),size:14}):(0,E.jsx)(te,{className:x.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,E.jsx)(P.Box,{className:x.columnHeaderText,title:i,children:u})})}var j=require("react/jsx-runtime"),Sa=(0,Lo.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"},selectorColumnHeader:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-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"}},selectorColumnHeaderWithRightShadow:{"&::after":{opacity:1}},selectionCheckboxInput:{cursor:"pointer"}}}),tr=(0,ar.forwardRef)(function({className:e,style:r,sortStatus:t,onSortStatusChange:f,columns:n,selectionVisible:d,selectionChecked:c,selectionIndeterminate:m,onSelectionChange:p,leftShadowVisible:l},g){let{classes:x,cx:u}=Sa();return(0,j.jsx)("thead",{className:u(x.root,e),style:r,ref:g,children:(0,j.jsxs)("tr",{children:[d&&(0,j.jsx)("th",{className:u(x.selectorColumnHeader,{[x.selectorColumnHeaderWithRightShadow]:l}),children:(0,j.jsx)(Lo.Checkbox,{classNames:{input:x.selectionCheckboxInput},checked:c,indeterminate:m,disabled:!p,onChange:p})}),n.map(({accessor:i,hidden:C,visibleMediaQuery:h,textAlignment:b,width:_,title:v,sortable:w,titleClassName:R,titleStyle:O,titleSx:k})=>C?null:(0,j.jsx)(de,{className:R,style:O,sx:k,accessor:i,visibleMediaQuery:h,textAlignment:b,width:_,title:v,sortable:w,sortStatus:t,onSortStatusChange:f},i))]})})});a();var lo=require("@mantine/core"),se=require("react/jsx-runtime"),ha=(0,lo.createStyles)(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function ce({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:n,variant:d,color:c}){let{classes:m,cx:p}=ha();return(0,se.jsx)(lo.Center,{pt:o,pb:e,className:p(m.root,{[m.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||(0,se.jsx)(lo.Loader,{size:n,variant:d,color:c}))})}a();var qo=require("@mantine/core");a();var Mo=require("@mantine/core");var fr=require("react/jsx-runtime"),ba=(0,Mo.createStyles)({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function ue({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:n,onClick:d,noWrap:c,ellipsis:m,textAlignment:p,width:l,accessor:g,render:x,defaultRender:u,customCellAttributes:i}){let{cx:C,classes:h}=ba();return ko(t)?(0,fr.jsx)(Mo.Box,{component:"td",className:C({[h.noWrap]:c||m,[h.ellipsis]:m,[h.withPointerCursor]:d},o),sx:[{width:l,minWidth:l,maxWidth:l,textAlign:p},e],style:r,onClick:d,...i?.(f,n),children:x?x(f,n):u?u(f,n,g):S(f,g)}):null}a();var No=require("@mantine/core");a();var Z=require("@mantine/hooks"),L=require("react");var vo=200,Ho={leading:!0};function nr(){let[o,e]=(0,Z.useDebouncedState)(!0,vo,Ho),[r,t]=(0,Z.useDebouncedState)(!0,vo,Ho),[f,n]=(0,Z.useDebouncedState)(!0,vo,Ho),[d,c]=(0,Z.useDebouncedState)(!0,vo,Ho);return{scrolledToTop:o,setScrolledToTop:e,scrolledToBottom:r,setScrolledToBottom:t,scrolledToLeft:f,setScrolledToLeft:n,scrolledToRight:d,setScrolledToRight:c}}function lr(o){let[e,r]=(0,L.useState)(null),t=o?.join(":")||"";return(0,L.useEffect)(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function dr(o){let[e,r]=(0,L.useState)(null);return(0,L.useEffect)(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:c,allowMultiple:m,initiallyExpanded:p}=o;e&&c==="always"?t=e.map(l=>S(l,r)):p&&(t=e.filter(p).map(l=>S(l,r)),m||(t=[t[0]]))}let f,n,d=(0,L.useState)(t);if(o){let{trigger:c,allowMultiple:m,collapseProps:p,content:l}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=d;let g=x=>n(f.filter(u=>u!==S(x,r)));return{expandOnClick:c!=="always"&&c!=="never",isRowExpanded:x=>c==="always"?!0:f.includes(S(x,r)),expandRow:x=>{let u=S(x,r);n(m?[...f,u]:[u])},collapseRow:g,collapseProps:p,content:(x,u)=>()=>l({record:x,recordIndex:u,collapse:()=>g(x)})}}}function cr(o,e){let[r,t]=(0,L.useState)(o),[f,n]=(0,L.useState)(o),d=(0,Z.useTimeout)(()=>t(!0),0),c=(0,Z.useTimeout)(()=>n(!1),e||200);return(0,L.useEffect)(()=>{o?(c.clear(),n(!0),d.start()):(d.clear(),t(!1),c.start())},[d,c,o]),{expanded:r,visible:f}}var q=require("react/jsx-runtime"),Ba=(0,No.createStyles)({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function pe({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:n}=cr(o,t?.transitionDuration),{cx:d,classes:c}=Ba();return n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("tr",{}),(0,q.jsx)("tr",{children:(0,q.jsx)("td",{className:d(c.cell,{[c.expandedCell]:f}),colSpan:e,children:(0,q.jsx)(No.Collapse,{in:f,...t,children:r()})})})]}):null}a();var Eo=require("@mantine/core"),me=require("react/jsx-runtime"),ya=(0,Eo.createStyles)(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:-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 xe({withRightShadow:o,...e}){let{cx:r,classes:t}=ya();return(0,me.jsx)("td",{className:r(t.root,{[t.withRightShadow]:o}),children:(0,me.jsx)(Eo.Checkbox,{classNames:{input:t.checkbox},...e,onClick:f=>f.stopPropagation()})})}var W=require("react/jsx-runtime"),Ta=(0,qo.createStyles)(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 Ie({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:n,onSelectionChange:d,isRecordSelectable:c,onClick:m,onCellClick:p,onContextMenu:l,expansion:g,customRowAttributes:x,className:u,style:i,sx:C,contextMenuVisible:h,leftShadowVisible:b}){let{cx:_,classes:v}=Ta();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(qo.Box,{component:"tr",className:_({[v.withPointerCursor]:m||g?.expandOnClick,[v.selected]:n,[v.contextMenuVisible]:h},typeof u=="function"?u(o,e):u),onClick:w=>{if(g){let{isRowExpanded:R,expandOnClick:O,expandRow:k,collapseRow:V}=g;O&&(R(o)?V(o):k(o))}m?.(w)},style:typeof i=="function"?i(o,e):i,sx:C,...x?.(o,e),onContextMenu:l,children:[f&&(0,W.jsx)(xe,{withRightShadow:b,checked:n,disabled:!d||(c?!c(o,e):!1),onChange:d}),r.map((w,R)=>{let{accessor:O,hidden:k,visibleMediaQuery:V,textAlignment:co,noWrap:Wo,ellipsis:zo,width:Vo,render:Uo,cellsClassName:uo,cellsStyle:po,cellsSx:Go,customCellAttributes:Xo}=w,bo;return p&&(bo=()=>p({record:o,recordIndex:e,column:w,columnIndex:R})),k?null:(0,W.jsx)(ue,{className:typeof uo=="function"?uo(o,e):uo,style:typeof po=="function"?po(o,e):po,sx:Go,visibleMediaQuery:V,record:o,recordIndex:e,onClick:bo,accessor:O,textAlignment:co,noWrap:Wo,ellipsis:zo,width:Vo,render:Uo,defaultRender:t,customCellAttributes:Xo},O)})]}),g&&(0,W.jsx)(pe,{colSpan:r.filter(w=>!w.hidden).length+(f?1:0),open:g.isRowExpanded(o),content:g.content(o,e),collapseProps:g.collapseProps})]})}a();var K=require("@mantine/core"),z=require("@mantine/hooks"),ur=require("react/jsx-runtime"),wa=(0,K.createStyles)(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 ie({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:n,children:d}){(0,z.useWindowEvent)("resize",n),(0,z.useWindowEvent)("scroll",n);let c=(0,z.useClickOutside)(n),{ref:m,width:p,height:l}=(0,z.useElementSize)(),g=(0,z.useMergedRef)(c,m),{dir:x,spacing:u}=(0,K.useMantineTheme)(),i=(0,K.px)(u.md),{innerWidth:C,innerHeight:h}=window,{classes:b}=wa();return(0,ur.jsx)(K.Paper,{ref:g,shadow:e,radius:o,className:b.root,sx:{zIndex:r,top:t+l+i>h?h-l-i:t,left:x==="ltr"?f+p+i>C?C-p-i:f:C-i-(f-p-i<0?p+i:f)},children:d})}a();var pr=require("@mantine/core"),mr=require("react/jsx-runtime"),Ra=(0,pr.createStyles)(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function ge(){let{classes:o}=Ra();return(0,mr.jsx)("div",{className:o.root})}a();var M=require("@mantine/core"),So=require("react/jsx-runtime"),Oa=(0,M.createStyles)((o,{color:e})=>{let r=(0,M.px)(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function Ce({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:n}=Oa({color:r});return(0,So.jsxs)(M.UnstyledButton,{className:n.root,disabled:t,onClick:f,children:[o&&(0,So.jsx)(M.Box,{className:n.icon,children:o}),(0,So.jsx)(M.Text,{className:n.title,size:"sm",children:e})]})}a();var so=require("@mantine/core"),xr=require("react"),oo=require("react/jsx-runtime"),Da=(0,so.createStyles)(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}}}),Ir=(0,xr.forwardRef)(function({topShadowVisible:e,leftShadowVisible:r,rightShadowVisible:t,bottomShadowVisible:f,headerHeight:n,onScrollPositionChange:d,children:c},m){let{cx:p,classes:l}=Da();return(0,oo.jsxs)(so.ScrollArea,{viewportRef:m,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:n}},onScrollPositionChange:d,children:[c,(0,oo.jsx)(so.Box,{className:p(l.shadow,l.topShadow,{[l.shadowVisible]:e}),sx:{top:n}}),(0,oo.jsx)("div",{className:p(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,oo.jsx)("div",{className:p(l.shadow,l.rightShadow,{[l.shadowVisible]:t})}),(0,oo.jsx)("div",{className:p(l.shadow,l.bottomShadow,{[l.shadowVisible]:f})})]})});var y=require("react/jsx-runtime"),ir={},Fa=(0,$.createStyles)((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Se({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:d="100%",minHeight:c,shadow:m,verticalAlignment:p="center",fetching:l,columns:g,defaultColumnRender:x,idAccessor:u="id",records:i,selectedRecords:C,onSelectedRecordsChange:h,isRecordSelectable:b,sortStatus:_,onSortStatusChange:v,horizontalSpacing:w,page:R,onPageChange:O,totalRecords:k,recordsPerPage:V,onRecordsPerPageChange:co,recordsPerPageOptions:Wo,recordsPerPageLabel:zo="Records per page",paginationColor:Vo,paginationSize:Uo="sm",paginationText:uo=({from:B,to:mo,totalRecords:eo})=>`${B} - ${mo} / ${eo}`,paginationWrapBreakpoint:po="sm",loaderBackgroundBlur:Go,customLoader:Xo,loaderSize:bo,loaderVariant:Cr,loaderColor:Sr,loadingText:hr="...",emptyState:br,noRecordsText:he="No records",noRecordsIcon:Br,striped:yr,onRowClick:Zo,onCellClick:Tr,rowContextMenu:H,rowExpansion:wr,rowClassName:Rr,rowStyle:Or,rowSx:Dr,customRowAttributes:Fr,bodyRef:kr,m:Ar,my:Pr,mx:Lr,mt:Mr,mb:vr,ml:Hr,mr:Nr,sx:Er,className:qr,classNames:Ko,style:Wr,styles:$o,...zr}){let{ref:B,width:mo,height:eo}=(0,ho.useElementSize)(),{ref:Vr,height:_o}=(0,ho.useElementSize)(),{ref:Ur,width:Yo,height:Bo}=(0,ho.useElementSize)(),{ref:Gr,height:be}=(0,ho.useElementSize)(),{scrolledToTop:Xr,setScrolledToTop:Be,scrolledToBottom:Zr,setScrolledToBottom:ye,scrolledToLeft:Te,setScrolledToLeft:we,scrolledToRight:Kr,setScrolledToRight:Re}=nr(),{rowContextMenuInfo:Y,setRowContextMenuInfo:xo}=dr(l),$r=sr({rowExpansion:wr,records:i,idAccessor:u}),Oe=()=>{if(!l&&H&&xo(null),l||Bo<=eo)Be(!0),ye(!0);else{let I=B.current.scrollTop;Be(I===0),ye(Math.round(Bo-I)===Math.round(eo))}if(l||Yo===mo)we(!0),Re(!0);else{let I=B.current.scrollLeft;we(I===0),Re(Math.round(Yo-I)===Math.round(mo))}};(0,gr.useEffect)(Oe,[l,eo,B,mo,Bo,Yo]);let _r=I=>{B.current.scrollTo({top:0,left:0}),O(I)},yo=i?.length,De=i?.map(I=>S(I,u)),Io=C?.map(I=>S(I,u)),Fe=De!==void 0&&Io!==void 0&&Io.length>0,ke=b?i?.filter(b):i,Qo=ke?.map(I=>S(I,u)),Jo=Fe&&Qo.every(I=>Io.includes(I)),Yr=Fe&&Qo.some(I=>Io.includes(I)),Ae;h&&(Ae=()=>{h(Jo?C.filter(I=>!Qo.includes(S(I,u))):Po([...C,...ke],I=>S(I,u)))});let{lastSelectionChangeIndex:To,setLastSelectionChangeIndex:Qr}=lr(De),Pe=!!C&&!Te,{cx:Le,classes:U,theme:Jr}=Fa({borderColor:r,rowBorderColor:t}),jr={m:Ar,my:Pr,mx:Lr,mt:Mr,mb:vr,ml:Hr,mr:Nr},jo=typeof $o=="function"?$o(Jr,ir,ir):$o;return(0,y.jsxs)($.Box,{...jr,className:Le(U.root,{[U.tableWithBorder]:o},qr,Ko?.root),sx:[I=>({borderRadius:I.radius[e]||e,boxShadow:I.shadows[m]||m,height:d,minHeight:c}),...(0,$.packSx)(Er)],style:{...jo?.root,...Wr},children:[(0,y.jsx)(Ir,{ref:B,topShadowVisible:!Xr,leftShadowVisible:!(C||Te),rightShadowVisible:!Kr,bottomShadowVisible:!Zr,headerHeight:_o,onScrollPositionChange:Oe,children:(0,y.jsxs)($.Table,{ref:Ur,horizontalSpacing:w,className:Le(U.table,{[U.tableWithColumnBorders]:f,[U.lastRowBorderBottomVisible]:Bo<eo,[U.textSelectionDisabled]:n,[U.verticalAlignmentTop]:p==="top",[U.verticalAlignmentBottom]:p==="bottom"}),striped:yo?yr:!1,...zr,children:[(0,y.jsx)(tr,{ref:Vr,className:Ko?.header,style:jo?.header,columns:g,sortStatus:_,onSortStatusChange:v,selectionVisible:!!C,selectionChecked:Jo,selectionIndeterminate:Yr&&!Jo,onSelectionChange:Ae,leftShadowVisible:Pe}),(0,y.jsx)("tbody",{ref:kr,children:yo?i.map((I,T)=>{let ro=S(I,u),io=Io?.includes(ro)||!1,wo=!1,Ro=!1;if(H){let{hidden:D}=H;(!D||!(typeof D=="function"?D(I,T):D))&&(H.trigger==="click"?wo=!0:Ro=!0)}let Oo;h&&(Oo=D=>{if(D.nativeEvent.shiftKey&&To!==null){let ao=i.filter(T>To?(Q,J)=>J>=To&&J<=T&&(b?b(Q,J):!0):(Q,J)=>J>=T&&J<=To&&(b?b(Q,J):!0));h(io?rr(C,ao,Q=>S(Q,u)):Po([...C,...ao],Q=>S(Q,u)))}else h(io?C.filter(ao=>S(ao,u)!==ro):Po([...C,I],ao=>S(ao,u)));Qr(T)});let go;wo?go=D=>{xo({y:D.clientY,x:D.clientX,record:I,recordIndex:T}),Zo?.(I,T)}:Zo&&(go=()=>{Zo(I,T)});let Me;return Ro&&(Me=D=>{D.preventDefault(),xo({y:D.clientY,x:D.clientX,record:I,recordIndex:T})}),(0,y.jsx)(Ie,{record:I,recordIndex:T,columns:g,defaultColumnRender:x,selectionVisible:!!C,selectionChecked:io,onSelectionChange:Oo,isRecordSelectable:b,onClick:go,onCellClick:Tr,onContextMenu:Me,contextMenuVisible:Y?S(Y.record,u)===ro:!1,expansion:$r,className:Rr,style:Or,sx:Dr,customRowAttributes:Fr,leftShadowVisible:Pe},ro)}):(0,y.jsx)(re,{})})]})}),R&&(0,y.jsx)(je,{ref:Gr,className:Ko?.pagination,style:jo?.pagination,topBorderColor:r,horizontalSpacing:w,fetching:l,page:R,onPageChange:_r,totalRecords:k,recordsPerPage:V,onRecordsPerPageChange:co,recordsPerPageOptions:Wo,recordsPerPageLabel:zo,paginationColor:Vo,paginationSize:Uo,paginationText:uo,paginationWrapBreakpoint:po,noRecordsText:he,loadingText:hr,recordsLength:yo}),(0,y.jsx)(ce,{pt:_o,pb:be,fetching:l,backgroundBlur:Go,customContent:Xo,size:bo,variant:Cr,color:Sr}),(0,y.jsx)(ne,{pt:_o,pb:be,icon:Br,text:he,active:!l&&!yo,children:br}),H&&Y&&(0,y.jsx)(ie,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:Y.y,x:Y.x,onDestroy:()=>xo(null),children:H.items(Y.record,Y.recordIndex).map(({divider:I,key:T,title:ro,icon:io,color:wo,hidden:Ro,disabled:Oo,onClick:go})=>I?(0,y.jsx)(ge,{},T):Ro?null:(0,y.jsx)(Ce,{title:ro??Ao(T),icon:io,color:wo,disabled:Oo,onClick:()=>{xo(null),go()}},T))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();
|
|
1
|
+
"use strict";var ea=Object.create;var Ro=Object.defineProperty;var ra=Object.getOwnPropertyDescriptor;var aa=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,fa=Object.prototype.hasOwnProperty;var na=(o,e)=>()=>(o&&(e=o(o=0)),e);var re=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),la=(o,e)=>{for(var r in e)Ro(o,r,{get:e[r],enumerable:!0})},Ue=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of aa(e))!fa.call(o,f)&&f!==r&&Ro(o,f,{get:()=>e[f],enumerable:!(t=ra(e,f))||t.enumerable});return o};var ze=(o,e,r)=>(r=o!=null?ea(ta(o)):{},Ue(e||!o||!o.__esModule?Ro(r,"default",{value:o,enumerable:!0}):r,o)),da=o=>Ue(Ro({},"__esModule",{value:!0}),o);var s,a=na(()=>{"use strict";s=ze(require("react"),1)});var Xe=re((Ha,Ge)=>{"use strict";a();var ca="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ge.exports=ca});var $e=re((Ea,Ke)=>{"use strict";a();var ua=Xe();function Ze(){}function Qe(){}Qe.resetWarningCache=Ze;Ke.exports=function(){function o(t,f,l,d,u,m){if(m!==ua){var p=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 p.name="Invariant Violation",p}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Qe,resetWarningCache:Ze};return r.PropTypes=r,r}});var _e=re((za,Ye)=>{a();Ye.exports=$e()();var Wa,Ua});var ka={};la(ka,{DataTable:()=>Be});module.exports=da(ka);a();a();var K=require("@mantine/core"),ho=require("@mantine/hooks"),eo=require("react");a();var Ve=require("@mantine/core"),ae=require("react/jsx-runtime"),sa=(0,Ve.createStyles)({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function te(){let{classes:o}=sa();return(0,ae.jsx)("tr",{className:o.root,children:(0,ae.jsx)("td",{})})}a();var no=require("@mantine/core");a();a();var Co=require("react"),X=ze(_e());a();var je={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 pa=Object.defineProperty,ma=Object.defineProperties,xa=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,Je=(o,e,r)=>e in o?pa(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,or=(o,e)=>{for(var r in e||(e={}))er.call(e,r)&&Je(o,r,e[r]);if(Oo)for(var r of Oo(e))rr.call(e,r)&&Je(o,r,e[r]);return o},Ia=(o,e)=>ma(o,xa(e)),ia=(o,e)=>{var r={};for(var t in o)er.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Oo)for(var t of Oo(o))e.indexOf(t)<0&&rr.call(o,t)&&(r[t]=o[t]);return r},fo=(o,e,r)=>{let t=(0,Co.forwardRef)((f,l)=>{var d=f,{color:u="currentColor",size:m=24,stroke:p=2,children:n}=d,g=ia(d,["color","size","stroke","children"]);return(0,Co.createElement)("svg",or(Ia(or({ref:l},je),{width:m,height:m,stroke:u,strokeWidth:p,className:`tabler-icon tabler-icon-${o}`}),g),[...r.map(([x,c])=>(0,Co.createElement)(x,c)),...n||[]])});return t.propTypes={color:X.default.string,size:X.default.oneOfType([X.default.string,X.default.number]),stroke:X.default.oneOfType([X.default.string,X.default.number])},t.displayName=`${e}`,t};a();var fe=fo("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var ne=fo("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var le=fo("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"}]]);var E=require("react/jsx-runtime"),ga=(0,no.createStyles)(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 de({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:d,cx:u}=ga();return(0,E.jsx)(no.Center,{pt:r,pb:t,className:u(d.root,{[d.active]:f}),children:l||(0,E.jsxs)(E.Fragment,{children:[o||(0,E.jsx)("div",{className:d.standardIcon,children:(0,E.jsx)(le,{})}),(0,E.jsx)(no.Text,{size:"sm",color:"dimmed",children:e})]})})}a();var Z=require("@mantine/core"),tr=require("react");a();var O=require("@mantine/core"),v=require("react/jsx-runtime"),ar={xs:22,sm:26,md:32,lg:38,xl:44};function se({size:o,label:e,values:r,value:t,onChange:f,color:l}){return(0,v.jsxs)(O.Group,{spacing:"xs",children:[(0,v.jsx)(O.Text,{size:o,children:e}),(0,v.jsxs)(O.Menu,{withinPortal:!0,withArrow:!0,children:[(0,v.jsx)(O.Menu.Target,{children:(0,v.jsx)(O.Button,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:ar[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),(0,v.jsx)(O.Menu.Dropdown,{children:r.map(d=>{let u=d===t;return(0,v.jsx)(O.Menu.Item,{sx:[{height:ar[o]},m=>({"&&":{color:u?m.white:void 0},background:u?m.colors[l||m.primaryColor][6]:void 0})],disabled:u,onClick:()=>f(d),children:(0,v.jsx)(O.Text,{size:o,children:d})},d)})})]})]})}var lo=require("react/jsx-runtime"),Ca=(0,Z.createStyles)((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),fr=(0,tr.forwardRef)(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:d,paginationColor:u,paginationSize:m,loadingText:p,noRecordsText:n,paginationText:g,totalRecords:x,recordsPerPage:c,onRecordsPerPageChange:i,recordsPerPageLabel:C,recordsPerPageOptions:b,recordsLength:B,horizontalSpacing:$,paginationWrapBreakpoint:N},w){let P;if(f)P=p;else if(!x)P=n;else{let V=(l-1)*c+1,uo=V+B-1;P=g({from:V,to:uo,totalRecords:x})}let{classes:M,cx:k}=Ca({topBorderColor:t,paginationWrapBreakpoint:N});return(0,lo.jsxs)(Z.Box,{ref:w,px:$??"xs",py:"xs",className:k(M.root,e),style:r,children:[(0,lo.jsx)(Z.Text,{className:M.text,size:m,children:P}),b&&(0,lo.jsx)(se,{size:m,label:C,values:b,value:c,onChange:i}),(0,lo.jsx)(Z.Pagination,{color:u,className:k(M.pagination,{[M.paginationFetching]:f||!B}),value:l,onChange:d,size:m,total:Math.ceil(x/c)})]})});a();var Ao=require("@mantine/core"),sr=require("react");a();var A=require("@mantine/core");a();var nr=require("@mantine/core"),lr=require("@mantine/hooks");function ko(o){let e=(0,nr.useMantineTheme)(),r=typeof o=="function"?o(e):o;return(0,lr.useMediaQuery)(r||"",!0)}function Fo(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 dr(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function vo(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function h(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}var q=require("react/jsx-runtime"),Sa=(0,A.createStyles)(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 ce({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:d,textAlignment:u,width:m,sortStatus:p,onSortStatusChange:n}){let{cx:g,classes:x}=Sa();if(!ko(f))return null;let c=l??Fo(t),i=typeof c=="string"?c:void 0;return(0,q.jsx)(A.Box,{component:"th",className:g({[x.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:u},width:m,minWidth:m,maxWidth:m},e],style:r,role:d?"button":void 0,onClick:d&&n?()=>{n({columnAccessor:t,direction:p?.direction==="asc"?"desc":"asc"})}:void 0,children:d||p?.columnAccessor===t?(0,q.jsxs)(A.Group,{className:x.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[(0,q.jsx)(A.Box,{className:g(x.columnHeaderText,x.sortableColumnHeaderText),title:i,children:c}),(0,q.jsx)(A.Center,{children:p?.columnAccessor===t?(0,q.jsx)(fe,{className:g(x.sortableColumnHeaderIcon,{[x.sortableColumnHeaderIconRotated]:p.direction==="desc"}),size:14}):(0,q.jsx)(ne,{className:x.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,q.jsx)(A.Box,{className:x.columnHeaderText,title:i,children:c})})}var J=require("react/jsx-runtime"),ha=(0,Ao.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"},selectorColumnHeader:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-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"}},selectorColumnHeaderWithRightShadow:{"&::after":{opacity:1}},selectionCheckboxInput:{cursor:"pointer"}}}),cr=(0,sr.forwardRef)(function({className:e,style:r,sortStatus:t,onSortStatusChange:f,columns:l,selectionVisible:d,selectionChecked:u,selectionIndeterminate:m,onSelectionChange:p,leftShadowVisible:n},g){let{classes:x,cx:c}=ha();return(0,J.jsx)("thead",{className:c(x.root,e),style:r,ref:g,children:(0,J.jsxs)("tr",{children:[d&&(0,J.jsx)("th",{className:c(x.selectorColumnHeader,{[x.selectorColumnHeaderWithRightShadow]:n}),children:(0,J.jsx)(Ao.Checkbox,{classNames:{input:x.selectionCheckboxInput},checked:u,indeterminate:m,disabled:!p,onChange:p})}),l.map(({accessor:i,hidden:C,visibleMediaQuery:b,textAlignment:B,width:$,title:N,sortable:w,titleClassName:P,titleStyle:M,titleSx:k})=>C?null:(0,J.jsx)(ce,{className:P,style:M,sx:k,accessor:i,visibleMediaQuery:b,textAlignment:B,width:$,title:N,sortable:w,sortStatus:t,onSortStatusChange:f},i))]})})});a();var so=require("@mantine/core"),ue=require("react/jsx-runtime"),ba=(0,so.createStyles)(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 pe({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:d,color:u}){let{classes:m,cx:p}=ba();return(0,ue.jsx)(so.Center,{pt:o,pb:e,className:p(m.root,{[m.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||(0,ue.jsx)(so.Loader,{size:l,variant:d,color:u}))})}a();var Eo=require("@mantine/core");a();var Lo=require("@mantine/core");var ur=require("react/jsx-runtime"),Ba=(0,Lo.createStyles)({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function me({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:d,noWrap:u,ellipsis:m,textAlignment:p,width:n,accessor:g,render:x,defaultRender:c,customCellAttributes:i}){let{cx:C,classes:b}=Ba();return ko(t)?(0,ur.jsx)(Lo.Box,{component:"td",className:C({[b.noWrap]:u||m,[b.ellipsis]:m,[b.withPointerCursor]:d},o),sx:[{width:n,minWidth:n,maxWidth:n,textAlign:p},e],style:r,onClick:d,...i?.(f,l),children:x?x(f,l):c?c(f,l,g):h(f,g)}):null}a();var Ho=require("@mantine/core");a();var xe=require("@mantine/hooks"),L=require("react");function pr(o){let[e,r]=(0,L.useState)(null),t=o?.join(":")||"";return(0,L.useEffect)(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function mr(o){let[e,r]=(0,L.useState)(null);return(0,L.useEffect)(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function xr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:u,allowMultiple:m,initiallyExpanded:p}=o;e&&u==="always"?t=e.map(n=>h(n,r)):p&&(t=e.filter(p).map(n=>h(n,r)),m||(t=[t[0]]))}let f,l,d=(0,L.useState)(t);if(o){let{trigger:u,allowMultiple:m,collapseProps:p,content:n}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=d;let g=x=>l(f.filter(c=>c!==h(x,r)));return{expandOnClick:u!=="always"&&u!=="never",isRowExpanded:x=>u==="always"?!0:f.includes(h(x,r)),expandRow:x=>{let c=h(x,r);l(m?[...f,c]:[c])},collapseRow:g,collapseProps:p,content:(x,c)=>()=>n({record:x,recordIndex:c,collapse:()=>g(x)})}}}function Ir(o,e){let[r,t]=(0,L.useState)(o),[f,l]=(0,L.useState)(o),d=(0,xe.useTimeout)(()=>t(!0),0),u=(0,xe.useTimeout)(()=>l(!1),e||200);return(0,L.useEffect)(()=>{o?(u.clear(),l(!0),d.start()):(d.clear(),t(!1),u.start())},[d,u,o]),{expanded:r,visible:f}}var W=require("react/jsx-runtime"),Da=(0,Ho.createStyles)({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function Ie({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=Ir(o,t?.transitionDuration),{cx:d,classes:u}=Da();return l?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("tr",{}),(0,W.jsx)("tr",{children:(0,W.jsx)("td",{className:d(u.cell,{[u.expandedCell]:f}),colSpan:e,children:(0,W.jsx)(Ho.Collapse,{in:f,...t,children:r()})})})]}):null}a();var No=require("@mantine/core"),ie=require("react/jsx-runtime"),ya=(0,No.createStyles)(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:-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 ge({withRightShadow:o,...e}){let{cx:r,classes:t}=ya();return(0,ie.jsx)("td",{className:r(t.root,{[t.withRightShadow]:o}),children:(0,ie.jsx)(No.Checkbox,{classNames:{input:t.checkbox},...e,onClick:f=>f.stopPropagation()})})}var U=require("react/jsx-runtime"),Ta=(0,Eo.createStyles)(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function Ce({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:d,isRecordSelectable:u,onClick:m,onCellClick:p,onContextMenu:n,expansion:g,customRowAttributes:x,className:c,style:i,sx:C,contextMenuVisible:b,leftShadowVisible:B}){let{cx:$,classes:N}=Ta();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Eo.Box,{component:"tr",className:$({[N.withPointerCursor]:m||g?.expandOnClick,[N.selected]:l,[N.contextMenuVisible]:b},typeof c=="function"?c(o,e):c),onClick:w=>{if(g){let{isRowExpanded:P,expandOnClick:M,expandRow:k,collapseRow:V}=g;M&&(P(o)?V(o):k(o))}m?.(w)},style:typeof i=="function"?i(o,e):i,sx:C,...x?.(o,e),onContextMenu:n,children:[f&&(0,U.jsx)(ge,{withRightShadow:B,checked:l,disabled:!d||(u?!u(o,e):!1),onChange:d}),r.map((w,P)=>{let{accessor:M,hidden:k,visibleMediaQuery:V,textAlignment:uo,noWrap:qo,ellipsis:Wo,width:Uo,render:zo,cellsClassName:po,cellsStyle:mo,cellsSx:Vo,customCellAttributes:Go}=w,bo;return p&&(bo=()=>p({record:o,recordIndex:e,column:w,columnIndex:P})),k?null:(0,U.jsx)(me,{className:typeof po=="function"?po(o,e):po,style:typeof mo=="function"?mo(o,e):mo,sx:Vo,visibleMediaQuery:V,record:o,recordIndex:e,onClick:bo,accessor:M,textAlignment:uo,noWrap:qo,ellipsis:Wo,width:Uo,render:zo,defaultRender:t,customCellAttributes:Go},M)})]}),g&&(0,U.jsx)(Ie,{colSpan:r.filter(w=>!w.hidden).length+(f?1:0),open:g.isRowExpanded(o),content:g.content(o,e),collapseProps:g.collapseProps})]})}a();var Q=require("@mantine/core"),z=require("@mantine/hooks"),ir=require("react/jsx-runtime"),wa=(0,Q.createStyles)(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Se({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:d}){(0,z.useWindowEvent)("resize",l),(0,z.useWindowEvent)("scroll",l);let u=(0,z.useClickOutside)(l),{ref:m,width:p,height:n}=(0,z.useElementSize)(),g=(0,z.useMergedRef)(u,m),{dir:x,spacing:c}=(0,Q.useMantineTheme)(),i=(0,Q.px)(c.md),{innerWidth:C,innerHeight:b}=window,{classes:B}=wa();return(0,ir.jsx)(Q.Paper,{ref:g,shadow:e,radius:o,className:B.root,sx:{zIndex:r,top:t+n+i>b?b-n-i:t,left:x==="ltr"?f+p+i>C?C-p-i:f:C-i-(f-p-i<0?p+i:f)},children:d})}a();var gr=require("@mantine/core"),Cr=require("react/jsx-runtime"),Pa=(0,gr.createStyles)(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function he(){let{classes:o}=Pa();return(0,Cr.jsx)("div",{className:o.root})}a();var H=require("@mantine/core"),So=require("react/jsx-runtime"),Ma=(0,H.createStyles)((o,{color:e})=>{let r=(0,H.px)(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function be({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=Ma({color:r});return(0,So.jsxs)(H.UnstyledButton,{className:l.root,disabled:t,onClick:f,children:[o&&(0,So.jsx)(H.Box,{className:l.icon,children:o}),(0,So.jsx)(H.Text,{className:l.title,size:"sm",children:e})]})}a();var co=require("@mantine/core"),Sr=require("react"),oo=require("react/jsx-runtime"),Ra=(0,co.createStyles)(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}}}),hr=(0,Sr.forwardRef)(function({topShadowVisible:e,leftShadowVisible:r,rightShadowVisible:t,bottomShadowVisible:f,headerHeight:l,onScrollPositionChange:d,children:u},m){let{cx:p,classes:n}=Ra();return(0,oo.jsxs)(co.ScrollArea,{viewportRef:m,classNames:{root:n.root,scrollbar:n.scrollbar,thumb:n.thumb,corner:n.corner},styles:{scrollbar:{marginTop:l}},onScrollPositionChange:d,children:[u,(0,oo.jsx)(co.Box,{className:p(n.shadow,n.topShadow,{[n.shadowVisible]:e}),sx:{top:l}}),(0,oo.jsx)("div",{className:p(n.shadow,n.leftShadow,{[n.shadowVisible]:r})}),(0,oo.jsx)("div",{className:p(n.shadow,n.rightShadow,{[n.shadowVisible]:t})}),(0,oo.jsx)("div",{className:p(n.shadow,n.bottomShadow,{[n.shadowVisible]:f})})]})});var y=require("react/jsx-runtime"),br={},Oa=(0,K.createStyles)((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Be({withBorder:o,borderRadius:e,borderColor:r=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:u,shadow:m,verticalAlignment:p="center",fetching:n,columns:g,defaultColumnRender:x,idAccessor:c="id",records:i,selectedRecords:C,onSelectedRecordsChange:b,isRecordSelectable:B,sortStatus:$,onSortStatusChange:N,horizontalSpacing:w,page:P,onPageChange:M,totalRecords:k,recordsPerPage:V,onRecordsPerPageChange:uo,recordsPerPageOptions:qo,recordsPerPageLabel:Wo="Records per page",paginationColor:Uo,paginationSize:zo="sm",paginationText:po=({from:D,to:xo,totalRecords:ro})=>`${D} - ${xo} / ${ro}`,paginationWrapBreakpoint:mo="sm",loaderBackgroundBlur:Vo,customLoader:Go,loaderSize:bo,loaderVariant:Br,loaderColor:Dr,loadingText:yr="...",emptyState:Tr,noRecordsText:De="No records",noRecordsIcon:wr,striped:Pr,onRowClick:Xo,onCellClick:Mr,onScrollToTop:ye,onScrollToBottom:Te,onScrollToLeft:we,onScrollToRight:Pe,rowContextMenu:F,rowExpansion:Rr,rowClassName:Or,rowStyle:kr,rowSx:Fr,customRowAttributes:vr,bodyRef:Ar,m:Lr,my:Hr,mx:Nr,mt:Er,mb:qr,ml:Wr,mr:Ur,sx:zr,className:Vr,classNames:Zo,style:Gr,styles:Qo,...Xr}){let{ref:D,width:xo,height:ro}=(0,ho.useElementSize)(),{ref:Zr,height:Ko}=(0,ho.useElementSize)(),{ref:Qr,width:$o,height:Bo}=(0,ho.useElementSize)(),{ref:Kr,height:Me}=(0,ho.useElementSize)(),[Yo,Re]=(0,eo.useState)(!0),[_o,Oe]=(0,eo.useState)(!0),[Do,ke]=(0,eo.useState)(!0),[jo,Fe]=(0,eo.useState)(!0),{rowContextMenuInfo:Y,setRowContextMenuInfo:ao}=mr(n),$r=xr({rowExpansion:Rr,records:i,idAccessor:c}),ve=()=>{if(!n&&F&&ao(null),n||Bo<=ro)Re(!0),Oe(!0);else{let I=D.current.scrollTop,S=I===0,T=Bo-I-ro<1;Re(S),Oe(T),S&&S!==Yo&&ye?.(),T&&T!==_o&&Te?.()}if(n||$o===xo)ke(!0),Fe(!0);else{let I=D.current.scrollLeft,S=I===0,T=$o-I-xo<1;ke(S),Fe(T),S&&S!==Do&&we?.(),T&&T!==jo&&Pe?.()}};(0,eo.useEffect)(ve,[n,Te,we,Pe,ye,F,ro,D,xo,_o,Do,jo,Yo,ao,Bo,$o]);let Yr=I=>{D.current.scrollTo({top:0,left:0}),M(I)},yo=i?.length,Ae=i?.map(I=>h(I,c)),Io=C?.map(I=>h(I,c)),Le=Ae!==void 0&&Io!==void 0&&Io.length>0,He=B?i?.filter(B):i,Jo=He?.map(I=>h(I,c)),oe=Le&&Jo.every(I=>Io.includes(I)),_r=Le&&Jo.some(I=>Io.includes(I)),Ne;b&&(Ne=()=>{b(oe?C.filter(I=>!Jo.includes(h(I,c))):vo([...C,...He],I=>h(I,c)))});let{lastSelectionChangeIndex:To,setLastSelectionChangeIndex:jr}=pr(Ae),Ee=!!C&&!Do,{cx:qe,classes:G,theme:Jr}=Oa({borderColor:r,rowBorderColor:t}),oa={m:Lr,my:Hr,mx:Nr,mt:Er,mb:qr,ml:Wr,mr:Ur},ee=typeof Qo=="function"?Qo(Jr,br,br):Qo;return(0,y.jsxs)(K.Box,{...oa,className:qe(G.root,{[G.tableWithBorder]:o},Vr,Zo?.root),sx:[I=>({borderRadius:I.radius[e]||e,boxShadow:I.shadows[m]||m,height:d,minHeight:u}),...(0,K.packSx)(zr)],style:{...ee?.root,...Gr},children:[(0,y.jsx)(hr,{ref:D,topShadowVisible:!Yo,leftShadowVisible:!(C||Do),rightShadowVisible:!jo,bottomShadowVisible:!_o,headerHeight:Ko,onScrollPositionChange:ve,children:(0,y.jsxs)(K.Table,{ref:Qr,horizontalSpacing:w,className:qe(G.table,{[G.tableWithColumnBorders]:f,[G.lastRowBorderBottomVisible]:Bo<ro,[G.textSelectionDisabled]:l,[G.verticalAlignmentTop]:p==="top",[G.verticalAlignmentBottom]:p==="bottom"}),striped:yo?Pr:!1,...Xr,children:[(0,y.jsx)(cr,{ref:Zr,className:Zo?.header,style:ee?.header,columns:g,sortStatus:$,onSortStatusChange:N,selectionVisible:!!C,selectionChecked:oe,selectionIndeterminate:_r&&!oe,onSelectionChange:Ne,leftShadowVisible:Ee}),(0,y.jsx)("tbody",{ref:Ar,children:yo?i.map((I,S)=>{let T=h(I,c),io=Io?.includes(T)||!1,wo=!1,Po=!1;if(F){let{hidden:R}=F;(!R||!(typeof R=="function"?R(I,S):R))&&(F.trigger==="click"?wo=!0:Po=!0)}let Mo;b&&(Mo=R=>{if(R.nativeEvent.shiftKey&&To!==null){let to=i.filter(S>To?(_,j)=>j>=To&&j<=S&&(B?B(_,j):!0):(_,j)=>j>=S&&j<=To&&(B?B(_,j):!0));b(io?dr(C,to,_=>h(_,c)):vo([...C,...to],_=>h(_,c)))}else b(io?C.filter(to=>h(to,c)!==T):vo([...C,I],to=>h(to,c)));jr(S)});let go;wo?go=R=>{ao({y:R.clientY,x:R.clientX,record:I,recordIndex:S}),Xo?.(I,S)}:Xo&&(go=()=>{Xo(I,S)});let We;return Po&&(We=R=>{R.preventDefault(),ao({y:R.clientY,x:R.clientX,record:I,recordIndex:S})}),(0,y.jsx)(Ce,{record:I,recordIndex:S,columns:g,defaultColumnRender:x,selectionVisible:!!C,selectionChecked:io,onSelectionChange:Mo,isRecordSelectable:B,onClick:go,onCellClick:Mr,onContextMenu:We,contextMenuVisible:Y?h(Y.record,c)===T:!1,expansion:$r,className:Or,style:kr,sx:Fr,customRowAttributes:vr,leftShadowVisible:Ee},T)}):(0,y.jsx)(te,{})})]})}),P&&(0,y.jsx)(fr,{ref:Kr,className:Zo?.pagination,style:ee?.pagination,topBorderColor:r,horizontalSpacing:w,fetching:n,page:P,onPageChange:Yr,totalRecords:k,recordsPerPage:V,onRecordsPerPageChange:uo,recordsPerPageOptions:qo,recordsPerPageLabel:Wo,paginationColor:Uo,paginationSize:zo,paginationText:po,paginationWrapBreakpoint:mo,noRecordsText:De,loadingText:yr,recordsLength:yo}),(0,y.jsx)(pe,{pt:Ko,pb:Me,fetching:n,backgroundBlur:Vo,customContent:Go,size:bo,variant:Br,color:Dr}),(0,y.jsx)(de,{pt:Ko,pb:Me,icon:wr,text:De,active:!n&&!yo,children:Tr}),F&&Y&&(0,y.jsx)(Se,{zIndex:F.zIndex,borderRadius:F.borderRadius,shadow:F.shadow,y:Y.y,x:Y.x,onDestroy:()=>ao(null),children:F.items(Y.record,Y.recordIndex).map(({divider:I,key:S,title:T,icon:io,color:wo,hidden:Po,disabled:Mo,onClick:go})=>I?(0,y.jsx)(he,{},S):Po?null:(0,y.jsx)(be,{title:T??Fo(S),icon:io,color:wo,disabled:Mo,onClick:()=>{ao(null),go()}},S))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|