simple-table-core 3.8.0 → 3.8.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.js +1 -1
- package/dist/cjs/src/core/SimpleTableVanilla.d.ts +7 -0
- package/dist/cjs/src/managers/AutoScaleManager.d.ts +8 -1
- package/dist/cjs/stories/tests/12-CellSelectionTests.stories.d.ts +15 -0
- package/dist/cjs/stories/tests/15-ColumnVisibilityTests.stories.d.ts +8 -0
- package/dist/cjs/stories/tests/39-AutoExpandColumnsTests.stories.d.ts +10 -0
- package/dist/cjs/stories/tests/47-DeferredHeadersTests.stories.d.ts +23 -0
- package/dist/index.es.js +1 -1
- package/dist/src/core/SimpleTableVanilla.d.ts +7 -0
- package/dist/src/managers/AutoScaleManager.d.ts +8 -1
- package/dist/stories/tests/12-CellSelectionTests.stories.d.ts +15 -0
- package/dist/stories/tests/15-ColumnVisibilityTests.stories.d.ts +8 -0
- package/dist/stories/tests/39-AutoExpandColumnsTests.stories.d.ts +10 -0
- package/dist/stories/tests/47-DeferredHeadersTests.stories.d.ts +23 -0
- package/package.json +1 -1
|
@@ -225,6 +225,13 @@ export declare class SimpleTableVanilla {
|
|
|
225
225
|
private isAutoSizeLeaf;
|
|
226
226
|
private computeAutoSizeAccessors;
|
|
227
227
|
private getAutoSizeStyleRoot;
|
|
228
|
+
/**
|
|
229
|
+
* Rows that content-fit ("auto") measurement should sample. With client-side
|
|
230
|
+
* pagination only the current page is rendered, so fit columns to the page's
|
|
231
|
+
* rows rather than the entire dataset — otherwise off-page values inflate
|
|
232
|
+
* every auto column's width.
|
|
233
|
+
*/
|
|
234
|
+
private getAutoSizeRows;
|
|
228
235
|
/** Immutably write measured pixel widths into the leaf headers. */
|
|
229
236
|
private applyMeasuredWidths;
|
|
230
237
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import HeaderObject from "../types/HeaderObject";
|
|
1
|
+
import HeaderObject, { Accessor } from "../types/HeaderObject";
|
|
2
2
|
interface AutoScaleConfig {
|
|
3
3
|
autoExpandColumns: boolean;
|
|
4
4
|
containerWidth: number;
|
|
@@ -8,6 +8,13 @@ interface AutoScaleConfig {
|
|
|
8
8
|
current: HTMLDivElement | null;
|
|
9
9
|
};
|
|
10
10
|
isResizing?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Currently collapsed header accessors. Auto-scale must only account for the
|
|
13
|
+
* leaf columns that are actually visible for the current collapsed state —
|
|
14
|
+
* otherwise it sums the widths of hidden child columns and under-expands,
|
|
15
|
+
* leaving empty space on the right.
|
|
16
|
+
*/
|
|
17
|
+
collapsedHeaders?: Set<Accessor>;
|
|
11
18
|
}
|
|
12
19
|
type HeaderUpdateCallback = (headers: HeaderObject[]) => void;
|
|
13
20
|
export declare const applyAutoScaleToHeaders: (headers: HeaderObject[], options: AutoScaleConfig) => HeaderObject[];
|
|
@@ -131,6 +131,21 @@ export declare const CopySelectionWithoutHeaders: {
|
|
|
131
131
|
canvasElement: HTMLElement;
|
|
132
132
|
}) => Promise<void>;
|
|
133
133
|
};
|
|
134
|
+
/**
|
|
135
|
+
* Regression: with `selectableCells` enabled, the cell mousedown handler used to
|
|
136
|
+
* `preventDefault()` and start a cell selection even when the press landed on an
|
|
137
|
+
* <a> rendered inside the cell. That cancelled the link's native default (href
|
|
138
|
+
* navigation) and forced a body re-render that swallowed the pending click.
|
|
139
|
+
* A link inside a cell must stay clickable and must not trigger cell selection.
|
|
140
|
+
*/
|
|
141
|
+
export declare const LinkInsideCellStaysClickable: {
|
|
142
|
+
render: () => HTMLDivElement & {
|
|
143
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
144
|
+
};
|
|
145
|
+
play: ({ canvasElement }: {
|
|
146
|
+
canvasElement: HTMLElement;
|
|
147
|
+
}) => Promise<void>;
|
|
148
|
+
};
|
|
134
149
|
export declare const ShiftArrowExtendsSelection: {
|
|
135
150
|
render: () => HTMLDivElement & {
|
|
136
151
|
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
@@ -109,6 +109,14 @@ export declare const ExcludeFromRenderNotInColumnEditor: {
|
|
|
109
109
|
canvasElement: HTMLElement;
|
|
110
110
|
}) => Promise<void>;
|
|
111
111
|
};
|
|
112
|
+
export declare const ExcludeFromRenderDoesNotInflateRowWidth: {
|
|
113
|
+
render: () => HTMLDivElement & {
|
|
114
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
115
|
+
};
|
|
116
|
+
play: ({ canvasElement }: {
|
|
117
|
+
canvasElement: HTMLElement;
|
|
118
|
+
}) => Promise<void>;
|
|
119
|
+
};
|
|
112
120
|
export declare const ColumnEditorCustomText: {
|
|
113
121
|
render: () => HTMLDivElement & {
|
|
114
122
|
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
@@ -80,6 +80,16 @@ export declare const AutoExpandGroupedExpandCollapse: {
|
|
|
80
80
|
canvasElement: HTMLElement;
|
|
81
81
|
}) => Promise<void>;
|
|
82
82
|
};
|
|
83
|
+
export declare const AutoExpandCollapsibleColumnsFillContainer: {
|
|
84
|
+
tags: string[];
|
|
85
|
+
parameters: {
|
|
86
|
+
tags: string[];
|
|
87
|
+
};
|
|
88
|
+
render: () => HTMLElement;
|
|
89
|
+
play: ({ canvasElement }: {
|
|
90
|
+
canvasElement: HTMLElement;
|
|
91
|
+
}) => Promise<void>;
|
|
92
|
+
};
|
|
83
93
|
export declare const AutoExpandWithNestedGrouping: {
|
|
84
94
|
parameters: {
|
|
85
95
|
tags: string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DEFERRED HEADERS TESTS
|
|
3
|
+
* Regression tests for populating `defaultHeaders` after mount (the table
|
|
4
|
+
* mounts with an empty header array, then `update({ defaultHeaders })` supplies
|
|
5
|
+
* the real columns — e.g. from an async fetch / useEffect).
|
|
6
|
+
*
|
|
7
|
+
* The header band must become visible once the columns arrive. Previously the
|
|
8
|
+
* DimensionManager kept maxHeaderDepth/calculatedHeaderHeight at 0 (computed
|
|
9
|
+
* from the empty mount-time headers), so the header row rendered at 0px height
|
|
10
|
+
* even though the body and the header cells existed.
|
|
11
|
+
*/
|
|
12
|
+
import type { Meta } from "@storybook/html";
|
|
13
|
+
import { SimpleTableVanilla } from "../../src/index";
|
|
14
|
+
declare const meta: Meta;
|
|
15
|
+
export default meta;
|
|
16
|
+
export declare const PopulateHeadersAfterMount: {
|
|
17
|
+
render: () => HTMLDivElement & {
|
|
18
|
+
_table?: SimpleTableVanilla | undefined;
|
|
19
|
+
};
|
|
20
|
+
play: ({ canvasElement }: {
|
|
21
|
+
canvasElement: HTMLElement;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
};
|