@popmenu/table 0.126.0 → 0.126.1
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/build/esm/_virtual/_commonjsHelpers.js +4 -0
- package/build/esm/_virtual/_commonjsHelpers.js.map +1 -0
- package/build/{components → esm/components}/ColumnFilterChip/ColumnFilterChip.d.ts +9 -9
- package/build/esm/components/ColumnFilterChip/ColumnFilterChip.js +17 -0
- package/build/esm/components/ColumnFilterChip/ColumnFilterChip.js.map +1 -0
- package/build/esm/components/ColumnFilterChip/ColumnFilterChipStyles.d.ts +1 -0
- package/build/esm/components/ColumnFilterChip/ColumnFilterChipStyles.js +14 -0
- package/build/esm/components/ColumnFilterChip/ColumnFilterChipStyles.js.map +1 -0
- package/build/{components → esm/components}/ColumnFilterChip/index.d.ts +1 -1
- package/build/{components → esm/components}/ColumnFilterResetButton/ColumnFilterResetButton.d.ts +3 -3
- package/build/esm/components/ColumnFilterResetButton/ColumnFilterResetButton.js +11 -0
- package/build/esm/components/ColumnFilterResetButton/ColumnFilterResetButton.js.map +1 -0
- package/build/{components → esm/components}/ColumnFilterResetButton/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/FilterControl/FilterControl.d.ts +3 -3
- package/build/esm/components/FilterPanel/FilterControl/FilterControl.js +24 -0
- package/build/esm/components/FilterPanel/FilterControl/FilterControl.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterControl/SelectFilter/SelectFilter.d.ts +5 -5
- package/build/esm/components/FilterPanel/FilterControl/SelectFilter/SelectFilter.js +97 -0
- package/build/esm/components/FilterPanel/FilterControl/SelectFilter/SelectFilter.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.d.ts +1 -1
- package/build/esm/components/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.js +23 -0
- package/build/esm/components/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterControl/SelectFilter/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/FilterControl/ToggleFilter/ToggleFilter.d.ts +4 -4
- package/build/esm/components/FilterPanel/FilterControl/ToggleFilter/ToggleFilter.js +20 -0
- package/build/esm/components/FilterPanel/FilterControl/ToggleFilter/ToggleFilter.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterControl/ToggleFilter/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/FilterControl/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/FilterPanel.d.ts +2 -2
- package/build/esm/components/FilterPanel/FilterPanel.js +24 -0
- package/build/esm/components/FilterPanel/FilterPanel.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterPanelContext/FilterPanelContext.d.ts +7 -7
- package/build/esm/components/FilterPanel/FilterPanelContext/FilterPanelContext.js +13 -0
- package/build/esm/components/FilterPanel/FilterPanelContext/FilterPanelContext.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/FilterPanelContext/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/FilterPanelProps.d.ts +11 -11
- package/build/{components → esm/components}/FilterPanel/Panel/Panel.d.ts +7 -7
- package/build/esm/components/FilterPanel/Panel/Panel.js +72 -0
- package/build/esm/components/FilterPanel/Panel/Panel.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/Panel/PanelStyles.d.ts +1 -1
- package/build/esm/components/FilterPanel/Panel/PanelStyles.js +58 -0
- package/build/esm/components/FilterPanel/Panel/PanelStyles.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/Panel/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/Trigger/Trigger.d.ts +7 -7
- package/build/esm/components/FilterPanel/Trigger/Trigger.js +14 -0
- package/build/esm/components/FilterPanel/Trigger/Trigger.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/Trigger/TriggerStyles.d.ts +1 -1
- package/build/esm/components/FilterPanel/Trigger/TriggerStyles.js +11 -0
- package/build/esm/components/FilterPanel/Trigger/TriggerStyles.js.map +1 -0
- package/build/{components → esm/components}/FilterPanel/Trigger/index.d.ts +1 -1
- package/build/{components → esm/components}/FilterPanel/index.d.ts +1 -1
- package/build/{components → esm/components}/GlobalFilter/GlobalFilter.d.ts +3 -3
- package/build/esm/components/GlobalFilter/GlobalFilter.js +21 -0
- package/build/esm/components/GlobalFilter/GlobalFilter.js.map +1 -0
- package/build/{components → esm/components}/GlobalFilter/GlobalFilterProps.d.ts +7 -7
- package/build/{components → esm/components}/GlobalFilter/GlobalFilterStyles.d.ts +1 -1
- package/build/esm/components/GlobalFilter/GlobalFilterStyles.js +14 -0
- package/build/esm/components/GlobalFilter/GlobalFilterStyles.js.map +1 -0
- package/build/{components → esm/components}/GlobalFilter/index.d.ts +2 -2
- package/build/{components → esm/components}/RowActions/RowActions.d.ts +3 -3
- package/build/esm/components/RowActions/RowActions.js +42 -0
- package/build/esm/components/RowActions/RowActions.js.map +1 -0
- package/build/{components → esm/components}/RowActions/RowActionsProps.d.ts +13 -13
- package/build/{components → esm/components}/RowActions/index.d.ts +2 -2
- package/build/{components → esm/components}/Table/Table.d.ts +21 -21
- package/build/esm/components/Table/Table.js +107 -0
- package/build/esm/components/Table/Table.js.map +1 -0
- package/build/{components → esm/components}/Table/TableProps.d.ts +47 -47
- package/build/{components → esm/components}/Table/TableStyles.d.ts +2 -2
- package/build/esm/components/Table/TableStyles.js +28 -0
- package/build/esm/components/Table/TableStyles.js.map +1 -0
- package/build/{components → esm/components}/Table/index.d.ts +2 -2
- package/build/{components → esm/components}/TableBody/TableBody.d.ts +4 -4
- package/build/esm/components/TableBody/TableBody.js +10 -0
- package/build/esm/components/TableBody/TableBody.js.map +1 -0
- package/build/{components → esm/components}/TableBody/index.d.ts +1 -1
- package/build/{components → esm/components}/TableCell/TableCell.d.ts +4 -4
- package/build/esm/components/TableCell/TableCell.js +12 -0
- package/build/esm/components/TableCell/TableCell.js.map +1 -0
- package/build/{components → esm/components}/TableCell/TableCellStyles.d.ts +1 -1
- package/build/esm/components/TableCell/TableCellStyles.js +11 -0
- package/build/esm/components/TableCell/TableCellStyles.js.map +1 -0
- package/build/{components → esm/components}/TableCell/index.d.ts +1 -1
- package/build/{components → esm/components}/TableContext/index.d.ts +16 -16
- package/build/esm/components/TableContext/index.js +6 -0
- package/build/esm/components/TableContext/index.js.map +1 -0
- package/build/{components → esm/components}/TableControlsContainer/TableControlsContainer.d.ts +3 -3
- package/build/esm/components/TableControlsContainer/TableControlsContainer.js +34 -0
- package/build/esm/components/TableControlsContainer/TableControlsContainer.js.map +1 -0
- package/build/{components → esm/components}/TableControlsContainer/TableControlsContainerProps.d.ts +6 -6
- package/build/{components → esm/components}/TableControlsContainer/index.d.ts +1 -1
- package/build/{components → esm/components}/TableFooter/TableFooter.d.ts +4 -4
- package/build/esm/components/TableFooter/TableFooter.js +9 -0
- package/build/esm/components/TableFooter/TableFooter.js.map +1 -0
- package/build/{components → esm/components}/TableFooter/index.d.ts +1 -1
- package/build/{components → esm/components}/TableHeader/TableHeader.d.ts +4 -4
- package/build/esm/components/TableHeader/TableHeader.js +10 -0
- package/build/esm/components/TableHeader/TableHeader.js.map +1 -0
- package/build/{components → esm/components}/TableHeader/index.d.ts +1 -1
- package/build/{components → esm/components}/TableHeaderCell/TableHeaderCell.d.ts +3 -3
- package/build/esm/components/TableHeaderCell/TableHeaderCell.js +31 -0
- package/build/esm/components/TableHeaderCell/TableHeaderCell.js.map +1 -0
- package/build/{components → esm/components}/TableHeaderCell/TableHeaderCellProps.d.ts +6 -6
- package/build/{components → esm/components}/TableHeaderCell/TableHeaderCellStyles.d.ts +4 -4
- package/build/esm/components/TableHeaderCell/TableHeaderCellStyles.js +41 -0
- package/build/esm/components/TableHeaderCell/TableHeaderCellStyles.js.map +1 -0
- package/build/{components → esm/components}/TableHeaderCell/index.d.ts +2 -2
- package/build/{components → esm/components}/TableHeaderRow/TableHeaderRow.d.ts +4 -4
- package/build/esm/components/TableHeaderRow/TableHeaderRow.js +10 -0
- package/build/esm/components/TableHeaderRow/TableHeaderRow.js.map +1 -0
- package/build/{components → esm/components}/TableHeaderRow/index.d.ts +1 -1
- package/build/{components → esm/components}/TableRow/TableRow.d.ts +4 -4
- package/build/esm/components/TableRow/TableRow.js +12 -0
- package/build/esm/components/TableRow/TableRow.js.map +1 -0
- package/build/{components → esm/components}/TableRow/TableRowStyles.d.ts +1 -1
- package/build/esm/components/TableRow/TableRowStyles.js +12 -0
- package/build/esm/components/TableRow/TableRowStyles.js.map +1 -0
- package/build/{components → esm/components}/TableRow/index.d.ts +1 -1
- package/build/{components → esm/components}/index.d.ts +10 -10
- package/build/{hooks → esm/hooks}/index.d.ts +2 -2
- package/build/{hooks → esm/hooks}/useColumnFilters.d.ts +9 -9
- package/build/esm/hooks/useColumnFilters.js +74 -0
- package/build/esm/hooks/useColumnFilters.js.map +1 -0
- package/build/{hooks → esm/hooks}/useStagedColumnFilters.d.ts +8 -8
- package/build/esm/hooks/useStagedColumnFilters.js +55 -0
- package/build/esm/hooks/useStagedColumnFilters.js.map +1 -0
- package/build/{index.d.ts → esm/index.d.ts} +1 -1
- package/build/esm/index.js +11 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/node_modules/lodash/_Symbol.js +11 -0
- package/build/esm/node_modules/lodash/_Symbol.js.map +1 -0
- package/build/esm/node_modules/lodash/_arrayMap.js +25 -0
- package/build/esm/node_modules/lodash/_arrayMap.js.map +1 -0
- package/build/esm/node_modules/lodash/_arrayReduce.js +30 -0
- package/build/esm/node_modules/lodash/_arrayReduce.js.map +1 -0
- package/build/esm/node_modules/lodash/_asciiWords.js +19 -0
- package/build/esm/node_modules/lodash/_asciiWords.js.map +1 -0
- package/build/esm/node_modules/lodash/_baseGetTag.js +35 -0
- package/build/esm/node_modules/lodash/_baseGetTag.js.map +1 -0
- package/build/esm/node_modules/lodash/_basePropertyOf.js +18 -0
- package/build/esm/node_modules/lodash/_basePropertyOf.js.map +1 -0
- package/build/esm/node_modules/lodash/_baseToString.js +42 -0
- package/build/esm/node_modules/lodash/_baseToString.js.map +1 -0
- package/build/esm/node_modules/lodash/_createCompounder.js +31 -0
- package/build/esm/node_modules/lodash/_createCompounder.js.map +1 -0
- package/build/esm/node_modules/lodash/_deburrLetter.js +76 -0
- package/build/esm/node_modules/lodash/_deburrLetter.js.map +1 -0
- package/build/esm/node_modules/lodash/_freeGlobal.js +10 -0
- package/build/esm/node_modules/lodash/_freeGlobal.js.map +1 -0
- package/build/esm/node_modules/lodash/_getRawTag.js +51 -0
- package/build/esm/node_modules/lodash/_getRawTag.js.map +1 -0
- package/build/esm/node_modules/lodash/_hasUnicodeWord.js +19 -0
- package/build/esm/node_modules/lodash/_hasUnicodeWord.js.map +1 -0
- package/build/esm/node_modules/lodash/_objectToString.js +26 -0
- package/build/esm/node_modules/lodash/_objectToString.js.map +1 -0
- package/build/esm/node_modules/lodash/_root.js +14 -0
- package/build/esm/node_modules/lodash/_root.js.map +1 -0
- package/build/esm/node_modules/lodash/_unicodeWords.js +73 -0
- package/build/esm/node_modules/lodash/_unicodeWords.js.map +1 -0
- package/build/esm/node_modules/lodash/deburr.js +51 -0
- package/build/esm/node_modules/lodash/deburr.js.map +1 -0
- package/build/esm/node_modules/lodash/isArray.js +30 -0
- package/build/esm/node_modules/lodash/isArray.js.map +1 -0
- package/build/esm/node_modules/lodash/isObjectLike.js +33 -0
- package/build/esm/node_modules/lodash/isObjectLike.js.map +1 -0
- package/build/esm/node_modules/lodash/isSymbol.js +35 -0
- package/build/esm/node_modules/lodash/isSymbol.js.map +1 -0
- package/build/esm/node_modules/lodash/kebabCase.js +33 -0
- package/build/esm/node_modules/lodash/kebabCase.js.map +1 -0
- package/build/esm/node_modules/lodash/toString.js +33 -0
- package/build/esm/node_modules/lodash/toString.js.map +1 -0
- package/build/esm/node_modules/lodash/words.js +43 -0
- package/build/esm/node_modules/lodash/words.js.map +1 -0
- package/build/{util → esm/util}/coercedValueIncludesString.d.ts +2 -2
- package/build/esm/util/coercedValueIncludesString.js +9 -0
- package/build/esm/util/coercedValueIncludesString.js.map +1 -0
- package/build/{util → esm/util}/getTableMinHeight.d.ts +2 -2
- package/build/esm/util/getTableMinHeight.js +20 -0
- package/build/esm/util/getTableMinHeight.js.map +1 -0
- package/build/{util → esm/util}/index.d.ts +3 -3
- package/build/{util → esm/util}/tableConstants.d.ts +5 -5
- package/build/esm/util/tableConstants.js +6 -0
- package/build/esm/util/tableConstants.js.map +1 -0
- package/build/{util → esm/util}/validateRowAction.d.ts +2 -2
- package/build/esm/util/validateRowAction.js +12 -0
- package/build/esm/util/validateRowAction.js.map +1 -0
- package/build/index.js +694 -3716
- package/build/index.js.map +1 -1
- package/package.json +8 -4
- package/build/components/ColumnFilterChip/ColumnFilterChipStyles.d.ts +0 -1
- package/build/index.es.js +0 -4407
- package/build/index.es.js.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core';
|
|
2
|
+
|
|
3
|
+
var useStyles = makeStyles(function (theme) { return ({
|
|
4
|
+
buttonBox: {
|
|
5
|
+
'& > :last-child': {
|
|
6
|
+
marginLeft: theme.spacing(2),
|
|
7
|
+
},
|
|
8
|
+
display: 'flex',
|
|
9
|
+
justifyContent: 'flex-end',
|
|
10
|
+
padding: "0px " + theme.spacing(3) + "px " + theme.spacing(3) + "px " + theme.spacing(3) + "px",
|
|
11
|
+
},
|
|
12
|
+
buttonLabel: {
|
|
13
|
+
fontWeight: 400,
|
|
14
|
+
},
|
|
15
|
+
filterPopoverContents: {
|
|
16
|
+
backgroundColor: 'white',
|
|
17
|
+
borderRadius: theme.spacing(1),
|
|
18
|
+
position: 'relative',
|
|
19
|
+
margin: '10px',
|
|
20
|
+
marginTop: theme.spacing(2),
|
|
21
|
+
width: '323px',
|
|
22
|
+
'&::before': {
|
|
23
|
+
backgroundColor: 'white',
|
|
24
|
+
borderRadius: theme.spacing(0.5),
|
|
25
|
+
content: '""',
|
|
26
|
+
display: 'block',
|
|
27
|
+
filter: 'drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.14)) drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.12))',
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
width: theme.spacing(2.5),
|
|
30
|
+
height: theme.spacing(2.5),
|
|
31
|
+
top: -7,
|
|
32
|
+
transform: 'rotate(45deg)',
|
|
33
|
+
left: 'calc(90% - 12px)',
|
|
34
|
+
zIndex: 0,
|
|
35
|
+
},
|
|
36
|
+
'&::after': {
|
|
37
|
+
backgroundColor: 'white',
|
|
38
|
+
content: '""',
|
|
39
|
+
display: 'block',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: 0,
|
|
42
|
+
left: 'calc(80%)',
|
|
43
|
+
width: theme.spacing(6),
|
|
44
|
+
height: theme.spacing(4),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
menuTitle: {
|
|
48
|
+
fontWeight: 400,
|
|
49
|
+
fontSize: '20px',
|
|
50
|
+
paddingBottom: theme.spacing(2),
|
|
51
|
+
},
|
|
52
|
+
selectInput: {
|
|
53
|
+
margin: '8px 0',
|
|
54
|
+
},
|
|
55
|
+
}); });
|
|
56
|
+
|
|
57
|
+
export { useStyles };
|
|
58
|
+
//# sourceMappingURL=PanelStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelStyles.js","sources":["../../../../../src/components/FilterPanel/Panel/PanelStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nexport const useStyles = makeStyles<Theme>((theme) => ({\n buttonBox: {\n '& > :last-child': {\n marginLeft: theme.spacing(2),\n },\n display: 'flex',\n justifyContent: 'flex-end',\n padding: `0px ${theme.spacing(3)}px ${theme.spacing(3)}px ${theme.spacing(3)}px`,\n },\n buttonLabel: {\n fontWeight: 400,\n },\n filterPopoverContents: {\n backgroundColor: 'white',\n borderRadius: theme.spacing(1),\n position: 'relative',\n margin: '10px',\n marginTop: theme.spacing(2),\n width: '323px',\n '&::before': {\n backgroundColor: 'white',\n borderRadius: theme.spacing(0.5),\n content: '\"\"',\n display: 'block',\n filter: 'drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.14)) drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.12))',\n position: 'absolute',\n width: theme.spacing(2.5),\n height: theme.spacing(2.5),\n top: -7,\n transform: 'rotate(45deg)',\n left: 'calc(90% - 12px)',\n zIndex: 0,\n },\n '&::after': {\n backgroundColor: 'white',\n content: '\"\"',\n display: 'block',\n position: 'absolute',\n top: 0,\n left: 'calc(80%)',\n width: theme.spacing(6),\n height: theme.spacing(4),\n },\n },\n menuTitle: {\n fontWeight: 400,\n fontSize: '20px',\n paddingBottom: theme.spacing(2),\n },\n selectInput: {\n margin: '8px 0',\n },\n}))\n"],"names":[],"mappings":";;AAEa,IAAA,SAAS,GAAG,UAAU,CAAQ,UAAC,KAAK,EAAK,EAAA,QAAC;AACrD,IAAA,SAAS,EAAE;AACT,QAAA,iBAAiB,EAAE;AACjB,YAAA,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7B,SAAA;AACD,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,cAAc,EAAE,UAAU;QAC1B,OAAO,EAAE,SAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAA,KAAA,GAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAM,KAAA,GAAA,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAI,IAAA;AACjF,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,UAAU,EAAE,GAAG;AAChB,KAAA;AACD,IAAA,qBAAqB,EAAE;AACrB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9B,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,SAAS,EAAE,KAAK,CAAC,O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1
|
-
import { SyntheticEvent } from 'react';
|
|
2
|
-
declare type FitlerPanelTriggerProps = {
|
|
3
|
-
onClick: (event: SyntheticEvent) => void;
|
|
4
|
-
label?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const Trigger: (props: FitlerPanelTriggerProps) => JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
declare type FitlerPanelTriggerProps = {
|
|
3
|
+
onClick: (event: SyntheticEvent) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const Trigger: (props: FitlerPanelTriggerProps) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from '@popmenu/common-ui';
|
|
3
|
+
import { Button } from '@popmenu/admin-ui';
|
|
4
|
+
import { Filter } from '@popmenu/web-icons';
|
|
5
|
+
import { useStyles } from './TriggerStyles.js';
|
|
6
|
+
|
|
7
|
+
var Trigger = function (props) {
|
|
8
|
+
var _a = props.label, label = _a === void 0 ? 'Filter' : _a, onClick = props.onClick;
|
|
9
|
+
var classes = useStyles();
|
|
10
|
+
return (React.createElement(Button, { className: classes.root, onClick: onClick, startIcon: React.createElement(Icon, { icon: Filter }), textTransform: "none", variant: "ghost" }, label));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { Trigger };
|
|
14
|
+
//# sourceMappingURL=Trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../src/components/FilterPanel/Trigger/Trigger.tsx"],"sourcesContent":["import React, { SyntheticEvent } from 'react'\nimport { Icon } from '@popmenu/common-ui'\nimport { Button } from '@popmenu/admin-ui'\nimport { Filter } from '@popmenu/web-icons'\nimport { useStyles } from './TriggerStyles'\n\ntype FitlerPanelTriggerProps = {\n onClick: (event: SyntheticEvent) => void\n label?: string\n}\n\nexport const Trigger = (props: FitlerPanelTriggerProps) => {\n const { label = 'Filter', onClick } = props\n const classes = useStyles()\n return (\n <Button\n className={classes.root}\n onClick={onClick}\n startIcon={<Icon icon={Filter} />}\n textTransform=\"none\"\n variant=\"ghost\"\n >\n {label}\n </Button>\n )\n}\n"],"names":[],"mappings":";;;;;;AAWO,IAAM,OAAO,GAAG,UAAC,KAA8B,EAAA;AAC5C,IAAA,IAAA,EAA8B,GAAA,KAAK,CAAnB,KAAA,EAAhB,KAAK,GAAA,EAAA,KAAA,MAAA,GAAG,QAAQ,GAAA,EAAA,EAAE,OAAO,GAAK,KAAK,QAAV;AACjC,IAAA,IAAM,OAAO,GAAG,SAAS,EAAE;AAC3B,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EACL,SAAS,EAAE,OAAO,CAAC,IAAI,EACvB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,MAAM,EAAI,CAAA,EACjC,aAAa,EAAC,MAAM,EACpB,OAAO,EAAC,OAAO,EAAA,EAEd,KAAK,CACC;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerStyles.js","sources":["../../../../../src/components/FilterPanel/Trigger/TriggerStyles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core'\n\nexport const useStyles = makeStyles({\n root: {\n justifySelf: 'end',\n gridArea: 'columnFilter',\n },\n})\n"],"names":[],"mappings":";;AAEO,IAAM,SAAS,GAAG,UAAU,CAAC;AAClC,IAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,KAAK;AAClB,QAAA,QAAQ,EAAE,cAAc;AACzB,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Trigger } from './Trigger';
|
|
1
|
+
export { Trigger } from './Trigger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FilterPanel } from './FilterPanel';
|
|
1
|
+
export { FilterPanel } from './FilterPanel';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GlobalFilterProps } from './GlobalFilterProps';
|
|
3
|
-
export declare const GlobalFilter: (props: GlobalFilterProps) => JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GlobalFilterProps } from './GlobalFilterProps';
|
|
3
|
+
export declare const GlobalFilter: (props: GlobalFilterProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TextField, InputAdornment } from '@material-ui/core';
|
|
4
|
+
import { Icon } from '@popmenu/common-ui';
|
|
5
|
+
import { Search } from '@popmenu/web-icons';
|
|
6
|
+
import { useStyles } from './GlobalFilterStyles.js';
|
|
7
|
+
|
|
8
|
+
var GlobalFilter = function (props) {
|
|
9
|
+
var value = props.value, setValue = props.setValue, restProps = __rest(props, ["value", "setValue"]);
|
|
10
|
+
var classes = useStyles();
|
|
11
|
+
var handleChange = function (e) {
|
|
12
|
+
setValue(e.target.value);
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement(TextField, __assign({ className: classes.root, variant: "outlined", value: value, onChange: handleChange, InputProps: {
|
|
15
|
+
startAdornment: (React.createElement(InputAdornment, { position: "start" },
|
|
16
|
+
React.createElement(Icon, { icon: Search }))),
|
|
17
|
+
} }, restProps)));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { GlobalFilter };
|
|
21
|
+
//# sourceMappingURL=GlobalFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalFilter.js","sources":["../../../../src/components/GlobalFilter/GlobalFilter.tsx"],"sourcesContent":["import React, { ChangeEventHandler } from 'react'\nimport { InputAdornment, TextField } from '@material-ui/core'\n\nimport { Icon } from '@popmenu/common-ui'\nimport { Search } from '@popmenu/web-icons'\nimport { useStyles } from './GlobalFilterStyles'\nimport { GlobalFilterProps } from './GlobalFilterProps'\n\nexport const GlobalFilter = (props: GlobalFilterProps) => {\n const { value, setValue, ...restProps } = props\n const classes = useStyles()\n const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n setValue(e.target.value)\n }\n return (\n <TextField\n className={classes.root}\n variant=\"outlined\"\n value={value}\n onChange={handleChange}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon icon={Search} />\n </InputAdornment>\n ),\n }}\n {...restProps}\n />\n )\n}\n"],"names":[],"mappings":";;;;;;;AAQO,IAAM,YAAY,GAAG,UAAC,KAAwB,EAAA;AAC3C,IAAA,IAAA,KAAK,GAA6B,KAAK,CAAlC,KAAA,EAAE,QAAQ,GAAmB,KAAK,CAAxB,QAAA,EAAK,SAAS,GAAK,MAAA,CAAA,KAAK,EAAzC,CAAA,OAAA,EAAA,UAAA,CAAiC,CAAF;AACrC,IAAA,IAAM,OAAO,GAAG,SAAS,EAAE;IAC3B,IAAM,YAAY,GAAyC,UAAC,CAAC,EAAA;AAC3D,QAAA,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAC1B,KAAC;IACD,QACE,oBAAC,SAAS,EAAA,QAAA,CAAA,EACR,SAAS,EAAE,OAAO,CAAC,IAAI,EACvB,OAAO,EAAC,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE;AACV,YAAA,cAAc,GACZ,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,QAAQ,EAAC,OAAO,EAAA;AAC9B,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAE,MAAM,EAAA,CAAI,CACP,CAClB;SACF,EACG,EAAA,SAAS,CACb,CAAA;AAEN;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OutlinedTextFieldProps } from '@material-ui/core/TextField';
|
|
2
|
-
export interface GlobalFilterProps extends Omit<OutlinedTextFieldProps, 'variant'> {
|
|
3
|
-
/** the value of global filter from table instance */
|
|
4
|
-
value: string;
|
|
5
|
-
/** the setter for value of global filter from table instance */
|
|
6
|
-
setValue: (value: string) => void;
|
|
7
|
-
}
|
|
1
|
+
import { OutlinedTextFieldProps } from '@material-ui/core/TextField';
|
|
2
|
+
export interface GlobalFilterProps extends Omit<OutlinedTextFieldProps, 'variant'> {
|
|
3
|
+
/** the value of global filter from table instance */
|
|
4
|
+
value: string;
|
|
5
|
+
/** the setter for value of global filter from table instance */
|
|
6
|
+
setValue: (value: string) => void;
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core';
|
|
2
|
+
|
|
3
|
+
var useStyles = makeStyles({
|
|
4
|
+
root: {
|
|
5
|
+
justifySelf: 'start',
|
|
6
|
+
maxWidth: 300,
|
|
7
|
+
minWidth: 200,
|
|
8
|
+
width: '100%',
|
|
9
|
+
gridArea: 'globalFilter',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { useStyles };
|
|
14
|
+
//# sourceMappingURL=GlobalFilterStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalFilterStyles.js","sources":["../../../../src/components/GlobalFilter/GlobalFilterStyles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core'\n\nexport const useStyles = makeStyles({\n root: {\n justifySelf: 'start',\n maxWidth: 300,\n minWidth: 200,\n width: '100%',\n gridArea: 'globalFilter',\n },\n})\n"],"names":[],"mappings":";;AAEO,IAAM,SAAS,GAAG,UAAU,CAAC;AAClC,IAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,OAAO;AACpB,QAAA,QAAQ,EAAE,GAAG;AACb,QAAA,QAAQ,EAAE,GAAG;AACb,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,QAAQ,EAAE,cAAc;AACzB,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GlobalFilter } from './GlobalFilter';
|
|
2
|
-
export { GlobalFilterProps } from './GlobalFilterProps';
|
|
1
|
+
export { GlobalFilter } from './GlobalFilter';
|
|
2
|
+
export { GlobalFilterProps } from './GlobalFilterProps';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { RowActionsProps } from './RowActionsProps';
|
|
3
|
-
export declare const RowActions: (props: RowActionsProps) => JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RowActionsProps } from './RowActionsProps';
|
|
3
|
+
export declare const RowActions: (props: RowActionsProps) => JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { More } from '@popmenu/web-icons';
|
|
4
|
+
import { Box, Tooltip, IconButton, Icon, Menu, MenuItem } from '@popmenu/common-ui';
|
|
5
|
+
import { validateAction } from '../../util/validateRowAction.js';
|
|
6
|
+
|
|
7
|
+
var RowActions = function (props) {
|
|
8
|
+
var context = props.context, actions = props.actions;
|
|
9
|
+
var validActions = actions.filter(validateAction);
|
|
10
|
+
var _a = React.useState(null), anchorEl = _a[0], setAnchorEl = _a[1];
|
|
11
|
+
var openMenu = function (event) {
|
|
12
|
+
setAnchorEl(event.currentTarget);
|
|
13
|
+
};
|
|
14
|
+
var closeMenu = function () {
|
|
15
|
+
setAnchorEl(null);
|
|
16
|
+
};
|
|
17
|
+
var actionsCount = validActions.length;
|
|
18
|
+
var mainActions;
|
|
19
|
+
var overflowActions;
|
|
20
|
+
if (actionsCount <= 3) {
|
|
21
|
+
mainActions = validActions;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
var firstAction = validActions[0], secondAction = validActions[1], restActions = validActions.slice(2);
|
|
25
|
+
mainActions = [firstAction, secondAction];
|
|
26
|
+
overflowActions = restActions;
|
|
27
|
+
}
|
|
28
|
+
return (React.createElement(Box, { display: "flex" },
|
|
29
|
+
mainActions.map(function (_a) {
|
|
30
|
+
var label = _a.label, onClick = _a.onClick, icon = _a.icon, restProps = __rest(_a, ["label", "onClick", "icon"]);
|
|
31
|
+
return (React.createElement(Tooltip, { title: label, key: label },
|
|
32
|
+
React.createElement(IconButton, __assign({ size: "small", onClick: function () { return onClick(context); } }, restProps),
|
|
33
|
+
React.createElement(Icon, { icon: icon }))));
|
|
34
|
+
}),
|
|
35
|
+
overflowActions && (React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement(IconButton, { size: "small", onClick: openMenu },
|
|
37
|
+
React.createElement(Icon, { icon: More })),
|
|
38
|
+
React.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, overflowActions.map(function (action) { return (React.createElement(MenuItem, { key: action.label, onClick: function () { return action.onClick(context); } }, action.label)); }))))));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { RowActions };
|
|
42
|
+
//# sourceMappingURL=RowActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActions.js","sources":["../../../../src/components/RowActions/RowActions.tsx"],"sourcesContent":["import React, { MouseEvent } from 'react'\nimport { More } from '@popmenu/web-icons'\nimport { RowActionsProps } from './RowActionsProps'\nimport { Tooltip, IconButton, Icon, Box, Menu, MenuItem } from '@popmenu/common-ui'\n\nimport { validateAction } from '../../util/validateRowAction'\n\nexport const RowActions = (props: RowActionsProps) => {\n const { context, actions } = props\n const validActions = actions.filter(validateAction)\n const [anchorEl, setAnchorEl] = React.useState<(EventTarget & Element) | null>(null)\n const openMenu = (event: MouseEvent) => {\n setAnchorEl(event.currentTarget)\n }\n const closeMenu = () => {\n setAnchorEl(null)\n }\n const actionsCount = validActions.length\n let mainActions\n let overflowActions\n if (actionsCount <= 3) {\n mainActions = validActions\n } else {\n const [firstAction, secondAction, ...restActions] = validActions\n mainActions = [firstAction, secondAction]\n overflowActions = restActions\n }\n\n return (\n <Box display=\"flex\">\n {mainActions.map(({ label, onClick, icon, ...restProps }) => (\n <Tooltip title={label} key={label}>\n <IconButton size=\"small\" onClick={() => onClick(context)} {...restProps}>\n <Icon icon={icon} />\n </IconButton>\n </Tooltip>\n ))}\n {overflowActions && (\n <>\n <IconButton size=\"small\" onClick={openMenu}>\n <Icon icon={More} />\n </IconButton>\n <Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={closeMenu}>\n {overflowActions.map((action) => (\n <MenuItem key={action.label} onClick={() => action.onClick(context)}>\n {action.label}\n </MenuItem>\n ))}\n </Menu>\n </>\n )}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;;;AAOO,IAAM,UAAU,GAAG,UAAC,KAAsB,EAAA;IACvC,IAAA,OAAO,GAAc,KAAK,CAAA,OAAnB,EAAE,OAAO,GAAK,KAAK,CAAA,OAAV;IACxB,IAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;AAC7C,IAAA,IAAA,EAA0B,GAAA,KAAK,CAAC,QAAQ,CAAiC,IAAI,CAAC,EAA7E,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,WAAW,QAAwD;IACpF,IAAM,QAAQ,GAAG,UAAC,KAAiB,EAAA;AACjC,QAAA,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC;AAClC,KAAC;AACD,IAAA,IAAM,SAAS,GAAG,YAAA;QAChB,WAAW,CAAC,IAAI,CAAC;AACnB,KAAC;AACD,IAAA,IAAM,YAAY,GAAG,YAAY,CAAC,MAAM;AACxC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xC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAE,IAAI,GAAI,CACT;AACb,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAClE,EAAA,eAAe,CAAC,GAAG,CAAC,UAAC,MAAM,EAAA,EAAK,QAC/B,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,YAAA,EAAM,OAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,EAAA,EAAA,EAChE,MAAM,CAAC,KAAK,CACJ,EACZ,EAAA,CAAC,CACG,CACN,CACJ,CACG;AAEV;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FC, SVGProps } from 'react';
|
|
2
|
-
import { CellContext } from '@tanstack/react-table';
|
|
3
|
-
export interface RowAction {
|
|
4
|
-
icon: FC<SVGProps<SVGSVGElement>>;
|
|
5
|
-
label: string;
|
|
6
|
-
onClick: (props: CellContext<any, any>) => void;
|
|
7
|
-
}
|
|
8
|
-
export interface RowActionsProps {
|
|
9
|
-
/** Expects cellContext from react-table and is passed through to action components */
|
|
10
|
-
context: CellContext<any, any>;
|
|
11
|
-
/** List of actions for a given row */
|
|
12
|
-
actions: Array<RowAction>;
|
|
13
|
-
}
|
|
1
|
+
import { FC, SVGProps } from 'react';
|
|
2
|
+
import { CellContext } from '@tanstack/react-table';
|
|
3
|
+
export interface RowAction {
|
|
4
|
+
icon: FC<SVGProps<SVGSVGElement>>;
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: (props: CellContext<any, any>) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface RowActionsProps {
|
|
9
|
+
/** Expects cellContext from react-table and is passed through to action components */
|
|
10
|
+
context: CellContext<any, any>;
|
|
11
|
+
/** List of actions for a given row */
|
|
12
|
+
actions: Array<RowAction>;
|
|
13
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RowActions } from './RowActions';
|
|
2
|
-
export { RowActionsProps } from './RowActionsProps';
|
|
1
|
+
export { RowActions } from './RowActions';
|
|
2
|
+
export { RowActionsProps } from './RowActionsProps';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableProps } from './TableProps';
|
|
3
|
-
declare const defaultTableProps: {
|
|
4
|
-
enableSortingRemoval: boolean;
|
|
5
|
-
fullWidth: boolean;
|
|
6
|
-
paginated: boolean;
|
|
7
|
-
sortable: boolean;
|
|
8
|
-
searchable: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare type DefaultTableProps<T> = TableProps<T> & typeof defaultTableProps;
|
|
11
|
-
export declare const Table: {
|
|
12
|
-
<T>(props: DefaultTableProps<T>): JSX.Element;
|
|
13
|
-
defaultProps: {
|
|
14
|
-
enableSortingRemoval: boolean;
|
|
15
|
-
fullWidth: boolean;
|
|
16
|
-
paginated: boolean;
|
|
17
|
-
sortable: boolean;
|
|
18
|
-
searchable: boolean;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableProps } from './TableProps';
|
|
3
|
+
declare const defaultTableProps: {
|
|
4
|
+
enableSortingRemoval: boolean;
|
|
5
|
+
fullWidth: boolean;
|
|
6
|
+
paginated: boolean;
|
|
7
|
+
sortable: boolean;
|
|
8
|
+
searchable: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare type DefaultTableProps<T> = TableProps<T> & typeof defaultTableProps;
|
|
11
|
+
export declare const Table: {
|
|
12
|
+
<T>(props: DefaultTableProps<T>): JSX.Element;
|
|
13
|
+
defaultProps: {
|
|
14
|
+
enableSortingRemoval: boolean;
|
|
15
|
+
fullWidth: boolean;
|
|
16
|
+
paginated: boolean;
|
|
17
|
+
sortable: boolean;
|
|
18
|
+
searchable: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
import React, { useRef, isValidElement, createElement } from 'react';
|
|
3
|
+
import { Typography } from '@material-ui/core';
|
|
4
|
+
import { Pagination } from '@material-ui/lab';
|
|
5
|
+
import { Box, CircularProgress } from '@popmenu/common-ui';
|
|
6
|
+
import { useReactTable, getFilteredRowModel, getSortedRowModel, getCoreRowModel, getPaginationRowModel, flexRender } from '@tanstack/react-table';
|
|
7
|
+
import { TableRow } from '../TableRow/TableRow.js';
|
|
8
|
+
import { TableCell } from '../TableCell/TableCell.js';
|
|
9
|
+
import { TableBody } from '../TableBody/TableBody.js';
|
|
10
|
+
import { useStyles } from './TableStyles.js';
|
|
11
|
+
import { TableHeader } from '../TableHeader/TableHeader.js';
|
|
12
|
+
import { TableFooter } from '../TableFooter/TableFooter.js';
|
|
13
|
+
import { FilterPanel } from '../FilterPanel/FilterPanel.js';
|
|
14
|
+
import { TableContext } from '../TableContext/index.js';
|
|
15
|
+
import { GlobalFilter } from '../GlobalFilter/GlobalFilter.js';
|
|
16
|
+
import { TableHeaderRow } from '../TableHeaderRow/TableHeaderRow.js';
|
|
17
|
+
import { TableHeaderCell } from '../TableHeaderCell/TableHeaderCell.js';
|
|
18
|
+
import { useColumnFilters } from '../../hooks/useColumnFilters.js';
|
|
19
|
+
import { useStagedColumnFilters } from '../../hooks/useStagedColumnFilters.js';
|
|
20
|
+
import { ColumnFilterChip } from '../ColumnFilterChip/ColumnFilterChip.js';
|
|
21
|
+
import { TableControlsContainer } from '../TableControlsContainer/TableControlsContainer.js';
|
|
22
|
+
import { ColumnFilterResetButton } from '../ColumnFilterResetButton/ColumnFilterResetButton.js';
|
|
23
|
+
import { coercedValueIncludesString } from '../../util/coercedValueIncludesString.js';
|
|
24
|
+
import { getTableMinHeight } from '../../util/getTableMinHeight.js';
|
|
25
|
+
|
|
26
|
+
var defaultTableProps = {
|
|
27
|
+
enableSortingRemoval: true,
|
|
28
|
+
fullWidth: true,
|
|
29
|
+
paginated: true,
|
|
30
|
+
sortable: false,
|
|
31
|
+
searchable: false,
|
|
32
|
+
};
|
|
33
|
+
var Table = function (props) {
|
|
34
|
+
var title = props.title, data = props.data, columns = props.columns, enableSortingRemoval = props.enableSortingRemoval, loading = props.loading, searchable = props.searchable, sortable = props.sortable, externalFilterState = props.filterState, externalGlobalFilterState = props.globalFilterState, externalPaginationState = props.paginationState, externalSortingState = props.sortingState, externalVisibilityState = props.visibilityState, paginated = props.paginated, pageCount = props.pageCount, GlobalFilterProps = props.GlobalFilterProps, Empty = props.Empty, idBase = props.idBase, stageFilterSelections = props.stageFilterSelections;
|
|
35
|
+
var classes = useStyles(props);
|
|
36
|
+
var rootRef = useRef(null);
|
|
37
|
+
// Prepare Empty State
|
|
38
|
+
var isEmpty = data.length === 0;
|
|
39
|
+
var isEmptyComponentValid = Empty && isValidElement(createElement(Empty));
|
|
40
|
+
// Prepare Sorting
|
|
41
|
+
var _a = externalSortingState || [], sorting = _a[0], setSorting = _a[1];
|
|
42
|
+
var isControlledColumnSort = Boolean(externalSortingState);
|
|
43
|
+
var controlledColumnSortOptions = { onSortingChange: setSorting, manualSorting: true };
|
|
44
|
+
// Prepare Global Filtering
|
|
45
|
+
var _b = externalGlobalFilterState || [], globalFilter = _b[0], setGlobalFilter = _b[1];
|
|
46
|
+
var isControlledGlobalFilter = Boolean(externalGlobalFilterState);
|
|
47
|
+
var controlledGlobalFilterOptions = { onGlobalFilterChange: setGlobalFilter, manualFiltering: true };
|
|
48
|
+
// Prepare ColumnFiltering
|
|
49
|
+
var _c = externalFilterState || [], columnFilters = _c[0], setColumnFilters = _c[1];
|
|
50
|
+
var isControlledColumnFilters = Boolean(externalFilterState);
|
|
51
|
+
var controlledColumnFiltersOptions = { onColumnFiltersChange: setColumnFilters, manualFiltering: true };
|
|
52
|
+
// Prepare Pagination
|
|
53
|
+
var _d = externalPaginationState || [], pagination = _d[0], setPagination = _d[1];
|
|
54
|
+
var isControlledPagination = Boolean(externalPaginationState && pageCount);
|
|
55
|
+
var controlledPaginationOptions = { manualPagination: true, onPaginationChange: setPagination, pageCount: pageCount };
|
|
56
|
+
// Prepare Column Visibility
|
|
57
|
+
var columnVisibility = (externalVisibilityState || [])[0];
|
|
58
|
+
var isControlledColumnVisibility = Boolean(externalVisibilityState);
|
|
59
|
+
// Init table instance
|
|
60
|
+
var table = useReactTable(__assign(__assign(__assign(__assign(__assign(__assign({ data: data, columns: columns, state: __assign(__assign(__assign(__assign(__assign({}, (isControlledPagination && { pagination: pagination })), (isControlledGlobalFilter && { globalFilter: globalFilter })), (isControlledColumnFilters && { columnFilters: columnFilters })), (isControlledColumnVisibility && { columnVisibility: columnVisibility })), (isControlledColumnSort && { sorting: sorting })), enableSorting: sortable, enableSortingRemoval: enableSortingRemoval, globalFilterFn: coercedValueIncludesString, getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), getFilteredRowModel: getFilteredRowModel() }, (paginated && { getPaginationRowModel: getPaginationRowModel() })), (isControlledPagination && controlledPaginationOptions)), (isControlledGlobalFilter && controlledGlobalFilterOptions)), (isControlledColumnFilters && controlledColumnFiltersOptions)), (isControlledColumnSort && controlledColumnSortOptions)), { meta: { idBase: idBase } }));
|
|
61
|
+
var _f = useColumnFilters(table), selectedColumnFilters = _f.selectedColumnFilters, hasColumnFilters = _f.hasColumnFilters, deselectColumnFilter = _f.deselectColumnFilter, formatSelectedFilterText = _f.formatSelectedFilterText, resetColumnFilters = _f.resetColumnFilters;
|
|
62
|
+
// stagedColumnFilters is only used when stageFilterSelections is enabled
|
|
63
|
+
var stagedColumnFilters = useStagedColumnFilters(selectedColumnFilters);
|
|
64
|
+
var handlePagination = function (_e, pageNumber) {
|
|
65
|
+
var pageIndex = pageNumber - 1;
|
|
66
|
+
table.setPageIndex(pageIndex);
|
|
67
|
+
};
|
|
68
|
+
var showTitle = Boolean(title);
|
|
69
|
+
var showGlobalSearch = Boolean(searchable || isControlledGlobalFilter);
|
|
70
|
+
var showColumnFilter = Boolean(hasColumnFilters);
|
|
71
|
+
var showControls = Boolean(showTitle || showGlobalSearch || showColumnFilter);
|
|
72
|
+
return (React.createElement(TableContext.Provider, { value: { table: table, stagedColumnFilters: stagedColumnFilters, stageFilterSelections: stageFilterSelections } },
|
|
73
|
+
React.createElement(Box, __assign({ className: classes.root }, { ref: rootRef }, { "data-table-element": "root" }, (table.getPageCount() > 1 && {
|
|
74
|
+
minHeight: getTableMinHeight(rootRef, table.getState().pagination.pageSize),
|
|
75
|
+
})),
|
|
76
|
+
showControls && (React.createElement(Box, null,
|
|
77
|
+
React.createElement(TableControlsContainer, { showTitle: showTitle, showGlobalSearch: showGlobalSearch, showColumnFilter: showColumnFilter },
|
|
78
|
+
showTitle && (React.createElement(Typography, { style: { gridArea: 'title', alignSelf: 'center', fontSize: '18px', lineHeight: '27px' } }, title)),
|
|
79
|
+
showGlobalSearch && (React.createElement(GlobalFilter, __assign({}, GlobalFilterProps, { value: table.getState().globalFilter, setValue: table.setGlobalFilter }))),
|
|
80
|
+
showColumnFilter && React.createElement(FilterPanel, null)),
|
|
81
|
+
React.createElement(Box, { display: "flex", flexWrap: "wrap", gridGap: 8 },
|
|
82
|
+
selectedColumnFilters.map(function (selectedColumnFilter, i) { return (React.createElement(ColumnFilterChip, { key: "selected-column-filter-chip-" + i, columnFilter: selectedColumnFilter, label: formatSelectedFilterText(selectedColumnFilter), onClick: function (columnFilter) {
|
|
83
|
+
if (stageFilterSelections) {
|
|
84
|
+
stagedColumnFilters.delete(columnFilter);
|
|
85
|
+
}
|
|
86
|
+
deselectColumnFilter(columnFilter);
|
|
87
|
+
} })); }),
|
|
88
|
+
selectedColumnFilters.length >= 1 && (React.createElement(ColumnFilterResetButton, { onClick: function () {
|
|
89
|
+
if (stageFilterSelections) {
|
|
90
|
+
stagedColumnFilters.clear();
|
|
91
|
+
}
|
|
92
|
+
resetColumnFilters();
|
|
93
|
+
} }))))),
|
|
94
|
+
React.createElement(Box, { className: classes.tableContainer, flexGrow: loading || isEmpty ? 0 : 1 },
|
|
95
|
+
React.createElement("table", { className: classes.table },
|
|
96
|
+
React.createElement(TableHeader, null, table.getHeaderGroups().map(function (headerGroup) { return (React.createElement(TableHeaderRow, { key: headerGroup.id }, headerGroup.headers.map(function (header) { return (React.createElement(TableHeaderCell, { key: header.id, context: header.getContext() }, flexRender(header.column.columnDef.header, header.getContext()))); }))); })),
|
|
97
|
+
!loading && (React.createElement(TableBody, null, table.getRowModel().rows.map(function (row) { return (React.createElement(TableRow, { key: row.id }, row.getVisibleCells().map(function (cell) { return (React.createElement(TableCell, { key: cell.id }, flexRender(cell.column.columnDef.cell, cell.getContext()))); }))); }))))),
|
|
98
|
+
isEmpty && isEmptyComponentValid && Empty && !loading && (React.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 }, createElement(Empty))),
|
|
99
|
+
loading && (React.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 },
|
|
100
|
+
React.createElement(CircularProgress, { size: 80, color: "inherit" }))),
|
|
101
|
+
paginated && table.getPageCount() > 1 && (React.createElement(TableFooter, null,
|
|
102
|
+
React.createElement(Pagination, { page: table.getState().pagination.pageIndex + 1, count: table.getPageCount(), onChange: handlePagination, disabled: loading }))))));
|
|
103
|
+
};
|
|
104
|
+
Table.defaultProps = defaultTableProps;
|
|
105
|
+
|
|
106
|
+
export { Table };
|
|
107
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../../src/components/Table/Table.tsx"],"sourcesContent":["import React, { ChangeEvent, createElement, isValidElement, useRef } from 'react'\nimport { Typography } from '@material-ui/core'\nimport { Pagination } from '@material-ui/lab'\nimport { Box, CircularProgress } from '@popmenu/common-ui'\nimport {\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n ColumnFilter as ReactTableColumnFilter,\n ColumnFilter,\n} from '@tanstack/react-table'\n\nimport { TableRow } from '../TableRow'\nimport { TableCell } from '../TableCell'\nimport { TableBody } from '../TableBody'\nimport { useStyles } from './TableStyles'\nimport { TableProps } from './TableProps'\nimport { TableHeader } from '../TableHeader'\nimport { TableFooter } from '../TableFooter'\nimport { FilterPanel } from '../FilterPanel'\nimport { TableContext } from '../TableContext'\nimport { GlobalFilter } from '../GlobalFilter'\nimport { TableHeaderRow } from '../TableHeaderRow'\nimport { TableHeaderCell } from '../TableHeaderCell'\nimport { useColumnFilters, useStagedColumnFilters } from '../../hooks'\nimport { ColumnFilterChip } from '../ColumnFilterChip'\nimport { TableControlsContainer } from '../TableControlsContainer'\nimport { ColumnFilterResetButton } from '../ColumnFilterResetButton'\nimport { coercedValueIncludesString, getTableMinHeight } from '../../util'\n\nconst defaultTableProps = {\n enableSortingRemoval: true,\n fullWidth: true,\n paginated: true,\n sortable: false,\n searchable: false,\n}\n\ntype DefaultTableProps<T> = TableProps<T> & typeof defaultTableProps\n\nexport const Table = <T,>(props: DefaultTableProps<T>) => {\n const {\n title,\n data,\n columns,\n enableSortingRemoval,\n loading,\n searchable,\n sortable,\n filterState: externalFilterState,\n globalFilterState: externalGlobalFilterState,\n paginationState: externalPaginationState,\n sortingState: externalSortingState,\n visibilityState: externalVisibilityState,\n paginated,\n pageCount,\n GlobalFilterProps,\n Empty,\n idBase,\n stageFilterSelections,\n } = props\n const classes = useStyles(props)\n const rootRef = useRef<HTMLDivElement>(null)\n\n // Prepare Empty State\n const isEmpty = data.length === 0\n const isEmptyComponentValid = Empty && isValidElement(createElement(Empty))\n\n // Prepare Sorting\n const [sorting, setSorting] = externalSortingState || []\n const isControlledColumnSort = Boolean(externalSortingState)\n const controlledColumnSortOptions = { onSortingChange: setSorting, manualSorting: true }\n\n // Prepare Global Filtering\n const [globalFilter, setGlobalFilter] = externalGlobalFilterState || []\n const isControlledGlobalFilter = Boolean(externalGlobalFilterState)\n const controlledGlobalFilterOptions = { onGlobalFilterChange: setGlobalFilter, manualFiltering: true }\n\n // Prepare ColumnFiltering\n const [columnFilters, setColumnFilters] = externalFilterState || []\n const isControlledColumnFilters = Boolean(externalFilterState)\n const controlledColumnFiltersOptions = { onColumnFiltersChange: setColumnFilters, manualFiltering: true }\n\n // Prepare Pagination\n const [pagination, setPagination] = externalPaginationState || []\n const isControlledPagination = Boolean(externalPaginationState && pageCount)\n const controlledPaginationOptions = { manualPagination: true, onPaginationChange: setPagination, pageCount }\n\n // Prepare Column Visibility\n const [columnVisibility] = externalVisibilityState || []\n const isControlledColumnVisibility = Boolean(externalVisibilityState)\n\n // Init table instance\n const table = useReactTable({\n data,\n columns,\n state: {\n ...(isControlledPagination && { pagination }),\n ...(isControlledGlobalFilter && { globalFilter }),\n ...(isControlledColumnFilters && { columnFilters }),\n ...(isControlledColumnVisibility && { columnVisibility }),\n ...(isControlledColumnSort && { sorting }),\n },\n enableSorting: sortable,\n enableSortingRemoval,\n globalFilterFn: coercedValueIncludesString,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n ...(paginated && { getPaginationRowModel: getPaginationRowModel() }),\n ...(isControlledPagination && controlledPaginationOptions),\n ...(isControlledGlobalFilter && controlledGlobalFilterOptions),\n ...(isControlledColumnFilters && controlledColumnFiltersOptions),\n ...(isControlledColumnSort && controlledColumnSortOptions),\n meta: { idBase: idBase },\n })\n\n const {\n selectedColumnFilters,\n hasColumnFilters,\n deselectColumnFilter,\n formatSelectedFilterText,\n resetColumnFilters,\n } = useColumnFilters(table)\n\n // stagedColumnFilters is only used when stageFilterSelections is enabled\n const stagedColumnFilters = useStagedColumnFilters(selectedColumnFilters)\n\n const handlePagination = (_e: ChangeEvent, pageNumber: number) => {\n const pageIndex = pageNumber - 1\n table.setPageIndex(pageIndex)\n }\n const showTitle = Boolean(title)\n const showGlobalSearch = Boolean(searchable || isControlledGlobalFilter)\n const showColumnFilter = Boolean(hasColumnFilters)\n const showControls = Boolean(showTitle || showGlobalSearch || showColumnFilter)\n\n return (\n <TableContext.Provider value={{ table, stagedColumnFilters, stageFilterSelections }}>\n <Box\n className={classes.root}\n {...{ ref: rootRef }}\n data-table-element=\"root\"\n {...(table.getPageCount() > 1 && {\n minHeight: getTableMinHeight(rootRef, table.getState().pagination.pageSize),\n })}\n >\n {showControls && (\n <Box>\n <TableControlsContainer\n showTitle={showTitle}\n showGlobalSearch={showGlobalSearch}\n showColumnFilter={showColumnFilter}\n >\n {showTitle && (\n <Typography style={{ gridArea: 'title', alignSelf: 'center', fontSize: '18px', lineHeight: '27px' }}>\n {title}\n </Typography>\n )}\n {showGlobalSearch && (\n <GlobalFilter\n {...GlobalFilterProps}\n value={table.getState().globalFilter}\n setValue={table.setGlobalFilter}\n />\n )}\n {showColumnFilter && <FilterPanel />}\n </TableControlsContainer>\n <Box display=\"flex\" flexWrap=\"wrap\" gridGap={8}>\n {selectedColumnFilters.map((selectedColumnFilter: ReactTableColumnFilter, i) => (\n <ColumnFilterChip\n key={`selected-column-filter-chip-${i}`}\n columnFilter={selectedColumnFilter}\n label={formatSelectedFilterText(selectedColumnFilter)}\n onClick={(columnFilter: ColumnFilter) => {\n if (stageFilterSelections) {\n stagedColumnFilters.delete(columnFilter)\n }\n deselectColumnFilter(columnFilter)\n }}\n />\n ))}\n {selectedColumnFilters.length >= 1 && (\n <ColumnFilterResetButton\n onClick={() => {\n if (stageFilterSelections) {\n stagedColumnFilters.clear()\n }\n resetColumnFilters()\n }}\n />\n )}\n </Box>\n </Box>\n )}\n <Box className={classes.tableContainer} flexGrow={loading || isEmpty ? 0 : 1}>\n <table className={classes.table}>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableHeaderRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHeaderCell key={header.id} context={header.getContext()}>\n {flexRender(header.column.columnDef.header, header.getContext())}\n </TableHeaderCell>\n ))}\n </TableHeaderRow>\n ))}\n </TableHeader>\n {!loading && (\n <TableBody>\n {table.getRowModel().rows.map((row) => (\n <TableRow key={row.id}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n )}\n </table>\n </Box>\n {isEmpty && isEmptyComponentValid && Empty && !loading && (\n <Box display=\"flex\" flexDirection=\"column\" justifyContent=\"center\" alignItems=\"center\" p={2} flexGrow={1}>\n {createElement(Empty)}\n </Box>\n )}\n {loading && (\n <Box display=\"flex\" flexDirection=\"column\" justifyContent=\"center\" alignItems=\"center\" p={2} flexGrow={1}>\n <CircularProgress size={80} color=\"inherit\" />\n </Box>\n )}\n {paginated && table.getPageCount() > 1 && (\n <TableFooter>\n <Pagination\n page={table.getState().pagination.pageIndex + 1}\n count={table.getPageCount()}\n onChange={handlePagination}\n disabled={loading}\n />\n </TableFooter>\n )}\n </Box>\n </TableContext.Provider>\n )\n}\n\nTable.defaultProps = defaultTableProps\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,iBAAiB,GAAG;AACxB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,UAAU,EAAE,KAAK;CAClB;AAIM,IAAM,KAAK,GAAG,UAAK,KAA2B,EAAA;AAEjD,IAAA,IAAA,KAAK,GAkBH,KAAK,MAlBF,EACL,IAAI,GAiBF,KAAK,CAAA,IAjBH,EACJ,OAAO,GAgBL,KAAK,CAhBA,OAAA,EACP,oBAAoB,GAelB,KAAK,qBAfa,EACpB,OAAO,GAcL,KAAK,QAdA,EACP,UAAU,GAaR,KAAK,CAAA,UAbG,EACV,QAAQ,G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AE,KAAK,EAAC,SAAS,EAAG,CAAA,CAC1C,CACP;YACA,SAAS,IAAI,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,KACpC,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,IAAA;AACV,gBAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,SAAS,GAAG,CAAC,EAC/C,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,EAC3B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,OAAO,GACjB,CACU,CACf,CACG,CACgB;AAE5B;AAEA,KAAK,CAAC,YAAY,GAAG,iBAAiB;;;;"}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { TextFieldProps } from '@material-ui/core';
|
|
2
|
-
import { ColumnDef, ColumnFiltersState, PaginationState, SortingState } from '@tanstack/react-table';
|
|
3
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
4
|
-
export interface ColumnFilter {
|
|
5
|
-
id: string;
|
|
6
|
-
value: unknown;
|
|
7
|
-
}
|
|
8
|
-
export interface TableProps<T = unknown> {
|
|
9
|
-
/** The table's title. */
|
|
10
|
-
title?: string;
|
|
11
|
-
/** List of objects representing the rows of a Table. */
|
|
12
|
-
data: Array<T>;
|
|
13
|
-
/** List of column definitions. */
|
|
14
|
-
columns: Array<ColumnDef<T, any>>;
|
|
15
|
-
/** Change column sorting change pattern - true: 'none' -> 'desc' -> 'asc' -> 'none' -> ..., false: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... */
|
|
16
|
-
enableSortingRemoval?: boolean;
|
|
17
|
-
/** Controls table loading state. */
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
/** Forces a table to take up the width of its container when true. */
|
|
20
|
-
fullWidth?: boolean;
|
|
21
|
-
/** Adds a global filter to the table. for uncontrolled global filtering only. */
|
|
22
|
-
searchable?: boolean;
|
|
23
|
-
/** Makes columns sortable. For uncontrolled sorting only. */
|
|
24
|
-
sortable?: boolean;
|
|
25
|
-
/** Enables and disables pagination all together for the table. */
|
|
26
|
-
paginated?: boolean;
|
|
27
|
-
/** Sorting state. Expects the result of a React useState hook. Used only for manual sorting. */
|
|
28
|
-
sortingState?: [SortingState, Dispatch<SetStateAction<SortingState>>];
|
|
29
|
-
/** Pagination state. Expects the result of a React useState hook. Used only for manual pagination. */
|
|
30
|
-
paginationState?: [PaginationState, Dispatch<SetStateAction<PaginationState>>];
|
|
31
|
-
/** GlobalFiltering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
32
|
-
globalFilterState?: [string, Dispatch<SetStateAction<string>>];
|
|
33
|
-
/** Props applied to the TextField for global filtering. */
|
|
34
|
-
GlobalFilterProps?: TextFieldProps;
|
|
35
|
-
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
36
|
-
filterState?: [ColumnFiltersState, Dispatch<SetStateAction<Array<ColumnFilter>>>];
|
|
37
|
-
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
38
|
-
visibilityState?: [Record<string, boolean>, Dispatch<SetStateAction<Record<string, boolean>>>];
|
|
39
|
-
/** Number of pages. Used only for manual pagination. */
|
|
40
|
-
pageCount?: number;
|
|
41
|
-
/** A React Component to be rendered when the data set is empty. */
|
|
42
|
-
Empty?: () => JSX.Element;
|
|
43
|
-
/** A string used to construct ids and tags used throughout the table for tagging inner elements. ie: data-tour-id. */
|
|
44
|
-
idBase?: string;
|
|
45
|
-
/** Controls which filter should be used for the application, automatic or manual. */
|
|
46
|
-
stageFilterSelections?: boolean;
|
|
47
|
-
}
|
|
1
|
+
import { TextFieldProps } from '@material-ui/core';
|
|
2
|
+
import { ColumnDef, ColumnFiltersState, PaginationState, SortingState } from '@tanstack/react-table';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
|
+
export interface ColumnFilter {
|
|
5
|
+
id: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface TableProps<T = unknown> {
|
|
9
|
+
/** The table's title. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** List of objects representing the rows of a Table. */
|
|
12
|
+
data: Array<T>;
|
|
13
|
+
/** List of column definitions. */
|
|
14
|
+
columns: Array<ColumnDef<T, any>>;
|
|
15
|
+
/** Change column sorting change pattern - true: 'none' -> 'desc' -> 'asc' -> 'none' -> ..., false: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... */
|
|
16
|
+
enableSortingRemoval?: boolean;
|
|
17
|
+
/** Controls table loading state. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/** Forces a table to take up the width of its container when true. */
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
/** Adds a global filter to the table. for uncontrolled global filtering only. */
|
|
22
|
+
searchable?: boolean;
|
|
23
|
+
/** Makes columns sortable. For uncontrolled sorting only. */
|
|
24
|
+
sortable?: boolean;
|
|
25
|
+
/** Enables and disables pagination all together for the table. */
|
|
26
|
+
paginated?: boolean;
|
|
27
|
+
/** Sorting state. Expects the result of a React useState hook. Used only for manual sorting. */
|
|
28
|
+
sortingState?: [SortingState, Dispatch<SetStateAction<SortingState>>];
|
|
29
|
+
/** Pagination state. Expects the result of a React useState hook. Used only for manual pagination. */
|
|
30
|
+
paginationState?: [PaginationState, Dispatch<SetStateAction<PaginationState>>];
|
|
31
|
+
/** GlobalFiltering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
32
|
+
globalFilterState?: [string, Dispatch<SetStateAction<string>>];
|
|
33
|
+
/** Props applied to the TextField for global filtering. */
|
|
34
|
+
GlobalFilterProps?: TextFieldProps;
|
|
35
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
36
|
+
filterState?: [ColumnFiltersState, Dispatch<SetStateAction<Array<ColumnFilter>>>];
|
|
37
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
38
|
+
visibilityState?: [Record<string, boolean>, Dispatch<SetStateAction<Record<string, boolean>>>];
|
|
39
|
+
/** Number of pages. Used only for manual pagination. */
|
|
40
|
+
pageCount?: number;
|
|
41
|
+
/** A React Component to be rendered when the data set is empty. */
|
|
42
|
+
Empty?: () => JSX.Element;
|
|
43
|
+
/** A string used to construct ids and tags used throughout the table for tagging inner elements. ie: data-tour-id. */
|
|
44
|
+
idBase?: string;
|
|
45
|
+
/** Controls which filter should be used for the application, automatic or manual. */
|
|
46
|
+
stageFilterSelections?: boolean;
|
|
47
|
+
}
|