@univerjs/engine-formula 0.12.4-experimental.20251210-8d33c6e → 0.12.4-experimental.20251210-d708bff
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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +160 -108
- package/lib/es/index.js +20 -36
- package/lib/facade.js +160 -108
- package/lib/index.js +20 -36
- package/lib/types/engine/dependency/formula-dependency.d.ts +1 -0
- package/lib/types/facade/f-formula.d.ts +60 -48
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +3 -3
package/lib/es/facade.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FBase as
|
|
2
|
-
import { Inject as
|
|
3
|
-
import { LexerTreeBuilder as
|
|
4
|
-
import { firstValueFrom as
|
|
5
|
-
var
|
|
6
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
1
|
+
import { FBase as h, FUniver as S } from "@univerjs/core/facade";
|
|
2
|
+
import { Inject as c, ICommandService as _, Injector as v, IConfigService as g } from "@univerjs/core";
|
|
3
|
+
import { LexerTreeBuilder as x, SetFormulaCalculationStartMutation as d, SetFormulaCalculationStopMutation as E, SetFormulaCalculationNotificationMutation as p, GlobalComputingStatusService as F, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as T, SetFormulaCalculationResultMutation as y, SetFormulaStringBatchCalculationResultMutation as w, SetFormulaStringBatchCalculationMutation as R, SetFormulaDependencyCalculationResultMutation as M, SetFormulaDependencyCalculationMutation as b, SetCellFormulaDependencyCalculationResultMutation as D, SetCellFormulaDependencyCalculationMutation as I, SetQueryFormulaDependencyResultMutation as f, SetQueryFormulaDependencyMutation as C } from "@univerjs/engine-formula";
|
|
4
|
+
import { firstValueFrom as P, race as B, filter as L, timer as N, map as O } from "rxjs";
|
|
5
|
+
var A = Object.getOwnPropertyDescriptor, j = (e, t, i, r) => {
|
|
6
|
+
for (var n = r > 1 ? void 0 : r ? A(t, i) : t, a = e.length - 1, o; a >= 0; a--)
|
|
7
7
|
(o = e[a]) && (n = o(n) || n);
|
|
8
8
|
return n;
|
|
9
|
-
},
|
|
10
|
-
let
|
|
9
|
+
}, u = (e, t) => (i, r) => t(i, r, e);
|
|
10
|
+
let m = class extends h {
|
|
11
11
|
constructor(e, t, i, r) {
|
|
12
12
|
super(), this._commandService = e, this._injector = t, this._lexerTreeBuilder = i, this._configService = r, this._initialize();
|
|
13
13
|
}
|
|
@@ -66,7 +66,7 @@ let c = class extends _ {
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
executeCalculation() {
|
|
69
|
-
this._commandService.executeCommand(
|
|
69
|
+
this._commandService.executeCommand(d.id, { commands: [], forceCalculation: !0 }, { onlyLocal: !0 });
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Stop the calculation of the formula.
|
|
@@ -78,7 +78,7 @@ let c = class extends _ {
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
stopCalculation() {
|
|
81
|
-
this._commandService.executeCommand(
|
|
81
|
+
this._commandService.executeCommand(E.id, {});
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Listening calculation starts.
|
|
@@ -95,7 +95,7 @@ let c = class extends _ {
|
|
|
95
95
|
*/
|
|
96
96
|
calculationStart(e) {
|
|
97
97
|
return this._commandService.onCommandExecuted((t) => {
|
|
98
|
-
if (t.id ===
|
|
98
|
+
if (t.id === d.id) {
|
|
99
99
|
const i = t.params;
|
|
100
100
|
e(i.forceCalculation);
|
|
101
101
|
}
|
|
@@ -116,7 +116,7 @@ let c = class extends _ {
|
|
|
116
116
|
*/
|
|
117
117
|
calculationEnd(e) {
|
|
118
118
|
return this._commandService.onCommandExecuted((t) => {
|
|
119
|
-
if (t.id !==
|
|
119
|
+
if (t.id !== p.id)
|
|
120
120
|
return;
|
|
121
121
|
const i = t.params;
|
|
122
122
|
i.functionsExecutedState !== void 0 && e(i.functionsExecutedState);
|
|
@@ -139,9 +139,9 @@ let c = class extends _ {
|
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
141
|
whenComputingCompleteAsync(e) {
|
|
142
|
-
const t = this._injector.get(
|
|
143
|
-
return t.computingStatus ? Promise.resolve(!0) :
|
|
144
|
-
t.computingStatus$.pipe(
|
|
142
|
+
const t = this._injector.get(F);
|
|
143
|
+
return t.computingStatus ? Promise.resolve(!0) : P(B(
|
|
144
|
+
t.computingStatus$.pipe(L((i) => i)),
|
|
145
145
|
N(e != null ? e : 3e4).pipe(O(() => !1))
|
|
146
146
|
));
|
|
147
147
|
}
|
|
@@ -173,7 +173,7 @@ let c = class extends _ {
|
|
|
173
173
|
*/
|
|
174
174
|
calculationProcessing(e) {
|
|
175
175
|
return this._commandService.onCommandExecuted((t) => {
|
|
176
|
-
if (t.id !==
|
|
176
|
+
if (t.id !== p.id)
|
|
177
177
|
return;
|
|
178
178
|
const i = t.params;
|
|
179
179
|
i.stageInfo !== void 0 && e(i.stageInfo);
|
|
@@ -192,7 +192,7 @@ let c = class extends _ {
|
|
|
192
192
|
* ```
|
|
193
193
|
*/
|
|
194
194
|
setMaxIteration(e) {
|
|
195
|
-
this._configService.setConfig(
|
|
195
|
+
this._configService.setConfig(T, e);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Listens for the moment when formula-calculation results are applied.
|
|
@@ -219,7 +219,7 @@ let c = class extends _ {
|
|
|
219
219
|
*/
|
|
220
220
|
calculationResultApplied(e) {
|
|
221
221
|
return this._commandService.onCommandExecuted((t) => {
|
|
222
|
-
if (t.id !==
|
|
222
|
+
if (t.id !== y.id)
|
|
223
223
|
return;
|
|
224
224
|
const i = t.params;
|
|
225
225
|
i !== void 0 && requestIdleCallback(() => {
|
|
@@ -264,11 +264,11 @@ let c = class extends _ {
|
|
|
264
264
|
i || (l(), e());
|
|
265
265
|
}, 500), o = this.calculationProcessing(() => {
|
|
266
266
|
i || (i = !0, clearTimeout(a));
|
|
267
|
-
}),
|
|
267
|
+
}), s = this.calculationResultApplied(() => {
|
|
268
268
|
r || (r = !0, l(), e());
|
|
269
269
|
});
|
|
270
270
|
function l() {
|
|
271
|
-
clearTimeout(n), clearTimeout(a), o.dispose(),
|
|
271
|
+
clearTimeout(n), clearTimeout(a), o.dispose(), s.dispose();
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -299,11 +299,13 @@ let c = class extends _ {
|
|
|
299
299
|
* Nested structure (unit → sheet → row → column) describing formulas and
|
|
300
300
|
* their decomposed sub-expressions.
|
|
301
301
|
*
|
|
302
|
-
* @param {
|
|
303
|
-
*
|
|
302
|
+
* @param {number} [timeout]
|
|
303
|
+
* Optional timeout in milliseconds. If no result is received within this
|
|
304
|
+
* period, the promise will be rejected.
|
|
304
305
|
*
|
|
305
|
-
* @returns {
|
|
306
|
-
* A
|
|
306
|
+
* @returns {Promise<IFormulaExecuteResultMap>}
|
|
307
|
+
* A promise that resolves with the computed value map mirroring
|
|
308
|
+
* the input structure.
|
|
307
309
|
*
|
|
308
310
|
* @example
|
|
309
311
|
* ```ts
|
|
@@ -335,19 +337,25 @@ let c = class extends _ {
|
|
|
335
337
|
* },
|
|
336
338
|
* };
|
|
337
339
|
*
|
|
338
|
-
* const
|
|
339
|
-
*
|
|
340
|
-
* });
|
|
341
|
-
*
|
|
340
|
+
* const result = await formulaEngine.executeFormulas(formulas);
|
|
341
|
+
* console.log(result);
|
|
342
342
|
* ```
|
|
343
343
|
*/
|
|
344
|
-
executeFormulas(e, t) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
344
|
+
executeFormulas(e, t = 3e4) {
|
|
345
|
+
return new Promise((i, r) => {
|
|
346
|
+
const n = this._commandService.onCommandExecuted((o) => {
|
|
347
|
+
if (o.id !== w.id)
|
|
348
|
+
return;
|
|
349
|
+
const s = o.params;
|
|
350
|
+
clearTimeout(a), n.dispose(), s.result != null ? i(s.result) : r(new Error("Formula batch calculation returned no result"));
|
|
351
|
+
}), a = setTimeout(() => {
|
|
352
|
+
n.dispose(), r(new Error("Formula batch calculation timeout"));
|
|
353
|
+
}, t);
|
|
354
|
+
this._commandService.executeCommand(
|
|
355
|
+
R.id,
|
|
356
|
+
{ formulas: e },
|
|
357
|
+
{ onlyLocal: !0 }
|
|
358
|
+
);
|
|
351
359
|
});
|
|
352
360
|
}
|
|
353
361
|
/**
|
|
@@ -355,28 +363,37 @@ let c = class extends _ {
|
|
|
355
363
|
* dependency-analysis run. This triggers a local dependency-calculation command
|
|
356
364
|
* and returns the complete set of dependency trees once the calculation finishes.
|
|
357
365
|
*
|
|
358
|
-
* @param
|
|
366
|
+
* @param {number} [timeout]
|
|
367
|
+
* Optional timeout in milliseconds. If no result is received within this
|
|
368
|
+
* period, the promise will be rejected.
|
|
359
369
|
*
|
|
360
|
-
* @returns {
|
|
370
|
+
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
371
|
+
* A promise that resolves with the array of dependency trees.
|
|
361
372
|
*
|
|
362
373
|
* @example
|
|
363
374
|
* ```ts
|
|
364
375
|
* const formulaEngine = univerAPI.getFormula();
|
|
365
376
|
*
|
|
366
377
|
* // Fetch all dependency trees generated for the current workbook.
|
|
367
|
-
* const
|
|
368
|
-
*
|
|
369
|
-
* });
|
|
370
|
-
*
|
|
378
|
+
* const trees = await formulaEngine.getAllDependencyTrees();
|
|
379
|
+
* console.log('All dependency trees:', trees);
|
|
371
380
|
* ```
|
|
372
381
|
*/
|
|
373
|
-
getAllDependencyTrees(e) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
382
|
+
getAllDependencyTrees(e = 3e4) {
|
|
383
|
+
return new Promise((t, i) => {
|
|
384
|
+
const r = this._commandService.onCommandExecuted((a) => {
|
|
385
|
+
if (a.id !== M.id)
|
|
386
|
+
return;
|
|
387
|
+
const o = a.params;
|
|
388
|
+
clearTimeout(n), r.dispose(), o.result != null ? t(o.result) : t([]);
|
|
389
|
+
}), n = setTimeout(() => {
|
|
390
|
+
r.dispose(), i(new Error("Formula dependency calculation timeout"));
|
|
391
|
+
}, e);
|
|
392
|
+
this._commandService.executeCommand(
|
|
393
|
+
b.id,
|
|
394
|
+
void 0,
|
|
395
|
+
{ onlyLocal: !0 }
|
|
396
|
+
);
|
|
380
397
|
});
|
|
381
398
|
}
|
|
382
399
|
/**
|
|
@@ -390,38 +407,50 @@ let c = class extends _ {
|
|
|
390
407
|
* - `row` The zero-based row index.
|
|
391
408
|
* - `column` The zero-based column index.
|
|
392
409
|
*
|
|
393
|
-
* @param
|
|
394
|
-
*
|
|
410
|
+
* @param {number} [timeout]
|
|
411
|
+
* Optional timeout in milliseconds. If no result is received within this
|
|
412
|
+
* period, the promise will be rejected.
|
|
395
413
|
*
|
|
396
|
-
* @returns {
|
|
414
|
+
* @returns {Promise<IFormulaDependencyTreeFullJson | undefined>}
|
|
415
|
+
* A promise that resolves with the dependency tree or `undefined`
|
|
416
|
+
* if no tree exists for that cell.
|
|
397
417
|
*
|
|
398
418
|
* @example
|
|
399
419
|
* ```ts
|
|
400
420
|
* const formulaEngine = univerAPI.getFormula();
|
|
401
421
|
*
|
|
402
422
|
* // Query the dependency tree for cell B2 in a specific sheet.
|
|
403
|
-
* const
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
* );
|
|
423
|
+
* const tree = await formulaEngine.getCellDependencyTree({
|
|
424
|
+
* unitId: 'workbook1',
|
|
425
|
+
* sheetId: 'sheet1',
|
|
426
|
+
* row: 1,
|
|
427
|
+
* column: 1,
|
|
428
|
+
* });
|
|
409
429
|
*
|
|
430
|
+
* console.log('Cell dependency tree:', tree);
|
|
410
431
|
* ```
|
|
411
432
|
*/
|
|
412
|
-
getCellDependencyTree(e, t) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
433
|
+
getCellDependencyTree(e, t = 3e4) {
|
|
434
|
+
return new Promise((i, r) => {
|
|
435
|
+
const n = this._commandService.onCommandExecuted((o) => {
|
|
436
|
+
if (o.id !== D.id)
|
|
437
|
+
return;
|
|
438
|
+
const s = o.params;
|
|
439
|
+
clearTimeout(a), n.dispose(), i(s.result);
|
|
440
|
+
}), a = setTimeout(() => {
|
|
441
|
+
n.dispose(), r(new Error("Cell dependency calculation timeout"));
|
|
442
|
+
}, t);
|
|
443
|
+
this._commandService.executeCommand(
|
|
444
|
+
I.id,
|
|
445
|
+
e,
|
|
446
|
+
{ onlyLocal: !0 }
|
|
447
|
+
);
|
|
419
448
|
});
|
|
420
449
|
}
|
|
421
450
|
/**
|
|
422
451
|
* Retrieve the full dependency trees for all formulas that *depend on* the
|
|
423
452
|
* specified ranges. This triggers a local dependency-calculation command and
|
|
424
|
-
*
|
|
453
|
+
* resolves once the calculation completes.
|
|
425
454
|
*
|
|
426
455
|
* @param unitRanges An array of workbook/sheet ranges to query. Each range
|
|
427
456
|
* includes:
|
|
@@ -429,30 +458,41 @@ let c = class extends _ {
|
|
|
429
458
|
* - `sheetId` The sheet ID.
|
|
430
459
|
* - `range` The row/column boundaries.
|
|
431
460
|
*
|
|
432
|
-
* @param
|
|
433
|
-
*
|
|
434
|
-
*
|
|
461
|
+
* @param {number} [timeout]
|
|
462
|
+
* Optional timeout in milliseconds. If no result is received within this
|
|
463
|
+
* period, the promise will be rejected.
|
|
464
|
+
*
|
|
465
|
+
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
466
|
+
* A promise that resolves with an array of `IFormulaDependencyTreeJson`
|
|
467
|
+
* representing formulas and their relationships within the dependency graph.
|
|
435
468
|
*
|
|
436
469
|
* @example
|
|
437
470
|
* ```ts
|
|
438
471
|
* const formulaEngine = univerAPI.getFormula();
|
|
439
472
|
*
|
|
440
473
|
* // Query all formulas that depend on A1:B10 in Sheet1.
|
|
441
|
-
* formulaEngine.getRangeDependents(
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* );
|
|
474
|
+
* const dependents = await formulaEngine.getRangeDependents([
|
|
475
|
+
* { unitId: 'workbook1', sheetId: 'sheet1', range: { startRow: 0, endRow: 9, startColumn: 0, endColumn: 1 } }
|
|
476
|
+
* ]);
|
|
477
|
+
*
|
|
478
|
+
* console.log('Dependent formulas:', dependents);
|
|
447
479
|
* ```
|
|
448
480
|
*/
|
|
449
|
-
getRangeDependents(e, t) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
481
|
+
getRangeDependents(e, t = 3e4) {
|
|
482
|
+
return new Promise((i, r) => {
|
|
483
|
+
const n = this._commandService.onCommandExecuted((o) => {
|
|
484
|
+
if (o.id !== f.id)
|
|
485
|
+
return;
|
|
486
|
+
const s = o.params;
|
|
487
|
+
clearTimeout(a), n.dispose(), s.result != null ? i(s.result) : i([]);
|
|
488
|
+
}), a = setTimeout(() => {
|
|
489
|
+
n.dispose(), r(new Error("Range dependents calculation timeout"));
|
|
490
|
+
}, t);
|
|
491
|
+
this._commandService.executeCommand(
|
|
492
|
+
C.id,
|
|
493
|
+
{ unitRanges: e },
|
|
494
|
+
{ onlyLocal: !0 }
|
|
495
|
+
);
|
|
456
496
|
});
|
|
457
497
|
}
|
|
458
498
|
/**
|
|
@@ -461,7 +501,7 @@ let c = class extends _ {
|
|
|
461
501
|
* physically reside within the queried ranges.
|
|
462
502
|
*
|
|
463
503
|
* Internally this triggers the same dependency-calculation command but with
|
|
464
|
-
* `isInRange = true`, and the
|
|
504
|
+
* `isInRange = true`, and the promise resolves when the results are ready.
|
|
465
505
|
*
|
|
466
506
|
* @param unitRanges An array of workbook/sheet ranges defining the lookup
|
|
467
507
|
* boundaries:
|
|
@@ -469,45 +509,57 @@ let c = class extends _ {
|
|
|
469
509
|
* - `sheetId` The sheet ID.
|
|
470
510
|
* - `range` The zero-based grid range.
|
|
471
511
|
*
|
|
472
|
-
* @param
|
|
473
|
-
*
|
|
474
|
-
*
|
|
512
|
+
* @param {number} [timeout]
|
|
513
|
+
* Optional timeout in milliseconds. If no result is received within this
|
|
514
|
+
* period, the promise will be rejected.
|
|
515
|
+
*
|
|
516
|
+
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
517
|
+
* A promise that resolves with an array of `IFormulaDependencyTreeJson`
|
|
518
|
+
* describing every formula found in the provided ranges along with
|
|
519
|
+
* their parent/child relationships.
|
|
475
520
|
*
|
|
476
521
|
* @example
|
|
477
522
|
* ```ts
|
|
478
523
|
* const formulaEngine = univerAPI.getFormula();
|
|
479
524
|
*
|
|
480
525
|
* // Query all formulas that lie within A1:D20 in Sheet1.
|
|
481
|
-
* formulaEngine.getInRangeFormulas(
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* );
|
|
526
|
+
* const formulasInRange = await formulaEngine.getInRangeFormulas([
|
|
527
|
+
* { unitId: 'workbook1', sheetId: 'sheet1', range: { startRow: 0, endRow: 19, startColumn: 0, endColumn: 3 } }
|
|
528
|
+
* ]);
|
|
529
|
+
*
|
|
530
|
+
* console.log('Formulas inside range:', formulasInRange);
|
|
487
531
|
* ```
|
|
488
532
|
*/
|
|
489
|
-
getInRangeFormulas(e, t) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
533
|
+
getInRangeFormulas(e, t = 3e4) {
|
|
534
|
+
return new Promise((i, r) => {
|
|
535
|
+
const n = this._commandService.onCommandExecuted((o) => {
|
|
536
|
+
if (o.id !== f.id)
|
|
537
|
+
return;
|
|
538
|
+
const s = o.params;
|
|
539
|
+
clearTimeout(a), n.dispose(), s.result != null ? i(s.result) : i([]);
|
|
540
|
+
}), a = setTimeout(() => {
|
|
541
|
+
n.dispose(), r(new Error("In-range formulas calculation timeout"));
|
|
542
|
+
}, t);
|
|
543
|
+
this._commandService.executeCommand(
|
|
544
|
+
C.id,
|
|
545
|
+
{ unitRanges: e, isInRange: !0 },
|
|
546
|
+
{ onlyLocal: !0 }
|
|
547
|
+
);
|
|
496
548
|
});
|
|
497
549
|
}
|
|
498
550
|
};
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
],
|
|
505
|
-
class U extends
|
|
551
|
+
m = j([
|
|
552
|
+
u(0, c(_)),
|
|
553
|
+
u(1, c(v)),
|
|
554
|
+
u(2, c(x)),
|
|
555
|
+
u(3, g)
|
|
556
|
+
], m);
|
|
557
|
+
class U extends S {
|
|
506
558
|
getFormula() {
|
|
507
|
-
return this._injector.createInstance(
|
|
559
|
+
return this._injector.createInstance(m);
|
|
508
560
|
}
|
|
509
561
|
}
|
|
510
|
-
|
|
562
|
+
S.extend(U);
|
|
511
563
|
export {
|
|
512
|
-
|
|
564
|
+
m as FFormula
|
|
513
565
|
};
|
package/lib/es/index.js
CHANGED
|
@@ -10806,6 +10806,19 @@ let ia = class extends Me {
|
|
|
10806
10806
|
r && t.push(r.toJson());
|
|
10807
10807
|
return this._endFormulaDependencyTreeModel(), t;
|
|
10808
10808
|
}
|
|
10809
|
+
_setRealFormulaString(a) {
|
|
10810
|
+
if (!a.refTreeId)
|
|
10811
|
+
return;
|
|
10812
|
+
const e = this._getTreeById(a.refTreeId);
|
|
10813
|
+
if (!e)
|
|
10814
|
+
return;
|
|
10815
|
+
const t = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
10816
|
+
e.formula,
|
|
10817
|
+
a.refOffsetX,
|
|
10818
|
+
a.refOffsetY
|
|
10819
|
+
);
|
|
10820
|
+
a.formula = t;
|
|
10821
|
+
}
|
|
10809
10822
|
async getCellDependencyJson(a, e, t, r) {
|
|
10810
10823
|
await this._initializeGenerateTreeList();
|
|
10811
10824
|
const n = this._dependencyManagerService.getFormulaDependency(a, e, t, r);
|
|
@@ -10816,27 +10829,14 @@ let ia = class extends Me {
|
|
|
10816
10829
|
return;
|
|
10817
10830
|
this._startFormulaDependencyTreeModel();
|
|
10818
10831
|
const o = this._getFormulaDependencyTreeModel(s);
|
|
10819
|
-
|
|
10820
|
-
const c = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
10821
|
-
s.formula,
|
|
10822
|
-
s.refOffsetX,
|
|
10823
|
-
s.refOffsetY
|
|
10824
|
-
);
|
|
10825
|
-
o.formula = c;
|
|
10826
|
-
}
|
|
10832
|
+
this._setRealFormulaString(o);
|
|
10827
10833
|
const u = this._getDependencyTreeChildrenIds(s);
|
|
10828
10834
|
for (const c of u) {
|
|
10829
|
-
const l = this._getTreeModel(c)
|
|
10830
|
-
|
|
10831
|
-
const m = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
10832
|
-
f.formula,
|
|
10833
|
-
f.refOffsetX,
|
|
10834
|
-
f.refOffsetY
|
|
10835
|
-
);
|
|
10836
|
-
l.formula = m;
|
|
10837
|
-
}
|
|
10838
|
-
o.addChild(l);
|
|
10835
|
+
const l = this._getTreeModel(c);
|
|
10836
|
+
this._setRealFormulaString(l), o.addChild(l);
|
|
10839
10837
|
}
|
|
10838
|
+
for (const c of o.parents)
|
|
10839
|
+
this._setRealFormulaString(c);
|
|
10840
10840
|
return this._endFormulaDependencyTreeModel(), o.toFullJson();
|
|
10841
10841
|
}
|
|
10842
10842
|
async getRangeDependents(a) {
|
|
@@ -10847,15 +10847,7 @@ let ia = class extends Me {
|
|
|
10847
10847
|
if (!s)
|
|
10848
10848
|
continue;
|
|
10849
10849
|
const o = this._getFormulaDependencyTreeModel(s);
|
|
10850
|
-
|
|
10851
|
-
const u = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
10852
|
-
s.formula,
|
|
10853
|
-
s.refOffsetX,
|
|
10854
|
-
s.refOffsetY
|
|
10855
|
-
);
|
|
10856
|
-
o.formula = u;
|
|
10857
|
-
}
|
|
10858
|
-
t.push(o);
|
|
10850
|
+
this._setRealFormulaString(o), t.push(o);
|
|
10859
10851
|
}
|
|
10860
10852
|
const r = [];
|
|
10861
10853
|
for (const n of t)
|
|
@@ -10876,15 +10868,7 @@ let ia = class extends Me {
|
|
|
10876
10868
|
const r = [];
|
|
10877
10869
|
for (const s of t) {
|
|
10878
10870
|
const o = this._getFormulaDependencyTreeModel(s);
|
|
10879
|
-
|
|
10880
|
-
const u = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
10881
|
-
s.formula,
|
|
10882
|
-
s.refOffsetX,
|
|
10883
|
-
s.refOffsetY
|
|
10884
|
-
);
|
|
10885
|
-
o.formula = u;
|
|
10886
|
-
}
|
|
10887
|
-
r[s.treeId] = o;
|
|
10871
|
+
this._setRealFormulaString(o), r[s.treeId] = o;
|
|
10888
10872
|
}
|
|
10889
10873
|
const n = [];
|
|
10890
10874
|
for (const s of r)
|