schummar-table 0.32.0 → 0.33.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/cjs/index.js +15 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +15 -9
- package/dist/es/index.js.map +1 -1
- package/dist/types/types.d.ts +4 -4
- package/package.json +1 -1
package/dist/types/types.d.ts
CHANGED
|
@@ -146,11 +146,11 @@ export type MemoizedTableTheme<T> = Omit<TableTheme, 'classes' | 'styles' | 'tex
|
|
|
146
146
|
};
|
|
147
147
|
export interface TableProps<T> extends PartialTableTheme<T> {
|
|
148
148
|
/** The data to be rendered. One item per row. */
|
|
149
|
-
items?: T[];
|
|
149
|
+
items?: readonly T[];
|
|
150
150
|
/** Unique id for each item/row. */
|
|
151
151
|
id: FunctionWithDeps<(item: T) => Id> | KeyOfType<T, Id>;
|
|
152
152
|
/** Create a nested structure by assigning parents to items. Child items are hidden until the parent is expanded. */
|
|
153
|
-
parentId?: FunctionWithDeps<(item: T) => Id | undefined> | KeyOfType<T, Id | undefined>;
|
|
153
|
+
parentId?: FunctionWithDeps<(item: T) => Id | undefined> | KeyOfType<T, Id | undefined | null>;
|
|
154
154
|
/** If true for an item, it means that children will be loaded asynchronously as soon as item is expanded. */
|
|
155
155
|
hasDeferredChildren?: (item: T) => boolean;
|
|
156
156
|
/** Column definitions. */
|
|
@@ -266,7 +266,7 @@ export interface TableProps<T> extends PartialTableTheme<T> {
|
|
|
266
266
|
};
|
|
267
267
|
debug?: (...output: any) => void;
|
|
268
268
|
debugRender?: (...output: any) => void;
|
|
269
|
-
onReset?: () => void;
|
|
269
|
+
onReset?: (scope?: 'table' | 'filters') => void;
|
|
270
270
|
}
|
|
271
271
|
export type InternalTableProps<T> = MemoizedFunctions<Omit<TableProps<T>, 'id' | 'parentId' | 'columns' | 'defaultColumnProps' | 'enableExport'> & {
|
|
272
272
|
id: (item: T) => Id;
|
|
@@ -279,7 +279,7 @@ export type InternalTableProps<T> = MemoizedFunctions<Omit<TableProps<T>, 'id' |
|
|
|
279
279
|
}>;
|
|
280
280
|
export type TableItem<T = unknown> = {
|
|
281
281
|
id: Id;
|
|
282
|
-
parentId?: Id;
|
|
282
|
+
parentId?: Id | null;
|
|
283
283
|
children: TableItem<T>[];
|
|
284
284
|
value: T;
|
|
285
285
|
};
|