@dooherceg/material-react-table 4.1.7 → 4.1.8

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 CHANGED
@@ -337,7 +337,6 @@ request cursor; the table displays all loaded rows together, not one UI page.
337
337
  - `layoutMode: 'grid' | 'grid-no-grow' | 'semantic'` switches between CSS grid/flexbox sizing and default semantic HTML table layout; per-column `grow` controls flex-grow in grid modes.
338
338
  - `theme/overrides/components/*` supplies MUI component-level overrides (Table, Switch, Select, etc.); `theme/options` merges user theme options.
339
339
  - Column widths use a CSS-variable-based sizing scheme (`utils/style.utils.ts`) rather than inline widths per cell.
340
- - Columns without an explicit `size` are autosized once by their **body cell content** (never the header text) as soon as real rows are rendered — not while loading or showing skeletons. Only rendered rows are measured (row virtualization); double-clicking a resize handle re-measures the current rows. Explicit `size`, restored/controlled `columnSizing`, and manual resizes are never overwritten. Every width — autosized, resized, or restored — stays within the column's own `minSize`/`maxSize` (defaults 40/1000). Autosized columns then share free space equally (`grow`; `grow: false` keeps the measured width).
341
340
 
342
341
  ## Localization
343
342
 
package/dist/index.d.ts CHANGED
@@ -460,6 +460,7 @@ interface MRT_Localization {
460
460
  rowCount: string;
461
461
  search: string;
462
462
  select: string;
463
+ selection: string;
463
464
  selectAllOnAllPages: string;
464
465
  selectAllOnCurrentPage: string;
465
466
  selectedCountOfRowCountRowsSelected: string;
@@ -877,7 +878,7 @@ type MRT_TreeRowReorderEvent<TData extends MRT_RowData> = {
877
878
  table: MRT_TableInstance<TData>;
878
879
  targetRow: MRT_Row<TData> | null;
879
880
  };
880
- type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-pin' | '__check__' | 'mrt-row-spacer';
881
+ type MRT_DisplayColumnIds = 'actions' | 'mrt-row-actions' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-pin' | '__check__' | 'mrt-row-spacer';
881
882
  type MRT_GetRowId<TData extends MRT_RowData> = (originalRow: TData, index: number, parentRow?: MRT_Row<TData>) => string;
882
883
  /**
883
884
  * `columns` and `data` props are the only required props, but there are over 170 other optional props.
@@ -1565,13 +1566,45 @@ declare function defaultDisplayColumnProps<TData extends MRT_RowData>({ columnSp
1565
1566
  declare const showRowPinningColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1566
1567
  declare const showRowExpandColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1567
1568
  declare const showRowActionsColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1568
- declare const showRowSelectionColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1569
1569
  declare const showRowNumbersColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1570
1570
  declare const showRowSpacerColumn: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => boolean;
1571
1571
  declare const getLeadingDisplayColumnIds: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => MRT_DisplayColumnIds[];
1572
1572
  declare const getTrailingDisplayColumnIds: <TData extends MRT_RowData>(tableOptions: MRT_StatefulTableOptions<TData>) => MRT_DisplayColumnIds[];
1573
1573
  /** The internal ID used by TanStack Table for the row-selection checkbox column */
1574
1574
  declare const CHECKBOX_DISPLAY_COLUMN_ID = "__check__";
1575
+ declare const getColumnMenuLabel: <TData extends MRT_RowData>(column: MRT_Column<TData>, localization: Pick<MRT_Localization, "selection">) => string;
1576
+ declare const ACTIONS_DISPLAY_COLUMN_ID = "actions";
1577
+ declare const getRowActionsCell: <TData extends MRT_RowData>() => Pick<MRT_ColumnDef<TData>, "Cell">;
1578
+ /** Render row actions in the supplied column, preserving its layout and metadata. */
1579
+ declare const decorateRowActionsColumn: <TData extends MRT_RowData>(columnDef: MRT_ColumnDef<TData>, tableOptions: MRT_DefinedTableOptions<TData>) => MRT_ColumnDef<TData>;
1580
+ declare const columnsIncludeRowActions: <TData extends MRT_RowData>(columnDefs: MRT_ColumnDef<TData>[]) => boolean;
1581
+ /**
1582
+ * The Cell/Header pair every `__check__` column renders — shared by the
1583
+ * auto-injected row-select column (getMRT_RowSelectColumnDef) and any column
1584
+ * a consumer supplies directly under this reserved id (see
1585
+ * decorateCheckboxSelectionColumn below), so both stay visually and
1586
+ * behaviorally identical.
1587
+ */
1588
+ declare const getCheckboxSelectionCellAndHeader: <TData extends MRT_RowData>(tableOptions: MRT_DefinedTableOptions<TData>) => Pick<MRT_ColumnDef<TData>, "Cell" | "Header">;
1589
+ /**
1590
+ * `__check__` is reserved: MRT always knows how to render a column by this
1591
+ * id as the row-selection checkbox — supplied directly in the consumer's
1592
+ * own columns array, e.g. a column converted 1:1, size/minSize/sortable and
1593
+ * all, from an external data source that happens to use this id for its own
1594
+ * selection column. `enableColumnActions`/`enablePinning` default to true
1595
+ * (matching every other display column's own baseline) unless the
1596
+ * consumer's own column def says otherwise; Cell/Header/columnDefType are
1597
+ * always forced, to route through the same display-column render path.
1598
+ * `displayColumnDefOptions['__check__']`, same as every other display
1599
+ * column, always has the final say, able to override any of it.
1600
+ */
1601
+ declare const decorateCheckboxSelectionColumn: <TData extends MRT_RowData>(columnDef: MRT_ColumnDef<TData>, tableOptions: MRT_DefinedTableOptions<TData>) => MRT_ColumnDef<TData>;
1602
+ /**
1603
+ * Whether the consumer's own columns already include a `__check__` column —
1604
+ * when true, MRT must not also auto-inject its own (enableRowSelection would
1605
+ * otherwise create a second column under the same reserved id).
1606
+ */
1607
+ declare const columnsIncludeCheckboxSelection: <TData extends MRT_RowData>(columnDefs: MRT_ColumnDef<TData>[]) => boolean;
1575
1608
  /**
1576
1609
  * Forces mrt-row-expand to a fixed slot in columnOrder: right after the
1577
1610
  * checkbox column when row selection is enabled, otherwise the very first
@@ -2092,4 +2125,4 @@ interface MRT_TopToolbarProps<TData extends MRT_RowData> {
2092
2125
  }
2093
2126
  declare const MRT_TopToolbar: <TData extends MRT_RowData>({ table, }: MRT_TopToolbarProps<TData>) => react.JSX.Element;
2094
2127
 
2095
- export { type Action, type ActionRowRenderContext, type ActionToolbarRenderContext, CHECKBOX_DISPLAY_COLUMN_ID, type ColumnType, type ColumnTypeResolver, type CreateDeleteActionOptions, type CreateEditActionOptions, type CreateExportActionOptions, type CustomOnDeleteActionContext, type CustomOnEditActionContext, type CustomOnExportActionContext, type DeleteActionRowRenderContext, type DeleteActionToolbarRenderContext, type DeleteConfirmationConfig, type DistributiveOmit, type DropdownOption, type ExportActionRowRenderContext, type ExportActionToolbarRenderContext, type LiteralUnion, MRT_ActionMenuItem, type MRT_ActionMenuItemProps, type MRT_ActiveExportsState, MRT_AdvancedFilters, type MRT_AdvancedFiltersProps, type MRT_AggregationFn, MRT_AggregationFns, type MRT_AggregationOption, MRT_BottomToolbar, type MRT_BottomToolbarProps, type MRT_Cell, type MRT_Column, MRT_ColumnActionMenu, type MRT_ColumnActionMenuProps, type MRT_ColumnDef, type MRT_ColumnHelper, type MRT_ColumnOrderState, MRT_ColumnPinningButtons, type MRT_ColumnPinningButtonsProps, type MRT_ColumnPinningState, type MRT_ColumnResizingState, type MRT_ColumnSizingState, type MRT_ColumnVirtualizer, MRT_DefaultColumn, MRT_DefaultDisplayColumn, type MRT_DefinedColumnDef, type MRT_DefinedTableOptions, type MRT_DensityState, type MRT_DimensionsDef, type MRT_DisplayColumnDef, type MRT_DisplayColumnIds, MRT_ExpandAllButton, type MRT_ExpandAllButtonProps, MRT_ExpandButton, type MRT_ExpandButtonProps, type MRT_ExpandedState, type MRT_ExportDefinition, type MRT_ExportFileResponse, type MRT_ExportParams, MRT_ExportsToolbar, type MRT_ExportsToolbarProps, type MRT_FilterOperator, type MRT_FilterOperatorDefinition, type MRT_FilterOperatorEditComponentProps, type MRT_FilterOperatorValueShape, type MRT_FilterRule, type MRT_FiltersLogicOperator, type MRT_FiltersState, type MRT_FormActionButtonRenderProps, type MRT_FormAdditionalField, type MRT_FormAdditionalFieldRenderProps, type MRT_FormCallbackProps, type MRT_FormConfig, type MRT_FormCustomAction, type MRT_FormFieldConfig, type MRT_FormFieldEntry, type MRT_FormFieldRenderProps, type MRT_FormRenderEntry, type MRT_FormSectionConfig, type MRT_GetRowId, MRT_GrabHandleButton, type MRT_GrabHandleButtonProps, type MRT_GroupColumnDef, type MRT_GroupingState, type MRT_Header, type MRT_HeaderGroup, type MRT_IconColumnDef, type MRT_Icons, type MRT_IconsListEntry, MRT_LinearProgressBar, type MRT_LinearProgressBarProps, type MRT_Localization, type MRT_ModalPosition, MRT_NewEntryForm, MRT_NewEntryFormActions, MRT_NewEntryFormActionsContext, type MRT_NewEntryFormActionsContextValue, type MRT_NewEntryFormActionsProps, type MRT_NewEntryFormProps, MRT_NewEntryFormProvider, type MRT_NewEntryFormProviderProps, MRT_NewEntryModal, type MRT_NewEntryModalOverrides, type MRT_NewEntryModalProps, type MRT_NewEntryModalState, type MRT_NonIconColumnDef, MRT_PaginationBoundsEffect, type MRT_PaginationBoundsEffectProps, type MRT_PaginationState, type MRT_Row, MRT_RowActionMenu, type MRT_RowActionMenuProps, type MRT_RowData, type MRT_RowManipulationInput, type MRT_RowModel, MRT_RowPinButton, type MRT_RowPinButtonProps, type MRT_RowReorderingSelectionState, type MRT_RowSelectionState, type MRT_RowVirtualizer, type MRT_SavedFilter, type MRT_SavedFilters, MRT_SelectAllMenuItems, type MRT_SelectAllMenuItemsProps, MRT_SelectCheckbox, type MRT_SelectCheckboxProps, MRT_SelectionCountBadge, type MRT_SelectionCountBadgeProps, MRT_ShowHideColumnsButton, type MRT_ShowHideColumnsButtonProps, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, type MRT_ShowHideColumnsMenuItemsProps, type MRT_ShowHideColumnsMenuProps, type MRT_SortFn, MRT_SortingFns, type MRT_SortingOption, type MRT_SortingState, type MRT_StatefulTableOptions, MRT_Table, MRT_TableBody, MRT_TableBodyCell, type MRT_TableBodyCellProps, MRT_TableBodyCellValue, type MRT_TableBodyCellValueProps, type MRT_TableBodyProps, MRT_TableBodyRow, MRT_TableBodyRowPinButton, type MRT_TableBodyRowPinButtonProps, type MRT_TableBodyRowProps, type MRT_TableConfig, MRT_TableContainer, type MRT_TableContainerProps, type MRT_TableData, MRT_TableDetailPanel, type MRT_TableDetailPanelProps, MRT_TableFooter, MRT_TableFooterCell, type MRT_TableFooterCellProps, type MRT_TableFooterProps, MRT_TableFooterRow, type MRT_TableFooterRowProps, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, type MRT_TableHeadCellColumnActionsButtonProps, MRT_TableHeadCellGrabHandle, type MRT_TableHeadCellGrabHandleProps, type MRT_TableHeadCellProps, MRT_TableHeadCellResizeHandle, type MRT_TableHeadCellResizeHandleProps, MRT_TableHeadCellSortLabel, type MRT_TableHeadCellSortLabelProps, type MRT_TableHeadProps, MRT_TableHeadRow, type MRT_TableHeadRowProps, type MRT_TableInstance, MRT_TableLoadingOverlay, type MRT_TableLoadingOverlayProps, type MRT_TableOptions, MRT_TablePagination, type MRT_TablePaginationProps, MRT_TablePaper, type MRT_TablePaperProps, type MRT_TableProps, type MRT_TableState, type MRT_Theme, MRT_ToggleDensePaddingButton, type MRT_ToggleDensePaddingButtonProps, MRT_ToggleRowActionMenuButton, type MRT_ToggleRowActionMenuButtonProps, MRT_ToolbarAlertBanner, type MRT_ToolbarAlertBannerProps, MRT_ToolbarDropZone, type MRT_ToolbarDropZoneProps, MRT_ToolbarInternalButtons, type MRT_ToolbarInternalButtonsProps, MRT_TopToolbar, type MRT_TopToolbarProps, type MRT_TreeRowReorderEvent, type MRT_Updater, type MRT_VirtualItem, type MRT_VirtualizerOptions, type MRT_VisibilityState, MaterialReactServerTable, type MaterialReactServerTableProps, MaterialReactTable, type MaterialReactTableProps, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, type OnDeleteActionContext, type OnEditActionContext, type OnExportActionContext, type Prettify, RHF_FormProvider, type RHF_FormProviderProps, type UseServerTableStateOptions, type UseServerTableStateReturn, type Xor, buildDefaultValues, createDeleteAction, createEditAction, createExportAction, createMRTColumnHelper, createRow, defaultDisplayColumnProps, flexRender, getAllLeafColumnDefs, getAutoSizeCandidateColumnIds, getColumnId, getDefaultColumnOrderIds, getIsAllPagesSelectionActive, getIsRowSelected, getLeadingDisplayColumnIds, getMRT_RowSelectionHandler, getMRT_Rows, getMRT_SelectAllHandler, getTrailingDisplayColumnIds, groupFieldsBySection, normalizeRowExpandColumnOrder, prepareColumns, reorderColumn, resolveFormFields, showRowActionsColumn, showRowExpandColumn, showRowNumbersColumn, showRowPinningColumn, showRowSelectionColumn, showRowSpacerColumn, sortByOrder, toAdditionalRenderEntries, toColumnRenderEntries, useMRT_ColumnVirtualizer, useMRT_NewEntryFormActions, useMRT_RowVirtualizer, useMRT_Rows, useMRT_TableInstance, useMRT_TableOptions, useMaterialReactTable };
2128
+ export { ACTIONS_DISPLAY_COLUMN_ID, type Action, type ActionRowRenderContext, type ActionToolbarRenderContext, CHECKBOX_DISPLAY_COLUMN_ID, type ColumnType, type ColumnTypeResolver, type CreateDeleteActionOptions, type CreateEditActionOptions, type CreateExportActionOptions, type CustomOnDeleteActionContext, type CustomOnEditActionContext, type CustomOnExportActionContext, type DeleteActionRowRenderContext, type DeleteActionToolbarRenderContext, type DeleteConfirmationConfig, type DistributiveOmit, type DropdownOption, type ExportActionRowRenderContext, type ExportActionToolbarRenderContext, type LiteralUnion, MRT_ActionMenuItem, type MRT_ActionMenuItemProps, type MRT_ActiveExportsState, MRT_AdvancedFilters, type MRT_AdvancedFiltersProps, type MRT_AggregationFn, MRT_AggregationFns, type MRT_AggregationOption, MRT_BottomToolbar, type MRT_BottomToolbarProps, type MRT_Cell, type MRT_Column, MRT_ColumnActionMenu, type MRT_ColumnActionMenuProps, type MRT_ColumnDef, type MRT_ColumnHelper, type MRT_ColumnOrderState, MRT_ColumnPinningButtons, type MRT_ColumnPinningButtonsProps, type MRT_ColumnPinningState, type MRT_ColumnResizingState, type MRT_ColumnSizingState, type MRT_ColumnVirtualizer, MRT_DefaultColumn, MRT_DefaultDisplayColumn, type MRT_DefinedColumnDef, type MRT_DefinedTableOptions, type MRT_DensityState, type MRT_DimensionsDef, type MRT_DisplayColumnDef, type MRT_DisplayColumnIds, MRT_ExpandAllButton, type MRT_ExpandAllButtonProps, MRT_ExpandButton, type MRT_ExpandButtonProps, type MRT_ExpandedState, type MRT_ExportDefinition, type MRT_ExportFileResponse, type MRT_ExportParams, MRT_ExportsToolbar, type MRT_ExportsToolbarProps, type MRT_FilterOperator, type MRT_FilterOperatorDefinition, type MRT_FilterOperatorEditComponentProps, type MRT_FilterOperatorValueShape, type MRT_FilterRule, type MRT_FiltersLogicOperator, type MRT_FiltersState, type MRT_FormActionButtonRenderProps, type MRT_FormAdditionalField, type MRT_FormAdditionalFieldRenderProps, type MRT_FormCallbackProps, type MRT_FormConfig, type MRT_FormCustomAction, type MRT_FormFieldConfig, type MRT_FormFieldEntry, type MRT_FormFieldRenderProps, type MRT_FormRenderEntry, type MRT_FormSectionConfig, type MRT_GetRowId, MRT_GrabHandleButton, type MRT_GrabHandleButtonProps, type MRT_GroupColumnDef, type MRT_GroupingState, type MRT_Header, type MRT_HeaderGroup, type MRT_IconColumnDef, type MRT_Icons, type MRT_IconsListEntry, MRT_LinearProgressBar, type MRT_LinearProgressBarProps, type MRT_Localization, type MRT_ModalPosition, MRT_NewEntryForm, MRT_NewEntryFormActions, MRT_NewEntryFormActionsContext, type MRT_NewEntryFormActionsContextValue, type MRT_NewEntryFormActionsProps, type MRT_NewEntryFormProps, MRT_NewEntryFormProvider, type MRT_NewEntryFormProviderProps, MRT_NewEntryModal, type MRT_NewEntryModalOverrides, type MRT_NewEntryModalProps, type MRT_NewEntryModalState, type MRT_NonIconColumnDef, MRT_PaginationBoundsEffect, type MRT_PaginationBoundsEffectProps, type MRT_PaginationState, type MRT_Row, MRT_RowActionMenu, type MRT_RowActionMenuProps, type MRT_RowData, type MRT_RowManipulationInput, type MRT_RowModel, MRT_RowPinButton, type MRT_RowPinButtonProps, type MRT_RowReorderingSelectionState, type MRT_RowSelectionState, type MRT_RowVirtualizer, type MRT_SavedFilter, type MRT_SavedFilters, MRT_SelectAllMenuItems, type MRT_SelectAllMenuItemsProps, MRT_SelectCheckbox, type MRT_SelectCheckboxProps, MRT_SelectionCountBadge, type MRT_SelectionCountBadgeProps, MRT_ShowHideColumnsButton, type MRT_ShowHideColumnsButtonProps, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, type MRT_ShowHideColumnsMenuItemsProps, type MRT_ShowHideColumnsMenuProps, type MRT_SortFn, MRT_SortingFns, type MRT_SortingOption, type MRT_SortingState, type MRT_StatefulTableOptions, MRT_Table, MRT_TableBody, MRT_TableBodyCell, type MRT_TableBodyCellProps, MRT_TableBodyCellValue, type MRT_TableBodyCellValueProps, type MRT_TableBodyProps, MRT_TableBodyRow, MRT_TableBodyRowPinButton, type MRT_TableBodyRowPinButtonProps, type MRT_TableBodyRowProps, type MRT_TableConfig, MRT_TableContainer, type MRT_TableContainerProps, type MRT_TableData, MRT_TableDetailPanel, type MRT_TableDetailPanelProps, MRT_TableFooter, MRT_TableFooterCell, type MRT_TableFooterCellProps, type MRT_TableFooterProps, MRT_TableFooterRow, type MRT_TableFooterRowProps, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, type MRT_TableHeadCellColumnActionsButtonProps, MRT_TableHeadCellGrabHandle, type MRT_TableHeadCellGrabHandleProps, type MRT_TableHeadCellProps, MRT_TableHeadCellResizeHandle, type MRT_TableHeadCellResizeHandleProps, MRT_TableHeadCellSortLabel, type MRT_TableHeadCellSortLabelProps, type MRT_TableHeadProps, MRT_TableHeadRow, type MRT_TableHeadRowProps, type MRT_TableInstance, MRT_TableLoadingOverlay, type MRT_TableLoadingOverlayProps, type MRT_TableOptions, MRT_TablePagination, type MRT_TablePaginationProps, MRT_TablePaper, type MRT_TablePaperProps, type MRT_TableProps, type MRT_TableState, type MRT_Theme, MRT_ToggleDensePaddingButton, type MRT_ToggleDensePaddingButtonProps, MRT_ToggleRowActionMenuButton, type MRT_ToggleRowActionMenuButtonProps, MRT_ToolbarAlertBanner, type MRT_ToolbarAlertBannerProps, MRT_ToolbarDropZone, type MRT_ToolbarDropZoneProps, MRT_ToolbarInternalButtons, type MRT_ToolbarInternalButtonsProps, MRT_TopToolbar, type MRT_TopToolbarProps, type MRT_TreeRowReorderEvent, type MRT_Updater, type MRT_VirtualItem, type MRT_VirtualizerOptions, type MRT_VisibilityState, MaterialReactServerTable, type MaterialReactServerTableProps, MaterialReactTable, type MaterialReactTableProps, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, type OnDeleteActionContext, type OnEditActionContext, type OnExportActionContext, type Prettify, RHF_FormProvider, type RHF_FormProviderProps, type UseServerTableStateOptions, type UseServerTableStateReturn, type Xor, buildDefaultValues, columnsIncludeCheckboxSelection, columnsIncludeRowActions, createDeleteAction, createEditAction, createExportAction, createMRTColumnHelper, createRow, decorateCheckboxSelectionColumn, decorateRowActionsColumn, defaultDisplayColumnProps, flexRender, getAllLeafColumnDefs, getAutoSizeCandidateColumnIds, getCheckboxSelectionCellAndHeader, getColumnId, getColumnMenuLabel, getDefaultColumnOrderIds, getIsAllPagesSelectionActive, getIsRowSelected, getLeadingDisplayColumnIds, getMRT_RowSelectionHandler, getMRT_Rows, getMRT_SelectAllHandler, getRowActionsCell, getTrailingDisplayColumnIds, groupFieldsBySection, normalizeRowExpandColumnOrder, prepareColumns, reorderColumn, resolveFormFields, showRowActionsColumn, showRowExpandColumn, showRowNumbersColumn, showRowPinningColumn, showRowSpacerColumn, sortByOrder, toAdditionalRenderEntries, toColumnRenderEntries, useMRT_ColumnVirtualizer, useMRT_NewEntryFormActions, useMRT_RowVirtualizer, useMRT_Rows, useMRT_TableInstance, useMRT_TableOptions, useMaterialReactTable };