gantri-components 2.34.0-beta.18 → 2.34.0-beta.19
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-footer/table-footer.d.ts +6 -2
- package/dist/components/table/components/table-footer/table-footer.types.d.ts +2 -3
- package/dist/components/table/components/table-header/table-header.d.ts +6 -2
- package/dist/components/table/components/table-header/table-header.types.d.ts +3 -3
- package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.d.ts +6 -2
- package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.types.d.ts +2 -3
- package/dist/components/table/components/table-row/table-row.d.ts +6 -2
- package/dist/components/table/components/table-row/table-row.types.d.ts +3 -3
- package/dist/components/table/helpers/add-missing-ids/index.d.ts +6 -2
- package/dist/components/table/hooks/use-move-row/use-move-row.d.ts +6 -1
- package/dist/components/table/hooks/use-move-row/use-move-row.types.d.ts +3 -3
- package/dist/components/table/table.d.ts +7 -2
- package/dist/components/table/table.types.d.ts +7 -8
- 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,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
2
|
import { TableFooterProps } from './table-footer.types';
|
|
3
|
-
export declare const TableFooter: <DataType extends
|
|
3
|
+
export declare const TableFooter: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableFooterProps<DataType>) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Table } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
export type TableFooterProps<DataType extends BaseTableDataType> = {
|
|
1
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
export type TableFooterProps<DataType extends RowData> = {
|
|
4
3
|
table: Table<DataType>;
|
|
5
4
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
2
|
import { TableHeaderProps } from './table-header.types';
|
|
3
|
-
export declare const TableHeader: <DataType extends
|
|
3
|
+
export declare const TableHeader: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableHeaderProps<DataType>) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Table } from '@tanstack/react-table';
|
|
2
|
-
import {
|
|
3
|
-
export type TableHeaderProps<DataType extends
|
|
1
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
import { GetHeaderCellProps } from '../../table.types';
|
|
3
|
+
export type TableHeaderProps<DataType extends RowData> = {
|
|
4
4
|
getHeaderCellProps: GetHeaderCellProps<DataType> | undefined;
|
|
5
5
|
table: Table<DataType>;
|
|
6
6
|
};
|
package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
3
|
import { UseDragAndDropProps } from './use-drag-and-drop.types';
|
|
4
|
-
export declare const useDragAndDrop: <DataType extends
|
|
4
|
+
export declare const useDragAndDrop: <DataType extends RowData<{
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
id: string | number;
|
|
7
|
+
subRows?: any[] | undefined;
|
|
8
|
+
}>>(props: UseDragAndDropProps<DataType>) => {
|
|
5
9
|
dragAndDropRef: import("react").RefObject<HTMLTableRowElement>;
|
|
6
10
|
isDragging: boolean;
|
|
7
11
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Row } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
export interface UseDragAndDropProps<DataType extends BaseTableDataType> {
|
|
1
|
+
import { Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
export interface UseDragAndDropProps<DataType extends RowData> {
|
|
4
3
|
enableReordering: boolean;
|
|
5
4
|
handleOnReorder: () => Promise<void>;
|
|
6
5
|
index: number;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
2
|
import { TableRowProps } from './table-row.types';
|
|
3
|
-
export declare const TableRow: <DataType extends
|
|
3
|
+
export declare const TableRow: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableRowProps<DataType>) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Row } from '@tanstack/react-table';
|
|
2
|
-
import {
|
|
3
|
-
export interface TableRowProps<DataType extends
|
|
1
|
+
import { Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { CustomRowProps, GetCellProps, OnRowClick } from '../../table.types';
|
|
3
|
+
export interface TableRowProps<DataType extends RowData> {
|
|
4
4
|
customRowProps: CustomRowProps;
|
|
5
5
|
enableReordering: boolean;
|
|
6
6
|
getCellProps: GetCellProps<DataType> | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
2
|
/** If an index does not contain an `id` value, one is added using uuid. */
|
|
3
|
-
export declare const addMissingIds: <DataType extends
|
|
3
|
+
export declare const addMissingIds: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(data: DataType[]) => DataType[];
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
1
2
|
import { UseMoveRowProps } from './use-move-row.types';
|
|
2
|
-
export declare const useMoveRow:
|
|
3
|
+
export declare const useMoveRow: <TData extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: UseMoveRowProps<TData>) => {
|
|
3
8
|
moveRow: (startIndex: number, endIndex: number) => void;
|
|
4
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
1
2
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
setData: Dispatch<SetStateAction<BaseTableDataType[]>>;
|
|
3
|
+
export interface UseMoveRowProps<TData extends RowData> {
|
|
4
|
+
setData: Dispatch<SetStateAction<TData[]>>;
|
|
5
5
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { TableProps } from './table.types';
|
|
2
3
|
export declare const Table: {
|
|
3
|
-
<DataType extends
|
|
4
|
+
<DataType extends RowData<{
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
id: string | number;
|
|
7
|
+
subRows?: any[] | undefined;
|
|
8
|
+
}>>(props: TableProps<DataType>): JSX.Element;
|
|
4
9
|
defaultProps: import("./table.types").TableDefaultProps;
|
|
5
10
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Cell, ColumnDef, Header, Row, TableOptions } from '@tanstack/react-table';
|
|
1
|
+
import { Cell, ColumnDef, Header, Row, RowData, TableOptions } from '@tanstack/react-table';
|
|
2
2
|
import { HTMLAttributes, MouseEvent } from 'react';
|
|
3
3
|
import { PagingProps } from '../paging/paging.types';
|
|
4
|
-
import { CustomActionProps, FiltersProps, SearchProps } from './components/table-actions-wrapper';
|
|
4
|
+
import { CustomActionProps, FiltersProps, SearchProps } from './components/table-actions-wrapper/table-actions-wrapper.types';
|
|
5
5
|
import { SortProps } from './components/table-actions-wrapper/components/sort/sort.types';
|
|
6
|
-
export
|
|
7
|
-
export interface TableProps<DataType extends BaseTableDataType> extends Partial<TableDefaultProps> {
|
|
6
|
+
export interface TableProps<DataType extends RowData> extends Partial<TableDefaultProps> {
|
|
8
7
|
className?: string;
|
|
9
8
|
columns: ColumnDef<DataType, any>[];
|
|
10
9
|
customAction?: CustomActionProps;
|
|
@@ -33,10 +32,10 @@ export interface TableProps<DataType extends BaseTableDataType> extends Partial<
|
|
|
33
32
|
export interface TableDefaultProps {
|
|
34
33
|
stickyFirstColumn: boolean;
|
|
35
34
|
}
|
|
36
|
-
export type GetHeaderCellProps<DataType extends
|
|
37
|
-
export type GetRowProps<DataType extends
|
|
38
|
-
export type GetCellProps<DataType extends
|
|
39
|
-
export type OnRowClick<DataType extends
|
|
35
|
+
export type GetHeaderCellProps<DataType extends RowData> = (cell?: Header<DataType, unknown>) => CustomCellProps;
|
|
36
|
+
export type GetRowProps<DataType extends RowData> = (row?: Row<DataType>, rows?: Row<DataType>[]) => CustomRowProps;
|
|
37
|
+
export type GetCellProps<DataType extends RowData> = (cell?: Cell<DataType, unknown>) => CustomCellProps;
|
|
38
|
+
export type OnRowClick<DataType extends RowData> = (data: Row<DataType>, event: MouseEvent<HTMLTableRowElement>) => void;
|
|
40
39
|
export interface CustomRowProps extends Record<string, unknown>, HTMLAttributes<HTMLTableRowElement> {
|
|
41
40
|
status?: RowStatusValue | undefined;
|
|
42
41
|
}
|