@simple-table/react 3.8.9 → 3.9.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.
Files changed (30) hide show
  1. package/dist/types/core/src/managers/AnimationCoordinator.d.ts +67 -0
  2. package/dist/types/core/src/managers/DimensionManager.d.ts +11 -0
  3. package/dist/types/core/src/types/AnimationsConfig.d.ts +2 -0
  4. package/package.json +2 -2
  5. package/dist/types/react/src/__tests__/animationCoordinator.test.d.ts +0 -1
  6. package/dist/types/react/src/__tests__/autoSizeColumns.test.d.ts +0 -1
  7. package/dist/types/react/src/__tests__/cellRendererMemoization.test.d.ts +0 -1
  8. package/dist/types/react/src/__tests__/collapseMultipleColumnGroups.test.d.ts +0 -1
  9. package/dist/types/react/src/__tests__/columnVirtualizationViewportWidth.test.d.ts +0 -1
  10. package/dist/types/react/src/__tests__/contextAndSlots.test.d.ts +0 -1
  11. package/dist/types/react/src/__tests__/deferredHeaders.test.d.ts +0 -1
  12. package/dist/types/react/src/__tests__/domSlots.test.d.ts +0 -1
  13. package/dist/types/react/src/__tests__/errorBoundary.test.d.ts +0 -1
  14. package/dist/types/react/src/__tests__/excludeFromRenderWidth.test.d.ts +0 -1
  15. package/dist/types/react/src/__tests__/getRowIdChange.test.d.ts +0 -1
  16. package/dist/types/react/src/__tests__/hostContext.test.d.ts +0 -1
  17. package/dist/types/react/src/__tests__/imperativeDomSlot.test.d.ts +0 -1
  18. package/dist/types/react/src/__tests__/linkClickInCell.test.d.ts +0 -1
  19. package/dist/types/react/src/__tests__/loadingSkeletonExpandableColumn.test.d.ts +0 -1
  20. package/dist/types/react/src/__tests__/maxHeightCalcScroll.test.d.ts +0 -1
  21. package/dist/types/react/src/__tests__/maxHeightServerSidePaginationEmptyRows.test.d.ts +0 -1
  22. package/dist/types/react/src/__tests__/portalBridge.test.d.ts +0 -1
  23. package/dist/types/react/src/__tests__/resetColumns.test.d.ts +0 -1
  24. package/dist/types/react/src/__tests__/rowButtons.test.d.ts +0 -1
  25. package/dist/types/react/src/__tests__/rowHover.test.d.ts +0 -1
  26. package/dist/types/react/src/__tests__/serverSidePaginationCustomFooter.test.d.ts +0 -1
  27. package/dist/types/react/src/__tests__/staleCallbacks.test.d.ts +0 -1
  28. package/dist/types/react/src/__tests__/staleRowIdCells.test.d.ts +0 -1
  29. package/dist/types/react/src/__tests__/updateDataDuringAnimation.test.d.ts +0 -1
  30. package/dist/types/react/src/__tests__/wrapReactRenderer.test.d.ts +0 -1
@@ -205,6 +205,73 @@ export declare class AnimationCoordinator {
205
205
  * sort/reorder FLIP-from-off-screen behavior is preserved.
206
206
  */
207
207
  hasSnapshotEntryInContainer(cellId: string, currentContainer: HTMLElement): boolean;
208
+ /**
209
+ * Whether a vertical position transition should be animated. Rows that live
210
+ * only in the virtualization padding band (above/below the visible viewport)
211
+ * should teleport rather than FLIP — otherwise a mid-scroll sort animates
212
+ * hundreds of off-screen rows through the viewport at once.
213
+ */
214
+ shouldAnimateVerticalTransition(args: {
215
+ beforeTop: number;
216
+ afterTop: number;
217
+ cellHeight: number;
218
+ container: HTMLElement;
219
+ }): boolean;
220
+ /**
221
+ * Whether a horizontal position transition should be animated. Same viewport
222
+ * gate as {@link shouldAnimateVerticalTransition} but for column slides.
223
+ */
224
+ shouldAnimateHorizontalTransition(args: {
225
+ beforeLeft: number;
226
+ afterLeft: number;
227
+ cellWidth: number;
228
+ container: HTMLElement;
229
+ }): boolean;
230
+ /**
231
+ * Whether a cell's position change should participate in FLIP animation.
232
+ * Only axes that actually moved are checked against the viewport gate —
233
+ * a vertical sort must not inherit "visible" from an unchanged horizontal
234
+ * position (which would retain/mount every column in every padding-band row).
235
+ */
236
+ shouldAnimateTransition(args: {
237
+ beforeTop: number;
238
+ afterTop: number;
239
+ beforeLeft: number;
240
+ afterLeft: number;
241
+ cellHeight: number;
242
+ cellWidth: number;
243
+ container: HTMLElement;
244
+ }): boolean;
245
+ /**
246
+ * Whether an incoming cell (in the snapshot but not previously in the DOM)
247
+ * should be mounted for this sort/reorder render. Padding-band rows that
248
+ * never intersect the visible viewport are deferred to the next scroll
249
+ * render so they do not pop into existence at animation start.
250
+ */
251
+ shouldMountIncomingCell(args: {
252
+ cellId: string;
253
+ afterTop: number;
254
+ afterLeft: number;
255
+ cellHeight: number;
256
+ cellWidth: number;
257
+ container: HTMLElement;
258
+ }): boolean;
259
+ /**
260
+ * Whether the cell currently paints inside the body scrollers' clip rects.
261
+ * Outgoing retain decisions use this as a fallback when {@link shouldAnimateTransition}
262
+ * rejects a cell based on `style.top`/`style.left` alone: virtualization padding
263
+ * rows can sit with their leading edge outside the scroll band while still being
264
+ * partially visible on screen (common at the bottom when scrolled to the end).
265
+ */
266
+ isCellRenderedInScrollerViewport(element: HTMLElement, container: HTMLElement): boolean;
267
+ /**
268
+ * Whether an outgoing DOM cell at a vertical scroll extreme (top or bottom of
269
+ * the dataset) should be retained even when {@link shouldAnimateTransition}
270
+ * rejects it on leading-edge grounds. Virtualization keeps a few overscan
271
+ * rows mounted above/below the strict viewport at max scroll; those rows
272
+ * must still slide out as ghosts when a sort evicts them.
273
+ */
274
+ shouldRetainDomCellAtScrollExtrema(cellId: string, container: HTMLElement): boolean;
208
275
  /**
209
276
  * Hand a cell that the renderer would otherwise remove to the coordinator.
210
277
  * The coordinator updates its absolute positioning to the post-change layout
@@ -21,12 +21,20 @@ export interface DimensionManagerState {
21
21
  contentHeight: number | undefined;
22
22
  }
23
23
  type StateChangeCallback = (state: DimensionManagerState) => void;
24
+ /**
25
+ * Wait this long after the last container-width ResizeObserver tick before
26
+ * notifying subscribers. Coalesces CSS-transition / animated layout shifts
27
+ * (e.g. a collapsible nav) into a single trailing update instead of one full
28
+ * table render per animation frame.
29
+ */
30
+ export declare const CONTAINER_RESIZE_NOTIFY_DEBOUNCE_MS = 50;
24
31
  export declare class DimensionManager {
25
32
  private config;
26
33
  private state;
27
34
  private subscribers;
28
35
  private resizeObserver;
29
36
  private rafId;
37
+ private resizeNotifyDebounceId;
30
38
  /** Set when applyContainerWidthSync updates state before any subscriber exists. */
31
39
  private initialNotifyPending;
32
40
  constructor(config: DimensionManagerConfig);
@@ -35,6 +43,9 @@ export declare class DimensionManager {
35
43
  private calculateHeaderHeight;
36
44
  private convertHeightToPixels;
37
45
  private calculateContentHeight;
46
+ private cancelPendingResizeNotify;
47
+ /** Trailing debounce for animated / continuous container resizes. */
48
+ private scheduleResizeNotify;
38
49
  private observeContainer;
39
50
  private applyContainerWidthSync;
40
51
  updateConfig(config: Partial<DimensionManagerConfig>): void;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * The animation coordinator runs FLIP-style transitions when cells move between
5
5
  * positions. All fields are optional; omit the prop entirely to use defaults.
6
+ *
7
+ * Row group expand/collapse never animates when `rowGrouping` is configured.
6
8
  */
7
9
  export interface AnimationsConfig {
8
10
  /** Master toggle. Defaults to `true`. When `false`, no other field has effect. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-table/react",
3
- "version": "3.8.9",
3
+ "version": "3.9.1",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/types/react/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "react-dom": ">=18.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "simple-table-core": "3.8.9"
32
+ "simple-table-core": "3.9.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@rollup/plugin-alias": "^4.0.4",
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};