@leankylin-sheet/core 7.0.31 → 7.0.33
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/common.d.ts +1 -0
- package/dist/context.d.ts +1 -0
- package/dist/index.esm.js +175 -146
- package/dist/index.js +175 -146
- package/dist/modules/formula.d.ts +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/api/common.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare function getSheetWithLatestCelldata(ctx: Context, options?: Commo
|
|
|
31
31
|
defaultRowHeight?: number | undefined;
|
|
32
32
|
defaultColWidth?: number | undefined;
|
|
33
33
|
showGridLines?: number | boolean | undefined;
|
|
34
|
+
showHeaders?: number | boolean | undefined;
|
|
34
35
|
pivotTable?: any;
|
|
35
36
|
isPivotTable?: boolean | undefined;
|
|
36
37
|
filter?: Record<string, any> | undefined;
|
package/dist/context.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -37586,7 +37586,7 @@ function execfunction(ctx, txt, r, c, id, isrefresh, notInsertFunc) {
|
|
|
37586
37586
|
f: txt
|
|
37587
37587
|
};else data[r][c].f = txt;
|
|
37588
37588
|
}
|
|
37589
|
-
execFunctionGroup(ctx, r, c, _.isNil(formulaError) ? result : formulaError, id, false, notInsertFunc);
|
|
37589
|
+
execFunctionGroup(ctx, r, c, _.isNil(formulaError) ? result : formulaError, id, false, notInsertFunc, undefined, txt);
|
|
37590
37590
|
if (!hadFormulaField && data && data[r] && data[r][c]) {
|
|
37591
37591
|
delete data[r][c].f;
|
|
37592
37592
|
}
|
|
@@ -37648,10 +37648,10 @@ function groupValuesRefresh(ctx) {
|
|
|
37648
37648
|
ctx.groupValuesRefreshData = [];
|
|
37649
37649
|
}
|
|
37650
37650
|
}
|
|
37651
|
-
function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
37652
|
-
var isForce = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
37653
|
-
var notInsertFunc = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
37651
|
+
function execFunctionGroup(ctx, origin_r, origin_c, value, id, data, isForce, notInsertFunc, originFormula) {
|
|
37654
37652
|
console.time('execFunctionGroup-before');
|
|
37653
|
+
isForce = !_.isNil(isForce) ? isForce : false;
|
|
37654
|
+
notInsertFunc = !_.isNil(notInsertFunc) ? notInsertFunc : true;
|
|
37655
37655
|
if (_.isNil(data)) {
|
|
37656
37656
|
data = getFlowdata(ctx);
|
|
37657
37657
|
}
|
|
@@ -37729,106 +37729,118 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37729
37729
|
console.timeEnd('arrayMatchCache');
|
|
37730
37730
|
console.time('cache1');
|
|
37731
37731
|
var _loop = function _loop() {
|
|
37732
|
-
|
|
37733
|
-
|
|
37734
|
-
|
|
37735
|
-
|
|
37736
|
-
|
|
37737
|
-
|
|
37738
|
-
|
|
37739
|
-
|
|
37740
|
-
|
|
37741
|
-
|
|
37742
|
-
|
|
37743
|
-
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
}
|
|
37748
|
-
|
|
37749
|
-
var
|
|
37750
|
-
var
|
|
37751
|
-
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37732
|
+
var formulaCell = calcChains[_i12];
|
|
37733
|
+
var fR = formulaCell.r;
|
|
37734
|
+
var fC = formulaCell.c;
|
|
37735
|
+
var fId = formulaCell.id;
|
|
37736
|
+
var key = "r".concat(fR, "c").concat(fC, "i").concat(fId);
|
|
37737
|
+
var calc_funcStr = getcellFormula(ctx, fR, fC, fId);
|
|
37738
|
+
var isOriginCell = !_.isNil(origin_r) && !_.isNil(origin_c) && fR === origin_r && fC === origin_c && fId === id;
|
|
37739
|
+
if (isOriginCell && !_.isNil(originFormula)) {
|
|
37740
|
+
if (originFormula === "") {
|
|
37741
|
+
return 0; // continue
|
|
37742
|
+
}
|
|
37743
|
+
calc_funcStr = originFormula;
|
|
37744
|
+
}
|
|
37745
|
+
if (_.isNil(calc_funcStr)) {
|
|
37746
|
+
return 0; // continue
|
|
37747
|
+
}
|
|
37748
|
+
var txt1 = calc_funcStr.toUpperCase();
|
|
37749
|
+
var isOffsetFunc = txt1.indexOf("INDIRECT(") > -1 || txt1.indexOf("OFFSET(") > -1 || txt1.indexOf("INDEX(") > -1;
|
|
37750
|
+
var formulaArray = [];
|
|
37751
|
+
if (isOffsetFunc) {
|
|
37752
|
+
isFunctionRange(ctx, calc_funcStr, null, null, fId, null, function (str_nb) {
|
|
37753
|
+
var range = getcellrange(ctx, _.trim(str_nb), fId);
|
|
37754
|
+
if (!_.isNil(range)) {
|
|
37755
|
+
formulaArray.push(range);
|
|
37756
|
+
}
|
|
37757
|
+
});
|
|
37758
|
+
} else if (!(calc_funcStr.substring(0, 2) === '="' && calc_funcStr.substring(calc_funcStr.length - 1, 1) === '"')) {
|
|
37759
|
+
var point = 0;
|
|
37760
|
+
var squote = -1;
|
|
37761
|
+
var dquote = -1;
|
|
37762
|
+
var formulaTextArray = [];
|
|
37763
|
+
var sq_end_array = [];
|
|
37764
|
+
var calc_funcStr_length = calc_funcStr.length;
|
|
37765
|
+
for (var j = 0; j < calc_funcStr_length; j += 1) {
|
|
37766
|
+
var char = calc_funcStr.charAt(j);
|
|
37767
|
+
if (char === "'" && dquote === -1) {
|
|
37768
|
+
if (squote === -1) {
|
|
37769
|
+
if (point !== j) {
|
|
37770
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, j).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37771
|
+
}
|
|
37772
|
+
squote = j;
|
|
37773
|
+
point = j;
|
|
37767
37774
|
} else {
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37775
|
+
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === "'") {
|
|
37776
|
+
j += 1;
|
|
37777
|
+
} else {
|
|
37778
|
+
point = j + 1;
|
|
37779
|
+
formulaTextArray.push(calc_funcStr.substring(squote, point));
|
|
37780
|
+
sq_end_array.push(formulaTextArray.length - 1);
|
|
37781
|
+
squote = -1;
|
|
37782
|
+
}
|
|
37772
37783
|
}
|
|
37773
37784
|
}
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
point = j;
|
|
37782
|
-
} else {
|
|
37783
|
-
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === '"') {
|
|
37784
|
-
j += 1;
|
|
37785
|
+
if (char === '"' && squote === -1) {
|
|
37786
|
+
if (dquote === -1) {
|
|
37787
|
+
if (point !== j) {
|
|
37788
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, j).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37789
|
+
}
|
|
37790
|
+
dquote = j;
|
|
37791
|
+
point = j;
|
|
37785
37792
|
} else {
|
|
37786
|
-
|
|
37787
|
-
|
|
37788
|
-
|
|
37793
|
+
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === '"') {
|
|
37794
|
+
j += 1;
|
|
37795
|
+
} else {
|
|
37796
|
+
point = j + 1;
|
|
37797
|
+
formulaTextArray.push(calc_funcStr.substring(dquote, point));
|
|
37798
|
+
dquote = -1;
|
|
37799
|
+
}
|
|
37789
37800
|
}
|
|
37790
37801
|
}
|
|
37791
37802
|
}
|
|
37792
|
-
|
|
37793
|
-
|
|
37794
|
-
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, calc_funcStr_length).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37795
|
-
}
|
|
37796
|
-
for (var _j = sq_end_array.length - 1; _j >= 0; _j -= 1) {
|
|
37797
|
-
if (sq_end_array[_j] !== formulaTextArray.length - 1) {
|
|
37798
|
-
formulaTextArray[sq_end_array[_j]] += formulaTextArray[sq_end_array[_j] + 1];
|
|
37799
|
-
formulaTextArray.splice(sq_end_array[_j] + 1, 1);
|
|
37800
|
-
}
|
|
37801
|
-
}
|
|
37802
|
-
for (var _j2 = 0; _j2 < formulaTextArray.length; _j2 += 1) {
|
|
37803
|
-
var t = _.trim(formulaTextArray[_j2]);
|
|
37804
|
-
if (t.length <= 1) {
|
|
37805
|
-
continue;
|
|
37803
|
+
if (point !== calc_funcStr_length) {
|
|
37804
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, calc_funcStr_length).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37806
37805
|
}
|
|
37807
|
-
|
|
37808
|
-
|
|
37806
|
+
for (var _j = sq_end_array.length - 1; _j >= 0; _j -= 1) {
|
|
37807
|
+
if (sq_end_array[_j] !== formulaTextArray.length - 1) {
|
|
37808
|
+
formulaTextArray[sq_end_array[_j]] += formulaTextArray[sq_end_array[_j] + 1];
|
|
37809
|
+
formulaTextArray.splice(sq_end_array[_j] + 1, 1);
|
|
37810
|
+
}
|
|
37809
37811
|
}
|
|
37810
|
-
var
|
|
37811
|
-
|
|
37812
|
-
|
|
37812
|
+
for (var _j2 = 0; _j2 < formulaTextArray.length; _j2 += 1) {
|
|
37813
|
+
var t = _.trim(formulaTextArray[_j2]);
|
|
37814
|
+
if (t.length <= 1) {
|
|
37815
|
+
continue;
|
|
37816
|
+
}
|
|
37817
|
+
if (t.substring(0, 1) === '"' && t.substring(t.length - 1, 1) === '"' || !iscelldata(t)) {
|
|
37818
|
+
continue;
|
|
37819
|
+
}
|
|
37820
|
+
var range = getcellrange(ctx, t, fId);
|
|
37821
|
+
if (_.isNil(range)) {
|
|
37822
|
+
continue;
|
|
37823
|
+
}
|
|
37824
|
+
formulaArray.push(range);
|
|
37813
37825
|
}
|
|
37814
|
-
formulaArray.push(range);
|
|
37815
37826
|
}
|
|
37816
|
-
|
|
37817
|
-
|
|
37818
|
-
|
|
37819
|
-
|
|
37820
|
-
|
|
37821
|
-
|
|
37822
|
-
|
|
37823
|
-
|
|
37824
|
-
|
|
37825
|
-
|
|
37826
|
-
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37827
|
+
var item = {
|
|
37828
|
+
formulaArray: formulaArray,
|
|
37829
|
+
calc_funcStr: calc_funcStr,
|
|
37830
|
+
key: key,
|
|
37831
|
+
r: fR,
|
|
37832
|
+
c: fC,
|
|
37833
|
+
id: fId,
|
|
37834
|
+
parents: {},
|
|
37835
|
+
chidren: {},
|
|
37836
|
+
color: "w"
|
|
37837
|
+
};
|
|
37838
|
+
formulaObjects[key] = item;
|
|
37839
|
+
},
|
|
37840
|
+
_ret;
|
|
37830
37841
|
for (var _i12 = 0; _i12 < calcChains.length; _i12 += 1) {
|
|
37831
|
-
|
|
37842
|
+
_ret = _loop();
|
|
37843
|
+
if (_ret === 0) continue;
|
|
37832
37844
|
}
|
|
37833
37845
|
console.timeEnd('cache1');
|
|
37834
37846
|
console.time('cache2');
|
|
@@ -37853,66 +37865,36 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37853
37865
|
var visited = {};
|
|
37854
37866
|
var inStack = {};
|
|
37855
37867
|
var circularNodes = {};
|
|
37868
|
+
var dfsPath = [];
|
|
37856
37869
|
function detectCycle(nodeKey) {
|
|
37857
37870
|
inStack[nodeKey] = true;
|
|
37858
37871
|
visited[nodeKey] = true;
|
|
37872
|
+
dfsPath.push(nodeKey);
|
|
37859
37873
|
var node = formulaObjects[nodeKey];
|
|
37860
|
-
if (
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
if (
|
|
37867
|
-
|
|
37874
|
+
if (node) {
|
|
37875
|
+
var children = Object.keys(node.chidren);
|
|
37876
|
+
for (var _i13 = 0; _i13 < children.length; _i13 += 1) {
|
|
37877
|
+
var childKey = children[_i13];
|
|
37878
|
+
if (inStack[childKey]) {
|
|
37879
|
+
var cycleStart = dfsPath.indexOf(childKey);
|
|
37880
|
+
if (cycleStart > -1) {
|
|
37881
|
+
for (var k = cycleStart; k < dfsPath.length; k += 1) {
|
|
37882
|
+
circularNodes[dfsPath[k]] = true;
|
|
37883
|
+
}
|
|
37868
37884
|
}
|
|
37869
|
-
})
|
|
37870
|
-
|
|
37871
|
-
|
|
37872
|
-
if (!visited[childKey] && detectCycle(childKey)) {
|
|
37873
|
-
return true;
|
|
37885
|
+
} else if (!visited[childKey]) {
|
|
37886
|
+
detectCycle(childKey);
|
|
37887
|
+
}
|
|
37874
37888
|
}
|
|
37875
37889
|
}
|
|
37890
|
+
dfsPath.pop();
|
|
37876
37891
|
inStack[nodeKey] = false;
|
|
37877
|
-
return false;
|
|
37878
37892
|
}
|
|
37879
|
-
Object.keys(formulaObjects).
|
|
37893
|
+
Object.keys(formulaObjects).forEach(function (key) {
|
|
37880
37894
|
if (!visited[key]) {
|
|
37881
37895
|
detectCycle(key);
|
|
37882
37896
|
}
|
|
37883
|
-
return true;
|
|
37884
37897
|
});
|
|
37885
|
-
if (Object.keys(circularNodes).length > 0) {
|
|
37886
|
-
ctx.circularReference = Object.keys(circularNodes).map(function (key) {
|
|
37887
|
-
var _ctx$luckysheetfile$s;
|
|
37888
|
-
var fObj = formulaObjects[key];
|
|
37889
|
-
var sheetIndex = getSheetIndex(ctx, fObj.id);
|
|
37890
|
-
var sheetName = sheetIndex != null ? ((_ctx$luckysheetfile$s = ctx.luckysheetfile[sheetIndex]) === null || _ctx$luckysheetfile$s === void 0 ? void 0 : _ctx$luckysheetfile$s.name) || '' : '';
|
|
37891
|
-
var cellPosition = indexToColumnChar(fObj.c) + (fObj.r + 1);
|
|
37892
|
-
return {
|
|
37893
|
-
sheetName: sheetName,
|
|
37894
|
-
cellPosition: cellPosition,
|
|
37895
|
-
formulaContent: fObj.calc_funcStr,
|
|
37896
|
-
r: fObj.r,
|
|
37897
|
-
c: fObj.c,
|
|
37898
|
-
sheetId: fObj.id
|
|
37899
|
-
};
|
|
37900
|
-
});
|
|
37901
|
-
Object.keys(circularNodes).forEach(function (key) {
|
|
37902
|
-
var fObj = formulaObjects[key];
|
|
37903
|
-
if (fObj) {
|
|
37904
|
-
ctx.groupValuesRefreshData.push({
|
|
37905
|
-
r: fObj.r,
|
|
37906
|
-
c: fObj.c,
|
|
37907
|
-
v: error.r,
|
|
37908
|
-
f: fObj.calc_funcStr,
|
|
37909
|
-
id: fObj.id
|
|
37910
|
-
});
|
|
37911
|
-
fObj.level = Math.max;
|
|
37912
|
-
}
|
|
37913
|
-
});
|
|
37914
|
-
}
|
|
37915
|
-
console.timeEnd('dev');
|
|
37916
37898
|
var formulaRunList = [];
|
|
37917
37899
|
var stack = updateValueArray;
|
|
37918
37900
|
var existsFormulaRunList = {};
|
|
@@ -37942,12 +37924,56 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37942
37924
|
stack = stack.concat(cacheStack);
|
|
37943
37925
|
}
|
|
37944
37926
|
},
|
|
37945
|
-
|
|
37927
|
+
_ret2;
|
|
37946
37928
|
while (stack.length > 0) {
|
|
37947
|
-
|
|
37948
|
-
if (
|
|
37929
|
+
_ret2 = _loop2();
|
|
37930
|
+
if (_ret2 === 0) continue;
|
|
37949
37931
|
}
|
|
37950
37932
|
formulaRunList.reverse();
|
|
37933
|
+
var formulaRunListKeys = {};
|
|
37934
|
+
formulaRunList.forEach(function (item) {
|
|
37935
|
+
formulaRunListKeys[item.key] = true;
|
|
37936
|
+
});
|
|
37937
|
+
var circularKeys = Object.keys(circularNodes);
|
|
37938
|
+
var relevantCircularKeys = circularKeys.filter(function (key) {
|
|
37939
|
+
return formulaRunListKeys[key];
|
|
37940
|
+
});
|
|
37941
|
+
if (relevantCircularKeys.length > 0) {
|
|
37942
|
+
ctx.circularReference = relevantCircularKeys.map(function (key) {
|
|
37943
|
+
var _ctx$luckysheetfile$s;
|
|
37944
|
+
var fObj = formulaObjects[key];
|
|
37945
|
+
var sheetIndex = getSheetIndex(ctx, fObj.id);
|
|
37946
|
+
var sheetName = sheetIndex != null ? ((_ctx$luckysheetfile$s = ctx.luckysheetfile[sheetIndex]) === null || _ctx$luckysheetfile$s === void 0 ? void 0 : _ctx$luckysheetfile$s.name) || '' : '';
|
|
37947
|
+
var cellPosition = indexToColumnChar(fObj.c) + (fObj.r + 1);
|
|
37948
|
+
return {
|
|
37949
|
+
sheetName: sheetName,
|
|
37950
|
+
cellPosition: cellPosition,
|
|
37951
|
+
formulaContent: fObj.calc_funcStr,
|
|
37952
|
+
r: fObj.r,
|
|
37953
|
+
c: fObj.c,
|
|
37954
|
+
sheetId: fObj.id
|
|
37955
|
+
};
|
|
37956
|
+
});
|
|
37957
|
+
}
|
|
37958
|
+
if (relevantCircularKeys.length > 0) {
|
|
37959
|
+
var isEditingCell = !_.isNil(origin_r) && !_.isNil(origin_c);
|
|
37960
|
+
relevantCircularKeys.forEach(function (key) {
|
|
37961
|
+
var fObj = formulaObjects[key];
|
|
37962
|
+
if (!fObj) return;
|
|
37963
|
+
fObj.level = Math.max;
|
|
37964
|
+
if (isEditingCell && fObj.r === origin_r && fObj.c === origin_c && fObj.id === id) {
|
|
37965
|
+
return;
|
|
37966
|
+
}
|
|
37967
|
+
ctx.groupValuesRefreshData.push({
|
|
37968
|
+
r: fObj.r,
|
|
37969
|
+
c: fObj.c,
|
|
37970
|
+
v: error.r,
|
|
37971
|
+
f: fObj.calc_funcStr,
|
|
37972
|
+
id: fObj.id
|
|
37973
|
+
});
|
|
37974
|
+
});
|
|
37975
|
+
}
|
|
37976
|
+
console.timeEnd('dev');
|
|
37951
37977
|
console.timeEnd('execFunctionGroup-before');
|
|
37952
37978
|
var lastDataRowSheets = Object.create(null);
|
|
37953
37979
|
for (var _i14 = 0; _i14 < formulaRunList.length; _i14++) {
|
|
@@ -42060,7 +42086,7 @@ function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
|
42060
42086
|
} else {
|
|
42061
42087
|
var _d$r3;
|
|
42062
42088
|
delFunctionGroup(ctx, r, c);
|
|
42063
|
-
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false);
|
|
42089
|
+
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false, "");
|
|
42064
42090
|
curv = _.cloneDeep((d === null || d === void 0 ? void 0 : (_d$r3 = d[r]) === null || _d$r3 === void 0 ? void 0 : _d$r3[c]) || {});
|
|
42065
42091
|
curv.v = value;
|
|
42066
42092
|
delete curv.f;
|
|
@@ -42119,7 +42145,7 @@ function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
|
42119
42145
|
}
|
|
42120
42146
|
} else {
|
|
42121
42147
|
delFunctionGroup(ctx, r, c);
|
|
42122
|
-
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false);
|
|
42148
|
+
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false, "");
|
|
42123
42149
|
}
|
|
42124
42150
|
}
|
|
42125
42151
|
setCellValue(ctx, r, c, d, value);
|
|
@@ -52566,6 +52592,7 @@ var Canvas = /*#__PURE__*/function () {
|
|
|
52566
52592
|
return _createClass(Canvas, [{
|
|
52567
52593
|
key: "drawRowHeader",
|
|
52568
52594
|
value: function drawRowHeader(scrollHeight, drawHeight, offsetTop) {
|
|
52595
|
+
if (!this.sheetCtx.showHeaders) return;
|
|
52569
52596
|
if (_.isNil(drawHeight)) {
|
|
52570
52597
|
var _this$sheetCtx$luckys = _slicedToArray(this.sheetCtx.luckysheetTableContentHW, 2);
|
|
52571
52598
|
drawHeight = _this$sheetCtx$luckys[1];
|
|
@@ -52660,6 +52687,7 @@ var Canvas = /*#__PURE__*/function () {
|
|
|
52660
52687
|
}, {
|
|
52661
52688
|
key: "drawColumnHeader",
|
|
52662
52689
|
value: function drawColumnHeader(scrollWidth, drawWidth, offsetLeft) {
|
|
52690
|
+
if (!this.sheetCtx.showHeaders) return;
|
|
52663
52691
|
if (drawWidth === undefined) {
|
|
52664
52692
|
var _this$sheetCtx$luckys2 = _slicedToArray(this.sheetCtx.luckysheetTableContentHW, 1);
|
|
52665
52693
|
drawWidth = _this$sheetCtx$luckys2[0];
|
|
@@ -55890,6 +55918,7 @@ function defaultContext(refs) {
|
|
|
55890
55918
|
chart_selection: {},
|
|
55891
55919
|
zoomRatio: 1,
|
|
55892
55920
|
showGridLines: true,
|
|
55921
|
+
showHeaders: true,
|
|
55893
55922
|
allowEdit: true,
|
|
55894
55923
|
showAddSheetButton: true,
|
|
55895
55924
|
onAddSheetClick: undefined,
|
|
@@ -56741,7 +56770,7 @@ function setCellValue$1(ctx, row, column, value, cellInput) {
|
|
|
56741
56770
|
var formatList = FORMAT_LIST;
|
|
56742
56771
|
if (value == null || value.toString().length === 0) {
|
|
56743
56772
|
delFunctionGroup(ctx, row, column);
|
|
56744
|
-
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false);
|
|
56773
|
+
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false, "");
|
|
56745
56774
|
setCellValue(ctx, row, column, data, value);
|
|
56746
56775
|
} else if (value instanceof Object) {
|
|
56747
56776
|
var _data$row;
|
|
@@ -56812,7 +56841,7 @@ function setCellValue$1(ctx, row, column, value, cellInput) {
|
|
|
56812
56841
|
updateCell(ctx, row, column, cellInput, value);
|
|
56813
56842
|
} else {
|
|
56814
56843
|
delFunctionGroup(ctx, row, column);
|
|
56815
|
-
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false);
|
|
56844
|
+
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false, "");
|
|
56816
56845
|
setCellValue(ctx, row, column, data, value);
|
|
56817
56846
|
}
|
|
56818
56847
|
}
|
package/dist/index.js
CHANGED
|
@@ -37596,7 +37596,7 @@ function execfunction(ctx, txt, r, c, id, isrefresh, notInsertFunc) {
|
|
|
37596
37596
|
f: txt
|
|
37597
37597
|
};else data[r][c].f = txt;
|
|
37598
37598
|
}
|
|
37599
|
-
execFunctionGroup(ctx, r, c, ___default['default'].isNil(formulaError) ? result : formulaError, id, false, notInsertFunc);
|
|
37599
|
+
execFunctionGroup(ctx, r, c, ___default['default'].isNil(formulaError) ? result : formulaError, id, false, notInsertFunc, undefined, txt);
|
|
37600
37600
|
if (!hadFormulaField && data && data[r] && data[r][c]) {
|
|
37601
37601
|
delete data[r][c].f;
|
|
37602
37602
|
}
|
|
@@ -37658,10 +37658,10 @@ function groupValuesRefresh(ctx) {
|
|
|
37658
37658
|
ctx.groupValuesRefreshData = [];
|
|
37659
37659
|
}
|
|
37660
37660
|
}
|
|
37661
|
-
function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
37662
|
-
var isForce = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
37663
|
-
var notInsertFunc = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
37661
|
+
function execFunctionGroup(ctx, origin_r, origin_c, value, id, data, isForce, notInsertFunc, originFormula) {
|
|
37664
37662
|
console.time('execFunctionGroup-before');
|
|
37663
|
+
isForce = !___default['default'].isNil(isForce) ? isForce : false;
|
|
37664
|
+
notInsertFunc = !___default['default'].isNil(notInsertFunc) ? notInsertFunc : true;
|
|
37665
37665
|
if (___default['default'].isNil(data)) {
|
|
37666
37666
|
data = getFlowdata(ctx);
|
|
37667
37667
|
}
|
|
@@ -37739,106 +37739,118 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37739
37739
|
console.timeEnd('arrayMatchCache');
|
|
37740
37740
|
console.time('cache1');
|
|
37741
37741
|
var _loop = function _loop() {
|
|
37742
|
-
|
|
37743
|
-
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
|
|
37750
|
-
|
|
37751
|
-
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
}
|
|
37758
|
-
|
|
37759
|
-
var
|
|
37760
|
-
var
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37742
|
+
var formulaCell = calcChains[_i12];
|
|
37743
|
+
var fR = formulaCell.r;
|
|
37744
|
+
var fC = formulaCell.c;
|
|
37745
|
+
var fId = formulaCell.id;
|
|
37746
|
+
var key = "r".concat(fR, "c").concat(fC, "i").concat(fId);
|
|
37747
|
+
var calc_funcStr = getcellFormula(ctx, fR, fC, fId);
|
|
37748
|
+
var isOriginCell = !___default['default'].isNil(origin_r) && !___default['default'].isNil(origin_c) && fR === origin_r && fC === origin_c && fId === id;
|
|
37749
|
+
if (isOriginCell && !___default['default'].isNil(originFormula)) {
|
|
37750
|
+
if (originFormula === "") {
|
|
37751
|
+
return 0; // continue
|
|
37752
|
+
}
|
|
37753
|
+
calc_funcStr = originFormula;
|
|
37754
|
+
}
|
|
37755
|
+
if (___default['default'].isNil(calc_funcStr)) {
|
|
37756
|
+
return 0; // continue
|
|
37757
|
+
}
|
|
37758
|
+
var txt1 = calc_funcStr.toUpperCase();
|
|
37759
|
+
var isOffsetFunc = txt1.indexOf("INDIRECT(") > -1 || txt1.indexOf("OFFSET(") > -1 || txt1.indexOf("INDEX(") > -1;
|
|
37760
|
+
var formulaArray = [];
|
|
37761
|
+
if (isOffsetFunc) {
|
|
37762
|
+
isFunctionRange(ctx, calc_funcStr, null, null, fId, null, function (str_nb) {
|
|
37763
|
+
var range = getcellrange(ctx, ___default['default'].trim(str_nb), fId);
|
|
37764
|
+
if (!___default['default'].isNil(range)) {
|
|
37765
|
+
formulaArray.push(range);
|
|
37766
|
+
}
|
|
37767
|
+
});
|
|
37768
|
+
} else if (!(calc_funcStr.substring(0, 2) === '="' && calc_funcStr.substring(calc_funcStr.length - 1, 1) === '"')) {
|
|
37769
|
+
var point = 0;
|
|
37770
|
+
var squote = -1;
|
|
37771
|
+
var dquote = -1;
|
|
37772
|
+
var formulaTextArray = [];
|
|
37773
|
+
var sq_end_array = [];
|
|
37774
|
+
var calc_funcStr_length = calc_funcStr.length;
|
|
37775
|
+
for (var j = 0; j < calc_funcStr_length; j += 1) {
|
|
37776
|
+
var char = calc_funcStr.charAt(j);
|
|
37777
|
+
if (char === "'" && dquote === -1) {
|
|
37778
|
+
if (squote === -1) {
|
|
37779
|
+
if (point !== j) {
|
|
37780
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, j).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37781
|
+
}
|
|
37782
|
+
squote = j;
|
|
37783
|
+
point = j;
|
|
37777
37784
|
} else {
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37785
|
+
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === "'") {
|
|
37786
|
+
j += 1;
|
|
37787
|
+
} else {
|
|
37788
|
+
point = j + 1;
|
|
37789
|
+
formulaTextArray.push(calc_funcStr.substring(squote, point));
|
|
37790
|
+
sq_end_array.push(formulaTextArray.length - 1);
|
|
37791
|
+
squote = -1;
|
|
37792
|
+
}
|
|
37782
37793
|
}
|
|
37783
37794
|
}
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37787
|
-
|
|
37788
|
-
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
point = j;
|
|
37792
|
-
} else {
|
|
37793
|
-
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === '"') {
|
|
37794
|
-
j += 1;
|
|
37795
|
+
if (char === '"' && squote === -1) {
|
|
37796
|
+
if (dquote === -1) {
|
|
37797
|
+
if (point !== j) {
|
|
37798
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, j).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37799
|
+
}
|
|
37800
|
+
dquote = j;
|
|
37801
|
+
point = j;
|
|
37795
37802
|
} else {
|
|
37796
|
-
|
|
37797
|
-
|
|
37798
|
-
|
|
37803
|
+
if (j < calc_funcStr_length - 1 && calc_funcStr.charAt(j + 1) === '"') {
|
|
37804
|
+
j += 1;
|
|
37805
|
+
} else {
|
|
37806
|
+
point = j + 1;
|
|
37807
|
+
formulaTextArray.push(calc_funcStr.substring(dquote, point));
|
|
37808
|
+
dquote = -1;
|
|
37809
|
+
}
|
|
37799
37810
|
}
|
|
37800
37811
|
}
|
|
37801
37812
|
}
|
|
37802
|
-
|
|
37803
|
-
|
|
37804
|
-
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, calc_funcStr_length).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37805
|
-
}
|
|
37806
|
-
for (var _j = sq_end_array.length - 1; _j >= 0; _j -= 1) {
|
|
37807
|
-
if (sq_end_array[_j] !== formulaTextArray.length - 1) {
|
|
37808
|
-
formulaTextArray[sq_end_array[_j]] += formulaTextArray[sq_end_array[_j] + 1];
|
|
37809
|
-
formulaTextArray.splice(sq_end_array[_j] + 1, 1);
|
|
37810
|
-
}
|
|
37811
|
-
}
|
|
37812
|
-
for (var _j2 = 0; _j2 < formulaTextArray.length; _j2 += 1) {
|
|
37813
|
-
var t = ___default['default'].trim(formulaTextArray[_j2]);
|
|
37814
|
-
if (t.length <= 1) {
|
|
37815
|
-
continue;
|
|
37813
|
+
if (point !== calc_funcStr_length) {
|
|
37814
|
+
formulaTextArray.push.apply(formulaTextArray, _toConsumableArray(calc_funcStr.substring(point, calc_funcStr_length).split(/==|!=|<>|<=|>=|[,()=+-/*%&^><]/)));
|
|
37816
37815
|
}
|
|
37817
|
-
|
|
37818
|
-
|
|
37816
|
+
for (var _j = sq_end_array.length - 1; _j >= 0; _j -= 1) {
|
|
37817
|
+
if (sq_end_array[_j] !== formulaTextArray.length - 1) {
|
|
37818
|
+
formulaTextArray[sq_end_array[_j]] += formulaTextArray[sq_end_array[_j] + 1];
|
|
37819
|
+
formulaTextArray.splice(sq_end_array[_j] + 1, 1);
|
|
37820
|
+
}
|
|
37819
37821
|
}
|
|
37820
|
-
var
|
|
37821
|
-
|
|
37822
|
-
|
|
37822
|
+
for (var _j2 = 0; _j2 < formulaTextArray.length; _j2 += 1) {
|
|
37823
|
+
var t = ___default['default'].trim(formulaTextArray[_j2]);
|
|
37824
|
+
if (t.length <= 1) {
|
|
37825
|
+
continue;
|
|
37826
|
+
}
|
|
37827
|
+
if (t.substring(0, 1) === '"' && t.substring(t.length - 1, 1) === '"' || !iscelldata(t)) {
|
|
37828
|
+
continue;
|
|
37829
|
+
}
|
|
37830
|
+
var range = getcellrange(ctx, t, fId);
|
|
37831
|
+
if (___default['default'].isNil(range)) {
|
|
37832
|
+
continue;
|
|
37833
|
+
}
|
|
37834
|
+
formulaArray.push(range);
|
|
37823
37835
|
}
|
|
37824
|
-
formulaArray.push(range);
|
|
37825
37836
|
}
|
|
37826
|
-
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
|
|
37832
|
-
|
|
37833
|
-
|
|
37834
|
-
|
|
37835
|
-
|
|
37836
|
-
|
|
37837
|
-
|
|
37838
|
-
|
|
37839
|
-
|
|
37837
|
+
var item = {
|
|
37838
|
+
formulaArray: formulaArray,
|
|
37839
|
+
calc_funcStr: calc_funcStr,
|
|
37840
|
+
key: key,
|
|
37841
|
+
r: fR,
|
|
37842
|
+
c: fC,
|
|
37843
|
+
id: fId,
|
|
37844
|
+
parents: {},
|
|
37845
|
+
chidren: {},
|
|
37846
|
+
color: "w"
|
|
37847
|
+
};
|
|
37848
|
+
formulaObjects[key] = item;
|
|
37849
|
+
},
|
|
37850
|
+
_ret;
|
|
37840
37851
|
for (var _i12 = 0; _i12 < calcChains.length; _i12 += 1) {
|
|
37841
|
-
|
|
37852
|
+
_ret = _loop();
|
|
37853
|
+
if (_ret === 0) continue;
|
|
37842
37854
|
}
|
|
37843
37855
|
console.timeEnd('cache1');
|
|
37844
37856
|
console.time('cache2');
|
|
@@ -37863,66 +37875,36 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37863
37875
|
var visited = {};
|
|
37864
37876
|
var inStack = {};
|
|
37865
37877
|
var circularNodes = {};
|
|
37878
|
+
var dfsPath = [];
|
|
37866
37879
|
function detectCycle(nodeKey) {
|
|
37867
37880
|
inStack[nodeKey] = true;
|
|
37868
37881
|
visited[nodeKey] = true;
|
|
37882
|
+
dfsPath.push(nodeKey);
|
|
37869
37883
|
var node = formulaObjects[nodeKey];
|
|
37870
|
-
if (
|
|
37871
|
-
|
|
37872
|
-
|
|
37873
|
-
|
|
37874
|
-
|
|
37875
|
-
|
|
37876
|
-
if (
|
|
37877
|
-
|
|
37884
|
+
if (node) {
|
|
37885
|
+
var children = Object.keys(node.chidren);
|
|
37886
|
+
for (var _i13 = 0; _i13 < children.length; _i13 += 1) {
|
|
37887
|
+
var childKey = children[_i13];
|
|
37888
|
+
if (inStack[childKey]) {
|
|
37889
|
+
var cycleStart = dfsPath.indexOf(childKey);
|
|
37890
|
+
if (cycleStart > -1) {
|
|
37891
|
+
for (var k = cycleStart; k < dfsPath.length; k += 1) {
|
|
37892
|
+
circularNodes[dfsPath[k]] = true;
|
|
37893
|
+
}
|
|
37878
37894
|
}
|
|
37879
|
-
})
|
|
37880
|
-
|
|
37881
|
-
|
|
37882
|
-
if (!visited[childKey] && detectCycle(childKey)) {
|
|
37883
|
-
return true;
|
|
37895
|
+
} else if (!visited[childKey]) {
|
|
37896
|
+
detectCycle(childKey);
|
|
37897
|
+
}
|
|
37884
37898
|
}
|
|
37885
37899
|
}
|
|
37900
|
+
dfsPath.pop();
|
|
37886
37901
|
inStack[nodeKey] = false;
|
|
37887
|
-
return false;
|
|
37888
37902
|
}
|
|
37889
|
-
Object.keys(formulaObjects).
|
|
37903
|
+
Object.keys(formulaObjects).forEach(function (key) {
|
|
37890
37904
|
if (!visited[key]) {
|
|
37891
37905
|
detectCycle(key);
|
|
37892
37906
|
}
|
|
37893
|
-
return true;
|
|
37894
37907
|
});
|
|
37895
|
-
if (Object.keys(circularNodes).length > 0) {
|
|
37896
|
-
ctx.circularReference = Object.keys(circularNodes).map(function (key) {
|
|
37897
|
-
var _ctx$luckysheetfile$s;
|
|
37898
|
-
var fObj = formulaObjects[key];
|
|
37899
|
-
var sheetIndex = getSheetIndex(ctx, fObj.id);
|
|
37900
|
-
var sheetName = sheetIndex != null ? ((_ctx$luckysheetfile$s = ctx.luckysheetfile[sheetIndex]) === null || _ctx$luckysheetfile$s === void 0 ? void 0 : _ctx$luckysheetfile$s.name) || '' : '';
|
|
37901
|
-
var cellPosition = indexToColumnChar(fObj.c) + (fObj.r + 1);
|
|
37902
|
-
return {
|
|
37903
|
-
sheetName: sheetName,
|
|
37904
|
-
cellPosition: cellPosition,
|
|
37905
|
-
formulaContent: fObj.calc_funcStr,
|
|
37906
|
-
r: fObj.r,
|
|
37907
|
-
c: fObj.c,
|
|
37908
|
-
sheetId: fObj.id
|
|
37909
|
-
};
|
|
37910
|
-
});
|
|
37911
|
-
Object.keys(circularNodes).forEach(function (key) {
|
|
37912
|
-
var fObj = formulaObjects[key];
|
|
37913
|
-
if (fObj) {
|
|
37914
|
-
ctx.groupValuesRefreshData.push({
|
|
37915
|
-
r: fObj.r,
|
|
37916
|
-
c: fObj.c,
|
|
37917
|
-
v: error.r,
|
|
37918
|
-
f: fObj.calc_funcStr,
|
|
37919
|
-
id: fObj.id
|
|
37920
|
-
});
|
|
37921
|
-
fObj.level = Math.max;
|
|
37922
|
-
}
|
|
37923
|
-
});
|
|
37924
|
-
}
|
|
37925
|
-
console.timeEnd('dev');
|
|
37926
37908
|
var formulaRunList = [];
|
|
37927
37909
|
var stack = updateValueArray;
|
|
37928
37910
|
var existsFormulaRunList = {};
|
|
@@ -37952,12 +37934,56 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data) {
|
|
|
37952
37934
|
stack = stack.concat(cacheStack);
|
|
37953
37935
|
}
|
|
37954
37936
|
},
|
|
37955
|
-
|
|
37937
|
+
_ret2;
|
|
37956
37938
|
while (stack.length > 0) {
|
|
37957
|
-
|
|
37958
|
-
if (
|
|
37939
|
+
_ret2 = _loop2();
|
|
37940
|
+
if (_ret2 === 0) continue;
|
|
37959
37941
|
}
|
|
37960
37942
|
formulaRunList.reverse();
|
|
37943
|
+
var formulaRunListKeys = {};
|
|
37944
|
+
formulaRunList.forEach(function (item) {
|
|
37945
|
+
formulaRunListKeys[item.key] = true;
|
|
37946
|
+
});
|
|
37947
|
+
var circularKeys = Object.keys(circularNodes);
|
|
37948
|
+
var relevantCircularKeys = circularKeys.filter(function (key) {
|
|
37949
|
+
return formulaRunListKeys[key];
|
|
37950
|
+
});
|
|
37951
|
+
if (relevantCircularKeys.length > 0) {
|
|
37952
|
+
ctx.circularReference = relevantCircularKeys.map(function (key) {
|
|
37953
|
+
var _ctx$luckysheetfile$s;
|
|
37954
|
+
var fObj = formulaObjects[key];
|
|
37955
|
+
var sheetIndex = getSheetIndex(ctx, fObj.id);
|
|
37956
|
+
var sheetName = sheetIndex != null ? ((_ctx$luckysheetfile$s = ctx.luckysheetfile[sheetIndex]) === null || _ctx$luckysheetfile$s === void 0 ? void 0 : _ctx$luckysheetfile$s.name) || '' : '';
|
|
37957
|
+
var cellPosition = indexToColumnChar(fObj.c) + (fObj.r + 1);
|
|
37958
|
+
return {
|
|
37959
|
+
sheetName: sheetName,
|
|
37960
|
+
cellPosition: cellPosition,
|
|
37961
|
+
formulaContent: fObj.calc_funcStr,
|
|
37962
|
+
r: fObj.r,
|
|
37963
|
+
c: fObj.c,
|
|
37964
|
+
sheetId: fObj.id
|
|
37965
|
+
};
|
|
37966
|
+
});
|
|
37967
|
+
}
|
|
37968
|
+
if (relevantCircularKeys.length > 0) {
|
|
37969
|
+
var isEditingCell = !___default['default'].isNil(origin_r) && !___default['default'].isNil(origin_c);
|
|
37970
|
+
relevantCircularKeys.forEach(function (key) {
|
|
37971
|
+
var fObj = formulaObjects[key];
|
|
37972
|
+
if (!fObj) return;
|
|
37973
|
+
fObj.level = Math.max;
|
|
37974
|
+
if (isEditingCell && fObj.r === origin_r && fObj.c === origin_c && fObj.id === id) {
|
|
37975
|
+
return;
|
|
37976
|
+
}
|
|
37977
|
+
ctx.groupValuesRefreshData.push({
|
|
37978
|
+
r: fObj.r,
|
|
37979
|
+
c: fObj.c,
|
|
37980
|
+
v: error.r,
|
|
37981
|
+
f: fObj.calc_funcStr,
|
|
37982
|
+
id: fObj.id
|
|
37983
|
+
});
|
|
37984
|
+
});
|
|
37985
|
+
}
|
|
37986
|
+
console.timeEnd('dev');
|
|
37961
37987
|
console.timeEnd('execFunctionGroup-before');
|
|
37962
37988
|
var lastDataRowSheets = Object.create(null);
|
|
37963
37989
|
for (var _i14 = 0; _i14 < formulaRunList.length; _i14++) {
|
|
@@ -42070,7 +42096,7 @@ function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
|
42070
42096
|
} else {
|
|
42071
42097
|
var _d$r3;
|
|
42072
42098
|
delFunctionGroup(ctx, r, c);
|
|
42073
|
-
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false);
|
|
42099
|
+
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false, "");
|
|
42074
42100
|
curv = ___default['default'].cloneDeep((d === null || d === void 0 ? void 0 : (_d$r3 = d[r]) === null || _d$r3 === void 0 ? void 0 : _d$r3[c]) || {});
|
|
42075
42101
|
curv.v = value;
|
|
42076
42102
|
delete curv.f;
|
|
@@ -42129,7 +42155,7 @@ function updateCell(ctx, r, c, $input, value, canvas, sheetId) {
|
|
|
42129
42155
|
}
|
|
42130
42156
|
} else {
|
|
42131
42157
|
delFunctionGroup(ctx, r, c);
|
|
42132
|
-
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false);
|
|
42158
|
+
execFunctionGroup(ctx, r, c, value, undefined, undefined, false, false, "");
|
|
42133
42159
|
}
|
|
42134
42160
|
}
|
|
42135
42161
|
setCellValue(ctx, r, c, d, value);
|
|
@@ -52576,6 +52602,7 @@ var Canvas = /*#__PURE__*/function () {
|
|
|
52576
52602
|
return _createClass(Canvas, [{
|
|
52577
52603
|
key: "drawRowHeader",
|
|
52578
52604
|
value: function drawRowHeader(scrollHeight, drawHeight, offsetTop) {
|
|
52605
|
+
if (!this.sheetCtx.showHeaders) return;
|
|
52579
52606
|
if (___default['default'].isNil(drawHeight)) {
|
|
52580
52607
|
var _this$sheetCtx$luckys = _slicedToArray(this.sheetCtx.luckysheetTableContentHW, 2);
|
|
52581
52608
|
drawHeight = _this$sheetCtx$luckys[1];
|
|
@@ -52670,6 +52697,7 @@ var Canvas = /*#__PURE__*/function () {
|
|
|
52670
52697
|
}, {
|
|
52671
52698
|
key: "drawColumnHeader",
|
|
52672
52699
|
value: function drawColumnHeader(scrollWidth, drawWidth, offsetLeft) {
|
|
52700
|
+
if (!this.sheetCtx.showHeaders) return;
|
|
52673
52701
|
if (drawWidth === undefined) {
|
|
52674
52702
|
var _this$sheetCtx$luckys2 = _slicedToArray(this.sheetCtx.luckysheetTableContentHW, 1);
|
|
52675
52703
|
drawWidth = _this$sheetCtx$luckys2[0];
|
|
@@ -55900,6 +55928,7 @@ function defaultContext(refs) {
|
|
|
55900
55928
|
chart_selection: {},
|
|
55901
55929
|
zoomRatio: 1,
|
|
55902
55930
|
showGridLines: true,
|
|
55931
|
+
showHeaders: true,
|
|
55903
55932
|
allowEdit: true,
|
|
55904
55933
|
showAddSheetButton: true,
|
|
55905
55934
|
onAddSheetClick: undefined,
|
|
@@ -56751,7 +56780,7 @@ function setCellValue$1(ctx, row, column, value, cellInput) {
|
|
|
56751
56780
|
var formatList = FORMAT_LIST;
|
|
56752
56781
|
if (value == null || value.toString().length === 0) {
|
|
56753
56782
|
delFunctionGroup(ctx, row, column);
|
|
56754
|
-
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false);
|
|
56783
|
+
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false, "");
|
|
56755
56784
|
setCellValue(ctx, row, column, data, value);
|
|
56756
56785
|
} else if (value instanceof Object) {
|
|
56757
56786
|
var _data$row;
|
|
@@ -56822,7 +56851,7 @@ function setCellValue$1(ctx, row, column, value, cellInput) {
|
|
|
56822
56851
|
updateCell(ctx, row, column, cellInput, value);
|
|
56823
56852
|
} else {
|
|
56824
56853
|
delFunctionGroup(ctx, row, column);
|
|
56825
|
-
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false);
|
|
56854
|
+
execFunctionGroup(ctx, row, column, value, sheet.id, data, false, false, "");
|
|
56826
56855
|
setCellValue(ctx, row, column, data, value);
|
|
56827
56856
|
}
|
|
56828
56857
|
}
|
|
@@ -35,7 +35,7 @@ export declare function delFunctionGroup(ctx: Context, r: number, c: number, id?
|
|
|
35
35
|
export declare function insertUpdateFunctionGroup(ctx: Context, r: number, c: number, id?: string): void;
|
|
36
36
|
export declare function execfunction(ctx: Context, txt: string, r: number, c: number, id?: string, isrefresh?: boolean, notInsertFunc?: boolean): any[];
|
|
37
37
|
export declare function groupValuesRefresh(ctx: Context): void;
|
|
38
|
-
export declare function execFunctionGroup(ctx: Context, origin_r: number, origin_c: number, value: any, id?: string, data?: any, isForce?: boolean, notInsertFunc?: boolean): void;
|
|
38
|
+
export declare function execFunctionGroup(ctx: Context, origin_r: number, origin_c: number, value: any, id?: string, data?: any, isForce?: boolean, notInsertFunc?: boolean, originFormula?: string): void;
|
|
39
39
|
export declare function createFormulaRangeSelect(ctx: Context, select: {
|
|
40
40
|
rangeIndex: number;
|
|
41
41
|
} & Rect): void;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.33",
|
|
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": "7.0.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "7.0.33",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|