@leankylin-sheet/core 1.2.16 → 1.2.18
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 +18 -6
- package/dist/index.js +18 -6
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -44926,8 +44926,9 @@ var make_ssf = function make_ssf(SSF) {
|
|
|
44926
44926
|
return [l, ff];
|
|
44927
44927
|
}
|
|
44928
44928
|
function format(fmt, v, o) {
|
|
44929
|
-
if (fmt === 'leanky_n') {
|
|
44930
|
-
|
|
44929
|
+
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_n')) {
|
|
44930
|
+
var precision = fmt.replace('leanky_n', '');
|
|
44931
|
+
return numberThousands(v, ',', precision);
|
|
44931
44932
|
}
|
|
44932
44933
|
if (o == null) o = {};
|
|
44933
44934
|
var sfmt = "";
|
|
@@ -45104,18 +45105,23 @@ var intThousands = function intThousands(number) {
|
|
|
45104
45105
|
};
|
|
45105
45106
|
var numberThousands = function numberThousands(number) {
|
|
45106
45107
|
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
45108
|
+
var precision = arguments.length > 2 ? arguments[2] : undefined;
|
|
45107
45109
|
if (number === 0) return '0';
|
|
45108
45110
|
if (!number) return number;
|
|
45109
|
-
|
|
45110
|
-
|
|
45111
|
+
var _number = !['', undefined].includes(precision) ? formatNumber(number, precision) : number;
|
|
45112
|
+
if (String(_number).includes('.')) {
|
|
45113
|
+
var _String$split = String(_number).split('.'),
|
|
45111
45114
|
_String$split2 = _slicedToArray(_String$split, 2),
|
|
45112
45115
|
init = _String$split2[0],
|
|
45113
45116
|
decimal = _String$split2[1];
|
|
45114
45117
|
return intThousands(init, groupSeparator) + '.' + decimal;
|
|
45115
45118
|
} else {
|
|
45116
|
-
return intThousands(
|
|
45119
|
+
return intThousands(_number, groupSeparator);
|
|
45117
45120
|
}
|
|
45118
45121
|
};
|
|
45122
|
+
function formatNumber(num, precision) {
|
|
45123
|
+
return parseFloat(Number(num).toFixed(precision));
|
|
45124
|
+
}
|
|
45119
45125
|
|
|
45120
45126
|
var base1904 = new Date(1900, 2, 1, 0, 0, 0);
|
|
45121
45127
|
function datenum_local(v, date1904) {
|
|
@@ -69516,9 +69522,15 @@ function _handlePasteByLeanklin() {
|
|
|
69516
69522
|
row: row,
|
|
69517
69523
|
column: column
|
|
69518
69524
|
};
|
|
69525
|
+
if (isAllowEdit(ctx, [range])) {
|
|
69526
|
+
_context2.next = 17;
|
|
69527
|
+
break;
|
|
69528
|
+
}
|
|
69529
|
+
return _context2.abrupt("return");
|
|
69530
|
+
case 17:
|
|
69519
69531
|
setCellValuesByRange(ctx, newData, range, null);
|
|
69520
69532
|
ctx.luckysheet_select_save = [range];
|
|
69521
|
-
case
|
|
69533
|
+
case 19:
|
|
69522
69534
|
case "end":
|
|
69523
69535
|
return _context2.stop();
|
|
69524
69536
|
}
|
package/dist/index.js
CHANGED
|
@@ -44936,8 +44936,9 @@ var make_ssf = function make_ssf(SSF) {
|
|
|
44936
44936
|
return [l, ff];
|
|
44937
44937
|
}
|
|
44938
44938
|
function format(fmt, v, o) {
|
|
44939
|
-
if (fmt === 'leanky_n') {
|
|
44940
|
-
|
|
44939
|
+
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_n')) {
|
|
44940
|
+
var precision = fmt.replace('leanky_n', '');
|
|
44941
|
+
return numberThousands(v, ',', precision);
|
|
44941
44942
|
}
|
|
44942
44943
|
if (o == null) o = {};
|
|
44943
44944
|
var sfmt = "";
|
|
@@ -45114,18 +45115,23 @@ var intThousands = function intThousands(number) {
|
|
|
45114
45115
|
};
|
|
45115
45116
|
var numberThousands = function numberThousands(number) {
|
|
45116
45117
|
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
45118
|
+
var precision = arguments.length > 2 ? arguments[2] : undefined;
|
|
45117
45119
|
if (number === 0) return '0';
|
|
45118
45120
|
if (!number) return number;
|
|
45119
|
-
|
|
45120
|
-
|
|
45121
|
+
var _number = !['', undefined].includes(precision) ? formatNumber(number, precision) : number;
|
|
45122
|
+
if (String(_number).includes('.')) {
|
|
45123
|
+
var _String$split = String(_number).split('.'),
|
|
45121
45124
|
_String$split2 = _slicedToArray(_String$split, 2),
|
|
45122
45125
|
init = _String$split2[0],
|
|
45123
45126
|
decimal = _String$split2[1];
|
|
45124
45127
|
return intThousands(init, groupSeparator) + '.' + decimal;
|
|
45125
45128
|
} else {
|
|
45126
|
-
return intThousands(
|
|
45129
|
+
return intThousands(_number, groupSeparator);
|
|
45127
45130
|
}
|
|
45128
45131
|
};
|
|
45132
|
+
function formatNumber(num, precision) {
|
|
45133
|
+
return parseFloat(Number(num).toFixed(precision));
|
|
45134
|
+
}
|
|
45129
45135
|
|
|
45130
45136
|
var base1904 = new Date(1900, 2, 1, 0, 0, 0);
|
|
45131
45137
|
function datenum_local(v, date1904) {
|
|
@@ -69526,9 +69532,15 @@ function _handlePasteByLeanklin() {
|
|
|
69526
69532
|
row: row,
|
|
69527
69533
|
column: column
|
|
69528
69534
|
};
|
|
69535
|
+
if (isAllowEdit(ctx, [range])) {
|
|
69536
|
+
_context2.next = 17;
|
|
69537
|
+
break;
|
|
69538
|
+
}
|
|
69539
|
+
return _context2.abrupt("return");
|
|
69540
|
+
case 17:
|
|
69529
69541
|
setCellValuesByRange(ctx, newData, range, null);
|
|
69530
69542
|
ctx.luckysheet_select_save = [range];
|
|
69531
|
-
case
|
|
69543
|
+
case 19:
|
|
69532
69544
|
case "end":
|
|
69533
69545
|
return _context2.stop();
|
|
69534
69546
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
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.18",
|
|
14
14
|
"dayjs": "^1.11.0",
|
|
15
15
|
"immer": "^9.0.12",
|
|
16
16
|
"lodash": "^4.17.21",
|