sheet-happens 0.0.44 → 0.0.45

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
@@ -1220,7 +1220,7 @@ var useMouse = function useMouse(hitmapRef, selection, knobArea, editMode, editD
1220
1220
  var newWidth = Math.max(size + x - anchor + scroll - currentScroll, SIZES.minimumWidth * indices.length);
1221
1221
  onInvalidateColumn === null || onInvalidateColumn === void 0 ? void 0 : onInvalidateColumn(indices[0] - 1);
1222
1222
  onCellWidthChange(indices, indices.map(function (_) {
1223
- return newWidth / indices.length;
1223
+ return Math.round(newWidth / indices.length);
1224
1224
  }));
1225
1225
  }
1226
1226
 
@@ -1344,15 +1344,18 @@ var useMouse = function useMouse(hitmapRef, selection, knobArea, editMode, editD
1344
1344
  selection = _ref$current4.selection,
1345
1345
  _ref$current4$cellLay = _ref$current4.cellLayout,
1346
1346
  pixelToCell = _ref$current4$cellLay.pixelToCell,
1347
- columnToPixel = _ref$current4$cellLay.columnToPixel;
1347
+ columnToPixel = _ref$current4$cellLay.columnToPixel,
1348
+ getIndentY = _ref$current4$cellLay.getIndentY;
1348
1349
  e.preventDefault();
1349
1350
  if (e.shiftKey) return;
1350
1351
  var xy = getMousePosition(e);
1351
1352
  if (!xy) return;
1352
- var x = xy[0];
1353
+ var x = xy[0],
1354
+ y = xy[1];
1355
+ var indentY = getIndentY();
1353
1356
  var columns = visibleCells.columns;
1354
1357
 
1355
- if (onCellWidthChange) {
1358
+ if (onCellWidthChange && y < indentY) {
1356
1359
  var autosized = [];
1357
1360
 
1358
1361
  for (var _iterator10 = _createForOfIteratorHelperLoose(columns), _step10; !(_step10 = _iterator10()).done;) {
@@ -3725,7 +3728,7 @@ var Sheet = React.forwardRef(function (props, ref) {
3725
3728
  var hitmapRef = React.useRef(NO_CLICKABLES);
3726
3729
  var isFocused = focused || editMode;
3727
3730
 
3728
- var _useClipboardAPI = useClipboardAPI(selection, editData, cellReadOnly, isFocused, changeSelection, props.onChange, props.onCopy, props.onPaste),
3731
+ var _useClipboardAPI = useClipboardAPI(selection, editData, cellReadOnly, isFocused && !editMode, changeSelection, props.onChange, props.onCopy, props.onPaste),
3729
3732
  clipboardApi = _useClipboardAPI.clipboardApi,
3730
3733
  onClipboardCopy = _useClipboardAPI.onClipboardCopy;
3731
3734