@leankylin-sheet/core 4.0.35 → 4.0.37
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 +59 -59
- package/dist/index.js +59 -58
- 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;
|
|
@@ -36168,6 +36171,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36168
36171
|
if (_.isNil(data)) {
|
|
36169
36172
|
data = getFlowdata(ctx);
|
|
36170
36173
|
}
|
|
36174
|
+
debugger;
|
|
36171
36175
|
if (_.isNil(ctx.formulaCache.execFunctionGlobalData)) {
|
|
36172
36176
|
ctx.formulaCache.execFunctionGlobalData = {};
|
|
36173
36177
|
}
|
|
@@ -36559,7 +36563,7 @@ function createRangeHightlight(ctx, inputInnerHtmlStr) {
|
|
|
36559
36563
|
formulaRanges.push(_objectSpread2(_objectSpread2({
|
|
36560
36564
|
rangeIndex: rangeIndex
|
|
36561
36565
|
}, rect), {}, {
|
|
36562
|
-
backgroundColor:
|
|
36566
|
+
backgroundColor: getHLColor(rangeIndex)
|
|
36563
36567
|
}));
|
|
36564
36568
|
}
|
|
36565
36569
|
}
|
|
@@ -36823,7 +36827,7 @@ function functionHTML(txt) {
|
|
|
36823
36827
|
if (i === funcstack.length - 1) {
|
|
36824
36828
|
if (iscelldata(_.trim(str))) {
|
|
36825
36829
|
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(
|
|
36830
|
+
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(rangeIndex), ";\">").concat(str, "</span>");
|
|
36827
36831
|
functionHTMLIndex += 1;
|
|
36828
36832
|
} else if (matchConfig.dquote > 0) {
|
|
36829
36833
|
function_str += "".concat(str, "</span>");
|
|
@@ -37285,7 +37289,7 @@ function functionStrChange(txt, type, rc, orient, stindex, step, sheetName, isCu
|
|
|
37285
37289
|
return function_str;
|
|
37286
37290
|
}
|
|
37287
37291
|
function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
37288
|
-
var _document$activeEleme;
|
|
37292
|
+
var _document$activeEleme, _ctx$active_f;
|
|
37289
37293
|
var $editor = cellInput;
|
|
37290
37294
|
var $copyTo = fxInput;
|
|
37291
37295
|
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) === "luckysheet-functionbox-cell") {
|
|
@@ -37295,13 +37299,14 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37295
37299
|
var range = "";
|
|
37296
37300
|
var rf = selected.row[0];
|
|
37297
37301
|
var cf = selected.column[0];
|
|
37302
|
+
var sheetId = ((_ctx$active_f = ctx.active_f) === null || _ctx$active_f === void 0 ? void 0 : _ctx$active_f.sheetId) || ctx.formulaCache.rangetosheet;
|
|
37298
37303
|
if (ctx.config.merge != null && "".concat(rf, "_").concat(cf) in ctx.config.merge) {
|
|
37299
37304
|
range = getRangetxt(ctx, ctx.currentSheetId, {
|
|
37300
37305
|
column: [cf, cf],
|
|
37301
37306
|
row: [rf, rf]
|
|
37302
|
-
},
|
|
37307
|
+
}, sheetId);
|
|
37303
37308
|
} else {
|
|
37304
|
-
range = getRangetxt(ctx, ctx.currentSheetId, selected,
|
|
37309
|
+
range = getRangetxt(ctx, ctx.currentSheetId, selected, sheetId);
|
|
37305
37310
|
}
|
|
37306
37311
|
if (!israngeseleciton(ctx) && (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start)) {
|
|
37307
37312
|
var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
@@ -37309,8 +37314,8 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37309
37314
|
span.innerHTML = range;
|
|
37310
37315
|
setCaretPosition(ctx, span, 0, range.length);
|
|
37311
37316
|
}
|
|
37312
|
-
} else {
|
|
37313
|
-
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
37317
|
+
} else if (ctx.active_f) {
|
|
37318
|
+
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37314
37319
|
var newEle = parseElement(function_str);
|
|
37315
37320
|
var refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37316
37321
|
if (refEle && refEle.parentNode) {
|
|
@@ -37322,6 +37327,19 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37322
37327
|
var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37323
37328
|
setCaretPosition(ctx, _span, 0, range.length);
|
|
37324
37329
|
functionHTMLIndex += 1;
|
|
37330
|
+
} else {
|
|
37331
|
+
var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37332
|
+
var _newEle = parseElement(_function_str);
|
|
37333
|
+
var _refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37334
|
+
if (_refEle && _refEle.parentNode) {
|
|
37335
|
+
_refEle.parentNode.insertBefore(_newEle, _refEle.nextSibling);
|
|
37336
|
+
} else {
|
|
37337
|
+
$editor.appendChild(_newEle);
|
|
37338
|
+
}
|
|
37339
|
+
ctx.formulaCache.rangechangeindex = functionHTMLIndex;
|
|
37340
|
+
var _span2 = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37341
|
+
setCaretPosition(ctx, _span2, 0, range.length);
|
|
37342
|
+
functionHTMLIndex += 1;
|
|
37325
37343
|
}
|
|
37326
37344
|
if ($copyTo) $copyTo.innerHTML = $editor.innerHTML;
|
|
37327
37345
|
}
|
|
@@ -40181,11 +40199,11 @@ function cancelNormalSelected(ctx) {
|
|
|
40181
40199
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
40182
40200
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
40183
40201
|
}
|
|
40184
|
-
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
40202
|
+
function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
40185
40203
|
var _inputText, _curv, _ctx$hooks$beforeUpda, _ctx$hooks, _curv2;
|
|
40186
40204
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
40187
40205
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
40188
|
-
var flowdata = getFlowdata(ctx);
|
|
40206
|
+
var flowdata = getFlowdata(ctx, sheetId);
|
|
40189
40207
|
if (!flowdata) return;
|
|
40190
40208
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
40191
40209
|
var dataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
@@ -51467,7 +51485,6 @@ function updateDropCell(ctx) {
|
|
|
51467
51485
|
if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
|
|
51468
51486
|
var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
|
|
51469
51487
|
var v = execfunction(ctx, f, j, i);
|
|
51470
|
-
execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
51471
51488
|
var _v = _slicedToArray(v, 3);
|
|
51472
51489
|
cell.v = _v[1];
|
|
51473
51490
|
cell.f = _v[2];
|
|
@@ -51549,7 +51566,6 @@ function updateDropCell(ctx) {
|
|
|
51549
51566
|
if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
|
|
51550
51567
|
var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
|
|
51551
51568
|
var _v2 = execfunction(ctx, _f, _j, i);
|
|
51552
|
-
execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
|
|
51553
51569
|
var _v3 = _slicedToArray(_v2, 3);
|
|
51554
51570
|
_cell.v = _v3[1];
|
|
51555
51571
|
_cell.f = _v3[2];
|
|
@@ -51630,7 +51646,6 @@ function updateDropCell(ctx) {
|
|
|
51630
51646
|
if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
|
|
51631
51647
|
var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
|
|
51632
51648
|
var _v4 = execfunction(ctx, _f2, _i23, _j2);
|
|
51633
|
-
execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
|
|
51634
51649
|
var _v5 = _slicedToArray(_v4, 3);
|
|
51635
51650
|
_cell2.v = _v5[1];
|
|
51636
51651
|
_cell2.f = _v5[2];
|
|
@@ -51705,7 +51720,6 @@ function updateDropCell(ctx) {
|
|
|
51705
51720
|
if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
|
|
51706
51721
|
var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
|
|
51707
51722
|
var _v6 = execfunction(ctx, _f3, _i23, _j3);
|
|
51708
|
-
execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
|
|
51709
51723
|
var _v7 = _slicedToArray(_v6, 3);
|
|
51710
51724
|
_cell3.v = _v7[1];
|
|
51711
51725
|
_cell3.f = _v7[2];
|
|
@@ -51776,28 +51790,6 @@ function updateDropCell(ctx) {
|
|
|
51776
51790
|
}
|
|
51777
51791
|
}
|
|
51778
51792
|
}
|
|
51779
|
-
var cdformat = file.luckysheet_conditionformat_save;
|
|
51780
|
-
if (cdformat != null && cdformat.length > 0) {
|
|
51781
|
-
for (var _i24 = 0; _i24 < cdformat.length; _i24 += 1) {
|
|
51782
|
-
var cdformat_cellrange = cdformat[_i24].cellrange;
|
|
51783
|
-
var emptyRange = [];
|
|
51784
|
-
for (var _j4 = 0; _j4 < cdformat_cellrange.length; _j4 += 1) {
|
|
51785
|
-
var range = CFSplitRange(cdformat_cellrange[_j4], {
|
|
51786
|
-
row: copyRange.row,
|
|
51787
|
-
column: copyRange.column
|
|
51788
|
-
}, {
|
|
51789
|
-
row: applyRange.row,
|
|
51790
|
-
column: applyRange.column
|
|
51791
|
-
}, "operatePart");
|
|
51792
|
-
if (range.length > 0) {
|
|
51793
|
-
emptyRange = emptyRange.concat(range);
|
|
51794
|
-
}
|
|
51795
|
-
}
|
|
51796
|
-
if (emptyRange.length > 0) {
|
|
51797
|
-
cdformat[_i24].cellrange.push(applyRange);
|
|
51798
|
-
}
|
|
51799
|
-
}
|
|
51800
|
-
}
|
|
51801
51793
|
jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
|
|
51802
51794
|
}
|
|
51803
51795
|
function onDropCellSelectEnd(ctx, e, container) {
|
|
@@ -56467,7 +56459,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
56467
56459
|
ctx.luckysheet_selection_range = [];
|
|
56468
56460
|
}
|
|
56469
56461
|
var allowEdit = isAllowEdit(ctx);
|
|
56470
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56462
|
+
if ((ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56471
56463
|
return;
|
|
56472
56464
|
}
|
|
56473
56465
|
if (kstr === "Enter") {
|
|
@@ -56648,8 +56640,8 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56648
56640
|
if (isInSelection) return;
|
|
56649
56641
|
}
|
|
56650
56642
|
ctx.luckysheet_scroll_status = true;
|
|
56651
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
56652
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56643
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) {
|
|
56644
|
+
if (ctx.active_f || ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56653
56645
|
var _$last;
|
|
56654
56646
|
var rowseleted = [row_index, row_index_ed];
|
|
56655
56647
|
var columnseleted = [col_index, col_index_ed];
|
|
@@ -56768,7 +56760,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56768
56760
|
row_focus: row_index,
|
|
56769
56761
|
column_focus: col_index
|
|
56770
56762
|
};
|
|
56771
|
-
} else {
|
|
56763
|
+
} else if (ctx.active_f) ; else {
|
|
56772
56764
|
ctx.formulaCache.func_selectedrange = {
|
|
56773
56765
|
left: left,
|
|
56774
56766
|
width: width,
|
|
@@ -59882,18 +59874,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59882
59874
|
var result = [];
|
|
59883
59875
|
var borderInfo = [];
|
|
59884
59876
|
var merge = {};
|
|
59885
|
-
var startOffColIndexMap = {};
|
|
59886
59877
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
59887
59878
|
var row = rows[index];
|
|
59888
|
-
var isFirstNoRs = false;
|
|
59889
59879
|
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
59890
59880
|
if (!result[index]) {
|
|
59891
59881
|
result[index] = [];
|
|
59892
59882
|
}
|
|
59883
|
+
if (copyRich) {
|
|
59884
|
+
for (var _offIndex = 0; _offIndex < result[index].length; _offIndex++) {
|
|
59885
|
+
var offNumber = result[index][_offIndex];
|
|
59886
|
+
if (offNumber) {
|
|
59887
|
+
cells.splice(_offIndex, 0, null);
|
|
59888
|
+
}
|
|
59889
|
+
}
|
|
59890
|
+
}
|
|
59893
59891
|
var offsetColIndex = 0;
|
|
59894
59892
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
59895
|
-
var _colIndex = startCol + offsetColIndex
|
|
59893
|
+
var _colIndex = startCol + offsetColIndex;
|
|
59896
59894
|
var cell = cells[cIndex];
|
|
59895
|
+
if (cell === null) {
|
|
59896
|
+
offsetColIndex++;
|
|
59897
|
+
continue;
|
|
59898
|
+
}
|
|
59897
59899
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
59898
59900
|
var v = cell.getAttribute("x:num");
|
|
59899
59901
|
var f = cell.getAttribute("f");
|
|
@@ -59920,26 +59922,23 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59920
59922
|
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
59921
59923
|
borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
59922
59924
|
} else {
|
|
59923
|
-
isFirstNoRs = true;
|
|
59924
59925
|
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
59925
59926
|
}
|
|
59926
|
-
result[index]
|
|
59927
|
+
result[index][_colIndex] = mainCell;
|
|
59927
59928
|
if (rowspan > 1) {
|
|
59928
59929
|
for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
|
|
59929
|
-
|
|
59930
|
-
|
|
59930
|
+
var nextR = index + rs_index;
|
|
59931
|
+
if (!result[nextR]) {
|
|
59932
|
+
result[nextR] = [];
|
|
59931
59933
|
}
|
|
59932
|
-
|
|
59933
|
-
|
|
59934
|
-
|
|
59935
|
-
|
|
59936
|
-
|
|
59937
|
-
|
|
59938
|
-
|
|
59939
|
-
|
|
59940
|
-
startOffColIndexMap[index + rs_index] = 0;
|
|
59941
|
-
}
|
|
59942
|
-
startOffColIndexMap[index + rs_index] += colspan || 1;
|
|
59934
|
+
for (var _cIndex = 0; _cIndex < colspan; _cIndex++) {
|
|
59935
|
+
var nextC = _colIndex + _cIndex;
|
|
59936
|
+
result[nextR][nextC] = {
|
|
59937
|
+
mc: {
|
|
59938
|
+
r: index + startRow,
|
|
59939
|
+
c: _colIndex
|
|
59940
|
+
}
|
|
59941
|
+
};
|
|
59943
59942
|
}
|
|
59944
59943
|
}
|
|
59945
59944
|
}
|
|
@@ -59953,7 +59952,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59953
59952
|
});
|
|
59954
59953
|
}
|
|
59955
59954
|
}
|
|
59956
|
-
offsetColIndex
|
|
59955
|
+
offsetColIndex = (colspan || 1) + offsetColIndex;
|
|
59957
59956
|
} else {
|
|
59958
59957
|
var item = f ? {
|
|
59959
59958
|
f: f
|
|
@@ -59965,6 +59964,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59965
59964
|
}
|
|
59966
59965
|
}
|
|
59967
59966
|
}
|
|
59967
|
+
console.log("result", result);
|
|
59968
59968
|
return {
|
|
59969
59969
|
data: result,
|
|
59970
59970
|
borderInfo: borderInfo,
|
|
@@ -60063,4 +60063,4 @@ function handlePasteByClick(ctx, triggerType) {
|
|
|
60063
60063
|
} else if (data.indexOf("leankylin-copy-action-image") > -1) ; else ;
|
|
60064
60064
|
}
|
|
60065
60065
|
|
|
60066
|
-
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 };
|
|
60066
|
+
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;
|
|
@@ -36178,6 +36181,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36178
36181
|
if (___default['default'].isNil(data)) {
|
|
36179
36182
|
data = getFlowdata(ctx);
|
|
36180
36183
|
}
|
|
36184
|
+
debugger;
|
|
36181
36185
|
if (___default['default'].isNil(ctx.formulaCache.execFunctionGlobalData)) {
|
|
36182
36186
|
ctx.formulaCache.execFunctionGlobalData = {};
|
|
36183
36187
|
}
|
|
@@ -36569,7 +36573,7 @@ function createRangeHightlight(ctx, inputInnerHtmlStr) {
|
|
|
36569
36573
|
formulaRanges.push(_objectSpread2(_objectSpread2({
|
|
36570
36574
|
rangeIndex: rangeIndex
|
|
36571
36575
|
}, rect), {}, {
|
|
36572
|
-
backgroundColor:
|
|
36576
|
+
backgroundColor: getHLColor(rangeIndex)
|
|
36573
36577
|
}));
|
|
36574
36578
|
}
|
|
36575
36579
|
}
|
|
@@ -36833,7 +36837,7 @@ function functionHTML(txt) {
|
|
|
36833
36837
|
if (i === funcstack.length - 1) {
|
|
36834
36838
|
if (iscelldata(___default['default'].trim(str))) {
|
|
36835
36839
|
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(
|
|
36840
|
+
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(rangeIndex), ";\">").concat(str, "</span>");
|
|
36837
36841
|
functionHTMLIndex += 1;
|
|
36838
36842
|
} else if (matchConfig.dquote > 0) {
|
|
36839
36843
|
function_str += "".concat(str, "</span>");
|
|
@@ -37295,7 +37299,7 @@ function functionStrChange(txt, type, rc, orient, stindex, step, sheetName, isCu
|
|
|
37295
37299
|
return function_str;
|
|
37296
37300
|
}
|
|
37297
37301
|
function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
37298
|
-
var _document$activeEleme;
|
|
37302
|
+
var _document$activeEleme, _ctx$active_f;
|
|
37299
37303
|
var $editor = cellInput;
|
|
37300
37304
|
var $copyTo = fxInput;
|
|
37301
37305
|
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) === "luckysheet-functionbox-cell") {
|
|
@@ -37305,13 +37309,14 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37305
37309
|
var range = "";
|
|
37306
37310
|
var rf = selected.row[0];
|
|
37307
37311
|
var cf = selected.column[0];
|
|
37312
|
+
var sheetId = ((_ctx$active_f = ctx.active_f) === null || _ctx$active_f === void 0 ? void 0 : _ctx$active_f.sheetId) || ctx.formulaCache.rangetosheet;
|
|
37308
37313
|
if (ctx.config.merge != null && "".concat(rf, "_").concat(cf) in ctx.config.merge) {
|
|
37309
37314
|
range = getRangetxt(ctx, ctx.currentSheetId, {
|
|
37310
37315
|
column: [cf, cf],
|
|
37311
37316
|
row: [rf, rf]
|
|
37312
|
-
},
|
|
37317
|
+
}, sheetId);
|
|
37313
37318
|
} else {
|
|
37314
|
-
range = getRangetxt(ctx, ctx.currentSheetId, selected,
|
|
37319
|
+
range = getRangetxt(ctx, ctx.currentSheetId, selected, sheetId);
|
|
37315
37320
|
}
|
|
37316
37321
|
if (!israngeseleciton(ctx) && (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start)) {
|
|
37317
37322
|
var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
@@ -37319,8 +37324,8 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37319
37324
|
span.innerHTML = range;
|
|
37320
37325
|
setCaretPosition(ctx, span, 0, range.length);
|
|
37321
37326
|
}
|
|
37322
|
-
} else {
|
|
37323
|
-
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
37327
|
+
} else if (ctx.active_f) {
|
|
37328
|
+
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37324
37329
|
var newEle = parseElement(function_str);
|
|
37325
37330
|
var refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37326
37331
|
if (refEle && refEle.parentNode) {
|
|
@@ -37332,6 +37337,19 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
|
37332
37337
|
var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37333
37338
|
setCaretPosition(ctx, _span, 0, range.length);
|
|
37334
37339
|
functionHTMLIndex += 1;
|
|
37340
|
+
} else {
|
|
37341
|
+
var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
37342
|
+
var _newEle = parseElement(_function_str);
|
|
37343
|
+
var _refEle = ctx.formulaCache.rangeSetValueTo;
|
|
37344
|
+
if (_refEle && _refEle.parentNode) {
|
|
37345
|
+
_refEle.parentNode.insertBefore(_newEle, _refEle.nextSibling);
|
|
37346
|
+
} else {
|
|
37347
|
+
$editor.appendChild(_newEle);
|
|
37348
|
+
}
|
|
37349
|
+
ctx.formulaCache.rangechangeindex = functionHTMLIndex;
|
|
37350
|
+
var _span2 = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
37351
|
+
setCaretPosition(ctx, _span2, 0, range.length);
|
|
37352
|
+
functionHTMLIndex += 1;
|
|
37335
37353
|
}
|
|
37336
37354
|
if ($copyTo) $copyTo.innerHTML = $editor.innerHTML;
|
|
37337
37355
|
}
|
|
@@ -40191,11 +40209,11 @@ function cancelNormalSelected(ctx) {
|
|
|
40191
40209
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
40192
40210
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
40193
40211
|
}
|
|
40194
|
-
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
40212
|
+
function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
40195
40213
|
var _inputText, _curv, _ctx$hooks$beforeUpda, _ctx$hooks, _curv2;
|
|
40196
40214
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
40197
40215
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
40198
|
-
var flowdata = getFlowdata(ctx);
|
|
40216
|
+
var flowdata = getFlowdata(ctx, sheetId);
|
|
40199
40217
|
if (!flowdata) return;
|
|
40200
40218
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
40201
40219
|
var dataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
@@ -51477,7 +51495,6 @@ function updateDropCell(ctx) {
|
|
|
51477
51495
|
if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
|
|
51478
51496
|
var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
|
|
51479
51497
|
var v = execfunction(ctx, f, j, i);
|
|
51480
|
-
execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
51481
51498
|
var _v = _slicedToArray(v, 3);
|
|
51482
51499
|
cell.v = _v[1];
|
|
51483
51500
|
cell.f = _v[2];
|
|
@@ -51559,7 +51576,6 @@ function updateDropCell(ctx) {
|
|
|
51559
51576
|
if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
|
|
51560
51577
|
var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
|
|
51561
51578
|
var _v2 = execfunction(ctx, _f, _j, i);
|
|
51562
|
-
execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
|
|
51563
51579
|
var _v3 = _slicedToArray(_v2, 3);
|
|
51564
51580
|
_cell.v = _v3[1];
|
|
51565
51581
|
_cell.f = _v3[2];
|
|
@@ -51640,7 +51656,6 @@ function updateDropCell(ctx) {
|
|
|
51640
51656
|
if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
|
|
51641
51657
|
var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
|
|
51642
51658
|
var _v4 = execfunction(ctx, _f2, _i23, _j2);
|
|
51643
|
-
execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
|
|
51644
51659
|
var _v5 = _slicedToArray(_v4, 3);
|
|
51645
51660
|
_cell2.v = _v5[1];
|
|
51646
51661
|
_cell2.f = _v5[2];
|
|
@@ -51715,7 +51730,6 @@ function updateDropCell(ctx) {
|
|
|
51715
51730
|
if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
|
|
51716
51731
|
var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
|
|
51717
51732
|
var _v6 = execfunction(ctx, _f3, _i23, _j3);
|
|
51718
|
-
execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
|
|
51719
51733
|
var _v7 = _slicedToArray(_v6, 3);
|
|
51720
51734
|
_cell3.v = _v7[1];
|
|
51721
51735
|
_cell3.f = _v7[2];
|
|
@@ -51786,28 +51800,6 @@ function updateDropCell(ctx) {
|
|
|
51786
51800
|
}
|
|
51787
51801
|
}
|
|
51788
51802
|
}
|
|
51789
|
-
var cdformat = file.luckysheet_conditionformat_save;
|
|
51790
|
-
if (cdformat != null && cdformat.length > 0) {
|
|
51791
|
-
for (var _i24 = 0; _i24 < cdformat.length; _i24 += 1) {
|
|
51792
|
-
var cdformat_cellrange = cdformat[_i24].cellrange;
|
|
51793
|
-
var emptyRange = [];
|
|
51794
|
-
for (var _j4 = 0; _j4 < cdformat_cellrange.length; _j4 += 1) {
|
|
51795
|
-
var range = CFSplitRange(cdformat_cellrange[_j4], {
|
|
51796
|
-
row: copyRange.row,
|
|
51797
|
-
column: copyRange.column
|
|
51798
|
-
}, {
|
|
51799
|
-
row: applyRange.row,
|
|
51800
|
-
column: applyRange.column
|
|
51801
|
-
}, "operatePart");
|
|
51802
|
-
if (range.length > 0) {
|
|
51803
|
-
emptyRange = emptyRange.concat(range);
|
|
51804
|
-
}
|
|
51805
|
-
}
|
|
51806
|
-
if (emptyRange.length > 0) {
|
|
51807
|
-
cdformat[_i24].cellrange.push(applyRange);
|
|
51808
|
-
}
|
|
51809
|
-
}
|
|
51810
|
-
}
|
|
51811
51803
|
jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
|
|
51812
51804
|
}
|
|
51813
51805
|
function onDropCellSelectEnd(ctx, e, container) {
|
|
@@ -56477,7 +56469,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
56477
56469
|
ctx.luckysheet_selection_range = [];
|
|
56478
56470
|
}
|
|
56479
56471
|
var allowEdit = isAllowEdit(ctx);
|
|
56480
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56472
|
+
if ((ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
56481
56473
|
return;
|
|
56482
56474
|
}
|
|
56483
56475
|
if (kstr === "Enter") {
|
|
@@ -56658,8 +56650,8 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56658
56650
|
if (isInSelection) return;
|
|
56659
56651
|
}
|
|
56660
56652
|
ctx.luckysheet_scroll_status = true;
|
|
56661
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
56662
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56653
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) {
|
|
56654
|
+
if (ctx.active_f || ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
56663
56655
|
var _$last;
|
|
56664
56656
|
var rowseleted = [row_index, row_index_ed];
|
|
56665
56657
|
var columnseleted = [col_index, col_index_ed];
|
|
@@ -56778,7 +56770,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
56778
56770
|
row_focus: row_index,
|
|
56779
56771
|
column_focus: col_index
|
|
56780
56772
|
};
|
|
56781
|
-
} else {
|
|
56773
|
+
} else if (ctx.active_f) ; else {
|
|
56782
56774
|
ctx.formulaCache.func_selectedrange = {
|
|
56783
56775
|
left: left,
|
|
56784
56776
|
width: width,
|
|
@@ -59892,18 +59884,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59892
59884
|
var result = [];
|
|
59893
59885
|
var borderInfo = [];
|
|
59894
59886
|
var merge = {};
|
|
59895
|
-
var startOffColIndexMap = {};
|
|
59896
59887
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
59897
59888
|
var row = rows[index];
|
|
59898
|
-
var isFirstNoRs = false;
|
|
59899
59889
|
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
59900
59890
|
if (!result[index]) {
|
|
59901
59891
|
result[index] = [];
|
|
59902
59892
|
}
|
|
59893
|
+
if (copyRich) {
|
|
59894
|
+
for (var _offIndex = 0; _offIndex < result[index].length; _offIndex++) {
|
|
59895
|
+
var offNumber = result[index][_offIndex];
|
|
59896
|
+
if (offNumber) {
|
|
59897
|
+
cells.splice(_offIndex, 0, null);
|
|
59898
|
+
}
|
|
59899
|
+
}
|
|
59900
|
+
}
|
|
59903
59901
|
var offsetColIndex = 0;
|
|
59904
59902
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
59905
|
-
var _colIndex = startCol + offsetColIndex
|
|
59903
|
+
var _colIndex = startCol + offsetColIndex;
|
|
59906
59904
|
var cell = cells[cIndex];
|
|
59905
|
+
if (cell === null) {
|
|
59906
|
+
offsetColIndex++;
|
|
59907
|
+
continue;
|
|
59908
|
+
}
|
|
59907
59909
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
59908
59910
|
var v = cell.getAttribute("x:num");
|
|
59909
59911
|
var f = cell.getAttribute("f");
|
|
@@ -59930,26 +59932,23 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59930
59932
|
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
59931
59933
|
borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
59932
59934
|
} else {
|
|
59933
|
-
isFirstNoRs = true;
|
|
59934
59935
|
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
59935
59936
|
}
|
|
59936
|
-
result[index]
|
|
59937
|
+
result[index][_colIndex] = mainCell;
|
|
59937
59938
|
if (rowspan > 1) {
|
|
59938
59939
|
for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
|
|
59939
|
-
|
|
59940
|
-
|
|
59940
|
+
var nextR = index + rs_index;
|
|
59941
|
+
if (!result[nextR]) {
|
|
59942
|
+
result[nextR] = [];
|
|
59941
59943
|
}
|
|
59942
|
-
|
|
59943
|
-
|
|
59944
|
-
|
|
59945
|
-
|
|
59946
|
-
|
|
59947
|
-
|
|
59948
|
-
|
|
59949
|
-
|
|
59950
|
-
startOffColIndexMap[index + rs_index] = 0;
|
|
59951
|
-
}
|
|
59952
|
-
startOffColIndexMap[index + rs_index] += colspan || 1;
|
|
59944
|
+
for (var _cIndex = 0; _cIndex < colspan; _cIndex++) {
|
|
59945
|
+
var nextC = _colIndex + _cIndex;
|
|
59946
|
+
result[nextR][nextC] = {
|
|
59947
|
+
mc: {
|
|
59948
|
+
r: index + startRow,
|
|
59949
|
+
c: _colIndex
|
|
59950
|
+
}
|
|
59951
|
+
};
|
|
59953
59952
|
}
|
|
59954
59953
|
}
|
|
59955
59954
|
}
|
|
@@ -59963,7 +59962,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59963
59962
|
});
|
|
59964
59963
|
}
|
|
59965
59964
|
}
|
|
59966
|
-
offsetColIndex
|
|
59965
|
+
offsetColIndex = (colspan || 1) + offsetColIndex;
|
|
59967
59966
|
} else {
|
|
59968
59967
|
var item = f ? {
|
|
59969
59968
|
f: f
|
|
@@ -59975,6 +59974,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59975
59974
|
}
|
|
59976
59975
|
}
|
|
59977
59976
|
}
|
|
59977
|
+
console.log("result", result);
|
|
59978
59978
|
return {
|
|
59979
59979
|
data: result,
|
|
59980
59980
|
borderInfo: borderInfo,
|
|
@@ -60182,6 +60182,7 @@ exports.getFontSet = getFontSet;
|
|
|
60182
60182
|
exports.getFontStyleByCell = getFontStyleByCell;
|
|
60183
60183
|
exports.getFrozenHandleLeft = getFrozenHandleLeft;
|
|
60184
60184
|
exports.getFrozenHandleTop = getFrozenHandleTop;
|
|
60185
|
+
exports.getHLColor = getHLColor;
|
|
60185
60186
|
exports.getHintText = getHintText;
|
|
60186
60187
|
exports.getHistoryRules = getHistoryRules;
|
|
60187
60188
|
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.37",
|
|
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.37",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|