@leankylin-sheet/core 4.0.36 → 4.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -51484,7 +51484,6 @@ function updateDropCell(ctx) {
51484
51484
  if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
51485
51485
  var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
51486
51486
  var v = execfunction(ctx, f, j, i);
51487
- execFunctionGroup(ctx, j, i, v[1], undefined, d);
51488
51487
  var _v = _slicedToArray(v, 3);
51489
51488
  cell.v = _v[1];
51490
51489
  cell.f = _v[2];
@@ -51566,7 +51565,6 @@ function updateDropCell(ctx) {
51566
51565
  if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
51567
51566
  var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
51568
51567
  var _v2 = execfunction(ctx, _f, _j, i);
51569
- execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
51570
51568
  var _v3 = _slicedToArray(_v2, 3);
51571
51569
  _cell.v = _v3[1];
51572
51570
  _cell.f = _v3[2];
@@ -51647,7 +51645,6 @@ function updateDropCell(ctx) {
51647
51645
  if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
51648
51646
  var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
51649
51647
  var _v4 = execfunction(ctx, _f2, _i23, _j2);
51650
- execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
51651
51648
  var _v5 = _slicedToArray(_v4, 3);
51652
51649
  _cell2.v = _v5[1];
51653
51650
  _cell2.f = _v5[2];
@@ -51722,7 +51719,6 @@ function updateDropCell(ctx) {
51722
51719
  if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
51723
51720
  var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
51724
51721
  var _v6 = execfunction(ctx, _f3, _i23, _j3);
51725
- execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
51726
51722
  var _v7 = _slicedToArray(_v6, 3);
51727
51723
  _cell3.v = _v7[1];
51728
51724
  _cell3.f = _v7[2];
@@ -51793,28 +51789,6 @@ function updateDropCell(ctx) {
51793
51789
  }
51794
51790
  }
51795
51791
  }
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
51792
  jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
51819
51793
  }
51820
51794
  function onDropCellSelectEnd(ctx, e, container) {
@@ -59899,18 +59873,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59899
59873
  var result = [];
59900
59874
  var borderInfo = [];
59901
59875
  var merge = {};
59902
- var startOffColIndexMap = {};
59903
59876
  for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
59904
59877
  var row = rows[index];
59905
- var isFirstNoRs = false;
59906
59878
  var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
59907
59879
  if (!result[index]) {
59908
59880
  result[index] = [];
59909
59881
  }
59882
+ if (copyRich) {
59883
+ for (var _offIndex = 0; _offIndex < result[index].length; _offIndex++) {
59884
+ var offNumber = result[index][_offIndex];
59885
+ if (offNumber === null || offNumber === void 0 ? void 0 : offNumber._mc) {
59886
+ cells.splice(_offIndex, 0, null);
59887
+ }
59888
+ }
59889
+ }
59910
59890
  var offsetColIndex = 0;
59911
59891
  for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
59912
- var _colIndex = startCol + offsetColIndex + (startOffColIndexMap[index] || 0);
59892
+ var _colIndex = startCol + offsetColIndex;
59913
59893
  var cell = cells[cIndex];
59894
+ if (cell === null) {
59895
+ offsetColIndex++;
59896
+ continue;
59897
+ }
59914
59898
  var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
59915
59899
  var v = cell.getAttribute("x:num");
59916
59900
  var f = cell.getAttribute("f");
@@ -59937,40 +59921,31 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59937
59921
  merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
59938
59922
  borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
59939
59923
  } else {
59940
- isFirstNoRs = true;
59941
59924
  borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
59942
59925
  }
59943
- result[index].push(mainCell);
59944
- if (rowspan > 1) {
59945
- for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
59946
- if (!result[index + rs_index]) {
59947
- result[index + rs_index] = [];
59926
+ result[index][offsetColIndex] = mainCell;
59927
+ if (rowspan > 1 || colspan > 1) {
59928
+ for (var rs_index = 0; rs_index < rowspan; rs_index += 1) {
59929
+ var nextR = index + rs_index;
59930
+ if (!result[nextR]) {
59931
+ result[nextR] = [];
59948
59932
  }
59949
- result[index + rs_index].push({
59950
- mc: {
59951
- r: index + startRow,
59952
- c: _colIndex
59953
- }
59954
- });
59955
- if (!isFirstNoRs) {
59956
- if (!startOffColIndexMap[index + rs_index]) {
59957
- startOffColIndexMap[index + rs_index] = 0;
59933
+ for (var _cIndex = 0; _cIndex < colspan; _cIndex++) {
59934
+ if (rs_index === 0 && _cIndex === 0) {
59935
+ continue;
59958
59936
  }
59959
- startOffColIndexMap[index + rs_index] += colspan || 1;
59937
+ var nextC = offsetColIndex + _cIndex;
59938
+ result[nextR][nextC] = {
59939
+ _mc: true,
59940
+ mc: {
59941
+ r: index + startRow,
59942
+ c: _colIndex
59943
+ }
59944
+ };
59960
59945
  }
59961
59946
  }
59962
59947
  }
59963
- if (colspan > 1) {
59964
- for (var cs_index = 1; cs_index < colspan; cs_index += 1) {
59965
- result[index].push({
59966
- mc: {
59967
- r: index + startRow,
59968
- c: _colIndex
59969
- }
59970
- });
59971
- }
59972
- }
59973
- offsetColIndex += colspan || 1;
59948
+ offsetColIndex = (colspan || 1) + offsetColIndex;
59974
59949
  } else {
59975
59950
  var item = f ? {
59976
59951
  f: f
@@ -59983,7 +59958,14 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59983
59958
  }
59984
59959
  }
59985
59960
  return {
59986
- data: result,
59961
+ data: result === null || result === void 0 ? void 0 : result.map(function (item) {
59962
+ return item === null || item === void 0 ? void 0 : item.map(function (cell) {
59963
+ if (cell === null || cell === void 0 ? void 0 : cell._mc) {
59964
+ delete cell._mc;
59965
+ }
59966
+ return cell;
59967
+ });
59968
+ }),
59987
59969
  borderInfo: borderInfo,
59988
59970
  merge: merge
59989
59971
  };
package/dist/index.js CHANGED
@@ -51494,7 +51494,6 @@ function updateDropCell(ctx) {
51494
51494
  if ((cell === null || cell === void 0 ? void 0 : cell.f) != null) {
51495
51495
  var f = "=".concat(functionCopy(ctx, cell.f, "down", j - apply_str_r + 1));
51496
51496
  var v = execfunction(ctx, f, j, i);
51497
- execFunctionGroup(ctx, j, i, v[1], undefined, d);
51498
51497
  var _v = _slicedToArray(v, 3);
51499
51498
  cell.v = _v[1];
51500
51499
  cell.f = _v[2];
@@ -51576,7 +51575,6 @@ function updateDropCell(ctx) {
51576
51575
  if ((_cell === null || _cell === void 0 ? void 0 : _cell.f) != null) {
51577
51576
  var _f = "=".concat(functionCopy(ctx, _cell.f, "up", apply_end_r - _j + 1));
51578
51577
  var _v2 = execfunction(ctx, _f, _j, i);
51579
- execFunctionGroup(ctx, _j, i, _v2[1], undefined, d);
51580
51578
  var _v3 = _slicedToArray(_v2, 3);
51581
51579
  _cell.v = _v3[1];
51582
51580
  _cell.f = _v3[2];
@@ -51657,7 +51655,6 @@ function updateDropCell(ctx) {
51657
51655
  if ((_cell2 === null || _cell2 === void 0 ? void 0 : _cell2.f) != null) {
51658
51656
  var _f2 = "=".concat(functionCopy(ctx, _cell2.f, "right", _j2 - apply_str_c + 1));
51659
51657
  var _v4 = execfunction(ctx, _f2, _i23, _j2);
51660
- execFunctionGroup(ctx, _j2, _i23, _v4[1], undefined, d);
51661
51658
  var _v5 = _slicedToArray(_v4, 3);
51662
51659
  _cell2.v = _v5[1];
51663
51660
  _cell2.f = _v5[2];
@@ -51732,7 +51729,6 @@ function updateDropCell(ctx) {
51732
51729
  if ((_cell3 === null || _cell3 === void 0 ? void 0 : _cell3.f) != null) {
51733
51730
  var _f3 = "=".concat(functionCopy(ctx, _cell3.f, "left", apply_end_c - _j3 + 1));
51734
51731
  var _v6 = execfunction(ctx, _f3, _i23, _j3);
51735
- execFunctionGroup(ctx, _j3, _i23, _v6[1], undefined, d);
51736
51732
  var _v7 = _slicedToArray(_v6, 3);
51737
51733
  _cell3.v = _v7[1];
51738
51734
  _cell3.f = _v7[2];
@@ -51803,28 +51799,6 @@ function updateDropCell(ctx) {
51803
51799
  }
51804
51800
  }
51805
51801
  }
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
51802
  jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
51829
51803
  }
51830
51804
  function onDropCellSelectEnd(ctx, e, container) {
@@ -59909,18 +59883,28 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59909
59883
  var result = [];
59910
59884
  var borderInfo = [];
59911
59885
  var merge = {};
59912
- var startOffColIndexMap = {};
59913
59886
  for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
59914
59887
  var row = rows[index];
59915
- var isFirstNoRs = false;
59916
59888
  var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
59917
59889
  if (!result[index]) {
59918
59890
  result[index] = [];
59919
59891
  }
59892
+ if (copyRich) {
59893
+ for (var _offIndex = 0; _offIndex < result[index].length; _offIndex++) {
59894
+ var offNumber = result[index][_offIndex];
59895
+ if (offNumber === null || offNumber === void 0 ? void 0 : offNumber._mc) {
59896
+ cells.splice(_offIndex, 0, null);
59897
+ }
59898
+ }
59899
+ }
59920
59900
  var offsetColIndex = 0;
59921
59901
  for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
59922
- var _colIndex = startCol + offsetColIndex + (startOffColIndexMap[index] || 0);
59902
+ var _colIndex = startCol + offsetColIndex;
59923
59903
  var cell = cells[cIndex];
59904
+ if (cell === null) {
59905
+ offsetColIndex++;
59906
+ continue;
59907
+ }
59924
59908
  var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
59925
59909
  var v = cell.getAttribute("x:num");
59926
59910
  var f = cell.getAttribute("f");
@@ -59947,40 +59931,31 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59947
59931
  merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
59948
59932
  borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
59949
59933
  } else {
59950
- isFirstNoRs = true;
59951
59934
  borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
59952
59935
  }
59953
- result[index].push(mainCell);
59954
- if (rowspan > 1) {
59955
- for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
59956
- if (!result[index + rs_index]) {
59957
- result[index + rs_index] = [];
59936
+ result[index][offsetColIndex] = mainCell;
59937
+ if (rowspan > 1 || colspan > 1) {
59938
+ for (var rs_index = 0; rs_index < rowspan; rs_index += 1) {
59939
+ var nextR = index + rs_index;
59940
+ if (!result[nextR]) {
59941
+ result[nextR] = [];
59958
59942
  }
59959
- result[index + rs_index].push({
59960
- mc: {
59961
- r: index + startRow,
59962
- c: _colIndex
59963
- }
59964
- });
59965
- if (!isFirstNoRs) {
59966
- if (!startOffColIndexMap[index + rs_index]) {
59967
- startOffColIndexMap[index + rs_index] = 0;
59943
+ for (var _cIndex = 0; _cIndex < colspan; _cIndex++) {
59944
+ if (rs_index === 0 && _cIndex === 0) {
59945
+ continue;
59968
59946
  }
59969
- startOffColIndexMap[index + rs_index] += colspan || 1;
59947
+ var nextC = offsetColIndex + _cIndex;
59948
+ result[nextR][nextC] = {
59949
+ _mc: true,
59950
+ mc: {
59951
+ r: index + startRow,
59952
+ c: _colIndex
59953
+ }
59954
+ };
59970
59955
  }
59971
59956
  }
59972
59957
  }
59973
- if (colspan > 1) {
59974
- for (var cs_index = 1; cs_index < colspan; cs_index += 1) {
59975
- result[index].push({
59976
- mc: {
59977
- r: index + startRow,
59978
- c: _colIndex
59979
- }
59980
- });
59981
- }
59982
- }
59983
- offsetColIndex += colspan || 1;
59958
+ offsetColIndex = (colspan || 1) + offsetColIndex;
59984
59959
  } else {
59985
59960
  var item = f ? {
59986
59961
  f: f
@@ -59993,7 +59968,14 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59993
59968
  }
59994
59969
  }
59995
59970
  return {
59996
- data: result,
59971
+ data: result === null || result === void 0 ? void 0 : result.map(function (item) {
59972
+ return item === null || item === void 0 ? void 0 : item.map(function (cell) {
59973
+ if (cell === null || cell === void 0 ? void 0 : cell._mc) {
59974
+ delete cell._mc;
59975
+ }
59976
+ return cell;
59977
+ });
59978
+ }),
59997
59979
  borderInfo: borderInfo,
59998
59980
  merge: merge
59999
59981
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.36",
3
+ "version": "4.0.38",
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.36",
16
+ "@leankylin-sheet/formula-parser": "4.0.38",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",