simple-table-core 3.8.1 → 3.8.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/hooks/contentHeight.d.ts +1 -1
- package/dist/cjs/stories/tests/22-LoadingStateTests.stories.d.ts +27 -3
- package/dist/cjs/stories/tests/40-MaxHeightScrollTests.stories.d.ts +9 -0
- package/dist/index.es.js +1 -1
- package/dist/src/hooks/contentHeight.d.ts +1 -1
- package/dist/stories/tests/22-LoadingStateTests.stories.d.ts +27 -3
- package/dist/stories/tests/40-MaxHeightScrollTests.stories.d.ts +9 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export interface ContentHeightConfig {
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts a height value (string or number) to pixels
|
|
19
19
|
*/
|
|
20
|
-
export declare const convertHeightToPixels: (heightValue: string | number) => number;
|
|
20
|
+
export declare const convertHeightToPixels: (heightValue: string | number, container?: Element | null) => number;
|
|
21
21
|
/**
|
|
22
22
|
* Calculates the content height for the table.
|
|
23
23
|
* This is a pure function alternative to the useContentHeight hook.
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Tests for isLoading prop - skeleton loaders in cells when data is loading.
|
|
4
4
|
*/
|
|
5
5
|
import type { Meta } from "@storybook/html";
|
|
6
|
+
import { SimpleTableVanilla } from "../../src/index";
|
|
6
7
|
declare const meta: Meta;
|
|
7
8
|
export default meta;
|
|
8
9
|
export declare const LoadingStateShowsSkeletons: {
|
|
9
10
|
render: () => HTMLDivElement & {
|
|
10
|
-
_table?:
|
|
11
|
+
_table?: SimpleTableVanilla | undefined;
|
|
11
12
|
};
|
|
12
13
|
play: ({ canvasElement }: {
|
|
13
14
|
canvasElement: HTMLElement;
|
|
@@ -15,7 +16,7 @@ export declare const LoadingStateShowsSkeletons: {
|
|
|
15
16
|
};
|
|
16
17
|
export declare const NotLoadingShowsData: {
|
|
17
18
|
render: () => HTMLDivElement & {
|
|
18
|
-
_table?:
|
|
19
|
+
_table?: SimpleTableVanilla | undefined;
|
|
19
20
|
};
|
|
20
21
|
play: ({ canvasElement }: {
|
|
21
22
|
canvasElement: HTMLElement;
|
|
@@ -23,7 +24,30 @@ export declare const NotLoadingShowsData: {
|
|
|
23
24
|
};
|
|
24
25
|
export declare const LoadingStateWithEmptyRows: {
|
|
25
26
|
render: () => HTMLDivElement & {
|
|
26
|
-
_table?:
|
|
27
|
+
_table?: SimpleTableVanilla | undefined;
|
|
28
|
+
};
|
|
29
|
+
play: ({ canvasElement }: {
|
|
30
|
+
canvasElement: HTMLElement;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Repro for the stale-cell bug. Body cells are keyed by `${rowId}-${accessor}`,
|
|
35
|
+
* where `rowId` comes from `getRowId`. When `getRowId` derives the id from row
|
|
36
|
+
* data, a row that is still loading has no id yet, so `getRowId` returns
|
|
37
|
+
* `undefined` (→ "undefined"). While `isLoading` is true the core renders a
|
|
38
|
+
* batch of skeleton rows that ALL collapse to the same cell id
|
|
39
|
+
* (`undefined-<accessor>`); only the last one is tracked in the rendered-cell
|
|
40
|
+
* registry, so the rest are orphaned in the DOM. Once the data resolves and
|
|
41
|
+
* `getRowId` returns a real id, the registry-driven cleanup removes only the
|
|
42
|
+
* tracked cell, leaving the orphaned skeleton cells underneath the real data
|
|
43
|
+
* cell indefinitely.
|
|
44
|
+
*
|
|
45
|
+
* After a single row resolves, the body should hold exactly one cell per
|
|
46
|
+
* column and no leftover loading skeletons.
|
|
47
|
+
*/
|
|
48
|
+
export declare const LoadingToLoadedRemovesStaleCells: {
|
|
49
|
+
render: () => HTMLDivElement & {
|
|
50
|
+
_table?: SimpleTableVanilla | undefined;
|
|
27
51
|
};
|
|
28
52
|
play: ({ canvasElement }: {
|
|
29
53
|
canvasElement: HTMLElement;
|
|
@@ -26,3 +26,12 @@ export declare const MaxHeightNoScrollWhenContentFits: {
|
|
|
26
26
|
canvasElement: any;
|
|
27
27
|
}) => Promise<void>;
|
|
28
28
|
};
|
|
29
|
+
export declare const MaxHeightCalcScrolls: {
|
|
30
|
+
tags: string[];
|
|
31
|
+
render: () => HTMLDivElement & {
|
|
32
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
33
|
+
};
|
|
34
|
+
play: ({ canvasElement }: {
|
|
35
|
+
canvasElement: any;
|
|
36
|
+
}) => Promise<void>;
|
|
37
|
+
};
|