@harpercollins/harpercollins-design-system 1.26.0 → 1.27.1
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 +109 -109
- 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 +3 -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 +3 -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 +4 -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,7 +8,7 @@ export interface InfiniteScrollOptions {
|
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
hasNextPage?: boolean;
|
|
10
10
|
isFetchingNextPage?: boolean;
|
|
11
|
-
fetchNextPage?: () => Promise<unknown> | void;
|
|
11
|
+
fetchNextPage?: (options?: any) => Promise<unknown> | void;
|
|
12
12
|
loadingText?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface TableProps<TData = unknown> {
|
|
@@ -29,4 +29,6 @@ export interface TableProps<TData = unknown> {
|
|
|
29
29
|
infiniteScroll?: InfiniteScrollOptions;
|
|
30
30
|
toolbar?: TableToolbarOptions;
|
|
31
31
|
footer?: boolean;
|
|
32
|
+
isError?: boolean;
|
|
33
|
+
errorMessage?: string | JSX.Element;
|
|
32
34
|
}
|
|
@@ -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,7 +118,7 @@ interface InfiniteScrollOptions {
|
|
|
118
118
|
enabled: boolean;
|
|
119
119
|
hasNextPage?: boolean;
|
|
120
120
|
isFetchingNextPage?: boolean;
|
|
121
|
-
fetchNextPage?: () => Promise<unknown> | void;
|
|
121
|
+
fetchNextPage?: (options?: any) => Promise<unknown> | void;
|
|
122
122
|
loadingText?: string;
|
|
123
123
|
}
|
|
124
124
|
interface TableProps<TData = unknown> {
|
|
@@ -139,6 +139,8 @@ interface TableProps<TData = unknown> {
|
|
|
139
139
|
infiniteScroll?: InfiniteScrollOptions;
|
|
140
140
|
toolbar?: TableToolbarOptions;
|
|
141
141
|
footer?: boolean;
|
|
142
|
+
isError?: boolean;
|
|
143
|
+
errorMessage?: string | JSX.Element;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
declare module "@tanstack/react-table" {
|
|
@@ -149,7 +151,7 @@ declare module "@tanstack/react-table" {
|
|
|
149
151
|
noSortButton?: boolean;
|
|
150
152
|
}
|
|
151
153
|
}
|
|
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;
|
|
154
|
+
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
155
|
|
|
154
156
|
interface TabsProps extends Omit<TabsProps$1, "value" | "onChange" | "defaultValue"> {
|
|
155
157
|
/**
|