@univerjs/sheets-formula 0.8.0-beta.0 → 0.8.0-beta.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/lib/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Ya = Object.defineProperty;
|
|
2
2
|
var Xa = (a, e, n) => e in a ? Ya(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
|
|
3
3
|
var W = (a, e, n) => Xa(a, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { CommandType as xt, ICommandService as ce, ObjectMatrix as Y, Tools as Ae, IUniverInstanceService as Ce, Rectangle as fe, sequenceExecuteAsync as Wa, isFormulaString as
|
|
5
|
-
import { SetRangeValuesCommand as Pa, SheetsSelectionsService as za, getSheetCommandTarget as Za, findFirstNonEmptyCell as Ja, alignToMergedCellsBorders as
|
|
6
|
-
import { serializeRange as
|
|
4
|
+
import { CommandType as xt, ICommandService as ce, ObjectMatrix as Y, Tools as Ae, IUniverInstanceService as Ce, Rectangle as fe, sequenceExecuteAsync as Wa, isFormulaString as xe, isFormulaId as la, cellToRange as sa, Direction as Ye, getIntersectRange as we, RANGE_TYPE as w, Inject as X, Disposable as ae, UniverInstanceType as ee, LifecycleService as Ka, ILogService as ka, IConfigService as De, LocaleService as _t, Injector as rt, createIdentifier as yt, toDisposable as ie, moveRangeByOffset as Nt, DisposableCollection as Xe, AbsoluteRefType as We, Optional as Qa, InterceptorEffectEnum as $a, CellValueType as Gt, isRealNum as ja, DependentOn as da, Plugin as pa, merge as La, touchDependencies as he, isNodeEnv as Ht } from "@univerjs/core";
|
|
5
|
+
import { SetRangeValuesCommand as Pa, SheetsSelectionsService as za, getSheetCommandTarget as Za, findFirstNonEmptyCell as Ja, alignToMergedCellsBorders as ct, expandToContinuousRange as en, SetSelectionsOperation as tn, SetRangeValuesMutation as te, handleMoveCols as Ta, EffectRefRangId as G, runRefRangeMutations as H, handleMoveRows as Ea, handleMoveRange as Ia, handleInsertRangeMoveRight as Na, handleInsertRangeMoveDown as Ra, handleDeleteRangeMoveUp as Sa, handleDeleteRangeMoveLeft as Aa, handleIRemoveCol as Ca, handleIRemoveRow as Da, handleInsertCol as ba, handleInsertRow as Oa, RemoveDefinedNameCommand as Ma, SetDefinedNameCommand as xa, RemoveSheetCommand as an, SetWorksheetNameCommand as nn, DeleteRangeMoveLeftCommand as rn, DeleteRangeMoveUpCommand as on, RemoveColCommand as un, RemoveRowCommand as mn, InsertRangeMoveDownCommand as fn, InsertRangeMoveRightCommand as cn, InsertColCommand as ln, InsertRowCommand as sn, MoveColsCommand as dn, MoveRowsCommand as pn, MoveRangeCommand as Ln, SheetInterceptorService as qt, SetStyleCommand as gt, SetBorderCommand as _a, ClearSelectionFormatCommand as ya, RemoveSheetMutation as Rt, InsertSheetMutation as St, RefRangeService as Pn, handleDefaultRangeChangeWithEffectRefCommands as wt, getSeparateEffectedRangesOnCommand as Tn, handleCommonDefaultRangeChangeWithEffectRefCommands as En, MoveRangeMutation as Yt, MoveRowsMutation as Xt, MoveColsMutation as Wt, ReorderRangeMutation as Kt, RemoveRowMutation as kt, RemoveColMutation as Qt, InsertColMutation as $t, InsertRowMutation as jt, SetRowHiddenMutation as zt, SetRowVisibleMutation as Zt, INTERCEPTOR_POINT as In, SetWorksheetActiveOperation as Nn, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as lt, UniverSheetsPlugin as Rn } from "@univerjs/sheets";
|
|
6
|
+
import { serializeRange as Ke, sequenceNodeType as J, deserializeRangeWithSheetWithCache as pe, serializeRangeToRefString as ot, ErrorType as j, IDefinedNamesService as ht, LexerTreeBuilder as Ut, generateStringWithSequence as ke, SetDefinedNameMutation as ye, IActiveDirtyManagerService as Ft, SetFormulaCalculationResultMutation as Sn, RemoveOtherFormulaMutation as An, SetOtherFormulaMutation as Cn, FormulaDataModel as ut, SetFormulaCalculationStartMutation as Ie, SetFormulaCalculationStopMutation as Jt, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as ea, SetFormulaCalculationNotificationMutation as Dn, FormulaExecuteStageType as Ue, FormulaExecutedStateType as be, IFormulaCurrentConfigService as bn, Lexer as On, AstTreeBuilder as Mn, Interpreter as xn, generateExecuteAstNodeData as _n, getObjectValue as yn, SetFormulaDataMutation as Fe, SetArrayFormulaDataMutation as At, initSheetFormulaData as ta, FunctionType as t, FUNCTION_NAMES_ARRAY as aa, FUNCTION_NAMES_COMPATIBILITY as _, FUNCTION_NAMES_CUBE as se, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as B, FUNCTION_NAMES_ENGINEERING as S, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as y, FUNCTION_NAMES_MATH as P, FUNCTION_NAMES_STATISTICAL as s, FUNCTION_NAMES_TEXT as D, FUNCTION_NAMES_WEB as st, IFunctionService as Bt, isReferenceStrings as qn, functionArray as gn, functionCompatibility as hn, functionCube as Un, functionDatabase as Fn, functionDate as Bn, functionEngineering as vn, functionFinancial as Vn, functionInformation as Gn, functionLogical as Hn, functionLookup as wn, functionMath as Yn, functionMeta as Xn, functionStatistical as Wn, functionText as Kn, functionUniver as kn, functionWeb as Qn, serializeRangeWithSpreadsheet as na, serializeRangeWithSheet as ia, CustomFunction as Ct, AsyncCustomFunction as qa, RemoveDefinedNameMutation as Dt, stripErrorMargin as $n, UniverFormulaEnginePlugin as ga } from "@univerjs/engine-formula";
|
|
7
7
|
import { Subject as ra, BehaviorSubject as ha, bufferWhen as jn, filter as oa, map as zn } from "rxjs";
|
|
8
8
|
import { IRPCChannelService as Ua, fromModule as Zn, toModule as Jn } from "@univerjs/rpc";
|
|
9
9
|
const ei = {
|
|
@@ -45,13 +45,13 @@ const ei = {
|
|
|
45
45
|
const o = n.range, { worksheet: u } = r;
|
|
46
46
|
let m = Ja(o, u);
|
|
47
47
|
if (!m) return !1;
|
|
48
|
-
m =
|
|
48
|
+
m = ct(m, u);
|
|
49
49
|
const f = en({
|
|
50
50
|
startRow: m.startRow,
|
|
51
51
|
startColumn: m.startColumn,
|
|
52
52
|
endRow: o.endRow,
|
|
53
53
|
endColumn: o.endColumn
|
|
54
|
-
}, { left: !0, right: !0, up: !0, down: !0 }, u), c = new Y(), d =
|
|
54
|
+
}, { left: !0, right: !0, up: !0, down: !0 }, u), c = new Y(), d = ct({
|
|
55
55
|
startRow: f.endRow,
|
|
56
56
|
endRow: f.endRow,
|
|
57
57
|
startColumn: f.startColumn,
|
|
@@ -60,14 +60,14 @@ const ei = {
|
|
|
60
60
|
if (!fe.equals(d, f))
|
|
61
61
|
for (const E of u.iterateByColumn(d))
|
|
62
62
|
(!E.value || !u.cellHasValue(E.value)) && c.setValue(E.row, E.col, {
|
|
63
|
-
f: `=SUM(${
|
|
63
|
+
f: `=SUM(${Ke({
|
|
64
64
|
startColumn: E.col,
|
|
65
65
|
endColumn: E.col,
|
|
66
66
|
startRow: f.startRow,
|
|
67
67
|
endRow: E.row - 1
|
|
68
68
|
})})`
|
|
69
69
|
});
|
|
70
|
-
const T =
|
|
70
|
+
const T = ct({
|
|
71
71
|
startRow: f.startRow,
|
|
72
72
|
startColumn: f.endColumn,
|
|
73
73
|
endRow: f.endRow,
|
|
@@ -76,7 +76,7 @@ const ei = {
|
|
|
76
76
|
if (!fe.equals(T, f))
|
|
77
77
|
for (const E of u.iterateByRow(T))
|
|
78
78
|
(!E.value || !u.cellHasValue(E.value)) && c.setValue(E.row, E.col, {
|
|
79
|
-
f: `=SUM(${
|
|
79
|
+
f: `=SUM(${Ke({
|
|
80
80
|
startColumn: f.startColumn,
|
|
81
81
|
endColumn: E.col - 1,
|
|
82
82
|
startRow: E.row,
|
|
@@ -106,7 +106,7 @@ const ei = {
|
|
|
106
106
|
}
|
|
107
107
|
], L)).result;
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, Me = {
|
|
110
110
|
type: xt.MUTATION,
|
|
111
111
|
id: "sheet.mutation.data-validation-formula-mark-dirty",
|
|
112
112
|
handler() {
|
|
@@ -117,7 +117,7 @@ function ai(a, e, n) {
|
|
|
117
117
|
var i;
|
|
118
118
|
return a == null || a[e] == null || ((i = a[e]) == null ? void 0 : i[n]) == null;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function dt(a, e, n) {
|
|
121
121
|
var i;
|
|
122
122
|
if (n) {
|
|
123
123
|
if (a && a[e] && ((i = a[e]) != null && i[n]))
|
|
@@ -154,7 +154,7 @@ function ri(a, e) {
|
|
|
154
154
|
if (f.forValue((l, N, R) => {
|
|
155
155
|
if (R == null)
|
|
156
156
|
return !0;
|
|
157
|
-
const p =
|
|
157
|
+
const p = mt(R);
|
|
158
158
|
p !== null && (d.setValue(l, N, p), T.setValue(l, N, c.getValue(l, N)));
|
|
159
159
|
}), d.getSizeOf() === 0)
|
|
160
160
|
return;
|
|
@@ -163,7 +163,7 @@ function ri(a, e) {
|
|
|
163
163
|
unitId: r,
|
|
164
164
|
cellValue: d.getMatrix()
|
|
165
165
|
}, E = {
|
|
166
|
-
id:
|
|
166
|
+
id: te.id,
|
|
167
167
|
params: L
|
|
168
168
|
};
|
|
169
169
|
i.push(E);
|
|
@@ -172,7 +172,7 @@ function ri(a, e) {
|
|
|
172
172
|
unitId: r,
|
|
173
173
|
cellValue: T.getMatrix()
|
|
174
174
|
}, A = {
|
|
175
|
-
id:
|
|
175
|
+
id: te.id,
|
|
176
176
|
params: I
|
|
177
177
|
};
|
|
178
178
|
n.push(A);
|
|
@@ -198,7 +198,7 @@ function oi(a, e, n) {
|
|
|
198
198
|
unitId: m,
|
|
199
199
|
cellValue: i[m][f]
|
|
200
200
|
}, d = {
|
|
201
|
-
id:
|
|
201
|
+
id: te.id,
|
|
202
202
|
params: c
|
|
203
203
|
};
|
|
204
204
|
o.push(d);
|
|
@@ -212,7 +212,7 @@ function oi(a, e, n) {
|
|
|
212
212
|
unitId: m,
|
|
213
213
|
cellValue: r[m][f]
|
|
214
214
|
}, d = {
|
|
215
|
-
id:
|
|
215
|
+
id: te.id,
|
|
216
216
|
params: c
|
|
217
217
|
};
|
|
218
218
|
u.push(d);
|
|
@@ -356,7 +356,7 @@ function Li(a, e) {
|
|
|
356
356
|
const n = Oa(
|
|
357
357
|
{
|
|
358
358
|
id: G.InsertRowCommandId,
|
|
359
|
-
params: { range: a, unitId: "", subUnitId: "", direction:
|
|
359
|
+
params: { range: a, unitId: "", subUnitId: "", direction: Ye.DOWN }
|
|
360
360
|
},
|
|
361
361
|
e
|
|
362
362
|
);
|
|
@@ -366,7 +366,7 @@ function Pi(a, e) {
|
|
|
366
366
|
const n = ba(
|
|
367
367
|
{
|
|
368
368
|
id: G.InsertColCommandId,
|
|
369
|
-
params: { range: a, unitId: "", subUnitId: "", direction:
|
|
369
|
+
params: { range: a, unitId: "", subUnitId: "", direction: Ye.RIGHT }
|
|
370
370
|
},
|
|
371
371
|
e
|
|
372
372
|
);
|
|
@@ -435,7 +435,7 @@ function Si(a, e) {
|
|
|
435
435
|
function Ai(a, e, n) {
|
|
436
436
|
const i = new Y({});
|
|
437
437
|
return a.forEach((r) => {
|
|
438
|
-
const { oldCell: o, newCell: u } = r, { startRow: m, startColumn: f } = o, c = n.getValue(m, f) || e.getValue(m, f), d =
|
|
438
|
+
const { oldCell: o, newCell: u } = r, { startRow: m, startColumn: f } = o, c = n.getValue(m, f) || e.getValue(m, f), d = mt(c);
|
|
439
439
|
if (i.setValue(m, f, { f: null, si: null }), u) {
|
|
440
440
|
const { startRow: T, startColumn: L } = u;
|
|
441
441
|
i.setValue(T, L, d);
|
|
@@ -445,7 +445,7 @@ function Ai(a, e, n) {
|
|
|
445
445
|
function Ci(a, e) {
|
|
446
446
|
const n = new Y({});
|
|
447
447
|
return a.reverse().forEach((i) => {
|
|
448
|
-
const { oldCell: r, newCell: o } = i, { startRow: u, startColumn: m } = r, f = e.getValue(u, m), c =
|
|
448
|
+
const { oldCell: r, newCell: o } = i, { startRow: u, startColumn: m } = r, f = e.getValue(u, m), c = mt(f);
|
|
449
449
|
if (o) {
|
|
450
450
|
const { startRow: d, startColumn: T } = o;
|
|
451
451
|
n.setValue(d, T, { f: null, si: null });
|
|
@@ -453,10 +453,10 @@ function Ci(a, e) {
|
|
|
453
453
|
n.setValue(u, m, c);
|
|
454
454
|
}), n.getMatrix();
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function mt(a) {
|
|
457
457
|
if (a == null)
|
|
458
458
|
return;
|
|
459
|
-
const { f: e, si: n, x: i = 0, y: r = 0 } = a, o =
|
|
459
|
+
const { f: e, si: n, x: i = 0, y: r = 0 } = a, o = xe(e), u = la(n);
|
|
460
460
|
if (!o && !u)
|
|
461
461
|
return {
|
|
462
462
|
f: null,
|
|
@@ -468,12 +468,12 @@ function ot(a) {
|
|
|
468
468
|
function Di(a) {
|
|
469
469
|
const e = new Y({});
|
|
470
470
|
return new Y(a).forValue((i, r, o) => {
|
|
471
|
-
const u =
|
|
471
|
+
const u = mt(o);
|
|
472
472
|
u && e.setValue(i, r, u);
|
|
473
473
|
}), e.getMatrix();
|
|
474
474
|
}
|
|
475
475
|
function Fa(a) {
|
|
476
|
-
const e = (a == null ? void 0 : a.f) || "", n = (a == null ? void 0 : a.si) || "", i =
|
|
476
|
+
const e = (a == null ? void 0 : a.f) || "", n = (a == null ? void 0 : a.si) || "", i = xe(e), r = la(n);
|
|
477
477
|
return !!(i || r);
|
|
478
478
|
}
|
|
479
479
|
function Ba(a, e, n, i, r, o) {
|
|
@@ -495,7 +495,7 @@ function va(a, e, n = 0, i = 0) {
|
|
|
495
495
|
const { token: f } = m, c = pe(f), { range: d, sheetName: T, unitId: L } = c, E = fe.moveOffset(d, n, i);
|
|
496
496
|
r.push({
|
|
497
497
|
...m,
|
|
498
|
-
token:
|
|
498
|
+
token: ot({
|
|
499
499
|
range: E,
|
|
500
500
|
unitId: L,
|
|
501
501
|
sheetName: T
|
|
@@ -527,7 +527,7 @@ function Va(a, e, n, i) {
|
|
|
527
527
|
if (r === q.MoveRange) {
|
|
528
528
|
if (f == null || c == null)
|
|
529
529
|
return;
|
|
530
|
-
const R =
|
|
530
|
+
const R = Lt(l, f), p = we(l, f);
|
|
531
531
|
if (p == null || R !== 4)
|
|
532
532
|
return;
|
|
533
533
|
const O = Ia(
|
|
@@ -536,12 +536,12 @@ function Va(a, e, n, i) {
|
|
|
536
536
|
), M = H(O, p);
|
|
537
537
|
if (M == null)
|
|
538
538
|
return j.REF;
|
|
539
|
-
N =
|
|
539
|
+
N = pt(R, M, f, c, l, p);
|
|
540
540
|
} else if (r === q.MoveRows) {
|
|
541
541
|
if (f == null || c == null)
|
|
542
542
|
return;
|
|
543
|
-
const R =
|
|
544
|
-
let p =
|
|
543
|
+
const R = Lt(l, f);
|
|
544
|
+
let p = we(l, f);
|
|
545
545
|
if (p == null && (f.endRow < l.startRow && c.endRow < l.startRow || f.startRow > l.endRow && c.startRow > l.endRow))
|
|
546
546
|
return;
|
|
547
547
|
p == null && (p = {
|
|
@@ -557,12 +557,12 @@ function Va(a, e, n, i) {
|
|
|
557
557
|
), M = H(O, p);
|
|
558
558
|
if (M == null)
|
|
559
559
|
return j.REF;
|
|
560
|
-
N =
|
|
560
|
+
N = pt(R, M, f, c, l, p);
|
|
561
561
|
} else if (r === q.MoveCols) {
|
|
562
562
|
if (f == null || c == null)
|
|
563
563
|
return;
|
|
564
|
-
const R =
|
|
565
|
-
let p =
|
|
564
|
+
const R = Lt(l, f);
|
|
565
|
+
let p = we(l, f);
|
|
566
566
|
if (p == null && (f.endColumn < l.startColumn && c.endColumn < l.startColumn || f.startColumn > l.endColumn && c.startColumn > l.endColumn))
|
|
567
567
|
return;
|
|
568
568
|
p == null && (p = {
|
|
@@ -578,14 +578,14 @@ function Va(a, e, n, i) {
|
|
|
578
578
|
), M = H(O, p);
|
|
579
579
|
if (M == null)
|
|
580
580
|
return j.REF;
|
|
581
|
-
N =
|
|
581
|
+
N = pt(R, M, f, c, l, p);
|
|
582
582
|
}
|
|
583
583
|
if (m != null) {
|
|
584
584
|
if (r === q.InsertRow) {
|
|
585
585
|
const R = Oa(
|
|
586
586
|
{
|
|
587
587
|
id: G.InsertRowCommandId,
|
|
588
|
-
params: { range: m, unitId: "", subUnitId: "", direction:
|
|
588
|
+
params: { range: m, unitId: "", subUnitId: "", direction: Ye.DOWN }
|
|
589
589
|
},
|
|
590
590
|
l
|
|
591
591
|
), p = H(R, l);
|
|
@@ -599,7 +599,7 @@ function Va(a, e, n, i) {
|
|
|
599
599
|
const R = ba(
|
|
600
600
|
{
|
|
601
601
|
id: G.InsertColCommandId,
|
|
602
|
-
params: { range: m, unitId: "", subUnitId: "", direction:
|
|
602
|
+
params: { range: m, unitId: "", subUnitId: "", direction: Ye.RIGHT }
|
|
603
603
|
},
|
|
604
604
|
l
|
|
605
605
|
), p = H(R, l);
|
|
@@ -696,35 +696,35 @@ function Va(a, e, n, i) {
|
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
if (N != null)
|
|
699
|
-
return
|
|
699
|
+
return ot({
|
|
700
700
|
range: N,
|
|
701
701
|
sheetName: E,
|
|
702
702
|
unitId: L
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
const { startRow: u, endRow: m, startColumn: f, endColumn: c, rangeType: d } =
|
|
705
|
+
function pt(a, e, n, i, r, o) {
|
|
706
|
+
const { startRow: u, endRow: m, startColumn: f, endColumn: c, rangeType: d } = Oe(e), {
|
|
707
707
|
startRow: T,
|
|
708
708
|
startColumn: L,
|
|
709
709
|
endRow: E,
|
|
710
710
|
endColumn: I,
|
|
711
711
|
rangeType: A = w.NORMAL
|
|
712
|
-
} =
|
|
712
|
+
} = Oe(n), { startRow: l, startColumn: N, endRow: R, endColumn: p } = Oe(i), {
|
|
713
713
|
startRow: O,
|
|
714
714
|
endRow: M,
|
|
715
715
|
startColumn: F,
|
|
716
716
|
endColumn: U
|
|
717
|
-
} =
|
|
717
|
+
} = Oe(o), {
|
|
718
718
|
startRow: g,
|
|
719
719
|
endRow: x,
|
|
720
720
|
startColumn: h,
|
|
721
721
|
endColumn: V,
|
|
722
722
|
rangeType: Q = w.NORMAL
|
|
723
|
-
} =
|
|
723
|
+
} = Oe(r), b = { ...r };
|
|
724
724
|
function Pe() {
|
|
725
725
|
return d === w.COLUMN && Q === w.COLUMN ? !0 : f >= h && c <= V;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function ne() {
|
|
728
728
|
return d === w.ROW && Q === w.ROW ? !0 : u >= g && m <= x;
|
|
729
729
|
}
|
|
730
730
|
if (a === 0)
|
|
@@ -748,7 +748,7 @@ function dt(a, e, n, i, r, o) {
|
|
|
748
748
|
else
|
|
749
749
|
return;
|
|
750
750
|
else if (a === 2)
|
|
751
|
-
if (
|
|
751
|
+
if (ne())
|
|
752
752
|
if (f < h)
|
|
753
753
|
b.startColumn = f;
|
|
754
754
|
else if (f >= V)
|
|
@@ -758,7 +758,7 @@ function dt(a, e, n, i, r, o) {
|
|
|
758
758
|
else
|
|
759
759
|
return;
|
|
760
760
|
else if (a === 3)
|
|
761
|
-
if (
|
|
761
|
+
if (ne())
|
|
762
762
|
if (c > V)
|
|
763
763
|
b.endColumn = c;
|
|
764
764
|
else if (c <= h)
|
|
@@ -770,7 +770,7 @@ function dt(a, e, n, i, r, o) {
|
|
|
770
770
|
else a === 4 ? (b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c) : L <= h && I >= V || A === w.ROW && Q === w.ROW ? n.endRow < g ? (l >= g && (b.startRow -= E - T + 1), l >= x && (b.endRow -= E - T + 1)) : n.startRow > x ? (R <= x && (b.endRow += E - T + 1), R <= g && (b.startRow += E - T + 1)) : n.startRow >= g && n.endRow <= x && (l <= g ? b.startRow += E - T + 1 : l >= x && (b.endRow -= E - T + 1)) : T <= g && E >= x || A === w.COLUMN && Q === w.COLUMN ? n.endColumn < h ? (N >= h && (b.startColumn -= I - L + 1), N >= V && (b.endColumn -= I - L + 1)) : n.startColumn > V ? (p <= V && (b.endColumn += I - L + 1), p <= h && (b.startColumn += I - L + 1)) : n.startColumn >= h && n.endColumn <= V && (N <= h ? b.startColumn += I - L + 1 : N >= V && (b.endColumn -= I - L + 1)) : ((N <= U + 1 && p >= V || N <= h && p >= F - 1) && l <= g && R >= x || (l <= M + 1 && R >= x || l <= g && R >= O - 1) && N <= h && p >= V, b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = c);
|
|
771
771
|
return b;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Lt(a, e) {
|
|
774
774
|
const n = Re(a.startRow), i = Se(a.endRow), r = Re(a.startColumn), o = Se(a.endColumn), u = Re(e.startRow), m = Se(e.endRow), f = Re(e.startColumn), c = Se(e.endColumn);
|
|
775
775
|
function d() {
|
|
776
776
|
return a.rangeType === w.COLUMN && e.rangeType === w.COLUMN ? !0 : n >= u && i <= m;
|
|
@@ -789,7 +789,7 @@ function Re(a) {
|
|
|
789
789
|
function Se(a) {
|
|
790
790
|
return isNaN(a) ? 1 / 0 : a;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function Oe(a) {
|
|
793
793
|
const { startRow: e, endRow: n, startColumn: i, endColumn: r } = a;
|
|
794
794
|
return {
|
|
795
795
|
...a,
|
|
@@ -1068,8 +1068,8 @@ var Hi = Object.getOwnPropertyDescriptor, wi = (a, e, n, i) => {
|
|
|
1068
1068
|
for (var r = i > 1 ? void 0 : i ? Hi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
1069
1069
|
(u = a[o]) && (r = u(r) || r);
|
|
1070
1070
|
return r;
|
|
1071
|
-
},
|
|
1072
|
-
let
|
|
1071
|
+
}, Be = (a, e) => (n, i) => e(n, i, a);
|
|
1072
|
+
let Qe = class extends ae {
|
|
1073
1073
|
constructor(a, e, n, i) {
|
|
1074
1074
|
super(), this._definedNamesService = a, this._univerInstanceService = e, this._sheetInterceptorService = n, this._lexerTreeBuilder = i, this._initialize();
|
|
1075
1075
|
}
|
|
@@ -1138,7 +1138,7 @@ let Ke = class extends te {
|
|
|
1138
1138
|
} = e;
|
|
1139
1139
|
if (b == null || x == null || x.length === 0 || Q !== x)
|
|
1140
1140
|
continue;
|
|
1141
|
-
V =
|
|
1141
|
+
V = ot({
|
|
1142
1142
|
range: F,
|
|
1143
1143
|
sheetName: b,
|
|
1144
1144
|
unitId: g
|
|
@@ -1157,8 +1157,8 @@ let Ke = class extends te {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
if (!T)
|
|
1159
1159
|
return !0;
|
|
1160
|
-
const E =
|
|
1161
|
-
id:
|
|
1160
|
+
const E = ke(va(d, L)), I = {
|
|
1161
|
+
id: ye.id,
|
|
1162
1162
|
params: {
|
|
1163
1163
|
unitId: i,
|
|
1164
1164
|
...f,
|
|
@@ -1167,7 +1167,7 @@ let Ke = class extends te {
|
|
|
1167
1167
|
};
|
|
1168
1168
|
u.push(I);
|
|
1169
1169
|
const A = {
|
|
1170
|
-
id:
|
|
1170
|
+
id: ye.id,
|
|
1171
1171
|
params: {
|
|
1172
1172
|
unitId: i,
|
|
1173
1173
|
...f
|
|
@@ -1185,18 +1185,18 @@ let Ke = class extends te {
|
|
|
1185
1185
|
return ((o = this._definedNamesService.getWorksheetByRef(e, i)) == null ? void 0 : o.getSheetId()) === n ? j.REF : null;
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
],
|
|
1188
|
+
Qe = wi([
|
|
1189
|
+
Be(0, ht),
|
|
1190
|
+
Be(1, Ce),
|
|
1191
|
+
Be(2, X(qt)),
|
|
1192
|
+
Be(3, X(Ut))
|
|
1193
|
+
], Qe);
|
|
1194
1194
|
var Ne = /* @__PURE__ */ ((a) => (a[a.NOT_REGISTER = 1] = "NOT_REGISTER", a[a.SUCCESS = 2] = "SUCCESS", a[a.WAIT = 3] = "WAIT", a[a.ERROR = 4] = "ERROR", a))(Ne || {}), Yi = Object.getOwnPropertyDescriptor, Xi = (a, e, n, i) => {
|
|
1195
1195
|
for (var r = i > 1 ? void 0 : i ? Yi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
1196
1196
|
(u = a[o]) && (r = u(r) || r);
|
|
1197
1197
|
return r;
|
|
1198
|
-
},
|
|
1199
|
-
let
|
|
1198
|
+
}, Pt = (a, e) => (n, i) => e(n, i, a);
|
|
1199
|
+
let $e = class extends ae {
|
|
1200
1200
|
constructor(e, n, i) {
|
|
1201
1201
|
super();
|
|
1202
1202
|
W(this, "_formulaCacheMap", /* @__PURE__ */ new Map());
|
|
@@ -1222,9 +1222,9 @@ let ke = class extends te {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
_initFormulaRegister() {
|
|
1224
1224
|
this._activeDirtyManagerService.register(
|
|
1225
|
-
|
|
1225
|
+
Me.id,
|
|
1226
1226
|
{
|
|
1227
|
-
commandId:
|
|
1227
|
+
commandId: Me.id,
|
|
1228
1228
|
getDirtyData(n) {
|
|
1229
1229
|
return {
|
|
1230
1230
|
dirtyUnitOtherFormulaMap: n.params
|
|
@@ -1248,7 +1248,7 @@ let ke = class extends te {
|
|
|
1248
1248
|
};
|
|
1249
1249
|
this._commandService.executeCommand(Cn.id, c).then(() => {
|
|
1250
1250
|
this._commandService.executeCommand(
|
|
1251
|
-
|
|
1251
|
+
Me.id,
|
|
1252
1252
|
{ [i]: { [r]: { [u]: !0 } } }
|
|
1253
1253
|
);
|
|
1254
1254
|
});
|
|
@@ -1330,17 +1330,17 @@ let ke = class extends te {
|
|
|
1330
1330
|
markFormulaDirty(e, n, i) {
|
|
1331
1331
|
const r = this.getFormulaValueSync(e, n, i);
|
|
1332
1332
|
r && (r.status = Ne.WAIT, this._commandService.executeCommand(
|
|
1333
|
-
|
|
1333
|
+
Me.id,
|
|
1334
1334
|
{ [e]: { [n]: { [i]: !0 } } }
|
|
1335
1335
|
));
|
|
1336
1336
|
}
|
|
1337
1337
|
};
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
],
|
|
1343
|
-
const
|
|
1338
|
+
$e = Xi([
|
|
1339
|
+
Pt(0, ce),
|
|
1340
|
+
Pt(1, Ft),
|
|
1341
|
+
Pt(2, X(Ka))
|
|
1342
|
+
], $e);
|
|
1343
|
+
const qe = "sheets-formula.base.config";
|
|
1344
1344
|
var Le = /* @__PURE__ */ ((a) => (a[a.FORCED = 0] = "FORCED", a[a.WHEN_EMPTY = 1] = "WHEN_EMPTY", a[a.NO_CALCULATION = 2] = "NO_CALCULATION", a))(Le || {});
|
|
1345
1345
|
const ua = {}, Wi = "sheets-formula.remote.config", ma = {};
|
|
1346
1346
|
var Ki = Object.getOwnPropertyDescriptor, ki = (a, e, n, i) => {
|
|
@@ -1348,8 +1348,8 @@ var Ki = Object.getOwnPropertyDescriptor, ki = (a, e, n, i) => {
|
|
|
1348
1348
|
(u = a[o]) && (r = u(r) || r);
|
|
1349
1349
|
return r;
|
|
1350
1350
|
}, de = (a, e) => (n, i) => e(n, i, a);
|
|
1351
|
-
const fa = { done: 0, count: 0 },
|
|
1352
|
-
let
|
|
1351
|
+
const fa = { done: 0, count: 0 }, Tt = { onlyLocal: !0 };
|
|
1352
|
+
let _e = class extends ae {
|
|
1353
1353
|
constructor(e, n, i, r, o, u, m) {
|
|
1354
1354
|
super();
|
|
1355
1355
|
W(this, "_waitingCommandQueue", []);
|
|
@@ -1405,7 +1405,7 @@ let xe = class extends te {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
_getCalculationMode() {
|
|
1407
1407
|
var n;
|
|
1408
|
-
const e = this._configService.getConfig(
|
|
1408
|
+
const e = this._configService.getConfig(qe);
|
|
1409
1409
|
return (n = e == null ? void 0 : e.initialFormulaComputing) != null ? n : Le.WHEN_EMPTY;
|
|
1410
1410
|
}
|
|
1411
1411
|
_commandExecutedListener() {
|
|
@@ -1419,14 +1419,14 @@ let xe = class extends te {
|
|
|
1419
1419
|
), this.disposeWithMe(
|
|
1420
1420
|
this._commandService.onCommandExecuted((e, n) => {
|
|
1421
1421
|
if (this._activeDirtyManagerService.get(e.id)) {
|
|
1422
|
-
if (e.id ===
|
|
1422
|
+
if (e.id === te.id) {
|
|
1423
1423
|
const i = e.params;
|
|
1424
1424
|
if (n && n.onlyLocal === !0 || i.trigger === gt.id || i.trigger === _a.id || i.trigger === ya.id)
|
|
1425
1425
|
return;
|
|
1426
1426
|
}
|
|
1427
1427
|
this._waitingCommandQueue.push(e), clearTimeout(this._setTimeoutKey), this._setTimeoutKey = setTimeout(() => {
|
|
1428
1428
|
const i = this._generateDirty(this._waitingCommandQueue);
|
|
1429
|
-
this._executingDirtyData = this._mergeDirty(this._executingDirtyData, i), this._executionInProgressParams == null ? this._commandService.executeCommand(Ie.id, { ...this._executingDirtyData },
|
|
1429
|
+
this._executingDirtyData = this._mergeDirty(this._executingDirtyData, i), this._executionInProgressParams == null ? this._commandService.executeCommand(Ie.id, { ...this._executingDirtyData }, Tt) : (this._restartCalculation = !0, this._commandService.executeCommand(Jt.id, {})), this._waitingCommandQueue = [];
|
|
1430
1430
|
}, 100);
|
|
1431
1431
|
}
|
|
1432
1432
|
})
|
|
@@ -1521,21 +1521,21 @@ let xe = class extends te {
|
|
|
1521
1521
|
const {
|
|
1522
1522
|
stage: o
|
|
1523
1523
|
} = r.stageInfo;
|
|
1524
|
-
if (o ===
|
|
1524
|
+
if (o === Ue.START)
|
|
1525
1525
|
n === 0 && (this._startExecutionTime = performance.now()), n++, e !== null && (clearTimeout(e), e = null), e = setTimeout(() => {
|
|
1526
1526
|
e = null, this._startProgress();
|
|
1527
1527
|
}, 1e3);
|
|
1528
|
-
else if (o ===
|
|
1528
|
+
else if (o === Ue.CURRENTLY_CALCULATING) {
|
|
1529
1529
|
if (this._executionInProgressParams = r.stageInfo, e === null) {
|
|
1530
1530
|
const u = this._localeService.t("formula.progress.calculating");
|
|
1531
1531
|
this._calculateProgress(u);
|
|
1532
1532
|
}
|
|
1533
|
-
} else if (o ===
|
|
1533
|
+
} else if (o === Ue.START_DEPENDENCY_ARRAY_FORMULA) {
|
|
1534
1534
|
if (this._executionInProgressParams = r.stageInfo, e === null) {
|
|
1535
1535
|
const u = this._localeService.t("formula.progress.array-analysis");
|
|
1536
1536
|
this._calculateProgress(u);
|
|
1537
1537
|
}
|
|
1538
|
-
} else if (o ===
|
|
1538
|
+
} else if (o === Ue.CURRENTLY_CALCULATING_ARRAY_FORMULA && (this._executionInProgressParams = r.stageInfo, e === null)) {
|
|
1539
1539
|
const u = this._localeService.t("formula.progress.array-calculation");
|
|
1540
1540
|
this._calculateProgress(u);
|
|
1541
1541
|
}
|
|
@@ -1543,25 +1543,25 @@ let xe = class extends te {
|
|
|
1543
1543
|
const o = r.functionsExecutedState;
|
|
1544
1544
|
let u = "";
|
|
1545
1545
|
switch (n--, o) {
|
|
1546
|
-
case
|
|
1546
|
+
case be.NOT_EXECUTED:
|
|
1547
1547
|
u = "No tasks are being executed anymore", this._resetExecutingDirtyData();
|
|
1548
1548
|
break;
|
|
1549
|
-
case
|
|
1549
|
+
case be.STOP_EXECUTION:
|
|
1550
1550
|
u = "The execution of the formula has been stopped", n = 0;
|
|
1551
1551
|
break;
|
|
1552
|
-
case
|
|
1552
|
+
case be.SUCCESS:
|
|
1553
1553
|
u = "Formula calculation succeeded", (n === 0 || n === -1) && (u += `. Total time consumed: ${performance.now() - this._startExecutionTime} ms`), this._resetExecutingDirtyData();
|
|
1554
1554
|
break;
|
|
1555
|
-
case
|
|
1555
|
+
case be.INITIAL:
|
|
1556
1556
|
u = "Waiting for calculation", this._resetExecutingDirtyData();
|
|
1557
1557
|
break;
|
|
1558
1558
|
}
|
|
1559
|
-
(n === 0 || n === -1) && (e ? (clearTimeout(e), e = null, this.clearProgress()) : this._completeProgress(), n = 0, this._doneCalculationTaskCount = 0, this._totalCalculationTaskCount = 0, this._forceCalculating = !1), o ===
|
|
1559
|
+
(n === 0 || n === -1) && (e ? (clearTimeout(e), e = null, this.clearProgress()) : this._completeProgress(), n = 0, this._doneCalculationTaskCount = 0, this._totalCalculationTaskCount = 0, this._forceCalculating = !1), o === be.STOP_EXECUTION && this._restartCalculation ? (this._restartCalculation = !1, this._commandService.executeCommand(
|
|
1560
1560
|
Ie.id,
|
|
1561
1561
|
{
|
|
1562
1562
|
...this._executingDirtyData
|
|
1563
1563
|
},
|
|
1564
|
-
|
|
1564
|
+
Tt
|
|
1565
1565
|
)) : this._executionInProgressParams = null, this._logService.debug("[TriggerCalculationController]", u);
|
|
1566
1566
|
}
|
|
1567
1567
|
})
|
|
@@ -1580,7 +1580,7 @@ let xe = class extends te {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
_initialExecuteFormula() {
|
|
1582
1582
|
const e = this._getCalculationMode(), n = this._getDirtyDataByCalculationMode(e);
|
|
1583
|
-
this._commandService.executeCommand(Ie.id, n,
|
|
1583
|
+
this._commandService.executeCommand(Ie.id, n, Tt), this._registerOtherFormulaService.calculateStarted$.next(!0);
|
|
1584
1584
|
}
|
|
1585
1585
|
_getDirtyDataByCalculationMode(e) {
|
|
1586
1586
|
const n = e === Le.FORCED, i = e === Le.WHEN_EMPTY ? this._formulaDataModel.getFormulaDirtyRanges() : [];
|
|
@@ -1596,15 +1596,15 @@ let xe = class extends te {
|
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
1598
|
};
|
|
1599
|
-
|
|
1599
|
+
_e = ki([
|
|
1600
1600
|
de(0, ce),
|
|
1601
1601
|
de(1, Ft),
|
|
1602
1602
|
de(2, ka),
|
|
1603
|
-
de(3,
|
|
1604
|
-
de(4, X(
|
|
1603
|
+
de(3, De),
|
|
1604
|
+
de(4, X(ut)),
|
|
1605
1605
|
de(5, X(_t)),
|
|
1606
|
-
de(6, X(
|
|
1607
|
-
],
|
|
1606
|
+
de(6, X($e))
|
|
1607
|
+
], _e);
|
|
1608
1608
|
function Xr(a, e, n, i) {
|
|
1609
1609
|
const r = a.get(bn), o = a.get(On), u = a.get(Mn), m = a.get(xn);
|
|
1610
1610
|
r.load({
|
|
@@ -1630,7 +1630,7 @@ var Qi = Object.getOwnPropertyDescriptor, $i = (a, e, n, i) => {
|
|
|
1630
1630
|
(u = a[o]) && (r = u(r) || r);
|
|
1631
1631
|
return r;
|
|
1632
1632
|
}, me = (a, e) => (n, i) => e(n, i, a);
|
|
1633
|
-
let
|
|
1633
|
+
let je = class extends ae {
|
|
1634
1634
|
constructor(a, e, n, i, r, o, u, m) {
|
|
1635
1635
|
super(), this._univerInstanceService = a, this._commandService = e, this._lexerTreeBuilder = n, this._formulaDataModel = i, this._sheetInterceptorService = r, this._definedNamesService = o, this._configService = u, this._injector = m, this._commandExecutedListener();
|
|
1636
1636
|
}
|
|
@@ -1647,7 +1647,7 @@ let Qe = class extends te {
|
|
|
1647
1647
|
})
|
|
1648
1648
|
), this.disposeWithMe(
|
|
1649
1649
|
this._commandService.beforeCommandExecuted((a, e) => {
|
|
1650
|
-
if (a.id ===
|
|
1650
|
+
if (a.id === te.id) {
|
|
1651
1651
|
const n = a.params;
|
|
1652
1652
|
if (e && e.onlyLocal === !0 || n.trigger === gt.id || n.trigger === _a.id || n.trigger === ya.id)
|
|
1653
1653
|
return;
|
|
@@ -1666,7 +1666,7 @@ let Qe = class extends te {
|
|
|
1666
1666
|
}
|
|
1667
1667
|
};
|
|
1668
1668
|
this._commandService.executeCommand(
|
|
1669
|
-
|
|
1669
|
+
te.id,
|
|
1670
1670
|
{
|
|
1671
1671
|
unitId: n,
|
|
1672
1672
|
subUnitId: e,
|
|
@@ -1677,7 +1677,7 @@ let Qe = class extends te {
|
|
|
1677
1677
|
fromFormula: !0
|
|
1678
1678
|
}
|
|
1679
1679
|
), this._formulaDataModel.updateArrayFormulaCellData(n, e, i), this._formulaDataModel.updateArrayFormulaRange(n, e, i), this._commandService.executeCommand(
|
|
1680
|
-
|
|
1680
|
+
Fe.id,
|
|
1681
1681
|
{
|
|
1682
1682
|
formulaData: o
|
|
1683
1683
|
},
|
|
@@ -1698,9 +1698,9 @@ let Qe = class extends te {
|
|
|
1698
1698
|
);
|
|
1699
1699
|
}
|
|
1700
1700
|
_handleWorkbookDisposed(a, e) {
|
|
1701
|
-
const n = this._formulaDataModel.getFormulaData(), i =
|
|
1701
|
+
const n = this._formulaDataModel.getFormulaData(), i = dt(n, a, e), r = this._formulaDataModel.getArrayFormulaRange(), o = dt(r, a, e), u = this._formulaDataModel.getArrayFormulaCellData(), m = dt(u, a, e);
|
|
1702
1702
|
i && this._commandService.executeCommand(
|
|
1703
|
-
|
|
1703
|
+
Fe.id,
|
|
1704
1704
|
{
|
|
1705
1705
|
formulaData: i
|
|
1706
1706
|
},
|
|
@@ -1721,7 +1721,7 @@ let Qe = class extends te {
|
|
|
1721
1721
|
_handleInsertSheetMutation(a) {
|
|
1722
1722
|
const { sheet: e, unitId: n } = a, i = this._formulaDataModel.getFormulaData(), { id: r, cellData: o } = e, u = new Y(o), m = ta(i, n, r, u);
|
|
1723
1723
|
this._commandService.executeCommand(
|
|
1724
|
-
|
|
1724
|
+
Fe.id,
|
|
1725
1725
|
{
|
|
1726
1726
|
formulaData: m
|
|
1727
1727
|
},
|
|
@@ -1737,8 +1737,8 @@ let Qe = class extends te {
|
|
|
1737
1737
|
var E;
|
|
1738
1738
|
const d = c.getCellMatrix(), T = c.getSheetId(), L = ta(e, n, T, d);
|
|
1739
1739
|
i[n][T] = (E = L[n]) == null ? void 0 : E[T];
|
|
1740
|
-
}), this._commandService.executeCommand(
|
|
1741
|
-
const o = this._configService.getConfig(
|
|
1740
|
+
}), this._commandService.executeCommand(Fe.id, { formulaData: i }, { onlyLocal: !0 });
|
|
1741
|
+
const o = this._configService.getConfig(qe), u = (f = o == null ? void 0 : o.initialFormulaComputing) != null ? f : Le.WHEN_EMPTY, m = this._getDirtyDataByCalculationMode(u);
|
|
1742
1742
|
this._commandService.executeCommand(Ie.id, m, { onlyLocal: !0 });
|
|
1743
1743
|
}
|
|
1744
1744
|
_getDirtyDataByCalculationMode(a) {
|
|
@@ -1818,7 +1818,7 @@ let Qe = class extends te {
|
|
|
1818
1818
|
continue;
|
|
1819
1819
|
} else if (Q !== J.REFERENCE)
|
|
1820
1820
|
continue;
|
|
1821
|
-
const Pe = pe(V), { range:
|
|
1821
|
+
const Pe = pe(V), { range: ne, sheetName: re, unitId: k } = Pe, oe = k == null || k.length === 0 ? u : k, z = ((U = e == null ? void 0 : e[oe]) == null ? void 0 : U[re]) || "";
|
|
1822
1822
|
if (!Ba(
|
|
1823
1823
|
n.unitId,
|
|
1824
1824
|
n.sheetId,
|
|
@@ -1828,8 +1828,8 @@ let Qe = class extends te {
|
|
|
1828
1828
|
z
|
|
1829
1829
|
))
|
|
1830
1830
|
continue;
|
|
1831
|
-
const
|
|
1832
|
-
range:
|
|
1831
|
+
const ge = {
|
|
1832
|
+
range: ne,
|
|
1833
1833
|
sheetId: z,
|
|
1834
1834
|
unitId: k,
|
|
1835
1835
|
sheetName: re,
|
|
@@ -1845,8 +1845,8 @@ let Qe = class extends te {
|
|
|
1845
1845
|
} = n;
|
|
1846
1846
|
if (le == null || z == null || z.length === 0 || Ee !== z)
|
|
1847
1847
|
continue;
|
|
1848
|
-
ue =
|
|
1849
|
-
range:
|
|
1848
|
+
ue = ot({
|
|
1849
|
+
range: ne,
|
|
1850
1850
|
sheetName: le,
|
|
1851
1851
|
unitId: k
|
|
1852
1852
|
});
|
|
@@ -1860,7 +1860,7 @@ let Qe = class extends te {
|
|
|
1860
1860
|
continue;
|
|
1861
1861
|
ue = j.REF;
|
|
1862
1862
|
} else b !== q.SetDefinedName && (ue = Va(
|
|
1863
|
-
|
|
1863
|
+
ge,
|
|
1864
1864
|
n,
|
|
1865
1865
|
u,
|
|
1866
1866
|
c
|
|
@@ -1874,7 +1874,7 @@ let Qe = class extends te {
|
|
|
1874
1874
|
return !0;
|
|
1875
1875
|
const F = va(p, M, l, N);
|
|
1876
1876
|
T.setValue(L, E, {
|
|
1877
|
-
f: `=${
|
|
1877
|
+
f: `=${ke(F)}`
|
|
1878
1878
|
});
|
|
1879
1879
|
}), o[u] && (o[u][c] = T.getData());
|
|
1880
1880
|
}
|
|
@@ -1882,16 +1882,16 @@ let Qe = class extends te {
|
|
|
1882
1882
|
return { newFormulaData: o };
|
|
1883
1883
|
}
|
|
1884
1884
|
};
|
|
1885
|
-
|
|
1885
|
+
je = $i([
|
|
1886
1886
|
me(0, Ce),
|
|
1887
1887
|
me(1, ce),
|
|
1888
1888
|
me(2, X(Ut)),
|
|
1889
|
-
me(3, X(
|
|
1889
|
+
me(3, X(ut)),
|
|
1890
1890
|
me(4, X(qt)),
|
|
1891
1891
|
me(5, ht),
|
|
1892
|
-
me(6,
|
|
1893
|
-
me(7, X(
|
|
1894
|
-
],
|
|
1892
|
+
me(6, De),
|
|
1893
|
+
me(7, X(rt))
|
|
1894
|
+
], je);
|
|
1895
1895
|
const ji = [
|
|
1896
1896
|
{
|
|
1897
1897
|
functionName: aa.ARRAY_CONSTRAIN,
|
|
@@ -8663,17 +8663,17 @@ const ji = [
|
|
|
8663
8663
|
abstract: "formula.functionList.HYPERLINK.abstract",
|
|
8664
8664
|
functionParameter: [
|
|
8665
8665
|
{
|
|
8666
|
-
name: "formula.functionList.HYPERLINK.functionParameter.
|
|
8667
|
-
detail: "formula.functionList.HYPERLINK.functionParameter.
|
|
8668
|
-
example: "
|
|
8666
|
+
name: "formula.functionList.HYPERLINK.functionParameter.url.name",
|
|
8667
|
+
detail: "formula.functionList.HYPERLINK.functionParameter.url.detail",
|
|
8668
|
+
example: '"https://univer.ai/"',
|
|
8669
8669
|
require: 1,
|
|
8670
8670
|
repeat: 0
|
|
8671
8671
|
},
|
|
8672
8672
|
{
|
|
8673
|
-
name: "formula.functionList.HYPERLINK.functionParameter.
|
|
8674
|
-
detail: "formula.functionList.HYPERLINK.functionParameter.
|
|
8675
|
-
example: "
|
|
8676
|
-
require:
|
|
8673
|
+
name: "formula.functionList.HYPERLINK.functionParameter.linkLabel.name",
|
|
8674
|
+
detail: "formula.functionList.HYPERLINK.functionParameter.linkLabel.detail",
|
|
8675
|
+
example: '"Univer"',
|
|
8676
|
+
require: 0,
|
|
8677
8677
|
repeat: 0
|
|
8678
8678
|
}
|
|
8679
8679
|
]
|
|
@@ -15119,7 +15119,7 @@ const ji = [
|
|
|
15119
15119
|
}
|
|
15120
15120
|
], fr = [], cr = [
|
|
15121
15121
|
{
|
|
15122
|
-
functionName:
|
|
15122
|
+
functionName: st.ENCODEURL,
|
|
15123
15123
|
functionType: t.Web,
|
|
15124
15124
|
description: "formula.functionList.ENCODEURL.description",
|
|
15125
15125
|
abstract: "formula.functionList.ENCODEURL.abstract",
|
|
@@ -15134,7 +15134,7 @@ const ji = [
|
|
|
15134
15134
|
]
|
|
15135
15135
|
},
|
|
15136
15136
|
{
|
|
15137
|
-
functionName:
|
|
15137
|
+
functionName: st.FILTERXML,
|
|
15138
15138
|
functionType: t.Web,
|
|
15139
15139
|
description: "formula.functionList.FILTERXML.description",
|
|
15140
15140
|
abstract: "formula.functionList.FILTERXML.abstract",
|
|
@@ -15156,7 +15156,7 @@ const ji = [
|
|
|
15156
15156
|
]
|
|
15157
15157
|
},
|
|
15158
15158
|
{
|
|
15159
|
-
functionName:
|
|
15159
|
+
functionName: st.WEBSERVICE,
|
|
15160
15160
|
functionType: t.Web,
|
|
15161
15161
|
description: "formula.functionList.WEBSERVICE.description",
|
|
15162
15162
|
abstract: "formula.functionList.WEBSERVICE.abstract",
|
|
@@ -15202,7 +15202,7 @@ var dr = Object.getOwnPropertyDescriptor, pr = (a, e, n, i) => {
|
|
|
15202
15202
|
for (var r = i > 1 ? void 0 : i ? dr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15203
15203
|
(u = a[o]) && (r = u(r) || r);
|
|
15204
15204
|
return r;
|
|
15205
|
-
},
|
|
15205
|
+
}, Et = (a, e) => (n, i) => e(n, i, a);
|
|
15206
15206
|
const vt = yt("formula.description-service");
|
|
15207
15207
|
let bt = class {
|
|
15208
15208
|
constructor(a, e, n) {
|
|
@@ -15243,7 +15243,7 @@ let bt = class {
|
|
|
15243
15243
|
}), e;
|
|
15244
15244
|
}
|
|
15245
15245
|
registerDescriptions(a) {
|
|
15246
|
-
return this._descriptions = this._descriptions.concat(a), this._registerDescriptions(),
|
|
15246
|
+
return this._descriptions = this._descriptions.concat(a), this._registerDescriptions(), ie(() => {
|
|
15247
15247
|
const e = a.map((n) => n.functionName);
|
|
15248
15248
|
this.unregisterDescriptions(e);
|
|
15249
15249
|
});
|
|
@@ -15288,7 +15288,7 @@ let bt = class {
|
|
|
15288
15288
|
...Kn,
|
|
15289
15289
|
...kn,
|
|
15290
15290
|
...Qn
|
|
15291
|
-
].map((r) => r[1]), e = lr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(
|
|
15291
|
+
].map((r) => r[1]), e = lr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(qe);
|
|
15292
15292
|
this._descriptions = e.concat((i = n == null ? void 0 : n.description) != null ? i : []);
|
|
15293
15293
|
}
|
|
15294
15294
|
_registerDescriptions() {
|
|
@@ -15309,15 +15309,15 @@ let bt = class {
|
|
|
15309
15309
|
}
|
|
15310
15310
|
};
|
|
15311
15311
|
bt = pr([
|
|
15312
|
-
|
|
15313
|
-
|
|
15314
|
-
|
|
15312
|
+
Et(0, Bt),
|
|
15313
|
+
Et(1, X(_t)),
|
|
15314
|
+
Et(2, De)
|
|
15315
15315
|
], bt);
|
|
15316
15316
|
var Lr = Object.getOwnPropertyDescriptor, Pr = (a, e, n, i) => {
|
|
15317
15317
|
for (var r = i > 1 ? void 0 : i ? Lr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15318
15318
|
(u = a[o]) && (r = u(r) || r);
|
|
15319
15319
|
return r;
|
|
15320
|
-
},
|
|
15320
|
+
}, ve = (a, e) => (n, i) => e(n, i, a);
|
|
15321
15321
|
function ca(a, e, n, i) {
|
|
15322
15322
|
const r = a.sequenceNodesBuilder(e);
|
|
15323
15323
|
if (r == null)
|
|
@@ -15329,7 +15329,7 @@ function ca(a, e, n, i) {
|
|
|
15329
15329
|
continue;
|
|
15330
15330
|
const { token: c } = f, d = pe(c), { sheetName: T, unitId: L } = d;
|
|
15331
15331
|
let E = d.range;
|
|
15332
|
-
E.startAbsoluteRefType ===
|
|
15332
|
+
E.startAbsoluteRefType === We.ALL && E.endAbsoluteRefType === We.ALL || (E = Nt(E, n, i), o.push({
|
|
15333
15333
|
unitId: L,
|
|
15334
15334
|
sheetName: T,
|
|
15335
15335
|
range: E
|
|
@@ -15337,7 +15337,7 @@ function ca(a, e, n, i) {
|
|
|
15337
15337
|
}
|
|
15338
15338
|
return o.map((u) => `${u.unitId}!${u.sheetName}!${u.range.startRow}!${u.range.endRow}!${u.range.startColumn}!${u.range.endColumn}`).join("|");
|
|
15339
15339
|
}
|
|
15340
|
-
let Ot = class extends
|
|
15340
|
+
let Ot = class extends ae {
|
|
15341
15341
|
constructor(a, e, n, i) {
|
|
15342
15342
|
super(), this._refRangeService = a, this._lexerTreeBuilder = e, this._univerInstanceService = n, this._injector = i;
|
|
15343
15343
|
}
|
|
@@ -15354,7 +15354,7 @@ let Ot = class extends te {
|
|
|
15354
15354
|
let O = "";
|
|
15355
15355
|
if (p) {
|
|
15356
15356
|
const M = p.startColumn - L.startColumn, F = p.startRow - L.startRow, U = Nt(L, M, F);
|
|
15357
|
-
E && I ? O = na(E, I, U) : I ? O = ia(I, U) : O =
|
|
15357
|
+
E && I ? O = na(E, I, U) : I ? O = ia(I, U) : O = Ke(U);
|
|
15358
15358
|
} else
|
|
15359
15359
|
O = j.REF;
|
|
15360
15360
|
return {
|
|
@@ -15364,10 +15364,10 @@ let Ot = class extends te {
|
|
|
15364
15364
|
} else
|
|
15365
15365
|
return d;
|
|
15366
15366
|
});
|
|
15367
|
-
return c ? `=${
|
|
15367
|
+
return c ? `=${ke(c)}` : "";
|
|
15368
15368
|
}
|
|
15369
15369
|
registerFormula(a, e, n, i) {
|
|
15370
|
-
const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new
|
|
15370
|
+
const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new Xe(), m = (f) => {
|
|
15371
15371
|
const c = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), d = c.getActiveSheet(), T = c.getUnitId(), L = d.getSheetId(), E = o == null ? void 0 : o.map((A) => {
|
|
15372
15372
|
if (typeof A == "object" && A.nodeType === J.REFERENCE) {
|
|
15373
15373
|
const l = r.get(A.token);
|
|
@@ -15377,7 +15377,7 @@ let Ot = class extends te {
|
|
|
15377
15377
|
let R = "";
|
|
15378
15378
|
if (N) {
|
|
15379
15379
|
const p = N.startColumn - l.range.startColumn, O = N.startRow - l.range.startRow, M = Nt(l.range, p, O);
|
|
15380
|
-
l.unitId && l.sheetName ? R = na(l.unitId, l.sheetName, M) : l.sheetName ? R = ia(l.sheetName, M) : R =
|
|
15380
|
+
l.unitId && l.sheetName ? R = na(l.unitId, l.sheetName, M) : l.sheetName ? R = ia(l.sheetName, M) : R = Ke(M);
|
|
15381
15381
|
} else
|
|
15382
15382
|
R = j.REF;
|
|
15383
15383
|
return {
|
|
@@ -15386,7 +15386,7 @@ let Ot = class extends te {
|
|
|
15386
15386
|
};
|
|
15387
15387
|
} else
|
|
15388
15388
|
return A;
|
|
15389
|
-
}), I = E &&
|
|
15389
|
+
}), I = E && ke(E);
|
|
15390
15390
|
return i(`=${I}`);
|
|
15391
15391
|
};
|
|
15392
15392
|
return o == null || o.forEach((f) => {
|
|
@@ -15405,11 +15405,11 @@ let Ot = class extends te {
|
|
|
15405
15405
|
}), u;
|
|
15406
15406
|
}
|
|
15407
15407
|
_getFormulaDependcy(a, e, n, i) {
|
|
15408
|
-
const r =
|
|
15408
|
+
const r = xe(n) ? this._lexerTreeBuilder.sequenceNodesBuilder(n) : null, o = [];
|
|
15409
15409
|
return r == null || r.forEach((u) => {
|
|
15410
15410
|
if (typeof u == "object" && u.nodeType === J.REFERENCE) {
|
|
15411
15411
|
const m = pe(u.token), { range: f, unitId: c, sheetName: d } = m;
|
|
15412
|
-
if (f.startAbsoluteRefType ===
|
|
15412
|
+
if (f.startAbsoluteRefType === We.ALL && f.endAbsoluteRefType === We.ALL)
|
|
15413
15413
|
return;
|
|
15414
15414
|
const T = this._univerInstanceService.getUnit(c || a), L = d ? T == null ? void 0 : T.getSheetBySheetName(d) : T == null ? void 0 : T.getSheetBySheetId(e);
|
|
15415
15415
|
if (!L)
|
|
@@ -15430,13 +15430,13 @@ let Ot = class extends te {
|
|
|
15430
15430
|
}
|
|
15431
15431
|
// eslint-disable-next-line max-lines-per-function
|
|
15432
15432
|
registerRangeFormula(a, e, n, i, r) {
|
|
15433
|
-
const o = new
|
|
15433
|
+
const o = new Xe(), u = i.map((f) => this._getFormulaDependcy(a, e, f, n)), m = (f) => {
|
|
15434
15434
|
const c = n[0].startRow, d = n[0].startColumn, T = [{ unitId: a, subUnitId: e, ranges: n }, ...u.flat()], L = [], E = Tn(this._injector, f);
|
|
15435
15435
|
for (const { unitId: I, subUnitId: A, ranges: l } of T)
|
|
15436
15436
|
if (I === E.unitId && A === E.subUnitId) {
|
|
15437
15437
|
const N = [], R = l[0].startRow, p = l[0].startColumn, O = R - c, M = p - d;
|
|
15438
15438
|
for (const F of E.ranges) {
|
|
15439
|
-
const U = l.map((g) =>
|
|
15439
|
+
const U = l.map((g) => we(F, g)).filter(Boolean);
|
|
15440
15440
|
U.length > 0 && N.push(...U);
|
|
15441
15441
|
}
|
|
15442
15442
|
N.length > 0 && L.push(
|
|
@@ -15456,18 +15456,18 @@ let Ot = class extends te {
|
|
|
15456
15456
|
const M = I[O], F = M.startRow, U = M.startColumn, g = F - c, x = U - d, h = En(M, f).sort((k, oe) => k.startRow - oe.startRow || k.startColumn - oe.startColumn);
|
|
15457
15457
|
if (!h.length)
|
|
15458
15458
|
continue;
|
|
15459
|
-
const V = h[0].startRow, Q = h[0].startColumn, b = V - c, Pe = Q - d,
|
|
15459
|
+
const V = h[0].startRow, Q = h[0].startColumn, b = V - c, Pe = Q - d, ne = [];
|
|
15460
15460
|
for (let k = 0; k < i.length; k++) {
|
|
15461
|
-
const oe = i[k], z =
|
|
15462
|
-
|
|
15461
|
+
const oe = i[k], z = xe(oe), ge = z ? this._lexerTreeBuilder.moveFormulaRefOffset(oe, x, g) : oe, ue = z ? this.transformFormulaByEffectCommand(a, e, ge, f) : ge, Te = ca(this._lexerTreeBuilder, ue, -Pe, -b);
|
|
15462
|
+
ne.push({
|
|
15463
15463
|
newFormula: ue,
|
|
15464
15464
|
orginFormula: Te
|
|
15465
15465
|
});
|
|
15466
15466
|
}
|
|
15467
15467
|
const re = {
|
|
15468
|
-
formulas:
|
|
15468
|
+
formulas: ne,
|
|
15469
15469
|
ranges: h,
|
|
15470
|
-
key:
|
|
15470
|
+
key: ne.map((k) => k.orginFormula).join("_")
|
|
15471
15471
|
};
|
|
15472
15472
|
l.has(re.key) ? l.get(re.key).push(re) : l.set(re.key, [re]);
|
|
15473
15473
|
}
|
|
@@ -15477,7 +15477,7 @@ let Ot = class extends te {
|
|
|
15477
15477
|
for (let g = 0; g < i.length; g++) {
|
|
15478
15478
|
const x = i[g];
|
|
15479
15479
|
F.push({
|
|
15480
|
-
newFormula:
|
|
15480
|
+
newFormula: xe(x) ? this._lexerTreeBuilder.moveFormulaRefOffset(x, M - d, O - c) : x,
|
|
15481
15481
|
orginFormula: x
|
|
15482
15482
|
});
|
|
15483
15483
|
}
|
|
@@ -15518,10 +15518,10 @@ let Ot = class extends te {
|
|
|
15518
15518
|
}
|
|
15519
15519
|
};
|
|
15520
15520
|
Ot = Pr([
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15521
|
+
ve(0, X(Pn)),
|
|
15522
|
+
ve(1, X(Ut)),
|
|
15523
|
+
ve(2, Ce),
|
|
15524
|
+
ve(3, X(rt))
|
|
15525
15525
|
], Ot);
|
|
15526
15526
|
var Tr = Object.getOwnPropertyDescriptor, Er = (a, e, n, i) => {
|
|
15527
15527
|
for (var r = i > 1 ? void 0 : i ? Tr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
@@ -15529,7 +15529,7 @@ var Tr = Object.getOwnPropertyDescriptor, Er = (a, e, n, i) => {
|
|
|
15529
15529
|
return r;
|
|
15530
15530
|
}, Ir = (a, e) => (n, i) => e(n, i, a);
|
|
15531
15531
|
const Vt = "sheets-formula.remote-register-function.service", Ha = yt(Vt);
|
|
15532
|
-
let
|
|
15532
|
+
let ze = class {
|
|
15533
15533
|
constructor(a) {
|
|
15534
15534
|
this._functionService = a;
|
|
15535
15535
|
}
|
|
@@ -15545,9 +15545,9 @@ let $e = class {
|
|
|
15545
15545
|
this._functionService.unregisterExecutors(...a), this._functionService.unregisterDescriptions(...a), this._functionService.deleteFormulaAstCacheKey(...a);
|
|
15546
15546
|
}
|
|
15547
15547
|
};
|
|
15548
|
-
|
|
15548
|
+
ze = Er([
|
|
15549
15549
|
Ir(0, Bt)
|
|
15550
|
-
],
|
|
15550
|
+
], ze);
|
|
15551
15551
|
function Nr(a, e) {
|
|
15552
15552
|
const n = new Ct(e), i = new Function(`return ${a}`)();
|
|
15553
15553
|
return n.calculateCustom = i, n;
|
|
@@ -15560,11 +15560,11 @@ var Sr = Object.getOwnPropertyDescriptor, Ar = (a, e, n, i) => {
|
|
|
15560
15560
|
for (var r = i > 1 ? void 0 : i ? Sr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15561
15561
|
(u = a[o]) && (r = u(r) || r);
|
|
15562
15562
|
return r;
|
|
15563
|
-
},
|
|
15563
|
+
}, Ve = (a, e) => (n, i) => e(n, i, a);
|
|
15564
15564
|
const Cr = yt(
|
|
15565
15565
|
"sheets-formula.register-function-service"
|
|
15566
15566
|
);
|
|
15567
|
-
let Mt = class extends
|
|
15567
|
+
let Mt = class extends ae {
|
|
15568
15568
|
constructor(a, e, n, i) {
|
|
15569
15569
|
super(), this._localeService = a, this._descriptionService = e, this._functionService = n, this._remoteRegisterFunctionService = i;
|
|
15570
15570
|
}
|
|
@@ -15577,7 +15577,7 @@ let Mt = class extends te {
|
|
|
15577
15577
|
registerFunctions(a) {
|
|
15578
15578
|
const { locales: e, description: n, calculate: i } = a;
|
|
15579
15579
|
e && this._localeService.load(e);
|
|
15580
|
-
const r = new
|
|
15580
|
+
const r = new Xe();
|
|
15581
15581
|
if (n)
|
|
15582
15582
|
r.add(this._descriptionService.registerDescriptions(n));
|
|
15583
15583
|
else {
|
|
@@ -15593,7 +15593,7 @@ let Mt = class extends te {
|
|
|
15593
15593
|
return r.add(this._registerLocalExecutors(i)), this._remoteRegisterFunctionService && r.add(this._registerRemoteExecutors(i)), r;
|
|
15594
15594
|
}
|
|
15595
15595
|
_registerSingleFunction(a) {
|
|
15596
|
-
const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new
|
|
15596
|
+
const { name: e, func: n, description: i, locales: r, async: o = !1 } = a, u = new Xe();
|
|
15597
15597
|
if (r && this._localeService.load(r), typeof i == "string") {
|
|
15598
15598
|
const f = {
|
|
15599
15599
|
functionName: e,
|
|
@@ -15606,8 +15606,8 @@ let Mt = class extends te {
|
|
|
15606
15606
|
} else
|
|
15607
15607
|
u.add(this._descriptionService.registerDescriptions([i]));
|
|
15608
15608
|
const m = o ? new qa(e) : new Ct(e);
|
|
15609
|
-
return m.calculateCustom = n, this._functionService.registerExecutors(m), u.add(
|
|
15610
|
-
|
|
15609
|
+
return m.calculateCustom = n, this._functionService.registerExecutors(m), u.add(ie(() => this._functionService.unregisterExecutors(e))), u.add(ie(() => this._functionService.unregisterDescriptions(e))), u.add(ie(() => this._functionService.deleteFormulaAstCacheKey(e))), this._remoteRegisterFunctionService && (this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(), e]]), u.add(
|
|
15610
|
+
ie(() => this._remoteRegisterFunctionService.unregisterFunctions([e]))
|
|
15611
15611
|
)), u;
|
|
15612
15612
|
}
|
|
15613
15613
|
_registerLocalExecutors(a) {
|
|
@@ -15615,26 +15615,26 @@ let Mt = class extends te {
|
|
|
15615
15615
|
const o = new Ct(r);
|
|
15616
15616
|
return o.calculateCustom = i, o;
|
|
15617
15617
|
});
|
|
15618
|
-
return this._functionService.registerExecutors(...n),
|
|
15618
|
+
return this._functionService.registerExecutors(...n), ie(() => this._functionService.unregisterExecutors(...e));
|
|
15619
15619
|
}
|
|
15620
15620
|
_registerRemoteExecutors(a) {
|
|
15621
15621
|
const e = [], n = a.map(([i, r]) => (e.push(r), [i.toString(), r]));
|
|
15622
|
-
return this._remoteRegisterFunctionService.registerFunctions(n),
|
|
15622
|
+
return this._remoteRegisterFunctionService.registerFunctions(n), ie(() => this._remoteRegisterFunctionService.unregisterFunctions(e));
|
|
15623
15623
|
}
|
|
15624
15624
|
};
|
|
15625
15625
|
Mt = Ar([
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15626
|
+
Ve(0, X(_t)),
|
|
15627
|
+
Ve(1, X(vt)),
|
|
15628
|
+
Ve(2, Bt),
|
|
15629
|
+
Ve(3, Qa(Ha))
|
|
15630
15630
|
], Mt);
|
|
15631
15631
|
const Dr = "SHEETS_FORMULA_PLUGIN";
|
|
15632
15632
|
var br = Object.getOwnPropertyDescriptor, Or = (a, e, n, i) => {
|
|
15633
15633
|
for (var r = i > 1 ? void 0 : i ? br(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15634
15634
|
(u = a[o]) && (r = u(r) || r);
|
|
15635
15635
|
return r;
|
|
15636
|
-
},
|
|
15637
|
-
let
|
|
15636
|
+
}, It = (a, e) => (n, i) => e(n, i, a);
|
|
15637
|
+
let Ze = class extends ae {
|
|
15638
15638
|
constructor(a, e, n) {
|
|
15639
15639
|
super(), this._activeDirtyManagerService = a, this._univerInstanceService = e, this._formulaDataModel = n, this._initialize();
|
|
15640
15640
|
}
|
|
@@ -15642,8 +15642,8 @@ let je = class extends te {
|
|
|
15642
15642
|
this._initialConversion();
|
|
15643
15643
|
}
|
|
15644
15644
|
_initialConversion() {
|
|
15645
|
-
this._activeDirtyManagerService.register(
|
|
15646
|
-
commandId:
|
|
15645
|
+
this._activeDirtyManagerService.register(te.id, {
|
|
15646
|
+
commandId: te.id,
|
|
15647
15647
|
getDirtyData: (a) => {
|
|
15648
15648
|
const e = a.params;
|
|
15649
15649
|
return e.trigger === gt.id ? {} : {
|
|
@@ -15815,8 +15815,8 @@ let je = class extends te {
|
|
|
15815
15815
|
});
|
|
15816
15816
|
}
|
|
15817
15817
|
_initialDefinedName() {
|
|
15818
|
-
this._activeDirtyManagerService.register(
|
|
15819
|
-
commandId:
|
|
15818
|
+
this._activeDirtyManagerService.register(ye.id, {
|
|
15819
|
+
commandId: ye.id,
|
|
15820
15820
|
getDirtyData: (a) => {
|
|
15821
15821
|
const e = a.params;
|
|
15822
15822
|
return { dirtyDefinedNameMap: this._getDefinedNameMutation(e) };
|
|
@@ -15928,19 +15928,19 @@ let je = class extends te {
|
|
|
15928
15928
|
return i;
|
|
15929
15929
|
}
|
|
15930
15930
|
};
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
],
|
|
15931
|
+
Ze = Or([
|
|
15932
|
+
It(0, Ft),
|
|
15933
|
+
It(1, Ce),
|
|
15934
|
+
It(2, X(ut))
|
|
15935
|
+
], Ze);
|
|
15936
15936
|
var Mr = Object.getOwnPropertyDescriptor, xr = (a, e, n, i) => {
|
|
15937
15937
|
for (var r = i > 1 ? void 0 : i ? Mr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15938
15938
|
(u = a[o]) && (r = u(r) || r);
|
|
15939
15939
|
return r;
|
|
15940
|
-
},
|
|
15941
|
-
let
|
|
15942
|
-
constructor(a, e, n) {
|
|
15943
|
-
super(), this._commandService = a, this.
|
|
15940
|
+
}, Ge = (a, e) => (n, i) => e(n, i, a);
|
|
15941
|
+
let Je = class extends ae {
|
|
15942
|
+
constructor(a, e, n, i) {
|
|
15943
|
+
super(), this._commandService = a, this._configService = e, this._sheetInterceptorService = n, this._formulaDataModel = i, this._initialize();
|
|
15944
15944
|
}
|
|
15945
15945
|
_initialize() {
|
|
15946
15946
|
this._commandExecutedListener(), this._initInterceptorCellContent();
|
|
@@ -15948,53 +15948,55 @@ let ze = class extends te {
|
|
|
15948
15948
|
_commandExecutedListener() {
|
|
15949
15949
|
this.disposeWithMe(
|
|
15950
15950
|
this._commandService.onCommandExecuted((a) => {
|
|
15951
|
+
var r;
|
|
15951
15952
|
if (a.id !== At.id)
|
|
15952
15953
|
return;
|
|
15953
15954
|
const e = a.params;
|
|
15954
15955
|
if (e == null)
|
|
15955
15956
|
return;
|
|
15956
15957
|
const { arrayFormulaRange: n, arrayFormulaCellData: i } = e;
|
|
15957
|
-
this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i);
|
|
15958
|
+
this._formulaDataModel.setArrayFormulaRange(n), this._formulaDataModel.setArrayFormulaCellData(i), (r = this._configService.getConfig(qe)) != null && r.writeArrayFormulaToSnapshot && this._writeArrayFormulaToSnapshot(i);
|
|
15958
15959
|
})
|
|
15959
15960
|
);
|
|
15960
15961
|
}
|
|
15962
|
+
_writeArrayFormulaToSnapshot(a) {
|
|
15963
|
+
Array.from(Object.entries(a)).forEach(([e, n]) => {
|
|
15964
|
+
n && Array.from(Object.entries(n)).forEach(([i, r]) => {
|
|
15965
|
+
this._commandService.executeCommand(te.id, {
|
|
15966
|
+
unitId: e,
|
|
15967
|
+
subUnitId: i,
|
|
15968
|
+
cellValue: r
|
|
15969
|
+
}, { onlyLocal: !0 });
|
|
15970
|
+
});
|
|
15971
|
+
});
|
|
15972
|
+
}
|
|
15961
15973
|
_initInterceptorCellContent() {
|
|
15962
15974
|
this.disposeWithMe(
|
|
15963
15975
|
this._sheetInterceptorService.intercept(In.CELL_CONTENT, {
|
|
15964
15976
|
priority: 100,
|
|
15965
15977
|
effect: $a.Value,
|
|
15966
15978
|
handler: (a, e, n) => {
|
|
15967
|
-
var
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
v: 0,
|
|
15972
|
-
// Default value for empty cell
|
|
15973
|
-
t: Gt.NUMBER
|
|
15974
|
-
}) : (a == null ? void 0 : a.t) === Gt.NUMBER && a.v !== void 0 && a.v !== null && ja(a.v) ? n({
|
|
15975
|
-
...a,
|
|
15976
|
-
v: $n(Number(a.v))
|
|
15977
|
-
}) : n({
|
|
15978
|
-
...a,
|
|
15979
|
-
v: f.v,
|
|
15980
|
-
t: f.t
|
|
15981
|
-
});
|
|
15979
|
+
var d, T, L;
|
|
15980
|
+
let i = a;
|
|
15981
|
+
const { unitId: r, subUnitId: o, row: u, col: m } = e, f = this._formulaDataModel.getArrayFormulaCellData(), c = (L = (T = (d = f == null ? void 0 : f[r]) == null ? void 0 : d[o]) == null ? void 0 : T[u]) == null ? void 0 : L[m];
|
|
15982
|
+
return c == null ? n(i) : ((!i || i === e.rawData) && (i = { ...e.rawData }), c.v == null && c.t == null ? (i.v = 0, i.t = Gt.NUMBER, n(i)) : (i == null ? void 0 : i.t) === Gt.NUMBER && i.v !== void 0 && i.v !== null && ja(i.v) ? (i.v = $n(Number(i.v)), n(i)) : (i.v = c.v, i.t = c.t, n(i)));
|
|
15982
15983
|
}
|
|
15983
15984
|
})
|
|
15984
15985
|
);
|
|
15985
15986
|
}
|
|
15986
15987
|
};
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15988
|
+
Je = xr([
|
|
15989
|
+
Ge(0, ce),
|
|
15990
|
+
Ge(1, De),
|
|
15991
|
+
Ge(2, X(qt)),
|
|
15992
|
+
Ge(3, X(ut))
|
|
15993
|
+
], Je);
|
|
15992
15994
|
var _r = Object.getOwnPropertyDescriptor, yr = (a, e, n, i) => {
|
|
15993
15995
|
for (var r = i > 1 ? void 0 : i ? _r(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15994
15996
|
(u = a[o]) && (r = u(r) || r);
|
|
15995
15997
|
return r;
|
|
15996
|
-
},
|
|
15997
|
-
let
|
|
15998
|
+
}, He = (a, e) => (n, i) => e(n, i, a);
|
|
15999
|
+
let et = class extends ae {
|
|
15998
16000
|
constructor(e, n, i, r) {
|
|
15999
16001
|
super();
|
|
16000
16002
|
W(this, "_preUnitId", null);
|
|
@@ -16004,14 +16006,14 @@ let Ze = class extends te {
|
|
|
16004
16006
|
this._descriptionListener(), this._changeUnitListener(), this._changeSheetListener();
|
|
16005
16007
|
}
|
|
16006
16008
|
_descriptionListener() {
|
|
16007
|
-
|
|
16009
|
+
ie(
|
|
16008
16010
|
this._definedNamesService.update$.subscribe(() => {
|
|
16009
16011
|
this._registerDescriptions();
|
|
16010
16012
|
})
|
|
16011
16013
|
);
|
|
16012
16014
|
}
|
|
16013
16015
|
_changeUnitListener() {
|
|
16014
|
-
|
|
16016
|
+
ie(
|
|
16015
16017
|
this._univerInstanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).subscribe(() => {
|
|
16016
16018
|
this._unRegisterDescriptions(), this._registerDescriptions();
|
|
16017
16019
|
})
|
|
@@ -16023,7 +16025,7 @@ let Ze = class extends te {
|
|
|
16023
16025
|
if (!(n != null && n.fromCollab)) {
|
|
16024
16026
|
if (e.id === Nn.id)
|
|
16025
16027
|
this._unregisterDescriptionsForNotInSheetId(), this._registerDescriptions();
|
|
16026
|
-
else if (e.id ===
|
|
16028
|
+
else if (e.id === ye.id) {
|
|
16027
16029
|
const i = e.params;
|
|
16028
16030
|
this._registerDescription(i);
|
|
16029
16031
|
} else if (e.id === Dt.id) {
|
|
@@ -16039,7 +16041,7 @@ let Ze = class extends te {
|
|
|
16039
16041
|
if (n == null || i == null)
|
|
16040
16042
|
return;
|
|
16041
16043
|
const { name: r, comment: o, formulaOrRefString: u, localSheetId: m } = e;
|
|
16042
|
-
!this._descriptionService.hasDescription(r) && (m == null || m ===
|
|
16044
|
+
!this._descriptionService.hasDescription(r) && (m == null || m === lt || m === i) && this._descriptionService.registerDescriptions([{
|
|
16043
16045
|
functionName: r,
|
|
16044
16046
|
description: u + (o || ""),
|
|
16045
16047
|
abstract: u,
|
|
@@ -16083,7 +16085,7 @@ let Ze = class extends te {
|
|
|
16083
16085
|
const r = [];
|
|
16084
16086
|
this._preUnitId = e, Array.from(Object.values(i)).forEach((o) => {
|
|
16085
16087
|
const { name: u, comment: m, formulaOrRefString: f, localSheetId: c } = o;
|
|
16086
|
-
!this._descriptionService.hasDescription(u) && (c == null || c ===
|
|
16088
|
+
!this._descriptionService.hasDescription(u) && (c == null || c === lt || c === n) && r.push({
|
|
16087
16089
|
functionName: u,
|
|
16088
16090
|
description: f + (m || ""),
|
|
16089
16091
|
abstract: f,
|
|
@@ -16102,39 +16104,39 @@ let Ze = class extends te {
|
|
|
16102
16104
|
const r = [];
|
|
16103
16105
|
Array.from(Object.values(i)).forEach((o) => {
|
|
16104
16106
|
const { name: u, localSheetId: m } = o;
|
|
16105
|
-
m !==
|
|
16107
|
+
m !== lt && m !== n && r.push(u);
|
|
16106
16108
|
}), this._descriptionService.unregisterDescriptions(r);
|
|
16107
16109
|
}
|
|
16108
16110
|
};
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
],
|
|
16111
|
+
et = yr([
|
|
16112
|
+
He(0, vt),
|
|
16113
|
+
He(1, ht),
|
|
16114
|
+
He(2, Ce),
|
|
16115
|
+
He(3, ce)
|
|
16116
|
+
], et);
|
|
16115
16117
|
var qr = Object.getOwnPropertyDescriptor, gr = (a, e, n, i) => {
|
|
16116
16118
|
for (var r = i > 1 ? void 0 : i ? qr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
16117
16119
|
(u = a[o]) && (r = u(r) || r);
|
|
16118
16120
|
return r;
|
|
16119
16121
|
}, hr = (a, e) => (n, i) => e(n, i, a);
|
|
16120
|
-
let
|
|
16122
|
+
let tt = class extends ae {
|
|
16121
16123
|
constructor(a) {
|
|
16122
16124
|
super(), this._commandService = a, [
|
|
16123
16125
|
ei,
|
|
16124
16126
|
ti,
|
|
16125
|
-
|
|
16127
|
+
Me
|
|
16126
16128
|
].forEach((e) => this._commandService.registerCommand(e));
|
|
16127
16129
|
}
|
|
16128
16130
|
};
|
|
16129
|
-
|
|
16131
|
+
tt = gr([
|
|
16130
16132
|
hr(0, ce)
|
|
16131
|
-
],
|
|
16133
|
+
], tt);
|
|
16132
16134
|
var Ur = Object.defineProperty, Fr = Object.getOwnPropertyDescriptor, Br = (a, e, n) => e in a ? Ur(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, wa = (a, e, n, i) => {
|
|
16133
16135
|
for (var r = i > 1 ? void 0 : i ? Fr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
16134
16136
|
(u = a[o]) && (r = u(r) || r);
|
|
16135
16137
|
return r;
|
|
16136
|
-
},
|
|
16137
|
-
let
|
|
16138
|
+
}, at = (a, e) => (n, i) => e(n, i, a), ft = (a, e, n) => Br(a, typeof e != "symbol" ? e + "" : e, n);
|
|
16139
|
+
let nt = class extends pa {
|
|
16138
16140
|
constructor(a = ma, e, n) {
|
|
16139
16141
|
super(), this._config = a, this._injector = e, this._configService = n;
|
|
16140
16142
|
const { ...i } = La(
|
|
@@ -16145,20 +16147,20 @@ let tt = class extends pa {
|
|
|
16145
16147
|
this._configService.setConfig(Wi, i);
|
|
16146
16148
|
}
|
|
16147
16149
|
onStarting() {
|
|
16148
|
-
this._injector.add([
|
|
16150
|
+
this._injector.add([ze]), this._injector.get(Ua).registerChannel(
|
|
16149
16151
|
Vt,
|
|
16150
|
-
Zn(this._injector.get(
|
|
16152
|
+
Zn(this._injector.get(ze))
|
|
16151
16153
|
);
|
|
16152
16154
|
}
|
|
16153
16155
|
};
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16156
|
+
ft(nt, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
|
|
16157
|
+
ft(nt, "type", ee.UNIVER_SHEET);
|
|
16158
|
+
nt = wa([
|
|
16157
16159
|
da(ga),
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
],
|
|
16161
|
-
let
|
|
16160
|
+
at(1, X(rt)),
|
|
16161
|
+
at(2, De)
|
|
16162
|
+
], nt);
|
|
16163
|
+
let it = class extends pa {
|
|
16162
16164
|
constructor(a = ua, e, n) {
|
|
16163
16165
|
super(), this._config = a, this._injector = e, this._configService = n;
|
|
16164
16166
|
const { ...i } = La(
|
|
@@ -16166,21 +16168,21 @@ let at = class extends pa {
|
|
|
16166
16168
|
ua,
|
|
16167
16169
|
this._config
|
|
16168
16170
|
);
|
|
16169
|
-
this._configService.setConfig(
|
|
16171
|
+
this._configService.setConfig(qe, i, { merge: !0 });
|
|
16170
16172
|
}
|
|
16171
16173
|
onStarting() {
|
|
16172
16174
|
const a = this._injector, e = [
|
|
16173
16175
|
[Cr, { useClass: Mt }],
|
|
16174
16176
|
[vt, { useClass: bt }],
|
|
16175
|
-
[
|
|
16177
|
+
[tt],
|
|
16176
16178
|
[Ot],
|
|
16177
|
-
[
|
|
16178
|
-
[
|
|
16179
|
-
[
|
|
16180
|
-
[Qe],
|
|
16179
|
+
[$e],
|
|
16180
|
+
[Je],
|
|
16181
|
+
[_e],
|
|
16181
16182
|
[je],
|
|
16182
16183
|
[Ze],
|
|
16183
|
-
[
|
|
16184
|
+
[et],
|
|
16185
|
+
[Qe]
|
|
16184
16186
|
];
|
|
16185
16187
|
if (this._config.notExecuteFormula) {
|
|
16186
16188
|
const n = a.get(Ua);
|
|
@@ -16191,31 +16193,31 @@ let at = class extends pa {
|
|
|
16191
16193
|
e.forEach((n) => a.add(n));
|
|
16192
16194
|
}
|
|
16193
16195
|
onReady() {
|
|
16194
|
-
|
|
16196
|
+
he(this._injector, [
|
|
16197
|
+
[tt],
|
|
16198
|
+
[Ze],
|
|
16195
16199
|
[Je],
|
|
16196
16200
|
[je],
|
|
16197
|
-
[
|
|
16198
|
-
|
|
16199
|
-
[
|
|
16200
|
-
]), Ht() && ge(this._injector, [
|
|
16201
|
-
[xe]
|
|
16201
|
+
[Qe]
|
|
16202
|
+
]), Ht() && he(this._injector, [
|
|
16203
|
+
[_e]
|
|
16202
16204
|
]);
|
|
16203
16205
|
}
|
|
16204
16206
|
onRendered() {
|
|
16205
|
-
|
|
16206
|
-
[
|
|
16207
|
-
]), Ht() ||
|
|
16208
|
-
[
|
|
16207
|
+
he(this._injector, [
|
|
16208
|
+
[et]
|
|
16209
|
+
]), Ht() || he(this._injector, [
|
|
16210
|
+
[_e]
|
|
16209
16211
|
]);
|
|
16210
16212
|
}
|
|
16211
16213
|
};
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16214
|
+
ft(it, "pluginName", Dr);
|
|
16215
|
+
ft(it, "type", ee.UNIVER_SHEET);
|
|
16216
|
+
it = wa([
|
|
16215
16217
|
da(ga, Rn),
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
],
|
|
16218
|
+
at(1, X(rt)),
|
|
16219
|
+
at(2, De)
|
|
16220
|
+
], it);
|
|
16219
16221
|
export {
|
|
16220
16222
|
Le as CalculationMode,
|
|
16221
16223
|
bt as DescriptionService,
|
|
@@ -16224,16 +16226,16 @@ export {
|
|
|
16224
16226
|
Cr as IRegisterFunctionService,
|
|
16225
16227
|
Ha as IRemoteRegisterFunctionService,
|
|
16226
16228
|
ei as InsertFunctionCommand,
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
+
Me as OtherFormulaMarkDirty,
|
|
16230
|
+
qe as PLUGIN_CONFIG_KEY_BASE,
|
|
16229
16231
|
ti as QuickSumCommand,
|
|
16230
16232
|
Mt as RegisterFunctionService,
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16237
|
-
|
|
16233
|
+
$e as RegisterOtherFormulaService,
|
|
16234
|
+
ze as RemoteRegisterFunctionService,
|
|
16235
|
+
_e as TriggerCalculationController,
|
|
16236
|
+
nt as UniverRemoteSheetsFormulaPlugin,
|
|
16237
|
+
it as UniverSheetsFormulaPlugin,
|
|
16238
|
+
Qe as UpdateDefinedNameController,
|
|
16239
|
+
je as UpdateFormulaController,
|
|
16238
16240
|
Xr as calculateFormula
|
|
16239
16241
|
};
|