@fileverse-dev/fortune-core 1.2.99-ydoc → 1.2.99-ydoc-1
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/es/api/cell.js +0 -2
- package/es/api/sheet.js +4 -5
- package/es/events/paste.js +0 -2
- package/es/modules/cell.js +0 -1
- package/es/modules/dropCell.js +0 -1
- package/es/modules/formula.js +0 -7
- package/es/modules/toolbar.js +0 -1
- package/lib/api/cell.js +0 -2
- package/lib/api/sheet.js +4 -5
- package/lib/events/paste.js +0 -2
- package/lib/modules/cell.js +0 -1
- package/lib/modules/dropCell.js +0 -1
- package/lib/modules/formula.js +0 -7
- package/lib/modules/toolbar.js +0 -1
- package/package.json +1 -1
package/es/api/cell.js
CHANGED
|
@@ -112,9 +112,7 @@ export function setCellValue(ctx, row, column, value, cellInput, options, callAf
|
|
|
112
112
|
setCellValueInternal(ctx, row, column, data, curv);
|
|
113
113
|
}
|
|
114
114
|
_.forEach(value, function (v, attr) {
|
|
115
|
-
console.log("attr haha why here", attr);
|
|
116
115
|
if (attr in formatList && callAfterUpdate) {
|
|
117
|
-
console.log("attr calling updateFormatCell", attr, callAfterUpdate);
|
|
118
116
|
updateFormatCell(ctx, data, attr, v, row, row, column, column);
|
|
119
117
|
} else {
|
|
120
118
|
cell_1[attr] = v;
|
package/es/api/sheet.js
CHANGED
|
@@ -173,23 +173,22 @@ export function calculateSheetFromula(ctx, id) {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
export function calculateReferencedCellSheetFromula(ctx, id, refCell) {
|
|
176
|
-
var _a, _b, _c, _d, _e
|
|
176
|
+
var _a, _b, _c, _d, _e;
|
|
177
177
|
var index = getSheetIndex(ctx, id);
|
|
178
178
|
if (!ctx.luckysheetfile[index].data) return;
|
|
179
179
|
var _loop_1 = function _loop_1(r) {
|
|
180
180
|
var _loop_2 = function _loop_2(c) {
|
|
181
|
-
console.log(refCell, (_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f);
|
|
182
181
|
var isRef = false;
|
|
183
|
-
if (refCell && ((
|
|
182
|
+
if (refCell && ((_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f) && !((_b = ctx.luckysheetfile[index].data[r][c]) === null || _b === void 0 ? void 0 : _b.isDataBlockFormula)) {
|
|
184
183
|
isRef = refCell.some(function (cell) {
|
|
185
184
|
var _a;
|
|
186
185
|
return isCellReferenced((_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f, cell);
|
|
187
186
|
});
|
|
188
187
|
}
|
|
189
|
-
if (!isRef || !((
|
|
188
|
+
if (!isRef || !((_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f) || ((_d = ctx.luckysheetfile[index].data[r][c]) === null || _d === void 0 ? void 0 : _d.isDataBlockFormula)) {
|
|
190
189
|
return "continue";
|
|
191
190
|
}
|
|
192
|
-
var result = execfunction(ctx, (
|
|
191
|
+
var result = execfunction(ctx, (_e = ctx.luckysheetfile[index].data[r][c]) === null || _e === void 0 ? void 0 : _e.f, r, c, id);
|
|
193
192
|
var isValueArray = Array.isArray(result[1]);
|
|
194
193
|
if (isValueArray) {
|
|
195
194
|
var value = {
|
package/es/events/paste.js
CHANGED
|
@@ -82,7 +82,6 @@ export function adjustFormulaForPaste(formula, srcCol, srcRow, destCol, destRow)
|
|
|
82
82
|
var result = formula.replace(stringOrCellRef, function (m, cellRef) {
|
|
83
83
|
if (!cellRef) return m;
|
|
84
84
|
if (cellRef.startsWith("$")) return m;
|
|
85
|
-
console.log(m, "cellRef", cellRef);
|
|
86
85
|
return cellRef.replace(cellRefRegex, function (__, absCol, colLetters, absRow, rowNum) {
|
|
87
86
|
var colIndex = columnLabelIndex(colLetters);
|
|
88
87
|
var rowIndex = parseInt(rowNum, 10);
|
|
@@ -1058,7 +1057,6 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
1058
1057
|
var isError = false;
|
|
1059
1058
|
try {
|
|
1060
1059
|
adjustedFormula = adjustFormulaForPaste(value.f, c_c1, c_r1, c, h);
|
|
1061
|
-
console.log("adjustedFormula", adjustedFormula);
|
|
1062
1060
|
} catch (error) {
|
|
1063
1061
|
isError = true;
|
|
1064
1062
|
value.error = {
|
package/es/modules/cell.js
CHANGED
|
@@ -111,7 +111,6 @@ export function getCellValue(r, c, data, attr) {
|
|
|
111
111
|
}
|
|
112
112
|
export function setCellValue(ctx, r, c, d, v) {
|
|
113
113
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
114
|
-
console.log("setCellValue", r, c, v);
|
|
115
114
|
if (ctx.allowEdit === false || ctx.isFlvReadOnly) return;
|
|
116
115
|
if (_.isNil(d)) {
|
|
117
116
|
d = getFlowdata(ctx);
|
package/es/modules/dropCell.js
CHANGED
|
@@ -2003,7 +2003,6 @@ export function updateDropCell(ctx) {
|
|
|
2003
2003
|
var v = formula.execfunction(ctx, f, i, j);
|
|
2004
2004
|
formula.execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
2005
2005
|
cell.v = v[1], cell.f = v[2];
|
|
2006
|
-
console.log(j, i);
|
|
2007
2006
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
2008
2007
|
if (afterUpdateCell) {
|
|
2009
2008
|
afterUpdateCell(i, j, null, __assign(__assign({}, cell), {
|
package/es/modules/formula.js
CHANGED
|
@@ -698,12 +698,6 @@ function replaceDotsInFunctionName(str) {
|
|
|
698
698
|
return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
|
|
699
699
|
}
|
|
700
700
|
export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
|
|
701
|
-
console.log("execfunction:", {
|
|
702
|
-
txt: txt,
|
|
703
|
-
r: r,
|
|
704
|
-
c: c,
|
|
705
|
-
id: id
|
|
706
|
-
});
|
|
707
701
|
var originalTxt = txt;
|
|
708
702
|
if ((txt === null || txt === void 0 ? void 0 : txt.toUpperCase().includes("NETWORKDAYS.INTL")) || (txt === null || txt === void 0 ? void 0 : txt.toUpperCase().includes("WORKDAY.INTL"))) {
|
|
709
703
|
txt = replaceDotsInFunctionName(txt);
|
|
@@ -821,7 +815,6 @@ export function execFunctionGroup(ctx, origin_r, origin_c, value, id, data, isFo
|
|
|
821
815
|
if (isForce === void 0) {
|
|
822
816
|
isForce = false;
|
|
823
817
|
}
|
|
824
|
-
console.log("execFunctionGroup", origin_r, origin_c, value, id, data);
|
|
825
818
|
if (_.isNil(data)) {
|
|
826
819
|
data = getFlowdata(ctx);
|
|
827
820
|
}
|
package/es/modules/toolbar.js
CHANGED
|
@@ -17,7 +17,6 @@ import { clearMeasureTextCache, getCellTextInfo } from "./text";
|
|
|
17
17
|
export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col_ed, canvas) {
|
|
18
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
19
19
|
var _11;
|
|
20
|
-
console.log("updateFormatCell", row_st, row_ed, col_st, col_ed);
|
|
21
20
|
if (_.isNil(d) || _.isNil(attr)) {
|
|
22
21
|
return;
|
|
23
22
|
}
|
package/lib/api/cell.js
CHANGED
|
@@ -123,9 +123,7 @@ function setCellValue(ctx, row, column, value, cellInput, options, callAfterUpda
|
|
|
123
123
|
(0, _modules.setCellValue)(ctx, row, column, data, curv);
|
|
124
124
|
}
|
|
125
125
|
_lodash.default.forEach(value, function (v, attr) {
|
|
126
|
-
console.log("attr haha why here", attr);
|
|
127
126
|
if (attr in formatList && callAfterUpdate) {
|
|
128
|
-
console.log("attr calling updateFormatCell", attr, callAfterUpdate);
|
|
129
127
|
(0, _modules.updateFormatCell)(ctx, data, attr, v, row, row, column, column);
|
|
130
128
|
} else {
|
|
131
129
|
cell_1[attr] = v;
|
package/lib/api/sheet.js
CHANGED
|
@@ -191,23 +191,22 @@ function calculateSheetFromula(ctx, id) {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
function calculateReferencedCellSheetFromula(ctx, id, refCell) {
|
|
194
|
-
var _a, _b, _c, _d, _e
|
|
194
|
+
var _a, _b, _c, _d, _e;
|
|
195
195
|
var index = (0, _utils.getSheetIndex)(ctx, id);
|
|
196
196
|
if (!ctx.luckysheetfile[index].data) return;
|
|
197
197
|
var _loop_1 = function _loop_1(r) {
|
|
198
198
|
var _loop_2 = function _loop_2(c) {
|
|
199
|
-
console.log(refCell, (_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f);
|
|
200
199
|
var isRef = false;
|
|
201
|
-
if (refCell && ((
|
|
200
|
+
if (refCell && ((_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f) && !((_b = ctx.luckysheetfile[index].data[r][c]) === null || _b === void 0 ? void 0 : _b.isDataBlockFormula)) {
|
|
202
201
|
isRef = refCell.some(function (cell) {
|
|
203
202
|
var _a;
|
|
204
203
|
return isCellReferenced((_a = ctx.luckysheetfile[index].data[r][c]) === null || _a === void 0 ? void 0 : _a.f, cell);
|
|
205
204
|
});
|
|
206
205
|
}
|
|
207
|
-
if (!isRef || !((
|
|
206
|
+
if (!isRef || !((_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f) || ((_d = ctx.luckysheetfile[index].data[r][c]) === null || _d === void 0 ? void 0 : _d.isDataBlockFormula)) {
|
|
208
207
|
return "continue";
|
|
209
208
|
}
|
|
210
|
-
var result = (0, _2.execfunction)(ctx, (
|
|
209
|
+
var result = (0, _2.execfunction)(ctx, (_e = ctx.luckysheetfile[index].data[r][c]) === null || _e === void 0 ? void 0 : _e.f, r, c, id);
|
|
211
210
|
var isValueArray = Array.isArray(result[1]);
|
|
212
211
|
if (isValueArray) {
|
|
213
212
|
var value = {
|
package/lib/events/paste.js
CHANGED
|
@@ -95,7 +95,6 @@ function adjustFormulaForPaste(formula, srcCol, srcRow, destCol, destRow) {
|
|
|
95
95
|
var result = formula.replace(stringOrCellRef, function (m, cellRef) {
|
|
96
96
|
if (!cellRef) return m;
|
|
97
97
|
if (cellRef.startsWith("$")) return m;
|
|
98
|
-
console.log(m, "cellRef", cellRef);
|
|
99
98
|
return cellRef.replace(cellRefRegex, function (__, absCol, colLetters, absRow, rowNum) {
|
|
100
99
|
var colIndex = columnLabelIndex(colLetters);
|
|
101
100
|
var rowIndex = parseInt(rowNum, 10);
|
|
@@ -1071,7 +1070,6 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
1071
1070
|
var isError = false;
|
|
1072
1071
|
try {
|
|
1073
1072
|
adjustedFormula = adjustFormulaForPaste(value.f, c_c1, c_r1, c, h);
|
|
1074
|
-
console.log("adjustedFormula", adjustedFormula);
|
|
1075
1073
|
} catch (error) {
|
|
1076
1074
|
isError = true;
|
|
1077
1075
|
value.error = {
|
package/lib/modules/cell.js
CHANGED
|
@@ -144,7 +144,6 @@ function getCellValue(r, c, data, attr) {
|
|
|
144
144
|
}
|
|
145
145
|
function setCellValue(ctx, r, c, d, v) {
|
|
146
146
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
147
|
-
console.log("setCellValue", r, c, v);
|
|
148
147
|
if (ctx.allowEdit === false || ctx.isFlvReadOnly) return;
|
|
149
148
|
if (_lodash.default.isNil(d)) {
|
|
150
149
|
d = (0, _context.getFlowdata)(ctx);
|
package/lib/modules/dropCell.js
CHANGED
|
@@ -2019,7 +2019,6 @@ function updateDropCell(ctx) {
|
|
|
2019
2019
|
var v = formula.execfunction(ctx, f, i, j);
|
|
2020
2020
|
formula.execFunctionGroup(ctx, j, i, v[1], undefined, d);
|
|
2021
2021
|
cell.v = v[1], cell.f = v[2];
|
|
2022
|
-
console.log(j, i);
|
|
2023
2022
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
2024
2023
|
if (afterUpdateCell) {
|
|
2025
2024
|
afterUpdateCell(i, j, null, __assign(__assign({}, cell), {
|
package/lib/modules/formula.js
CHANGED
|
@@ -728,12 +728,6 @@ function replaceDotsInFunctionName(str) {
|
|
|
728
728
|
return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
|
|
729
729
|
}
|
|
730
730
|
function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
|
|
731
|
-
console.log("execfunction:", {
|
|
732
|
-
txt: txt,
|
|
733
|
-
r: r,
|
|
734
|
-
c: c,
|
|
735
|
-
id: id
|
|
736
|
-
});
|
|
737
731
|
var originalTxt = txt;
|
|
738
732
|
if ((txt === null || txt === void 0 ? void 0 : txt.toUpperCase().includes("NETWORKDAYS.INTL")) || (txt === null || txt === void 0 ? void 0 : txt.toUpperCase().includes("WORKDAY.INTL"))) {
|
|
739
733
|
txt = replaceDotsInFunctionName(txt);
|
|
@@ -851,7 +845,6 @@ function execFunctionGroup(ctx, origin_r, origin_c, value, id, data, isForce) {
|
|
|
851
845
|
if (isForce === void 0) {
|
|
852
846
|
isForce = false;
|
|
853
847
|
}
|
|
854
|
-
console.log("execFunctionGroup", origin_r, origin_c, value, id, data);
|
|
855
848
|
if (_lodash.default.isNil(data)) {
|
|
856
849
|
data = (0, _context.getFlowdata)(ctx);
|
|
857
850
|
}
|
package/lib/modules/toolbar.js
CHANGED
|
@@ -50,7 +50,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
50
50
|
function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col_ed, canvas) {
|
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
52
52
|
var _11;
|
|
53
|
-
console.log("updateFormatCell", row_st, row_ed, col_st, col_ed);
|
|
54
53
|
if (_lodash.default.isNil(d) || _lodash.default.isNil(attr)) {
|
|
55
54
|
return;
|
|
56
55
|
}
|