simple-table-core 4.0.0 → 4.0.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.
@@ -0,0 +1,11 @@
1
+ import type Row from "../types/Row";
2
+ import type { GetRowId } from "../types/GetRowId";
3
+ /** Mark and return a fresh empty row used as an `isLoading` skeleton placeholder. */
4
+ export declare const createLoadingPlaceholderRow: () => Row;
5
+ export declare const isLoadingPlaceholderRow: (row: Row) => boolean;
6
+ /**
7
+ * Consumer `getRowId` often collapses empty placeholders to the same key.
8
+ * Skip it for placeholders so WeakMap identity / positional ids stay unique.
9
+ */
10
+ export declare const wrapGetRowIdForLoadingPlaceholders: (getRowId: GetRowId | undefined) => GetRowId | undefined;
11
+ export declare const createLoadingPlaceholderRows: (count: number) => Row[];
@@ -44,8 +44,8 @@ export declare function collectHeaderAccessors(headers: ReadonlyArray<HeaderStru
44
44
  * invisible — callers must pass new object identities when data changes.
45
45
  */
46
46
  export declare function shallowEqualRow(a: object, b: object): boolean;
47
- /** Compatible with `GetRowId`; return may be undefined for sync helpers. */
48
- export type GetRowIdLike = (params: GetRowIdParams) => string | number | undefined;
47
+ /** Compatible with `GetRowId`; return may be nullish for sync helpers. */
48
+ export type GetRowIdLike = (params: GetRowIdParams) => string | number | null | undefined;
49
49
  /**
50
50
  * Above this length, skip per-field shallow compares when row object identity
51
51
  * differs. Same-array-ref and same-row-object cases stay O(1) / O(n) pointer
@@ -1,11 +1,14 @@
1
1
  /**
2
2
  * LOADING STATE TESTS
3
- * Tests for isLoading prop - skeleton loaders in cells when data is loading.
3
+ * Tests for isLoading prop - skeleton loaders when data is loading.
4
4
  */
5
5
  import type { Meta } from "@storybook/html";
6
6
  import { SimpleTableVanilla } from "../../src/index";
7
7
  declare const meta: Meta;
8
8
  export default meta;
9
+ /**
10
+ * Rows + isLoading: real data stays visible and skeleton rows are appended below.
11
+ */
9
12
  export declare const LoadingStateShowsSkeletons: {
10
13
  render: () => HTMLDivElement & {
11
14
  _table?: SimpleTableVanilla | undefined;
@@ -54,14 +57,20 @@ export declare const LoadingToLoadedRemovesStaleCells: {
54
57
  }) => Promise<void>;
55
58
  };
56
59
  /**
57
- * Repro: `updateBodyCellElement` skips content rebuilds for expandable cells
58
- * so the expand-icon DOM node survives for CSS transitions. That bypass also
59
- * skips loading-skeleton swaps, so toggling `isLoading` on already-rendered
60
- * row-grouped rows leaves the expandable column out of sync with every other
61
- * column.
62
- *
63
- * Entering loading: non-expandable columns show skeletons; expandable columns
64
- * keep their stale expand icon + value.
60
+ * Pagination / infinite-scroll style: loaded rows stay put; skeletons append;
61
+ * clearing loading with more rows removes skeletons.
62
+ */
63
+ export declare const LoadingAppendsSkeletonsUnderLoadedRows: {
64
+ render: () => HTMLDivElement & {
65
+ _table?: SimpleTableVanilla | undefined;
66
+ };
67
+ play: ({ canvasElement }: {
68
+ canvasElement: HTMLElement;
69
+ }) => Promise<void>;
70
+ };
71
+ /**
72
+ * Entering loading with existing expandable rows keeps their chevrons/content
73
+ * and only appends skeleton placeholder rows below.
65
74
  */
66
75
  export declare const ExpandableCellsShowSkeletonWhenEnteringLoading: {
67
76
  render: () => HTMLDivElement & {
@@ -72,10 +81,8 @@ export declare const ExpandableCellsShowSkeletonWhenEnteringLoading: {
72
81
  }) => Promise<void>;
73
82
  };
74
83
  /**
75
- * Repro (exit path): expandable cells created while `isLoading` is true render
76
- * as skeletons. When loading ends, content updates are still skipped for
77
- * expandable cells, so they stay stuck on the skeleton instead of restoring
78
- * the expand icon + value.
84
+ * Full-table skeleton (empty + loading) then resolve expandable rows: expandable
85
+ * cells must restore chevron + value instead of staying stuck on skeletons.
79
86
  */
80
87
  export declare const ExpandableCellsRestoreContentWhenLeavingLoading: {
81
88
  render: () => HTMLDivElement & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/src/index.d.ts",