Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from.col = _ref[0];
to.col = _ref[1];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
}
}
}
}
to.col = _ref[1];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, coords.col));
}
}
}
}
changeDirection = true;
}
if (changeDirection) {
[from.col, to.col] = [to.col, from.col];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
}
}
value: function onAfterOnCellMouseDown(event, coords, TD) {
if (coords.row < 0) {
var colspan = this.getColspan(coords.row, coords.col);
var lastColIndex = coords.col + colspan - 1;
if (colspan > 1) {
var lastRowIndex = this.hot.countRows() - 1;
this.hot.selection.setRangeEnd(new CellCoords(lastRowIndex, lastColIndex));
}
}
}
[from.col, to.col] = [to.col, from.col];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
}
}
}
}
value: function onAfterOnCellMouseDown(event, coords, TD) {
if (coords.row < 0) {
var colspan = this.getColspan(coords.row, coords.col);
var lastColIndex = coords.col + colspan - 1;
if (colspan > 1) {
var lastRowIndex = this.hot.countRows() - 1;
this.hot.selection.setRangeEnd(new _src.CellCoords(lastRowIndex, lastColIndex));
}
}
}
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new _src.CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new _src.CellCoords(to.row, coords.col));
}
}
}
}
onAfterOnCellMouseDown(event, coords, TD) {
if (coords.row < 0) {
let colspan = this.getColspan(coords.row, coords.col);
let lastColIndex = coords.col + colspan - 1;
if (colspan > 1) {
let lastRowIndex = this.hot.countRows() - 1;
this.hot.selection.setRangeEnd(new CellCoords(lastRowIndex, lastColIndex));
}
}
}
}
if (changeDirection) {
[from.col, to.col] = [to.col, from.col];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
}
}
}
if (changeDirection) {
var _ref = [to.col, from.col];
from.col = _ref[0];
to.col = _ref[1];
}
if (colspan > 1) {
blockCalculations.column = true;
blockCalculations.cell = true;
this.hot.selection.setSelectedHeaders(false, true);
if (from.col === to.col) {
if (lastColIndex <= from.col && coords.col < from.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, to.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
} else {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex > to.col ? lastColIndex : to.col));
}
}
if (from.col < to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, coords.col < from.col ? coords.col : from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, lastColIndex));
}
if (from.col > to.col) {
this.hot.selection.setRangeStartOnly(new CellCoords(from.row, from.col));
this.hot.selection.setRangeEnd(new CellCoords(to.row, coords.col));
}
}
}
}