@leankylin-sheet/core 7.0.25 → 7.0.27

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
@@ -53922,6 +53922,54 @@ function handleScreenShot(ctx) {
53922
53922
  return image.src;
53923
53923
  }
53924
53924
 
53925
+ function isFormulaReplaceValue(v) {
53926
+ return _.isString(v) && v.length > 1 && v.charAt(0) === "=";
53927
+ }
53928
+ function writeReplaceValue(ctx, r, c, d, sheetId, v) {
53929
+ var _d$r;
53930
+ if (!isFormulaReplaceValue(v)) {
53931
+ setCellValue(ctx, r, c, d, v);
53932
+ return false;
53933
+ }
53934
+ var cell = (_d$r = d[r]) === null || _d$r === void 0 ? void 0 : _d$r[c];
53935
+ if (cell != null && _typeof(cell) === "object" && "f" in cell) {
53936
+ delete cell.f;
53937
+ }
53938
+ var exec = execfunction(ctx, v, r, c, sheetId, false, true);
53939
+ setCellValue(ctx, r, c, d, {
53940
+ v: exec[1],
53941
+ f: exec[2]
53942
+ });
53943
+ return true;
53944
+ }
53945
+ function refreshAfterReplaceAll(ctx, cells) {
53946
+ if (cells.length === 0) return;
53947
+ var seen = new Set();
53948
+ var sheetIds = new Set();
53949
+ var exist = [];
53950
+ for (var i = 0; i < cells.length; i += 1) {
53951
+ var _cells$i = cells[i],
53952
+ r = _cells$i.r,
53953
+ c = _cells$i.c,
53954
+ sheetId = _cells$i.sheetId;
53955
+ var key = "".concat(sheetId, "_").concat(r, "_").concat(c);
53956
+ if (seen.has(key)) continue;
53957
+ seen.add(key);
53958
+ sheetIds.add(sheetId);
53959
+ exist.push({
53960
+ r: r,
53961
+ c: c,
53962
+ i: sheetId
53963
+ });
53964
+ }
53965
+ sheetIds.forEach(function (sheetId) {
53966
+ return updateFunctionGroup(ctx, sheetId);
53967
+ });
53968
+ ctx.formulaCache.execFunctionExist = exist;
53969
+ execFunctionGroup(ctx, null, null, null, null, undefined, false, true);
53970
+ groupValuesRefresh(ctx);
53971
+ ctx.formulaCache.execFunctionGlobalData = null;
53972
+ }
53925
53973
  function getSearchTargets(ctx) {
53926
53974
  var searchRangeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "all";
53927
53975
  var selectionRange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -54316,7 +54364,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
54316
54364
  }
54317
54365
  if (checkModes.wordCheck) {
54318
54366
  var v = replaceText;
54319
- setCellValue(ctx, r, c, d, v);
54367
+ writeReplaceValue(ctx, r, c, d, sheetId, v);
54320
54368
  } else {
54321
54369
  var regSource = checkModes.regCheck ? getRegExpStr(searchText) : escapeRegExpStr(searchText);
54322
54370
  var reg;
@@ -54336,7 +54384,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
54336
54384
  });
54337
54385
  } else {
54338
54386
  var _v = valueShowEs(r, c, d).toString().replace(reg, replaceText);
54339
- setCellValue(ctx, r, c, d, _v);
54387
+ writeReplaceValue(ctx, r, c, d, sheetId, _v);
54340
54388
  }
54341
54389
  }
54342
54390
  ctx.luckysheet_select_save = normalizeSelection(ctx, [{
@@ -54392,6 +54440,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54392
54440
  return findAndReplace.noReplceTip;
54393
54441
  }
54394
54442
  var replacedInCurrentSheet = [];
54443
+ var changedCells = [];
54395
54444
  var replaceCount = 0;
54396
54445
  if (checkModes.wordCheck) {
54397
54446
  for (var i = 0; i < matches.length; i += 1) {
@@ -54400,7 +54449,12 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54400
54449
  c = _matches$i.c,
54401
54450
  sheetId = _matches$i.sheetId,
54402
54451
  fd = _matches$i.flowdata;
54403
- setCellValue(ctx, r, c, fd, replaceText);
54452
+ writeReplaceValue(ctx, r, c, fd, sheetId, replaceText);
54453
+ changedCells.push({
54454
+ r: r,
54455
+ c: c,
54456
+ sheetId: sheetId
54457
+ });
54404
54458
  if (sheetId === ctx.currentSheetId) {
54405
54459
  replacedInCurrentSheet.push({
54406
54460
  row: [r, r],
@@ -54434,8 +54488,13 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54434
54488
  });
54435
54489
  } else {
54436
54490
  var v = valueShowEs(_r, _c, _fd).toString().replace(reg, replaceText);
54437
- setCellValue(ctx, _r, _c, _fd, v);
54491
+ writeReplaceValue(ctx, _r, _c, _fd, _sheetId, v);
54438
54492
  }
54493
+ changedCells.push({
54494
+ r: _r,
54495
+ c: _c,
54496
+ sheetId: _sheetId
54497
+ });
54439
54498
  if (_sheetId === ctx.currentSheetId) {
54440
54499
  replacedInCurrentSheet.push({
54441
54500
  row: [_r, _r],
@@ -54445,6 +54504,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54445
54504
  replaceCount += 1;
54446
54505
  }
54447
54506
  }
54507
+ refreshAfterReplaceAll(ctx, changedCells);
54448
54508
  if (replacedInCurrentSheet.length > 0) {
54449
54509
  ctx.luckysheet_select_save = normalizeSelection(ctx, replacedInCurrentSheet);
54450
54510
  }
@@ -61567,4 +61627,4 @@ function handlePasteByClick(ctx, triggerType) {
61567
61627
  } else if (data.indexOf("leankylin-copy-action-image") > -1) ; else ;
61568
61628
  }
61569
61629
 
61570
- export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, PAINT_MODEL_CURSOR, 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, copy2, 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, escapeRegExpStr, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellHyperlinkWithPayload, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getClipboardContent, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHLColor, 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, handleCellAreaDragOver, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellDrop, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleDropCellDoubleClick, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePasteByLeanklin, 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, setDateCellValue, setDropcownValue, setEditingComment, setNextSheet, 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 };
61630
+ export { CFSplitRange, Canvas, FormulaCache, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, PAINT_MODEL_CURSOR, 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, copy2, 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, escapeRegExpStr, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellHyperlinkWithPayload, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getClipboardContent, getColMerge, getColorGradation, getCommentBoxByRC, getCommentBoxPosition, getComputeMap, getCurrentRules, getDataArr, getDataBySelectionNoCopy, getDropdownList, getFailureText, getFilterColumnColors, getFilterColumnValues, getFlattenedRange, getFlowdata, getFontSet, getFontStyleByCell, getFrozenHandleLeft, getFrozenHandleTop, getHLColor, 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, handleCellAreaDragOver, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellDrop, handleClearFormat, handleColFreezeHandleMouseDown, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, handleContextMenu, handleCopy, handleCurrencyFormat, handleDropCellDoubleClick, handleFormatPainter, handleFormulaInput, handleFreeze, handleGlobalEnter, handleGlobalKeyDown, handleGlobalWheel, handleHorizontalAlign, handleItalic, handleKeydownForZoom, handleLink, handleMerge, handleNumberDecrease, handleNumberIncrease, handleOverlayMouseMove, handleOverlayMouseUp, handleOverlayTouchEnd, handleOverlayTouchMove, handleOverlayTouchStart, handlePaste, handlePasteByClick, handlePasteByLeanklin, 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, isFormulaReplaceValue, 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, refreshAfterReplaceAll, 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, setDateCellValue, setDropcownValue, setEditingComment, setNextSheet, 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, writeReplaceValue };
package/dist/index.js CHANGED
@@ -53932,6 +53932,54 @@ function handleScreenShot(ctx) {
53932
53932
  return image.src;
53933
53933
  }
53934
53934
 
53935
+ function isFormulaReplaceValue(v) {
53936
+ return ___default['default'].isString(v) && v.length > 1 && v.charAt(0) === "=";
53937
+ }
53938
+ function writeReplaceValue(ctx, r, c, d, sheetId, v) {
53939
+ var _d$r;
53940
+ if (!isFormulaReplaceValue(v)) {
53941
+ setCellValue(ctx, r, c, d, v);
53942
+ return false;
53943
+ }
53944
+ var cell = (_d$r = d[r]) === null || _d$r === void 0 ? void 0 : _d$r[c];
53945
+ if (cell != null && _typeof(cell) === "object" && "f" in cell) {
53946
+ delete cell.f;
53947
+ }
53948
+ var exec = execfunction(ctx, v, r, c, sheetId, false, true);
53949
+ setCellValue(ctx, r, c, d, {
53950
+ v: exec[1],
53951
+ f: exec[2]
53952
+ });
53953
+ return true;
53954
+ }
53955
+ function refreshAfterReplaceAll(ctx, cells) {
53956
+ if (cells.length === 0) return;
53957
+ var seen = new Set();
53958
+ var sheetIds = new Set();
53959
+ var exist = [];
53960
+ for (var i = 0; i < cells.length; i += 1) {
53961
+ var _cells$i = cells[i],
53962
+ r = _cells$i.r,
53963
+ c = _cells$i.c,
53964
+ sheetId = _cells$i.sheetId;
53965
+ var key = "".concat(sheetId, "_").concat(r, "_").concat(c);
53966
+ if (seen.has(key)) continue;
53967
+ seen.add(key);
53968
+ sheetIds.add(sheetId);
53969
+ exist.push({
53970
+ r: r,
53971
+ c: c,
53972
+ i: sheetId
53973
+ });
53974
+ }
53975
+ sheetIds.forEach(function (sheetId) {
53976
+ return updateFunctionGroup(ctx, sheetId);
53977
+ });
53978
+ ctx.formulaCache.execFunctionExist = exist;
53979
+ execFunctionGroup(ctx, null, null, null, null, undefined, false, true);
53980
+ groupValuesRefresh(ctx);
53981
+ ctx.formulaCache.execFunctionGlobalData = null;
53982
+ }
53935
53983
  function getSearchTargets(ctx) {
53936
53984
  var searchRangeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "all";
53937
53985
  var selectionRange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -54326,7 +54374,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
54326
54374
  }
54327
54375
  if (checkModes.wordCheck) {
54328
54376
  var v = replaceText;
54329
- setCellValue(ctx, r, c, d, v);
54377
+ writeReplaceValue(ctx, r, c, d, sheetId, v);
54330
54378
  } else {
54331
54379
  var regSource = checkModes.regCheck ? getRegExpStr(searchText) : escapeRegExpStr(searchText);
54332
54380
  var reg;
@@ -54346,7 +54394,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
54346
54394
  });
54347
54395
  } else {
54348
54396
  var _v = valueShowEs(r, c, d).toString().replace(reg, replaceText);
54349
- setCellValue(ctx, r, c, d, _v);
54397
+ writeReplaceValue(ctx, r, c, d, sheetId, _v);
54350
54398
  }
54351
54399
  }
54352
54400
  ctx.luckysheet_select_save = normalizeSelection(ctx, [{
@@ -54402,6 +54450,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54402
54450
  return findAndReplace.noReplceTip;
54403
54451
  }
54404
54452
  var replacedInCurrentSheet = [];
54453
+ var changedCells = [];
54405
54454
  var replaceCount = 0;
54406
54455
  if (checkModes.wordCheck) {
54407
54456
  for (var i = 0; i < matches.length; i += 1) {
@@ -54410,7 +54459,12 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54410
54459
  c = _matches$i.c,
54411
54460
  sheetId = _matches$i.sheetId,
54412
54461
  fd = _matches$i.flowdata;
54413
- setCellValue(ctx, r, c, fd, replaceText);
54462
+ writeReplaceValue(ctx, r, c, fd, sheetId, replaceText);
54463
+ changedCells.push({
54464
+ r: r,
54465
+ c: c,
54466
+ sheetId: sheetId
54467
+ });
54414
54468
  if (sheetId === ctx.currentSheetId) {
54415
54469
  replacedInCurrentSheet.push({
54416
54470
  row: [r, r],
@@ -54444,8 +54498,13 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54444
54498
  });
54445
54499
  } else {
54446
54500
  var v = valueShowEs(_r, _c, _fd).toString().replace(reg, replaceText);
54447
- setCellValue(ctx, _r, _c, _fd, v);
54501
+ writeReplaceValue(ctx, _r, _c, _fd, _sheetId, v);
54448
54502
  }
54503
+ changedCells.push({
54504
+ r: _r,
54505
+ c: _c,
54506
+ sheetId: _sheetId
54507
+ });
54449
54508
  if (_sheetId === ctx.currentSheetId) {
54450
54509
  replacedInCurrentSheet.push({
54451
54510
  row: [_r, _r],
@@ -54455,6 +54514,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
54455
54514
  replaceCount += 1;
54456
54515
  }
54457
54516
  }
54517
+ refreshAfterReplaceAll(ctx, changedCells);
54458
54518
  if (replacedInCurrentSheet.length > 0) {
54459
54519
  ctx.luckysheet_select_save = normalizeSelection(ctx, replacedInCurrentSheet);
54460
54520
  }
@@ -61789,6 +61849,7 @@ exports.insertUpdateFunctionGroup = insertUpdateFunctionGroup;
61789
61849
  exports.inverseRowColOptions = inverseRowColOptions;
61790
61850
  exports.isAllSelectedCellsInStatus = isAllSelectedCellsInStatus;
61791
61851
  exports.isAllowEdit = isAllowEdit;
61852
+ exports.isFormulaReplaceValue = isFormulaReplaceValue;
61792
61853
  exports.isInlineStringCT = isInlineStringCT;
61793
61854
  exports.isInlineStringCell = isInlineStringCell;
61794
61855
  exports.isLinkValid = isLinkValid;
@@ -61853,6 +61914,7 @@ exports.rangeDragRow = rangeDragRow;
61853
61914
  exports.rangeHightlightselected = rangeHightlightselected;
61854
61915
  exports.rangeSetValue = rangeSetValue;
61855
61916
  exports.rangeValueToHtml = rangeValueToHtml;
61917
+ exports.refreshAfterReplaceAll = refreshAfterReplaceAll;
61856
61918
  exports.removeActiveImage = removeActiveImage;
61857
61919
  exports.removeEditingComment = removeEditingComment;
61858
61920
  exports.removeHyperlink = removeHyperlink;
@@ -61914,3 +61976,4 @@ exports.validateCellData = validateCellData;
61914
61976
  exports.validateIdCard = validateIdCard;
61915
61977
  exports.valueIsError = valueIsError;
61916
61978
  exports.valueShowEs = valueShowEs;
61979
+ exports.writeReplaceValue = writeReplaceValue;
@@ -2,6 +2,13 @@ import { Context } from "../context";
2
2
  import { CellMatrix, SearchResult, GlobalCache } from "../types";
3
3
  export type SearchType = "v" | "m" | "f";
4
4
  export type SearchRangeType = "all" | "currentSheet" | "selection";
5
+ export declare function isFormulaReplaceValue(v: any): boolean;
6
+ export declare function writeReplaceValue(ctx: Context, r: number, c: number, d: CellMatrix, sheetId: string, v: any): boolean;
7
+ export declare function refreshAfterReplaceAll(ctx: Context, cells: {
8
+ r: number;
9
+ c: number;
10
+ sheetId: string;
11
+ }[]): void;
5
12
  export declare function getSearchIndexArr(searchText: string, range: {
6
13
  row: number[];
7
14
  column: number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "7.0.25",
3
+ "version": "7.0.27",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "build": "father-build"
14
14
  },
15
15
  "dependencies": {
16
- "@leankylin-sheet/formula-parser": "7.0.25",
16
+ "@leankylin-sheet/formula-parser": "7.0.27",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",