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,39 @@
|
|
|
1
|
+
import ColumnDef, { Accessor } from "../types/ColumnDef";
|
|
2
|
+
import type { AnimationCoordinator, CellPosition } from "./AnimationCoordinator";
|
|
3
|
+
import { type AccordionAxis } from "../utils/accordionAnimation";
|
|
4
|
+
export interface AccordionHost {
|
|
5
|
+
animationCoordinator: AnimationCoordinator;
|
|
6
|
+
getRoot(): HTMLElement;
|
|
7
|
+
getAnimatableContainers(): HTMLElement[];
|
|
8
|
+
getHeaders(): ColumnDef[];
|
|
9
|
+
getCollapsedHeaders(): Set<Accessor>;
|
|
10
|
+
getEffectiveRowGrouping(): Accessor[] | undefined;
|
|
11
|
+
getCurrentBodyLayouts(): Map<HTMLElement, Map<string, CellPosition>>;
|
|
12
|
+
getExternalVerticalScroll(): {
|
|
13
|
+
clientHeight: number;
|
|
14
|
+
scrollHeight: number;
|
|
15
|
+
scrollTop: number;
|
|
16
|
+
} | null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Owns accordion CSS class timing and when to capture a FLIP snapshot.
|
|
20
|
+
* Delegates the actual FLIP work to {@link AnimationCoordinator}.
|
|
21
|
+
*/
|
|
22
|
+
export declare class AccordionController {
|
|
23
|
+
private host;
|
|
24
|
+
private pendingAccordionAxis;
|
|
25
|
+
private accordionCleanupTimerId;
|
|
26
|
+
/** Leaf accessor + pin key from the last committed paint. */
|
|
27
|
+
private lastRenderedVisibilityKey;
|
|
28
|
+
constructor(host: AccordionHost);
|
|
29
|
+
getPendingAxis(): AccordionAxis;
|
|
30
|
+
clearPendingAxis(): void;
|
|
31
|
+
didColumnVisibilityChange(nextHeaders: ColumnDef[]): boolean;
|
|
32
|
+
/** Record the leaf/pin set that the last render actually painted. */
|
|
33
|
+
rememberRenderedHeaders(headers: ColumnDef[]): void;
|
|
34
|
+
captureSnapshot(): void;
|
|
35
|
+
begin(axis: AccordionAxis): void;
|
|
36
|
+
play(): void;
|
|
37
|
+
destroy(): void;
|
|
38
|
+
private updateAnimationVerticalScroll;
|
|
39
|
+
}
|
|
@@ -97,6 +97,10 @@ export declare class AnimationCoordinator {
|
|
|
97
97
|
* transforms it left behind, so only the latest sort animates.
|
|
98
98
|
*/
|
|
99
99
|
private scheduledFlip;
|
|
100
|
+
/** True while the user is dragging a column header to reorder. */
|
|
101
|
+
private columnReordering;
|
|
102
|
+
/** Holds and slides cells during column drag. Sort uses CSS transitions in play(). */
|
|
103
|
+
private readonly cellSlideAnimator;
|
|
100
104
|
/**
|
|
101
105
|
* Invoked immediately BEFORE a retained/ghost element is permanently removed
|
|
102
106
|
* from the DOM (FLIP/shrink/cancel/destroy teardown). Lets framework adapters
|
|
@@ -116,8 +120,18 @@ export declare class AnimationCoordinator {
|
|
|
116
120
|
setDuration(duration: number): void;
|
|
117
121
|
setEasing(easing: string): void;
|
|
118
122
|
isEnabled(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Enter or leave column-header drag. Motion is owned by CellSlideAnimator.
|
|
125
|
+
* Left/top writes stay plain; the animator holds and slides after those writes.
|
|
126
|
+
*/
|
|
127
|
+
setColumnReordering(active: boolean): void;
|
|
128
|
+
isColumnReordering(): boolean;
|
|
129
|
+
/** Snapshot header visuals before mid-drag left writes. */
|
|
130
|
+
beginColumnReorder(root: ParentNode): void;
|
|
131
|
+
/** Slide after left writes, same task, before paint. */
|
|
132
|
+
commitColumnReorder(root: ParentNode): void;
|
|
119
133
|
isInFlight(cellId: string): boolean;
|
|
120
|
-
/** True while any
|
|
134
|
+
/** True while any sort slide, retained cell, or column-reorder slide is running. */
|
|
121
135
|
hasInFlight(): boolean;
|
|
122
136
|
getDuration(): number;
|
|
123
137
|
getEasing(): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import ColumnDef, { Accessor } from "../types/ColumnDef";
|
|
2
|
+
import Row from "../types/Row";
|
|
3
|
+
import type { ResolvedIcons } from "../core/initialization/TableInitializer";
|
|
4
|
+
import type TableRow from "../types/TableRow";
|
|
5
|
+
import type Theme from "../types/Theme";
|
|
6
|
+
export interface AutoSizeMeasureContext {
|
|
7
|
+
headers: ColumnDef[];
|
|
8
|
+
collapsedHeaders: Set<Accessor>;
|
|
9
|
+
styleRoot: ParentNode | null;
|
|
10
|
+
rows: Row[];
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
icons: ResolvedIcons;
|
|
13
|
+
onRendererHostDiscard?: (host: HTMLElement) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Content-fit column sizing (`width: "auto"`). Distinct from AutoScaleManager,
|
|
17
|
+
* which stretches already-measured natural widths to fill surplus container space.
|
|
18
|
+
*/
|
|
19
|
+
export declare class AutoSizeManager {
|
|
20
|
+
private autoSizeAccessors;
|
|
21
|
+
private pendingAutoSize;
|
|
22
|
+
private naturalWidths;
|
|
23
|
+
private isAutoSizing;
|
|
24
|
+
getAccessors(): Set<Accessor>;
|
|
25
|
+
getNaturalWidths(): Map<string, number>;
|
|
26
|
+
hasPending(): boolean;
|
|
27
|
+
recomputeAccessors(headers: ColumnDef[], collapsedHeaders: Set<Accessor>): void;
|
|
28
|
+
queuePendingFromAccessors(): void;
|
|
29
|
+
clearNaturalWidths(): void;
|
|
30
|
+
recordNaturalWidths(widths: Map<string, number>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Shrink floors for auto-expand column resize, keyed by accessor. Each
|
|
33
|
+
* visible leaf's floor is its natural width — a user-set / content-measured
|
|
34
|
+
* override when present, else the pixel width declared in the column
|
|
35
|
+
* definitions — raised to at least its `minWidth`.
|
|
36
|
+
*/
|
|
37
|
+
getShrinkFloors(headers: ColumnDef[], collapsedHeaders: Set<Accessor>, pristineDefaultHeaders: ColumnDef[]): Map<string, number>;
|
|
38
|
+
/**
|
|
39
|
+
* Measure pending auto columns. Returns updated headers when widths changed;
|
|
40
|
+
* otherwise null (nothing to apply). Always clears the pending set after a
|
|
41
|
+
* successful measure pass so we do not retry every render.
|
|
42
|
+
*/
|
|
43
|
+
maybeMeasure(ctx: AutoSizeMeasureContext): ColumnDef[] | null;
|
|
44
|
+
}
|
|
45
|
+
export declare const getAutoSizeStyleRoot: (refs: {
|
|
46
|
+
mainBodyRef?: {
|
|
47
|
+
current: HTMLElement | null;
|
|
48
|
+
};
|
|
49
|
+
mainHeaderRef?: {
|
|
50
|
+
current: HTMLElement | null;
|
|
51
|
+
};
|
|
52
|
+
pinnedLeftHeaderRef?: {
|
|
53
|
+
current: HTMLElement | null;
|
|
54
|
+
};
|
|
55
|
+
pinnedRightHeaderRef?: {
|
|
56
|
+
current: HTMLElement | null;
|
|
57
|
+
};
|
|
58
|
+
}) => ParentNode | null;
|
|
59
|
+
export declare const getAutoSizeMeasureRows: (args: {
|
|
60
|
+
enablePagination?: boolean;
|
|
61
|
+
serverSidePagination?: boolean;
|
|
62
|
+
currentTableRows?: TableRow[];
|
|
63
|
+
localRows: Row[];
|
|
64
|
+
}) => Row[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slide cells from a remembered visual position to their new layout slot.
|
|
3
|
+
*
|
|
4
|
+
* 1. Snapshot style-space visual (left + top, including live translate)
|
|
5
|
+
* 2. Render writes plain style.left / style.top
|
|
6
|
+
* 3. Hold = parkedFrom − written, then animate to parkedTo − written
|
|
7
|
+
*
|
|
8
|
+
* Far-off true coordinates are parked just outside the viewport and staggered.
|
|
9
|
+
* Mid-flight retargets cancel and replace. Column-drag bodies copy the header remain.
|
|
10
|
+
*/
|
|
11
|
+
/** Marks animations owned by this helper so they can be cancelled without touching others. */
|
|
12
|
+
export declare const CELL_SLIDE_ANIM_ID = "st-cell-slide";
|
|
13
|
+
export type CellSlideAnimatorOptions = {
|
|
14
|
+
duration?: number;
|
|
15
|
+
};
|
|
16
|
+
export type CellSlideKeyframe = {
|
|
17
|
+
element: HTMLElement;
|
|
18
|
+
id: string;
|
|
19
|
+
fromX: number;
|
|
20
|
+
fromY: number;
|
|
21
|
+
toX?: number;
|
|
22
|
+
toY?: number;
|
|
23
|
+
duration?: number;
|
|
24
|
+
easing?: string;
|
|
25
|
+
onFinish?: () => void;
|
|
26
|
+
};
|
|
27
|
+
export declare class CellSlideAnimator {
|
|
28
|
+
private active;
|
|
29
|
+
private duration;
|
|
30
|
+
/** Snapshot taken at beginOrderChange — visual before style.left/top rewrites. */
|
|
31
|
+
private pendingSnap;
|
|
32
|
+
private running;
|
|
33
|
+
constructor(opts?: CellSlideAnimatorOptions);
|
|
34
|
+
setDuration(duration: number): void;
|
|
35
|
+
setActive(active: boolean): void;
|
|
36
|
+
isActive(): boolean;
|
|
37
|
+
hasInFlight(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Snapshot header visuals before mid-drag style.left rewrites.
|
|
40
|
+
*/
|
|
41
|
+
beginOrderChange(root: ParentNode): void;
|
|
42
|
+
/**
|
|
43
|
+
* After style.left rewrites: hold from parked origin toward parked dest.
|
|
44
|
+
* Bodies get the same remain as their header.
|
|
45
|
+
*/
|
|
46
|
+
commitOrderChange(root: ParentNode): void;
|
|
47
|
+
/**
|
|
48
|
+
* Run a hold+tween on one element. Cancels a prior slide on that node first.
|
|
49
|
+
*/
|
|
50
|
+
animate(slide: CellSlideKeyframe): boolean;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
|
53
|
+
/** @deprecated Use {@link CellSlideAnimator}. */
|
|
54
|
+
export declare const ColumnReorderAnimator: typeof CellSlideAnimator;
|
|
@@ -4,6 +4,10 @@ export declare const getSiblingArray: (headers: ColumnDef[], indexPath: number[]
|
|
|
4
4
|
export declare const setSiblingArray: (headers: ColumnDef[], indexPath: number[], newSiblings: ColumnDef[]) => ColumnDef[];
|
|
5
5
|
export declare const getHeaderSection: (header: ColumnDef, rootHeaders: ColumnDef[]) => "left" | "main" | "right";
|
|
6
6
|
export declare const updateHeaderPinnedProperty: (header: ColumnDef, targetSection: "left" | "main" | "right") => ColumnDef;
|
|
7
|
+
/**
|
|
8
|
+
* Move the dragged sibling to the hovered index (remove + insert).
|
|
9
|
+
* Columns between those indices shift by one slot.
|
|
10
|
+
*/
|
|
7
11
|
export declare function swapHeaders(headers: ColumnDef[], draggedPath: number[], hoveredPath: number[]): {
|
|
8
12
|
newHeaders: ColumnDef[];
|
|
9
13
|
emergencyBreak: boolean;
|
|
@@ -16,29 +20,3 @@ export declare function insertHeaderAcrossSections({ headers, draggedHeader, hov
|
|
|
16
20
|
newHeaders: ColumnDef[];
|
|
17
21
|
emergencyBreak: boolean;
|
|
18
22
|
};
|
|
19
|
-
export interface DragHandlerManagerConfig {
|
|
20
|
-
headers: ColumnDef[];
|
|
21
|
-
essentialAccessors?: ReadonlySet<string>;
|
|
22
|
-
onTableHeaderDragEnd: (newHeaders: ColumnDef[]) => void;
|
|
23
|
-
onColumnOrderChange?: (newHeaders: ColumnDef[]) => void;
|
|
24
|
-
onHeadersChange?: (newHeaders: ColumnDef[]) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare class DragHandlerManager {
|
|
27
|
-
private config;
|
|
28
|
-
private draggedHeader;
|
|
29
|
-
private hoveredHeader;
|
|
30
|
-
private prevUpdateTime;
|
|
31
|
-
private prevDraggingPosition;
|
|
32
|
-
private prevHeadersTracker;
|
|
33
|
-
constructor(config: DragHandlerManagerConfig);
|
|
34
|
-
updateConfig(config: Partial<DragHandlerManagerConfig>): void;
|
|
35
|
-
getDraggedHeader(): ColumnDef | null;
|
|
36
|
-
getHoveredHeader(): ColumnDef | null;
|
|
37
|
-
handleDragStart(header: ColumnDef): void;
|
|
38
|
-
handleDragOver({ event, hoveredHeader, }: {
|
|
39
|
-
event: DragEvent;
|
|
40
|
-
hoveredHeader: ColumnDef;
|
|
41
|
-
}): void;
|
|
42
|
-
handleDragEnd(): void;
|
|
43
|
-
destroy(): void;
|
|
44
|
-
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DimensionManager } from "./DimensionManager";
|
|
2
|
+
import { type ExternalScrollMetrics, type ResolvedScrollParent, type ScrollParentValue } from "../utils/externalScroll";
|
|
3
|
+
export interface ExternalScrollHost {
|
|
4
|
+
getScrollParent(): ScrollParentValue;
|
|
5
|
+
getHeight(): string | number | undefined | null;
|
|
6
|
+
getMaxHeight(): string | number | undefined | null;
|
|
7
|
+
getBodyContainer(): HTMLElement | null;
|
|
8
|
+
getRootElement(): HTMLElement | null;
|
|
9
|
+
getFallbackRoot(): HTMLElement;
|
|
10
|
+
isMounted(): boolean;
|
|
11
|
+
getDimensionManager(): DimensionManager | null;
|
|
12
|
+
onInternalScroll(e: Event): void;
|
|
13
|
+
onExternalScroll(metrics: ExternalScrollMetrics): void;
|
|
14
|
+
onExternalResize(): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Owns which element is the vertical scroller: the table body (internal) or a
|
|
18
|
+
* consumer `scrollParent` (external / window). Also tracks the visible
|
|
19
|
+
* viewport height used for virtualization in external mode.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ExternalScrollController {
|
|
22
|
+
private host;
|
|
23
|
+
private resolvedScrollParent;
|
|
24
|
+
private externalScrollListener;
|
|
25
|
+
private externalWindowResizeListener;
|
|
26
|
+
private externalParentResizeObserver;
|
|
27
|
+
private externalViewportHeight;
|
|
28
|
+
private externalScrollRetryRaf;
|
|
29
|
+
private externalScrollRetryCount;
|
|
30
|
+
private bodyScrollListenerAttached;
|
|
31
|
+
private bodyContainerScrollListener;
|
|
32
|
+
/**
|
|
33
|
+
* When external scroll mode is active we briefly take control of the scroll
|
|
34
|
+
* parent's `overscroll-behavior-y` to neutralize the browser's rubber-band /
|
|
35
|
+
* scroll-chaining at the boundaries. Without this, pulling past the top or
|
|
36
|
+
* bottom of the scroll parent visually translates the entire scroll content
|
|
37
|
+
* layer (including the CSS-sticky header), causing the header to "disappear"
|
|
38
|
+
* during overscroll bounces even though its layout position is unchanged.
|
|
39
|
+
*/
|
|
40
|
+
private overscrollBehaviorTarget;
|
|
41
|
+
private overscrollBehaviorPrev;
|
|
42
|
+
constructor(host: ExternalScrollHost);
|
|
43
|
+
getResolvedParent(): ResolvedScrollParent;
|
|
44
|
+
getViewportHeight(): number;
|
|
45
|
+
setViewportHeight(next: number): void;
|
|
46
|
+
/**
|
|
47
|
+
* Reconciles which element owns the vertical scroll listener based on the
|
|
48
|
+
* current `scrollParent` config. Idempotent — safe to call repeatedly.
|
|
49
|
+
*/
|
|
50
|
+
sync(): void;
|
|
51
|
+
recomputeViewportHeight(): void;
|
|
52
|
+
getVerticalScrollMetrics(): {
|
|
53
|
+
clientHeight: number;
|
|
54
|
+
scrollHeight: number;
|
|
55
|
+
scrollTop: number;
|
|
56
|
+
} | null;
|
|
57
|
+
destroy(): void;
|
|
58
|
+
private scheduleParentRetry;
|
|
59
|
+
private ensureBodyScrollListenerAttached;
|
|
60
|
+
private ensureBodyScrollListenerDetached;
|
|
61
|
+
private attachExternalWiring;
|
|
62
|
+
private detachExternalWiring;
|
|
63
|
+
private applyOverscrollContainment;
|
|
64
|
+
private restoreOverscrollBehavior;
|
|
65
|
+
private recomputePaddingTop;
|
|
66
|
+
private handleExternalResize;
|
|
67
|
+
private handleExternalScroll;
|
|
68
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type ColumnDef from "../types/ColumnDef";
|
|
2
|
-
import type { Accessor } from "../types/ColumnDef";
|
|
3
2
|
import type Row from "../types/Row";
|
|
4
3
|
import type { PivotConfig } from "../types/PivotTypes";
|
|
5
4
|
export interface PivotManagerConfig {
|
|
@@ -11,7 +10,6 @@ export interface PivotManagerState {
|
|
|
11
10
|
active: boolean;
|
|
12
11
|
pivotedRows: Row[];
|
|
13
12
|
headers: ColumnDef[];
|
|
14
|
-
rowGrouping?: Accessor[];
|
|
15
13
|
pivot: PivotConfig | null;
|
|
16
14
|
}
|
|
17
15
|
type StateChangeCallback = (state: PivotManagerState) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ScrollManager } from "./ScrollManager";
|
|
2
|
+
export type ScrollRenderSource = "scroll-raf" | "scroll-end";
|
|
3
|
+
export interface ScrollRenderCoalescerHost {
|
|
4
|
+
getScrollManager(): ScrollManager | null;
|
|
5
|
+
/** When true, pass container/content height into ScrollManager for infinite scroll. */
|
|
6
|
+
shouldTrackInfiniteScroll(): boolean;
|
|
7
|
+
onRender(source: ScrollRenderSource): void;
|
|
8
|
+
}
|
|
9
|
+
export interface ScrollFrameInput {
|
|
10
|
+
scrollTop: number;
|
|
11
|
+
scrollLeft: number;
|
|
12
|
+
containerHeight: number;
|
|
13
|
+
contentHeight: number;
|
|
14
|
+
/** Runs inside the rAF after scrollTop and direction are stored. */
|
|
15
|
+
afterApply?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Coalesces vertical scroll into one rAF render, then one full render after
|
|
19
|
+
* scrolling stops. Shared by the table body scroller and an external scroll parent.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ScrollRenderCoalescer {
|
|
22
|
+
private host;
|
|
23
|
+
private scrollRafId;
|
|
24
|
+
private scrollEndTimeoutId;
|
|
25
|
+
private lastScrollTop;
|
|
26
|
+
isScrolling: boolean;
|
|
27
|
+
scrollTop: number;
|
|
28
|
+
scrollDirection: "up" | "down" | "none";
|
|
29
|
+
constructor(host: ScrollRenderCoalescerHost);
|
|
30
|
+
schedule(frame: ScrollFrameInput): void;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
}
|
|
@@ -4,13 +4,13 @@ import type Cell from "../../types/Cell";
|
|
|
4
4
|
* Uses row buckets: one getBoundingClientRect per row to find the row, then only
|
|
5
5
|
* measures cells in that row (O(rows + cols) instead of O(rows * cols)).
|
|
6
6
|
*/
|
|
7
|
-
export declare function calculateNearestCell(clientX: number, clientY: number, root
|
|
7
|
+
export declare function calculateNearestCell(clientX: number, clientY: number, root: HTMLElement | null): Cell | null;
|
|
8
8
|
/**
|
|
9
9
|
* Get cell from mouse position (element under point, or nearest cell).
|
|
10
10
|
*/
|
|
11
|
-
export declare function getCellFromMousePosition(clientX: number, clientY: number, root
|
|
11
|
+
export declare function getCellFromMousePosition(clientX: number, clientY: number, root: HTMLElement | null): Cell | null;
|
|
12
12
|
/**
|
|
13
13
|
* Handle auto-scrolling when dragging near table edges.
|
|
14
14
|
* @param root - Table root (e.g. `.simple-table-root`); limits queries to this instance.
|
|
15
15
|
*/
|
|
16
|
-
export declare function handleAutoScroll(clientX: number, clientY: number, root
|
|
16
|
+
export declare function handleAutoScroll(clientX: number, clientY: number, root: HTMLElement | null): void;
|