simple-table-core 4.1.5 → 4.1.7
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/README.md +15 -7
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/consts/general-consts.d.ts +0 -4
- package/dist/core/SimpleTableVanilla.d.ts +19 -272
- package/dist/core/api/TableAPIContext.d.ts +74 -0
- package/dist/core/api/TableAPIImpl.d.ts +2 -74
- package/dist/core/api/buildTableAPIContext.d.ts +61 -0
- package/dist/core/dev/UnvirtualizedRowsWarning.d.ts +20 -0
- package/dist/core/initialization/createDataManagers.d.ts +37 -0
- package/dist/core/initialization/wireMountManagers.d.ts +43 -0
- package/dist/core/pipeline/syncPivotPipeline.d.ts +41 -0
- package/dist/core/rendering/RenderContext.d.ts +125 -0
- package/dist/core/rendering/RenderOrchestrator.d.ts +8 -116
- package/dist/core/rendering/SectionRenderer.d.ts +21 -15
- package/dist/core/rendering/TableRenderer.d.ts +6 -95
- package/dist/core/rendering/TableRendererDeps.d.ts +98 -0
- package/dist/core/rendering/buildRenderContext.d.ts +94 -0
- package/dist/core/rendering/cellRenderContexts.d.ts +11 -0
- package/dist/core/rendering/renderBodySections.d.ts +14 -0
- package/dist/core/rendering/renderHeaderSections.d.ts +13 -0
- package/dist/core/rendering/sectionCaches.d.ts +24 -0
- package/dist/core/rendering/sectionExtraRows.d.ts +19 -0
- package/dist/core/rendering/sectionLayout.d.ts +42 -0
- package/dist/core/vanilla/VanillaLiveHost.d.ts +103 -0
- package/dist/core/vanilla/applyTableUpdate.d.ts +10 -0
- package/dist/core/vanilla/createVanillaRenderContext.d.ts +4 -0
- package/dist/core/vanilla/destroyTableResources.d.ts +26 -0
- package/dist/core/vanilla/syncRowSelectionManager.d.ts +13 -0
- package/dist/core/vanilla/tableContainers.d.ts +5 -0
- package/dist/core/vanilla/toTableAPIContextHost.d.ts +3 -0
- package/dist/hooks/contentHeight.d.ts +3 -1
- package/dist/hooks/expandedDepths.d.ts +4 -3
- package/dist/hooks/scrollbarWidth.d.ts +0 -43
- package/dist/hooks/useAggregatedRows.d.ts +0 -2
- package/dist/icons/CloseIcon.d.ts +2 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +1 -1
- package/dist/managers/AccordionController.d.ts +39 -0
- package/dist/managers/AnimationCoordinator.d.ts +15 -1
- package/dist/managers/AutoSizeManager.d.ts +64 -0
- package/dist/managers/CellSlideAnimator.d.ts +54 -0
- package/dist/managers/DragHandlerManager.d.ts +4 -26
- package/dist/managers/ExternalScrollController.d.ts +68 -0
- package/dist/managers/PivotManager.d.ts +0 -2
- package/dist/managers/ScrollRenderCoalescer.d.ts +32 -0
- package/dist/managers/SelectionManager/mouseUtils.d.ts +3 -3
- package/dist/styles.css +1 -1
- package/dist/types/ColumnEditorCustomRendererProps.d.ts +5 -0
- package/dist/types/PivotTypes.d.ts +1 -8
- package/dist/types/SimpleTableConfig.d.ts +3 -1
- package/dist/types/SimpleTableProps.d.ts +8 -2
- package/dist/types/TableAPI.d.ts +2 -2
- package/dist/utils/accordionAnimation.d.ts +0 -5
- package/dist/utils/bodyCell/editing.d.ts +1 -1
- package/dist/utils/bodyCell/editors/booleanDropdown.d.ts +1 -1
- package/dist/utils/bodyCell/editors/datePicker.d.ts +1 -1
- package/dist/utils/bodyCell/editors/enumDropdown.d.ts +1 -1
- package/dist/utils/bodyCell/selection.d.ts +0 -1
- package/dist/utils/bodyCell/styling.d.ts +2 -0
- package/dist/utils/cellScrollUtils.d.ts +1 -1
- package/dist/utils/cellUtils.d.ts +0 -4
- package/dist/utils/collapseUtils.d.ts +0 -10
- package/dist/utils/columnEditor/createColumnEditor.d.ts +6 -0
- package/dist/utils/columnEditor/createColumnEditorPopout.d.ts +6 -0
- package/dist/utils/columnEditor/createPivotPanel.d.ts +16 -0
- package/dist/utils/externalScroll.d.ts +0 -10
- package/dist/utils/filters/createDropdown.d.ts +2 -0
- package/dist/utils/formatters.d.ts +0 -2
- package/dist/utils/headerCell/eventTracking.d.ts +2 -2
- package/dist/utils/headerCell/styling.d.ts +0 -1
- package/dist/utils/headerWidthUtils.d.ts +2 -2
- package/dist/utils/infiniteScrollUtils.d.ts +0 -1
- package/dist/utils/parkAndStagger.d.ts +44 -0
- package/dist/utils/resizeUtils/domUpdates.d.ts +1 -1
- package/dist/utils/resizeUtils/maxWidth.d.ts +2 -1
- package/dist/utils/rowSelectionUtils.d.ts +0 -4
- package/dist/utils/rowSeparatorRenderer.d.ts +0 -1
- package/dist/utils/rowUtils.d.ts +1 -27
- package/dist/utils/setAbsoluteCellPosition.d.ts +31 -0
- package/dist/utils/stateRowRenderer.d.ts +0 -1
- package/dist/utils/tableDomScope.d.ts +20 -0
- package/package.json +4 -3
- package/src/styles/base.css +144 -147
- package/dist/managers/ColumnManager.d.ts +0 -42
- package/dist/managers/RowManager.d.ts +0 -56
- package/dist/managers/TableManager.d.ts +0 -72
- package/dist/types/BoundingBox.d.ts +0 -11
- package/dist/types/DragHandlerProps.d.ts +0 -14
- package/dist/types/OnSortProps.d.ts +0 -3
- package/dist/types/SharedTableProps.d.ts +0 -24
- package/dist/types/TableBodyProps.d.ts +0 -20
- package/dist/types/TableHeaderProps.d.ts +0 -17
- package/dist/types/TableHeaderSectionProps.d.ts +0 -19
- package/dist/types/TableRowProps.d.ts +0 -29
- package/dist/utils/columnIndicesUtils.d.ts +0 -15
- package/dist/utils/columnVirtualizationUtils.d.ts +0 -128
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HeaderRenderContext } from "../../utils/headerCellRenderer";
|
|
2
|
+
import { CellRenderContext } from "../../utils/bodyCellRenderer";
|
|
3
|
+
import type { TableRendererDeps } from "./TableRendererDeps";
|
|
4
|
+
export interface SectionWidths {
|
|
5
|
+
mainWidth: number;
|
|
6
|
+
leftWidth: number;
|
|
7
|
+
rightWidth: number;
|
|
8
|
+
containerWidth: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const buildHeaderCellContext: (deps: TableRendererDeps, widths: SectionWidths) => HeaderRenderContext;
|
|
11
|
+
export declare const buildBodyCellContext: (deps: TableRendererDeps, widths: SectionWidths, processedResult: any, scheduleRender: (callback: () => void) => void) => CellRenderContext;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CellRenderContext } from "../../utils/bodyCellRenderer";
|
|
2
|
+
import { SectionRenderer } from "./SectionRenderer";
|
|
3
|
+
import type { TableRendererDeps } from "./TableRendererDeps";
|
|
4
|
+
import type { SectionWidths } from "./cellRenderContexts";
|
|
5
|
+
export declare const renderBodySections: (args: {
|
|
6
|
+
container: HTMLElement;
|
|
7
|
+
processedResult: any;
|
|
8
|
+
deps: TableRendererDeps;
|
|
9
|
+
bodyContext: CellRenderContext;
|
|
10
|
+
widths: SectionWidths;
|
|
11
|
+
calculatedHeaderHeight: number;
|
|
12
|
+
sectionRenderer: SectionRenderer;
|
|
13
|
+
stickyParentsContainer: HTMLElement | null;
|
|
14
|
+
}) => HTMLElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HeaderRenderContext } from "../../utils/headerCellRenderer";
|
|
2
|
+
import { SectionRenderer } from "./SectionRenderer";
|
|
3
|
+
import type { TableRendererDeps } from "./TableRendererDeps";
|
|
4
|
+
import type { SectionWidths } from "./cellRenderContexts";
|
|
5
|
+
export declare const renderHeaderSections: (args: {
|
|
6
|
+
container: HTMLElement;
|
|
7
|
+
calculatedHeaderHeight: number;
|
|
8
|
+
maxHeaderDepth: number;
|
|
9
|
+
deps: TableRendererDeps;
|
|
10
|
+
headerContext: HeaderRenderContext;
|
|
11
|
+
widths: SectionWidths;
|
|
12
|
+
sectionRenderer: SectionRenderer;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ColumnDef, { Accessor } from "../../types/ColumnDef";
|
|
2
|
+
import TableRow from "../../types/TableRow";
|
|
3
|
+
import { AbsoluteCell, HeaderRenderContext } from "../../utils/headerCellRenderer";
|
|
4
|
+
import { AbsoluteBodyCell, CellRenderContext } from "../../utils/bodyCellRenderer";
|
|
5
|
+
/**
|
|
6
|
+
* Caches absolute header/body cell geometry and hashed render contexts per section.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SectionCellCaches {
|
|
9
|
+
private bodyCellsCache;
|
|
10
|
+
private headerCellsCache;
|
|
11
|
+
private contextCache;
|
|
12
|
+
private createHeadersHash;
|
|
13
|
+
/** Order-independent leaf signature so sibling reorders can remap `left` without a full rebuild. */
|
|
14
|
+
private createHeadersStructureHash;
|
|
15
|
+
private createHeightOffsetsHash;
|
|
16
|
+
private createContextHash;
|
|
17
|
+
getCachedBodyCells(sectionKey: string, headers: ColumnDef[], rows: TableRow[], collapsedHeaders: Set<Accessor>, rowHeight: number, heightOffsets?: Array<[number, number]>, customTheme?: any, startColIndex?: number, fullTableRows?: TableRow[], renderedStartIndex?: number, renderedEndIndex?: number): AbsoluteBodyCell[];
|
|
18
|
+
getCachedHeaderCells(sectionKey: string, headers: ColumnDef[], collapsedHeaders: Set<Accessor>, maxDepth: number, headerHeight: number, startColIndex?: number): AbsoluteCell[];
|
|
19
|
+
getCachedContext<T extends CellRenderContext | HeaderRenderContext>(cacheKey: string, context: T, pinned?: "left" | "right", sectionWidth?: number): T;
|
|
20
|
+
clearBody(): void;
|
|
21
|
+
clearHeader(): void;
|
|
22
|
+
clearContext(): void;
|
|
23
|
+
clearAll(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import TableRow from "../../types/TableRow";
|
|
2
|
+
import type { CellRenderContext } from "../../utils/bodyCellRenderer";
|
|
3
|
+
import type { AnimationCoordinator } from "../../managers/AnimationCoordinator";
|
|
4
|
+
export interface NestedGridRowEntry {
|
|
5
|
+
element: HTMLElement;
|
|
6
|
+
cleanup?: () => void;
|
|
7
|
+
lastPosition: number;
|
|
8
|
+
/** Last numeric top written onto the row. */
|
|
9
|
+
lastTop: number;
|
|
10
|
+
lastWrapperHeight: number;
|
|
11
|
+
}
|
|
12
|
+
export interface StateRowEntry {
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
lastTop: number;
|
|
15
|
+
lastPosition: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function renderNestedGridRows(section: HTMLElement, sectionKey: string, rows: TableRow[], pinned: "left" | "right" | undefined, context: CellRenderContext, animationCoordinator: AnimationCoordinator | undefined, nestedGridRowsMap: Map<string, Map<string, NestedGridRowEntry>>, stateRowsMap: Map<string, Map<string, StateRowEntry>>): void;
|
|
18
|
+
export declare function renderStateRows(section: HTMLElement, sectionKey: string, rows: TableRow[], context: CellRenderContext, animationCoordinator: AnimationCoordinator | undefined, stateRowsMap: Map<string, Map<string, StateRowEntry>>): void;
|
|
19
|
+
export declare function releaseExtraRowMaps(nestedGridRowsMap: Map<string, Map<string, NestedGridRowEntry>>, stateRowsMap: Map<string, Map<string, StateRowEntry>>): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ColumnDef, { Accessor } from "../../types/ColumnDef";
|
|
2
|
+
import TableRow from "../../types/TableRow";
|
|
3
|
+
import { AbsoluteCell } from "../../utils/headerCellRenderer";
|
|
4
|
+
import { AbsoluteBodyCell } from "../../utils/bodyCellRenderer";
|
|
5
|
+
import type { CellPosition } from "../../managers/AnimationCoordinator";
|
|
6
|
+
/**
|
|
7
|
+
* Per-section snapshot of just enough state to recompute every cell position
|
|
8
|
+
* (left × top for every row × every leaf header) on demand. Used by the
|
|
9
|
+
* animation coordinator: it needs positions for off-screen rows so cells
|
|
10
|
+
* sliding in or out of the visible band have a real "from" / "to" point.
|
|
11
|
+
*
|
|
12
|
+
* Rebuilt on every body section render so it always reflects the layout the
|
|
13
|
+
* user is currently looking at — i.e. when captureAnimationSnapshot fires
|
|
14
|
+
* before the next render runs, this represents the *pre-change* layout.
|
|
15
|
+
*/
|
|
16
|
+
export interface BodySectionSnapshotConfig {
|
|
17
|
+
rows: TableRow[];
|
|
18
|
+
headerPositions: Array<{
|
|
19
|
+
accessor: Accessor;
|
|
20
|
+
left: number;
|
|
21
|
+
width: number;
|
|
22
|
+
}>;
|
|
23
|
+
rowHeight: number;
|
|
24
|
+
heightOffsets?: Array<[number, number]>;
|
|
25
|
+
customTheme?: any;
|
|
26
|
+
/** When > 0, each row's `position` is treated as a global flattened-list
|
|
27
|
+
* index and shifted by this amount when computing `top`. This lets the
|
|
28
|
+
* snapshot include off-page rows (positioned above/below the viewport)
|
|
29
|
+
* for paginated tables. */
|
|
30
|
+
pageStartIndex?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compute every cell position (every row × every leaf header) implied by a
|
|
34
|
+
* snapshot config. Used both for FLIP "First" snapshots (pre-change layout)
|
|
35
|
+
* and to feed the renderer the post-change layout for cells that exit the
|
|
36
|
+
* visible band — the off-screen `top` is what we want them to slide *to*.
|
|
37
|
+
*/
|
|
38
|
+
export declare function computeFullSectionLayout(config: BodySectionSnapshotConfig): Map<string, CellPosition>;
|
|
39
|
+
export declare function getLeafHeaders(headers: ColumnDef[], collapsedHeaders: Set<Accessor>): ColumnDef[];
|
|
40
|
+
export declare function calculateAbsoluteHeaderCells(headers: ColumnDef[], collapsedHeaders: Set<Accessor>, maxDepth: number, headerHeight: number, startColIndex?: number): AbsoluteCell[];
|
|
41
|
+
export declare function calculateAbsoluteBodyCells(headers: ColumnDef[], rows: TableRow[], collapsedHeaders: Set<Accessor>, rowHeight: number, heightOffsets?: Array<[number, number]>, customTheme?: any, startColIndex?: number): AbsoluteBodyCell[];
|
|
42
|
+
export declare function buildBodySectionSnapshotConfig(headers: ColumnDef[], collapsedHeaders: Set<Accessor>, rows: TableRow[], rowHeight: number, heightOffsets?: Array<[number, number]>, customTheme?: any, pageStartIndex?: number): BodySectionSnapshotConfig;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { SimpleTableConfig } from "../../types/SimpleTableConfig";
|
|
2
|
+
import type ColumnDef from "../../types/ColumnDef";
|
|
3
|
+
import type { Accessor } from "../../types/ColumnDef";
|
|
4
|
+
import type Row from "../../types/Row";
|
|
5
|
+
import type { CustomTheme } from "../../types/CustomTheme";
|
|
6
|
+
import type RowState from "../../types/RowState";
|
|
7
|
+
import type { PivotConfig } from "../../types/PivotTypes";
|
|
8
|
+
import type { AnimationCoordinator } from "../../managers/AnimationCoordinator";
|
|
9
|
+
import type { AccordionController } from "../../managers/AccordionController";
|
|
10
|
+
import type { AutoSizeManager } from "../../managers/AutoSizeManager";
|
|
11
|
+
import type { AutoScaleManager } from "../../managers/AutoScaleManager";
|
|
12
|
+
import type { DimensionManager } from "../../managers/DimensionManager";
|
|
13
|
+
import type { ExternalScrollController } from "../../managers/ExternalScrollController";
|
|
14
|
+
import type { FilterManager } from "../../managers/FilterManager";
|
|
15
|
+
import type { SortManager } from "../../managers/SortManager";
|
|
16
|
+
import type { PivotManager } from "../../managers/PivotManager";
|
|
17
|
+
import type { SelectionManager } from "../../managers/SelectionManager";
|
|
18
|
+
import type { RowSelectionManager } from "../../managers/RowSelectionManager";
|
|
19
|
+
import type { ScrollManager } from "../../managers/ScrollManager";
|
|
20
|
+
import type { SectionScrollController } from "../../managers/SectionScrollController";
|
|
21
|
+
import type { DOMManager } from "../dom/DOMManager";
|
|
22
|
+
import type { RenderOrchestrator } from "../rendering/RenderOrchestrator";
|
|
23
|
+
import type { ResolvedIcons } from "../initialization/TableInitializer";
|
|
24
|
+
import type ExpandedDepthsManager from "../../hooks/expandedDepths";
|
|
25
|
+
import type { AccordionAxis } from "../../utils/accordionAnimation";
|
|
26
|
+
/**
|
|
27
|
+
* Live accessors for the table facade. Used by config updates, render-context
|
|
28
|
+
* assembly, and TableAPI — getters always read current instance state.
|
|
29
|
+
*/
|
|
30
|
+
export interface VanillaLiveHost {
|
|
31
|
+
getConfig(): SimpleTableConfig;
|
|
32
|
+
setConfig(config: SimpleTableConfig): void;
|
|
33
|
+
applyAnimationsConfig(animations: SimpleTableConfig["animations"]): void;
|
|
34
|
+
getCustomTheme(): CustomTheme;
|
|
35
|
+
setCustomTheme(theme: CustomTheme): void;
|
|
36
|
+
getInternalIsLoading(): boolean;
|
|
37
|
+
setInternalIsLoading(value: boolean): void;
|
|
38
|
+
getCurrentPage(): number;
|
|
39
|
+
setCurrentPage(page: number): void;
|
|
40
|
+
getFirstRenderDone(): boolean;
|
|
41
|
+
getIsResizing(): boolean;
|
|
42
|
+
setIsResizing(value: boolean): void;
|
|
43
|
+
getLocalRows(): Row[];
|
|
44
|
+
setLocalRows(rows: Row[]): void;
|
|
45
|
+
rebuildRowIndexMap(): void;
|
|
46
|
+
getHeaders(): ColumnDef[];
|
|
47
|
+
setHeaders(headers: ColumnDef[]): void;
|
|
48
|
+
getPristineDefaultHeaders(): ColumnDef[];
|
|
49
|
+
getEssentialAccessors(): Set<string>;
|
|
50
|
+
setEssentialAccessors(accessors: Set<string>): void;
|
|
51
|
+
ingestColumnSnapshot(columns: ColumnDef[]): void;
|
|
52
|
+
applyHeaders(headers: ColumnDef[]): void;
|
|
53
|
+
getCollapsedHeaders(): Set<Accessor>;
|
|
54
|
+
setCollapsedHeaders(headers: Set<Accessor>): void;
|
|
55
|
+
getCollapsedRows(): Map<string, number>;
|
|
56
|
+
setCollapsedRows(rows: Map<string, number>): void;
|
|
57
|
+
getExpandedRows(): Map<string, number>;
|
|
58
|
+
setExpandedRows(rows: Map<string, number>): void;
|
|
59
|
+
getExpandedDepths(): Set<number>;
|
|
60
|
+
clearExpandedRows(): void;
|
|
61
|
+
clearCollapsedRows(): void;
|
|
62
|
+
getRowStateMap(): Map<string | number, RowState>;
|
|
63
|
+
setRowStateMap(map: Map<string | number, RowState>): void;
|
|
64
|
+
getColumnEditorOpen(): boolean;
|
|
65
|
+
setColumnEditorOpen(open: boolean): void;
|
|
66
|
+
getCellRegistry(): Map<string, any>;
|
|
67
|
+
getHeaderRegistry(): Map<string, any>;
|
|
68
|
+
getHoverScopeId(): string;
|
|
69
|
+
getDraggedHeaderRef(): {
|
|
70
|
+
current: ColumnDef | null;
|
|
71
|
+
};
|
|
72
|
+
getHoveredHeaderRef(): {
|
|
73
|
+
current: ColumnDef | null;
|
|
74
|
+
};
|
|
75
|
+
getResolvedIcons(): ResolvedIcons;
|
|
76
|
+
getPositionOnlyBody(): boolean;
|
|
77
|
+
getAnimationCoordinator(): AnimationCoordinator;
|
|
78
|
+
getAccordionController(): AccordionController;
|
|
79
|
+
getAutoSizeManager(): AutoSizeManager;
|
|
80
|
+
getAutoScaleManager(): AutoScaleManager | null;
|
|
81
|
+
getDomManager(): DOMManager;
|
|
82
|
+
getRenderOrchestrator(): RenderOrchestrator;
|
|
83
|
+
getDimensionManager(): DimensionManager | null;
|
|
84
|
+
getFilterManager(): FilterManager | null;
|
|
85
|
+
getSortManager(): SortManager | null;
|
|
86
|
+
getPivotManager(): PivotManager | null;
|
|
87
|
+
getSelectionManager(): SelectionManager | null;
|
|
88
|
+
getRowSelectionManager(): RowSelectionManager | null;
|
|
89
|
+
getScrollManager(): ScrollManager | null;
|
|
90
|
+
getSectionScrollController(): SectionScrollController | null;
|
|
91
|
+
getExternalScrollController(): ExternalScrollController;
|
|
92
|
+
getExpandedDepthsManager(): ExpandedDepthsManager | null;
|
|
93
|
+
syncPivotPipeline(filteredSourceRows?: Row[]): void;
|
|
94
|
+
syncRowSelectionManager(): void;
|
|
95
|
+
captureSnapshot(): void;
|
|
96
|
+
beginAccordion(axis: Exclude<AccordionAxis, null>): void;
|
|
97
|
+
getEffectiveRowGrouping(): Accessor[] | undefined;
|
|
98
|
+
applyPivot(pivot: PivotConfig | null): void;
|
|
99
|
+
onRender(source: string): void;
|
|
100
|
+
isCellAnimating(cellId: string): boolean;
|
|
101
|
+
hasAnimatingCells(): boolean;
|
|
102
|
+
runWithoutAnimationSnapshot(fn: () => void): void;
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SimpleTableConfigInput } from "../../utils/normalizeConfig";
|
|
2
|
+
import type Row from "../../types/Row";
|
|
3
|
+
import type { RowData } from "../../types/Row";
|
|
4
|
+
import type { VanillaLiveHost } from "./VanillaLiveHost";
|
|
5
|
+
/**
|
|
6
|
+
* Applies a partial config patch to the live table: rows, columns, theme,
|
|
7
|
+
* selection, viewport, and related managers. Caller wraps this in `isUpdating`
|
|
8
|
+
* and renders once afterward.
|
|
9
|
+
*/
|
|
10
|
+
export declare const applyTableUpdate: <TData extends RowData = Row>(host: VanillaLiveHost, config: Partial<SimpleTableConfigInput<TData>>) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NestedTableFactory } from "../../utils/nestedGridRowRenderer";
|
|
2
|
+
import type { RenderContext } from "../rendering/RenderContext";
|
|
3
|
+
import type { VanillaLiveHost } from "./VanillaLiveHost";
|
|
4
|
+
export declare const createVanillaRenderContext: (host: VanillaLiveHost, createNestedTable: NestedTableFactory) => RenderContext;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Destroyable {
|
|
2
|
+
destroy(): void;
|
|
3
|
+
}
|
|
4
|
+
export interface TableDestroyables {
|
|
5
|
+
scrollCoalescer: Destroyable;
|
|
6
|
+
unvirtualizedRowsWarning: Destroyable;
|
|
7
|
+
externalScrollController: Destroyable;
|
|
8
|
+
accordionController: Destroyable;
|
|
9
|
+
dimensionManager: Destroyable | null | undefined;
|
|
10
|
+
scrollManager: Destroyable | null | undefined;
|
|
11
|
+
sectionScrollController: Destroyable | null | undefined;
|
|
12
|
+
sortManager: Destroyable | null | undefined;
|
|
13
|
+
filterManager: Destroyable | null | undefined;
|
|
14
|
+
pivotManager: Destroyable | null | undefined;
|
|
15
|
+
rowSelectionManager: Destroyable | null | undefined;
|
|
16
|
+
selectionManager: Destroyable | null | undefined;
|
|
17
|
+
autoScaleManager: Destroyable | null | undefined;
|
|
18
|
+
windowResizeManager: Destroyable | null | undefined;
|
|
19
|
+
handleOutsideClickManager: Destroyable | null | undefined;
|
|
20
|
+
scrollbarVisibilityManager: Destroyable | null | undefined;
|
|
21
|
+
expandedDepthsManager: Destroyable | null | undefined;
|
|
22
|
+
ariaAnnouncementManager: Destroyable | null | undefined;
|
|
23
|
+
animationCoordinator: Destroyable;
|
|
24
|
+
}
|
|
25
|
+
export declare const destroyTableManagers: (managers: TableDestroyables) => void;
|
|
26
|
+
export declare const untrackCellsInRoot: (root: HTMLElement) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SimpleTableConfig } from "../../types/SimpleTableConfig";
|
|
2
|
+
import type { ProcessRowsResult } from "../../utils/rowProcessing";
|
|
3
|
+
import { RowSelectionManager } from "../../managers/RowSelectionManager";
|
|
4
|
+
export interface RowSelectionSyncHost {
|
|
5
|
+
getConfig(): SimpleTableConfig;
|
|
6
|
+
getTableRoot(): HTMLElement;
|
|
7
|
+
getRowSelectionManager(): RowSelectionManager | null;
|
|
8
|
+
setRowSelectionManager(manager: RowSelectionManager | null): void;
|
|
9
|
+
getLastProcessedResult(): ProcessRowsResult | null;
|
|
10
|
+
onRender(source: string): void;
|
|
11
|
+
}
|
|
12
|
+
/** Creates, updates, or tears down row selection when those props change. */
|
|
13
|
+
export declare const syncRowSelectionManager: (host: RowSelectionSyncHost) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DOMManager } from "../dom/DOMManager";
|
|
2
|
+
export declare const getBodyContainers: (domManager: DOMManager) => HTMLElement[];
|
|
3
|
+
export declare const getHeaderContainers: (domManager: DOMManager) => HTMLElement[];
|
|
4
|
+
/** Body and header sections the animation coordinator inspects for FLIP. */
|
|
5
|
+
export declare const getAnimatableContainers: (domManager: DOMManager) => HTMLElement[];
|
|
@@ -13,6 +13,8 @@ export interface ContentHeightConfig {
|
|
|
13
13
|
* virtualization driven by a window- or element-level scroller.
|
|
14
14
|
*/
|
|
15
15
|
externalViewportHeight?: number;
|
|
16
|
+
/** Element used to resolve `%` and `calc()` heights against the parent box. */
|
|
17
|
+
container?: Element | null;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Converts a height value (string or number) to pixels
|
|
@@ -25,5 +27,5 @@ export declare const convertHeightToPixels: (heightValue: string | number, conta
|
|
|
25
27
|
* @param config - Configuration for content height calculation
|
|
26
28
|
* @returns The calculated content height in pixels, or undefined to disable virtualization
|
|
27
29
|
*/
|
|
28
|
-
export declare const calculateContentHeight: ({ height, maxHeight, rowHeight, enablePagination, rowsPerPage, totalRowCount, headerHeight, footerHeight, externalViewportHeight, }: ContentHeightConfig) => number | undefined;
|
|
30
|
+
export declare const calculateContentHeight: ({ height, maxHeight, rowHeight, enablePagination, rowsPerPage, totalRowCount, headerHeight, footerHeight, externalViewportHeight, container, }: ContentHeightConfig) => number | undefined;
|
|
29
31
|
export default calculateContentHeight;
|
|
@@ -9,14 +9,15 @@ export declare const initializeExpandedDepths: (expandAll: boolean, rowGrouping?
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class ExpandedDepthsManager {
|
|
11
11
|
private expandedDepths;
|
|
12
|
+
private shouldExpandAll;
|
|
12
13
|
private observers;
|
|
13
14
|
/** Coalesce sync collapseAll→expandDepth into a single observer notification. */
|
|
14
15
|
private notifyMicrotaskScheduled;
|
|
15
16
|
constructor(expandAll: boolean, rowGrouping?: Accessor[]);
|
|
16
17
|
/**
|
|
17
|
-
* Updates the expanded depths when rowGrouping changes
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Updates the expanded depths when rowGrouping changes.
|
|
19
|
+
* When `expandAll` is on (default), re-expand so grouping that appears after
|
|
20
|
+
* mount is not stuck collapsed. Otherwise keep in-range depths only.
|
|
20
21
|
*/
|
|
21
22
|
updateRowGrouping(rowGrouping?: Accessor[]): void;
|
|
22
23
|
/**
|
|
@@ -6,47 +6,4 @@
|
|
|
6
6
|
* @returns The width of the scrollbar in pixels, or 0 if element is null
|
|
7
7
|
*/
|
|
8
8
|
export declare function calculateScrollbarWidth(element: HTMLElement | null): number;
|
|
9
|
-
/**
|
|
10
|
-
* A class to manage scrollbar width state and updates.
|
|
11
|
-
* This provides a stateful alternative to the useScrollbarWidth hook.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ScrollbarWidthManager {
|
|
14
|
-
private width;
|
|
15
|
-
private element;
|
|
16
|
-
private observers;
|
|
17
|
-
constructor(element?: HTMLElement | null);
|
|
18
|
-
/**
|
|
19
|
-
* Sets the element to measure and calculates its scrollbar width
|
|
20
|
-
* @param element - The HTML element to measure
|
|
21
|
-
*/
|
|
22
|
-
setElement(element: HTMLElement | null): void;
|
|
23
|
-
/**
|
|
24
|
-
* Updates the scrollbar width measurement
|
|
25
|
-
*/
|
|
26
|
-
update(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the current scrollbar width
|
|
29
|
-
* @returns The current scrollbar width in pixels
|
|
30
|
-
*/
|
|
31
|
-
getWidth(): number;
|
|
32
|
-
/**
|
|
33
|
-
* Manually sets the scrollbar width
|
|
34
|
-
* @param width - The width to set
|
|
35
|
-
*/
|
|
36
|
-
setWidth(width: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* Subscribes to scrollbar width changes
|
|
39
|
-
* @param callback - Function to call when width changes
|
|
40
|
-
* @returns Unsubscribe function
|
|
41
|
-
*/
|
|
42
|
-
subscribe(callback: (width: number) => void): () => void;
|
|
43
|
-
/**
|
|
44
|
-
* Notifies all observers of width changes
|
|
45
|
-
*/
|
|
46
|
-
private notifyObservers;
|
|
47
|
-
/**
|
|
48
|
-
* Cleans up the manager
|
|
49
|
-
*/
|
|
50
|
-
destroy(): void;
|
|
51
|
-
}
|
|
52
9
|
export default calculateScrollbarWidth;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import ColumnDef from "../types/ColumnDef";
|
|
2
2
|
import Row from "../types/Row";
|
|
3
|
-
import { RowManager } from "../managers/RowManager";
|
|
4
3
|
interface CalculateAggregatedRowsProps {
|
|
5
4
|
rows?: Row[];
|
|
6
5
|
headers?: ColumnDef[];
|
|
7
6
|
rowGrouping?: string[];
|
|
8
|
-
rowManager?: RowManager;
|
|
9
7
|
}
|
|
10
8
|
/**
|
|
11
9
|
* Pure function to calculate aggregated rows based on row grouping and aggregation configuration
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { createAngleRightIcon } from "./AngleRightIcon";
|
|
|
8
8
|
export { createAngleUpIcon } from "./AngleUpIcon";
|
|
9
9
|
export { createAscIcon } from "./AscIcon";
|
|
10
10
|
export { createCheckIcon } from "./CheckIcon";
|
|
11
|
+
export { createCloseIcon } from "./CloseIcon";
|
|
11
12
|
export { createDescIcon } from "./DescIcon";
|
|
12
13
|
export { createMinusIcon } from "./MinusIcon";
|
|
13
14
|
export { createDragIcon } from "./DragIcon";
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { Accessor, AutoSizeMode, ChartOptions, ColumnDef, NestedColumnDef,
|
|
|
7
7
|
import type { SimpleTableConfigInput } from "./utils/normalizeConfig";
|
|
8
8
|
import type { AggregationConfig, AggregationType } from "./types/AggregationTypes";
|
|
9
9
|
import type { PivotConfig, PivotValueConfig, PivotResult } from "./types/PivotTypes";
|
|
10
|
-
import {
|
|
10
|
+
import { PIVOT_IS_TOTAL_KEY, PIVOT_ACCESSOR_PREFIX, PIVOT_BLANK_LABEL } from "./types/PivotTypes";
|
|
11
11
|
import { pivotRows, buildPivotAccessor, buildPivotRowTotalAccessor } from "./utils/pivot/pivotRows";
|
|
12
12
|
import type OnRowGroupExpandProps from "./types/OnRowGroupExpandProps";
|
|
13
13
|
import type Row from "./types/Row";
|
|
@@ -51,7 +51,7 @@ import type TableRow from "./types/TableRow";
|
|
|
51
51
|
export { SimpleTableVanilla };
|
|
52
52
|
export { asRows } from "./utils/asRows";
|
|
53
53
|
export { normalizeConfig, normalizeConfigPatch, normalizeColumnDef, normalizeColumnDefs, } from "./utils/normalizeConfig";
|
|
54
|
-
export { pivotRows, buildPivotAccessor, buildPivotRowTotalAccessor,
|
|
54
|
+
export { pivotRows, buildPivotAccessor, buildPivotRowTotalAccessor, PIVOT_IS_TOTAL_KEY, PIVOT_ACCESSOR_PREFIX, PIVOT_BLANK_LABEL, };
|
|
55
55
|
export { headersStructurallyEqual, collectHeaderAccessors, rowsShallowUnchanged, shallowEqualRow, SHALLOW_ROW_COMPARE_MAX, } from "./utils/propSyncEqual";
|
|
56
56
|
export type { HeaderStructureLike, GetRowIdLike } from "./utils/propSyncEqual";
|
|
57
57
|
export type { Accessor, AggregationConfig, AggregationType, AnimationsConfig, AutoSizeMode, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnDef, NestedColumnDef, NestedTableConfig, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FilterOperator, StringFilterOperator, NumberFilterOperator, BooleanFilterOperator, DateFilterOperator, EnumFilterOperator, FooterRendererProps, FooterPosition, GetRowId, GetRowIdParams, GetRowClass, GetRowClassParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, Pinned, PinnedSectionsState, PivotConfig, PivotValueConfig, PivotResult, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowData, RowButtonProps, RowId, RowSelectionChangeProps, RowSelectionMode, RowState, SetHeaderRenameProps, ShowWhen, SimpleTableConfig, SimpleTableConfigInput, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableRow, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
|