material-react-table 2.12.0 → 2.13.0
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.d.ts +16 -17
- package/dist/index.esm.js +28 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +28 -40
- package/dist/index.js.map +1 -1
- package/locales/am/index.d.ts +3 -0
- package/locales/am/index.esm.d.ts +3 -0
- package/locales/am/index.esm.js +93 -0
- package/locales/am/index.js +97 -0
- package/locales/am/package.json +6 -0
- package/locales/el/index.d.ts +3 -0
- package/locales/el/index.esm.d.ts +3 -0
- package/locales/el/index.esm.js +95 -0
- package/locales/el/index.js +99 -0
- package/locales/el/package.json +6 -0
- package/locales/hr/index.d.ts +3 -0
- package/locales/hr/index.esm.d.ts +3 -0
- package/locales/hr/index.esm.js +95 -0
- package/locales/hr/index.js +99 -0
- package/locales/hr/package.json +6 -0
- package/locales/pl/index.esm.js +5 -5
- package/locales/pl/index.js +5 -5
- package/package.json +35 -36
- package/src/components/buttons/MRT_EditActionButtons.tsx +2 -0
- package/src/components/inputs/MRT_FilterTextField.tsx +22 -44
- package/src/components/inputs/MRT_SelectCheckbox.tsx +1 -1
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -4
- package/src/components/table/MRT_TablePaper.tsx +4 -1
- package/src/components/toolbar/MRT_TablePagination.tsx +10 -12
- package/src/hooks/useMRT_ColumnVirtualizer.ts +6 -8
- package/src/hooks/useMRT_TableOptions.ts +10 -6
- package/src/locales/el.ts +96 -0
- package/src/locales/hr.ts +96 -0
- package/src/locales/pl.ts +5 -5
- package/src/types.ts +12 -13
package/dist/index.d.ts
CHANGED
@@ -630,12 +630,12 @@ type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<ColumnDef
|
|
630
630
|
column: MRT_Column<TData>;
|
631
631
|
rangeFilterIndex?: number;
|
632
632
|
table: MRT_TableInstance<TData>;
|
633
|
-
}) => DatePickerProps<
|
633
|
+
}) => DatePickerProps<never>) | DatePickerProps<never>;
|
634
634
|
muiFilterDateTimePickerProps?: ((props: {
|
635
635
|
column: MRT_Column<TData>;
|
636
636
|
rangeFilterIndex?: number;
|
637
637
|
table: MRT_TableInstance<TData>;
|
638
|
-
}) => DateTimePickerProps<
|
638
|
+
}) => DateTimePickerProps<never>) | DateTimePickerProps<never>;
|
639
639
|
muiFilterSliderProps?: ((props: {
|
640
640
|
column: MRT_Column<TData>;
|
641
641
|
table: MRT_TableInstance<TData>;
|
@@ -649,7 +649,7 @@ type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<ColumnDef
|
|
649
649
|
column: MRT_Column<TData>;
|
650
650
|
rangeFilterIndex?: number;
|
651
651
|
table: MRT_TableInstance<TData>;
|
652
|
-
}) => TimePickerProps<
|
652
|
+
}) => TimePickerProps<never>) | TimePickerProps<never>;
|
653
653
|
muiTableBodyCellProps?: ((props: {
|
654
654
|
cell: MRT_Cell<TData, TValue>;
|
655
655
|
column: MRT_Column<TData>;
|
@@ -902,12 +902,12 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
|
|
902
902
|
column: MRT_Column<TData>;
|
903
903
|
rangeFilterIndex?: number;
|
904
904
|
table: MRT_TableInstance<TData>;
|
905
|
-
}) => DatePickerProps<
|
905
|
+
}) => DatePickerProps<never>) | DatePickerProps<never>;
|
906
906
|
muiFilterDateTimePickerProps?: ((props: {
|
907
907
|
column: MRT_Column<TData>;
|
908
908
|
rangeFilterIndex?: number;
|
909
909
|
table: MRT_TableInstance<TData>;
|
910
|
-
}) => DateTimePickerProps<
|
910
|
+
}) => DateTimePickerProps<never>) | DateTimePickerProps<never>;
|
911
911
|
muiFilterSliderProps?: ((props: {
|
912
912
|
column: MRT_Column<TData>;
|
913
913
|
table: MRT_TableInstance<TData>;
|
@@ -921,7 +921,7 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
|
|
921
921
|
column: MRT_Column<TData>;
|
922
922
|
rangeFilterIndex?: number;
|
923
923
|
table: MRT_TableInstance<TData>;
|
924
|
-
}) => TimePickerProps<
|
924
|
+
}) => TimePickerProps<never>) | TimePickerProps<never>;
|
925
925
|
muiLinearProgressProps?: ((props: {
|
926
926
|
isTopToolbar: boolean;
|
927
927
|
table: MRT_TableInstance<TData>;
|
@@ -1146,7 +1146,6 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
|
|
1146
1146
|
renderTopToolbarCustomActions?: (props: {
|
1147
1147
|
table: MRT_TableInstance<TData>;
|
1148
1148
|
}) => ReactNode;
|
1149
|
-
rowCount?: number;
|
1150
1149
|
rowNumberDisplayMode?: 'original' | 'static';
|
1151
1150
|
rowPinningDisplayMode?: 'bottom' | 'select-bottom' | 'select-sticky' | 'select-top' | 'sticky' | 'top' | 'top-and-bottom';
|
1152
1151
|
rowVirtualizerInstanceRef?: MutableRefObject<MRT_RowVirtualizer | MRT_Virtualizer | null>;
|
@@ -1162,7 +1161,7 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
|
|
1162
1161
|
|
1163
1162
|
declare const flexRender: (Comp: Renderable<any>, props: any) => JSX.Element | ReactNode;
|
1164
1163
|
declare function createMRTColumnHelper<TData extends MRT_RowData>(): MRT_ColumnHelper<TData>;
|
1165
|
-
declare const createRow: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>, originalRow?: TData
|
1164
|
+
declare const createRow: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>, originalRow?: TData, rowIndex?: number, depth?: number, subRows?: MRT_Row<TData>[], parentId?: string) => MRT_Row<TData>;
|
1166
1165
|
|
1167
1166
|
declare const isCellEditable: <TData extends MRT_RowData>({ cell, table, }: {
|
1168
1167
|
cell: MRT_Cell<TData>;
|
@@ -1224,7 +1223,7 @@ declare function defaultDisplayColumnProps<TData extends MRT_RowData>({ header,
|
|
1224
1223
|
readonly enableSorting?: boolean | undefined;
|
1225
1224
|
readonly invertSorting?: boolean | undefined;
|
1226
1225
|
readonly sortDescFirst?: boolean | undefined;
|
1227
|
-
readonly sortUndefined?: false | 1 | -1 | undefined;
|
1226
|
+
readonly sortUndefined?: false | 1 | -1 | "first" | "last" | undefined;
|
1228
1227
|
readonly enableGrouping?: boolean | undefined;
|
1229
1228
|
readonly enableResizing?: boolean | undefined;
|
1230
1229
|
readonly maxSize?: number | undefined;
|
@@ -1327,16 +1326,16 @@ declare function defaultDisplayColumnProps<TData extends MRT_RowData>({ header,
|
|
1327
1326
|
column: MRT_Column<TData, unknown>;
|
1328
1327
|
table: MRT_TableInstance<TData>;
|
1329
1328
|
}) => _mui_material.CheckboxProps) | undefined;
|
1330
|
-
readonly muiFilterDatePickerProps?: _mui_x_date_pickers.DatePickerProps<
|
1329
|
+
readonly muiFilterDatePickerProps?: _mui_x_date_pickers.DatePickerProps<never, false> | ((props: {
|
1331
1330
|
column: MRT_Column<TData, unknown>;
|
1332
1331
|
rangeFilterIndex?: number | undefined;
|
1333
1332
|
table: MRT_TableInstance<TData>;
|
1334
|
-
}) => _mui_x_date_pickers.DatePickerProps<
|
1335
|
-
readonly muiFilterDateTimePickerProps?: _mui_x_date_pickers.DateTimePickerProps<
|
1333
|
+
}) => _mui_x_date_pickers.DatePickerProps<never, false>) | undefined;
|
1334
|
+
readonly muiFilterDateTimePickerProps?: _mui_x_date_pickers.DateTimePickerProps<never, false> | ((props: {
|
1336
1335
|
column: MRT_Column<TData, unknown>;
|
1337
1336
|
rangeFilterIndex?: number | undefined;
|
1338
1337
|
table: MRT_TableInstance<TData>;
|
1339
|
-
}) => _mui_x_date_pickers.DateTimePickerProps<
|
1338
|
+
}) => _mui_x_date_pickers.DateTimePickerProps<never, false>) | undefined;
|
1340
1339
|
readonly muiFilterSliderProps?: _mui_material.SliderProps | ((props: {
|
1341
1340
|
column: MRT_Column<TData, unknown>;
|
1342
1341
|
table: MRT_TableInstance<TData>;
|
@@ -1346,11 +1345,11 @@ declare function defaultDisplayColumnProps<TData extends MRT_RowData>({ header,
|
|
1346
1345
|
rangeFilterIndex?: number | undefined;
|
1347
1346
|
table: MRT_TableInstance<TData>;
|
1348
1347
|
}) => _mui_material.TextFieldProps) | undefined;
|
1349
|
-
readonly muiFilterTimePickerProps?: _mui_x_date_pickers.TimePickerProps<
|
1348
|
+
readonly muiFilterTimePickerProps?: _mui_x_date_pickers.TimePickerProps<never, false> | ((props: {
|
1350
1349
|
column: MRT_Column<TData, unknown>;
|
1351
1350
|
rangeFilterIndex?: number | undefined;
|
1352
1351
|
table: MRT_TableInstance<TData>;
|
1353
|
-
}) => _mui_x_date_pickers.TimePickerProps<
|
1352
|
+
}) => _mui_x_date_pickers.TimePickerProps<never, false>) | undefined;
|
1354
1353
|
readonly muiTableBodyCellProps?: _mui_material.TableCellProps | ((props: {
|
1355
1354
|
cell: MRT_Cell<TData, unknown>;
|
1356
1355
|
column: MRT_Column<TData, unknown>;
|
@@ -1409,7 +1408,7 @@ declare const getIsRowSelected: <TData extends MRT_RowData>({ row, table, }: {
|
|
1409
1408
|
}) => boolean | undefined;
|
1410
1409
|
declare const getMRT_RowSelectionHandler: <TData extends MRT_RowData>({ row, staticRowIndex, table, }: {
|
1411
1410
|
row: MRT_Row<TData>;
|
1412
|
-
staticRowIndex?: number
|
1411
|
+
staticRowIndex?: number;
|
1413
1412
|
table: MRT_TableInstance<TData>;
|
1414
1413
|
}) => (event: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLTableRowElement>, value?: boolean) => void;
|
1415
1414
|
declare const getMRT_SelectAllHandler: <TData extends MRT_RowData>({ table }: {
|
@@ -1422,7 +1421,7 @@ declare const useMRT_ColumnVirtualizer: <TData extends MRT_RowData, TScrollEleme
|
|
1422
1421
|
|
1423
1422
|
declare const useMRT_Effects: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>) => void;
|
1424
1423
|
|
1425
|
-
declare const useMRT_RowVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableRowElement>(table: MRT_TableInstance<TData>, rows?: MRT_Row<TData>[]
|
1424
|
+
declare const useMRT_RowVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableRowElement>(table: MRT_TableInstance<TData>, rows?: MRT_Row<TData>[]) => MRT_RowVirtualizer<TScrollElement, TItemElement> | undefined;
|
1426
1425
|
|
1427
1426
|
declare const useMRT_Rows: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>) => MRT_Row<TData>[];
|
1428
1427
|
|
package/dist/index.esm.js
CHANGED
@@ -50,6 +50,7 @@ import ViewColumnIcon from '@mui/icons-material/ViewColumn';
|
|
50
50
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
51
51
|
import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual';
|
52
52
|
import Paper from '@mui/material/Paper';
|
53
|
+
import { useTheme as useTheme$1 } from '@mui/material';
|
53
54
|
import TableContainer from '@mui/material/TableContainer';
|
54
55
|
import Table from '@mui/material/Table';
|
55
56
|
import TableBody from '@mui/material/TableBody';
|
@@ -657,7 +658,7 @@ const MRT_EditActionButtons = (_a) => {
|
|
657
658
|
}
|
658
659
|
};
|
659
660
|
return (jsx(Box, { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, { title: localization.cancel, children: jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsx(CancelIcon, {}) }) }), ((isCreating && onCreatingRowSave) ||
|
660
|
-
(isEditing && onEditingRowSave)) && (jsx(Tooltip, { title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) }))] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
|
661
|
+
(isEditing && onEditingRowSave)) && (jsx(Tooltip, { title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", disabled: isSaving, onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) }))] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { disabled: isSaving, onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
|
661
662
|
};
|
662
663
|
|
663
664
|
const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
|
@@ -1326,11 +1327,12 @@ const useMRT_TableOptions = (_a) => {
|
|
1326
1327
|
? getFacetedMinMaxValues()
|
1327
1328
|
: undefined, getFacetedRowModel: enableFacetedValues ? getFacetedRowModel() : undefined, getFacetedUniqueValues: enableFacetedValues
|
1328
1329
|
? getFacetedUniqueValues()
|
1329
|
-
: undefined, getFilteredRowModel: enableColumnFilters || enableGlobalFilter || enableFilters
|
1330
|
+
: undefined, getFilteredRowModel: (enableColumnFilters || enableGlobalFilter || enableFilters) &&
|
1331
|
+
!manualFiltering
|
1330
1332
|
? getFilteredRowModel()
|
1331
|
-
: undefined, getGroupedRowModel: enableGrouping ? getGroupedRowModel() : undefined, getPaginationRowModel: enablePagination
|
1333
|
+
: undefined, getGroupedRowModel: enableGrouping && !manualGrouping ? getGroupedRowModel() : undefined, getPaginationRowModel: enablePagination && !manualPagination
|
1332
1334
|
? getPaginationRowModel()
|
1333
|
-
: undefined, getSortedRowModel: enableSorting ? getSortedRowModel() : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, icons,
|
1335
|
+
: undefined, getSortedRowModel: enableSorting && !manualSorting ? getSortedRowModel() : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, icons,
|
1334
1336
|
layoutMode,
|
1335
1337
|
localization,
|
1336
1338
|
manualFiltering,
|
@@ -1645,22 +1647,23 @@ const extraIndexRangeExtractor = (range, draggingIndex) => {
|
|
1645
1647
|
|
1646
1648
|
const useMRT_ColumnVirtualizer = (table) => {
|
1647
1649
|
var _a, _b, _c, _d;
|
1648
|
-
const {
|
1649
|
-
const { columnPinning, draggingColumn } = getState();
|
1650
|
+
const { getState, options: { columnVirtualizerInstanceRef, columnVirtualizerOptions, enableColumnPinning, enableColumnVirtualization, }, refs: { tableContainerRef }, } = table;
|
1651
|
+
const { columnPinning, columnVisibility, draggingColumn } = getState();
|
1650
1652
|
if (!enableColumnVirtualization)
|
1651
1653
|
return undefined;
|
1652
1654
|
const columnVirtualizerProps = parseFromValuesOrFunc(columnVirtualizerOptions, {
|
1653
1655
|
table,
|
1654
1656
|
});
|
1655
|
-
const visibleColumns = getVisibleLeafColumns();
|
1657
|
+
const visibleColumns = table.getVisibleLeafColumns();
|
1656
1658
|
const [leftPinnedIndexes, rightPinnedIndexes] = useMemo(() => enableColumnPinning
|
1657
1659
|
? [
|
1658
|
-
|
1659
|
-
|
1660
|
+
table.getLeftVisibleLeafColumns().map((c) => c.getPinnedIndex()),
|
1661
|
+
table
|
1662
|
+
.getRightVisibleLeafColumns()
|
1660
1663
|
.map((column) => visibleColumns.length - column.getPinnedIndex() - 1)
|
1661
1664
|
.sort((a, b) => a - b),
|
1662
1665
|
]
|
1663
|
-
: [[], []], [columnPinning, enableColumnPinning]);
|
1666
|
+
: [[], []], [columnPinning, columnVisibility, enableColumnPinning]);
|
1664
1667
|
const numPinnedLeft = leftPinnedIndexes.length;
|
1665
1668
|
const numPinnedRight = rightPinnedIndexes.length;
|
1666
1669
|
const draggingColumnIndex = useMemo(() => (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id)
|
@@ -2803,26 +2806,12 @@ const MRT_FilterTextField = (_a) => {
|
|
2803
2806
|
const { column } = header;
|
2804
2807
|
const { columnDef } = column;
|
2805
2808
|
const { filterVariant } = columnDef;
|
2806
|
-
const
|
2807
|
-
|
2808
|
-
|
2809
|
-
})),
|
2810
|
-
const
|
2811
|
-
|
2812
|
-
table,
|
2813
|
-
}));
|
2814
|
-
const datePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterDatePickerProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterDatePickerProps, {
|
2815
|
-
column,
|
2816
|
-
table,
|
2817
|
-
}));
|
2818
|
-
const dateTimePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterDateTimePickerProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterDateTimePickerProps, {
|
2819
|
-
column,
|
2820
|
-
table,
|
2821
|
-
}));
|
2822
|
-
const timePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTimePickerProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTimePickerProps, {
|
2823
|
-
column,
|
2824
|
-
table,
|
2825
|
-
}));
|
2809
|
+
const args = { column, rangeFilterIndex, table };
|
2810
|
+
const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTextFieldProps, args)), parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, args)), rest);
|
2811
|
+
const autocompleteProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterAutocompleteProps, args)), parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps, args));
|
2812
|
+
const datePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterDatePickerProps, args)), parseFromValuesOrFunc(columnDef.muiFilterDatePickerProps, args));
|
2813
|
+
const dateTimePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterDateTimePickerProps, args)), parseFromValuesOrFunc(columnDef.muiFilterDateTimePickerProps, args));
|
2814
|
+
const timePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTimePickerProps, args)), parseFromValuesOrFunc(columnDef.muiFilterTimePickerProps, args));
|
2826
2815
|
const { allowedColumnFilterOptions, currentFilterOption, facetedUniqueValues, isAutocompleteFilter, isDateFilter, isMultiSelectFilter, isRangeFilter, isSelectFilter, isTextboxFilter, } = getColumnFilterInfo({ header, table });
|
2827
2816
|
const dropdownOptions = useDropdownOptions({ header, table });
|
2828
2817
|
const filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption)
|
@@ -3705,13 +3694,13 @@ const MRT_TablePagination = (_a) => {
|
|
3705
3694
|
var { position = 'bottom', table } = _a, rest = __rest(_a, ["position", "table"]);
|
3706
3695
|
const theme = useTheme();
|
3707
3696
|
const isMobile = useMediaQuery('(max-width: 720px)');
|
3708
|
-
const {
|
3697
|
+
const { getState, options: { enableToolbarInternalActions, icons: { ChevronLeftIcon, ChevronRightIcon, FirstPageIcon, LastPageIcon }, localization, muiPaginationProps, paginationDisplayMode, }, } = table;
|
3709
3698
|
const { pagination: { pageIndex = 0, pageSize = 10 }, showGlobalFilter, } = getState();
|
3710
3699
|
const paginationProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiPaginationProps, {
|
3711
3700
|
table,
|
3712
3701
|
})), rest);
|
3713
|
-
const totalRowCount =
|
3714
|
-
const numberOfPages =
|
3702
|
+
const totalRowCount = table.getRowCount();
|
3703
|
+
const numberOfPages = table.getPageCount();
|
3715
3704
|
const showFirstLastPageButtons = numberOfPages > 2;
|
3716
3705
|
const firstRowIndex = pageIndex * pageSize;
|
3717
3706
|
const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
|
@@ -3741,17 +3730,17 @@ const MRT_TablePagination = (_a) => {
|
|
3741
3730
|
}, 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({ MenuProps: { disableScrollLock: true }, disableUnderline: true, disabled: disabled, inputProps: {
|
3742
3731
|
'aria-label': localization.rowsPerPage,
|
3743
3732
|
id: 'mrt-rows-per-page',
|
3744
|
-
}, label: localization.rowsPerPage, onChange: (event) => setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard" }, SelectProps, { children: rowsPerPageOptions.map((option) => {
|
3733
|
+
}, label: localization.rowsPerPage, onChange: (event) => table.setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard" }, SelectProps, { children: rowsPerPageOptions.map((option) => {
|
3745
3734
|
var _a;
|
3746
3735
|
const value = typeof option !== 'number' ? option.value : option;
|
3747
3736
|
const label = typeof option !== 'number' ? option.label : `${option}`;
|
3748
3737
|
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))));
|
3749
|
-
}) }))] })), paginationDisplayMode === 'pages' ? (jsx(Pagination, Object.assign({ count: numberOfPages, disabled: disabled, onChange: (_e, newPageIndex) => setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsx(PaginationItem, Object.assign({ slots: {
|
3738
|
+
}) }))] })), paginationDisplayMode === 'pages' ? (jsx(Pagination, Object.assign({ count: numberOfPages, disabled: disabled, onChange: (_e, newPageIndex) => table.setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsx(PaginationItem, Object.assign({ slots: {
|
3750
3739
|
first: FirstPageIcon,
|
3751
3740
|
last: LastPageIcon,
|
3752
3741
|
next: ChevronRightIcon,
|
3753
3742
|
previous: ChevronLeftIcon,
|
3754
|
-
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, restPaginationProps))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", component: "span", sx: { m: '0 4px', minWidth: '8ch' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(Tooltip, Object.assign({}, tooltipProps, { title: localization.goToFirstPage, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: disableBack, onClick: () =>
|
3743
|
+
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, restPaginationProps))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", component: "span", sx: { m: '0 4px', minWidth: '8ch' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(Tooltip, Object.assign({}, tooltipProps, { title: localization.goToFirstPage, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: disableBack, onClick: () => table.firstPage(), size: "small", children: jsx(FirstPageIcon, Object.assign({}, flipIconStyles(theme))) }) }) }))), jsx(Tooltip, Object.assign({}, tooltipProps, { title: localization.goToPreviousPage, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.goToPreviousPage, disabled: disableBack, onClick: () => table.previousPage(), size: "small", children: jsx(ChevronLeftIcon, Object.assign({}, flipIconStyles(theme))) }) }) })), jsx(Tooltip, Object.assign({}, tooltipProps, { title: localization.goToNextPage, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.goToNextPage, disabled: disableNext, onClick: () => table.nextPage(), size: "small", children: jsx(ChevronRightIcon, Object.assign({}, flipIconStyles(theme))) }) }) })), showLastButton && (jsx(Tooltip, Object.assign({}, tooltipProps, { title: localization.goToLastPage, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.goToLastPage, disabled: disableNext, onClick: () => table.lastPage(), size: "small", children: jsx(LastPageIcon, Object.assign({}, flipIconStyles(theme))) }) }) })))] })] })) : null] }));
|
3755
3744
|
};
|
3756
3745
|
|
3757
3746
|
const MRT_ToolbarDropZone = (_a) => {
|
@@ -3829,9 +3818,7 @@ const MRT_ShowHideColumnsMenuItems = (_a) => {
|
|
3829
3818
|
const { columnOrder } = getState();
|
3830
3819
|
const { columnDef } = column;
|
3831
3820
|
const { columnDefType } = columnDef;
|
3832
|
-
const switchChecked =
|
3833
|
-
(columnDefType === 'group' &&
|
3834
|
-
column.getLeafColumns().some((col) => col.getIsVisible()));
|
3821
|
+
const switchChecked = column.getIsVisible();
|
3835
3822
|
const handleToggleColumnHidden = (column) => {
|
3836
3823
|
var _a, _b;
|
3837
3824
|
if (columnDefType === 'group') {
|
@@ -4110,6 +4097,7 @@ const MRT_TablePaper = (_a) => {
|
|
4110
4097
|
const { getState, options: { enableBottomToolbar, enableTopToolbar, mrtTheme: { baseBackgroundColor }, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
|
4111
4098
|
const { isFullScreen } = getState();
|
4112
4099
|
const paperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
|
4100
|
+
const theme = useTheme$1();
|
4113
4101
|
return (jsxs(Paper, Object.assign({ elevation: 2 }, paperProps, { ref: (ref) => {
|
4114
4102
|
tablePaperRef.current = ref;
|
4115
4103
|
if (paperProps === null || paperProps === void 0 ? void 0 : paperProps.ref) {
|
@@ -4129,7 +4117,7 @@ const MRT_TablePaper = (_a) => {
|
|
4129
4117
|
right: 0,
|
4130
4118
|
top: 0,
|
4131
4119
|
width: '100dvw',
|
4132
|
-
zIndex:
|
4120
|
+
zIndex: theme.zIndex.modal,
|
4133
4121
|
}
|
4134
4122
|
: {})), paperProps === null || paperProps === void 0 ? void 0 : paperProps.style), sx: (theme) => (Object.assign({ backgroundColor: baseBackgroundColor, backgroundImage: 'unset', overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx, theme))), children: [enableTopToolbar &&
|
4135
4123
|
((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsx(MRT_TopToolbar, { table: table }))), jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|