mantine-datatable 1.0.10 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable.d.ts +2 -1
- package/dist/DataTable.d.ts.map +1 -1
- package/dist/DataTable.props.d.ts +25 -8
- package/dist/DataTable.props.d.ts.map +1 -1
- package/dist/DataTableEmptyRow.d.ts +3 -0
- package/dist/DataTableEmptyRow.d.ts.map +1 -0
- package/dist/DataTableFooter.d.ts.map +1 -1
- package/dist/DataTableHeader.d.ts.map +1 -1
- package/dist/DataTableHeaderCell.d.ts.map +1 -1
- package/dist/DataTableLoader.d.ts +1 -0
- package/dist/DataTableLoader.d.ts.map +1 -1
- package/dist/DataTableNoRecords.d.ts +10 -0
- package/dist/DataTableNoRecords.d.ts.map +1 -0
- package/dist/DataTableRowCell.d.ts +1 -0
- package/dist/DataTableRowCell.d.ts.map +1 -1
- package/dist/DataTableRowMenuDivider.d.ts +1 -0
- package/dist/DataTableRowMenuDivider.d.ts.map +1 -1
- package/dist/DataTableScrollArea.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +5 -8
- package/dist/DataTableEmpty.d.ts +0 -9
- package/dist/DataTableEmpty.d.ts.map +0 -1
- package/dist/useMediaQueryStringOrFn.d.ts +0 -3
- package/dist/useMediaQueryStringOrFn.d.ts.map +0 -1
package/dist/DataTable.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DataTableProps } from './DataTable.props';
|
|
2
|
-
export default function DataTable<T extends Record<string, unknown>>({ withBorder, borderRadius, withColumnBorders, height, minHeight, shadow, verticalAlignment, fetching, columns, idAccessor, records, selectedRecords, onSelectedRecordsChange, sortStatus, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, paginationSize, loaderSize, loaderVariant, loaderBackgroundBlur, noRecordsText, striped, onRowClick, rowContextMenu, ...otherProps }: DataTableProps<T>): JSX.Element;
|
|
3
|
+
export default function DataTable<T extends Record<string, unknown>>({ withBorder, borderRadius, 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
4
|
//# 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":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAsDnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACnE,UAAU,EACV,YAAY,EACZ,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,eAuSnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MantineColor, MantineNumberSize, MantineShadow, MantineTheme, TableProps } from '@mantine/core';
|
|
1
|
+
import { MantineColor, MantineNumberSize, MantineShadow, MantineSize, MantineTheme, TableProps } from '@mantine/core';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export declare type DataTableColumnTextAlignment = 'left' | 'center' | 'right';
|
|
4
4
|
export declare type DataTableVerticalAlignment = 'top' | 'center' | 'bottom';
|
|
@@ -21,6 +21,7 @@ export declare type DataTablePaginationProps = {
|
|
|
21
21
|
totalRecords?: never;
|
|
22
22
|
recordsPerPage?: never;
|
|
23
23
|
paginationSize?: never;
|
|
24
|
+
paginationText?: never;
|
|
24
25
|
} | {
|
|
25
26
|
/**
|
|
26
27
|
* Current page number (1-based); if provided, a pagination component is shown
|
|
@@ -41,12 +42,21 @@ export declare type DataTablePaginationProps = {
|
|
|
41
42
|
/**
|
|
42
43
|
* Pagination component size; defaults to `sm`
|
|
43
44
|
*/
|
|
44
|
-
paginationSize?:
|
|
45
|
+
paginationSize?: MantineSize;
|
|
46
|
+
/**
|
|
47
|
+
* Pagination text; defaults to ```({ from, to, totalRecords }) => `${from}-${to}/${totalRecords}`
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
paginationText?: (options: {
|
|
51
|
+
from: number;
|
|
52
|
+
to: number;
|
|
53
|
+
totalRecords: number;
|
|
54
|
+
}) => ReactNode;
|
|
45
55
|
};
|
|
46
56
|
export declare type DataTableColumn<T> = {
|
|
47
57
|
/**
|
|
48
58
|
* Column accessor; you can use dot-notation for nested objects property drilling
|
|
49
|
-
* (i.e. `department.name` or `department.company.name`
|
|
59
|
+
* (i.e. `department.name` or `department.company.name`)
|
|
50
60
|
*/
|
|
51
61
|
accessor: string;
|
|
52
62
|
/**
|
|
@@ -54,8 +64,9 @@ export declare type DataTableColumn<T> = {
|
|
|
54
64
|
*/
|
|
55
65
|
visibleMediaQuery?: string | ((theme: MantineTheme) => string);
|
|
56
66
|
/**
|
|
57
|
-
* Optional column header title; if not present, one will be generated by
|
|
58
|
-
*
|
|
67
|
+
* Optional column header title; if not present, one will be generated by "humanizing"
|
|
68
|
+
* the provided column accessor
|
|
69
|
+
* (i.e. `firstName` -> `First name`; `user.firstName` -> `User first name`)
|
|
59
70
|
*/
|
|
60
71
|
title?: ReactNode;
|
|
61
72
|
/**
|
|
@@ -82,7 +93,7 @@ export declare type DataTableColumn<T> = {
|
|
|
82
93
|
export declare type DataTableSortStatus = {
|
|
83
94
|
/**
|
|
84
95
|
* Sort column accessor; you can use dot-notation for nested objects property drilling
|
|
85
|
-
* (i.e. `department.name` or `department.company.name`
|
|
96
|
+
* (i.e. `department.name` or `department.company.name`)
|
|
86
97
|
*/
|
|
87
98
|
columnAccessor: string;
|
|
88
99
|
/**
|
|
@@ -139,7 +150,9 @@ export declare type DataTableContextMenuItemProps = ({
|
|
|
139
150
|
*/
|
|
140
151
|
icon?: ReactNode;
|
|
141
152
|
/**
|
|
142
|
-
* Item title
|
|
153
|
+
* Item title; if not present, one will be generated by "humanizing"
|
|
154
|
+
* the provided item key
|
|
155
|
+
* (i.e. `viewRecord` -> `View record`)
|
|
143
156
|
*/
|
|
144
157
|
title?: ReactNode;
|
|
145
158
|
/**
|
|
@@ -176,6 +189,10 @@ export declare type DataTableProps<T> = {
|
|
|
176
189
|
* If true, columns will have vertical borders
|
|
177
190
|
*/
|
|
178
191
|
withColumnBorders?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* If true, the user will not be able to select text
|
|
194
|
+
*/
|
|
195
|
+
textSelectionDisabled?: boolean;
|
|
179
196
|
/**
|
|
180
197
|
* Vertical alignment for row cells; defaults to `center`
|
|
181
198
|
*/
|
|
@@ -190,7 +207,7 @@ export declare type DataTableProps<T> = {
|
|
|
190
207
|
columns: DataTableColumn<T>[];
|
|
191
208
|
/**
|
|
192
209
|
* Accessor to use as unique record key; you can use dot-notation for nested objects property drilling
|
|
193
|
-
* (i.e. `department.name` or `department.company.name`
|
|
210
|
+
* (i.e. `department.name` or `department.company.name`);
|
|
194
211
|
* defaults to `id`
|
|
195
212
|
*/
|
|
196
213
|
idAccessor?: string;
|
|
@@ -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,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.props.d.ts","sourceRoot":"","sources":["../DataTable.props.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableEmptyRow.d.ts","sourceRoot":"","sources":["../DataTableEmptyRow.tsx"],"names":[],"mappings":";AAUA,MAAM,CAAC,OAAO,UAAU,iBAAiB,gBAOxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,iBAAiB,EAAoB,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,iBAAiB,EAAoB,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAqB7D,aAAK,oBAAoB,GAAG,wBAAwB,GAAG;IACrD,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAClD,CAAC;gCAuCY,oBAAoB,GAAG;IAAE,GAAG,EAAE,aAAa,cAAc,CAAC,CAAA;CAAE,KAAK,WAAW;AArC1F,wBAqC2F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeader.d.ts","sourceRoot":"","sources":["../DataTableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableHeader.d.ts","sourceRoot":"","sources":["../DataTableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAwEzE,aAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C,kBAAkB,EAAE,CAAC,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5E,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sBAAsB,EAAE,OAAO,CAAC;IAChC,iBAAiB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;;SAoDgD,aAAa,uBAAuB,CAAC;MAAO,WAAW;AAlDzG,wBAkD0G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeaderCell.d.ts","sourceRoot":"","sources":["../DataTableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableHeaderCell.d.ts","sourceRoot":"","sources":["../DataTableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAmCzE,aAAK,mBAAmB,CAAC,CAAC,IAAI;IAC5B,iBAAiB,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1E,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C,kBAAkB,EAAE,CAAC,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC7E,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,OAAO,CAAC,CAAC;AAElF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,CAAC,EAAE,EAC7C,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,KAAK,EACL,UAAU,EACV,kBAAkB,GACnB,EAAE,mBAAmB,CAAC,CAAC,CAAC,sBA+CxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableLoader.d.ts","sourceRoot":"","sources":["../DataTableLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqB9F,aAAK,oBAAoB,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1C,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,EAAE,EACF,EAAE,EACF,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,aAAa,GACd,EAAE,oBAAoB,eAYtB"}
|
|
1
|
+
{"version":3,"file":"DataTableLoader.d.ts","sourceRoot":"","sources":["../DataTableLoader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqB9F,aAAK,oBAAoB,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1C,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,EAAE,EACF,EAAE,EACF,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,aAAa,GACd,EAAE,oBAAoB,eAYtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type DataTableNoRecordsProps = {
|
|
3
|
+
text: string;
|
|
4
|
+
pt: number;
|
|
5
|
+
pb: number;
|
|
6
|
+
active: boolean;
|
|
7
|
+
};
|
|
8
|
+
export default function DataTableNoRecords({ text, pt, pb, active }: DataTableNoRecordsProps): JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=DataTableNoRecords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableNoRecords.d.ts","sourceRoot":"","sources":["../DataTableNoRecords.tsx"],"names":[],"mappings":";AA2BA,aAAK,uBAAuB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,uBAAuB,eAY3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableRowCell.d.ts","sourceRoot":"","sources":["../DataTableRowCell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableRowCell.d.ts","sourceRoot":"","sources":["../DataTableRowCell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD,aAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,MAAM,EAAE,CAAC,CAAC;CACX,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,mBAAmB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC,CAAC;AAEnH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,EAAE,EAC1C,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE,qBAAqB,CAAC,CAAC,CAAC,sBAkB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableRowMenuDivider.d.ts","sourceRoot":"","sources":["../DataTableRowMenuDivider.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,uBAAuB,gBAG9C"}
|
|
1
|
+
{"version":3,"file":"DataTableRowMenuDivider.d.ts","sourceRoot":"","sources":["../DataTableRowMenuDivider.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,uBAAuB,gBAG9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableScrollArea.d.ts","sourceRoot":"","sources":["../DataTableScrollArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableScrollArea.d.ts","sourceRoot":"","sources":["../DataTableScrollArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAkE5D,aAAK,wBAAwB,GAAG;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;gCA2BY,wBAAwB,GAAG;IAAE,GAAG,EAAE,aAAa,cAAc,CAAC,CAAA;CAAE,KAAK,WAAW;AAzB9F,wBAyB+F"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Or=Object.create;var de=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var yr=Object.getOwnPropertyNames;var kr=Object.getPrototypeOf,Dr=Object.prototype.hasOwnProperty;var Ar=(e,r)=>{for(var o in r)de(e,o,{get:r[o],enumerable:!0})},Ke=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of yr(r))!Dr.call(e,t)&&t!==o&&de(e,t,{get:()=>r[t],enumerable:!(a=Tr(r,t))||a.enumerable});return e};var ue=(e,r,o)=>(o=e!=null?Or(kr(e)):{},Ke(r||!e||!e.__esModule?de(o,"default",{value:e,enumerable:!0}):o,e)),Lr=e=>Ke(de({},"__esModule",{value:!0}),e);var jr={};Ar(jr,{DataTable:()=>He});module.exports=Lr(jr);var c=ue(require("react"),1);var q=require("@mantine/core"),oe=require("@mantine/hooks"),x=require("lodash"),C=require("react");var W=require("@mantine/core");function A(){return A=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},A.apply(this,arguments)}function Rr(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 E(e,r){if(e==null)return{};var o=Rr(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 z=ue(require("react")),Pr=["size","color"];function Te(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=E(e,Pr);return z.default.createElement("svg",A({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),z.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),z.default.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),z.default.createElement("line",{x1:"18",y1:"13",x2:"12",y2:"19"}),z.default.createElement("line",{x1:"6",y1:"13",x2:"12",y2:"19"}))}var V=ue(require("react")),Mr=["size","color"];function ye(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=E(e,Mr);return V.default.createElement("svg",A({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),V.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),V.default.createElement("polyline",{points:"8 7 12 3 16 7"}),V.default.createElement("polyline",{points:"8 17 12 21 16 17"}),V.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var M=ue(require("react")),vr=["size","color"];function ke(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=E(e,vr);return M.default.createElement("svg",A({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),M.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),M.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"}),M.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"}),M.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"}),M.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var Y=require("react/jsx-runtime"),Fr=(0,W.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 De({text:e,pt:r,pb:o,active:a}){let{classes:t,cx:f}=Fr();return(0,Y.jsxs)(W.Center,{pt:r,pb:o,className:f(t.root,{[t.active]:a}),children:[(0,Y.jsx)("div",{className:t.icon,children:(0,Y.jsx)(ke,{})}),(0,Y.jsx)(W.Text,{size:"sm",color:"dimmed",children:e})]})}var L=require("@mantine/core"),Xe=require("react"),pe=require("react/jsx-runtime"),Hr=(0,L.createStyles)(e=>({root:{borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,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}})),je=(0,Xe.forwardRef)(function({fetching:r,page:o,onPageChange:a,paginationSize:t,totalRecords:f,recordsPerPage:m,recordsLength:u,horizontalSpacing:n},l){let p;if(r)p="...";else{let h=(o-1)*m+1,S=h+u-1;p=`${h} - ${S}`,f&&(p+=` / ${f}`)}let{classes:d,cx:i}=Hr();return(0,pe.jsxs)(L.Box,{ref:l,px:n??"xs",py:"xs",className:d.root,children:[(0,pe.jsx)(L.Text,{size:t,children:p}),(0,pe.jsx)(L.Pagination,{className:i(d.pagination,{[d.paginationFetching]:r||!u}),page:o,onChange:a,size:t,total:Math.ceil(f/m)})]})});var xe=require("@mantine/core"),Ye=require("react");var B=require("@mantine/core"),me=require("lodash");var Qe=require("@mantine/core"),_e=require("@mantine/hooks");function J(e){let r=(0,Qe.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,_e.useMediaQuery)(o||"",!0)}var R=require("react/jsx-runtime"),Nr=(0,B.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",userSelect:"none"},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 Ae({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:m,onSortStatusChange:u}){let{cx:n,classes:l}=Nr();if(!J(r))return null;let p=o??(0,me.upperFirst)((0,me.lowerCase)(e));return(0,R.jsx)(B.Box,{component:"th",className:n({[l.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&u?()=>{u({columnAccessor:e,direction:m?.direction==="asc"?"desc":"asc"})}:void 0,children:a||m?.columnAccessor===e?(0,R.jsxs)(B.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,R.jsx)(B.Box,{className:n(l.columnHeaderText,l.sortableColumnHeaderText),children:p}),(0,R.jsx)(B.Center,{children:m?.columnAccessor===e?(0,R.jsx)(Te,{className:n(l.sortableColumnHeaderIcon,{[l.sortableColumnHeaderIconRotated]:m.direction==="desc"}),size:14}):(0,R.jsx)(ye,{className:l.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,R.jsx)(B.Box,{className:l.columnHeaderText,children:p})})}var I=require("react/jsx-runtime"),Er=(0,xe.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}},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"}}}),Je=(0,Ye.forwardRef)(function({sortStatus:r,onSortStatusChange:o,columns:a,selectionVisible:t,selectionChecked:f,selectionIndeterminate:m,onSelectionChange:u,leftShadowVisible:n,bottomShadowVisible:l},p){let{classes:d,cx:i}=Er();return(0,I.jsx)("thead",{className:i(d.root,{[d.bottomShadowVisible]:l}),ref:p,children:(0,I.jsxs)("tr",{children:[t&&(0,I.jsx)("th",{className:i(d.selectorColumnHeader,{[d.selectorColumnHeaderWithRightShadow]:n}),children:(0,I.jsx)(xe.Checkbox,{classNames:{input:d.selectionCheckboxInput},checked:f,indeterminate:m,disabled:!u,onChange:u})}),a.map(({accessor:h,visibleMediaQuery:S,textAlignment:O,width:T,title:$,sortable:be})=>(0,I.jsx)(Ae,{accessor:h,visibleMediaQuery:S,textAlignment:O,width:T,title:$,sortable:be,sortStatus:r,onSortStatusChange:o},h))]})})});var G=require("@mantine/core"),er=require("react/jsx-runtime"),zr=(0,G.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 Le({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:m,cx:u}=zr();return(0,er.jsx)(G.Center,{pt:e,pb:r,className:u(m.root,{[m.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,er.jsx)(G.Loader,{size:t,variant:f})})}var ie=require("@mantine/core");var ne=require("@mantine/core"),rr=require("lodash");var Wr=require("react/jsx-runtime"),Vr=(0,ne.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function Re({visibleMediaQuery:e,record:r,ellipsis:o,textAlignment:a,width:t,accessor:f,render:m}){let{cx:u,classes:n}=Vr();return J(e)?(0,Wr.jsx)(ne.Box,{component:"td",className:u({[n.ellipsis]:o}),sx:{width:t,minWidth:t,maxWidth:t,textAlign:a},children:m?m(r):(0,rr.get)(r,f)}):null}var ee=require("react/jsx-runtime"),Ir=(0,ie.createStyles)(e=>{let r=e.colors[e.primaryColor][6],o=e.colorScheme==="dark"?.5:.05;return{withClickHandler:{cursor:"pointer"},selectorCell:{position:"sticky",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 Pe({record:e,columns:r,selectionVisible:o,selectionChecked:a,onSelectionChange:t,onClick:f,onContextMenu:m,contextMenuVisible:u,leftShadowVisible:n}){let{cx:l,classes:p}=Ir();return(0,ee.jsxs)("tr",{className:l({[p.withClickHandler]:f,[p.selected]:a,[p.contextMenuVisible]:u}),onClick:f,onContextMenu:m,children:[o&&(0,ee.jsx)("td",{className:l(p.selectorCell,{[p.selectorCellWithRightShadow]:n}),children:(0,ee.jsx)(ie.Checkbox,{classNames:{input:p.selectorCheckboxInput},checked:a,disabled:!t,onChange:t,onClick:d=>d.stopPropagation()})}),r.map(({accessor:d,visibleMediaQuery:i,textAlignment:h,ellipsis:S,width:O,render:T})=>(0,ee.jsx)(Re,{visibleMediaQuery:i,record:e,accessor:d,textAlignment:h,ellipsis:S,width:O,render:T},d))]})}var U=require("@mantine/core"),w=require("@mantine/hooks"),Ur=require("react/jsx-runtime"),Gr=(0,U.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 Me({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:m}){(0,w.useWindowEvent)("resize",f),(0,w.useWindowEvent)("scroll",f);let u=(0,w.useClickOutside)(f),{ref:n,width:l,height:p}=(0,w.useElementSize)(),d=(0,w.useMergedRef)(u,n),{spacing:{xs:i}}=(0,U.useMantineTheme)(),{innerWidth:h,innerHeight:S}=window,O=a+p+i>S?S-p-i:a,T=t+l+i>h?h-l-i:t,{classes:$}=Gr();return(0,Ur.jsx)(U.Paper,{ref:d,shadow:r,radius:e,className:$.root,sx:{top:O,left:T,zIndex:o},children:m})}var or=require("@mantine/core"),$r=require("react/jsx-runtime"),qr=(0,or.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function ve(){let{classes:e}=qr();return(0,$r.jsx)("div",{className:e.root})}var P=require("@mantine/core"),ce=require("react/jsx-runtime"),Zr=(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 Fe({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=Zr({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 ge=require("@mantine/core"),ar=require("react"),re=require("react/jsx-runtime"),Kr=(0,ge.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"}},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}}}),tr=(0,ar.forwardRef)(function({leftShadowVisible:r,rightShadowVisible:o,bottomShadowVisible:a,headerHeight:t,onScrollPositionChange:f,children:m},u){let{cx:n,classes:l}=Kr();return(0,re.jsxs)(ge.ScrollArea,{viewportRef:u,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb},styles:{scrollbar:{marginTop:t}},onScrollPositionChange:f,children:[m,(0,re.jsx)("div",{className:n(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,re.jsx)("div",{className:n(l.shadow,l.rightShadow,{[l.shadowVisible]:o})}),(0,re.jsx)("div",{className:n(l.shadow,l.bottomShadow,{[l.shadowVisible]:a})})]})});var b=require("react/jsx-runtime"),Xr=(0,q.createStyles)(e=>{let r=`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}},browserSelectionDisabled:{userSelect:"none"},tableWithBorder:{border:r},tableWithColumnBorders:{"th, td":{":not(:first-of-type)":{borderLeft:r}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function He({withBorder:e,borderRadius:r,withColumnBorders:o,height:a="100%",minHeight:t,shadow:f,verticalAlignment:m="center",fetching:u,columns:n,idAccessor:l="id",records:p,selectedRecords:d,onSelectedRecordsChange:i,sortStatus:h,onSortStatusChange:S,horizontalSpacing:O,page:T,onPageChange:$,totalRecords:be,recordsPerPage:fr,paginationSize:lr="sm",loaderSize:sr,loaderVariant:dr,loaderBackgroundBlur:ur,noRecordsText:pr="No records",striped:mr,onRowClick:ae,rowContextMenu:y,...xr}){let{ref:Z,width:he,height:Ce}=(0,oe.useElementSize)(),{ref:nr,height:Se}=(0,oe.useElementSize)(),{ref:ir,width:Be,height:we}=(0,oe.useElementSize)(),{ref:cr,height:Ne}=(0,oe.useElementSize)(),[gr,Ee]=(0,C.useState)(!0),[br,ze]=(0,C.useState)(!0),[Ve,We]=(0,C.useState)(!0),[hr,Ie]=(0,C.useState)(!0),[v,F]=(0,C.useState)(null);(0,C.useEffect)(()=>{u&&F(null)},[u]);let Ge=()=>{if(u||F(null),u||we<=Ce)Ee(!0),ze(!0);else{let s=Z.current.scrollTop;Ee(s===0),ze(Math.round(we-s)===Math.round(Ce))}if(u||Be===he)We(!0),Ie(!0);else{let s=Z.current.scrollLeft;We(s===0),Ie(Math.round(Be-s)===Math.round(he))}};(0,C.useEffect)(Ge,[u,Ce,Z,he,we,Be]);let Cr=(0,x.throttle)(Ge,200,{leading:!0,trailing:!0}),Sr=s=>{Z.current.scrollTo({top:0,left:0}),$(s)},te=p?.length,K=p?.map(s=>(0,x.get)(s,l)),X=d?.map(s=>(0,x.get)(s,l)),Ue=K!==void 0&&X!==void 0&&X.length>0,Oe=Ue&&K.every(s=>X.includes(s)),Br=Ue&&K.some(s=>X.includes(s)),[fe,qe]=(0,C.useState)(null),wr=K?.join(":")||"";(0,C.useEffect)(()=>{qe(null)},[wr]);let $e=!!d&&!Ve,{cx:Ze,classes:H}=Xr();return(0,b.jsxs)(q.Box,{className:Ze(H.root,{[H.tableWithBorder]:e}),sx:s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[f]||f,height:a,minHeight:t}),children:[(0,b.jsx)(tr,{ref:Z,leftShadowVisible:!(d||Ve),rightShadowVisible:!hr,bottomShadowVisible:!br,headerHeight:Se,onScrollPositionChange:Cr,children:(0,b.jsxs)(q.Table,{ref:ir,horizontalSpacing:O,className:Ze({[H.browserSelectionDisabled]:ae||d,[H.tableWithColumnBorders]:o,[H.verticalAlignmentTop]:m==="top",[H.verticalAlignmentBottom]:m==="bottom"}),striped:te?mr:!1,...xr,children:[(0,b.jsx)(Je,{ref:nr,columns:n,sortStatus:h,onSortStatusChange:S,selectionVisible:!!d,selectionChecked:Oe,selectionIndeterminate:Br&&!Oe,onSelectionChange:i?()=>{i(Oe?d.filter(s=>!K.includes((0,x.get)(s,l))):(0,x.uniqBy)([...d,...p],s=>(0,x.get)(s,l)))}:void 0,leftShadowVisible:$e,bottomShadowVisible:!gr}),(0,b.jsx)("tbody",{children:te?p.map((s,k)=>{let N=(0,x.get)(s,l),j=X?.includes(N)||!1,le=!1,se=!1;if(y){let{hidden:g}=y;(!g||!(typeof g=="function"?g(s):g))&&(y.trigger==="click"?le=!0:se=!0)}return(0,b.jsx)(Pe,{record:s,columns:n,selectionVisible:!!d,selectionChecked:j,onSelectionChange:i?g=>{if(g.nativeEvent.shiftKey&&fe!==null){let D=p.filter(k>fe?(Q,_)=>_>=fe&&_<=k:(Q,_)=>_>=k&&_<=fe);i(j?(0,x.differenceBy)(d,D,Q=>(0,x.get)(Q,l)):(0,x.uniqBy)([...d,...D],Q=>(0,x.get)(Q,l)))}else i(j?d.filter(D=>(0,x.get)(D,l)!==N):(0,x.uniqBy)([...d,s],D=>(0,x.get)(D,l)));qe(k)}:void 0,onClick:le?g=>{F({top:g.clientY,left:g.clientX,record:s}),ae?.(s)}:ae?()=>{ae(s)}:void 0,onContextMenu:se?g=>{g.preventDefault(),F({top:g.clientY,left:g.clientX,record:s})}:void 0,contextMenuVisible:v?(0,x.get)(v.record,l)===N:!1,leftShadowVisible:$e},N)}):(0,b.jsx)("tr",{children:(0,b.jsx)("td",{})})})]})}),T&&(0,b.jsx)(je,{ref:cr,horizontalSpacing:O,fetching:u,page:T,onPageChange:Sr,totalRecords:be,recordsPerPage:fr,paginationSize:lr,recordsLength:te}),(0,b.jsx)(Le,{pt:Se,pb:Ne,fetching:u,loaderBackgroundBlur:ur,loaderSize:sr,loaderVariant:dr}),(0,b.jsx)(De,{pt:Se,pb:Ne,text:pr,active:!u&&!te}),y&&v&&(0,b.jsx)(Me,{zIndex:y.zIndex,borderRadius:y.borderRadius,shadow:y.shadow,top:v.top,left:v.left,onDestroy:()=>F(null),children:y.items(v.record).map(({divider:s,key:k,title:N,icon:j,color:le,hidden:se,disabled:g,onClick:D})=>s?(0,b.jsx)(ve,{},k):se?null:(0,b.jsx)(Fe,{title:N??(0,x.upperFirst)((0,x.lowerCase)(k)),icon:j,color:le,disabled:g,onClick:()=>{F(null),D()}},k))})]})}
|
|
1
|
+
"use strict";var Lr=Object.create;var de=Object.defineProperty;var Pr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var vr=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var Hr=(e,r)=>{for(var o in r)de(e,o,{get:r[o],enumerable:!0})},je=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Mr(r))!Fr.call(e,t)&&t!==o&&de(e,t,{get:()=>r[t],enumerable:!(a=Pr(r,t))||a.enumerable});return e};var ue=(e,r,o)=>(o=e!=null?Lr(vr(e)):{},je(r||!e||!e.__esModule?de(o,"default",{value:e,enumerable:!0}):o,e)),Nr=e=>je(de({},"__esModule",{value:!0}),e);var ao={};Hr(ao,{DataTable:()=>Ve});module.exports=Nr(ao);var i=ue(require("react"),1);var K=require("@mantine/core"),B=require("@mantine/hooks"),F=require("react");var Je=require("@mantine/core"),Ye=require("react/jsx-runtime"),Er=(0,Je.createStyles)({root:{"&&":{background:"transparent"}}});function De(){let{classes:e}=Er();return(0,Ye.jsx)("tr",{className:e.root,children:(0,Ye.jsx)("td",{})})}var A=require("@mantine/core"),er=require("react"),pe=require("react/jsx-runtime"),zr=(0,A.createStyles)(e=>({root:{borderTop:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,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}})),rr=(0,er.forwardRef)(function({fetching:r,page:o,onPageChange:a,paginationSize:t,paginationText:f,totalRecords:p,recordsPerPage:n,recordsLength:d,horizontalSpacing:l},u){let x;if(r||!p)x="...";else{let C=(o-1)*n+1,w=C+d-1;x=f({from:C,to:w,totalRecords:p})}let{classes:m,cx:c}=zr();return(0,pe.jsxs)(A.Box,{ref:u,px:l??"xs",py:"xs",className:m.root,children:[(0,pe.jsx)(A.Text,{size:t,children:x}),(0,pe.jsx)(A.Pagination,{className:c(m.pagination,{[m.paginationFetching]:r||!d}),page:o,onChange:a,size:t,total:Math.ceil(p/n)})]})});var ie=require("@mantine/core"),fr=require("react");var S=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 Vr(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=Vr(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=ue(require("react")),Wr=["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,Wr);return I.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),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=ue(require("react")),Ir=["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,Ir);return G.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),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 v=ue(require("react")),Gr=["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,Gr);return v.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),v.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),v.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"}),v.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"}),v.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"}),v.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var or=require("@mantine/core"),ar=require("@mantine/hooks");function me(e){let r=(0,or.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,ar.useMediaQuery)(o||"",!0)}function xe(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 tr(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 ne(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 h(e,r){return r?r.match(/([^[.\]])+/g).reduce((a,t)=>a&&a[t],e):void 0}var L=require("react/jsx-runtime"),Ur=(0,S.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:p,onSortStatusChange:n}){let{cx:d,classes:l}=Ur();if(!me(r))return null;let u=o??xe(e);return(0,L.jsx)(S.Box,{component:"th",className:d({[l.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&n?()=>{n({columnAccessor:e,direction:p?.direction==="asc"?"desc":"asc"})}:void 0,children:a||p?.columnAccessor===e?(0,L.jsxs)(S.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,L.jsx)(S.Box,{className:d(l.columnHeaderText,l.sortableColumnHeaderText),children:u}),(0,L.jsx)(S.Center,{children:p?.columnAccessor===e?(0,L.jsx)(Ae,{className:d(l.sortableColumnHeaderIcon,{[l.sortableColumnHeaderIconRotated]:p.direction==="desc"}),size:14}):(0,L.jsx)(Re,{className:l.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,L.jsx)(S.Box,{className:l.columnHeaderText,children:u})})}var U=require("react/jsx-runtime"),qr=(0,ie.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"}}}),lr=(0,fr.forwardRef)(function({sortStatus:r,onSortStatusChange:o,columns:a,selectionVisible:t,selectionChecked:f,selectionIndeterminate:p,onSelectionChange:n,leftShadowVisible:d,bottomShadowVisible:l},u){let{classes:x,cx:m}=qr();return(0,U.jsx)("thead",{className:m(x.root,{[x.bottomShadowVisible]:l}),ref:u,children:(0,U.jsxs)("tr",{children:[t&&(0,U.jsx)("th",{className:m(x.selectorColumnHeader,{[x.selectorColumnHeaderWithRightShadow]:d}),children:(0,U.jsx)(ie.Checkbox,{classNames:{input:x.selectionCheckboxInput},checked:f,indeterminate:p,disabled:!n,onChange:n})}),a.map(({accessor:c,visibleMediaQuery:C,textAlignment:w,width:T,title:H,sortable:Be})=>(0,U.jsx)(Pe,{accessor:c,visibleMediaQuery:C,textAlignment:w,width:T,title:H,sortable:Be,sortStatus:r,onSortStatusChange:o},c))]})})});var q=require("@mantine/core"),sr=require("react/jsx-runtime"),$r=(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 Me({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:p,cx:n}=$r();return(0,sr.jsx)(q.Center,{pt:e,pb:r,className:n(p.root,{[p.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,sr.jsx)(q.Loader,{size:t,variant:f})})}var $=require("@mantine/core");var re=require("react/jsx-runtime"),Zr=(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}=Zr();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 ge=require("@mantine/core");var ce=require("@mantine/core");var Xr=require("react/jsx-runtime"),Kr=(0,ce.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:n,classes:d}=Kr();return me(e)?(0,Xr.jsx)(ce.Box,{component:"td",className:n({[d.ellipsis]:o}),sx:{width:t,minWidth:t,maxWidth:t,textAlign:a},children:p?p(r):h(r,f)}):null}var oe=require("react/jsx-runtime"),_r=(0,ge.createStyles)(e=>{let r=e.colors[e.primaryColor][6],o=e.colorScheme==="dark"?.5:.05;return{withClickHandler:{cursor:"pointer"},selectorCell:{position:"sticky",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:n,leftShadowVisible:d}){let{cx:l,classes:u}=_r();return(0,oe.jsxs)("tr",{className:l({[u.withClickHandler]:f,[u.selected]:a,[u.contextMenuVisible]:n}),onClick:f,onContextMenu:p,children:[o&&(0,oe.jsx)("td",{className:l(u.selectorCell,{[u.selectorCellWithRightShadow]:d}),children:(0,oe.jsx)(ge.Checkbox,{classNames:{input:u.selectorCheckboxInput},checked:a,disabled:!t,onChange:t,onClick:x=>x.stopPropagation()})}),r.map(({accessor:x,visibleMediaQuery:m,textAlignment:c,ellipsis:C,width:w,render:T})=>(0,oe.jsx)(Fe,{visibleMediaQuery:m,record:e,accessor:x,textAlignment:c,ellipsis:C,width:w,render:T},x))]})}var Z=require("@mantine/core"),O=require("@mantine/hooks"),jr=require("react/jsx-runtime"),Qr=(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,O.useWindowEvent)("resize",f),(0,O.useWindowEvent)("scroll",f);let n=(0,O.useClickOutside)(f),{ref:d,width:l,height:u}=(0,O.useElementSize)(),x=(0,O.useMergedRef)(n,d),{spacing:{xs:m}}=(0,Z.useMantineTheme)(),{innerWidth:c,innerHeight:C}=window,w=a+u+m>C?C-u-m:a,T=t+l+m>c?c-l-m:t,{classes:H}=Qr();return(0,jr.jsx)(Z.Paper,{ref:x,shadow:r,radius:e,className:H.root,sx:{top:w,left:T,zIndex:o},children:p})}var dr=require("@mantine/core"),Jr=require("react/jsx-runtime"),Yr=(0,dr.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Ee(){let{classes:e}=Yr();return(0,Jr.jsx)("div",{className:e.root})}var P=require("@mantine/core"),be=require("react/jsx-runtime"),eo=(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}=eo({color:o});return(0,be.jsxs)(P.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,be.jsx)(P.Box,{className:f.icon,children:e}),(0,be.jsx)(P.Text,{className:f.title,size:"sm",children:r})]})}var he=require("@mantine/core"),ur=require("react"),ae=require("react/jsx-runtime"),ro=(0,he.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}}}),pr=(0,ur.forwardRef)(function({leftShadowVisible:r,rightShadowVisible:o,bottomShadowVisible:a,headerHeight:t,onScrollPositionChange:f,children:p},n){let{cx:d,classes:l}=ro();return(0,ae.jsxs)(he.ScrollArea,{viewportRef:n,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:d(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,ae.jsx)("div",{className:d(l.shadow,l.rightShadow,{[l.shadowVisible]:o})}),(0,ae.jsx)("div",{className:d(l.shadow,l.bottomShadow,{[l.shadowVisible]:a})})]})});var b=require("react/jsx-runtime"),Ce=200,Se={leading:!0},oo=(0,K.createStyles)(e=>{let r=`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}},textSelectionDisabled:{userSelect:"none"},tableWithBorder:{border:r},tableWithColumnBorders:{"th, td":{":not(:first-of-type)":{borderLeft:r}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Ve({withBorder:e,borderRadius:r,withColumnBorders:o,textSelectionDisabled:a,height:t="100%",minHeight:f,shadow:p,verticalAlignment:n="center",fetching:d,columns:l,idAccessor:u="id",records:x,selectedRecords:m,onSelectedRecordsChange:c,sortStatus:C,onSortStatusChange:w,horizontalSpacing:T,page:H,onPageChange:Be,totalRecords:mr,recordsPerPage:xr,paginationSize:nr="sm",paginationText:ir=({from:M,to:X,totalRecords:_})=>`${M} - ${X} / ${_}`,loaderSize:cr,loaderVariant:gr,loaderBackgroundBlur:br,noRecordsText:hr="No records",striped:Cr,onRowClick:we,rowContextMenu:y,...Sr}){let{ref:M,width:X,height:_}=(0,B.useElementSize)(),{ref:Br,height:Oe}=(0,B.useElementSize)(),{ref:wr,width:Te,height:ye}=(0,B.useElementSize)(),{ref:Or,height:We}=(0,B.useElementSize)(),[Tr,Ie]=(0,B.useDebouncedState)(!0,Ce,Se),[yr,Ge]=(0,B.useDebouncedState)(!0,Ce,Se),[Ue,qe]=(0,B.useDebouncedState)(!0,Ce,Se),[kr,$e]=(0,B.useDebouncedState)(!0,Ce,Se),[N,E]=(0,F.useState)(null);(0,F.useEffect)(()=>{d&&E(null)},[d]);let Ze=()=>{if(d||E(null),d||ye<=_)Ie(!0),Ge(!0);else{let s=M.current.scrollTop;Ie(s===0),Ge(Math.round(ye-s)===Math.round(_))}if(d||Te===X)qe(!0),$e(!0);else{let s=M.current.scrollLeft;qe(s===0),$e(Math.round(Te-s)===Math.round(X))}};(0,F.useEffect)(Ze,[d,_,M,X,ye,Te]);let Dr=s=>{M.current.scrollTo({top:0,left:0}),Be(s)},te=x?.length,Q=x?.map(s=>h(s,u)),j=m?.map(s=>h(s,u)),Ke=Q!==void 0&&j!==void 0&&j.length>0,ke=Ke&&Q.every(s=>j.includes(s)),Ar=Ke&&Q.some(s=>j.includes(s)),[fe,Xe]=(0,F.useState)(null),Rr=Q?.join(":")||"";(0,F.useEffect)(()=>{Xe(null)},[Rr]);let _e=!!m&&!Ue,{cx:Qe,classes:z}=oo();return(0,b.jsxs)(K.Box,{className:Qe(z.root,{[z.tableWithBorder]:e}),sx:s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[p]||p,height:t,minHeight:f}),children:[(0,b.jsx)(pr,{ref:M,leftShadowVisible:!(m||Ue),rightShadowVisible:!kr,bottomShadowVisible:!yr,headerHeight:Oe,onScrollPositionChange:Ze,children:(0,b.jsxs)(K.Table,{ref:wr,horizontalSpacing:T,className:Qe({[z.tableWithColumnBorders]:o,[z.textSelectionDisabled]:a,[z.verticalAlignmentTop]:n==="top",[z.verticalAlignmentBottom]:n==="bottom"}),striped:te?Cr:!1,...Sr,children:[(0,b.jsx)(lr,{ref:Br,columns:l,sortStatus:C,onSortStatusChange:w,selectionVisible:!!m,selectionChecked:ke,selectionIndeterminate:Ar&&!ke,onSelectionChange:c?()=>{c(ke?m.filter(s=>!Q.includes(h(s,u))):ne([...m,...x],s=>h(s,u)))}:void 0,leftShadowVisible:_e,bottomShadowVisible:!Tr}),(0,b.jsx)("tbody",{children:te?x.map((s,k)=>{let V=h(s,u),Y=j?.includes(V)||!1,le=!1,se=!1;if(y){let{hidden:g}=y;(!g||!(typeof g=="function"?g(s):g))&&(y.trigger==="click"?le=!0:se=!0)}return(0,b.jsx)(He,{record:s,columns:l,selectionVisible:!!m,selectionChecked:Y,onSelectionChange:c?g=>{if(g.nativeEvent.shiftKey&&fe!==null){let D=x.filter(k>fe?(J,ee)=>ee>=fe&&ee<=k:(J,ee)=>ee>=k&&ee<=fe);c(Y?tr(m,D,J=>h(J,u)):ne([...m,...D],J=>h(J,u)))}else c(Y?m.filter(D=>h(D,u)!==V):ne([...m,s],D=>h(D,u)));Xe(k)}:void 0,onClick:le?g=>{E({top:g.clientY,left:g.clientX,record:s}),we?.(s)}:we?()=>{we(s)}:void 0,onContextMenu:se?g=>{g.preventDefault(),E({top:g.clientY,left:g.clientX,record:s})}:void 0,contextMenuVisible:N?h(N.record,u)===V:!1,leftShadowVisible:_e},V)}):(0,b.jsx)(De,{})})]})}),H&&(0,b.jsx)(rr,{ref:Or,horizontalSpacing:T,fetching:d,page:H,onPageChange:Dr,totalRecords:mr,recordsPerPage:xr,paginationSize:nr,paginationText:ir,recordsLength:te}),(0,b.jsx)(Me,{pt:Oe,pb:We,fetching:d,loaderBackgroundBlur:br,loaderSize:cr,loaderVariant:gr}),(0,b.jsx)(ve,{pt:Oe,pb:We,text:hr,active:!d&&!te}),y&&N&&(0,b.jsx)(Ne,{zIndex:y.zIndex,borderRadius:y.borderRadius,shadow:y.shadow,top:N.top,left:N.left,onDestroy:()=>E(null),children:y.items(N.record).map(({divider:s,key:k,title:V,icon:Y,color:le,hidden:se,disabled:g,onClick:D})=>s?(0,b.jsx)(Ee,{},k):se?null:(0,b.jsx)(ze,{title:V??xe(k),icon:Y,color:le,disabled:g,onClick:()=>{E(null),D()}},k))})]})}
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|