@fileverse-dev/fortune-core 1.1.47 → 1.1.48
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/events/mouse.js +1 -1
- package/es/modules/cell.js +10 -12
- package/es/modules/formula.d.ts +1 -0
- package/es/modules/formula.js +12 -2
- package/es/utils/index.js +12 -4
- package/lib/events/mouse.js +1 -1
- package/lib/modules/cell.js +10 -12
- package/lib/modules/formula.d.ts +1 -0
- package/lib/modules/formula.js +13 -2
- package/lib/utils/index.js +12 -4
- package/package.json +1 -1
package/es/events/mouse.js
CHANGED
|
@@ -178,7 +178,7 @@ export function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, containe
|
|
|
178
178
|
var spans = doc.querySelectorAll("span");
|
|
179
179
|
var firstSpan = spans[0];
|
|
180
180
|
var lastSpan = spans[spans.length - 1];
|
|
181
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)
|
|
181
|
+
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
182
182
|
var rowseleted = [row_index, row_index_ed];
|
|
183
183
|
var columnseleted = [col_index, col_index_ed];
|
|
184
184
|
var left = col_pre;
|
package/es/modules/cell.js
CHANGED
|
@@ -128,12 +128,10 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
128
128
|
vupdate = v;
|
|
129
129
|
}
|
|
130
130
|
var commaPresent = false;
|
|
131
|
-
var decimalPresent = false;
|
|
132
131
|
if (vupdate && typeof vupdate === "string" && vupdate.includes(",")) {
|
|
133
132
|
commaPresent = vupdate.includes(",");
|
|
134
|
-
decimalPresent = vupdate.includes(".");
|
|
135
133
|
var removeCommasValidated = function removeCommasValidated(str) {
|
|
136
|
-
return /^[\d
|
|
134
|
+
return /^[\d,.]+$/.test(str) ? str === null || str === void 0 ? void 0 : str.replace(/,/g, "") : str;
|
|
137
135
|
};
|
|
138
136
|
vupdate = removeCommasValidated(vupdate);
|
|
139
137
|
}
|
|
@@ -503,7 +501,7 @@ export function cancelNormalSelected(ctx) {
|
|
|
503
501
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
504
502
|
}
|
|
505
503
|
export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
506
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
504
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
507
505
|
console.log("updateCell", r, c, $input, value);
|
|
508
506
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
509
507
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
@@ -673,8 +671,8 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
673
671
|
f: v[2]
|
|
674
672
|
};
|
|
675
673
|
if (/^[\d.,]+$/.test(value.v)) {
|
|
676
|
-
var args = getContentInParentheses(value === null || value === void 0 ? void 0 : value.f).split(",");
|
|
677
|
-
var cellRefs = args.map(function (arg) {
|
|
674
|
+
var args = (_k = getContentInParentheses(value === null || value === void 0 ? void 0 : value.f)) === null || _k === void 0 ? void 0 : _k.split(",");
|
|
675
|
+
var cellRefs = args === null || args === void 0 ? void 0 : args.map(function (arg) {
|
|
678
676
|
return arg.trim().toUpperCase();
|
|
679
677
|
});
|
|
680
678
|
var formatted = processArray(cellRefs, d, flowdata);
|
|
@@ -725,8 +723,8 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
725
723
|
isRunExecFunction = false;
|
|
726
724
|
}
|
|
727
725
|
}
|
|
728
|
-
var decemialCount = ((
|
|
729
|
-
var coin = (
|
|
726
|
+
var decemialCount = ((_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().includes(".")) ? (_o = (_m = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _m === void 0 ? void 0 : _m.toString().split(" ")[0].split(".")[1]) === null || _o === void 0 ? void 0 : _o.length : 0;
|
|
727
|
+
var coin = (_p = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _p === void 0 ? void 0 : _p.toString().split(" ")[1];
|
|
730
728
|
if (_typeof(value) === "object" && value.baseValue && !(value === null || value === void 0 ? void 0 : value.m)) {
|
|
731
729
|
value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount || 2), " ").concat(coin);
|
|
732
730
|
}
|
|
@@ -742,7 +740,7 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
742
740
|
} else if (_typeof(value) === "object" && !value.tb) {
|
|
743
741
|
value.tb = "1";
|
|
744
742
|
}
|
|
745
|
-
var isValueArray = Array.isArray((
|
|
743
|
+
var isValueArray = Array.isArray((_q = value === null || value === void 0 ? void 0 : value.v) === null || _q === void 0 ? void 0 : _q[0]);
|
|
746
744
|
try {
|
|
747
745
|
if (isValueArray) {
|
|
748
746
|
if (spillSortResult(ctx, r, c, value, d)) {
|
|
@@ -766,8 +764,8 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
766
764
|
if ((curv === null || curv === void 0 ? void 0 : curv.tb) === "2" && curv.v || isInlineStringCell(d[r][c])) {
|
|
767
765
|
var defaultrowlen = ctx.defaultrowlen;
|
|
768
766
|
var cfg = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].config || {};
|
|
769
|
-
if (!(((
|
|
770
|
-
var cellWidth = ((
|
|
767
|
+
if (!(((_r = cfg.columnlen) === null || _r === void 0 ? void 0 : _r[c]) && ((_s = cfg.rowlen) === null || _s === void 0 ? void 0 : _s[r]))) {
|
|
768
|
+
var cellWidth = ((_t = cfg.columnlen) === null || _t === void 0 ? void 0 : _t[c]) || ctx.defaultcollen;
|
|
771
769
|
var textInfo = canvas ? getCellTextInfo(d[r][c], canvas, ctx, {
|
|
772
770
|
r: r,
|
|
773
771
|
c: c,
|
|
@@ -778,7 +776,7 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
778
776
|
currentRowLen = textInfo.textHeightAll + 2;
|
|
779
777
|
}
|
|
780
778
|
var previousRowHeight = getRowHeight(ctx, [r])[r];
|
|
781
|
-
if (currentRowLen > defaultrowlen && !((
|
|
779
|
+
if (currentRowLen > defaultrowlen && !((_u = cfg.customHeight) === null || _u === void 0 ? void 0 : _u[r]) && previousRowHeight < currentRowLen) {
|
|
782
780
|
if (_.isNil(cfg.rowlen)) cfg.rowlen = {};
|
|
783
781
|
cfg.rowlen[r] = currentRowLen;
|
|
784
782
|
}
|
package/es/modules/formula.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare function createFormulaRangeSelect(ctx: Context, select: {
|
|
|
40
40
|
} & Rect): void;
|
|
41
41
|
export declare function createRangeHightlight(ctx: Context, inputInnerHtmlStr: string, ignoreRangeIndex?: number): void;
|
|
42
42
|
export declare function setCaretPosition(ctx: Context, textDom: HTMLElement, children: number, pos: number): void;
|
|
43
|
+
export declare function moveCursorToEnd(editableDiv: HTMLDivElement): void;
|
|
43
44
|
export declare function getrangeseleciton(): ParentNode | ChildNode | null | undefined;
|
|
44
45
|
export declare function rangeHightlightselected(ctx: Context, $editor: HTMLDivElement): void;
|
|
45
46
|
export declare function functionHTMLGenerate(txt: string): string;
|
package/es/modules/formula.js
CHANGED
|
@@ -24,7 +24,6 @@ import { getFlowdata } from "../context";
|
|
|
24
24
|
import { columnCharToIndex, escapeScriptTag, getSheetIndex, indexToColumnChar, getSheetIdByName, escapeHTMLTag } from "../utils";
|
|
25
25
|
import { getcellFormula, getRangetxt, mergeMoveMain, setCellValue } from "./cell";
|
|
26
26
|
import { error } from "./validation";
|
|
27
|
-
import { moveToEnd } from "./cursor";
|
|
28
27
|
import { locale } from "../locale";
|
|
29
28
|
import { colors } from "./color";
|
|
30
29
|
import { colLocation, mousePosition, rowLocation } from "./location";
|
|
@@ -1237,7 +1236,18 @@ export function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1237
1236
|
el.focus();
|
|
1238
1237
|
} catch (err) {
|
|
1239
1238
|
console.error(err);
|
|
1240
|
-
|
|
1239
|
+
moveCursorToEnd(textDom);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
export function moveCursorToEnd(editableDiv) {
|
|
1243
|
+
editableDiv.focus();
|
|
1244
|
+
var range = document.createRange();
|
|
1245
|
+
var selection = window.getSelection();
|
|
1246
|
+
range.selectNodeContents(editableDiv);
|
|
1247
|
+
range.collapse(false);
|
|
1248
|
+
if (selection) {
|
|
1249
|
+
selection.removeAllRanges();
|
|
1250
|
+
selection.addRange(range);
|
|
1241
1251
|
}
|
|
1242
1252
|
}
|
|
1243
1253
|
function functionRange(ctx, obj, v, vp) {
|
package/es/utils/index.js
CHANGED
|
@@ -212,8 +212,16 @@ export function removeLastSpan(htmlString) {
|
|
|
212
212
|
}
|
|
213
213
|
export function getContentInParentheses(str) {
|
|
214
214
|
if (!str) return null;
|
|
215
|
-
var
|
|
216
|
-
|
|
215
|
+
var parenMatch = str.match(/\(([^)]+)\)/);
|
|
216
|
+
if (parenMatch) return parenMatch[1];
|
|
217
|
+
var formulaMatch = str.match(/^=([\w\d:+\-*/]+)$/);
|
|
218
|
+
if (formulaMatch) {
|
|
219
|
+
var refs = formulaMatch[1].split(/[\+\-\*\/]/).map(function (part) {
|
|
220
|
+
return part.trim();
|
|
221
|
+
}).filter(Boolean);
|
|
222
|
+
return refs.join(",");
|
|
223
|
+
}
|
|
224
|
+
return null;
|
|
217
225
|
}
|
|
218
226
|
export function processArray(cellReferences, d, flowData) {
|
|
219
227
|
function isValidCellReference(cell) {
|
|
@@ -238,7 +246,7 @@ export function processArray(cellReferences, d, flowData) {
|
|
|
238
246
|
row: row
|
|
239
247
|
};
|
|
240
248
|
}
|
|
241
|
-
var validCellReferences = cellReferences.filter(function (cellRef) {
|
|
249
|
+
var validCellReferences = cellReferences === null || cellReferences === void 0 ? void 0 : cellReferences.filter(function (cellRef) {
|
|
242
250
|
if (cellRef.includes(":")) {
|
|
243
251
|
var _a = cellRef.split(":"),
|
|
244
252
|
startCell = _a[0],
|
|
@@ -248,7 +256,7 @@ export function processArray(cellReferences, d, flowData) {
|
|
|
248
256
|
return isValidCellReference(cellRef.trim());
|
|
249
257
|
});
|
|
250
258
|
var expandedCellReferences = [];
|
|
251
|
-
validCellReferences.forEach(function (cellRef) {
|
|
259
|
+
validCellReferences === null || validCellReferences === void 0 ? void 0 : validCellReferences.forEach(function (cellRef) {
|
|
252
260
|
if (cellRef.includes(":")) {
|
|
253
261
|
var _a = cellRef.split(":"),
|
|
254
262
|
startCell = _a[0],
|
package/lib/events/mouse.js
CHANGED
|
@@ -197,7 +197,7 @@ function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxIn
|
|
|
197
197
|
var spans = doc.querySelectorAll("span");
|
|
198
198
|
var firstSpan = spans[0];
|
|
199
199
|
var lastSpan = spans[spans.length - 1];
|
|
200
|
-
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || (0, _modules.israngeseleciton)(ctx)
|
|
200
|
+
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || (0, _modules.israngeseleciton)(ctx)) {
|
|
201
201
|
var rowseleted = [row_index, row_index_ed];
|
|
202
202
|
var columnseleted = [col_index, col_index_ed];
|
|
203
203
|
var left = col_pre;
|
package/lib/modules/cell.js
CHANGED
|
@@ -158,12 +158,10 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
158
158
|
vupdate = v;
|
|
159
159
|
}
|
|
160
160
|
var commaPresent = false;
|
|
161
|
-
var decimalPresent = false;
|
|
162
161
|
if (vupdate && typeof vupdate === "string" && vupdate.includes(",")) {
|
|
163
162
|
commaPresent = vupdate.includes(",");
|
|
164
|
-
decimalPresent = vupdate.includes(".");
|
|
165
163
|
var removeCommasValidated = function removeCommasValidated(str) {
|
|
166
|
-
return /^[\d
|
|
164
|
+
return /^[\d,.]+$/.test(str) ? str === null || str === void 0 ? void 0 : str.replace(/,/g, "") : str;
|
|
167
165
|
};
|
|
168
166
|
vupdate = removeCommasValidated(vupdate);
|
|
169
167
|
}
|
|
@@ -533,7 +531,7 @@ function cancelNormalSelected(ctx) {
|
|
|
533
531
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
534
532
|
}
|
|
535
533
|
function updateCell(ctx, r, c, $input, value, canvas) {
|
|
536
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
534
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
537
535
|
console.log("updateCell", r, c, $input, value);
|
|
538
536
|
var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
|
|
539
537
|
var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
|
|
@@ -703,8 +701,8 @@ function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
703
701
|
f: v[2]
|
|
704
702
|
};
|
|
705
703
|
if (/^[\d.,]+$/.test(value.v)) {
|
|
706
|
-
var args = (0, _utils.getContentInParentheses)(value === null || value === void 0 ? void 0 : value.f).split(",");
|
|
707
|
-
var cellRefs = args.map(function (arg) {
|
|
704
|
+
var args = (_k = (0, _utils.getContentInParentheses)(value === null || value === void 0 ? void 0 : value.f)) === null || _k === void 0 ? void 0 : _k.split(",");
|
|
705
|
+
var cellRefs = args === null || args === void 0 ? void 0 : args.map(function (arg) {
|
|
708
706
|
return arg.trim().toUpperCase();
|
|
709
707
|
});
|
|
710
708
|
var formatted = (0, _utils.processArray)(cellRefs, d, flowdata);
|
|
@@ -755,8 +753,8 @@ function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
755
753
|
isRunExecFunction = false;
|
|
756
754
|
}
|
|
757
755
|
}
|
|
758
|
-
var decemialCount = ((
|
|
759
|
-
var coin = (
|
|
756
|
+
var decemialCount = ((_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().includes(".")) ? (_o = (_m = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _m === void 0 ? void 0 : _m.toString().split(" ")[0].split(".")[1]) === null || _o === void 0 ? void 0 : _o.length : 0;
|
|
757
|
+
var coin = (_p = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _p === void 0 ? void 0 : _p.toString().split(" ")[1];
|
|
760
758
|
if (_typeof(value) === "object" && value.baseValue && !(value === null || value === void 0 ? void 0 : value.m)) {
|
|
761
759
|
value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount || 2), " ").concat(coin);
|
|
762
760
|
}
|
|
@@ -772,7 +770,7 @@ function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
772
770
|
} else if (_typeof(value) === "object" && !value.tb) {
|
|
773
771
|
value.tb = "1";
|
|
774
772
|
}
|
|
775
|
-
var isValueArray = Array.isArray((
|
|
773
|
+
var isValueArray = Array.isArray((_q = value === null || value === void 0 ? void 0 : value.v) === null || _q === void 0 ? void 0 : _q[0]);
|
|
776
774
|
try {
|
|
777
775
|
if (isValueArray) {
|
|
778
776
|
if ((0, _sort.spillSortResult)(ctx, r, c, value, d)) {
|
|
@@ -796,8 +794,8 @@ function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
796
794
|
if ((curv === null || curv === void 0 ? void 0 : curv.tb) === "2" && curv.v || (0, _inlineString.isInlineStringCell)(d[r][c])) {
|
|
797
795
|
var defaultrowlen = ctx.defaultrowlen;
|
|
798
796
|
var cfg = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].config || {};
|
|
799
|
-
if (!(((
|
|
800
|
-
var cellWidth = ((
|
|
797
|
+
if (!(((_r = cfg.columnlen) === null || _r === void 0 ? void 0 : _r[c]) && ((_s = cfg.rowlen) === null || _s === void 0 ? void 0 : _s[r]))) {
|
|
798
|
+
var cellWidth = ((_t = cfg.columnlen) === null || _t === void 0 ? void 0 : _t[c]) || ctx.defaultcollen;
|
|
801
799
|
var textInfo = canvas ? (0, _text.getCellTextInfo)(d[r][c], canvas, ctx, {
|
|
802
800
|
r: r,
|
|
803
801
|
c: c,
|
|
@@ -808,7 +806,7 @@ function updateCell(ctx, r, c, $input, value, canvas) {
|
|
|
808
806
|
currentRowLen = textInfo.textHeightAll + 2;
|
|
809
807
|
}
|
|
810
808
|
var previousRowHeight = (0, _api.getRowHeight)(ctx, [r])[r];
|
|
811
|
-
if (currentRowLen > defaultrowlen && !((
|
|
809
|
+
if (currentRowLen > defaultrowlen && !((_u = cfg.customHeight) === null || _u === void 0 ? void 0 : _u[r]) && previousRowHeight < currentRowLen) {
|
|
812
810
|
if (_lodash.default.isNil(cfg.rowlen)) cfg.rowlen = {};
|
|
813
811
|
cfg.rowlen[r] = currentRowLen;
|
|
814
812
|
}
|
package/lib/modules/formula.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare function createFormulaRangeSelect(ctx: Context, select: {
|
|
|
40
40
|
} & Rect): void;
|
|
41
41
|
export declare function createRangeHightlight(ctx: Context, inputInnerHtmlStr: string, ignoreRangeIndex?: number): void;
|
|
42
42
|
export declare function setCaretPosition(ctx: Context, textDom: HTMLElement, children: number, pos: number): void;
|
|
43
|
+
export declare function moveCursorToEnd(editableDiv: HTMLDivElement): void;
|
|
43
44
|
export declare function getrangeseleciton(): ParentNode | ChildNode | null | undefined;
|
|
44
45
|
export declare function rangeHightlightselected(ctx: Context, $editor: HTMLDivElement): void;
|
|
45
46
|
export declare function functionHTMLGenerate(txt: string): string;
|
package/lib/modules/formula.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.handleFormulaInput = handleFormulaInput;
|
|
|
20
20
|
exports.insertUpdateFunctionGroup = insertUpdateFunctionGroup;
|
|
21
21
|
exports.iscelldata = iscelldata;
|
|
22
22
|
exports.israngeseleciton = israngeseleciton;
|
|
23
|
+
exports.moveCursorToEnd = moveCursorToEnd;
|
|
23
24
|
exports.onFormulaRangeDragEnd = onFormulaRangeDragEnd;
|
|
24
25
|
exports.rangeDrag = rangeDrag;
|
|
25
26
|
exports.rangeDragColumn = rangeDragColumn;
|
|
@@ -33,7 +34,6 @@ var _context = require("../context");
|
|
|
33
34
|
var _utils = require("../utils");
|
|
34
35
|
var _cell = require("./cell");
|
|
35
36
|
var _validation = require("./validation");
|
|
36
|
-
var _cursor = require("./cursor");
|
|
37
37
|
var _locale = require("../locale");
|
|
38
38
|
var _color = require("./color");
|
|
39
39
|
var _location = require("./location");
|
|
@@ -1266,7 +1266,18 @@ function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1266
1266
|
el.focus();
|
|
1267
1267
|
} catch (err) {
|
|
1268
1268
|
console.error(err);
|
|
1269
|
-
(
|
|
1269
|
+
moveCursorToEnd(textDom);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
function moveCursorToEnd(editableDiv) {
|
|
1273
|
+
editableDiv.focus();
|
|
1274
|
+
var range = document.createRange();
|
|
1275
|
+
var selection = window.getSelection();
|
|
1276
|
+
range.selectNodeContents(editableDiv);
|
|
1277
|
+
range.collapse(false);
|
|
1278
|
+
if (selection) {
|
|
1279
|
+
selection.removeAllRanges();
|
|
1280
|
+
selection.addRange(range);
|
|
1270
1281
|
}
|
|
1271
1282
|
}
|
|
1272
1283
|
function functionRange(ctx, obj, v, vp) {
|
package/lib/utils/index.js
CHANGED
|
@@ -280,8 +280,16 @@ function removeLastSpan(htmlString) {
|
|
|
280
280
|
}
|
|
281
281
|
function getContentInParentheses(str) {
|
|
282
282
|
if (!str) return null;
|
|
283
|
-
var
|
|
284
|
-
|
|
283
|
+
var parenMatch = str.match(/\(([^)]+)\)/);
|
|
284
|
+
if (parenMatch) return parenMatch[1];
|
|
285
|
+
var formulaMatch = str.match(/^=([\w\d:+\-*/]+)$/);
|
|
286
|
+
if (formulaMatch) {
|
|
287
|
+
var refs = formulaMatch[1].split(/[\+\-\*\/]/).map(function (part) {
|
|
288
|
+
return part.trim();
|
|
289
|
+
}).filter(Boolean);
|
|
290
|
+
return refs.join(",");
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
285
293
|
}
|
|
286
294
|
function processArray(cellReferences, d, flowData) {
|
|
287
295
|
function isValidCellReference(cell) {
|
|
@@ -306,7 +314,7 @@ function processArray(cellReferences, d, flowData) {
|
|
|
306
314
|
row: row
|
|
307
315
|
};
|
|
308
316
|
}
|
|
309
|
-
var validCellReferences = cellReferences.filter(function (cellRef) {
|
|
317
|
+
var validCellReferences = cellReferences === null || cellReferences === void 0 ? void 0 : cellReferences.filter(function (cellRef) {
|
|
310
318
|
if (cellRef.includes(":")) {
|
|
311
319
|
var _a = cellRef.split(":"),
|
|
312
320
|
startCell = _a[0],
|
|
@@ -316,7 +324,7 @@ function processArray(cellReferences, d, flowData) {
|
|
|
316
324
|
return isValidCellReference(cellRef.trim());
|
|
317
325
|
});
|
|
318
326
|
var expandedCellReferences = [];
|
|
319
|
-
validCellReferences.forEach(function (cellRef) {
|
|
327
|
+
validCellReferences === null || validCellReferences === void 0 ? void 0 : validCellReferences.forEach(function (cellRef) {
|
|
320
328
|
if (cellRef.includes(":")) {
|
|
321
329
|
var _a = cellRef.split(":"),
|
|
322
330
|
startCell = _a[0],
|