@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.js CHANGED
@@ -6321,15 +6321,19 @@ const MRT_SavedFiltersButton = ({ onSelectFilter, table, }) => {
6321
6321
  };
6322
6322
 
6323
6323
  const MRT_NewEntryButton = (_a) => {
6324
- var _b;
6324
+ var _b, _c;
6325
6325
  var { table } = _a, rest = __rest(_a, ["table"]);
6326
- const { options: { icons: { AddIcon }, localization, }, setNewEntryModal, } = table;
6326
+ const { options: { icons: { AddIcon }, localization, newEntryButtonProps, }, setNewEntryModal, } = table;
6327
6327
  const handleOpenNewEntryModal = (event) => {
6328
6328
  // Prevent bubbling to muiTableBodyRowProps onClick (row click handlers)
6329
6329
  event.stopPropagation();
6330
6330
  setNewEntryModal({ open: true });
6331
6331
  };
6332
- return (jsxRuntime.jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.newEntry, children: jsxRuntime.jsx(Button, Object.assign({ "aria-label": localization.newEntry, onClick: handleOpenNewEntryModal, size: "small", startIcon: jsxRuntime.jsx(AddIcon, { fontSize: "small" }), variant: "text" }, rest, { title: undefined, children: localization.newEntry })) }));
6332
+ // When the consumer supplies onClick via newEntryButtonProps (or rest), it fully
6333
+ // replaces handleOpenNewEntryModal below — matches the override convention used by
6334
+ // every other mui*ButtonProps option in this codebase.
6335
+ const buttonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(newEntryButtonProps, { table })), rest);
6336
+ return (jsxRuntime.jsx(Tooltip, { title: (_b = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _b !== void 0 ? _b : localization.newEntry, children: jsxRuntime.jsx(Button, Object.assign({ "aria-label": localization.newEntry, onClick: handleOpenNewEntryModal, size: "small", startIcon: jsxRuntime.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 })) }));
6333
6337
  };
6334
6338
 
6335
6339
  const MRT_ShowHideColumnsMenuItems = (_a) => {