material-react-table 0.38.0 → 0.38.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/README.md +2 -1
- package/dist/cjs/MaterialReactTable.d.ts +2 -2
- package/dist/cjs/index.js +5 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/MaterialReactTable.d.ts +2 -2
- package/dist/esm/material-react-table.esm.js +5 -2
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/MaterialReactTable.tsx +2 -2
- package/src/inputs/MRT_EditCellTextField.tsx +11 -2
- package/src/inputs/MRT_FilterTextField.tsx +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ See all [Props and Options](https://www.material-react-table.com/docs/api)
|
|
|
43
43
|
- [Basic Table](https://www.material-react-table.com/docs/examples/basic/) (See Default Features)
|
|
44
44
|
- [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features)
|
|
45
45
|
- [Advanced Table](https://www.material-react-table.com/docs/examples/advanced/) (See some of the Advanced Features)
|
|
46
|
+
- [Aggregation/Grouping](https://www.material-react-table.com/docs/examples/aggregation-and-grouping/) (Aggregation features such as Sum, Average, Count, etc.)
|
|
46
47
|
- [Data Export Table](https://www.material-react-table.com/docs/examples/data-export/) (Export to CSV, Excel, etc.)
|
|
47
48
|
- [Editing CRUD Table](https://www.material-react-table.com/docs/examples/editing-crud/) (Create, Edit, and Delete Rows)
|
|
48
49
|
- [Remote Data](https://www.material-react-table.com/docs/examples/remote/) (Server-side Pagination, Sorting, and Filtering)
|
|
@@ -60,9 +61,9 @@ _All features can easily be enabled/disabled_
|
|
|
60
61
|
|
|
61
62
|
- [x] < 37kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
|
|
62
63
|
- [x] Advanced TypeScript Generics Support (TypeScript Optional)
|
|
64
|
+
- [x] Aggregation and Grouping (Sum, Average, Count, etc.)
|
|
63
65
|
- [x] Click To Copy Cell Values
|
|
64
66
|
- [x] Column Action Dropdown Menu
|
|
65
|
-
- [x] Column/Row Grouping (Group By and Aggregates)
|
|
66
67
|
- [x] Column Hiding
|
|
67
68
|
- [x] Column Ordering via Drag'n'Drop
|
|
68
69
|
- [x] Column Pinning (Freeze Columns)
|
|
@@ -48,8 +48,8 @@ export declare type MRT_TableInstance<TData extends Record<string, any> = {}> =
|
|
|
48
48
|
setDensity: Dispatch<SetStateAction<'comfortable' | 'compact' | 'spacious'>>;
|
|
49
49
|
setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
|
|
50
50
|
setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
|
|
51
|
-
setEditingCell: Dispatch<SetStateAction<MRT_Cell | null>>;
|
|
52
|
-
setEditingRow: Dispatch<SetStateAction<MRT_Row | null>>;
|
|
51
|
+
setEditingCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
|
|
52
|
+
setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
|
|
53
53
|
setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
|
|
54
54
|
setHoveredColumn: Dispatch<SetStateAction<MRT_Column<TData> | {
|
|
55
55
|
id: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1452,7 +1452,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1452
1452
|
if (textFieldProps.inputRef) {
|
|
1453
1453
|
textFieldProps.inputRef = inputRef;
|
|
1454
1454
|
}
|
|
1455
|
-
}, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '
|
|
1455
|
+
}, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '150px' : 'auto', width: '100%', '& .MuiSelect-icon': {
|
|
1456
1456
|
mr: '1.5rem',
|
|
1457
1457
|
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
|
1458
1458
|
? textFieldProps.sx(theme)
|
|
@@ -1785,6 +1785,9 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
|
1785
1785
|
var _a;
|
|
1786
1786
|
(_a = textFieldProps.onChange) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
|
|
1787
1787
|
setValue(event.target.value);
|
|
1788
|
+
if ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.select) && editingRow) {
|
|
1789
|
+
setEditingRow(Object.assign(Object.assign({}, editingRow), { _valuesCache: Object.assign(Object.assign({}, editingRow._valuesCache), { [column.id]: event.target.value }) }));
|
|
1790
|
+
}
|
|
1788
1791
|
};
|
|
1789
1792
|
const handleBlur = (event) => {
|
|
1790
1793
|
var _a;
|
|
@@ -1797,7 +1800,7 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
|
1797
1800
|
if (columnDef.Edit) {
|
|
1798
1801
|
return React__default["default"].createElement(React__default["default"].Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }));
|
|
1799
1802
|
}
|
|
1800
|
-
return (React__default["default"].createElement(material.TextField, Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, label: showLabel ? column.columnDef.header : undefined, margin: "none", name:
|
|
1803
|
+
return (React__default["default"].createElement(material.TextField, Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, label: showLabel ? column.columnDef.header : undefined, margin: "none", name: column.id, onClick: (e) => e.stopPropagation(), placeholder: columnDef.header, value: value, variant: "standard" }, textFieldProps, { inputRef: (inputRef) => {
|
|
1801
1804
|
if (inputRef) {
|
|
1802
1805
|
editInputRefs.current[column.id] = inputRef;
|
|
1803
1806
|
if (textFieldProps.inputRef) {
|