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
|
@@ -18,6 +18,8 @@ export interface CreateDropdownOptions {
|
|
|
18
18
|
width?: number;
|
|
19
19
|
maxWidth?: number;
|
|
20
20
|
positioning?: "fixed" | "absolute";
|
|
21
|
+
/** Extra class(es) preserved across open/position updates (e.g. `st-custom-select-dropdown`). */
|
|
22
|
+
className?: string;
|
|
21
23
|
/**
|
|
22
24
|
* When true, this panel does not clip overflowing descendants (e.g. nested operator menus inside
|
|
23
25
|
* the filter popover). Uses overflow: visible and drops max-height on the shell — see
|
|
@@ -22,7 +22,7 @@ export declare const getHeaderPositionCache: (container: HTMLElement) => Map<str
|
|
|
22
22
|
export declare const REVERT_TO_PREVIOUS_HEADERS_DELAY = 150;
|
|
23
23
|
export declare const throttle: (callback: () => void, limit: number) => void;
|
|
24
24
|
export declare const addTrackedEventListener: (element: HTMLElement, event: string, handler: EventListener, options?: AddEventListenerOptions) => void;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
export declare const getHeaderTooltipEpoch: () => number;
|
|
26
|
+
/** Removes `.st-tooltip` nodes under this table. Pending show timers from before this call do not create a new tooltip. */
|
|
27
27
|
export declare const removeFloatingHeaderTooltips: (fromElement: HTMLElement) => void;
|
|
28
28
|
export declare const cleanupHeaderCellRendering: (container?: HTMLElement, onHostDiscard?: (host: HTMLElement) => void) => void;
|
|
@@ -4,4 +4,3 @@ export declare const createHeaderCellElement: (cell: AbsoluteCell, context: Head
|
|
|
4
4
|
export declare const getLastHeaderIndex: (absoluteCells: AbsoluteCell[]) => number;
|
|
5
5
|
/** Replace sort/filter/collapse icons on an existing header cell, preserving label/drag handlers. */
|
|
6
6
|
export declare const refreshHeaderCellIcons: (cellElement: HTMLElement, header: AbsoluteCell["header"], context: HeaderRenderContext, colIndex: number) => void;
|
|
7
|
-
export declare const updateHeaderCellElement: (cellElement: HTMLElement, cell: AbsoluteCell, context: HeaderRenderContext) => void;
|
|
@@ -49,11 +49,11 @@ export declare function normalizeHeaderWidths(headers: ColumnDef[], totalWidthOr
|
|
|
49
49
|
/**
|
|
50
50
|
* Get actual width of a header in pixels
|
|
51
51
|
*/
|
|
52
|
-
export declare const getHeaderWidthInPixels: (header: ColumnDef) => number;
|
|
52
|
+
export declare const getHeaderWidthInPixels: (header: ColumnDef, searchRoot?: ParentNode | null) => number;
|
|
53
53
|
/**
|
|
54
54
|
* Convert fractional widths to pixel values
|
|
55
55
|
*/
|
|
56
|
-
export declare const removeAllFractionalWidths: (header: ColumnDef) => void;
|
|
56
|
+
export declare const removeAllFractionalWidths: (header: ColumnDef, searchRoot?: ParentNode | null) => void;
|
|
57
57
|
/**
|
|
58
58
|
* Calculate the minimum width for a header
|
|
59
59
|
*/
|
|
@@ -48,7 +48,6 @@ export declare const findRowAtScrollPosition: (scrollTop: number, heightMap: Cum
|
|
|
48
48
|
* @returns Total extra height from all nested grids above this position
|
|
49
49
|
*/
|
|
50
50
|
export declare const getCumulativeExtraHeight: (position: number, heightOffsets?: HeightOffsets) => number;
|
|
51
|
-
export declare const getTotalRowCount: (tableRows: TableRow[]) => number;
|
|
52
51
|
/**
|
|
53
52
|
* Calculate the total height of all rows including nested grids with extra heights
|
|
54
53
|
* @param totalRowCount - Total number of rows
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Park far-off cell coordinates just outside the visible band, spaced so
|
|
3
|
+
* they do not stack on the same edge.
|
|
4
|
+
*/
|
|
5
|
+
export type ParkBand = {
|
|
6
|
+
/** scrollTop (Y) or scrollLeft (X). */
|
|
7
|
+
scrollOffset: number;
|
|
8
|
+
/** clientHeight (Y) or clientWidth (X). */
|
|
9
|
+
clientSize: number;
|
|
10
|
+
};
|
|
11
|
+
export type ParkItem = {
|
|
12
|
+
id: string;
|
|
13
|
+
truePos: number;
|
|
14
|
+
cellSize: number;
|
|
15
|
+
/**
|
|
16
|
+
* Park on this side even when `truePos` overlaps the visible band.
|
|
17
|
+
* Used for incoming cells whose conceptual origin is in-view but the
|
|
18
|
+
* cell itself was not in the DOM — they still slide in from an edge.
|
|
19
|
+
*/
|
|
20
|
+
forceSide?: "before" | "after";
|
|
21
|
+
/**
|
|
22
|
+
* Keep `truePos` even when it sits outside the band. Used for cells that
|
|
23
|
+
* are already in the DOM so the slide starts from where they currently look.
|
|
24
|
+
*/
|
|
25
|
+
holdTruePos?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type ParkAndStaggerOptions = {
|
|
28
|
+
/** Extra space between parked cells. Defaults to 0. */
|
|
29
|
+
gap?: number;
|
|
30
|
+
/** Gap between the viewport edge and the first parked cell. Defaults to that cell's size. */
|
|
31
|
+
margin?: number;
|
|
32
|
+
};
|
|
33
|
+
/** True when the cell's box overlaps the visible band. */
|
|
34
|
+
export declare const isNearViewport: (truePos: number, cellSize: number, band: ParkBand) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Map each item to a coordinate: true position when near the viewport,
|
|
37
|
+
* otherwise just outside the matching edge, staggered by slot.
|
|
38
|
+
*
|
|
39
|
+
* Slot 0 is closest to the visible edge. Order on each side follows
|
|
40
|
+
* `truePos` so destination order is preserved. Parks stay between the
|
|
41
|
+
* edge and the true position, and the stagger never spreads more than
|
|
42
|
+
* one viewport beyond the first parked cell.
|
|
43
|
+
*/
|
|
44
|
+
export declare const parkAndStagger: (items: ParkItem[], band: ParkBand, options?: ParkAndStaggerOptions) => Map<string, number>;
|
|
@@ -12,4 +12,4 @@ export declare const getRootPinned: (header: ColumnDef, headers: ColumnDef[]) =>
|
|
|
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: ColumnDef[], collapsedHeaders?: Set<string>, overrideWidths?: Map<string, number
|
|
15
|
+
export declare const updateColumnWidthsInDOM: (headers: ColumnDef[], collapsedHeaders?: Set<string>, overrideWidths?: Map<string, number>, tableRoot?: ParentNode | null) => void;
|
|
@@ -2,8 +2,9 @@ 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
|
-
export declare const calculateMaxHeaderWidth: ({ header, headers, collapsedHeaders, }: {
|
|
5
|
+
export declare const calculateMaxHeaderWidth: ({ header, headers, collapsedHeaders, tableRoot, }: {
|
|
6
6
|
header: ColumnDef;
|
|
7
7
|
headers: ColumnDef[];
|
|
8
8
|
collapsedHeaders?: Set<string>;
|
|
9
|
+
tableRoot?: ParentNode | null;
|
|
9
10
|
}) => number;
|
|
@@ -11,10 +11,6 @@ export declare const shouldShowRowSelectionColumn: (config: {
|
|
|
11
11
|
showRowSelectionColumn?: boolean;
|
|
12
12
|
rowButtons?: unknown[];
|
|
13
13
|
}) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Get the set of selected row IDs from an array of table rows
|
|
16
|
-
*/
|
|
17
|
-
export declare const getSelectedRowIds: (tableRows: TableRow[]) => string[];
|
|
18
14
|
/**
|
|
19
15
|
* Check if a specific row is selected
|
|
20
16
|
*/
|
|
@@ -13,4 +13,3 @@ export interface CreateRowSeparatorOptions {
|
|
|
13
13
|
/** Keep separator width in sync with section layout (resize, pinned width changes). */
|
|
14
14
|
export declare const applyRowSeparatorSectionWidth: (separator: HTMLElement, sectionWidthPx?: number) => void;
|
|
15
15
|
export declare const createRowSeparator: (options: CreateRowSeparatorOptions) => HTMLElement;
|
|
16
|
-
export declare const createSpacerRow: (position: number, rowHeight: number, heightOffsets: HeightOffsets | undefined, customTheme: CustomTheme, className: string, height?: number) => HTMLElement;
|
package/dist/utils/rowUtils.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import TableRow from "../types/TableRow";
|
|
2
1
|
import Row from "../types/Row";
|
|
3
|
-
import
|
|
2
|
+
import { Accessor } from "../types/ColumnDef";
|
|
4
3
|
import CellValue from "../types/CellValue";
|
|
5
|
-
import RowState from "../types/RowState";
|
|
6
4
|
import { CustomTheme } from "../types/CustomTheme";
|
|
7
5
|
import { GetRowId } from "../types/GetRowId";
|
|
8
6
|
import { GenerateRowIdParams } from "../types/GenerateRowIdParams";
|
|
@@ -161,27 +159,3 @@ export declare const hasNestedRows: (row: Row, groupingKey?: string) => boolean;
|
|
|
161
159
|
* @returns true if the row is expanded, false otherwise
|
|
162
160
|
*/
|
|
163
161
|
export declare const isRowExpanded: (expandStateRowId: string | number, depth: number, expandedDepths: Set<number>, expandedRows: Map<string, number>, collapsedRows: Map<string, number>) => boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Flatten rows recursively based on row grouping configuration
|
|
166
|
-
* Now calculates ALL properties including position and isLastGroupRow
|
|
167
|
-
* Also injects special state rows for loading/error/empty states (only if renderers are available)
|
|
168
|
-
* Also injects nested grid rows when a header has nestedTable configuration
|
|
169
|
-
*/
|
|
170
|
-
export declare const flattenRowsWithGrouping: ({ depth, expandedDepths, expandedRows, collapsedRows, rowGrouping, getRowId, rows, displayPositionOffset, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, headers, rowHeight, headerHeight, customTheme, }: {
|
|
171
|
-
depth?: number;
|
|
172
|
-
expandedDepths: Set<number>;
|
|
173
|
-
expandedRows: Map<string, number>;
|
|
174
|
-
collapsedRows: Map<string, number>;
|
|
175
|
-
rowGrouping?: Accessor[];
|
|
176
|
-
getRowId?: GetRowId;
|
|
177
|
-
rows: Row[];
|
|
178
|
-
displayPositionOffset?: number;
|
|
179
|
-
rowStateMap?: Map<string | number, RowState>;
|
|
180
|
-
hasLoadingRenderer?: boolean;
|
|
181
|
-
hasErrorRenderer?: boolean;
|
|
182
|
-
hasEmptyRenderer?: boolean;
|
|
183
|
-
headers?: ColumnDef[];
|
|
184
|
-
rowHeight: number;
|
|
185
|
-
headerHeight: number;
|
|
186
|
-
customTheme: CustomTheme;
|
|
187
|
-
}) => TableRow[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write absolute `left`/`top` while preserving an in-flight FLIP visual position.
|
|
3
|
+
*
|
|
4
|
+
* FLIP inverts use `transform: translate3d(...)` relative to `style.left/top`.
|
|
5
|
+
* Updating left/top without adjusting that translate moves the painted cell by
|
|
6
|
+
* the same delta — then `play()` "corrects" it with a new invert, which reads
|
|
7
|
+
* as a jump during rapid reorders.
|
|
8
|
+
*
|
|
9
|
+
* Column-drag does NOT compensate here: {@link CellSlideAnimator} snapshots
|
|
10
|
+
* visuals before left writes and applies the hold+tween after.
|
|
11
|
+
*/
|
|
12
|
+
export declare const setFlipCompensationEnabled: (enabled: boolean) => void;
|
|
13
|
+
/** Parse translate/matrix CSS into tx/ty. */
|
|
14
|
+
export declare const parseCssTranslate: (transform: string) => {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
} | null;
|
|
18
|
+
/**
|
|
19
|
+
* Painted translate in style.left/top space. Prefers the computed matrix so a
|
|
20
|
+
* running WAAPI slide is not mistaken for its start keyframe (`style.transform`
|
|
21
|
+
* stays at the invert until the animation finishes).
|
|
22
|
+
*/
|
|
23
|
+
export declare const readLiveTranslate: (element: HTMLElement) => {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
} | null;
|
|
27
|
+
/**
|
|
28
|
+
* Set absolute cell coordinates, compensating any active FLIP translate so the
|
|
29
|
+
* visual position does not drift when the logical slot moves.
|
|
30
|
+
*/
|
|
31
|
+
export declare const setAbsoluteCellPosition: (element: HTMLElement, nextLeft: number, nextTop: number) => void;
|
|
@@ -12,4 +12,3 @@ export interface StateRowRenderContext {
|
|
|
12
12
|
emptyStateRenderer?: EmptyStateRenderer;
|
|
13
13
|
}
|
|
14
14
|
export declare const createStateRow: (tableRow: TableRowType, context: StateRowRenderContext) => HTMLElement;
|
|
15
|
-
export declare const cleanupStateRow: (rowElement: HTMLElement) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Class on the per-instance table wrapper created by DOMManager. */
|
|
2
|
+
export declare const TABLE_ROOT_CLASS = "simple-table-root";
|
|
3
|
+
export declare const TABLE_ROOT_SELECTOR = ".simple-table-root";
|
|
4
|
+
/** Walks up from `from` to this table's `.simple-table-root`, or null. */
|
|
5
|
+
export declare const resolveTableRoot: (from: Element | null | undefined) => HTMLElement | null;
|
|
6
|
+
/**
|
|
7
|
+
* True when `el` belongs to this table instance, not a nested table inside it.
|
|
8
|
+
* Nested grids mount their own `.simple-table-root` under the parent.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isOwnedByTable: (root: Element, el: Element) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* `querySelectorAll` within `root`, skipping nodes that belong to a nested table.
|
|
13
|
+
* Pass this instance's `.simple-table-root` (or any descendant of it).
|
|
14
|
+
*/
|
|
15
|
+
export declare const queryAllInTable: <E extends Element = HTMLElement>(root: ParentNode | null | undefined, selector: string) => E[];
|
|
16
|
+
/** First match of `queryAllInTable`, or null. */
|
|
17
|
+
export declare const queryInTable: <E extends Element = HTMLElement>(root: ParentNode | null | undefined, selector: string) => E | null;
|
|
18
|
+
/** Looks up an element by `id` inside this table, not `document.getElementById`. */
|
|
19
|
+
export declare const getElementByIdInTable: (root: ParentNode | null | undefined, id: string) => HTMLElement | null;
|
|
20
|
+
export declare const escapeTableAttrValue: (value: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-table-core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@storybook/test-runner": "^0.19.1",
|
|
43
43
|
"@types/node": "^16.18.111",
|
|
44
44
|
"cssnano": "^7.0.6",
|
|
45
|
+
"playwright": "1.58.2",
|
|
45
46
|
"postcss-calc": "^10.1.1",
|
|
46
47
|
"postcss-custom-properties": "^14.0.4",
|
|
47
48
|
"postcss-import": "^16.1.0",
|
|
48
49
|
"postcss-preset-env": "^10.1.5",
|
|
49
|
-
"playwright": "1.58.2",
|
|
50
50
|
"rollup": "^2.79.2",
|
|
51
51
|
"rollup-plugin-delete": "^2.1.0",
|
|
52
52
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"storybook": "^8.6.14",
|
|
58
58
|
"ts-loader": "^9.5.4",
|
|
59
59
|
"tslib": "^2.8.1",
|
|
60
|
-
"typescript": "^5.0.0"
|
|
60
|
+
"typescript": "^5.0.0",
|
|
61
|
+
"vitest": "^2.1.9"
|
|
61
62
|
},
|
|
62
63
|
"browserslist": {
|
|
63
64
|
"production": [
|
package/src/styles/base.css
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
font-family: inherit;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
input {
|
|
89
|
+
.simple-table-root input {
|
|
90
90
|
color: black;
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -206,7 +206,7 @@ input {
|
|
|
206
206
|
display: block;
|
|
207
207
|
/* `*` does not target ::after; border-box keeps the bottom border inside the flex line. */
|
|
208
208
|
box-sizing: border-box;
|
|
209
|
-
width: var(--st-after-width,
|
|
209
|
+
width: var(--st-after-width, 11.01px);
|
|
210
210
|
flex-shrink: 0;
|
|
211
211
|
background-color: var(--st-header-background-color);
|
|
212
212
|
border-bottom: var(--st-border-width) solid var(--st-border-color);
|
|
@@ -218,11 +218,6 @@ input {
|
|
|
218
218
|
border-bottom: var(--st-border-width) solid var(--st-border-color);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
.st-header-grid {
|
|
222
|
-
position: relative;
|
|
223
|
-
min-width: 100%;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
221
|
.st-horizontal-scrollbar-middle,
|
|
227
222
|
.st-horizontal-scrollbar-left,
|
|
228
223
|
.st-horizontal-scrollbar-right,
|
|
@@ -373,12 +368,6 @@ input {
|
|
|
373
368
|
background-color: var(--st-selected-row-background-color);
|
|
374
369
|
}
|
|
375
370
|
|
|
376
|
-
.st-sticky-top
|
|
377
|
-
.st-row.hovered:not(.st-cell-editing):not(.st-cell-column-selected):not(
|
|
378
|
-
.st-cell-column-selected-last
|
|
379
|
-
):not(.st-cell-column-selected-first) {
|
|
380
|
-
background-color: var(--st-hover-row-background-color);
|
|
381
|
-
}
|
|
382
371
|
.st-row.hovered .st-cell-editing,
|
|
383
372
|
.st-row.hovered
|
|
384
373
|
.st-cell:not(.st-cell-selected):not(.st-cell-selected-first):not(.st-cell-column-selected):not(
|
|
@@ -497,9 +486,6 @@ input {
|
|
|
497
486
|
.st-header-cell.st-header-editable {
|
|
498
487
|
cursor: pointer;
|
|
499
488
|
}
|
|
500
|
-
.st-header-cell.draggable {
|
|
501
|
-
cursor: grab;
|
|
502
|
-
}
|
|
503
489
|
.st-header-cell.st-header-selected {
|
|
504
490
|
background-color: var(--st-header-selected-background-color);
|
|
505
491
|
}
|
|
@@ -727,10 +713,6 @@ input {
|
|
|
727
713
|
outline-offset: 2px;
|
|
728
714
|
}
|
|
729
715
|
|
|
730
|
-
.st-collapse-icon-container {
|
|
731
|
-
cursor: pointer;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
716
|
.st-expand-icon {
|
|
735
717
|
cursor: pointer;
|
|
736
718
|
color: var(--st-header-label-color);
|
|
@@ -774,6 +756,40 @@ input {
|
|
|
774
756
|
.st-dragging.st-sub-header {
|
|
775
757
|
background-color: var(--st-dragging-sub-header-background-color);
|
|
776
758
|
}
|
|
759
|
+
/* Keep the dragged header above neighbors while they slide past (DOM order
|
|
760
|
+
would otherwise flip who paints on top mid-animation). */
|
|
761
|
+
.st-header-cell.st-dragging {
|
|
762
|
+
z-index: 2;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/*
|
|
766
|
+
* Column-drag / FLIP pass-through paint.
|
|
767
|
+
*
|
|
768
|
+
* Body cells use `background-color: transparent` so a shared row fill shows
|
|
769
|
+
* through — when two cells slide past each other you see labels overlap, not
|
|
770
|
+
* opaque rectangles stacking. Neighboring headers do the same during reorder
|
|
771
|
+
* (the header strip already paints `--st-header-background-color`).
|
|
772
|
+
* `.st-flip-active` covers slides that continue after dragend.
|
|
773
|
+
*
|
|
774
|
+
* The dragged header keeps `--st-dragging-background-color` (see below) so the
|
|
775
|
+
* active column stays visually marked.
|
|
776
|
+
*/
|
|
777
|
+
.simple-table-root.st-column-reordering .st-header-cell,
|
|
778
|
+
.simple-table-root.st-column-reordering .st-header-cell.st-sub-header,
|
|
779
|
+
.st-header-cell.st-flip-active,
|
|
780
|
+
.st-header-cell.st-flip-active.st-sub-header {
|
|
781
|
+
background-color: transparent;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/* Dragged header fill wins over the pass-through rule above. */
|
|
785
|
+
.simple-table-root.st-column-reordering .st-header-cell.st-dragging:not(.st-sub-header),
|
|
786
|
+
.st-header-cell.st-flip-active.st-dragging:not(.st-sub-header) {
|
|
787
|
+
background-color: var(--st-dragging-background-color);
|
|
788
|
+
}
|
|
789
|
+
.simple-table-root.st-column-reordering .st-header-cell.st-dragging.st-sub-header,
|
|
790
|
+
.st-header-cell.st-flip-active.st-dragging.st-sub-header {
|
|
791
|
+
background-color: var(--st-dragging-sub-header-background-color);
|
|
792
|
+
}
|
|
777
793
|
|
|
778
794
|
/* Loading skeleton styles */
|
|
779
795
|
.st-loading-skeleton {
|
|
@@ -1153,6 +1169,8 @@ input {
|
|
|
1153
1169
|
touch-action: auto;
|
|
1154
1170
|
border-left: var(--st-border-width) solid var(--st-border-color);
|
|
1155
1171
|
height: 100%;
|
|
1172
|
+
min-height: 0;
|
|
1173
|
+
overflow: hidden;
|
|
1156
1174
|
}
|
|
1157
1175
|
|
|
1158
1176
|
/* Column Editor Search Wrapper */
|
|
@@ -1164,10 +1182,6 @@ input {
|
|
|
1164
1182
|
padding: var(--st-spacing-medium);
|
|
1165
1183
|
}
|
|
1166
1184
|
|
|
1167
|
-
/* Column Editor Search Styles */
|
|
1168
|
-
.st-column-editor-search {
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
1185
|
/* Column Editor List */
|
|
1172
1186
|
.st-column-editor-list {
|
|
1173
1187
|
display: flex;
|
|
@@ -1194,6 +1208,108 @@ input {
|
|
|
1194
1208
|
padding: var(--st-spacing-small) var(--st-spacing-medium) 0;
|
|
1195
1209
|
}
|
|
1196
1210
|
|
|
1211
|
+
/* Pivot panel — fill popout height and scroll when zones overflow */
|
|
1212
|
+
.st-pivot-panel {
|
|
1213
|
+
flex: 1 1 auto;
|
|
1214
|
+
min-height: 0;
|
|
1215
|
+
overflow: auto;
|
|
1216
|
+
-webkit-overflow-scrolling: touch;
|
|
1217
|
+
color: var(--st-column-editor-text-color);
|
|
1218
|
+
font-size: var(--st-overlay-font-size);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.st-pivot-panel-zone + .st-pivot-panel-zone {
|
|
1222
|
+
border-top: var(--st-border-width) solid var(--st-border-color);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.st-pivot-panel-zone-title {
|
|
1226
|
+
font-size: var(--st-overlay-font-size);
|
|
1227
|
+
font-weight: 600;
|
|
1228
|
+
color: var(--st-column-editor-text-color);
|
|
1229
|
+
padding: var(--st-spacing-medium) var(--st-spacing-medium) var(--st-spacing-small);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
.st-pivot-panel-zone-list {
|
|
1233
|
+
padding-top: 0;
|
|
1234
|
+
padding-bottom: var(--st-spacing-medium);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
.st-pivot-panel-zone-empty {
|
|
1238
|
+
padding-top: var(--st-spacing-small);
|
|
1239
|
+
font-size: var(--st-overlay-font-size);
|
|
1240
|
+
color: var(--st-column-editor-text-color);
|
|
1241
|
+
opacity: 0.55;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
.st-pivot-panel-field,
|
|
1245
|
+
.st-pivot-panel-chip {
|
|
1246
|
+
display: flex;
|
|
1247
|
+
align-items: center;
|
|
1248
|
+
gap: var(--st-spacing-small);
|
|
1249
|
+
padding-top: var(--st-spacing-small);
|
|
1250
|
+
padding-bottom: var(--st-spacing-small);
|
|
1251
|
+
color: var(--st-column-editor-text-color);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.st-pivot-panel-field-label,
|
|
1255
|
+
.st-pivot-panel-chip-label {
|
|
1256
|
+
flex: 1;
|
|
1257
|
+
min-width: 0;
|
|
1258
|
+
font-size: var(--st-overlay-font-size);
|
|
1259
|
+
overflow: hidden;
|
|
1260
|
+
text-overflow: ellipsis;
|
|
1261
|
+
white-space: nowrap;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
.st-pivot-panel-field-actions {
|
|
1265
|
+
display: flex;
|
|
1266
|
+
gap: var(--st-spacing-small);
|
|
1267
|
+
flex-shrink: 0;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.st-pivot-panel-action {
|
|
1271
|
+
padding: var(--st-spacing-small) var(--st-spacing-medium);
|
|
1272
|
+
font-size: var(--st-overlay-font-size);
|
|
1273
|
+
font-weight: 500;
|
|
1274
|
+
line-height: 1.2;
|
|
1275
|
+
color: var(--st-column-editor-text-color);
|
|
1276
|
+
background: transparent;
|
|
1277
|
+
border: var(--st-border-width) solid var(--st-border-color);
|
|
1278
|
+
border-radius: var(--st-border-radius);
|
|
1279
|
+
cursor: pointer;
|
|
1280
|
+
transition: background-color var(--st-transition-duration) var(--st-transition-ease);
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.st-pivot-panel-action:hover {
|
|
1284
|
+
background-color: var(--st-button-hover-background-color);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.st-pivot-panel-remove {
|
|
1288
|
+
flex-shrink: 0;
|
|
1289
|
+
color: var(--st-column-editor-text-color);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
/* Aggregation select — same size tokens as filter CustomSelect */
|
|
1293
|
+
.st-pivot-panel-agg {
|
|
1294
|
+
width: auto;
|
|
1295
|
+
min-width: 6.5rem;
|
|
1296
|
+
max-width: 9rem;
|
|
1297
|
+
flex-shrink: 0;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
.st-pivot-panel-agg .st-custom-select-trigger {
|
|
1301
|
+
background-color: transparent;
|
|
1302
|
+
color: var(--st-column-editor-text-color);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
.st-pivot-panel-agg .st-custom-select-value {
|
|
1306
|
+
color: var(--st-column-editor-text-color);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
.st-pivot-panel-agg .st-custom-select-arrow {
|
|
1310
|
+
color: var(--st-column-editor-text-color);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1197
1313
|
.st-column-editor-list-section {
|
|
1198
1314
|
padding-top: 0;
|
|
1199
1315
|
padding-bottom: var(--st-spacing-small);
|
|
@@ -1242,12 +1358,6 @@ input {
|
|
|
1242
1358
|
background: color-mix(in srgb, var(--st-column-editor-text-color) 12%, transparent);
|
|
1243
1359
|
}
|
|
1244
1360
|
|
|
1245
|
-
.st-column-pin-pinned-mark {
|
|
1246
|
-
display: flex;
|
|
1247
|
-
align-items: center;
|
|
1248
|
-
justify-content: center;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
1361
|
/* Pinned left/right: same surface as .st-column-pin-btn:hover */
|
|
1252
1362
|
.st-column-pin-pinned-active {
|
|
1253
1363
|
background: color-mix(in srgb, var(--st-column-editor-text-color) 12%, transparent);
|
|
@@ -1391,11 +1501,6 @@ input {
|
|
|
1391
1501
|
align-items: center;
|
|
1392
1502
|
}
|
|
1393
1503
|
|
|
1394
|
-
.st-nested-headers {
|
|
1395
|
-
display: flex;
|
|
1396
|
-
flex-direction: column;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
1504
|
.st-column-editor-popout.open {
|
|
1400
1505
|
min-width: 240px;
|
|
1401
1506
|
width: auto;
|
|
@@ -1462,77 +1567,6 @@ input {
|
|
|
1462
1567
|
color: var(--st-button-active-text-color);
|
|
1463
1568
|
}
|
|
1464
1569
|
|
|
1465
|
-
@keyframes slide-in-left {
|
|
1466
|
-
from {
|
|
1467
|
-
transform: translateX(-100%);
|
|
1468
|
-
}
|
|
1469
|
-
to {
|
|
1470
|
-
transform: translateX(0);
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
@keyframes slide-in-right {
|
|
1475
|
-
from {
|
|
1476
|
-
transform: translateX(100%);
|
|
1477
|
-
}
|
|
1478
|
-
to {
|
|
1479
|
-
transform: translateX(0);
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
/* Group Header Styles */
|
|
1484
|
-
.st-group-header {
|
|
1485
|
-
background-color: var(--st-header-background-color);
|
|
1486
|
-
cursor: pointer;
|
|
1487
|
-
user-select: none;
|
|
1488
|
-
height: 40px;
|
|
1489
|
-
display: flex;
|
|
1490
|
-
align-items: center;
|
|
1491
|
-
border-bottom: var(--st-border-width) solid var(--st-border-color);
|
|
1492
|
-
color: var(--st-cell-color);
|
|
1493
|
-
font-weight: 500;
|
|
1494
|
-
transition: background-color var(--st-transition-duration) var(--st-transition-ease);
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
.st-group-header:hover {
|
|
1498
|
-
background-color: var(--st-button-hover-background-color);
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
.st-group-header-content {
|
|
1502
|
-
display: flex;
|
|
1503
|
-
align-items: center;
|
|
1504
|
-
gap: var(--st-spacing-medium);
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
.st-group-toggle-icon {
|
|
1508
|
-
font-size: 0.8em;
|
|
1509
|
-
width: 16px;
|
|
1510
|
-
height: 16px;
|
|
1511
|
-
display: flex;
|
|
1512
|
-
align-items: center;
|
|
1513
|
-
justify-content: center;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
.st-group-name {
|
|
1517
|
-
font-weight: 600;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
.st-group-count {
|
|
1521
|
-
color: var(--st-cell-odd-row-color);
|
|
1522
|
-
font-size: 0.9em;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
/* Animation for expand/collapse */
|
|
1526
|
-
.st-group-header.expanded .st-group-toggle-icon {
|
|
1527
|
-
transform: rotate(0deg);
|
|
1528
|
-
transition: transform var(--st-transition-duration) var(--st-transition-ease);
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
.st-group-header.collapsed .st-group-toggle-icon {
|
|
1532
|
-
transform: rotate(-90deg);
|
|
1533
|
-
transition: transform var(--st-transition-duration) var(--st-transition-ease);
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
1570
|
/* Row expand icon animation */
|
|
1537
1571
|
.st-expand-icon-container {
|
|
1538
1572
|
transition: transform var(--st-transition-duration) var(--st-transition-ease);
|
|
@@ -1718,12 +1752,6 @@ input {
|
|
|
1718
1752
|
color: var(--st-selected-cell-color);
|
|
1719
1753
|
}
|
|
1720
1754
|
|
|
1721
|
-
.st-dropdown-divider {
|
|
1722
|
-
height: 1px;
|
|
1723
|
-
margin: 4px 0;
|
|
1724
|
-
background-color: var(--st-border-color);
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
1755
|
/* Datepicker css */
|
|
1728
1756
|
|
|
1729
1757
|
.st-datepicker {
|
|
@@ -1933,25 +1961,6 @@ input {
|
|
|
1933
1961
|
margin-bottom: var(--st-spacing-medium);
|
|
1934
1962
|
}
|
|
1935
1963
|
|
|
1936
|
-
/* Filter Select - Dropdown selectors */
|
|
1937
|
-
.st-filter-select {
|
|
1938
|
-
width: 100%;
|
|
1939
|
-
padding: var(--st-control-padding-y) var(--st-control-padding-x);
|
|
1940
|
-
border: var(--st-border-width) solid var(--st-border-color);
|
|
1941
|
-
border-radius: var(--st-border-radius);
|
|
1942
|
-
font-size: var(--st-overlay-font-size);
|
|
1943
|
-
background-color: var(--st-odd-row-background-color);
|
|
1944
|
-
color: var(--st-cell-color);
|
|
1945
|
-
font-family: inherit;
|
|
1946
|
-
cursor: pointer;
|
|
1947
|
-
outline: none;
|
|
1948
|
-
transition: border-color var(--st-transition-duration) var(--st-transition-ease);
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
.st-filter-select:focus {
|
|
1952
|
-
border-color: var(--st-editable-cell-focus-border-color);
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
1964
|
/* Filter Actions - Button container and buttons */
|
|
1956
1965
|
.st-filter-actions {
|
|
1957
1966
|
display: flex;
|
|
@@ -2178,14 +2187,6 @@ input {
|
|
|
2178
2187
|
font-style: italic;
|
|
2179
2188
|
}
|
|
2180
2189
|
|
|
2181
|
-
/* Row number styling */
|
|
2182
|
-
.st-row-number {
|
|
2183
|
-
font-size: 0.8em;
|
|
2184
|
-
opacity: 0.6;
|
|
2185
|
-
user-select: none;
|
|
2186
|
-
font-weight: 500;
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
2190
|
/* Selection cell with row buttons layout */
|
|
2190
2191
|
.st-selection-cell-content {
|
|
2191
2192
|
display: flex;
|
|
@@ -2261,6 +2262,10 @@ input {
|
|
|
2261
2262
|
animation: st-tooltip-fade-in 0.2s ease-out;
|
|
2262
2263
|
}
|
|
2263
2264
|
|
|
2265
|
+
.simple-table-root.st-column-reordering .st-tooltip {
|
|
2266
|
+
display: none;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2264
2269
|
@keyframes st-tooltip-fade-in {
|
|
2265
2270
|
from {
|
|
2266
2271
|
opacity: 0;
|
|
@@ -2283,14 +2288,6 @@ input {
|
|
|
2283
2288
|
width: 100%;
|
|
2284
2289
|
}
|
|
2285
2290
|
|
|
2286
|
-
/* Empty spacer for pinned sections when state row is shown */
|
|
2287
|
-
.st-row.st-state-row-spacer {
|
|
2288
|
-
display: block;
|
|
2289
|
-
position: absolute;
|
|
2290
|
-
width: 100%;
|
|
2291
|
-
background-color: transparent;
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
2291
|
/* The cell within state row that spans full width */
|
|
2295
2292
|
.st-state-row-cell {
|
|
2296
2293
|
grid-column: 1 / -1;
|