simple-table-core 4.1.9 → 4.2.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.
- package/dist/cjs/index.js +1 -1
- package/dist/core/dom/DOMManager.d.ts +2 -0
- package/dist/core/initialization/TableInitializer.d.ts +1 -0
- package/dist/core/rendering/TableRenderer.d.ts +2 -0
- package/dist/core/vanilla/VanillaLiveHost.d.ts +5 -2
- package/dist/index.es.js +1 -1
- package/dist/types/ColumnEditorConfig.d.ts +4 -2
- package/dist/utils/columnEditor/columnEditorUtils.d.ts +2 -2
- package/dist/utils/columnEditor/createColumnEditorRow.d.ts +2 -0
- package/dist/utils/headerCell/resizing.d.ts +2 -0
- package/dist/utils/headerCell/styling.d.ts +3 -1
- package/dist/utils/headerUtils.d.ts +4 -0
- package/dist/utils/propSyncEqual.d.ts +11 -2
- package/dist/utils/resizeUtils/autoExpandResize.d.ts +3 -3
- package/package.json +2 -2
|
@@ -25,6 +25,8 @@ export interface ColumnEditorConfig {
|
|
|
25
25
|
searchEnabled?: boolean;
|
|
26
26
|
/** Placeholder text for the search input (default: "Search columns...") */
|
|
27
27
|
searchPlaceholder?: string;
|
|
28
|
+
/** Label for the reset-columns button (default: "Reset columns") */
|
|
29
|
+
resetText?: string;
|
|
28
30
|
/** Custom search function to override default search behavior. Receives header and searchTerm, returns true if header matches. */
|
|
29
31
|
searchFunction?: ColumnEditorSearchFunction;
|
|
30
32
|
/**
|
|
@@ -38,5 +40,5 @@ export interface ColumnEditorConfig {
|
|
|
38
40
|
customRenderer?: ColumnEditorCustomRenderer;
|
|
39
41
|
}
|
|
40
42
|
export declare const DEFAULT_COLUMN_EDITOR_CONFIG: Required<Omit<ColumnEditorConfig, "searchFunction" | "rowRenderer" | "customRenderer">>;
|
|
41
|
-
/** Column editor config with defaults applied
|
|
42
|
-
export type MergedColumnEditorConfig = Required<Pick<ColumnEditorConfig, "text" | "showToggle" | "searchEnabled" | "searchPlaceholder" | "allowColumnPinning">> & Pick<ColumnEditorConfig, "searchFunction" | "rowRenderer" | "customRenderer">;
|
|
43
|
+
/** Column editor config with defaults applied */
|
|
44
|
+
export type MergedColumnEditorConfig = Required<Pick<ColumnEditorConfig, "text" | "showToggle" | "searchEnabled" | "searchPlaceholder" | "resetText" | "allowColumnPinning">> & Pick<ColumnEditorConfig, "searchFunction" | "rowRenderer" | "customRenderer">;
|
|
@@ -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;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
3
|
export declare const createResizeHandle: (header: ColumnDef, context: HeaderRenderContext) => HTMLElement | null;
|
|
4
|
+
/** Add or remove the resize handle to match `columnResizing`. */
|
|
5
|
+
export declare const syncResizeHandle: (cellElement: HTMLElement, header: ColumnDef, context: HeaderRenderContext) => void;
|
|
@@ -4,5 +4,7 @@ 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
|
-
/**
|
|
7
|
+
/** Set or clear the label's draggable attribute from `columnReordering`. */
|
|
8
|
+
export declare const syncHeaderDragAttribute: (cellElement: HTMLElement, header: AbsoluteCell["header"], context: HeaderRenderContext) => void;
|
|
9
|
+
/** Keep a reused header cell in sync with the current column definition. */
|
|
8
10
|
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
|
|
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). */
|
|
@@ -7,9 +7,9 @@ import type { Pinned } from "../../types/Pinned";
|
|
|
7
7
|
* natural width — declared, content-measured, or user-set). Once all
|
|
8
8
|
* neighbors are at their floor, the main section keeps growing past the
|
|
9
9
|
* container width and overflows into horizontal scroll instead of blocking
|
|
10
|
-
* the drag.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* the drag. A pinned column that still has leftover delta grows the pinned
|
|
11
|
+
* strip itself (policy-capped), not only when it is the column next to the
|
|
12
|
+
* main grid.
|
|
13
13
|
*/
|
|
14
14
|
export declare const handleResizeWithAutoExpand: ({ childrenToResize, collapsedHeaders, containerWidth, delta, headers, initialWidthsMap, isParentResize, resizedHeader, reverse, rootPinned, sectionHeaders, sectionWidth, sectionViewportWidth, shrinkFloors, startWidth, }: {
|
|
15
15
|
childrenToResize?: ColumnDef[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-table-core",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
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
|
}
|