material-react-table 0.4.7 → 0.4.8
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/MaterialReactTable.d.ts +65 -21
- package/dist/body/MRT_TableBodyCell.d.ts +2 -2
- package/dist/body/MRT_TableBodyRow.d.ts +2 -2
- package/dist/body/MRT_TableDetailPanel.d.ts +2 -2
- package/dist/buttons/MRT_EditActionButtons.d.ts +2 -2
- package/dist/buttons/MRT_ExpandButton.d.ts +2 -2
- package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +2 -2
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -2
- package/dist/footer/MRT_TableFooterCell.d.ts +2 -2
- package/dist/footer/MRT_TableFooterRow.d.ts +2 -2
- package/dist/head/MRT_TableHeadCell.d.ts +2 -2
- package/dist/head/MRT_TableHeadRow.d.ts +2 -2
- package/dist/inputs/MRT_EditCellTextField.d.ts +2 -2
- package/dist/inputs/MRT_FilterTextField.d.ts +2 -2
- package/dist/inputs/MRT_SelectCheckbox.d.ts +2 -2
- package/dist/material-react-table.cjs.development.js +11 -11
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +11 -11
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +2 -2
- package/dist/menus/MRT_RowActionMenu.d.ts +2 -2
- package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +2 -2
- package/dist/useMRT.d.ts +4 -4
- package/package.json +1 -1
- package/src/@types/react-table-config.d.ts +18 -121
- package/src/MaterialReactTable.tsx +179 -20
- package/src/body/MRT_TableBody.tsx +2 -1
- package/src/body/MRT_TableBodyCell.tsx +2 -2
- package/src/body/MRT_TableBodyRow.tsx +3 -3
- package/src/body/MRT_TableDetailPanel.tsx +3 -3
- package/src/buttons/MRT_EditActionButtons.tsx +2 -2
- package/src/buttons/MRT_ExpandButton.tsx +2 -2
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +2 -1
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +2 -2
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +2 -2
- package/src/footer/MRT_TableFooter.tsx +2 -1
- package/src/footer/MRT_TableFooterCell.tsx +2 -2
- package/src/footer/MRT_TableFooterRow.tsx +3 -3
- package/src/head/MRT_TableHead.tsx +2 -1
- package/src/head/MRT_TableHeadCell.tsx +2 -2
- package/src/head/MRT_TableHeadRow.tsx +3 -3
- package/src/index.tsx +2 -0
- package/src/inputs/MRT_EditCellTextField.tsx +2 -2
- package/src/inputs/MRT_FilterTextField.tsx +3 -2
- package/src/inputs/MRT_SelectCheckbox.tsx +2 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +2 -2
- package/src/menus/MRT_RowActionMenu.tsx +2 -2
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +3 -2
- package/src/useMRT.tsx +18 -15
|
@@ -98,17 +98,19 @@ var MaterialReactTableContext = /*#__PURE__*/function () {
|
|
|
98
98
|
}();
|
|
99
99
|
|
|
100
100
|
var MaterialReactTableProvider = function MaterialReactTableProvider(props) {
|
|
101
|
-
var _props$
|
|
101
|
+
var _props$initialState$d, _props$initialState, _props$initialState$f, _props$initialState2, _props$initialState$s, _props$initialState3, _props$initialState$s2, _props$initialState4;
|
|
102
102
|
|
|
103
103
|
var hooks = [useFilters, useGlobalFilter, useGroupBy, useSortBy, useExpanded, usePagination, useRowSelect];
|
|
104
104
|
if (props.enableColumnResizing) hooks.unshift(useResizeColumns, useFlexLayout);
|
|
105
105
|
var tableInstance = useTable.apply(void 0, [props].concat(hooks));
|
|
106
|
-
var anyRowsCanExpand = useMemo(
|
|
106
|
+
var anyRowsCanExpand = useMemo( // @ts-ignore
|
|
107
|
+
function () {
|
|
107
108
|
return tableInstance.rows.some(function (row) {
|
|
108
109
|
return row.canExpand;
|
|
109
110
|
});
|
|
110
111
|
}, [tableInstance.rows]);
|
|
111
|
-
var anyRowsExpanded = useMemo(
|
|
112
|
+
var anyRowsExpanded = useMemo( // @ts-ignore
|
|
113
|
+
function () {
|
|
112
114
|
return tableInstance.rows.some(function (row) {
|
|
113
115
|
return row.isExpanded;
|
|
114
116
|
});
|
|
@@ -118,19 +120,19 @@ var MaterialReactTableProvider = function MaterialReactTableProvider(props) {
|
|
|
118
120
|
currentEditingRow = _useState[0],
|
|
119
121
|
setCurrentEditingRow = _useState[1];
|
|
120
122
|
|
|
121
|
-
var _useState2 = useState((_props$
|
|
123
|
+
var _useState2 = useState((_props$initialState$d = (_props$initialState = props.initialState) == null ? void 0 : _props$initialState.densePadding) != null ? _props$initialState$d : false),
|
|
122
124
|
densePadding = _useState2[0],
|
|
123
125
|
setDensePadding = _useState2[1];
|
|
124
126
|
|
|
125
|
-
var _useState3 = useState((_props$
|
|
127
|
+
var _useState3 = useState((_props$initialState$f = (_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.fullScreen) != null ? _props$initialState$f : false),
|
|
126
128
|
fullScreen = _useState3[0],
|
|
127
129
|
setFullScreen = _useState3[1];
|
|
128
130
|
|
|
129
|
-
var _useState4 = useState((_props$
|
|
131
|
+
var _useState4 = useState((_props$initialState$s = (_props$initialState3 = props.initialState) == null ? void 0 : _props$initialState3.showFilters) != null ? _props$initialState$s : false),
|
|
130
132
|
showFilters = _useState4[0],
|
|
131
133
|
setShowFilters = _useState4[1];
|
|
132
134
|
|
|
133
|
-
var _useState5 = useState((_props$
|
|
135
|
+
var _useState5 = useState((_props$initialState$s2 = (_props$initialState4 = props.initialState) == null ? void 0 : _props$initialState4.showSearchTextField) != null ? _props$initialState$s2 : false),
|
|
134
136
|
showSearch = _useState5[0],
|
|
135
137
|
setShowSearch = _useState5[1];
|
|
136
138
|
|
|
@@ -154,7 +156,7 @@ var MaterialReactTableProvider = function MaterialReactTableProvider(props) {
|
|
|
154
156
|
}, props.children);
|
|
155
157
|
};
|
|
156
158
|
var useMRT = function useMRT() {
|
|
157
|
-
return (
|
|
159
|
+
return (// @ts-ignore
|
|
158
160
|
useContext(MaterialReactTableContext)
|
|
159
161
|
);
|
|
160
162
|
};
|
|
@@ -753,9 +755,7 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref2) {
|
|
|
753
755
|
});
|
|
754
756
|
|
|
755
757
|
var tableCellProps = muiTableDetailPanelProps instanceof Function ? muiTableDetailPanelProps(row) : muiTableDetailPanelProps;
|
|
756
|
-
return React.createElement(TableRow$1, Object.assign({
|
|
757
|
-
hover: true
|
|
758
|
-
}, tableRowProps), React.createElement(TableCell, Object.assign({
|
|
758
|
+
return React.createElement(TableRow$1, Object.assign({}, tableRowProps), React.createElement(TableCell, Object.assign({
|
|
759
759
|
colSpan: tableInstance.visibleColumns.length + 10,
|
|
760
760
|
isExpanded: row.isExpanded,
|
|
761
761
|
onClick: function onClick(event) {
|