@dooherceg/material-react-table 3.2.10 → 3.2.11
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 +3 -0
- package/dist/index.esm.js +7 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1292,6 +1292,9 @@ interface MRT_TableOptions<TData extends MRT_RowData> extends Omit<Partial<Table
|
|
|
1292
1292
|
table: MRT_TableInstance<TData>;
|
|
1293
1293
|
}) => BoxProps) | BoxProps;
|
|
1294
1294
|
muiNewEntryModalProps?: MRT_NewEntryModalOverrides;
|
|
1295
|
+
newEntryButtonProps?: ((props: {
|
|
1296
|
+
table: MRT_TableInstance<TData>;
|
|
1297
|
+
}) => ButtonProps) | ButtonProps;
|
|
1295
1298
|
formConfig?: MRT_FormConfig<TData>;
|
|
1296
1299
|
onActionCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
|
|
1297
1300
|
onColumnFilterFnsChange?: OnChangeFn<{
|
package/dist/index.esm.js
CHANGED
|
@@ -6319,15 +6319,19 @@ const MRT_SavedFiltersButton = ({ onSelectFilter, table, }) => {
|
|
|
6319
6319
|
};
|
|
6320
6320
|
|
|
6321
6321
|
const MRT_NewEntryButton = (_a) => {
|
|
6322
|
-
var _b;
|
|
6322
|
+
var _b, _c;
|
|
6323
6323
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
6324
|
-
const { options: { icons: { AddIcon }, localization, }, setNewEntryModal, } = table;
|
|
6324
|
+
const { options: { icons: { AddIcon }, localization, newEntryButtonProps, }, setNewEntryModal, } = table;
|
|
6325
6325
|
const handleOpenNewEntryModal = (event) => {
|
|
6326
6326
|
// Prevent bubbling to muiTableBodyRowProps onClick (row click handlers)
|
|
6327
6327
|
event.stopPropagation();
|
|
6328
6328
|
setNewEntryModal({ open: true });
|
|
6329
6329
|
};
|
|
6330
|
-
|
|
6330
|
+
// When the consumer supplies onClick via newEntryButtonProps (or rest), it fully
|
|
6331
|
+
// replaces handleOpenNewEntryModal below — matches the override convention used by
|
|
6332
|
+
// every other mui*ButtonProps option in this codebase.
|
|
6333
|
+
const buttonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(newEntryButtonProps, { table })), rest);
|
|
6334
|
+
return (jsx(Tooltip, { title: (_b = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _b !== void 0 ? _b : localization.newEntry, children: jsx(Button, Object.assign({ "aria-label": localization.newEntry, onClick: handleOpenNewEntryModal, size: "small", startIcon: jsx(AddIcon, { fontSize: "small" }), variant: "text" }, buttonProps, { title: undefined, children: (_c = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.children) !== null && _c !== void 0 ? _c : localization.newEntry })) }));
|
|
6331
6335
|
};
|
|
6332
6336
|
|
|
6333
6337
|
const MRT_ShowHideColumnsMenuItems = (_a) => {
|