@leankylin-sheet/core 5.2.2 → 5.2.3
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/api/sheet.d.ts +1 -0
- package/dist/index.esm.js +29 -0
- package/dist/index.js +29 -0
- package/package.json +2 -2
package/dist/api/sheet.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare function hideSheet(ctx: Context, sheetId: string): void;
|
|
|
9
9
|
export declare function showSheet(ctx: Context, sheetId: string): void;
|
|
10
10
|
export declare function copySheet(ctx: Context, sheetId: string, hooks: Hooks): void;
|
|
11
11
|
export declare function calculateSheetFromula(ctx: Context, id: string): void;
|
|
12
|
+
export declare function updateFunctionGroup(ctx: Context, id: string): void;
|
|
12
13
|
export declare function calculateSheetByCells(ctx: Context, cells: {
|
|
13
14
|
r: number;
|
|
14
15
|
c: number;
|
package/dist/index.esm.js
CHANGED
|
@@ -46611,6 +46611,34 @@ function calculateSheetFromula(ctx, id) {
|
|
|
46611
46611
|
ctx.luckysheetfile = luckysheetfile;
|
|
46612
46612
|
console.timeEnd("calcTime:".concat(id));
|
|
46613
46613
|
}
|
|
46614
|
+
function updateFunctionGroup(ctx, id) {
|
|
46615
|
+
var index = getSheetIndex(ctx, id);
|
|
46616
|
+
var luckysheetfile = ctx.luckysheetfile;
|
|
46617
|
+
var file = luckysheetfile[index];
|
|
46618
|
+
var calcChain = file.calcChain;
|
|
46619
|
+
if (_.isNil(calcChain)) {
|
|
46620
|
+
calcChain = [];
|
|
46621
|
+
}
|
|
46622
|
+
if (!ctx.luckysheetfile[index].data) return;
|
|
46623
|
+
for (var r = 0; r < ctx.luckysheetfile[index].data.length; r += 1) {
|
|
46624
|
+
for (var c = 0; c < ctx.luckysheetfile[index].data[r].length; c += 1) {
|
|
46625
|
+
var cell = ctx.luckysheetfile[index].data[r][c];
|
|
46626
|
+
if (!(cell === null || cell === void 0 ? void 0 : cell.f)) {
|
|
46627
|
+
continue;
|
|
46628
|
+
}
|
|
46629
|
+
var cc = {
|
|
46630
|
+
r: r,
|
|
46631
|
+
c: c,
|
|
46632
|
+
id: id
|
|
46633
|
+
};
|
|
46634
|
+
calcChain.push(cc);
|
|
46635
|
+
}
|
|
46636
|
+
}
|
|
46637
|
+
file.calcChain = uniqBy(calcChain, function (item) {
|
|
46638
|
+
return item.r + item.c + item.id;
|
|
46639
|
+
});
|
|
46640
|
+
ctx.luckysheetfile = luckysheetfile;
|
|
46641
|
+
}
|
|
46614
46642
|
function parseCellReferences(expression) {
|
|
46615
46643
|
if (typeof expression !== "string" || expression.trim() === "") {
|
|
46616
46644
|
return [];
|
|
@@ -56403,6 +56431,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
56403
56431
|
showSheet: showSheet,
|
|
56404
56432
|
copySheet: copySheet,
|
|
56405
56433
|
calculateSheetFromula: calculateSheetFromula,
|
|
56434
|
+
updateFunctionGroup: updateFunctionGroup,
|
|
56406
56435
|
calculateSheetByCells: calculateSheetByCells,
|
|
56407
56436
|
addSheet: addSheet$1,
|
|
56408
56437
|
deleteSheet: deleteSheet$1,
|
package/dist/index.js
CHANGED
|
@@ -46621,6 +46621,34 @@ function calculateSheetFromula(ctx, id) {
|
|
|
46621
46621
|
ctx.luckysheetfile = luckysheetfile;
|
|
46622
46622
|
console.timeEnd("calcTime:".concat(id));
|
|
46623
46623
|
}
|
|
46624
|
+
function updateFunctionGroup(ctx, id) {
|
|
46625
|
+
var index = getSheetIndex(ctx, id);
|
|
46626
|
+
var luckysheetfile = ctx.luckysheetfile;
|
|
46627
|
+
var file = luckysheetfile[index];
|
|
46628
|
+
var calcChain = file.calcChain;
|
|
46629
|
+
if (___default['default'].isNil(calcChain)) {
|
|
46630
|
+
calcChain = [];
|
|
46631
|
+
}
|
|
46632
|
+
if (!ctx.luckysheetfile[index].data) return;
|
|
46633
|
+
for (var r = 0; r < ctx.luckysheetfile[index].data.length; r += 1) {
|
|
46634
|
+
for (var c = 0; c < ctx.luckysheetfile[index].data[r].length; c += 1) {
|
|
46635
|
+
var cell = ctx.luckysheetfile[index].data[r][c];
|
|
46636
|
+
if (!(cell === null || cell === void 0 ? void 0 : cell.f)) {
|
|
46637
|
+
continue;
|
|
46638
|
+
}
|
|
46639
|
+
var cc = {
|
|
46640
|
+
r: r,
|
|
46641
|
+
c: c,
|
|
46642
|
+
id: id
|
|
46643
|
+
};
|
|
46644
|
+
calcChain.push(cc);
|
|
46645
|
+
}
|
|
46646
|
+
}
|
|
46647
|
+
file.calcChain = _.uniqBy(calcChain, function (item) {
|
|
46648
|
+
return item.r + item.c + item.id;
|
|
46649
|
+
});
|
|
46650
|
+
ctx.luckysheetfile = luckysheetfile;
|
|
46651
|
+
}
|
|
46624
46652
|
function parseCellReferences(expression) {
|
|
46625
46653
|
if (typeof expression !== "string" || expression.trim() === "") {
|
|
46626
46654
|
return [];
|
|
@@ -56413,6 +56441,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
56413
56441
|
showSheet: showSheet,
|
|
56414
56442
|
copySheet: copySheet,
|
|
56415
56443
|
calculateSheetFromula: calculateSheetFromula,
|
|
56444
|
+
updateFunctionGroup: updateFunctionGroup,
|
|
56416
56445
|
calculateSheetByCells: calculateSheetByCells,
|
|
56417
56446
|
addSheet: addSheet$1,
|
|
56418
56447
|
deleteSheet: deleteSheet$1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
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": "5.2.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "5.2.3",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|