@fileverse-dev/fortune-core 1.2.51-patch-1 → 1.2.51-patch-3
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/es/events/mouse.js +22 -9
- package/lib/events/mouse.js +22 -9
- package/package.json +1 -1
package/es/events/mouse.js
CHANGED
|
@@ -156,7 +156,6 @@ export function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, containe
|
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
cellFocus(ctx, row_index, col_index, true);
|
|
159
|
-
console.log("handleCellAreaMouseDown", row_index, col_index);
|
|
160
159
|
if (!inHorizontalFreeze && !inVerticalFreeze) {
|
|
161
160
|
if (col_pre < ctx.scrollLeft) {
|
|
162
161
|
ctx.scrollLeft = col_pre;
|
|
@@ -900,21 +899,35 @@ function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container
|
|
|
900
899
|
}
|
|
901
900
|
}
|
|
902
901
|
export function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX, scrollY, container, fxInput) {
|
|
902
|
+
var _a;
|
|
903
903
|
if (onCommentBoxResize(ctx, globalCache, e)) return;
|
|
904
904
|
if (onCommentBoxMove(ctx, globalCache, e)) return;
|
|
905
905
|
if (onImageMove(ctx, globalCache, e)) return;
|
|
906
906
|
if (onImageResize(ctx, globalCache, e)) return;
|
|
907
907
|
onCellsMove(ctx, globalCache, e, scrollX, scrollY, container);
|
|
908
|
-
var
|
|
909
|
-
var
|
|
910
|
-
|
|
908
|
+
var containerMain = document.getElementsByClassName('fortune-cell-area')[0];
|
|
909
|
+
var rect = containerMain === null || containerMain === void 0 ? void 0 : containerMain.getBoundingClientRect();
|
|
910
|
+
if (!rect) {
|
|
911
|
+
rect = container.getBoundingClientRect();
|
|
912
|
+
}
|
|
913
|
+
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
914
|
+
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
915
|
+
var _x = mouseX + ctx.scrollLeft;
|
|
916
|
+
var _y = mouseY + ctx.scrollTop;
|
|
917
|
+
if (_x >= rect.width + ctx.scrollLeft || _y >= rect.height + ctx.scrollTop) {
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
var freeze = (_a = globalCache.freezen) === null || _a === void 0 ? void 0 : _a[ctx.currentSheetId];
|
|
921
|
+
var _b = fixPositionOnFrozenCells(freeze, _x, _y, mouseX, mouseY),
|
|
922
|
+
x = _b.x,
|
|
923
|
+
y = _b.y,
|
|
924
|
+
inHorizontalFreeze = _b.inHorizontalFreeze,
|
|
925
|
+
inVerticalFreeze = _b.inVerticalFreeze;
|
|
926
|
+
var row_location = rowLocation(y, ctx.visibledatarow);
|
|
911
927
|
var row_index = row_location[2];
|
|
912
|
-
var col_location = colLocation(
|
|
913
|
-
var col = col_location[1];
|
|
914
|
-
var col_pre = col_location[0];
|
|
928
|
+
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
915
929
|
var col_index = col_location[2];
|
|
916
|
-
|
|
917
|
-
editComment(ctx, globalCache, row_index - 4, col_index - 1);
|
|
930
|
+
editComment(ctx, globalCache, row_index, col_index);
|
|
918
931
|
overShowError(ctx, e, scrollX, scrollY, container);
|
|
919
932
|
onSearchDialogMove(globalCache, e);
|
|
920
933
|
onRangeSelectionModalMove(globalCache, e);
|
package/lib/events/mouse.js
CHANGED
|
@@ -175,7 +175,6 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
(0, _modules.cellFocus)(ctx, row_index, col_index, true);
|
|
178
|
-
console.log("handleCellAreaMouseDown", row_index, col_index);
|
|
179
178
|
if (!inHorizontalFreeze && !inVerticalFreeze) {
|
|
180
179
|
if (col_pre < ctx.scrollLeft) {
|
|
181
180
|
ctx.scrollLeft = col_pre;
|
|
@@ -919,21 +918,35 @@ function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container
|
|
|
919
918
|
}
|
|
920
919
|
}
|
|
921
920
|
function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX, scrollY, container, fxInput) {
|
|
921
|
+
var _a;
|
|
922
922
|
if ((0, _modules.onCommentBoxResize)(ctx, globalCache, e)) return;
|
|
923
923
|
if ((0, _modules.onCommentBoxMove)(ctx, globalCache, e)) return;
|
|
924
924
|
if ((0, _modules.onImageMove)(ctx, globalCache, e)) return;
|
|
925
925
|
if ((0, _modules.onImageResize)(ctx, globalCache, e)) return;
|
|
926
926
|
(0, _modules.onCellsMove)(ctx, globalCache, e, scrollX, scrollY, container);
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
|
|
927
|
+
var containerMain = document.getElementsByClassName('fortune-cell-area')[0];
|
|
928
|
+
var rect = containerMain === null || containerMain === void 0 ? void 0 : containerMain.getBoundingClientRect();
|
|
929
|
+
if (!rect) {
|
|
930
|
+
rect = container.getBoundingClientRect();
|
|
931
|
+
}
|
|
932
|
+
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
933
|
+
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
934
|
+
var _x = mouseX + ctx.scrollLeft;
|
|
935
|
+
var _y = mouseY + ctx.scrollTop;
|
|
936
|
+
if (_x >= rect.width + ctx.scrollLeft || _y >= rect.height + ctx.scrollTop) {
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
var freeze = (_a = globalCache.freezen) === null || _a === void 0 ? void 0 : _a[ctx.currentSheetId];
|
|
940
|
+
var _b = fixPositionOnFrozenCells(freeze, _x, _y, mouseX, mouseY),
|
|
941
|
+
x = _b.x,
|
|
942
|
+
y = _b.y,
|
|
943
|
+
inHorizontalFreeze = _b.inHorizontalFreeze,
|
|
944
|
+
inVerticalFreeze = _b.inVerticalFreeze;
|
|
945
|
+
var row_location = (0, _location.rowLocation)(y, ctx.visibledatarow);
|
|
930
946
|
var row_index = row_location[2];
|
|
931
|
-
var col_location = (0, _location.colLocation)(
|
|
932
|
-
var col = col_location[1];
|
|
933
|
-
var col_pre = col_location[0];
|
|
947
|
+
var col_location = (0, _location.colLocation)(x, ctx.visibledatacolumn);
|
|
934
948
|
var col_index = col_location[2];
|
|
935
|
-
|
|
936
|
-
(0, _modules.editComment)(ctx, globalCache, row_index - 4, col_index - 1);
|
|
949
|
+
(0, _modules.editComment)(ctx, globalCache, row_index, col_index);
|
|
937
950
|
(0, _modules.overShowError)(ctx, e, scrollX, scrollY, container);
|
|
938
951
|
(0, _searchReplace.onSearchDialogMove)(globalCache, e);
|
|
939
952
|
(0, _hyperlink.onRangeSelectionModalMove)(globalCache, e);
|