@harpercollins/harpercollins-design-system 1.23.0 → 1.24.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 +215 -136
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/data-display/Table/FilterChipsSection.d.ts +10 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.d.ts +8 -18
- package/dist/cjs/types/src/components/data-display/Table/Table.filtering.stories.d.ts +8 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.sorting.stories.d.ts +32 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.stories.d.ts +8 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.styles.d.ts +117 -0
- package/dist/cjs/types/src/components/data-display/Table/Table.types.d.ts +34 -0
- package/dist/cjs/types/src/components/data-display/Table/TableBody.d.ts +13 -0
- package/dist/cjs/types/src/components/data-display/Table/TableToolbar.d.ts +17 -0
- package/dist/cjs/types/src/components/data-display/Table/filters/FilterComponents.d.ts +61 -0
- package/dist/cjs/types/src/components/data-display/Table/filters/filterFunctions.d.ts +28 -0
- package/dist/cjs/types/src/components/data-display/Table/filters/index.d.ts +2 -0
- package/dist/cjs/types/src/components/data-display/Table/hooks/index.d.ts +3 -0
- package/dist/cjs/types/src/components/data-display/Table/hooks/useInfiniteScroll.d.ts +7 -0
- package/dist/cjs/types/src/components/data-display/Table/hooks/useStickyHeader.d.ts +14 -0
- package/dist/cjs/types/src/components/data-display/Table/hooks/useStickyScrollbar.d.ts +6 -0
- package/dist/cjs/types/src/components/data-display/Table/mockProducts.d.ts +24 -0
- package/dist/cjs/types/src/components/index.d.ts +2 -1
- package/dist/cjs/types/src/components/inputs/Autocomplete/AutocompleteOption.d.ts +3 -0
- package/dist/cjs/types/src/components/inputs/Button/index.d.ts +1 -0
- package/dist/cjs/types/src/tests/mockProducts.d.ts +24 -0
- package/dist/esm/index.js +242 -163
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/data-display/Table/FilterChipsSection.d.ts +10 -0
- package/dist/esm/types/src/components/data-display/Table/Table.d.ts +8 -18
- package/dist/esm/types/src/components/data-display/Table/Table.filtering.stories.d.ts +8 -0
- package/dist/esm/types/src/components/data-display/Table/Table.sorting.stories.d.ts +32 -0
- package/dist/esm/types/src/components/data-display/Table/Table.stories.d.ts +8 -0
- package/dist/esm/types/src/components/data-display/Table/Table.styles.d.ts +117 -0
- package/dist/esm/types/src/components/data-display/Table/Table.types.d.ts +34 -0
- package/dist/esm/types/src/components/data-display/Table/TableBody.d.ts +13 -0
- package/dist/esm/types/src/components/data-display/Table/TableToolbar.d.ts +17 -0
- package/dist/esm/types/src/components/data-display/Table/filters/FilterComponents.d.ts +61 -0
- package/dist/esm/types/src/components/data-display/Table/filters/filterFunctions.d.ts +28 -0
- package/dist/esm/types/src/components/data-display/Table/filters/index.d.ts +2 -0
- package/dist/esm/types/src/components/data-display/Table/hooks/index.d.ts +3 -0
- package/dist/esm/types/src/components/data-display/Table/hooks/useInfiniteScroll.d.ts +7 -0
- package/dist/esm/types/src/components/data-display/Table/hooks/useStickyHeader.d.ts +14 -0
- package/dist/esm/types/src/components/data-display/Table/hooks/useStickyScrollbar.d.ts +6 -0
- package/dist/esm/types/src/components/data-display/Table/mockProducts.d.ts +24 -0
- package/dist/esm/types/src/components/index.d.ts +2 -1
- package/dist/esm/types/src/components/inputs/Autocomplete/AutocompleteOption.d.ts +3 -0
- package/dist/esm/types/src/components/inputs/Button/index.d.ts +1 -0
- package/dist/esm/types/src/tests/mockProducts.d.ts +24 -0
- package/dist/index.d.ts +35 -7
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnFiltersState, Table } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface FilterChipsSectionProps<TData = unknown> {
|
|
4
|
+
columnFilters: ColumnFiltersState;
|
|
5
|
+
table: Table<TData>;
|
|
6
|
+
}
|
|
7
|
+
declare const FilterChipsSection: <TData>(props: FilterChipsSectionProps<TData> & {
|
|
8
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
9
|
+
}) => React.ReactElement;
|
|
10
|
+
export default FilterChipsSection;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
reactTableOptions: Partial<TableOptions<unknown>> & Pick<TableOptions<unknown>, "data" | "columns">;
|
|
9
|
-
gridCheckboxes?: boolean;
|
|
10
|
-
selectedField?: string;
|
|
11
|
-
onSelectionChange?: (dataItem: any) => void;
|
|
12
|
-
onHeaderSelectionChange?: (checked: boolean) => void;
|
|
13
|
-
headerSelectionValue?: boolean;
|
|
14
|
-
allSelected?: boolean;
|
|
15
|
-
showStickyScrollbar?: boolean;
|
|
16
|
-
enableStickyHeader?: boolean;
|
|
17
|
-
stickyHeaderOffset?: number;
|
|
1
|
+
import { TableProps } from "./Table.types";
|
|
2
|
+
declare module "@tanstack/react-table" {
|
|
3
|
+
interface ColumnMeta<TData, TValue> {
|
|
4
|
+
filterType?: "text" | "number" | "date" | "select" | "multiselect";
|
|
5
|
+
filterOptions?: string[];
|
|
6
|
+
pinned?: "left" | "right";
|
|
7
|
+
}
|
|
18
8
|
}
|
|
19
|
-
declare function Table({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, selectedField, onSelectionChange, onHeaderSelectionChange, headerSelectionValue, allSelected, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function Table<TData = unknown>({ id, loading, maxHeight, wrapText, rowRender, reactTableOptions, gridCheckboxes, selectedField, onSelectionChange, onHeaderSelectionChange, headerSelectionValue, allSelected, showStickyScrollbar, enableStickyHeader, stickyHeaderOffset, infiniteScroll, toolbar, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
20
10
|
export default Table;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Table from "./Table";
|
|
3
|
+
declare const meta: Meta<typeof Table>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Table>;
|
|
6
|
+
export declare const ClientSideFiltering: Story;
|
|
7
|
+
export declare const ServerSideFiltering: Story;
|
|
8
|
+
export declare const WithGlobalFilters: StoryObj<typeof Table>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Table from "./Table";
|
|
3
|
+
declare const meta: Meta<typeof Table>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Table>;
|
|
6
|
+
/**
|
|
7
|
+
* Client-Side Sorting
|
|
8
|
+
*
|
|
9
|
+
* This example demonstrates client-side sorting where all data is loaded
|
|
10
|
+
* and sorting happens in the browser using TanStack Table's getSortedRowModel.
|
|
11
|
+
*
|
|
12
|
+
* Features:
|
|
13
|
+
* - Click column headers to sort
|
|
14
|
+
* - First click: ascending
|
|
15
|
+
* - Second click: descending
|
|
16
|
+
* - Third click: clear sort
|
|
17
|
+
* - Sort indicators show current sort state
|
|
18
|
+
* - Multiple columns can be sorted (shift+click)
|
|
19
|
+
*/
|
|
20
|
+
export declare const ClientSideSorting: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Server-Side Sorting
|
|
23
|
+
*
|
|
24
|
+
* This example demonstrates server-side sorting where sorting is handled
|
|
25
|
+
* by the backend API. The table manages the sorting state and notifies
|
|
26
|
+
* the parent component when sorting changes.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export declare const ServerSideSorting: Story;
|
|
30
|
+
export declare const InitialSortState: Story;
|
|
31
|
+
export declare const DisabledSorting: Story;
|
|
32
|
+
export declare const MixedSortingConfiguration: Story;
|
|
@@ -7,3 +7,11 @@ export declare const Default: Story;
|
|
|
7
7
|
export declare const MaxHeight: Story;
|
|
8
8
|
export declare const WrapText: Story;
|
|
9
9
|
export declare const DynamicStickyHeader: Story;
|
|
10
|
+
export declare const DynamicStickyHeaderWithOffset: Story;
|
|
11
|
+
export declare const StickyHorizontalScrollbar: Story;
|
|
12
|
+
export declare const NoData: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Infinite scroll example
|
|
15
|
+
* Demonstrates loading more data as user scrolls to the bottom
|
|
16
|
+
*/
|
|
17
|
+
export declare const InfiniteScroll: Story;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Box } from "@mui/joy";
|
|
2
|
+
export declare const TableWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$maxHeight: boolean;
|
|
4
|
+
}>> & string;
|
|
5
|
+
export declare const SortButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
6
|
+
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;
|
|
7
|
+
export declare const LoadingOverlay: typeof Box;
|
|
8
|
+
export declare const getTableStyles: (columnSizeVars: Record<string, number>, totalTableWidth: number, wrapText: boolean, headerSticky: boolean) => {
|
|
9
|
+
tableLayout: string;
|
|
10
|
+
width: string;
|
|
11
|
+
minWidth: string;
|
|
12
|
+
"& thead": {
|
|
13
|
+
transition: string;
|
|
14
|
+
};
|
|
15
|
+
"& thead th": {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
fontWeight: string;
|
|
18
|
+
fontSize: string;
|
|
19
|
+
verticalAlign: string;
|
|
20
|
+
position: string;
|
|
21
|
+
zIndex: number;
|
|
22
|
+
top: string | number;
|
|
23
|
+
};
|
|
24
|
+
"& td, & td>div, & td>a": {
|
|
25
|
+
whiteSpace: string;
|
|
26
|
+
overflow: string;
|
|
27
|
+
textOverflow: string;
|
|
28
|
+
verticalAlign: string;
|
|
29
|
+
};
|
|
30
|
+
"& th[data-pinned='right'], & td[data-pinned='right']": {
|
|
31
|
+
position: string;
|
|
32
|
+
right: number;
|
|
33
|
+
background: string;
|
|
34
|
+
boxShadow: string;
|
|
35
|
+
"&::before": {
|
|
36
|
+
content: string;
|
|
37
|
+
position: string;
|
|
38
|
+
top: number;
|
|
39
|
+
left: string;
|
|
40
|
+
width: string;
|
|
41
|
+
height: string;
|
|
42
|
+
background: string;
|
|
43
|
+
pointerEvents: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
"& th[data-pinned='right']": {
|
|
47
|
+
background: string;
|
|
48
|
+
};
|
|
49
|
+
"& th[data-pinned='left'], & td[data-pinned='left']": {
|
|
50
|
+
position: string;
|
|
51
|
+
left: number;
|
|
52
|
+
background: string;
|
|
53
|
+
boxShadow: string;
|
|
54
|
+
"&::after": {
|
|
55
|
+
content: string;
|
|
56
|
+
position: string;
|
|
57
|
+
top: number;
|
|
58
|
+
right: string;
|
|
59
|
+
width: string;
|
|
60
|
+
height: string;
|
|
61
|
+
background: string;
|
|
62
|
+
pointerEvents: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
"& th[data-pinned='left']": {
|
|
66
|
+
background: string;
|
|
67
|
+
zIndex: number;
|
|
68
|
+
};
|
|
69
|
+
"& .resizer": {
|
|
70
|
+
position: string;
|
|
71
|
+
right: number;
|
|
72
|
+
top: number;
|
|
73
|
+
height: string;
|
|
74
|
+
width: string;
|
|
75
|
+
background: string;
|
|
76
|
+
cursor: string;
|
|
77
|
+
userSelect: string;
|
|
78
|
+
touchAction: string;
|
|
79
|
+
zIndex: number;
|
|
80
|
+
"@media (hover: hover)": {
|
|
81
|
+
opacity: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
"& .resizer.isResizing": {
|
|
85
|
+
background: string;
|
|
86
|
+
opacity: number;
|
|
87
|
+
};
|
|
88
|
+
"& *:hover > .resizer": {
|
|
89
|
+
"@media (hover: hover)": {
|
|
90
|
+
opacity: number;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
"& th button": {
|
|
94
|
+
display: string;
|
|
95
|
+
alignItems: string;
|
|
96
|
+
flexWrap: string;
|
|
97
|
+
gap: string;
|
|
98
|
+
position: string;
|
|
99
|
+
border: string;
|
|
100
|
+
cursor: string;
|
|
101
|
+
padding: number;
|
|
102
|
+
textAlign: string;
|
|
103
|
+
fontWeight: string;
|
|
104
|
+
fontSize: string;
|
|
105
|
+
width: string;
|
|
106
|
+
whiteSpace: string;
|
|
107
|
+
height: string;
|
|
108
|
+
flex: number;
|
|
109
|
+
"& i.fade": {
|
|
110
|
+
opacity: number;
|
|
111
|
+
transition: string;
|
|
112
|
+
};
|
|
113
|
+
"&:hover i.fade": {
|
|
114
|
+
opacity: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Row, TableOptions } from "@tanstack/react-table";
|
|
2
|
+
import { TableToolbarOptions } from "./TableToolbar";
|
|
3
|
+
export declare enum SortDirection {
|
|
4
|
+
ASC = "asc",
|
|
5
|
+
DESC = "desc"
|
|
6
|
+
}
|
|
7
|
+
export interface InfiniteScrollOptions {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
hasNextPage?: boolean;
|
|
10
|
+
isFetchingNextPage?: boolean;
|
|
11
|
+
fetchNextPage?: () => Promise<unknown> | void;
|
|
12
|
+
loadingText?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TableProps<TData = unknown> {
|
|
15
|
+
id: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
maxHeight?: boolean;
|
|
18
|
+
wrapText?: boolean;
|
|
19
|
+
rowRender?: (row: Row<TData>, props: {
|
|
20
|
+
key: string;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
reactTableOptions: Partial<TableOptions<TData>> & Pick<TableOptions<TData>, "data" | "columns">;
|
|
23
|
+
gridCheckboxes?: boolean;
|
|
24
|
+
selectedField?: string;
|
|
25
|
+
onSelectionChange?: (dataItem: TData) => void;
|
|
26
|
+
onHeaderSelectionChange?: (checked: boolean) => void;
|
|
27
|
+
headerSelectionValue?: boolean;
|
|
28
|
+
allSelected?: boolean;
|
|
29
|
+
showStickyScrollbar?: boolean;
|
|
30
|
+
enableStickyHeader?: boolean;
|
|
31
|
+
stickyHeaderOffset?: number;
|
|
32
|
+
infiniteScroll?: InfiniteScrollOptions;
|
|
33
|
+
toolbar?: TableToolbarOptions;
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColumnDef, Row } from "@tanstack/react-table";
|
|
2
|
+
interface TableBodyProps<TData> {
|
|
3
|
+
rows: Row<TData>[];
|
|
4
|
+
columns: ColumnDef<TData, unknown>[];
|
|
5
|
+
rowRender?: (row: Row<TData>, props: {
|
|
6
|
+
key: string;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
tableId: string;
|
|
10
|
+
}
|
|
11
|
+
declare function TableBodyInner<TData>({ rows, columns, rowRender, loading, tableId, }: TableBodyProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const TableBody: typeof TableBodyInner;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ColumnFiltersState, Table } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface TableToolbarOptions {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
totalResults?: number;
|
|
6
|
+
customContent?: React.ReactNode;
|
|
7
|
+
showFilterChips?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface TableToolbarProps<TData = unknown> {
|
|
10
|
+
toolbar: TableToolbarOptions;
|
|
11
|
+
columnFilters: ColumnFiltersState;
|
|
12
|
+
table: Table<TData>;
|
|
13
|
+
}
|
|
14
|
+
declare const TableToolbar: <TData = unknown>(props: TableToolbarProps<TData> & {
|
|
15
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
16
|
+
}) => React.ReactElement;
|
|
17
|
+
export default TableToolbar;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Column } from "@tanstack/react-table";
|
|
2
|
+
interface TextFilterProps<TData = unknown> {
|
|
3
|
+
column: Column<TData, unknown>;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Text filter component with search input
|
|
8
|
+
*/
|
|
9
|
+
export declare function TextFilter<TData = unknown>({ column, onClose, }: TextFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface NumericFilterProps<TData = unknown> {
|
|
11
|
+
column: Column<TData, unknown>;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Numeric filter component with min/max inputs
|
|
16
|
+
*/
|
|
17
|
+
export declare function NumericFilter<TData = unknown>({ column, onClose, }: NumericFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
interface DateFilterProps<TData = unknown> {
|
|
19
|
+
column: Column<TData, unknown>;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Date filter component with start/end date inputs
|
|
24
|
+
*/
|
|
25
|
+
export declare function DateFilter<TData = unknown>({ column, onClose, }: DateFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
interface SelectFilterProps<TData = unknown> {
|
|
27
|
+
column: Column<TData, unknown>;
|
|
28
|
+
options: string[];
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Select filter component with dropdown options
|
|
33
|
+
*/
|
|
34
|
+
export declare function SelectFilter<TData = unknown>({ column, options, onClose, }: SelectFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
interface MultiSelectFilterProps<TData = unknown> {
|
|
36
|
+
column: Column<TData, unknown>;
|
|
37
|
+
options: string[];
|
|
38
|
+
onClose?: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Multi-select filter component with checkboxes
|
|
42
|
+
*/
|
|
43
|
+
export declare function MultiSelectFilter<TData = unknown>({ column, options, onClose, }: MultiSelectFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare const filterComponentMap: {
|
|
45
|
+
readonly text: typeof TextFilter;
|
|
46
|
+
readonly number: typeof NumericFilter;
|
|
47
|
+
readonly date: typeof DateFilter;
|
|
48
|
+
readonly select: typeof SelectFilter;
|
|
49
|
+
readonly multiselect: typeof MultiSelectFilter;
|
|
50
|
+
};
|
|
51
|
+
interface ColumnFilterProps<TData = unknown> {
|
|
52
|
+
column: Column<TData, unknown>;
|
|
53
|
+
filterType?: "text" | "number" | "date" | "select" | "multiselect";
|
|
54
|
+
filterOptions?: string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Main column filter component that renders the appropriate filter UI
|
|
58
|
+
* based on the filter type
|
|
59
|
+
*/
|
|
60
|
+
export declare function ColumnFilter<TData = unknown>({ column, filterType, filterOptions, }: ColumnFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FilterFn } from "@tanstack/react-table";
|
|
2
|
+
/**
|
|
3
|
+
* Filter function for text-based columns
|
|
4
|
+
* Performs case-insensitive substring matching
|
|
5
|
+
*/
|
|
6
|
+
export declare const textFilter: FilterFn<unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Filter function for numeric columns with range support
|
|
9
|
+
* Supports min, max, or both
|
|
10
|
+
*/
|
|
11
|
+
export declare const numericFilter: FilterFn<unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* Filter function for date columns with range support
|
|
14
|
+
*/
|
|
15
|
+
export declare const dateFilter: FilterFn<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Filter function for select/dropdown columns
|
|
18
|
+
* Supports single or multiple values
|
|
19
|
+
*/
|
|
20
|
+
export declare const selectFilter: FilterFn<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Filter function for boolean columns
|
|
23
|
+
*/
|
|
24
|
+
export declare const booleanFilter: FilterFn<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Multi-select filter that checks if value is in the selected array
|
|
27
|
+
*/
|
|
28
|
+
export declare const multiSelectFilter: FilterFn<unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InfiniteScrollOptions } from "../Table.types";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to manage infinite scroll behavior using IntersectionObserver
|
|
5
|
+
* Automatically fetches next page when sentinel element is visible
|
|
6
|
+
*/
|
|
7
|
+
export declare function useInfiniteScroll(infiniteScroll: InfiniteScrollOptions | undefined, observerTargetRef: React.RefObject<HTMLDivElement>): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface UseStickyHeaderOptions {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
stickyHeaderOffset: number;
|
|
5
|
+
tableWrapperRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
theadRef: React.RefObject<HTMLTableSectionElement>;
|
|
7
|
+
toolbarRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to manage sticky header behavior with smooth transitions
|
|
11
|
+
* Handles scroll detection and header positioning with fade effects
|
|
12
|
+
*/
|
|
13
|
+
export declare function useStickyHeader({ enabled, stickyHeaderOffset, tableWrapperRef, theadRef, toolbarRef, }: UseStickyHeaderOptions): boolean;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to manage sticky horizontal scrollbar visibility
|
|
4
|
+
* Shows a sticky scrollbar at the bottom of the viewport when the native scrollbar is out of view
|
|
5
|
+
*/
|
|
6
|
+
export declare function useStickyScrollbar(tableWrapperRef: React.RefObject<HTMLDivElement>): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const STATUS_OPTIONS: string[];
|
|
2
|
+
export declare const READING_GROUP_OPTIONS: string[];
|
|
3
|
+
export interface MockProduct {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
digital_isbn: string;
|
|
7
|
+
author: string;
|
|
8
|
+
publish_date: Date;
|
|
9
|
+
image_count: number;
|
|
10
|
+
reviewed_image_count: number;
|
|
11
|
+
creator: string;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
detail_url: string;
|
|
14
|
+
update_url: string;
|
|
15
|
+
delete_url: string;
|
|
16
|
+
export_url: string;
|
|
17
|
+
reviewers: string;
|
|
18
|
+
reviewed_at: Date;
|
|
19
|
+
last_reviewed_by: string;
|
|
20
|
+
status: string;
|
|
21
|
+
reading_group: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const mockProducts: MockProduct[];
|
|
24
|
+
export declare function generateProducts(num: number): MockProduct[];
|
|
@@ -34,6 +34,7 @@ import Logo from "./global/Logo/Logo";
|
|
|
34
34
|
import LogoMini from "./global/Logo/LogoMini";
|
|
35
35
|
import ThemeProvider from "./global/ThemeProvider";
|
|
36
36
|
import Autocomplete from "./inputs/Autocomplete";
|
|
37
|
+
import AutocompleteOption from "./inputs/Autocomplete/AutocompleteOption";
|
|
37
38
|
import AutocompleteSelectMultiple from "./inputs/Autocomplete/AutocompleteSelectMultiple";
|
|
38
39
|
import Button from "./inputs/Button";
|
|
39
40
|
import Checkbox from "./inputs/Checkbox";
|
|
@@ -72,4 +73,4 @@ import CardContent from "./surfaces/Card/CardContent";
|
|
|
72
73
|
import CardCover from "./surfaces/Card/CardCover";
|
|
73
74
|
import CardOverflow from "./surfaces/Card/CardOverflow";
|
|
74
75
|
import Sheet from "./surfaces/Sheet/Sheet";
|
|
75
|
-
export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, Option, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Tab, tabClasses, Table, TabList, tabListClasses, TabPanel, tabPanelClasses, Tabs, Textarea, TextBlock, TextField, ThemeProvider, ToastMessages, Tooltip, Typography, };
|
|
76
|
+
export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteOption, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, Option, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Tab, tabClasses, Table, TabList, tabListClasses, TabPanel, tabPanelClasses, Tabs, Textarea, TextBlock, TextField, ThemeProvider, ToastMessages, Tooltip, Typography, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const STATUS_OPTIONS: string[];
|
|
2
|
+
export declare const READING_GROUP_OPTIONS: string[];
|
|
3
|
+
export interface MockProduct {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
digital_isbn: string;
|
|
7
|
+
author: string;
|
|
8
|
+
publish_date: Date;
|
|
9
|
+
image_count: number;
|
|
10
|
+
reviewed_image_count: number;
|
|
11
|
+
creator: string;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
detail_url: string;
|
|
14
|
+
update_url: string;
|
|
15
|
+
delete_url: string;
|
|
16
|
+
export_url: string;
|
|
17
|
+
reviewers: string;
|
|
18
|
+
reviewed_at: Date;
|
|
19
|
+
last_reviewed_by: string;
|
|
20
|
+
status: string;
|
|
21
|
+
reading_group: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const mockProducts: MockProduct[];
|
|
24
|
+
export declare function generateProducts(num: number): MockProduct[];
|