mantine-datatable 7.1.0 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +794 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{css/styles.css → styles.css} +2 -0
- package/dist/styles.css.map +1 -0
- package/dist/{css/styles.layer.css → styles.layer.css} +2 -0
- package/dist/styles.layer.css.map +1 -0
- package/package.json +17 -17
- package/dist/cjs/DataTable.js +0 -222
- package/dist/cjs/DataTable.js.map +0 -1
- package/dist/cjs/DataTableColumnGroupHeaderCell.js +0 -34
- package/dist/cjs/DataTableColumnGroupHeaderCell.js.map +0 -1
- package/dist/cjs/DataTableEmptyRow.js +0 -9
- package/dist/cjs/DataTableEmptyRow.js.map +0 -1
- package/dist/cjs/DataTableEmptyState.js +0 -12
- package/dist/cjs/DataTableEmptyState.js.map +0 -1
- package/dist/cjs/DataTableFooter.js +0 -52
- package/dist/cjs/DataTableFooter.js.map +0 -1
- package/dist/cjs/DataTableFooterCell.js +0 -33
- package/dist/cjs/DataTableFooterCell.js.map +0 -1
- package/dist/cjs/DataTableFooterSelectorPlaceholderCell.js +0 -11
- package/dist/cjs/DataTableFooterSelectorPlaceholderCell.js.map +0 -1
- package/dist/cjs/DataTableHeader.js +0 -48
- package/dist/cjs/DataTableHeader.js.map +0 -1
- package/dist/cjs/DataTableHeaderCell.js +0 -50
- package/dist/cjs/DataTableHeaderCell.js.map +0 -1
- package/dist/cjs/DataTableHeaderCellFilter.js +0 -20
- package/dist/cjs/DataTableHeaderCellFilter.js.map +0 -1
- package/dist/cjs/DataTableHeaderSelectorCell.js +0 -24
- package/dist/cjs/DataTableHeaderSelectorCell.js.map +0 -1
- package/dist/cjs/DataTableLoader.js +0 -15
- package/dist/cjs/DataTableLoader.js.map +0 -1
- package/dist/cjs/DataTablePageSizeSelector.js +0 -40
- package/dist/cjs/DataTablePageSizeSelector.js.map +0 -1
- package/dist/cjs/DataTablePagination.js +0 -46
- package/dist/cjs/DataTablePagination.js.map +0 -1
- package/dist/cjs/DataTableRow.js +0 -79
- package/dist/cjs/DataTableRow.js.map +0 -1
- package/dist/cjs/DataTableRowCell.js +0 -51
- package/dist/cjs/DataTableRowCell.js.map +0 -1
- package/dist/cjs/DataTableRowExpansion.js +0 -25
- package/dist/cjs/DataTableRowExpansion.js.map +0 -1
- package/dist/cjs/DataTableRowSelectorCell.js +0 -35
- package/dist/cjs/DataTableRowSelectorCell.js.map +0 -1
- package/dist/cjs/DataTableScrollArea.js +0 -41
- package/dist/cjs/DataTableScrollArea.js.map +0 -1
- package/dist/cjs/cssVariables.js +0 -53
- package/dist/cjs/cssVariables.js.map +0 -1
- package/dist/cjs/hooks/index.js +0 -25
- package/dist/cjs/hooks/index.js.map +0 -1
- package/dist/cjs/hooks/useElementOuterSize.js +0 -13
- package/dist/cjs/hooks/useElementOuterSize.js.map +0 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +0 -7
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/dist/cjs/hooks/useLastSelectionChangeIndex.js +0 -15
- package/dist/cjs/hooks/useLastSelectionChangeIndex.js.map +0 -1
- package/dist/cjs/hooks/useMediaQueries.js +0 -57
- package/dist/cjs/hooks/useMediaQueries.js.map +0 -1
- package/dist/cjs/hooks/useMediaQueriesStringOrFunction.js +0 -15
- package/dist/cjs/hooks/useMediaQueriesStringOrFunction.js.map +0 -1
- package/dist/cjs/hooks/useMediaQueryStringOrFunction.js +0 -13
- package/dist/cjs/hooks/useMediaQueryStringOrFunction.js.map +0 -1
- package/dist/cjs/hooks/useRowExpansion.js +0 -69
- package/dist/cjs/hooks/useRowExpansion.js.map +0 -1
- package/dist/cjs/hooks/useRowExpansionStatus.js +0 -27
- package/dist/cjs/hooks/useRowExpansionStatus.js.map +0 -1
- package/dist/cjs/icons/IconArrowUp.js +0 -9
- package/dist/cjs/icons/IconArrowUp.js.map +0 -1
- package/dist/cjs/icons/IconArrowsVertical.js +0 -9
- package/dist/cjs/icons/IconArrowsVertical.js.map +0 -1
- package/dist/cjs/icons/IconDatabaseOff.js +0 -9
- package/dist/cjs/icons/IconDatabaseOff.js.map +0 -1
- package/dist/cjs/icons/IconFilter.js +0 -9
- package/dist/cjs/icons/IconFilter.js.map +0 -1
- package/dist/cjs/icons/IconFilterFilled.js +0 -9
- package/dist/cjs/icons/IconFilterFilled.js.map +0 -1
- package/dist/cjs/icons/IconSelector.js +0 -9
- package/dist/cjs/icons/IconSelector.js.map +0 -1
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/DataTableCellClickHandler.js +0 -3
- package/dist/cjs/types/DataTableCellClickHandler.js.map +0 -1
- package/dist/cjs/types/DataTableColorProps.js +0 -3
- package/dist/cjs/types/DataTableColorProps.js.map +0 -1
- package/dist/cjs/types/DataTableColumn.js +0 -3
- package/dist/cjs/types/DataTableColumn.js.map +0 -1
- package/dist/cjs/types/DataTableColumnGroup.js +0 -3
- package/dist/cjs/types/DataTableColumnGroup.js.map +0 -1
- package/dist/cjs/types/DataTableColumnProps.js +0 -3
- package/dist/cjs/types/DataTableColumnProps.js.map +0 -1
- package/dist/cjs/types/DataTableColumnTextAlign.js +0 -3
- package/dist/cjs/types/DataTableColumnTextAlign.js.map +0 -1
- package/dist/cjs/types/DataTableDefaultColumnProps.js +0 -3
- package/dist/cjs/types/DataTableDefaultColumnProps.js.map +0 -1
- package/dist/cjs/types/DataTableEmptyStateProps.js +0 -3
- package/dist/cjs/types/DataTableEmptyStateProps.js.map +0 -1
- package/dist/cjs/types/DataTableLoaderProps.js +0 -3
- package/dist/cjs/types/DataTableLoaderProps.js.map +0 -1
- package/dist/cjs/types/DataTableOuterBorderProps.js +0 -3
- package/dist/cjs/types/DataTableOuterBorderProps.js.map +0 -1
- package/dist/cjs/types/DataTablePageSizeSelectorProps.js +0 -3
- package/dist/cjs/types/DataTablePageSizeSelectorProps.js.map +0 -1
- package/dist/cjs/types/DataTablePaginationProps.js +0 -3
- package/dist/cjs/types/DataTablePaginationProps.js.map +0 -1
- package/dist/cjs/types/DataTableProps.js +0 -3
- package/dist/cjs/types/DataTableProps.js.map +0 -1
- package/dist/cjs/types/DataTableRowClickHandler.js +0 -3
- package/dist/cjs/types/DataTableRowClickHandler.js.map +0 -1
- package/dist/cjs/types/DataTableRowExpansionCollapseProps.js +0 -3
- package/dist/cjs/types/DataTableRowExpansionCollapseProps.js.map +0 -1
- package/dist/cjs/types/DataTableRowExpansionProps.js +0 -3
- package/dist/cjs/types/DataTableRowExpansionProps.js.map +0 -1
- package/dist/cjs/types/DataTableScrollProps.js +0 -3
- package/dist/cjs/types/DataTableScrollProps.js.map +0 -1
- package/dist/cjs/types/DataTableSelectionProps.js +0 -3
- package/dist/cjs/types/DataTableSelectionProps.js.map +0 -1
- package/dist/cjs/types/DataTableSortProps.js +0 -3
- package/dist/cjs/types/DataTableSortProps.js.map +0 -1
- package/dist/cjs/types/DataTableSortStatus.js +0 -3
- package/dist/cjs/types/DataTableSortStatus.js.map +0 -1
- package/dist/cjs/types/DataTableVerticalAlign.js +0 -3
- package/dist/cjs/types/DataTableVerticalAlign.js.map +0 -1
- package/dist/cjs/types/index.js +0 -34
- package/dist/cjs/types/index.js.map +0 -1
- package/dist/cjs/types/utils.js +0 -3
- package/dist/cjs/types/utils.js.map +0 -1
- package/dist/cjs/utilityClasses.js +0 -11
- package/dist/cjs/utilityClasses.js.map +0 -1
- package/dist/cjs/utils.js +0 -49
- package/dist/cjs/utils.js.map +0 -1
- package/dist/esm/DataTable.js +0 -175
- package/dist/esm/DataTable.js.map +0 -1
- package/dist/esm/DataTableColumnGroupHeaderCell.js +0 -19
- package/dist/esm/DataTableColumnGroupHeaderCell.js.map +0 -1
- package/dist/esm/DataTableEmptyRow.js +0 -5
- package/dist/esm/DataTableEmptyRow.js.map +0 -1
- package/dist/esm/DataTableEmptyState.js +0 -7
- package/dist/esm/DataTableEmptyState.js.map +0 -1
- package/dist/esm/DataTableFooter.js +0 -22
- package/dist/esm/DataTableFooter.js.map +0 -1
- package/dist/esm/DataTableFooterCell.js +0 -24
- package/dist/esm/DataTableFooterCell.js.map +0 -1
- package/dist/esm/DataTableFooterSelectorPlaceholderCell.js +0 -6
- package/dist/esm/DataTableFooterSelectorPlaceholderCell.js.map +0 -1
- package/dist/esm/DataTableHeader.js +0 -18
- package/dist/esm/DataTableHeader.js.map +0 -1
- package/dist/esm/DataTableHeaderCell.js +0 -40
- package/dist/esm/DataTableHeaderCell.js.map +0 -1
- package/dist/esm/DataTableHeaderCellFilter.js +0 -15
- package/dist/esm/DataTableHeaderCellFilter.js.map +0 -1
- package/dist/esm/DataTableHeaderSelectorCell.js +0 -8
- package/dist/esm/DataTableHeaderSelectorCell.js.map +0 -1
- package/dist/esm/DataTableLoader.js +0 -7
- package/dist/esm/DataTableLoader.js.map +0 -1
- package/dist/esm/DataTablePageSizeSelector.js +0 -30
- package/dist/esm/DataTablePageSizeSelector.js.map +0 -1
- package/dist/esm/DataTablePagination.js +0 -34
- package/dist/esm/DataTablePagination.js.map +0 -1
- package/dist/esm/DataTableRow.js +0 -44
- package/dist/esm/DataTableRow.js.map +0 -1
- package/dist/esm/DataTableRowCell.js +0 -31
- package/dist/esm/DataTableRowCell.js.map +0 -1
- package/dist/esm/DataTableRowExpansion.js +0 -9
- package/dist/esm/DataTableRowExpansion.js.map +0 -1
- package/dist/esm/DataTableRowSelectorCell.js +0 -8
- package/dist/esm/DataTableRowSelectorCell.js.map +0 -1
- package/dist/esm/DataTableScrollArea.js +0 -22
- package/dist/esm/DataTableScrollArea.js.map +0 -1
- package/dist/esm/cssVariables.js +0 -43
- package/dist/esm/cssVariables.js.map +0 -1
- package/dist/esm/hooks/index.js +0 -9
- package/dist/esm/hooks/index.js.map +0 -1
- package/dist/esm/hooks/useElementOuterSize.js +0 -8
- package/dist/esm/hooks/useElementOuterSize.js.map +0 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +0 -4
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/dist/esm/hooks/useLastSelectionChangeIndex.js +0 -11
- package/dist/esm/hooks/useLastSelectionChangeIndex.js.map +0 -1
- package/dist/esm/hooks/useMediaQueries.js +0 -52
- package/dist/esm/hooks/useMediaQueries.js.map +0 -1
- package/dist/esm/hooks/useMediaQueriesStringOrFunction.js +0 -11
- package/dist/esm/hooks/useMediaQueriesStringOrFunction.js.map +0 -1
- package/dist/esm/hooks/useMediaQueryStringOrFunction.js +0 -9
- package/dist/esm/hooks/useMediaQueryStringOrFunction.js.map +0 -1
- package/dist/esm/hooks/useRowExpansion.js +0 -45
- package/dist/esm/hooks/useRowExpansion.js.map +0 -1
- package/dist/esm/hooks/useRowExpansionStatus.js +0 -23
- package/dist/esm/hooks/useRowExpansionStatus.js.map +0 -1
- package/dist/esm/icons/IconArrowUp.js +0 -5
- package/dist/esm/icons/IconArrowUp.js.map +0 -1
- package/dist/esm/icons/IconArrowsVertical.js +0 -5
- package/dist/esm/icons/IconArrowsVertical.js.map +0 -1
- package/dist/esm/icons/IconDatabaseOff.js +0 -5
- package/dist/esm/icons/IconDatabaseOff.js.map +0 -1
- package/dist/esm/icons/IconFilter.js +0 -5
- package/dist/esm/icons/IconFilter.js.map +0 -1
- package/dist/esm/icons/IconFilterFilled.js +0 -5
- package/dist/esm/icons/IconFilterFilled.js.map +0 -1
- package/dist/esm/icons/IconSelector.js +0 -5
- package/dist/esm/icons/IconSelector.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/DataTableCellClickHandler.js +0 -2
- package/dist/esm/types/DataTableCellClickHandler.js.map +0 -1
- package/dist/esm/types/DataTableColorProps.js +0 -2
- package/dist/esm/types/DataTableColorProps.js.map +0 -1
- package/dist/esm/types/DataTableColumn.js +0 -2
- package/dist/esm/types/DataTableColumn.js.map +0 -1
- package/dist/esm/types/DataTableColumnGroup.js +0 -2
- package/dist/esm/types/DataTableColumnGroup.js.map +0 -1
- package/dist/esm/types/DataTableColumnProps.js +0 -2
- package/dist/esm/types/DataTableColumnProps.js.map +0 -1
- package/dist/esm/types/DataTableColumnTextAlign.js +0 -2
- package/dist/esm/types/DataTableColumnTextAlign.js.map +0 -1
- package/dist/esm/types/DataTableDefaultColumnProps.js +0 -2
- package/dist/esm/types/DataTableDefaultColumnProps.js.map +0 -1
- package/dist/esm/types/DataTableEmptyStateProps.js +0 -2
- package/dist/esm/types/DataTableEmptyStateProps.js.map +0 -1
- package/dist/esm/types/DataTableLoaderProps.js +0 -2
- package/dist/esm/types/DataTableLoaderProps.js.map +0 -1
- package/dist/esm/types/DataTableOuterBorderProps.js +0 -2
- package/dist/esm/types/DataTableOuterBorderProps.js.map +0 -1
- package/dist/esm/types/DataTablePageSizeSelectorProps.js +0 -2
- package/dist/esm/types/DataTablePageSizeSelectorProps.js.map +0 -1
- package/dist/esm/types/DataTablePaginationProps.js +0 -2
- package/dist/esm/types/DataTablePaginationProps.js.map +0 -1
- package/dist/esm/types/DataTableProps.js +0 -2
- package/dist/esm/types/DataTableProps.js.map +0 -1
- package/dist/esm/types/DataTableRowClickHandler.js +0 -2
- package/dist/esm/types/DataTableRowClickHandler.js.map +0 -1
- package/dist/esm/types/DataTableRowExpansionCollapseProps.js +0 -2
- package/dist/esm/types/DataTableRowExpansionCollapseProps.js.map +0 -1
- package/dist/esm/types/DataTableRowExpansionProps.js +0 -2
- package/dist/esm/types/DataTableRowExpansionProps.js.map +0 -1
- package/dist/esm/types/DataTableScrollProps.js +0 -2
- package/dist/esm/types/DataTableScrollProps.js.map +0 -1
- package/dist/esm/types/DataTableSelectionProps.js +0 -2
- package/dist/esm/types/DataTableSelectionProps.js.map +0 -1
- package/dist/esm/types/DataTableSortProps.js +0 -2
- package/dist/esm/types/DataTableSortProps.js.map +0 -1
- package/dist/esm/types/DataTableSortStatus.js +0 -2
- package/dist/esm/types/DataTableSortStatus.js.map +0 -1
- package/dist/esm/types/DataTableVerticalAlign.js +0 -2
- package/dist/esm/types/DataTableVerticalAlign.js.map +0 -1
- package/dist/esm/types/index.js +0 -18
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/utils.js +0 -2
- package/dist/esm/types/utils.js.map +0 -1
- package/dist/esm/utilityClasses.js +0 -8
- package/dist/esm/utilityClasses.js.map +0 -1
- package/dist/esm/utils.js +0 -41
- package/dist/esm/utils.js.map +0 -1
- package/dist/types/DataTable.d.ts +0 -2
- package/dist/types/DataTableColumnGroupHeaderCell.d.ts +0 -6
- package/dist/types/DataTableEmptyRow.d.ts +0 -1
- package/dist/types/DataTableEmptyState.d.ts +0 -11
- package/dist/types/DataTableFooter.d.ts +0 -15
- package/dist/types/DataTableFooterCell.d.ts +0 -11
- package/dist/types/DataTableFooterSelectorPlaceholderCell.d.ts +0 -5
- package/dist/types/DataTableHeader.d.ts +0 -22
- package/dist/types/DataTableHeaderCell.d.ts +0 -14
- package/dist/types/DataTableHeaderCellFilter.d.ts +0 -7
- package/dist/types/DataTableHeaderSelectorCell.d.ts +0 -11
- package/dist/types/DataTableLoader.d.ts +0 -14
- package/dist/types/DataTablePageSizeSelector.d.ts +0 -18
- package/dist/types/DataTablePagination.d.ts +0 -16
- package/dist/types/DataTableRow.d.ts +0 -35
- package/dist/types/DataTableRowCell.d.ts +0 -14
- package/dist/types/DataTableRowExpansion.d.ts +0 -10
- package/dist/types/DataTableRowSelectorCell.d.ts +0 -13
- package/dist/types/DataTableScrollArea.d.ts +0 -16
- package/dist/types/cssVariables.d.ts +0 -46
- package/dist/types/hooks/index.d.ts +0 -8
- package/dist/types/hooks/useElementOuterSize.d.ts +0 -6
- package/dist/types/hooks/useIsomorphicLayoutEffect.d.ts +0 -2
- package/dist/types/hooks/useLastSelectionChangeIndex.d.ts +0 -5
- package/dist/types/hooks/useMediaQueries.d.ts +0 -4
- package/dist/types/hooks/useMediaQueriesStringOrFunction.d.ts +0 -2
- package/dist/types/hooks/useMediaQueryStringOrFunction.d.ts +0 -2
- package/dist/types/hooks/useRowExpansion.d.ts +0 -17
- package/dist/types/hooks/useRowExpansionStatus.d.ts +0 -4
- package/dist/types/icons/IconArrowUp.d.ts +0 -1
- package/dist/types/icons/IconArrowsVertical.d.ts +0 -1
- package/dist/types/icons/IconDatabaseOff.d.ts +0 -1
- package/dist/types/icons/IconFilter.d.ts +0 -1
- package/dist/types/icons/IconFilterFilled.d.ts +0 -1
- package/dist/types/icons/IconSelector.d.ts +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/types/DataTableCellClickHandler.d.ts +0 -24
- package/dist/types/types/DataTableColorProps.d.ts +0 -77
- package/dist/types/types/DataTableColumn.d.ts +0 -134
- package/dist/types/types/DataTableColumnGroup.d.ts +0 -33
- package/dist/types/types/DataTableColumnProps.d.ts +0 -15
- package/dist/types/types/DataTableColumnTextAlign.d.ts +0 -1
- package/dist/types/types/DataTableDefaultColumnProps.d.ts +0 -2
- package/dist/types/types/DataTableEmptyStateProps.d.ts +0 -18
- package/dist/types/types/DataTableLoaderProps.d.ts +0 -31
- package/dist/types/types/DataTableOuterBorderProps.d.ts +0 -14
- package/dist/types/types/DataTablePageSizeSelectorProps.d.ts +0 -19
- package/dist/types/types/DataTablePaginationProps.d.ts +0 -90
- package/dist/types/types/DataTableProps.d.ts +0 -155
- package/dist/types/types/DataTableRowClickHandler.d.ts +0 -15
- package/dist/types/types/DataTableRowExpansionCollapseProps.d.ts +0 -2
- package/dist/types/types/DataTableRowExpansionProps.d.ts +0 -52
- package/dist/types/types/DataTableScrollProps.d.ts +0 -25
- package/dist/types/types/DataTableSelectionProps.d.ts +0 -33
- package/dist/types/types/DataTableSortProps.d.ts +0 -31
- package/dist/types/types/DataTableSortStatus.d.ts +0 -12
- package/dist/types/types/DataTableVerticalAlign.d.ts +0 -1
- package/dist/types/types/index.d.ts +0 -17
- package/dist/types/types/utils.d.ts +0 -4
- package/dist/types/utilityClasses.d.ts +0 -7
- package/dist/types/utils.d.ts +0 -21
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { MantineColor } from '@mantine/core';
|
|
2
|
-
export type DataTableColorProps<T> = {
|
|
3
|
-
/**
|
|
4
|
-
* Data table text color.
|
|
5
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
6
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
7
|
-
*/
|
|
8
|
-
c?: MantineColor | {
|
|
9
|
-
light: MantineColor;
|
|
10
|
-
dark: MantineColor;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Data table background color.
|
|
14
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
15
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
16
|
-
*/
|
|
17
|
-
backgroundColor?: MantineColor | {
|
|
18
|
-
light: MantineColor;
|
|
19
|
-
dark: MantineColor;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Color of table borders, applied to all borders except row borders.
|
|
23
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
24
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
25
|
-
*/
|
|
26
|
-
borderColor?: MantineColor | {
|
|
27
|
-
light: MantineColor;
|
|
28
|
-
dark: MantineColor;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Color of row borders.
|
|
32
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
33
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
34
|
-
*/
|
|
35
|
-
rowBorderColor?: MantineColor | {
|
|
36
|
-
light: MantineColor;
|
|
37
|
-
dark: MantineColor;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Background color of striped rows.
|
|
41
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
42
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
43
|
-
*/
|
|
44
|
-
stripedColor?: MantineColor | {
|
|
45
|
-
light: MantineColor;
|
|
46
|
-
dark: MantineColor;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Background color of hover-highlighted row.
|
|
50
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
51
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
52
|
-
*/
|
|
53
|
-
highlightOnHoverColor?: MantineColor | {
|
|
54
|
-
light: MantineColor;
|
|
55
|
-
dark: MantineColor;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Data table row text color.
|
|
59
|
-
* A function that accepts row data and returns color.
|
|
60
|
-
* The returned color can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
61
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
62
|
-
*/
|
|
63
|
-
rowColor?: (record: T, index: number) => MantineColor | undefined | {
|
|
64
|
-
light: MantineColor;
|
|
65
|
-
dark: MantineColor;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Data table row background color.
|
|
69
|
-
* A function that accepts row data and returns background color color.
|
|
70
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
71
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
72
|
-
*/
|
|
73
|
-
rowBackgroundColor?: (record: T, index: number) => MantineColor | undefined | {
|
|
74
|
-
light: MantineColor;
|
|
75
|
-
dark: MantineColor;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MantineStyleProp, MantineTheme } from '@mantine/core';
|
|
3
|
-
import type { DataTableColumnTextAlign } from './DataTableColumnTextAlign';
|
|
4
|
-
export type DataTableColumn<T = Record<string, unknown>> = {
|
|
5
|
-
/**
|
|
6
|
-
* Column accessor.
|
|
7
|
-
* You can use dot-notation for nested objects property drilling.
|
|
8
|
-
* (i.e. `department.name` or `department.company.name`)
|
|
9
|
-
*/
|
|
10
|
-
accessor: keyof T | (string & NonNullable<unknown>);
|
|
11
|
-
/**
|
|
12
|
-
* Optional column header title.
|
|
13
|
-
* If not present, one will be generated by "humanizing" the provided column accessor.
|
|
14
|
-
* (i.e. `firstName` -> `First name`; `user.firstName` -> `User first name`)
|
|
15
|
-
*/
|
|
16
|
-
title?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Custom cell data render function.
|
|
19
|
-
* Accepts the current record and its index in `records` as arguments and returns a React node
|
|
20
|
-
* (remember that a string is a valid React node too).
|
|
21
|
-
*/
|
|
22
|
-
render?: (record: T, index: number) => React.ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Column text alignment.
|
|
25
|
-
* @default `left`
|
|
26
|
-
*/
|
|
27
|
-
textAlign?: DataTableColumnTextAlign;
|
|
28
|
-
/**
|
|
29
|
-
* If true, column will be sortable.
|
|
30
|
-
*/
|
|
31
|
-
sortable?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Optional node providing the user with filtering options.
|
|
34
|
-
* If present, a filter button will be added to the column's header. Upon clicking that button,
|
|
35
|
-
* a pop-over showing the provided node will be opened.
|
|
36
|
-
*
|
|
37
|
-
* Alternatively, a function returning a node can be provided. The function receives props with a `close`
|
|
38
|
-
* method which allows programatically closing the pop-over.
|
|
39
|
-
*
|
|
40
|
-
* ```tsx
|
|
41
|
-
* // …
|
|
42
|
-
* columns={[
|
|
43
|
-
* {
|
|
44
|
-
* accessor: 'name',
|
|
45
|
-
* filter: ({ close }) => {
|
|
46
|
-
* return <Stack>
|
|
47
|
-
* <Button onClick={() => { setFilter(undefined); close(); }}>Reset</Button>
|
|
48
|
-
* </Stack>
|
|
49
|
-
* },
|
|
50
|
-
* }
|
|
51
|
-
* ]}
|
|
52
|
-
* // …
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* Note: this property only takes care of rendering the node which provides the filtering options.
|
|
56
|
-
* It is assumed that the actual filtering is performed somewhere in user code.
|
|
57
|
-
*/
|
|
58
|
-
filter?: React.ReactNode | ((params: {
|
|
59
|
-
close: () => void;
|
|
60
|
-
}) => React.ReactNode);
|
|
61
|
-
/**
|
|
62
|
-
* If true, filter icon will be styled differently to indicate the filter is in effect.
|
|
63
|
-
*/
|
|
64
|
-
filtering?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Desired column width.
|
|
67
|
-
*/
|
|
68
|
-
width?: string | number;
|
|
69
|
-
/**
|
|
70
|
-
* If true, column will not be visible.
|
|
71
|
-
*/
|
|
72
|
-
hidden?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* If set, the column will only be visible according to the specified media query.
|
|
75
|
-
* Can be a string, or a function receiving the current theme and returning a string.
|
|
76
|
-
*/
|
|
77
|
-
visibleMediaQuery?: string | ((theme: MantineTheme) => string);
|
|
78
|
-
/**
|
|
79
|
-
* Optional class name passed to the column title
|
|
80
|
-
*/
|
|
81
|
-
titleClassName?: string;
|
|
82
|
-
/**
|
|
83
|
-
* Optional style passed to the column title.
|
|
84
|
-
* Either a style object, or a function receiving the current theme and returning a style object.
|
|
85
|
-
*/
|
|
86
|
-
titleStyle?: MantineStyleProp;
|
|
87
|
-
/**
|
|
88
|
-
* Optional class name passed to each data cell in the column.
|
|
89
|
-
* Can be a string, or a function receiving the current record and its index
|
|
90
|
-
* as arguments and returning a string.
|
|
91
|
-
*/
|
|
92
|
-
cellsClassName?: string | ((record: T, index: number) => string | undefined);
|
|
93
|
-
/**
|
|
94
|
-
* Optional style passed to each data cell in the column.
|
|
95
|
-
* A function that receives the current record and its index as arguments and returns either
|
|
96
|
-
* a style object, or a function that accepts theme and returns a style object.
|
|
97
|
-
*/
|
|
98
|
-
cellsStyle?: (record: T, index: number) => MantineStyleProp | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Optional function returning an object of custom attributes to be applied to each cell in the column.
|
|
101
|
-
* Receives the current record and its index as arguments.
|
|
102
|
-
* Useful for adding data attributes, handling middle-clicks, etc.
|
|
103
|
-
*/
|
|
104
|
-
customCellAttributes?: (record: T, index: number) => Record<string, unknown>;
|
|
105
|
-
/**
|
|
106
|
-
* Optional column footer content.
|
|
107
|
-
* If at least one column has a footer, the table will display a footer row.
|
|
108
|
-
*/
|
|
109
|
-
footer?: React.ReactNode;
|
|
110
|
-
/**
|
|
111
|
-
* Optional class name passed to the column footer.
|
|
112
|
-
*/
|
|
113
|
-
footerClassName?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Optional style passed to the column footer.
|
|
116
|
-
*/
|
|
117
|
-
footerStyle?: MantineStyleProp;
|
|
118
|
-
} & ({
|
|
119
|
-
/**
|
|
120
|
-
* If true, cell content in this column will be truncated with ellipsis as needed and will not wrap
|
|
121
|
-
* to multiple lines (i.e. `overflow: hidden; text-overflow: ellipsis`; `white-space: nowrap`).
|
|
122
|
-
* On a column, you can either set this property or `noWrap`, but not both.
|
|
123
|
-
*/
|
|
124
|
-
ellipsis?: boolean;
|
|
125
|
-
noWrap?: never;
|
|
126
|
-
} | {
|
|
127
|
-
ellipsis?: never;
|
|
128
|
-
/**
|
|
129
|
-
* If true, cell content in this column will not wrap to multiple lines (i.e. `white-space: nowrap`).
|
|
130
|
-
* This is useful for columns containing long strings.
|
|
131
|
-
* On a column, you can either set this property or `ellipsis`, but not both.
|
|
132
|
-
*/
|
|
133
|
-
noWrap?: boolean;
|
|
134
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MantineStyleProp } from '@mantine/core';
|
|
3
|
-
import type { DataTableColumn } from './DataTableColumn';
|
|
4
|
-
import type { DataTableColumnTextAlign } from './DataTableColumnTextAlign';
|
|
5
|
-
export type DataTableColumnGroup<T = Record<string, unknown>> = {
|
|
6
|
-
/**
|
|
7
|
-
* Used as the `key` prop for the created `<th />`.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Component to render inside the column group header.
|
|
12
|
-
*/
|
|
13
|
-
title?: React.ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* Text alignment of the column group header.
|
|
16
|
-
* @default `left`
|
|
17
|
-
*/
|
|
18
|
-
textAlign?: DataTableColumnTextAlign;
|
|
19
|
-
/**
|
|
20
|
-
* Columns which are part of the group.
|
|
21
|
-
*/
|
|
22
|
-
columns: DataTableColumn<T>[];
|
|
23
|
-
/**
|
|
24
|
-
* Optional className to apply to the column group header.
|
|
25
|
-
*/
|
|
26
|
-
className?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Optional style to apply to the column group header.
|
|
29
|
-
* Can be a style object or a function which receives the current theme and
|
|
30
|
-
* returns a style object.
|
|
31
|
-
*/
|
|
32
|
-
style?: MantineStyleProp;
|
|
33
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { DataTableColumn } from './DataTableColumn';
|
|
2
|
-
import type { DataTableColumnGroup } from './DataTableColumnGroup';
|
|
3
|
-
export type DataTableColumnProps<T = Record<string, unknown>> = {
|
|
4
|
-
/**
|
|
5
|
-
* Grouped columns.
|
|
6
|
-
*/
|
|
7
|
-
groups: DataTableColumnGroup<T>[];
|
|
8
|
-
columns?: never;
|
|
9
|
-
} | {
|
|
10
|
-
groups?: never;
|
|
11
|
-
/**
|
|
12
|
-
* Visible columns.
|
|
13
|
-
*/
|
|
14
|
-
columns: DataTableColumn<T>[];
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type DataTableColumnTextAlign = 'left' | 'center' | 'right';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type DataTableEmptyStateProps = {
|
|
3
|
-
/**
|
|
4
|
-
* Content to show when no records are available.
|
|
5
|
-
* The provided content will be overlaid and centered automatically.
|
|
6
|
-
* You can either provide this property or `noRecordsIcon`, but not both.
|
|
7
|
-
*/
|
|
8
|
-
emptyState?: React.ReactNode;
|
|
9
|
-
noRecordsIcon?: never;
|
|
10
|
-
} | {
|
|
11
|
-
emptyState?: never;
|
|
12
|
-
/**
|
|
13
|
-
* Icon to show when no records are available.
|
|
14
|
-
* The provided icon will be overlaid and centered automatically.
|
|
15
|
-
* You can either provide this property or `emptyState`, but not both.
|
|
16
|
-
*/
|
|
17
|
-
noRecordsIcon?: React.ReactNode;
|
|
18
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MantineColor, MantineLoader, MantineSize } from '@mantine/core';
|
|
3
|
-
export type DataTableLoaderProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Loader background blur (in pixels).
|
|
6
|
-
*/
|
|
7
|
-
loaderBackgroundBlur?: number;
|
|
8
|
-
} & ({
|
|
9
|
-
loaderSize?: never;
|
|
10
|
-
loaderType?: never;
|
|
11
|
-
loaderColor?: never;
|
|
12
|
-
/**
|
|
13
|
-
* Custom loader component to use instead of default one.
|
|
14
|
-
*/
|
|
15
|
-
customLoader?: React.ReactNode;
|
|
16
|
-
} | {
|
|
17
|
-
/**
|
|
18
|
-
* Loader size.
|
|
19
|
-
* @default `lg`.
|
|
20
|
-
*/
|
|
21
|
-
loaderSize?: MantineSize | (string & NonNullable<unknown>) | number;
|
|
22
|
-
/**
|
|
23
|
-
* Loader type.
|
|
24
|
-
*/
|
|
25
|
-
loaderType?: MantineLoader;
|
|
26
|
-
/**
|
|
27
|
-
* Loader color.
|
|
28
|
-
*/
|
|
29
|
-
loaderColor?: MantineColor;
|
|
30
|
-
customLoader?: never;
|
|
31
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { MantineSize } from '@mantine/core';
|
|
2
|
-
export type DataTableOuterBorderProps = {
|
|
3
|
-
withTableBorder?: never;
|
|
4
|
-
borderRadius?: never;
|
|
5
|
-
} | {
|
|
6
|
-
/**
|
|
7
|
-
* If true, table will have border.
|
|
8
|
-
*/
|
|
9
|
-
withTableBorder: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Table border radius.
|
|
12
|
-
*/
|
|
13
|
-
borderRadius?: MantineSize | (string & NonNullable<unknown>) | number;
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type DataTablePageSizeSelectorProps = {
|
|
2
|
-
onRecordsPerPageChange?: never;
|
|
3
|
-
recordsPerPageOptions?: never;
|
|
4
|
-
recordsPerPageLabel?: never;
|
|
5
|
-
} | {
|
|
6
|
-
/**
|
|
7
|
-
* Callback fired a new page size is selected.
|
|
8
|
-
* Receives new page size as argument.
|
|
9
|
-
*/
|
|
10
|
-
onRecordsPerPageChange: (recordsPerPage: number) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Array of page sizes (numbers) to show in records per page selector.
|
|
13
|
-
*/
|
|
14
|
-
recordsPerPageOptions: number[];
|
|
15
|
-
/**
|
|
16
|
-
* Label for records per page selector.
|
|
17
|
-
*/
|
|
18
|
-
recordsPerPageLabel?: string;
|
|
19
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MantineColor, MantineSize } from '@mantine/core';
|
|
3
|
-
import type { DataTablePageSizeSelectorProps } from './DataTablePageSizeSelectorProps';
|
|
4
|
-
export type DataTablePaginationProps = ({
|
|
5
|
-
paginationWithEdges?: never;
|
|
6
|
-
page?: never;
|
|
7
|
-
onPageChange?: never;
|
|
8
|
-
totalRecords?: never;
|
|
9
|
-
recordsPerPage?: never;
|
|
10
|
-
paginationActiveTextColor?: never;
|
|
11
|
-
paginationActiveBackgroundColor?: never;
|
|
12
|
-
paginationSize?: never;
|
|
13
|
-
loadingText?: never;
|
|
14
|
-
paginationText?: never;
|
|
15
|
-
paginationWrapBreakpoint?: never;
|
|
16
|
-
getPaginationControlProps?: never;
|
|
17
|
-
} | {
|
|
18
|
-
/**
|
|
19
|
-
* Whenther to show first and last page navigation buttons.
|
|
20
|
-
*/
|
|
21
|
-
paginationWithEdges?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Current page number (1-based).
|
|
24
|
-
* If provided, a pagination component is shown.
|
|
25
|
-
*/
|
|
26
|
-
page: number;
|
|
27
|
-
/**
|
|
28
|
-
* Callback fired after page change.
|
|
29
|
-
* Receives the new page number as argument.
|
|
30
|
-
*/
|
|
31
|
-
onPageChange: (page: number) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Total number of records in the dataset.
|
|
34
|
-
*/
|
|
35
|
-
totalRecords: number | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Number of records per page.
|
|
38
|
-
*/
|
|
39
|
-
recordsPerPage: number;
|
|
40
|
-
/**
|
|
41
|
-
* Pagination component size.
|
|
42
|
-
* @default `sm`
|
|
43
|
-
*/
|
|
44
|
-
paginationSize?: MantineSize;
|
|
45
|
-
/**
|
|
46
|
-
* Color applied to active page button text.
|
|
47
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
48
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
49
|
-
* Defaults to white.
|
|
50
|
-
*/
|
|
51
|
-
paginationActiveTextColor?: MantineColor | {
|
|
52
|
-
light: MantineColor;
|
|
53
|
-
dark: MantineColor;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Color applied to active page button background.
|
|
57
|
-
* Can be a `MantineColor` (key of `theme.colors` or any valid CSS color string),
|
|
58
|
-
* or an object with `light` and `dark` keys and `MantineColor` values.
|
|
59
|
-
* Defaults to primary theme color.
|
|
60
|
-
*/
|
|
61
|
-
paginationActiveBackgroundColor?: MantineColor | {
|
|
62
|
-
light: MantineColor;
|
|
63
|
-
dark: MantineColor;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Text to show while records are loading.
|
|
67
|
-
*/
|
|
68
|
-
loadingText?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Pagination text. Defaults to ```({ from, to, totalRecords }) => `${from}-${to}/${totalRecords}`
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
paginationText?: (params: {
|
|
74
|
-
from: number;
|
|
75
|
-
to: number;
|
|
76
|
-
totalRecords: number;
|
|
77
|
-
}) => React.ReactNode;
|
|
78
|
-
/**
|
|
79
|
-
* Pagination wrap breakpoints.
|
|
80
|
-
* Below this breakpoint the content will be displayed on multiple lines,
|
|
81
|
-
* above it the content will be displayed on a single line.
|
|
82
|
-
* @default `sm`
|
|
83
|
-
*/
|
|
84
|
-
paginationWrapBreakpoint?: MantineSize | (string & NonNullable<unknown>) | number;
|
|
85
|
-
/**
|
|
86
|
-
* Function that returns props object for pagination control.
|
|
87
|
-
* Useful for improving accessibility.
|
|
88
|
-
*/
|
|
89
|
-
getPaginationControlProps?: (control: 'first' | 'last' | 'previous' | 'next') => Record<string, unknown>;
|
|
90
|
-
}) & DataTablePageSizeSelectorProps;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MantineShadow, MantineStyleProp, ScrollAreaProps, StylesRecord, TableProps } from '@mantine/core';
|
|
3
|
-
import type { DataTableCellClickHandler } from './DataTableCellClickHandler';
|
|
4
|
-
import { DataTableColorProps } from './DataTableColorProps';
|
|
5
|
-
import type { DataTableColumnProps } from './DataTableColumnProps';
|
|
6
|
-
import type { DataTableDefaultColumnProps } from './DataTableDefaultColumnProps';
|
|
7
|
-
import type { DataTableEmptyStateProps } from './DataTableEmptyStateProps';
|
|
8
|
-
import type { DataTableLoaderProps } from './DataTableLoaderProps';
|
|
9
|
-
import type { DataTableOuterBorderProps } from './DataTableOuterBorderProps';
|
|
10
|
-
import type { DataTablePaginationProps } from './DataTablePaginationProps';
|
|
11
|
-
import type { DataTableRowClickHandler } from './DataTableRowClickHandler';
|
|
12
|
-
import type { DataTableRowExpansionProps } from './DataTableRowExpansionProps';
|
|
13
|
-
import type { DataTableScrollProps } from './DataTableScrollProps';
|
|
14
|
-
import type { DataTableSelectionProps } from './DataTableSelectionProps';
|
|
15
|
-
import type { DataTableSortProps } from './DataTableSortProps';
|
|
16
|
-
import type { DataTableVerticalAlign } from './DataTableVerticalAlign';
|
|
17
|
-
export type DataTableProps<T = Record<string, unknown>> = {
|
|
18
|
-
/**
|
|
19
|
-
* Data table container class name.
|
|
20
|
-
*/
|
|
21
|
-
className?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Data table container style.
|
|
24
|
-
* Either a style object or a function that accepts current theme and returns a style object.
|
|
25
|
-
*/
|
|
26
|
-
style?: MantineStyleProp;
|
|
27
|
-
/**
|
|
28
|
-
* Data table elements class names.
|
|
29
|
-
* An object with `root`, `table`, `header`, `footer` and `pagination` keys and class names
|
|
30
|
-
* as values.
|
|
31
|
-
*/
|
|
32
|
-
classNames?: Partial<Record<'root' | 'table' | 'header' | 'footer' | 'pagination', string>>;
|
|
33
|
-
/**
|
|
34
|
-
* Data table elements styles.
|
|
35
|
-
* An object with `root`, `table`, `header`, `footer` and `pagination` keys and
|
|
36
|
-
* either style objects, or functions that accept current theme and return style objects, as values.
|
|
37
|
-
*/
|
|
38
|
-
styles?: StylesRecord<'root' | 'table' | 'header' | 'footer' | 'pagination', MantineStyleProp>;
|
|
39
|
-
/**
|
|
40
|
-
* Table height.
|
|
41
|
-
* @default '100%'
|
|
42
|
-
*/
|
|
43
|
-
height?: string | number;
|
|
44
|
-
/**
|
|
45
|
-
* Minimum table height.
|
|
46
|
-
*/
|
|
47
|
-
minHeight?: string | number;
|
|
48
|
-
/**
|
|
49
|
-
* DataTable component shadow.
|
|
50
|
-
*/
|
|
51
|
-
shadow?: MantineShadow;
|
|
52
|
-
/**
|
|
53
|
-
* If true, the user will not be able to select text.
|
|
54
|
-
*/
|
|
55
|
-
textSelectionDisabled?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Vertical alignment for row cells.
|
|
58
|
-
* @default `center`
|
|
59
|
-
*/
|
|
60
|
-
verticalAlign?: DataTableVerticalAlign;
|
|
61
|
-
/**
|
|
62
|
-
* If true, will show a loader with semi-transparent background, centered over the table.
|
|
63
|
-
*/
|
|
64
|
-
fetching?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Default column props; will be merged with column props provided to each column
|
|
67
|
-
*/
|
|
68
|
-
defaultColumnProps?: DataTableDefaultColumnProps<T>;
|
|
69
|
-
/**
|
|
70
|
-
* A default render function for all columns.
|
|
71
|
-
* Accepts the current record, its index in `records` and the column `accessor` as
|
|
72
|
-
* arguments and returns a React node (remember that a string is a valid React node too).
|
|
73
|
-
*/
|
|
74
|
-
defaultColumnRender?: (record: T, index: number, accessor: keyof T | (string & NonNullable<unknown>)) => React.ReactNode;
|
|
75
|
-
/**
|
|
76
|
-
* Accessor to use as unique record key.
|
|
77
|
-
* Can be a string representing a property name or a function receiving the current record
|
|
78
|
-
* and returning a unique value.
|
|
79
|
-
* If you're providing a string, you can use dot-notation for nested objects property drilling
|
|
80
|
-
* (i.e. `department.name` or `department.company.name`).
|
|
81
|
-
* @default `id`
|
|
82
|
-
*/
|
|
83
|
-
idAccessor?: (keyof T | (string & NonNullable<unknown>)) | ((record: T) => React.Key);
|
|
84
|
-
/**
|
|
85
|
-
* Visible records.
|
|
86
|
-
* The component will try to infer its row type from here.
|
|
87
|
-
*/
|
|
88
|
-
records?: T[];
|
|
89
|
-
/**
|
|
90
|
-
* Text to show on empty state and pagination footer when no records are available.
|
|
91
|
-
*/
|
|
92
|
-
noRecordsText?: string;
|
|
93
|
-
/**
|
|
94
|
-
* If true, the table will not show the header with column titles.
|
|
95
|
-
*/
|
|
96
|
-
noHeader?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Function to call when a row cell is clicked.
|
|
99
|
-
* Receives an object with the current record, its index in `records`, the current column,
|
|
100
|
-
* its index in `columns` and the click event as properties.
|
|
101
|
-
*/
|
|
102
|
-
onCellClick?: DataTableCellClickHandler<T>;
|
|
103
|
-
/**
|
|
104
|
-
* Function to call when the user right-clicks on a row cell.
|
|
105
|
-
* Receives an object with the current record, its index in `records`, the current column,
|
|
106
|
-
* its index in `columns` and the click event as properties.
|
|
107
|
-
*/
|
|
108
|
-
onCellContextMenu?: DataTableCellClickHandler<T>;
|
|
109
|
-
/**
|
|
110
|
-
* Function to call when a row is clicked.
|
|
111
|
-
* Receives an object with the current record, its index in `records` and the click event
|
|
112
|
-
* as properties.
|
|
113
|
-
*/
|
|
114
|
-
onRowClick?: DataTableRowClickHandler<T>;
|
|
115
|
-
/**
|
|
116
|
-
* Function to call when the user right-clicks on a row.
|
|
117
|
-
* Receives an object with the current record, its index in `records` and the click event
|
|
118
|
-
* as properties.
|
|
119
|
-
*/
|
|
120
|
-
onRowContextMenu?: DataTableRowClickHandler<T>;
|
|
121
|
-
/**
|
|
122
|
-
* Defines the row expansion behavior.
|
|
123
|
-
*/
|
|
124
|
-
rowExpansion?: DataTableRowExpansionProps<T>;
|
|
125
|
-
/**
|
|
126
|
-
* Optional class name passed to each row.
|
|
127
|
-
* Can be a string or a function receiving the current record and its index as arguments and returning a string.
|
|
128
|
-
*/
|
|
129
|
-
rowClassName?: string | ((record: T, index: number) => string | undefined);
|
|
130
|
-
/**
|
|
131
|
-
* Optional style passed to each row.
|
|
132
|
-
* A function receiving the current record and its index as arguments and returning either
|
|
133
|
-
* a style object, or a function that accepts theme and returns a style object.
|
|
134
|
-
*/
|
|
135
|
-
rowStyle?: (record: T, index: number) => MantineStyleProp | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* Optional function returning an object of custom attributes to be applied to each row in the table.
|
|
138
|
-
* Receives the current record and its index as arguments.
|
|
139
|
-
* Useful for adding data attributes, handling middle-clicks, etc.
|
|
140
|
-
*/
|
|
141
|
-
customRowAttributes?: (record: T, index: number) => Record<string, unknown>;
|
|
142
|
-
/**
|
|
143
|
-
* Ref pointing to the scrollable viewport element.
|
|
144
|
-
* Useful for imperative scrolling.
|
|
145
|
-
*/
|
|
146
|
-
scrollViewportRef?: React.RefObject<HTMLDivElement>;
|
|
147
|
-
/**
|
|
148
|
-
* Additional props passed to the underlying `ScrollArea` element.
|
|
149
|
-
*/
|
|
150
|
-
scrollAreaProps?: Omit<ScrollAreaProps, 'classNames' | 'styles' | 'onScrollPositionChange'>;
|
|
151
|
-
/**
|
|
152
|
-
* Ref pointing to the table body element.
|
|
153
|
-
*/
|
|
154
|
-
bodyRef?: ((instance: HTMLTableSectionElement | null) => void) | React.RefObject<HTMLTableSectionElement>;
|
|
155
|
-
} & Omit<TableProps, 'onScroll' | 'className' | 'classNames' | 'style' | 'styles' | 'p' | 'px' | 'py' | 'pt' | 'pb' | 'layout' | 'captionSide' | 'c' | 'color' | 'borderColor' | 'stripedColor' | 'highlightOnHoverColor'> & DataTableColorProps<T> & DataTableColumnProps<T> & DataTableOuterBorderProps & DataTableLoaderProps & DataTableEmptyStateProps & DataTablePaginationProps & DataTableSortProps<T> & DataTableScrollProps & DataTableSelectionProps<T>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type DataTableRowClickHandler<T = Record<string, unknown>> = (params: {
|
|
3
|
-
/**
|
|
4
|
-
* Click event.
|
|
5
|
-
*/
|
|
6
|
-
event: React.MouseEvent;
|
|
7
|
-
/**
|
|
8
|
-
* Clicked record.
|
|
9
|
-
*/
|
|
10
|
-
record: T;
|
|
11
|
-
/**
|
|
12
|
-
* Clicked record index.
|
|
13
|
-
*/
|
|
14
|
-
index: number;
|
|
15
|
-
}) => void;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DataTableRowExpansionCollapseProps } from './DataTableRowExpansionCollapseProps';
|
|
3
|
-
export type DataTableRowExpansionProps<T = Record<string, unknown>> = {
|
|
4
|
-
/**
|
|
5
|
-
* Defines when rows should expand.
|
|
6
|
-
* @default `click`
|
|
7
|
-
*/
|
|
8
|
-
trigger?: 'click' | 'always' | 'never';
|
|
9
|
-
/**
|
|
10
|
-
* If true, multiple rows can be expanded at the same time.
|
|
11
|
-
*/
|
|
12
|
-
allowMultiple?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Function defining which records will be initially expanded.
|
|
15
|
-
* Accepts an object with `record` and `index` properties and returns a boolean specifying
|
|
16
|
-
* whether the row should be expanded initially.
|
|
17
|
-
* Does nothing if `trigger === 'always'`.
|
|
18
|
-
*/
|
|
19
|
-
initiallyExpanded?: (options: {
|
|
20
|
-
record: T;
|
|
21
|
-
index: number;
|
|
22
|
-
}) => boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Additional properties passed to the Mantine Collapse component wrapping the custom content.
|
|
25
|
-
*/
|
|
26
|
-
collapseProps?: DataTableRowExpansionCollapseProps;
|
|
27
|
-
/**
|
|
28
|
-
* An object defining the row expansion behavior in controlled mode.
|
|
29
|
-
*/
|
|
30
|
-
expanded?: {
|
|
31
|
-
/**
|
|
32
|
-
* Currently expanded record IDs.
|
|
33
|
-
*/
|
|
34
|
-
recordIds: unknown[];
|
|
35
|
-
/**
|
|
36
|
-
* Callback fired when expanded records change.
|
|
37
|
-
* Receives an array containing the newly expanded record IDs.
|
|
38
|
-
*/
|
|
39
|
-
onRecordIdsChange?: React.Dispatch<React.SetStateAction<any[]>> | ((recordIds: unknown[]) => void);
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Function returning the custom content to be lazily rendered for an expanded row.
|
|
43
|
-
* Accepts an object with properties containing the current record, its index,
|
|
44
|
-
* and a `collapse()` callback that can be used to collapse the expanded row.
|
|
45
|
-
* Must return a React node.
|
|
46
|
-
*/
|
|
47
|
-
content: (params: {
|
|
48
|
-
record: T;
|
|
49
|
-
index: number;
|
|
50
|
-
collapse: () => void;
|
|
51
|
-
}) => React.ReactNode;
|
|
52
|
-
};
|