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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.19.0-alpha.1",
2
+ "version": "0.19.0",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI implementation of TanStack React Table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
@@ -46,6 +46,8 @@ import { MRT_TableRoot } from './table/MRT_TableRoot';
46
46
  import { MRT_FilterFns } from './filtersFns';
47
47
  import { MRT_SortingFns } from './sortingFns';
48
48
 
49
+ type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
50
+
49
51
  export type MRT_TableOptions<D extends Record<string, any> = {}> = Partial<
50
52
  Omit<
51
53
  TableOptions<D>,
@@ -206,7 +208,7 @@ export type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<
206
208
  *
207
209
  * @example accessorKey: 'username'
208
210
  */
209
- accessorKey?: keyof D;
211
+ accessorKey?: LiteralUnion<string & keyof D>;
210
212
  /**
211
213
  * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
212
214
  * Leave this blank if you are just creating a normal data column.
@@ -229,12 +231,14 @@ export type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<
229
231
  header: string;
230
232
  /**
231
233
  * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
234
+ *
232
235
  * If you have also specified an `accessorFn`, MRT still needs to have a valid `id` to be able to identify the column uniquely.
236
+ *
233
237
  * `id` defaults to the `accessorKey` or `header` if not specified.
234
238
  *
235
239
  * @default gets set to the same value as `accessorKey` by default
236
240
  */
237
- id?: string;
241
+ id?: LiteralUnion<string & keyof D>;
238
242
  muiTableBodyCellCopyButtonProps?:
239
243
  | ButtonProps
240
244
  | (({