@simple-table/react 3.9.0 → 3.9.2

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.
@@ -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;
@@ -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. */
@@ -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 {};
@@ -96,4 +96,10 @@ export declare const calculateHeaderContentWidth: (accessor: Accessor, options?:
96
96
  * column), so sorting later does not push the label into ellipsis.
97
97
  */
98
98
  sortIcon?: string | HTMLElement | SVGSVGElement;
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;
99
105
  }) => 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
  /**
@@ -20,11 +20,12 @@ interface PortalEntry {
20
20
  *
21
21
  * Cleanup is authoritative, not inferred: core invokes `onRendererHostDiscard(host)`
22
22
  * — wired to {@link disposeHost} — immediately before it permanently discards a
23
- * host element (cell rebuild/edit `innerHTML = ""`, plain cell removal, and the
24
- * animation coordinator's ghost/FLIP/shrink teardown). `disposeHost` unregisters
25
- * the portal(s) tagged with {@link PORTAL_ID_ATTR} inside that host, so React
26
- * unmounts exactly those subtrees. Reuse/reparent paths never signal, so a reused
27
- * node keeps its portal entry (and its content) with zero churn.
23
+ * host element (cell rebuild/edit `innerHTML = ""`, header renderer refresh on
24
+ * sort/filter, plain cell/header removal, and the animation coordinator's
25
+ * ghost/FLIP/shrink teardown). `disposeHost` unregisters the portal(s) tagged
26
+ * with {@link PORTAL_ID_ATTR} inside that host, so React unmounts exactly those
27
+ * subtrees. Reuse/reparent paths never signal, so a reused node keeps its portal
28
+ * entry (and its content) with zero churn.
28
29
  */
29
30
  export declare class PortalBridge {
30
31
  private entries;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-table/react",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
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.9.0"
32
+ "simple-table-core": "3.9.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@rollup/plugin-alias": "^4.0.4",