@harpercollins/harpercollins-design-system 1.25.0 → 1.27.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/cjs/index.cjs +107 -107
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/data-display/Table/Table.d.ts +1 -1
- package/dist/cjs/types/src/components/data-display/Table/Table.stories.d.ts +2 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.styles.d.ts +6 -1
- package/dist/cjs/types/src/components/data-display/Table/Table.types.d.ts +6 -1
- package/dist/cjs/types/src/components/data-display/Table/TableBody.d.ts +6 -2
- package/dist/cjs/types/src/components/data-display/Table/hooks/useInfiniteScroll.d.ts +9 -5
- package/dist/esm/index.js +138 -138
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/data-display/Table/Table.d.ts +1 -1
- package/dist/esm/types/src/components/data-display/Table/Table.stories.d.ts +2 -0
- package/dist/esm/types/src/components/data-display/Table/Table.styles.d.ts +6 -1
- package/dist/esm/types/src/components/data-display/Table/Table.types.d.ts +6 -1
- package/dist/esm/types/src/components/data-display/Table/TableBody.d.ts +6 -2
- package/dist/esm/types/src/components/data-display/Table/hooks/useInfiniteScroll.d.ts +9 -5
- package/dist/index.d.ts +7 -2
- package/package.json +1 -1
|
@@ -7,5 +7,5 @@ declare module "@tanstack/react-table" {
|
|
|
7
7
|
noSortButton?: boolean;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, allSelected, onSelectionChange, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, allSelected, onSelectionChange, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, footer, isError, errorMessage, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Table;
|
|
@@ -18,3 +18,5 @@ export declare const InfiniteScroll: Story;
|
|
|
18
18
|
export declare const RowSelection: Story;
|
|
19
19
|
export declare const ColumnHeaderTooltip: Story;
|
|
20
20
|
export declare const WithExportToExcelButton: Story;
|
|
21
|
+
export declare const WithFooter: Story;
|
|
22
|
+
export declare const WithError: Story;
|
|
@@ -6,7 +6,7 @@ export declare const SortButton: import("styled-components/dist/types").IStyledC
|
|
|
6
6
|
export declare const ColumnHeaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
7
7
|
export declare const HeaderContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
8
|
export declare const LoadingOverlay: typeof Box;
|
|
9
|
-
export declare const getTableStyles: (columnSizeVars: Record<string, number>, totalTableWidth: number, wrapText: boolean, headerSticky: boolean) => {
|
|
9
|
+
export declare const getTableStyles: (columnSizeVars: Record<string, number>, totalTableWidth: number, wrapText: boolean, headerSticky: boolean, maxHeight: boolean) => {
|
|
10
10
|
tableLayout: string;
|
|
11
11
|
width: string;
|
|
12
12
|
minWidth: string;
|
|
@@ -22,6 +22,11 @@ export declare const getTableStyles: (columnSizeVars: Record<string, number>, to
|
|
|
22
22
|
zIndex: number;
|
|
23
23
|
top: string | number;
|
|
24
24
|
};
|
|
25
|
+
"& tfoot": {
|
|
26
|
+
position: string;
|
|
27
|
+
zIndex: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
};
|
|
25
30
|
"& td, & td>div, & td>a": {
|
|
26
31
|
whiteSpace: string;
|
|
27
32
|
overflow: string;
|
|
@@ -8,8 +8,10 @@ export interface InfiniteScrollOptions {
|
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
hasNextPage?: boolean;
|
|
10
10
|
isFetchingNextPage?: boolean;
|
|
11
|
-
fetchNextPage?: () => Promise<
|
|
11
|
+
fetchNextPage?: () => Promise<void>;
|
|
12
12
|
loadingText?: string;
|
|
13
|
+
/** Estimated row height in px used by the row virtualizer. Defaults to 40. */
|
|
14
|
+
estimateRowHeight?: number;
|
|
13
15
|
}
|
|
14
16
|
export interface TableProps<TData = unknown> {
|
|
15
17
|
id: string;
|
|
@@ -28,4 +30,7 @@ export interface TableProps<TData = unknown> {
|
|
|
28
30
|
stickyHeaderOffset?: number;
|
|
29
31
|
infiniteScroll?: InfiniteScrollOptions;
|
|
30
32
|
toolbar?: TableToolbarOptions;
|
|
33
|
+
footer?: boolean;
|
|
34
|
+
isError?: boolean;
|
|
35
|
+
errorMessage?: string;
|
|
31
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ColumnDef, Row } from "@tanstack/react-table";
|
|
2
|
+
import { VirtualItem } from "@tanstack/react-virtual";
|
|
2
3
|
interface TableBodyProps<TData> {
|
|
3
4
|
rows: Row<TData>[];
|
|
4
5
|
columns: ColumnDef<TData, unknown>[];
|
|
@@ -6,9 +7,12 @@ interface TableBodyProps<TData> {
|
|
|
6
7
|
key: string;
|
|
7
8
|
}) => JSX.Element;
|
|
8
9
|
loading: boolean;
|
|
9
|
-
tableId: string;
|
|
10
10
|
rowSelectionState?: Record<string, boolean>;
|
|
11
|
+
virtualItems?: VirtualItem[];
|
|
12
|
+
paddingTop?: number;
|
|
13
|
+
paddingBottom?: number;
|
|
14
|
+
measureElement?: (node: Element | null) => void;
|
|
11
15
|
}
|
|
12
|
-
declare function TableBodyInner<TData>({ rows, columns, rowRender, loading,
|
|
16
|
+
declare function TableBodyInner<TData>({ rows, columns, rowRender, loading, rowSelectionState: _rowSelectionState, virtualItems, paddingTop, paddingBottom, measureElement, }: TableBodyProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
13
17
|
export declare const TableBody: typeof TableBodyInner;
|
|
14
18
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { VirtualItem } from "@tanstack/react-virtual";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { InfiniteScrollOptions } from "../Table.types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export interface UseInfiniteScrollResult {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
virtualItems: VirtualItem[];
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
paddingBottom: number;
|
|
9
|
+
measureElement: (node: Element | null) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useInfiniteScroll(rowCount: number, infiniteScroll: InfiniteScrollOptions | undefined, scrollElementRef: React.RefObject<HTMLDivElement>): UseInfiniteScrollResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -118,8 +118,10 @@ interface InfiniteScrollOptions {
|
|
|
118
118
|
enabled: boolean;
|
|
119
119
|
hasNextPage?: boolean;
|
|
120
120
|
isFetchingNextPage?: boolean;
|
|
121
|
-
fetchNextPage?: () => Promise<
|
|
121
|
+
fetchNextPage?: () => Promise<void>;
|
|
122
122
|
loadingText?: string;
|
|
123
|
+
/** Estimated row height in px used by the row virtualizer. Defaults to 40. */
|
|
124
|
+
estimateRowHeight?: number;
|
|
123
125
|
}
|
|
124
126
|
interface TableProps<TData = unknown> {
|
|
125
127
|
id: string;
|
|
@@ -138,6 +140,9 @@ interface TableProps<TData = unknown> {
|
|
|
138
140
|
stickyHeaderOffset?: number;
|
|
139
141
|
infiniteScroll?: InfiniteScrollOptions;
|
|
140
142
|
toolbar?: TableToolbarOptions;
|
|
143
|
+
footer?: boolean;
|
|
144
|
+
isError?: boolean;
|
|
145
|
+
errorMessage?: string;
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
declare module "@tanstack/react-table" {
|
|
@@ -148,7 +153,7 @@ declare module "@tanstack/react-table" {
|
|
|
148
153
|
noSortButton?: boolean;
|
|
149
154
|
}
|
|
150
155
|
}
|
|
151
|
-
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, allSelected, onSelectionChange, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, }: TableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
156
|
+
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, allSelected, onSelectionChange, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, footer, isError, errorMessage, }: TableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
152
157
|
|
|
153
158
|
interface TabsProps extends Omit<TabsProps$1, "value" | "onChange" | "defaultValue"> {
|
|
154
159
|
/**
|