sheet-happens 0.0.59 → 0.0.60

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.
package/dist/index.js CHANGED
@@ -1379,10 +1379,16 @@ var useMouse = function useMouse(elementRef, dataOffset, hitmapRef, selection, k
1379
1379
  if (!xy) return;
1380
1380
  var x = xy[0],
1381
1381
  y = xy[1];
1382
- if (x <= getIndentX() || y <= getIndentY()) {
1382
+ if (x <= getIndentX() && y <= getIndentY()) {
1383
1383
  return;
1384
1384
  }
1385
1385
  var cell = pixelToCell(xy);
1386
+ if (!hideRowHeaders && x < getIndentX()) {
1387
+ cell[0] = -1;
1388
+ }
1389
+ if (!hideColumnHeaders && y < getIndentY()) {
1390
+ cell[1] = -1;
1391
+ }
1386
1392
  if (!isPointInsideSelection(selection, cell)) {
1387
1393
  onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange([cell, cell]);
1388
1394
  }
@@ -3687,14 +3693,14 @@ var Sheet = React.forwardRef(function (props, ref) {
3687
3693
  scrollToSelection(newSelection, toHead);
3688
3694
  }
3689
3695
  if (props.onSelectionChanged) {
3690
- var _normalizeSelection = normalizeSelection(validateSelection(newSelection)),
3691
- _normalizeSelection$ = _normalizeSelection[0],
3692
- minX = _normalizeSelection$[0],
3693
- minY = _normalizeSelection$[1],
3694
- _normalizeSelection$2 = _normalizeSelection[1],
3695
- maxX = _normalizeSelection$2[0],
3696
- maxY = _normalizeSelection$2[1];
3697
- props.onSelectionChanged(minX, minY, maxX, maxY);
3696
+ var _validateSelection = validateSelection(newSelection),
3697
+ _validateSelection$ = _validateSelection[0],
3698
+ anchorX = _validateSelection$[0],
3699
+ anchorY = _validateSelection$[1],
3700
+ _validateSelection$2 = _validateSelection[1],
3701
+ headX = _validateSelection$2[0],
3702
+ headY = _validateSelection$2[1];
3703
+ props.onSelectionChanged(anchorX, anchorY, headX, headY);
3698
3704
  }
3699
3705
  };
3700
3706
  var cancelEditingCell = function cancelEditingCell() {