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
|
@@ -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;
|
|
@@ -1444,7 +1444,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1444
1444
|
if (textFieldProps.inputRef) {
|
|
1445
1445
|
textFieldProps.inputRef = inputRef;
|
|
1446
1446
|
}
|
|
1447
|
-
}, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '
|
|
1447
|
+
}, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '150px' : 'auto', width: '100%', '& .MuiSelect-icon': {
|
|
1448
1448
|
mr: '1.5rem',
|
|
1449
1449
|
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
|
1450
1450
|
? textFieldProps.sx(theme)
|
|
@@ -1777,6 +1777,9 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
|
1777
1777
|
var _a;
|
|
1778
1778
|
(_a = textFieldProps.onChange) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
|
|
1779
1779
|
setValue(event.target.value);
|
|
1780
|
+
if ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.select) && editingRow) {
|
|
1781
|
+
setEditingRow(Object.assign(Object.assign({}, editingRow), { _valuesCache: Object.assign(Object.assign({}, editingRow._valuesCache), { [column.id]: event.target.value }) }));
|
|
1782
|
+
}
|
|
1780
1783
|
};
|
|
1781
1784
|
const handleBlur = (event) => {
|
|
1782
1785
|
var _a;
|
|
@@ -1789,7 +1792,7 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
|
1789
1792
|
if (columnDef.Edit) {
|
|
1790
1793
|
return React.createElement(React.Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }));
|
|
1791
1794
|
}
|
|
1792
|
-
return (React.createElement(TextField, Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, label: showLabel ? column.columnDef.header : undefined, margin: "none", name:
|
|
1795
|
+
return (React.createElement(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) => {
|
|
1793
1796
|
if (inputRef) {
|
|
1794
1797
|
editInputRefs.current[column.id] = inputRef;
|
|
1795
1798
|
if (textFieldProps.inputRef) {
|