simple-table-core 3.0.9 → 3.0.12

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.
@@ -22,6 +22,8 @@ export interface TableAPIContext {
22
22
  expandedRows: Map<string, number>;
23
23
  collapsedRows: Map<string, number>;
24
24
  expandedDepths: Set<number>;
25
+ clearExpandedRows: () => void;
26
+ clearCollapsedRows: () => void;
25
27
  rowStateMap: Map<string | number, RowState>;
26
28
  headerRegistry: Map<string, any>;
27
29
  cellRegistry?: Map<string, {
@@ -226,10 +226,6 @@ export declare class SelectionManager {
226
226
  * Update selection range during mouse drag. Skips derived state and class sync when selection unchanged.
227
227
  */
228
228
  private updateSelectionRange;
229
- /**
230
- * Calculate the nearest cell to a given mouse position
231
- */
232
- private calculateNearestCell;
233
229
  /**
234
230
  * Get cell from mouse position
235
231
  */
@@ -247,7 +243,9 @@ export declare class SelectionManager {
247
243
  */
248
244
  handleMouseDown({ colIndex, rowIndex, rowId }: Cell): void;
249
245
  /**
250
- * Handle mouse over a cell during selection drag
246
+ * Handle mouse over a cell during selection drag.
247
+ * Uses the pointer position to resolve the cell under the cursor (same as continuousScroll)
248
+ * so virtualization/recycled DOM does not apply stale cellData from the firing element.
251
249
  */
252
- handleMouseOver({ colIndex, rowIndex, rowId }: Cell): void;
250
+ handleMouseOver(cellFromElement: Cell, clientX: number, clientY: number): void;
253
251
  }
@@ -4,11 +4,11 @@ import type Cell from "../../types/Cell";
4
4
  * Uses row buckets: one getBoundingClientRect per row to find the row, then only
5
5
  * measures cells in that row (O(rows + cols) instead of O(rows * cols)).
6
6
  */
7
- export declare function calculateNearestCell(clientX: number, clientY: number): Cell | null;
7
+ export declare function calculateNearestCell(clientX: number, clientY: number, root?: Document | HTMLElement): Cell | null;
8
8
  /**
9
9
  * Get cell from mouse position (element under point, or nearest cell).
10
10
  */
11
- export declare function getCellFromMousePosition(clientX: number, clientY: number): Cell | null;
11
+ export declare function getCellFromMousePosition(clientX: number, clientY: number, root?: Document | HTMLElement): Cell | null;
12
12
  /**
13
13
  * Handle auto-scrolling when dragging near table edges.
14
14
  * @param root - Table root (e.g. `.simple-table-root`); limits queries to this instance.
@@ -77,7 +77,7 @@ export interface CellRenderContext {
77
77
  onRowGroupExpand?: (props: OnRowGroupExpandProps) => void | Promise<void>;
78
78
  handleRowSelect?: (rowId: string, checked: boolean) => void;
79
79
  handleMouseDown: (cell: CellData) => void;
80
- handleMouseOver: (cell: CellData) => void;
80
+ handleMouseOver: (cell: CellData, clientX: number, clientY: number) => void;
81
81
  cellRegistry?: Map<string, CellRegistryEntry>;
82
82
  setCollapsedRows: Dispatch<SetStateAction<Map<string, number>>>;
83
83
  setExpandedRows: Dispatch<SetStateAction<Map<string, number>>>;
@@ -50,6 +50,76 @@ export declare const ProgrammaticDepthControl: {
50
50
  canvasElement: any;
51
51
  }) => Promise<void>;
52
52
  };
53
+ /** Marketing-style: collapse all then expand only depth 0 (divisions-only pattern). */
54
+ export declare const ApiCollapseAllThenExpandDepth0: {
55
+ tags: string[];
56
+ render: () => HTMLDivElement & {
57
+ _table?: SimpleTableVanilla | undefined;
58
+ };
59
+ play: ({ canvasElement }: {
60
+ canvasElement: any;
61
+ }) => Promise<void>;
62
+ };
63
+ /** Imperative setExpandedDepths must match DOM and getExpandedDepths for two-level grouping. */
64
+ export declare const ApiSetExpandedDepthsTwoLevels: {
65
+ tags: string[];
66
+ render: () => HTMLDivElement & {
67
+ _table?: SimpleTableVanilla | undefined;
68
+ };
69
+ play: ({ canvasElement }: {
70
+ canvasElement: any;
71
+ }) => Promise<void>;
72
+ };
73
+ /** After setExpandedDepths, toggleDepth(0) must not read stale manager state. */
74
+ export declare const ApiToggleDepthAfterSetExpandedDepths: {
75
+ tags: string[];
76
+ render: () => HTMLDivElement & {
77
+ _table?: SimpleTableVanilla | undefined;
78
+ };
79
+ play: ({ canvasElement }: {
80
+ canvasElement: any;
81
+ }) => Promise<void>;
82
+ };
83
+ /** expandAll must override a previous manual collapse. */
84
+ export declare const ApiExpandAllAfterManualCollapse: {
85
+ tags: string[];
86
+ render: () => HTMLDivElement & {
87
+ _table?: SimpleTableVanilla | undefined;
88
+ };
89
+ play: ({ canvasElement }: {
90
+ canvasElement: any;
91
+ }) => Promise<void>;
92
+ };
93
+ /** collapseAll must override a previous manual expand. */
94
+ export declare const ApiCollapseAllAfterManualExpand: {
95
+ tags: string[];
96
+ render: () => HTMLDivElement & {
97
+ _table?: SimpleTableVanilla | undefined;
98
+ };
99
+ play: ({ canvasElement }: {
100
+ canvasElement: any;
101
+ }) => Promise<void>;
102
+ };
103
+ /** setExpandedDepths must re-expand a manually collapsed row. */
104
+ export declare const ApiSetExpandedDepthsAfterManualToggle: {
105
+ tags: string[];
106
+ render: () => HTMLDivElement & {
107
+ _table?: SimpleTableVanilla | undefined;
108
+ };
109
+ play: ({ canvasElement }: {
110
+ canvasElement: any;
111
+ }) => Promise<void>;
112
+ };
113
+ /** Marketing "Only Divisions" (collapseAll + expandDepth(0)) after manual expand must not leak departments. */
114
+ export declare const ApiOnlyDivisionsAfterManualExpand: {
115
+ tags: string[];
116
+ render: () => HTMLDivElement & {
117
+ _table?: SimpleTableVanilla | undefined;
118
+ };
119
+ play: ({ canvasElement }: {
120
+ canvasElement: any;
121
+ }) => Promise<void>;
122
+ };
53
123
  export declare const OnRowGroupExpandCallback: {
54
124
  render: () => HTMLDivElement;
55
125
  play: ({ canvasElement }: {
@@ -3,7 +3,8 @@
3
3
  * Tests for TableAPI (getAPI()) methods: getVisibleRows, getAllRows, getHeaders,
4
4
  * getSortState/applySortState, getFilterState/applyFilter/clearFilter,
5
5
  * getCurrentPage/setPage, setQuickFilter, toggleColumnEditor/applyColumnVisibility,
6
- * expandAll/collapseAll/getExpandedDepths.
6
+ * expandAll/collapseAll/getExpandedDepths, getTotalPages, resetColumns, selection API,
7
+ * two-level getGroupingProperty/Depth (see tagged exports).
7
8
  */
8
9
  import type { Meta } from "@storybook/html";
9
10
  import { SimpleTableVanilla } from "../../src/index";
@@ -113,3 +114,39 @@ export declare const GetGroupingPropertyAndDepth: {
113
114
  canvasElement: HTMLElement;
114
115
  }) => Promise<void>;
115
116
  };
117
+ export declare const GetTotalPagesViaAPI: {
118
+ tags: string[];
119
+ render: () => HTMLDivElement & {
120
+ _table?: SimpleTableVanilla | undefined;
121
+ };
122
+ play: ({ canvasElement }: {
123
+ canvasElement: HTMLElement;
124
+ }) => Promise<void>;
125
+ };
126
+ export declare const ResetColumnsViaAPI: {
127
+ tags: string[];
128
+ render: () => HTMLDivElement & {
129
+ _table?: SimpleTableVanilla | undefined;
130
+ };
131
+ play: ({ canvasElement }: {
132
+ canvasElement: HTMLElement;
133
+ }) => Promise<void>;
134
+ };
135
+ export declare const SelectionViaTableAPI: {
136
+ tags: string[];
137
+ render: () => HTMLDivElement & {
138
+ _table?: SimpleTableVanilla | undefined;
139
+ };
140
+ play: ({ canvasElement }: {
141
+ canvasElement: HTMLElement;
142
+ }) => Promise<void>;
143
+ };
144
+ export declare const GetGroupingPropertyTwoLevels: {
145
+ tags: string[];
146
+ render: () => HTMLDivElement & {
147
+ _table?: SimpleTableVanilla | undefined;
148
+ };
149
+ play: ({ canvasElement }: {
150
+ canvasElement: HTMLElement;
151
+ }) => Promise<void>;
152
+ };