@harpercollins/harpercollins-design-system 1.26.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 +106 -106
- 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 +1 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.types.d.ts +5 -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 +137 -137
- 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 +1 -0
- package/dist/esm/types/src/components/data-display/Table/Table.types.d.ts +5 -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 +6 -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, footer, }: 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;
|
|
@@ -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;
|
|
@@ -29,4 +31,6 @@ export interface TableProps<TData = unknown> {
|
|
|
29
31
|
infiniteScroll?: InfiniteScrollOptions;
|
|
30
32
|
toolbar?: TableToolbarOptions;
|
|
31
33
|
footer?: boolean;
|
|
34
|
+
isError?: boolean;
|
|
35
|
+
errorMessage?: string;
|
|
32
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;
|
|
@@ -139,6 +141,8 @@ interface TableProps<TData = unknown> {
|
|
|
139
141
|
infiniteScroll?: InfiniteScrollOptions;
|
|
140
142
|
toolbar?: TableToolbarOptions;
|
|
141
143
|
footer?: boolean;
|
|
144
|
+
isError?: boolean;
|
|
145
|
+
errorMessage?: string;
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
declare module "@tanstack/react-table" {
|
|
@@ -149,7 +153,7 @@ declare module "@tanstack/react-table" {
|
|
|
149
153
|
noSortButton?: boolean;
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
|
-
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, allSelected, onSelectionChange, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, footer, }: 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;
|
|
153
157
|
|
|
154
158
|
interface TabsProps extends Omit<TabsProps$1, "value" | "onChange" | "defaultValue"> {
|
|
155
159
|
/**
|