schummar-table 0.46.9 → 0.47.2

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.
Files changed (55) hide show
  1. package/dist/chunk-CTAAG5j7.js +13 -0
  2. package/dist/chunk-pbleEpgJ.cjs +44 -0
  3. package/dist/csvExporter-BGoiph1b.cjs +41 -0
  4. package/dist/csvExporter-BGoiph1b.cjs.map +1 -0
  5. package/dist/csvExporter-DRm4V8We.js +35 -0
  6. package/dist/csvExporter-DRm4V8We.js.map +1 -0
  7. package/dist/csvExporter.cjs +2 -78
  8. package/dist/csvExporter.d.cts +15 -13
  9. package/dist/csvExporter.d.ts +15 -13
  10. package/dist/csvExporter.js +3 -8
  11. package/dist/excelExporter.cjs +18 -38
  12. package/dist/excelExporter.cjs.map +1 -1
  13. package/dist/excelExporter.d.cts +7 -6
  14. package/dist/excelExporter.d.ts +7 -5
  15. package/dist/excelExporter.js +16 -19
  16. package/dist/excelExporter.js.map +1 -1
  17. package/dist/exporter-BxgFAyWA.d.ts +24 -0
  18. package/dist/exporter-ztSF5GbY.d.cts +24 -0
  19. package/dist/index.cjs +3422 -5328
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +207 -168
  22. package/dist/index.d.ts +205 -168
  23. package/dist/index.js +3378 -4413
  24. package/dist/index.js.map +1 -1
  25. package/dist/mui4Theme.cjs +62 -905
  26. package/dist/mui4Theme.cjs.map +1 -1
  27. package/dist/mui4Theme.d.cts +14 -10
  28. package/dist/mui4Theme.d.ts +14 -10
  29. package/dist/mui4Theme.js +54 -77
  30. package/dist/mui4Theme.js.map +1 -1
  31. package/dist/mui5Theme.cjs +62 -901
  32. package/dist/mui5Theme.cjs.map +1 -1
  33. package/dist/mui5Theme.d.cts +14 -10
  34. package/dist/mui5Theme.d.ts +14 -10
  35. package/dist/mui5Theme.js +57 -76
  36. package/dist/mui5Theme.js.map +1 -1
  37. package/dist/tableSettings-BxCzVAiu.cjs +740 -0
  38. package/dist/tableSettings-BxCzVAiu.cjs.map +1 -0
  39. package/dist/tableSettings-C5bAcuVw.js +675 -0
  40. package/dist/tableSettings-C5bAcuVw.js.map +1 -0
  41. package/dist/types-CemO-cBr.d.ts +433 -0
  42. package/dist/types-lBtXAU-l.d.cts +433 -0
  43. package/package.json +30 -70
  44. package/dist/chunk-EEBUKP6F.js +0 -64
  45. package/dist/chunk-EEBUKP6F.js.map +0 -1
  46. package/dist/chunk-NTYYITKA.js +0 -803
  47. package/dist/chunk-NTYYITKA.js.map +0 -1
  48. package/dist/chunk-WFCJ3D3G.js +0 -47
  49. package/dist/chunk-WFCJ3D3G.js.map +0 -1
  50. package/dist/csvExporter.cjs.map +0 -1
  51. package/dist/csvExporter.js.map +0 -1
  52. package/dist/exporter-u6SatTo6.d.cts +0 -22
  53. package/dist/exporter-u6SatTo6.d.ts +0 -22
  54. package/dist/types-CADdapzE.d.cts +0 -437
  55. package/dist/types-DNdXIGcn.d.ts +0 -437
@@ -0,0 +1,433 @@
1
+ import { ExportOptions } from "./exporter-ztSF5GbY.cjs";
2
+ import React, { CSSProperties, ComponentType, DependencyList, ReactNode, Ref } from "react";
3
+ import { Interpolation, Theme } from "@emotion/react";
4
+ import { Store } from "schummar-state/react";
5
+
6
+ //#region src/internalState/tableStateStorage.d.ts
7
+ type TableStateStorage = {
8
+ getItem: (key: string) => string | null | Promise<string | null>;
9
+ setItem: (key: string, value: string) => unknown | Promise<unknown>;
10
+ removeItem: (key: string) => unknown | Promise<unknown>;
11
+ } & ({
12
+ keys: () => string[] | Promise<string[]>;
13
+ } | {
14
+ length: number | (() => number | Promise<number>);
15
+ key: (keyIndex: number) => string | null | Promise<string | null>;
16
+ });
17
+ //#endregion
18
+ //#region src/types.d.ts
19
+ type Sort = {
20
+ columnId: string | number;
21
+ direction: SortDirection;
22
+ };
23
+ type SortDirection = 'asc' | 'desc';
24
+ type Id = string | number;
25
+ type KeyOfType<T, S> = { [K in keyof T]: T[K] extends S ? K : never }[keyof T];
26
+ type FunctionWithDeps<F extends (...args: any[]) => any> = F | [function: F, ...deps: DependencyList];
27
+ type MemoizedFunctions<T> = { [K in keyof T]: Exclude<T[K], [function: (...args: any[]) => any, ...deps: DependencyList]> };
28
+ type CSSInterpolation = Exclude<Interpolation<Theme>, ((...args: any[]) => any) | Array<any>>;
29
+ type Falsy = false | 0 | '' | null | undefined;
30
+ type DisplaySize = 'desktop' | 'mobile' | (string & {});
31
+ type DisplaySizes = Partial<Record<DisplaySize, number>>;
32
+ interface TableTheme<TItem = unknown> {
33
+ /** Define display texts. */
34
+ text: {
35
+ selectColumns: ReactNode;
36
+ showAllColumns: ReactNode;
37
+ hideAllColumns: ReactNode;
38
+ noResults: ReactNode;
39
+ exportTitle: ReactNode;
40
+ exportCopy: ReactNode;
41
+ exportDownload: ReactNode;
42
+ today: ReactNode;
43
+ thisWeek: ReactNode;
44
+ thisMonth: ReactNode;
45
+ thisYear: ReactNode;
46
+ lastSevenDays: ReactNode;
47
+ lastThirtyDays: ReactNode;
48
+ reset: ReactNode;
49
+ loading: ReactNode;
50
+ clearFilters: ReactNode;
51
+ deselectAll: ReactNode;
52
+ resetAll: ReactNode;
53
+ rangeMin: ReactNode;
54
+ rangeMax: ReactNode;
55
+ calendarWeek: ReactNode;
56
+ };
57
+ /** Define styles. */
58
+ classes?: {
59
+ table?: string;
60
+ row?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
61
+ headerCell?: string;
62
+ footerCell?: string;
63
+ cell?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
64
+ evenCell?: string;
65
+ oddCell?: string;
66
+ popover?: string;
67
+ popoverBackdrop?: string;
68
+ columnDivider?: string;
69
+ details?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
70
+ };
71
+ styles?: {
72
+ table?: Interpolation<Theme>;
73
+ row?: CSSInterpolation | FunctionWithDeps<(item: TItem, index: number) => CSSInterpolation | CSSInterpolation[]>;
74
+ headerCell?: Interpolation<Theme>;
75
+ footerCell?: Interpolation<Theme>;
76
+ cell?: CSSInterpolation | FunctionWithDeps<(item: TItem, index: number) => Interpolation<Theme>>;
77
+ evenCell?: Interpolation<Theme>;
78
+ oddCell?: Interpolation<Theme>;
79
+ popover?: Interpolation<Theme>;
80
+ popoverBackdrop?: CSSInterpolation;
81
+ columnDivider?: Interpolation<Theme>;
82
+ details?: Exclude<Interpolation<Theme>, ((...args: any[]) => any) | Array<any>> | FunctionWithDeps<(item: TItem, index: number) => Interpolation<Theme>>;
83
+ };
84
+ /** Define components to be used in the table. */
85
+ components: {
86
+ IconButton: ComponentType<{
87
+ children: ReactNode;
88
+ onClick?: (event: React.MouseEvent<Element>) => void;
89
+ onContextMenu?: (event: React.MouseEvent<Element>) => void;
90
+ className?: string;
91
+ type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
92
+ }>;
93
+ Button: ComponentType<{
94
+ children: ReactNode;
95
+ onClick?: (event: React.MouseEvent<Element>) => void;
96
+ onContextMenu?: (event: React.MouseEvent<Element>) => void;
97
+ startIcon?: ReactNode;
98
+ variant?: 'text' | 'outlined' | 'contained';
99
+ disabled?: boolean;
100
+ className?: string;
101
+ type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
102
+ }>;
103
+ Checkbox: ComponentType<{
104
+ checked: boolean;
105
+ onChange: (event: React.ChangeEvent) => void;
106
+ disabled?: boolean;
107
+ className?: string;
108
+ }>;
109
+ Popover: ComponentType<{
110
+ anchorEl: Element | null;
111
+ open: boolean;
112
+ hidden?: boolean;
113
+ onClose: () => void;
114
+ children: ReactNode;
115
+ className?: string;
116
+ backdropClassName?: string;
117
+ align?: 'center' | 'left';
118
+ }>;
119
+ Badge: ComponentType<{
120
+ children: ReactNode;
121
+ badgeContent: ReactNode;
122
+ }>;
123
+ TextField: ComponentType<{
124
+ value?: string | null;
125
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
126
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
127
+ startIcon?: ReactNode;
128
+ endIcon?: ReactNode;
129
+ className?: string;
130
+ inputRef?: Ref<HTMLInputElement>;
131
+ placeholder?: string;
132
+ }>;
133
+ Spinner: (props: {
134
+ className?: string;
135
+ }) => JSX.Element;
136
+ };
137
+ /** Define icons for the table. */
138
+ icons: { [K in 'Settings' | 'Export' | 'Clipboard' | 'ChevronRight' | 'Search' | 'Clear' | 'ArrowDropDown' | 'FilterList' | 'ArrowUpward']: ComponentType<{
139
+ className?: string;
140
+ }> };
141
+ /** Define colors */
142
+ colors: {
143
+ primary: {
144
+ main: string;
145
+ light: string;
146
+ contrastText: string;
147
+ };
148
+ secondary: {
149
+ main: string;
150
+ light: string;
151
+ contrastText: string;
152
+ };
153
+ blocked: {
154
+ main: string;
155
+ light: string;
156
+ contrastText: string;
157
+ };
158
+ background: string;
159
+ text: string;
160
+ border: string;
161
+ borderLight: string;
162
+ };
163
+ /** Spacing. */
164
+ spacing: string | number;
165
+ /** Locale for number and date rendering */
166
+ locale?: string;
167
+ }
168
+ type PartialTableTheme<TItem = unknown> = { [K in keyof TableTheme<TItem>]?: TableTheme<TItem>[K] extends Record<string, any> ? Partial<TableTheme<TItem>[K]> : TableTheme<TItem>[K] };
169
+ type MemoizedTableTheme<TItem> = Omit<TableTheme, 'classes' | 'styles' | 'text'> & {
170
+ classes: MemoizedFunctions<TableTheme<TItem>['classes']>;
171
+ styles: MemoizedFunctions<TableTheme<TItem>['styles']>;
172
+ text: MemoizedFunctions<TableTheme<TItem>['text']>;
173
+ };
174
+ type ColumnGenerator<TItem> = (col: ColumnFactory<TItem>) => (Column<TItem, any> | Falsy)[];
175
+ type ColumnFactory<TItem> = <TColumnValue>(value: (item: TItem) => TColumnValue, column: Omit<Column<TItem, TColumnValue>, 'value'>) => Column<TItem, TColumnValue>;
176
+ interface TableProps<TItem> extends PartialTableTheme<TItem> {
177
+ /** The data to be rendered. One item per row. */
178
+ items?: readonly TItem[];
179
+ /** Unique id for each item/row. */
180
+ id: FunctionWithDeps<(item: TItem) => Id> | KeyOfType<TItem, Id>;
181
+ /** Create a nested structure by assigning parents to items. Child items are hidden until the parent is expanded. */
182
+ parentId?: FunctionWithDeps<(item: TItem) => Id | undefined> | KeyOfType<TItem, Id | undefined | null>;
183
+ /** If true for an item, it means that children will be loaded asynchronously as soon as item is expanded. */
184
+ hasDeferredChildren?: (item: TItem) => boolean;
185
+ /** Column definitions. */
186
+ columns: (Column<TItem, any> | Falsy)[] | ColumnGenerator<TItem>;
187
+ /** Default props for all column. Will take effect if not overriden in column definition. */
188
+ defaultColumnProps?: Omit<Column<TItem, unknown>, 'id' | 'value'>;
189
+ /** Set props for multiple columns at once. Will take effect if not overriden in column definition. */
190
+ columnProps?: FunctionWithDeps<(id: Id) => Partial<Omit<Column<TItem, unknown>, 'id'>>>;
191
+ /** Wrap each row */
192
+ wrapRow?: FunctionWithDeps<(props: {
193
+ className?: string;
194
+ style?: CSSProperties;
195
+ children?: ReactNode;
196
+ }, item: TItem, index: number) => ReactNode>;
197
+ /** Wrap each cell */
198
+ wrapCell?: FunctionWithDeps<(content: ReactNode, value: unknown, item: TItem, index: number) => ReactNode>;
199
+ /** Display a cell at the start of each row. Useful for "go to details" button for example. */
200
+ rowAction?: ReactNode | FunctionWithDeps<(item: TItem, index: number) => ReactNode>;
201
+ /** Expand row to show details. */
202
+ rowDetails?: ReactNode | FunctionWithDeps<(item: TItem, index: number) => ReactNode>;
203
+ /** Default sort order. */
204
+ defaultSort?: Sort[];
205
+ /** If given, controls the sort order. */
206
+ sort?: Sort[];
207
+ /** Called when sort order changes. */
208
+ onSortChange?: (sort: Sort[]) => void;
209
+ /** Handle sorting externally, e.g. server side */
210
+ externalSort?: boolean;
211
+ /** Disable sort for all columns (can be override per column) */
212
+ disableSort?: boolean;
213
+ /** Default selection. */
214
+ defaultSelection?: Set<Id>;
215
+ /** If given, controls the selection. */
216
+ selection?: Set<Id>;
217
+ /** Called when selection changes. */
218
+ onSelectionChange?: (selection: Set<Id>) => void;
219
+ /** Whether to show checkboxes at the start of each row.
220
+ * @default true
221
+ */
222
+ enableSelection?: boolean;
223
+ /** Select and deselect children if a parent is selected or deselected.
224
+ * @default true
225
+ */
226
+ selectSyncChildren?: boolean;
227
+ /** Expand parents whose children fit a newly selected filter
228
+ * @default false
229
+ */
230
+ revealFiltered?: boolean;
231
+ /** Default expanded rows. */
232
+ defaultExpanded?: Set<Id>;
233
+ /** If given, controls expanded rows. */
234
+ expanded?: Set<Id>;
235
+ /** Called when expanded rows change. */
236
+ onExpandedChange?: (expanded: Set<Id>) => void;
237
+ /** If enabled and one row is expanded, other rows will be closed.
238
+ * @default false
239
+ */
240
+ expandOnlyOne?: boolean;
241
+ /** Default hidden columns. */
242
+ defaultHiddenColumns?: Set<Id>;
243
+ /** If given, controls hidden columns. */
244
+ hiddenColumns?: Set<Id>;
245
+ /** Called when hidden columns change. */
246
+ onHiddenColumnsChange?: (hiddenColumns: Set<Id>) => void;
247
+ /** Whether to stretch the table component over the available space. If value is "left" or "right", align accordingly. */
248
+ fullWidth?: boolean | 'left' | 'right';
249
+ /** Whether the table header should be sticky.
250
+ * @default true
251
+ */
252
+ stickyHeader?: boolean | {
253
+ top: number;
254
+ };
255
+ /** Whether the table footer should be sticky.
256
+ * @default true
257
+ */
258
+ stickyFooter?: boolean | {
259
+ bottom: number;
260
+ };
261
+ /** Whether the table cells should only be rendered when in viewport.
262
+ * @default true
263
+ */
264
+ virtual?: boolean | {
265
+ rowHeight?: number;
266
+ initalRowHeight?: number;
267
+ throttleScroll?: number;
268
+ overscan?: number;
269
+ overscanBottom?: number;
270
+ overscanTop?: number;
271
+ };
272
+ /** Whether to use a subgrid layout */
273
+ subgrid?: boolean;
274
+ /** Enable menu to select which columns are visible.
275
+ * @default true
276
+ */
277
+ enableColumnSelection?: boolean;
278
+ /** Enable exporting to csv.
279
+ * @default false
280
+ */
281
+ enableExport?: boolean | ExportOptions;
282
+ /** Shows a button to clear all filters while any are active
283
+ * @default false
284
+ */
285
+ enableClearFiltersButton?: boolean;
286
+ /** Allow to drag and drop column separators to resize the column left of it.
287
+ * @default true
288
+ */
289
+ enableColumnResize?: boolean | 'visualOnly';
290
+ /** Allow to drag and drop column header to reorder columns.
291
+ * @default true
292
+ */
293
+ enableColumnReorder?: boolean;
294
+ /** If enabled, automatically store table state in localStorage, localForage or another compatible storage. */
295
+ persist?: {
296
+ storage: TableStateStorage;
297
+ id: string;
298
+ include?: ('sort' | 'selection' | 'expanded' | 'hiddenColumns' | 'filterValues' | 'columnWidths' | 'columnOrder')[];
299
+ exclude?: ('sort' | 'selection' | 'expanded' | 'hiddenColumns' | 'filterValues' | 'columnWidths' | 'columnOrder')[];
300
+ };
301
+ /** The current screen size. Used to determine which columns to display.
302
+ * Either assert the size manually - e.g. "mobile" or "desktop".
303
+ * Or provide a map of screen sizes to maximum pixel widths of the screen.
304
+ * If not provided, <= 400 px will be "mobile", else "desktop".
305
+ *
306
+ * @example
307
+ * displaySize: 'mobile' // assert the size manually
308
+ * displaySize: { mobile: 450, desktop: Infinity } // provide a map of screen sizes
309
+ * */
310
+ displaySize?: DisplaySize | DisplaySizes;
311
+ displaySizeOverrides?: Partial<Record<DisplaySize, Partial<Omit<TableProps<TItem>, 'displaySize' | 'displaySizeOverrides'>>>>;
312
+ debug?: (...output: any) => void;
313
+ debugRender?: (...output: any) => void;
314
+ onReset?: (scope?: 'table' | 'filters') => void;
315
+ }
316
+ interface TableRef {
317
+ getSort: () => Sort[];
318
+ setSort: (sort: Sort[]) => void;
319
+ getSelection: () => Set<Id>;
320
+ setSelection: (selection: Set<Id>) => void;
321
+ getExpanded: () => Set<Id>;
322
+ setExpanded: (expanded: Set<Id>) => void;
323
+ getHiddenColumns: () => Set<Id>;
324
+ setHiddenColumns: (hidden: Set<Id>) => void;
325
+ }
326
+ type InternalTableProps<TItem> = MemoizedFunctions<Omit<TableProps<TItem>, 'id' | 'parentId' | 'columns' | 'defaultColumnProps' | 'displaySizeOverrides'> & {
327
+ id: (item: TItem) => Id;
328
+ parentId?: (item: TItem) => Id | undefined;
329
+ columns: InternalColumn<TItem, unknown>[];
330
+ displaySizeOverrides?: Partial<Record<DisplaySize, Partial<Omit<InternalTableProps<TItem>, 'displaySize' | 'displaySizeOverrides'>>>>;
331
+ }>;
332
+ type TableItem<TItem = unknown> = {
333
+ id: Id;
334
+ parentId?: Id | null;
335
+ children: TableItem<TItem>[];
336
+ value: TItem;
337
+ };
338
+ type Column<TItem, TColumnValue> = {
339
+ /** Column id. If not provided, the index in the column array will be used.
340
+ * An explicit id is better however for controlling column related states, persitance etc.
341
+ */
342
+ id?: string;
343
+ /** Render table header for this column. */
344
+ header?: ReactNode;
345
+ exportHeader?: string | number | Date;
346
+ /** Render table header for this column. */
347
+ footer?: ReactNode;
348
+ /** Extract value for this column */
349
+ value: FunctionWithDeps<(item: TItem) => TColumnValue>;
350
+ /** Render table cell. If not provided, a string representation of the value will be rendered. */
351
+ renderCell?: FunctionWithDeps<(value: TColumnValue, item: TItem) => ReactNode>;
352
+ /** Serialize column value for exports. If not provided, a string representation of the value will be used. */
353
+ exportCell?: (value: TColumnValue, item: TItem) => string | number | Date;
354
+ /** Customize sort criteria. By default it will be the value itself in case it's a number or Date, or a string representation of the value otherwise. */
355
+ sortBy?: FunctionWithDeps<(value: TColumnValue, item: TItem) => unknown>[];
356
+ /** Disable sort for this column */
357
+ disableSort?: boolean;
358
+ /** Set filter component that will be displayed in the column header */
359
+ filter?: ReactNode;
360
+ /** Override whether the column is hidden. If set, prevents toggling the column via menu. */
361
+ hidden?: boolean;
362
+ /** Specify a css width.
363
+ * @default 'max-content'
364
+ */
365
+ width?: string;
366
+ /** Provide css class names to override columns styles. */
367
+ classes?: Omit<NonNullable<TableTheme<TItem>['classes']>, 'table' | 'details'>;
368
+ /** Provide css styles to override columns styles. */
369
+ styles?: Omit<NonNullable<TableTheme<TItem>['styles']>, 'table' | 'details'>;
370
+ /** Specify the screen size(s) for which this column should be displayed. */
371
+ displaySize?: DisplaySize | DisplaySize[];
372
+ };
373
+ type InternalColumn<TItem, TColumnValue> = MemoizedFunctions<Required<Omit<Column<TItem, TColumnValue>, 'id' | 'sortBy' | 'displaySize'>, 'header' | 'exportHeader' | 'renderCell' | 'exportCell' | 'sortBy'> & {
374
+ id: Id;
375
+ sortBy: ((value: TColumnValue, item: TItem) => unknown)[];
376
+ displaySize: DisplaySize[] | undefined;
377
+ }>;
378
+ type Required<T, S> = T & { [P in keyof T as P extends S ? P : never]-?: T[P] };
379
+ type InternalTableState<TItem> = {
380
+ normalizedProps: InternalTableProps<TItem>;
381
+ props: InternalTableProps<TItem>;
382
+ key: any;
383
+ sort: Sort[];
384
+ selection: Set<Id>;
385
+ expanded: Set<Id>;
386
+ rowHeights: Map<Id, number>;
387
+ filters: Map<Id, MemoizedFunctions<FilterImplementation<TItem, any, any, any>>>;
388
+ filterValues: Map<Id, any>;
389
+ hiddenColumns: Set<Id>;
390
+ columnWidths: Map<Id, string>;
391
+ columnOrder: Id[];
392
+ columnStyleOverride: Map<Id, CSSProperties>;
393
+ activeColumns: InternalColumn<TItem, unknown>[];
394
+ visibleColumns: InternalColumn<TItem, unknown>[];
395
+ items: TableItem<TItem>[];
396
+ itemsById: Map<Id, TableItem<TItem>>;
397
+ activeItems: TableItem<TItem>[];
398
+ activeItemsById: Map<Id, TableItem<TItem>>;
399
+ lastSelectedId?: Id;
400
+ displaySizePx: number | undefined;
401
+ displaySize: DisplaySize | undefined;
402
+ };
403
+ type CommonFilterProps<TItem, TColumnValue, TFilterBy, TFilterValue> = {
404
+ /** Filter by? By default the column value will be used. If filterBy returns an array, an items will be active if at least one entry matches the active filter. */
405
+ filterBy?: FunctionWithDeps<(value: TColumnValue, item: TItem) => TFilterBy | TFilterBy[]>;
406
+ /** Preselected filter value. */
407
+ defaultValue?: TFilterValue;
408
+ /** Controlled filter value. */
409
+ value?: TFilterValue;
410
+ /** Notifies on filter change. */
411
+ onChange?: (value?: TFilterValue) => void;
412
+ /** Table should not filter using this filter. It will be done externally, e.g. server side. */
413
+ external?: boolean;
414
+ /** Whether to persist filter value (given that filter persitance is enabled for the table).
415
+ * @default true
416
+ */
417
+ persist?: boolean;
418
+ classNames?: {
419
+ popover?: string;
420
+ popoverBackdrop?: string;
421
+ };
422
+ };
423
+ type FilterImplementation<TItem, TColumnValue, TFilterBy, TFilterValue> = CommonFilterProps<TItem, TColumnValue, TFilterBy, TFilterValue> & {
424
+ /** Unique filter id. Used to persist filter values. */
425
+ id: string;
426
+ /** Whether the filter is active currently. */
427
+ isActive: (filterValue: TFilterValue) => boolean;
428
+ /** When the filter is active, this function is used to filter the items to be displayed. */
429
+ test: (filterValue: TFilterValue, value: TFilterBy) => boolean;
430
+ };
431
+ //#endregion
432
+ export { Column, CommonFilterProps, FilterImplementation, FunctionWithDeps, Id, InternalColumn, InternalTableState, MemoizedTableTheme, PartialTableTheme, Sort, SortDirection, TableItem, TableProps, TableRef, TableStateStorage, TableTheme };
433
+ //# sourceMappingURL=types-lBtXAU-l.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schummar-table",
3
- "version": "0.46.9",
3
+ "version": "0.47.2",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": "schummar/schummar-table",
@@ -15,70 +15,39 @@
15
15
  ],
16
16
  "exports": {
17
17
  ".": {
18
- "import": {
19
- "types": "./dist/index.d.ts",
20
- "default": "./dist/index.js"
21
- },
22
- "require": {
23
- "types": "./dist/index.d.cts",
24
- "default": "./dist/index.cjs"
25
- }
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
26
20
  },
27
- "./mui5Theme": {
28
- "import": {
29
- "types": "./dist/mui5Theme.d.ts",
30
- "default": "./dist/mui5Theme.js"
31
- },
32
- "require": {
33
- "types": "./dist/mui5Theme.d.cts",
34
- "default": "./dist/mui5Theme.cjs"
35
- }
21
+ "./csvExporter": {
22
+ "import": "./dist/csvExporter.js",
23
+ "require": "./dist/csvExporter.cjs"
24
+ },
25
+ "./excelExporter": {
26
+ "import": "./dist/excelExporter.js",
27
+ "require": "./dist/excelExporter.cjs"
36
28
  },
37
29
  "./mui4Theme": {
38
- "import": {
39
- "types": "./dist/mui4Theme.d.ts",
40
- "default": "./dist/mui4Theme.js"
41
- },
42
- "require": {
43
- "types": "./dist/mui4Theme.d.cts",
44
- "default": "./dist/mui4Theme.cjs"
45
- }
30
+ "import": "./dist/mui4Theme.js",
31
+ "require": "./dist/mui4Theme.cjs"
46
32
  },
47
- "./csvExporter": {
48
- "import": {
49
- "types": "./dist/csvExporter.d.ts",
50
- "default": "./dist/csvExporter.js"
51
- },
52
- "require": {
53
- "types": "./dist/csvExporter.d.cts",
54
- "default": "./dist/csvExporter.cjs"
55
- }
33
+ "./mui5Theme": {
34
+ "import": "./dist/mui5Theme.js",
35
+ "require": "./dist/mui5Theme.cjs"
56
36
  },
57
- "./excelExporter": {
58
- "import": {
59
- "types": "./dist/excelExporter.d.ts",
60
- "default": "./dist/excelExporter.js"
61
- },
62
- "require": {
63
- "types": "./dist/excelExporter.d.cts",
64
- "default": "./dist/excelExporter.cjs"
65
- }
66
- }
37
+ "./package.json": "./package.json"
67
38
  },
68
39
  "scripts": {
69
40
  "start": "npm -w docs start",
70
- "build": "tsup",
41
+ "build": "tsdown",
71
42
  "lint": "runp lint:*",
72
- "lint:eslint": "lint .",
43
+ "lint:oxlint": "oxlint",
73
44
  "lint:tsc": "tsc --emitDeclarationOnly false --noEmit",
74
- "prepublishOnly": "runp lint build :s publint",
45
+ "prepublishOnly": "runp lint build",
75
46
  "docs:build": "npm -w docs run build"
76
47
  },
77
48
  "peerDependencies": {
78
49
  "@material-ui/core": ">=4.0.0",
79
50
  "@mui/material": ">=5.0.0",
80
- "@types/react": ">=17.0.0",
81
- "@types/react-dom": ">=17.0.0",
82
51
  "react": ">=17.0.0",
83
52
  "react-dom": ">=17.0.0",
84
53
  "xlsx": ">=0.18.5"
@@ -107,41 +76,32 @@
107
76
  "@emotion/styled": "11.11.0",
108
77
  "@material-ui/core": "4.12.4",
109
78
  "@mui/material": "5.14.18",
110
- "@schummar/eslint-config": "github:schummar/eslint-config",
111
79
  "@schummar/prettier-config": "github:schummar/prettier-config",
112
80
  "@schummar/runp": "2.0.5",
113
81
  "@types/react": "18.2.37",
114
82
  "@types/react-dom": "18.2.15",
115
- "@typescript-eslint/parser": "6.11.0",
116
83
  "esbuild": "0.24.0",
117
- "eslint": "8.53.0",
118
- "eslint-plugin-storybook": "0.6.15",
84
+ "oxlint": "^1.20.0",
119
85
  "prettier": "3.1.0",
120
- "publint": "0.2.12",
86
+ "publint": "^0.3.14",
121
87
  "react": "18.2.0",
122
88
  "react-dom": "18.2.0",
123
89
  "schummar-state": "0.2.1-experimental-13",
124
90
  "semantic-release": "22.0.7",
125
- "tsup": "8.3.5",
126
- "typescript": "5.6.3",
91
+ "tsdown": "^0.15.6",
92
+ "typescript": "^5.9.3",
93
+ "unplugin-unused": "^0.5.3",
127
94
  "xlsx": "0.18.5"
128
95
  },
129
96
  "workspaces": [
130
97
  "docs"
131
98
  ],
132
99
  "volta": {
133
- "node": "20.9.0",
134
- "npm": "10.2.4"
135
- },
136
- "eslintConfig": {
137
- "extends": [
138
- "@schummar/eslint-config",
139
- "plugin:storybook/recommended"
140
- ],
141
- "rules": {
142
- "node/no-unpublished-import": "off",
143
- "@typescript-eslint/consistent-type-imports": "off"
144
- }
100
+ "node": "22.20.0",
101
+ "npm": "11.6.1"
145
102
  },
146
- "prettier": "@schummar/prettier-config"
103
+ "prettier": "@schummar/prettier-config",
104
+ "main": "./dist/index.cjs",
105
+ "module": "./dist/index.js",
106
+ "types": "./dist/index.d.cts"
147
107
  }
@@ -1,64 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- var __export = (target, all) => {
33
- for (var name in all)
34
- __defProp(target, name, { get: all[name], enumerable: true });
35
- };
36
- var __async = (__this, __arguments, generator) => {
37
- return new Promise((resolve, reject) => {
38
- var fulfilled = (value) => {
39
- try {
40
- step(generator.next(value));
41
- } catch (e) {
42
- reject(e);
43
- }
44
- };
45
- var rejected = (value) => {
46
- try {
47
- step(generator.throw(value));
48
- } catch (e) {
49
- reject(e);
50
- }
51
- };
52
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
53
- step((generator = generator.apply(__this, __arguments)).next());
54
- });
55
- };
56
-
57
- export {
58
- __spreadValues,
59
- __spreadProps,
60
- __objRest,
61
- __export,
62
- __async
63
- };
64
- //# sourceMappingURL=chunk-EEBUKP6F.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}