mantine-datatable 1.6.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/DataTable.d.ts +1 -1
- package/dist/DataTable.d.ts.map +1 -1
- package/dist/DataTable.props.d.ts +60 -30
- package/dist/DataTable.props.d.ts.map +1 -1
- package/dist/DataTableRow.d.ts +3 -2
- package/dist/DataTableRow.d.ts.map +1 -1
- package/dist/DataTableRowExpansion.d.ts +11 -0
- package/dist/DataTableRowExpansion.d.ts.map +1 -0
- package/dist/DataTableRowSelectorCell.d.ts +10 -0
- package/dist/DataTableRowSelectorCell.d.ts.map +1 -0
- package/dist/hooks.d.ts +45 -0
- package/dist/hooks.d.ts.map +1 -0
- 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/package.json +7 -7
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[![Downloads][downloads-image]][npm-url]
|
|
9
9
|
[![Language][language-image]][repo-url]
|
|
10
10
|
|
|
11
|
-
A "dark-theme aware" **table component** for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, multiple rows selection, column sorting, custom cell data rendering, row context menu, and more.
|
|
11
|
+
A "dark-theme aware" **table component** for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, multiple rows selection, column sorting, custom cell data rendering, row context menu, row expansion, and more.
|
|
12
12
|
|
|
13
13
|
[](https://icflorescu.github.io/mantine-datatable/)
|
|
14
14
|
|
|
15
15
|
## Full documentation and examples
|
|
16
16
|
|
|
17
|
-
Visit [icflorescu.github.io/mantine-datatable](https://icflorescu.github.io/mantine-datatable/) to view the full documentation and learn how to use it.
|
|
17
|
+
Visit [icflorescu.github.io/mantine-datatable](https://icflorescu.github.io/mantine-datatable/) to view the full documentation and learn how to use it by browsing a comprehensive list of examples.
|
|
18
18
|
|
|
19
19
|
## Quickstart
|
|
20
20
|
|
package/dist/DataTable.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DataTableProps } from './DataTable.props';
|
|
2
|
-
export default function DataTable<T>({ 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;
|
|
2
|
+
export default function DataTable<T>({ 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, rowExpansion, 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;AAoFnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,EACnC,UAAU,EACV,YAAY,EACZ,WAAqG,EACrG,cACiG,EACjG,iBAAiB,EACjB,qBAAqB,EACrB,MAAe,EACf,SAAS,EACT,MAAM,EACN,iBAA4B,EAC5B,QAAQ,EACR,OAAO,EACP,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,YAAY,EACZ,EAAE,EACF,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,GAAG,UAAU,EACd,EAAE,cAAc,CAAC,CAAC,CAAC,eAuSnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultProps, MantineColor, MantineNumberSize, MantineShadow, MantineSize, MantineTheme, Sx, TableProps } from '@mantine/core';
|
|
1
|
+
import type { CollapseProps, DefaultProps, MantineColor, MantineNumberSize, MantineShadow, MantineSize, MantineTheme, Sx, TableProps } from '@mantine/core';
|
|
2
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';
|
|
@@ -209,6 +209,61 @@ export declare type DataTableContextMenuItemProps = ({
|
|
|
209
209
|
*/
|
|
210
210
|
onClick: () => void;
|
|
211
211
|
}));
|
|
212
|
+
export declare type DataTableContextMenuProps<T> = {
|
|
213
|
+
/**
|
|
214
|
+
* Context menu trigger; defaults to `rightClick` for classic behavior
|
|
215
|
+
*/
|
|
216
|
+
trigger?: 'rightClick' | 'click';
|
|
217
|
+
/**
|
|
218
|
+
* Menu z-index; defaults to `3`
|
|
219
|
+
*/
|
|
220
|
+
zIndex?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Menu border radius; defaults to `xs`
|
|
223
|
+
*/
|
|
224
|
+
borderRadius?: MantineNumberSize;
|
|
225
|
+
/**
|
|
226
|
+
* Menu shadow; defaults to `sm`
|
|
227
|
+
*/
|
|
228
|
+
shadow?: MantineShadow;
|
|
229
|
+
/**
|
|
230
|
+
* Boolean or function accepting the current record as parameter returning boolean;
|
|
231
|
+
* if true, the menu will not be shown
|
|
232
|
+
*/
|
|
233
|
+
hidden?: boolean | ((record: T) => boolean);
|
|
234
|
+
/**
|
|
235
|
+
* Function returning the row menu items for the current record
|
|
236
|
+
*/
|
|
237
|
+
items: (record: T) => DataTableContextMenuItemProps[];
|
|
238
|
+
};
|
|
239
|
+
export declare type DataTableRowExpansionCollapseProps = Pick<CollapseProps, 'animateOpacity' | 'transitionDuration' | 'transitionTimingFunction'>;
|
|
240
|
+
export declare type DataTableRowExpansionProps<T> = {
|
|
241
|
+
/**
|
|
242
|
+
* Defines when rows should expand; defaults to `click`
|
|
243
|
+
*/
|
|
244
|
+
trigger?: 'click' | 'always';
|
|
245
|
+
/**
|
|
246
|
+
* If true, multiple rows can be expanded at the same time
|
|
247
|
+
*/
|
|
248
|
+
allowMultiple?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Function defining which records will be initially expanded;
|
|
251
|
+
* does nothing if `trigger === 'always'`
|
|
252
|
+
*/
|
|
253
|
+
initiallyExpanded?: (record: T) => boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Additional properties passed to the Mantine Collapse component wrapping the custom content
|
|
256
|
+
*/
|
|
257
|
+
collapseProps?: DataTableRowExpansionCollapseProps;
|
|
258
|
+
/**
|
|
259
|
+
* Function returning the custom content to be lazily rendered for an expanded row;
|
|
260
|
+
* accepts the current record and a `collapse()` callback that can be used to collapse the expanded row
|
|
261
|
+
*/
|
|
262
|
+
content: (props: {
|
|
263
|
+
record: T;
|
|
264
|
+
collapse: () => void;
|
|
265
|
+
}) => ReactNode;
|
|
266
|
+
};
|
|
212
267
|
export declare type DataTableProps<T> = {
|
|
213
268
|
/**
|
|
214
269
|
* Table height; defaults to `100%`
|
|
@@ -280,34 +335,9 @@ export declare type DataTableProps<T> = {
|
|
|
280
335
|
*/
|
|
281
336
|
onRowClick?: (record: T) => void;
|
|
282
337
|
/**
|
|
283
|
-
* Defines a context-menu
|
|
284
|
-
*/
|
|
285
|
-
rowContextMenu?:
|
|
286
|
-
|
|
287
|
-
* Context menu trigger; defaults to `rightClick` for classic behavior
|
|
288
|
-
*/
|
|
289
|
-
trigger?: 'rightClick' | 'click';
|
|
290
|
-
/**
|
|
291
|
-
* Menu z-index; defaults to `3`
|
|
292
|
-
*/
|
|
293
|
-
zIndex?: number;
|
|
294
|
-
/**
|
|
295
|
-
* Menu border radius; defaults to `xs`
|
|
296
|
-
*/
|
|
297
|
-
borderRadius?: MantineNumberSize;
|
|
298
|
-
/**
|
|
299
|
-
* Menu shadow; defaults to `sm`
|
|
300
|
-
*/
|
|
301
|
-
shadow?: MantineShadow;
|
|
302
|
-
/**
|
|
303
|
-
* Boolean or function accepting the current record as parameter returning boolean;
|
|
304
|
-
* if true, the menu will not be shown
|
|
305
|
-
*/
|
|
306
|
-
hidden?: boolean | ((record: T) => boolean);
|
|
307
|
-
/**
|
|
308
|
-
* A function returning the row menu items for the current record
|
|
309
|
-
*/
|
|
310
|
-
items: (record: T) => DataTableContextMenuItemProps[];
|
|
311
|
-
};
|
|
338
|
+
* Defines a context-menu to show when user right-clicks or clicks on a row
|
|
339
|
+
*/
|
|
340
|
+
rowContextMenu?: DataTableContextMenuProps<T>;
|
|
341
|
+
rowExpansion?: DataTableRowExpansionProps<T>;
|
|
312
342
|
} & Pick<TableProps, 'striped' | 'highlightOnHover' | 'horizontalSpacing' | 'verticalSpacing' | 'fontSize'> & Omit<DefaultProps<'root' | 'header' | 'pagination', CSSProperties>, 'unstyled'> & DataTableOuterBorderProps & DataTableEmptyStateProps & DataTablePaginationProps & DataTableSortProps & DataTableSelectionProps<T>;
|
|
313
343
|
//# sourceMappingURL=DataTable.props.d.ts.map
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,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,UAAU,CAAC,GACzG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,QAAQ,GAAG,YAAY,EAAE,aAAa,CAAC,EAAE,UAAU,CAAC,GAC/E,yBAAyB,GACzB,wBAAwB,GACxB,wBAAwB,GACxB,kBAAkB,GAClB,uBAAuB,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/DataTableRow.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { ChangeEventHandler, MouseEventHandler } from 'react';
|
|
2
2
|
import { DataTableColumn } from './DataTable.props';
|
|
3
|
+
import { useRowExpansion } from './hooks';
|
|
3
4
|
declare type DataTableRowProps<T> = {
|
|
4
5
|
record: T;
|
|
5
6
|
columns: DataTableColumn<T>[];
|
|
6
|
-
withPointerCursor: boolean;
|
|
7
7
|
selectionVisible: boolean;
|
|
8
8
|
selectionChecked: boolean;
|
|
9
9
|
onSelectionChange: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
10
10
|
onClick: MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
11
11
|
onContextMenu: MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
12
|
+
expansion: ReturnType<typeof useRowExpansion<T>>;
|
|
12
13
|
contextMenuVisible: boolean;
|
|
13
14
|
leftShadowVisible: boolean;
|
|
14
15
|
};
|
|
15
|
-
export default function DataTableRow<T>({ record, columns,
|
|
16
|
+
export default function DataTableRow<T>({ record, columns, selectionVisible, selectionChecked, onSelectionChange, onClick, onContextMenu, expansion, contextMenuVisible, leftShadowVisible, }: DataTableRowProps<T>): JSX.Element;
|
|
16
17
|
export {};
|
|
17
18
|
//# sourceMappingURL=DataTableRow.d.ts.map
|
|
@@ -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;
|
|
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;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiC1C,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,SAAS,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,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,SAAS,EACT,kBAAkB,EAClB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,CAAC,CAAC,eA0EtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DataTableRowExpansionCollapseProps } from './DataTable.props';
|
|
3
|
+
declare type DataTableRowExpansionProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
colSpan: number;
|
|
6
|
+
content: () => ReactNode;
|
|
7
|
+
collapseProps?: DataTableRowExpansionCollapseProps;
|
|
8
|
+
};
|
|
9
|
+
export default function DataTableRowExpansion({ open, colSpan, content, collapseProps }: DataTableRowExpansionProps): JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=DataTableRowExpansion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableRowExpansion.d.ts","sourceRoot":"","sources":["../DataTableRowExpansion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AAiBvE,aAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,kCAAkC,CAAC;CACpD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,0BAA0B,sBAkBlH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChangeEventHandler } from 'react';
|
|
2
|
+
declare type DataTableRowSelectorCellProps = {
|
|
3
|
+
withRightShadow: boolean;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
onChange: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
7
|
+
};
|
|
8
|
+
export default function DataTableRowSelectorCell({ withRightShadow, ...otherProps }: DataTableRowSelectorCellProps): JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=DataTableRowSelectorCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableRowSelectorCell.d.ts","sourceRoot":"","sources":["../DataTableRowSelectorCell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAyC3C,aAAK,6BAA6B,GAAG;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;CAC5D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,EAAE,6BAA6B,eAOjH"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataTableRowExpansionProps } from './DataTable.props';
|
|
3
|
+
export declare function useScrollStatus(): {
|
|
4
|
+
scrolledToTop: boolean;
|
|
5
|
+
setScrolledToTop: (newValue: boolean) => void;
|
|
6
|
+
scrolledToBottom: boolean;
|
|
7
|
+
setScrolledToBottom: (newValue: boolean) => void;
|
|
8
|
+
scrolledToLeft: boolean;
|
|
9
|
+
setScrolledToLeft: (newValue: boolean) => void;
|
|
10
|
+
scrolledToRight: boolean;
|
|
11
|
+
setScrolledToRight: (newValue: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function useLastSelectionChangeIndex(recordIds: unknown[] | undefined): {
|
|
14
|
+
lastSelectionChangeIndex: number | null;
|
|
15
|
+
setLastSelectionChangeIndex: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
|
16
|
+
};
|
|
17
|
+
export declare function useRowContextMenu<T>(fetching?: boolean): {
|
|
18
|
+
rowContextMenuInfo: {
|
|
19
|
+
top: number;
|
|
20
|
+
left: number;
|
|
21
|
+
record: T;
|
|
22
|
+
} | null;
|
|
23
|
+
setRowContextMenuInfo: import("react").Dispatch<import("react").SetStateAction<{
|
|
24
|
+
top: number;
|
|
25
|
+
left: number;
|
|
26
|
+
record: T;
|
|
27
|
+
} | null>>;
|
|
28
|
+
};
|
|
29
|
+
export declare function useRowExpansion<T>({ rowExpansion, records, idAccessor, }: {
|
|
30
|
+
rowExpansion?: DataTableRowExpansionProps<T>;
|
|
31
|
+
records: T[] | undefined;
|
|
32
|
+
idAccessor: string;
|
|
33
|
+
}): {
|
|
34
|
+
expandOnClick: boolean;
|
|
35
|
+
isRowExpanded: (record: T) => boolean;
|
|
36
|
+
expandRow: (record: T) => void;
|
|
37
|
+
collapseRow: (record: T) => void;
|
|
38
|
+
collapseProps: import("./DataTable.props").DataTableRowExpansionCollapseProps | undefined;
|
|
39
|
+
content: (record: T) => () => import("react").ReactNode;
|
|
40
|
+
} | undefined;
|
|
41
|
+
export declare function useRowExpansionStatus(open: boolean, transitionDuration?: number): {
|
|
42
|
+
expanded: boolean;
|
|
43
|
+
visible: boolean;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../hooks.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAM/D,wBAAgB,eAAe;;;;;;;;;EA4B9B;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS;;;EAQ3E;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO;;aACe,MAAM;cAAQ,MAAM;gBAAU,CAAC;;;aAA/B,MAAM;cAAQ,MAAM;gBAAU,CAAC;;EAKpG;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,EACjC,YAAY,EACZ,OAAO,EACP,UAAU,GACX,EAAE;IACD,YAAY,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;;4BAsB6B,CAAC;wBAEL,CAAC;0BAPM,CAAC;;sBAaV,CAAC;cAGxB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,MAAM;;;EAoB/E"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Kr=Object.create;var Ce=Object.defineProperty;var Yr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var Qr=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty;var Jr=(e,r)=>{for(var o in r)Ce(e,o,{get:r[o],enumerable:!0})},ur=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of _r(r))!jr.call(e,t)&&t!==o&&Ce(e,t,{get:()=>r[t],enumerable:!(a=Yr(r,t))||a.enumerable});return e};var Se=(e,r,o)=>(o=e!=null?Kr(Qr(e)):{},ur(r||!e||!e.__esModule?Ce(o,"default",{value:e,enumerable:!0}):o,e)),eo=e=>ur(Ce({},"__esModule",{value:!0}),e);var bo={};Jr(bo,{DataTable:()=>Ye});module.exports=eo(bo);var c=Se(require("react"),1);var N=require("@mantine/core"),T=require("@mantine/hooks"),G=require("react");var pr=require("@mantine/core"),Fe=require("react/jsx-runtime"),ro=(0,pr.createStyles)({root:{"&&":{background:"transparent"}}});function Ee(){let{classes:e}=ro();return(0,Fe.jsx)("tr",{className:e.root,children:(0,Fe.jsx)("td",{})})}var Q=require("@mantine/core");function H(){return H=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},H.apply(this,arguments)}function oo(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 K(e,r){if(e==null)return{};var o=oo(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 Y=Se(require("react")),ao=["size","color"];function Ne(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=K(e,ao);return Y.default.createElement("svg",H({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),Y.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Y.default.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Y.default.createElement("line",{x1:"18",y1:"13",x2:"12",y2:"19"}),Y.default.createElement("line",{x1:"6",y1:"13",x2:"12",y2:"19"}))}var _=Se(require("react")),to=["size","color"];function We(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=K(e,to);return _.default.createElement("svg",H({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),_.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),_.default.createElement("polyline",{points:"8 7 12 3 16 7"}),_.default.createElement("polyline",{points:"8 17 12 21 16 17"}),_.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var z=Se(require("react")),fo=["size","color"];function ze(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=K(e,fo);return z.default.createElement("svg",H({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 k=require("react/jsx-runtime"),lo=(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 Ve({icon:e,text:r,pt:o,pb:a,active:t,children:f}){let{classes:p,cx:m}=lo();return(0,k.jsx)(Q.Center,{pt:o,pb:a,className:m(p.root,{[p.active]:t}),children:f||(0,k.jsxs)(k.Fragment,{children:[e||(0,k.jsx)("div",{className:p.standardIcon,children:(0,k.jsx)(ze,{})}),(0,k.jsx)(Q.Text,{size:"sm",color:"dimmed",children:r})]})})}var F=require("@mantine/core"),mr=require("react"),pe=require("react/jsx-runtime"),so=(0,F.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}})),xr=(0,mr.forwardRef)(function({className:r,style:o,topBorderColor:a,fetching:t,page:f,onPageChange:p,paginationSize:m,paginationText:n,totalRecords:d,recordsPerPage:l,recordsLength:i,horizontalSpacing:u},h){let x;if(t||!d)x="...";else{let y=(f-1)*l+1,M=y+i-1;x=n({from:y,to:M,totalRecords:d})}let{classes:C,cx:O}=so({topBorderColor:a});return(0,pe.jsxs)(F.Box,{ref:h,px:u??"xs",py:"xs",className:O(C.root,r),style:o,children:[(0,pe.jsx)(F.Text,{size:m,children:x}),(0,pe.jsx)(F.Pagination,{className:O(C.pagination,{[C.paginationFetching]:t||!i}),page:f,onChange:p,size:m,total:Math.ceil(d/l)})]})});var ye=require("@mantine/core"),gr=require("react");var w=require("@mantine/core");var nr=require("@mantine/core"),ir=require("@mantine/hooks");function be(e){let r=(0,nr.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,ir.useMediaQuery)(o||"",!0)}function Be(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 cr(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 Oe(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 D=require("react/jsx-runtime"),uo=(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 Ie({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:p,onSortStatusChange:m}){let{cx:n,classes:d}=uo();if(!be(r))return null;let l=o??Be(e);return(0,D.jsx)(w.Box,{component:"th",className:n({[d.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&m?()=>{m({columnAccessor:e,direction:p?.direction==="asc"?"desc":"asc"})}:void 0,children:a||p?.columnAccessor===e?(0,D.jsxs)(w.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,D.jsx)(w.Box,{className:n(d.columnHeaderText,d.sortableColumnHeaderText),children:l}),(0,D.jsx)(w.Center,{children:p?.columnAccessor===e?(0,D.jsx)(Ne,{className:n(d.sortableColumnHeaderIcon,{[d.sortableColumnHeaderIconRotated]:p.direction==="desc"}),size:14}):(0,D.jsx)(We,{className:d.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,D.jsx)(w.Box,{className:d.columnHeaderText,children:l})})}var V=require("react/jsx-runtime"),po=(0,ye.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},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"}}}),hr=(0,gr.forwardRef)(function({className:r,style:o,sortStatus:a,onSortStatusChange:t,columns:f,selectionVisible:p,selectionChecked:m,selectionIndeterminate:n,onSelectionChange:d,leftShadowVisible:l},i){let{classes:u,cx:h}=po();return(0,V.jsx)("thead",{className:h(u.root,r),style:o,ref:i,children:(0,V.jsxs)("tr",{children:[p&&(0,V.jsx)("th",{className:h(u.selectorColumnHeader,{[u.selectorColumnHeaderWithRightShadow]:l}),children:(0,V.jsx)(ye.Checkbox,{classNames:{input:u.selectionCheckboxInput},checked:m,indeterminate:n,disabled:!d,onChange:d})}),f.map(({accessor:x,hidden:C,visibleMediaQuery:O,textAlignment:y,width:M,title:P,sortable:W})=>C?null:(0,V.jsx)(Ie,{accessor:x,visibleMediaQuery:O,textAlignment:y,width:M,title:P,sortable:W,sortStatus:a,onSortStatusChange:t},x))]})})});var j=require("@mantine/core"),Ge=require("react/jsx-runtime"),mo=(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 Ue({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:p,cx:m}=mo();return(0,Ge.jsx)(j.Center,{pt:e,pb:r,className:m(p.root,{[p.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,Ge.jsx)(j.Loader,{size:t,variant:f})})}var Te=require("@mantine/core");var we=require("@mantine/core");var Cr=require("react/jsx-runtime"),xo=(0,we.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function qe({className:e,sx:r,style:o,visibleMediaQuery:a,record:t,ellipsis:f,textAlignment:p,width:m,accessor:n,render:d}){let{cx:l,classes:i}=xo();return be(a)?(0,Cr.jsx)(we.Box,{component:"td",className:l({[i.ellipsis]:f},e),sx:[{width:m,minWidth:m,maxWidth:m,textAlign:p},r],style:o,children:d?d(t):B(t,n)}):null}var J=require("react/jsx-runtime"),no=(0,Te.createStyles)(e=>{let r=e.colors[e.primaryColor][6],o=e.colorScheme==="dark"?.5:.05;return{withPointerCursor:{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)}}},expandedRow:{"&&":{padding:0}},expandedRowCollapsed:{"&&":{border:0}}}});function Ze({record:e,columns:r,withPointerCursor:o,selectionVisible:a,selectionChecked:t,onSelectionChange:f,onClick:p,onContextMenu:m,contextMenuVisible:n,leftShadowVisible:d}){let{cx:l,classes:i}=no();return(0,J.jsxs)("tr",{className:l({[i.withPointerCursor]:o,[i.selected]:t,[i.contextMenuVisible]:n}),onClick:p,onContextMenu:m,children:[a&&(0,J.jsx)("td",{className:l(i.selectorCell,{[i.selectorCellWithRightShadow]:d}),children:(0,J.jsx)(Te.Checkbox,{classNames:{input:i.selectorCheckboxInput},checked:t,disabled:!f,onChange:f,onClick:u=>u.stopPropagation()})}),r.map(({accessor:u,hidden:h,visibleMediaQuery:x,textAlignment:C,ellipsis:O,width:y,render:M,cellsClassName:P,cellsStyle:W,cellsSx:Ae})=>h?null:(0,J.jsx)(qe,{className:typeof P=="function"?P(e):P,style:typeof W=="function"?W(e):W,sx:Ae,visibleMediaQuery:x,record:e,accessor:u,textAlignment:C,ellipsis:O,width:y,render:M},u))]})}var ee=require("@mantine/core"),A=require("@mantine/hooks"),Sr=require("react/jsx-runtime"),io=(0,ee.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 $e({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:p}){(0,A.useWindowEvent)("resize",f),(0,A.useWindowEvent)("scroll",f);let m=(0,A.useClickOutside)(f),{ref:n,width:d,height:l}=(0,A.useElementSize)(),i=(0,A.useMergedRef)(m,n),{spacing:{xs:u}}=(0,ee.useMantineTheme)(),{innerWidth:h,innerHeight:x}=window,C=a+l+u>x?x-l-u:a,O=t+d+u>h?h-d-u:t,{classes:y}=io();return(0,Sr.jsx)(ee.Paper,{ref:i,shadow:r,radius:e,className:y.root,sx:{top:C,left:O,zIndex:o},children:p})}var br=require("@mantine/core"),Br=require("react/jsx-runtime"),co=(0,br.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Xe(){let{classes:e}=co();return(0,Br.jsx)("div",{className:e.root})}var E=require("@mantine/core"),me=require("react/jsx-runtime"),go=(0,E.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 Ke({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=go({color:o});return(0,me.jsxs)(E.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,me.jsx)(E.Box,{className:f.icon,children:e}),(0,me.jsx)(E.Text,{className:f.title,size:"sm",children:r})]})}var re=require("@mantine/core"),Or=require("react"),I=require("react/jsx-runtime"),ho=(0,re.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"},topShadow:{zIndex:2,top:0,left:0,right:0,height:e.spacing.sm,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%)`},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}}}),yr=(0,Or.forwardRef)(function({topShadowVisible:r,leftShadowVisible:o,rightShadowVisible:a,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:p,children:m},n){let{cx:d,classes:l}=ho();return(0,I.jsxs)(re.ScrollArea,{viewportRef:n,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:p,children:[m,(0,I.jsx)(re.Box,{className:d(l.shadow,l.topShadow,{[l.shadowVisible]:r}),sx:{top:f}}),(0,I.jsx)("div",{className:d(l.shadow,l.leftShadow,{[l.shadowVisible]:o})}),(0,I.jsx)("div",{className:d(l.shadow,l.rightShadow,{[l.shadowVisible]:a})}),(0,I.jsx)("div",{className:d(l.shadow,l.bottomShadow,{[l.shadowVisible]:t})})]})});var S=require("react/jsx-runtime"),Co={},ke=200,De={leading:!0},So=(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"},table:{borderCollapse:"separate",borderSpacing:0},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 Ye({withBorder:e,borderRadius:r,borderColor:o=g=>g.colorScheme==="dark"?g.colors.dark[4]:g.colors.gray[3],rowBorderColor:a=g=>g.fn.rgba(g.colorScheme==="dark"?g.colors.dark[4]:g.colors.gray[3],.65),withColumnBorders:t,textSelectionDisabled:f,height:p="100%",minHeight:m,shadow:n,verticalAlignment:d="center",fetching:l,columns:i,idAccessor:u="id",records:h,selectedRecords:x,onSelectedRecordsChange:C,sortStatus:O,onSortStatusChange:y,horizontalSpacing:M,page:P,onPageChange:W,totalRecords:Ae,recordsPerPage:wr,paginationSize:Tr="sm",paginationText:kr=({from:g,to:oe,totalRecords:U})=>`${g} - ${oe} / ${U}`,loaderSize:Dr,loaderVariant:Ar,loaderBackgroundBlur:Mr,emptyState:Pr,noRecordsText:Rr="No records",noRecordsIcon:Lr,striped:vr,onRowClick:xe,rowContextMenu:R,sx:Hr,className:Fr,classNames:Me,style:Er,styles:Pe,...Nr}){let{ref:g,width:oe,height:U}=(0,T.useElementSize)(),{ref:Wr,height:Re}=(0,T.useElementSize)(),{ref:zr,width:Le,height:ne}=(0,T.useElementSize)(),{ref:Vr,height:_e}=(0,T.useElementSize)(),[Ir,Qe]=(0,T.useDebouncedState)(!0,ke,De),[Gr,je]=(0,T.useDebouncedState)(!0,ke,De),[Je,er]=(0,T.useDebouncedState)(!0,ke,De),[Ur,rr]=(0,T.useDebouncedState)(!0,ke,De),[q,Z]=(0,G.useState)(null);(0,G.useEffect)(()=>{l&&Z(null)},[l]);let or=()=>{if(l||Z(null),l||ne<=U)Qe(!0),je(!0);else{let s=g.current.scrollTop;Qe(s===0),je(Math.round(ne-s)===Math.round(U))}if(l||Le===oe)er(!0),rr(!0);else{let s=g.current.scrollLeft;er(s===0),rr(Math.round(Le-s)===Math.round(oe))}};(0,G.useEffect)(or,[l,U,g,oe,ne,Le]);let qr=s=>{g.current.scrollTo({top:0,left:0}),W(s)},ie=h?.length,ae=h?.map(s=>B(s,u)),te=x?.map(s=>B(s,u)),ar=ae!==void 0&&te!==void 0&&te.length>0,ve=ar&&ae.every(s=>te.includes(s)),Zr=ar&&ae.some(s=>te.includes(s)),tr;C&&(tr=()=>{C(ve?x.filter(s=>!ae.includes(B(s,u))):Oe([...x,...h],s=>B(s,u)))});let[ce,fr]=(0,G.useState)(null),$r=ae?.join(":")||"";(0,G.useEffect)(()=>{fr(null)},[$r]);let lr=!!x&&!Je,{cx:sr,classes:L,theme:Xr}=So({borderColor:o,rowBorderColor:a}),He=typeof Pe=="function"?Pe(Xr,Co):Pe;return(0,S.jsxs)(N.Box,{className:sr(L.root,{[L.tableWithBorder]:e},Fr,Me?.root),sx:[s=>({borderRadius:s.radius[r]||r,boxShadow:s.shadows[n]||n,height:p,minHeight:m}),...(0,N.packSx)(Hr)],style:{...He?.root,...Er},children:[(0,S.jsx)(yr,{ref:g,topShadowVisible:!Ir,leftShadowVisible:!(x||Je),rightShadowVisible:!Ur,bottomShadowVisible:!Gr,headerHeight:Re,onScrollPositionChange:or,children:(0,S.jsxs)(N.Table,{ref:zr,horizontalSpacing:M,className:sr(L.table,{[L.tableWithColumnBorders]:t,[L.lastRowBorderBottomVisible]:ne<U,[L.textSelectionDisabled]:f,[L.verticalAlignmentTop]:d==="top",[L.verticalAlignmentBottom]:d==="bottom"}),striped:ie?vr:!1,...Nr,children:[(0,S.jsx)(hr,{ref:Wr,className:Me?.header,style:He?.header,columns:i,sortStatus:O,onSortStatusChange:y,selectionVisible:!!x,selectionChecked:ve,selectionIndeterminate:Zr&&!ve,onSelectionChange:tr,leftShadowVisible:lr}),(0,S.jsx)("tbody",{children:ie?h.map((s,v)=>{let $=B(s,u),fe=te?.includes($)||!1,le=!1,ge=!1;if(R){let{hidden:b}=R;(!b||!(typeof b=="function"?b(s):b))&&(R.trigger==="click"?le=!0:ge=!0)}let he;C&&(he=b=>{if(b.nativeEvent.shiftKey&&ce!==null){let X=h.filter(v>ce?(de,ue)=>ue>=ce&&ue<=v:(de,ue)=>ue>=v&&ue<=ce);C(fe?cr(x,X,de=>B(de,u)):Oe([...x,...X],de=>B(de,u)))}else C(fe?x.filter(X=>B(X,u)!==$):Oe([...x,s],X=>B(X,u)));fr(v)});let se;le?se=b=>{Z({top:b.clientY,left:b.clientX,record:s}),xe?.(s)}:xe&&(se=()=>{xe(s)});let dr;return ge&&(dr=b=>{b.preventDefault(),Z({top:b.clientY,left:b.clientX,record:s})}),(0,S.jsx)(Ze,{record:s,columns:i,withPointerCursor:!!xe||le,selectionVisible:!!x,selectionChecked:fe,onSelectionChange:he,onClick:se,onContextMenu:dr,contextMenuVisible:q?B(q.record,u)===$:!1,leftShadowVisible:lr},$)}):(0,S.jsx)(Ee,{})})]})}),P&&(0,S.jsx)(xr,{ref:Vr,className:Me?.pagination,style:He?.pagination,topBorderColor:o,horizontalSpacing:M,fetching:l,page:P,onPageChange:qr,totalRecords:Ae,recordsPerPage:wr,paginationSize:Tr,paginationText:kr,recordsLength:ie}),(0,S.jsx)(Ue,{pt:Re,pb:_e,fetching:l,loaderBackgroundBlur:Mr,loaderSize:Dr,loaderVariant:Ar}),(0,S.jsx)(Ve,{pt:Re,pb:_e,icon:Lr,text:Rr,active:!l&&!ie,children:Pr}),R&&q&&(0,S.jsx)($e,{zIndex:R.zIndex,borderRadius:R.borderRadius,shadow:R.shadow,top:q.top,left:q.left,onDestroy:()=>Z(null),children:R.items(q.record).map(({divider:s,key:v,title:$,icon:fe,color:le,hidden:ge,disabled:he,onClick:se})=>s?(0,S.jsx)(Xe,{},v):ge?null:(0,S.jsx)(Ke,{title:$??Be(v),icon:fe,color:le,disabled:he,onClick:()=>{Z(null),se()}},v))})]})}
|
|
1
|
+
"use strict";var uo=Object.create;var Se=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var xo=Object.getPrototypeOf,no=Object.prototype.hasOwnProperty;var io=(e,r)=>{for(var o in r)Se(e,o,{get:r[o],enumerable:!0})},ir=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of mo(r))!no.call(e,t)&&t!==o&&Se(e,t,{get:()=>r[t],enumerable:!(a=po(r,t))||a.enumerable});return e};var be=(e,r,o)=>(o=e!=null?uo(xo(e)):{},ir(r||!e||!e.__esModule?Se(o,"default",{value:e,enumerable:!0}):o,e)),co=e=>ir(Se({},"__esModule",{value:!0}),e);var Eo={};io(Eo,{DataTable:()=>rr});module.exports=co(Eo);var i=be(require("react"),1);var I=require("@mantine/core"),xe=require("@mantine/hooks"),Fr=require("react");var cr=require("@mantine/core"),We=require("react/jsx-runtime"),go=(0,cr.createStyles)({root:{"&&":{background:"transparent"}}});function ze(){let{classes:e}=go();return(0,We.jsx)("tr",{className:e.root,children:(0,We.jsx)("td",{})})}var j=require("@mantine/core");function E(){return E=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},E.apply(this,arguments)}function ho(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 Y(e,r){if(e==null)return{};var o=ho(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 Q=be(require("react")),Co=["size","color"];function Ie(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=Y(e,Co);return Q.default.createElement("svg",E({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),Q.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Q.default.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Q.default.createElement("line",{x1:"18",y1:"13",x2:"12",y2:"19"}),Q.default.createElement("line",{x1:"6",y1:"13",x2:"12",y2:"19"}))}var _=be(require("react")),So=["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=Y(e,So);return _.default.createElement("svg",E({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),_.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),_.default.createElement("polyline",{points:"8 7 12 3 16 7"}),_.default.createElement("polyline",{points:"8 17 12 21 16 17"}),_.default.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"21"}))}var G=be(require("react")),bo=["size","color"];function Ge(e){var r=e.size,o=r===void 0?24:r,a=e.color,t=a===void 0?"currentColor":a,f=Y(e,bo);return G.default.createElement("svg",E({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),G.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),G.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"}),G.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"}),G.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"}),G.default.createElement("line",{x1:"3",y1:"3",x2:"21",y2:"21"}))}var k=require("react/jsx-runtime"),Bo=(0,j.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 Ue({icon:e,text:r,pt:o,pb:a,active:t,children:f}){let{classes:d,cx:l}=Bo();return(0,k.jsx)(j.Center,{pt:o,pb:a,className:l(d.root,{[d.active]:t}),children:f||(0,k.jsxs)(k.Fragment,{children:[e||(0,k.jsx)("div",{className:d.standardIcon,children:(0,k.jsx)(Ge,{})}),(0,k.jsx)(j.Text,{size:"sm",color:"dimmed",children:r})]})})}var N=require("@mantine/core"),gr=require("react"),pe=require("react/jsx-runtime"),Oo=(0,N.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}})),hr=(0,gr.forwardRef)(function({className:r,style:o,topBorderColor:a,fetching:t,page:f,onPageChange:d,paginationSize:l,paginationText:x,totalRecords:u,recordsPerPage:s,recordsLength:S,horizontalSpacing:m},g){let n;if(t||!u)n="...";else{let w=(f-1)*s+1,L=w+S-1;n=x({from:w,to:L,totalRecords:u})}let{classes:h,cx:O}=Oo({topBorderColor:a});return(0,pe.jsxs)(N.Box,{ref:g,px:m??"xs",py:"xs",className:O(h.root,r),style:o,children:[(0,pe.jsx)(N.Text,{size:l,children:n}),(0,pe.jsx)(N.Pagination,{className:O(h.pagination,{[h.paginationFetching]:t||!S}),page:f,onChange:d,size:l,total:Math.ceil(u/s)})]})});var Te=require("@mantine/core"),Br=require("react");var T=require("@mantine/core");var Cr=require("@mantine/core"),Sr=require("@mantine/hooks");function Be(e){let r=(0,Cr.useMantineTheme)(),o=typeof e=="function"?e(r):e;return(0,Sr.useMediaQuery)(o||"",!0)}function Oe(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 br(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 we(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 c(e,r){return r?r.match(/([^[.\]])+/g).reduce((a,t)=>a&&a[t],e):void 0}var R=require("react/jsx-runtime"),wo=(0,T.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 qe({accessor:e,visibleMediaQuery:r,title:o,sortable:a,textAlignment:t,width:f,sortStatus:d,onSortStatusChange:l}){let{cx:x,classes:u}=wo();if(!Be(r))return null;let s=o??Oe(e);return(0,R.jsx)(T.Box,{component:"th",className:x({[u.sortableColumnHeader]:a}),sx:{"&&":{textAlign:t},width:f,minWidth:f,maxWidth:f},role:a?"button":void 0,onClick:a&&l?()=>{l({columnAccessor:e,direction:d?.direction==="asc"?"desc":"asc"})}:void 0,children:a||d?.columnAccessor===e?(0,R.jsxs)(T.Group,{position:"apart",noWrap:!0,spacing:"xs",children:[(0,R.jsx)(T.Box,{className:x(u.columnHeaderText,u.sortableColumnHeaderText),children:s}),(0,R.jsx)(T.Center,{children:d?.columnAccessor===e?(0,R.jsx)(Ie,{className:x(u.sortableColumnHeaderIcon,{[u.sortableColumnHeaderIconRotated]:d.direction==="desc"}),size:14}):(0,R.jsx)(Ve,{className:u.sortableColumnHeaderNeutralIcon,size:14})})]}):(0,R.jsx)(T.Box,{className:u.columnHeaderText,children:s})})}var U=require("react/jsx-runtime"),To=(0,Te.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},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"}}}),Or=(0,Br.forwardRef)(function({className:r,style:o,sortStatus:a,onSortStatusChange:t,columns:f,selectionVisible:d,selectionChecked:l,selectionIndeterminate:x,onSelectionChange:u,leftShadowVisible:s},S){let{classes:m,cx:g}=To();return(0,U.jsx)("thead",{className:g(m.root,r),style:o,ref:S,children:(0,U.jsxs)("tr",{children:[d&&(0,U.jsx)("th",{className:g(m.selectorColumnHeader,{[m.selectorColumnHeaderWithRightShadow]:s}),children:(0,U.jsx)(Te.Checkbox,{classNames:{input:m.selectionCheckboxInput},checked:l,indeterminate:x,disabled:!u,onChange:u})}),f.map(({accessor:n,hidden:h,visibleMediaQuery:O,textAlignment:w,width:L,title:v,sortable:V})=>h?null:(0,U.jsx)(qe,{accessor:n,visibleMediaQuery:O,textAlignment:w,width:L,title:v,sortable:V,sortStatus:a,onSortStatusChange:t},n))]})})});var J=require("@mantine/core"),Ze=require("react/jsx-runtime"),yo=(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 $e({pt:e,pb:r,fetching:o,loaderBackgroundBlur:a,loaderSize:t,loaderVariant:f}){let{classes:d,cx:l}=yo();return(0,Ze.jsx)(J.Center,{pt:e,pb:r,className:l(d.root,{[d.fetching]:o}),sx:a?{backdropFilter:`blur(${a}px)`}:void 0,children:o&&(0,Ze.jsx)(J.Loader,{size:t,variant:f})})}var Pr=require("@mantine/core");var ye=require("@mantine/core");var wr=require("react/jsx-runtime"),Do=(0,ye.createStyles)({ellipsis:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}});function Xe({className:e,sx:r,style:o,visibleMediaQuery:a,record:t,ellipsis:f,textAlignment:d,width:l,accessor:x,render:u}){let{cx:s,classes:S}=Do();return Be(a)?(0,wr.jsx)(ye.Box,{component:"td",className:s({[S.ellipsis]:f},e),sx:[{width:l,minWidth:l,maxWidth:l,textAlign:d},r],style:o,children:u?u(t):c(t,x)}):null}var Re=require("@mantine/core");var W=require("@mantine/hooks"),y=require("react");var De=200,ke={leading:!0};function Tr(){let[e,r]=(0,W.useDebouncedState)(!0,De,ke),[o,a]=(0,W.useDebouncedState)(!0,De,ke),[t,f]=(0,W.useDebouncedState)(!0,De,ke),[d,l]=(0,W.useDebouncedState)(!0,De,ke);return{scrolledToTop:e,setScrolledToTop:r,scrolledToBottom:o,setScrolledToBottom:a,scrolledToLeft:t,setScrolledToLeft:f,scrolledToRight:d,setScrolledToRight:l}}function yr(e){let[r,o]=(0,y.useState)(null),a=e?.join(":")||"";return(0,y.useEffect)(()=>{o(null)},[a]),{lastSelectionChangeIndex:r,setLastSelectionChangeIndex:o}}function Dr(e){let[r,o]=(0,y.useState)(null);return(0,y.useEffect)(()=>{e&&o(null)},[e]),{rowContextMenuInfo:r,setRowContextMenuInfo:o}}function kr({rowExpansion:e,records:r,idAccessor:o}){let a=[];if(e&&r){let{trigger:d,allowMultiple:l,initiallyExpanded:x}=e;r&&d==="always"?a=r.map(u=>c(u,o)):x&&(a=r.filter(x).map(u=>c(u,o)),l||(a=[a[0]]))}let[t,f]=(0,y.useState)(a);if(typeof e<"u"){let d=l=>f(t.filter(x=>x!==c(l,o)));return{expandOnClick:e.trigger!=="always",isRowExpanded:l=>e.trigger==="always"?!0:t.includes(c(l,o)),expandRow:l=>{let x=c(l,o);f(e.allowMultiple?[...t,x]:[x])},collapseRow:d,collapseProps:e.collapseProps,content:l=>()=>e.content({record:l,collapse:()=>d(l)})}}}function Rr(e,r){let[o,a]=(0,y.useState)(e),[t,f]=(0,y.useState)(e),d=(0,W.useTimeout)(()=>a(!0),0),l=(0,W.useTimeout)(()=>f(!1),r||200);return(0,y.useEffect)(()=>{e?(l.clear(),f(!0),d.start()):(d.clear(),a(!1),l.start())},[d,l,e]),{expanded:o,visible:t}}var P=require("react/jsx-runtime"),ko=(0,Re.createStyles)({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function Ke({open:e,colSpan:r,content:o,collapseProps:a}){let{expanded:t,visible:f}=Rr(e,a?.transitionDuration),{cx:d,classes:l}=ko();return f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("tr",{}),(0,P.jsx)("tr",{children:(0,P.jsx)("td",{className:d(l.cell,{[l.expandedCell]:t}),colSpan:r,children:(0,P.jsx)(Re.Collapse,{in:t,...a,children:o()})})})]}):null}var Pe=require("@mantine/core"),Ye=require("react/jsx-runtime"),Ro=(0,Pe.createStyles)(e=>{let r=e.colorScheme==="dark"?.5:.05;return{root:{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,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"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function Qe({withRightShadow:e,...r}){let{cx:o,classes:a}=Ro();return(0,Ye.jsx)("td",{className:o(a.root,{[a.withRightShadow]:e}),children:(0,Ye.jsx)(Pe.Checkbox,{classNames:{input:a.checkbox},...r,onClick:t=>t.stopPropagation()})})}var A=require("react/jsx-runtime"),Po=(0,Pr.createStyles)(e=>{let r=e.colors[e.primaryColor][6];return{withPointerCursor:{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 _e({record:e,columns:r,selectionVisible:o,selectionChecked:a,onSelectionChange:t,onClick:f,onContextMenu:d,expansion:l,contextMenuVisible:x,leftShadowVisible:u}){let{cx:s,classes:S}=Po();return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("tr",{className:s({[S.withPointerCursor]:f||l?.expandOnClick,[S.selected]:a,[S.contextMenuVisible]:x}),onClick:m=>{if(l){let{isRowExpanded:g,expandOnClick:n,expandRow:h,collapseRow:O}=l;n&&(g(e)?O(e):h(e))}f?.(m)},onContextMenu:d,children:[o&&(0,A.jsx)(Qe,{withRightShadow:u,checked:a,disabled:!t,onChange:t}),r.map(({accessor:m,hidden:g,visibleMediaQuery:n,textAlignment:h,ellipsis:O,width:w,render:L,cellsClassName:v,cellsStyle:V,cellsSx:Ae})=>g?null:(0,A.jsx)(Xe,{className:typeof v=="function"?v(e):v,style:typeof V=="function"?V(e):V,sx:Ae,visibleMediaQuery:n,record:e,accessor:m,textAlignment:h,ellipsis:O,width:w,render:L},m))]}),l&&(0,A.jsx)(Ke,{colSpan:r.filter(m=>!m.hidden).length+(o?1:0),open:l.isRowExpanded(e),content:l.content(e),collapseProps:l.collapseProps})]})}var ee=require("@mantine/core"),M=require("@mantine/hooks"),Ar=require("react/jsx-runtime"),Ao=(0,ee.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 je({borderRadius:e="xs",shadow:r="sm",zIndex:o=3,top:a,left:t,onDestroy:f,children:d}){(0,M.useWindowEvent)("resize",f),(0,M.useWindowEvent)("scroll",f);let l=(0,M.useClickOutside)(f),{ref:x,width:u,height:s}=(0,M.useElementSize)(),S=(0,M.useMergedRef)(l,x),{spacing:{xs:m}}=(0,ee.useMantineTheme)(),{innerWidth:g,innerHeight:n}=window,h=a+s+m>n?n-s-m:a,O=t+u+m>g?g-u-m:t,{classes:w}=Ao();return(0,Ar.jsx)(ee.Paper,{ref:S,shadow:r,radius:e,className:w.root,sx:{top:h,left:O,zIndex:o},children:d})}var Mr=require("@mantine/core"),Lr=require("react/jsx-runtime"),Mo=(0,Mr.createStyles)(e=>({root:{height:1,background:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}}));function Je(){let{classes:e}=Mo();return(0,Lr.jsx)("div",{className:e.root})}var z=require("@mantine/core"),me=require("react/jsx-runtime"),Lo=(0,z.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 er({icon:e,title:r,color:o,disabled:a,onClick:t}){let{classes:f}=Lo({color:o});return(0,me.jsxs)(z.UnstyledButton,{className:f.root,disabled:a,onClick:t,children:[e&&(0,me.jsx)(z.Box,{className:f.icon,children:e}),(0,me.jsx)(z.Text,{className:f.title,size:"sm",children:r})]})}var re=require("@mantine/core"),vr=require("react"),q=require("react/jsx-runtime"),vo=(0,re.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"},topShadow:{zIndex:2,top:0,left:0,right:0,height:e.spacing.sm,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%)`},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}}}),Hr=(0,vr.forwardRef)(function({topShadowVisible:r,leftShadowVisible:o,rightShadowVisible:a,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:d,children:l},x){let{cx:u,classes:s}=vo();return(0,q.jsxs)(re.ScrollArea,{viewportRef:x,classNames:{root:s.root,scrollbar:s.scrollbar,thumb:s.thumb,corner:s.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:d,children:[l,(0,q.jsx)(re.Box,{className:u(s.shadow,s.topShadow,{[s.shadowVisible]:r}),sx:{top:f}}),(0,q.jsx)("div",{className:u(s.shadow,s.leftShadow,{[s.shadowVisible]:o})}),(0,q.jsx)("div",{className:u(s.shadow,s.rightShadow,{[s.shadowVisible]:a})}),(0,q.jsx)("div",{className:u(s.shadow,s.bottomShadow,{[s.shadowVisible]:t})})]})});var b=require("react/jsx-runtime"),Ho={},Fo=(0,I.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"},table:{borderCollapse:"separate",borderSpacing:0},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 rr({withBorder:e,borderRadius:r,borderColor:o=C=>C.colorScheme==="dark"?C.colors.dark[4]:C.colors.gray[3],rowBorderColor:a=C=>C.fn.rgba(C.colorScheme==="dark"?C.colors.dark[4]:C.colors.gray[3],.65),withColumnBorders:t,textSelectionDisabled:f,height:d="100%",minHeight:l,shadow:x,verticalAlignment:u="center",fetching:s,columns:S,idAccessor:m="id",records:g,selectedRecords:n,onSelectedRecordsChange:h,sortStatus:O,onSortStatusChange:w,horizontalSpacing:L,page:v,onPageChange:V,totalRecords:Ae,recordsPerPage:Er,paginationSize:Nr="sm",paginationText:Wr=({from:C,to:oe,totalRecords:Z})=>`${C} - ${oe} / ${Z}`,loaderSize:zr,loaderVariant:Ir,loaderBackgroundBlur:Vr,emptyState:Gr,noRecordsText:Ur="No records",noRecordsIcon:qr,striped:Zr,onRowClick:Me,rowContextMenu:D,rowExpansion:$r,sx:Xr,className:Kr,classNames:Le,style:Yr,styles:ve,...Qr}){let{ref:C,width:oe,height:Z}=(0,xe.useElementSize)(),{ref:_r,height:He}=(0,xe.useElementSize)(),{ref:jr,width:Fe,height:ne}=(0,xe.useElementSize)(),{ref:Jr,height:or}=(0,xe.useElementSize)(),{scrolledToTop:eo,setScrolledToTop:ar,scrolledToBottom:ro,setScrolledToBottom:tr,scrolledToLeft:fr,setScrolledToLeft:lr,scrolledToRight:oo,setScrolledToRight:sr}=Tr(),{rowContextMenuInfo:$,setRowContextMenuInfo:ae}=Dr(s),ao=kr({rowExpansion:$r,records:g,idAccessor:m}),dr=()=>{if(!s&&D&&ae(null),s||ne<=Z)ar(!0),tr(!0);else{let p=C.current.scrollTop;ar(p===0),tr(Math.round(ne-p)===Math.round(Z))}if(s||Fe===oe)lr(!0),sr(!0);else{let p=C.current.scrollLeft;lr(p===0),sr(Math.round(Fe-p)===Math.round(oe))}};(0,Fr.useEffect)(dr,[s,Z,C,oe,ne,Fe]);let to=p=>{C.current.scrollTo({top:0,left:0}),V(p)},ie=g?.length,te=g?.map(p=>c(p,m)),fe=n?.map(p=>c(p,m)),ur=te!==void 0&&fe!==void 0&&fe.length>0,Ee=ur&&te.every(p=>fe.includes(p)),fo=ur&&te.some(p=>fe.includes(p)),pr;h&&(pr=()=>{h(Ee?n.filter(p=>!te.includes(c(p,m))):we([...n,...g],p=>c(p,m)))});let{lastSelectionChangeIndex:ce,setLastSelectionChangeIndex:lo}=yr(te),mr=!!n&&!fr,{cx:xr,classes:H,theme:so}=Fo({borderColor:o,rowBorderColor:a}),Ne=typeof ve=="function"?ve(so,Ho):ve;return(0,b.jsxs)(I.Box,{className:xr(H.root,{[H.tableWithBorder]:e},Kr,Le?.root),sx:[p=>({borderRadius:p.radius[r]||r,boxShadow:p.shadows[x]||x,height:d,minHeight:l}),...(0,I.packSx)(Xr)],style:{...Ne?.root,...Yr},children:[(0,b.jsx)(Hr,{ref:C,topShadowVisible:!eo,leftShadowVisible:!(n||fr),rightShadowVisible:!oo,bottomShadowVisible:!ro,headerHeight:He,onScrollPositionChange:dr,children:(0,b.jsxs)(I.Table,{ref:jr,horizontalSpacing:L,className:xr(H.table,{[H.tableWithColumnBorders]:t,[H.lastRowBorderBottomVisible]:ne<Z,[H.textSelectionDisabled]:f,[H.verticalAlignmentTop]:u==="top",[H.verticalAlignmentBottom]:u==="bottom"}),striped:ie?Zr:!1,...Qr,children:[(0,b.jsx)(Or,{ref:_r,className:Le?.header,style:Ne?.header,columns:S,sortStatus:O,onSortStatusChange:w,selectionVisible:!!n,selectionChecked:Ee,selectionIndeterminate:fo&&!Ee,onSelectionChange:pr,leftShadowVisible:mr}),(0,b.jsx)("tbody",{children:ie?g.map((p,F)=>{let X=c(p,m),le=fe?.includes(X)||!1,ge=!1,he=!1;if(D){let{hidden:B}=D;(!B||!(typeof B=="function"?B(p):B))&&(D.trigger==="click"?ge=!0:he=!0)}let Ce;h&&(Ce=B=>{if(B.nativeEvent.shiftKey&&ce!==null){let K=g.filter(F>ce?(de,ue)=>ue>=ce&&ue<=F:(de,ue)=>ue>=F&&ue<=ce);h(le?br(n,K,de=>c(de,m)):we([...n,...K],de=>c(de,m)))}else h(le?n.filter(K=>c(K,m)!==X):we([...n,p],K=>c(K,m)));lo(F)});let se;ge?se=B=>{ae({top:B.clientY,left:B.clientX,record:p}),Me?.(p)}:Me&&(se=()=>{Me(p)});let nr;return he&&(nr=B=>{B.preventDefault(),ae({top:B.clientY,left:B.clientX,record:p})}),(0,b.jsx)(_e,{record:p,columns:S,selectionVisible:!!n,selectionChecked:le,onSelectionChange:Ce,onClick:se,onContextMenu:nr,contextMenuVisible:$?c($.record,m)===X:!1,expansion:ao,leftShadowVisible:mr},X)}):(0,b.jsx)(ze,{})})]})}),v&&(0,b.jsx)(hr,{ref:Jr,className:Le?.pagination,style:Ne?.pagination,topBorderColor:o,horizontalSpacing:L,fetching:s,page:v,onPageChange:to,totalRecords:Ae,recordsPerPage:Er,paginationSize:Nr,paginationText:Wr,recordsLength:ie}),(0,b.jsx)($e,{pt:He,pb:or,fetching:s,loaderBackgroundBlur:Vr,loaderSize:zr,loaderVariant:Ir}),(0,b.jsx)(Ue,{pt:He,pb:or,icon:qr,text:Ur,active:!s&&!ie,children:Gr}),D&&$&&(0,b.jsx)(je,{zIndex:D.zIndex,borderRadius:D.borderRadius,shadow:D.shadow,top:$.top,left:$.left,onDestroy:()=>ae(null),children:D.items($.record).map(({divider:p,key:F,title:X,icon:le,color:ge,hidden:he,disabled:Ce,onClick:se})=>p?(0,b.jsx)(Je,{},F):he?null:(0,b.jsx)(er,{title:X??Oe(F),icon:le,color:ge,disabled:Ce,onClick:()=>{ae(null),se()}},F))})]})}
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|