@leankylin-sheet/core 4.0.36 → 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/index.esm.js +28 -45
- package/dist/index.js +28 -45
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -36171,6 +36171,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36171
36171
|
if (_.isNil(data)) {
|
|
36172
36172
|
data = getFlowdata(ctx);
|
|
36173
36173
|
}
|
|
36174
|
+
debugger;
|
|
36174
36175
|
if (_.isNil(ctx.formulaCache.execFunctionGlobalData)) {
|
|
36175
36176
|
ctx.formulaCache.execFunctionGlobalData = {};
|
|
36176
36177
|
}
|
|
@@ -51484,7 +51485,6 @@ function updateDropCell(ctx) {
|
|
|
51484
51485
|
if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
|
|
51485
51486
|
var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
|
|
51486
51487
|
var v = execfunction(ctx, f, j, i);
|
|
51487
|
-
execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
51488
51488
|
var _v = _slicedToArray(v, 3);
|
|
51489
51489
|
cell.v = _v[1];
|
|
51490
51490
|
cell.f = _v[2];
|
|
@@ -51566,7 +51566,6 @@ function updateDropCell(ctx) {
|
|
|
51566
51566
|
if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
|
|
51567
51567
|
var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
|
|
51568
51568
|
var _v2 = execfunction(ctx, _f, _j, i);
|
|
51569
|
-
execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
|
|
51570
51569
|
var _v3 = _slicedToArray(_v2, 3);
|
|
51571
51570
|
_cell.v = _v3[1];
|
|
51572
51571
|
_cell.f = _v3[2];
|
|
@@ -51647,7 +51646,6 @@ function updateDropCell(ctx) {
|
|
|
51647
51646
|
if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
|
|
51648
51647
|
var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
|
|
51649
51648
|
var _v4 = execfunction(ctx, _f2, _i23, _j2);
|
|
51650
|
-
execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
|
|
51651
51649
|
var _v5 = _slicedToArray(_v4, 3);
|
|
51652
51650
|
_cell2.v = _v5[1];
|
|
51653
51651
|
_cell2.f = _v5[2];
|
|
@@ -51722,7 +51720,6 @@ function updateDropCell(ctx) {
|
|
|
51722
51720
|
if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
|
|
51723
51721
|
var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
|
|
51724
51722
|
var _v6 = execfunction(ctx, _f3, _i23, _j3);
|
|
51725
|
-
execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
|
|
51726
51723
|
var _v7 = _slicedToArray(_v6, 3);
|
|
51727
51724
|
_cell3.v = _v7[1];
|
|
51728
51725
|
_cell3.f = _v7[2];
|
|
@@ -51793,28 +51790,6 @@ function updateDropCell(ctx) {
|
|
|
51793
51790
|
}
|
|
51794
51791
|
}
|
|
51795
51792
|
}
|
|
51796
|
-
var cdformat = file.luckysheet_conditionformat_save;
|
|
51797
|
-
if (cdformat != null && cdformat.length > 0) {
|
|
51798
|
-
for (var _i24 = 0; _i24 < cdformat.length; _i24 += 1) {
|
|
51799
|
-
var cdformat_cellrange = cdformat[_i24].cellrange;
|
|
51800
|
-
var emptyRange = [];
|
|
51801
|
-
for (var _j4 = 0; _j4 < cdformat_cellrange.length; _j4 += 1) {
|
|
51802
|
-
var range = CFSplitRange(cdformat_cellrange[_j4], {
|
|
51803
|
-
row: copyRange.row,
|
|
51804
|
-
column: copyRange.column
|
|
51805
|
-
}, {
|
|
51806
|
-
row: applyRange.row,
|
|
51807
|
-
column: applyRange.column
|
|
51808
|
-
}, "operatePart");
|
|
51809
|
-
if (range.length > 0) {
|
|
51810
|
-
emptyRange = emptyRange.concat(range);
|
|
51811
|
-
}
|
|
51812
|
-
}
|
|
51813
|
-
if (emptyRange.length > 0) {
|
|
51814
|
-
cdformat[_i24].cellrange.push(applyRange);
|
|
51815
|
-
}
|
|
51816
|
-
}
|
|
51817
|
-
}
|
|
51818
51793
|
jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
|
|
51819
51794
|
}
|
|
51820
51795
|
function onDropCellSelectEnd(ctx, e, container) {
|
|
@@ -59899,18 +59874,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59899
59874
|
var result = [];
|
|
59900
59875
|
var borderInfo = [];
|
|
59901
59876
|
var merge = {};
|
|
59902
|
-
var startOffColIndexMap = {};
|
|
59903
59877
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
59904
59878
|
var row = rows[index];
|
|
59905
|
-
var isFirstNoRs = false;
|
|
59906
59879
|
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
59907
59880
|
if (!result[index]) {
|
|
59908
59881
|
result[index] = [];
|
|
59909
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
|
+
}
|
|
59910
59891
|
var offsetColIndex = 0;
|
|
59911
59892
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
59912
|
-
var _colIndex = startCol + offsetColIndex
|
|
59893
|
+
var _colIndex = startCol + offsetColIndex;
|
|
59913
59894
|
var cell = cells[cIndex];
|
|
59895
|
+
if (cell === null) {
|
|
59896
|
+
offsetColIndex++;
|
|
59897
|
+
continue;
|
|
59898
|
+
}
|
|
59914
59899
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
59915
59900
|
var v = cell.getAttribute("x:num");
|
|
59916
59901
|
var f = cell.getAttribute("f");
|
|
@@ -59937,26 +59922,23 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59937
59922
|
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
59938
59923
|
borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
59939
59924
|
} else {
|
|
59940
|
-
isFirstNoRs = true;
|
|
59941
59925
|
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
59942
59926
|
}
|
|
59943
|
-
result[index]
|
|
59927
|
+
result[index][_colIndex] = mainCell;
|
|
59944
59928
|
if (rowspan > 1) {
|
|
59945
59929
|
for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
|
|
59946
|
-
|
|
59947
|
-
|
|
59930
|
+
var nextR = index + rs_index;
|
|
59931
|
+
if (!result[nextR]) {
|
|
59932
|
+
result[nextR] = [];
|
|
59948
59933
|
}
|
|
59949
|
-
|
|
59950
|
-
|
|
59951
|
-
|
|
59952
|
-
|
|
59953
|
-
|
|
59954
|
-
|
|
59955
|
-
|
|
59956
|
-
|
|
59957
|
-
startOffColIndexMap[index + rs_index] = 0;
|
|
59958
|
-
}
|
|
59959
|
-
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
|
+
};
|
|
59960
59942
|
}
|
|
59961
59943
|
}
|
|
59962
59944
|
}
|
|
@@ -59970,7 +59952,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59970
59952
|
});
|
|
59971
59953
|
}
|
|
59972
59954
|
}
|
|
59973
|
-
offsetColIndex
|
|
59955
|
+
offsetColIndex = (colspan || 1) + offsetColIndex;
|
|
59974
59956
|
} else {
|
|
59975
59957
|
var item = f ? {
|
|
59976
59958
|
f: f
|
|
@@ -59982,6 +59964,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59982
59964
|
}
|
|
59983
59965
|
}
|
|
59984
59966
|
}
|
|
59967
|
+
console.log("result", result);
|
|
59985
59968
|
return {
|
|
59986
59969
|
data: result,
|
|
59987
59970
|
borderInfo: borderInfo,
|
package/dist/index.js
CHANGED
|
@@ -36181,6 +36181,7 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
36181
36181
|
if (___default['default'].isNil(data)) {
|
|
36182
36182
|
data = getFlowdata(ctx);
|
|
36183
36183
|
}
|
|
36184
|
+
debugger;
|
|
36184
36185
|
if (___default['default'].isNil(ctx.formulaCache.execFunctionGlobalData)) {
|
|
36185
36186
|
ctx.formulaCache.execFunctionGlobalData = {};
|
|
36186
36187
|
}
|
|
@@ -51494,7 +51495,6 @@ function updateDropCell(ctx) {
|
|
|
51494
51495
|
if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
|
|
51495
51496
|
var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
|
|
51496
51497
|
var v = execfunction(ctx, f, j, i);
|
|
51497
|
-
execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
51498
51498
|
var _v = _slicedToArray(v, 3);
|
|
51499
51499
|
cell.v = _v[1];
|
|
51500
51500
|
cell.f = _v[2];
|
|
@@ -51576,7 +51576,6 @@ function updateDropCell(ctx) {
|
|
|
51576
51576
|
if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
|
|
51577
51577
|
var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
|
|
51578
51578
|
var _v2 = execfunction(ctx, _f, _j, i);
|
|
51579
|
-
execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
|
|
51580
51579
|
var _v3 = _slicedToArray(_v2, 3);
|
|
51581
51580
|
_cell.v = _v3[1];
|
|
51582
51581
|
_cell.f = _v3[2];
|
|
@@ -51657,7 +51656,6 @@ function updateDropCell(ctx) {
|
|
|
51657
51656
|
if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
|
|
51658
51657
|
var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
|
|
51659
51658
|
var _v4 = execfunction(ctx, _f2, _i23, _j2);
|
|
51660
|
-
execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
|
|
51661
51659
|
var _v5 = _slicedToArray(_v4, 3);
|
|
51662
51660
|
_cell2.v = _v5[1];
|
|
51663
51661
|
_cell2.f = _v5[2];
|
|
@@ -51732,7 +51730,6 @@ function updateDropCell(ctx) {
|
|
|
51732
51730
|
if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
|
|
51733
51731
|
var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
|
|
51734
51732
|
var _v6 = execfunction(ctx, _f3, _i23, _j3);
|
|
51735
|
-
execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
|
|
51736
51733
|
var _v7 = _slicedToArray(_v6, 3);
|
|
51737
51734
|
_cell3.v = _v7[1];
|
|
51738
51735
|
_cell3.f = _v7[2];
|
|
@@ -51803,28 +51800,6 @@ function updateDropCell(ctx) {
|
|
|
51803
51800
|
}
|
|
51804
51801
|
}
|
|
51805
51802
|
}
|
|
51806
|
-
var cdformat = file.luckysheet_conditionformat_save;
|
|
51807
|
-
if (cdformat != null && cdformat.length > 0) {
|
|
51808
|
-
for (var _i24 = 0; _i24 < cdformat.length; _i24 += 1) {
|
|
51809
|
-
var cdformat_cellrange = cdformat[_i24].cellrange;
|
|
51810
|
-
var emptyRange = [];
|
|
51811
|
-
for (var _j4 = 0; _j4 < cdformat_cellrange.length; _j4 += 1) {
|
|
51812
|
-
var range = CFSplitRange(cdformat_cellrange[_j4], {
|
|
51813
|
-
row: copyRange.row,
|
|
51814
|
-
column: copyRange.column
|
|
51815
|
-
}, {
|
|
51816
|
-
row: applyRange.row,
|
|
51817
|
-
column: applyRange.column
|
|
51818
|
-
}, "operatePart");
|
|
51819
|
-
if (range.length > 0) {
|
|
51820
|
-
emptyRange = emptyRange.concat(range);
|
|
51821
|
-
}
|
|
51822
|
-
}
|
|
51823
|
-
if (emptyRange.length > 0) {
|
|
51824
|
-
cdformat[_i24].cellrange.push(applyRange);
|
|
51825
|
-
}
|
|
51826
|
-
}
|
|
51827
|
-
}
|
|
51828
51803
|
jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
|
|
51829
51804
|
}
|
|
51830
51805
|
function onDropCellSelectEnd(ctx, e, container) {
|
|
@@ -59909,18 +59884,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59909
59884
|
var result = [];
|
|
59910
59885
|
var borderInfo = [];
|
|
59911
59886
|
var merge = {};
|
|
59912
|
-
var startOffColIndexMap = {};
|
|
59913
59887
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
59914
59888
|
var row = rows[index];
|
|
59915
|
-
var isFirstNoRs = false;
|
|
59916
59889
|
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
59917
59890
|
if (!result[index]) {
|
|
59918
59891
|
result[index] = [];
|
|
59919
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
|
+
}
|
|
59920
59901
|
var offsetColIndex = 0;
|
|
59921
59902
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
59922
|
-
var _colIndex = startCol + offsetColIndex
|
|
59903
|
+
var _colIndex = startCol + offsetColIndex;
|
|
59923
59904
|
var cell = cells[cIndex];
|
|
59905
|
+
if (cell === null) {
|
|
59906
|
+
offsetColIndex++;
|
|
59907
|
+
continue;
|
|
59908
|
+
}
|
|
59924
59909
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
59925
59910
|
var v = cell.getAttribute("x:num");
|
|
59926
59911
|
var f = cell.getAttribute("f");
|
|
@@ -59947,26 +59932,23 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59947
59932
|
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
59948
59933
|
borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
59949
59934
|
} else {
|
|
59950
|
-
isFirstNoRs = true;
|
|
59951
59935
|
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
59952
59936
|
}
|
|
59953
|
-
result[index]
|
|
59937
|
+
result[index][_colIndex] = mainCell;
|
|
59954
59938
|
if (rowspan > 1) {
|
|
59955
59939
|
for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
|
|
59956
|
-
|
|
59957
|
-
|
|
59940
|
+
var nextR = index + rs_index;
|
|
59941
|
+
if (!result[nextR]) {
|
|
59942
|
+
result[nextR] = [];
|
|
59958
59943
|
}
|
|
59959
|
-
|
|
59960
|
-
|
|
59961
|
-
|
|
59962
|
-
|
|
59963
|
-
|
|
59964
|
-
|
|
59965
|
-
|
|
59966
|
-
|
|
59967
|
-
startOffColIndexMap[index + rs_index] = 0;
|
|
59968
|
-
}
|
|
59969
|
-
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
|
+
};
|
|
59970
59952
|
}
|
|
59971
59953
|
}
|
|
59972
59954
|
}
|
|
@@ -59980,7 +59962,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59980
59962
|
});
|
|
59981
59963
|
}
|
|
59982
59964
|
}
|
|
59983
|
-
offsetColIndex
|
|
59965
|
+
offsetColIndex = (colspan || 1) + offsetColIndex;
|
|
59984
59966
|
} else {
|
|
59985
59967
|
var item = f ? {
|
|
59986
59968
|
f: f
|
|
@@ -59992,6 +59974,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
|
59992
59974
|
}
|
|
59993
59975
|
}
|
|
59994
59976
|
}
|
|
59977
|
+
console.log("result", result);
|
|
59995
59978
|
return {
|
|
59996
59979
|
data: result,
|
|
59997
59980
|
borderInfo: borderInfo,
|
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",
|