simple-table-core 4.0.4 → 4.0.5
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/consts/general-consts.d.ts +2 -2
- package/dist/core/SimpleTableVanilla.d.ts +3 -3
- package/dist/core/api/TableAPIImpl.d.ts +6 -6
- package/dist/core/initialization/TableInitializer.d.ts +4 -4
- package/dist/core/rendering/RenderOrchestrator.d.ts +9 -9
- package/dist/core/rendering/SectionRenderer.d.ts +3 -3
- package/dist/core/rendering/TableRenderer.d.ts +8 -8
- package/dist/hooks/contentHeight.d.ts +2 -2
- package/dist/hooks/expandedDepths.d.ts +1 -1
- package/dist/hooks/handleOutsideClick.d.ts +3 -3
- package/dist/hooks/useAggregatedRows.d.ts +2 -2
- package/dist/hooks/useQuickFilter.d.ts +2 -2
- package/dist/index.d.ts +2 -3
- package/dist/index.es.js +1 -1
- package/dist/managers/AutoScaleManager.d.ts +5 -5
- package/dist/managers/ColumnManager.d.ts +12 -12
- package/dist/managers/DimensionManager.d.ts +2 -2
- package/dist/managers/DragHandlerManager.d.ts +20 -20
- package/dist/managers/FilterManager.d.ts +2 -2
- package/dist/managers/PivotManager.d.ts +4 -4
- package/dist/managers/RowManager.d.ts +2 -2
- package/dist/managers/SelectionManager/types.d.ts +3 -3
- package/dist/managers/SortManager.d.ts +2 -2
- package/dist/managers/TableManager.d.ts +4 -4
- package/dist/types/CellChangeProps.d.ts +1 -1
- package/dist/types/CellClickProps.d.ts +1 -1
- package/dist/types/CellRendererProps.d.ts +1 -1
- package/dist/types/{HeaderObject.d.ts → ColumnDef.d.ts} +3 -5
- package/dist/types/ColumnEditorConfig.d.ts +2 -2
- package/dist/types/ColumnEditorCustomRendererProps.d.ts +2 -2
- package/dist/types/ColumnEditorRowRendererProps.d.ts +5 -5
- package/dist/types/ColumnVisibilityTypes.d.ts +1 -1
- package/dist/types/DragHandlerProps.d.ts +6 -6
- package/dist/types/FilterTypes.d.ts +1 -1
- package/dist/types/FlattenedHeader.d.ts +3 -3
- package/dist/types/HandleResizeStartProps.d.ts +5 -5
- package/dist/types/HeaderRendererProps.d.ts +3 -3
- package/dist/types/OnRowGroupExpandProps.d.ts +1 -1
- package/dist/types/OnSortProps.d.ts +1 -1
- package/dist/types/PinnedSectionsState.d.ts +1 -1
- package/dist/types/PivotTypes.d.ts +3 -3
- package/dist/types/QuickFilterTypes.d.ts +1 -1
- package/dist/types/SharedTableProps.d.ts +7 -7
- package/dist/types/SimpleTableConfig.d.ts +24 -16
- package/dist/types/SimpleTableProps.d.ts +19 -58
- package/dist/types/SortColumn.d.ts +2 -2
- package/dist/types/TableAPI.d.ts +4 -4
- package/dist/types/TableBodyProps.d.ts +3 -3
- package/dist/types/TableHeaderProps.d.ts +4 -4
- package/dist/types/TableHeaderSectionProps.d.ts +2 -2
- package/dist/types/TableRow.d.ts +2 -2
- package/dist/types/TableRowProps.d.ts +6 -6
- package/dist/types/UpdateCellProps.d.ts +1 -1
- package/dist/utils/bodyCell/content.d.ts +2 -2
- package/dist/utils/bodyCell/types.d.ts +6 -6
- package/dist/utils/cellClipboardUtils.d.ts +4 -4
- package/dist/utils/cellUtils.d.ts +3 -3
- package/dist/utils/collapseUtils.d.ts +7 -7
- package/dist/utils/columnEditor/columnEditorUtils.d.ts +5 -5
- package/dist/utils/columnEditor/createColumnEditor.d.ts +5 -5
- package/dist/utils/columnEditor/createColumnEditorPopout.d.ts +4 -4
- package/dist/utils/columnEditor/createColumnEditorRow.d.ts +6 -6
- package/dist/utils/columnIndicesUtils.d.ts +4 -4
- package/dist/utils/columnVirtualizationUtils.d.ts +10 -10
- package/dist/utils/csvExportUtils.d.ts +3 -3
- package/dist/utils/filters/createBooleanFilter.d.ts +2 -2
- package/dist/utils/filters/createDateFilter.d.ts +2 -2
- package/dist/utils/filters/createEnumFilter.d.ts +2 -2
- package/dist/utils/filters/createFilterDropdown.d.ts +2 -2
- package/dist/utils/filters/createNumberFilter.d.ts +2 -2
- package/dist/utils/filters/createStringFilter.d.ts +2 -2
- package/dist/utils/footer/createTableFooter.d.ts +1 -1
- package/dist/utils/generalUtils.d.ts +2 -2
- package/dist/utils/headerCell/collapsing.d.ts +2 -2
- package/dist/utils/headerCell/dragging.d.ts +4 -4
- package/dist/utils/headerCell/editing.d.ts +3 -3
- package/dist/utils/headerCell/eventTracking.d.ts +3 -3
- package/dist/utils/headerCell/filtering.d.ts +2 -2
- package/dist/utils/headerCell/resizing.d.ts +2 -2
- package/dist/utils/headerCell/sorting.d.ts +2 -2
- package/dist/utils/headerCell/types.d.ts +13 -13
- package/dist/utils/headerLayoutUtils.d.ts +2 -2
- package/dist/utils/headerUtils.d.ts +5 -5
- package/dist/utils/headerWidthUtils.d.ts +10 -10
- package/dist/utils/horizontalScrollbarRenderer.d.ts +1 -1
- package/dist/utils/infiniteScrollUtils.d.ts +1 -1
- package/dist/utils/normalizeConfig.d.ts +7 -43
- package/dist/utils/pinnedColumnUtils.d.ts +12 -12
- package/dist/utils/pivot/pivotRows.d.ts +4 -4
- package/dist/utils/propSyncEqual.d.ts +1 -1
- package/dist/utils/resizeUtils/autoExpandResize.d.ts +5 -5
- package/dist/utils/resizeUtils/compensation.d.ts +2 -2
- package/dist/utils/resizeUtils/domUpdates.d.ts +3 -3
- package/dist/utils/resizeUtils/index.d.ts +5 -5
- package/dist/utils/resizeUtils/maxWidth.d.ts +3 -3
- package/dist/utils/resizeUtils/parentHeaderResize.d.ts +2 -2
- package/dist/utils/resizeUtils/sectionWidths.d.ts +2 -2
- package/dist/utils/rowFlattening.d.ts +2 -2
- package/dist/utils/rowProcessing.d.ts +2 -2
- package/dist/utils/rowSelectionUtils.d.ts +2 -2
- package/dist/utils/rowUtils.d.ts +2 -2
- package/dist/utils/sortUtils.d.ts +2 -2
- package/dist/utils/stickyParentsRenderer.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateBooleanFilterOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateDateFilterOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateEnumFilterOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateFilterDropdownOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateNumberFilterOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { FilterCondition } from "../../types/FilterTypes";
|
|
3
3
|
export interface CreateStringFilterOptions {
|
|
4
|
-
header:
|
|
4
|
+
header: ColumnDef;
|
|
5
5
|
currentFilter?: FilterCondition;
|
|
6
6
|
onApplyFilter: (filter: FilterCondition) => void;
|
|
7
7
|
onClearFilter: () => void;
|
|
@@ -6,7 +6,7 @@ export interface CreateTableFooterOptions {
|
|
|
6
6
|
onNextPage?: OnNextPage;
|
|
7
7
|
onUserPageChange?: (page: number) => void | Promise<void>;
|
|
8
8
|
rowsPerPage: number;
|
|
9
|
-
|
|
9
|
+
enablePagination?: boolean;
|
|
10
10
|
totalPages: number;
|
|
11
11
|
totalRows: number;
|
|
12
12
|
/** Custom icon for previous page button (string = HTML, HTMLElement = node to clone/append). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../types/ColumnDef";
|
|
2
2
|
import { Pinned } from "../types/Pinned";
|
|
3
3
|
export declare const deepClone: <T>(obj: T) => T;
|
|
4
|
-
export declare const canDisplaySection: (headers:
|
|
4
|
+
export declare const canDisplaySection: (headers: ColumnDef[], pinned?: Pinned) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
3
|
/** Use same icon and animation as body row expand/collapse (icons.expand + st-expand-icon-container). */
|
|
4
|
-
export declare const createCollapseIcon: (header:
|
|
4
|
+
export declare const createCollapseIcon: (header: ColumnDef, context: HeaderRenderContext) => HTMLElement | null;
|
|
5
5
|
/** Update header collapse icon direction on an existing cell (delegates to body updateExpandIconState). */
|
|
6
6
|
export declare const updateHeaderCollapseIconState: (cellElement: HTMLElement, isCollapsed: boolean, label?: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
|
-
export declare const handleColumnHeaderClick: (event: MouseEvent, header:
|
|
4
|
-
export declare const handleColumnHeaderDoubleClick: (event: MouseEvent, header:
|
|
5
|
-
export declare const attachDragHandlers: (labelElement: HTMLElement, cellElement: HTMLElement, header:
|
|
3
|
+
export declare const handleColumnHeaderClick: (event: MouseEvent, header: ColumnDef, colIndex: number, context: HeaderRenderContext) => void;
|
|
4
|
+
export declare const handleColumnHeaderDoubleClick: (event: MouseEvent, header: ColumnDef, context: HeaderRenderContext) => void;
|
|
5
|
+
export declare const attachDragHandlers: (labelElement: HTMLElement, cellElement: HTMLElement, header: ColumnDef, context: HeaderRenderContext) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
|
-
export declare const createEditableInput: (header:
|
|
4
|
-
export declare const createLabelContent: (header:
|
|
3
|
+
export declare const createEditableInput: (header: ColumnDef, context: HeaderRenderContext, labelContainer: HTMLElement) => HTMLInputElement;
|
|
4
|
+
export declare const createLabelContent: (header: ColumnDef, context: HeaderRenderContext, labelOverride?: string) => HTMLElement;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
export declare let prevUpdateTime: number;
|
|
3
3
|
export declare let prevDraggingPosition: {
|
|
4
4
|
screenX: number;
|
|
5
5
|
screenY: number;
|
|
6
6
|
};
|
|
7
|
-
export declare let prevHeaders:
|
|
7
|
+
export declare let prevHeaders: ColumnDef[] | null;
|
|
8
8
|
export declare const setPrevUpdateTime: (time: number) => void;
|
|
9
9
|
export declare const setPrevDraggingPosition: (position: {
|
|
10
10
|
screenX: number;
|
|
11
11
|
screenY: number;
|
|
12
12
|
}) => void;
|
|
13
|
-
export declare const setPrevHeaders: (headers:
|
|
13
|
+
export declare const setPrevHeaders: (headers: ColumnDef[] | null) => void;
|
|
14
14
|
export declare const getRenderedCells: (container: HTMLElement) => Map<string, HTMLElement>;
|
|
15
15
|
export interface CachedHeaderPosition {
|
|
16
16
|
left: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
|
-
export declare const createFilterIcon: (header:
|
|
3
|
+
export declare const createFilterIcon: (header: ColumnDef, context: HeaderRenderContext) => HTMLElement | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
|
-
export declare const createResizeHandle: (header:
|
|
3
|
+
export declare const createResizeHandle: (header: ColumnDef, context: HeaderRenderContext) => HTMLElement | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import { HeaderRenderContext } from "./types";
|
|
3
|
-
export declare const createSortIcon: (header:
|
|
3
|
+
export declare const createSortIcon: (header: ColumnDef, context: HeaderRenderContext) => HTMLElement | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef, { Accessor } from "../../types/ColumnDef";
|
|
2
2
|
import SortColumn from "../../types/SortColumn";
|
|
3
3
|
import { TableFilterState, FilterCondition } from "../../types/FilterTypes";
|
|
4
4
|
import { IconsConfig } from "../../types/IconsConfig";
|
|
@@ -14,13 +14,13 @@ type RefObject<T> = {
|
|
|
14
14
|
readonly current: T | null;
|
|
15
15
|
};
|
|
16
16
|
export interface AbsoluteCell {
|
|
17
|
-
header:
|
|
17
|
+
header: ColumnDef;
|
|
18
18
|
left: number;
|
|
19
19
|
top: number;
|
|
20
20
|
width: number;
|
|
21
21
|
height: number;
|
|
22
22
|
colIndex: number;
|
|
23
|
-
parentHeader?:
|
|
23
|
+
parentHeader?: ColumnDef;
|
|
24
24
|
}
|
|
25
25
|
export interface HeaderRenderContext {
|
|
26
26
|
areAllRowsSelected?: () => boolean;
|
|
@@ -32,7 +32,7 @@ export interface HeaderRenderContext {
|
|
|
32
32
|
columnResizing: boolean;
|
|
33
33
|
columnsWithSelectedCells: Set<number>;
|
|
34
34
|
containerWidth: number;
|
|
35
|
-
draggedHeaderRef: MutableRefObject<
|
|
35
|
+
draggedHeaderRef: MutableRefObject<ColumnDef | null>;
|
|
36
36
|
enableHeaderEditing?: boolean;
|
|
37
37
|
enableRowSelection?: boolean;
|
|
38
38
|
/** When `"single"`, header select-all checkbox is hidden. */
|
|
@@ -48,13 +48,13 @@ export interface HeaderRenderContext {
|
|
|
48
48
|
handleClearFilter: (accessor: Accessor) => void;
|
|
49
49
|
handleSelectAll?: (checked: boolean) => void;
|
|
50
50
|
/** Live header tree from table state (avoids stale `headers` snapshot in long-lived handlers). */
|
|
51
|
-
getHeaders: () =>
|
|
51
|
+
getHeaders: () => ColumnDef[];
|
|
52
52
|
headerHeight: number;
|
|
53
53
|
headerRegistry?: Map<string, {
|
|
54
54
|
setEditing: (editing: boolean) => void;
|
|
55
55
|
}>;
|
|
56
|
-
headers:
|
|
57
|
-
hoveredHeaderRef: MutableRefObject<
|
|
56
|
+
headers: ColumnDef[];
|
|
57
|
+
hoveredHeaderRef: MutableRefObject<ColumnDef | null>;
|
|
58
58
|
icons: IconsConfig;
|
|
59
59
|
lastHeaderIndex: number;
|
|
60
60
|
mainBodyRef: RefObject<HTMLDivElement>;
|
|
@@ -62,12 +62,12 @@ export interface HeaderRenderContext {
|
|
|
62
62
|
mainSectionViewportWidth?: number; /** Main section *visible* viewport width (container minus pinned); use for getVisibleCells when !pinned */
|
|
63
63
|
/** When false, skip column virtualization and render every header cell in the main section. Default true. */
|
|
64
64
|
enableVirtualization?: boolean;
|
|
65
|
-
onColumnOrderChange?: (headers:
|
|
66
|
-
onColumnSelect?: (header:
|
|
67
|
-
onColumnWidthChange?: (headers:
|
|
68
|
-
onHeaderEdit?: (header:
|
|
65
|
+
onColumnOrderChange?: (headers: ColumnDef[]) => void;
|
|
66
|
+
onColumnSelect?: (header: ColumnDef) => void;
|
|
67
|
+
onColumnWidthChange?: (headers: ColumnDef[]) => void;
|
|
68
|
+
onHeaderEdit?: (header: ColumnDef, newLabel: string) => void;
|
|
69
69
|
onSort: (accessor: Accessor) => void;
|
|
70
|
-
onTableHeaderDragEnd: (headers:
|
|
70
|
+
onTableHeaderDragEnd: (headers: ColumnDef[]) => void;
|
|
71
71
|
pinned?: "left" | "right";
|
|
72
72
|
/** Mirrors body context: pinned strip width for cache invalidation when only section width changes. */
|
|
73
73
|
pinnedSectionWidthPx?: number;
|
|
@@ -80,7 +80,7 @@ export interface HeaderRenderContext {
|
|
|
80
80
|
selectedColumns: Set<number>;
|
|
81
81
|
selectedRowCount?: number; /** Used for context cache invalidation when row selection changes */
|
|
82
82
|
setCollapsedHeaders: Dispatch<SetStateAction<Set<Accessor>>>;
|
|
83
|
-
setHeaders: Dispatch<SetStateAction<
|
|
83
|
+
setHeaders: Dispatch<SetStateAction<ColumnDef[]>>;
|
|
84
84
|
setInitialFocusedCell: (cell: any) => void;
|
|
85
85
|
setIsResizing: Dispatch<SetStateAction<boolean>>;
|
|
86
86
|
setSelectedCells: Dispatch<SetStateAction<Set<string>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* True when a column must not participate in table layout: cells, widths,
|
|
4
4
|
* positions, colspan, pinned-section math, etc.
|
|
@@ -6,4 +6,4 @@ import type HeaderObject from "../types/HeaderObject";
|
|
|
6
6
|
* Covers both user-hidden columns (`hide`) and export-only columns
|
|
7
7
|
* (`excludeFromRender`). Prefer this over checking either flag alone.
|
|
8
8
|
*/
|
|
9
|
-
export declare const isHeaderExcludedFromLayout: (header: Pick<
|
|
9
|
+
export declare const isHeaderExcludedFromLayout: (header: Pick<ColumnDef, "hide" | "excludeFromRender">) => boolean;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef from "../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* Gets all leaf column indices (bottom-level columns) for a given header and its descendants
|
|
4
4
|
* @param header The header to get indices for
|
|
5
5
|
* @param colIndex The column index of the header in the current context
|
|
6
6
|
* @returns Array of column indices that belong to this header branch
|
|
7
7
|
*/
|
|
8
|
-
export declare const getHeaderLeafIndices: (header:
|
|
8
|
+
export declare const getHeaderLeafIndices: (header: ColumnDef, colIndex: number) => number[];
|
|
9
9
|
/**
|
|
10
10
|
* Flattens a nested header structure to get all leaf headers
|
|
11
11
|
* @param headers The headers array to flatten
|
|
12
12
|
* @returns Flattened array of all leaf headers
|
|
13
13
|
*/
|
|
14
|
-
export declare const flattenHeaders: (headers:
|
|
14
|
+
export declare const flattenHeaders: (headers: ColumnDef[]) => ColumnDef[];
|
|
15
15
|
/**
|
|
16
16
|
* Flattens a nested header structure to get all headers (including parent headers)
|
|
17
17
|
* @param headers The headers array to flatten
|
|
18
18
|
* @returns Flattened array of all headers in the hierarchy
|
|
19
19
|
*/
|
|
20
|
-
export declare const flattenAllHeaders: (headers:
|
|
20
|
+
export declare const flattenAllHeaders: (headers: ColumnDef[]) => ColumnDef[];
|
|
21
21
|
/**
|
|
22
22
|
* Gets the range of column indices between two column indices
|
|
23
23
|
* @param startColIndex Starting column index
|
|
@@ -38,4 +38,4 @@ export declare const getHeaderDescriptionId: (accessor: string | number) => stri
|
|
|
38
38
|
* @param filterable Whether the column is filterable
|
|
39
39
|
* @returns Description string for aria-describedby, or empty string if no description
|
|
40
40
|
*/
|
|
41
|
-
export declare const getHeaderDescription: (header:
|
|
41
|
+
export declare const getHeaderDescription: (header: ColumnDef, filterable: boolean) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef, { Accessor } from "../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* Build the set of row indices to sample for auto-size measurement.
|
|
4
4
|
* Hybrid strategy: the first `headSize` rows (always include the top / initial
|
|
@@ -29,13 +29,13 @@ export declare const selectContentWidthWithOutlierClip: (widths: number[], optio
|
|
|
29
29
|
* Takes collapsed state into account - when a header is collapsed, only returns
|
|
30
30
|
* children that are visible when parent is collapsed (showWhen is 'parentCollapsed' or 'always')
|
|
31
31
|
*/
|
|
32
|
-
export declare const findLeafHeaders: (header:
|
|
32
|
+
export declare const findLeafHeaders: (header: ColumnDef, collapsedHeaders?: Set<Accessor>) => ColumnDef[];
|
|
33
33
|
/** Default pixel width for 1fr when converting before container width is known */
|
|
34
34
|
export declare const DEFAULT_FR_PX = 150;
|
|
35
35
|
/** Default total table width used when normalizing fr/% if container width unknown */
|
|
36
36
|
export declare const DEFAULT_TABLE_WIDTH = 800;
|
|
37
37
|
/** True when a header's width requests content-based auto-sizing (`width: "auto"`). */
|
|
38
|
-
export declare const isAutoWidth: (header:
|
|
38
|
+
export declare const isAutoWidth: (header: ColumnDef) => boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Normalize header widths so that fr and % are converted to pixels.
|
|
41
41
|
* Call this as soon as headers are received so the rest of the code can assume numeric widths.
|
|
@@ -43,25 +43,25 @@ export declare const isAutoWidth: (header: HeaderObject) => boolean;
|
|
|
43
43
|
* If options.containerWidth is provided, all fr/% columns are resolved against the full container width,
|
|
44
44
|
* so pinned and non-pinned fr columns share the same proportional pool.
|
|
45
45
|
*/
|
|
46
|
-
export declare function normalizeHeaderWidths(headers:
|
|
46
|
+
export declare function normalizeHeaderWidths(headers: ColumnDef[], totalWidthOrOptions?: number | {
|
|
47
47
|
containerWidth: number;
|
|
48
|
-
}):
|
|
48
|
+
}): ColumnDef[];
|
|
49
49
|
/**
|
|
50
50
|
* Get actual width of a header in pixels
|
|
51
51
|
*/
|
|
52
|
-
export declare const getHeaderWidthInPixels: (header:
|
|
52
|
+
export declare const getHeaderWidthInPixels: (header: ColumnDef) => number;
|
|
53
53
|
/**
|
|
54
54
|
* Convert fractional widths to pixel values
|
|
55
55
|
*/
|
|
56
|
-
export declare const removeAllFractionalWidths: (header:
|
|
56
|
+
export declare const removeAllFractionalWidths: (header: ColumnDef) => void;
|
|
57
57
|
/**
|
|
58
58
|
* Calculate the minimum width for a header
|
|
59
59
|
*/
|
|
60
|
-
export declare const getHeaderMinWidth: (header:
|
|
60
|
+
export declare const getHeaderMinWidth: (header: ColumnDef) => number;
|
|
61
61
|
/**
|
|
62
62
|
* Get all visible leaf headers from an array of headers
|
|
63
63
|
*/
|
|
64
|
-
export declare const getAllVisibleLeafHeaders: (headers:
|
|
64
|
+
export declare const getAllVisibleLeafHeaders: (headers: ColumnDef[], collapsedHeaders?: Set<Accessor>) => ColumnDef[];
|
|
65
65
|
/**
|
|
66
66
|
* Calculate the optimal width for a column by measuring both header and cell content
|
|
67
67
|
* This is used for auto-sizing columns to fit their content (like Excel/Google Sheets)
|
|
@@ -79,7 +79,7 @@ export declare const getAllVisibleLeafHeaders: (headers: HeaderObject[], collaps
|
|
|
79
79
|
*/
|
|
80
80
|
export declare const calculateHeaderContentWidth: (accessor: Accessor, options?: {
|
|
81
81
|
rows?: any[];
|
|
82
|
-
header?:
|
|
82
|
+
header?: ColumnDef;
|
|
83
83
|
maxWidth?: number;
|
|
84
84
|
/** Leading rows always measured (default AUTO_SIZE_HEAD_SAMPLE_SIZE) */
|
|
85
85
|
headSampleSize?: number;
|
|
@@ -8,7 +8,7 @@ export interface HorizontalScrollbarProps {
|
|
|
8
8
|
pinnedRightContentWidth: number;
|
|
9
9
|
tableBodyContainerRef: HTMLDivElement;
|
|
10
10
|
/** True when the column-editor toggle strip is visible and reserves horizontal space. */
|
|
11
|
-
|
|
11
|
+
enableColumnEditor: boolean;
|
|
12
12
|
sectionScrollController?: SectionScrollController | null;
|
|
13
13
|
/**
|
|
14
14
|
* When true, skip the DOM scrollWidth check and always build the scrollbar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TableRow from "../types/TableRow";
|
|
2
2
|
import { CustomTheme } from "../types/CustomTheme";
|
|
3
|
-
import { Accessor } from "../types/
|
|
3
|
+
import { Accessor } from "../types/ColumnDef";
|
|
4
4
|
/**
|
|
5
5
|
* Sorted array of [position, extraHeight] tuples for nested grids
|
|
6
6
|
* Position: the row index in flattened array
|
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../types/ColumnDef";
|
|
2
2
|
import type { SimpleTableConfig } from "../types/SimpleTableConfig";
|
|
3
3
|
/**
|
|
4
|
-
* Consumer-facing config input
|
|
5
|
-
* names. {@link normalizeConfig} / {@link normalizeConfigPatch} collapse aliases
|
|
6
|
-
* into the canonical {@link SimpleTableConfig} shape used internally.
|
|
7
|
-
*
|
|
8
|
-
* Column flags (`sortable` / `editable` / `essential`) have no legacy aliases —
|
|
9
|
-
* they are stored and returned as those names only.
|
|
4
|
+
* Consumer-facing config input. Preferred prop names only — no legacy aliases.
|
|
10
5
|
*/
|
|
11
|
-
export type SimpleTableConfigInput =
|
|
12
|
-
/** Preferred column definitions prop. */
|
|
13
|
-
columns?: HeaderObject[];
|
|
14
|
-
/** @deprecated Prefer `columns` */
|
|
15
|
-
defaultHeaders?: HeaderObject[];
|
|
16
|
-
/** Preferred flag for the column editor / visibility UI. */
|
|
17
|
-
enableColumnEditor?: boolean;
|
|
18
|
-
/** @deprecated Prefer `enableColumnEditor` */
|
|
19
|
-
editColumns?: boolean;
|
|
20
|
-
enableColumnEditorInitOpen?: boolean;
|
|
21
|
-
/** @deprecated Prefer `enableColumnEditorInitOpen` */
|
|
22
|
-
editColumnsInitOpen?: boolean;
|
|
23
|
-
/** Preferred pagination flag. */
|
|
24
|
-
enablePagination?: boolean;
|
|
25
|
-
/** @deprecated Prefer `enablePagination` */
|
|
26
|
-
shouldPaginate?: boolean;
|
|
27
|
-
/** Preferred ready callback. */
|
|
28
|
-
onTableReady?: () => void;
|
|
29
|
-
/** @deprecated Prefer `onTableReady` */
|
|
30
|
-
onGridReady?: () => void;
|
|
31
|
-
hoverRowBackground?: boolean;
|
|
32
|
-
/** @deprecated Prefer `hoverRowBackground` */
|
|
33
|
-
useHoverRowBackground?: boolean;
|
|
34
|
-
oddColumnBackground?: boolean;
|
|
35
|
-
/** @deprecated Prefer `oddColumnBackground` */
|
|
36
|
-
useOddColumnBackground?: boolean;
|
|
37
|
-
oddEvenRowBackground?: boolean;
|
|
38
|
-
/** @deprecated Prefer `oddEvenRowBackground` */
|
|
39
|
-
useOddEvenRowBackground?: boolean;
|
|
40
|
-
};
|
|
6
|
+
export type SimpleTableConfigInput = SimpleTableConfig;
|
|
41
7
|
/** Pass-through for column trees (kept for call-site stability / future transforms). */
|
|
42
|
-
export declare function normalizeColumnDef(header:
|
|
43
|
-
export declare function normalizeColumnDefs(headers:
|
|
8
|
+
export declare function normalizeColumnDef(header: ColumnDef): ColumnDef;
|
|
9
|
+
export declare function normalizeColumnDefs(headers: ColumnDef[]): ColumnDef[];
|
|
44
10
|
/**
|
|
45
|
-
*
|
|
46
|
-
* Requires `columns` or `defaultHeaders`.
|
|
11
|
+
* Validate and normalize config. Requires `columns`.
|
|
47
12
|
*/
|
|
48
13
|
export declare function normalizeConfig(input: SimpleTableConfigInput): SimpleTableConfig;
|
|
49
14
|
/**
|
|
50
|
-
* Normalize a partial update patch.
|
|
51
|
-
* keys so `update({ columns })` / `update({ enablePagination })` work.
|
|
15
|
+
* Normalize a partial update patch.
|
|
52
16
|
*/
|
|
53
17
|
export declare function normalizeConfigPatch(patch: Partial<SimpleTableConfigInput>): Partial<SimpleTableConfig>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnDef, { Accessor } from "../types/ColumnDef";
|
|
2
2
|
import { PinnedSectionsState } from "../types/PinnedSectionsState";
|
|
3
3
|
import { PanelSection } from "../types/PanelSection";
|
|
4
4
|
export type { PinnedSectionsState, PanelSection };
|
|
5
5
|
/** Root-level columns only, preserving order within each pin group. */
|
|
6
|
-
export declare function partitionRootHeadersByPin(headers:
|
|
7
|
-
pinnedLeft:
|
|
8
|
-
unpinned:
|
|
9
|
-
pinnedRight:
|
|
6
|
+
export declare function partitionRootHeadersByPin(headers: ColumnDef[]): {
|
|
7
|
+
pinnedLeft: ColumnDef[];
|
|
8
|
+
unpinned: ColumnDef[];
|
|
9
|
+
pinnedRight: ColumnDef[];
|
|
10
10
|
};
|
|
11
|
-
export declare function isHeaderEssential(header:
|
|
11
|
+
export declare function isHeaderEssential(header: ColumnDef, essentialAccessors: ReadonlySet<string>): boolean;
|
|
12
12
|
/** Accessors for every header with `essential` in the tree (including nested). */
|
|
13
|
-
export declare function collectEssentialAccessors(headers:
|
|
13
|
+
export declare function collectEssentialAccessors(headers: ColumnDef[]): Set<string>;
|
|
14
14
|
/** Within one sibling list: all essential columns must form a left prefix. */
|
|
15
|
-
export declare function hasEssentialPrefixOrder(siblings:
|
|
15
|
+
export declare function hasEssentialPrefixOrder(siblings: ColumnDef[], essentialAccessors: ReadonlySet<string>): boolean;
|
|
16
16
|
/** Root array mixes pin sections; validate each pin group separately, then recurse into children. */
|
|
17
|
-
export declare function validateFullHeaderTreeEssentialOrder(headers:
|
|
18
|
-
export declare function getPinnedSectionsState(headers:
|
|
17
|
+
export declare function validateFullHeaderTreeEssentialOrder(headers: ColumnDef[], essentialAccessors: ReadonlySet<string>): boolean;
|
|
18
|
+
export declare function getPinnedSectionsState(headers: ColumnDef[]): PinnedSectionsState;
|
|
19
19
|
/**
|
|
20
20
|
* Rebuilds root `headers` order and `pinned` flags from section accessor lists.
|
|
21
21
|
* Clamps essential columns to the left within each section. Returns null if accessors don't match roots.
|
|
22
22
|
*/
|
|
23
|
-
export declare function rebuildHeadersFromPinnedState(headers:
|
|
23
|
+
export declare function rebuildHeadersFromPinnedState(headers: ColumnDef[], state: PinnedSectionsState, essentialAccessors: ReadonlySet<string>): ColumnDef[] | null;
|
|
24
24
|
/**
|
|
25
25
|
* Move a root column to another pin section.
|
|
26
26
|
* Appends within left/right targets. For `main`, left-pinned columns are inserted at the
|
|
27
27
|
* start of main; right-pinned (and other) columns are inserted at the end of main.
|
|
28
28
|
*/
|
|
29
|
-
export declare function moveRootColumnPinSide(headers:
|
|
29
|
+
export declare function moveRootColumnPinSide(headers: ColumnDef[], accessor: Accessor, target: Exclude<PanelSection, "main"> | "main", essentialAccessors: ReadonlySet<string>): ColumnDef[] | null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Accessor } from "../../types/
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
|
+
import type { Accessor } from "../../types/ColumnDef";
|
|
3
3
|
import type Row from "../../types/Row";
|
|
4
4
|
import type { PivotConfig, PivotResult } from "../../types/PivotTypes";
|
|
5
5
|
export type PivotRowsProps = {
|
|
6
6
|
rows: Row[];
|
|
7
7
|
pivot: PivotConfig;
|
|
8
|
-
/** Field catalog (`
|
|
9
|
-
fieldHeaders:
|
|
8
|
+
/** Field catalog (`columns`) for labels, types, widths, formatters. */
|
|
9
|
+
fieldHeaders: ColumnDef[];
|
|
10
10
|
};
|
|
11
11
|
export declare const buildPivotAccessor: (colKey: string, valueAccessor: Accessor) => string;
|
|
12
12
|
export declare const buildPivotRowTotalAccessor: (valueAccessor: Accessor) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared prop-sync helpers for framework adapters.
|
|
3
|
-
* Used to skip no-op `
|
|
3
|
+
* Used to skip no-op `columns` / `rows` updates when consumers rebuild
|
|
4
4
|
* column configs or shallow-clone rows every render.
|
|
5
5
|
*/
|
|
6
6
|
import type { GetRowIdParams } from "../types/GetRowId";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import type { Pinned } from "../../types/Pinned";
|
|
3
3
|
/**
|
|
4
4
|
* Handle resize with autoExpandColumns enabled.
|
|
@@ -12,17 +12,17 @@ import type { Pinned } from "../../types/Pinned";
|
|
|
12
12
|
* policy cap).
|
|
13
13
|
*/
|
|
14
14
|
export declare const handleResizeWithAutoExpand: ({ childrenToResize, collapsedHeaders, containerWidth, delta, headers, initialWidthsMap, isParentResize, resizedHeader, reverse, rootPinned, sectionHeaders, sectionWidth, sectionViewportWidth, shrinkFloors, startWidth, }: {
|
|
15
|
-
childrenToResize?:
|
|
15
|
+
childrenToResize?: ColumnDef[];
|
|
16
16
|
collapsedHeaders?: Set<string>;
|
|
17
17
|
containerWidth: number;
|
|
18
18
|
delta: number;
|
|
19
|
-
headers:
|
|
19
|
+
headers: ColumnDef[];
|
|
20
20
|
initialWidthsMap: Map<string, number>;
|
|
21
21
|
isParentResize?: boolean;
|
|
22
|
-
resizedHeader:
|
|
22
|
+
resizedHeader: ColumnDef;
|
|
23
23
|
reverse: boolean;
|
|
24
24
|
rootPinned: Pinned | undefined;
|
|
25
|
-
sectionHeaders:
|
|
25
|
+
sectionHeaders: ColumnDef[];
|
|
26
26
|
sectionWidth: number;
|
|
27
27
|
/** Visible viewport width of the section (main: container minus pinned). 0 when unknown. */
|
|
28
28
|
sectionViewportWidth?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* Distribute compensation among columns proportionally based on available headroom
|
|
4
4
|
* Used in autoExpandColumns mode
|
|
@@ -10,7 +10,7 @@ import type HeaderObject from "../../types/HeaderObject";
|
|
|
10
10
|
* Falls back to MIN_COLUMN_WIDTH when a column has no known floor.
|
|
11
11
|
*/
|
|
12
12
|
export declare const distributeCompensationProportionally: ({ columnsToShrink, totalCompensation, initialWidthsMap, shrinkFloors, }: {
|
|
13
|
-
columnsToShrink:
|
|
13
|
+
columnsToShrink: ColumnDef[];
|
|
14
14
|
totalCompensation: number;
|
|
15
15
|
initialWidthsMap: Map<string, number>;
|
|
16
16
|
shrinkFloors?: Map<string, number>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
import type { Pinned } from "../../types/Pinned";
|
|
3
3
|
/**
|
|
4
4
|
* Get the pinned value from the root header (for nested headers, children inherit from parent)
|
|
5
5
|
*/
|
|
6
|
-
export declare const getRootPinned: (header:
|
|
6
|
+
export declare const getRootPinned: (header: ColumnDef, headers: ColumnDef[]) => Pinned | undefined;
|
|
7
7
|
/**
|
|
8
8
|
* Update column widths and positions directly in the DOM without triggering React re-renders
|
|
9
9
|
* This is used during resize drag for better performance
|
|
@@ -12,4 +12,4 @@ export declare const getRootPinned: (header: HeaderObject, headers: HeaderObject
|
|
|
12
12
|
* @param collapsedHeaders - Set of collapsed header accessors; only visible children are laid out (matches findLeafHeaders / SectionRenderer).
|
|
13
13
|
* @param overrideWidths - Optional map of accessor -> width to use for position calculation (e.g. after resize so DOM reflects just-set value)
|
|
14
14
|
*/
|
|
15
|
-
export declare const updateColumnWidthsInDOM: (headers:
|
|
15
|
+
export declare const updateColumnWidthsInDOM: (headers: ColumnDef[], collapsedHeaders?: Set<string>, overrideWidths?: Map<string, number>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Accessor } from "../../types/
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
|
+
import type { Accessor } from "../../types/ColumnDef";
|
|
3
3
|
import type { HandleResizeStartProps } from "../../types/HandleResizeStartProps";
|
|
4
4
|
/**
|
|
5
5
|
* Handler for when resize dragging starts
|
|
@@ -8,10 +8,10 @@ export declare const handleResizeStart: ({ autoExpandColumns, collapsedHeaders,
|
|
|
8
8
|
export type ApplyColumnAutoFitWithAutoExpandParams = {
|
|
9
9
|
collapsedHeaders: Set<Accessor>;
|
|
10
10
|
containerWidth: number;
|
|
11
|
-
getTargetLeafWidth: (leafHeader:
|
|
12
|
-
header:
|
|
11
|
+
getTargetLeafWidth: (leafHeader: ColumnDef) => number;
|
|
12
|
+
header: ColumnDef;
|
|
13
13
|
headerCellElement: HTMLElement | null;
|
|
14
|
-
headers:
|
|
14
|
+
headers: ColumnDef[];
|
|
15
15
|
mainBodyRef: HandleResizeStartProps["mainBodyRef"];
|
|
16
16
|
/** Persist the auto-fitted column(s)' widths as their natural widths. */
|
|
17
17
|
onAutoExpandNaturalWidths?: (widths: Map<string, number>) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* Calculate the maximum allowable width for a header based on container constraints
|
|
4
4
|
*/
|
|
5
5
|
export declare const calculateMaxHeaderWidth: ({ header, headers, collapsedHeaders, }: {
|
|
6
|
-
header:
|
|
7
|
-
headers:
|
|
6
|
+
header: ColumnDef;
|
|
7
|
+
headers: ColumnDef[];
|
|
8
8
|
collapsedHeaders?: Set<string>;
|
|
9
9
|
}) => number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
2
2
|
/**
|
|
3
3
|
* Handle resizing of parent headers with multiple children
|
|
4
4
|
*/
|
|
5
5
|
export declare const handleParentHeaderResize: ({ delta, leafHeaders, minWidth, startWidth, maxWidth, }: {
|
|
6
6
|
delta: number;
|
|
7
|
-
leafHeaders:
|
|
7
|
+
leafHeaders: ColumnDef[];
|
|
8
8
|
minWidth: number;
|
|
9
9
|
startWidth: number;
|
|
10
10
|
maxWidth: number;
|