@dooherceg/material-react-table 3.2.11 → 3.2.12

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.esm.js CHANGED
@@ -1677,7 +1677,13 @@ const MRT_ExpandAllButton = (_a) => {
1677
1677
  table,
1678
1678
  })), rest);
1679
1679
  const isAllRowsExpanded = getIsAllRowsExpanded();
1680
- return (jsx(Tooltip, Object.assign({}, getCommonTooltipProps(), { title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : (isAllRowsExpanded ? localization.collapseAll : localization.expandAll), children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_c = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _c !== void 0 ? _c : (jsx(KeyboardDoubleArrowDownIcon, { style: {
1680
+ const handleToggleExpandAll = (event) => {
1681
+ var _a;
1682
+ event.stopPropagation();
1683
+ toggleAllRowsExpanded(!isAllRowsExpanded);
1684
+ (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
1685
+ };
1686
+ return (jsx(Tooltip, Object.assign({}, getCommonTooltipProps(), { title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : (isAllRowsExpanded ? localization.collapseAll : localization.expandAll), children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()) }, iconButtonProps, { onClick: handleToggleExpandAll, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_c = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _c !== void 0 ? _c : (jsx(KeyboardDoubleArrowDownIcon, { style: {
1681
1687
  transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
1682
1688
  transition: 'transform 150ms',
1683
1689
  } })) })) }) })));
@@ -1720,18 +1726,29 @@ const MRT_ExpandButton = ({ row, staticRowIndex, table, }) => {
1720
1726
  const INSERT_HERE_TOOLTIP = 'Insert here';
1721
1727
  const ACTION_ICON_SIZE$1 = 'small';
1722
1728
  const MRT_InsertHereAction = ({ onClick, }) => {
1723
- return (jsx(Tooltip, { title: INSERT_HERE_TOOLTIP, disableInteractive: true, children: jsx(IconButton, { onClick: onClick, size: ACTION_ICON_SIZE$1, children: jsx(SubdirectoryArrowLeftIcon, { color: "warning" }) }) }));
1729
+ const handleClick = (event) => {
1730
+ event.stopPropagation();
1731
+ onClick();
1732
+ };
1733
+ return (jsx(Tooltip, { title: INSERT_HERE_TOOLTIP, disableInteractive: true, children: jsx(IconButton, { onClick: handleClick, size: ACTION_ICON_SIZE$1, children: jsx(SubdirectoryArrowLeftIcon, { color: "warning" }) }) }));
1724
1734
  };
1725
1735
 
1726
1736
  const MOVE_TO_TOP_TOOLTIP = 'Move to top level';
1727
1737
  const ACTION_ICON_SIZE = 'small';
1728
1738
  const ACTION_BUTTON_HEIGHT = '1.75rem';
1729
1739
  const MRT_MoveToTopAction = ({ onClick }) => {
1730
- return (jsx(Tooltip, { title: MOVE_TO_TOP_TOOLTIP, disableInteractive: true, children: jsx(IconButton, { onClick: onClick, size: ACTION_ICON_SIZE, sx: { height: ACTION_BUTTON_HEIGHT }, children: jsx(VerticalAlignTopIcon, { fontSize: "small" }) }) }));
1740
+ const handleClick = (event) => {
1741
+ event.stopPropagation();
1742
+ onClick();
1743
+ };
1744
+ return (jsx(Tooltip, { title: MOVE_TO_TOP_TOOLTIP, disableInteractive: true, children: jsx(IconButton, { onClick: handleClick, size: ACTION_ICON_SIZE, sx: { height: ACTION_BUTTON_HEIGHT }, children: jsx(VerticalAlignTopIcon, { fontSize: "small" }) }) }));
1731
1745
  };
1732
1746
 
1733
1747
  const MRT_ReorderRowCheckbox = ({ onChange, isSelected, }) => {
1734
- return (jsx(Checkbox, { checked: isSelected, color: "warning", disableRipple: true, onChange: onChange, sx: {
1748
+ const handleClick = (event) => {
1749
+ event.stopPropagation();
1750
+ };
1751
+ return (jsx(Checkbox, { checked: isSelected, color: "warning", disableRipple: true, onChange: onChange, onClick: handleClick, sx: {
1735
1752
  color: (theme) => theme.palette.warning.main,
1736
1753
  '&.Mui-checked': {
1737
1754
  color: (theme) => theme.palette.warning.main,
@@ -2002,7 +2019,7 @@ const getMRT_RowExpandColumnDef = (tableOptions) => {
2002
2019
  });
2003
2020
  if (groupedColumnMode === 'remove' && row.groupingColumnId) {
2004
2021
  const defaultGroupedCell = (jsx(Tooltip, Object.assign({}, getCommonTooltipProps('right'), { title: table.getColumn(row.groupingColumnId).columnDef.header, children: jsx("span", { children: row.groupingValue }) })));
2005
- return (jsxs(Stack, { alignItems: "center", flexDirection: "row", gap: TREE_REORDER_ICON_SPACING, onMouseEnter: cellLogic.handleRowHoverEnter, onMouseLeave: cellLogic.handleRowHoverLeave, width: "100%", children: [jsx(MRT_ExpandButton, Object.assign({}, expandButtonProps)), column.columnDef.GroupedCell
2022
+ return (jsxs(Stack, { alignItems: "center", flexDirection: "row", gap: TREE_REORDER_ICON_SPACING, onMouseEnter: cellLogic.handleRowHoverEnter, onMouseLeave: cellLogic.handleRowHoverLeave, children: [jsx(MRT_ExpandButton, Object.assign({}, expandButtonProps)), column.columnDef.GroupedCell
2006
2023
  ? customGroupedCell
2007
2024
  : defaultGroupedCell, cellLogic.shouldShowReorderCheckbox && (jsx(MRT_ReorderRowCheckbox, { isSelected: cellLogic.isReorderCheckboxSelected, onChange: cellLogic.handleReorderCheckboxChange })), cellLogic.shouldShowInsertHereAction && (jsx(MRT_InsertHereAction, { onClick: cellLogic.handleInsertHereActionClick })), !!subRowsLength && jsxs("span", { children: ["(", subRowsLength, ")"] })] }));
2008
2025
  }