simple-table-core 3.9.8 → 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.
Files changed (41) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/src/core/SimpleTableVanilla.d.ts +8 -0
  3. package/dist/cjs/src/core/api/TableAPIImpl.d.ts +7 -1
  4. package/dist/cjs/src/index.d.ts +5 -1
  5. package/dist/cjs/src/managers/PivotManager.d.ts +35 -0
  6. package/dist/cjs/src/types/GetRowId.d.ts +7 -1
  7. package/dist/cjs/src/types/PivotTypes.d.ts +37 -0
  8. package/dist/cjs/src/types/SimpleTableConfig.d.ts +7 -0
  9. package/dist/cjs/src/types/SimpleTableProps.d.ts +15 -0
  10. package/dist/cjs/src/types/TableAPI.d.ts +8 -0
  11. package/dist/cjs/src/utils/aggregationUtils.d.ts +7 -0
  12. package/dist/cjs/src/utils/bodyCell/types.d.ts +5 -0
  13. package/dist/cjs/src/utils/headerCell/types.d.ts +2 -0
  14. package/dist/cjs/src/utils/pivot/pivotRows.d.ts +16 -0
  15. package/dist/cjs/src/utils/propSyncEqual.d.ts +3 -8
  16. package/dist/cjs/stories/docs/Features.stories.d.ts +1 -0
  17. package/dist/cjs/stories/docs/storyArgs.d.ts +1 -0
  18. package/dist/cjs/stories/examples/PivotExample.d.ts +16 -0
  19. package/dist/cjs/stories/tests/45-PivotTests.stories.d.ts +8 -0
  20. package/dist/cjs/stories/vanillaStoryConfig.d.ts +3 -1
  21. package/dist/index.es.js +1 -1
  22. package/dist/src/core/SimpleTableVanilla.d.ts +8 -0
  23. package/dist/src/core/api/TableAPIImpl.d.ts +7 -1
  24. package/dist/src/index.d.ts +5 -1
  25. package/dist/src/managers/PivotManager.d.ts +35 -0
  26. package/dist/src/types/GetRowId.d.ts +7 -1
  27. package/dist/src/types/PivotTypes.d.ts +37 -0
  28. package/dist/src/types/SimpleTableConfig.d.ts +7 -0
  29. package/dist/src/types/SimpleTableProps.d.ts +15 -0
  30. package/dist/src/types/TableAPI.d.ts +8 -0
  31. package/dist/src/utils/aggregationUtils.d.ts +7 -0
  32. package/dist/src/utils/bodyCell/types.d.ts +5 -0
  33. package/dist/src/utils/headerCell/types.d.ts +2 -0
  34. package/dist/src/utils/pivot/pivotRows.d.ts +16 -0
  35. package/dist/src/utils/propSyncEqual.d.ts +3 -8
  36. package/dist/stories/docs/Features.stories.d.ts +1 -0
  37. package/dist/stories/docs/storyArgs.d.ts +1 -0
  38. package/dist/stories/examples/PivotExample.d.ts +16 -0
  39. package/dist/stories/tests/45-PivotTests.stories.d.ts +8 -0
  40. package/dist/stories/vanillaStoryConfig.d.ts +3 -1
  41. 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;
@@ -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
- export type GetRowId = (params: GetRowIdParams) => string | number;
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
  /**
@@ -53,6 +54,8 @@ export interface SimpleTableConfig {
53
54
  /** @see SimpleTableProps.showRowSelectionColumn */
54
55
  showRowSelectionColumn?: boolean;
55
56
  enableStickyParents?: boolean;
57
+ /** @see SimpleTableProps.enableVirtualization */
58
+ enableVirtualization?: boolean;
56
59
  errorStateRenderer?: VanillaErrorStateRenderer;
57
60
  expandAll?: boolean;
58
61
  externalFilterHandling?: boolean;
@@ -97,6 +100,10 @@ export interface SimpleTableConfig {
97
100
  */
98
101
  onRendererHostDiscard?: (host: HTMLElement) => void;
99
102
  onSortChange?: (sort: SortColumn | null) => void;
103
+ /** @see SimpleTableProps.pivot */
104
+ pivot?: PivotConfig | null;
105
+ /** @see SimpleTableProps.onPivotChange */
106
+ onPivotChange?: (pivot: PivotConfig | null) => void;
100
107
  quickFilter?: QuickFilterConfig;
101
108
  rowButtons?: RowButton[];
102
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;
@@ -57,6 +58,13 @@ export interface SimpleTableProps {
57
58
  */
58
59
  showRowSelectionColumn?: boolean;
59
60
  enableStickyParents?: boolean;
61
+ /**
62
+ * When false, disables both row and column virtualization so every row and
63
+ * column is rendered in the DOM. Useful for print, a11y tooling, or small
64
+ * datasets that still need a fixed `height` / `maxHeight` for layout.
65
+ * Default true.
66
+ */
67
+ enableVirtualization?: boolean;
60
68
  errorStateRenderer?: ErrorStateRenderer;
61
69
  expandAll?: boolean;
62
70
  externalFilterHandling?: boolean;
@@ -90,6 +98,13 @@ export interface SimpleTableProps {
90
98
  onRowGroupExpand?: (props: OnRowGroupExpandProps) => void | Promise<void>;
91
99
  onRowSelectionChange?: (props: RowSelectionChangeProps) => void;
92
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;
93
108
  quickFilter?: QuickFilterConfig;
94
109
  rowButtons?: RowButton[];
95
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;
@@ -108,6 +108,11 @@ export interface CellRenderContext {
108
108
  * here makes every column count as visible, disabling virtualization.
109
109
  */
110
110
  mainSectionViewportWidth?: number;
111
+ /**
112
+ * When false, skip column virtualization and render every body cell in the
113
+ * main section. Default true. Mirrors {@link SimpleTableProps.enableVirtualization}.
114
+ */
115
+ enableVirtualization?: boolean;
111
116
  onCellEdit?: (params: CellEditParams) => void;
112
117
  onCellClick?: (params: CellClickParams) => void;
113
118
  onRowGroupExpand?: (props: OnRowGroupExpandProps) => void | Promise<void>;
@@ -60,6 +60,8 @@ export interface HeaderRenderContext {
60
60
  mainBodyRef: RefObject<HTMLDivElement>;
61
61
  mainSectionContainerWidth?: number; /** Main section *content* width (sum of all non-pinned column widths). NOT the virtualization viewport. */
62
62
  mainSectionViewportWidth?: number; /** Main section *visible* viewport width (container minus pinned); use for getVisibleCells when !pinned */
63
+ /** When false, skip column virtualization and render every header cell in the main section. Default true. */
64
+ enableVirtualization?: boolean;
63
65
  onColumnOrderChange?: (headers: HeaderObject[]) => void;
64
66
  onColumnSelect?: (header: HeaderObject) => void;
65
67
  onColumnWidthChange?: (headers: HeaderObject[]) => void;
@@ -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
- export type GetRowIdLike = (params: {
47
- row: unknown;
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;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Interaction tests for declarative matrix pivot.
3
+ */
4
+ import type { Meta, StoryObj } from "@storybook/html";
5
+ declare const meta: Meta;
6
+ export default meta;
7
+ type Story = StoryObj;
8
+ export declare const PivotRendersDynamicColumns: Story;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "3.9.8",
3
+ "version": "4.0.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/src/index.d.ts",