gantri-components 2.40.2 → 2.41.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/components/table/components/table-row/table-row.constants.d.ts +2 -0
- package/dist/components/table/components/table-row/table-row.styles.d.ts +2 -0
- package/dist/components/table/hooks/use-track-sticky-cells/use-track-sticky-cells.types.d.ts +2 -0
- package/dist/components/table/table.styles.d.ts +9 -1
- package/dist/components/table/table.types.d.ts +11 -5
- 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
|
@@ -6,5 +6,7 @@ export declare const dataAttrRowHighlightOnHover: "data-row-highlight-on-hover";
|
|
|
6
6
|
export declare const dataAttrActiveRow: "data-active-row";
|
|
7
7
|
/** Prefix added to table cell data attrs (like cell ID). */
|
|
8
8
|
export declare const dataAttrCellPrefix: "data-cell";
|
|
9
|
+
/** Applied when a table cell should be clickable. */
|
|
10
|
+
export declare const dataAttrCellIsClickable: "data-cell-is-clickable";
|
|
9
11
|
/** Applied when a sticky styled element is observed to have become sticky via `markStickyElements`. */
|
|
10
12
|
export declare const dataAttrIsSticky: "data-is-sticky";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { CustomCellProps } from '../../table.types';
|
|
1
2
|
export declare const StyledTR: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
|
2
3
|
canReorder: boolean;
|
|
3
4
|
isDragging: boolean | undefined;
|
|
4
5
|
}, never>;
|
|
6
|
+
export declare const StyledTD: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, CustomCellProps, never>;
|
package/dist/components/table/hooks/use-track-sticky-cells/use-track-sticky-cells.types.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { RowData } from '@tanstack/react-table';
|
|
|
2
2
|
import { CustomColumnsProps } from '../../components/custom-columns-wrapper/custom-columns-wrapper.types';
|
|
3
3
|
export interface UseTrackStickyCellsProps<TData extends RowData> {
|
|
4
4
|
customColumns: CustomColumnsProps<TData> | undefined;
|
|
5
|
+
numRows: number;
|
|
5
6
|
/** The containing element that the child will intersect with. */
|
|
6
7
|
root: Element | null;
|
|
7
8
|
stickyFirstColumn: boolean | undefined;
|
|
9
|
+
stickyLastColumn: boolean | undefined;
|
|
8
10
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare const StyledTableContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const useTableRowBackgroundColors: () => {
|
|
3
|
+
readonly statusErrorClickableHoverColor: string;
|
|
4
|
+
readonly statusErrorColor: string;
|
|
5
|
+
readonly statusNoneClickableHoverColor: string;
|
|
6
|
+
readonly statusNoneColor: string;
|
|
7
|
+
readonly statusWarningClickableHoverColor: string;
|
|
8
|
+
readonly statusWarningColor: string;
|
|
9
|
+
};
|
|
2
10
|
export declare const StyledTable: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {
|
|
3
|
-
|
|
11
|
+
isCustomColumnsEnabled: boolean;
|
|
4
12
|
}, never>;
|
|
@@ -16,9 +16,10 @@ export interface TableProps<TData extends RowData> extends Partial<TableDefaultP
|
|
|
16
16
|
*/
|
|
17
17
|
data: TData[];
|
|
18
18
|
filters?: FiltersProps;
|
|
19
|
+
/** Include `href` and (optionally) `target` in the returned object to apply an anchor with appropriate cell styling. Text styling must be applied within the column. */
|
|
19
20
|
getCellProps?: GetCellProps<TData>;
|
|
20
21
|
getHeaderCellProps?: GetHeaderCellProps<TData>;
|
|
21
|
-
/** Include `status` in the returned
|
|
22
|
+
/** Include `status` in the returned object to set the row status color. */
|
|
22
23
|
getRowProps?: GetRowProps<TData>;
|
|
23
24
|
onRowClick?: OnRowClick<TData>;
|
|
24
25
|
/** Any options provided are passed to `useReactTable` and may override default values. */
|
|
@@ -31,17 +32,22 @@ export interface TableProps<TData extends RowData> extends Partial<TableDefaultP
|
|
|
31
32
|
};
|
|
32
33
|
search?: SearchProps;
|
|
33
34
|
sorting?: SortProps;
|
|
35
|
+
stickyLastColumn?: boolean;
|
|
34
36
|
}
|
|
35
37
|
export interface TableDefaultProps {
|
|
36
38
|
stickyFirstColumn: boolean;
|
|
37
39
|
}
|
|
38
|
-
export type GetHeaderCellProps<TData extends RowData> = (cell?: Header<TData,
|
|
40
|
+
export type GetHeaderCellProps<TData extends RowData, TValue = unknown> = (cell?: Header<TData, TValue>) => CustomCellProps;
|
|
41
|
+
/** Include `status` in the returned object to set the row status color. */
|
|
39
42
|
export type GetRowProps<TData extends RowData> = (row?: Row<TData>, rows?: Row<TData>[]) => CustomRowProps;
|
|
40
|
-
export interface CustomRowProps extends Record<string, unknown
|
|
43
|
+
export interface CustomRowProps extends HTMLAttributes<HTMLTableRowElement>, Record<string, unknown> {
|
|
41
44
|
status?: RowStatusValue | undefined;
|
|
42
45
|
}
|
|
43
46
|
export type RowStatusValue = 'handled' | 'next' | 'error' | 'warning';
|
|
44
|
-
|
|
47
|
+
/** Include `href` and (optionally) `target` in the returned object to apply an anchor with appropriate cell styling. Text styling must be applied within the column. */
|
|
48
|
+
export type GetCellProps<TData extends RowData, TValue = unknown> = (cell?: Cell<TData, TValue>) => CustomCellProps;
|
|
45
49
|
export type OnRowClick<TData extends RowData> = (data: Row<TData>, event: MouseEvent<HTMLTableRowElement>) => void;
|
|
46
|
-
export interface CustomCellProps extends Record<string, unknown
|
|
50
|
+
export interface CustomCellProps extends HTMLAttributes<HTMLTableCellElement>, Record<string, unknown> {
|
|
51
|
+
href?: string;
|
|
52
|
+
target?: '_blank';
|
|
47
53
|
}
|