simple-table-core 3.0.10 → 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.
@@ -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>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "3.0.10",
3
+ "version": "3.0.12",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/src/index.d.ts",