simple-table-core 3.9.1 → 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;
@@ -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
  /**
@@ -4,7 +4,7 @@
4
4
  * Comprehensive coverage for content-fit columns (`width: "auto"`):
5
5
  * - shrink / grow, per-column `maxWidth` cap and `minWidth` floor
6
6
  * - `autoSizeMode: "header"`
7
- * - custom (vanilla) renderers, valueFormatter, valueGetter, chart columns
7
+ * - custom (vanilla) renderers, valueFormatter (incl. multi-line), valueGetter, chart columns
8
8
  * - outliers (single giant value clipped) vs. a legitimate wide minority (kept)
9
9
  * - very large datasets (50k rows) with bounded sampling
10
10
  * - re-fit on data change, sort stability, empty data, mixed/pinned layouts
@@ -117,6 +117,23 @@ export declare const AutoSizeMeasuresFormattedValue: {
117
117
  canvasElement: HTMLElement;
118
118
  }) => Promise<void>;
119
119
  };
120
+ /**
121
+ * valueFormatter may return explicit multi-line text (e.g. an address). When the
122
+ * cell is allowed to wrap (`white-space: pre-line`), auto-size must fit the
123
+ * longest line — not the full string measured as one nowrap run (newlines
124
+ * collapse to spaces under `white-space: nowrap` measurement).
125
+ */
126
+ export declare const AutoSizeMultilineFormattedValueUsesLongestLine: {
127
+ parameters: {
128
+ tags: string[];
129
+ };
130
+ render: () => HTMLDivElement & {
131
+ _table?: SimpleTableVanilla | undefined;
132
+ };
133
+ play: ({ canvasElement }: {
134
+ canvasElement: HTMLElement;
135
+ }) => Promise<void>;
136
+ };
120
137
  export declare const AutoSizeMeasuresValueGetter: {
121
138
  parameters: {
122
139
  tags: string[];
@@ -302,6 +319,37 @@ export declare const AutoSizeEmptyStateAsyncHeaderRenderer: {
302
319
  canvasElement: HTMLElement;
303
320
  }) => Promise<void>;
304
321
  };
322
+ export declare const AutoSizeCollapsibleHeaderReservesIconWidth: {
323
+ parameters: {
324
+ tags: string[];
325
+ };
326
+ render: () => HTMLDivElement & {
327
+ _table?: SimpleTableVanilla | undefined;
328
+ };
329
+ play: ({ canvasElement }: {
330
+ canvasElement: HTMLElement;
331
+ }) => Promise<void>;
332
+ };
333
+ export declare const AutoSizeLongHeaderConsistentAcrossContainerWidths: {
334
+ parameters: {
335
+ tags: string[];
336
+ };
337
+ render: () => HTMLDivElement;
338
+ play: ({ canvasElement }: {
339
+ canvasElement: HTMLElement;
340
+ }) => Promise<void>;
341
+ };
342
+ export declare const HorizontalScrollbarShowsWhenHeaderOverflowsEmptyState: {
343
+ parameters: {
344
+ tags: string[];
345
+ };
346
+ render: () => HTMLDivElement & {
347
+ _table?: SimpleTableVanilla | undefined;
348
+ };
349
+ play: ({ canvasElement }: {
350
+ canvasElement: HTMLElement;
351
+ }) => Promise<void>;
352
+ };
305
353
  export declare const SamplingAndOutlierHelpers: {
306
354
  parameters: {
307
355
  tags: string[];