gantri-components 2.34.0-beta.2 → 2.34.0-beta.4
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/components/table/components/table-header/table-header.types.d.ts +2 -1
- package/dist/components/table/components/table-row/table-row.types.d.ts +3 -3
- package/dist/components/table/helpers/hyphenate-column-id/hyphenate-column-id.d.ts +1 -0
- package/dist/components/table/helpers/hyphenate-column-id/index.d.ts +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.types.d.ts +12 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Table } from '@tanstack/react-table';
|
|
2
|
-
import { BaseDataType } from '../../table.types';
|
|
2
|
+
import { BaseDataType, GetHeaderCellProps } from '../../table.types';
|
|
3
3
|
export type TableHeaderProps<DataType extends BaseDataType> = {
|
|
4
|
+
getHeaderCellProps: GetHeaderCellProps<DataType> | undefined;
|
|
4
5
|
table: Table<DataType>;
|
|
5
6
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Row } from '@tanstack/react-table';
|
|
2
|
-
import {
|
|
3
|
-
import { BaseDataType, CustomRowProps } from '../../table.types';
|
|
2
|
+
import { BaseDataType, CustomRowProps, GetCellProps, OnRowClick } from '../../table.types';
|
|
4
3
|
export interface TableRowProps<DataType extends BaseDataType> {
|
|
5
4
|
customRowProps: CustomRowProps;
|
|
6
5
|
enableReordering: boolean;
|
|
6
|
+
getCellProps: GetCellProps<DataType> | undefined;
|
|
7
7
|
handleOnReorder: () => Promise<void>;
|
|
8
8
|
index: number;
|
|
9
9
|
moveRow: (startIndex: number, endIndex: number) => void;
|
|
10
|
-
onRowClick?:
|
|
10
|
+
onRowClick?: OnRowClick<DataType>;
|
|
11
11
|
row: Row<DataType>;
|
|
12
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hyphenateColumnId: ((id: string) => string) & import("lodash").MemoizedFunction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hyphenate-column-id';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnDef, Row, TableOptions } from '@tanstack/react-table';
|
|
1
|
+
import { Cell, ColumnDef, Header, Row, TableOptions } from '@tanstack/react-table';
|
|
2
2
|
import { HTMLAttributes, MouseEvent } from 'react';
|
|
3
3
|
import { PagingProps } from '../paging/paging.types';
|
|
4
4
|
import { CustomActionProps, FiltersProps, SearchProps } from './components/table-actions-wrapper';
|
|
@@ -14,10 +14,12 @@ export interface TableProps<DataType extends BaseDataType> extends Partial<Table
|
|
|
14
14
|
data: DataType[];
|
|
15
15
|
enableReordering?: boolean;
|
|
16
16
|
filters?: FiltersProps;
|
|
17
|
+
getCellProps?: GetCellProps<DataType>;
|
|
18
|
+
getHeaderCellProps?: GetHeaderCellProps<DataType>;
|
|
17
19
|
/** Include `status` in the returned value to set the row status color. */
|
|
18
|
-
getRowProps?:
|
|
20
|
+
getRowProps?: GetRowProps<DataType>;
|
|
19
21
|
onReorder?: (data: DataType[]) => Promise<void>;
|
|
20
|
-
onRowClick?:
|
|
22
|
+
onRowClick?: OnRowClick<DataType>;
|
|
21
23
|
options?: Partial<TableOptions<DataType>>;
|
|
22
24
|
paging?: PagingProps;
|
|
23
25
|
search?: SearchProps;
|
|
@@ -26,7 +28,13 @@ export interface TableProps<DataType extends BaseDataType> extends Partial<Table
|
|
|
26
28
|
export interface TableDefaultProps {
|
|
27
29
|
stickyFirstColumn: boolean;
|
|
28
30
|
}
|
|
29
|
-
export
|
|
31
|
+
export type GetHeaderCellProps<DataType extends BaseDataType> = (cell: Header<DataType, unknown>) => CustomCellProps;
|
|
32
|
+
export type GetRowProps<DataType extends BaseDataType> = (row: Row<DataType>, rows: Row<DataType>[]) => CustomRowProps;
|
|
33
|
+
export type GetCellProps<DataType extends BaseDataType> = (cell: Cell<DataType, unknown>) => CustomCellProps;
|
|
34
|
+
export type OnRowClick<DataType extends BaseDataType> = (data: Row<DataType>, event: MouseEvent<HTMLTableRowElement>) => void;
|
|
35
|
+
export interface CustomRowProps extends Record<string, unknown>, HTMLAttributes<HTMLTableRowElement> {
|
|
30
36
|
status?: RowStatusValue | undefined;
|
|
31
37
|
}
|
|
38
|
+
export interface CustomCellProps extends Record<string, unknown>, HTMLAttributes<HTMLTableCellElement> {
|
|
39
|
+
}
|
|
32
40
|
export type RowStatusValue = 'handled' | 'next' | 'error' | 'warning';
|