asma-core-ui 2.19.89 → 2.19.90
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/asma-core-ui.es.js +2 -2
- package/dist/src/components/table/components/TableHeader.d.ts +2 -1
- package/dist/src/components/table/components/columns/expandColumn.d.ts +1 -0
- package/dist/src/components/table/components/columns/selectColumn.d.ts +2 -1
- package/dist/src/components/table/story/components/RenderSubRows.d.ts +5 -0
- package/dist/src/components/table/story/components/getRowActions.d.ts +23 -0
- package/dist/src/components/table/story/components/useTableSubRowsColumns.d.ts +5 -0
- package/dist/src/components/table/types.d.ts +9 -8
- package/dist/style.css +1 -1
- package/package.json +119 -118
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Table } from '@tanstack/react-table';
|
|
3
|
-
export declare function TableHeader<TData>({ table, stickyHeader }: {
|
|
3
|
+
export declare function TableHeader<TData>({ table, stickyHeader, hideHeader, }: {
|
|
4
4
|
table: Table<TData>;
|
|
5
5
|
stickyHeader?: boolean;
|
|
6
|
+
hideHeader?: boolean;
|
|
6
7
|
}): JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CellContext, HeaderContext } from '@tanstack/react-table';
|
|
2
2
|
export declare function selectColumn<TData>(): {
|
|
3
3
|
id: string;
|
|
4
|
-
|
|
4
|
+
minSize: number;
|
|
5
5
|
maxSize: number;
|
|
6
|
+
size: number;
|
|
6
7
|
header: ({ table }: HeaderContext<TData, TData>) => JSX.Element;
|
|
7
8
|
cell: ({ cell }: CellContext<TData, TData>) => JSX.Element;
|
|
8
9
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Person } from '../helpers/makeData';
|
|
2
|
+
import type { Row } from '@tanstack/react-table';
|
|
3
|
+
export declare function getRowActions(row: Row<Person>): ({
|
|
4
|
+
label: string;
|
|
5
|
+
hide: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
className?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
label: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
hide?: undefined;
|
|
12
|
+
className?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
label: string;
|
|
15
|
+
className: string;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
hide?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
label: string;
|
|
20
|
+
hide: boolean;
|
|
21
|
+
className: string;
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
})[];
|
|
@@ -15,16 +15,17 @@ declare module '@tanstack/react-table' {
|
|
|
15
15
|
meta?: ColumnMeta<TData, TValue>;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
export interface IAction<TData> {
|
|
19
|
+
label: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
hide?: boolean;
|
|
23
|
+
onClick?: (row: Row<TData>) => void;
|
|
24
|
+
}
|
|
18
25
|
export interface StyledTableProps<TData, TCustomData> extends Omit<TableOptions<TData>, 'getCoreRowModel' | 'getExpandedRowModel' | 'getFilteredRowModel' | 'getSortedRowModel'> {
|
|
19
26
|
locale?: 'no' | 'en';
|
|
20
27
|
height?: string | number;
|
|
21
|
-
actions?: (row: Row<TData>) =>
|
|
22
|
-
label: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
hide?: boolean;
|
|
26
|
-
onClick?: (row: Row<TData>) => void;
|
|
27
|
-
}[];
|
|
28
|
+
actions?: (row: Row<TData>) => IAction<TData>[];
|
|
28
29
|
customActionsNode?: (row: CellContext<TData, TData>) => ReactNode;
|
|
29
30
|
customSubRowData?: Map<string, TCustomData[]>;
|
|
30
31
|
headerPin?: boolean;
|
|
@@ -42,7 +43,7 @@ export interface StyledTableProps<TData, TCustomData> extends Omit<TableOptions<
|
|
|
42
43
|
renderSubRows?: (props: {
|
|
43
44
|
rows: TCustomData[];
|
|
44
45
|
row: TData;
|
|
45
|
-
}) => ReactElement;
|
|
46
|
+
}) => ReactElement | null;
|
|
46
47
|
getRowSelectionIds?: (ids: string[]) => void;
|
|
47
48
|
footer?: (table: Table<TData>) => ReactNode;
|
|
48
49
|
hideHeader?: boolean;
|