@fileverse-dev/fortune-core 1.0.2-mod-13 → 1.0.2-mod-15

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.esm.js CHANGED
@@ -68952,6 +68952,7 @@ function drawArrow(rc, _ref, color, theta, headlen) {
68952
68952
  fromY = _ref.fromY,
68953
68953
  toX = _ref.toX,
68954
68954
  toY = _ref.toY;
68955
+ if (rc) return;
68955
68956
  var canvas = document.getElementById("arrowCanvas-".concat(rc));
68956
68957
  var ctx = canvas.getContext("2d");
68957
68958
  if (!canvas || !ctx) return;
@@ -69097,7 +69098,9 @@ function newComment(ctx, globalCache, r, c) {
69097
69098
  if (((_ctx$hooks$beforeInse = (_ctx$hooks3 = ctx.hooks).beforeInsertComment) === null || _ctx$hooks$beforeInse === void 0 ? void 0 : _ctx$hooks$beforeInse.call(_ctx$hooks3, r, c)) === false) {
69098
69099
  return;
69099
69100
  }
69100
- removeEditingComment(ctx, globalCache);
69101
+ if (globalCache) {
69102
+ removeEditingComment(ctx, globalCache);
69103
+ }
69101
69104
  var flowdata = getFlowdata(ctx);
69102
69105
  if (!flowdata) return;
69103
69106
  var cell = flowdata[r][c];
@@ -69235,8 +69238,11 @@ function showHideAllComments(ctx) {
69235
69238
  }
69236
69239
  }
69237
69240
  }
69241
+ function removeOverShowComment(ctx) {
69242
+ ctx.hoveredCommentBox = undefined;
69243
+ }
69238
69244
  function overShowComment(ctx, e, scrollX, scrollY, container) {
69239
- var _flowdata$r, _flowdata$r$c4, _ctx$editingCommentBo, _ctx$hoveredCommentBo;
69245
+ var _ctx$luckysheet_selec, _flowdata$r, _flowdata$r$c4, _ctx$editingCommentBo, _ctx$hoveredCommentBo;
69240
69246
  var flowdata = getFlowdata(ctx);
69241
69247
  if (!flowdata) return;
69242
69248
  var scrollLeft = scrollX.scrollLeft;
@@ -69257,6 +69263,13 @@ function overShowComment(ctx, e, scrollX, scrollY, container) {
69257
69263
  var _margeset$column2 = _slicedToArray(margeset.column, 3);
69258
69264
  c = _margeset$column2[2];
69259
69265
  }
69266
+ var firstSelection = (_ctx$luckysheet_selec = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec === void 0 ? void 0 : _ctx$luckysheet_selec[0];
69267
+ var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
69268
+ var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
69269
+ if (r === row_index && c === col_index) {
69270
+ ctx.hoveredCommentBox = undefined;
69271
+ return;
69272
+ }
69260
69273
  var rc = "".concat(r, "_").concat(c);
69261
69274
  var comment = (_flowdata$r = flowdata[r]) === null || _flowdata$r === void 0 ? void 0 : (_flowdata$r$c4 = _flowdata$r[c]) === null || _flowdata$r$c4 === void 0 ? void 0 : _flowdata$r$c4.ps;
69262
69275
  if (comment == null || comment.isShow || _.findIndex(ctx.commentBoxes, function (v) {
@@ -72862,13 +72875,13 @@ var Canvas = /*#__PURE__*/function () {
72862
72875
  renderCtx.fillText(_.isNil(value) ? "" : value, horizonAlignPos, verticalAlignPos);
72863
72876
  }
72864
72877
  if (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps) {
72865
- var ps_w = 8 * this.sheetCtx.zoomRatio;
72866
- var ps_h = 8 * this.sheetCtx.zoomRatio;
72878
+ var ps_w = 12 * this.sheetCtx.zoomRatio;
72879
+ var ps_h = 12 * this.sheetCtx.zoomRatio;
72867
72880
  renderCtx.beginPath();
72868
72881
  renderCtx.moveTo(endX + offsetLeft - 1 - ps_w, startY + offsetTop);
72869
72882
  renderCtx.lineTo(endX + offsetLeft - 1, startY + offsetTop);
72870
72883
  renderCtx.lineTo(endX + offsetLeft - 1, startY + offsetTop + ps_h);
72871
- renderCtx.fillStyle = "#FC6666";
72884
+ renderCtx.fillStyle = "#EFC703";
72872
72885
  renderCtx.fill();
72873
72886
  renderCtx.closePath();
72874
72887
  }
@@ -72948,30 +72961,30 @@ var Canvas = /*#__PURE__*/function () {
72948
72961
  var index = getSheetIndex(this.sheetCtx, this.sheetCtx.currentSheetId);
72949
72962
  var dataVerification = this.sheetCtx.luckysheetfile[index].dataVerification;
72950
72963
  if ((dataVerification === null || dataVerification === void 0 ? void 0 : dataVerification["".concat(r, "_").concat(c)]) && !validateCellData(this.sheetCtx, dataVerification["".concat(r, "_").concat(c)], value)) {
72951
- var dv_w = 5 * this.sheetCtx.zoomRatio;
72952
- var dv_h = 5 * this.sheetCtx.zoomRatio;
72964
+ var dv_w = 9 * this.sheetCtx.zoomRatio;
72965
+ var dv_h = 9 * this.sheetCtx.zoomRatio;
72953
72966
  renderCtx.beginPath();
72954
72967
  renderCtx.moveTo(startX + offsetLeft, startY + offsetTop);
72955
72968
  renderCtx.lineTo(startX + offsetLeft + dv_w, startY + offsetTop);
72956
72969
  renderCtx.lineTo(startX + offsetLeft, startY + offsetTop + dv_h);
72957
- renderCtx.fillStyle = "#FC6666";
72970
+ renderCtx.fillStyle = "#EFC703";
72958
72971
  renderCtx.fill();
72959
72972
  renderCtx.closePath();
72960
72973
  }
72961
72974
  if (cell === null || cell === void 0 ? void 0 : cell.ps) {
72962
- var ps_w = 8 * this.sheetCtx.zoomRatio;
72963
- var ps_h = 8 * this.sheetCtx.zoomRatio;
72975
+ var ps_w = 12 * this.sheetCtx.zoomRatio;
72976
+ var ps_h = 12 * this.sheetCtx.zoomRatio;
72964
72977
  renderCtx.beginPath();
72965
72978
  renderCtx.moveTo(endX + offsetLeft - ps_w, startY + offsetTop);
72966
72979
  renderCtx.lineTo(endX + offsetLeft, startY + offsetTop);
72967
72980
  renderCtx.lineTo(endX + offsetLeft, startY + offsetTop + ps_h);
72968
- renderCtx.fillStyle = "#FC6666";
72981
+ renderCtx.fillStyle = "#EFC703";
72969
72982
  renderCtx.fill();
72970
72983
  renderCtx.closePath();
72971
72984
  }
72972
72985
  if ((cell === null || cell === void 0 ? void 0 : cell.qp) === 1 && isRealNum$1(cell === null || cell === void 0 ? void 0 : cell.v)) {
72973
- var _ps_w = 6 * this.sheetCtx.zoomRatio;
72974
- var _ps_h = 6 * this.sheetCtx.zoomRatio;
72986
+ var _ps_w = 10 * this.sheetCtx.zoomRatio;
72987
+ var _ps_h = 10 * this.sheetCtx.zoomRatio;
72975
72988
  renderCtx.beginPath();
72976
72989
  renderCtx.moveTo(startX + offsetLeft + _ps_w - 1, startY + offsetTop);
72977
72990
  renderCtx.lineTo(startX + offsetLeft - 1, startY + offsetTop);
@@ -76299,8 +76312,8 @@ var defaultSettings = {
76299
76312
  defaultColWidth: 73,
76300
76313
  defaultRowHeight: 19,
76301
76314
  defaultFontSize: 10,
76302
- toolbarItems: ["undo", "redo", "format-painter", "|", "currency-format", "percentage-format", "number-decrease", "number-increase", "format", "|", "font", "|", "font-size", "|", "bold", "italic", "strike-through", "|", "font-color", "background", "border", "merge-cell", "|", "horizontal-align", "vertical-align", "text-wrap", "|", "conditionFormat", "filter", "link", "image", "quick-formula", "dataVerification", "screenshot", "search"],
76303
- cellContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA", "filter", "chart", "image", "link", "data", "cell-format"],
76315
+ toolbarItems: ["undo", "redo", "format-painter", "clear-format", "|", "currency-format", "percentage-format", "number-decrease", "number-increase", "format", "|", "font", "|", "font-size", "|", "bold", "italic", "strike-through", "underline", "|", "font-color", "background", "border", "merge-cell", "|", "horizontal-align", "vertical-align", "text-wrap", "text-rotation", "|", "freeze", "conditionFormat", "filter", "link", "image", "comment", "quick-formula", "dataVerification", "splitColumn", "locationCondition", "screenshot", "search"],
76316
+ cellContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA", "filter", "chart", "image", "link", "data", "cell-format", "comment"],
76304
76317
  headerContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA"],
76305
76318
  sheetTabContextMenu: ["delete", "copy", "rename", "color", "hide", "|", "move"],
76306
76319
  filterContextMenu: ["sort-by-asc", "sort-by-desc", "|", "filter-by-color", "|", "filter-by-value"],
@@ -76309,7 +76322,8 @@ var defaultSettings = {
76309
76322
  },
76310
76323
  hooks: {},
76311
76324
  customToolbarItems: [],
76312
- currency: "¥"
76325
+ currency: "¥",
76326
+ getCommentCellUI: null
76313
76327
  };
76314
76328
 
76315
76329
  function handleCopy(ctx) {
@@ -76710,6 +76724,7 @@ var mouseWheelUniqueTimeout;
76710
76724
  var scrollLockTimeout;
76711
76725
  function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
76712
76726
  var _cache$searchDialog;
76727
+ removeEditingComment(ctx, cache);
76713
76728
  if (((_cache$searchDialog = cache.searchDialog) === null || _cache$searchDialog === void 0 ? void 0 : _cache$searchDialog.mouseEnter) && ctx.showSearch && ctx.showReplace) return;
76714
76729
  if (ctx.filterContextMenu != null) return;
76715
76730
  var scrollLeft = scrollbarX.scrollLeft;
@@ -76854,6 +76869,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
76854
76869
  return;
76855
76870
  }
76856
76871
  cellFocus(ctx, row_index, col_index, true);
76872
+ editComment(ctx, globalCache, row_index, col_index);
76857
76873
  if (!inHorizontalFreeze && !inVerticalFreeze) {
76858
76874
  if (col_pre < ctx.scrollLeft) {
76859
76875
  ctx.scrollLeft = col_pre;
@@ -77150,6 +77166,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
77150
77166
  }
77151
77167
  function handleCellAreaDoubleClick(ctx, globalCache, settings, e, container) {
77152
77168
  var _globalCache$freezen2;
77169
+ console.log("handleCellAreaDoubleClick");
77153
77170
  var flowdata = getFlowdata(ctx);
77154
77171
  if (!flowdata) return;
77155
77172
  if (ctx.luckysheetCellUpdate.length > 0 && ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
@@ -77170,6 +77187,8 @@ function handleCellAreaDoubleClick(ctx, globalCache, settings, e, container) {
77170
77187
  var row_index = row_location[2];
77171
77188
  var col_location = colLocation(x, ctx.visibledatacolumn);
77172
77189
  var col_index = col_location[2];
77190
+ removeOverShowComment(ctx);
77191
+ removeEditingComment(ctx, globalCache);
77173
77192
  var index = getSheetIndex(ctx, ctx.currentSheetId);
77174
77193
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
77175
77194
  if (dataVerification) {
@@ -77622,6 +77641,7 @@ function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX, scrollY
77622
77641
  if (onImageMove(ctx, globalCache, e)) return;
77623
77642
  if (onImageResize(ctx, globalCache, e)) return;
77624
77643
  onCellsMove(ctx, globalCache, e, scrollX, scrollY, container);
77644
+ var inputBoxContainer = document.getElementsByClassName("luckysheet-input-box")[0];
77625
77645
  overShowComment(ctx, e, scrollX, scrollY, container);
77626
77646
  onSearchDialogMove(globalCache, e);
77627
77647
  onRangeSelectionModalMove(globalCache, e);
@@ -79824,4 +79844,4 @@ function handlePasteByClick(ctx, clipboardData, triggerType) {
79824
79844
  } else ;
79825
79845
  }
79826
79846
 
79827
- export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, index as api, applyLocation, attrToCssName, autoSelectionFormula, calcSelectionInfo, cancelActiveImgItem, cancelFunctionrangeSelected, cancelNormalSelected, cancelPaintModel, cellFocus, cfSplitRange, changeSheet, chatatABC, checkCF, checkCellIsLocked, checkProtectionAllSelected, checkProtectionFormatCells, checkProtectionSelectLockedOrUnLockedCells, checkboxChange, clearFilter, clearMeasureTextCache, colHasMerged, colLocation, colLocationByIndex, colors, columnCharToIndex, commentBoxProps, compute, computeRowlenArr, confirmMessage, convertCssToStyleList, convertSpanToShareString, copy, createDropCellRange, createFilter, createFilterOptions, createFormulaRangeSelect, createRangeHightlight, dataRangeSelection, datenum_local, defaultContext, defaultFont, defaultSettings, defaultStyle, delFunctionGroup, deleteCellInSave, deleteComment, deleteRowCol, deleteSelectedCellText, deleteSheet, diff, drawArrow, drawLineInfo, dropCellCache, editComment, editSheetName, ensureSheetIndex, error, escapeHTMLTag, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHintText, getHistoryRules, getInlineStringHTML, getInlineStringNoStyle, getMeasureText, getNowDateTime, getNullData, getOptionValue, getOrigincell, getQKBorder, getRange, getRangeArr, getRangeByTxt, getRangetxt, getRealCellValue, getRegExpStr, getRegStr, getRowMerge, getSearchIndexArr, getSelectRange, getSheetByIndex, getSheetIdByName, getSheetIndex, getStyleByCell, getTypeItemHide, getcellFormula, getcellrange, getdatabyselection, getrangeseleciton, goToLink, groupValuesRefresh, handleArrowKey, handleBold, handleBorder, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePercentageFormat, handleRowFreezeHandleMouseDown, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleScreenShot, handleSort, handleStrikeThrough, handleSum, handleTextBackground, handleTextColor, handleTextSize, handleUnderline, handleVerticalAlign, handleWithCtrlOrMetaKey, hasChinaword, hasPartMC, hideCRCount, hideDropCellSelection, hideSelected, imageProps, indexToColumnChar, initFreeze, initSheetIndex, inlineStyleAffectAttribute, inlineStyleAffectCssName, insertImage, insertRowCol, insertUpdateFunctionGroup, inverseRowColOptions, isAllSelectedCellsInStatus, isAllowEdit, isInlineStringCT, isInlineStringCell, isLinkValid, isRealNull, isRealNum, isShowHidenCR, isSupportBoundingBox, is_date, iscelldata, isdatatype, isdatatypemulti, isdatetime, israngeseleciton, jfrefreshgrid, labelFilterOptionState, locale, luckysheetUpdateCell, mergeBorder, mergeCells, mergeMoveMain, mousePosition, moveHighlightCell, moveHighlightRange, moveToEnd, newComment, normalizeSelection, normalizedAttr, normalizedCellAttr, onCellsMove, onCellsMoveEnd, onCellsMoveStart, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxMoveStart, onCommentBoxResize, onCommentBoxResizeEnd, onCommentBoxResizeStart, onDropCellSelect, onDropCellSelectEnd, onFormulaRangeDragEnd, onImageMove, onImageMoveEnd, onImageMoveStart, onImageResize, onImageResizeEnd, onImageResizeStart, onRangeSelectionModalMove, onRangeSelectionModalMoveEnd, onRangeSelectionModalMoveStart, onSearchDialogMove, onSearchDialogMoveEnd, onSearchDialogMoveStart, opToPatch, orderbydata, orderbydatafiler, overShowComment, pasteHandlerOfPaintModel, patchToOp, rangeDrag, rangeDragColumn, rangeDragRow, rangeHightlightselected, rangeSetValue, rangeValueToHtml, removeActiveImage, removeEditingComment, removeHyperlink, replace, replaceAll, replaceHtml, rgbToHex, rowHasMerged, rowLocation, rowLocationByIndex, saveFilter, saveHyperlink, saveImage, scrollToFrozenRowCol, scrollToHighlightCell, searchAll, searchNext, selectAll, selectIsOverlap, selectTextContent, selectTextContentCross, selectTitlesMap, selectTitlesRange, selectionCache, selectionCopyShow, seletedHighlistByindex, setCaretPosition, setCellValue, setConditionRules, setDropcownValue, setEditingComment, showComments, showDropCellSelection, showHideAllComments, showHideComment, showImgChooser, showLinkCard, showSelected, sortDataRange, sortSelection, storeSheetParamALL, toolbarItemClickHandler, toolbarItemSelectedFunc, update, updateCell, updateContextWithCanvas, updateContextWithSheetData, updateDropCell, updateFormat, updateFormatCell, updateInlineStringFormat, updateInlineStringFormatOutside, updateItem, updateMoreCell, updateSheet, validateCellData, validateIdCard, valueIsError, valueShowEs };
79847
+ export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, index as api, applyLocation, attrToCssName, autoSelectionFormula, calcSelectionInfo, cancelActiveImgItem, cancelFunctionrangeSelected, cancelNormalSelected, cancelPaintModel, cellFocus, cfSplitRange, changeSheet, chatatABC, checkCF, checkCellIsLocked, checkProtectionAllSelected, checkProtectionFormatCells, checkProtectionSelectLockedOrUnLockedCells, checkboxChange, clearFilter, clearMeasureTextCache, colHasMerged, colLocation, colLocationByIndex, colors, columnCharToIndex, commentBoxProps, compute, computeRowlenArr, confirmMessage, convertCssToStyleList, convertSpanToShareString, copy, createDropCellRange, createFilter, createFilterOptions, createFormulaRangeSelect, createRangeHightlight, dataRangeSelection, datenum_local, defaultContext, defaultFont, defaultSettings, defaultStyle, delFunctionGroup, deleteCellInSave, deleteComment, deleteRowCol, deleteSelectedCellText, deleteSheet, diff, drawArrow, drawLineInfo, dropCellCache, editComment, editSheetName, ensureSheetIndex, error, escapeHTMLTag, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHintText, getHistoryRules, getInlineStringHTML, getInlineStringNoStyle, getMeasureText, getNowDateTime, getNullData, getOptionValue, getOrigincell, getQKBorder, getRange, getRangeArr, getRangeByTxt, getRangetxt, getRealCellValue, getRegExpStr, getRegStr, getRowMerge, getSearchIndexArr, getSelectRange, getSheetByIndex, getSheetIdByName, getSheetIndex, getStyleByCell, getTypeItemHide, getcellFormula, getcellrange, getdatabyselection, getrangeseleciton, goToLink, groupValuesRefresh, handleArrowKey, handleBold, handleBorder, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePercentageFormat, handleRowFreezeHandleMouseDown, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleScreenShot, handleSort, handleStrikeThrough, handleSum, handleTextBackground, handleTextColor, handleTextSize, handleUnderline, handleVerticalAlign, handleWithCtrlOrMetaKey, hasChinaword, hasPartMC, hideCRCount, hideDropCellSelection, hideSelected, imageProps, indexToColumnChar, initFreeze, initSheetIndex, inlineStyleAffectAttribute, inlineStyleAffectCssName, insertImage, insertRowCol, insertUpdateFunctionGroup, inverseRowColOptions, isAllSelectedCellsInStatus, isAllowEdit, isInlineStringCT, isInlineStringCell, isLinkValid, isRealNull, isRealNum, isShowHidenCR, isSupportBoundingBox, is_date, iscelldata, isdatatype, isdatatypemulti, isdatetime, israngeseleciton, jfrefreshgrid, labelFilterOptionState, locale, luckysheetUpdateCell, mergeBorder, mergeCells, mergeMoveMain, mousePosition, moveHighlightCell, moveHighlightRange, moveToEnd, newComment, normalizeSelection, normalizedAttr, normalizedCellAttr, onCellsMove, onCellsMoveEnd, onCellsMoveStart, onCommentBoxMove, onCommentBoxMoveEnd, onCommentBoxMoveStart, onCommentBoxResize, onCommentBoxResizeEnd, onCommentBoxResizeStart, onDropCellSelect, onDropCellSelectEnd, onFormulaRangeDragEnd, onImageMove, onImageMoveEnd, onImageMoveStart, onImageResize, onImageResizeEnd, onImageResizeStart, onRangeSelectionModalMove, onRangeSelectionModalMoveEnd, onRangeSelectionModalMoveStart, onSearchDialogMove, onSearchDialogMoveEnd, onSearchDialogMoveStart, opToPatch, orderbydata, orderbydatafiler, overShowComment, pasteHandlerOfPaintModel, patchToOp, rangeDrag, rangeDragColumn, rangeDragRow, rangeHightlightselected, rangeSetValue, rangeValueToHtml, removeActiveImage, removeEditingComment, removeHyperlink, removeOverShowComment, replace, replaceAll, replaceHtml, rgbToHex, rowHasMerged, rowLocation, rowLocationByIndex, saveFilter, saveHyperlink, saveImage, scrollToFrozenRowCol, scrollToHighlightCell, searchAll, searchNext, selectAll, selectIsOverlap, selectTextContent, selectTextContentCross, selectTitlesMap, selectTitlesRange, selectionCache, selectionCopyShow, seletedHighlistByindex, setCaretPosition, setCellValue, setConditionRules, setDropcownValue, setEditingComment, showComments, showDropCellSelection, showHideAllComments, showHideComment, showImgChooser, showLinkCard, showSelected, sortDataRange, sortSelection, storeSheetParamALL, toolbarItemClickHandler, toolbarItemSelectedFunc, update, updateCell, updateContextWithCanvas, updateContextWithSheetData, updateDropCell, updateFormat, updateFormatCell, updateInlineStringFormat, updateInlineStringFormatOutside, updateItem, updateMoreCell, updateSheet, validateCellData, validateIdCard, valueIsError, valueShowEs };
package/dist/index.js CHANGED
@@ -68962,6 +68962,7 @@ function drawArrow(rc, _ref, color, theta, headlen) {
68962
68962
  fromY = _ref.fromY,
68963
68963
  toX = _ref.toX,
68964
68964
  toY = _ref.toY;
68965
+ if (rc) return;
68965
68966
  var canvas = document.getElementById("arrowCanvas-".concat(rc));
68966
68967
  var ctx = canvas.getContext("2d");
68967
68968
  if (!canvas || !ctx) return;
@@ -69107,7 +69108,9 @@ function newComment(ctx, globalCache, r, c) {
69107
69108
  if (((_ctx$hooks$beforeInse = (_ctx$hooks3 = ctx.hooks).beforeInsertComment) === null || _ctx$hooks$beforeInse === void 0 ? void 0 : _ctx$hooks$beforeInse.call(_ctx$hooks3, r, c)) === false) {
69108
69109
  return;
69109
69110
  }
69110
- removeEditingComment(ctx, globalCache);
69111
+ if (globalCache) {
69112
+ removeEditingComment(ctx, globalCache);
69113
+ }
69111
69114
  var flowdata = getFlowdata(ctx);
69112
69115
  if (!flowdata) return;
69113
69116
  var cell = flowdata[r][c];
@@ -69245,8 +69248,11 @@ function showHideAllComments(ctx) {
69245
69248
  }
69246
69249
  }
69247
69250
  }
69251
+ function removeOverShowComment(ctx) {
69252
+ ctx.hoveredCommentBox = undefined;
69253
+ }
69248
69254
  function overShowComment(ctx, e, scrollX, scrollY, container) {
69249
- var _flowdata$r, _flowdata$r$c4, _ctx$editingCommentBo, _ctx$hoveredCommentBo;
69255
+ var _ctx$luckysheet_selec, _flowdata$r, _flowdata$r$c4, _ctx$editingCommentBo, _ctx$hoveredCommentBo;
69250
69256
  var flowdata = getFlowdata(ctx);
69251
69257
  if (!flowdata) return;
69252
69258
  var scrollLeft = scrollX.scrollLeft;
@@ -69267,6 +69273,13 @@ function overShowComment(ctx, e, scrollX, scrollY, container) {
69267
69273
  var _margeset$column2 = _slicedToArray(margeset.column, 3);
69268
69274
  c = _margeset$column2[2];
69269
69275
  }
69276
+ var firstSelection = (_ctx$luckysheet_selec = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec === void 0 ? void 0 : _ctx$luckysheet_selec[0];
69277
+ var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
69278
+ var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
69279
+ if (r === row_index && c === col_index) {
69280
+ ctx.hoveredCommentBox = undefined;
69281
+ return;
69282
+ }
69270
69283
  var rc = "".concat(r, "_").concat(c);
69271
69284
  var comment = (_flowdata$r = flowdata[r]) === null || _flowdata$r === void 0 ? void 0 : (_flowdata$r$c4 = _flowdata$r[c]) === null || _flowdata$r$c4 === void 0 ? void 0 : _flowdata$r$c4.ps;
69272
69285
  if (comment == null || comment.isShow || ___default['default'].findIndex(ctx.commentBoxes, function (v) {
@@ -72872,13 +72885,13 @@ var Canvas = /*#__PURE__*/function () {
72872
72885
  renderCtx.fillText(___default['default'].isNil(value) ? "" : value, horizonAlignPos, verticalAlignPos);
72873
72886
  }
72874
72887
  if (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps) {
72875
- var ps_w = 8 * this.sheetCtx.zoomRatio;
72876
- var ps_h = 8 * this.sheetCtx.zoomRatio;
72888
+ var ps_w = 12 * this.sheetCtx.zoomRatio;
72889
+ var ps_h = 12 * this.sheetCtx.zoomRatio;
72877
72890
  renderCtx.beginPath();
72878
72891
  renderCtx.moveTo(endX + offsetLeft - 1 - ps_w, startY + offsetTop);
72879
72892
  renderCtx.lineTo(endX + offsetLeft - 1, startY + offsetTop);
72880
72893
  renderCtx.lineTo(endX + offsetLeft - 1, startY + offsetTop + ps_h);
72881
- renderCtx.fillStyle = "#FC6666";
72894
+ renderCtx.fillStyle = "#EFC703";
72882
72895
  renderCtx.fill();
72883
72896
  renderCtx.closePath();
72884
72897
  }
@@ -72958,30 +72971,30 @@ var Canvas = /*#__PURE__*/function () {
72958
72971
  var index = getSheetIndex(this.sheetCtx, this.sheetCtx.currentSheetId);
72959
72972
  var dataVerification = this.sheetCtx.luckysheetfile[index].dataVerification;
72960
72973
  if ((dataVerification === null || dataVerification === void 0 ? void 0 : dataVerification["".concat(r, "_").concat(c)]) && !validateCellData(this.sheetCtx, dataVerification["".concat(r, "_").concat(c)], value)) {
72961
- var dv_w = 5 * this.sheetCtx.zoomRatio;
72962
- var dv_h = 5 * this.sheetCtx.zoomRatio;
72974
+ var dv_w = 9 * this.sheetCtx.zoomRatio;
72975
+ var dv_h = 9 * this.sheetCtx.zoomRatio;
72963
72976
  renderCtx.beginPath();
72964
72977
  renderCtx.moveTo(startX + offsetLeft, startY + offsetTop);
72965
72978
  renderCtx.lineTo(startX + offsetLeft + dv_w, startY + offsetTop);
72966
72979
  renderCtx.lineTo(startX + offsetLeft, startY + offsetTop + dv_h);
72967
- renderCtx.fillStyle = "#FC6666";
72980
+ renderCtx.fillStyle = "#EFC703";
72968
72981
  renderCtx.fill();
72969
72982
  renderCtx.closePath();
72970
72983
  }
72971
72984
  if (cell === null || cell === void 0 ? void 0 : cell.ps) {
72972
- var ps_w = 8 * this.sheetCtx.zoomRatio;
72973
- var ps_h = 8 * this.sheetCtx.zoomRatio;
72985
+ var ps_w = 12 * this.sheetCtx.zoomRatio;
72986
+ var ps_h = 12 * this.sheetCtx.zoomRatio;
72974
72987
  renderCtx.beginPath();
72975
72988
  renderCtx.moveTo(endX + offsetLeft - ps_w, startY + offsetTop);
72976
72989
  renderCtx.lineTo(endX + offsetLeft, startY + offsetTop);
72977
72990
  renderCtx.lineTo(endX + offsetLeft, startY + offsetTop + ps_h);
72978
- renderCtx.fillStyle = "#FC6666";
72991
+ renderCtx.fillStyle = "#EFC703";
72979
72992
  renderCtx.fill();
72980
72993
  renderCtx.closePath();
72981
72994
  }
72982
72995
  if ((cell === null || cell === void 0 ? void 0 : cell.qp) === 1 && isRealNum$1(cell === null || cell === void 0 ? void 0 : cell.v)) {
72983
- var _ps_w = 6 * this.sheetCtx.zoomRatio;
72984
- var _ps_h = 6 * this.sheetCtx.zoomRatio;
72996
+ var _ps_w = 10 * this.sheetCtx.zoomRatio;
72997
+ var _ps_h = 10 * this.sheetCtx.zoomRatio;
72985
72998
  renderCtx.beginPath();
72986
72999
  renderCtx.moveTo(startX + offsetLeft + _ps_w - 1, startY + offsetTop);
72987
73000
  renderCtx.lineTo(startX + offsetLeft - 1, startY + offsetTop);
@@ -76309,8 +76322,8 @@ var defaultSettings = {
76309
76322
  defaultColWidth: 73,
76310
76323
  defaultRowHeight: 19,
76311
76324
  defaultFontSize: 10,
76312
- toolbarItems: ["undo", "redo", "format-painter", "|", "currency-format", "percentage-format", "number-decrease", "number-increase", "format", "|", "font", "|", "font-size", "|", "bold", "italic", "strike-through", "|", "font-color", "background", "border", "merge-cell", "|", "horizontal-align", "vertical-align", "text-wrap", "|", "conditionFormat", "filter", "link", "image", "quick-formula", "dataVerification", "screenshot", "search"],
76313
- cellContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA", "filter", "chart", "image", "link", "data", "cell-format"],
76325
+ toolbarItems: ["undo", "redo", "format-painter", "clear-format", "|", "currency-format", "percentage-format", "number-decrease", "number-increase", "format", "|", "font", "|", "font-size", "|", "bold", "italic", "strike-through", "underline", "|", "font-color", "background", "border", "merge-cell", "|", "horizontal-align", "vertical-align", "text-wrap", "text-rotation", "|", "freeze", "conditionFormat", "filter", "link", "image", "comment", "quick-formula", "dataVerification", "splitColumn", "locationCondition", "screenshot", "search"],
76326
+ cellContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA", "filter", "chart", "image", "link", "data", "cell-format", "comment"],
76314
76327
  headerContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA"],
76315
76328
  sheetTabContextMenu: ["delete", "copy", "rename", "color", "hide", "|", "move"],
76316
76329
  filterContextMenu: ["sort-by-asc", "sort-by-desc", "|", "filter-by-color", "|", "filter-by-value"],
@@ -76319,7 +76332,8 @@ var defaultSettings = {
76319
76332
  },
76320
76333
  hooks: {},
76321
76334
  customToolbarItems: [],
76322
- currency: "¥"
76335
+ currency: "¥",
76336
+ getCommentCellUI: null
76323
76337
  };
76324
76338
 
76325
76339
  function handleCopy(ctx) {
@@ -76720,6 +76734,7 @@ var mouseWheelUniqueTimeout;
76720
76734
  var scrollLockTimeout;
76721
76735
  function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
76722
76736
  var _cache$searchDialog;
76737
+ removeEditingComment(ctx, cache);
76723
76738
  if (((_cache$searchDialog = cache.searchDialog) === null || _cache$searchDialog === void 0 ? void 0 : _cache$searchDialog.mouseEnter) && ctx.showSearch && ctx.showReplace) return;
76724
76739
  if (ctx.filterContextMenu != null) return;
76725
76740
  var scrollLeft = scrollbarX.scrollLeft;
@@ -76864,6 +76879,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
76864
76879
  return;
76865
76880
  }
76866
76881
  cellFocus(ctx, row_index, col_index, true);
76882
+ editComment(ctx, globalCache, row_index, col_index);
76867
76883
  if (!inHorizontalFreeze && !inVerticalFreeze) {
76868
76884
  if (col_pre < ctx.scrollLeft) {
76869
76885
  ctx.scrollLeft = col_pre;
@@ -77160,6 +77176,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
77160
77176
  }
77161
77177
  function handleCellAreaDoubleClick(ctx, globalCache, settings, e, container) {
77162
77178
  var _globalCache$freezen2;
77179
+ console.log("handleCellAreaDoubleClick");
77163
77180
  var flowdata = getFlowdata(ctx);
77164
77181
  if (!flowdata) return;
77165
77182
  if (ctx.luckysheetCellUpdate.length > 0 && ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
@@ -77180,6 +77197,8 @@ function handleCellAreaDoubleClick(ctx, globalCache, settings, e, container) {
77180
77197
  var row_index = row_location[2];
77181
77198
  var col_location = colLocation(x, ctx.visibledatacolumn);
77182
77199
  var col_index = col_location[2];
77200
+ removeOverShowComment(ctx);
77201
+ removeEditingComment(ctx, globalCache);
77183
77202
  var index = getSheetIndex(ctx, ctx.currentSheetId);
77184
77203
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
77185
77204
  if (dataVerification) {
@@ -77632,6 +77651,7 @@ function handleOverlayMouseMove(ctx, globalCache, e, cellInput, scrollX, scrollY
77632
77651
  if (onImageMove(ctx, globalCache, e)) return;
77633
77652
  if (onImageResize(ctx, globalCache, e)) return;
77634
77653
  onCellsMove(ctx, globalCache, e, scrollX, scrollY, container);
77654
+ var inputBoxContainer = document.getElementsByClassName("luckysheet-input-box")[0];
77635
77655
  overShowComment(ctx, e, scrollX, scrollY, container);
77636
77656
  onSearchDialogMove(globalCache, e);
77637
77657
  onRangeSelectionModalMove(globalCache, e);
@@ -80102,6 +80122,7 @@ exports.rangeValueToHtml = rangeValueToHtml;
80102
80122
  exports.removeActiveImage = removeActiveImage;
80103
80123
  exports.removeEditingComment = removeEditingComment;
80104
80124
  exports.removeHyperlink = removeHyperlink;
80125
+ exports.removeOverShowComment = removeOverShowComment;
80105
80126
  exports.replace = replace;
80106
80127
  exports.replaceAll = replaceAll;
80107
80128
  exports.replaceHtml = replaceHtml;
@@ -63,7 +63,7 @@ export declare function getCommentBoxByRC(ctx: Context, flowdata: CellMatrix, r:
63
63
  };
64
64
  export declare function setEditingComment(ctx: Context, flowdata: CellMatrix, r: number, c: number): void;
65
65
  export declare function removeEditingComment(ctx: Context, globalCache: GlobalCache): void;
66
- export declare function newComment(ctx: Context, globalCache: GlobalCache, r: number, c: number): void;
66
+ export declare function newComment(ctx: Context, globalCache: GlobalCache | undefined, r: number, c: number): void;
67
67
  export declare function editComment(ctx: Context, globalCache: GlobalCache, r: number, c: number): void;
68
68
  export declare function deleteComment(ctx: Context, globalCache: GlobalCache, r: number, c: number): void;
69
69
  export declare function showComments(ctx: Context, commentShowCells: {
@@ -72,6 +72,7 @@ export declare function showComments(ctx: Context, commentShowCells: {
72
72
  }[]): void;
73
73
  export declare function showHideComment(ctx: Context, globalCache: GlobalCache, r: number, c: number): void;
74
74
  export declare function showHideAllComments(ctx: Context): void;
75
+ export declare function removeOverShowComment(ctx: Context): void;
75
76
  export declare function overShowComment(ctx: Context, e: MouseEvent, scrollX: HTMLDivElement, scrollY: HTMLDivElement, container: HTMLDivElement): void;
76
77
  export declare function getCommentBoxPosition(commentId: string): {
77
78
  left: number;
@@ -80,6 +80,7 @@ export type Settings = {
80
80
  headerContextMenu?: string[];
81
81
  sheetTabContextMenu?: string[];
82
82
  filterContextMenu?: string[];
83
+ getCommentCellUI?: ((row: number, column: number) => React.ReactNode) | null;
83
84
  generateSheetId?: () => string;
84
85
  hooks?: Hooks;
85
86
  customToolbarItems?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.0.2-mod-13",
3
+ "version": "1.0.2-mod-15",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",