simple-table-core 3.9.9 → 4.0.0
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/src/core/SimpleTableVanilla.d.ts +8 -0
- package/dist/cjs/src/core/api/TableAPIImpl.d.ts +7 -1
- package/dist/cjs/src/index.d.ts +5 -1
- package/dist/cjs/src/managers/PivotManager.d.ts +35 -0
- package/dist/cjs/src/types/GetRowId.d.ts +7 -1
- package/dist/cjs/src/types/PivotTypes.d.ts +37 -0
- package/dist/cjs/src/types/SimpleTableConfig.d.ts +5 -0
- package/dist/cjs/src/types/SimpleTableProps.d.ts +8 -0
- package/dist/cjs/src/types/TableAPI.d.ts +8 -0
- package/dist/cjs/src/utils/aggregationUtils.d.ts +7 -0
- package/dist/cjs/src/utils/pivot/pivotRows.d.ts +16 -0
- package/dist/cjs/src/utils/propSyncEqual.d.ts +3 -8
- package/dist/cjs/stories/docs/Features.stories.d.ts +1 -0
- package/dist/cjs/stories/docs/storyArgs.d.ts +1 -0
- package/dist/cjs/stories/examples/PivotExample.d.ts +16 -0
- package/dist/cjs/stories/tests/45-PivotTests.stories.d.ts +8 -0
- package/dist/cjs/stories/vanillaStoryConfig.d.ts +3 -1
- package/dist/index.es.js +1 -1
- package/dist/src/core/SimpleTableVanilla.d.ts +8 -0
- package/dist/src/core/api/TableAPIImpl.d.ts +7 -1
- package/dist/src/index.d.ts +5 -1
- package/dist/src/managers/PivotManager.d.ts +35 -0
- package/dist/src/types/GetRowId.d.ts +7 -1
- package/dist/src/types/PivotTypes.d.ts +37 -0
- package/dist/src/types/SimpleTableConfig.d.ts +5 -0
- package/dist/src/types/SimpleTableProps.d.ts +8 -0
- package/dist/src/types/TableAPI.d.ts +8 -0
- package/dist/src/utils/aggregationUtils.d.ts +7 -0
- package/dist/src/utils/pivot/pivotRows.d.ts +16 -0
- package/dist/src/utils/propSyncEqual.d.ts +3 -8
- package/dist/stories/docs/Features.stories.d.ts +1 -0
- package/dist/stories/docs/storyArgs.d.ts +1 -0
- package/dist/stories/examples/PivotExample.d.ts +16 -0
- package/dist/stories/tests/45-PivotTests.stories.d.ts +8 -0
- package/dist/stories/vanillaStoryConfig.d.ts +3 -1
- package/package.json +1 -1
|
@@ -83,6 +83,7 @@ export declare class SimpleTableVanilla {
|
|
|
83
83
|
private sectionScrollController;
|
|
84
84
|
private sortManager;
|
|
85
85
|
private filterManager;
|
|
86
|
+
private pivotManager;
|
|
86
87
|
private selectionManager;
|
|
87
88
|
private rowSelectionManager;
|
|
88
89
|
private windowResizeManager;
|
|
@@ -290,6 +291,13 @@ export declare class SimpleTableVanilla {
|
|
|
290
291
|
private handleScroll;
|
|
291
292
|
private clearHoveredRows;
|
|
292
293
|
private updateAriaLiveRegion;
|
|
294
|
+
/** Row grouping used for flatten/expand while pivot is active (overrides consumer). */
|
|
295
|
+
private getEffectiveRowGrouping;
|
|
296
|
+
/**
|
|
297
|
+
* Recompute pivot from filtered source rows and feed sort/selection managers.
|
|
298
|
+
* When pivot is inactive, sort sees the filtered source rows directly.
|
|
299
|
+
*/
|
|
300
|
+
private syncPivotPipeline;
|
|
293
301
|
private getRenderContext;
|
|
294
302
|
private getRenderState;
|
|
295
303
|
/** A leaf column that should size to content (declared with width:"auto"). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TableAPI } from "../../types/TableAPI";
|
|
2
2
|
import { SimpleTableConfig } from "../../types/SimpleTableConfig";
|
|
3
|
-
import HeaderObject from "../../types/HeaderObject";
|
|
3
|
+
import HeaderObject, { Accessor } from "../../types/HeaderObject";
|
|
4
4
|
import Row from "../../types/Row";
|
|
5
5
|
import { CustomTheme } from "../../types/CustomTheme";
|
|
6
6
|
import RowState from "../../types/RowState";
|
|
@@ -10,6 +10,7 @@ import { SortManager } from "../../managers/SortManager";
|
|
|
10
10
|
import { FilterManager } from "../../managers/FilterManager";
|
|
11
11
|
import { FlattenRowsResult } from "../../utils/rowFlattening";
|
|
12
12
|
import { ProcessRowsResult } from "../../utils/rowProcessing";
|
|
13
|
+
import type { PivotConfig } from "../../types/PivotTypes";
|
|
13
14
|
export interface TableAPIContext {
|
|
14
15
|
config: SimpleTableConfig;
|
|
15
16
|
localRows: Row[];
|
|
@@ -66,6 +67,11 @@ export interface TableAPIContext {
|
|
|
66
67
|
setHeaders: (headers: HeaderObject[]) => void;
|
|
67
68
|
setCurrentPage: (page: number) => void;
|
|
68
69
|
setColumnEditorOpen: (open: boolean) => void;
|
|
70
|
+
getEffectiveRowGrouping: () => Accessor[] | undefined;
|
|
71
|
+
setPivot: (config: PivotConfig | null) => void;
|
|
72
|
+
getPivot: () => PivotConfig | null;
|
|
73
|
+
getPivotHeaders: () => HeaderObject[];
|
|
74
|
+
getPivotedRows: () => Row[];
|
|
69
75
|
}
|
|
70
76
|
export declare class TableAPIImpl {
|
|
71
77
|
static createAPI(context: TableAPIContext): TableAPI;
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import type EnumOption from "./types/EnumOption";
|
|
|
8
8
|
import type HeaderObject from "./types/HeaderObject";
|
|
9
9
|
import type { Accessor, ChartOptions, ColumnType, Comparator, ComparatorProps, ExportValueGetter, ExportValueProps, ShowWhen, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps } from "./types/HeaderObject";
|
|
10
10
|
import type { AggregationConfig, AggregationType } from "./types/AggregationTypes";
|
|
11
|
+
import type { PivotConfig, PivotValueConfig, PivotResult } from "./types/PivotTypes";
|
|
12
|
+
import { PIVOT_CHILDREN_KEY, PIVOT_IS_TOTAL_KEY, PIVOT_ACCESSOR_PREFIX, PIVOT_BLANK_LABEL } from "./types/PivotTypes";
|
|
13
|
+
import { pivotRows, buildPivotAccessor, buildPivotRowTotalAccessor } from "./utils/pivot/pivotRows";
|
|
11
14
|
import type OnSortProps from "./types/OnSortProps";
|
|
12
15
|
import type OnRowGroupExpandProps from "./types/OnRowGroupExpandProps";
|
|
13
16
|
import type Row from "./types/Row";
|
|
@@ -49,6 +52,7 @@ import type { RowId } from "./types/RowId";
|
|
|
49
52
|
import type { PinnedSectionsState } from "./types/PinnedSectionsState";
|
|
50
53
|
export { SimpleTableVanilla };
|
|
51
54
|
export { asRows } from "./utils/asRows";
|
|
55
|
+
export { pivotRows, buildPivotAccessor, buildPivotRowTotalAccessor, PIVOT_CHILDREN_KEY, PIVOT_IS_TOTAL_KEY, PIVOT_ACCESSOR_PREFIX, PIVOT_BLANK_LABEL, };
|
|
52
56
|
export { headersStructurallyEqual, collectHeaderAccessors, rowsShallowUnchanged, shallowEqualRow, SHALLOW_ROW_COMPARE_MAX, } from "./utils/propSyncEqual";
|
|
53
57
|
export type { HeaderStructureLike, GetRowIdLike } from "./utils/propSyncEqual";
|
|
54
|
-
export type { Accessor, AggregationConfig, AggregationType, AnimationsConfig, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FilterOperator, StringFilterOperator, NumberFilterOperator, BooleanFilterOperator, DateFilterOperator, EnumFilterOperator, FooterRendererProps, FooterPosition, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowId, RowSelectionChangeProps, RowSelectionMode, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SimpleTableConfig, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableHeaderProps, TableRowProps, Theme, PinnedSectionsState, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
|
|
58
|
+
export type { Accessor, AggregationConfig, AggregationType, AnimationsConfig, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FilterOperator, StringFilterOperator, NumberFilterOperator, BooleanFilterOperator, DateFilterOperator, EnumFilterOperator, FooterRendererProps, FooterPosition, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, PivotConfig, PivotValueConfig, PivotResult, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowId, RowSelectionChangeProps, RowSelectionMode, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SimpleTableConfig, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableHeaderProps, TableRowProps, Theme, PinnedSectionsState, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type HeaderObject from "../types/HeaderObject";
|
|
2
|
+
import type { Accessor } from "../types/HeaderObject";
|
|
3
|
+
import type Row from "../types/Row";
|
|
4
|
+
import type { PivotConfig } from "../types/PivotTypes";
|
|
5
|
+
export interface PivotManagerConfig {
|
|
6
|
+
sourceRows: Row[];
|
|
7
|
+
fieldHeaders: HeaderObject[];
|
|
8
|
+
pivot: PivotConfig | null;
|
|
9
|
+
}
|
|
10
|
+
export interface PivotManagerState {
|
|
11
|
+
active: boolean;
|
|
12
|
+
pivotedRows: Row[];
|
|
13
|
+
headers: HeaderObject[];
|
|
14
|
+
rowGrouping?: Accessor[];
|
|
15
|
+
pivot: PivotConfig | null;
|
|
16
|
+
}
|
|
17
|
+
type StateChangeCallback = (state: PivotManagerState) => void;
|
|
18
|
+
export declare class PivotManager {
|
|
19
|
+
private config;
|
|
20
|
+
private state;
|
|
21
|
+
private subscribers;
|
|
22
|
+
private cacheKey;
|
|
23
|
+
constructor(config: PivotManagerConfig);
|
|
24
|
+
private buildCacheKey;
|
|
25
|
+
private computeState;
|
|
26
|
+
getState(): PivotManagerState;
|
|
27
|
+
isActive(): boolean;
|
|
28
|
+
getPivot(): PivotConfig | null;
|
|
29
|
+
updateConfig(partial: Partial<PivotManagerConfig>): void;
|
|
30
|
+
setPivot(pivot: PivotConfig | null): void;
|
|
31
|
+
subscribe(callback: StateChangeCallback): () => void;
|
|
32
|
+
private notifySubscribers;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -7,4 +7,10 @@ export interface GetRowIdParams {
|
|
|
7
7
|
rowIndexPath: number[];
|
|
8
8
|
groupingKey?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Return a stable business id for the row, or `undefined` / `null` when the row
|
|
12
|
+
* has no id yet (e.g. loading placeholders, pivot aggregates). Nullish returns
|
|
13
|
+
* fall back to reference-based identity so cell keys never collide on
|
|
14
|
+
* `String(undefined)`.
|
|
15
|
+
*/
|
|
16
|
+
export type GetRowId = (params: GetRowIdParams) => string | number | null | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Accessor } from "./HeaderObject";
|
|
2
|
+
import { AggregationConfig } from "./AggregationTypes";
|
|
3
|
+
import HeaderObject from "./HeaderObject";
|
|
4
|
+
import Row from "./Row";
|
|
5
|
+
export type PivotValueConfig = {
|
|
6
|
+
accessor: Accessor;
|
|
7
|
+
aggregation: AggregationConfig;
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PivotConfig = {
|
|
11
|
+
/** Row dimension accessors (0+). Multi-level dims become an expandable tree. */
|
|
12
|
+
rows: Accessor[];
|
|
13
|
+
/** Column dimension accessors (0+). Distinct values become dynamic header groups. */
|
|
14
|
+
columns: Accessor[];
|
|
15
|
+
/** Value/measure configs (required, length >= 1). */
|
|
16
|
+
values: PivotValueConfig[];
|
|
17
|
+
/** Total column(s) aggregating across column dimensions. Default true. */
|
|
18
|
+
showRowTotals?: boolean;
|
|
19
|
+
/** Total row aggregating across row dimensions. Default true. */
|
|
20
|
+
showColumnTotals?: boolean;
|
|
21
|
+
/** Grand-total cell(s) on the totals row/column. Default true. */
|
|
22
|
+
showGrandTotal?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Synthetic child-array key used for multi-level pivot row trees. */
|
|
25
|
+
export declare const PIVOT_CHILDREN_KEY = "__pivotChildren";
|
|
26
|
+
/** Marker on total rows for styling / identification. */
|
|
27
|
+
export declare const PIVOT_IS_TOTAL_KEY = "__pivotIsTotal";
|
|
28
|
+
/** Prefix for generated pivot measure accessors. */
|
|
29
|
+
export declare const PIVOT_ACCESSOR_PREFIX = "__pivot:";
|
|
30
|
+
/** Label used when a dimension value is null/undefined. */
|
|
31
|
+
export declare const PIVOT_BLANK_LABEL = "(blank)";
|
|
32
|
+
export type PivotResult = {
|
|
33
|
+
rows: Row[];
|
|
34
|
+
headers: HeaderObject[];
|
|
35
|
+
/** Internal rowGrouping to use while pivot is active (undefined when flat). */
|
|
36
|
+
rowGrouping?: Accessor[];
|
|
37
|
+
};
|
|
@@ -21,6 +21,7 @@ import { VanillaIconsConfig } from "./IconsConfig";
|
|
|
21
21
|
import { QuickFilterConfig } from "./QuickFilterTypes";
|
|
22
22
|
import { AnimationsConfig } from "./AnimationsConfig";
|
|
23
23
|
import type { FooterPosition } from "./FooterPosition";
|
|
24
|
+
import type { PivotConfig } from "./PivotTypes";
|
|
24
25
|
export interface SimpleTableConfig {
|
|
25
26
|
animations?: AnimationsConfig;
|
|
26
27
|
/**
|
|
@@ -99,6 +100,10 @@ export interface SimpleTableConfig {
|
|
|
99
100
|
*/
|
|
100
101
|
onRendererHostDiscard?: (host: HTMLElement) => void;
|
|
101
102
|
onSortChange?: (sort: SortColumn | null) => void;
|
|
103
|
+
/** @see SimpleTableProps.pivot */
|
|
104
|
+
pivot?: PivotConfig | null;
|
|
105
|
+
/** @see SimpleTableProps.onPivotChange */
|
|
106
|
+
onPivotChange?: (pivot: PivotConfig | null) => void;
|
|
102
107
|
quickFilter?: QuickFilterConfig;
|
|
103
108
|
rowButtons?: RowButton[];
|
|
104
109
|
rowGrouping?: Accessor[];
|
|
@@ -21,6 +21,7 @@ import { IconsConfig } from "./IconsConfig";
|
|
|
21
21
|
import { QuickFilterConfig } from "./QuickFilterTypes";
|
|
22
22
|
import { AnimationsConfig } from "./AnimationsConfig";
|
|
23
23
|
import type { FooterPosition } from "./FooterPosition";
|
|
24
|
+
import type { PivotConfig } from "./PivotTypes";
|
|
24
25
|
export interface SimpleTableProps {
|
|
25
26
|
animations?: AnimationsConfig;
|
|
26
27
|
autoExpandColumns?: boolean;
|
|
@@ -97,6 +98,13 @@ export interface SimpleTableProps {
|
|
|
97
98
|
onRowGroupExpand?: (props: OnRowGroupExpandProps) => void | Promise<void>;
|
|
98
99
|
onRowSelectionChange?: (props: RowSelectionChangeProps) => void;
|
|
99
100
|
onSortChange?: (sort: SortColumn | null) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Declarative matrix pivot. When set, flat `rows` are reshaped into a
|
|
103
|
+
* pivoted grid with dynamic columns. Ignores consumer `rowGrouping` while active.
|
|
104
|
+
*/
|
|
105
|
+
pivot?: PivotConfig | null;
|
|
106
|
+
/** Fired when pivot config changes via TableAPI.setPivot. */
|
|
107
|
+
onPivotChange?: (pivot: PivotConfig | null) => void;
|
|
100
108
|
quickFilter?: QuickFilterConfig;
|
|
101
109
|
rowButtons?: RowButton[];
|
|
102
110
|
rowGrouping?: Accessor[];
|
|
@@ -6,6 +6,7 @@ import SortColumn, { SortDirection } from "./SortColumn";
|
|
|
6
6
|
import { TableFilterState, FilterCondition } from "./FilterTypes";
|
|
7
7
|
import Cell from "./Cell";
|
|
8
8
|
import type { PinnedSectionsState } from "./PinnedSectionsState";
|
|
9
|
+
import type { PivotConfig } from "./PivotTypes";
|
|
9
10
|
export interface SetHeaderRenameProps {
|
|
10
11
|
accessor: Accessor;
|
|
11
12
|
}
|
|
@@ -71,4 +72,11 @@ export type TableAPI = {
|
|
|
71
72
|
toggleRowSelection: (rowId: string) => void;
|
|
72
73
|
/** Clears row selection only (does not clear cell selection). */
|
|
73
74
|
clearRowSelection: () => void;
|
|
75
|
+
/** Enable, update, or clear matrix pivot (`null` disables). */
|
|
76
|
+
setPivot: (config: PivotConfig | null) => void;
|
|
77
|
+
getPivot: () => PivotConfig | null;
|
|
78
|
+
/** Generated headers while pivot is active; otherwise current headers. */
|
|
79
|
+
getPivotHeaders: () => HeaderObject[];
|
|
80
|
+
/** Post-pivot rows (pre-flatten) while pivot is active; otherwise source rows. */
|
|
81
|
+
getPivotedRows: () => Row[];
|
|
74
82
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type CellValue from "../types/CellValue";
|
|
2
|
+
import type { AggregationConfig } from "../types/AggregationTypes";
|
|
3
|
+
/**
|
|
4
|
+
* Aggregate a flat list of cell values using the given AggregationConfig.
|
|
5
|
+
* Shared by row-grouping rollups and matrix pivot.
|
|
6
|
+
*/
|
|
7
|
+
export declare const aggregateValues: (allValues: CellValue[], config: AggregationConfig) => number | string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type HeaderObject from "../../types/HeaderObject";
|
|
2
|
+
import type { Accessor } from "../../types/HeaderObject";
|
|
3
|
+
import type Row from "../../types/Row";
|
|
4
|
+
import type { PivotConfig, PivotResult } from "../../types/PivotTypes";
|
|
5
|
+
export type PivotRowsProps = {
|
|
6
|
+
rows: Row[];
|
|
7
|
+
pivot: PivotConfig;
|
|
8
|
+
/** Field catalog (`defaultHeaders`) for labels, types, widths, formatters. */
|
|
9
|
+
fieldHeaders: HeaderObject[];
|
|
10
|
+
};
|
|
11
|
+
export declare const buildPivotAccessor: (colKey: string, valueAccessor: Accessor) => string;
|
|
12
|
+
export declare const buildPivotRowTotalAccessor: (valueAccessor: Accessor) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Pure transform: flat source rows + pivot config → pivoted rows and generated headers.
|
|
15
|
+
*/
|
|
16
|
+
export declare const pivotRows: ({ rows, pivot, fieldHeaders }: PivotRowsProps) => PivotResult;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Used to skip no-op `defaultHeaders` / `rows` updates when consumers rebuild
|
|
4
4
|
* column configs or shallow-clone rows every render.
|
|
5
5
|
*/
|
|
6
|
+
import type { GetRowIdParams } from "../types/GetRowId";
|
|
6
7
|
/** Minimal header shape for structural comparison (renderers ignored). */
|
|
7
8
|
export type HeaderStructureLike = {
|
|
8
9
|
accessor: string | number | symbol;
|
|
@@ -43,14 +44,8 @@ export declare function collectHeaderAccessors(headers: ReadonlyArray<HeaderStru
|
|
|
43
44
|
* invisible — callers must pass new object identities when data changes.
|
|
44
45
|
*/
|
|
45
46
|
export declare function shallowEqualRow(a: object, b: object): boolean;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
depth?: number;
|
|
49
|
-
index?: number;
|
|
50
|
-
rowPath?: (string | number)[];
|
|
51
|
-
rowIndexPath?: number[];
|
|
52
|
-
groupingKey?: string;
|
|
53
|
-
}) => string | number | undefined;
|
|
47
|
+
/** Compatible with `GetRowId`; return may be undefined for sync helpers. */
|
|
48
|
+
export type GetRowIdLike = (params: GetRowIdParams) => string | number | undefined;
|
|
54
49
|
/**
|
|
55
50
|
* Above this length, skip per-field shallow compares when row object identity
|
|
56
51
|
* differs. Same-array-ref and same-row-object cases stay O(1) / O(n) pointer
|
|
@@ -38,6 +38,7 @@ export declare const NestedAccessor: StoryObj;
|
|
|
38
38
|
export declare const NestedGrid: StoryObj;
|
|
39
39
|
export declare const Pagination: StoryObj;
|
|
40
40
|
export declare const PaginationAPI: StoryObj;
|
|
41
|
+
export declare const Pivot: StoryObj;
|
|
41
42
|
export declare const PinnedColumns: StoryObj;
|
|
42
43
|
export declare const ProgrammaticFilter: StoryObj;
|
|
43
44
|
export declare const ProgrammaticSort: StoryObj;
|
|
@@ -16,6 +16,7 @@ export declare const storyArgs: (exampleDefaults?: Partial<UniversalVanillaArgs>
|
|
|
16
16
|
externalSortHandling?: boolean | undefined;
|
|
17
17
|
height?: string | undefined;
|
|
18
18
|
hideFooter?: boolean | undefined;
|
|
19
|
+
pivot?: import("../../src").PivotConfig | null | undefined;
|
|
19
20
|
rowsPerPage?: number | undefined;
|
|
20
21
|
selectableCells?: boolean | undefined;
|
|
21
22
|
selectableColumns?: boolean | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PivotExample – interactive playground for declarative matrix pivot.
|
|
3
|
+
*/
|
|
4
|
+
import type { PivotConfig } from "../../src/index";
|
|
5
|
+
import { type UniversalVanillaArgs } from "../vanillaStoryConfig";
|
|
6
|
+
export declare const pivotExampleDefaults: {
|
|
7
|
+
columnResizing: boolean;
|
|
8
|
+
height: string;
|
|
9
|
+
expandAll: boolean;
|
|
10
|
+
columnBorders: boolean;
|
|
11
|
+
pivot: PivotConfig | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Interactive pivot feature demo: configure rows / columns / values / totals live.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderPivotExample(args?: Partial<UniversalVanillaArgs>): HTMLElement;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Shared default args and argTypes for vanilla Docs & Examples stories.
|
|
3
3
|
* Mirrors the React StoryWrapper pattern so Controls (theme, height, etc.) are consistent.
|
|
4
4
|
*/
|
|
5
|
-
import type { Theme, CustomThemeProps } from "../src/index";
|
|
5
|
+
import type { Theme, CustomThemeProps, PivotConfig } from "../src/index";
|
|
6
6
|
export interface UniversalVanillaArgs {
|
|
7
7
|
autoExpandColumns?: boolean;
|
|
8
8
|
cellUpdateFlash?: boolean;
|
|
@@ -16,6 +16,8 @@ export interface UniversalVanillaArgs {
|
|
|
16
16
|
externalSortHandling?: boolean;
|
|
17
17
|
height?: string;
|
|
18
18
|
hideFooter?: boolean;
|
|
19
|
+
/** Declarative matrix pivot (passed through to SimpleTableConfig). */
|
|
20
|
+
pivot?: PivotConfig | null;
|
|
19
21
|
rowsPerPage?: number;
|
|
20
22
|
selectableCells?: boolean;
|
|
21
23
|
selectableColumns?: boolean;
|