@leankylin-sheet/react 4.0.40 → 4.0.42
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.umd.js +163 -85
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -32440,6 +32440,7 @@
|
|
|
32440
32440
|
var ERROR_NUM = 'NUM';
|
|
32441
32441
|
var ERROR_REF = 'REF';
|
|
32442
32442
|
var ERROR_VALUE = 'VALUE';
|
|
32443
|
+
var errors_formula_map = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, ERROR, formulajs.utils.errors.error), ERROR_DIV_ZERO, formulajs.utils.errors.div0), ERROR_NAME, formulajs.utils.errors.name), ERROR_NOT_AVAILABLE, formulajs.utils.errors.na), ERROR_NULL, formulajs.utils.errors.nil), ERROR_NUM, formulajs.utils.errors.num), ERROR_REF, formulajs.utils.errors.ref), ERROR_VALUE, formulajs.utils.errors.value);
|
|
32443
32444
|
var errors = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, ERROR, '#ERROR!'), ERROR_DIV_ZERO, '#DIV/0!'), ERROR_NAME, '#NAME?'), ERROR_NOT_AVAILABLE, '#N/A'), ERROR_NULL, '#NULL!'), ERROR_NUM, '#NUM!'), ERROR_REF, '#REF!'), ERROR_VALUE, '#VALUE!');
|
|
32444
32445
|
|
|
32445
32446
|
/**
|
|
@@ -32532,13 +32533,23 @@
|
|
|
32532
32533
|
function func$4(symbol) {
|
|
32533
32534
|
return function __formulaFunction() {
|
|
32534
32535
|
symbol = symbol.toUpperCase();
|
|
32536
|
+
for (var _len = arguments.length, _params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32537
|
+
_params[_key] = arguments[_key];
|
|
32538
|
+
}
|
|
32539
|
+
var params = _params === null || _params === void 0 ? void 0 : _params.map(function (item) {
|
|
32540
|
+
if (errors_formula_map[item]) {
|
|
32541
|
+
return errors_formula_map[item];
|
|
32542
|
+
} else {
|
|
32543
|
+
return item;
|
|
32544
|
+
}
|
|
32545
|
+
});
|
|
32535
32546
|
var symbolParts = symbol.split('.');
|
|
32536
32547
|
var foundFormula = false;
|
|
32537
32548
|
var result;
|
|
32538
32549
|
if (symbolParts.length === 1) {
|
|
32539
32550
|
if (formulajs$1[symbolParts[0]]) {
|
|
32540
32551
|
foundFormula = true;
|
|
32541
|
-
result = formulajs$1[symbolParts[0]].apply(formulajs$1,
|
|
32552
|
+
result = formulajs$1[symbolParts[0]].apply(formulajs$1, _toConsumableArray$1(params));
|
|
32542
32553
|
}
|
|
32543
32554
|
} else {
|
|
32544
32555
|
var length = symbolParts.length;
|
|
@@ -32554,7 +32565,7 @@
|
|
|
32554
32565
|
}
|
|
32555
32566
|
if (nestedFormula) {
|
|
32556
32567
|
foundFormula = true;
|
|
32557
|
-
result = nestedFormula.apply(void 0,
|
|
32568
|
+
result = nestedFormula.apply(void 0, _toConsumableArray$1(params));
|
|
32558
32569
|
}
|
|
32559
32570
|
}
|
|
32560
32571
|
if (!foundFormula) {
|
|
@@ -34276,6 +34287,9 @@
|
|
|
34276
34287
|
result = "";
|
|
34277
34288
|
} else {
|
|
34278
34289
|
result = this.parser.parse(expression);
|
|
34290
|
+
// if(result === 'DIV/0'){
|
|
34291
|
+
// result= '0'
|
|
34292
|
+
// }
|
|
34279
34293
|
}
|
|
34280
34294
|
} catch (ex) {
|
|
34281
34295
|
var message = error$1(ex.message);
|
|
@@ -44674,6 +44688,18 @@
|
|
|
44674
44688
|
text: "Number",
|
|
44675
44689
|
value: "##0.00",
|
|
44676
44690
|
example: "1000.12"
|
|
44691
|
+
}, {
|
|
44692
|
+
text: "thousand",
|
|
44693
|
+
value: "leanky_n",
|
|
44694
|
+
example: "12,345"
|
|
44695
|
+
}, {
|
|
44696
|
+
text: "thousand-2",
|
|
44697
|
+
value: "leanky_n2",
|
|
44698
|
+
example: "12,345.67"
|
|
44699
|
+
}, {
|
|
44700
|
+
text: "thousand-4",
|
|
44701
|
+
value: "leanky_n4",
|
|
44702
|
+
example: "12,345.6789"
|
|
44677
44703
|
}, {
|
|
44678
44704
|
text: "Percent",
|
|
44679
44705
|
value: "#0.00%",
|
|
@@ -44966,11 +44992,11 @@
|
|
|
44966
44992
|
columnOverLimit: "1000 column limit exceeded"
|
|
44967
44993
|
},
|
|
44968
44994
|
comment: {
|
|
44969
|
-
insert: "Insert",
|
|
44970
|
-
edit: "Edit",
|
|
44971
|
-
delete: "Delete",
|
|
44972
|
-
showOne: "Show/Hide",
|
|
44973
|
-
showAll: "Show/Hide All"
|
|
44995
|
+
insert: "Insert Comment",
|
|
44996
|
+
edit: "Edit Comment",
|
|
44997
|
+
delete: "Delete Comment",
|
|
44998
|
+
showOne: "Show/Hide Comment",
|
|
44999
|
+
showAll: "Show/Hide All Comment"
|
|
44974
45000
|
},
|
|
44975
45001
|
screenshot: {
|
|
44976
45002
|
screenshotTipNoSelection: "Please select the scope of the screenshot",
|
|
@@ -55206,6 +55232,18 @@
|
|
|
55206
55232
|
text: "数字",
|
|
55207
55233
|
value: "##0.00",
|
|
55208
55234
|
example: "1000.12"
|
|
55235
|
+
}, {
|
|
55236
|
+
text: "千分符整数",
|
|
55237
|
+
value: "leanky_n",
|
|
55238
|
+
example: "12,345"
|
|
55239
|
+
}, {
|
|
55240
|
+
text: "千分符2位小数",
|
|
55241
|
+
value: "leanky_n2",
|
|
55242
|
+
example: "12,345.67"
|
|
55243
|
+
}, {
|
|
55244
|
+
text: "千分符4位小数",
|
|
55245
|
+
value: "leanky_n4",
|
|
55246
|
+
example: "12,345.6789"
|
|
55209
55247
|
}, {
|
|
55210
55248
|
text: "百分比",
|
|
55211
55249
|
value: "#0.00%",
|
|
@@ -55530,11 +55568,11 @@
|
|
|
55530
55568
|
columnOverLimit: "超出1000列限制"
|
|
55531
55569
|
},
|
|
55532
55570
|
comment: {
|
|
55533
|
-
insert: "
|
|
55534
|
-
edit: "
|
|
55535
|
-
delete: "
|
|
55536
|
-
showOne: "
|
|
55537
|
-
showAll: "
|
|
55571
|
+
insert: "新建说明",
|
|
55572
|
+
edit: "编辑说明",
|
|
55573
|
+
delete: "删除说明",
|
|
55574
|
+
showOne: "显示/隐藏说明",
|
|
55575
|
+
showAll: "显示/隐藏所有说明"
|
|
55538
55576
|
},
|
|
55539
55577
|
screenshot: {
|
|
55540
55578
|
screenshotTipNoSelection: "请框选需要截图的范围",
|
|
@@ -69422,16 +69460,22 @@
|
|
|
69422
69460
|
}
|
|
69423
69461
|
function format(fmt, v, o) {
|
|
69424
69462
|
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_n')) {
|
|
69425
|
-
if (isNaN(v) || Infinity == v || -Infinity == v) {
|
|
69463
|
+
if (Number.isNaN(v) || Infinity == v || -Infinity == v || v === null || v === '' || v === undefined) {
|
|
69426
69464
|
return '';
|
|
69427
69465
|
}
|
|
69466
|
+
if (isNaN(v)) {
|
|
69467
|
+
return v;
|
|
69468
|
+
}
|
|
69428
69469
|
var precision = fmt.replace('leanky_n', '');
|
|
69429
69470
|
return numberThousands(v, ',', precision);
|
|
69430
69471
|
}
|
|
69431
69472
|
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_p')) {
|
|
69432
|
-
if (isNaN(v) || Infinity == v || -Infinity == v) {
|
|
69473
|
+
if (Number.isNaN(v) || Infinity == v || -Infinity == v || v === null || v === '' || v === undefined) {
|
|
69433
69474
|
return '';
|
|
69434
69475
|
}
|
|
69476
|
+
if (isNaN(v)) {
|
|
69477
|
+
return v;
|
|
69478
|
+
}
|
|
69435
69479
|
var _precision = fmt.replace('leanky_p', '');
|
|
69436
69480
|
return numberThousands(v * 100, ',', _precision) + '%';
|
|
69437
69481
|
}
|
|
@@ -69909,6 +69953,9 @@
|
|
|
69909
69953
|
}
|
|
69910
69954
|
|
|
69911
69955
|
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"];
|
|
69956
|
+
function getHLColor(index) {
|
|
69957
|
+
return colors[index % colors.length];
|
|
69958
|
+
}
|
|
69912
69959
|
|
|
69913
69960
|
function mousePosition(x, y, ctx) {
|
|
69914
69961
|
var newX = x - ctx.rowHeaderWidth;
|
|
@@ -71089,7 +71136,7 @@
|
|
|
71089
71136
|
formulaRanges.push(_objectSpread2$1(_objectSpread2$1({
|
|
71090
71137
|
rangeIndex: rangeIndex
|
|
71091
71138
|
}, rect), {}, {
|
|
71092
|
-
backgroundColor:
|
|
71139
|
+
backgroundColor: getHLColor(rangeIndex)
|
|
71093
71140
|
}));
|
|
71094
71141
|
}
|
|
71095
71142
|
}
|
|
@@ -71353,7 +71400,7 @@
|
|
|
71353
71400
|
if (i === funcstack.length - 1) {
|
|
71354
71401
|
if (iscelldata(lodash.trim(str))) {
|
|
71355
71402
|
var rangeIndex = rangeIndexes.length > functionHTMLIndex ? rangeIndexes[functionHTMLIndex] : functionHTMLIndex;
|
|
71356
|
-
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
71403
|
+
function_str += "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(rangeIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(rangeIndex), ";\">").concat(str, "</span>");
|
|
71357
71404
|
functionHTMLIndex += 1;
|
|
71358
71405
|
} else if (matchConfig.dquote > 0) {
|
|
71359
71406
|
function_str += "".concat(str, "</span>");
|
|
@@ -71815,7 +71862,7 @@
|
|
|
71815
71862
|
return function_str;
|
|
71816
71863
|
}
|
|
71817
71864
|
function rangeSetValue(ctx, cellInput, selected, fxInput) {
|
|
71818
|
-
var _document$activeEleme;
|
|
71865
|
+
var _document$activeEleme, _ctx$active_f;
|
|
71819
71866
|
var $editor = cellInput;
|
|
71820
71867
|
var $copyTo = fxInput;
|
|
71821
71868
|
if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) === "luckysheet-functionbox-cell") {
|
|
@@ -71825,13 +71872,14 @@
|
|
|
71825
71872
|
var range = "";
|
|
71826
71873
|
var rf = selected.row[0];
|
|
71827
71874
|
var cf = selected.column[0];
|
|
71875
|
+
var sheetId = ((_ctx$active_f = ctx.active_f) === null || _ctx$active_f === void 0 ? void 0 : _ctx$active_f.sheetId) || ctx.formulaCache.rangetosheet;
|
|
71828
71876
|
if (ctx.config.merge != null && "".concat(rf, "_").concat(cf) in ctx.config.merge) {
|
|
71829
71877
|
range = getRangetxt(ctx, ctx.currentSheetId, {
|
|
71830
71878
|
column: [cf, cf],
|
|
71831
71879
|
row: [rf, rf]
|
|
71832
|
-
},
|
|
71880
|
+
}, sheetId);
|
|
71833
71881
|
} else {
|
|
71834
|
-
range = getRangetxt(ctx, ctx.currentSheetId, selected,
|
|
71882
|
+
range = getRangetxt(ctx, ctx.currentSheetId, selected, sheetId);
|
|
71835
71883
|
}
|
|
71836
71884
|
if (!israngeseleciton(ctx) && (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start)) {
|
|
71837
71885
|
var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
@@ -71839,8 +71887,8 @@
|
|
|
71839
71887
|
span.innerHTML = range;
|
|
71840
71888
|
setCaretPosition(ctx, span, 0, range.length);
|
|
71841
71889
|
}
|
|
71842
|
-
} else {
|
|
71843
|
-
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(
|
|
71890
|
+
} else if (ctx.active_f) {
|
|
71891
|
+
var function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
71844
71892
|
var newEle = parseElement(function_str);
|
|
71845
71893
|
var refEle = ctx.formulaCache.rangeSetValueTo;
|
|
71846
71894
|
if (refEle && refEle.parentNode) {
|
|
@@ -71852,6 +71900,19 @@
|
|
|
71852
71900
|
var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
71853
71901
|
setCaretPosition(ctx, _span, 0, range.length);
|
|
71854
71902
|
functionHTMLIndex += 1;
|
|
71903
|
+
} else {
|
|
71904
|
+
var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
|
|
71905
|
+
var _newEle = parseElement(_function_str);
|
|
71906
|
+
var _refEle = ctx.formulaCache.rangeSetValueTo;
|
|
71907
|
+
if (_refEle && _refEle.parentNode) {
|
|
71908
|
+
_refEle.parentNode.insertBefore(_newEle, _refEle.nextSibling);
|
|
71909
|
+
} else {
|
|
71910
|
+
$editor.appendChild(_newEle);
|
|
71911
|
+
}
|
|
71912
|
+
ctx.formulaCache.rangechangeindex = functionHTMLIndex;
|
|
71913
|
+
var _span2 = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
|
|
71914
|
+
setCaretPosition(ctx, _span2, 0, range.length);
|
|
71915
|
+
functionHTMLIndex += 1;
|
|
71855
71916
|
}
|
|
71856
71917
|
if ($copyTo) $copyTo.innerHTML = $editor.innerHTML;
|
|
71857
71918
|
}
|
|
@@ -72174,6 +72235,20 @@
|
|
|
72174
72235
|
};
|
|
72175
72236
|
while (i < funcstack.length) {
|
|
72176
72237
|
var s = funcstack[i];
|
|
72238
|
+
var nextS = funcstack[i + 1];
|
|
72239
|
+
if (s === "{" && nextS === "{") {
|
|
72240
|
+
var nextI = funcstack === null || funcstack === void 0 ? void 0 : funcstack.findIndex(function (__, index) {
|
|
72241
|
+
if (i < index && funcstack[index] === "}" && funcstack[index + 1] === "}") {
|
|
72242
|
+
return true;
|
|
72243
|
+
}
|
|
72244
|
+
return false;
|
|
72245
|
+
});
|
|
72246
|
+
if (nextI !== -1) {
|
|
72247
|
+
function_str += txt.substring(i, nextI + 2);
|
|
72248
|
+
i = nextI + 2;
|
|
72249
|
+
continue;
|
|
72250
|
+
}
|
|
72251
|
+
}
|
|
72177
72252
|
if (s === "(" && matchConfig.dquote === 0) {
|
|
72178
72253
|
matchConfig.bracket += 1;
|
|
72179
72254
|
if (str.length > 0) {
|
|
@@ -74647,11 +74722,11 @@
|
|
|
74647
74722
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
74648
74723
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
74649
74724
|
}
|
|
74650
|
-
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
74725
|
+
function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
74651
74726
|
var _inputText, _curv, _ctx$hooks$beforeUpda, _ctx$hooks, _curv2;
|
|
74652
74727
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
74653
74728
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
74654
|
-
var flowdata = getFlowdata(ctx);
|
|
74729
|
+
var flowdata = getFlowdata(ctx, sheetId);
|
|
74655
74730
|
if (!flowdata) return;
|
|
74656
74731
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
74657
74732
|
var dataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
@@ -79805,7 +79880,19 @@
|
|
|
79805
79880
|
ctx.luckysheet_select_save = range;
|
|
79806
79881
|
}
|
|
79807
79882
|
}
|
|
79883
|
+
file.luckysheet_select_save = undefined;
|
|
79884
|
+
ctx.luckysheet_select_save = undefined;
|
|
79808
79885
|
refreshLocalMergeData(merge_new, file);
|
|
79886
|
+
if (ctx.hooks.rowColChange) {
|
|
79887
|
+
ctx.hooks.rowColChange({
|
|
79888
|
+
action: "add",
|
|
79889
|
+
type: type,
|
|
79890
|
+
index: index,
|
|
79891
|
+
count: count,
|
|
79892
|
+
direction: direction,
|
|
79893
|
+
id: id
|
|
79894
|
+
});
|
|
79895
|
+
}
|
|
79809
79896
|
}
|
|
79810
79897
|
function deleteRowCol(ctx, op) {
|
|
79811
79898
|
var type = op.type;
|
|
@@ -80537,6 +80624,15 @@
|
|
|
80537
80624
|
if (file.id === ctx.currentSheetId) {
|
|
80538
80625
|
ctx.config = cfg;
|
|
80539
80626
|
}
|
|
80627
|
+
if (ctx.hooks.rowColChange) {
|
|
80628
|
+
ctx.hooks.rowColChange({
|
|
80629
|
+
action: "delete",
|
|
80630
|
+
type: type,
|
|
80631
|
+
index: start,
|
|
80632
|
+
count: end - start + 1,
|
|
80633
|
+
id: id
|
|
80634
|
+
});
|
|
80635
|
+
}
|
|
80540
80636
|
}
|
|
80541
80637
|
function hideSelected(ctx, type) {
|
|
80542
80638
|
if (!ctx.luckysheet_select_save || ctx.luckysheet_select_save.length > 1) return "noMulti";
|
|
@@ -85696,7 +85792,6 @@
|
|
|
85696
85792
|
if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
|
|
85697
85793
|
var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
|
|
85698
85794
|
var v = execfunction(ctx, f, j, i);
|
|
85699
|
-
execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
85700
85795
|
var _v = _slicedToArray$2(v, 3);
|
|
85701
85796
|
cell.v = _v[1];
|
|
85702
85797
|
cell.f = _v[2];
|
|
@@ -85778,7 +85873,6 @@
|
|
|
85778
85873
|
if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
|
|
85779
85874
|
var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
|
|
85780
85875
|
var _v2 = execfunction(ctx, _f, _j, i);
|
|
85781
|
-
execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
|
|
85782
85876
|
var _v3 = _slicedToArray$2(_v2, 3);
|
|
85783
85877
|
_cell.v = _v3[1];
|
|
85784
85878
|
_cell.f = _v3[2];
|
|
@@ -85859,7 +85953,6 @@
|
|
|
85859
85953
|
if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
|
|
85860
85954
|
var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
|
|
85861
85955
|
var _v4 = execfunction(ctx, _f2, _i23, _j2);
|
|
85862
|
-
execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
|
|
85863
85956
|
var _v5 = _slicedToArray$2(_v4, 3);
|
|
85864
85957
|
_cell2.v = _v5[1];
|
|
85865
85958
|
_cell2.f = _v5[2];
|
|
@@ -85934,7 +86027,6 @@
|
|
|
85934
86027
|
if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
|
|
85935
86028
|
var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
|
|
85936
86029
|
var _v6 = execfunction(ctx, _f3, _i23, _j3);
|
|
85937
|
-
execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
|
|
85938
86030
|
var _v7 = _slicedToArray$2(_v6, 3);
|
|
85939
86031
|
_cell3.v = _v7[1];
|
|
85940
86032
|
_cell3.f = _v7[2];
|
|
@@ -86005,28 +86097,6 @@
|
|
|
86005
86097
|
}
|
|
86006
86098
|
}
|
|
86007
86099
|
}
|
|
86008
|
-
var cdformat = file.luckysheet_conditionformat_save;
|
|
86009
|
-
if (cdformat != null && cdformat.length > 0) {
|
|
86010
|
-
for (var _i24 = 0; _i24 < cdformat.length; _i24 += 1) {
|
|
86011
|
-
var cdformat_cellrange = cdformat[_i24].cellrange;
|
|
86012
|
-
var emptyRange = [];
|
|
86013
|
-
for (var _j4 = 0; _j4 < cdformat_cellrange.length; _j4 += 1) {
|
|
86014
|
-
var range = CFSplitRange(cdformat_cellrange[_j4], {
|
|
86015
|
-
row: copyRange.row,
|
|
86016
|
-
column: copyRange.column
|
|
86017
|
-
}, {
|
|
86018
|
-
row: applyRange.row,
|
|
86019
|
-
column: applyRange.column
|
|
86020
|
-
}, "operatePart");
|
|
86021
|
-
if (range.length > 0) {
|
|
86022
|
-
emptyRange = emptyRange.concat(range);
|
|
86023
|
-
}
|
|
86024
|
-
}
|
|
86025
|
-
if (emptyRange.length > 0) {
|
|
86026
|
-
cdformat[_i24].cellrange.push(applyRange);
|
|
86027
|
-
}
|
|
86028
|
-
}
|
|
86029
|
-
}
|
|
86030
86100
|
jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
|
|
86031
86101
|
}
|
|
86032
86102
|
function onDropCellSelectEnd(ctx, e, container) {
|
|
@@ -90695,7 +90765,7 @@
|
|
|
90695
90765
|
ctx.luckysheet_selection_range = [];
|
|
90696
90766
|
}
|
|
90697
90767
|
var allowEdit = isAllowEdit(ctx);
|
|
90698
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
90768
|
+
if ((ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
90699
90769
|
return;
|
|
90700
90770
|
}
|
|
90701
90771
|
if (kstr === "Enter") {
|
|
@@ -90876,8 +90946,8 @@
|
|
|
90876
90946
|
if (isInSelection) return;
|
|
90877
90947
|
}
|
|
90878
90948
|
ctx.luckysheet_scroll_status = true;
|
|
90879
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
90880
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
90949
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.active_f) {
|
|
90950
|
+
if (ctx.active_f || ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
90881
90951
|
var _$last;
|
|
90882
90952
|
var rowseleted = [row_index, row_index_ed];
|
|
90883
90953
|
var columnseleted = [col_index, col_index_ed];
|
|
@@ -90996,7 +91066,7 @@
|
|
|
90996
91066
|
row_focus: row_index,
|
|
90997
91067
|
column_focus: col_index
|
|
90998
91068
|
};
|
|
90999
|
-
} else {
|
|
91069
|
+
} else if (ctx.active_f) ; else {
|
|
91000
91070
|
ctx.formulaCache.func_selectedrange = {
|
|
91001
91071
|
left: left,
|
|
91002
91072
|
width: width,
|
|
@@ -92780,18 +92850,28 @@
|
|
|
92780
92850
|
var result = [];
|
|
92781
92851
|
var borderInfo = [];
|
|
92782
92852
|
var merge = {};
|
|
92783
|
-
var startOffColIndexMap = {};
|
|
92784
92853
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
92785
92854
|
var row = rows[index];
|
|
92786
|
-
var isFirstNoRs = false;
|
|
92787
92855
|
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
92788
92856
|
if (!result[index]) {
|
|
92789
92857
|
result[index] = [];
|
|
92790
92858
|
}
|
|
92859
|
+
if (copyRich) {
|
|
92860
|
+
for (var _offIndex = 0; _offIndex < result[index].length; _offIndex++) {
|
|
92861
|
+
var offNumber = result[index][_offIndex];
|
|
92862
|
+
if (offNumber === null || offNumber === void 0 ? void 0 : offNumber._mc) {
|
|
92863
|
+
cells.splice(_offIndex, 0, null);
|
|
92864
|
+
}
|
|
92865
|
+
}
|
|
92866
|
+
}
|
|
92791
92867
|
var offsetColIndex = 0;
|
|
92792
92868
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
92793
|
-
var _colIndex = startCol + offsetColIndex
|
|
92869
|
+
var _colIndex = startCol + offsetColIndex;
|
|
92794
92870
|
var cell = cells[cIndex];
|
|
92871
|
+
if (cell === null) {
|
|
92872
|
+
offsetColIndex++;
|
|
92873
|
+
continue;
|
|
92874
|
+
}
|
|
92795
92875
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
92796
92876
|
var v = cell.getAttribute("x:num");
|
|
92797
92877
|
var f = cell.getAttribute("f");
|
|
@@ -92818,40 +92898,31 @@
|
|
|
92818
92898
|
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
92819
92899
|
borderInfo.push.apply(borderInfo, _toConsumableArray$2(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
92820
92900
|
} else {
|
|
92821
|
-
isFirstNoRs = true;
|
|
92822
92901
|
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
92823
92902
|
}
|
|
92824
|
-
result[index]
|
|
92825
|
-
if (rowspan > 1) {
|
|
92826
|
-
for (var rs_index =
|
|
92827
|
-
|
|
92828
|
-
|
|
92903
|
+
result[index][offsetColIndex] = mainCell;
|
|
92904
|
+
if (rowspan > 1 || colspan > 1) {
|
|
92905
|
+
for (var rs_index = 0; rs_index < rowspan; rs_index += 1) {
|
|
92906
|
+
var nextR = index + rs_index;
|
|
92907
|
+
if (!result[nextR]) {
|
|
92908
|
+
result[nextR] = [];
|
|
92829
92909
|
}
|
|
92830
|
-
|
|
92831
|
-
|
|
92832
|
-
|
|
92833
|
-
c: _colIndex
|
|
92834
|
-
}
|
|
92835
|
-
});
|
|
92836
|
-
if (!isFirstNoRs) {
|
|
92837
|
-
if (!startOffColIndexMap[index + rs_index]) {
|
|
92838
|
-
startOffColIndexMap[index + rs_index] = 0;
|
|
92910
|
+
for (var _cIndex = 0; _cIndex < colspan; _cIndex++) {
|
|
92911
|
+
if (rs_index === 0 && _cIndex === 0) {
|
|
92912
|
+
continue;
|
|
92839
92913
|
}
|
|
92840
|
-
|
|
92914
|
+
var nextC = offsetColIndex + _cIndex;
|
|
92915
|
+
result[nextR][nextC] = {
|
|
92916
|
+
_mc: true,
|
|
92917
|
+
mc: {
|
|
92918
|
+
r: index + startRow,
|
|
92919
|
+
c: _colIndex
|
|
92920
|
+
}
|
|
92921
|
+
};
|
|
92841
92922
|
}
|
|
92842
92923
|
}
|
|
92843
92924
|
}
|
|
92844
|
-
|
|
92845
|
-
for (var cs_index = 1; cs_index < colspan; cs_index += 1) {
|
|
92846
|
-
result[index].push({
|
|
92847
|
-
mc: {
|
|
92848
|
-
r: index + startRow,
|
|
92849
|
-
c: _colIndex
|
|
92850
|
-
}
|
|
92851
|
-
});
|
|
92852
|
-
}
|
|
92853
|
-
}
|
|
92854
|
-
offsetColIndex += colspan || 1;
|
|
92925
|
+
offsetColIndex = (colspan || 1) + offsetColIndex;
|
|
92855
92926
|
} else {
|
|
92856
92927
|
var item = f ? {
|
|
92857
92928
|
f: f
|
|
@@ -92864,7 +92935,14 @@
|
|
|
92864
92935
|
}
|
|
92865
92936
|
}
|
|
92866
92937
|
return {
|
|
92867
|
-
data: result
|
|
92938
|
+
data: result === null || result === void 0 ? void 0 : result.map(function (item) {
|
|
92939
|
+
return item === null || item === void 0 ? void 0 : item.map(function (cell) {
|
|
92940
|
+
if (cell === null || cell === void 0 ? void 0 : cell._mc) {
|
|
92941
|
+
delete cell._mc;
|
|
92942
|
+
}
|
|
92943
|
+
return cell;
|
|
92944
|
+
});
|
|
92945
|
+
}),
|
|
92868
92946
|
borderInfo: borderInfo,
|
|
92869
92947
|
merge: merge
|
|
92870
92948
|
};
|
|
@@ -101878,7 +101956,7 @@
|
|
|
101878
101956
|
}
|
|
101879
101957
|
var _update = ((_luckysheetCellUpdate = luckysheetCellUpdate) === null || _luckysheetCellUpdate === void 0 ? void 0 : _luckysheetCellUpdate.length) > 0 ? luckysheetCellUpdate : draftCtx.luckysheetCellUpdate;
|
|
101880
101958
|
if ((_update === null || _update === void 0 ? void 0 : _update.length) > 0) {
|
|
101881
|
-
updateCell(draftCtx, _update[0], _update[1], refs.cellInput.current, undefined, refs.canvas.current.getContext("2d"));
|
|
101959
|
+
updateCell(draftCtx, _update[0], _update[1], refs.cellInput.current, undefined, refs.canvas.current.getContext("2d"), sheetId);
|
|
101882
101960
|
}
|
|
101883
101961
|
draftCtx.dataVerificationDropDownList = false;
|
|
101884
101962
|
draftCtx.currentSheetId = sheet.id;
|