@leankylin-sheet/core 1.2.11 → 1.2.12
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 +13 -1
- package/dist/index.js +12 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _, { isPlainObject } from 'lodash';
|
|
1
|
+
import _, { isPlainObject, pick } from 'lodash';
|
|
2
2
|
import numeral from 'numeral';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import { Parser, ERROR_REF } from '@leankylin-sheet/formula-parser';
|
|
@@ -68418,6 +68418,16 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
|
|
|
68418
68418
|
postPasteCut(ctx, source, target, copyRowlChange);
|
|
68419
68419
|
}
|
|
68420
68420
|
}
|
|
68421
|
+
function transofrmCellDataOfCopy(ctx, cellData, r, c) {
|
|
68422
|
+
var _currentData$data$r$c, _currentData$data, _currentData$data$r;
|
|
68423
|
+
var currentSheetId = ctx.currentSheetId,
|
|
68424
|
+
luckysheetfile = ctx.luckysheetfile;
|
|
68425
|
+
var currentData = luckysheetfile === null || luckysheetfile === void 0 ? void 0 : luckysheetfile.find(function (item) {
|
|
68426
|
+
return item.id === currentSheetId;
|
|
68427
|
+
});
|
|
68428
|
+
var originCell = (_currentData$data$r$c = (_currentData$data = currentData.data) === null || _currentData$data === void 0 ? void 0 : (_currentData$data$r = _currentData$data[r]) === null || _currentData$data$r === void 0 ? void 0 : _currentData$data$r[c]) !== null && _currentData$data$r$c !== void 0 ? _currentData$data$r$c : {};
|
|
68429
|
+
return _objectSpread2(_objectSpread2({}, originCell), pick(cellData, "v", "m"));
|
|
68430
|
+
}
|
|
68421
68431
|
function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
68422
68432
|
var _ctx$luckysheet_selec6, _ctx$luckysheet_selec7, _ctx$luckysheet_copy_5;
|
|
68423
68433
|
var allowEdit = isAllowEdit(ctx);
|
|
@@ -68597,6 +68607,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
68597
68607
|
var value = null;
|
|
68598
68608
|
if ((_copyData = copyData[h - mth]) === null || _copyData === void 0 ? void 0 : _copyData[c - mtc]) {
|
|
68599
68609
|
value = _.cloneDeep(copyData[h - mth][c - mtc]);
|
|
68610
|
+
value = transofrmCellDataOfCopy(ctx, value, h, c);
|
|
68600
68611
|
}
|
|
68601
68612
|
if (!_.isNil(value) && !_.isNil(value.f)) {
|
|
68602
68613
|
var func = value.f;
|
|
@@ -68925,6 +68936,7 @@ function handlePaste(ctx, e) {
|
|
|
68925
68936
|
while (c < colLen && !_.isNil(data[_r2][c])) {
|
|
68926
68937
|
c += 1;
|
|
68927
68938
|
}
|
|
68939
|
+
cell = transofrmCellDataOfCopy(ctx, cell, _r2, c);
|
|
68928
68940
|
if (c === colLen) {
|
|
68929
68941
|
return true;
|
|
68930
68942
|
}
|
package/dist/index.js
CHANGED
|
@@ -68428,6 +68428,16 @@ function pasteHandlerOfCutPaste(ctx, copyRange) {
|
|
|
68428
68428
|
postPasteCut(ctx, source, target, copyRowlChange);
|
|
68429
68429
|
}
|
|
68430
68430
|
}
|
|
68431
|
+
function transofrmCellDataOfCopy(ctx, cellData, r, c) {
|
|
68432
|
+
var _currentData$data$r$c, _currentData$data, _currentData$data$r;
|
|
68433
|
+
var currentSheetId = ctx.currentSheetId,
|
|
68434
|
+
luckysheetfile = ctx.luckysheetfile;
|
|
68435
|
+
var currentData = luckysheetfile === null || luckysheetfile === void 0 ? void 0 : luckysheetfile.find(function (item) {
|
|
68436
|
+
return item.id === currentSheetId;
|
|
68437
|
+
});
|
|
68438
|
+
var originCell = (_currentData$data$r$c = (_currentData$data = currentData.data) === null || _currentData$data === void 0 ? void 0 : (_currentData$data$r = _currentData$data[r]) === null || _currentData$data$r === void 0 ? void 0 : _currentData$data$r[c]) !== null && _currentData$data$r$c !== void 0 ? _currentData$data$r$c : {};
|
|
68439
|
+
return _objectSpread2(_objectSpread2({}, originCell), _.pick(cellData, "v", "m"));
|
|
68440
|
+
}
|
|
68431
68441
|
function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
68432
68442
|
var _ctx$luckysheet_selec6, _ctx$luckysheet_selec7, _ctx$luckysheet_copy_5;
|
|
68433
68443
|
var allowEdit = isAllowEdit(ctx);
|
|
@@ -68607,6 +68617,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
68607
68617
|
var value = null;
|
|
68608
68618
|
if ((_copyData = copyData[h - mth]) === null || _copyData === void 0 ? void 0 : _copyData[c - mtc]) {
|
|
68609
68619
|
value = ___default['default'].cloneDeep(copyData[h - mth][c - mtc]);
|
|
68620
|
+
value = transofrmCellDataOfCopy(ctx, value, h, c);
|
|
68610
68621
|
}
|
|
68611
68622
|
if (!___default['default'].isNil(value) && !___default['default'].isNil(value.f)) {
|
|
68612
68623
|
var func = value.f;
|
|
@@ -68935,6 +68946,7 @@ function handlePaste(ctx, e) {
|
|
|
68935
68946
|
while (c < colLen && !___default['default'].isNil(data[_r2][c])) {
|
|
68936
68947
|
c += 1;
|
|
68937
68948
|
}
|
|
68949
|
+
cell = transofrmCellDataOfCopy(ctx, cell, _r2, c);
|
|
68938
68950
|
if (c === colLen) {
|
|
68939
68951
|
return true;
|
|
68940
68952
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": "http://114.55.85.79:19999/leankylin-front/leankylin-sheet",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@leankylin-sheet/formula-parser": "^1.2.
|
|
13
|
+
"@leankylin-sheet/formula-parser": "^1.2.12",
|
|
14
14
|
"dayjs": "^1.11.0",
|
|
15
15
|
"immer": "^9.0.12",
|
|
16
16
|
"lodash": "^4.17.21",
|