MCPcopy
hub / github.com/handsontable/handsontable / mouseOver

Function mouseOver

handsontable/src/selection/mouseEventHandler.ts:111–135  ·  view source on GitHub ↗
({ isLeftClick, coords, selection, controller, cellCoordsFactory }: MouseOverOptions)

Source from the content-addressed store, hash-verified

109 * @param {Function} options.cellCoordsFactory The function factory for CellCoords objects.
110 */
111export function mouseOver({ isLeftClick, coords, selection, controller, cellCoordsFactory }: MouseOverOptions) {
112 if (!isLeftClick) {
113 return;
114 }
115
116 const sel = selection;
117 const selectedRow = sel.isSelectedByRowHeader();
118 const selectedColumn = sel.isSelectedByColumnHeader();
119 const countCols = sel.tableProps.countCols();
120 const countRows = sel.tableProps.countRows();
121
122 sel.markSource('mouse');
123
124 if (selectedColumn && !controller.column) {
125 sel.setRangeEnd(cellCoordsFactory(countRows - 1, coords.col ?? 0));
126
127 } else if (selectedRow && !controller.row) {
128 sel.setRangeEnd(cellCoordsFactory(coords.row ?? 0, countCols - 1));
129
130 } else if (!controller.cell) {
131 sel.setRangeEnd(coords);
132 }
133
134 sel.markEndSource();
135}
136
137interface MouseUpOptions {
138 isLeftClick: boolean;

Callers 15

general.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
hiddenRows.spec.jsFile · 0.85

Calls 7

isSelectedByRowHeaderMethod · 0.80
markSourceMethod · 0.80
setRangeEndMethod · 0.80
markEndSourceMethod · 0.80
countColsMethod · 0.65
countRowsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…