@fileverse-dev/fortune-core 1.2.50-patch-6 → 1.2.51-patch-1

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.
@@ -1,6 +1,6 @@
1
1
  import _ from "lodash";
2
2
  import { getFlowdata } from "../context";
3
- import { cancelActiveImgItem, cancelPaintModel, functionHTMLGenerate, israngeseleciton, rangeHightlightselected, rangeSetValue, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxResize, onCommentBoxResizeEnd, onImageMove, onImageMoveEnd, onImageResize, onImageResizeEnd, removeEditingComment, overShowComment, removeOverShowComment, rangeDrag, onFormulaRangeDragEnd, createFormulaRangeSelect, createRangeHightlight, onCellsMoveEnd, onCellsMove, cellFocus, editComment, onIframeMoveEnd, onIframeResizeEnd, overShowError } from "../modules";
3
+ import { cancelActiveImgItem, cancelPaintModel, functionHTMLGenerate, israngeseleciton, rangeHightlightselected, rangeSetValue, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxResize, onCommentBoxResizeEnd, onImageMove, onImageMoveEnd, onImageResize, onImageResizeEnd, removeEditingComment, removeOverShowComment, rangeDrag, onFormulaRangeDragEnd, createFormulaRangeSelect, createRangeHightlight, onCellsMoveEnd, onCellsMove, cellFocus, editComment, onIframeMoveEnd, onIframeResizeEnd, overShowError } from "../modules";
4
4
  import { getFrozenHandleLeft, getFrozenHandleTop, scrollToFrozenRowCol } from "../modules/freeze";
5
5
  import { cancelFunctionrangeSelected, mergeBorder, mergeMoveMain, updateCell, luckysheetUpdateCell } from "../modules/cell";
6
6
  import { colLocation, colLocationByIndex, rowLocation, rowLocationByIndex } from "../modules/location";
@@ -156,7 +156,7 @@ export function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, containe
156
156
  return;
157
157
  }
158
158
  cellFocus(ctx, row_index, col_index, true);
159
- editComment(ctx, globalCache, row_index, col_index);
159
+ console.log("handleCellAreaMouseDown", row_index, col_index);
160
160
  if (!inHorizontalFreeze && !inVerticalFreeze) {
161
161
  if (col_pre < ctx.scrollLeft) {
162
162
  ctx.scrollLeft = col_pre;
@@ -905,7 +905,16 @@ export function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX,
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
- overShowComment(ctx, e, scrollX, scrollY, container);
908
+ var row_location = rowLocation(e.pageY, ctx.visibledatarow);
909
+ var row = row_location[1];
910
+ var row_pre = row_location[0];
911
+ var row_index = row_location[2];
912
+ var col_location = colLocation(e.pageX, ctx.visibledatacolumn);
913
+ var col = col_location[1];
914
+ var col_pre = col_location[0];
915
+ var col_index = col_location[2];
916
+ console.log('mousemove row_index:', row_index, 'col_index:', col_index);
917
+ editComment(ctx, globalCache, row_index - 4, col_index - 1);
909
918
  overShowError(ctx, e, scrollX, scrollY, container);
910
919
  onSearchDialogMove(globalCache, e);
911
920
  onRangeSelectionModalMove(globalCache, e);
@@ -104,6 +104,7 @@ export function getCellValue(r, c, data, attr) {
104
104
  }
105
105
  export function setCellValue(ctx, r, c, d, v) {
106
106
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
107
+ console.log("setCellValue", r, c, __assign({}, v), __assign({}, v.ct));
107
108
  if (ctx.allowEdit === false || ctx.isFlvReadOnly) return;
108
109
  if (_.isNil(d)) {
109
110
  d = getFlowdata(ctx);
@@ -230,12 +230,12 @@ export function newComment(ctx, globalCache, r, c) {
230
230
  }
231
231
  }
232
232
  export function editComment(ctx, globalCache, r, c) {
233
- var _a;
233
+ var _a, _b;
234
234
  var allowEdit = isAllowEdit(ctx);
235
235
  if (!allowEdit) return;
236
236
  var flowdata = getFlowdata(ctx);
237
- removeEditingComment(ctx, globalCache);
238
- var comment = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r][c]) === null || _a === void 0 ? void 0 : _a.ps;
237
+ var comment = (_b = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r]) === null || _a === void 0 ? void 0 : _a[c]) === null || _b === void 0 ? void 0 : _b.ps;
238
+ if (!comment) return;
239
239
  var commentBoxes = _.concat(ctx.commentBoxes, ctx.editingCommentBox);
240
240
  if (_.findIndex(commentBoxes, function (v) {
241
241
  return (v === null || v === void 0 ? void 0 : v.rc) === "".concat(r, "_").concat(c);
@@ -175,7 +175,7 @@ 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
- (0, _modules.editComment)(ctx, globalCache, row_index, col_index);
178
+ console.log("handleCellAreaMouseDown", row_index, col_index);
179
179
  if (!inHorizontalFreeze && !inVerticalFreeze) {
180
180
  if (col_pre < ctx.scrollLeft) {
181
181
  ctx.scrollLeft = col_pre;
@@ -924,7 +924,16 @@ function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX, scrollY
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
- (0, _modules.overShowComment)(ctx, e, scrollX, scrollY, container);
927
+ var row_location = (0, _location.rowLocation)(e.pageY, ctx.visibledatarow);
928
+ var row = row_location[1];
929
+ var row_pre = row_location[0];
930
+ var row_index = row_location[2];
931
+ var col_location = (0, _location.colLocation)(e.pageX, ctx.visibledatacolumn);
932
+ var col = col_location[1];
933
+ var col_pre = col_location[0];
934
+ var col_index = col_location[2];
935
+ console.log('mousemove row_index:', row_index, 'col_index:', col_index);
936
+ (0, _modules.editComment)(ctx, globalCache, row_index - 4, col_index - 1);
928
937
  (0, _modules.overShowError)(ctx, e, scrollX, scrollY, container);
929
938
  (0, _searchReplace.onSearchDialogMove)(globalCache, e);
930
939
  (0, _hyperlink.onRangeSelectionModalMove)(globalCache, e);
@@ -137,6 +137,7 @@ function getCellValue(r, c, data, attr) {
137
137
  }
138
138
  function setCellValue(ctx, r, c, d, v) {
139
139
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
140
+ console.log("setCellValue", r, c, __assign({}, v), __assign({}, v.ct));
140
141
  if (ctx.allowEdit === false || ctx.isFlvReadOnly) return;
141
142
  if (_lodash.default.isNil(d)) {
142
143
  d = (0, _context.getFlowdata)(ctx);
@@ -258,12 +258,12 @@ function newComment(ctx, globalCache, r, c) {
258
258
  }
259
259
  }
260
260
  function editComment(ctx, globalCache, r, c) {
261
- var _a;
261
+ var _a, _b;
262
262
  var allowEdit = (0, _utils.isAllowEdit)(ctx);
263
263
  if (!allowEdit) return;
264
264
  var flowdata = (0, _context.getFlowdata)(ctx);
265
- removeEditingComment(ctx, globalCache);
266
- var comment = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r][c]) === null || _a === void 0 ? void 0 : _a.ps;
265
+ var comment = (_b = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r]) === null || _a === void 0 ? void 0 : _a[c]) === null || _b === void 0 ? void 0 : _b.ps;
266
+ if (!comment) return;
267
267
  var commentBoxes = _lodash.default.concat(ctx.commentBoxes, ctx.editingCommentBox);
268
268
  if (_lodash.default.findIndex(commentBoxes, function (v) {
269
269
  return (v === null || v === void 0 ? void 0 : v.rc) === "".concat(r, "_").concat(c);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.50-patch-6",
3
+ "version": "1.2.51-patch-1",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",