simple-table-core 3.9.1 → 3.9.3
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.js +1 -1
- package/dist/cjs/src/consts/general-consts.d.ts +2 -0
- package/dist/cjs/src/core/rendering/SectionRenderer.d.ts +8 -0
- package/dist/cjs/src/utils/bodyCell/styling.d.ts +2 -0
- package/dist/cjs/src/utils/headerCell/eventTracking.d.ts +1 -1
- package/dist/cjs/src/utils/headerCell/types.d.ts +6 -0
- package/dist/cjs/src/utils/headerWidthUtils.d.ts +24 -12
- package/dist/cjs/src/utils/horizontalScrollbarRenderer.d.ts +7 -0
- package/dist/cjs/stories/docs/Examples.stories.d.ts +17 -0
- package/dist/cjs/stories/{SimpleTable.stories.d.ts → docs/Features.stories.d.ts} +5 -16
- package/dist/cjs/stories/docs/GettingStarted.stories.d.ts +7 -0
- package/dist/cjs/stories/docs/storyArgs.d.ts +154 -0
- package/dist/cjs/stories/examples/RadioStationsExample.d.ts +3 -0
- package/dist/cjs/stories/tests/18-QuickFilterTests.stories.d.ts +19 -0
- package/dist/cjs/stories/tests/46-AutoSizeColumnsTests.stories.d.ts +65 -1
- package/dist/cjs/stories/utils.d.ts +15 -2
- package/dist/cjs/styles.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/src/consts/general-consts.d.ts +2 -0
- package/dist/src/core/rendering/SectionRenderer.d.ts +8 -0
- package/dist/src/utils/bodyCell/styling.d.ts +2 -0
- package/dist/src/utils/headerCell/eventTracking.d.ts +1 -1
- package/dist/src/utils/headerCell/types.d.ts +6 -0
- package/dist/src/utils/headerWidthUtils.d.ts +24 -12
- package/dist/src/utils/horizontalScrollbarRenderer.d.ts +7 -0
- package/dist/stories/docs/Examples.stories.d.ts +17 -0
- package/dist/stories/{SimpleTable.stories.d.ts → docs/Features.stories.d.ts} +5 -16
- package/dist/stories/docs/GettingStarted.stories.d.ts +7 -0
- package/dist/stories/docs/storyArgs.d.ts +154 -0
- package/dist/stories/examples/RadioStationsExample.d.ts +3 -0
- package/dist/stories/tests/18-QuickFilterTests.stories.d.ts +19 -0
- package/dist/stories/tests/46-AutoSizeColumnsTests.stories.d.ts +65 -1
- package/dist/stories/utils.d.ts +15 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/base.css +14 -1
|
@@ -19,3 +19,5 @@ export declare const AUTO_SIZE_OUTLIER_PERCENTILE = 95;
|
|
|
19
19
|
export declare const AUTO_SIZE_OUTLIER_THRESHOLD = 0.5;
|
|
20
20
|
export declare const AUTO_SIZE_MIN_SAMPLE_FOR_CLIP = 20;
|
|
21
21
|
export declare const AUTO_SIZE_WIDTH_BUFFER = 2;
|
|
22
|
+
/** Extra padding reserved around header icons (sort / collapse) during auto-size. */
|
|
23
|
+
export declare const AUTO_SIZE_HEADER_ICON_PADDING = 4;
|
|
@@ -107,5 +107,13 @@ export declare class SectionRenderer {
|
|
|
107
107
|
* currently knows about.
|
|
108
108
|
*/
|
|
109
109
|
private captureSnapshotConfig;
|
|
110
|
+
/**
|
|
111
|
+
* Tear down all body sections and forget them so a subsequent
|
|
112
|
+
* `renderBodySection` creates fresh nodes. Used when the empty-state path
|
|
113
|
+
* takes over the body container: clearing `innerHTML` alone leaves
|
|
114
|
+
* `renderedCells` pointing at detached nodes, so rows never remount when
|
|
115
|
+
* data returns (e.g. typing `-E` mid-filter briefly matches every row).
|
|
116
|
+
*/
|
|
117
|
+
releaseBodySections(): void;
|
|
110
118
|
cleanup(): void;
|
|
111
119
|
}
|
|
@@ -2,6 +2,8 @@ import { AbsoluteBodyCell, CellRegistryEntry, CellRenderContext } from "./types"
|
|
|
2
2
|
import { CellLiveRef, cellLiveRefMap } from "./cellLiveRef";
|
|
3
3
|
export { cellLiveRefMap };
|
|
4
4
|
export type { CellLiveRef };
|
|
5
|
+
/** Drop the content memo so the next `updateBodyCellElement` rebuilds. */
|
|
6
|
+
export declare const invalidateBodyCellContentMemo: (cellElement: HTMLElement) => void;
|
|
5
7
|
export declare const untrackCellByRow: (rowId: string, cellElement: HTMLElement) => void;
|
|
6
8
|
export declare const unregisterCellFromRegistry: (cellElement: HTMLElement, cellRegistry?: Map<string, CellRegistryEntry>) => void;
|
|
7
9
|
export declare const createBodyCellElement: (cell: AbsoluteBodyCell, context: CellRenderContext) => HTMLElement;
|
|
@@ -25,4 +25,4 @@ export declare const addTrackedEventListener: (element: HTMLElement, event: stri
|
|
|
25
25
|
/** Header tooltips are portaled under .simple-table-root; remove them when header DOM is torn down
|
|
26
26
|
* without pointer leave (e.g. sort/filter invalidates context cache and removes header cells). */
|
|
27
27
|
export declare const removeFloatingHeaderTooltips: (fromElement: HTMLElement) => void;
|
|
28
|
-
export declare const cleanupHeaderCellRendering: (container?: HTMLElement) => void;
|
|
28
|
+
export declare const cleanupHeaderCellRendering: (container?: HTMLElement, onHostDiscard?: ((host: HTMLElement) => void) | undefined) => void;
|
|
@@ -96,5 +96,11 @@ export interface HeaderRenderContext {
|
|
|
96
96
|
* driving the unfold animation.
|
|
97
97
|
*/
|
|
98
98
|
animationCoordinator?: AnimationCoordinator;
|
|
99
|
+
/**
|
|
100
|
+
* Called immediately before a header host (or its label content) is permanently
|
|
101
|
+
* discarded so adapters can tear down renderer subtrees (e.g. React portals).
|
|
102
|
+
* Mirrors {@link CellRenderContext.onRendererHostDiscard}.
|
|
103
|
+
*/
|
|
104
|
+
onRendererHostDiscard?: (host: HTMLElement) => void;
|
|
99
105
|
}
|
|
100
106
|
export {};
|
|
@@ -71,29 +71,41 @@ export declare const getAllVisibleLeafHeaders: (headers: HeaderObject[], collaps
|
|
|
71
71
|
* @returns The optimal width in pixels
|
|
72
72
|
*/
|
|
73
73
|
export declare const calculateHeaderContentWidth: (accessor: Accessor, options?: {
|
|
74
|
-
rows?: any[];
|
|
75
|
-
header?: HeaderObject;
|
|
76
|
-
maxWidth?: number;
|
|
74
|
+
rows?: any[] | undefined;
|
|
75
|
+
header?: HeaderObject | undefined;
|
|
76
|
+
maxWidth?: number | undefined;
|
|
77
77
|
/** Leading rows always measured (default AUTO_SIZE_HEAD_SAMPLE_SIZE) */
|
|
78
|
-
headSampleSize?: number;
|
|
78
|
+
headSampleSize?: number | undefined;
|
|
79
79
|
/** Rows sampled at an even stride across the rest (default AUTO_SIZE_STRIDED_SAMPLE_SIZE) */
|
|
80
|
-
stridedSampleSize?: number;
|
|
80
|
+
stridedSampleSize?: number | undefined;
|
|
81
81
|
/** Back-compat: when set, used as the head sample size (strided defaults to 0) */
|
|
82
|
-
sampleSize?: number;
|
|
82
|
+
sampleSize?: number | undefined;
|
|
83
83
|
/** Outlier clip percentile (default AUTO_SIZE_OUTLIER_PERCENTILE) */
|
|
84
|
-
outlierPercentile?: number;
|
|
84
|
+
outlierPercentile?: number | undefined;
|
|
85
85
|
/** Outlier clip threshold fraction (default AUTO_SIZE_OUTLIER_THRESHOLD) */
|
|
86
|
-
outlierThreshold?: number;
|
|
86
|
+
outlierThreshold?: number | undefined;
|
|
87
87
|
/** When "header", ignore cell content and fit the header label only */
|
|
88
|
-
autoSizeMode?: "content" | "header";
|
|
88
|
+
autoSizeMode?: "content" | "header" | undefined;
|
|
89
89
|
/** Theme passed to a custom cellRenderer during measurement */
|
|
90
90
|
theme?: any;
|
|
91
91
|
/** Scope `.st-cell-content` font/padding sampling to this table instance */
|
|
92
|
-
styleRoot?: ParentNode | null;
|
|
92
|
+
styleRoot?: ParentNode | null | undefined;
|
|
93
93
|
/**
|
|
94
94
|
* The table's resolved sort icon. Used to reserve space on sortable columns
|
|
95
95
|
* that are not currently sorted (the icon only exists on the active sort
|
|
96
96
|
* column), so sorting later does not push the label into ellipsis.
|
|
97
97
|
*/
|
|
98
|
-
sortIcon?: string | HTMLElement | SVGSVGElement;
|
|
99
|
-
|
|
98
|
+
sortIcon?: string | HTMLElement | SVGSVGElement | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* The table's resolved expand/collapse icon. Used to reserve space on
|
|
101
|
+
* collapsible headers when the header cell is virtualized out of the
|
|
102
|
+
* horizontal band (so the icon is not in the DOM to measure directly).
|
|
103
|
+
*/
|
|
104
|
+
expandIcon?: string | HTMLElement | SVGSVGElement | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Called before a temporary measure host from `cellRenderer` is discarded.
|
|
107
|
+
* Framework adapters (React portals, Vue/Solid mounts) register on render;
|
|
108
|
+
* without this, autofit sampling leaks those registrations.
|
|
109
|
+
*/
|
|
110
|
+
onRendererHostDiscard?: ((host: HTMLElement) => void) | undefined;
|
|
111
|
+
} | undefined) => number;
|
|
@@ -9,6 +9,13 @@ export interface HorizontalScrollbarProps {
|
|
|
9
9
|
tableBodyContainerRef: HTMLDivElement;
|
|
10
10
|
editColumns: boolean;
|
|
11
11
|
sectionScrollController?: SectionScrollController | null;
|
|
12
|
+
/**
|
|
13
|
+
* When true, skip the DOM scrollWidth check and always build the scrollbar.
|
|
14
|
+
* Used after the caller has already verified content overflow (e.g. empty
|
|
15
|
+
* tables where the header scrollport is sized to content and reports no
|
|
16
|
+
* DOM overflow even though columns exceed the viewport).
|
|
17
|
+
*/
|
|
18
|
+
forceScrollable?: boolean;
|
|
12
19
|
}
|
|
13
20
|
export declare const createHorizontalScrollbar: (props: HorizontalScrollbarProps) => HTMLElement | null;
|
|
14
21
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docs & Examples / Examples – product-style demos (domain datasets).
|
|
3
|
+
* Stories are listed alphabetically.
|
|
4
|
+
*/
|
|
5
|
+
import type { Meta, StoryObj } from "@storybook/html";
|
|
6
|
+
declare const meta: Meta;
|
|
7
|
+
export default meta;
|
|
8
|
+
export declare const Billing: StoryObj;
|
|
9
|
+
export declare const Clay: StoryObj;
|
|
10
|
+
export declare const Finance: StoryObj;
|
|
11
|
+
export declare const Infrastructure: StoryObj;
|
|
12
|
+
export declare const Leads: StoryObj;
|
|
13
|
+
export declare const Manufacturing: StoryObj;
|
|
14
|
+
export declare const Music: StoryObj;
|
|
15
|
+
export declare const MusicWindowScroll: StoryObj;
|
|
16
|
+
export declare const RadioStations: StoryObj;
|
|
17
|
+
export declare const Sales: StoryObj;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Docs & Examples
|
|
3
|
-
* Each story uses SimpleTableVanilla; example logic lives in stories/examples/.
|
|
2
|
+
* Docs & Examples / Features – capability demos, listed alphabetically.
|
|
4
3
|
*/
|
|
5
4
|
import type { Meta, StoryObj } from "@storybook/html";
|
|
6
5
|
declare const meta: Meta;
|
|
7
6
|
export default meta;
|
|
8
7
|
export declare const AdvancedSorting: StoryObj;
|
|
9
|
-
export declare const
|
|
8
|
+
export declare const Aggregate: StoryObj;
|
|
10
9
|
export declare const Alignment: StoryObj;
|
|
11
10
|
export declare const AutoExpandColumns: StoryObj;
|
|
12
|
-
export declare const BasicExample: StoryObj;
|
|
13
11
|
export declare const BasicRowGrouping: StoryObj;
|
|
14
|
-
export declare const BillingExample: StoryObj;
|
|
15
12
|
export declare const CSVExportFormatting: StoryObj;
|
|
16
13
|
export declare const CSVExportSingleRowChildren: StoryObj;
|
|
17
14
|
export declare const CellHighlighting: StoryObj;
|
|
18
15
|
export declare const CellRenderer: StoryObj;
|
|
19
16
|
export declare const Charts: StoryObj;
|
|
20
|
-
export declare const ClayExample: StoryObj;
|
|
21
17
|
export declare const ClipboardFormatting: StoryObj;
|
|
22
18
|
export declare const CollapsibleColumns: StoryObj;
|
|
23
19
|
export declare const ColumnVisibilityAPI: StoryObj;
|
|
@@ -32,21 +28,14 @@ export declare const EditableCells: StoryObj;
|
|
|
32
28
|
export declare const ExpansionControl: StoryObj;
|
|
33
29
|
export declare const ExternalFilter: StoryObj;
|
|
34
30
|
export declare const ExternalSort: StoryObj;
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const FinanceExample: StoryObj;
|
|
31
|
+
export declare const Filter: StoryObj;
|
|
37
32
|
export declare const HeaderInclusion: StoryObj;
|
|
38
33
|
export declare const HiddenColumns: StoryObj;
|
|
39
34
|
export declare const InfiniteScroll: StoryObj;
|
|
40
|
-
export declare const WindowInfiniteScroll: StoryObj;
|
|
41
|
-
export declare const InfrastructureExample: StoryObj;
|
|
42
|
-
export declare const LeadsExample: StoryObj;
|
|
43
35
|
export declare const LiveUpdates: StoryObj;
|
|
44
36
|
export declare const LoadingState: StoryObj;
|
|
45
|
-
export declare const ManufacturingExample: StoryObj;
|
|
46
|
-
export declare const MusicExample: StoryObj;
|
|
47
|
-
export declare const MusicWindowScroll: StoryObj;
|
|
48
|
-
export declare const NestedGrid: StoryObj;
|
|
49
37
|
export declare const NestedAccessor: StoryObj;
|
|
38
|
+
export declare const NestedGrid: StoryObj;
|
|
50
39
|
export declare const Pagination: StoryObj;
|
|
51
40
|
export declare const PaginationAPI: StoryObj;
|
|
52
41
|
export declare const PinnedColumns: StoryObj;
|
|
@@ -57,8 +46,8 @@ export declare const RowButtons: StoryObj;
|
|
|
57
46
|
export declare const RowGrouping: StoryObj;
|
|
58
47
|
export declare const RowHeight: StoryObj;
|
|
59
48
|
export declare const RowSelection: StoryObj;
|
|
60
|
-
export declare const SalesExample: StoryObj;
|
|
61
49
|
export declare const SelectableCells: StoryObj;
|
|
62
50
|
export declare const ServerSidePagination: StoryObj;
|
|
63
51
|
export declare const Theming: StoryObj;
|
|
64
52
|
export declare const Tooltip: StoryObj;
|
|
53
|
+
export declare const WindowInfiniteScroll: StoryObj;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Storybook args helper for Docs & Examples stories.
|
|
3
|
+
*/
|
|
4
|
+
import { type UniversalVanillaArgs } from "../vanillaStoryConfig";
|
|
5
|
+
export declare const storyArgs: (exampleDefaults?: Partial<UniversalVanillaArgs>) => {
|
|
6
|
+
args: {
|
|
7
|
+
autoExpandColumns?: boolean | undefined;
|
|
8
|
+
cellUpdateFlash?: boolean | undefined;
|
|
9
|
+
columnReordering?: boolean | undefined;
|
|
10
|
+
columnResizing?: boolean | undefined;
|
|
11
|
+
customTheme?: import("../../src").CustomThemeProps | undefined;
|
|
12
|
+
editColumns?: boolean | undefined;
|
|
13
|
+
editColumnsInitOpen?: boolean | undefined;
|
|
14
|
+
expandAll?: boolean | undefined;
|
|
15
|
+
externalFilterHandling?: boolean | undefined;
|
|
16
|
+
externalSortHandling?: boolean | undefined;
|
|
17
|
+
height?: string | undefined;
|
|
18
|
+
hideFooter?: boolean | undefined;
|
|
19
|
+
rowsPerPage?: number | undefined;
|
|
20
|
+
selectableCells?: boolean | undefined;
|
|
21
|
+
selectableColumns?: boolean | undefined;
|
|
22
|
+
shouldPaginate?: boolean | undefined;
|
|
23
|
+
theme?: import("../../src/types/Theme").default | undefined;
|
|
24
|
+
useHoverRowBackground?: boolean | undefined;
|
|
25
|
+
useOddColumnBackground?: boolean | undefined;
|
|
26
|
+
useOddEvenRowBackground?: boolean | undefined;
|
|
27
|
+
};
|
|
28
|
+
argTypes: {
|
|
29
|
+
theme: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "select";
|
|
32
|
+
};
|
|
33
|
+
options: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
useOddColumnBackground: {
|
|
37
|
+
control: {
|
|
38
|
+
type: "boolean";
|
|
39
|
+
};
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
useHoverRowBackground: {
|
|
43
|
+
control: {
|
|
44
|
+
type: "boolean";
|
|
45
|
+
};
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
useOddEvenRowBackground: {
|
|
49
|
+
control: {
|
|
50
|
+
type: "boolean";
|
|
51
|
+
};
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
cellUpdateFlash: {
|
|
55
|
+
control: {
|
|
56
|
+
type: "boolean";
|
|
57
|
+
};
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
height: {
|
|
61
|
+
control: {
|
|
62
|
+
type: "text";
|
|
63
|
+
};
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
customTheme: {
|
|
67
|
+
control: {
|
|
68
|
+
type: "object";
|
|
69
|
+
};
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
autoExpandColumns: {
|
|
73
|
+
control: {
|
|
74
|
+
type: "boolean";
|
|
75
|
+
};
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
expandAll: {
|
|
79
|
+
control: {
|
|
80
|
+
type: "boolean";
|
|
81
|
+
};
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
columnReordering: {
|
|
85
|
+
control: {
|
|
86
|
+
type: "boolean";
|
|
87
|
+
};
|
|
88
|
+
description: string;
|
|
89
|
+
};
|
|
90
|
+
columnResizing: {
|
|
91
|
+
control: {
|
|
92
|
+
type: "boolean";
|
|
93
|
+
};
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
editColumns: {
|
|
97
|
+
control: {
|
|
98
|
+
type: "boolean";
|
|
99
|
+
};
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
editColumnsInitOpen: {
|
|
103
|
+
control: {
|
|
104
|
+
type: "boolean";
|
|
105
|
+
};
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
selectableCells: {
|
|
109
|
+
control: {
|
|
110
|
+
type: "boolean";
|
|
111
|
+
};
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
selectableColumns: {
|
|
115
|
+
control: {
|
|
116
|
+
type: "boolean";
|
|
117
|
+
};
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
shouldPaginate: {
|
|
121
|
+
control: {
|
|
122
|
+
type: "boolean";
|
|
123
|
+
};
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
hideFooter: {
|
|
127
|
+
control: {
|
|
128
|
+
type: "boolean";
|
|
129
|
+
};
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
externalSortHandling: {
|
|
133
|
+
control: {
|
|
134
|
+
type: "boolean";
|
|
135
|
+
};
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
externalFilterHandling: {
|
|
139
|
+
control: {
|
|
140
|
+
type: "boolean";
|
|
141
|
+
};
|
|
142
|
+
description: string;
|
|
143
|
+
};
|
|
144
|
+
rowsPerPage: {
|
|
145
|
+
control: {
|
|
146
|
+
type: "number";
|
|
147
|
+
min: number;
|
|
148
|
+
max: number;
|
|
149
|
+
step: number;
|
|
150
|
+
};
|
|
151
|
+
description: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
@@ -76,6 +76,25 @@ export declare const SmartModeQuotedPhrase: {
|
|
|
76
76
|
}) => Promise<void>;
|
|
77
77
|
};
|
|
78
78
|
export declare const SmartModeNegation: {
|
|
79
|
+
parameters: {
|
|
80
|
+
tags: string[];
|
|
81
|
+
};
|
|
82
|
+
render: () => HTMLDivElement & {
|
|
83
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
84
|
+
};
|
|
85
|
+
play: ({ canvasElement }: {
|
|
86
|
+
canvasElement: HTMLElement;
|
|
87
|
+
}) => Promise<void>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Filtering through a brief empty state (0 matching rows) and back must remount
|
|
91
|
+
* body cells. Regression for empty-state scrollport takeover that left
|
|
92
|
+
* SectionRenderer holding detached body sections.
|
|
93
|
+
*/
|
|
94
|
+
export declare const QuickFilterRecoversAfterEmptyState: {
|
|
95
|
+
parameters: {
|
|
96
|
+
tags: string[];
|
|
97
|
+
};
|
|
79
98
|
render: () => HTMLDivElement & {
|
|
80
99
|
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
81
100
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Comprehensive coverage for content-fit columns (`width: "auto"`):
|
|
5
5
|
* - shrink / grow, per-column `maxWidth` cap and `minWidth` floor
|
|
6
6
|
* - `autoSizeMode: "header"`
|
|
7
|
-
* - custom (vanilla) renderers, valueFormatter, valueGetter, chart columns
|
|
7
|
+
* - custom (vanilla) renderers, valueFormatter (incl. multi-line), valueGetter, chart columns
|
|
8
8
|
* - outliers (single giant value clipped) vs. a legitimate wide minority (kept)
|
|
9
9
|
* - very large datasets (50k rows) with bounded sampling
|
|
10
10
|
* - re-fit on data change, sort stability, empty data, mixed/pinned layouts
|
|
@@ -117,6 +117,23 @@ export declare const AutoSizeMeasuresFormattedValue: {
|
|
|
117
117
|
canvasElement: HTMLElement;
|
|
118
118
|
}) => Promise<void>;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* valueFormatter may return explicit multi-line text (e.g. an address). When the
|
|
122
|
+
* cell is allowed to wrap (`white-space: pre-line`), auto-size must fit the
|
|
123
|
+
* longest line — not the full string measured as one nowrap run (newlines
|
|
124
|
+
* collapse to spaces under `white-space: nowrap` measurement).
|
|
125
|
+
*/
|
|
126
|
+
export declare const AutoSizeMultilineFormattedValueUsesLongestLine: {
|
|
127
|
+
parameters: {
|
|
128
|
+
tags: string[];
|
|
129
|
+
};
|
|
130
|
+
render: () => HTMLDivElement & {
|
|
131
|
+
_table?: SimpleTableVanilla | undefined;
|
|
132
|
+
};
|
|
133
|
+
play: ({ canvasElement }: {
|
|
134
|
+
canvasElement: HTMLElement;
|
|
135
|
+
}) => Promise<void>;
|
|
136
|
+
};
|
|
120
137
|
export declare const AutoSizeMeasuresValueGetter: {
|
|
121
138
|
parameters: {
|
|
122
139
|
tags: string[];
|
|
@@ -302,6 +319,53 @@ export declare const AutoSizeEmptyStateAsyncHeaderRenderer: {
|
|
|
302
319
|
canvasElement: HTMLElement;
|
|
303
320
|
}) => Promise<void>;
|
|
304
321
|
};
|
|
322
|
+
export declare const AutoSizeCollapsibleHeaderReservesIconWidth: {
|
|
323
|
+
parameters: {
|
|
324
|
+
tags: string[];
|
|
325
|
+
};
|
|
326
|
+
render: () => HTMLDivElement & {
|
|
327
|
+
_table?: SimpleTableVanilla | undefined;
|
|
328
|
+
};
|
|
329
|
+
play: ({ canvasElement }: {
|
|
330
|
+
canvasElement: HTMLElement;
|
|
331
|
+
}) => Promise<void>;
|
|
332
|
+
};
|
|
333
|
+
export declare const AutoSizeLongHeaderConsistentAcrossContainerWidths: {
|
|
334
|
+
parameters: {
|
|
335
|
+
tags: string[];
|
|
336
|
+
};
|
|
337
|
+
render: () => HTMLDivElement;
|
|
338
|
+
play: ({ canvasElement }: {
|
|
339
|
+
canvasElement: HTMLElement;
|
|
340
|
+
}) => Promise<void>;
|
|
341
|
+
};
|
|
342
|
+
export declare const HorizontalScrollbarShowsWhenHeaderOverflowsEmptyState: {
|
|
343
|
+
parameters: {
|
|
344
|
+
tags: string[];
|
|
345
|
+
};
|
|
346
|
+
render: () => HTMLDivElement & {
|
|
347
|
+
_table?: SimpleTableVanilla | undefined;
|
|
348
|
+
};
|
|
349
|
+
play: ({ canvasElement }: {
|
|
350
|
+
canvasElement: HTMLElement;
|
|
351
|
+
}) => Promise<void>;
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* Empty tables still need a real body scrollport: wheel/trackpad over the
|
|
355
|
+
* "No rows to display" area (and the horizontal scrollbar) must scroll the
|
|
356
|
+
* headers. Replacing the body with a non-scrolling empty wrapper breaks that.
|
|
357
|
+
*/
|
|
358
|
+
export declare const EmptyStateBodyScrollSyncsWithHeader: {
|
|
359
|
+
parameters: {
|
|
360
|
+
tags: string[];
|
|
361
|
+
};
|
|
362
|
+
render: () => HTMLDivElement & {
|
|
363
|
+
_table?: SimpleTableVanilla | undefined;
|
|
364
|
+
};
|
|
365
|
+
play: ({ canvasElement }: {
|
|
366
|
+
canvasElement: HTMLElement;
|
|
367
|
+
}) => Promise<void>;
|
|
368
|
+
};
|
|
305
369
|
export declare const SamplingAndOutlierHelpers: {
|
|
306
370
|
parameters: {
|
|
307
371
|
tags: string[];
|
|
@@ -2,9 +2,22 @@
|
|
|
2
2
|
* Shared helpers for vanilla stories (examples and tests).
|
|
3
3
|
*/
|
|
4
4
|
import { SimpleTableVanilla } from "../src/index";
|
|
5
|
-
import type { HeaderObject, Row } from "../src/index";
|
|
5
|
+
import type { HeaderObject, Row, SimpleTableConfig } from "../src/index";
|
|
6
6
|
/** Instance type of the table (class is a value; use InstanceType<typeof C> for the type of instances). */
|
|
7
7
|
type TableInstance = InstanceType<typeof SimpleTableVanilla>;
|
|
8
|
+
/**
|
|
9
|
+
* Config passed through to {@link SimpleTableVanilla}, minus `defaultHeaders` /
|
|
10
|
+
* `rows` which are supplied as the first two arguments of
|
|
11
|
+
* {@link renderVanillaTable}.
|
|
12
|
+
*
|
|
13
|
+
* Keys are constrained to {@link SimpleTableConfig} so typos and misplaced
|
|
14
|
+
* props (e.g. top-level `rowHeight` instead of `customTheme.rowHeight`) fail
|
|
15
|
+
* at compile time. Values stay loose (`unknown`) so story callbacks that are
|
|
16
|
+
* slightly narrower than the public types still typecheck.
|
|
17
|
+
*/
|
|
18
|
+
export type RenderVanillaTableOptions = {
|
|
19
|
+
[K in keyof Omit<SimpleTableConfig, "defaultHeaders" | "rows">]?: unknown;
|
|
20
|
+
};
|
|
8
21
|
export interface RenderVanillaTableResult {
|
|
9
22
|
wrapper: HTMLDivElement & {
|
|
10
23
|
_table?: TableInstance;
|
|
@@ -13,7 +26,7 @@ export interface RenderVanillaTableResult {
|
|
|
13
26
|
tableContainer: HTMLDivElement;
|
|
14
27
|
table: TableInstance;
|
|
15
28
|
}
|
|
16
|
-
export declare function renderVanillaTable(headers: HeaderObject[], data: Row[], options?:
|
|
29
|
+
export declare function renderVanillaTable(headers: HeaderObject[], data: Row[], options?: RenderVanillaTableOptions): RenderVanillaTableResult;
|
|
17
30
|
export declare function addParagraph(wrapper: HTMLElement, text: string, beforeElement?: Element | null): HTMLParagraphElement;
|
|
18
31
|
export interface ControlPanelSection {
|
|
19
32
|
heading: string;
|