@leankylin-sheet/core 4.0.3 → 4.0.4

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
@@ -56416,7 +56416,6 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
56416
56416
  function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
56417
56417
  var _cache$searchDialog;
56418
56418
  if (((_cache$searchDialog = cache.searchDialog) === null || _cache$searchDialog === void 0 ? void 0 : _cache$searchDialog.mouseEnter) && ctx.showSearch && ctx.showReplace) return;
56419
- if (ctx.filterContextMenu != null) return;
56420
56419
  var scrollLeft = scrollbarX.scrollLeft;
56421
56420
  var scrollTop = scrollbarY.scrollTop;
56422
56421
  if (e.deltaY !== 0) {
@@ -56935,8 +56934,6 @@ function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56935
56934
  if (!afterCellMouseMove) {
56936
56935
  return;
56937
56936
  }
56938
- ctx.contextMenu = {};
56939
- ctx.filterContextMenu = undefined;
56940
56937
  var flowdata = getFlowdata(ctx);
56941
56938
  if (!flowdata) return;
56942
56939
  var rect = container.getBoundingClientRect();
@@ -59751,11 +59748,14 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59751
59748
  var rows = htmlDoc.querySelectorAll("tbody tr");
59752
59749
  if (!rows || rows.length < 1) {
59753
59750
  return {
59754
- data: [[clipboardData.getData("text")]]
59751
+ data: [[clipboardData.getData("text")]],
59752
+ borderInfo: [],
59753
+ merge: {}
59755
59754
  };
59756
59755
  }
59757
59756
  var result = [];
59758
59757
  var borderInfo = [];
59758
+ var merge = {};
59759
59759
  var startOffColIndexMap = {};
59760
59760
  for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
59761
59761
  var row = rows[index];
@@ -59787,6 +59787,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59787
59787
  r: index + startRow,
59788
59788
  c: _colIndex
59789
59789
  };
59790
+ merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
59790
59791
  borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
59791
59792
  } else {
59792
59793
  isFirstNoRs = true;
@@ -59833,7 +59834,8 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59833
59834
  }
59834
59835
  return {
59835
59836
  data: result,
59836
- borderInfo: borderInfo
59837
+ borderInfo: borderInfo,
59838
+ merge: merge
59837
59839
  };
59838
59840
  }
59839
59841
  function handlePasteByLeanklin(_x2, _x3, _x4) {
@@ -59842,7 +59844,7 @@ function handlePasteByLeanklin(_x2, _x3, _x4) {
59842
59844
  function _handlePasteByLeanklin() {
59843
59845
  _handlePasteByLeanklin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ctx, e, copyRich) {
59844
59846
  var _ctx$luckysheet_selec8, _data$0$;
59845
- var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
59847
+ var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, merge, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
59846
59848
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
59847
59849
  while (1) switch (_context2.prev = _context2.next) {
59848
59850
  case 0:
@@ -59862,13 +59864,19 @@ function _handlePasteByLeanklin() {
59862
59864
  case 6:
59863
59865
  rows = selectRange.row;
59864
59866
  columns = selectRange.column;
59865
- _getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo;
59867
+ _getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo, merge = _getClipboardData.merge;
59866
59868
  if (!ctx.config.borderInfo) {
59867
59869
  ctx.config.borderInfo = [];
59868
59870
  }
59869
59871
  if (copyRich) {
59870
59872
  (_ctx$config$borderInf = ctx.config.borderInfo).push.apply(_ctx$config$borderInf, _toConsumableArray(borderInfo));
59871
59873
  }
59874
+ if (!ctx.config.merge) {
59875
+ ctx.config.merge = {};
59876
+ }
59877
+ if (copyRich) {
59878
+ ctx.config.merge = Object.assign(ctx.config.merge, merge);
59879
+ }
59872
59880
  index = getSheetIndex(ctx, ctx.currentSheetId);
59873
59881
  ctx.luckysheetfile[index].config = ctx.config;
59874
59882
  data = copyData;
@@ -59890,14 +59898,14 @@ function _handlePasteByLeanklin() {
59890
59898
  column: column
59891
59899
  };
59892
59900
  if (isAllowEdit(ctx, [range])) {
59893
- _context2.next = 22;
59901
+ _context2.next = 24;
59894
59902
  break;
59895
59903
  }
59896
59904
  return _context2.abrupt("return");
59897
- case 22:
59905
+ case 24:
59898
59906
  setCellValuesByRange(ctx, pasteData, range, null);
59899
59907
  ctx.luckysheet_select_save = [range];
59900
- case 24:
59908
+ case 26:
59901
59909
  case "end":
59902
59910
  return _context2.stop();
59903
59911
  }
package/dist/index.js CHANGED
@@ -56426,7 +56426,6 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
56426
56426
  function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
56427
56427
  var _cache$searchDialog;
56428
56428
  if (((_cache$searchDialog = cache.searchDialog) === null || _cache$searchDialog === void 0 ? void 0 : _cache$searchDialog.mouseEnter) && ctx.showSearch && ctx.showReplace) return;
56429
- if (ctx.filterContextMenu != null) return;
56430
56429
  var scrollLeft = scrollbarX.scrollLeft;
56431
56430
  var scrollTop = scrollbarY.scrollTop;
56432
56431
  if (e.deltaY !== 0) {
@@ -56945,8 +56944,6 @@ function handleCellAreaMouseMove(ctx, globalCache, e, container) {
56945
56944
  if (!afterCellMouseMove) {
56946
56945
  return;
56947
56946
  }
56948
- ctx.contextMenu = {};
56949
- ctx.filterContextMenu = undefined;
56950
56947
  var flowdata = getFlowdata(ctx);
56951
56948
  if (!flowdata) return;
56952
56949
  var rect = container.getBoundingClientRect();
@@ -59761,11 +59758,14 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59761
59758
  var rows = htmlDoc.querySelectorAll("tbody tr");
59762
59759
  if (!rows || rows.length < 1) {
59763
59760
  return {
59764
- data: [[clipboardData.getData("text")]]
59761
+ data: [[clipboardData.getData("text")]],
59762
+ borderInfo: [],
59763
+ merge: {}
59765
59764
  };
59766
59765
  }
59767
59766
  var result = [];
59768
59767
  var borderInfo = [];
59768
+ var merge = {};
59769
59769
  var startOffColIndexMap = {};
59770
59770
  for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
59771
59771
  var row = rows[index];
@@ -59797,6 +59797,7 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59797
59797
  r: index + startRow,
59798
59798
  c: _colIndex
59799
59799
  };
59800
+ merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
59800
59801
  borderInfo.push.apply(borderInfo, _toConsumableArray(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
59801
59802
  } else {
59802
59803
  isFirstNoRs = true;
@@ -59843,7 +59844,8 @@ function getClipboardData(ctx, e, copyRich, startRow, startCol) {
59843
59844
  }
59844
59845
  return {
59845
59846
  data: result,
59846
- borderInfo: borderInfo
59847
+ borderInfo: borderInfo,
59848
+ merge: merge
59847
59849
  };
59848
59850
  }
59849
59851
  function handlePasteByLeanklin(_x2, _x3, _x4) {
@@ -59852,7 +59854,7 @@ function handlePasteByLeanklin(_x2, _x3, _x4) {
59852
59854
  function _handlePasteByLeanklin() {
59853
59855
  _handlePasteByLeanklin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ctx, e, copyRich) {
59854
59856
  var _ctx$luckysheet_selec8, _data$0$;
59855
- var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
59857
+ var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, merge, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
59856
59858
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
59857
59859
  while (1) switch (_context2.prev = _context2.next) {
59858
59860
  case 0:
@@ -59872,13 +59874,19 @@ function _handlePasteByLeanklin() {
59872
59874
  case 6:
59873
59875
  rows = selectRange.row;
59874
59876
  columns = selectRange.column;
59875
- _getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo;
59877
+ _getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo, merge = _getClipboardData.merge;
59876
59878
  if (!ctx.config.borderInfo) {
59877
59879
  ctx.config.borderInfo = [];
59878
59880
  }
59879
59881
  if (copyRich) {
59880
59882
  (_ctx$config$borderInf = ctx.config.borderInfo).push.apply(_ctx$config$borderInf, _toConsumableArray(borderInfo));
59881
59883
  }
59884
+ if (!ctx.config.merge) {
59885
+ ctx.config.merge = {};
59886
+ }
59887
+ if (copyRich) {
59888
+ ctx.config.merge = Object.assign(ctx.config.merge, merge);
59889
+ }
59882
59890
  index = getSheetIndex(ctx, ctx.currentSheetId);
59883
59891
  ctx.luckysheetfile[index].config = ctx.config;
59884
59892
  data = copyData;
@@ -59900,14 +59908,14 @@ function _handlePasteByLeanklin() {
59900
59908
  column: column
59901
59909
  };
59902
59910
  if (isAllowEdit(ctx, [range])) {
59903
- _context2.next = 22;
59911
+ _context2.next = 24;
59904
59912
  break;
59905
59913
  }
59906
59914
  return _context2.abrupt("return");
59907
- case 22:
59915
+ case 24:
59908
59916
  setCellValuesByRange(ctx, pasteData, range, null);
59909
59917
  ctx.luckysheet_select_save = [range];
59910
- case 24:
59918
+ case 26:
59911
59919
  case "end":
59912
59920
  return _context2.stop();
59913
59921
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
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.3",
16
+ "@leankylin-sheet/formula-parser": "4.0.4",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",