simple-table-core 4.1.8 → 4.2.0

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.
@@ -2,6 +2,8 @@ import ColumnDef, { Accessor } from "../../types/ColumnDef";
2
2
  import { ColumnVisibilityState } from "../../types/ColumnVisibilityTypes";
3
3
  import { FlattenedHeader } from "../../types/FlattenedHeader";
4
4
  import { PanelSection } from "../../types/PanelSection";
5
+ import { findHeaderByAccessor } from "../headerUtils";
6
+ export { findHeaderByAccessor };
5
7
  export type { FlattenedHeader };
6
8
  /**
7
9
  * Tracks which drop separator is currently highlighted during a column-editor
@@ -22,8 +24,6 @@ export declare const areAllChildrenVisible: (children: ColumnDef[]) => boolean;
22
24
  export declare const showAllDescendants: (children: ColumnDef[]) => void;
23
25
  export declare const updateParentHeaders: (headers: ColumnDef[]) => void;
24
26
  export declare const buildColumnVisibilityState: (headers: ColumnDef[]) => ColumnVisibilityState;
25
- /** Find a header node by accessor anywhere in the tree. */
26
- export declare const findHeaderByAccessor: (headers: ColumnDef[], accessor: Accessor) => ColumnDef | null;
27
27
  /**
28
28
  * Tri-state checkbox values for a column-editor row (matches createColumnEditorRow).
29
29
  */
@@ -44,4 +44,6 @@ export interface CreateColumnEditorRowResult {
44
44
  /** Run after the row fragment is connected to the document (e.g. listEl.appendChild). */
45
45
  scheduleExpandIconAnimation?: () => void;
46
46
  }
47
+ /** Write checkbox, name, expand label, and essential lock onto an existing editor row. */
48
+ export declare const syncColumnEditorRow: (row: HTMLElement, header: ColumnDef, essentialAccessors?: ReadonlySet<string>) => void;
47
49
  export declare const createColumnEditorRow: (options: CreateColumnEditorRowOptions) => CreateColumnEditorRowResult;
@@ -4,3 +4,5 @@ export declare const createHeaderCellElement: (cell: AbsoluteCell, context: Head
4
4
  export declare const getLastHeaderIndex: (absoluteCells: AbsoluteCell[]) => number;
5
5
  /** Replace sort/filter/collapse icons on an existing header cell, preserving label/drag handlers. */
6
6
  export declare const refreshHeaderCellIcons: (cellElement: HTMLElement, header: AbsoluteCell["header"], context: HeaderRenderContext, colIndex: number) => void;
7
+ /** Keep a reused header cell in sync with the current column definition. */
8
+ export declare const syncHeaderCellLabel: (cellElement: HTMLElement, header: AbsoluteCell["header"], context: HeaderRenderContext, colIndex: number) => void;
@@ -6,6 +6,10 @@ import ColumnDef from "../types/ColumnDef";
6
6
  * @returns Array of column indices that belong to this header branch
7
7
  */
8
8
  export declare const getHeaderLeafIndices: (header: ColumnDef, colIndex: number) => number[];
9
+ /** Alignment class on header labels and body cell content. */
10
+ export declare const columnAlignClass: (align?: string) => string;
11
+ /** Find a header node by accessor anywhere in the tree. */
12
+ export declare const findHeaderByAccessor: (headers: ColumnDef[], accessor: ColumnDef["accessor"]) => ColumnDef | null;
9
13
  /**
10
14
  * Flattens a nested header structure to get all leaf headers
11
15
  * @param headers The headers array to flatten
@@ -4,7 +4,7 @@
4
4
  * column configs or shallow-clone rows every render.
5
5
  */
6
6
  import type { GetRowIdParams } from "../types/GetRowId";
7
- /** Minimal header shape for structural comparison (renderers ignored). */
7
+ /** Minimal header shape for structural comparison. Renderer identity is ignored; presence is not. */
8
8
  export type HeaderStructureLike = {
9
9
  accessor: string | number | symbol;
10
10
  width?: number | string;
@@ -29,11 +29,20 @@ export type HeaderStructureLike = {
29
29
  tooltip?: string;
30
30
  quickFilterable?: boolean;
31
31
  filterOperators?: ReadonlyArray<string>;
32
+ cellClass?: string;
33
+ valueFormatter?: unknown;
34
+ cellRenderer?: unknown;
35
+ headerRenderer?: unknown;
36
+ enumOptions?: ReadonlyArray<{
37
+ label?: string;
38
+ value?: unknown;
39
+ }>;
32
40
  children?: ReadonlyArray<HeaderStructureLike>;
33
41
  };
34
42
  /**
35
43
  * True when two header trees describe the same columns (accessors, widths,
36
- * flags, nesting). Ignores renderer identity.
44
+ * flags, nesting, formatters, enum options). Ignores renderer identity; still
45
+ * treats adding or removing a renderer as a change.
37
46
  */
38
47
  export declare function headersStructurallyEqual(a: ReadonlyArray<HeaderStructureLike> | undefined, b: ReadonlyArray<HeaderStructureLike> | undefined): boolean;
39
48
  /** Collect every accessor in a header tree (for renderer-cache pruning). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "4.1.8",
3
+ "version": "4.2.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -130,6 +130,6 @@
130
130
  "version:patch": "npm version patch && git push && git push --tags",
131
131
  "version:minor": "npm version minor && git push && git push --tags",
132
132
  "version:major": "npm version major && git push && git push --tags",
133
- "test-storybook:ci": "test-storybook --url http://localhost:6006"
133
+ "test-storybook:ci": "test-storybook --url http://localhost:6006 --testTimeout=120000"
134
134
  }
135
135
  }