@leankylin-sheet/core 4.0.34 → 4.0.36
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/context.d.ts +1 -0
- package/dist/index.esm.js +33 -14
- package/dist/index.js +33 -13
- package/dist/modules/cell.d.ts +1 -1
- package/dist/modules/color.d.ts +1 -0
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -35379,6 +35379,9 @@ function valueShowEs(r, c, d) {
|
|
|
35379
35379
|
}
|
|
35380
35380
|
|
|
35381
35381
|
var colors = ["#c1232b", "#27727b", "#fcce10", "#e87c25", "#b5c334", "#fe8463", "#9bca63", "#fad860", "#f3a43b", "#60c0dd", "#d7504b", "#c6e579", "#f4e001", "#f0805a", "#26c0c0", "#c12e34", "#e6b600", "#0098d9", "#2b821d", "#005eaa", "#339ca8", "#cda819", "#32a487", "#3fb1e3", "#6be6c1", "#626c91", "#a0a7e6", "#c4ebad", "#96dee8"];
|
|
35382
|
+
function getHLColor(index) {
|
|
35383
|
+
return colors[index % colors.length];
|
|
35384
|
+
}
|
|
35382
35385
|
|
|
35383
35386
|
function mousePosition(x, y, ctx) {
|
|
35384
35387
|
var newX = x - ctx.rowHeaderWidth;
|
|
@@ -36559,7 +36562,7 @@ function createRangeHightlight(ctx, inputInnerHtmlStr) {
|
|
|
36559
36562
|
formulaRanges.push(_objectSpread2(_objectSpread2({
|
|
36560
36563
|
rangeIndex: rangeIndex
|
|
36561
36564
|
}, rect), {}, {
|
|
36562
|
-
backgroundColor:
|
|
36565
|
+
backgroundColor: getHLColor(rangeIndex)
|
|
36563
36566
|
}));
|
|
36564
36567
|
}
|
|
36565
36568
|
}
|
|
@@ -36823,7 +36826,7 @@ function functionHTML(txt) {
|
|
|
36823
36826
|
if (i === funcstack.length - 1) {
|
|
36824
36827
|
if (iscelldata(_.trim(str))) {
|
|
36825
36828
|
var rangeIndex = rangeIndexes.length > functionHTMLIndex ? rangeIndexes[functionHTMLIndex] : functionHTMLIndex;
|
|
36826
|
-
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
36829
|
+
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(rangeIndex), ";\">").concat(str, "</span>");
|
|
36827
36830
|
functionHTMLIndex += 1;
|
|
36828
36831
|
} else if (matchConfig.dquote > 0) {
|
|
36829
36832
|
function_str += "".concat(str, "</span>");
|
|
@@ -37285,7 +37288,7 @@ function functionStrChange(txt, type, rc, orient, stindex, step, sheetName, isCu
|
|
|
37285
37288
|
return function_str;
|
|
37286
37289
|
}
|
|
37287
37290
|
function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
37288
|
-
var _document$activeEleme;
|
|
37291
|
+
var _document$activeEleme, _ctx$active_f;
|
|
37289
37292
|
var $editor = cellInput;
|
|
37290
37293
|
var $copyTo = fxInput;
|
|
37291
37294
|
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) === "luckysheet-functionbox-cell") {
|
|
@@ -37295,13 +37298,14 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37295
37298
|
var range = "";
|
|
37296
37299
|
var rf = selected.row[0];
|
|
37297
37300
|
var cf = selected.column[0];
|
|
37301
|
+
var sheetId = ((_ctx$active_f = ctx.active_f) === null || _ctx$active_f === void 0 ? void 0 : _ctx$active_f.sheetId) || ctx.formulaCache.rangetosheet;
|
|
37298
37302
|
if (ctx.config.merge != null && "".concat(rf, "_").concat(cf) in ctx.config.merge) {
|
|
37299
37303
|
range = getRangetxt(ctx, ctx.currentSheetId, {
|
|
37300
37304
|
column: [cf, cf],
|
|
37301
37305
|
row: [rf, rf]
|
|
37302
|
-
},
|
|
37306
|
+
}, sheetId);
|
|
37303
37307
|
} else {
|
|
37304
|
-
range = getRangetxt(ctx, ctx.currentSheetId, selected,
|
|
37308
|
+
range = getRangetxt(ctx, ctx.currentSheetId, selected, sheetId);
|
|
37305
37309
|
}
|
|
37306
37310
|
if (!israngeseleciton(ctx) && (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start)) {
|
|
37307
37311
|
var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
@@ -37309,8 +37313,8 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37309
37313
|
span.innerHTML = range;
|
|
37310
37314
|
setCaretPosition(ctx, span, 0, range.length);
|
|
37311
37315
|
}
|
|
37312
|
-
} else {
|
|
37313
|
-
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
37316
|
+
} else if (ctx.active_f) {
|
|
37317
|
+
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37314
37318
|
var newEle = parseElement(function_str);
|
|
37315
37319
|
var refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37316
37320
|
if (refEle && refEle.parentNode) {
|
|
@@ -37322,6 +37326,19 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37322
37326
|
var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37323
37327
|
setCaretPosition(ctx, _span, 0, range.length);
|
|
37324
37328
|
functionHTMLIndex += 1;
|
|
37329
|
+
} else {
|
|
37330
|
+
var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37331
|
+
var _newEle = parseElement(_function_str);
|
|
37332
|
+
var _refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37333
|
+
if (_refEle && _refEle.parentNode) {
|
|
37334
|
+
_refEle.parentNode.insertBefore(_newEle, _refEle.nextSibling);
|
|
37335
|
+
} else {
|
|
37336
|
+
$editor.appendChild(_newEle);
|
|
37337
|
+
}
|
|
37338
|
+
ctx.formulaCache.rangechangeindex = functionHTMLIndex;
|
|
37339
|
+
var _span2 = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37340
|
+
setCaretPosition(ctx, _span2, 0, range.length);
|
|
37341
|
+
functionHTMLIndex += 1;
|
|
37325
37342
|
}
|
|
37326
37343
|
if ($copyTo) $copyTo.innerHTML = $editor.innerHTML;
|
|
37327
37344
|
}
|
|
@@ -40181,11 +40198,11 @@ function cancelNormalSelected(ctx) {
|
|
|
40181
40198
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
40182
40199
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
40183
40200
|
}
|
|
40184
|
-
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
40201
|
+
function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
40185
40202
|
var _inputText, _curv, _ctx$hooks$beforeUpda, _ctx$hooks, _curv2;
|
|
40186
40203
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
40187
40204
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
40188
|
-
var flowdata = getFlowdata(ctx);
|
|
40205
|
+
var flowdata = getFlowdata(ctx, sheetId);
|
|
40189
40206
|
if (!flowdata) return;
|
|
40190
40207
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
40191
40208
|
var dataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
@@ -45437,6 +45454,8 @@ function insertRowCol(ctx, op) {
|
|
|
45437
45454
|
ctx.luckysheet_select_save = range;
|
|
45438
45455
|
}
|
|
45439
45456
|
}
|
|
45457
|
+
file.luckysheet_select_save = undefined;
|
|
45458
|
+
ctx.luckysheet_select_save = undefined;
|
|
45440
45459
|
refreshLocalMergeData(merge_new, file);
|
|
45441
45460
|
if (ctx.hooks.rowColChange) {
|
|
45442
45461
|
ctx.hooks.rowColChange({
|
|
@@ -56465,7 +56484,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
56465
56484
|
ctx.luckysheet_selection_range = [];
|
|
56466
56485
|
}
|
|
56467
56486
|
var allowEdit = isAllowEdit(ctx);
|
|
56468
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56487
|
+
if ((ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56469
56488
|
return;
|
|
56470
56489
|
}
|
|
56471
56490
|
if (kstr === "Enter") {
|
|
@@ -56646,8 +56665,8 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56646
56665
|
if (isInSelection) return;
|
|
56647
56666
|
}
|
|
56648
56667
|
ctx.luckysheet_scroll_status = true;
|
|
56649
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
56650
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56668
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) {
|
|
56669
|
+
if (ctx.active_f || ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56651
56670
|
var _$last;
|
|
56652
56671
|
var rowseleted = [row_index, row_index_ed];
|
|
56653
56672
|
var columnseleted = [col_index, col_index_ed];
|
|
@@ -56766,7 +56785,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56766
56785
|
row_focus: row_index,
|
|
56767
56786
|
column_focus: col_index
|
|
56768
56787
|
};
|
|
56769
|
-
} else {
|
|
56788
|
+
} else if (ctx.active_f) ; else {
|
|
56770
56789
|
ctx.formulaCache.func_selectedrange = {
|
|
56771
56790
|
left: left,
|
|
56772
56791
|
width: width,
|
|
@@ -60061,4 +60080,4 @@ function handlePasteByClick(ctx, triggerType) {
|
|
|
60061
60080
|
} else if (data.indexOf("leankylin-copy-action-image") > -1) ; else ;
|
|
60062
60081
|
}
|
|
60063
60082
|
|
|
60064
|
-
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, 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, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, getCellRowColumn, getCellTextInfo, getCellTopRightPostion, getCellValue, getClipboardContent, 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, handleCellAreaDragOver, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellDrop, 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, 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, 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 };
|
|
60083
|
+
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, 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, escapeScriptTag, execFunctionGroup, execfunction, expandRowsAndColumns, extractFormulaCellOps, filterPatch, fixColumnStyleOverflowInFreeze, fixPositionOnFrozenCells, fixRowStyleOverflowInFreeze, functionCopy, functionHTMLGenerate, functionStrChange, genarate, generateRandomId, generateRandomSheetName, getAllFunctionGroup, getArrowCanvasSize, getBorderInfoCompute, getBorderInfoComputeRange, getCellHyperlink, 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, 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, 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
|
@@ -35389,6 +35389,9 @@ function valueShowEs(r, c, d) {
|
|
|
35389
35389
|
}
|
|
35390
35390
|
|
|
35391
35391
|
var colors = ["#c1232b", "#27727b", "#fcce10", "#e87c25", "#b5c334", "#fe8463", "#9bca63", "#fad860", "#f3a43b", "#60c0dd", "#d7504b", "#c6e579", "#f4e001", "#f0805a", "#26c0c0", "#c12e34", "#e6b600", "#0098d9", "#2b821d", "#005eaa", "#339ca8", "#cda819", "#32a487", "#3fb1e3", "#6be6c1", "#626c91", "#a0a7e6", "#c4ebad", "#96dee8"];
|
|
35392
|
+
function getHLColor(index) {
|
|
35393
|
+
return colors[index % colors.length];
|
|
35394
|
+
}
|
|
35392
35395
|
|
|
35393
35396
|
function mousePosition(x, y, ctx) {
|
|
35394
35397
|
var newX = x - ctx.rowHeaderWidth;
|
|
@@ -36569,7 +36572,7 @@ function createRangeHightlight(ctx, inputInnerHtmlStr) {
|
|
|
36569
36572
|
formulaRanges.push(_objectSpread2(_objectSpread2({
|
|
36570
36573
|
rangeIndex: rangeIndex
|
|
36571
36574
|
}, rect), {}, {
|
|
36572
|
-
backgroundColor:
|
|
36575
|
+
backgroundColor: getHLColor(rangeIndex)
|
|
36573
36576
|
}));
|
|
36574
36577
|
}
|
|
36575
36578
|
}
|
|
@@ -36833,7 +36836,7 @@ function functionHTML(txt) {
|
|
|
36833
36836
|
if (i === funcstack.length - 1) {
|
|
36834
36837
|
if (iscelldata(___default['default'].trim(str))) {
|
|
36835
36838
|
var rangeIndex = rangeIndexes.length > functionHTMLIndex ? rangeIndexes[functionHTMLIndex] : functionHTMLIndex;
|
|
36836
|
-
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
36839
|
+
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(rangeIndex), ";\">").concat(str, "</span>");
|
|
36837
36840
|
functionHTMLIndex += 1;
|
|
36838
36841
|
} else if (matchConfig.dquote > 0) {
|
|
36839
36842
|
function_str += "".concat(str, "</span>");
|
|
@@ -37295,7 +37298,7 @@ function functionStrChange(txt, type, rc, orient, stindex, step, sheetName, isCu
|
|
|
37295
37298
|
return function_str;
|
|
37296
37299
|
}
|
|
37297
37300
|
function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
37298
|
-
var _document$activeEleme;
|
|
37301
|
+
var _document$activeEleme, _ctx$active_f;
|
|
37299
37302
|
var $editor = cellInput;
|
|
37300
37303
|
var $copyTo = fxInput;
|
|
37301
37304
|
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) === "luckysheet-functionbox-cell") {
|
|
@@ -37305,13 +37308,14 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37305
37308
|
var range = "";
|
|
37306
37309
|
var rf = selected.row[0];
|
|
37307
37310
|
var cf = selected.column[0];
|
|
37311
|
+
var sheetId = ((_ctx$active_f = ctx.active_f) === null || _ctx$active_f === void 0 ? void 0 : _ctx$active_f.sheetId) || ctx.formulaCache.rangetosheet;
|
|
37308
37312
|
if (ctx.config.merge != null && "".concat(rf, "_").concat(cf) in ctx.config.merge) {
|
|
37309
37313
|
range = getRangetxt(ctx, ctx.currentSheetId, {
|
|
37310
37314
|
column: [cf, cf],
|
|
37311
37315
|
row: [rf, rf]
|
|
37312
|
-
},
|
|
37316
|
+
}, sheetId);
|
|
37313
37317
|
} else {
|
|
37314
|
-
range = getRangetxt(ctx, ctx.currentSheetId, selected,
|
|
37318
|
+
range = getRangetxt(ctx, ctx.currentSheetId, selected, sheetId);
|
|
37315
37319
|
}
|
|
37316
37320
|
if (!israngeseleciton(ctx) && (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start)) {
|
|
37317
37321
|
var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
@@ -37319,8 +37323,8 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37319
37323
|
span.innerHTML = range;
|
|
37320
37324
|
setCaretPosition(ctx, span, 0, range.length);
|
|
37321
37325
|
}
|
|
37322
|
-
} else {
|
|
37323
|
-
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
37326
|
+
} else if (ctx.active_f) {
|
|
37327
|
+
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37324
37328
|
var newEle = parseElement(function_str);
|
|
37325
37329
|
var refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37326
37330
|
if (refEle && refEle.parentNode) {
|
|
@@ -37332,6 +37336,19 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37332
37336
|
var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37333
37337
|
setCaretPosition(ctx, _span, 0, range.length);
|
|
37334
37338
|
functionHTMLIndex += 1;
|
|
37339
|
+
} else {
|
|
37340
|
+
var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37341
|
+
var _newEle = parseElement(_function_str);
|
|
37342
|
+
var _refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37343
|
+
if (_refEle && _refEle.parentNode) {
|
|
37344
|
+
_refEle.parentNode.insertBefore(_newEle, _refEle.nextSibling);
|
|
37345
|
+
} else {
|
|
37346
|
+
$editor.appendChild(_newEle);
|
|
37347
|
+
}
|
|
37348
|
+
ctx.formulaCache.rangechangeindex = functionHTMLIndex;
|
|
37349
|
+
var _span2 = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37350
|
+
setCaretPosition(ctx, _span2, 0, range.length);
|
|
37351
|
+
functionHTMLIndex += 1;
|
|
37335
37352
|
}
|
|
37336
37353
|
if ($copyTo) $copyTo.innerHTML = $editor.innerHTML;
|
|
37337
37354
|
}
|
|
@@ -40191,11 +40208,11 @@ function cancelNormalSelected(ctx) {
|
|
|
40191
40208
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
40192
40209
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
40193
40210
|
}
|
|
40194
|
-
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
40211
|
+
function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
40195
40212
|
var _inputText, _curv, _ctx$hooks$beforeUpda, _ctx$hooks, _curv2;
|
|
40196
40213
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
40197
40214
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
40198
|
-
var flowdata = getFlowdata(ctx);
|
|
40215
|
+
var flowdata = getFlowdata(ctx, sheetId);
|
|
40199
40216
|
if (!flowdata) return;
|
|
40200
40217
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
40201
40218
|
var dataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
@@ -45447,6 +45464,8 @@ function insertRowCol(ctx, op) {
|
|
|
45447
45464
|
ctx.luckysheet_select_save = range;
|
|
45448
45465
|
}
|
|
45449
45466
|
}
|
|
45467
|
+
file.luckysheet_select_save = undefined;
|
|
45468
|
+
ctx.luckysheet_select_save = undefined;
|
|
45450
45469
|
refreshLocalMergeData(merge_new, file);
|
|
45451
45470
|
if (ctx.hooks.rowColChange) {
|
|
45452
45471
|
ctx.hooks.rowColChange({
|
|
@@ -56475,7 +56494,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
56475
56494
|
ctx.luckysheet_selection_range = [];
|
|
56476
56495
|
}
|
|
56477
56496
|
var allowEdit = isAllowEdit(ctx);
|
|
56478
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56497
|
+
if ((ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56479
56498
|
return;
|
|
56480
56499
|
}
|
|
56481
56500
|
if (kstr === "Enter") {
|
|
@@ -56656,8 +56675,8 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56656
56675
|
if (isInSelection) return;
|
|
56657
56676
|
}
|
|
56658
56677
|
ctx.luckysheet_scroll_status = true;
|
|
56659
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
56660
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56678
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) {
|
|
56679
|
+
if (ctx.active_f || ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56661
56680
|
var _$last;
|
|
56662
56681
|
var rowseleted = [row_index, row_index_ed];
|
|
56663
56682
|
var columnseleted = [col_index, col_index_ed];
|
|
@@ -56776,7 +56795,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56776
56795
|
row_focus: row_index,
|
|
56777
56796
|
column_focus: col_index
|
|
56778
56797
|
};
|
|
56779
|
-
} else {
|
|
56798
|
+
} else if (ctx.active_f) ; else {
|
|
56780
56799
|
ctx.formulaCache.func_selectedrange = {
|
|
56781
56800
|
left: left,
|
|
56782
56801
|
width: width,
|
|
@@ -60180,6 +60199,7 @@ exports.getFontSet = getFontSet;
|
|
|
60180
60199
|
exports.getFontStyleByCell = getFontStyleByCell;
|
|
60181
60200
|
exports.getFrozenHandleLeft = getFrozenHandleLeft;
|
|
60182
60201
|
exports.getFrozenHandleTop = getFrozenHandleTop;
|
|
60202
|
+
exports.getHLColor = getHLColor;
|
|
60183
60203
|
exports.getHintText = getHintText;
|
|
60184
60204
|
exports.getHistoryRules = getHistoryRules;
|
|
60185
60205
|
exports.getInlineStringHTML = getInlineStringHTML;
|
package/dist/modules/cell.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function mergeBorder(ctx: Context, d: CellMatrix, row_index: numb
|
|
|
12
12
|
export declare function mergeMoveMain(ctx: Context, columnseleted: number[], rowseleted: number[], s: Partial<Selection>, top: number, height: number, left: number, width: number): (number | number[])[] | null;
|
|
13
13
|
export declare function cancelFunctionrangeSelected(ctx: Context): void;
|
|
14
14
|
export declare function cancelNormalSelected(ctx: Context): void;
|
|
15
|
-
export declare function updateCell(ctx: Context, r: number, c: number, $input?: HTMLDivElement | null, value?: any, canvas?: CanvasRenderingContext2D): void;
|
|
15
|
+
export declare function updateCell(ctx: Context, r: number, c: number, $input?: HTMLDivElement | null, value?: any, canvas?: CanvasRenderingContext2D, sheetId?: string): void;
|
|
16
16
|
export declare function getOrigincell(ctx: Context, r: number, c: number, i: string): Cell | null;
|
|
17
17
|
export declare function getcellFormula(ctx: Context, r: number, c: number, i: string, data?: any): any;
|
|
18
18
|
export declare function getRange(ctx: Context): Range;
|
package/dist/modules/color.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.36",
|
|
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": "4.0.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "4.0.36",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|