mantine-datatable 1.3.1 → 1.4.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.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { DataTableProps } from './DataTable.props';
3
- export default function DataTable<T extends Record<string, unknown>>({ withBorder, borderRadius, borderColor, rowBorderColor, withColumnBorders, textSelectionDisabled, height, minHeight, shadow, verticalAlignment, fetching, columns, idAccessor, records, selectedRecords, onSelectedRecordsChange, sortStatus, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, paginationSize, paginationText, loaderSize, loaderVariant, loaderBackgroundBlur, noRecordsText, striped, onRowClick, rowContextMenu, ...otherProps }: DataTableProps<T>): JSX.Element;
3
+ export default function DataTable<T extends Record<string, unknown>>({ withBorder, borderRadius, borderColor, rowBorderColor, withColumnBorders, textSelectionDisabled, height, minHeight, shadow, verticalAlignment, fetching, columns, idAccessor, records, selectedRecords, onSelectedRecordsChange, sortStatus, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, paginationSize, paginationText, loaderSize, loaderVariant, loaderBackgroundBlur, emptyState, noRecordsText, noRecordsIcon, striped, onRowClick, rowContextMenu, ...otherProps }: DataTableProps<T>): JSX.Element;
4
4
  //# sourceMappingURL=DataTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgFnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACnE,UAAU,EACV,YAAY,EACZ,WAAqG,EACrG,cACiG,EACjG,iBAAiB,EACjB,qBAAqB,EACrB,MAAe,EACf,SAAS,EACT,MAAM,EACN,iBAA4B,EAC5B,QAAQ,EACR,OAAO,EACP,UAAiB,EACjB,OAAO,EACP,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAqB,EACrB,cAAoF,EACpF,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,aAA4B,EAC5B,OAAO,EACP,UAAU,EACV,cAAc,EACd,GAAG,UAAU,EACd,EAAE,cAAc,CAAC,CAAC,CAAC,eAySnB"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgFnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACnE,UAAU,EACV,YAAY,EACZ,WAAqG,EACrG,cACiG,EACjG,iBAAiB,EACjB,qBAAqB,EACrB,MAAe,EACf,SAAS,EACT,MAAM,EACN,iBAA4B,EAC5B,QAAQ,EACR,OAAO,EACP,UAAiB,EACjB,OAAO,EACP,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAqB,EACrB,cAAoF,EACpF,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,aAA4B,EAC5B,aAAa,EACb,OAAO,EACP,UAAU,EACV,cAAc,EACd,GAAG,UAAU,EACd,EAAE,cAAc,CAAC,CAAC,CAAC,eA4SnB"}
@@ -15,6 +15,25 @@ export declare type DataTableOuterBorderProps = {
15
15
  */
16
16
  borderRadius?: MantineNumberSize;
17
17
  };
18
+ export declare type DataTableEmptyStateProps = {
19
+ /**
20
+ * Content to show when no records are available; the provided content
21
+ * will be overlaid and centered automatically
22
+ */
23
+ emptyState?: ReactNode;
24
+ noRecordsText?: never;
25
+ noRecordsIcon?: never;
26
+ } | {
27
+ emptyState?: never;
28
+ /**
29
+ * Text to show when no records are available
30
+ */
31
+ noRecordsText?: string;
32
+ /**
33
+ * Icon to show when no records are available
34
+ */
35
+ noRecordsIcon?: ReactNode;
36
+ };
18
37
  export declare type DataTablePaginationProps = {
19
38
  page?: never;
20
39
  onPageChange?: never;
@@ -238,10 +257,6 @@ export declare type DataTableProps<T> = {
238
257
  * Loader background blur (in pixels)
239
258
  */
240
259
  loaderBackgroundBlur?: number;
241
- /**
242
- * Text to show when no records are available
243
- */
244
- noRecordsText?: string;
245
260
  /**
246
261
  * Function to call when a row is clicked
247
262
  */
@@ -276,5 +291,5 @@ export declare type DataTableProps<T> = {
276
291
  */
277
292
  items: (record: T) => DataTableContextMenuItemProps[];
278
293
  };
279
- } & Omit<TableProps, 'border'> & DataTableOuterBorderProps & DataTablePaginationProps & DataTableSortProps & DataTableSelectionProps<T>;
294
+ } & Omit<TableProps, 'border'> & DataTableOuterBorderProps & DataTableEmptyStateProps & DataTablePaginationProps & DataTableSortProps & DataTableSelectionProps<T>;
280
295
  //# sourceMappingURL=DataTable.props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.props.d.ts","sourceRoot":"","sources":["../DataTable.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,oBAAY,4BAA4B,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACvE,oBAAY,0BAA0B,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,oBAAY,yBAAyB,GACjC;IACE,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,GACD;IACE;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH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C,EAAE,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEvC;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;QAEjC;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;QAEjC;;WAEG;QACH,MAAM,CAAC,EAAE,aAAa,CAAC;QAEvB;;;WAGG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC;QAE5C;;WAEG;QACH,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,6BAA6B,EAAE,CAAC;KACvD,CAAC;CACH,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAC5B,yBAAyB,GACzB,wBAAwB,GACxB,wBAAwB,GACxB,kBAAkB,GAClB,uBAAuB,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ declare type DataTableEmptyStateProps = {
3
+ icon: ReactNode | undefined;
4
+ text: string;
5
+ pt: number;
6
+ pb: number;
7
+ active: boolean;
8
+ children: ReactNode | undefined;
9
+ };
10
+ export default function DataTableEmptyState({ icon, text, pt, pb, active, children }: DataTableEmptyStateProps): JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=DataTableEmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTableEmptyState.d.ts","sourceRoot":"","sources":["../DataTableEmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA2BlC,aAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAkB7G"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Pr=Object.create;var pe=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var Fr=Object.getOwnPropertyNames;var Hr=Object.getPrototypeOf,Nr=Object.prototype.hasOwnProperty;var Er=(e,r)=>{for(var o in r)pe(e,o,{get:r[o],enumerable:!0})},Ye=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Fr(r))!Nr.call(e,t)&&t!==o&&pe(e,t,{get:()=>r[t],enumerable:!(a=vr(r,t))||a.enumerable});return e};var me=(e,r,o)=>(o=e!=null?Pr(Hr(e)):{},Ye(r||!e||!e.__esModule?pe(o,"default",{value:e,enumerable:!0}):o,e)),zr=e=>Ye(pe({},"__esModule",{value:!0}),e);var fo={};Er(fo,{DataTable:()=>Ve});module.exports=zr(fo);var i=me(require("react"),1);var K=require("@mantine/core"),T=require("@mantine/hooks"),H=require("react");var er=require("@mantine/core"),Je=require("react/jsx-runtime"),Vr=(0,er.createStyles)({root:{"&&":{background:"transparent"}}});function De(){let{classes:e}=Vr();return(0,Je.jsx)("tr",{className:e.root,children:(0,Je.jsx)("td",{})})}var R=require("@mantine/core"),rr=require("react"),xe=require("react/jsx-runtime"),Wr=(0,R.createStyles)((e,{topBorderColor:r})=>({root:{borderTop:`1px solid ${typeof r=="function"?r(e):r}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:e.spacing.xs,[e.fn.largerThan("xs")]:{flexDirection:"row"}},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),or=(0,rr.forwardRef)(function({topBorderColor:r,fetching:o,page:a,onPageChange:t,paginationSize:f,paginationText:p,totalRecords:m,recordsPerPage:x,recordsLength:l,horizontalSpacing:d},c){let u;if(o||!m)u="...";else{let C=(a-1)*x+1,O=C+l-1;u=p({from:C,to:O,totalRecords:m})}let{classes:g,cx:n}=Wr({topBorderColor:r});return(0,xe.jsxs)(R.Box,{ref:c,px:d??"xs",py:"xs",className:g.root,children:[(0,xe.jsx)(R.Text,{size:f,children:u}),(0,xe.jsx)(R.Pagination,{className:n(g.pagination,{[g.paginationFetching]:o||!l}),page:a,onChange:t,size:f,total:Math.ceil(m/x)})]})});var ge=require("@mantine/core"),lr=require("react");var w=require("@mantine/core");function L(){return L=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},L.apply(this,arguments)}function Ir(e,r){if(e==null)return{};var o={},a=Object.keys(e),t,f;for(f=0;f<a.length;f++)t=a[f],!(r.indexOf(t)>=0)&&(o[t]=e[t]);return o}function W(e,r){if(e==null)return{};var o=Ir(e,r),a,t;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(t=0;t<f.length;t++)a=f[t],!(r.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,a)||(o[a]=e[a]))}return o}var I=me(require("react")),Gr=["size","color"];function Ae(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=W(e,Gr);return I.default.createElement("svg",L({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-arrow-down",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),I.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),I.default.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),I.default.createElement("line",{x1:"18",y1:"13",x2:"12",y2:"19"}),I.default.createElement("line",{x1:"6",y1:"13",x2:"12",y2:"19"}))}var G=me(require("react")),Ur=["size","color"];function Re(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=W(e,Ur);return G.default.createElement("svg",L({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-arrows-vertical",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),G.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),G.default.createElement("polyline",{points:"8 7 12 3 16 7"}),G.default.createElement("polyline",{points:"8 17 12 21 16 17"}),G.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var F=me(require("react")),qr=["size","color"];function Le(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=W(e,qr);return F.default.createElement("svg",L({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-database-off",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),F.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),F.default.createElement("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"}),F.default.createElement("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"}),F.default.createElement("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),F.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var ar=require("@mantine/core"),tr=require("@mantine/hooks");function ne(e){let r=(0,ar.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,tr.useMediaQuery)(o||"",!0)}function ie(e){let r=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}function fr(e,r,o){if(typeof o=="string"){let a=o;o=t=>t[a]}return e.filter(a=>!r.map(o).includes(o(a)))}function ce(e,r){if(typeof r=="string"){let o=r;r=a=>a[o]}return e.filter((o,a,t)=>a===t.findIndex(f=>r(o)===r(f)))}function B(e,r){return r?r.match(/([^[.\]])+/g).reduce((a,t)=>a&&a[t],e):void 0}var M=require("react/jsx-runtime"),$r=(0,w.createStyles)(e=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},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:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],transition:"color .15s ease","th:hover &":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}}}));function Me({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:p,onSortStatusChange:m}){let{cx:x,classes:l}=$r();if(!ne(r))return null;let d=o??ie(e);return(0,M.jsx)(w.Box,{component:"th",className:x({[l.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&m?()=>{m({columnAccessor:e,direction:p?.direction==="asc"?"desc":"asc"})}:void 0,children:a||p?.columnAccessor===e?(0,M.jsxs)(w.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,M.jsx)(w.Box,{className:x(l.columnHeaderText,l.sortableColumnHeaderText),children:d}),(0,M.jsx)(w.Center,{children:p?.columnAccessor===e?(0,M.jsx)(Ae,{className:x(l.sortableColumnHeaderIcon,{[l.sortableColumnHeaderIconRotated]:p.direction==="desc"}),size:14}):(0,M.jsx)(Re,{className:l.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,M.jsx)(w.Box,{className:l.columnHeaderText,children:d})})}var U=require("react/jsx-runtime"),Zr=(0,ge.createStyles)(e=>{let r=e.colorScheme==="dark"?.5:.05;return{root:{zIndex:2,position:"sticky",top:0,background:e.colorScheme==="dark"?e.colors.dark[7]:e.white,"&::after":{content:'""',position:"absolute",left:0,right:0,bottom:-e.spacing.sm+1,height:e.spacing.sm,borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,background:`linear-gradient(${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},bottomShadowVisible:{"&::after":{opacity:1}},textSelectionDisabled:{userSelect:"none"},selectorColumnHeader:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-e.spacing.sm,bottom:0,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,width:e.spacing.sm,background:`linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},selectorColumnHeaderWithRightShadow:{"&::after":{opacity:1}},selectionCheckboxInput:{cursor:"pointer"}}}),sr=(0,lr.forwardRef)(function({sortStatus:r,onSortStatusChange:o,columns:a,selectionVisible:t,selectionChecked:f,selectionIndeterminate:p,onSelectionChange:m,leftShadowVisible:x,bottomShadowVisible:l},d){let{classes:c,cx:u}=Zr();return(0,U.jsx)("thead",{className:u(c.root,{[c.bottomShadowVisible]:l}),ref:d,children:(0,U.jsxs)("tr",{children:[t&&(0,U.jsx)("th",{className:u(c.selectorColumnHeader,{[c.selectorColumnHeaderWithRightShadow]:x}),children:(0,U.jsx)(ge.Checkbox,{classNames:{input:c.selectionCheckboxInput},checked:f,indeterminate:p,disabled:!m,onChange:m})}),a.map(({accessor:g,visibleMediaQuery:n,textAlignment:C,width:O,title:X,sortable:te})=>(0,U.jsx)(Me,{accessor:g,visibleMediaQuery:n,textAlignment:C,width:O,title:X,sortable:te,sortStatus:r,onSortStatusChange:o},g))]})})});var q=require("@mantine/core"),dr=require("react/jsx-runtime"),Kr=(0,q.createStyles)(e=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:e.fn.rgba(e.colorScheme==="dark"?e.colors.dark[8]:e.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function Pe({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:p,cx:m}=Kr();return(0,dr.jsx)(q.Center,{pt:e,pb:r,className:m(p.root,{[p.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,dr.jsx)(q.Loader,{size:t,variant:f})})}var $=require("@mantine/core");var re=require("react/jsx-runtime"),Xr=(0,$.createStyles)(e=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},active:{opacity:1},icon:{fontSize:0,borderRadius:"50%",padding:e.spacing.xs,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[6]}}));function ve({text:e,pt:r,pb:o,active:a}){let{classes:t,cx:f}=Xr();return(0,re.jsxs)($.Center,{pt:r,pb:o,className:f(t.root,{[t.active]:a}),children:[(0,re.jsx)("div",{className:t.icon,children:(0,re.jsx)(Le,{})}),(0,re.jsx)($.Text,{size:"sm",color:"dimmed",children:e})]})}var he=require("@mantine/core");var be=require("@mantine/core");var Qr=require("react/jsx-runtime"),_r=(0,be.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function Fe({visibleMediaQuery:e,record:r,ellipsis:o,textAlignment:a,width:t,accessor:f,render:p}){let{cx:m,classes:x}=_r();return ne(e)?(0,Qr.jsx)(be.Box,{component:"td",className:m({[x.ellipsis]:o}),sx:{width:t,minWidth:t,maxWidth:t,textAlign:a},children:p?p(r):B(r,f)}):null}var oe=require("react/jsx-runtime"),jr=(0,he.createStyles)(e=>{let r=e.colors[e.primaryColor][6],o=e.colorScheme==="dark"?.5:.05;return{withClickHandler:{cursor:"pointer"},selectorCell:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-e.spacing.sm,bottom:0,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,width:e.spacing.sm,background:`linear-gradient(to right, ${e.fn.rgba(e.black,o)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,o)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},selectorCellWithRightShadow:{"&::after":{opacity:1}},selectorCheckboxInput:{cursor:"pointer"},selected:{"&&":{"tr&":{background:e.colorScheme==="dark"?e.fn.darken(r,.6):e.fn.lighten(r,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:e.colorScheme==="dark"?e.fn.darken(r,.55):e.fn.lighten(r,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:e.colorScheme==="dark"?e.fn.darken(r,.5):e.fn.lighten(r,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:e.colorScheme==="dark"?e.fn.darken(r,.45):e.fn.lighten(r,.65)}}}}});function He({record:e,columns:r,selectionVisible:o,selectionChecked:a,onSelectionChange:t,onClick:f,onContextMenu:p,contextMenuVisible:m,leftShadowVisible:x}){let{cx:l,classes:d}=jr();return(0,oe.jsxs)("tr",{className:l({[d.withClickHandler]:f,[d.selected]:a,[d.contextMenuVisible]:m}),onClick:f,onContextMenu:p,children:[o&&(0,oe.jsx)("td",{className:l(d.selectorCell,{[d.selectorCellWithRightShadow]:x}),children:(0,oe.jsx)(he.Checkbox,{classNames:{input:d.selectorCheckboxInput},checked:a,disabled:!t,onChange:t,onClick:c=>c.stopPropagation()})}),r.map(({accessor:c,visibleMediaQuery:u,textAlignment:g,ellipsis:n,width:C,render:O})=>(0,oe.jsx)(Fe,{visibleMediaQuery:u,record:e,accessor:c,textAlignment:g,ellipsis:n,width:C,render:O},c))]})}var Z=require("@mantine/core"),y=require("@mantine/hooks"),Jr=require("react/jsx-runtime"),Yr=(0,Z.createStyles)(e=>({root:{position:"fixed",border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Ne({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:p}){(0,y.useWindowEvent)("resize",f),(0,y.useWindowEvent)("scroll",f);let m=(0,y.useClickOutside)(f),{ref:x,width:l,height:d}=(0,y.useElementSize)(),c=(0,y.useMergedRef)(m,x),{spacing:{xs:u}}=(0,Z.useMantineTheme)(),{innerWidth:g,innerHeight:n}=window,C=a+d+u>n?n-d-u:a,O=t+l+u>g?g-l-u:t,{classes:X}=Yr();return(0,Jr.jsx)(Z.Paper,{ref:c,shadow:r,radius:e,className:X.root,sx:{top:C,left:O,zIndex:o},children:p})}var ur=require("@mantine/core"),ro=require("react/jsx-runtime"),eo=(0,ur.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Ee(){let{classes:e}=eo();return(0,ro.jsx)("div",{className:e.root})}var P=require("@mantine/core"),Ce=require("react/jsx-runtime"),oo=(0,P.createStyles)((e,{color:r})=>{let o=e.spacing.sm/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:o,paddingBottom:o,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,color:r&&e.colors[r][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:hover:not([disabled])":{background:e.fn.rgba(r?e.colors[r][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],r?e.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:e.fn.rgba(r?e.colors[r][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],r?e.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:e.spacing.xs},title:{whiteSpace:"nowrap"}}});function ze({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=oo({color:o});return(0,Ce.jsxs)(P.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,Ce.jsx)(P.Box,{className:f.icon,children:e}),(0,Ce.jsx)(P.Text,{className:f.title,size:"sm",children:r})]})}var Se=require("@mantine/core"),pr=require("react"),ae=require("react/jsx-runtime"),ao=(0,Se.createStyles)(e=>{let r=e.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"},leftShadow:{top:0,left:0,bottom:0,width:e.spacing.sm,zIndex:3,background:`linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`},rightShadow:{top:0,bottom:0,right:0,width:e.spacing.sm,zIndex:2,background:`linear-gradient(to left, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to left, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`},bottomShadow:{left:0,right:0,bottom:0,height:e.spacing.sm,background:`linear-gradient(${e.fn.rgba(e.black,0)}, ${e.fn.rgba(e.black,r)}), linear-gradient(${e.fn.rgba(e.black,0)} 30%, ${e.fn.rgba(e.black,r)})`},shadowVisible:{opacity:1}}}),mr=(0,pr.forwardRef)(function({leftShadowVisible:r,rightShadowVisible:o,bottomShadowVisible:a,headerHeight:t,onScrollPositionChange:f,children:p},m){let{cx:x,classes:l}=ao();return(0,ae.jsxs)(Se.ScrollArea,{viewportRef:m,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:t}},onScrollPositionChange:f,children:[p,(0,ae.jsx)("div",{className:x(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,ae.jsx)("div",{className:x(l.shadow,l.rightShadow,{[l.shadowVisible]:o})}),(0,ae.jsx)("div",{className:x(l.shadow,l.bottomShadow,{[l.shadowVisible]:a})})]})});var S=require("react/jsx-runtime"),Be=200,we={leading:!0},to=(0,K.createStyles)((e,{borderColor:r,rowBorderColor:o})=>{let a=typeof r=="function"?r(e):r,t=typeof o=="function"?o(e):o;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white},"&&":{"thead tr th":{borderBottomColor:a},"tbody tr td":{borderBottomColor:t}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${t}`}},textSelectionDisabled:{userSelect:"none"},tableWithBorder:{border:`1px solid ${a}`},tableWithColumnBorders:{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${t}`}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Ve({withBorder:e,borderRadius:r,borderColor:o=b=>b.colorScheme==="dark"?b.colors.dark[4]:b.colors.gray[3],rowBorderColor:a=b=>b.fn.rgba(b.colorScheme==="dark"?b.colors.dark[4]:b.colors.gray[3],.65),withColumnBorders:t,textSelectionDisabled:f,height:p="100%",minHeight:m,shadow:x,verticalAlignment:l="center",fetching:d,columns:c,idAccessor:u="id",records:g,selectedRecords:n,onSelectedRecordsChange:C,sortStatus:O,onSortStatusChange:X,horizontalSpacing:te,page:We,onPageChange:xr,totalRecords:nr,recordsPerPage:ir,paginationSize:cr="sm",paginationText:gr=({from:b,to:_,totalRecords:N})=>`${b} - ${_} / ${N}`,loaderSize:br,loaderVariant:hr,loaderBackgroundBlur:Cr,noRecordsText:Sr="No records",striped:Br,onRowClick:Te,rowContextMenu:k,...wr}){let{ref:b,width:_,height:N}=(0,T.useElementSize)(),{ref:Tr,height:Oe}=(0,T.useElementSize)(),{ref:Or,width:ye,height:fe}=(0,T.useElementSize)(),{ref:yr,height:Ie}=(0,T.useElementSize)(),[kr,Ge]=(0,T.useDebouncedState)(!0,Be,we),[Dr,Ue]=(0,T.useDebouncedState)(!0,Be,we),[qe,$e]=(0,T.useDebouncedState)(!0,Be,we),[Ar,Ze]=(0,T.useDebouncedState)(!0,Be,we),[E,z]=(0,H.useState)(null);(0,H.useEffect)(()=>{d&&z(null)},[d]);let Ke=()=>{if(d||z(null),d||fe<=N)Ge(!0),Ue(!0);else{let s=b.current.scrollTop;Ge(s===0),Ue(Math.round(fe-s)===Math.round(N))}if(d||ye===_)$e(!0),Ze(!0);else{let s=b.current.scrollLeft;$e(s===0),Ze(Math.round(ye-s)===Math.round(_))}};(0,H.useEffect)(Ke,[d,N,b,_,fe,ye]);let Rr=s=>{b.current.scrollTo({top:0,left:0}),xr(s)},le=g?.length,Q=g?.map(s=>B(s,u)),j=n?.map(s=>B(s,u)),Xe=Q!==void 0&&j!==void 0&&j.length>0,ke=Xe&&Q.every(s=>j.includes(s)),Lr=Xe&&Q.some(s=>j.includes(s)),[se,_e]=(0,H.useState)(null),Mr=Q?.join(":")||"";(0,H.useEffect)(()=>{_e(null)},[Mr]);let Qe=!!n&&!qe,{cx:je,classes:v}=to({borderColor:o,rowBorderColor:a});return(0,S.jsxs)(K.Box,{className:je(v.root,{[v.tableWithBorder]:e}),sx:s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[x]||x,height:p,minHeight:m}),children:[(0,S.jsx)(mr,{ref:b,leftShadowVisible:!(n||qe),rightShadowVisible:!Ar,bottomShadowVisible:!Dr,headerHeight:Oe,onScrollPositionChange:Ke,children:(0,S.jsxs)(K.Table,{ref:Or,horizontalSpacing:te,className:je({[v.tableWithColumnBorders]:t,[v.lastRowBorderBottomVisible]:fe<N,[v.textSelectionDisabled]:f,[v.verticalAlignmentTop]:l==="top",[v.verticalAlignmentBottom]:l==="bottom"}),striped:le?Br:!1,...wr,children:[(0,S.jsx)(sr,{ref:Tr,columns:c,sortStatus:O,onSortStatusChange:X,selectionVisible:!!n,selectionChecked:ke,selectionIndeterminate:Lr&&!ke,onSelectionChange:C?()=>{C(ke?n.filter(s=>!Q.includes(B(s,u))):ce([...n,...g],s=>B(s,u)))}:void 0,leftShadowVisible:Qe,bottomShadowVisible:!kr}),(0,S.jsx)("tbody",{children:le?g.map((s,D)=>{let V=B(s,u),Y=j?.includes(V)||!1,de=!1,ue=!1;if(k){let{hidden:h}=k;(!h||!(typeof h=="function"?h(s):h))&&(k.trigger==="click"?de=!0:ue=!0)}return(0,S.jsx)(He,{record:s,columns:c,selectionVisible:!!n,selectionChecked:Y,onSelectionChange:C?h=>{if(h.nativeEvent.shiftKey&&se!==null){let A=g.filter(D>se?(J,ee)=>ee>=se&&ee<=D:(J,ee)=>ee>=D&&ee<=se);C(Y?fr(n,A,J=>B(J,u)):ce([...n,...A],J=>B(J,u)))}else C(Y?n.filter(A=>B(A,u)!==V):ce([...n,s],A=>B(A,u)));_e(D)}:void 0,onClick:de?h=>{z({top:h.clientY,left:h.clientX,record:s}),Te?.(s)}:Te?()=>{Te(s)}:void 0,onContextMenu:ue?h=>{h.preventDefault(),z({top:h.clientY,left:h.clientX,record:s})}:void 0,contextMenuVisible:E?B(E.record,u)===V:!1,leftShadowVisible:Qe},V)}):(0,S.jsx)(De,{})})]})}),We&&(0,S.jsx)(or,{ref:yr,topBorderColor:o,horizontalSpacing:te,fetching:d,page:We,onPageChange:Rr,totalRecords:nr,recordsPerPage:ir,paginationSize:cr,paginationText:gr,recordsLength:le}),(0,S.jsx)(Pe,{pt:Oe,pb:Ie,fetching:d,loaderBackgroundBlur:Cr,loaderSize:br,loaderVariant:hr}),(0,S.jsx)(ve,{pt:Oe,pb:Ie,text:Sr,active:!d&&!le}),k&&E&&(0,S.jsx)(Ne,{zIndex:k.zIndex,borderRadius:k.borderRadius,shadow:k.shadow,top:E.top,left:E.left,onDestroy:()=>z(null),children:k.items(E.record).map(({divider:s,key:D,title:V,icon:Y,color:de,hidden:ue,disabled:h,onClick:A})=>s?(0,S.jsx)(Ee,{},D):ue?null:(0,S.jsx)(ze,{title:V??ie(D),icon:Y,color:de,disabled:h,onClick:()=>{z(null),A()}},D))})]})}
1
+ "use strict";var Fr=Object.create;var pe=Object.defineProperty;var Hr=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Er=Object.getPrototypeOf,zr=Object.prototype.hasOwnProperty;var Vr=(e,r)=>{for(var o in r)pe(e,o,{get:r[o],enumerable:!0})},Ye=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Nr(r))!zr.call(e,t)&&t!==o&&pe(e,t,{get:()=>r[t],enumerable:!(a=Hr(r,t))||a.enumerable});return e};var me=(e,r,o)=>(o=e!=null?Fr(Er(e)):{},Ye(r||!e||!e.__esModule?pe(o,"default",{value:e,enumerable:!0}):o,e)),Wr=e=>Ye(pe({},"__esModule",{value:!0}),e);var so={};Vr(so,{DataTable:()=>Ve});module.exports=Wr(so);var i=me(require("react"),1);var X=require("@mantine/core"),T=require("@mantine/hooks"),N=require("react");var er=require("@mantine/core"),Je=require("react/jsx-runtime"),Ir=(0,er.createStyles)({root:{"&&":{background:"transparent"}}});function De(){let{classes:e}=Ir();return(0,Je.jsx)("tr",{className:e.root,children:(0,Je.jsx)("td",{})})}var q=require("@mantine/core");function R(){return R=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},R.apply(this,arguments)}function Gr(e,r){if(e==null)return{};var o={},a=Object.keys(e),t,f;for(f=0;f<a.length;f++)t=a[f],!(r.indexOf(t)>=0)&&(o[t]=e[t]);return o}function I(e,r){if(e==null)return{};var o=Gr(e,r),a,t;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(t=0;t<f.length;t++)a=f[t],!(r.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,a)||(o[a]=e[a]))}return o}var G=me(require("react")),Ur=["size","color"];function Ae(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=I(e,Ur);return G.default.createElement("svg",R({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-arrow-down",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),G.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),G.default.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),G.default.createElement("line",{x1:"18",y1:"13",x2:"12",y2:"19"}),G.default.createElement("line",{x1:"6",y1:"13",x2:"12",y2:"19"}))}var U=me(require("react")),qr=["size","color"];function Re(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=I(e,qr);return U.default.createElement("svg",R({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-arrows-vertical",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),U.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),U.default.createElement("polyline",{points:"8 7 12 3 16 7"}),U.default.createElement("polyline",{points:"8 17 12 21 16 17"}),U.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var H=me(require("react")),$r=["size","color"];function Le(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=I(e,$r);return H.default.createElement("svg",R({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-database-off",width:o,height:o,viewBox:"0 0 24 24",stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),H.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),H.default.createElement("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"}),H.default.createElement("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"}),H.default.createElement("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),H.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var L=require("react/jsx-runtime"),Zr=(0,q.createStyles)(e=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:e.spacing.xs,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}}));function Me({icon:e,text:r,pt:o,pb:a,active:t,children:f}){let{classes:d,cx:m}=Zr();return(0,L.jsx)(q.Center,{pt:o,pb:a,className:m(d.root,{[d.active]:t}),children:f||(0,L.jsxs)(L.Fragment,{children:[e||(0,L.jsx)("div",{className:d.standardIcon,children:(0,L.jsx)(Le,{})}),(0,L.jsx)(q.Text,{size:"sm",color:"dimmed",children:r})]})})}var M=require("@mantine/core"),rr=require("react"),xe=require("react/jsx-runtime"),Kr=(0,M.createStyles)((e,{topBorderColor:r})=>({root:{borderTop:`1px solid ${typeof r=="function"?r(e):r}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:e.spacing.xs,[e.fn.largerThan("xs")]:{flexDirection:"row"}},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),or=(0,rr.forwardRef)(function({topBorderColor:r,fetching:o,page:a,onPageChange:t,paginationSize:f,paginationText:d,totalRecords:m,recordsPerPage:x,recordsLength:l,horizontalSpacing:u},c){let p;if(o||!m)p="...";else{let C=(a-1)*x+1,O=C+l-1;p=d({from:C,to:O,totalRecords:m})}let{classes:g,cx:n}=Kr({topBorderColor:r});return(0,xe.jsxs)(M.Box,{ref:c,px:u??"xs",py:"xs",className:g.root,children:[(0,xe.jsx)(M.Text,{size:f,children:p}),(0,xe.jsx)(M.Pagination,{className:n(g.pagination,{[g.paginationFetching]:o||!l}),page:a,onChange:t,size:f,total:Math.ceil(m/x)})]})});var ge=require("@mantine/core"),lr=require("react");var w=require("@mantine/core");var ar=require("@mantine/core"),tr=require("@mantine/hooks");function ne(e){let r=(0,ar.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,tr.useMediaQuery)(o||"",!0)}function ie(e){let r=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}function fr(e,r,o){if(typeof o=="string"){let a=o;o=t=>t[a]}return e.filter(a=>!r.map(o).includes(o(a)))}function ce(e,r){if(typeof r=="string"){let o=r;r=a=>a[o]}return e.filter((o,a,t)=>a===t.findIndex(f=>r(o)===r(f)))}function B(e,r){return r?r.match(/([^[.\]])+/g).reduce((a,t)=>a&&a[t],e):void 0}var P=require("react/jsx-runtime"),Xr=(0,w.createStyles)(e=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},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:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],transition:"color .15s ease","th:hover &":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}}}));function Pe({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:d,onSortStatusChange:m}){let{cx:x,classes:l}=Xr();if(!ne(r))return null;let u=o??ie(e);return(0,P.jsx)(w.Box,{component:"th",className:x({[l.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&m?()=>{m({columnAccessor:e,direction:d?.direction==="asc"?"desc":"asc"})}:void 0,children:a||d?.columnAccessor===e?(0,P.jsxs)(w.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,P.jsx)(w.Box,{className:x(l.columnHeaderText,l.sortableColumnHeaderText),children:u}),(0,P.jsx)(w.Center,{children:d?.columnAccessor===e?(0,P.jsx)(Ae,{className:x(l.sortableColumnHeaderIcon,{[l.sortableColumnHeaderIconRotated]:d.direction==="desc"}),size:14}):(0,P.jsx)(Re,{className:l.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,P.jsx)(w.Box,{className:l.columnHeaderText,children:u})})}var $=require("react/jsx-runtime"),_r=(0,ge.createStyles)(e=>{let r=e.colorScheme==="dark"?.5:.05;return{root:{zIndex:2,position:"sticky",top:0,background:e.colorScheme==="dark"?e.colors.dark[7]:e.white,"&::after":{content:'""',position:"absolute",left:0,right:0,bottom:-e.spacing.sm+1,height:e.spacing.sm,borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,background:`linear-gradient(${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},bottomShadowVisible:{"&::after":{opacity:1}},textSelectionDisabled:{userSelect:"none"},selectorColumnHeader:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-e.spacing.sm,bottom:0,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,width:e.spacing.sm,background:`linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},selectorColumnHeaderWithRightShadow:{"&::after":{opacity:1}},selectionCheckboxInput:{cursor:"pointer"}}}),sr=(0,lr.forwardRef)(function({sortStatus:r,onSortStatusChange:o,columns:a,selectionVisible:t,selectionChecked:f,selectionIndeterminate:d,onSelectionChange:m,leftShadowVisible:x,bottomShadowVisible:l},u){let{classes:c,cx:p}=_r();return(0,$.jsx)("thead",{className:p(c.root,{[c.bottomShadowVisible]:l}),ref:u,children:(0,$.jsxs)("tr",{children:[t&&(0,$.jsx)("th",{className:p(c.selectorColumnHeader,{[c.selectorColumnHeaderWithRightShadow]:x}),children:(0,$.jsx)(ge.Checkbox,{classNames:{input:c.selectionCheckboxInput},checked:f,indeterminate:d,disabled:!m,onChange:m})}),a.map(({accessor:g,visibleMediaQuery:n,textAlignment:C,width:O,title:_,sortable:te})=>(0,$.jsx)(Pe,{accessor:g,visibleMediaQuery:n,textAlignment:C,width:O,title:_,sortable:te,sortStatus:r,onSortStatusChange:o},g))]})})});var Z=require("@mantine/core"),dr=require("react/jsx-runtime"),Qr=(0,Z.createStyles)(e=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:e.fn.rgba(e.colorScheme==="dark"?e.colors.dark[8]:e.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function ve({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:d,cx:m}=Qr();return(0,dr.jsx)(Z.Center,{pt:e,pb:r,className:m(d.root,{[d.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,dr.jsx)(Z.Loader,{size:t,variant:f})})}var he=require("@mantine/core");var be=require("@mantine/core");var Yr=require("react/jsx-runtime"),jr=(0,be.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function Fe({visibleMediaQuery:e,record:r,ellipsis:o,textAlignment:a,width:t,accessor:f,render:d}){let{cx:m,classes:x}=jr();return ne(e)?(0,Yr.jsx)(be.Box,{component:"td",className:m({[x.ellipsis]:o}),sx:{width:t,minWidth:t,maxWidth:t,textAlign:a},children:d?d(r):B(r,f)}):null}var oe=require("react/jsx-runtime"),Jr=(0,he.createStyles)(e=>{let r=e.colors[e.primaryColor][6],o=e.colorScheme==="dark"?.5:.05;return{withClickHandler:{cursor:"pointer"},selectorCell:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-e.spacing.sm,bottom:0,borderLeft:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,width:e.spacing.sm,background:`linear-gradient(to right, ${e.fn.rgba(e.black,o)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,o)}, ${e.fn.rgba(e.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},selectorCellWithRightShadow:{"&::after":{opacity:1}},selectorCheckboxInput:{cursor:"pointer"},selected:{"&&":{"tr&":{background:e.colorScheme==="dark"?e.fn.darken(r,.6):e.fn.lighten(r,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:e.colorScheme==="dark"?e.fn.darken(r,.55):e.fn.lighten(r,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:e.colorScheme==="dark"?e.fn.darken(r,.5):e.fn.lighten(r,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:e.colorScheme==="dark"?e.fn.darken(r,.45):e.fn.lighten(r,.65)}}}}});function He({record:e,columns:r,selectionVisible:o,selectionChecked:a,onSelectionChange:t,onClick:f,onContextMenu:d,contextMenuVisible:m,leftShadowVisible:x}){let{cx:l,classes:u}=Jr();return(0,oe.jsxs)("tr",{className:l({[u.withClickHandler]:f,[u.selected]:a,[u.contextMenuVisible]:m}),onClick:f,onContextMenu:d,children:[o&&(0,oe.jsx)("td",{className:l(u.selectorCell,{[u.selectorCellWithRightShadow]:x}),children:(0,oe.jsx)(he.Checkbox,{classNames:{input:u.selectorCheckboxInput},checked:a,disabled:!t,onChange:t,onClick:c=>c.stopPropagation()})}),r.map(({accessor:c,visibleMediaQuery:p,textAlignment:g,ellipsis:n,width:C,render:O})=>(0,oe.jsx)(Fe,{visibleMediaQuery:p,record:e,accessor:c,textAlignment:g,ellipsis:n,width:C,render:O},c))]})}var K=require("@mantine/core"),y=require("@mantine/hooks"),ro=require("react/jsx-runtime"),eo=(0,K.createStyles)(e=>({root:{position:"fixed",border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Ne({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:d}){(0,y.useWindowEvent)("resize",f),(0,y.useWindowEvent)("scroll",f);let m=(0,y.useClickOutside)(f),{ref:x,width:l,height:u}=(0,y.useElementSize)(),c=(0,y.useMergedRef)(m,x),{spacing:{xs:p}}=(0,K.useMantineTheme)(),{innerWidth:g,innerHeight:n}=window,C=a+u+p>n?n-u-p:a,O=t+l+p>g?g-l-p:t,{classes:_}=eo();return(0,ro.jsx)(K.Paper,{ref:c,shadow:r,radius:e,className:_.root,sx:{top:C,left:O,zIndex:o},children:d})}var ur=require("@mantine/core"),ao=require("react/jsx-runtime"),oo=(0,ur.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Ee(){let{classes:e}=oo();return(0,ao.jsx)("div",{className:e.root})}var v=require("@mantine/core"),Ce=require("react/jsx-runtime"),to=(0,v.createStyles)((e,{color:r})=>{let o=e.spacing.sm/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:o,paddingBottom:o,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,color:r&&e.colors[r][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:hover:not([disabled])":{background:e.fn.rgba(r?e.colors[r][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],r?e.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:e.fn.rgba(r?e.colors[r][6]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],r?e.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:e.spacing.xs},title:{whiteSpace:"nowrap"}}});function ze({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=to({color:o});return(0,Ce.jsxs)(v.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,Ce.jsx)(v.Box,{className:f.icon,children:e}),(0,Ce.jsx)(v.Text,{className:f.title,size:"sm",children:r})]})}var Se=require("@mantine/core"),pr=require("react"),ae=require("react/jsx-runtime"),fo=(0,Se.createStyles)(e=>{let r=e.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"},leftShadow:{top:0,left:0,bottom:0,width:e.spacing.sm,zIndex:3,background:`linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to right, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`},rightShadow:{top:0,bottom:0,right:0,width:e.spacing.sm,zIndex:2,background:`linear-gradient(to left, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)}), linear-gradient(to left, ${e.fn.rgba(e.black,r)}, ${e.fn.rgba(e.black,0)} 30%)`},bottomShadow:{left:0,right:0,bottom:0,height:e.spacing.sm,background:`linear-gradient(${e.fn.rgba(e.black,0)}, ${e.fn.rgba(e.black,r)}), linear-gradient(${e.fn.rgba(e.black,0)} 30%, ${e.fn.rgba(e.black,r)})`},shadowVisible:{opacity:1}}}),mr=(0,pr.forwardRef)(function({leftShadowVisible:r,rightShadowVisible:o,bottomShadowVisible:a,headerHeight:t,onScrollPositionChange:f,children:d},m){let{cx:x,classes:l}=fo();return(0,ae.jsxs)(Se.ScrollArea,{viewportRef:m,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:t}},onScrollPositionChange:f,children:[d,(0,ae.jsx)("div",{className:x(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,ae.jsx)("div",{className:x(l.shadow,l.rightShadow,{[l.shadowVisible]:o})}),(0,ae.jsx)("div",{className:x(l.shadow,l.bottomShadow,{[l.shadowVisible]:a})})]})});var S=require("react/jsx-runtime"),Be=200,we={leading:!0},lo=(0,X.createStyles)((e,{borderColor:r,rowBorderColor:o})=>{let a=typeof r=="function"?r(e):r,t=typeof o=="function"?o(e):o;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white},"&&":{"thead tr th":{borderBottomColor:a},"tbody tr td":{borderBottomColor:t}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${t}`}},textSelectionDisabled:{userSelect:"none"},tableWithBorder:{border:`1px solid ${a}`},tableWithColumnBorders:{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${t}`}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Ve({withBorder:e,borderRadius:r,borderColor:o=b=>b.colorScheme==="dark"?b.colors.dark[4]:b.colors.gray[3],rowBorderColor:a=b=>b.fn.rgba(b.colorScheme==="dark"?b.colors.dark[4]:b.colors.gray[3],.65),withColumnBorders:t,textSelectionDisabled:f,height:d="100%",minHeight:m,shadow:x,verticalAlignment:l="center",fetching:u,columns:c,idAccessor:p="id",records:g,selectedRecords:n,onSelectedRecordsChange:C,sortStatus:O,onSortStatusChange:_,horizontalSpacing:te,page:We,onPageChange:xr,totalRecords:nr,recordsPerPage:ir,paginationSize:cr="sm",paginationText:gr=({from:b,to:Q,totalRecords:E})=>`${b} - ${Q} / ${E}`,loaderSize:br,loaderVariant:hr,loaderBackgroundBlur:Cr,emptyState:Sr,noRecordsText:Br="No records",noRecordsIcon:wr,striped:Tr,onRowClick:Te,rowContextMenu:k,...Or}){let{ref:b,width:Q,height:E}=(0,T.useElementSize)(),{ref:yr,height:Oe}=(0,T.useElementSize)(),{ref:kr,width:ye,height:fe}=(0,T.useElementSize)(),{ref:Dr,height:Ie}=(0,T.useElementSize)(),[Ar,Ge]=(0,T.useDebouncedState)(!0,Be,we),[Rr,Ue]=(0,T.useDebouncedState)(!0,Be,we),[qe,$e]=(0,T.useDebouncedState)(!0,Be,we),[Lr,Ze]=(0,T.useDebouncedState)(!0,Be,we),[z,V]=(0,N.useState)(null);(0,N.useEffect)(()=>{u&&V(null)},[u]);let Ke=()=>{if(u||V(null),u||fe<=E)Ge(!0),Ue(!0);else{let s=b.current.scrollTop;Ge(s===0),Ue(Math.round(fe-s)===Math.round(E))}if(u||ye===Q)$e(!0),Ze(!0);else{let s=b.current.scrollLeft;$e(s===0),Ze(Math.round(ye-s)===Math.round(Q))}};(0,N.useEffect)(Ke,[u,E,b,Q,fe,ye]);let Mr=s=>{b.current.scrollTo({top:0,left:0}),xr(s)},le=g?.length,j=g?.map(s=>B(s,p)),Y=n?.map(s=>B(s,p)),Xe=j!==void 0&&Y!==void 0&&Y.length>0,ke=Xe&&j.every(s=>Y.includes(s)),Pr=Xe&&j.some(s=>Y.includes(s)),[se,_e]=(0,N.useState)(null),vr=j?.join(":")||"";(0,N.useEffect)(()=>{_e(null)},[vr]);let Qe=!!n&&!qe,{cx:je,classes:F}=lo({borderColor:o,rowBorderColor:a});return(0,S.jsxs)(X.Box,{className:je(F.root,{[F.tableWithBorder]:e}),sx:s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[x]||x,height:d,minHeight:m}),children:[(0,S.jsx)(mr,{ref:b,leftShadowVisible:!(n||qe),rightShadowVisible:!Lr,bottomShadowVisible:!Rr,headerHeight:Oe,onScrollPositionChange:Ke,children:(0,S.jsxs)(X.Table,{ref:kr,horizontalSpacing:te,className:je({[F.tableWithColumnBorders]:t,[F.lastRowBorderBottomVisible]:fe<E,[F.textSelectionDisabled]:f,[F.verticalAlignmentTop]:l==="top",[F.verticalAlignmentBottom]:l==="bottom"}),striped:le?Tr:!1,...Or,children:[(0,S.jsx)(sr,{ref:yr,columns:c,sortStatus:O,onSortStatusChange:_,selectionVisible:!!n,selectionChecked:ke,selectionIndeterminate:Pr&&!ke,onSelectionChange:C?()=>{C(ke?n.filter(s=>!j.includes(B(s,p))):ce([...n,...g],s=>B(s,p)))}:void 0,leftShadowVisible:Qe,bottomShadowVisible:!Ar}),(0,S.jsx)("tbody",{children:le?g.map((s,D)=>{let W=B(s,p),J=Y?.includes(W)||!1,de=!1,ue=!1;if(k){let{hidden:h}=k;(!h||!(typeof h=="function"?h(s):h))&&(k.trigger==="click"?de=!0:ue=!0)}return(0,S.jsx)(He,{record:s,columns:c,selectionVisible:!!n,selectionChecked:J,onSelectionChange:C?h=>{if(h.nativeEvent.shiftKey&&se!==null){let A=g.filter(D>se?(ee,re)=>re>=se&&re<=D:(ee,re)=>re>=D&&re<=se);C(J?fr(n,A,ee=>B(ee,p)):ce([...n,...A],ee=>B(ee,p)))}else C(J?n.filter(A=>B(A,p)!==W):ce([...n,s],A=>B(A,p)));_e(D)}:void 0,onClick:de?h=>{V({top:h.clientY,left:h.clientX,record:s}),Te?.(s)}:Te?()=>{Te(s)}:void 0,onContextMenu:ue?h=>{h.preventDefault(),V({top:h.clientY,left:h.clientX,record:s})}:void 0,contextMenuVisible:z?B(z.record,p)===W:!1,leftShadowVisible:Qe},W)}):(0,S.jsx)(De,{})})]})}),We&&(0,S.jsx)(or,{ref:Dr,topBorderColor:o,horizontalSpacing:te,fetching:u,page:We,onPageChange:Mr,totalRecords:nr,recordsPerPage:ir,paginationSize:cr,paginationText:gr,recordsLength:le}),(0,S.jsx)(ve,{pt:Oe,pb:Ie,fetching:u,loaderBackgroundBlur:Cr,loaderSize:br,loaderVariant:hr}),(0,S.jsx)(Me,{pt:Oe,pb:Ie,icon:wr,text:Br,active:!u&&!le,children:Sr}),k&&z&&(0,S.jsx)(Ne,{zIndex:k.zIndex,borderRadius:k.borderRadius,shadow:k.shadow,top:z.top,left:z.left,onDestroy:()=>V(null),children:k.items(z.record).map(({divider:s,key:D,title:W,icon:J,color:de,hidden:ue,disabled:h,onClick:A})=>s?(0,S.jsx)(Ee,{},D):ue?null:(0,S.jsx)(ze,{title:W??ie(D),icon:J,color:de,disabled:h,onClick:()=>{V(null),A()}},D))})]})}
2
2
  //# sourceMappingURL=index.cjs.map