gantri-components 2.34.0-beta.2 → 2.34.0-beta.3

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.
@@ -1,5 +1,6 @@
1
- import { Table } from '@tanstack/react-table';
2
- import { BaseDataType } from '../../table.types';
1
+ import { Header, Table } from '@tanstack/react-table';
2
+ import { BaseDataType, CustomCellProps } from '../../table.types';
3
3
  export type TableHeaderProps<DataType extends BaseDataType> = {
4
+ getHeaderCellProps: ((row: Header<DataType, unknown>) => CustomCellProps) | undefined;
4
5
  table: Table<DataType>;
5
6
  };
@@ -1,9 +1,10 @@
1
- import { Row } from '@tanstack/react-table';
1
+ import { Cell, Row } from '@tanstack/react-table';
2
2
  import { MouseEvent } from 'react';
3
- import { BaseDataType, CustomRowProps } from '../../table.types';
3
+ import { BaseDataType, CustomCellProps, CustomRowProps } from '../../table.types';
4
4
  export interface TableRowProps<DataType extends BaseDataType> {
5
5
  customRowProps: CustomRowProps;
6
6
  enableReordering: boolean;
7
+ getCellProps: ((row: Cell<DataType, unknown>) => CustomCellProps) | undefined;
7
8
  handleOnReorder: () => Promise<void>;
8
9
  index: number;
9
10
  moveRow: (startIndex: number, endIndex: number) => void;
@@ -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,6 +14,8 @@ export interface TableProps<DataType extends BaseDataType> extends Partial<Table
14
14
  data: DataType[];
15
15
  enableReordering?: boolean;
16
16
  filters?: FiltersProps;
17
+ getCellProps?: (row: Cell<DataType, unknown>) => CustomCellProps;
18
+ getHeaderCellProps?: (row: Header<DataType, unknown>) => CustomCellProps;
17
19
  /** Include `status` in the returned value to set the row status color. */
18
20
  getRowProps?: (row: Row<DataType>, rows: Row<DataType>[]) => CustomRowProps;
19
21
  onReorder?: (data: DataType[]) => Promise<void>;
@@ -26,7 +28,9 @@ export interface TableProps<DataType extends BaseDataType> extends Partial<Table
26
28
  export interface TableDefaultProps {
27
29
  stickyFirstColumn: boolean;
28
30
  }
29
- export interface CustomRowProps extends HTMLAttributes<HTMLTableRowElement> {
31
+ export interface CustomRowProps extends Record<string, unknown>, HTMLAttributes<HTMLTableRowElement> {
30
32
  status?: RowStatusValue | undefined;
31
33
  }
34
+ export interface CustomCellProps extends Record<string, unknown>, HTMLAttributes<HTMLTableCellElement> {
35
+ }
32
36
  export type RowStatusValue = 'handled' | 'next' | 'error' | 'warning';