@univerjs/sheets-formula 0.6.1 → 0.6.2
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 +37 -33
- package/lib/es/index.js +449 -429
- package/lib/types/controllers/trigger-calculation.controller.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/util/calculate.d.ts +3 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var Va = Object.defineProperty;
|
|
2
2
|
var Ga = (a, e, n) => e in a ? Va(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as ua, ICommandService as de, ObjectMatrix as W, Tools as Ne, Rectangle as De, isFormulaString as be, isFormulaId as ma, cellToRange as fa, Direction as He, getIntersectRange as Ve, RANGE_TYPE as Y, IUniverInstanceService as xe, Inject as
|
|
5
|
-
import { SetRangeValuesCommand as Ka, SetRangeValuesMutation as
|
|
6
|
-
import { sequenceNodeType as J, deserializeRangeWithSheetWithCache as
|
|
7
|
-
import { Subject as ta, BehaviorSubject as _a, bufferWhen as
|
|
8
|
-
import { IRPCChannelService as ya, fromModule as
|
|
9
|
-
const
|
|
3
|
+
var w = (a, e, n) => Ga(a, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as ua, ICommandService as de, ObjectMatrix as W, Tools as Ne, Rectangle as De, isFormulaString as be, isFormulaId as ma, cellToRange as fa, Direction as He, getIntersectRange as Ve, RANGE_TYPE as Y, IUniverInstanceService as xe, Inject as X, Disposable as te, UniverInstanceType as ee, LifecycleService as Ha, ILogService as Ya, IConfigService as _e, LocaleService as Ot, Injector as at, createIdentifier as Mt, toDisposable as le, moveRangeByOffset as Et, DisposableCollection as Ye, AbsoluteRefType as Xe, Optional as Xa, InterceptorEffectEnum as wa, CellValueType as Bt, isRealNum as Wa, DependentOn as ca, Plugin as la, merge as sa, touchDependencies as qe, isNodeEnv as vt } from "@univerjs/core";
|
|
5
|
+
import { SetRangeValuesCommand as Ka, SetRangeValuesMutation as ne, handleMoveCols as pa, EffectRefRangId as G, runRefRangeMutations as H, handleMoveRows as da, handleMoveRange as La, handleInsertRangeMoveRight as Pa, handleInsertRangeMoveDown as Ta, handleDeleteRangeMoveUp as Ea, handleDeleteRangeMoveLeft as Ia, handleIRemoveCol as Na, handleIRemoveRow as Ra, handleInsertCol as Aa, handleInsertRow as Sa, RemoveDefinedNameCommand as Ca, SetDefinedNameCommand as Da, RemoveSheetCommand as ka, SetWorksheetNameCommand as Qa, DeleteRangeMoveLeftCommand as $a, DeleteRangeMoveUpCommand as ja, RemoveColCommand as za, RemoveRowCommand as Za, InsertRangeMoveDownCommand as Ja, InsertRangeMoveRightCommand as en, InsertColCommand as tn, InsertRowCommand as an, MoveColsCommand as nn, MoveRowsCommand as rn, MoveRangeCommand as on, SheetInterceptorService as xt, SetStyleCommand as _t, SetBorderCommand as ba, ClearSelectionFormatCommand as Oa, RemoveSheetMutation as It, InsertSheetMutation as Nt, RefRangeService as un, handleDefaultRangeChangeWithEffectRefCommands as Vt, getSeparateEffectedRangesOnCommand as mn, handleCommonDefaultRangeChangeWithEffectRefCommands as fn, MoveRangeMutation as Gt, MoveRowsMutation as Ht, MoveColsMutation as Yt, ReorderRangeMutation as Xt, RemoveRowMutation as wt, RemoveColMutation as Wt, InsertColMutation as Kt, InsertRowMutation as kt, INTERCEPTOR_POINT as cn, SetWorksheetActiveOperation as ln, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as mt, UniverSheetsPlugin as sn } from "@univerjs/sheets";
|
|
6
|
+
import { sequenceNodeType as J, deserializeRangeWithSheetWithCache as se, serializeRangeToRefString as nt, ErrorType as j, IDefinedNamesService as yt, LexerTreeBuilder as qt, generateStringWithSequence as we, SetDefinedNameMutation as Me, IActiveDirtyManagerService as gt, SetFormulaCalculationResultMutation as pn, RemoveOtherFormulaMutation as dn, SetOtherFormulaMutation as Ln, FormulaDataModel as it, SetFormulaCalculationStartMutation as Se, SetFormulaCalculationStopMutation as Qt, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as $t, SetFormulaCalculationNotificationMutation as Pn, FormulaExecuteStageType as ge, FormulaExecutedStateType as Re, IFormulaCurrentConfigService as Tn, Lexer as En, AstTreeBuilder as In, Interpreter as Nn, generateExecuteAstNodeData as Rn, getObjectValue as An, SetFormulaDataMutation as he, SetArrayFormulaDataMutation as Rt, initSheetFormulaData as jt, FunctionType as t, FUNCTION_NAMES_ARRAY as zt, FUNCTION_NAMES_COMPATIBILITY as _, FUNCTION_NAMES_CUBE as fe, FUNCTION_NAMES_DATABASE as $, FUNCTION_NAMES_DATE as B, FUNCTION_NAMES_ENGINEERING as A, FUNCTION_NAMES_FINANCIAL as C, FUNCTION_NAMES_INFORMATION as v, FUNCTION_NAMES_LOGICAL as K, FUNCTION_NAMES_LOOKUP as y, FUNCTION_NAMES_MATH as L, FUNCTION_NAMES_STATISTICAL as l, FUNCTION_NAMES_TEXT as D, FUNCTION_NAMES_WEB as ft, IFunctionService as ht, isReferenceStrings as Sn, functionArray as Cn, functionCompatibility as Dn, functionCube as bn, functionDatabase as On, functionDate as Mn, functionEngineering as xn, functionFinancial as _n, functionInformation as yn, functionLogical as qn, functionLookup as gn, functionMath as hn, functionMeta as Un, functionStatistical as Fn, functionText as Bn, functionUniver as vn, functionWeb as Vn, serializeRangeWithSpreadsheet as Zt, serializeRangeWithSheet as Jt, serializeRange as ea, CustomFunction as At, AsyncCustomFunction as Ma, RemoveDefinedNameMutation as St, stripErrorMargin as Gn, UniverFormulaEnginePlugin as xa } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as ta, BehaviorSubject as _a, bufferWhen as Hn, filter as aa, map as Yn } from "rxjs";
|
|
8
|
+
import { IRPCChannelService as ya, fromModule as Xn, toModule as wn } from "@univerjs/rpc";
|
|
9
|
+
const Wn = {
|
|
10
10
|
id: "formula.command.insert-function",
|
|
11
11
|
type: ua.COMMAND,
|
|
12
12
|
handler: async (a, e) => {
|
|
13
13
|
const { list: n, listOfRangeHasNumber: i } = e, r = a.get(de), o = new W();
|
|
14
14
|
n.forEach((m) => {
|
|
15
|
-
const { range: f, primary: s, formula:
|
|
15
|
+
const { range: f, primary: s, formula: p } = m, { row: T, column: P } = s, E = Ne.generateRandomId(6);
|
|
16
16
|
o.setValue(T, P, {
|
|
17
|
-
f:
|
|
17
|
+
f: p,
|
|
18
18
|
si: E
|
|
19
19
|
});
|
|
20
20
|
const { startRow: I, startColumn: S, endRow: c, endColumn: N } = f;
|
|
21
21
|
for (let R = I; R <= c; R++)
|
|
22
|
-
for (let
|
|
23
|
-
(R !== T ||
|
|
22
|
+
for (let d = S; d <= N; d++)
|
|
23
|
+
(R !== T || d !== P) && o.setValue(R, d, {
|
|
24
24
|
si: E
|
|
25
25
|
});
|
|
26
26
|
}), i && i.length > 0 && i.forEach((m) => {
|
|
@@ -41,7 +41,7 @@ const Vn = {
|
|
|
41
41
|
return !0;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function
|
|
44
|
+
function Kn(a, e, n) {
|
|
45
45
|
var i;
|
|
46
46
|
return a == null || a[e] == null || ((i = a[e]) == null ? void 0 : i[n]) == null;
|
|
47
47
|
}
|
|
@@ -60,38 +60,38 @@ function ct(a, e, n) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
var q = /* @__PURE__ */ ((a) => (a[a.MoveRange = 0] = "MoveRange", a[a.MoveRows = 1] = "MoveRows", a[a.MoveCols = 2] = "MoveCols", a[a.InsertRow = 3] = "InsertRow", a[a.InsertColumn = 4] = "InsertColumn", a[a.RemoveRow = 5] = "RemoveRow", a[a.RemoveColumn = 6] = "RemoveColumn", a[a.DeleteMoveLeft = 7] = "DeleteMoveLeft", a[a.DeleteMoveUp = 8] = "DeleteMoveUp", a[a.InsertMoveDown = 9] = "InsertMoveDown", a[a.InsertMoveRight = 10] = "InsertMoveRight", a[a.SetName = 11] = "SetName", a[a.RemoveSheet = 12] = "RemoveSheet", a[a.SetDefinedName = 13] = "SetDefinedName", a[a.RemoveDefinedName = 14] = "RemoveDefinedName", a))(q || {});
|
|
63
|
-
const
|
|
63
|
+
const kn = [
|
|
64
64
|
11,
|
|
65
65
|
12,
|
|
66
66
|
13,
|
|
67
67
|
14
|
|
68
68
|
/* RemoveDefinedName */
|
|
69
69
|
];
|
|
70
|
-
function
|
|
70
|
+
function Qn(a, e, n) {
|
|
71
71
|
const { type: i } = n;
|
|
72
|
-
return
|
|
72
|
+
return kn.includes(i) ? $n(a, e) : jn(a, e, n);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function $n(a, e) {
|
|
75
75
|
const n = [], i = [];
|
|
76
76
|
return Object.keys(e).forEach((r) => {
|
|
77
77
|
const o = e[r], u = a[r];
|
|
78
78
|
if (o == null || u == null)
|
|
79
79
|
return !0;
|
|
80
80
|
Object.keys(o).forEach((m) => {
|
|
81
|
-
const f = new W(o[m] || {}), s = new W(u[m] || {}),
|
|
81
|
+
const f = new W(o[m] || {}), s = new W(u[m] || {}), p = new W(), T = new W();
|
|
82
82
|
if (f.forValue((c, N, R) => {
|
|
83
83
|
if (R == null)
|
|
84
84
|
return !0;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
}),
|
|
85
|
+
const d = rt(R);
|
|
86
|
+
d !== null && (p.setValue(c, N, d), T.setValue(c, N, s.getValue(c, N)));
|
|
87
|
+
}), p.getSizeOf() === 0)
|
|
88
88
|
return;
|
|
89
89
|
const P = {
|
|
90
90
|
subUnitId: m,
|
|
91
91
|
unitId: r,
|
|
92
|
-
cellValue:
|
|
92
|
+
cellValue: p.getMatrix()
|
|
93
93
|
}, E = {
|
|
94
|
-
id:
|
|
94
|
+
id: ne.id,
|
|
95
95
|
params: P
|
|
96
96
|
};
|
|
97
97
|
i.push(E);
|
|
@@ -100,7 +100,7 @@ function Xn(a, e) {
|
|
|
100
100
|
unitId: r,
|
|
101
101
|
cellValue: T.getMatrix()
|
|
102
102
|
}, S = {
|
|
103
|
-
id:
|
|
103
|
+
id: ne.id,
|
|
104
104
|
params: I
|
|
105
105
|
};
|
|
106
106
|
n.push(S);
|
|
@@ -110,8 +110,8 @@ function Xn(a, e) {
|
|
|
110
110
|
redos: i
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const { redoFormulaData: i, undoFormulaData: r } =
|
|
113
|
+
function jn(a, e, n) {
|
|
114
|
+
const { redoFormulaData: i, undoFormulaData: r } = zn(a, e, n);
|
|
115
115
|
if (Ne.diffValue(i, r))
|
|
116
116
|
return {
|
|
117
117
|
undos: [],
|
|
@@ -125,11 +125,11 @@ function wn(a, e, n) {
|
|
|
125
125
|
subUnitId: f,
|
|
126
126
|
unitId: m,
|
|
127
127
|
cellValue: i[m][f]
|
|
128
|
-
},
|
|
129
|
-
id:
|
|
128
|
+
}, p = {
|
|
129
|
+
id: ne.id,
|
|
130
130
|
params: s
|
|
131
131
|
};
|
|
132
|
-
o.push(
|
|
132
|
+
o.push(p);
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}), Object.keys(r).forEach((m) => {
|
|
@@ -139,11 +139,11 @@ function wn(a, e, n) {
|
|
|
139
139
|
subUnitId: f,
|
|
140
140
|
unitId: m,
|
|
141
141
|
cellValue: r[m][f]
|
|
142
|
-
},
|
|
143
|
-
id:
|
|
142
|
+
}, p = {
|
|
143
|
+
id: ne.id,
|
|
144
144
|
params: s
|
|
145
145
|
};
|
|
146
|
-
u.push(
|
|
146
|
+
u.push(p);
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
}), {
|
|
@@ -151,10 +151,10 @@ function wn(a, e, n) {
|
|
|
151
151
|
redos: o
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
const i = {}, r = {}, { type: o, unitId: u, sheetId: m, range: f, from: s, to:
|
|
154
|
+
function zn(a, e, n) {
|
|
155
|
+
const i = {}, r = {}, { type: o, unitId: u, sheetId: m, range: f, from: s, to: p } = n;
|
|
156
156
|
return (/* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(e)])).forEach((P) => {
|
|
157
|
-
if (
|
|
157
|
+
if (Kn(a, P, m))
|
|
158
158
|
return;
|
|
159
159
|
(/* @__PURE__ */ new Set([
|
|
160
160
|
...Object.keys(a[P] || {}),
|
|
@@ -162,9 +162,9 @@ function Wn(a, e, n) {
|
|
|
162
162
|
])).forEach((I) => {
|
|
163
163
|
var F, U;
|
|
164
164
|
const S = (F = a[P]) == null ? void 0 : F[I], c = (U = e[P]) == null ? void 0 : U[I], N = new W(S || {}), R = new W(c || {});
|
|
165
|
-
let
|
|
166
|
-
P !== u || I !== m ?
|
|
167
|
-
const O =
|
|
165
|
+
let d = [];
|
|
166
|
+
P !== u || I !== m ? d = Jn(R) : d = Zn(N, o, s, p, f);
|
|
167
|
+
const O = pi(d, N, R), M = di(d, N);
|
|
168
168
|
i[P] || (i[P] = {}), r[P] || (r[P] = {}), i[P][I] = {
|
|
169
169
|
...i[P][I],
|
|
170
170
|
...O
|
|
@@ -178,27 +178,27 @@ function Wn(a, e, n) {
|
|
|
178
178
|
undoFormulaData: r
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Zn(a, e, n, i, r) {
|
|
182
182
|
const o = [];
|
|
183
183
|
return a.forValue((u, m, f) => {
|
|
184
184
|
if (f == null || !qa(f)) return !0;
|
|
185
185
|
const s = fa(u, m);
|
|
186
|
-
let
|
|
186
|
+
let p = null, T = !1;
|
|
187
187
|
if ([
|
|
188
188
|
0,
|
|
189
189
|
1,
|
|
190
190
|
2
|
|
191
191
|
/* MoveCols */
|
|
192
192
|
].includes(e))
|
|
193
|
-
|
|
193
|
+
p = ei(e, n, i, s);
|
|
194
194
|
else if (r != null) {
|
|
195
|
-
const P =
|
|
196
|
-
|
|
195
|
+
const P = ti(e, r, s);
|
|
196
|
+
p = P.newCell, T = P.isReverse;
|
|
197
197
|
}
|
|
198
|
-
T ? o.unshift({ oldCell: s, newCell:
|
|
198
|
+
T ? o.unshift({ oldCell: s, newCell: p }) : o.push({ oldCell: s, newCell: p });
|
|
199
199
|
}), o;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Jn(a) {
|
|
202
202
|
const e = [];
|
|
203
203
|
return a.forValue((n, i, r) => {
|
|
204
204
|
if (r == null || !qa(r)) return !0;
|
|
@@ -206,51 +206,51 @@ function kn(a) {
|
|
|
206
206
|
e.push({ oldCell: o, newCell: o });
|
|
207
207
|
}), e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function ei(a, e, n, i) {
|
|
210
210
|
if (e == null || n == null)
|
|
211
211
|
return null;
|
|
212
212
|
switch (a) {
|
|
213
213
|
case 0:
|
|
214
|
-
return
|
|
214
|
+
return ai(e, n, i);
|
|
215
215
|
case 1:
|
|
216
|
-
return
|
|
216
|
+
return ni(e, n, i);
|
|
217
217
|
case 2:
|
|
218
|
-
return
|
|
218
|
+
return ii(e, n, i);
|
|
219
219
|
default:
|
|
220
220
|
return null;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function ti(a, e, n) {
|
|
224
224
|
let i = null, r = !1;
|
|
225
225
|
switch (a) {
|
|
226
226
|
case 3:
|
|
227
|
-
i =
|
|
227
|
+
i = ri(e, n), r = !0;
|
|
228
228
|
break;
|
|
229
229
|
case 4:
|
|
230
|
-
i =
|
|
230
|
+
i = oi(e, n), r = !0;
|
|
231
231
|
break;
|
|
232
232
|
case 5:
|
|
233
|
-
i =
|
|
233
|
+
i = ui(e, n);
|
|
234
234
|
break;
|
|
235
235
|
case 6:
|
|
236
|
-
i =
|
|
236
|
+
i = mi(e, n);
|
|
237
237
|
break;
|
|
238
238
|
case 7:
|
|
239
|
-
i =
|
|
239
|
+
i = fi(e, n);
|
|
240
240
|
break;
|
|
241
241
|
case 8:
|
|
242
|
-
i =
|
|
242
|
+
i = ci(e, n);
|
|
243
243
|
break;
|
|
244
244
|
case 9:
|
|
245
|
-
i =
|
|
245
|
+
i = li(e, n), r = !0;
|
|
246
246
|
break;
|
|
247
247
|
case 10:
|
|
248
|
-
i =
|
|
248
|
+
i = si(e, n), r = !0;
|
|
249
249
|
break;
|
|
250
250
|
}
|
|
251
251
|
return { newCell: i, isReverse: r };
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ai(a, e, n) {
|
|
254
254
|
const i = La(
|
|
255
255
|
{
|
|
256
256
|
id: G.MoveRangeCommandId,
|
|
@@ -260,7 +260,7 @@ function jn(a, e, n) {
|
|
|
260
260
|
);
|
|
261
261
|
return H(i, n);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function ni(a, e, n) {
|
|
264
264
|
const i = da(
|
|
265
265
|
{
|
|
266
266
|
id: G.MoveRowsCommandId,
|
|
@@ -270,7 +270,7 @@ function zn(a, e, n) {
|
|
|
270
270
|
);
|
|
271
271
|
return H(i, n);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function ii(a, e, n) {
|
|
274
274
|
const i = pa(
|
|
275
275
|
{
|
|
276
276
|
id: G.MoveColsCommandId,
|
|
@@ -280,7 +280,7 @@ function Zn(a, e, n) {
|
|
|
280
280
|
);
|
|
281
281
|
return H(i, n);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ri(a, e) {
|
|
284
284
|
const n = Sa(
|
|
285
285
|
{
|
|
286
286
|
id: G.InsertRowCommandId,
|
|
@@ -290,7 +290,7 @@ function Jn(a, e) {
|
|
|
290
290
|
);
|
|
291
291
|
return H(n, e);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function oi(a, e) {
|
|
294
294
|
const n = Aa(
|
|
295
295
|
{
|
|
296
296
|
id: G.InsertColCommandId,
|
|
@@ -300,7 +300,7 @@ function ei(a, e) {
|
|
|
300
300
|
);
|
|
301
301
|
return H(n, e);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function ui(a, e) {
|
|
304
304
|
const n = Ra(
|
|
305
305
|
{
|
|
306
306
|
id: G.RemoveRowCommandId,
|
|
@@ -310,7 +310,7 @@ function ti(a, e) {
|
|
|
310
310
|
);
|
|
311
311
|
return H(n, e);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function mi(a, e) {
|
|
314
314
|
const n = Na(
|
|
315
315
|
{
|
|
316
316
|
id: G.RemoveColCommandId,
|
|
@@ -320,7 +320,7 @@ function ai(a, e) {
|
|
|
320
320
|
);
|
|
321
321
|
return H(n, e);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function fi(a, e) {
|
|
324
324
|
const n = Ia(
|
|
325
325
|
{
|
|
326
326
|
id: G.DeleteRangeMoveLeftCommandId,
|
|
@@ -330,7 +330,7 @@ function ni(a, e) {
|
|
|
330
330
|
);
|
|
331
331
|
return H(n, e);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ci(a, e) {
|
|
334
334
|
const n = Ea(
|
|
335
335
|
{
|
|
336
336
|
id: G.DeleteRangeMoveUpCommandId,
|
|
@@ -340,7 +340,7 @@ function ii(a, e) {
|
|
|
340
340
|
);
|
|
341
341
|
return H(n, e);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function li(a, e) {
|
|
344
344
|
const n = Ta(
|
|
345
345
|
{
|
|
346
346
|
id: G.InsertRangeMoveDownCommandId,
|
|
@@ -350,7 +350,7 @@ function ri(a, e) {
|
|
|
350
350
|
);
|
|
351
351
|
return H(n, e);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function si(a, e) {
|
|
354
354
|
const n = Pa(
|
|
355
355
|
{
|
|
356
356
|
id: G.InsertRangeMoveRightCommandId,
|
|
@@ -360,23 +360,23 @@ function oi(a, e) {
|
|
|
360
360
|
);
|
|
361
361
|
return H(n, e);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function pi(a, e, n) {
|
|
364
364
|
const i = new W({});
|
|
365
365
|
return a.forEach((r) => {
|
|
366
|
-
const { oldCell: o, newCell: u } = r, { startRow: m, startColumn: f } = o, s = n.getValue(m, f) || e.getValue(m, f),
|
|
366
|
+
const { oldCell: o, newCell: u } = r, { startRow: m, startColumn: f } = o, s = n.getValue(m, f) || e.getValue(m, f), p = rt(s);
|
|
367
367
|
if (i.setValue(m, f, { f: null, si: null }), u) {
|
|
368
368
|
const { startRow: T, startColumn: P } = u;
|
|
369
|
-
i.setValue(T, P,
|
|
369
|
+
i.setValue(T, P, p);
|
|
370
370
|
}
|
|
371
371
|
}), i.getMatrix();
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function di(a, e) {
|
|
374
374
|
const n = new W({});
|
|
375
375
|
return a.reverse().forEach((i) => {
|
|
376
376
|
const { oldCell: r, newCell: o } = i, { startRow: u, startColumn: m } = r, f = e.getValue(u, m), s = rt(f);
|
|
377
377
|
if (o) {
|
|
378
|
-
const { startRow:
|
|
379
|
-
n.setValue(
|
|
378
|
+
const { startRow: p, startColumn: T } = o;
|
|
379
|
+
n.setValue(p, T, { f: null, si: null });
|
|
380
380
|
}
|
|
381
381
|
n.setValue(u, m, s);
|
|
382
382
|
}), n.getMatrix();
|
|
@@ -393,7 +393,7 @@ function rt(a) {
|
|
|
393
393
|
const m = {};
|
|
394
394
|
return u && (m.si = n), o && i === 0 && r === 0 && (m.f = e), m.f === void 0 && (m.f = null), m.si === void 0 && (m.si = null), m;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function Li(a) {
|
|
397
397
|
const e = new W({});
|
|
398
398
|
return new W(a).forValue((i, r, o) => {
|
|
399
399
|
const u = rt(o);
|
|
@@ -420,7 +420,7 @@ function ha(a, e, n = 0, i = 0) {
|
|
|
420
420
|
r.push(m);
|
|
421
421
|
continue;
|
|
422
422
|
}
|
|
423
|
-
const { token: f } = m, s =
|
|
423
|
+
const { token: f } = m, s = se(f), { range: p, sheetName: T, unitId: P } = s, E = De.moveOffset(p, n, i);
|
|
424
424
|
r.push({
|
|
425
425
|
...m,
|
|
426
426
|
token: nt({
|
|
@@ -434,7 +434,7 @@ function ha(a, e, n = 0, i = 0) {
|
|
|
434
434
|
}
|
|
435
435
|
function Ua(a, e, n, i) {
|
|
436
436
|
const { type: r, unitId: o, sheetId: u, range: m, from: f, to: s } = e, {
|
|
437
|
-
range:
|
|
437
|
+
range: p,
|
|
438
438
|
sheetId: T,
|
|
439
439
|
unitId: P,
|
|
440
440
|
sheetName: E,
|
|
@@ -450,29 +450,29 @@ function Ua(a, e, n, i) {
|
|
|
450
450
|
T
|
|
451
451
|
))
|
|
452
452
|
return;
|
|
453
|
-
const c = De.moveOffset(
|
|
453
|
+
const c = De.moveOffset(p, I, S);
|
|
454
454
|
let N = null;
|
|
455
455
|
if (r === q.MoveRange) {
|
|
456
456
|
if (f == null || s == null)
|
|
457
457
|
return;
|
|
458
|
-
const R = st(c, f),
|
|
459
|
-
if (
|
|
458
|
+
const R = st(c, f), d = Ve(c, f);
|
|
459
|
+
if (d == null || R !== 4)
|
|
460
460
|
return;
|
|
461
461
|
const O = La(
|
|
462
462
|
{ id: G.MoveRangeCommandId, params: { toRange: s, fromRange: f } },
|
|
463
|
-
|
|
464
|
-
), M = H(O,
|
|
463
|
+
d
|
|
464
|
+
), M = H(O, d);
|
|
465
465
|
if (M == null)
|
|
466
466
|
return j.REF;
|
|
467
|
-
N = lt(R, M, f, s, c,
|
|
467
|
+
N = lt(R, M, f, s, c, d);
|
|
468
468
|
} else if (r === q.MoveRows) {
|
|
469
469
|
if (f == null || s == null)
|
|
470
470
|
return;
|
|
471
471
|
const R = st(c, f);
|
|
472
|
-
let
|
|
473
|
-
if (
|
|
472
|
+
let d = Ve(c, f);
|
|
473
|
+
if (d == null && (f.endRow < c.startRow && s.endRow < c.startRow || f.startRow > c.endRow && s.startRow > c.endRow))
|
|
474
474
|
return;
|
|
475
|
-
|
|
475
|
+
d == null && (d = {
|
|
476
476
|
startRow: c.startRow,
|
|
477
477
|
endRow: c.endRow,
|
|
478
478
|
startColumn: c.startColumn,
|
|
@@ -481,19 +481,19 @@ function Ua(a, e, n, i) {
|
|
|
481
481
|
});
|
|
482
482
|
const O = da(
|
|
483
483
|
{ id: G.MoveRowsCommandId, params: { toRange: s, fromRange: f } },
|
|
484
|
-
|
|
485
|
-
), M = H(O,
|
|
484
|
+
d
|
|
485
|
+
), M = H(O, d);
|
|
486
486
|
if (M == null)
|
|
487
487
|
return j.REF;
|
|
488
|
-
N = lt(R, M, f, s, c,
|
|
488
|
+
N = lt(R, M, f, s, c, d);
|
|
489
489
|
} else if (r === q.MoveCols) {
|
|
490
490
|
if (f == null || s == null)
|
|
491
491
|
return;
|
|
492
492
|
const R = st(c, f);
|
|
493
|
-
let
|
|
494
|
-
if (
|
|
493
|
+
let d = Ve(c, f);
|
|
494
|
+
if (d == null && (f.endColumn < c.startColumn && s.endColumn < c.startColumn || f.startColumn > c.endColumn && s.startColumn > c.endColumn))
|
|
495
495
|
return;
|
|
496
|
-
|
|
496
|
+
d == null && (d = {
|
|
497
497
|
startRow: c.startRow,
|
|
498
498
|
endRow: c.endRow,
|
|
499
499
|
startColumn: c.startColumn,
|
|
@@ -502,11 +502,11 @@ function Ua(a, e, n, i) {
|
|
|
502
502
|
});
|
|
503
503
|
const O = pa(
|
|
504
504
|
{ id: G.MoveColsCommandId, params: { toRange: s, fromRange: f } },
|
|
505
|
-
|
|
506
|
-
), M = H(O,
|
|
505
|
+
d
|
|
506
|
+
), M = H(O, d);
|
|
507
507
|
if (M == null)
|
|
508
508
|
return j.REF;
|
|
509
|
-
N = lt(R, M, f, s, c,
|
|
509
|
+
N = lt(R, M, f, s, c, d);
|
|
510
510
|
}
|
|
511
511
|
if (m != null) {
|
|
512
512
|
if (r === q.InsertRow) {
|
|
@@ -516,12 +516,12 @@ function Ua(a, e, n, i) {
|
|
|
516
516
|
params: { range: m, unitId: "", subUnitId: "", direction: He.DOWN }
|
|
517
517
|
},
|
|
518
518
|
c
|
|
519
|
-
),
|
|
520
|
-
if (
|
|
519
|
+
), d = H(R, c);
|
|
520
|
+
if (d == null)
|
|
521
521
|
return;
|
|
522
522
|
N = {
|
|
523
523
|
...c,
|
|
524
|
-
...
|
|
524
|
+
...d
|
|
525
525
|
};
|
|
526
526
|
} else if (r === q.InsertColumn) {
|
|
527
527
|
const R = Aa(
|
|
@@ -530,12 +530,12 @@ function Ua(a, e, n, i) {
|
|
|
530
530
|
params: { range: m, unitId: "", subUnitId: "", direction: He.RIGHT }
|
|
531
531
|
},
|
|
532
532
|
c
|
|
533
|
-
),
|
|
534
|
-
if (
|
|
533
|
+
), d = H(R, c);
|
|
534
|
+
if (d == null)
|
|
535
535
|
return;
|
|
536
536
|
N = {
|
|
537
537
|
...c,
|
|
538
|
-
...
|
|
538
|
+
...d
|
|
539
539
|
};
|
|
540
540
|
} else if (r === q.RemoveRow) {
|
|
541
541
|
const R = Ra(
|
|
@@ -544,12 +544,12 @@ function Ua(a, e, n, i) {
|
|
|
544
544
|
params: { range: m }
|
|
545
545
|
},
|
|
546
546
|
c
|
|
547
|
-
),
|
|
548
|
-
if (
|
|
547
|
+
), d = H(R, c);
|
|
548
|
+
if (d == null)
|
|
549
549
|
return j.REF;
|
|
550
550
|
N = {
|
|
551
551
|
...c,
|
|
552
|
-
...
|
|
552
|
+
...d
|
|
553
553
|
};
|
|
554
554
|
} else if (r === q.RemoveColumn) {
|
|
555
555
|
const R = Na(
|
|
@@ -558,12 +558,12 @@ function Ua(a, e, n, i) {
|
|
|
558
558
|
params: { range: m }
|
|
559
559
|
},
|
|
560
560
|
c
|
|
561
|
-
),
|
|
562
|
-
if (
|
|
561
|
+
), d = H(R, c);
|
|
562
|
+
if (d == null)
|
|
563
563
|
return j.REF;
|
|
564
564
|
N = {
|
|
565
565
|
...c,
|
|
566
|
-
...
|
|
566
|
+
...d
|
|
567
567
|
};
|
|
568
568
|
} else if (r === q.DeleteMoveLeft) {
|
|
569
569
|
const R = Ia(
|
|
@@ -572,12 +572,12 @@ function Ua(a, e, n, i) {
|
|
|
572
572
|
params: { range: m }
|
|
573
573
|
},
|
|
574
574
|
c
|
|
575
|
-
),
|
|
576
|
-
if (
|
|
575
|
+
), d = H(R, c);
|
|
576
|
+
if (d == null)
|
|
577
577
|
return j.REF;
|
|
578
578
|
N = {
|
|
579
579
|
...c,
|
|
580
|
-
...
|
|
580
|
+
...d
|
|
581
581
|
};
|
|
582
582
|
} else if (r === q.DeleteMoveUp) {
|
|
583
583
|
const R = Ea(
|
|
@@ -586,12 +586,12 @@ function Ua(a, e, n, i) {
|
|
|
586
586
|
params: { range: m }
|
|
587
587
|
},
|
|
588
588
|
c
|
|
589
|
-
),
|
|
590
|
-
if (
|
|
589
|
+
), d = H(R, c);
|
|
590
|
+
if (d == null)
|
|
591
591
|
return j.REF;
|
|
592
592
|
N = {
|
|
593
593
|
...c,
|
|
594
|
-
...
|
|
594
|
+
...d
|
|
595
595
|
};
|
|
596
596
|
} else if (r === q.InsertMoveDown) {
|
|
597
597
|
const R = Ta(
|
|
@@ -600,12 +600,12 @@ function Ua(a, e, n, i) {
|
|
|
600
600
|
params: { range: m }
|
|
601
601
|
},
|
|
602
602
|
c
|
|
603
|
-
),
|
|
604
|
-
if (
|
|
603
|
+
), d = H(R, c);
|
|
604
|
+
if (d == null)
|
|
605
605
|
return;
|
|
606
606
|
N = {
|
|
607
607
|
...c,
|
|
608
|
-
...
|
|
608
|
+
...d
|
|
609
609
|
};
|
|
610
610
|
} else if (r === q.InsertMoveRight) {
|
|
611
611
|
const R = Pa(
|
|
@@ -614,12 +614,12 @@ function Ua(a, e, n, i) {
|
|
|
614
614
|
params: { range: m }
|
|
615
615
|
},
|
|
616
616
|
c
|
|
617
|
-
),
|
|
618
|
-
if (
|
|
617
|
+
), d = H(R, c);
|
|
618
|
+
if (d == null)
|
|
619
619
|
return;
|
|
620
620
|
N = {
|
|
621
621
|
...c,
|
|
622
|
-
...
|
|
622
|
+
...d
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
625
|
}
|
|
@@ -631,13 +631,13 @@ function Ua(a, e, n, i) {
|
|
|
631
631
|
});
|
|
632
632
|
}
|
|
633
633
|
function lt(a, e, n, i, r, o) {
|
|
634
|
-
const { startRow: u, endRow: m, startColumn: f, endColumn: s, rangeType:
|
|
634
|
+
const { startRow: u, endRow: m, startColumn: f, endColumn: s, rangeType: p } = Ae(e), {
|
|
635
635
|
startRow: T,
|
|
636
636
|
startColumn: P,
|
|
637
637
|
endRow: E,
|
|
638
638
|
endColumn: I,
|
|
639
639
|
rangeType: S = Y.NORMAL
|
|
640
|
-
} = Ae(n), { startRow: c, startColumn: N, endRow: R, endColumn:
|
|
640
|
+
} = Ae(n), { startRow: c, startColumn: N, endRow: R, endColumn: d } = Ae(i), {
|
|
641
641
|
startRow: O,
|
|
642
642
|
endRow: M,
|
|
643
643
|
startColumn: F,
|
|
@@ -650,10 +650,10 @@ function lt(a, e, n, i, r, o) {
|
|
|
650
650
|
rangeType: Q = Y.NORMAL
|
|
651
651
|
} = Ae(r), b = { ...r };
|
|
652
652
|
function Le() {
|
|
653
|
-
return
|
|
653
|
+
return p === Y.COLUMN && Q === Y.COLUMN ? !0 : f >= h && s <= V;
|
|
654
654
|
}
|
|
655
655
|
function ae() {
|
|
656
|
-
return
|
|
656
|
+
return p === Y.ROW && Q === Y.ROW ? !0 : u >= g && m <= x;
|
|
657
657
|
}
|
|
658
658
|
if (a === 0)
|
|
659
659
|
if (Le())
|
|
@@ -695,12 +695,12 @@ function lt(a, e, n, i, r, o) {
|
|
|
695
695
|
return;
|
|
696
696
|
else
|
|
697
697
|
return;
|
|
698
|
-
else a === 4 ? (b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = s) : P <= h && I >= V || S === Y.ROW && Q === Y.ROW ? n.endRow < g ? (c >= g && (b.startRow -= E - T + 1), c >= 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 && (c <= g ? b.startRow += E - T + 1 : c >= x && (b.endRow -= E - T + 1)) : T <= g && E >= x || S === Y.COLUMN && Q === Y.COLUMN ? n.endColumn < h ? (N >= h && (b.startColumn -= I - P + 1), N >= V && (b.endColumn -= I - P + 1)) : n.startColumn > V ? (
|
|
698
|
+
else a === 4 ? (b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = s) : P <= h && I >= V || S === Y.ROW && Q === Y.ROW ? n.endRow < g ? (c >= g && (b.startRow -= E - T + 1), c >= 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 && (c <= g ? b.startRow += E - T + 1 : c >= x && (b.endRow -= E - T + 1)) : T <= g && E >= x || S === Y.COLUMN && Q === Y.COLUMN ? n.endColumn < h ? (N >= h && (b.startColumn -= I - P + 1), N >= V && (b.endColumn -= I - P + 1)) : n.startColumn > V ? (d <= V && (b.endColumn += I - P + 1), d <= h && (b.startColumn += I - P + 1)) : n.startColumn >= h && n.endColumn <= V && (N <= h ? b.startColumn += I - P + 1 : N >= V && (b.endColumn -= I - P + 1)) : ((N <= U + 1 && d >= V || N <= h && d >= F - 1) && c <= g && R >= x || (c <= M + 1 && R >= x || c <= g && R >= O - 1) && N <= h && d >= V, b.startRow = u, b.startColumn = f, b.endRow = m, b.endColumn = s);
|
|
699
699
|
return b;
|
|
700
700
|
}
|
|
701
701
|
function st(a, e) {
|
|
702
702
|
const n = Ee(a.startRow), i = Ie(a.endRow), r = Ee(a.startColumn), o = Ie(a.endColumn), u = Ee(e.startRow), m = Ie(e.endRow), f = Ee(e.startColumn), s = Ie(e.endColumn);
|
|
703
|
-
function
|
|
703
|
+
function p() {
|
|
704
704
|
return a.rangeType === Y.COLUMN && e.rangeType === Y.COLUMN ? !0 : n >= u && i <= m;
|
|
705
705
|
}
|
|
706
706
|
function T() {
|
|
@@ -709,7 +709,7 @@ function st(a, e) {
|
|
|
709
709
|
function P() {
|
|
710
710
|
return a.rangeType === Y.ALL && e.rangeType === Y.ALL;
|
|
711
711
|
}
|
|
712
|
-
return
|
|
712
|
+
return p() && T() || P() ? 4 : T() && n >= u && n <= m && i > m ? 0 : T() && i >= u && i <= m && n < u ? 1 : p() && r >= f && r <= s && o > s ? 2 : p() && o >= f && o <= s && r < f ? 3 : null;
|
|
713
713
|
}
|
|
714
714
|
function Ee(a) {
|
|
715
715
|
return isNaN(a) ? -1 / 0 : a;
|
|
@@ -732,49 +732,49 @@ function Fa(a, e) {
|
|
|
732
732
|
let i = null;
|
|
733
733
|
switch (n) {
|
|
734
734
|
case on.id:
|
|
735
|
-
i =
|
|
735
|
+
i = Pi(e, a);
|
|
736
736
|
break;
|
|
737
737
|
case rn.id:
|
|
738
|
-
i =
|
|
738
|
+
i = Ti(e, a);
|
|
739
739
|
break;
|
|
740
740
|
case nn.id:
|
|
741
|
-
i =
|
|
741
|
+
i = Ei(e, a);
|
|
742
742
|
break;
|
|
743
743
|
case an.id:
|
|
744
|
-
i =
|
|
744
|
+
i = Ii(e);
|
|
745
745
|
break;
|
|
746
746
|
case tn.id:
|
|
747
|
-
i =
|
|
747
|
+
i = Ni(e);
|
|
748
748
|
break;
|
|
749
749
|
case en.id:
|
|
750
|
-
i =
|
|
750
|
+
i = Ri(e, a);
|
|
751
751
|
break;
|
|
752
752
|
case Ja.id:
|
|
753
|
-
i =
|
|
753
|
+
i = Ai(e, a);
|
|
754
754
|
break;
|
|
755
755
|
case Za.id:
|
|
756
|
-
i =
|
|
756
|
+
i = Si(e, a);
|
|
757
757
|
break;
|
|
758
758
|
case za.id:
|
|
759
|
-
i =
|
|
759
|
+
i = Ci(e, a);
|
|
760
760
|
break;
|
|
761
761
|
case ja.id:
|
|
762
|
-
i =
|
|
762
|
+
i = Di(e, a);
|
|
763
763
|
break;
|
|
764
764
|
case $a.id:
|
|
765
|
-
i =
|
|
765
|
+
i = bi(e, a);
|
|
766
766
|
break;
|
|
767
767
|
case Qa.id:
|
|
768
|
-
i =
|
|
768
|
+
i = Oi(e, a);
|
|
769
769
|
break;
|
|
770
770
|
case ka.id:
|
|
771
|
-
i =
|
|
771
|
+
i = Mi(e, a);
|
|
772
772
|
break;
|
|
773
773
|
case Da.id:
|
|
774
|
-
i =
|
|
774
|
+
i = xi(e, a);
|
|
775
775
|
break;
|
|
776
776
|
case Ca.id:
|
|
777
|
-
i =
|
|
777
|
+
i = _i(e, a);
|
|
778
778
|
break;
|
|
779
779
|
}
|
|
780
780
|
return i;
|
|
@@ -787,7 +787,7 @@ function Z(a) {
|
|
|
787
787
|
sheetId: n
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Pi(a, e) {
|
|
791
791
|
const { params: n } = a;
|
|
792
792
|
if (!n) return null;
|
|
793
793
|
const { fromRange: i, toRange: r } = n;
|
|
@@ -801,7 +801,7 @@ function ci(a, e) {
|
|
|
801
801
|
sheetId: u
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function Ti(a, e) {
|
|
805
805
|
const { params: n } = a;
|
|
806
806
|
if (!n) return null;
|
|
807
807
|
const {
|
|
@@ -809,7 +809,7 @@ function li(a, e) {
|
|
|
809
809
|
toRange: { startRow: o, endRow: u }
|
|
810
810
|
} = n, m = e.getUnitId(), f = e.getActiveSheet();
|
|
811
811
|
if (!f) return null;
|
|
812
|
-
const s = f.getSheetId(),
|
|
812
|
+
const s = f.getSheetId(), p = {
|
|
813
813
|
startRow: i,
|
|
814
814
|
startColumn: 0,
|
|
815
815
|
endRow: r,
|
|
@@ -824,13 +824,13 @@ function li(a, e) {
|
|
|
824
824
|
};
|
|
825
825
|
return {
|
|
826
826
|
type: q.MoveRows,
|
|
827
|
-
from:
|
|
827
|
+
from: p,
|
|
828
828
|
to: T,
|
|
829
829
|
unitId: m,
|
|
830
830
|
sheetId: s
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function Ei(a, e) {
|
|
834
834
|
const { params: n } = a;
|
|
835
835
|
if (!n) return null;
|
|
836
836
|
const {
|
|
@@ -838,7 +838,7 @@ function si(a, e) {
|
|
|
838
838
|
toRange: { startColumn: o, endColumn: u }
|
|
839
839
|
} = n, m = e.getUnitId(), f = e.getActiveSheet();
|
|
840
840
|
if (!f) return null;
|
|
841
|
-
const s = f.getSheetId(),
|
|
841
|
+
const s = f.getSheetId(), p = {
|
|
842
842
|
startRow: 0,
|
|
843
843
|
startColumn: i,
|
|
844
844
|
endRow: f.getRowCount() - 1,
|
|
@@ -853,13 +853,13 @@ function si(a, e) {
|
|
|
853
853
|
};
|
|
854
854
|
return {
|
|
855
855
|
type: q.MoveCols,
|
|
856
|
-
from:
|
|
856
|
+
from: p,
|
|
857
857
|
to: T,
|
|
858
858
|
unitId: m,
|
|
859
859
|
sheetId: s
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function Ii(a) {
|
|
863
863
|
const { params: e } = a;
|
|
864
864
|
if (!e) return null;
|
|
865
865
|
const { range: n, unitId: i, subUnitId: r } = e;
|
|
@@ -870,7 +870,7 @@ function pi(a) {
|
|
|
870
870
|
sheetId: r
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Ni(a) {
|
|
874
874
|
const { params: e } = a;
|
|
875
875
|
if (!e) return null;
|
|
876
876
|
const { range: n, unitId: i, subUnitId: r } = e;
|
|
@@ -881,7 +881,7 @@ function di(a) {
|
|
|
881
881
|
sheetId: r
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Ri(a, e) {
|
|
885
885
|
const { params: n } = a;
|
|
886
886
|
if (!n) return null;
|
|
887
887
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -892,7 +892,7 @@ function Li(a, e) {
|
|
|
892
892
|
sheetId: o
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Ai(a, e) {
|
|
896
896
|
const { params: n } = a;
|
|
897
897
|
if (!n) return null;
|
|
898
898
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -903,7 +903,7 @@ function Pi(a, e) {
|
|
|
903
903
|
sheetId: o
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Si(a, e) {
|
|
907
907
|
const { params: n } = a;
|
|
908
908
|
if (!n) return null;
|
|
909
909
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -914,7 +914,7 @@ function Ti(a, e) {
|
|
|
914
914
|
sheetId: o
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function Ci(a, e) {
|
|
918
918
|
const { params: n } = a;
|
|
919
919
|
if (!n) return null;
|
|
920
920
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -925,7 +925,7 @@ function Ei(a, e) {
|
|
|
925
925
|
sheetId: o
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Di(a, e) {
|
|
929
929
|
const { params: n } = a;
|
|
930
930
|
if (!n) return null;
|
|
931
931
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -936,7 +936,7 @@ function Ii(a, e) {
|
|
|
936
936
|
sheetId: o
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function bi(a, e) {
|
|
940
940
|
const { params: n } = a;
|
|
941
941
|
if (!n) return null;
|
|
942
942
|
const { range: i } = n, { unitId: r, sheetId: o } = Z(e);
|
|
@@ -947,7 +947,7 @@ function Ni(a, e) {
|
|
|
947
947
|
sheetId: o
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function Oi(a, e) {
|
|
951
951
|
const { params: n } = a;
|
|
952
952
|
if (!n) return null;
|
|
953
953
|
const { unitId: i, subUnitId: r, name: o } = n, { unitId: u, sheetId: m } = Z(e);
|
|
@@ -958,7 +958,7 @@ function Ri(a, e) {
|
|
|
958
958
|
sheetName: o
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Mi(a, e) {
|
|
962
962
|
const { params: n } = a;
|
|
963
963
|
if (!n) return null;
|
|
964
964
|
const { unitId: i, subUnitId: r } = n, { unitId: o, sheetId: u } = Z(e);
|
|
@@ -968,7 +968,7 @@ function Ai(a, e) {
|
|
|
968
968
|
sheetId: r || u
|
|
969
969
|
};
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function xi(a, e) {
|
|
972
972
|
const { params: n } = a;
|
|
973
973
|
if (!n) return null;
|
|
974
974
|
const { unitId: i, name: r, id: o } = n, { sheetId: u } = Z(e);
|
|
@@ -980,7 +980,7 @@ function Si(a, e) {
|
|
|
980
980
|
definedNameId: o
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function _i(a, e) {
|
|
984
984
|
const { params: n } = a;
|
|
985
985
|
if (!n) return null;
|
|
986
986
|
const { unitId: i, name: r, id: o } = n, { sheetId: u } = Z(e);
|
|
@@ -992,8 +992,8 @@ function Ci(a, e) {
|
|
|
992
992
|
definedNameId: o
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
|
-
var
|
|
996
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
995
|
+
var yi = Object.getOwnPropertyDescriptor, qi = (a, e, n, i) => {
|
|
996
|
+
for (var r = i > 1 ? void 0 : i ? yi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
997
997
|
(u = a[o]) && (r = u(r) || r);
|
|
998
998
|
return r;
|
|
999
999
|
}, Ue = (a, e) => (n, i) => e(n, i, a);
|
|
@@ -1039,16 +1039,16 @@ let We = class extends te {
|
|
|
1039
1039
|
const u = [], m = [];
|
|
1040
1040
|
return Object.values(o).forEach((f) => {
|
|
1041
1041
|
var c;
|
|
1042
|
-
const { formulaOrRefString: s } = f,
|
|
1043
|
-
if (
|
|
1042
|
+
const { formulaOrRefString: s } = f, p = this._lexerTreeBuilder.sequenceNodesBuilder(s);
|
|
1043
|
+
if (p == null)
|
|
1044
1044
|
return !0;
|
|
1045
1045
|
let T = !1;
|
|
1046
1046
|
const P = [];
|
|
1047
|
-
for (let N = 0, R =
|
|
1048
|
-
const
|
|
1049
|
-
if (typeof
|
|
1047
|
+
for (let N = 0, R = p.length; N < R; N++) {
|
|
1048
|
+
const d = p[N];
|
|
1049
|
+
if (typeof d == "string" || d.nodeType !== J.REFERENCE)
|
|
1050
1050
|
continue;
|
|
1051
|
-
const { token: O } =
|
|
1051
|
+
const { token: O } = d, M = se(O), { range: F, sheetName: U, unitId: g } = M, x = ((c = a.getSheetBySheetName(U)) == null ? void 0 : c.getSheetId()) || "", h = {
|
|
1052
1052
|
range: F,
|
|
1053
1053
|
sheetId: x,
|
|
1054
1054
|
unitId: g,
|
|
@@ -1078,14 +1078,14 @@ let We = class extends te {
|
|
|
1078
1078
|
i,
|
|
1079
1079
|
r
|
|
1080
1080
|
);
|
|
1081
|
-
V != null && (
|
|
1082
|
-
...
|
|
1081
|
+
V != null && (p[N] = {
|
|
1082
|
+
...d,
|
|
1083
1083
|
token: V
|
|
1084
1084
|
}, T = !0, P.push(N));
|
|
1085
1085
|
}
|
|
1086
1086
|
if (!T)
|
|
1087
1087
|
return !0;
|
|
1088
|
-
const E = we(ha(
|
|
1088
|
+
const E = we(ha(p, P)), I = {
|
|
1089
1089
|
id: Me.id,
|
|
1090
1090
|
params: {
|
|
1091
1091
|
unitId: i,
|
|
@@ -1113,27 +1113,27 @@ let We = class extends te {
|
|
|
1113
1113
|
return ((o = this._definedNamesService.getWorksheetByRef(e, i)) == null ? void 0 : o.getSheetId()) === n ? j.REF : null;
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
|
-
We =
|
|
1116
|
+
We = qi([
|
|
1117
1117
|
Ue(0, yt),
|
|
1118
1118
|
Ue(1, xe),
|
|
1119
|
-
Ue(2,
|
|
1120
|
-
Ue(3,
|
|
1119
|
+
Ue(2, X(xt)),
|
|
1120
|
+
Ue(3, X(qt))
|
|
1121
1121
|
], We);
|
|
1122
|
-
var Ce = /* @__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))(Ce || {}),
|
|
1123
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1122
|
+
var Ce = /* @__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))(Ce || {}), gi = Object.getOwnPropertyDescriptor, hi = (a, e, n, i) => {
|
|
1123
|
+
for (var r = i > 1 ? void 0 : i ? gi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
1124
1124
|
(u = a[o]) && (r = u(r) || r);
|
|
1125
1125
|
return r;
|
|
1126
1126
|
}, pt = (a, e) => (n, i) => e(n, i, a);
|
|
1127
1127
|
let Ke = class extends te {
|
|
1128
1128
|
constructor(e, n, i) {
|
|
1129
1129
|
super();
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1130
|
+
w(this, "_formulaCacheMap", /* @__PURE__ */ new Map());
|
|
1131
|
+
w(this, "_formulaChangeWithRange$", new ta());
|
|
1132
|
+
w(this, "formulaChangeWithRange$", this._formulaChangeWithRange$.asObservable());
|
|
1133
1133
|
// FIXME: this design could be improved.
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1134
|
+
w(this, "_formulaResult$", new ta());
|
|
1135
|
+
w(this, "formulaResult$", this._formulaResult$.asObservable());
|
|
1136
|
+
w(this, "calculateStarted$", new _a(!1));
|
|
1137
1137
|
this._commandService = e, this._activeDirtyManagerService = n, this._lifecycleService = i, this._initFormulaRegister(), this._initFormulaCalculationResultChange();
|
|
1138
1138
|
}
|
|
1139
1139
|
dispose() {
|
|
@@ -1182,7 +1182,7 @@ let Ke = class extends te {
|
|
|
1182
1182
|
});
|
|
1183
1183
|
};
|
|
1184
1184
|
this.disposeWithMe(
|
|
1185
|
-
this._formulaChangeWithRange$.pipe(
|
|
1185
|
+
this._formulaChangeWithRange$.pipe(Hn(() => this.calculateStarted$.pipe(aa((n) => n)))).subscribe((n) => n.forEach(e))
|
|
1186
1186
|
), this.disposeWithMe(
|
|
1187
1187
|
this._formulaChangeWithRange$.pipe(aa(() => this.calculateStarted$.getValue())).subscribe(e)
|
|
1188
1188
|
);
|
|
@@ -1195,18 +1195,18 @@ let Ke = class extends te {
|
|
|
1195
1195
|
const u = i[o], m = {};
|
|
1196
1196
|
r[o] = m;
|
|
1197
1197
|
for (const f in u) {
|
|
1198
|
-
const s = this._ensureCacheMap(o, f),
|
|
1198
|
+
const s = this._ensureCacheMap(o, f), p = u[f], T = [];
|
|
1199
1199
|
m[f] = T;
|
|
1200
|
-
for (const P in
|
|
1201
|
-
const E =
|
|
1200
|
+
for (const P in p) {
|
|
1201
|
+
const E = p[P];
|
|
1202
1202
|
if (s.has(P)) {
|
|
1203
1203
|
const I = s.get(P);
|
|
1204
1204
|
if (!I)
|
|
1205
1205
|
continue;
|
|
1206
1206
|
I.result || (I.result = {});
|
|
1207
1207
|
const S = new W(E), c = new W(I.result);
|
|
1208
|
-
S.forValue((N, R,
|
|
1209
|
-
c.setValue(N, R,
|
|
1208
|
+
S.forValue((N, R, d) => {
|
|
1209
|
+
c.setValue(N, R, d);
|
|
1210
1210
|
}), I.status = Ce.SUCCESS, I.callbacks.forEach((N) => {
|
|
1211
1211
|
N(E);
|
|
1212
1212
|
}), I.callbacks.clear(), T.push(I);
|
|
@@ -1256,26 +1256,25 @@ let Ke = class extends te {
|
|
|
1256
1256
|
return this._ensureCacheMap(e, n).get(i);
|
|
1257
1257
|
}
|
|
1258
1258
|
};
|
|
1259
|
-
Ke =
|
|
1259
|
+
Ke = hi([
|
|
1260
1260
|
pt(0, de),
|
|
1261
1261
|
pt(1, gt),
|
|
1262
|
-
pt(2,
|
|
1262
|
+
pt(2, X(Ha))
|
|
1263
1263
|
], Ke);
|
|
1264
1264
|
const ot = "sheets-formula.base.config";
|
|
1265
|
-
var
|
|
1266
|
-
const na = {},
|
|
1267
|
-
var
|
|
1268
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1265
|
+
var pe = /* @__PURE__ */ ((a) => (a[a.FORCED = 0] = "FORCED", a[a.WHEN_EMPTY = 1] = "WHEN_EMPTY", a[a.NO_CALCULATION = 2] = "NO_CALCULATION", a))(pe || {});
|
|
1266
|
+
const na = {}, Ui = "sheets-formula.remote.config", ia = {};
|
|
1267
|
+
var Fi = Object.getOwnPropertyDescriptor, Bi = (a, e, n, i) => {
|
|
1268
|
+
for (var r = i > 1 ? void 0 : i ? Fi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
1269
1269
|
(u = a[o]) && (r = u(r) || r);
|
|
1270
1270
|
return r;
|
|
1271
|
-
},
|
|
1271
|
+
}, ce = (a, e) => (n, i) => e(n, i, a);
|
|
1272
1272
|
const ra = { done: 0, count: 0 }, dt = { onlyLocal: !0 };
|
|
1273
1273
|
let Oe = class extends te {
|
|
1274
1274
|
constructor(e, n, i, r, o, u, m) {
|
|
1275
|
-
var s;
|
|
1276
1275
|
super();
|
|
1277
|
-
|
|
1278
|
-
|
|
1276
|
+
w(this, "_waitingCommandQueue", []);
|
|
1277
|
+
w(this, "_executingDirtyData", {
|
|
1279
1278
|
forceCalculation: !1,
|
|
1280
1279
|
dirtyRanges: [],
|
|
1281
1280
|
dirtyNameMap: {},
|
|
@@ -1284,22 +1283,19 @@ let Oe = class extends te {
|
|
|
1284
1283
|
dirtyUnitOtherFormulaMap: {},
|
|
1285
1284
|
clearDependencyTreeCache: {}
|
|
1286
1285
|
});
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
X(this, "_calculationMode", ne.WHEN_EMPTY);
|
|
1286
|
+
w(this, "_setTimeoutKey", -1);
|
|
1287
|
+
w(this, "_startExecutionTime", 0);
|
|
1288
|
+
w(this, "_totalCalculationTaskCount", 0);
|
|
1289
|
+
w(this, "_doneCalculationTaskCount", 0);
|
|
1290
|
+
w(this, "_executionInProgressParams", null);
|
|
1291
|
+
w(this, "_restartCalculation", !1);
|
|
1294
1292
|
/**
|
|
1295
1293
|
* The mark of forced calculation. If a new mutation triggers dirty area calculation during the forced calculation process, forced calculation is still required.
|
|
1296
1294
|
*/
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
this._commandService = e, this._activeDirtyManagerService = n, this._logService = i, this._configService = r, this._formulaDataModel = o, this._localeService = u, this._registerOtherFormulaService = m;
|
|
1301
|
-
const f = this._configService.getConfig(ot);
|
|
1302
|
-
this._calculationMode = (s = f == null ? void 0 : f.initialFormulaComputing) != null ? s : ne.WHEN_EMPTY, this._commandExecutedListener(), this._initialExecuteFormulaProcessListener(), this._initialExecuteFormula();
|
|
1295
|
+
w(this, "_forceCalculating", !1);
|
|
1296
|
+
w(this, "_progress$", new _a(ra));
|
|
1297
|
+
w(this, "progress$", this._progress$.asObservable());
|
|
1298
|
+
this._commandService = e, this._activeDirtyManagerService = n, this._logService = i, this._configService = r, this._formulaDataModel = o, this._localeService = u, this._registerOtherFormulaService = m, this._commandExecutedListener(), this._initialExecuteFormulaProcessListener(), this._initialExecuteFormula();
|
|
1303
1299
|
}
|
|
1304
1300
|
_emitProgress(e) {
|
|
1305
1301
|
this._progress$.next({ done: this._doneCalculationTaskCount, count: this._totalCalculationTaskCount, label: e });
|
|
@@ -1328,11 +1324,16 @@ let Oe = class extends te {
|
|
|
1328
1324
|
dispose() {
|
|
1329
1325
|
super.dispose(), this._progress$.next(ra), this._progress$.complete(), clearTimeout(this._setTimeoutKey);
|
|
1330
1326
|
}
|
|
1327
|
+
_getCalculationMode() {
|
|
1328
|
+
var n;
|
|
1329
|
+
const e = this._configService.getConfig(ot);
|
|
1330
|
+
return (n = e == null ? void 0 : e.initialFormulaComputing) != null ? n : pe.WHEN_EMPTY;
|
|
1331
|
+
}
|
|
1331
1332
|
_commandExecutedListener() {
|
|
1332
1333
|
this.disposeWithMe(
|
|
1333
1334
|
this._commandService.onCommandExecuted((e, n) => {
|
|
1334
1335
|
if (this._activeDirtyManagerService.get(e.id)) {
|
|
1335
|
-
if (e.id ===
|
|
1336
|
+
if (e.id === ne.id) {
|
|
1336
1337
|
const i = e.params;
|
|
1337
1338
|
if (n && n.onlyLocal === !0 || i.trigger === _t.id || i.trigger === ba.id || i.trigger === Oa.id)
|
|
1338
1339
|
return;
|
|
@@ -1351,7 +1352,7 @@ let Oe = class extends te {
|
|
|
1351
1352
|
const s = this._activeDirtyManagerService.get(f.id);
|
|
1352
1353
|
if (s == null)
|
|
1353
1354
|
continue;
|
|
1354
|
-
const
|
|
1355
|
+
const p = s.getDirtyData(f), { dirtyRanges: T, dirtyNameMap: P, dirtyDefinedNameMap: E, dirtyUnitFeatureMap: I, dirtyUnitOtherFormulaMap: S, clearDependencyTreeCache: c } = p;
|
|
1355
1356
|
T != null && this._mergeDirtyRanges(n, T), P != null && this._mergeDirtyNameMap(i, P), E != null && this._mergeDirtyNameMap(r, E), I != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, I), S != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(u, S), c != null && this._mergeDirtyNameMap(m, c);
|
|
1356
1357
|
}
|
|
1357
1358
|
return {
|
|
@@ -1391,8 +1392,8 @@ let Oe = class extends te {
|
|
|
1391
1392
|
let r = !1;
|
|
1392
1393
|
for (const o of e)
|
|
1393
1394
|
if (i.unitId === o.unitId && i.sheetId === o.sheetId) {
|
|
1394
|
-
const { startRow: u, startColumn: m, endRow: f, endColumn: s } = i.range, { startRow:
|
|
1395
|
-
if (u ===
|
|
1395
|
+
const { startRow: u, startColumn: m, endRow: f, endColumn: s } = i.range, { startRow: p, startColumn: T, endRow: P, endColumn: E } = o.range;
|
|
1396
|
+
if (u === p && m === T && f === P && s === E) {
|
|
1396
1397
|
r = !0;
|
|
1397
1398
|
break;
|
|
1398
1399
|
}
|
|
@@ -1434,13 +1435,11 @@ let Oe = class extends te {
|
|
|
1434
1435
|
const {
|
|
1435
1436
|
stage: o
|
|
1436
1437
|
} = r.stageInfo;
|
|
1437
|
-
if (o === ge.START)
|
|
1438
|
-
if (this._calculationMode === ne.NO_CALCULATION)
|
|
1439
|
-
return;
|
|
1438
|
+
if (o === ge.START)
|
|
1440
1439
|
n === 0 && (this._startExecutionTime = performance.now()), n++, e !== null && (clearTimeout(e), e = null), e = setTimeout(() => {
|
|
1441
1440
|
e = null, this._startProgress();
|
|
1442
1441
|
}, 1e3);
|
|
1443
|
-
|
|
1442
|
+
else if (o === ge.CURRENTLY_CALCULATING) {
|
|
1444
1443
|
if (this._executionInProgressParams = r.stageInfo, e === null) {
|
|
1445
1444
|
const u = this._localeService.t("formula.progress.calculating");
|
|
1446
1445
|
this._calculateProgress(u);
|
|
@@ -1494,11 +1493,11 @@ let Oe = class extends te {
|
|
|
1494
1493
|
};
|
|
1495
1494
|
}
|
|
1496
1495
|
_initialExecuteFormula() {
|
|
1497
|
-
const e = this.
|
|
1498
|
-
this._commandService.executeCommand(Se.id,
|
|
1496
|
+
const e = this._getCalculationMode(), n = this._getDirtyDataByCalculationMode(e);
|
|
1497
|
+
this._commandService.executeCommand(Se.id, n, dt), this._registerOtherFormulaService.calculateStarted$.next(!0);
|
|
1499
1498
|
}
|
|
1500
1499
|
_getDirtyDataByCalculationMode(e) {
|
|
1501
|
-
const n = e ===
|
|
1500
|
+
const n = e === pe.FORCED, i = e === pe.WHEN_EMPTY ? this._formulaDataModel.getFormulaDirtyRanges() : [];
|
|
1502
1501
|
return {
|
|
1503
1502
|
forceCalculation: n,
|
|
1504
1503
|
dirtyRanges: i,
|
|
@@ -1511,20 +1510,40 @@ let Oe = class extends te {
|
|
|
1511
1510
|
};
|
|
1512
1511
|
}
|
|
1513
1512
|
};
|
|
1514
|
-
Oe =
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1513
|
+
Oe = Bi([
|
|
1514
|
+
ce(0, de),
|
|
1515
|
+
ce(1, gt),
|
|
1516
|
+
ce(2, Ya),
|
|
1517
|
+
ce(3, _e),
|
|
1518
|
+
ce(4, X(it)),
|
|
1519
|
+
ce(5, X(Ot)),
|
|
1520
|
+
ce(6, X(Ke))
|
|
1522
1521
|
], Oe);
|
|
1523
|
-
|
|
1524
|
-
|
|
1522
|
+
function hr(a, e, n, i) {
|
|
1523
|
+
const r = a.get(Tn), o = a.get(En), u = a.get(In), m = a.get(Nn);
|
|
1524
|
+
r.load({
|
|
1525
|
+
formulaData: {},
|
|
1526
|
+
arrayFormulaCellData: {},
|
|
1527
|
+
arrayFormulaRange: {},
|
|
1528
|
+
forceCalculate: !1,
|
|
1529
|
+
dirtyRanges: [],
|
|
1530
|
+
dirtyNameMap: {},
|
|
1531
|
+
dirtyDefinedNameMap: {},
|
|
1532
|
+
dirtyUnitFeatureMap: {},
|
|
1533
|
+
excludedCell: {},
|
|
1534
|
+
allUnitData: {
|
|
1535
|
+
[n]: i
|
|
1536
|
+
},
|
|
1537
|
+
dirtyUnitOtherFormulaMap: {}
|
|
1538
|
+
});
|
|
1539
|
+
const f = o.treeBuilder(e), s = u.parse(f), p = m.execute(Rn(s));
|
|
1540
|
+
return An(p);
|
|
1541
|
+
}
|
|
1542
|
+
var vi = Object.getOwnPropertyDescriptor, Vi = (a, e, n, i) => {
|
|
1543
|
+
for (var r = i > 1 ? void 0 : i ? vi(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
1525
1544
|
(u = a[o]) && (r = u(r) || r);
|
|
1526
1545
|
return r;
|
|
1527
|
-
},
|
|
1546
|
+
}, ue = (a, e) => (n, i) => e(n, i, a);
|
|
1528
1547
|
let ke = class extends te {
|
|
1529
1548
|
constructor(a, e, n, i, r, o, u, m) {
|
|
1530
1549
|
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();
|
|
@@ -1542,14 +1561,14 @@ let ke = class extends te {
|
|
|
1542
1561
|
})
|
|
1543
1562
|
), this.disposeWithMe(
|
|
1544
1563
|
this._commandService.beforeCommandExecuted((a, e) => {
|
|
1545
|
-
if (a.id ===
|
|
1564
|
+
if (a.id === ne.id) {
|
|
1546
1565
|
const n = a.params;
|
|
1547
1566
|
if (e && e.onlyLocal === !0 || n.trigger === _t.id || n.trigger === ba.id || n.trigger === Oa.id)
|
|
1548
1567
|
return;
|
|
1549
1568
|
this._handleSetRangeValuesMutation(n);
|
|
1550
1569
|
}
|
|
1551
1570
|
})
|
|
1552
|
-
), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ee.UNIVER_SHEET).subscribe((a) => this._handleWorkbookAdded(a))), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ee.UNIVER_SHEET).pipe(
|
|
1571
|
+
), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ee.UNIVER_SHEET).subscribe((a) => this._handleWorkbookAdded(a))), this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ee.UNIVER_SHEET).pipe(Yn((a) => a.getUnitId())).subscribe((a) => this._handleWorkbookDisposed(a)));
|
|
1553
1572
|
}
|
|
1554
1573
|
_handleSetRangeValuesMutation(a) {
|
|
1555
1574
|
const { subUnitId: e, unitId: n, cellValue: i } = a;
|
|
@@ -1561,11 +1580,11 @@ let ke = class extends te {
|
|
|
1561
1580
|
}
|
|
1562
1581
|
};
|
|
1563
1582
|
this._commandService.executeCommand(
|
|
1564
|
-
|
|
1583
|
+
ne.id,
|
|
1565
1584
|
{
|
|
1566
1585
|
unitId: n,
|
|
1567
1586
|
subUnitId: e,
|
|
1568
|
-
cellValue:
|
|
1587
|
+
cellValue: Li(r)
|
|
1569
1588
|
},
|
|
1570
1589
|
{
|
|
1571
1590
|
onlyLocal: !0,
|
|
@@ -1630,14 +1649,14 @@ let ke = class extends te {
|
|
|
1630
1649
|
const e = {}, n = a.getUnitId(), i = { [n]: {} };
|
|
1631
1650
|
a.getSheets().forEach((s) => {
|
|
1632
1651
|
var E;
|
|
1633
|
-
const
|
|
1652
|
+
const p = s.getCellMatrix(), T = s.getSheetId(), P = jt(e, n, T, p);
|
|
1634
1653
|
i[n][T] = (E = P[n]) == null ? void 0 : E[T];
|
|
1635
1654
|
}), this._commandService.executeCommand(he.id, { formulaData: i }, { onlyLocal: !0 });
|
|
1636
|
-
const o = this._configService.getConfig(ot), u = (f = o == null ? void 0 : o.initialFormulaComputing) != null ? f :
|
|
1655
|
+
const o = this._configService.getConfig(ot), u = (f = o == null ? void 0 : o.initialFormulaComputing) != null ? f : pe.WHEN_EMPTY, m = this._getDiryDataByCalculationMode(u);
|
|
1637
1656
|
this._commandService.executeCommand(Se.id, m, { onlyLocal: !0 });
|
|
1638
1657
|
}
|
|
1639
1658
|
_getDiryDataByCalculationMode(a) {
|
|
1640
|
-
const e = a ===
|
|
1659
|
+
const e = a === pe.FORCED, n = a === pe.WHEN_EMPTY ? this._formulaDataModel.getFormulaDirtyRanges() : [];
|
|
1641
1660
|
return {
|
|
1642
1661
|
forceCalculation: e,
|
|
1643
1662
|
dirtyRanges: n,
|
|
@@ -1661,7 +1680,7 @@ let ke = class extends te {
|
|
|
1661
1680
|
r,
|
|
1662
1681
|
i,
|
|
1663
1682
|
n
|
|
1664
|
-
), { undos: u, redos: m } =
|
|
1683
|
+
), { undos: u, redos: m } = Qn(r, o, n);
|
|
1665
1684
|
return {
|
|
1666
1685
|
undos: u,
|
|
1667
1686
|
redos: m
|
|
@@ -1685,17 +1704,17 @@ let ke = class extends te {
|
|
|
1685
1704
|
const f = Object.keys(m);
|
|
1686
1705
|
Ne.isDefine(r[u]) || (r[u] = {}), Ne.isDefine(o[u]) || (o[u] = {});
|
|
1687
1706
|
for (const s of f) {
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1707
|
+
const p = new W(m[s] || {}), T = new W();
|
|
1708
|
+
p.forValue((P, E, I) => {
|
|
1690
1709
|
var U;
|
|
1691
1710
|
if (!I) return !0;
|
|
1692
|
-
const { f: S, x: c, y: N, si: R } = I,
|
|
1693
|
-
if (
|
|
1711
|
+
const { f: S, x: c, y: N, si: R } = I, d = this._lexerTreeBuilder.sequenceNodesBuilder(S);
|
|
1712
|
+
if (d == null)
|
|
1694
1713
|
return !0;
|
|
1695
1714
|
let O = !1;
|
|
1696
1715
|
const M = [];
|
|
1697
|
-
for (let g = 0, x =
|
|
1698
|
-
const h =
|
|
1716
|
+
for (let g = 0, x = d.length; g < x; g++) {
|
|
1717
|
+
const h = d[g];
|
|
1699
1718
|
if (typeof h == "string")
|
|
1700
1719
|
continue;
|
|
1701
1720
|
const { token: V, nodeType: Q } = h, { type: b } = n;
|
|
@@ -1703,17 +1722,17 @@ let ke = class extends te {
|
|
|
1703
1722
|
const { definedNameId: Pe, definedName: Te } = n;
|
|
1704
1723
|
if (Pe === void 0 || Te === void 0)
|
|
1705
1724
|
continue;
|
|
1706
|
-
const
|
|
1707
|
-
if (
|
|
1725
|
+
const me = this._definedNamesService.getValueById(u, Pe);
|
|
1726
|
+
if (me == null || me.name !== V)
|
|
1708
1727
|
continue;
|
|
1709
|
-
|
|
1728
|
+
d[g] = {
|
|
1710
1729
|
...h,
|
|
1711
1730
|
token: b === q.SetDefinedName ? Te : j.REF
|
|
1712
1731
|
}, O = !0, M.push(g);
|
|
1713
1732
|
continue;
|
|
1714
1733
|
} else if (Q !== J.REFERENCE)
|
|
1715
1734
|
continue;
|
|
1716
|
-
const Le =
|
|
1735
|
+
const Le = se(V), { range: ae, sheetName: ie, unitId: k } = Le, re = k == null || k.length === 0 ? u : k, z = ((U = e == null ? void 0 : e[re]) == null ? void 0 : U[ie]) || "";
|
|
1717
1736
|
if (!ga(
|
|
1718
1737
|
n.unitId,
|
|
1719
1738
|
n.sheetId,
|
|
@@ -1727,47 +1746,47 @@ let ke = class extends te {
|
|
|
1727
1746
|
range: ae,
|
|
1728
1747
|
sheetId: z,
|
|
1729
1748
|
unitId: k,
|
|
1730
|
-
sheetName:
|
|
1749
|
+
sheetName: ie,
|
|
1731
1750
|
refOffsetX: c || 0,
|
|
1732
1751
|
refOffsetY: N || 0
|
|
1733
1752
|
};
|
|
1734
|
-
let
|
|
1753
|
+
let oe = null;
|
|
1735
1754
|
if (b === q.SetName) {
|
|
1736
1755
|
const {
|
|
1737
1756
|
unitId: Pe,
|
|
1738
1757
|
sheetId: Te,
|
|
1739
|
-
sheetName:
|
|
1758
|
+
sheetName: me
|
|
1740
1759
|
} = n;
|
|
1741
|
-
if (
|
|
1760
|
+
if (me == null || z == null || z.length === 0 || Te !== z)
|
|
1742
1761
|
continue;
|
|
1743
|
-
|
|
1762
|
+
oe = nt({
|
|
1744
1763
|
range: ae,
|
|
1745
|
-
sheetName:
|
|
1764
|
+
sheetName: me,
|
|
1746
1765
|
unitId: k
|
|
1747
1766
|
});
|
|
1748
1767
|
} else if (b === q.RemoveSheet) {
|
|
1749
1768
|
const {
|
|
1750
1769
|
unitId: Pe,
|
|
1751
1770
|
sheetId: Te,
|
|
1752
|
-
sheetName:
|
|
1771
|
+
sheetName: me
|
|
1753
1772
|
} = n;
|
|
1754
1773
|
if (z == null || z.length === 0 || Te !== z)
|
|
1755
1774
|
continue;
|
|
1756
|
-
|
|
1757
|
-
} else b !== q.SetDefinedName && (
|
|
1775
|
+
oe = j.REF;
|
|
1776
|
+
} else b !== q.SetDefinedName && (oe = Ua(
|
|
1758
1777
|
ye,
|
|
1759
1778
|
n,
|
|
1760
1779
|
u,
|
|
1761
1780
|
s
|
|
1762
1781
|
));
|
|
1763
|
-
|
|
1782
|
+
oe != null && (d[g] = {
|
|
1764
1783
|
...h,
|
|
1765
|
-
token:
|
|
1784
|
+
token: oe
|
|
1766
1785
|
}, O = !0, M.push(g));
|
|
1767
1786
|
}
|
|
1768
1787
|
if (!O)
|
|
1769
1788
|
return !0;
|
|
1770
|
-
const F = ha(
|
|
1789
|
+
const F = ha(d, M, c, N);
|
|
1771
1790
|
T.setValue(P, E, {
|
|
1772
1791
|
f: `=${we(F)}`
|
|
1773
1792
|
});
|
|
@@ -1777,17 +1796,17 @@ let ke = class extends te {
|
|
|
1777
1796
|
return { newFormulaData: o };
|
|
1778
1797
|
}
|
|
1779
1798
|
};
|
|
1780
|
-
ke =
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1799
|
+
ke = Vi([
|
|
1800
|
+
ue(0, xe),
|
|
1801
|
+
ue(1, de),
|
|
1802
|
+
ue(2, X(qt)),
|
|
1803
|
+
ue(3, X(it)),
|
|
1804
|
+
ue(4, X(xt)),
|
|
1805
|
+
ue(5, yt),
|
|
1806
|
+
ue(6, _e),
|
|
1807
|
+
ue(7, X(at))
|
|
1789
1808
|
], ke);
|
|
1790
|
-
const
|
|
1809
|
+
const Gi = [
|
|
1791
1810
|
{
|
|
1792
1811
|
functionName: zt.ARRAY_CONSTRAIN,
|
|
1793
1812
|
functionType: t.Array,
|
|
@@ -1839,7 +1858,7 @@ const hi = [
|
|
|
1839
1858
|
}
|
|
1840
1859
|
]
|
|
1841
1860
|
}
|
|
1842
|
-
],
|
|
1861
|
+
], Hi = [
|
|
1843
1862
|
{
|
|
1844
1863
|
functionName: _.BETADIST,
|
|
1845
1864
|
functionType: t.Compatibility,
|
|
@@ -2893,9 +2912,9 @@ const hi = [
|
|
|
2893
2912
|
}
|
|
2894
2913
|
]
|
|
2895
2914
|
}
|
|
2896
|
-
],
|
|
2915
|
+
], Yi = [
|
|
2897
2916
|
{
|
|
2898
|
-
functionName:
|
|
2917
|
+
functionName: fe.CUBEKPIMEMBER,
|
|
2899
2918
|
functionType: t.Cube,
|
|
2900
2919
|
description: "formula.functionList.CUBEKPIMEMBER.description",
|
|
2901
2920
|
abstract: "formula.functionList.CUBEKPIMEMBER.abstract",
|
|
@@ -2917,7 +2936,7 @@ const hi = [
|
|
|
2917
2936
|
]
|
|
2918
2937
|
},
|
|
2919
2938
|
{
|
|
2920
|
-
functionName:
|
|
2939
|
+
functionName: fe.CUBEMEMBER,
|
|
2921
2940
|
functionType: t.Cube,
|
|
2922
2941
|
description: "formula.functionList.CUBEMEMBER.description",
|
|
2923
2942
|
abstract: "formula.functionList.CUBEMEMBER.abstract",
|
|
@@ -2939,7 +2958,7 @@ const hi = [
|
|
|
2939
2958
|
]
|
|
2940
2959
|
},
|
|
2941
2960
|
{
|
|
2942
|
-
functionName:
|
|
2961
|
+
functionName: fe.CUBEMEMBERPROPERTY,
|
|
2943
2962
|
functionType: t.Cube,
|
|
2944
2963
|
description: "formula.functionList.CUBEMEMBERPROPERTY.description",
|
|
2945
2964
|
abstract: "formula.functionList.CUBEMEMBERPROPERTY.abstract",
|
|
@@ -2961,7 +2980,7 @@ const hi = [
|
|
|
2961
2980
|
]
|
|
2962
2981
|
},
|
|
2963
2982
|
{
|
|
2964
|
-
functionName:
|
|
2983
|
+
functionName: fe.CUBERANKEDMEMBER,
|
|
2965
2984
|
functionType: t.Cube,
|
|
2966
2985
|
description: "formula.functionList.CUBERANKEDMEMBER.description",
|
|
2967
2986
|
abstract: "formula.functionList.CUBERANKEDMEMBER.abstract",
|
|
@@ -2983,7 +3002,7 @@ const hi = [
|
|
|
2983
3002
|
]
|
|
2984
3003
|
},
|
|
2985
3004
|
{
|
|
2986
|
-
functionName:
|
|
3005
|
+
functionName: fe.CUBESET,
|
|
2987
3006
|
functionType: t.Cube,
|
|
2988
3007
|
description: "formula.functionList.CUBESET.description",
|
|
2989
3008
|
abstract: "formula.functionList.CUBESET.abstract",
|
|
@@ -3005,7 +3024,7 @@ const hi = [
|
|
|
3005
3024
|
]
|
|
3006
3025
|
},
|
|
3007
3026
|
{
|
|
3008
|
-
functionName:
|
|
3027
|
+
functionName: fe.CUBESETCOUNT,
|
|
3009
3028
|
functionType: t.Cube,
|
|
3010
3029
|
description: "formula.functionList.CUBESETCOUNT.description",
|
|
3011
3030
|
abstract: "formula.functionList.CUBESETCOUNT.abstract",
|
|
@@ -3027,7 +3046,7 @@ const hi = [
|
|
|
3027
3046
|
]
|
|
3028
3047
|
},
|
|
3029
3048
|
{
|
|
3030
|
-
functionName:
|
|
3049
|
+
functionName: fe.CUBEVALUE,
|
|
3031
3050
|
functionType: t.Cube,
|
|
3032
3051
|
description: "formula.functionList.CUBEVALUE.description",
|
|
3033
3052
|
abstract: "formula.functionList.CUBEVALUE.abstract",
|
|
@@ -3048,7 +3067,7 @@ const hi = [
|
|
|
3048
3067
|
}
|
|
3049
3068
|
]
|
|
3050
3069
|
}
|
|
3051
|
-
],
|
|
3070
|
+
], Xi = [
|
|
3052
3071
|
{
|
|
3053
3072
|
functionName: $.DAVERAGE,
|
|
3054
3073
|
functionType: t.Database,
|
|
@@ -3397,7 +3416,7 @@ const hi = [
|
|
|
3397
3416
|
}
|
|
3398
3417
|
]
|
|
3399
3418
|
}
|
|
3400
|
-
],
|
|
3419
|
+
], wi = [
|
|
3401
3420
|
{
|
|
3402
3421
|
functionName: B.DATE,
|
|
3403
3422
|
functionType: t.Date,
|
|
@@ -3969,7 +3988,7 @@ const hi = [
|
|
|
3969
3988
|
}
|
|
3970
3989
|
]
|
|
3971
3990
|
}
|
|
3972
|
-
],
|
|
3991
|
+
], Wi = [
|
|
3973
3992
|
{
|
|
3974
3993
|
functionName: A.BESSELI,
|
|
3975
3994
|
functionType: t.Engineering,
|
|
@@ -5042,7 +5061,7 @@ const hi = [
|
|
|
5042
5061
|
}
|
|
5043
5062
|
]
|
|
5044
5063
|
}
|
|
5045
|
-
],
|
|
5064
|
+
], Ki = [
|
|
5046
5065
|
{
|
|
5047
5066
|
functionName: C.ACCRINT,
|
|
5048
5067
|
functionType: t.Financial,
|
|
@@ -7303,7 +7322,7 @@ const hi = [
|
|
|
7303
7322
|
}
|
|
7304
7323
|
]
|
|
7305
7324
|
}
|
|
7306
|
-
],
|
|
7325
|
+
], ki = [
|
|
7307
7326
|
{
|
|
7308
7327
|
functionName: v.CELL,
|
|
7309
7328
|
functionType: t.Information,
|
|
@@ -7712,7 +7731,7 @@ const hi = [
|
|
|
7712
7731
|
}
|
|
7713
7732
|
]
|
|
7714
7733
|
}
|
|
7715
|
-
],
|
|
7734
|
+
], Qi = [
|
|
7716
7735
|
{
|
|
7717
7736
|
functionName: K.AND,
|
|
7718
7737
|
functionType: t.Logical,
|
|
@@ -8186,7 +8205,7 @@ const hi = [
|
|
|
8186
8205
|
}
|
|
8187
8206
|
]
|
|
8188
8207
|
}
|
|
8189
|
-
],
|
|
8208
|
+
], $i = [
|
|
8190
8209
|
{
|
|
8191
8210
|
functionName: y.ADDRESS,
|
|
8192
8211
|
functionType: t.Lookup,
|
|
@@ -9218,7 +9237,7 @@ const hi = [
|
|
|
9218
9237
|
}
|
|
9219
9238
|
]
|
|
9220
9239
|
}
|
|
9221
|
-
],
|
|
9240
|
+
], ji = [
|
|
9222
9241
|
{
|
|
9223
9242
|
functionName: L.ABS,
|
|
9224
9243
|
functionType: t.Math,
|
|
@@ -10856,7 +10875,7 @@ const hi = [
|
|
|
10856
10875
|
}
|
|
10857
10876
|
]
|
|
10858
10877
|
}
|
|
10859
|
-
],
|
|
10878
|
+
], zi = [
|
|
10860
10879
|
{
|
|
10861
10880
|
functionName: l.AVEDEV,
|
|
10862
10881
|
functionType: t.Statistical,
|
|
@@ -13798,7 +13817,7 @@ const hi = [
|
|
|
13798
13817
|
}
|
|
13799
13818
|
]
|
|
13800
13819
|
}
|
|
13801
|
-
],
|
|
13820
|
+
], Zi = [
|
|
13802
13821
|
{
|
|
13803
13822
|
functionName: D.ASC,
|
|
13804
13823
|
functionType: t.Text,
|
|
@@ -15012,7 +15031,7 @@ const hi = [
|
|
|
15012
15031
|
}
|
|
15013
15032
|
]
|
|
15014
15033
|
}
|
|
15015
|
-
],
|
|
15034
|
+
], Ji = [], er = [
|
|
15016
15035
|
{
|
|
15017
15036
|
functionName: ft.ENCODEURL,
|
|
15018
15037
|
functionType: t.Web,
|
|
@@ -15072,36 +15091,36 @@ const hi = [
|
|
|
15072
15091
|
}
|
|
15073
15092
|
]
|
|
15074
15093
|
}
|
|
15075
|
-
],
|
|
15076
|
-
...
|
|
15077
|
-
...vi,
|
|
15094
|
+
], tr = [
|
|
15095
|
+
...Ki,
|
|
15078
15096
|
...wi,
|
|
15079
|
-
...
|
|
15097
|
+
...ji,
|
|
15098
|
+
...zi,
|
|
15099
|
+
...$i,
|
|
15080
15100
|
...Xi,
|
|
15081
|
-
...
|
|
15082
|
-
...
|
|
15101
|
+
...Zi,
|
|
15102
|
+
...Qi,
|
|
15103
|
+
...ki,
|
|
15104
|
+
...Wi,
|
|
15083
15105
|
...Yi,
|
|
15084
15106
|
...Hi,
|
|
15085
|
-
...
|
|
15086
|
-
...
|
|
15087
|
-
...
|
|
15088
|
-
...Qi,
|
|
15089
|
-
...hi,
|
|
15090
|
-
...ki
|
|
15107
|
+
...er,
|
|
15108
|
+
...Gi,
|
|
15109
|
+
...Ji
|
|
15091
15110
|
];
|
|
15092
|
-
function
|
|
15111
|
+
function ar(a, e) {
|
|
15093
15112
|
let n = "";
|
|
15094
15113
|
return a.aliasFunctionName ? (n = e.t(a.aliasFunctionName), n === a.aliasFunctionName && (n = a.functionName)) : n = a.functionName, n;
|
|
15095
15114
|
}
|
|
15096
|
-
var
|
|
15097
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15115
|
+
var nr = Object.getOwnPropertyDescriptor, ir = (a, e, n, i) => {
|
|
15116
|
+
for (var r = i > 1 ? void 0 : i ? nr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15098
15117
|
(u = a[o]) && (r = u(r) || r);
|
|
15099
15118
|
return r;
|
|
15100
15119
|
}, Lt = (a, e) => (n, i) => e(n, i, a);
|
|
15101
15120
|
const Ut = Mt("formula.description-service");
|
|
15102
15121
|
let Ct = class {
|
|
15103
15122
|
constructor(a, e, n) {
|
|
15104
|
-
|
|
15123
|
+
w(this, "_descriptions", []);
|
|
15105
15124
|
this._functionService = a, this._localeService = e, this._configService = n, this._initialize();
|
|
15106
15125
|
}
|
|
15107
15126
|
dispose() {
|
|
@@ -15138,7 +15157,7 @@ let Ct = class {
|
|
|
15138
15157
|
}), e;
|
|
15139
15158
|
}
|
|
15140
15159
|
registerDescriptions(a) {
|
|
15141
|
-
return this._descriptions = this._descriptions.concat(a), this._registerDescriptions(),
|
|
15160
|
+
return this._descriptions = this._descriptions.concat(a), this._registerDescriptions(), le(() => {
|
|
15142
15161
|
const e = a.map((n) => n.functionName);
|
|
15143
15162
|
this.unregisterDescriptions(e);
|
|
15144
15163
|
});
|
|
@@ -15157,7 +15176,7 @@ let Ct = class {
|
|
|
15157
15176
|
if (e.length === 0)
|
|
15158
15177
|
return !1;
|
|
15159
15178
|
const n = e[0].description;
|
|
15160
|
-
return !
|
|
15179
|
+
return !Sn(n);
|
|
15161
15180
|
}
|
|
15162
15181
|
_initialize() {
|
|
15163
15182
|
this._localeService.localeChanged$.subscribe(() => {
|
|
@@ -15167,12 +15186,6 @@ let Ct = class {
|
|
|
15167
15186
|
_initDescription() {
|
|
15168
15187
|
var i;
|
|
15169
15188
|
const a = [
|
|
15170
|
-
...En,
|
|
15171
|
-
...In,
|
|
15172
|
-
...Nn,
|
|
15173
|
-
...Rn,
|
|
15174
|
-
...An,
|
|
15175
|
-
...Sn,
|
|
15176
15189
|
...Cn,
|
|
15177
15190
|
...Dn,
|
|
15178
15191
|
...bn,
|
|
@@ -15182,13 +15195,19 @@ let Ct = class {
|
|
|
15182
15195
|
..._n,
|
|
15183
15196
|
...yn,
|
|
15184
15197
|
...qn,
|
|
15185
|
-
...gn
|
|
15186
|
-
|
|
15198
|
+
...gn,
|
|
15199
|
+
...hn,
|
|
15200
|
+
...Un,
|
|
15201
|
+
...Fn,
|
|
15202
|
+
...Bn,
|
|
15203
|
+
...vn,
|
|
15204
|
+
...Vn
|
|
15205
|
+
].map((r) => r[1]), e = tr.filter((r) => a.includes(r.functionName)), n = this._configService.getConfig(ot);
|
|
15187
15206
|
this._descriptions = e.concat((i = n == null ? void 0 : n.description) != null ? i : []);
|
|
15188
15207
|
}
|
|
15189
15208
|
_registerDescriptions() {
|
|
15190
15209
|
const a = this._localeService, e = this._descriptions.map((n) => ({
|
|
15191
|
-
functionName:
|
|
15210
|
+
functionName: ar(n, a),
|
|
15192
15211
|
functionType: n.functionType,
|
|
15193
15212
|
description: a.t(n.description),
|
|
15194
15213
|
abstract: a.t(n.abstract),
|
|
@@ -15203,13 +15222,13 @@ let Ct = class {
|
|
|
15203
15222
|
this._functionService.registerDescriptions(...e);
|
|
15204
15223
|
}
|
|
15205
15224
|
};
|
|
15206
|
-
Ct =
|
|
15225
|
+
Ct = ir([
|
|
15207
15226
|
Lt(0, ht),
|
|
15208
|
-
Lt(1,
|
|
15227
|
+
Lt(1, X(Ot)),
|
|
15209
15228
|
Lt(2, _e)
|
|
15210
15229
|
], Ct);
|
|
15211
|
-
var
|
|
15212
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15230
|
+
var rr = Object.getOwnPropertyDescriptor, or = (a, e, n, i) => {
|
|
15231
|
+
for (var r = i > 1 ? void 0 : i ? rr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15213
15232
|
(u = a[o]) && (r = u(r) || r);
|
|
15214
15233
|
return r;
|
|
15215
15234
|
}, Fe = (a, e) => (n, i) => e(n, i, a);
|
|
@@ -15222,8 +15241,8 @@ function oa(a, e, n, i) {
|
|
|
15222
15241
|
const f = r[u];
|
|
15223
15242
|
if (typeof f == "string" || f.nodeType !== J.REFERENCE)
|
|
15224
15243
|
continue;
|
|
15225
|
-
const { token: s } = f,
|
|
15226
|
-
let E =
|
|
15244
|
+
const { token: s } = f, p = se(s), { sheetName: T, unitId: P } = p;
|
|
15245
|
+
let E = p.range;
|
|
15227
15246
|
E.startAbsoluteRefType === Xe.ALL && E.endAbsoluteRefType === Xe.ALL || (E = Et(E, n, i), o.push({
|
|
15228
15247
|
unitId: P,
|
|
15229
15248
|
sheetName: T,
|
|
@@ -15237,33 +15256,33 @@ let Dt = class extends te {
|
|
|
15237
15256
|
super(), this._refRangeService = a, this._lexerTreeBuilder = e, this._univerInstanceService = n, this._injector = i;
|
|
15238
15257
|
}
|
|
15239
15258
|
transformFormulaByEffectCommand(a, e, n, i) {
|
|
15240
|
-
const r = this._lexerTreeBuilder.sequenceNodesBuilder(n), o = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), u = o.getActiveSheet(), m = o.getUnitId(), f = u.getSheetId(), s = r == null ? void 0 : r.map((
|
|
15241
|
-
if (typeof
|
|
15242
|
-
const T =
|
|
15259
|
+
const r = this._lexerTreeBuilder.sequenceNodesBuilder(n), o = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), u = o.getActiveSheet(), m = o.getUnitId(), f = u.getSheetId(), s = r == null ? void 0 : r.map((p) => {
|
|
15260
|
+
if (typeof p == "object" && p.nodeType === J.REFERENCE) {
|
|
15261
|
+
const T = se(p.token), { range: P, unitId: E, sheetName: I } = T, S = this._univerInstanceService.getUnit(E || a), c = I ? S == null ? void 0 : S.getSheetBySheetName(I) : S == null ? void 0 : S.getSheetBySheetId(e);
|
|
15243
15262
|
if (!c)
|
|
15244
15263
|
throw new Error("Sheet not found");
|
|
15245
15264
|
const N = S.getUnitId(), R = c.getSheetId();
|
|
15246
15265
|
if (N !== m || R !== f)
|
|
15247
|
-
return
|
|
15248
|
-
const
|
|
15266
|
+
return p;
|
|
15267
|
+
const d = Vt(P, i);
|
|
15249
15268
|
let O = "";
|
|
15250
|
-
if (
|
|
15251
|
-
const M =
|
|
15269
|
+
if (d) {
|
|
15270
|
+
const M = d.startColumn - P.startColumn, F = d.startRow - P.startRow, U = Et(P, M, F);
|
|
15252
15271
|
E && I ? O = Zt(E, I, U) : I ? O = Jt(I, U) : O = ea(U);
|
|
15253
15272
|
} else
|
|
15254
15273
|
O = j.REF;
|
|
15255
15274
|
return {
|
|
15256
|
-
...
|
|
15275
|
+
...p,
|
|
15257
15276
|
token: O
|
|
15258
15277
|
};
|
|
15259
15278
|
} else
|
|
15260
|
-
return
|
|
15279
|
+
return p;
|
|
15261
15280
|
});
|
|
15262
15281
|
return s ? `=${we(s)}` : "";
|
|
15263
15282
|
}
|
|
15264
15283
|
registerFormula(a, e, n, i) {
|
|
15265
15284
|
const r = /* @__PURE__ */ new Map(), o = this._lexerTreeBuilder.sequenceNodesBuilder(n), u = new Ye(), m = (f) => {
|
|
15266
|
-
const s = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET),
|
|
15285
|
+
const s = this._univerInstanceService.getCurrentUnitForType(ee.UNIVER_SHEET), p = s.getActiveSheet(), T = s.getUnitId(), P = p.getSheetId(), E = o == null ? void 0 : o.map((S) => {
|
|
15267
15286
|
if (typeof S == "object" && S.nodeType === J.REFERENCE) {
|
|
15268
15287
|
const c = r.get(S.token);
|
|
15269
15288
|
if (c.unitId !== T || c.subUnitId !== P)
|
|
@@ -15271,7 +15290,7 @@ let Dt = class extends te {
|
|
|
15271
15290
|
const N = Vt(c.range, f);
|
|
15272
15291
|
let R = "";
|
|
15273
15292
|
if (N) {
|
|
15274
|
-
const
|
|
15293
|
+
const d = N.startColumn - c.range.startColumn, O = N.startRow - c.range.startRow, M = Et(c.range, d, O);
|
|
15275
15294
|
c.unitId && c.sheetName ? R = Zt(c.unitId, c.sheetName, M) : c.sheetName ? R = Jt(c.sheetName, M) : R = ea(M);
|
|
15276
15295
|
} else
|
|
15277
15296
|
R = j.REF;
|
|
@@ -15286,16 +15305,16 @@ let Dt = class extends te {
|
|
|
15286
15305
|
};
|
|
15287
15306
|
return o == null || o.forEach((f) => {
|
|
15288
15307
|
if (typeof f == "object" && f.nodeType === J.REFERENCE) {
|
|
15289
|
-
const s =
|
|
15308
|
+
const s = se(f.token), { range: p, unitId: T, sheetName: P } = s, E = this._univerInstanceService.getUnit(T || a), I = P ? E == null ? void 0 : E.getSheetBySheetName(P) : E == null ? void 0 : E.getSheetBySheetId(e);
|
|
15290
15309
|
if (!I)
|
|
15291
15310
|
return;
|
|
15292
15311
|
const S = E.getUnitId(), c = I.getSheetId(), N = {
|
|
15293
15312
|
unitId: S,
|
|
15294
15313
|
subUnitId: c,
|
|
15295
|
-
range:
|
|
15314
|
+
range: p,
|
|
15296
15315
|
sheetName: P
|
|
15297
15316
|
};
|
|
15298
|
-
r.set(f.token, N), u.add(this._refRangeService.registerRefRange(
|
|
15317
|
+
r.set(f.token, N), u.add(this._refRangeService.registerRefRange(p, m, S, c));
|
|
15299
15318
|
}
|
|
15300
15319
|
}), u;
|
|
15301
15320
|
}
|
|
@@ -15303,13 +15322,13 @@ let Dt = class extends te {
|
|
|
15303
15322
|
const r = be(n) ? this._lexerTreeBuilder.sequenceNodesBuilder(n) : null, o = [];
|
|
15304
15323
|
return r == null || r.forEach((u) => {
|
|
15305
15324
|
if (typeof u == "object" && u.nodeType === J.REFERENCE) {
|
|
15306
|
-
const m =
|
|
15325
|
+
const m = se(u.token), { range: f, unitId: s, sheetName: p } = m;
|
|
15307
15326
|
if (f.startAbsoluteRefType === Xe.ALL && f.endAbsoluteRefType === Xe.ALL)
|
|
15308
15327
|
return;
|
|
15309
|
-
const T = this._univerInstanceService.getUnit(s || a), P =
|
|
15328
|
+
const T = this._univerInstanceService.getUnit(s || a), P = p ? T == null ? void 0 : T.getSheetBySheetName(p) : T == null ? void 0 : T.getSheetBySheetId(e);
|
|
15310
15329
|
if (!P)
|
|
15311
15330
|
return;
|
|
15312
|
-
const E = T.getUnitId(), I = P.getSheetId(), S = i[0].startRow, c = i[0].startColumn, N = f.startRow, R = f.startColumn,
|
|
15331
|
+
const E = T.getUnitId(), I = P.getSheetId(), S = i[0].startRow, c = i[0].startColumn, N = f.startRow, R = f.startColumn, d = i.map((O) => ({
|
|
15313
15332
|
startRow: O.startRow - S + N,
|
|
15314
15333
|
endRow: O.endRow - S + N,
|
|
15315
15334
|
startColumn: O.startColumn - c + R,
|
|
@@ -15318,7 +15337,7 @@ let Dt = class extends te {
|
|
|
15318
15337
|
o.push({
|
|
15319
15338
|
unitId: E,
|
|
15320
15339
|
subUnitId: I,
|
|
15321
|
-
ranges:
|
|
15340
|
+
ranges: d
|
|
15322
15341
|
});
|
|
15323
15342
|
}
|
|
15324
15343
|
}), o;
|
|
@@ -15326,10 +15345,10 @@ let Dt = class extends te {
|
|
|
15326
15345
|
// eslint-disable-next-line max-lines-per-function
|
|
15327
15346
|
registerRangeFormula(a, e, n, i, r) {
|
|
15328
15347
|
const o = new Ye(), u = i.map((f) => this._getFormulaDependcy(a, e, f, n)), m = (f) => {
|
|
15329
|
-
const s = n[0].startRow,
|
|
15348
|
+
const s = n[0].startRow, p = n[0].startColumn, T = [{ unitId: a, subUnitId: e, ranges: n }, ...u.flat()], P = [], E = mn(this._injector, f);
|
|
15330
15349
|
for (const { unitId: I, subUnitId: S, ranges: c } of T)
|
|
15331
15350
|
if (I === E.unitId && S === E.subUnitId) {
|
|
15332
|
-
const N = [], R = c[0].startRow,
|
|
15351
|
+
const N = [], R = c[0].startRow, d = c[0].startColumn, O = R - s, M = d - p;
|
|
15333
15352
|
for (const F of E.ranges) {
|
|
15334
15353
|
const U = c.map((g) => Ve(F, g)).filter(Boolean);
|
|
15335
15354
|
U.length > 0 && N.push(...U);
|
|
@@ -15348,23 +15367,23 @@ let Dt = class extends te {
|
|
|
15348
15367
|
S.sort((O, M) => O.startRow - M.startRow || O.startColumn - M.startColumn);
|
|
15349
15368
|
const c = /* @__PURE__ */ new Map();
|
|
15350
15369
|
for (let O = 0; O < I.length; O++) {
|
|
15351
|
-
const M = I[O], F = M.startRow, U = M.startColumn, g = F - s, x = U -
|
|
15370
|
+
const M = I[O], F = M.startRow, U = M.startColumn, g = F - s, x = U - p, h = fn(M, f).sort((k, re) => k.startRow - re.startRow || k.startColumn - re.startColumn);
|
|
15352
15371
|
if (!h.length)
|
|
15353
15372
|
continue;
|
|
15354
|
-
const V = h[0].startRow, Q = h[0].startColumn, b = V - s, Le = Q -
|
|
15373
|
+
const V = h[0].startRow, Q = h[0].startColumn, b = V - s, Le = Q - p, ae = [];
|
|
15355
15374
|
for (let k = 0; k < i.length; k++) {
|
|
15356
|
-
const
|
|
15375
|
+
const re = i[k], z = be(re), ye = z ? this._lexerTreeBuilder.moveFormulaRefOffset(re, x, g) : re, oe = z ? this.transformFormulaByEffectCommand(a, e, ye, f) : ye, Pe = oa(this._lexerTreeBuilder, oe, -Le, -b);
|
|
15357
15376
|
ae.push({
|
|
15358
|
-
newFormula:
|
|
15377
|
+
newFormula: oe,
|
|
15359
15378
|
orginFormula: Pe
|
|
15360
15379
|
});
|
|
15361
15380
|
}
|
|
15362
|
-
const
|
|
15381
|
+
const ie = {
|
|
15363
15382
|
formulas: ae,
|
|
15364
15383
|
ranges: h,
|
|
15365
15384
|
key: ae.map((k) => k.orginFormula).join("_")
|
|
15366
15385
|
};
|
|
15367
|
-
c.has(
|
|
15386
|
+
c.has(ie.key) ? c.get(ie.key).push(ie) : c.set(ie.key, [ie]);
|
|
15368
15387
|
}
|
|
15369
15388
|
const N = i.map((O) => oa(this._lexerTreeBuilder, O, 0, 0)).join("_");
|
|
15370
15389
|
if (S.length > 0) {
|
|
@@ -15372,7 +15391,7 @@ let Dt = class extends te {
|
|
|
15372
15391
|
for (let g = 0; g < i.length; g++) {
|
|
15373
15392
|
const x = i[g];
|
|
15374
15393
|
F.push({
|
|
15375
|
-
newFormula: be(x) ? this._lexerTreeBuilder.moveFormulaRefOffset(x, M -
|
|
15394
|
+
newFormula: be(x) ? this._lexerTreeBuilder.moveFormulaRefOffset(x, M - p, O - s) : x,
|
|
15376
15395
|
orginFormula: x
|
|
15377
15396
|
});
|
|
15378
15397
|
}
|
|
@@ -15383,9 +15402,9 @@ let Dt = class extends te {
|
|
|
15383
15402
|
};
|
|
15384
15403
|
c.has(U.key) ? c.get(U.key).push(U) : c.set(U.key, [U]);
|
|
15385
15404
|
}
|
|
15386
|
-
const R = [],
|
|
15387
|
-
for (let O =
|
|
15388
|
-
const M =
|
|
15405
|
+
const R = [], d = Array.from(c.keys());
|
|
15406
|
+
for (let O = d.length - 1; O >= 0; O--) {
|
|
15407
|
+
const M = d[O], F = c.get(M).sort((x, h) => x.ranges[0].startRow - h.ranges[0].startRow || x.ranges[0].startColumn - h.ranges[0].startColumn), U = [];
|
|
15389
15408
|
for (let x = 0; x < F[0].formulas.length; x++)
|
|
15390
15409
|
U.push(F[0].formulas[x].newFormula);
|
|
15391
15410
|
const g = De.mergeRanges(F.map((x) => x.ranges).flat());
|
|
@@ -15404,59 +15423,59 @@ let Dt = class extends te {
|
|
|
15404
15423
|
return n.forEach((f) => {
|
|
15405
15424
|
const s = this._refRangeService.registerRefRange(f, m, a, e);
|
|
15406
15425
|
o.add(s);
|
|
15407
|
-
}), [...u.flat()].forEach(({ unitId: f, subUnitId: s, ranges:
|
|
15408
|
-
|
|
15426
|
+
}), [...u.flat()].forEach(({ unitId: f, subUnitId: s, ranges: p }) => {
|
|
15427
|
+
p.forEach((T) => {
|
|
15409
15428
|
const P = this._refRangeService.registerRefRange(T, m, f, s);
|
|
15410
15429
|
o.add(P);
|
|
15411
15430
|
});
|
|
15412
15431
|
}), o;
|
|
15413
15432
|
}
|
|
15414
15433
|
};
|
|
15415
|
-
Dt =
|
|
15416
|
-
Fe(0,
|
|
15417
|
-
Fe(1,
|
|
15434
|
+
Dt = or([
|
|
15435
|
+
Fe(0, X(un)),
|
|
15436
|
+
Fe(1, X(qt)),
|
|
15418
15437
|
Fe(2, xe),
|
|
15419
|
-
Fe(3,
|
|
15438
|
+
Fe(3, X(at))
|
|
15420
15439
|
], Dt);
|
|
15421
|
-
var
|
|
15422
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15440
|
+
var ur = Object.getOwnPropertyDescriptor, mr = (a, e, n, i) => {
|
|
15441
|
+
for (var r = i > 1 ? void 0 : i ? ur(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15423
15442
|
(u = a[o]) && (r = u(r) || r);
|
|
15424
15443
|
return r;
|
|
15425
|
-
},
|
|
15444
|
+
}, fr = (a, e) => (n, i) => e(n, i, a);
|
|
15426
15445
|
const Ft = "sheets-formula.remote-register-function.service", Ba = Mt(Ft);
|
|
15427
15446
|
let Qe = class {
|
|
15428
15447
|
constructor(a) {
|
|
15429
15448
|
this._functionService = a;
|
|
15430
15449
|
}
|
|
15431
15450
|
async registerFunctions(a) {
|
|
15432
|
-
const e = a.map(([n, i]) =>
|
|
15451
|
+
const e = a.map(([n, i]) => cr(n, i));
|
|
15433
15452
|
this._functionService.registerExecutors(...e);
|
|
15434
15453
|
}
|
|
15435
15454
|
async registerAsyncFunctions(a) {
|
|
15436
|
-
const e = a.map(([n, i]) =>
|
|
15455
|
+
const e = a.map(([n, i]) => lr(n, i));
|
|
15437
15456
|
this._functionService.registerExecutors(...e);
|
|
15438
15457
|
}
|
|
15439
15458
|
async unregisterFunctions(a) {
|
|
15440
15459
|
this._functionService.unregisterDescriptions(...a);
|
|
15441
15460
|
}
|
|
15442
15461
|
};
|
|
15443
|
-
Qe =
|
|
15444
|
-
|
|
15462
|
+
Qe = mr([
|
|
15463
|
+
fr(0, ht)
|
|
15445
15464
|
], Qe);
|
|
15446
|
-
function
|
|
15465
|
+
function cr(a, e) {
|
|
15447
15466
|
const n = new At(e), i = new Function(`return ${a}`)();
|
|
15448
15467
|
return n.calculateCustom = i, n;
|
|
15449
15468
|
}
|
|
15450
|
-
function
|
|
15469
|
+
function lr(a, e) {
|
|
15451
15470
|
const n = new Ma(e), i = new Function(`return ${a}`)();
|
|
15452
15471
|
return n.calculateCustom = i, n;
|
|
15453
15472
|
}
|
|
15454
|
-
var
|
|
15455
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15473
|
+
var sr = Object.getOwnPropertyDescriptor, pr = (a, e, n, i) => {
|
|
15474
|
+
for (var r = i > 1 ? void 0 : i ? sr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15456
15475
|
(u = a[o]) && (r = u(r) || r);
|
|
15457
15476
|
return r;
|
|
15458
15477
|
}, Be = (a, e) => (n, i) => e(n, i, a);
|
|
15459
|
-
const
|
|
15478
|
+
const dr = Mt(
|
|
15460
15479
|
"sheets-formula.register-function-service"
|
|
15461
15480
|
);
|
|
15462
15481
|
let bt = class extends te {
|
|
@@ -15501,8 +15520,8 @@ let bt = class extends te {
|
|
|
15501
15520
|
} else
|
|
15502
15521
|
u.add(this._descriptionService.registerDescriptions([i]));
|
|
15503
15522
|
const m = o ? new Ma(e) : new At(e);
|
|
15504
|
-
return m.calculateCustom = n, this._functionService.registerExecutors(m), u.add(
|
|
15505
|
-
|
|
15523
|
+
return m.calculateCustom = n, this._functionService.registerExecutors(m), u.add(le(() => this._functionService.unregisterExecutors(e))), this._remoteRegisterFunctionService && (this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(), e]]), u.add(
|
|
15524
|
+
le(() => this._remoteRegisterFunctionService.unregisterFunctions([e]))
|
|
15506
15525
|
)), u;
|
|
15507
15526
|
}
|
|
15508
15527
|
_registerLocalExecutors(a) {
|
|
@@ -15510,22 +15529,22 @@ let bt = class extends te {
|
|
|
15510
15529
|
const o = new At(r);
|
|
15511
15530
|
return o.calculateCustom = i, o;
|
|
15512
15531
|
});
|
|
15513
|
-
return this._functionService.registerExecutors(...n),
|
|
15532
|
+
return this._functionService.registerExecutors(...n), le(() => this._functionService.unregisterExecutors(...e));
|
|
15514
15533
|
}
|
|
15515
15534
|
_registerRemoteExecutors(a) {
|
|
15516
15535
|
const e = [], n = a.map(([i, r]) => (e.push(r), [i.toString(), r]));
|
|
15517
|
-
return this._remoteRegisterFunctionService.registerFunctions(n),
|
|
15536
|
+
return this._remoteRegisterFunctionService.registerFunctions(n), le(() => this._remoteRegisterFunctionService.unregisterFunctions(e));
|
|
15518
15537
|
}
|
|
15519
15538
|
};
|
|
15520
|
-
bt =
|
|
15521
|
-
Be(0,
|
|
15522
|
-
Be(1,
|
|
15539
|
+
bt = pr([
|
|
15540
|
+
Be(0, X(Ot)),
|
|
15541
|
+
Be(1, X(Ut)),
|
|
15523
15542
|
Be(2, ht),
|
|
15524
15543
|
Be(3, Xa(Ba))
|
|
15525
15544
|
], bt);
|
|
15526
|
-
const
|
|
15527
|
-
var
|
|
15528
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15545
|
+
const Lr = "SHEETS_FORMULA_PLUGIN";
|
|
15546
|
+
var Pr = Object.getOwnPropertyDescriptor, Tr = (a, e, n, i) => {
|
|
15547
|
+
for (var r = i > 1 ? void 0 : i ? Pr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15529
15548
|
(u = a[o]) && (r = u(r) || r);
|
|
15530
15549
|
return r;
|
|
15531
15550
|
}, Pt = (a, e) => (n, i) => e(n, i, a);
|
|
@@ -15537,8 +15556,8 @@ let $e = class extends te {
|
|
|
15537
15556
|
this._initialConversion();
|
|
15538
15557
|
}
|
|
15539
15558
|
_initialConversion() {
|
|
15540
|
-
this._activeDirtyManagerService.register(
|
|
15541
|
-
commandId:
|
|
15559
|
+
this._activeDirtyManagerService.register(ne.id, {
|
|
15560
|
+
commandId: ne.id,
|
|
15542
15561
|
getDirtyData: (a) => {
|
|
15543
15562
|
const e = a.params;
|
|
15544
15563
|
return e.trigger === _t.id ? {} : {
|
|
@@ -15717,20 +15736,20 @@ let $e = class extends te {
|
|
|
15717
15736
|
}
|
|
15718
15737
|
_getRemoveRowOrColumnMutation(a, e = !0) {
|
|
15719
15738
|
const { subUnitId: n, unitId: i, range: r } = a, o = [], u = this._univerInstanceService.getUniverSheetInstance(i), m = u == null ? void 0 : u.getSheetBySheetId(n), f = (m == null ? void 0 : m.getRowCount()) || 0, s = (m == null ? void 0 : m.getColumnCount()) || 0;
|
|
15720
|
-
let
|
|
15739
|
+
let p = null;
|
|
15721
15740
|
const { startRow: T, endRow: P, startColumn: E, endColumn: I } = r;
|
|
15722
|
-
e === !0 ?
|
|
15741
|
+
e === !0 ? p = this._rangeToMatrix({
|
|
15723
15742
|
startRow: T,
|
|
15724
15743
|
startColumn: 0,
|
|
15725
15744
|
endRow: P,
|
|
15726
15745
|
endColumn: s - 1
|
|
15727
|
-
}) :
|
|
15746
|
+
}) : p = this._rangeToMatrix({
|
|
15728
15747
|
startRow: 0,
|
|
15729
15748
|
startColumn: E,
|
|
15730
15749
|
endRow: f,
|
|
15731
15750
|
endColumn: I
|
|
15732
15751
|
});
|
|
15733
|
-
const S =
|
|
15752
|
+
const S = p.getData();
|
|
15734
15753
|
return o.push(...this._getDirtyRangesByCellValue(i, n, S)), o.push(...this._getDirtyRangesForArrayFormula(i, n, S)), o;
|
|
15735
15754
|
}
|
|
15736
15755
|
_getRemoveSheetMutation(a) {
|
|
@@ -15766,12 +15785,12 @@ let $e = class extends te {
|
|
|
15766
15785
|
const r = new W(n), o = this._formulaDataModel.getArrayFormulaRange();
|
|
15767
15786
|
if ((u = o == null ? void 0 : o[a]) != null && u[e]) {
|
|
15768
15787
|
const f = new W((m = o == null ? void 0 : o[a]) == null ? void 0 : m[e]);
|
|
15769
|
-
r.forValue((s,
|
|
15788
|
+
r.forValue((s, p) => {
|
|
15770
15789
|
f.forValue((T, P, E) => {
|
|
15771
15790
|
if (E == null)
|
|
15772
15791
|
return !0;
|
|
15773
15792
|
const { startRow: I, startColumn: S, endRow: c, endColumn: N } = E;
|
|
15774
|
-
s >= I && s <= c &&
|
|
15793
|
+
s >= I && s <= c && p >= S && p <= N && i.push({
|
|
15775
15794
|
unitId: a,
|
|
15776
15795
|
sheetId: e,
|
|
15777
15796
|
range: {
|
|
@@ -15787,13 +15806,13 @@ let $e = class extends te {
|
|
|
15787
15806
|
return i;
|
|
15788
15807
|
}
|
|
15789
15808
|
};
|
|
15790
|
-
$e =
|
|
15809
|
+
$e = Tr([
|
|
15791
15810
|
Pt(0, gt),
|
|
15792
15811
|
Pt(1, xe),
|
|
15793
|
-
Pt(2,
|
|
15812
|
+
Pt(2, X(it))
|
|
15794
15813
|
], $e);
|
|
15795
|
-
var
|
|
15796
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15814
|
+
var Er = Object.getOwnPropertyDescriptor, Ir = (a, e, n, i) => {
|
|
15815
|
+
for (var r = i > 1 ? void 0 : i ? Er(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15797
15816
|
(u = a[o]) && (r = u(r) || r);
|
|
15798
15817
|
return r;
|
|
15799
15818
|
}, Tt = (a, e) => (n, i) => e(n, i, a);
|
|
@@ -15823,8 +15842,8 @@ let je = class extends te {
|
|
|
15823
15842
|
priority: 100,
|
|
15824
15843
|
effect: wa.Value,
|
|
15825
15844
|
handler: (a, e, n) => {
|
|
15826
|
-
var s,
|
|
15827
|
-
const { unitId: i, subUnitId: r, row: o, col: u } = e, m = this._formulaDataModel.getArrayFormulaCellData(), f = (T = (
|
|
15845
|
+
var s, p, T;
|
|
15846
|
+
const { unitId: i, subUnitId: r, row: o, col: u } = e, m = this._formulaDataModel.getArrayFormulaCellData(), f = (T = (p = (s = m == null ? void 0 : m[i]) == null ? void 0 : s[r]) == null ? void 0 : p[o]) == null ? void 0 : T[u];
|
|
15828
15847
|
return f == null ? n(a) : f.v == null && f.t == null ? n({
|
|
15829
15848
|
...a,
|
|
15830
15849
|
v: 0,
|
|
@@ -15832,7 +15851,7 @@ let je = class extends te {
|
|
|
15832
15851
|
t: Bt.NUMBER
|
|
15833
15852
|
}) : (a == null ? void 0 : a.t) === Bt.NUMBER && a.v !== void 0 && a.v !== null && Wa(a.v) ? n({
|
|
15834
15853
|
...a,
|
|
15835
|
-
v:
|
|
15854
|
+
v: Gn(Number(a.v))
|
|
15836
15855
|
}) : n({
|
|
15837
15856
|
...a,
|
|
15838
15857
|
v: f.v,
|
|
@@ -15843,34 +15862,34 @@ let je = class extends te {
|
|
|
15843
15862
|
);
|
|
15844
15863
|
}
|
|
15845
15864
|
};
|
|
15846
|
-
je =
|
|
15865
|
+
je = Ir([
|
|
15847
15866
|
Tt(0, de),
|
|
15848
|
-
Tt(1,
|
|
15849
|
-
Tt(2,
|
|
15867
|
+
Tt(1, X(xt)),
|
|
15868
|
+
Tt(2, X(it))
|
|
15850
15869
|
], je);
|
|
15851
|
-
var
|
|
15852
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15870
|
+
var Nr = Object.getOwnPropertyDescriptor, Rr = (a, e, n, i) => {
|
|
15871
|
+
for (var r = i > 1 ? void 0 : i ? Nr(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15853
15872
|
(u = a[o]) && (r = u(r) || r);
|
|
15854
15873
|
return r;
|
|
15855
15874
|
}, ve = (a, e) => (n, i) => e(n, i, a);
|
|
15856
15875
|
let ze = class extends te {
|
|
15857
15876
|
constructor(e, n, i, r) {
|
|
15858
15877
|
super();
|
|
15859
|
-
|
|
15878
|
+
w(this, "_preUnitId", null);
|
|
15860
15879
|
this._descriptionService = e, this._definedNamesService = n, this._univerInstanceService = i, this._commandService = r, this._initialize();
|
|
15861
15880
|
}
|
|
15862
15881
|
_initialize() {
|
|
15863
15882
|
this._descriptionListener(), this._changeUnitListener(), this._changeSheetListener();
|
|
15864
15883
|
}
|
|
15865
15884
|
_descriptionListener() {
|
|
15866
|
-
|
|
15885
|
+
le(
|
|
15867
15886
|
this._definedNamesService.update$.subscribe(() => {
|
|
15868
15887
|
this._registerDescriptions();
|
|
15869
15888
|
})
|
|
15870
15889
|
);
|
|
15871
15890
|
}
|
|
15872
15891
|
_changeUnitListener() {
|
|
15873
|
-
|
|
15892
|
+
le(
|
|
15874
15893
|
this._univerInstanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).subscribe(() => {
|
|
15875
15894
|
this._unRegisterDescriptions(), this._registerDescriptions();
|
|
15876
15895
|
})
|
|
@@ -15965,33 +15984,33 @@ let ze = class extends te {
|
|
|
15965
15984
|
}), this._descriptionService.unregisterDescriptions(r);
|
|
15966
15985
|
}
|
|
15967
15986
|
};
|
|
15968
|
-
ze =
|
|
15987
|
+
ze = Rr([
|
|
15969
15988
|
ve(0, Ut),
|
|
15970
15989
|
ve(1, yt),
|
|
15971
15990
|
ve(2, xe),
|
|
15972
15991
|
ve(3, de)
|
|
15973
15992
|
], ze);
|
|
15974
|
-
var
|
|
15975
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
15993
|
+
var Ar = Object.getOwnPropertyDescriptor, Sr = (a, e, n, i) => {
|
|
15994
|
+
for (var r = i > 1 ? void 0 : i ? Ar(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15976
15995
|
(u = a[o]) && (r = u(r) || r);
|
|
15977
15996
|
return r;
|
|
15978
|
-
},
|
|
15997
|
+
}, Cr = (a, e) => (n, i) => e(n, i, a);
|
|
15979
15998
|
let Ze = class extends te {
|
|
15980
15999
|
constructor(a) {
|
|
15981
16000
|
super(), this._commandService = a, [
|
|
15982
|
-
|
|
16001
|
+
Wn,
|
|
15983
16002
|
Ge
|
|
15984
16003
|
].forEach((e) => this._commandService.registerCommand(e));
|
|
15985
16004
|
}
|
|
15986
16005
|
};
|
|
15987
|
-
Ze =
|
|
15988
|
-
|
|
16006
|
+
Ze = Sr([
|
|
16007
|
+
Cr(0, de)
|
|
15989
16008
|
], Ze);
|
|
15990
|
-
var
|
|
15991
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
16009
|
+
var Dr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Or = (a, e, n) => e in a ? Dr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, va = (a, e, n, i) => {
|
|
16010
|
+
for (var r = i > 1 ? void 0 : i ? br(e, n) : e, o = a.length - 1, u; o >= 0; o--)
|
|
15992
16011
|
(u = a[o]) && (r = u(r) || r);
|
|
15993
16012
|
return r;
|
|
15994
|
-
}, Je = (a, e) => (n, i) => e(n, i, a), ut = (a, e, n) =>
|
|
16013
|
+
}, Je = (a, e) => (n, i) => e(n, i, a), ut = (a, e, n) => Or(a, typeof e != "symbol" ? e + "" : e, n);
|
|
15995
16014
|
let et = class extends la {
|
|
15996
16015
|
constructor(a = ia, e, n) {
|
|
15997
16016
|
super(), this._config = a, this._injector = e, this._configService = n;
|
|
@@ -16000,12 +16019,12 @@ let et = class extends la {
|
|
|
16000
16019
|
ia,
|
|
16001
16020
|
this._config
|
|
16002
16021
|
);
|
|
16003
|
-
this._configService.setConfig(
|
|
16022
|
+
this._configService.setConfig(Ui, i);
|
|
16004
16023
|
}
|
|
16005
16024
|
onStarting() {
|
|
16006
16025
|
this._injector.add([Qe]), this._injector.get(ya).registerChannel(
|
|
16007
16026
|
Ft,
|
|
16008
|
-
|
|
16027
|
+
Xn(this._injector.get(Qe))
|
|
16009
16028
|
);
|
|
16010
16029
|
}
|
|
16011
16030
|
};
|
|
@@ -16013,7 +16032,7 @@ ut(et, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
|
|
|
16013
16032
|
ut(et, "type", ee.UNIVER_SHEET);
|
|
16014
16033
|
et = va([
|
|
16015
16034
|
ca(xa),
|
|
16016
|
-
Je(1,
|
|
16035
|
+
Je(1, X(at)),
|
|
16017
16036
|
Je(2, _e)
|
|
16018
16037
|
], et);
|
|
16019
16038
|
let tt = class extends la {
|
|
@@ -16024,11 +16043,11 @@ let tt = class extends la {
|
|
|
16024
16043
|
na,
|
|
16025
16044
|
this._config
|
|
16026
16045
|
);
|
|
16027
|
-
this._configService.setConfig(ot, i);
|
|
16046
|
+
this._configService.setConfig(ot, i, { merge: !0 });
|
|
16028
16047
|
}
|
|
16029
16048
|
onStarting() {
|
|
16030
16049
|
const a = this._injector, e = [
|
|
16031
|
-
[
|
|
16050
|
+
[dr, { useClass: bt }],
|
|
16032
16051
|
[Ut, { useClass: Ct }],
|
|
16033
16052
|
[Ze],
|
|
16034
16053
|
[Dt],
|
|
@@ -16043,7 +16062,7 @@ let tt = class extends la {
|
|
|
16043
16062
|
if (this._config.notExecuteFormula) {
|
|
16044
16063
|
const n = a.get(ya);
|
|
16045
16064
|
e.push([Ba, {
|
|
16046
|
-
useFactory: () =>
|
|
16065
|
+
useFactory: () => wn(n.requestChannel(Ft))
|
|
16047
16066
|
}]);
|
|
16048
16067
|
}
|
|
16049
16068
|
e.forEach((n) => a.add(n));
|
|
@@ -16067,21 +16086,21 @@ let tt = class extends la {
|
|
|
16067
16086
|
]);
|
|
16068
16087
|
}
|
|
16069
16088
|
};
|
|
16070
|
-
ut(tt, "pluginName",
|
|
16089
|
+
ut(tt, "pluginName", Lr);
|
|
16071
16090
|
ut(tt, "type", ee.UNIVER_SHEET);
|
|
16072
16091
|
tt = va([
|
|
16073
16092
|
ca(xa, sn),
|
|
16074
|
-
Je(1,
|
|
16093
|
+
Je(1, X(at)),
|
|
16075
16094
|
Je(2, _e)
|
|
16076
16095
|
], tt);
|
|
16077
16096
|
export {
|
|
16078
|
-
|
|
16097
|
+
pe as CalculationMode,
|
|
16079
16098
|
Ct as DescriptionService,
|
|
16080
16099
|
Dt as FormulaRefRangeService,
|
|
16081
16100
|
Ut as IDescriptionService,
|
|
16082
|
-
|
|
16101
|
+
dr as IRegisterFunctionService,
|
|
16083
16102
|
Ba as IRemoteRegisterFunctionService,
|
|
16084
|
-
|
|
16103
|
+
Wn as InsertFunctionCommand,
|
|
16085
16104
|
Ge as OtherFormulaMarkDirty,
|
|
16086
16105
|
ot as PLUGIN_CONFIG_KEY_BASE,
|
|
16087
16106
|
bt as RegisterFunctionService,
|
|
@@ -16091,5 +16110,6 @@ export {
|
|
|
16091
16110
|
et as UniverRemoteSheetsFormulaPlugin,
|
|
16092
16111
|
tt as UniverSheetsFormulaPlugin,
|
|
16093
16112
|
We as UpdateDefinedNameController,
|
|
16094
|
-
ke as UpdateFormulaController
|
|
16113
|
+
ke as UpdateFormulaController,
|
|
16114
|
+
hr as calculateFormula
|
|
16095
16115
|
};
|