@dooherceg/material-react-table 3.2.2-alpha.8 → 3.2.3

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 CHANGED
@@ -1,9 +1,8 @@
1
- import { RowData } from '@tanstack/table-core';
1
+ import * as _tanstack_react_table from '@tanstack/react-table';
2
+ import { Row, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingInfoState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, RowSelectionState, SortingState, Updater, VisibilityState, AccessorFn, DeepKeys, DeepValue, Table, TableState, Column, Header, HeaderGroup, Cell, AggregationFn, SortingFn, FilterFn, TableOptions, OnChangeFn, ColumnDef, RowData, Renderable, RowPinningPosition } from '@tanstack/react-table';
2
3
  import * as React from 'react';
3
4
  import React__default, { ReactNode, RefObject, Dispatch, SetStateAction, ChangeEvent, MouseEvent, JSX, Ref, ReactElement, DragEventHandler, HTMLAttributes, FormEventHandler } from 'react';
4
5
  import { RegisterOptions, UseFormReturn } from 'react-hook-form';
5
- import * as _tanstack_react_table from '@tanstack/react-table';
6
- import { Row, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingInfoState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, RowSelectionState, SortingState, Updater, VisibilityState, AccessorFn, DeepKeys, DeepValue, Table, TableState, Column, Header, HeaderGroup, Cell, AggregationFn, SortingFn, FilterFn, TableOptions, OnChangeFn, ColumnDef, Renderable, RowPinningPosition } from '@tanstack/react-table';
7
6
  import { VirtualItem, VirtualizerOptions, Virtualizer } from '@tanstack/react-virtual';
8
7
  import { AlertProps } from '@mui/material/Alert';
9
8
  import { AutocompleteProps } from '@mui/material/Autocomplete';
@@ -535,6 +534,7 @@ type MRT_TableInstance<TData extends MRT_RowData> = Omit<Table<TData>, 'getAllCo
535
534
  setShowProgressBars: Dispatch<SetStateAction<boolean>>;
536
535
  setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
537
536
  setShowAdvancedFilters: Dispatch<SetStateAction<boolean>>;
537
+ _showAdvancedFiltersSetterRef: RefObject<Dispatch<SetStateAction<boolean>> | null>;
538
538
  setNewEntryModal: Dispatch<SetStateAction<MRT_NewEntryModalState>>;
539
539
  setRowReorderingSelection: Dispatch<SetStateAction<MRT_RowReorderingSelectionState>>;
540
540
  addRow: (rows: MRT_RowManipulationInput<TData>) => void;
@@ -580,13 +580,6 @@ interface MRT_TableState<TData extends MRT_RowData> extends TableState {
580
580
  rowReorderingSelection: MRT_RowReorderingSelectionState;
581
581
  }
582
582
  interface MRT_ColumnDefBase<TData extends MRT_RowData, TValue = unknown> extends Omit<ColumnDef<TData, TValue>, 'accessorKey' | 'aggregatedCell' | 'aggregationFn' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> {
583
- /**
584
- * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
585
- * Specify a function here to point to the correct property in the data object.
586
- *
587
- * @example accessorFn: (row) => row.username
588
- */
589
- accessorFn?: (originalRow: TData) => TValue;
590
583
  /**
591
584
  * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
592
585
  * Specify which key in the row this column should use to access the correct data.
@@ -595,7 +588,7 @@ interface MRT_ColumnDefBase<TData extends MRT_RowData, TValue = unknown> extends
595
588
  * @example accessorKey: 'username' //simple
596
589
  * @example accessorKey: 'name.firstName' //deep key dot notation
597
590
  */
598
- accessorKey?: DeepKeys<TData> | (string & {});
591
+ accessorKey: DeepKeys<TData> | (string & {});
599
592
  AggregatedCell?: (props: {
600
593
  cell: MRT_Cell<TData, TValue>;
601
594
  column: MRT_Column<TData, TValue>;
@@ -1556,7 +1549,7 @@ interface MRT_FormSectionConfig {
1556
1549
  interface IIconColTypeValue {
1557
1550
  color: string;
1558
1551
  description: string;
1559
- iconCode: string;
1552
+ iconCode: number;
1560
1553
  additional?: Record<string, Omit<IIconColTypeValue, 'additional'>>;
1561
1554
  }
1562
1555
  type MRT_AvailableIconOption = {
@@ -1572,17 +1565,7 @@ interface MRT_DimensionsDef {
1572
1565
  };
1573
1566
  fieldsPerRow?: number;
1574
1567
  }
1575
- declare module '@tanstack/table-core' {
1576
- interface ColumnMeta<TData extends RowData, TValue> {
1577
- enumValues?: Array<{
1578
- value: string;
1579
- label: string;
1580
- }>;
1581
- availableIcons?: MRT_AvailableIconOption[];
1582
- dimensions?: MRT_DimensionsDef;
1583
- extraFieldFilters?: MRT_ColumnDef<TData, TValue>[];
1584
- }
1585
- }
1568
+ type ExtraFieldFilterOption<TData extends RowData> = Pick<MRT_ColumnDef<TData & MRT_RowData>, 'type' | 'accessorKey' | 'header' | 'meta'>;
1586
1569
  declare module '@tanstack/react-table' {
1587
1570
  interface ColumnMeta<TData extends RowData, TValue> {
1588
1571
  enumValues?: Array<{
@@ -1591,7 +1574,7 @@ declare module '@tanstack/react-table' {
1591
1574
  }>;
1592
1575
  availableIcons?: MRT_AvailableIconOption[];
1593
1576
  dimensions?: MRT_DimensionsDef;
1594
- extraFieldFilters?: MRT_ColumnDef<TData, TValue>[];
1577
+ extraFieldFilters?: ExtraFieldFilterOption<TData>[];
1595
1578
  }
1596
1579
  }
1597
1580
 
@@ -1761,6 +1744,7 @@ type MaterialReactServerTableInstanceProps<TData extends MRT_RowData> = Partial<
1761
1744
  editRowFn?: ({ rowToEdit, table, }: OnEditActionContext<TData>) => Promise<void> | void;
1762
1745
  enableResetState?: boolean;
1763
1746
  resetState?: (table: MRT_TableInstance<TData>) => Promise<void> | void;
1747
+ extendColumns?: Partial<MRT_ColumnDef<TData>>[];
1764
1748
  };
1765
1749
 
1766
1750
  type MaterialReactServerTableProps<TData extends MRT_RowData> = Omit<MaterialReactServerTableInstanceProps<TData>, 'config'> & {
@@ -1792,8 +1776,9 @@ interface MRT_TableBodyCellProps<TData extends MRT_RowData> extends TableCellPro
1792
1776
  staticColumnIndex?: number;
1793
1777
  staticRowIndex: number;
1794
1778
  table: MRT_TableInstance<TData>;
1779
+ theme: Theme;
1795
1780
  }
1796
- declare const MRT_TableBodyCell: <TData extends MRT_RowData>({ cell, numRows, rowRef, staticColumnIndex, staticRowIndex, table, ...rest }: MRT_TableBodyCellProps<TData>) => react_jsx_runtime.JSX.Element;
1781
+ declare const MRT_TableBodyCell: <TData extends MRT_RowData>({ cell, numRows, rowRef, staticColumnIndex, staticRowIndex, table, theme, ...rest }: MRT_TableBodyCellProps<TData>) => react_jsx_runtime.JSX.Element;
1797
1782
  declare const Memo_MRT_TableBodyCell: typeof MRT_TableBodyCell;
1798
1783
 
1799
1784
  interface MRT_TableBodyCellValueProps<TData extends MRT_RowData> {
@@ -1813,9 +1798,10 @@ interface MRT_TableBodyRowProps<TData extends MRT_RowData> extends TableRowProps
1813
1798
  rowVirtualizer?: MRT_RowVirtualizer;
1814
1799
  staticRowIndex: number;
1815
1800
  table: MRT_TableInstance<TData>;
1801
+ theme: Theme;
1816
1802
  virtualRow?: VirtualItem;
1817
1803
  }
1818
- declare const MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, virtualRow, ...rest }: MRT_TableBodyRowProps<TData>) => react_jsx_runtime.JSX.Element;
1804
+ declare const MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, theme, virtualRow, ...rest }: MRT_TableBodyRowProps<TData>) => react_jsx_runtime.JSX.Element;
1819
1805
  declare const Memo_MRT_TableBodyRow: typeof MRT_TableBodyRow;
1820
1806
 
1821
1807
  interface MRT_TableBodyRowGrabHandleProps<TData extends MRT_RowData> extends IconButtonProps {