simple-table-core 4.2.3 → 4.2.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/dist/cjs/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/core/SimpleTableVanilla.d.ts +1 -1
- package/dist/core/initialization/wireMountManagers.d.ts +4 -2
- package/dist/core/rendering/RenderContext.d.ts +2 -2
- package/dist/core/rendering/SectionRenderer.d.ts +4 -0
- package/dist/core/rendering/TableRenderer.d.ts +1 -1
- package/dist/core/rendering/TableRendererDeps.d.ts +2 -2
- package/dist/core/rendering/buildRenderContext.d.ts +2 -2
- package/dist/core/vanilla/VanillaLiveHost.d.ts +2 -2
- package/dist/core/vanilla/destroyTableResources.d.ts +1 -1
- package/dist/hooks/windowResize.d.ts +2 -1
- package/dist/index.es.js +1 -1
- package/dist/managers/AnimationCoordinator.d.ts +9 -0
- package/dist/managers/DimensionManager.d.ts +6 -1
- package/dist/managers/ExternalScrollController.d.ts +6 -3
- package/dist/managers/ScrollManager.d.ts +1 -1
- package/dist/managers/horizontalScroll/HorizontalScrollEngine.d.ts +49 -0
- package/dist/managers/horizontalScroll/index.d.ts +6 -0
- package/dist/managers/horizontalScroll/lookup.d.ts +8 -0
- package/dist/managers/horizontalScroll/physics.d.ts +22 -0
- package/dist/managers/horizontalScroll/scrollLayer.d.ts +7 -0
- package/dist/managers/horizontalScroll/types.d.ts +13 -0
- package/dist/styles.css +1 -1
- package/dist/types/SimpleTableConfig.d.ts +5 -1
- package/dist/types/SimpleTableProps.d.ts +5 -1
- package/dist/utils/horizontalScrollbarRenderer.d.ts +4 -7
- package/dist/utils/stickyParentsRenderer.d.ts +3 -3
- package/package.json +14 -14
- package/src/styles/base.css +37 -8
- package/dist/managers/SectionScrollController.d.ts +0 -74
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TableRow from "../types/TableRow";
|
|
2
2
|
import ColumnDef from "../types/ColumnDef";
|
|
3
3
|
import { CumulativeHeightMap, HeightOffsets } from "./infiniteScrollUtils";
|
|
4
|
-
import type
|
|
4
|
+
import { type HorizontalScrollEngine } from "../managers/horizontalScroll";
|
|
5
5
|
import { CustomTheme } from "../types/CustomTheme";
|
|
6
6
|
import { CellRenderContext } from "./bodyCell/types";
|
|
7
7
|
export interface StickyParentsContainerProps {
|
|
@@ -47,7 +47,7 @@ export interface StickyParentsRenderContext {
|
|
|
47
47
|
rowHeight: number;
|
|
48
48
|
heightOffsets: HeightOffsets | undefined;
|
|
49
49
|
cellRenderContext: CellRenderContext;
|
|
50
|
-
|
|
50
|
+
horizontalScroll?: HorizontalScrollEngine | null;
|
|
51
51
|
}
|
|
52
52
|
export declare const createStickyParentsContainer: (props: StickyParentsContainerProps, context: StickyParentsRenderContext) => HTMLElement | null;
|
|
53
|
-
export declare const cleanupStickyParentsContainer: (container: HTMLElement,
|
|
53
|
+
export declare const cleanupStickyParentsContainer: (container: HTMLElement, horizontalScroll?: HorizontalScrollEngine | null) => void;
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-table-core",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.7",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rollup -c",
|
|
9
|
+
"preview": "rollup -c -w",
|
|
10
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
11
|
+
"start": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build",
|
|
13
|
+
"version:patch": "npm version patch && git push && git push --tags",
|
|
14
|
+
"version:minor": "npm version minor && git push && git push --tags",
|
|
15
|
+
"version:major": "npm version major && git push && git push --tags",
|
|
16
|
+
"test-storybook:ci": "test-storybook --url http://localhost:6006 --testTimeout=120000"
|
|
17
|
+
},
|
|
7
18
|
"sideEffects": [
|
|
8
19
|
"*.css",
|
|
9
20
|
"**/*.css"
|
|
@@ -120,16 +131,5 @@
|
|
|
120
131
|
"row pinning",
|
|
121
132
|
"column pinning",
|
|
122
133
|
"tree data grid"
|
|
123
|
-
]
|
|
124
|
-
|
|
125
|
-
"build": "rollup -c",
|
|
126
|
-
"preview": "rollup -c -w",
|
|
127
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
128
|
-
"start": "storybook dev -p 6006",
|
|
129
|
-
"build-storybook": "storybook build",
|
|
130
|
-
"version:patch": "npm version patch && git push && git push --tags",
|
|
131
|
-
"version:minor": "npm version minor && git push && git push --tags",
|
|
132
|
-
"version:major": "npm version major && git push && git push --tags",
|
|
133
|
-
"test-storybook:ci": "test-storybook --url http://localhost:6006 --testTimeout=120000"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
134
|
+
]
|
|
135
|
+
}
|
package/src/styles/base.css
CHANGED
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
/* Wrapper for the table */
|
|
120
120
|
.st-wrapper {
|
|
121
121
|
position: relative;
|
|
122
|
+
width: 100%;
|
|
122
123
|
border: var(--st-border-width) solid var(--st-border-color);
|
|
123
124
|
border-radius: var(--st-border-radius);
|
|
124
125
|
overflow: hidden;
|
|
@@ -225,15 +226,42 @@
|
|
|
225
226
|
|
|
226
227
|
.st-horizontal-scrollbar-middle,
|
|
227
228
|
.st-horizontal-scrollbar-left,
|
|
228
|
-
.st-horizontal-scrollbar-right
|
|
229
|
+
.st-horizontal-scrollbar-right {
|
|
230
|
+
overflow: auto;
|
|
231
|
+
touch-action: auto;
|
|
232
|
+
}
|
|
233
|
+
|
|
229
234
|
.st-header-main,
|
|
230
235
|
.st-header-pinned-left,
|
|
231
236
|
.st-header-pinned-right,
|
|
232
237
|
.st-body-main,
|
|
233
238
|
.st-body-pinned-left,
|
|
234
239
|
.st-body-pinned-right {
|
|
235
|
-
overflow:
|
|
236
|
-
|
|
240
|
+
overflow-x: hidden;
|
|
241
|
+
overflow-x: clip;
|
|
242
|
+
overflow-y: hidden;
|
|
243
|
+
position: relative;
|
|
244
|
+
min-width: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.st-body-main,
|
|
248
|
+
.st-body-pinned-left,
|
|
249
|
+
.st-body-pinned-right {
|
|
250
|
+
touch-action: pan-y;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.st-header-main,
|
|
254
|
+
.st-header-pinned-left,
|
|
255
|
+
.st-header-pinned-right {
|
|
256
|
+
touch-action: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.st-h-scroll-layer {
|
|
260
|
+
position: absolute;
|
|
261
|
+
left: 0;
|
|
262
|
+
top: 0;
|
|
263
|
+
height: 100%;
|
|
264
|
+
will-change: transform;
|
|
237
265
|
}
|
|
238
266
|
.st-header-main,
|
|
239
267
|
.st-header-pinned-left,
|
|
@@ -264,12 +292,9 @@
|
|
|
264
292
|
flex-grow: 1;
|
|
265
293
|
}
|
|
266
294
|
|
|
267
|
-
/* Header must only scroll horizontally; prevent vertical scroll (vanilla refactor removed display:grid from header sections) */
|
|
268
295
|
.st-header-main,
|
|
269
296
|
.st-header-pinned-left,
|
|
270
297
|
.st-header-pinned-right {
|
|
271
|
-
overflow-x: auto;
|
|
272
|
-
overflow-y: hidden;
|
|
273
298
|
background-color: var(--st-header-background-color);
|
|
274
299
|
}
|
|
275
300
|
|
|
@@ -282,9 +307,11 @@
|
|
|
282
307
|
flex-grow: 1;
|
|
283
308
|
display: flex;
|
|
284
309
|
width: 100%;
|
|
285
|
-
overflow:
|
|
310
|
+
overflow-x: hidden;
|
|
311
|
+
overflow-x: clip;
|
|
312
|
+
overflow-y: auto;
|
|
286
313
|
-webkit-overflow-scrolling: touch;
|
|
287
|
-
touch-action:
|
|
314
|
+
touch-action: pan-y;
|
|
288
315
|
height: max-content;
|
|
289
316
|
background-color: var(--st-even-row-background-color);
|
|
290
317
|
}
|
|
@@ -302,6 +329,8 @@
|
|
|
302
329
|
.st-sticky-section-main,
|
|
303
330
|
.st-sticky-section-right {
|
|
304
331
|
overflow: hidden;
|
|
332
|
+
overflow-x: clip;
|
|
333
|
+
position: relative;
|
|
305
334
|
}
|
|
306
335
|
|
|
307
336
|
.st-sticky-section-left {
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export type SectionId = "pinned-left" | "main" | "pinned-right";
|
|
2
|
-
export type SectionPaneRole = "sticky" | "scrollbar" | "header" | "body";
|
|
3
|
-
export interface SectionScrollControllerConfig {
|
|
4
|
-
/** Heavy body virtualization. Throttled to every {@link VIRTUALIZATION_THRESHOLD_PX}px. */
|
|
5
|
-
onMainSectionScrollLeft?: (scrollLeft: number) => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Single controller for horizontal scroll sync across all four panes per section:
|
|
9
|
-
* sticky parent, horizontal scrollbar segment, header, and body.
|
|
10
|
-
* Scrolling any one pane updates the other three in that section.
|
|
11
|
-
* All four panes must have the same scroll width (enforced by renderers).
|
|
12
|
-
*/
|
|
13
|
-
export declare class SectionScrollController {
|
|
14
|
-
private scrollLeftBySection;
|
|
15
|
-
private panesBySection;
|
|
16
|
-
private scrollHandlers;
|
|
17
|
-
/** Non-passive touchmove handlers on header panes that cancel iOS touch scrolling. */
|
|
18
|
-
private headerTouchMoveHandlers;
|
|
19
|
-
private config;
|
|
20
|
-
/** Guard to avoid re-entrancy when we programmatically set scrollLeft on other panes */
|
|
21
|
-
private isSyncing;
|
|
22
|
-
/** Last scrollLeft at which we ran main-section virtualization; used to run heavy ops only every N px. */
|
|
23
|
-
private lastMainVirtualizationScrollLeft;
|
|
24
|
-
/**
|
|
25
|
-
* True while a touch-driven scroll (including post-release momentum) is in progress on a body
|
|
26
|
-
* pane. While true, we must not write scrollLeft to scroll-container followers (the horizontal
|
|
27
|
-
* scrollbar), because on iOS that cancels the body's inertial momentum. Such followers are
|
|
28
|
-
* reconciled once scrolling settles.
|
|
29
|
-
*/
|
|
30
|
-
private isTouchScrolling;
|
|
31
|
-
/** Scroll-idle timer used to detect the end of a touch-driven scroll (incl. momentum). */
|
|
32
|
-
private touchSettleTimeoutId;
|
|
33
|
-
constructor(config?: SectionScrollControllerConfig);
|
|
34
|
-
updateConfig(config: Partial<SectionScrollControllerConfig>): void;
|
|
35
|
-
/**
|
|
36
|
-
* Register a pane (sticky, scrollbar, header, or body) for a section.
|
|
37
|
-
* When any registered pane scrolls, the others in the same section are updated.
|
|
38
|
-
* If a pane with the same role was already registered (e.g. after re-render), it is replaced.
|
|
39
|
-
*/
|
|
40
|
-
registerPane(sectionId: SectionId, element: HTMLElement, role: SectionPaneRole): void;
|
|
41
|
-
/**
|
|
42
|
-
* Unregister a pane (e.g. when section is removed or re-created).
|
|
43
|
-
*/
|
|
44
|
-
unregisterPane(sectionId: SectionId, element: HTMLElement): void;
|
|
45
|
-
/**
|
|
46
|
-
* Unregister all panes for a section (e.g. on cleanup).
|
|
47
|
-
*/
|
|
48
|
-
unregisterSection(sectionId: SectionId): void;
|
|
49
|
-
/**
|
|
50
|
-
* Set scroll position for a section. Updates state and all registered panes.
|
|
51
|
-
* Used when a pane fires scroll and when restoring after render.
|
|
52
|
-
*/
|
|
53
|
-
setSectionScrollLeft(sectionId: SectionId, value: number): void;
|
|
54
|
-
getSectionScrollLeft(sectionId: SectionId): number;
|
|
55
|
-
/**
|
|
56
|
-
* Restore scroll position to all registered panes from stored state (e.g. after render).
|
|
57
|
-
*/
|
|
58
|
-
restoreAll(): void;
|
|
59
|
-
private addScrollListener;
|
|
60
|
-
/**
|
|
61
|
-
* Track touch-driven scrolling on a body pane. While a touch (and its post-release momentum) is
|
|
62
|
-
* active, scroll-container followers (the horizontal scrollbar) are not written, to preserve iOS
|
|
63
|
-
* momentum; they are reconciled when scrolling settles.
|
|
64
|
-
*/
|
|
65
|
-
private addTouchTracking;
|
|
66
|
-
/**
|
|
67
|
-
* (Re)arm the scroll-idle timer that marks the end of a touch-driven scroll. When it fires (no
|
|
68
|
-
* scroll for the idle window, i.e. momentum has stopped), reconcile scroll-container followers
|
|
69
|
-
* (the scrollbar) to the final position, which we deliberately skipped during the touch scroll.
|
|
70
|
-
*/
|
|
71
|
-
private scheduleTouchSettle;
|
|
72
|
-
private removeScrollListener;
|
|
73
|
-
destroy(): void;
|
|
74
|
-
}
|