material-react-table 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/dist/index.d.ts +15 -3
  2. package/dist/index.esm.js +7 -2
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +7 -2
  5. package/dist/index.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/toolbar/MRT_TablePagination.tsx +21 -7
  8. package/src/types.ts +5 -2
  9. package/dist/types/MaterialReactTable.d.ts +0 -7
  10. package/dist/types/aggregationFns.d.ts +0 -11
  11. package/dist/types/body/MRT_TableBody.d.ts +0 -13
  12. package/dist/types/body/MRT_TableBodyCell.d.ts +0 -15
  13. package/dist/types/body/MRT_TableBodyCellValue.d.ts +0 -8
  14. package/dist/types/body/MRT_TableBodyRow.d.ts +0 -18
  15. package/dist/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -10
  16. package/dist/types/body/MRT_TableBodyRowPinButton.d.ts +0 -8
  17. package/dist/types/body/MRT_TableDetailPanel.d.ts +0 -13
  18. package/dist/types/body/index.d.ts +0 -7
  19. package/dist/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -8
  20. package/dist/types/buttons/MRT_CopyButton.d.ts +0 -8
  21. package/dist/types/buttons/MRT_EditActionButtons.d.ts +0 -9
  22. package/dist/types/buttons/MRT_ExpandAllButton.d.ts +0 -7
  23. package/dist/types/buttons/MRT_ExpandButton.d.ts +0 -8
  24. package/dist/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
  25. package/dist/types/buttons/MRT_RowPinButton.d.ts +0 -10
  26. package/dist/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
  27. package/dist/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
  28. package/dist/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
  29. package/dist/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
  30. package/dist/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
  31. package/dist/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -9
  32. package/dist/types/buttons/index.d.ts +0 -13
  33. package/dist/types/column.utils.d.ts +0 -127
  34. package/dist/types/filterFns.d.ts +0 -69
  35. package/dist/types/footer/MRT_TableFooter.d.ts +0 -11
  36. package/dist/types/footer/MRT_TableFooterCell.d.ts +0 -8
  37. package/dist/types/footer/MRT_TableFooterRow.d.ts +0 -12
  38. package/dist/types/footer/index.d.ts +0 -3
  39. package/dist/types/head/MRT_TableHead.d.ts +0 -11
  40. package/dist/types/head/MRT_TableHeadCell.d.ts +0 -8
  41. package/dist/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -8
  42. package/dist/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -8
  43. package/dist/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -8
  44. package/dist/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -10
  45. package/dist/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -8
  46. package/dist/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -8
  47. package/dist/types/head/MRT_TableHeadRow.d.ts +0 -12
  48. package/dist/types/head/index.d.ts +0 -9
  49. package/dist/types/hooks/index.d.ts +0 -4
  50. package/dist/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
  51. package/dist/types/hooks/useMRT_Effects.d.ts +0 -2
  52. package/dist/types/hooks/useMRT_TableInstance.d.ts +0 -2
  53. package/dist/types/hooks/useMRT_TableOptions.d.ts +0 -22
  54. package/dist/types/icons.d.ts +0 -36
  55. package/dist/types/index.d.ts +0 -18
  56. package/dist/types/inputs/MRT_EditCellTextField.d.ts +0 -8
  57. package/dist/types/inputs/MRT_FilterCheckbox.d.ts +0 -8
  58. package/dist/types/inputs/MRT_FilterRangeFields.d.ts +0 -8
  59. package/dist/types/inputs/MRT_FilterRangeSlider.d.ts +0 -8
  60. package/dist/types/inputs/MRT_FilterTextField.d.ts +0 -9
  61. package/dist/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -7
  62. package/dist/types/inputs/MRT_SelectCheckbox.d.ts +0 -9
  63. package/dist/types/inputs/index.d.ts +0 -7
  64. package/dist/types/locales/am.d.ts +0 -2
  65. package/dist/types/locales/ar.d.ts +0 -2
  66. package/dist/types/locales/az.d.ts +0 -2
  67. package/dist/types/locales/bg.d.ts +0 -2
  68. package/dist/types/locales/cs.d.ts +0 -2
  69. package/dist/types/locales/da.d.ts +0 -2
  70. package/dist/types/locales/de.d.ts +0 -2
  71. package/dist/types/locales/en.d.ts +0 -2
  72. package/dist/types/locales/es.d.ts +0 -2
  73. package/dist/types/locales/et.d.ts +0 -2
  74. package/dist/types/locales/fa.d.ts +0 -2
  75. package/dist/types/locales/fi.d.ts +0 -2
  76. package/dist/types/locales/fr.d.ts +0 -2
  77. package/dist/types/locales/hu.d.ts +0 -2
  78. package/dist/types/locales/hy.d.ts +0 -2
  79. package/dist/types/locales/id.d.ts +0 -2
  80. package/dist/types/locales/it.d.ts +0 -2
  81. package/dist/types/locales/ja.d.ts +0 -2
  82. package/dist/types/locales/ko.d.ts +0 -2
  83. package/dist/types/locales/nl.d.ts +0 -2
  84. package/dist/types/locales/no.d.ts +0 -2
  85. package/dist/types/locales/np.d.ts +0 -2
  86. package/dist/types/locales/pl.d.ts +0 -2
  87. package/dist/types/locales/pt-BR.d.ts +0 -2
  88. package/dist/types/locales/pt.d.ts +0 -2
  89. package/dist/types/locales/ro.d.ts +0 -2
  90. package/dist/types/locales/ru.d.ts +0 -2
  91. package/dist/types/locales/sk.d.ts +0 -2
  92. package/dist/types/locales/sr-Cyrl-RS.d.ts +0 -2
  93. package/dist/types/locales/sr-Latn-RS.d.ts +0 -2
  94. package/dist/types/locales/sv.d.ts +0 -2
  95. package/dist/types/locales/tr.d.ts +0 -2
  96. package/dist/types/locales/uk.d.ts +0 -2
  97. package/dist/types/locales/vi.d.ts +0 -2
  98. package/dist/types/locales/zh-Hans.d.ts +0 -2
  99. package/dist/types/locales/zh-Hant.d.ts +0 -2
  100. package/dist/types/menus/MRT_ColumnActionMenu.d.ts +0 -20
  101. package/dist/types/menus/MRT_FilterOptionMenu.d.ts +0 -13
  102. package/dist/types/menus/MRT_RowActionMenu.d.ts +0 -12
  103. package/dist/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -10
  104. package/dist/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -12
  105. package/dist/types/menus/index.d.ts +0 -5
  106. package/dist/types/modals/MRT_EditRowModal.d.ts +0 -8
  107. package/dist/types/modals/index.d.ts +0 -1
  108. package/dist/types/sortingFns.d.ts +0 -12
  109. package/dist/types/style.utils.d.ts +0 -32
  110. package/dist/types/table/MRT_Table.d.ts +0 -7
  111. package/dist/types/table/MRT_TableContainer.d.ts +0 -7
  112. package/dist/types/table/MRT_TableLoadingOverlay.d.ts +0 -7
  113. package/dist/types/table/MRT_TablePaper.d.ts +0 -7
  114. package/dist/types/table/index.d.ts +0 -5
  115. package/dist/types/toolbar/MRT_BottomToolbar.d.ts +0 -7
  116. package/dist/types/toolbar/MRT_LinearProgressBar.d.ts +0 -8
  117. package/dist/types/toolbar/MRT_TablePagination.d.ts +0 -11
  118. package/dist/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -8
  119. package/dist/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -7
  120. package/dist/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -7
  121. package/dist/types/toolbar/MRT_TopToolbar.d.ts +0 -6
  122. package/dist/types/toolbar/index.d.ts +0 -7
  123. package/dist/types/types.d.ts +0 -844
  124. package/dist/types/useMaterialReactTable.d.ts +0 -2
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ import { LinearProgressProps } from '@mui/material/LinearProgress';
18
18
  import { PaginationProps } from '@mui/material/Pagination';
19
19
  import { PaperProps } from '@mui/material/Paper';
20
20
  import { RadioProps } from '@mui/material/Radio';
21
+ import { SelectProps } from '@mui/material/Select';
21
22
  import { SkeletonProps } from '@mui/material/Skeleton';
22
23
  import { SliderProps } from '@mui/material/Slider';
23
24
  import { TableProps } from '@mui/material/Table';
@@ -773,10 +774,18 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
773
774
  muiPaginationProps?: ((props: {
774
775
  table: MRT_TableInstance<TData>;
775
776
  }) => Partial<PaginationProps & {
776
- rowsPerPageOptions?: number[];
777
+ SelectProps?: Partial<SelectProps>;
778
+ rowsPerPageOptions?: {
779
+ label: string;
780
+ value: number;
781
+ }[] | number[];
777
782
  showRowsPerPage?: boolean;
778
783
  }>) | Partial<PaginationProps & {
779
- rowsPerPageOptions?: number[];
784
+ SelectProps?: Partial<SelectProps>;
785
+ rowsPerPageOptions?: {
786
+ label: string;
787
+ value: number;
788
+ }[] | number[];
780
789
  showRowsPerPage?: boolean;
781
790
  }>;
782
791
  muiRowDragHandleProps?: ((props: {
@@ -1530,7 +1539,10 @@ interface Props$5<TData extends MRT_RowData> extends LinearProgressProps {
1530
1539
  declare const MRT_LinearProgressBar: <TData extends MRT_RowData>({ isTopToolbar, table, ...rest }: Props$5<TData>) => react_jsx_runtime.JSX.Element;
1531
1540
 
1532
1541
  interface Props$4<TData extends MRT_RowData> extends Partial<PaginationProps & {
1533
- rowsPerPageOptions?: number[];
1542
+ rowsPerPageOptions?: {
1543
+ label: string;
1544
+ value: number;
1545
+ }[] | number[];
1534
1546
  showRowsPerPage?: boolean;
1535
1547
  }> {
1536
1548
  position?: 'bottom' | 'top';
package/dist/index.esm.js CHANGED
@@ -2154,7 +2154,7 @@ const MRT_TablePagination = (_a) => {
2154
2154
  const showFirstLastPageButtons = numberOfPages > 2;
2155
2155
  const firstRowIndex = pageIndex * pageSize;
2156
2156
  const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
2157
- const _b = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _b, _rest = __rest(_b, ["rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
2157
+ const _b = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { SelectProps, rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _b, _rest = __rest(_b, ["SelectProps", "rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
2158
2158
  return (jsxs(Box, { sx: {
2159
2159
  alignItems: 'center',
2160
2160
  display: 'flex',
@@ -2171,7 +2171,12 @@ const MRT_TablePagination = (_a) => {
2171
2171
  px: '8px',
2172
2172
  py: '12px',
2173
2173
  zIndex: 2,
2174
- }, children: [showRowsPerPage && (jsxs(Box, { sx: { alignItems: 'center', display: 'flex', gap: '8px' }, children: [jsx(InputLabel, { htmlFor: "mrt-rows-per-page", sx: { mb: 0 }, children: localization.rowsPerPage }), jsx(Select, { disableUnderline: true, id: "mrt-rows-per-page", inputProps: { 'aria-label': localization.rowsPerPage }, label: localization.rowsPerPage, onChange: (event) => setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard", children: rowsPerPageOptions.map((value) => (jsx(MenuItem, { sx: { m: 0 }, value: value, children: value }, value))) })] })), paginationDisplayMode === 'pages' ? (jsx(Pagination, Object.assign({ count: numberOfPages, onChange: (_e, newPageIndex) => setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsx(PaginationItem, Object.assign({ slots: {
2174
+ }, children: [showRowsPerPage && (jsxs(Box, { sx: { alignItems: 'center', display: 'flex', gap: '8px' }, children: [jsx(InputLabel, { htmlFor: "mrt-rows-per-page", sx: { mb: 0 }, children: localization.rowsPerPage }), jsx(Select, Object.assign({ disableUnderline: true, id: "mrt-rows-per-page", inputProps: { 'aria-label': localization.rowsPerPage }, label: localization.rowsPerPage, onChange: (event) => setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard" }, SelectProps, { children: rowsPerPageOptions.map((option) => {
2175
+ var _a;
2176
+ const value = typeof option !== 'number' ? option.value : option;
2177
+ const label = typeof option !== 'number' ? option.label : `${option}`;
2178
+ return ((_a = SelectProps === null || SelectProps === void 0 ? void 0 : SelectProps.children) !== null && _a !== void 0 ? _a : ((SelectProps === null || SelectProps === void 0 ? void 0 : SelectProps.native) ? (jsx("option", { value: value, children: label }, value)) : (jsx(MenuItem, { sx: { m: 0 }, value: value, children: label }, value))));
2179
+ }) }))] })), paginationDisplayMode === 'pages' ? (jsx(Pagination, Object.assign({ count: numberOfPages, onChange: (_e, newPageIndex) => setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsx(PaginationItem, Object.assign({ slots: {
2175
2180
  first: FirstPageIcon,
2176
2181
  last: LastPageIcon,
2177
2182
  next: ChevronRightIcon,