mantine-datatable 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/DataTable.d.ts +1 -1
- package/dist/DataTable.d.ts.map +1 -1
- package/dist/DataTable.props.d.ts +17 -3
- package/dist/DataTable.props.d.ts.map +1 -1
- package/dist/DataTableFooter.d.ts +3 -1
- package/dist/DataTableFooter.d.ts.map +1 -1
- package/dist/DataTableHeader.d.ts +3 -0
- package/dist/DataTableHeader.d.ts.map +1 -1
- package/dist/DataTableRow.d.ts.map +1 -1
- package/dist/DataTableRowCell.d.ts +6 -1
- package/dist/DataTableRowCell.d.ts.map +1 -1
- package/dist/DataTableScrollArea.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ export default function GettingStartedExample() {
|
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
|
-
Also see the [getting started](https://icflorescu.github.io/mantine-datatable/getting-started) page in the documentation.
|
|
75
|
+
Also see the [getting started](https://icflorescu.github.io/mantine-datatable/getting-started) page in the documentation, have a look at the available [component properties](https://icflorescu.github.io/mantine-datatable/component-properties) and make sure to browse the comprehensive list of [usage examples](https://icflorescu.github.io/mantine-datatable/examples/basic-usage).
|
|
76
76
|
|
|
77
77
|
## Code contributors
|
|
78
78
|
|
package/dist/DataTable.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DataTableProps } from './DataTable.props';
|
|
2
|
-
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;
|
|
2
|
+
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, sx, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): JSX.Element;
|
|
3
3
|
//# sourceMappingURL=DataTable.d.ts.map
|
package/dist/DataTable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../DataTable.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiFnD,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,EAAE,EACF,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,GAAG,UAAU,EACd,EAAE,cAAc,CAAC,CAAC,CAAC,eAqTnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MantineColor, MantineNumberSize, MantineShadow, MantineSize, MantineTheme, TableProps } from '@mantine/core';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import type { DefaultProps, MantineColor, MantineNumberSize, MantineShadow, MantineSize, MantineTheme, Sx, TableProps } from '@mantine/core';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
export declare type DataTableColumnTextAlignment = 'left' | 'center' | 'right';
|
|
4
4
|
export declare type DataTableVerticalAlignment = 'top' | 'center' | 'bottom';
|
|
5
5
|
export declare type DataTableOuterBorderProps = {
|
|
@@ -108,6 +108,20 @@ export declare type DataTableColumn<T> = {
|
|
|
108
108
|
* If true, cell content in this column will be truncated with ellipsis as needed
|
|
109
109
|
*/
|
|
110
110
|
ellipsis?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Optional class name passed to each data cell in the column; can be a string or a function
|
|
113
|
+
* receiving the current record as its argument and returning a string
|
|
114
|
+
*/
|
|
115
|
+
cellsClassName?: string | ((record: T) => string | undefined);
|
|
116
|
+
/**
|
|
117
|
+
* Optional style passed to each data cell in the column; can be a CSS properties object or
|
|
118
|
+
* a function receiving the current record as its argument and returning a CSS properties object
|
|
119
|
+
*/
|
|
120
|
+
cellsStyle?: CSSProperties | ((record: T) => CSSProperties | undefined);
|
|
121
|
+
/**
|
|
122
|
+
* Optional style passed to each data cell in the column; see https://mantine.dev/styles/sx/
|
|
123
|
+
*/
|
|
124
|
+
cellsSx?: Sx;
|
|
111
125
|
};
|
|
112
126
|
export declare type DataTableSortStatus = {
|
|
113
127
|
/**
|
|
@@ -291,5 +305,5 @@ export declare type DataTableProps<T> = {
|
|
|
291
305
|
*/
|
|
292
306
|
items: (record: T) => DataTableContextMenuItemProps[];
|
|
293
307
|
};
|
|
294
|
-
} &
|
|
308
|
+
} & Pick<TableProps, 'striped' | 'highlightOnHover' | 'horizontalSpacing' | 'verticalSpacing' | 'fontSize'> & Omit<DefaultProps<'root' | 'header' | 'pagination', CSSProperties>, 'unstyled'> & DataTableOuterBorderProps & DataTableEmptyStateProps & DataTablePaginationProps & DataTableSortProps & DataTableSelectionProps<T>;
|
|
295
309
|
//# 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,
|
|
1
|
+
{"version":3,"file":"DataTable.props.d.ts","sourceRoot":"","sources":["../DataTable.props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,EAAE,EACF,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,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,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC,CAAC;AAEN,oBAAY,wBAAwB,GAChC;IACE;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB,aAA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9 @@
|
|
|
1
|
-
import { MantineNumberSize, MantineTheme } from '@mantine/core';
|
|
1
|
+
import { CSSObject, MantineNumberSize, MantineTheme } from '@mantine/core';
|
|
2
2
|
import { ForwardedRef } from 'react';
|
|
3
3
|
import { DataTablePaginationProps } from './DataTable.props';
|
|
4
4
|
declare type DataTableFooterProps = DataTablePaginationProps & {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSObject;
|
|
5
7
|
topBorderColor: string | ((theme: MantineTheme) => string);
|
|
6
8
|
fetching: boolean | undefined;
|
|
7
9
|
recordsLength: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,iBAAiB,EAAE,YAAY,EAAoB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAoB,MAAM,eAAe,CAAC;AAChH,OAAO,EAAiB,YAAY,EAAyB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAuB7D,aAAK,oBAAoB,GAAG,wBAAwB,GAAG;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,CAAC,CAAC;IAC3D,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAClD,CAAC;gCAgDY,oBAAoB,GAAG;IAAE,GAAG,EAAE,aAAa,cAAc,CAAC,CAAA;CAAE,KAAK,WAAW;AA9C1F,wBA8C2F"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { CSSObject } from '@mantine/core';
|
|
1
2
|
import { ForwardedRef } from 'react';
|
|
2
3
|
import { DataTableColumn, DataTableSortStatus } from './DataTable.props';
|
|
3
4
|
declare type DataTableHeaderProps<T> = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSObject;
|
|
4
7
|
sortStatus: DataTableSortStatus | undefined;
|
|
5
8
|
onSortStatusChange: ((sortStatus: DataTableSortStatus) => void) | undefined;
|
|
6
9
|
columns: DataTableColumn<T>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableHeader.d.ts","sourceRoot":"","sources":["../DataTableHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTableHeader.d.ts","sourceRoot":"","sources":["../DataTableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,SAAS,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAiB,YAAY,EAAc,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAwEzE,aAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,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;;SA0DgD,aAAa,uBAAuB,CAAC;MAAO,WAAW;AAxDzG,wBAwD0G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableRow.d.ts","sourceRoot":"","sources":["../DataTableRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoEpD,aAAK,iBAAiB,CAAC,CAAC,IAAI;IAC1B,MAAM,EAAE,CAAC,CAAC;IACV,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAC5D,aAAa,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAClE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,EACtC,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"DataTableRow.d.ts","sourceRoot":"","sources":["../DataTableRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoEpD,aAAK,iBAAiB,CAAC,CAAC,IAAI;IAC1B,MAAM,EAAE,CAAC,CAAC;IACV,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAC5D,aAAa,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAClE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,EACtC,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,CAAC,CAAC,eAqDtB"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { Sx } from '@mantine/core';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
1
3
|
import { DataTableColumn } from './DataTable.props';
|
|
2
4
|
declare type DataTableRowCellProps<T> = {
|
|
5
|
+
className?: string;
|
|
6
|
+
sx?: Sx;
|
|
7
|
+
style?: CSSProperties;
|
|
3
8
|
record: T;
|
|
4
9
|
} & Pick<DataTableColumn<T>, 'accessor' | 'visibleMediaQuery' | 'textAlignment' | 'width' | 'ellipsis' | 'render'>;
|
|
5
|
-
export default function DataTableRowCell<T>({ visibleMediaQuery, record, ellipsis, textAlignment, width, accessor, render, }: DataTableRowCellProps<T>): JSX.Element | null;
|
|
10
|
+
export default function DataTableRowCell<T>({ className, sx, style, visibleMediaQuery, record, ellipsis, textAlignment, width, accessor, render, }: DataTableRowCellProps<T>): JSX.Element | null;
|
|
6
11
|
export {};
|
|
7
12
|
//# sourceMappingURL=DataTableRowCell.d.ts.map
|
|
@@ -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":"AAAA,OAAO,EAAqB,EAAE,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD,aAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,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,SAAS,EACT,EAAE,EACF,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE,qBAAqB,CAAC,CAAC,CAAC,sBAqB1B"}
|
|
@@ -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;AAmE5D,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 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))})]})}
|
|
1
|
+
"use strict";var Ir=Object.create;var me=Object.defineProperty;var Gr=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var qr=Object.getPrototypeOf,$r=Object.prototype.hasOwnProperty;var Zr=(e,r)=>{for(var o in r)me(e,o,{get:r[o],enumerable:!0})},or=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Ur(r))!$r.call(e,t)&&t!==o&&me(e,t,{get:()=>r[t],enumerable:!(a=Gr(r,t))||a.enumerable});return e};var xe=(e,r,o)=>(o=e!=null?Ir(qr(e)):{},or(r||!e||!e.__esModule?me(o,"default",{value:e,enumerable:!0}):o,e)),Kr=e=>or(me({},"__esModule",{value:!0}),e);var go={};Zr(go,{DataTable:()=>qe});module.exports=Kr(go);var c=xe(require("react"),1);var N=require("@mantine/core"),k=require("@mantine/hooks"),V=require("react");var tr=require("@mantine/core"),ar=require("react/jsx-runtime"),Xr=(0,tr.createStyles)({root:{"&&":{background:"transparent"}}});function Me(){let{classes:e}=Xr();return(0,ar.jsx)("tr",{className:e.root,children:(0,ar.jsx)("td",{})})}var X=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 _r(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,r){if(e==null)return{};var o=_r(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=xe(require("react")),jr=["size","color"];function ve(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=$(e,jr);return Z.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),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 K=xe(require("react")),Qr=["size","color"];function Fe(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=$(e,Qr);return K.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),K.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),K.default.createElement("polyline",{points:"8 7 12 3 16 7"}),K.default.createElement("polyline",{points:"8 17 12 21 16 17"}),K.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var z=xe(require("react")),Yr=["size","color"];function He(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=$(e,Yr);return z.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),z.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),z.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"}),z.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"}),z.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"}),z.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var M=require("react/jsx-runtime"),Jr=(0,X.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 Ne({icon:e,text:r,pt:o,pb:a,active:t,children:f}){let{classes:u,cx:p}=Jr();return(0,M.jsx)(X.Center,{pt:o,pb:a,className:p(u.root,{[u.active]:t}),children:f||(0,M.jsxs)(M.Fragment,{children:[e||(0,M.jsx)("div",{className:u.standardIcon,children:(0,M.jsx)(He,{})}),(0,M.jsx)(X.Text,{size:"sm",color:"dimmed",children:r})]})})}var v=require("@mantine/core"),fr=require("react"),ne=require("react/jsx-runtime"),eo=(0,v.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}})),lr=(0,fr.forwardRef)(function({className:r,style:o,topBorderColor:a,fetching:t,page:f,onPageChange:u,paginationSize:p,paginationText:n,totalRecords:l,recordsPerPage:d,recordsLength:g,horizontalSpacing:x},i){let m;if(t||!l)m="...";else{let w=(f-1)*d+1,y=w+g-1;m=n({from:w,to:y,totalRecords:l})}let{classes:b,cx:T}=eo({topBorderColor:a});return(0,ne.jsxs)(v.Box,{ref:i,px:x??"xs",py:"xs",className:T(b.root,r),style:o,children:[(0,ne.jsx)(v.Text,{size:p,children:m}),(0,ne.jsx)(v.Pagination,{className:T(b.pagination,{[b.paginationFetching]:t||!g}),page:f,onChange:u,size:p,total:Math.ceil(l/d)})]})});var be=require("@mantine/core"),pr=require("react");var O=require("@mantine/core");var sr=require("@mantine/core"),dr=require("@mantine/hooks");function ie(e){let r=(0,sr.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,dr.useMediaQuery)(o||"",!0)}function ce(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 ur(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 ge(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 F=require("react/jsx-runtime"),ro=(0,O.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 Ee({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:u,onSortStatusChange:p}){let{cx:n,classes:l}=ro();if(!ie(r))return null;let d=o??ce(e);return(0,F.jsx)(O.Box,{component:"th",className:n({[l.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&p?()=>{p({columnAccessor:e,direction:u?.direction==="asc"?"desc":"asc"})}:void 0,children:a||u?.columnAccessor===e?(0,F.jsxs)(O.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,F.jsx)(O.Box,{className:n(l.columnHeaderText,l.sortableColumnHeaderText),children:d}),(0,F.jsx)(O.Center,{children:u?.columnAccessor===e?(0,F.jsx)(ve,{className:n(l.sortableColumnHeaderIcon,{[l.sortableColumnHeaderIconRotated]:u.direction==="desc"}),size:14}):(0,F.jsx)(Fe,{className:l.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,F.jsx)(O.Box,{className:l.columnHeaderText,children:d})})}var _=require("react/jsx-runtime"),oo=(0,be.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"}}}),mr=(0,pr.forwardRef)(function({className:r,style:o,sortStatus:a,onSortStatusChange:t,columns:f,selectionVisible:u,selectionChecked:p,selectionIndeterminate:n,onSelectionChange:l,leftShadowVisible:d,bottomShadowVisible:g},x){let{classes:i,cx:m}=oo();return(0,_.jsx)("thead",{className:m(i.root,{[i.bottomShadowVisible]:g},r),style:o,ref:x,children:(0,_.jsxs)("tr",{children:[u&&(0,_.jsx)("th",{className:m(i.selectorColumnHeader,{[i.selectorColumnHeaderWithRightShadow]:d}),children:(0,_.jsx)(be.Checkbox,{classNames:{input:i.selectionCheckboxInput},checked:p,indeterminate:n,disabled:!l,onChange:l})}),f.map(({accessor:b,visibleMediaQuery:T,textAlignment:w,width:y,title:W,sortable:ye})=>(0,_.jsx)(Ee,{accessor:b,visibleMediaQuery:T,textAlignment:w,width:y,title:W,sortable:ye,sortStatus:a,onSortStatusChange:t},b))]})})});var j=require("@mantine/core"),xr=require("react/jsx-runtime"),ao=(0,j.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 ze({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:u,cx:p}=ao();return(0,xr.jsx)(j.Center,{pt:e,pb:r,className:p(u.root,{[u.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,xr.jsx)(j.Loader,{size:t,variant:f})})}var Ce=require("@mantine/core");var he=require("@mantine/core");var fo=require("react/jsx-runtime"),to=(0,he.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function Ve({className:e,sx:r,style:o,visibleMediaQuery:a,record:t,ellipsis:f,textAlignment:u,width:p,accessor:n,render:l}){let{cx:d,classes:g}=to();return ie(a)?(0,fo.jsx)(he.Box,{component:"td",className:d({[g.ellipsis]:f},e),sx:[{width:p,minWidth:p,maxWidth:p,textAlign:u},r],style:o,children:l?l(t):B(t,n)}):null}var te=require("react/jsx-runtime"),lo=(0,Ce.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 We({record:e,columns:r,selectionVisible:o,selectionChecked:a,onSelectionChange:t,onClick:f,onContextMenu:u,contextMenuVisible:p,leftShadowVisible:n}){let{cx:l,classes:d}=lo();return(0,te.jsxs)("tr",{className:l({[d.withClickHandler]:f,[d.selected]:a,[d.contextMenuVisible]:p}),onClick:f,onContextMenu:u,children:[o&&(0,te.jsx)("td",{className:l(d.selectorCell,{[d.selectorCellWithRightShadow]:n}),children:(0,te.jsx)(Ce.Checkbox,{classNames:{input:d.selectorCheckboxInput},checked:a,disabled:!t,onChange:t,onClick:g=>g.stopPropagation()})}),r.map(({accessor:g,visibleMediaQuery:x,textAlignment:i,ellipsis:m,width:b,render:T,cellsClassName:w,cellsStyle:y,cellsSx:W})=>(0,te.jsx)(Ve,{className:typeof w=="function"?w(e):w,style:typeof y=="function"?y(e):y,sx:W,visibleMediaQuery:x,record:e,accessor:g,textAlignment:i,ellipsis:m,width:b,render:T},g))]})}var Q=require("@mantine/core"),D=require("@mantine/hooks"),uo=require("react/jsx-runtime"),so=(0,Q.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 Ie({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:u}){(0,D.useWindowEvent)("resize",f),(0,D.useWindowEvent)("scroll",f);let p=(0,D.useClickOutside)(f),{ref:n,width:l,height:d}=(0,D.useElementSize)(),g=(0,D.useMergedRef)(p,n),{spacing:{xs:x}}=(0,Q.useMantineTheme)(),{innerWidth:i,innerHeight:m}=window,b=a+d+x>m?m-d-x:a,T=t+l+x>i?i-l-x:t,{classes:w}=so();return(0,uo.jsx)(Q.Paper,{ref:g,shadow:r,radius:e,className:w.root,sx:{top:b,left:T,zIndex:o},children:u})}var nr=require("@mantine/core"),mo=require("react/jsx-runtime"),po=(0,nr.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Ge(){let{classes:e}=po();return(0,mo.jsx)("div",{className:e.root})}var H=require("@mantine/core"),Se=require("react/jsx-runtime"),xo=(0,H.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 Ue({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=xo({color:o});return(0,Se.jsxs)(H.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,Se.jsx)(H.Box,{className:f.icon,children:e}),(0,Se.jsx)(H.Text,{className:f.title,size:"sm",children:r})]})}var Be=require("@mantine/core"),ir=require("react"),fe=require("react/jsx-runtime"),no=(0,Be.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:{zIndex:3,top:0,left:0,bottom:0,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%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:e.spacing.sm,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:{zIndex:2,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}}}),cr=(0,ir.forwardRef)(function({leftShadowVisible:r,rightShadowVisible:o,bottomShadowVisible:a,headerHeight:t,onScrollPositionChange:f,children:u},p){let{cx:n,classes:l}=no();return(0,fe.jsxs)(Be.ScrollArea,{viewportRef:p,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:t}},onScrollPositionChange:f,children:[u,(0,fe.jsx)("div",{className:n(l.shadow,l.leftShadow,{[l.shadowVisible]:r})}),(0,fe.jsx)("div",{className:n(l.shadow,l.rightShadow,{[l.shadowVisible]:o})}),(0,fe.jsx)("div",{className:n(l.shadow,l.bottomShadow,{[l.shadowVisible]:a})})]})});var S=require("react/jsx-runtime"),io={},we=200,Te={leading:!0},co=(0,N.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 qe({withBorder:e,borderRadius:r,borderColor:o=h=>h.colorScheme==="dark"?h.colors.dark[4]:h.colors.gray[3],rowBorderColor:a=h=>h.fn.rgba(h.colorScheme==="dark"?h.colors.dark[4]:h.colors.gray[3],.65),withColumnBorders:t,textSelectionDisabled:f,height:u="100%",minHeight:p,shadow:n,verticalAlignment:l="center",fetching:d,columns:g,idAccessor:x="id",records:i,selectedRecords:m,onSelectedRecordsChange:b,sortStatus:T,onSortStatusChange:w,horizontalSpacing:y,page:W,onPageChange:ye,totalRecords:gr,recordsPerPage:br,paginationSize:hr="sm",paginationText:Cr=({from:h,to:Y,totalRecords:I})=>`${h} - ${Y} / ${I}`,loaderSize:Sr,loaderVariant:Br,loaderBackgroundBlur:wr,emptyState:Tr,noRecordsText:yr="No records",noRecordsIcon:Or,striped:kr,onRowClick:Oe,rowContextMenu:A,sx:Dr,className:Ar,classNames:ke,style:Rr,styles:De,...Pr}){let{ref:h,width:Y,height:I}=(0,k.useElementSize)(),{ref:Lr,height:Ae}=(0,k.useElementSize)(),{ref:Mr,width:Re,height:le}=(0,k.useElementSize)(),{ref:vr,height:$e}=(0,k.useElementSize)(),[Fr,Ze]=(0,k.useDebouncedState)(!0,we,Te),[Hr,Ke]=(0,k.useDebouncedState)(!0,we,Te),[Xe,_e]=(0,k.useDebouncedState)(!0,we,Te),[Nr,je]=(0,k.useDebouncedState)(!0,we,Te),[G,U]=(0,V.useState)(null);(0,V.useEffect)(()=>{d&&U(null)},[d]);let Qe=()=>{if(d||U(null),d||le<=I)Ze(!0),Ke(!0);else{let s=h.current.scrollTop;Ze(s===0),Ke(Math.round(le-s)===Math.round(I))}if(d||Re===Y)_e(!0),je(!0);else{let s=h.current.scrollLeft;_e(s===0),je(Math.round(Re-s)===Math.round(Y))}};(0,V.useEffect)(Qe,[d,I,h,Y,le,Re]);let Er=s=>{h.current.scrollTo({top:0,left:0}),ye(s)},se=i?.length,J=i?.map(s=>B(s,x)),ee=m?.map(s=>B(s,x)),Ye=J!==void 0&&ee!==void 0&&ee.length>0,Pe=Ye&&J.every(s=>ee.includes(s)),zr=Ye&&J.some(s=>ee.includes(s)),[de,Je]=(0,V.useState)(null),Vr=J?.join(":")||"";(0,V.useEffect)(()=>{Je(null)},[Vr]);let er=!!m&&!Xe,{cx:rr,classes:E,theme:Wr}=co({borderColor:o,rowBorderColor:a}),Le=typeof De=="function"?De(Wr,io):De;return(0,S.jsxs)(N.Box,{className:rr(E.root,{[E.tableWithBorder]:e},Ar,ke?.root),sx:[s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[n]||n,height:u,minHeight:p}),...(0,N.packSx)(Dr)],style:{...Le?.root,...Rr},children:[(0,S.jsx)(cr,{ref:h,leftShadowVisible:!(m||Xe),rightShadowVisible:!Nr,bottomShadowVisible:!Hr,headerHeight:Ae,onScrollPositionChange:Qe,children:(0,S.jsxs)(N.Table,{ref:Mr,horizontalSpacing:y,className:rr({[E.tableWithColumnBorders]:t,[E.lastRowBorderBottomVisible]:le<I,[E.textSelectionDisabled]:f,[E.verticalAlignmentTop]:l==="top",[E.verticalAlignmentBottom]:l==="bottom"}),striped:se?kr:!1,...Pr,children:[(0,S.jsx)(mr,{ref:Lr,className:ke?.header,style:Le?.header,columns:g,sortStatus:T,onSortStatusChange:w,selectionVisible:!!m,selectionChecked:Pe,selectionIndeterminate:zr&&!Pe,onSelectionChange:b?()=>{b(Pe?m.filter(s=>!J.includes(B(s,x))):ge([...m,...i],s=>B(s,x)))}:void 0,leftShadowVisible:er,bottomShadowVisible:!Fr}),(0,S.jsx)("tbody",{children:se?i.map((s,R)=>{let q=B(s,x),re=ee?.includes(q)||!1,ue=!1,pe=!1;if(A){let{hidden:C}=A;(!C||!(typeof C=="function"?C(s):C))&&(A.trigger==="click"?ue=!0:pe=!0)}return(0,S.jsx)(We,{record:s,columns:g,selectionVisible:!!m,selectionChecked:re,onSelectionChange:b?C=>{if(C.nativeEvent.shiftKey&&de!==null){let P=i.filter(R>de?(oe,ae)=>ae>=de&&ae<=R:(oe,ae)=>ae>=R&&ae<=de);b(re?ur(m,P,oe=>B(oe,x)):ge([...m,...P],oe=>B(oe,x)))}else b(re?m.filter(P=>B(P,x)!==q):ge([...m,s],P=>B(P,x)));Je(R)}:void 0,onClick:ue?C=>{U({top:C.clientY,left:C.clientX,record:s}),Oe?.(s)}:Oe?()=>{Oe(s)}:void 0,onContextMenu:pe?C=>{C.preventDefault(),U({top:C.clientY,left:C.clientX,record:s})}:void 0,contextMenuVisible:G?B(G.record,x)===q:!1,leftShadowVisible:er},q)}):(0,S.jsx)(Me,{})})]})}),W&&(0,S.jsx)(lr,{ref:vr,className:ke?.pagination,style:Le?.pagination,topBorderColor:o,horizontalSpacing:y,fetching:d,page:W,onPageChange:Er,totalRecords:gr,recordsPerPage:br,paginationSize:hr,paginationText:Cr,recordsLength:se}),(0,S.jsx)(ze,{pt:Ae,pb:$e,fetching:d,loaderBackgroundBlur:wr,loaderSize:Sr,loaderVariant:Br}),(0,S.jsx)(Ne,{pt:Ae,pb:$e,icon:Or,text:yr,active:!d&&!se,children:Tr}),A&&G&&(0,S.jsx)(Ie,{zIndex:A.zIndex,borderRadius:A.borderRadius,shadow:A.shadow,top:G.top,left:G.left,onDestroy:()=>U(null),children:A.items(G.record).map(({divider:s,key:R,title:q,icon:re,color:ue,hidden:pe,disabled:C,onClick:P})=>s?(0,S.jsx)(Ge,{},R):pe?null:(0,S.jsx)(Ue,{title:q??ce(R),icon:re,color:ue,disabled:C,onClick:()=>{U(null),P()}},R))})]})}
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|