material-react-table 0.19.0-alpha.1 → 0.19.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.
@@ -6,6 +6,7 @@ import { MRT_Localization } from './localization';
6
6
  import { MRT_Icons } from './icons';
7
7
  import { MRT_FilterFns } from './filtersFns';
8
8
  import { MRT_SortingFns } from './sortingFns';
9
+ declare type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
9
10
  export declare type MRT_TableOptions<D extends Record<string, any> = {}> = Partial<Omit<TableOptions<D>, 'columns' | 'data' | 'initialState' | 'state' | 'expandRowsFn'>> & {
10
11
  columns: MRT_ColumnDef<D>[];
11
12
  data: D[];
@@ -105,7 +106,7 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
105
106
  *
106
107
  * @example accessorKey: 'username'
107
108
  */
108
- accessorKey?: keyof D;
109
+ accessorKey?: LiteralUnion<string & keyof D>;
109
110
  /**
110
111
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
111
112
  * Leave this blank if you are just creating a normal data column.
@@ -131,12 +132,14 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
131
132
  header: string;
132
133
  /**
133
134
  * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
135
+ *
134
136
  * If you have also specified an `accessorFn`, MRT still needs to have a valid `id` to be able to identify the column uniquely.
137
+ *
135
138
  * `id` defaults to the `accessorKey` or `header` if not specified.
136
139
  *
137
140
  * @default gets set to the same value as `accessorKey` by default
138
141
  */
139
- id?: string;
142
+ id?: LiteralUnion<string & keyof D>;
140
143
  muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
141
144
  table: MRT_TableInstance<D>;
142
145
  cell: MRT_Cell<D>;