@leankylin-sheet/core 1.2.18 → 1.2.20
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 +102 -107
- package/dist/index.js +102 -107
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -4,6 +4,67 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import { Parser, ERROR_REF } from '@leankylin-sheet/formula-parser';
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
|
|
7
|
+
function _arrayLikeToArray(r, a) {
|
|
8
|
+
(null == a || a > r.length) && (a = r.length);
|
|
9
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function _arrayWithHoles(r) {
|
|
13
|
+
if (Array.isArray(r)) return r;
|
|
14
|
+
}
|
|
15
|
+
function _arrayWithoutHoles(r) {
|
|
16
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
17
|
+
}
|
|
18
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
19
|
+
try {
|
|
20
|
+
var i = n[a](c),
|
|
21
|
+
u = i.value;
|
|
22
|
+
} catch (n) {
|
|
23
|
+
return void e(n);
|
|
24
|
+
}
|
|
25
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
26
|
+
}
|
|
27
|
+
function _asyncToGenerator(n) {
|
|
28
|
+
return function () {
|
|
29
|
+
var t = this,
|
|
30
|
+
e = arguments;
|
|
31
|
+
return new Promise(function (r, o) {
|
|
32
|
+
var a = n.apply(t, e);
|
|
33
|
+
function _next(n) {
|
|
34
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
35
|
+
}
|
|
36
|
+
function _throw(n) {
|
|
37
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
38
|
+
}
|
|
39
|
+
_next(void 0);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function _classCallCheck(a, n) {
|
|
44
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
45
|
+
}
|
|
46
|
+
function _defineProperties(e, r) {
|
|
47
|
+
for (var t = 0; t < r.length; t++) {
|
|
48
|
+
var o = r[t];
|
|
49
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function _createClass(e, r, t) {
|
|
53
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
54
|
+
writable: !1
|
|
55
|
+
}), e;
|
|
56
|
+
}
|
|
57
|
+
function _defineProperty(e, r, t) {
|
|
58
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
59
|
+
value: t,
|
|
60
|
+
enumerable: !0,
|
|
61
|
+
configurable: !0,
|
|
62
|
+
writable: !0
|
|
63
|
+
}) : e[r] = t, e;
|
|
64
|
+
}
|
|
65
|
+
function _iterableToArray(r) {
|
|
66
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
67
|
+
}
|
|
7
68
|
function _iterableToArrayLimit(r, l) {
|
|
8
69
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9
70
|
if (null != t) {
|
|
@@ -31,6 +92,12 @@ function _iterableToArrayLimit(r, l) {
|
|
|
31
92
|
return a;
|
|
32
93
|
}
|
|
33
94
|
}
|
|
95
|
+
function _nonIterableRest() {
|
|
96
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
97
|
+
}
|
|
98
|
+
function _nonIterableSpread() {
|
|
99
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
100
|
+
}
|
|
34
101
|
function ownKeys(e, r) {
|
|
35
102
|
var t = Object.keys(e);
|
|
36
103
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -353,6 +420,12 @@ function _regeneratorRuntime() {
|
|
|
353
420
|
}
|
|
354
421
|
}, e;
|
|
355
422
|
}
|
|
423
|
+
function _slicedToArray(r, e) {
|
|
424
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
425
|
+
}
|
|
426
|
+
function _toConsumableArray(r) {
|
|
427
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
428
|
+
}
|
|
356
429
|
function _toPrimitive(t, r) {
|
|
357
430
|
if ("object" != typeof t || !t) return t;
|
|
358
431
|
var e = t[Symbol.toPrimitive];
|
|
@@ -376,106 +449,13 @@ function _typeof(o) {
|
|
|
376
449
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
377
450
|
}, _typeof(o);
|
|
378
451
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
reject(error);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
if (info.done) {
|
|
388
|
-
resolve(value);
|
|
389
|
-
} else {
|
|
390
|
-
Promise.resolve(value).then(_next, _throw);
|
|
452
|
+
function _unsupportedIterableToArray(r, a) {
|
|
453
|
+
if (r) {
|
|
454
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
455
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
456
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
391
457
|
}
|
|
392
458
|
}
|
|
393
|
-
function _asyncToGenerator(fn) {
|
|
394
|
-
return function () {
|
|
395
|
-
var self = this,
|
|
396
|
-
args = arguments;
|
|
397
|
-
return new Promise(function (resolve, reject) {
|
|
398
|
-
var gen = fn.apply(self, args);
|
|
399
|
-
function _next(value) {
|
|
400
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
401
|
-
}
|
|
402
|
-
function _throw(err) {
|
|
403
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
404
|
-
}
|
|
405
|
-
_next(undefined);
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
function _classCallCheck(instance, Constructor) {
|
|
410
|
-
if (!(instance instanceof Constructor)) {
|
|
411
|
-
throw new TypeError("Cannot call a class as a function");
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
function _defineProperties(target, props) {
|
|
415
|
-
for (var i = 0; i < props.length; i++) {
|
|
416
|
-
var descriptor = props[i];
|
|
417
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
418
|
-
descriptor.configurable = true;
|
|
419
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
420
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
424
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
425
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
426
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
427
|
-
writable: false
|
|
428
|
-
});
|
|
429
|
-
return Constructor;
|
|
430
|
-
}
|
|
431
|
-
function _defineProperty(obj, key, value) {
|
|
432
|
-
key = _toPropertyKey(key);
|
|
433
|
-
if (key in obj) {
|
|
434
|
-
Object.defineProperty(obj, key, {
|
|
435
|
-
value: value,
|
|
436
|
-
enumerable: true,
|
|
437
|
-
configurable: true,
|
|
438
|
-
writable: true
|
|
439
|
-
});
|
|
440
|
-
} else {
|
|
441
|
-
obj[key] = value;
|
|
442
|
-
}
|
|
443
|
-
return obj;
|
|
444
|
-
}
|
|
445
|
-
function _slicedToArray(arr, i) {
|
|
446
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
447
|
-
}
|
|
448
|
-
function _toConsumableArray(arr) {
|
|
449
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
450
|
-
}
|
|
451
|
-
function _arrayWithoutHoles(arr) {
|
|
452
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
453
|
-
}
|
|
454
|
-
function _arrayWithHoles(arr) {
|
|
455
|
-
if (Array.isArray(arr)) return arr;
|
|
456
|
-
}
|
|
457
|
-
function _iterableToArray(iter) {
|
|
458
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
459
|
-
}
|
|
460
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
461
|
-
if (!o) return;
|
|
462
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
463
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
464
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
465
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
466
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
467
|
-
}
|
|
468
|
-
function _arrayLikeToArray(arr, len) {
|
|
469
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
470
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
471
|
-
return arr2;
|
|
472
|
-
}
|
|
473
|
-
function _nonIterableSpread() {
|
|
474
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
475
|
-
}
|
|
476
|
-
function _nonIterableRest() {
|
|
477
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
478
|
-
}
|
|
479
459
|
|
|
480
460
|
var en = {
|
|
481
461
|
generalDialog: {
|
|
@@ -44326,7 +44306,7 @@ var make_ssf = function make_ssf(SSF) {
|
|
|
44326
44306
|
function split_fmt(fmt) {
|
|
44327
44307
|
var out = [];
|
|
44328
44308
|
var in_str = false; /*, cc*/
|
|
44329
|
-
for (var i = 0, j = 0; i < fmt.length; ++i) switch (
|
|
44309
|
+
for (var i = 0, j = 0; i < fmt.length; ++i) switch (/*cc=*/fmt.charCodeAt(i)) {
|
|
44330
44310
|
case 34:
|
|
44331
44311
|
/* '"' */in_str = !in_str;
|
|
44332
44312
|
break;
|
|
@@ -52336,14 +52316,28 @@ function copy(ctx) {
|
|
|
52336
52316
|
for (var r = rows[0]; r <= rows[1]; r += 1) {
|
|
52337
52317
|
cpString += "<tr>";
|
|
52338
52318
|
for (var c = columns[0]; c <= columns[1]; c += 1) {
|
|
52339
|
-
var _flowdata$r, _ref, _data$m;
|
|
52319
|
+
var _flowdata$r, _ref, _data$m, _ref2, _data$v, _data$mc$rs, _data$mc, _data$mc$cs, _data$mc2, _data$bg, _data$fc, _data$ht;
|
|
52340
52320
|
var data = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r = flowdata[r]) === null || _flowdata$r === void 0 ? void 0 : _flowdata$r[c];
|
|
52341
52321
|
var value = (_ref = (_data$m = data === null || data === void 0 ? void 0 : data.m) !== null && _data$m !== void 0 ? _data$m : data === null || data === void 0 ? void 0 : data.v) !== null && _ref !== void 0 ? _ref : "";
|
|
52342
|
-
|
|
52322
|
+
var realValue = (_ref2 = (_data$v = data === null || data === void 0 ? void 0 : data.v) !== null && _data$v !== void 0 ? _data$v : data === null || data === void 0 ? void 0 : data.m) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
52323
|
+
var rowspan = (_data$mc$rs = data === null || data === void 0 ? void 0 : (_data$mc = data.mc) === null || _data$mc === void 0 ? void 0 : _data$mc.rs) !== null && _data$mc$rs !== void 0 ? _data$mc$rs : 1;
|
|
52324
|
+
var colspan = (_data$mc$cs = data === null || data === void 0 ? void 0 : (_data$mc2 = data.mc) === null || _data$mc2 === void 0 ? void 0 : _data$mc2.cs) !== null && _data$mc$cs !== void 0 ? _data$mc$cs : 1;
|
|
52325
|
+
var bg = (_data$bg = data === null || data === void 0 ? void 0 : data.bg) !== null && _data$bg !== void 0 ? _data$bg : "#fff";
|
|
52326
|
+
var fc = (_data$fc = data === null || data === void 0 ? void 0 : data.fc) !== null && _data$fc !== void 0 ? _data$fc : "#000";
|
|
52327
|
+
var ht = (_data$ht = data === null || data === void 0 ? void 0 : data.ht) !== null && _data$ht !== void 0 ? _data$ht : "1";
|
|
52328
|
+
var textAlign = {
|
|
52329
|
+
0: "center",
|
|
52330
|
+
1: "left",
|
|
52331
|
+
2: "right"
|
|
52332
|
+
}[String(ht)];
|
|
52333
|
+
if (!(data === null || data === void 0 ? void 0 : data.mc) || (data === null || data === void 0 ? void 0 : data.mc) && (data === null || data === void 0 ? void 0 : data.mc.r) === r && data.mc.c === c) {
|
|
52334
|
+
var style = "background: ".concat(bg, "; color: ").concat(fc, "; text-align: ").concat(textAlign, "; vertical-align: middle;");
|
|
52335
|
+
cpString += "<td x:num=".concat(realValue, " style='").concat(style, "' rowspan=").concat(rowspan, " colspan=").concat(colspan, "> ").concat(value, " </td>");
|
|
52336
|
+
}
|
|
52343
52337
|
}
|
|
52344
52338
|
cpString += "</tr>";
|
|
52345
52339
|
}
|
|
52346
|
-
var result = "<table data-type=\"leankylin-copy-action-table\">".concat(cpString, "</table>");
|
|
52340
|
+
var result = "<table border=\"1\" style=\"border-collapse:collapse\" data-type=\"leankylin-copy-action-table\">".concat(cpString, "</table>");
|
|
52347
52341
|
clipboard.writeHtml(result);
|
|
52348
52342
|
}
|
|
52349
52343
|
function copy2(ctx) {
|
|
@@ -64076,7 +64070,7 @@ function getFilterColumnColors(ctx, col, startRow, endRow) {
|
|
|
64076
64070
|
fc = fc.substr(0, 1) + fc.substr(1, 1).repeat(2) + fc.substr(2, 1).repeat(2) + fc.substr(3, 1).repeat(2);
|
|
64077
64071
|
}
|
|
64078
64072
|
}
|
|
64079
|
-
var isRowHidden =
|
|
64073
|
+
var isRowHidden = r in (((_ctx$config = ctx.config) === null || _ctx$config === void 0 ? void 0 : _ctx$config.rowhidden) || {});
|
|
64080
64074
|
var bgData = bgMap.get(bg);
|
|
64081
64075
|
if (bgData != null) {
|
|
64082
64076
|
bgData.rows.push(r);
|
|
@@ -69432,7 +69426,7 @@ function getClipboardContent() {
|
|
|
69432
69426
|
return _getClipboardContent.apply(this, arguments);
|
|
69433
69427
|
}
|
|
69434
69428
|
function _getClipboardContent() {
|
|
69435
|
-
_getClipboardContent = _asyncToGenerator(
|
|
69429
|
+
_getClipboardContent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
69436
69430
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
69437
69431
|
while (1) switch (_context.prev = _context.next) {
|
|
69438
69432
|
case 0:
|
|
@@ -69470,9 +69464,10 @@ function getClipboardData(e) {
|
|
|
69470
69464
|
var cells = row.querySelectorAll("td");
|
|
69471
69465
|
var rowData = [];
|
|
69472
69466
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
69473
|
-
var _cell$
|
|
69467
|
+
var _ref, _cell$getAttribute, _cell$textContent;
|
|
69474
69468
|
var cell = cells[cIndex];
|
|
69475
|
-
|
|
69469
|
+
var value = (_ref = (_cell$getAttribute = cell.getAttribute("x:num")) !== null && _cell$getAttribute !== void 0 ? _cell$getAttribute : cell === null || cell === void 0 ? void 0 : (_cell$textContent = cell.textContent) === null || _cell$textContent === void 0 ? void 0 : _cell$textContent.trim()) !== null && _ref !== void 0 ? _ref : "";
|
|
69470
|
+
rowData.push(value);
|
|
69476
69471
|
}
|
|
69477
69472
|
result.push(rowData);
|
|
69478
69473
|
}
|
|
@@ -69482,7 +69477,7 @@ function handlePasteByLeanklin(_x2, _x3) {
|
|
|
69482
69477
|
return _handlePasteByLeanklin.apply(this, arguments);
|
|
69483
69478
|
}
|
|
69484
69479
|
function _handlePasteByLeanklin() {
|
|
69485
|
-
_handlePasteByLeanklin = _asyncToGenerator(
|
|
69480
|
+
_handlePasteByLeanklin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ctx, e) {
|
|
69486
69481
|
var _ctx$luckysheet_selec8;
|
|
69487
69482
|
var data, allowEdit, selectRange, rows, columns, copyOne, newData, r, rIndex, c, row, column, range;
|
|
69488
69483
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,67 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
|
14
14
|
var numeral__default = /*#__PURE__*/_interopDefaultLegacy(numeral);
|
|
15
15
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
16
16
|
|
|
17
|
+
function _arrayLikeToArray(r, a) {
|
|
18
|
+
(null == a || a > r.length) && (a = r.length);
|
|
19
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function _arrayWithHoles(r) {
|
|
23
|
+
if (Array.isArray(r)) return r;
|
|
24
|
+
}
|
|
25
|
+
function _arrayWithoutHoles(r) {
|
|
26
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
27
|
+
}
|
|
28
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
29
|
+
try {
|
|
30
|
+
var i = n[a](c),
|
|
31
|
+
u = i.value;
|
|
32
|
+
} catch (n) {
|
|
33
|
+
return void e(n);
|
|
34
|
+
}
|
|
35
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
36
|
+
}
|
|
37
|
+
function _asyncToGenerator(n) {
|
|
38
|
+
return function () {
|
|
39
|
+
var t = this,
|
|
40
|
+
e = arguments;
|
|
41
|
+
return new Promise(function (r, o) {
|
|
42
|
+
var a = n.apply(t, e);
|
|
43
|
+
function _next(n) {
|
|
44
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
45
|
+
}
|
|
46
|
+
function _throw(n) {
|
|
47
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
48
|
+
}
|
|
49
|
+
_next(void 0);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function _classCallCheck(a, n) {
|
|
54
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
55
|
+
}
|
|
56
|
+
function _defineProperties(e, r) {
|
|
57
|
+
for (var t = 0; t < r.length; t++) {
|
|
58
|
+
var o = r[t];
|
|
59
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function _createClass(e, r, t) {
|
|
63
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
64
|
+
writable: !1
|
|
65
|
+
}), e;
|
|
66
|
+
}
|
|
67
|
+
function _defineProperty(e, r, t) {
|
|
68
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
69
|
+
value: t,
|
|
70
|
+
enumerable: !0,
|
|
71
|
+
configurable: !0,
|
|
72
|
+
writable: !0
|
|
73
|
+
}) : e[r] = t, e;
|
|
74
|
+
}
|
|
75
|
+
function _iterableToArray(r) {
|
|
76
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
77
|
+
}
|
|
17
78
|
function _iterableToArrayLimit(r, l) {
|
|
18
79
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
19
80
|
if (null != t) {
|
|
@@ -41,6 +102,12 @@ function _iterableToArrayLimit(r, l) {
|
|
|
41
102
|
return a;
|
|
42
103
|
}
|
|
43
104
|
}
|
|
105
|
+
function _nonIterableRest() {
|
|
106
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
107
|
+
}
|
|
108
|
+
function _nonIterableSpread() {
|
|
109
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
110
|
+
}
|
|
44
111
|
function ownKeys(e, r) {
|
|
45
112
|
var t = Object.keys(e);
|
|
46
113
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -363,6 +430,12 @@ function _regeneratorRuntime() {
|
|
|
363
430
|
}
|
|
364
431
|
}, e;
|
|
365
432
|
}
|
|
433
|
+
function _slicedToArray(r, e) {
|
|
434
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
435
|
+
}
|
|
436
|
+
function _toConsumableArray(r) {
|
|
437
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
438
|
+
}
|
|
366
439
|
function _toPrimitive(t, r) {
|
|
367
440
|
if ("object" != typeof t || !t) return t;
|
|
368
441
|
var e = t[Symbol.toPrimitive];
|
|
@@ -386,106 +459,13 @@ function _typeof(o) {
|
|
|
386
459
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
387
460
|
}, _typeof(o);
|
|
388
461
|
}
|
|
389
|
-
function
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
reject(error);
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
if (info.done) {
|
|
398
|
-
resolve(value);
|
|
399
|
-
} else {
|
|
400
|
-
Promise.resolve(value).then(_next, _throw);
|
|
462
|
+
function _unsupportedIterableToArray(r, a) {
|
|
463
|
+
if (r) {
|
|
464
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
465
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
466
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
401
467
|
}
|
|
402
468
|
}
|
|
403
|
-
function _asyncToGenerator(fn) {
|
|
404
|
-
return function () {
|
|
405
|
-
var self = this,
|
|
406
|
-
args = arguments;
|
|
407
|
-
return new Promise(function (resolve, reject) {
|
|
408
|
-
var gen = fn.apply(self, args);
|
|
409
|
-
function _next(value) {
|
|
410
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
411
|
-
}
|
|
412
|
-
function _throw(err) {
|
|
413
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
414
|
-
}
|
|
415
|
-
_next(undefined);
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
function _classCallCheck(instance, Constructor) {
|
|
420
|
-
if (!(instance instanceof Constructor)) {
|
|
421
|
-
throw new TypeError("Cannot call a class as a function");
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function _defineProperties(target, props) {
|
|
425
|
-
for (var i = 0; i < props.length; i++) {
|
|
426
|
-
var descriptor = props[i];
|
|
427
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
428
|
-
descriptor.configurable = true;
|
|
429
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
430
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
434
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
435
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
436
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
437
|
-
writable: false
|
|
438
|
-
});
|
|
439
|
-
return Constructor;
|
|
440
|
-
}
|
|
441
|
-
function _defineProperty(obj, key, value) {
|
|
442
|
-
key = _toPropertyKey(key);
|
|
443
|
-
if (key in obj) {
|
|
444
|
-
Object.defineProperty(obj, key, {
|
|
445
|
-
value: value,
|
|
446
|
-
enumerable: true,
|
|
447
|
-
configurable: true,
|
|
448
|
-
writable: true
|
|
449
|
-
});
|
|
450
|
-
} else {
|
|
451
|
-
obj[key] = value;
|
|
452
|
-
}
|
|
453
|
-
return obj;
|
|
454
|
-
}
|
|
455
|
-
function _slicedToArray(arr, i) {
|
|
456
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
457
|
-
}
|
|
458
|
-
function _toConsumableArray(arr) {
|
|
459
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
460
|
-
}
|
|
461
|
-
function _arrayWithoutHoles(arr) {
|
|
462
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
463
|
-
}
|
|
464
|
-
function _arrayWithHoles(arr) {
|
|
465
|
-
if (Array.isArray(arr)) return arr;
|
|
466
|
-
}
|
|
467
|
-
function _iterableToArray(iter) {
|
|
468
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
469
|
-
}
|
|
470
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
471
|
-
if (!o) return;
|
|
472
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
473
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
474
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
475
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
476
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
477
|
-
}
|
|
478
|
-
function _arrayLikeToArray(arr, len) {
|
|
479
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
480
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
481
|
-
return arr2;
|
|
482
|
-
}
|
|
483
|
-
function _nonIterableSpread() {
|
|
484
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
485
|
-
}
|
|
486
|
-
function _nonIterableRest() {
|
|
487
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
488
|
-
}
|
|
489
469
|
|
|
490
470
|
var en = {
|
|
491
471
|
generalDialog: {
|
|
@@ -44336,7 +44316,7 @@ var make_ssf = function make_ssf(SSF) {
|
|
|
44336
44316
|
function split_fmt(fmt) {
|
|
44337
44317
|
var out = [];
|
|
44338
44318
|
var in_str = false; /*, cc*/
|
|
44339
|
-
for (var i = 0, j = 0; i < fmt.length; ++i) switch (
|
|
44319
|
+
for (var i = 0, j = 0; i < fmt.length; ++i) switch (/*cc=*/fmt.charCodeAt(i)) {
|
|
44340
44320
|
case 34:
|
|
44341
44321
|
/* '"' */in_str = !in_str;
|
|
44342
44322
|
break;
|
|
@@ -52346,14 +52326,28 @@ function copy(ctx) {
|
|
|
52346
52326
|
for (var r = rows[0]; r <= rows[1]; r += 1) {
|
|
52347
52327
|
cpString += "<tr>";
|
|
52348
52328
|
for (var c = columns[0]; c <= columns[1]; c += 1) {
|
|
52349
|
-
var _flowdata$r, _ref, _data$m;
|
|
52329
|
+
var _flowdata$r, _ref, _data$m, _ref2, _data$v, _data$mc$rs, _data$mc, _data$mc$cs, _data$mc2, _data$bg, _data$fc, _data$ht;
|
|
52350
52330
|
var data = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r = flowdata[r]) === null || _flowdata$r === void 0 ? void 0 : _flowdata$r[c];
|
|
52351
52331
|
var value = (_ref = (_data$m = data === null || data === void 0 ? void 0 : data.m) !== null && _data$m !== void 0 ? _data$m : data === null || data === void 0 ? void 0 : data.v) !== null && _ref !== void 0 ? _ref : "";
|
|
52352
|
-
|
|
52332
|
+
var realValue = (_ref2 = (_data$v = data === null || data === void 0 ? void 0 : data.v) !== null && _data$v !== void 0 ? _data$v : data === null || data === void 0 ? void 0 : data.m) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
52333
|
+
var rowspan = (_data$mc$rs = data === null || data === void 0 ? void 0 : (_data$mc = data.mc) === null || _data$mc === void 0 ? void 0 : _data$mc.rs) !== null && _data$mc$rs !== void 0 ? _data$mc$rs : 1;
|
|
52334
|
+
var colspan = (_data$mc$cs = data === null || data === void 0 ? void 0 : (_data$mc2 = data.mc) === null || _data$mc2 === void 0 ? void 0 : _data$mc2.cs) !== null && _data$mc$cs !== void 0 ? _data$mc$cs : 1;
|
|
52335
|
+
var bg = (_data$bg = data === null || data === void 0 ? void 0 : data.bg) !== null && _data$bg !== void 0 ? _data$bg : "#fff";
|
|
52336
|
+
var fc = (_data$fc = data === null || data === void 0 ? void 0 : data.fc) !== null && _data$fc !== void 0 ? _data$fc : "#000";
|
|
52337
|
+
var ht = (_data$ht = data === null || data === void 0 ? void 0 : data.ht) !== null && _data$ht !== void 0 ? _data$ht : "1";
|
|
52338
|
+
var textAlign = {
|
|
52339
|
+
0: "center",
|
|
52340
|
+
1: "left",
|
|
52341
|
+
2: "right"
|
|
52342
|
+
}[String(ht)];
|
|
52343
|
+
if (!(data === null || data === void 0 ? void 0 : data.mc) || (data === null || data === void 0 ? void 0 : data.mc) && (data === null || data === void 0 ? void 0 : data.mc.r) === r && data.mc.c === c) {
|
|
52344
|
+
var style = "background: ".concat(bg, "; color: ").concat(fc, "; text-align: ").concat(textAlign, "; vertical-align: middle;");
|
|
52345
|
+
cpString += "<td x:num=".concat(realValue, " style='").concat(style, "' rowspan=").concat(rowspan, " colspan=").concat(colspan, "> ").concat(value, " </td>");
|
|
52346
|
+
}
|
|
52353
52347
|
}
|
|
52354
52348
|
cpString += "</tr>";
|
|
52355
52349
|
}
|
|
52356
|
-
var result = "<table data-type=\"leankylin-copy-action-table\">".concat(cpString, "</table>");
|
|
52350
|
+
var result = "<table border=\"1\" style=\"border-collapse:collapse\" data-type=\"leankylin-copy-action-table\">".concat(cpString, "</table>");
|
|
52357
52351
|
clipboard.writeHtml(result);
|
|
52358
52352
|
}
|
|
52359
52353
|
function copy2(ctx) {
|
|
@@ -64086,7 +64080,7 @@ function getFilterColumnColors(ctx, col, startRow, endRow) {
|
|
|
64086
64080
|
fc = fc.substr(0, 1) + fc.substr(1, 1).repeat(2) + fc.substr(2, 1).repeat(2) + fc.substr(3, 1).repeat(2);
|
|
64087
64081
|
}
|
|
64088
64082
|
}
|
|
64089
|
-
var isRowHidden =
|
|
64083
|
+
var isRowHidden = r in (((_ctx$config = ctx.config) === null || _ctx$config === void 0 ? void 0 : _ctx$config.rowhidden) || {});
|
|
64090
64084
|
var bgData = bgMap.get(bg);
|
|
64091
64085
|
if (bgData != null) {
|
|
64092
64086
|
bgData.rows.push(r);
|
|
@@ -69442,7 +69436,7 @@ function getClipboardContent() {
|
|
|
69442
69436
|
return _getClipboardContent.apply(this, arguments);
|
|
69443
69437
|
}
|
|
69444
69438
|
function _getClipboardContent() {
|
|
69445
|
-
_getClipboardContent = _asyncToGenerator(
|
|
69439
|
+
_getClipboardContent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
69446
69440
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
69447
69441
|
while (1) switch (_context.prev = _context.next) {
|
|
69448
69442
|
case 0:
|
|
@@ -69480,9 +69474,10 @@ function getClipboardData(e) {
|
|
|
69480
69474
|
var cells = row.querySelectorAll("td");
|
|
69481
69475
|
var rowData = [];
|
|
69482
69476
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
69483
|
-
var _cell$
|
|
69477
|
+
var _ref, _cell$getAttribute, _cell$textContent;
|
|
69484
69478
|
var cell = cells[cIndex];
|
|
69485
|
-
|
|
69479
|
+
var value = (_ref = (_cell$getAttribute = cell.getAttribute("x:num")) !== null && _cell$getAttribute !== void 0 ? _cell$getAttribute : cell === null || cell === void 0 ? void 0 : (_cell$textContent = cell.textContent) === null || _cell$textContent === void 0 ? void 0 : _cell$textContent.trim()) !== null && _ref !== void 0 ? _ref : "";
|
|
69480
|
+
rowData.push(value);
|
|
69486
69481
|
}
|
|
69487
69482
|
result.push(rowData);
|
|
69488
69483
|
}
|
|
@@ -69492,7 +69487,7 @@ function handlePasteByLeanklin(_x2, _x3) {
|
|
|
69492
69487
|
return _handlePasteByLeanklin.apply(this, arguments);
|
|
69493
69488
|
}
|
|
69494
69489
|
function _handlePasteByLeanklin() {
|
|
69495
|
-
_handlePasteByLeanklin = _asyncToGenerator(
|
|
69490
|
+
_handlePasteByLeanklin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ctx, e) {
|
|
69496
69491
|
var _ctx$luckysheet_selec8;
|
|
69497
69492
|
var data, allowEdit, selectRange, rows, columns, copyOne, newData, r, rIndex, c, row, column, range;
|
|
69498
69493
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
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.20",
|
|
14
14
|
"dayjs": "^1.11.0",
|
|
15
15
|
"immer": "^9.0.12",
|
|
16
16
|
"lodash": "^4.17.21",
|