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.
- package/dist/index.d.ts +15 -3
- package/dist/index.esm.js +7 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/toolbar/MRT_TablePagination.tsx +21 -7
- package/src/types.ts +5 -2
- package/dist/types/MaterialReactTable.d.ts +0 -7
- package/dist/types/aggregationFns.d.ts +0 -11
- package/dist/types/body/MRT_TableBody.d.ts +0 -13
- package/dist/types/body/MRT_TableBodyCell.d.ts +0 -15
- package/dist/types/body/MRT_TableBodyCellValue.d.ts +0 -8
- package/dist/types/body/MRT_TableBodyRow.d.ts +0 -18
- package/dist/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -10
- package/dist/types/body/MRT_TableBodyRowPinButton.d.ts +0 -8
- package/dist/types/body/MRT_TableDetailPanel.d.ts +0 -13
- package/dist/types/body/index.d.ts +0 -7
- package/dist/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -8
- package/dist/types/buttons/MRT_CopyButton.d.ts +0 -8
- package/dist/types/buttons/MRT_EditActionButtons.d.ts +0 -9
- package/dist/types/buttons/MRT_ExpandAllButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ExpandButton.d.ts +0 -8
- package/dist/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
- package/dist/types/buttons/MRT_RowPinButton.d.ts +0 -10
- package/dist/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
- package/dist/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -9
- package/dist/types/buttons/index.d.ts +0 -13
- package/dist/types/column.utils.d.ts +0 -127
- package/dist/types/filterFns.d.ts +0 -69
- package/dist/types/footer/MRT_TableFooter.d.ts +0 -11
- package/dist/types/footer/MRT_TableFooterCell.d.ts +0 -8
- package/dist/types/footer/MRT_TableFooterRow.d.ts +0 -12
- package/dist/types/footer/index.d.ts +0 -3
- package/dist/types/head/MRT_TableHead.d.ts +0 -11
- package/dist/types/head/MRT_TableHeadCell.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -10
- package/dist/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -8
- package/dist/types/head/MRT_TableHeadRow.d.ts +0 -12
- package/dist/types/head/index.d.ts +0 -9
- package/dist/types/hooks/index.d.ts +0 -4
- package/dist/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
- package/dist/types/hooks/useMRT_Effects.d.ts +0 -2
- package/dist/types/hooks/useMRT_TableInstance.d.ts +0 -2
- package/dist/types/hooks/useMRT_TableOptions.d.ts +0 -22
- package/dist/types/icons.d.ts +0 -36
- package/dist/types/index.d.ts +0 -18
- package/dist/types/inputs/MRT_EditCellTextField.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterCheckbox.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterRangeFields.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterRangeSlider.d.ts +0 -8
- package/dist/types/inputs/MRT_FilterTextField.d.ts +0 -9
- package/dist/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -7
- package/dist/types/inputs/MRT_SelectCheckbox.d.ts +0 -9
- package/dist/types/inputs/index.d.ts +0 -7
- package/dist/types/locales/am.d.ts +0 -2
- package/dist/types/locales/ar.d.ts +0 -2
- package/dist/types/locales/az.d.ts +0 -2
- package/dist/types/locales/bg.d.ts +0 -2
- package/dist/types/locales/cs.d.ts +0 -2
- package/dist/types/locales/da.d.ts +0 -2
- package/dist/types/locales/de.d.ts +0 -2
- package/dist/types/locales/en.d.ts +0 -2
- package/dist/types/locales/es.d.ts +0 -2
- package/dist/types/locales/et.d.ts +0 -2
- package/dist/types/locales/fa.d.ts +0 -2
- package/dist/types/locales/fi.d.ts +0 -2
- package/dist/types/locales/fr.d.ts +0 -2
- package/dist/types/locales/hu.d.ts +0 -2
- package/dist/types/locales/hy.d.ts +0 -2
- package/dist/types/locales/id.d.ts +0 -2
- package/dist/types/locales/it.d.ts +0 -2
- package/dist/types/locales/ja.d.ts +0 -2
- package/dist/types/locales/ko.d.ts +0 -2
- package/dist/types/locales/nl.d.ts +0 -2
- package/dist/types/locales/no.d.ts +0 -2
- package/dist/types/locales/np.d.ts +0 -2
- package/dist/types/locales/pl.d.ts +0 -2
- package/dist/types/locales/pt-BR.d.ts +0 -2
- package/dist/types/locales/pt.d.ts +0 -2
- package/dist/types/locales/ro.d.ts +0 -2
- package/dist/types/locales/ru.d.ts +0 -2
- package/dist/types/locales/sk.d.ts +0 -2
- package/dist/types/locales/sr-Cyrl-RS.d.ts +0 -2
- package/dist/types/locales/sr-Latn-RS.d.ts +0 -2
- package/dist/types/locales/sv.d.ts +0 -2
- package/dist/types/locales/tr.d.ts +0 -2
- package/dist/types/locales/uk.d.ts +0 -2
- package/dist/types/locales/vi.d.ts +0 -2
- package/dist/types/locales/zh-Hans.d.ts +0 -2
- package/dist/types/locales/zh-Hant.d.ts +0 -2
- package/dist/types/menus/MRT_ColumnActionMenu.d.ts +0 -20
- package/dist/types/menus/MRT_FilterOptionMenu.d.ts +0 -13
- package/dist/types/menus/MRT_RowActionMenu.d.ts +0 -12
- package/dist/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -10
- package/dist/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -12
- package/dist/types/menus/index.d.ts +0 -5
- package/dist/types/modals/MRT_EditRowModal.d.ts +0 -8
- package/dist/types/modals/index.d.ts +0 -1
- package/dist/types/sortingFns.d.ts +0 -12
- package/dist/types/style.utils.d.ts +0 -32
- package/dist/types/table/MRT_Table.d.ts +0 -7
- package/dist/types/table/MRT_TableContainer.d.ts +0 -7
- package/dist/types/table/MRT_TableLoadingOverlay.d.ts +0 -7
- package/dist/types/table/MRT_TablePaper.d.ts +0 -7
- package/dist/types/table/index.d.ts +0 -5
- package/dist/types/toolbar/MRT_BottomToolbar.d.ts +0 -7
- package/dist/types/toolbar/MRT_LinearProgressBar.d.ts +0 -8
- package/dist/types/toolbar/MRT_TablePagination.d.ts +0 -11
- package/dist/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -8
- package/dist/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -7
- package/dist/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -7
- package/dist/types/toolbar/MRT_TopToolbar.d.ts +0 -6
- package/dist/types/toolbar/index.d.ts +0 -7
- package/dist/types/types.d.ts +0 -844
- 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
|
-
|
777
|
+
SelectProps?: Partial<SelectProps>;
|
778
|
+
rowsPerPageOptions?: {
|
779
|
+
label: string;
|
780
|
+
value: number;
|
781
|
+
}[] | number[];
|
777
782
|
showRowsPerPage?: boolean;
|
778
783
|
}>) | Partial<PaginationProps & {
|
779
|
-
|
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?:
|
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",
|
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,
|