@univerjs/sheets-formula 0.1.0-beta.0 → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +6 -6
- package/lib/es/index.js +1089 -969
- package/lib/types/controllers/utils.d.ts +1 -0
- package/lib/types/locale/en-US.d.ts +8 -20
- package/lib/types/locale/function-list/logical/en-US.d.ts +4 -0
- package/lib/types/locale/function-list/logical/ja-JP.d.ts +4 -0
- package/lib/types/locale/function-list/logical/zh-CN.d.ts +4 -0
- package/lib/types/locale/function-list/math/en-US.d.ts +4 -20
- package/lib/types/locale/function-list/math/ja-JP.d.ts +4 -20
- package/lib/types/locale/function-list/math/zh-CN.d.ts +4 -20
- package/lib/types/locale/zh-CN.d.ts +8 -20
- package/lib/types/services/description.service.d.ts +7 -0
- package/lib/types/services/function-list/array.d.ts +1 -1
- package/lib/umd/index.js +6 -6
- package/package.json +25 -25
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (i, e, t) => (
|
|
4
|
-
import { Disposable as
|
|
5
|
-
import { createIdentifier as
|
|
6
|
-
import { FormulaDataModel as
|
|
7
|
-
import { SetRangeValuesMutation as ie, SetStyleCommand as
|
|
8
|
-
import { DATA_TYPE as
|
|
9
|
-
import { IRenderManagerService as
|
|
10
|
-
import { TextSelectionManagerService as
|
|
11
|
-
import { KeyCode as O, ISidebarService as
|
|
1
|
+
var Kn = Object.defineProperty;
|
|
2
|
+
var Yn = (i, e, t) => e in i ? Kn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var k = (i, e, t) => (Yn(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { Disposable as $, ObjectMatrix as x, Dimension as Y, OnLifecycle as X, LifecycleStages as Q, IUniverInstanceService as Ie, ICommandService as J, isFormulaString as Re, isFormulaId as Ut, Tools as K, Direction as M, CommandType as oe, toDisposable as w, ColorKit as sn, ThemeService as on, deserializeRangeWithSheet as ge, AbsoluteRefType as L, serializeRange as gt, Rectangle as Ve, getCellValueType as Xn, CellValueType as Qn, LocaleService as De, IContextService as _t, FOCUSING_FORMULA_EDITOR as cn, UniverInstanceType as Jn, FOCUSING_EDITOR_INPUT_FORMULA as xe, DisposableCollection as Zn, serializeRangeToRefString as qe, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ot, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ct, RANGE_TYPE as Ee, Plugin as er, PluginType as tr } from "@univerjs/core";
|
|
5
|
+
import { createIdentifier as et, Inject as y, Injector as tt } from "@wendellhu/redi";
|
|
6
|
+
import { FormulaDataModel as nt, SetArrayFormulaDataMutation as It, LexerTreeBuilder as ve, ErrorType as nr, SetFormulaCalculationResultMutation as rr, sequenceNodeType as G, matchToken as W, FUNCTION_NAMES_ARRAY as ir, FunctionType as q, FUNCTION_NAMES_MATH as pe, FUNCTION_NAMES_STATISTICAL as Se, IFunctionService as ar, isFormulaLexerToken as sr, normalizeSheetName as or, includeFormulaLexerToken as cr, generateStringWithSequence as un, SetFormulaCalculationStartMutation as Vt, SetFormulaCalculationNotificationMutation as ur, FormulaExecutedStateType as we, SetFormulaDataMutation as Le, initSheetFormulaData as mr } from "@univerjs/engine-formula";
|
|
7
|
+
import { SetRangeValuesMutation as ie, SetStyleCommand as Dt, MoveRangeMutation as qt, MoveRowsMutation as Ht, MoveColsMutation as $t, DeleteRangeMutation as jt, InsertRangeMutation as Wt, RemoveRowMutation as Gt, RemoveColMutation as Kt, RemoveSheetMutation as vt, InsertSheetMutation as Pt, INTERCEPTOR_POINT as mn, SheetInterceptorService as yt, SetRangeValuesUndoMutationFactory as fn, SetRangeValuesCommand as fr, SelectionManagerService as Tt, getCellAtRowCol as lr, SetSelectionsOperation as dr, NORMAL_SELECTION_PLUGIN_NAME as Ce, convertSelectionDataToRange as ut, getNormalSelectionStyle as br, SetBorderCommand as ln, DeleteRangeMoveLeftCommand as dn, DeleteRangeMoveUpCommand as bn, RemoveColCommand as pn, RemoveRowCommand as hn, InsertRangeMoveDownCommand as En, InsertRangeMoveRightCommand as Rn, InsertColCommand as gn, InsertRowCommand as In, MoveColsCommand as vn, MoveRowsCommand as Pn, MoveRangeCommand as Sn, handleInsertRangeMutation as rt, handleDeleteRangeMutation as it, SetWorksheetNameCommand as pr, handleMoveRange as hr, EffectRefRangId as Z, runRefRangeMutations as ee, handleInsertRow as Er, handleInsertCol as Rr, handleIRemoveRow as gr, handleIRemoveCol as Ir, handleDeleteRangeMoveLeft as vr, handleDeleteRangeMoveUp as Pr, handleInsertRangeMoveDown as Sr, handleInsertRangeMoveRight as Br } from "@univerjs/sheets";
|
|
8
|
+
import { DATA_TYPE as Yt, APPLY_TYPE as Cr, IAutoFillService as kr, SheetPasteCommand as _r, ISheetClipboardService as Dr, COPY_TYPE as yr, SelectionShape as Tr, IEditorBridgeService as At, SheetSkeletonManagerService as Bn, ISelectionRenderService as Cn, getEditorObject as St, ICellEditorManagerService as Nt, IFormulaEditorManagerService as kn, RangeSelector as Ar, PASTE_SPECIAL_MENU_ID as Nr, whenEditorInputFormulaActivated as ye, SetEditorResizeOperation as Mr, MoveSelectionCommand as Fe, JumpOver as Xt, ExpandSelectionCommand as Qt } from "@univerjs/sheets-ui";
|
|
9
|
+
import { IRenderManagerService as Mt, DeviceInputEventType as ae, ITextSelectionRenderManager as _n, getCellInfoInMergeData as Or } from "@univerjs/engine-render";
|
|
10
|
+
import { TextSelectionManagerService as Dn, ReplaceContentCommand as xr, MoveCursorOperation as wr, DocViewModelManagerService as Lr } from "@univerjs/docs";
|
|
11
|
+
import { KeyCode as O, ISidebarService as yn, MenuGroup as Fr, MenuItemType as Ot, MenuPosition as zr, getMenuHiddenObservable as Ur, MetaKeys as se, ComponentManager as Vr, IMenuService as qr, IShortcutService as Hr, IUIController as $r } from "@univerjs/ui";
|
|
12
12
|
import { Subject as re } from "rxjs";
|
|
13
|
-
import { useDependency as z, connectInjector as
|
|
14
|
-
import
|
|
15
|
-
import { Popup as
|
|
16
|
-
const
|
|
17
|
-
class
|
|
13
|
+
import { useDependency as z, connectInjector as jr } from "@wendellhu/redi/react-bindings";
|
|
14
|
+
import Wr, { useState as N, useEffect as _e, forwardRef as Te, useRef as Gr, createElement as Ae } from "react";
|
|
15
|
+
import { Popup as Tn, Select as Kr, Input as Yr, Button as mt } from "@univerjs/design";
|
|
16
|
+
const An = "formula-ui";
|
|
17
|
+
class Xr extends $ {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
k(this, "_dirtyConversionMap", /* @__PURE__ */ new Map());
|
|
@@ -38,15 +38,15 @@ class Gr extends H {
|
|
|
38
38
|
return this._dirtyConversionMap;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const xt = et(
|
|
42
42
|
"univer.formula.active-dirty-manager.service"
|
|
43
43
|
);
|
|
44
|
-
var
|
|
45
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
44
|
+
var Qr = Object.defineProperty, Jr = Object.getOwnPropertyDescriptor, Zr = (i, e, t, n) => {
|
|
45
|
+
for (var r = n > 1 ? void 0 : n ? Jr(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
46
46
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
47
|
-
return n && r &&
|
|
48
|
-
},
|
|
49
|
-
let
|
|
47
|
+
return n && r && Qr(e, t, r), r;
|
|
48
|
+
}, ft = (i, e) => (t, n) => e(t, n, i);
|
|
49
|
+
let He = class extends $ {
|
|
50
50
|
constructor(i, e, t) {
|
|
51
51
|
super(), this._activeDirtyManagerService = i, this._currentUniverService = e, this._formulaDataModel = t, this._initialize();
|
|
52
52
|
}
|
|
@@ -58,24 +58,16 @@ let qe = class extends H {
|
|
|
58
58
|
commandId: ie.id,
|
|
59
59
|
getDirtyData: (i) => {
|
|
60
60
|
const e = i.params;
|
|
61
|
-
return e.trigger ===
|
|
61
|
+
return e.trigger === Dt.id ? {} : {
|
|
62
62
|
dirtyRanges: this._getSetRangeValuesMutationDirtyRange(e)
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
}), this._activeDirtyManagerService.register(Vt.id, {
|
|
66
|
-
commandId: Vt.id,
|
|
67
|
-
getDirtyData: (i) => {
|
|
68
|
-
const e = i.params;
|
|
69
|
-
return {
|
|
70
|
-
dirtyRanges: this._getMoveRangeMutationDirtyRange(e)
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
65
|
}), this._activeDirtyManagerService.register(qt.id, {
|
|
74
66
|
commandId: qt.id,
|
|
75
67
|
getDirtyData: (i) => {
|
|
76
68
|
const e = i.params;
|
|
77
69
|
return {
|
|
78
|
-
dirtyRanges: this.
|
|
70
|
+
dirtyRanges: this._getMoveRangeMutationDirtyRange(e)
|
|
79
71
|
};
|
|
80
72
|
}
|
|
81
73
|
}), this._activeDirtyManagerService.register(Ht.id, {
|
|
@@ -91,7 +83,7 @@ let qe = class extends H {
|
|
|
91
83
|
getDirtyData: (i) => {
|
|
92
84
|
const e = i.params;
|
|
93
85
|
return {
|
|
94
|
-
dirtyRanges: this.
|
|
86
|
+
dirtyRanges: this._getMoveRowsMutationDirtyRange(e)
|
|
95
87
|
};
|
|
96
88
|
}
|
|
97
89
|
}), this._activeDirtyManagerService.register(jt.id, {
|
|
@@ -107,25 +99,33 @@ let qe = class extends H {
|
|
|
107
99
|
getDirtyData: (i) => {
|
|
108
100
|
const e = i.params;
|
|
109
101
|
return {
|
|
110
|
-
dirtyRanges: this.
|
|
102
|
+
dirtyRanges: this._getDeleteRangeMutationDirtyRange(e)
|
|
111
103
|
};
|
|
112
104
|
}
|
|
113
105
|
}), this._activeDirtyManagerService.register(Gt.id, {
|
|
114
106
|
commandId: Gt.id,
|
|
107
|
+
getDirtyData: (i) => {
|
|
108
|
+
const e = i.params;
|
|
109
|
+
return {
|
|
110
|
+
dirtyRanges: this._getRemoveRowOrColumnMutation(e, !0)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}), this._activeDirtyManagerService.register(Kt.id, {
|
|
114
|
+
commandId: Kt.id,
|
|
115
115
|
getDirtyData: (i) => {
|
|
116
116
|
const e = i.params;
|
|
117
117
|
return {
|
|
118
118
|
dirtyRanges: this._getRemoveRowOrColumnMutation(e, !1)
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
}), this._activeDirtyManagerService.register(
|
|
122
|
-
commandId:
|
|
121
|
+
}), this._activeDirtyManagerService.register(vt.id, {
|
|
122
|
+
commandId: vt.id,
|
|
123
123
|
getDirtyData: (i) => {
|
|
124
124
|
const e = i.params;
|
|
125
125
|
return { dirtyNameMap: this._getRemoveSheetMutation(e) };
|
|
126
126
|
}
|
|
127
|
-
}), this._activeDirtyManagerService.register(
|
|
128
|
-
commandId:
|
|
127
|
+
}), this._activeDirtyManagerService.register(Pt.id, {
|
|
128
|
+
commandId: Pt.id,
|
|
129
129
|
getDirtyData: (i) => {
|
|
130
130
|
const e = i.params;
|
|
131
131
|
return { dirtyNameMap: this._getInsertSheetMutation(e) };
|
|
@@ -147,13 +147,13 @@ let qe = class extends H {
|
|
|
147
147
|
_getDeleteRangeMutationDirtyRange(i) {
|
|
148
148
|
const { subUnitId: e, unitId: t, range: n, shiftDimension: r } = i, a = [], s = this._currentUniverService.getUniverSheetInstance(t), o = s == null ? void 0 : s.getSheetBySheetId(e), c = (o == null ? void 0 : o.getLastRowWithContent()) || 0, u = (o == null ? void 0 : o.getLastColumnWithContent()) || 0, l = new x();
|
|
149
149
|
let d = null;
|
|
150
|
-
const { startRow: m, startColumn: b, endRow: h, endColumn:
|
|
151
|
-
r ===
|
|
150
|
+
const { startRow: m, startColumn: b, endRow: h, endColumn: g } = n;
|
|
151
|
+
r === Y.ROWS ? d = this._rangeToMatrix({
|
|
152
152
|
startRow: m,
|
|
153
153
|
startColumn: b,
|
|
154
154
|
endRow: c,
|
|
155
|
-
endColumn:
|
|
156
|
-
}) : r ===
|
|
155
|
+
endColumn: g
|
|
156
|
+
}) : r === Y.COLUMNS && (d = this._rangeToMatrix({
|
|
157
157
|
startRow: m,
|
|
158
158
|
startColumn: b,
|
|
159
159
|
endRow: h,
|
|
@@ -165,7 +165,7 @@ let qe = class extends H {
|
|
|
165
165
|
_getRemoveRowOrColumnMutation(i, e = !0) {
|
|
166
166
|
const { subUnitId: t, unitId: n, range: r } = i, a = [], s = this._currentUniverService.getUniverSheetInstance(n), o = s == null ? void 0 : s.getSheetBySheetId(t), c = (o == null ? void 0 : o.getRowCount()) || 0, u = (o == null ? void 0 : o.getColumnCount()) || 0, l = new x();
|
|
167
167
|
let d = null;
|
|
168
|
-
const { startRow: m, endRow: b, startColumn: h, endColumn:
|
|
168
|
+
const { startRow: m, endRow: b, startColumn: h, endColumn: g } = r;
|
|
169
169
|
e === !0 ? d = this._rangeToMatrix({
|
|
170
170
|
startRow: m,
|
|
171
171
|
startColumn: 0,
|
|
@@ -175,7 +175,7 @@ let qe = class extends H {
|
|
|
175
175
|
startRow: 0,
|
|
176
176
|
startColumn: h,
|
|
177
177
|
endRow: c,
|
|
178
|
-
endColumn:
|
|
178
|
+
endColumn: g
|
|
179
179
|
}), d != null && l.merge(d);
|
|
180
180
|
const f = l.getData();
|
|
181
181
|
return a.push(...this._getDirtyRangesByCellValue(n, t, f)), a.push(...this._getDirtyRangesForArrayFormula(n, t, f)), a;
|
|
@@ -217,15 +217,15 @@ let qe = class extends H {
|
|
|
217
217
|
c.forValue((d, m, b) => {
|
|
218
218
|
if (b == null)
|
|
219
219
|
return !0;
|
|
220
|
-
const { startRow: h, startColumn:
|
|
221
|
-
u >= h && u <= f && l >=
|
|
220
|
+
const { startRow: h, startColumn: g, endRow: f, endColumn: R } = b;
|
|
221
|
+
u >= h && u <= f && l >= g && l <= R && n.push({
|
|
222
222
|
unitId: i,
|
|
223
223
|
sheetId: e,
|
|
224
224
|
range: {
|
|
225
225
|
startRow: h,
|
|
226
|
-
startColumn:
|
|
226
|
+
startColumn: g,
|
|
227
227
|
endRow: h,
|
|
228
|
-
endColumn:
|
|
228
|
+
endColumn: g
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
});
|
|
@@ -234,18 +234,18 @@ let qe = class extends H {
|
|
|
234
234
|
return n;
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
],
|
|
243
|
-
var
|
|
244
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
237
|
+
He = Zr([
|
|
238
|
+
X(Q.Ready, He),
|
|
239
|
+
ft(0, xt),
|
|
240
|
+
ft(1, Ie),
|
|
241
|
+
ft(2, y(nt))
|
|
242
|
+
], He);
|
|
243
|
+
var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ni = (i, e, t, n) => {
|
|
244
|
+
for (var r = n > 1 ? void 0 : n ? ti(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
245
245
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
246
|
-
return n && r &&
|
|
247
|
-
},
|
|
248
|
-
let
|
|
246
|
+
return n && r && ei(e, t, r), r;
|
|
247
|
+
}, lt = (i, e) => (t, n) => e(t, n, i);
|
|
248
|
+
let $e = class extends $ {
|
|
249
249
|
constructor(i, e, t) {
|
|
250
250
|
super(), this._commandService = i, this._sheetInterceptorService = e, this._formulaDataModel = t, this._initialize();
|
|
251
251
|
}
|
|
@@ -255,7 +255,7 @@ let He = class extends H {
|
|
|
255
255
|
_commandExecutedListener() {
|
|
256
256
|
this.disposeWithMe(
|
|
257
257
|
this._commandService.onCommandExecuted((i) => {
|
|
258
|
-
if (i.id !==
|
|
258
|
+
if (i.id !== It.id)
|
|
259
259
|
return;
|
|
260
260
|
const e = i.params;
|
|
261
261
|
if (e == null)
|
|
@@ -267,29 +267,29 @@ let He = class extends H {
|
|
|
267
267
|
}
|
|
268
268
|
_initInterceptorCellContent() {
|
|
269
269
|
this.disposeWithMe(
|
|
270
|
-
this._sheetInterceptorService.intercept(
|
|
270
|
+
this._sheetInterceptorService.intercept(mn.CELL_CONTENT, {
|
|
271
271
|
priority: 100,
|
|
272
272
|
handler: (i, e, t) => {
|
|
273
|
-
var d, m, b, h,
|
|
274
|
-
const { unitId: n, subUnitId: r, row: a, col: s } = e, o = this._formulaDataModel.getArrayFormulaCellData(), c = this._formulaDataModel.getArrayFormulaRange(), u = (b = (m = (d = o == null ? void 0 : o[n]) == null ? void 0 : d[r]) == null ? void 0 : m[a]) == null ? void 0 : b[s], l = (f = (
|
|
273
|
+
var d, m, b, h, g, f;
|
|
274
|
+
const { unitId: n, subUnitId: r, row: a, col: s } = e, o = this._formulaDataModel.getArrayFormulaCellData(), c = this._formulaDataModel.getArrayFormulaRange(), u = (b = (m = (d = o == null ? void 0 : o[n]) == null ? void 0 : d[r]) == null ? void 0 : m[a]) == null ? void 0 : b[s], l = (f = (g = (h = c == null ? void 0 : c[n]) == null ? void 0 : h[r]) == null ? void 0 : g[a]) == null ? void 0 : f[s];
|
|
275
275
|
return u == null || l != null && l.startRow === a && l.startColumn === s ? t(i) : t({ ...i, ...u });
|
|
276
276
|
}
|
|
277
277
|
})
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
],
|
|
287
|
-
var
|
|
288
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
281
|
+
$e = ni([
|
|
282
|
+
X(Q.Ready, $e),
|
|
283
|
+
lt(0, J),
|
|
284
|
+
lt(1, y(yt)),
|
|
285
|
+
lt(2, y(nt))
|
|
286
|
+
], $e);
|
|
287
|
+
var ri = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, ai = (i, e, t, n) => {
|
|
288
|
+
for (var r = n > 1 ? void 0 : n ? ii(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
289
289
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
290
|
-
return n && r &&
|
|
291
|
-
},
|
|
292
|
-
let
|
|
290
|
+
return n && r && ri(e, t, r), r;
|
|
291
|
+
}, Jt = (i, e) => (t, n) => e(t, n, i);
|
|
292
|
+
let je = class extends $ {
|
|
293
293
|
constructor(i, e) {
|
|
294
294
|
super(), this._autoFillService = i, this._lexerTreeBuilder = e, this._initialize();
|
|
295
295
|
}
|
|
@@ -298,12 +298,12 @@ let $e = class extends H {
|
|
|
298
298
|
}
|
|
299
299
|
_registerAutoFill() {
|
|
300
300
|
const i = {
|
|
301
|
-
type:
|
|
301
|
+
type: Yt.FORMULA,
|
|
302
302
|
priority: 1001,
|
|
303
|
-
match: (e) =>
|
|
304
|
-
isContinue: (e, t) => e.type ===
|
|
303
|
+
match: (e) => Re(e == null ? void 0 : e.f) || Ut(e == null ? void 0 : e.si),
|
|
304
|
+
isContinue: (e, t) => e.type === Yt.FORMULA,
|
|
305
305
|
applyFunctions: {
|
|
306
|
-
[
|
|
306
|
+
[Cr.COPY]: (e, t, n, r) => {
|
|
307
307
|
const { data: a, index: s } = e;
|
|
308
308
|
return this._fillCopyFormula(a, t, n, s, r);
|
|
309
309
|
}
|
|
@@ -313,23 +313,23 @@ let $e = class extends H {
|
|
|
313
313
|
}
|
|
314
314
|
_fillCopyFormula(i, e, t, n, r) {
|
|
315
315
|
var c, u;
|
|
316
|
-
const a =
|
|
316
|
+
const a = oi(r), s = [], o = /* @__PURE__ */ new Map();
|
|
317
317
|
for (let l = 1; l <= e; l++) {
|
|
318
|
-
const d = (l - 1) % i.length, m =
|
|
318
|
+
const d = (l - 1) % i.length, m = K.deepClone(i[d]);
|
|
319
319
|
if (m) {
|
|
320
|
-
const b = ((c = i[d]) == null ? void 0 : c.f) || "", h = ((u = i[d]) == null ? void 0 : u.si) || "",
|
|
321
|
-
if (
|
|
320
|
+
const b = ((c = i[d]) == null ? void 0 : c.f) || "", h = ((u = i[d]) == null ? void 0 : u.si) || "", g = Re(b);
|
|
321
|
+
if (Ut(h))
|
|
322
322
|
m.si = h, m.f = null, m.v = null, m.p = null, t === M.DOWN || t === M.RIGHT ? s.push(m) : s.unshift(m);
|
|
323
|
-
else if (
|
|
323
|
+
else if (g) {
|
|
324
324
|
let R = o.get(d);
|
|
325
325
|
if (R)
|
|
326
326
|
m.si = R, m.f = null, m.v = null, m.p = null;
|
|
327
327
|
else {
|
|
328
|
-
R =
|
|
329
|
-
const { offsetX: p, offsetY:
|
|
328
|
+
R = K.generateRandomId(6), o.set(d, R);
|
|
329
|
+
const { offsetX: p, offsetY: I } = si(a, t), C = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
330
330
|
b,
|
|
331
331
|
p,
|
|
332
|
-
|
|
332
|
+
I
|
|
333
333
|
);
|
|
334
334
|
m.si = R, m.f = C, m.v = null, m.p = null;
|
|
335
335
|
}
|
|
@@ -340,12 +340,12 @@ let $e = class extends H {
|
|
|
340
340
|
return s;
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
],
|
|
348
|
-
function
|
|
343
|
+
je = ai([
|
|
344
|
+
X(Q.Ready, je),
|
|
345
|
+
Jt(0, kr),
|
|
346
|
+
Jt(1, y(ve))
|
|
347
|
+
], je);
|
|
348
|
+
function si(i, e) {
|
|
349
349
|
let t = 0, n = 0;
|
|
350
350
|
switch (e) {
|
|
351
351
|
case M.UP:
|
|
@@ -363,7 +363,7 @@ function ri(i, e) {
|
|
|
363
363
|
}
|
|
364
364
|
return { offsetX: t, offsetY: n };
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function oi(i) {
|
|
367
367
|
let e = 0;
|
|
368
368
|
for (const t in i)
|
|
369
369
|
i[t].forEach((n) => {
|
|
@@ -371,20 +371,20 @@ function ii(i) {
|
|
|
371
371
|
});
|
|
372
372
|
return e;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
374
|
+
const Nn = "special-paste-formula", Mn = {
|
|
375
375
|
id: "sheet.command.paste-formula",
|
|
376
376
|
type: oe.COMMAND,
|
|
377
|
-
handler: async (i) => i.get(
|
|
378
|
-
value:
|
|
377
|
+
handler: async (i) => i.get(J).executeCommand(_r.id, {
|
|
378
|
+
value: Nn
|
|
379
379
|
})
|
|
380
380
|
};
|
|
381
|
-
var
|
|
382
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
381
|
+
var ci = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, mi = (i, e, t, n) => {
|
|
382
|
+
for (var r = n > 1 ? void 0 : n ? ui(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
383
383
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
384
|
-
return n && r &&
|
|
385
|
-
},
|
|
386
|
-
const
|
|
387
|
-
let
|
|
384
|
+
return n && r && ci(e, t, r), r;
|
|
385
|
+
}, ze = (i, e) => (t, n) => e(t, n, i);
|
|
386
|
+
const fi = "default-paste-formula";
|
|
387
|
+
let We = class extends $ {
|
|
388
388
|
constructor(i, e, t, n) {
|
|
389
389
|
super(), this._currentUniverSheet = i, this._lexerTreeBuilder = e, this._sheetClipboardService = t, this._injector = n, this._initialize();
|
|
390
390
|
}
|
|
@@ -396,14 +396,14 @@ let je = class extends H {
|
|
|
396
396
|
}
|
|
397
397
|
_pasteFormulaHook() {
|
|
398
398
|
return {
|
|
399
|
-
hookName:
|
|
399
|
+
hookName: Nn,
|
|
400
400
|
specialPasteInfo: {
|
|
401
401
|
label: "specialPaste.formula"
|
|
402
402
|
},
|
|
403
403
|
onPasteCells: (e, t, n, r) => {
|
|
404
404
|
const a = this._currentUniverSheet.getCurrentUniverSheetInstance(), s = a.getUnitId(), o = a.getActiveSheet().getSheetId();
|
|
405
405
|
return this._injector.invoke(
|
|
406
|
-
(c) =>
|
|
406
|
+
(c) => Zt(
|
|
407
407
|
s,
|
|
408
408
|
o,
|
|
409
409
|
e,
|
|
@@ -419,11 +419,11 @@ let je = class extends H {
|
|
|
419
419
|
}
|
|
420
420
|
_pasteWithFormulaHook() {
|
|
421
421
|
return {
|
|
422
|
-
hookName:
|
|
422
|
+
hookName: fi,
|
|
423
423
|
onPasteCells: (e, t, n, r) => {
|
|
424
424
|
const a = this._currentUniverSheet.getCurrentUniverSheetInstance(), s = a.getUnitId(), o = a.getActiveSheet().getSheetId();
|
|
425
425
|
return this._injector.invoke(
|
|
426
|
-
(c) =>
|
|
426
|
+
(c) => Zt(
|
|
427
427
|
s,
|
|
428
428
|
o,
|
|
429
429
|
e,
|
|
@@ -437,30 +437,30 @@ let je = class extends H {
|
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
],
|
|
447
|
-
function
|
|
440
|
+
We = mi([
|
|
441
|
+
X(Q.Ready, We),
|
|
442
|
+
ze(0, Ie),
|
|
443
|
+
ze(1, y(ve)),
|
|
444
|
+
ze(2, Dr),
|
|
445
|
+
ze(3, y(tt))
|
|
446
|
+
], We);
|
|
447
|
+
function Zt(i, e, t, n, r, a, s, o = !1) {
|
|
448
448
|
const c = [], u = [], { startColumn: l, startRow: d } = t, m = new x(), b = /* @__PURE__ */ new Map();
|
|
449
|
-
let h = 0,
|
|
449
|
+
let h = 0, g = 0, f = 0, R = 0;
|
|
450
450
|
if (a) {
|
|
451
451
|
const { copyType: C, copyRange: S } = a;
|
|
452
|
-
C ===
|
|
452
|
+
C === yr.COPY && S && (f = S.startRow, R = S.startColumn, h = S.endRow - f + 1, g = S.endColumn - R + 1);
|
|
453
453
|
}
|
|
454
454
|
n.forValue((C, S, v) => {
|
|
455
|
-
const
|
|
456
|
-
if (o && (_.v = v.v),
|
|
457
|
-
const
|
|
455
|
+
const B = v.f || "", _ = {};
|
|
456
|
+
if (o && (_.v = v.v), Re(B) && h && g) {
|
|
457
|
+
const A = C % h, P = S % g, T = `${A}_${P}`;
|
|
458
458
|
let D = b.get(T);
|
|
459
459
|
if (D)
|
|
460
460
|
_.si = D, _.f = null, _.v = null, _.p = null;
|
|
461
461
|
else {
|
|
462
|
-
D =
|
|
463
|
-
const
|
|
462
|
+
D = K.generateRandomId(6), b.set(T, D);
|
|
463
|
+
const j = S + l - (R + P), U = C + d - (f + A), ce = s.moveFormulaRefOffset(B, j, U);
|
|
464
464
|
_.si = D, _.f = ce, _.v = null, _.p = null;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
@@ -475,24 +475,24 @@ function Jt(i, e, t, n, r, a, s, o = !1) {
|
|
|
475
475
|
id: ie.id,
|
|
476
476
|
params: p
|
|
477
477
|
});
|
|
478
|
-
const
|
|
478
|
+
const I = fn(
|
|
479
479
|
r,
|
|
480
480
|
p
|
|
481
481
|
);
|
|
482
482
|
return u.push({
|
|
483
483
|
id: ie.id,
|
|
484
|
-
params:
|
|
484
|
+
params: I
|
|
485
485
|
}), {
|
|
486
486
|
undos: u,
|
|
487
487
|
redos: c
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
|
-
var
|
|
491
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
490
|
+
var li = Object.defineProperty, di = Object.getOwnPropertyDescriptor, bi = (i, e, t, n) => {
|
|
491
|
+
for (var r = n > 1 ? void 0 : n ? di(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
492
492
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
493
|
-
return n && r &&
|
|
494
|
-
},
|
|
495
|
-
let
|
|
493
|
+
return n && r && li(e, t, r), r;
|
|
494
|
+
}, te = (i, e) => (t, n) => e(t, n, i);
|
|
495
|
+
let Ge = class extends $ {
|
|
496
496
|
constructor(e, t, n, r, a, s, o, c, u) {
|
|
497
497
|
super();
|
|
498
498
|
k(this, "_previousShape");
|
|
@@ -505,62 +505,65 @@ let We = class extends H {
|
|
|
505
505
|
this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
|
|
506
506
|
{
|
|
507
507
|
handler: (e, t, n) => {
|
|
508
|
-
var
|
|
509
|
-
const { row: r, col: a, unitId: s, subUnitId: o } = t,
|
|
508
|
+
var h, g, f, R;
|
|
509
|
+
const { row: r, col: a, unitId: s, subUnitId: o, worksheet: c } = t, u = this._formulaDataModel.getArrayFormulaRange(), l = this._formulaDataModel.getArrayFormulaCellData();
|
|
510
510
|
if (this._removeArrayFormulaRangeShape(), e == null)
|
|
511
511
|
return n(e);
|
|
512
|
-
let
|
|
513
|
-
const
|
|
512
|
+
let d = null;
|
|
513
|
+
const m = this._formulaDataModel.getFormulaDataItem(
|
|
514
514
|
r,
|
|
515
515
|
a,
|
|
516
516
|
o,
|
|
517
517
|
s
|
|
518
518
|
);
|
|
519
|
-
if (
|
|
520
|
-
const { f:
|
|
521
|
-
if (
|
|
522
|
-
let
|
|
523
|
-
if (
|
|
524
|
-
|
|
519
|
+
if (m != null) {
|
|
520
|
+
const { f: p, si: I, x: C = 0, y: S = 0 } = m;
|
|
521
|
+
if (I != null && (C > 0 || S > 0)) {
|
|
522
|
+
let v = "";
|
|
523
|
+
if (p.length > 0)
|
|
524
|
+
v = p;
|
|
525
525
|
else {
|
|
526
|
-
const
|
|
527
|
-
|
|
526
|
+
const _ = this._formulaDataModel.getFormulaItemBySId(
|
|
527
|
+
I,
|
|
528
528
|
o,
|
|
529
529
|
s
|
|
530
530
|
);
|
|
531
|
-
if (
|
|
531
|
+
if (_ == null || _.f.length === 0)
|
|
532
532
|
return n(e);
|
|
533
|
-
|
|
533
|
+
v = _.f;
|
|
534
534
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
535
|
+
d = { f: this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
536
|
+
v,
|
|
537
|
+
C,
|
|
538
|
+
S
|
|
539
539
|
) };
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
if (e.v != null && e.v !== "" && ((
|
|
543
|
-
return
|
|
544
|
-
const
|
|
545
|
-
return
|
|
546
|
-
if (
|
|
542
|
+
if (e.v != null && e.v !== "" && ((f = (g = (h = l[s]) == null ? void 0 : h[o]) == null ? void 0 : g[r]) == null ? void 0 : f[a]) == null)
|
|
543
|
+
return d || n(e);
|
|
544
|
+
const b = (R = u == null ? void 0 : u[s]) == null ? void 0 : R[o];
|
|
545
|
+
return b != null && new x(b).forValue((p, I, C) => {
|
|
546
|
+
if (C == null)
|
|
547
547
|
return !0;
|
|
548
|
-
const { startRow:
|
|
549
|
-
if (
|
|
550
|
-
return this._createArrayFormulaRangeShape(
|
|
551
|
-
if (r >=
|
|
552
|
-
const
|
|
553
|
-
|
|
548
|
+
const { startRow: S, startColumn: v, endRow: B, endColumn: _ } = C;
|
|
549
|
+
if (p === r && I === a)
|
|
550
|
+
return this._createArrayFormulaRangeShape(C, s), !1;
|
|
551
|
+
if (r >= S && r <= B && a >= v && a <= _) {
|
|
552
|
+
const A = c.getCell(S, v);
|
|
553
|
+
if ((A == null ? void 0 : A.v) === nr.SPILL)
|
|
554
|
+
return;
|
|
555
|
+
const P = this._formulaDataModel.getFormulaDataItem(
|
|
554
556
|
p,
|
|
557
|
+
I,
|
|
555
558
|
o,
|
|
556
559
|
s
|
|
557
560
|
);
|
|
558
|
-
return
|
|
559
|
-
f:
|
|
561
|
+
return P == null || P.f == null ? !0 : (d == null && (d = {
|
|
562
|
+
f: P.f,
|
|
560
563
|
isInArrayFormulaRange: !0
|
|
561
|
-
}), this._createArrayFormulaRangeShape(
|
|
564
|
+
}), this._createArrayFormulaRangeShape(C, s), !1);
|
|
562
565
|
}
|
|
563
|
-
}),
|
|
566
|
+
}), d || n(e);
|
|
564
567
|
}
|
|
565
568
|
}
|
|
566
569
|
)
|
|
@@ -569,7 +572,7 @@ let We = class extends H {
|
|
|
569
572
|
}
|
|
570
573
|
_initInterceptorCell() {
|
|
571
574
|
this.disposeWithMe(
|
|
572
|
-
this._sheetInterceptorService.intercept(
|
|
575
|
+
this._sheetInterceptorService.intercept(mn.CELL_CONTENT, {
|
|
573
576
|
handler: (e, t, n) => {
|
|
574
577
|
var l, d, m;
|
|
575
578
|
const { row: r, col: a, unitId: s, subUnitId: o } = t, c = this._formulaDataModel.getArrayFormulaCellData(), u = (m = (d = (l = c == null ? void 0 : c[s]) == null ? void 0 : l[o]) == null ? void 0 : d[r]) == null ? void 0 : m[a];
|
|
@@ -581,13 +584,13 @@ let We = class extends H {
|
|
|
581
584
|
_commandExecutedListener() {
|
|
582
585
|
this.disposeWithMe(
|
|
583
586
|
this._commandService.onCommandExecuted((e) => {
|
|
584
|
-
e.id ===
|
|
587
|
+
e.id === rr.id && this._removeArrayFormulaRangeShape();
|
|
585
588
|
})
|
|
586
589
|
);
|
|
587
590
|
}
|
|
588
591
|
_createArrayFormulaRangeShape(e, t) {
|
|
589
592
|
var b;
|
|
590
|
-
const n = this._themeService.getCurrentTheme(), r = new
|
|
593
|
+
const n = this._themeService.getCurrentTheme(), r = new sn(n.colorWhite).setAlpha(0).toString(), a = {
|
|
591
594
|
strokeWidth: 1,
|
|
592
595
|
stroke: n.hyacinth700,
|
|
593
596
|
fill: r,
|
|
@@ -602,31 +605,31 @@ let We = class extends H {
|
|
|
602
605
|
}), u = (b = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : b.skeleton;
|
|
603
606
|
if (!s || !u)
|
|
604
607
|
return;
|
|
605
|
-
const { rowHeaderWidth: l, columnHeaderHeight: d } = u, m = new
|
|
608
|
+
const { rowHeaderWidth: l, columnHeaderHeight: d } = u, m = new Tr(s, 100, !1, this._themeService);
|
|
606
609
|
m.update(o, l, d, a, c), this._previousShape = m;
|
|
607
610
|
}
|
|
608
611
|
_removeArrayFormulaRangeShape() {
|
|
609
612
|
this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
|
|
610
613
|
}
|
|
611
614
|
};
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
],
|
|
624
|
-
const
|
|
615
|
+
Ge = bi([
|
|
616
|
+
X(Q.Rendered, Ge),
|
|
617
|
+
te(0, y(At)),
|
|
618
|
+
te(1, y(nt)),
|
|
619
|
+
te(2, y(ve)),
|
|
620
|
+
te(3, y(on)),
|
|
621
|
+
te(4, Mt),
|
|
622
|
+
te(5, Cn),
|
|
623
|
+
te(6, y(Bn)),
|
|
624
|
+
te(7, J),
|
|
625
|
+
te(8, y(yt))
|
|
626
|
+
], Ge);
|
|
627
|
+
const wt = {
|
|
625
628
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
626
629
|
type: oe.OPERATION,
|
|
627
630
|
handler: async (i) => !0
|
|
628
631
|
};
|
|
629
|
-
class
|
|
632
|
+
class pi {
|
|
630
633
|
constructor() {
|
|
631
634
|
k(this, "_sequenceNodes", []);
|
|
632
635
|
k(this, "_isSelectionMoving", !1);
|
|
@@ -692,7 +695,7 @@ class li {
|
|
|
692
695
|
*/
|
|
693
696
|
updateSequenceRef(e, t) {
|
|
694
697
|
const n = this._sequenceNodes[e];
|
|
695
|
-
if (typeof n == "string" || n.nodeType !==
|
|
698
|
+
if (typeof n == "string" || n.nodeType !== G.REFERENCE)
|
|
696
699
|
return;
|
|
697
700
|
const r = t.length - n.token.length, a = { ...n };
|
|
698
701
|
a.token = t, a.endIndex += r, this._sequenceNodes[e] = a;
|
|
@@ -717,7 +720,7 @@ class li {
|
|
|
717
720
|
token: t,
|
|
718
721
|
startIndex: e,
|
|
719
722
|
endIndex: e + n - 1,
|
|
720
|
-
nodeType:
|
|
723
|
+
nodeType: G.REFERENCE
|
|
721
724
|
});
|
|
722
725
|
for (let a = r + 1, s = this._sequenceNodes.length; a < s; a++) {
|
|
723
726
|
const o = this._sequenceNodes[a];
|
|
@@ -775,13 +778,13 @@ class li {
|
|
|
775
778
|
return this._isLockedOnSelectionInsertRefString;
|
|
776
779
|
}
|
|
777
780
|
}
|
|
778
|
-
const
|
|
779
|
-
var
|
|
780
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
781
|
+
const Ne = et("formula-ui.input-service");
|
|
782
|
+
var hi = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, Ri = (i, e, t, n) => {
|
|
783
|
+
for (var r = n > 1 ? void 0 : n ? Ei(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
781
784
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
782
|
-
return n && r &&
|
|
785
|
+
return n && r && hi(e, t, r), r;
|
|
783
786
|
}, me = (i, e) => (t, n) => e(t, n, i);
|
|
784
|
-
let
|
|
787
|
+
let Ke = class extends $ {
|
|
785
788
|
constructor(e, t, n, r, a, s, o) {
|
|
786
789
|
super();
|
|
787
790
|
k(this, "_userCursorMove", !1);
|
|
@@ -832,7 +835,7 @@ let Ge = class extends H {
|
|
|
832
835
|
if (e == null)
|
|
833
836
|
return;
|
|
834
837
|
const { startOffset: t } = e, n = t - 2, r = this._formulaInputService.getCurrentSequenceNodeIndex(n), a = this._formulaInputService.getCurrentSequenceNodeByIndex(r);
|
|
835
|
-
if (a == null || typeof a == "string" || a.nodeType !==
|
|
838
|
+
if (a == null || typeof a == "string" || a.nodeType !== G.REFERENCE)
|
|
836
839
|
return;
|
|
837
840
|
const s = a.token.split("!");
|
|
838
841
|
let o = a.token;
|
|
@@ -841,12 +844,12 @@ let Ge = class extends H {
|
|
|
841
844
|
for (let d = 0, m = s.length; d < m - 1; d++)
|
|
842
845
|
c += s[d];
|
|
843
846
|
let u = o;
|
|
844
|
-
if (o.indexOf(
|
|
847
|
+
if (o.indexOf(W.COLON) > -1)
|
|
845
848
|
if (!this._userCursorMove)
|
|
846
849
|
u = this._changeRangeRef(o);
|
|
847
850
|
else {
|
|
848
|
-
const d = o.split(
|
|
849
|
-
n - a.startIndex <= m.length ? u = this._changeSingleRef(m) +
|
|
851
|
+
const d = o.split(W.COLON), m = d[0], b = d[1];
|
|
852
|
+
n - a.startIndex <= m.length ? u = this._changeSingleRef(m) + W.COLON + b : u = m + W.COLON + this._changeSingleRef(b);
|
|
850
853
|
}
|
|
851
854
|
else
|
|
852
855
|
u = this._changeSingleRef(o);
|
|
@@ -855,17 +858,17 @@ let Ge = class extends H {
|
|
|
855
858
|
this._formulaInputService.updateSequenceRef(r, u), this._formulaInputService.syncToEditor(n + l + 1);
|
|
856
859
|
}
|
|
857
860
|
_changeRangeRef(e) {
|
|
858
|
-
const t =
|
|
861
|
+
const t = ge(e).range;
|
|
859
862
|
let n = "";
|
|
860
|
-
return t.startAbsoluteRefType ===
|
|
863
|
+
return t.startAbsoluteRefType === L.NONE || t.startAbsoluteRefType == null ? (t.startAbsoluteRefType = L.ALL, t.endAbsoluteRefType = L.ALL) : (t.startAbsoluteRefType = L.NONE, t.endAbsoluteRefType = L.NONE), n = gt(t), n;
|
|
861
864
|
}
|
|
862
865
|
_changeSingleRef(e) {
|
|
863
|
-
const t =
|
|
866
|
+
const t = ge(e).range, n = t.startAbsoluteRefType;
|
|
864
867
|
let r = "";
|
|
865
|
-
return n ===
|
|
868
|
+
return n === L.NONE || n == null ? (t.startAbsoluteRefType = L.ALL, t.endAbsoluteRefType = L.ALL) : n === L.ALL ? (t.startAbsoluteRefType = L.ROW, t.endAbsoluteRefType = L.ROW) : n === L.ROW ? (t.startAbsoluteRefType = L.COLUMN, t.endAbsoluteRefType = L.COLUMN) : (t.startAbsoluteRefType = L.NONE, t.endAbsoluteRefType = L.NONE), r = gt(t), r;
|
|
866
869
|
}
|
|
867
870
|
_commandExecutedListener() {
|
|
868
|
-
const e = [
|
|
871
|
+
const e = [wt.id];
|
|
869
872
|
this.disposeWithMe(
|
|
870
873
|
this._commandService.onCommandExecuted((t) => {
|
|
871
874
|
e.includes(t.id) && this._changeRefString();
|
|
@@ -873,32 +876,32 @@ let Ge = class extends H {
|
|
|
873
876
|
);
|
|
874
877
|
}
|
|
875
878
|
_getEditorObject() {
|
|
876
|
-
return
|
|
879
|
+
return St(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
|
|
877
880
|
}
|
|
878
881
|
};
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
me(0,
|
|
882
|
-
me(1,
|
|
883
|
-
me(2, y(
|
|
884
|
-
me(3, y(
|
|
885
|
-
me(4,
|
|
886
|
-
me(5,
|
|
887
|
-
me(6, y(
|
|
888
|
-
],
|
|
889
|
-
const
|
|
882
|
+
Ke = Ri([
|
|
883
|
+
X(Q.Steady, Ke),
|
|
884
|
+
me(0, J),
|
|
885
|
+
me(1, _n),
|
|
886
|
+
me(2, y(At)),
|
|
887
|
+
me(3, y(ve)),
|
|
888
|
+
me(4, Mt),
|
|
889
|
+
me(5, Ne),
|
|
890
|
+
me(6, y(Dn))
|
|
891
|
+
], Ke);
|
|
892
|
+
const On = {
|
|
890
893
|
id: "formula-ui.command.insert-function",
|
|
891
894
|
type: oe.COMMAND,
|
|
892
895
|
handler: async (i, e) => {
|
|
893
|
-
const { list: t } = e, n = i.get(
|
|
896
|
+
const { list: t } = e, n = i.get(J), r = new x();
|
|
894
897
|
t.forEach((s) => {
|
|
895
|
-
const { range: o, primary: c, formula: u } = s, { row: l, column: d } = c, m =
|
|
898
|
+
const { range: o, primary: c, formula: u } = s, { row: l, column: d } = c, m = K.generateRandomId(6);
|
|
896
899
|
r.setValue(l, d, {
|
|
897
900
|
f: u,
|
|
898
901
|
si: m
|
|
899
902
|
});
|
|
900
|
-
const { startRow: b, startColumn: h, endRow:
|
|
901
|
-
for (let R = b; R <=
|
|
903
|
+
const { startRow: b, startColumn: h, endRow: g, endColumn: f } = o;
|
|
904
|
+
for (let R = b; R <= g; R++)
|
|
902
905
|
for (let p = h; p <= f; p++)
|
|
903
906
|
(R !== l || p !== d) && r.setValue(R, p, {
|
|
904
907
|
si: m
|
|
@@ -907,9 +910,9 @@ const Mn = {
|
|
|
907
910
|
const a = {
|
|
908
911
|
value: r.getData()
|
|
909
912
|
};
|
|
910
|
-
return n.executeCommand(
|
|
913
|
+
return n.executeCommand(fr.id, a);
|
|
911
914
|
}
|
|
912
|
-
},
|
|
915
|
+
}, Pe = {
|
|
913
916
|
id: "formula-ui.operation.select-editor-formula",
|
|
914
917
|
type: oe.OPERATION,
|
|
915
918
|
handler: (i, e) => (
|
|
@@ -941,8 +944,8 @@ const Mn = {
|
|
|
941
944
|
// }
|
|
942
945
|
!0
|
|
943
946
|
)
|
|
944
|
-
}, de =
|
|
945
|
-
class
|
|
947
|
+
}, de = et("formula-ui.prompt-service");
|
|
948
|
+
class gi {
|
|
946
949
|
constructor() {
|
|
947
950
|
k(this, "_search$", new re());
|
|
948
951
|
k(this, "_help$", new re());
|
|
@@ -983,62 +986,62 @@ class hi {
|
|
|
983
986
|
this._acceptFormulaName$.next(e);
|
|
984
987
|
}
|
|
985
988
|
}
|
|
986
|
-
const
|
|
989
|
+
const Bt = {
|
|
987
990
|
id: "formula-ui.operation.help-function",
|
|
988
991
|
type: oe.OPERATION,
|
|
989
992
|
handler: async (i, e) => (i.get(de).help(e), !0)
|
|
990
|
-
},
|
|
993
|
+
}, Lt = {
|
|
991
994
|
id: "formula-ui.operation.insert-function",
|
|
992
995
|
type: oe.OPERATION,
|
|
993
996
|
handler: async (i, e) => {
|
|
994
|
-
const t = i.get(
|
|
997
|
+
const t = i.get(Tt), n = i.get(Ne), r = t.getSelections();
|
|
995
998
|
if (!r || !r.length)
|
|
996
999
|
return !1;
|
|
997
|
-
const a = i.get(
|
|
998
|
-
let b = null, h = 0,
|
|
1000
|
+
const a = i.get(Ie).getCurrentUniverSheetInstance(), s = a.getActiveSheet(), o = a.getUnitId(), c = s.getSheetId(), u = s.getCellMatrix(), { value: l } = e, d = i.get(J), m = [];
|
|
1001
|
+
let b = null, h = 0, g = 0;
|
|
999
1002
|
if (r.some((f) => {
|
|
1000
|
-
const { range: R, primary: p } = f,
|
|
1003
|
+
const { range: R, primary: p } = f, I = (p == null ? void 0 : p.actualRow) ?? R.startRow, C = (p == null ? void 0 : p.actualColumn) ?? R.startColumn, S = Ii(u, I, C);
|
|
1001
1004
|
if (!S)
|
|
1002
|
-
return b = R, h =
|
|
1003
|
-
const v =
|
|
1005
|
+
return b = R, h = I, g = C, !0;
|
|
1006
|
+
const v = gt(S), B = `=${l}(${v})`;
|
|
1004
1007
|
return m.push({
|
|
1005
1008
|
range: R,
|
|
1006
1009
|
primary: {
|
|
1007
|
-
row:
|
|
1010
|
+
row: I,
|
|
1008
1011
|
column: C
|
|
1009
1012
|
},
|
|
1010
|
-
formula:
|
|
1013
|
+
formula: B
|
|
1011
1014
|
}), !1;
|
|
1012
1015
|
}), b) {
|
|
1013
|
-
const f =
|
|
1014
|
-
range:
|
|
1016
|
+
const f = lr(h, g, s), R = {
|
|
1017
|
+
range: Ve.clone(b),
|
|
1015
1018
|
primary: {
|
|
1016
1019
|
startRow: f.startRow,
|
|
1017
1020
|
startColumn: f.startColumn,
|
|
1018
1021
|
endRow: f.endRow,
|
|
1019
1022
|
endColumn: f.endColumn,
|
|
1020
1023
|
actualRow: h,
|
|
1021
|
-
actualColumn:
|
|
1024
|
+
actualColumn: g,
|
|
1022
1025
|
isMerged: f.isMerged,
|
|
1023
|
-
isMergedMainCell: f.startRow === h && f.startColumn ===
|
|
1026
|
+
isMergedMainCell: f.startRow === h && f.startColumn === g
|
|
1024
1027
|
}
|
|
1025
1028
|
}, p = {
|
|
1026
1029
|
unitId: o,
|
|
1027
1030
|
sheetId: c,
|
|
1028
|
-
pluginName:
|
|
1031
|
+
pluginName: Ce,
|
|
1029
1032
|
selections: [R]
|
|
1030
1033
|
};
|
|
1031
|
-
await d.executeCommand(
|
|
1034
|
+
await d.executeCommand(dr.id, p), setTimeout(() => {
|
|
1032
1035
|
n.inputFormula(`=${l}(`);
|
|
1033
1036
|
}, 0);
|
|
1034
1037
|
}
|
|
1035
|
-
return m.length === 0 ? !1 : d.executeCommand(
|
|
1038
|
+
return m.length === 0 ? !1 : d.executeCommand(On.id, {
|
|
1036
1039
|
list: m
|
|
1037
1040
|
});
|
|
1038
1041
|
}
|
|
1039
1042
|
};
|
|
1040
|
-
function
|
|
1041
|
-
const n =
|
|
1043
|
+
function Ii(i, e, t) {
|
|
1044
|
+
const n = vi(i, e, t);
|
|
1042
1045
|
if (n !== e)
|
|
1043
1046
|
return {
|
|
1044
1047
|
startRow: n,
|
|
@@ -1046,7 +1049,7 @@ function Ei(i, e, t) {
|
|
|
1046
1049
|
startColumn: t,
|
|
1047
1050
|
endColumn: t
|
|
1048
1051
|
};
|
|
1049
|
-
const r =
|
|
1052
|
+
const r = Pi(i, e, t);
|
|
1050
1053
|
return r !== t ? {
|
|
1051
1054
|
startRow: e,
|
|
1052
1055
|
endRow: e,
|
|
@@ -1054,18 +1057,18 @@ function Ei(i, e, t) {
|
|
|
1054
1057
|
endColumn: t - 1
|
|
1055
1058
|
} : null;
|
|
1056
1059
|
}
|
|
1057
|
-
function
|
|
1060
|
+
function vi(i, e, t) {
|
|
1058
1061
|
let n = !1;
|
|
1059
1062
|
if (e === 0)
|
|
1060
1063
|
return e;
|
|
1061
1064
|
for (let r = e - 1; r >= 0; r--) {
|
|
1062
1065
|
const a = i.getValue(r, t);
|
|
1063
|
-
if (
|
|
1066
|
+
if (Ze(a) && !n) {
|
|
1064
1067
|
if (r === 0)
|
|
1065
1068
|
return 0;
|
|
1066
1069
|
n = !0;
|
|
1067
1070
|
} else {
|
|
1068
|
-
if (n && !
|
|
1071
|
+
if (n && !Ze(a))
|
|
1069
1072
|
return r + 1;
|
|
1070
1073
|
if (n && r === 0)
|
|
1071
1074
|
return 0;
|
|
@@ -1073,18 +1076,18 @@ function Ri(i, e, t) {
|
|
|
1073
1076
|
}
|
|
1074
1077
|
return e;
|
|
1075
1078
|
}
|
|
1076
|
-
function
|
|
1079
|
+
function Pi(i, e, t) {
|
|
1077
1080
|
let n = !1;
|
|
1078
1081
|
if (t === 0)
|
|
1079
1082
|
return t;
|
|
1080
1083
|
for (let r = t - 1; r >= 0; r--) {
|
|
1081
1084
|
const a = i.getValue(e, r);
|
|
1082
|
-
if (
|
|
1085
|
+
if (Ze(a) && !n) {
|
|
1083
1086
|
if (r === 0)
|
|
1084
1087
|
return 0;
|
|
1085
1088
|
n = !0;
|
|
1086
1089
|
} else {
|
|
1087
|
-
if (n && !
|
|
1090
|
+
if (n && !Ze(a))
|
|
1088
1091
|
return r + 1;
|
|
1089
1092
|
if (n && r === 0)
|
|
1090
1093
|
return 0;
|
|
@@ -1092,22 +1095,22 @@ function gi(i, e, t) {
|
|
|
1092
1095
|
}
|
|
1093
1096
|
return t;
|
|
1094
1097
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return i && (
|
|
1098
|
+
function Ze(i) {
|
|
1099
|
+
return i && (K.isStringNumber(i.v) || Xn(i) === Qn.NUMBER);
|
|
1097
1100
|
}
|
|
1098
|
-
const
|
|
1101
|
+
const xn = `${An}_MORE_FUNCTIONS_COMPONENT`, wn = {
|
|
1099
1102
|
id: "formula-ui.operation.more-functions",
|
|
1100
1103
|
type: oe.OPERATION,
|
|
1101
|
-
handler: async (i) => (i.get(
|
|
1104
|
+
handler: async (i) => (i.get(yn).open({
|
|
1102
1105
|
header: { title: "formula.insert.tooltip" },
|
|
1103
|
-
children: { label:
|
|
1106
|
+
children: { label: xn }
|
|
1104
1107
|
}), !0)
|
|
1105
|
-
},
|
|
1108
|
+
}, Ct = {
|
|
1106
1109
|
id: "formula-ui.operation.search-function",
|
|
1107
1110
|
type: oe.OPERATION,
|
|
1108
1111
|
handler: async (i, e) => (i.get(de).search(e), !0)
|
|
1109
1112
|
};
|
|
1110
|
-
var
|
|
1113
|
+
var Ln = { exports: {} }, at = {};
|
|
1111
1114
|
/**
|
|
1112
1115
|
* @license React
|
|
1113
1116
|
* react-jsx-runtime.production.min.js
|
|
@@ -1117,28 +1120,28 @@ var wn = { exports: {} }, it = {};
|
|
|
1117
1120
|
* This source code is licensed under the MIT license found in the
|
|
1118
1121
|
* LICENSE file in the root directory of this source tree.
|
|
1119
1122
|
*/
|
|
1120
|
-
var
|
|
1123
|
+
var Si = Wr, Bi = Symbol.for("react.element"), Ci = Symbol.for("react.fragment"), ki = Object.prototype.hasOwnProperty, _i = Si.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Di = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1121
1124
|
function Fn(i, e, t) {
|
|
1122
1125
|
var n, r = {}, a = null, s = null;
|
|
1123
1126
|
t !== void 0 && (a = "" + t), e.key !== void 0 && (a = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
|
1124
1127
|
for (n in e)
|
|
1125
|
-
|
|
1128
|
+
ki.call(e, n) && !Di.hasOwnProperty(n) && (r[n] = e[n]);
|
|
1126
1129
|
if (i && i.defaultProps)
|
|
1127
1130
|
for (n in e = i.defaultProps, e)
|
|
1128
1131
|
r[n] === void 0 && (r[n] = e[n]);
|
|
1129
|
-
return { $$typeof:
|
|
1132
|
+
return { $$typeof: Bi, type: i, key: a, ref: s, props: r, _owner: _i.current };
|
|
1130
1133
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
var E =
|
|
1136
|
-
const
|
|
1137
|
-
formulaErrorFunction:
|
|
1134
|
+
at.Fragment = Ci;
|
|
1135
|
+
at.jsx = Fn;
|
|
1136
|
+
at.jsxs = Fn;
|
|
1137
|
+
Ln.exports = at;
|
|
1138
|
+
var E = Ln.exports;
|
|
1139
|
+
const yi = "univer-formula-error-function", Ti = {
|
|
1140
|
+
formulaErrorFunction: yi
|
|
1138
1141
|
};
|
|
1139
|
-
function
|
|
1140
|
-
const [i, e] =
|
|
1141
|
-
return
|
|
1142
|
+
function Ai() {
|
|
1143
|
+
const [i, e] = N(!1), [t, n] = N({ left: 0, top: 0 }), r = z(de), a = z(Nt);
|
|
1144
|
+
return _e(() => {
|
|
1142
1145
|
const s = r.help$.subscribe((o) => {
|
|
1143
1146
|
const c = a.getState();
|
|
1144
1147
|
if (!c)
|
|
@@ -1154,18 +1157,18 @@ function Di() {
|
|
|
1154
1157
|
return () => {
|
|
1155
1158
|
s == null || s.unsubscribe();
|
|
1156
1159
|
};
|
|
1157
|
-
}, []), i ? /* @__PURE__ */ E.jsx("div", { className:
|
|
1160
|
+
}, []), i ? /* @__PURE__ */ E.jsx("div", { className: Ti.formulaErrorFunction, style: { left: t.left, top: t.top } }) : null;
|
|
1158
1161
|
}
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1162
|
+
var H = function() {
|
|
1163
|
+
return H = Object.assign || function(i) {
|
|
1161
1164
|
for (var e, t = 1, n = arguments.length; t < n; t++) {
|
|
1162
1165
|
e = arguments[t];
|
|
1163
1166
|
for (var r in e)
|
|
1164
1167
|
Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
1165
1168
|
}
|
|
1166
1169
|
return i;
|
|
1167
|
-
},
|
|
1168
|
-
},
|
|
1170
|
+
}, H.apply(this, arguments);
|
|
1171
|
+
}, Ni = function(i, e) {
|
|
1169
1172
|
var t = {};
|
|
1170
1173
|
for (var n in i)
|
|
1171
1174
|
Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
|
|
@@ -1173,17 +1176,17 @@ var q = function() {
|
|
|
1173
1176
|
for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
|
|
1174
1177
|
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
|
|
1175
1178
|
return t;
|
|
1176
|
-
},
|
|
1177
|
-
var t = i.icon, n = i.id, r = i.className, a = i.extend, s =
|
|
1178
|
-
return
|
|
1179
|
+
}, Me = Te(function(i, e) {
|
|
1180
|
+
var t = i.icon, n = i.id, r = i.className, a = i.extend, s = Ni(i, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = Gr("_".concat(xi()));
|
|
1181
|
+
return zn(t, "".concat(n), { defIds: t.defIds, idSuffix: c.current }, H({ ref: e, className: o }, s), a);
|
|
1179
1182
|
});
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1182
|
-
return
|
|
1183
|
+
function zn(i, e, t, n, r) {
|
|
1184
|
+
return Ae(i.tag, H(H({ key: e }, Mi(i, t, r)), n), (Oi(i, t).children || []).map(function(a, s) {
|
|
1185
|
+
return zn(a, "".concat(e, "-").concat(i.tag, "-").concat(s), t, void 0, r);
|
|
1183
1186
|
}));
|
|
1184
1187
|
}
|
|
1185
|
-
function
|
|
1186
|
-
var n =
|
|
1188
|
+
function Mi(i, e, t) {
|
|
1189
|
+
var n = H({}, i.attrs);
|
|
1187
1190
|
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
|
|
1188
1191
|
var r = e.defIds;
|
|
1189
1192
|
return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(a) {
|
|
@@ -1191,17 +1194,17 @@ function Ti(i, e, t) {
|
|
|
1191
1194
|
typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1192
1195
|
})), n;
|
|
1193
1196
|
}
|
|
1194
|
-
function
|
|
1197
|
+
function Oi(i, e) {
|
|
1195
1198
|
var t, n = e.defIds;
|
|
1196
|
-
return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ?
|
|
1197
|
-
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ?
|
|
1199
|
+
return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? H(H({}, i), { children: i.children.map(function(r) {
|
|
1200
|
+
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? H(H({}, r), { attrs: H(H({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
1198
1201
|
}) }) : i;
|
|
1199
1202
|
}
|
|
1200
|
-
function
|
|
1203
|
+
function xi() {
|
|
1201
1204
|
return Math.random().toString(36).substring(2, 8);
|
|
1202
1205
|
}
|
|
1203
|
-
|
|
1204
|
-
var
|
|
1206
|
+
Me.displayName = "UniverIcon";
|
|
1207
|
+
var wi = {
|
|
1205
1208
|
tag: "svg",
|
|
1206
1209
|
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
1207
1210
|
children: [
|
|
@@ -1215,16 +1218,16 @@ var Mi = {
|
|
|
1215
1218
|
}
|
|
1216
1219
|
}
|
|
1217
1220
|
]
|
|
1218
|
-
},
|
|
1219
|
-
return
|
|
1221
|
+
}, Un = Te(function(i, e) {
|
|
1222
|
+
return Ae(Me, Object.assign({}, i, {
|
|
1220
1223
|
id: "check-mark-single",
|
|
1221
1224
|
ref: e,
|
|
1222
|
-
icon:
|
|
1225
|
+
icon: wi
|
|
1223
1226
|
}));
|
|
1224
1227
|
});
|
|
1225
|
-
|
|
1226
|
-
const
|
|
1227
|
-
var
|
|
1228
|
+
Un.displayName = "CheckMarkSingle";
|
|
1229
|
+
const Li = Un;
|
|
1230
|
+
var Fi = {
|
|
1228
1231
|
tag: "svg",
|
|
1229
1232
|
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
1230
1233
|
children: [
|
|
@@ -1236,16 +1239,16 @@ var xi = {
|
|
|
1236
1239
|
}
|
|
1237
1240
|
}
|
|
1238
1241
|
]
|
|
1239
|
-
},
|
|
1240
|
-
return
|
|
1242
|
+
}, Vn = Te(function(i, e) {
|
|
1243
|
+
return Ae(Me, Object.assign({}, i, {
|
|
1241
1244
|
id: "close-single",
|
|
1242
1245
|
ref: e,
|
|
1243
|
-
icon:
|
|
1246
|
+
icon: Fi
|
|
1244
1247
|
}));
|
|
1245
1248
|
});
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
var
|
|
1249
|
+
Vn.displayName = "CloseSingle";
|
|
1250
|
+
const zi = Vn;
|
|
1251
|
+
var Ui = {
|
|
1249
1252
|
tag: "svg",
|
|
1250
1253
|
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
1251
1254
|
children: [
|
|
@@ -1288,16 +1291,16 @@ var Fi = {
|
|
|
1288
1291
|
]
|
|
1289
1292
|
}
|
|
1290
1293
|
]
|
|
1291
|
-
},
|
|
1292
|
-
return
|
|
1294
|
+
}, qn = Te(function(i, e) {
|
|
1295
|
+
return Ae(Me, Object.assign({}, i, {
|
|
1293
1296
|
id: "details-single",
|
|
1294
1297
|
ref: e,
|
|
1295
|
-
icon:
|
|
1298
|
+
icon: Ui
|
|
1296
1299
|
}));
|
|
1297
1300
|
});
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1300
|
-
var
|
|
1301
|
+
qn.displayName = "DetailsSingle";
|
|
1302
|
+
const Vi = qn;
|
|
1303
|
+
var qi = {
|
|
1301
1304
|
tag: "svg",
|
|
1302
1305
|
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
1303
1306
|
children: [
|
|
@@ -1311,45 +1314,45 @@ var zi = {
|
|
|
1311
1314
|
}
|
|
1312
1315
|
}
|
|
1313
1316
|
]
|
|
1314
|
-
},
|
|
1315
|
-
return
|
|
1317
|
+
}, Hn = Te(function(i, e) {
|
|
1318
|
+
return Ae(Me, Object.assign({}, i, {
|
|
1316
1319
|
id: "more-single",
|
|
1317
1320
|
ref: e,
|
|
1318
|
-
icon:
|
|
1321
|
+
icon: qi
|
|
1319
1322
|
}));
|
|
1320
1323
|
});
|
|
1321
|
-
|
|
1322
|
-
const
|
|
1323
|
-
formulaHelpFunction:
|
|
1324
|
-
formulaHelpFunctionTitle:
|
|
1325
|
-
formulaHelpFunctionTitleIcons:
|
|
1326
|
-
formulaHelpFunctionTitleIcon:
|
|
1327
|
-
formulaHelpFunctionContent:
|
|
1328
|
-
formulaHelpFunctionContentInner:
|
|
1329
|
-
formulaHelpFunctionContentParams:
|
|
1330
|
-
formulaHelpFunctionContentParamsTitle:
|
|
1331
|
-
formulaHelpFunctionContentParamsDetail:
|
|
1332
|
-
formulaHelpFunctionActive:
|
|
1333
|
-
formulaHelpDecorator:
|
|
1324
|
+
Hn.displayName = "MoreSingle";
|
|
1325
|
+
const Hi = Hn, $i = "univer-formula-help-function", ji = "univer-formula-help-function-title", Wi = "univer-formula-help-function-title-icons", Gi = "univer-formula-help-function-title-icon", Ki = "univer-formula-help-function-content", Yi = "univer-formula-help-function-content-inner", Xi = "univer-formula-help-function-content-params", Qi = "univer-formula-help-function-content-params-title", Ji = "univer-formula-help-function-content-params-detail", Zi = "univer-formula-help-function-active", ea = "univer-formula-help-decorator", V = {
|
|
1326
|
+
formulaHelpFunction: $i,
|
|
1327
|
+
formulaHelpFunctionTitle: ji,
|
|
1328
|
+
formulaHelpFunctionTitleIcons: Wi,
|
|
1329
|
+
formulaHelpFunctionTitleIcon: Gi,
|
|
1330
|
+
formulaHelpFunctionContent: Ki,
|
|
1331
|
+
formulaHelpFunctionContentInner: Yi,
|
|
1332
|
+
formulaHelpFunctionContentParams: Xi,
|
|
1333
|
+
formulaHelpFunctionContentParamsTitle: Qi,
|
|
1334
|
+
formulaHelpFunctionContentParamsDetail: Ji,
|
|
1335
|
+
formulaHelpFunctionActive: Zi,
|
|
1336
|
+
formulaHelpDecorator: ea
|
|
1334
1337
|
};
|
|
1335
|
-
function
|
|
1336
|
-
const [i, e] =
|
|
1337
|
-
|
|
1338
|
-
const v = h.help$.subscribe((
|
|
1339
|
-
const { visible: _, paramIndex:
|
|
1338
|
+
function ta() {
|
|
1339
|
+
const [i, e] = N(!1), [t, n] = N(!0), [r, a] = N(!0), [s, o] = N(0), [c, u] = N([0, 0]), [l, d] = N({ left: 0, top: 0 }), [m, b] = N(null), h = z(de), g = z(Nt), f = z(De), R = z(kn), p = z(_t), I = f.t("formula.prompt.required"), C = f.t("formula.prompt.optional");
|
|
1340
|
+
_e(() => {
|
|
1341
|
+
const v = h.help$.subscribe((B) => {
|
|
1342
|
+
const { visible: _, paramIndex: A, functionInfo: P } = B;
|
|
1340
1343
|
if (!_) {
|
|
1341
1344
|
e(_);
|
|
1342
1345
|
return;
|
|
1343
1346
|
}
|
|
1344
|
-
const D = p.getContextValue(
|
|
1347
|
+
const D = p.getContextValue(cn) ? R.getPosition() : g.getRect();
|
|
1345
1348
|
if (D == null)
|
|
1346
1349
|
return;
|
|
1347
|
-
const { left:
|
|
1348
|
-
functionName:
|
|
1349
|
-
functionType:
|
|
1350
|
-
description: f.t(
|
|
1351
|
-
abstract: f.t(
|
|
1352
|
-
functionParameter:
|
|
1350
|
+
const { left: j, top: U, height: ce } = D, be = {
|
|
1351
|
+
functionName: P.functionName,
|
|
1352
|
+
functionType: P.functionType,
|
|
1353
|
+
description: f.t(P.description),
|
|
1354
|
+
abstract: f.t(P.abstract),
|
|
1355
|
+
functionParameter: P.functionParameter.map((ue) => ({
|
|
1353
1356
|
name: f.t(ue.name),
|
|
1354
1357
|
detail: f.t(ue.detail),
|
|
1355
1358
|
example: ue.example,
|
|
@@ -1357,7 +1360,7 @@ function Ji() {
|
|
|
1357
1360
|
repeat: ue.repeat
|
|
1358
1361
|
}))
|
|
1359
1362
|
};
|
|
1360
|
-
u([
|
|
1363
|
+
u([j, U + ce]), o(A), b(be), d({ left: j, top: U }), e(_);
|
|
1361
1364
|
});
|
|
1362
1365
|
return () => {
|
|
1363
1366
|
v == null || v.unsubscribe();
|
|
@@ -1366,10 +1369,10 @@ function Ji() {
|
|
|
1366
1369
|
function S(v) {
|
|
1367
1370
|
o(v);
|
|
1368
1371
|
}
|
|
1369
|
-
return /* @__PURE__ */ E.jsx(E.Fragment, { children: r ? /* @__PURE__ */ E.jsx(
|
|
1372
|
+
return /* @__PURE__ */ E.jsx(E.Fragment, { children: r ? /* @__PURE__ */ E.jsx(Tn, { visible: i, offset: c, children: m ? /* @__PURE__ */ E.jsxs("div", { className: V.formulaHelpFunction, children: [
|
|
1370
1373
|
/* @__PURE__ */ E.jsxs("div", { className: V.formulaHelpFunctionTitle, children: [
|
|
1371
1374
|
/* @__PURE__ */ E.jsx(
|
|
1372
|
-
|
|
1375
|
+
na,
|
|
1373
1376
|
{
|
|
1374
1377
|
prefix: m.functionName,
|
|
1375
1378
|
value: m.functionParameter,
|
|
@@ -1384,7 +1387,7 @@ function Ji() {
|
|
|
1384
1387
|
className: V.formulaHelpFunctionTitleIcon,
|
|
1385
1388
|
style: { transform: t ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
1386
1389
|
onClick: () => n(!t),
|
|
1387
|
-
children: /* @__PURE__ */ E.jsx(
|
|
1390
|
+
children: /* @__PURE__ */ E.jsx(Hi, {})
|
|
1388
1391
|
}
|
|
1389
1392
|
),
|
|
1390
1393
|
/* @__PURE__ */ E.jsx(
|
|
@@ -1392,7 +1395,7 @@ function Ji() {
|
|
|
1392
1395
|
{
|
|
1393
1396
|
className: V.formulaHelpFunctionTitleIcon,
|
|
1394
1397
|
onClick: () => a(!r),
|
|
1395
|
-
children: /* @__PURE__ */ E.jsx(
|
|
1398
|
+
children: /* @__PURE__ */ E.jsx(zi, {})
|
|
1396
1399
|
}
|
|
1397
1400
|
)
|
|
1398
1401
|
] })
|
|
@@ -1407,27 +1410,27 @@ function Ji() {
|
|
|
1407
1410
|
},
|
|
1408
1411
|
children: /* @__PURE__ */ E.jsxs("div", { className: V.formulaHelpFunctionContentInner, children: [
|
|
1409
1412
|
/* @__PURE__ */ E.jsx(
|
|
1410
|
-
|
|
1413
|
+
dt,
|
|
1411
1414
|
{
|
|
1412
1415
|
title: f.t("formula.prompt.helpExample"),
|
|
1413
1416
|
value: `${m.functionName}(${m.functionParameter.map((v) => v.example).join(",")})`
|
|
1414
1417
|
}
|
|
1415
1418
|
),
|
|
1416
1419
|
/* @__PURE__ */ E.jsx(
|
|
1417
|
-
|
|
1420
|
+
dt,
|
|
1418
1421
|
{
|
|
1419
1422
|
title: f.t("formula.prompt.helpAbstract"),
|
|
1420
1423
|
value: m.description
|
|
1421
1424
|
}
|
|
1422
1425
|
),
|
|
1423
|
-
m && m.functionParameter && m.functionParameter.map((v,
|
|
1424
|
-
|
|
1426
|
+
m && m.functionParameter && m.functionParameter.map((v, B) => /* @__PURE__ */ E.jsx(
|
|
1427
|
+
dt,
|
|
1425
1428
|
{
|
|
1426
|
-
className: s ===
|
|
1429
|
+
className: s === B ? V.formulaHelpFunctionActive : "",
|
|
1427
1430
|
title: v.name,
|
|
1428
|
-
value: `${v.require ?
|
|
1431
|
+
value: `${v.require ? I : C} ${v.detail}`
|
|
1429
1432
|
},
|
|
1430
|
-
|
|
1433
|
+
B
|
|
1431
1434
|
))
|
|
1432
1435
|
] })
|
|
1433
1436
|
}
|
|
@@ -1438,14 +1441,14 @@ function Ji() {
|
|
|
1438
1441
|
className: V.formulaHelpDecorator,
|
|
1439
1442
|
onClick: () => a(!r),
|
|
1440
1443
|
style: { left: l.left - 24, top: l.top },
|
|
1441
|
-
children: /* @__PURE__ */ E.jsx(
|
|
1444
|
+
children: /* @__PURE__ */ E.jsx(Vi, {})
|
|
1442
1445
|
}
|
|
1443
1446
|
) : /* @__PURE__ */ E.jsx(E.Fragment, {}) });
|
|
1444
1447
|
}
|
|
1445
|
-
const
|
|
1448
|
+
const dt = (i) => /* @__PURE__ */ E.jsxs("div", { className: V.formulaHelpFunctionContentParams, children: [
|
|
1446
1449
|
/* @__PURE__ */ E.jsx("div", { className: `${V.formulaHelpFunctionContentParamsTitle} ${i.className}`, children: i.title }),
|
|
1447
1450
|
/* @__PURE__ */ E.jsx("div", { className: V.formulaHelpFunctionContentParamsDetail, children: i.value })
|
|
1448
|
-
] }),
|
|
1451
|
+
] }), na = (i) => {
|
|
1449
1452
|
const { prefix: e, value: t, active: n, onClick: r } = i;
|
|
1450
1453
|
return /* @__PURE__ */ E.jsxs("div", { children: [
|
|
1451
1454
|
/* @__PURE__ */ E.jsxs("span", { children: [
|
|
@@ -1468,58 +1471,58 @@ const lt = (i) => /* @__PURE__ */ E.jsxs("div", { className: V.formulaHelpFuncti
|
|
|
1468
1471
|
)),
|
|
1469
1472
|
")"
|
|
1470
1473
|
] });
|
|
1471
|
-
},
|
|
1472
|
-
formulaSearchFunction:
|
|
1473
|
-
formulaSearchFunctionItem:
|
|
1474
|
-
formulaSearchFunctionItemName:
|
|
1475
|
-
formulaSearchFunctionItemNameLight:
|
|
1476
|
-
formulaSearchFunctionItemDesc:
|
|
1477
|
-
formulaSearchFunctionItemActive:
|
|
1474
|
+
}, ra = "univer-formula-search-function", ia = "univer-formula-search-function-item", aa = "univer-formula-search-function-item-name", sa = "univer-formula-search-function-item-name-light", oa = "univer-formula-search-function-item-desc", ca = "univer-formula-search-function-item-active", fe = {
|
|
1475
|
+
formulaSearchFunction: ra,
|
|
1476
|
+
formulaSearchFunctionItem: ia,
|
|
1477
|
+
formulaSearchFunctionItemName: aa,
|
|
1478
|
+
formulaSearchFunctionItemNameLight: sa,
|
|
1479
|
+
formulaSearchFunctionItemDesc: oa,
|
|
1480
|
+
formulaSearchFunctionItemActive: ca
|
|
1478
1481
|
};
|
|
1479
|
-
function
|
|
1480
|
-
const [i, e] =
|
|
1481
|
-
|
|
1482
|
+
function ua() {
|
|
1483
|
+
const [i, e] = N(!1), [t, n] = N(0), [r, a] = N([0, 0]), [s, o] = N([]), [c, u] = N(""), l = z(de), d = z(Nt), m = z(kn), b = z(_t);
|
|
1484
|
+
_e(() => {
|
|
1482
1485
|
let f = [], R = 0;
|
|
1483
1486
|
const p = l.search$.subscribe((S) => {
|
|
1484
|
-
const { visible: v, searchText:
|
|
1487
|
+
const { visible: v, searchText: B, searchList: _ } = S;
|
|
1485
1488
|
if (!v) {
|
|
1486
1489
|
e(v);
|
|
1487
1490
|
return;
|
|
1488
1491
|
}
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1492
|
+
const P = b.getContextValue(cn) ? m.getPosition() : d.getRect();
|
|
1493
|
+
if (P == null)
|
|
1491
1494
|
return;
|
|
1492
|
-
const { left: T, top: D, height:
|
|
1493
|
-
u(
|
|
1494
|
-
}),
|
|
1495
|
+
const { left: T, top: D, height: j } = P;
|
|
1496
|
+
u(B), o(_), f = _, a([T, D + j]), e(v), n(0), R = 0;
|
|
1497
|
+
}), I = l.navigate$.subscribe((S) => {
|
|
1495
1498
|
const { direction: v } = S;
|
|
1496
1499
|
if (v === M.UP) {
|
|
1497
|
-
let
|
|
1498
|
-
|
|
1500
|
+
let B = R - 1;
|
|
1501
|
+
B = B < 0 ? f.length - 1 : B, n(B), R = B;
|
|
1499
1502
|
} else if (v === M.DOWN) {
|
|
1500
|
-
let
|
|
1501
|
-
|
|
1503
|
+
let B = R + 1;
|
|
1504
|
+
B = B >= f.length ? 0 : B, n(B), R = B;
|
|
1502
1505
|
}
|
|
1503
1506
|
}), C = l.accept$.subscribe((S) => {
|
|
1504
1507
|
const v = f[R].name;
|
|
1505
1508
|
l.acceptFormulaName(v);
|
|
1506
1509
|
});
|
|
1507
1510
|
return () => {
|
|
1508
|
-
p == null || p.unsubscribe(),
|
|
1511
|
+
p == null || p.unsubscribe(), I == null || I.unsubscribe(), C == null || C.unsubscribe();
|
|
1509
1512
|
};
|
|
1510
1513
|
}, []);
|
|
1511
1514
|
function h(f) {
|
|
1512
1515
|
n(f);
|
|
1513
1516
|
}
|
|
1514
|
-
function
|
|
1517
|
+
function g() {
|
|
1515
1518
|
n(-1);
|
|
1516
1519
|
}
|
|
1517
|
-
return /* @__PURE__ */ E.jsx(
|
|
1520
|
+
return /* @__PURE__ */ E.jsx(Tn, { visible: i, offset: r, children: /* @__PURE__ */ E.jsx("ul", { className: fe.formulaSearchFunction, children: s.map((f, R) => /* @__PURE__ */ E.jsxs(
|
|
1518
1521
|
"li",
|
|
1519
1522
|
{
|
|
1520
1523
|
className: t === R ? `${fe.formulaSearchFunctionItem} ${fe.formulaSearchFunctionItemActive}` : fe.formulaSearchFunctionItem,
|
|
1521
1524
|
onMouseEnter: () => h(R),
|
|
1522
|
-
onMouseLeave:
|
|
1525
|
+
onMouseLeave: g,
|
|
1523
1526
|
onClick: () => l.acceptFormulaName(f.name),
|
|
1524
1527
|
children: [
|
|
1525
1528
|
/* @__PURE__ */ E.jsxs("span", { className: fe.formulaSearchFunctionItemName, children: [
|
|
@@ -1532,18 +1535,18 @@ function sa() {
|
|
|
1532
1535
|
R
|
|
1533
1536
|
)) }) });
|
|
1534
1537
|
}
|
|
1535
|
-
function
|
|
1538
|
+
function ma() {
|
|
1536
1539
|
return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1537
|
-
/* @__PURE__ */ E.jsx(
|
|
1538
|
-
/* @__PURE__ */ E.jsx(
|
|
1539
|
-
/* @__PURE__ */ E.jsx(
|
|
1540
|
+
/* @__PURE__ */ E.jsx(ua, {}),
|
|
1541
|
+
/* @__PURE__ */ E.jsx(ta, {}),
|
|
1542
|
+
/* @__PURE__ */ E.jsx(Ai, {})
|
|
1540
1543
|
] });
|
|
1541
1544
|
}
|
|
1542
|
-
const
|
|
1543
|
-
formulaMoreFunctions:
|
|
1544
|
-
formulaMoreFunctionsOperation:
|
|
1545
|
+
const fa = "univer-formula-more-functions", la = "univer-formula-more-functions-operation", en = {
|
|
1546
|
+
formulaMoreFunctions: fa,
|
|
1547
|
+
formulaMoreFunctionsOperation: la
|
|
1545
1548
|
};
|
|
1546
|
-
function
|
|
1549
|
+
function $n(i) {
|
|
1547
1550
|
const { prefix: e, value: t } = i;
|
|
1548
1551
|
return /* @__PURE__ */ E.jsxs("div", { children: [
|
|
1549
1552
|
/* @__PURE__ */ E.jsxs("span", { children: [
|
|
@@ -1557,28 +1560,28 @@ function Hn(i) {
|
|
|
1557
1560
|
")"
|
|
1558
1561
|
] });
|
|
1559
1562
|
}
|
|
1560
|
-
const
|
|
1561
|
-
formulaFunctionParams:
|
|
1562
|
-
formulaFunctionParamsTitle:
|
|
1563
|
-
formulaFunctionParamsDetail:
|
|
1563
|
+
const da = "univer-formula-function-params", ba = "univer-formula-function-params-title", pa = "univer-formula-function-params-detail", bt = {
|
|
1564
|
+
formulaFunctionParams: da,
|
|
1565
|
+
formulaFunctionParamsTitle: ba,
|
|
1566
|
+
formulaFunctionParamsDetail: pa
|
|
1564
1567
|
};
|
|
1565
1568
|
function ke(i) {
|
|
1566
1569
|
const { className: e, value: t, title: n } = i;
|
|
1567
|
-
return /* @__PURE__ */ E.jsxs("div", { className:
|
|
1568
|
-
/* @__PURE__ */ E.jsx("div", { className: `${
|
|
1569
|
-
/* @__PURE__ */ E.jsx("div", { className:
|
|
1570
|
+
return /* @__PURE__ */ E.jsxs("div", { className: bt.formulaFunctionParams, children: [
|
|
1571
|
+
/* @__PURE__ */ E.jsx("div", { className: `${bt.formulaFunctionParamsTitle} ${e}`, children: n }),
|
|
1572
|
+
/* @__PURE__ */ E.jsx("div", { className: bt.formulaFunctionParamsDetail, children: t })
|
|
1570
1573
|
] });
|
|
1571
1574
|
}
|
|
1572
|
-
const
|
|
1573
|
-
formulaInputParamsList:
|
|
1574
|
-
formulaInputParamsListItemName:
|
|
1575
|
-
formulaInputParamsListItemSelector:
|
|
1575
|
+
const ha = "univer-formula-input-params-list", Ea = "univer-formula-input-params-list-item-name", Ra = "univer-formula-input-params-list-item-selector", Be = {
|
|
1576
|
+
formulaInputParamsList: ha,
|
|
1577
|
+
formulaInputParamsListItemName: Ea,
|
|
1578
|
+
formulaInputParamsListItemSelector: Ra
|
|
1576
1579
|
};
|
|
1577
|
-
function
|
|
1580
|
+
function ga(i) {
|
|
1578
1581
|
const { functionInfo: e, onChange: t } = i;
|
|
1579
1582
|
if (!e)
|
|
1580
1583
|
return null;
|
|
1581
|
-
const [n, r] =
|
|
1584
|
+
const [n, r] = N([]), [a, s] = N(e.functionParameter), [o, c] = N(-1);
|
|
1582
1585
|
function u(d, m) {
|
|
1583
1586
|
const b = [...n];
|
|
1584
1587
|
b[m] = d, r(b), t(b);
|
|
@@ -1590,31 +1593,122 @@ function ha(i) {
|
|
|
1590
1593
|
}
|
|
1591
1594
|
c(d);
|
|
1592
1595
|
}
|
|
1593
|
-
return /* @__PURE__ */ E.jsxs("div", { className:
|
|
1594
|
-
/* @__PURE__ */ E.jsx("div", { className:
|
|
1595
|
-
/* @__PURE__ */ E.jsx("div", { className:
|
|
1596
|
-
/* @__PURE__ */ E.jsx("div", { className:
|
|
1597
|
-
|
|
1596
|
+
return /* @__PURE__ */ E.jsxs("div", { className: Be.formulaInputParams, children: [
|
|
1597
|
+
/* @__PURE__ */ E.jsx("div", { className: Be.formulaInputParamsList, children: a.map((d, m) => /* @__PURE__ */ E.jsxs("div", { children: [
|
|
1598
|
+
/* @__PURE__ */ E.jsx("div", { className: Be.formulaInputParamsListItemName, children: d.name }),
|
|
1599
|
+
/* @__PURE__ */ E.jsx("div", { className: Be.formulaInputParamsListItemSelector, children: /* @__PURE__ */ E.jsx(
|
|
1600
|
+
Ar,
|
|
1598
1601
|
{
|
|
1599
1602
|
onChange: (b) => u(b, m),
|
|
1600
1603
|
onActive: () => l(m)
|
|
1601
1604
|
}
|
|
1602
1605
|
) })
|
|
1603
1606
|
] }, m)) }),
|
|
1604
|
-
/* @__PURE__ */ E.jsx("div", { className:
|
|
1607
|
+
/* @__PURE__ */ E.jsx("div", { className: Be.formulaInputParamsInfo, children: /* @__PURE__ */ E.jsx(
|
|
1605
1608
|
ke,
|
|
1606
1609
|
{
|
|
1607
|
-
title: o === -1 ? /* @__PURE__ */ E.jsx(
|
|
1610
|
+
title: o === -1 ? /* @__PURE__ */ E.jsx($n, { prefix: e.functionName, value: a }) : a[o].name,
|
|
1608
1611
|
value: o === -1 ? e.description : a[o].detail
|
|
1609
1612
|
}
|
|
1610
1613
|
) })
|
|
1611
1614
|
] });
|
|
1612
1615
|
}
|
|
1613
|
-
const
|
|
1616
|
+
const Ia = [
|
|
1617
|
+
{
|
|
1618
|
+
functionName: ir.MAKEARRAY,
|
|
1619
|
+
aliasFunctionName: "formula.functionList.MAKEARRAY.aliasFunctionName",
|
|
1620
|
+
functionType: q.Array,
|
|
1621
|
+
description: "formula.functionList.MAKEARRAY.description",
|
|
1622
|
+
abstract: "formula.functionList.MAKEARRAY.abstract",
|
|
1623
|
+
functionParameter: [
|
|
1624
|
+
{
|
|
1625
|
+
name: "formula.functionList.MAKEARRAY.functionParameter.number1.name",
|
|
1626
|
+
detail: "formula.functionList.MAKEARRAY.functionParameter.number1.detail",
|
|
1627
|
+
example: "8",
|
|
1628
|
+
require: 1,
|
|
1629
|
+
repeat: 0
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
name: "formula.functionList.MAKEARRAY.functionParameter.number2.name",
|
|
1633
|
+
detail: "formula.functionList.MAKEARRAY.functionParameter.number2.detail",
|
|
1634
|
+
example: "7",
|
|
1635
|
+
require: 1,
|
|
1636
|
+
repeat: 0
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
name: "formula.functionList.MAKEARRAY.functionParameter.value3.name",
|
|
1640
|
+
detail: "formula.functionList.MAKEARRAY.functionParameter.value3.detail",
|
|
1641
|
+
example: "LAMBDA(r,c, r*c)",
|
|
1642
|
+
require: 1,
|
|
1643
|
+
repeat: 0
|
|
1644
|
+
}
|
|
1645
|
+
]
|
|
1646
|
+
}
|
|
1647
|
+
], va = [], Pa = [], Sa = [], Ba = [], Ca = [], ka = [], _a = [], Da = [], ya = [], Ta = [
|
|
1648
|
+
{
|
|
1649
|
+
functionName: pe.ABS,
|
|
1650
|
+
functionType: q.Math,
|
|
1651
|
+
description: "formula.functionList.ABS.description",
|
|
1652
|
+
abstract: "formula.functionList.ABS.abstract",
|
|
1653
|
+
functionParameter: [
|
|
1654
|
+
{
|
|
1655
|
+
name: "formula.functionList.ABS.functionParameter.number.name",
|
|
1656
|
+
detail: "formula.functionList.ABS.functionParameter.number.detail",
|
|
1657
|
+
example: "A1:A20",
|
|
1658
|
+
require: 1,
|
|
1659
|
+
repeat: 0
|
|
1660
|
+
}
|
|
1661
|
+
]
|
|
1662
|
+
},
|
|
1614
1663
|
{
|
|
1615
|
-
functionName:
|
|
1664
|
+
functionName: pe.ACOS,
|
|
1665
|
+
functionType: q.Math,
|
|
1666
|
+
description: "formula.functionList.ACOS.description",
|
|
1667
|
+
abstract: "formula.functionList.ACOS.abstract",
|
|
1668
|
+
functionParameter: [
|
|
1669
|
+
{
|
|
1670
|
+
name: "formula.functionList.ACOS.functionParameter.number.name",
|
|
1671
|
+
detail: "formula.functionList.ACOS.functionParameter.number.detail",
|
|
1672
|
+
example: "A1:A20",
|
|
1673
|
+
require: 1,
|
|
1674
|
+
repeat: 0
|
|
1675
|
+
}
|
|
1676
|
+
]
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
functionName: pe.ACOSH,
|
|
1680
|
+
functionType: q.Math,
|
|
1681
|
+
description: "formula.functionList.ACOSH.description",
|
|
1682
|
+
abstract: "formula.functionList.ACOSH.abstract",
|
|
1683
|
+
functionParameter: [
|
|
1684
|
+
{
|
|
1685
|
+
name: "formula.functionList.ACOSH.functionParameter.number.name",
|
|
1686
|
+
detail: "formula.functionList.ACOSH.functionParameter.number.detail",
|
|
1687
|
+
example: "A1:A20",
|
|
1688
|
+
require: 1,
|
|
1689
|
+
repeat: 0
|
|
1690
|
+
}
|
|
1691
|
+
]
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
functionName: pe.ACOT,
|
|
1695
|
+
functionType: q.Math,
|
|
1696
|
+
description: "formula.functionList.ACOT.description",
|
|
1697
|
+
abstract: "formula.functionList.ACOT.abstract",
|
|
1698
|
+
functionParameter: [
|
|
1699
|
+
{
|
|
1700
|
+
name: "formula.functionList.ACOT.functionParameter.number.name",
|
|
1701
|
+
detail: "formula.functionList.ACOT.functionParameter.number.detail",
|
|
1702
|
+
example: "A1:A20",
|
|
1703
|
+
require: 1,
|
|
1704
|
+
repeat: 0
|
|
1705
|
+
}
|
|
1706
|
+
]
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
functionName: pe.SUM,
|
|
1616
1710
|
aliasFunctionName: "formula.functionList.SUM.aliasFunctionName",
|
|
1617
|
-
functionType:
|
|
1711
|
+
functionType: q.Math,
|
|
1618
1712
|
description: "formula.functionList.SUM.description",
|
|
1619
1713
|
abstract: "formula.functionList.SUM.abstract",
|
|
1620
1714
|
functionParameter: [
|
|
@@ -1635,9 +1729,9 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1635
1729
|
]
|
|
1636
1730
|
},
|
|
1637
1731
|
{
|
|
1638
|
-
functionName:
|
|
1732
|
+
functionName: pe.SUMIF,
|
|
1639
1733
|
aliasFunctionName: "formula.functionList.SUMIF.aliasFunctionName",
|
|
1640
|
-
functionType:
|
|
1734
|
+
functionType: q.Math,
|
|
1641
1735
|
description: "formula.functionList.SUMIF.description",
|
|
1642
1736
|
abstract: "formula.functionList.SUMIF.abstract",
|
|
1643
1737
|
functionParameter: [
|
|
@@ -1664,11 +1758,11 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1664
1758
|
}
|
|
1665
1759
|
]
|
|
1666
1760
|
}
|
|
1667
|
-
],
|
|
1761
|
+
], Aa = [
|
|
1668
1762
|
{
|
|
1669
|
-
functionName:
|
|
1763
|
+
functionName: Se.AVERAGE,
|
|
1670
1764
|
aliasFunctionName: "formula.functionList.AVERAGE.aliasFunctionName",
|
|
1671
|
-
functionType:
|
|
1765
|
+
functionType: q.Statistical,
|
|
1672
1766
|
description: "formula.functionList.AVERAGE.description",
|
|
1673
1767
|
abstract: "formula.functionList.AVERAGE.abstract",
|
|
1674
1768
|
functionParameter: [
|
|
@@ -1689,9 +1783,9 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1689
1783
|
]
|
|
1690
1784
|
},
|
|
1691
1785
|
{
|
|
1692
|
-
functionName:
|
|
1786
|
+
functionName: Se.MAX,
|
|
1693
1787
|
aliasFunctionName: "formula.functionList.MAX.aliasFunctionName",
|
|
1694
|
-
functionType:
|
|
1788
|
+
functionType: q.Statistical,
|
|
1695
1789
|
description: "formula.functionList.MAX.description",
|
|
1696
1790
|
abstract: "formula.functionList.MAX.abstract",
|
|
1697
1791
|
functionParameter: [
|
|
@@ -1712,9 +1806,9 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1712
1806
|
]
|
|
1713
1807
|
},
|
|
1714
1808
|
{
|
|
1715
|
-
functionName:
|
|
1809
|
+
functionName: Se.COUNT,
|
|
1716
1810
|
aliasFunctionName: "formula.functionList.COUNT.aliasFunctionName",
|
|
1717
|
-
functionType:
|
|
1811
|
+
functionType: q.Statistical,
|
|
1718
1812
|
description: "formula.functionList.COUNT.description",
|
|
1719
1813
|
abstract: "formula.functionList.COUNT.abstract",
|
|
1720
1814
|
functionParameter: [
|
|
@@ -1735,9 +1829,9 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1735
1829
|
]
|
|
1736
1830
|
},
|
|
1737
1831
|
{
|
|
1738
|
-
functionName:
|
|
1832
|
+
functionName: Se.MIN,
|
|
1739
1833
|
aliasFunctionName: "formula.functionList.MIN.aliasFunctionName",
|
|
1740
|
-
functionType:
|
|
1834
|
+
functionType: q.Statistical,
|
|
1741
1835
|
description: "formula.functionList.MIN.description",
|
|
1742
1836
|
abstract: "formula.functionList.MIN.abstract",
|
|
1743
1837
|
functionParameter: [
|
|
@@ -1758,9 +1852,9 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1758
1852
|
]
|
|
1759
1853
|
},
|
|
1760
1854
|
{
|
|
1761
|
-
functionName:
|
|
1855
|
+
functionName: Se.COUNTA,
|
|
1762
1856
|
aliasFunctionName: "formula.functionList.COUNTA.aliasFunctionName",
|
|
1763
|
-
functionType:
|
|
1857
|
+
functionType: q.Statistical,
|
|
1764
1858
|
description: "formula.functionList.COUNT_A.description",
|
|
1765
1859
|
abstract: "formula.functionList.COUNT_A.abstract",
|
|
1766
1860
|
functionParameter: [
|
|
@@ -1780,40 +1874,40 @@ const Ea = [], Ra = [], ga = [], Ia = [], va = [], Pa = [], Sa = [], Ba = [], ka
|
|
|
1780
1874
|
}
|
|
1781
1875
|
]
|
|
1782
1876
|
}
|
|
1783
|
-
],
|
|
1877
|
+
], Na = [], Ma = [], Oa = [], xa = [
|
|
1878
|
+
...ka,
|
|
1879
|
+
...Ba,
|
|
1880
|
+
...Ta,
|
|
1881
|
+
...Aa,
|
|
1882
|
+
...ya,
|
|
1784
1883
|
...Sa,
|
|
1785
|
-
...
|
|
1786
|
-
..._a,
|
|
1884
|
+
...Na,
|
|
1787
1885
|
...Da,
|
|
1886
|
+
..._a,
|
|
1788
1887
|
...Ca,
|
|
1789
|
-
...Ia,
|
|
1790
|
-
...ya,
|
|
1791
|
-
...ka,
|
|
1792
|
-
...Ba,
|
|
1793
1888
|
...Pa,
|
|
1794
|
-
...
|
|
1795
|
-
...
|
|
1796
|
-
...
|
|
1797
|
-
...
|
|
1798
|
-
...Ta
|
|
1889
|
+
...va,
|
|
1890
|
+
...Oa,
|
|
1891
|
+
...Ia,
|
|
1892
|
+
...Ma
|
|
1799
1893
|
];
|
|
1800
|
-
function
|
|
1894
|
+
function wa(i, e) {
|
|
1801
1895
|
return Object.keys(i).filter((t) => isNaN(Number(t))).map((t) => ({
|
|
1802
1896
|
label: e.t(`formula.functionType.${t.toLocaleLowerCase()}`),
|
|
1803
1897
|
value: `${i[t]}`
|
|
1804
1898
|
}));
|
|
1805
1899
|
}
|
|
1806
|
-
function
|
|
1900
|
+
function La(i, e) {
|
|
1807
1901
|
let t = "";
|
|
1808
1902
|
return i.aliasFunctionName ? (t = e.t(i.aliasFunctionName), t === i.aliasFunctionName && (t = i.functionName)) : t = i.functionName, t;
|
|
1809
1903
|
}
|
|
1810
|
-
var
|
|
1811
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1904
|
+
var Fa = Object.defineProperty, za = Object.getOwnPropertyDescriptor, Ua = (i, e, t, n) => {
|
|
1905
|
+
for (var r = n > 1 ? void 0 : n ? za(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
1812
1906
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1813
|
-
return n && r &&
|
|
1814
|
-
},
|
|
1815
|
-
const
|
|
1816
|
-
let
|
|
1907
|
+
return n && r && Fa(e, t, r), r;
|
|
1908
|
+
}, tn = (i, e) => (t, n) => e(t, n, i);
|
|
1909
|
+
const Ft = et("formula-ui.description-service");
|
|
1910
|
+
let kt = class {
|
|
1817
1911
|
constructor(i, e, t) {
|
|
1818
1912
|
this._description = i, this._functionService = e, this._localeService = t, this._initialize(), this._registerDescription();
|
|
1819
1913
|
}
|
|
@@ -1836,6 +1930,13 @@ let Bt = class {
|
|
|
1836
1930
|
r.indexOf(i) > -1 && e.push({ name: r, desc: a });
|
|
1837
1931
|
}), e;
|
|
1838
1932
|
}
|
|
1933
|
+
getSearchListByNameFirstLetter(i) {
|
|
1934
|
+
const e = [], t = this._functionService.getDescriptions();
|
|
1935
|
+
return i = i.toLocaleUpperCase(), t.forEach((n) => {
|
|
1936
|
+
const { functionName: r, abstract: a } = n;
|
|
1937
|
+
r.indexOf(i) === 0 && e.push({ name: r, desc: a });
|
|
1938
|
+
}), e;
|
|
1939
|
+
}
|
|
1839
1940
|
getSearchListByType(i) {
|
|
1840
1941
|
const e = [];
|
|
1841
1942
|
return this._functionService.getDescriptions().forEach((n) => {
|
|
@@ -1849,8 +1950,8 @@ let Bt = class {
|
|
|
1849
1950
|
});
|
|
1850
1951
|
}
|
|
1851
1952
|
_registerDescription() {
|
|
1852
|
-
const i = this._localeService, t =
|
|
1853
|
-
functionName:
|
|
1953
|
+
const i = this._localeService, t = xa.concat(this._description || []).map((n) => ({
|
|
1954
|
+
functionName: La(n, i),
|
|
1854
1955
|
functionType: n.functionType,
|
|
1855
1956
|
description: i.t(n.description),
|
|
1856
1957
|
abstract: i.t(n.abstract),
|
|
@@ -1865,43 +1966,43 @@ let Bt = class {
|
|
|
1865
1966
|
this._functionService.registerDescriptions(...t);
|
|
1866
1967
|
}
|
|
1867
1968
|
};
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
],
|
|
1872
|
-
const
|
|
1873
|
-
formulaSelectFunctionSelect:
|
|
1874
|
-
formulaSelectFunctionResult:
|
|
1875
|
-
formulaSelectFunctionResultItem:
|
|
1876
|
-
formulaSelectFunctionResultItemNameLight:
|
|
1877
|
-
formulaSelectFunctionResultItemSelected:
|
|
1878
|
-
formulaSelectFunctionResultItemActive:
|
|
1879
|
-
formulaSelectFunctionContent:
|
|
1969
|
+
kt = Ua([
|
|
1970
|
+
tn(1, ar),
|
|
1971
|
+
tn(2, y(De))
|
|
1972
|
+
], kt);
|
|
1973
|
+
const Va = "univer-formula-select-function-select", qa = "univer-formula-select-function-result", Ha = "univer-formula-select-function-result-item", $a = "univer-formula-select-function-result-item-name-light", ja = "univer-formula-select-function-result-item-selected", Wa = "univer-formula-select-function-result-item-active", Ga = "univer-formula-select-function-content", ne = {
|
|
1974
|
+
formulaSelectFunctionSelect: Va,
|
|
1975
|
+
formulaSelectFunctionResult: qa,
|
|
1976
|
+
formulaSelectFunctionResultItem: Ha,
|
|
1977
|
+
formulaSelectFunctionResultItemNameLight: $a,
|
|
1978
|
+
formulaSelectFunctionResultItemSelected: ja,
|
|
1979
|
+
formulaSelectFunctionResultItemActive: Wa,
|
|
1980
|
+
formulaSelectFunctionContent: Ga
|
|
1880
1981
|
};
|
|
1881
|
-
function
|
|
1882
|
-
const { onChange: e } = i, t = "-1", [n, r] =
|
|
1982
|
+
function Ka(i) {
|
|
1983
|
+
const { onChange: e } = i, t = "-1", [n, r] = N(""), [a, s] = N([]), [o, c] = N(0), [u, l] = N(t), [d, m] = N(0), [b, h] = N(null), g = z(Ft), f = z(De), R = wa(q, f);
|
|
1883
1984
|
R.unshift({
|
|
1884
1985
|
label: f.t("formula.moreFunctions.allFunctions"),
|
|
1885
1986
|
value: t
|
|
1886
1987
|
});
|
|
1887
|
-
const p = f.t("formula.prompt.required"),
|
|
1888
|
-
|
|
1988
|
+
const p = f.t("formula.prompt.required"), I = f.t("formula.prompt.optional");
|
|
1989
|
+
_e(() => {
|
|
1889
1990
|
v(t);
|
|
1890
|
-
}, []),
|
|
1991
|
+
}, []), _e(() => {
|
|
1891
1992
|
S(0);
|
|
1892
1993
|
}, [a]);
|
|
1893
1994
|
const C = (T) => {
|
|
1894
1995
|
if (n.trim() === "")
|
|
1895
1996
|
return T;
|
|
1896
1997
|
const D = new RegExp(`(${n.toLocaleUpperCase()})`);
|
|
1897
|
-
return T.split(D).filter(Boolean).map((U, ce) => U.match(D) ? /* @__PURE__ */ E.jsx("span", { className:
|
|
1998
|
+
return T.split(D).filter(Boolean).map((U, ce) => U.match(D) ? /* @__PURE__ */ E.jsx("span", { className: ne.formulaSelectFunctionResultItemNameLight, children: U }, ce) : U);
|
|
1898
1999
|
}, S = (T) => {
|
|
1899
2000
|
if (a.length === 0) {
|
|
1900
2001
|
h(null);
|
|
1901
2002
|
return;
|
|
1902
2003
|
}
|
|
1903
2004
|
m(T);
|
|
1904
|
-
const D =
|
|
2005
|
+
const D = g.getFunctionInfo(a[T].name);
|
|
1905
2006
|
if (!D) {
|
|
1906
2007
|
h(null);
|
|
1907
2008
|
return;
|
|
@@ -1910,12 +2011,12 @@ function ja(i) {
|
|
|
1910
2011
|
};
|
|
1911
2012
|
function v(T) {
|
|
1912
2013
|
l(T);
|
|
1913
|
-
const D =
|
|
2014
|
+
const D = g.getSearchListByType(+T);
|
|
1914
2015
|
s(D);
|
|
1915
2016
|
}
|
|
1916
|
-
function
|
|
2017
|
+
function B(T) {
|
|
1917
2018
|
r(T);
|
|
1918
|
-
const D =
|
|
2019
|
+
const D = g.getSearchListByName(T);
|
|
1919
2020
|
s(D);
|
|
1920
2021
|
}
|
|
1921
2022
|
function _(T) {
|
|
@@ -1928,47 +2029,47 @@ function ja(i) {
|
|
|
1928
2029
|
} else
|
|
1929
2030
|
T.key === "Enter" && S(o);
|
|
1930
2031
|
}
|
|
1931
|
-
const
|
|
2032
|
+
const A = (T) => {
|
|
1932
2033
|
c(T);
|
|
1933
|
-
},
|
|
2034
|
+
}, P = () => {
|
|
1934
2035
|
c(-1);
|
|
1935
2036
|
};
|
|
1936
2037
|
return /* @__PURE__ */ E.jsxs("div", { children: [
|
|
1937
|
-
/* @__PURE__ */ E.jsxs("div", { className:
|
|
1938
|
-
/* @__PURE__ */ E.jsx(
|
|
2038
|
+
/* @__PURE__ */ E.jsxs("div", { className: ne.formulaSelectFunctionSelect, children: [
|
|
2039
|
+
/* @__PURE__ */ E.jsx(Kr, { value: u, options: R, onChange: v }),
|
|
1939
2040
|
/* @__PURE__ */ E.jsx(
|
|
1940
|
-
|
|
2041
|
+
Yr,
|
|
1941
2042
|
{
|
|
1942
2043
|
placeholder: f.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1943
2044
|
onKeyDown: _,
|
|
1944
2045
|
value: n,
|
|
1945
|
-
onChange:
|
|
2046
|
+
onChange: B,
|
|
1946
2047
|
size: "large",
|
|
1947
2048
|
allowClear: !0
|
|
1948
2049
|
}
|
|
1949
2050
|
)
|
|
1950
2051
|
] }),
|
|
1951
|
-
/* @__PURE__ */ E.jsx("ul", { className:
|
|
2052
|
+
/* @__PURE__ */ E.jsx("ul", { className: ne.formulaSelectFunctionResult, onKeyDown: _, tabIndex: -1, children: a.map(({ name: T }, D) => /* @__PURE__ */ E.jsxs(
|
|
1952
2053
|
"li",
|
|
1953
2054
|
{
|
|
1954
|
-
className: o === D ? `${
|
|
1955
|
-
onMouseEnter: () =>
|
|
1956
|
-
onMouseLeave:
|
|
2055
|
+
className: o === D ? `${ne.formulaSelectFunctionResultItem} ${ne.formulaSelectFunctionResultItemActive}` : ne.formulaSelectFunctionResultItem,
|
|
2056
|
+
onMouseEnter: () => A(D),
|
|
2057
|
+
onMouseLeave: P,
|
|
1957
2058
|
onClick: () => S(D),
|
|
1958
2059
|
children: [
|
|
1959
|
-
d === D && /* @__PURE__ */ E.jsx(
|
|
1960
|
-
/* @__PURE__ */ E.jsx("span", { className:
|
|
2060
|
+
d === D && /* @__PURE__ */ E.jsx(Li, { className: ne.formulaSelectFunctionResultItemSelected }),
|
|
2061
|
+
/* @__PURE__ */ E.jsx("span", { className: ne.formulaSelectFunctionResultItemName, children: C(T) })
|
|
1961
2062
|
]
|
|
1962
2063
|
},
|
|
1963
2064
|
D
|
|
1964
2065
|
)) }),
|
|
1965
|
-
b && /* @__PURE__ */ E.jsxs("div", { className:
|
|
2066
|
+
b && /* @__PURE__ */ E.jsxs("div", { className: ne.formulaSelectFunctionContent, children: [
|
|
1966
2067
|
/* @__PURE__ */ E.jsx(ke, { title: b.functionName, value: b.description }),
|
|
1967
2068
|
/* @__PURE__ */ E.jsx(
|
|
1968
2069
|
ke,
|
|
1969
2070
|
{
|
|
1970
2071
|
title: f.t("formula.moreFunctions.syntax"),
|
|
1971
|
-
value: /* @__PURE__ */ E.jsx(
|
|
2072
|
+
value: /* @__PURE__ */ E.jsx($n, { prefix: b.functionName, value: b.functionParameter })
|
|
1972
2073
|
}
|
|
1973
2074
|
),
|
|
1974
2075
|
/* @__PURE__ */ E.jsx(
|
|
@@ -1982,41 +2083,41 @@ function ja(i) {
|
|
|
1982
2083
|
ke,
|
|
1983
2084
|
{
|
|
1984
2085
|
title: T.name,
|
|
1985
|
-
value: `${T.require ? p :
|
|
2086
|
+
value: `${T.require ? p : I} ${T.detail}`
|
|
1986
2087
|
},
|
|
1987
2088
|
D
|
|
1988
2089
|
))
|
|
1989
2090
|
] })
|
|
1990
2091
|
] });
|
|
1991
2092
|
}
|
|
1992
|
-
function
|
|
1993
|
-
const [i, e] =
|
|
1994
|
-
z(
|
|
1995
|
-
const u = z(
|
|
2093
|
+
function Ya() {
|
|
2094
|
+
const [i, e] = N(!0), [t, n] = N(!1), [r, a] = N([]), [s, o] = N(null), c = z(De);
|
|
2095
|
+
z(yn);
|
|
2096
|
+
const u = z(Ne);
|
|
1996
2097
|
function l() {
|
|
1997
2098
|
e(!i), n(!t);
|
|
1998
2099
|
}
|
|
1999
2100
|
function d() {
|
|
2000
2101
|
u.inputFormula(`=${s == null ? void 0 : s.functionName}(`);
|
|
2001
2102
|
}
|
|
2002
|
-
return /* @__PURE__ */ E.jsxs("div", { className:
|
|
2003
|
-
i && /* @__PURE__ */ E.jsx(
|
|
2004
|
-
t && /* @__PURE__ */ E.jsx(
|
|
2005
|
-
/* @__PURE__ */ E.jsxs("div", { className:
|
|
2006
|
-
t && /* @__PURE__ */ E.jsx(
|
|
2007
|
-
t && /* @__PURE__ */ E.jsx(
|
|
2008
|
-
i && /* @__PURE__ */ E.jsx(
|
|
2103
|
+
return /* @__PURE__ */ E.jsxs("div", { className: en.formulaMoreFunctions, children: [
|
|
2104
|
+
i && /* @__PURE__ */ E.jsx(Ka, { onChange: o }),
|
|
2105
|
+
t && /* @__PURE__ */ E.jsx(ga, { functionInfo: s, onChange: a }),
|
|
2106
|
+
/* @__PURE__ */ E.jsxs("div", { className: en.formulaMoreFunctionsOperation, children: [
|
|
2107
|
+
t && /* @__PURE__ */ E.jsx(mt, { type: "primary", size: "small", onClick: l, children: c.t("formula.moreFunctions.next") }),
|
|
2108
|
+
t && /* @__PURE__ */ E.jsx(mt, { size: "small", onClick: l, children: c.t("formula.moreFunctions.prev") }),
|
|
2109
|
+
i && /* @__PURE__ */ E.jsx(mt, { type: "primary", size: "small", onClick: d, children: c.t("formula.moreFunctions.confirm") })
|
|
2009
2110
|
] })
|
|
2010
2111
|
] });
|
|
2011
2112
|
}
|
|
2012
|
-
function
|
|
2113
|
+
function Xa(i) {
|
|
2013
2114
|
return {
|
|
2014
|
-
id:
|
|
2115
|
+
id: Lt.id,
|
|
2015
2116
|
icon: "FunctionSingle",
|
|
2016
2117
|
tooltip: "formula.insert.tooltip",
|
|
2017
|
-
group:
|
|
2018
|
-
type:
|
|
2019
|
-
positions: [
|
|
2118
|
+
group: Fr.TOOLBAR_FORMULAS_INSERT,
|
|
2119
|
+
type: Ot.SELECTOR,
|
|
2120
|
+
positions: [zr.TOOLBAR_START],
|
|
2020
2121
|
selections: [
|
|
2021
2122
|
{
|
|
2022
2123
|
label: "SUM",
|
|
@@ -2044,38 +2145,38 @@ function Ga(i) {
|
|
|
2044
2145
|
icon: "MinSingle"
|
|
2045
2146
|
}
|
|
2046
2147
|
],
|
|
2047
|
-
hidden$:
|
|
2148
|
+
hidden$: Ur(i, Jn.SHEET)
|
|
2048
2149
|
};
|
|
2049
2150
|
}
|
|
2050
|
-
function
|
|
2151
|
+
function Qa(i) {
|
|
2051
2152
|
return {
|
|
2052
|
-
id:
|
|
2153
|
+
id: wn.id,
|
|
2053
2154
|
title: "formula.insert.more",
|
|
2054
|
-
positions:
|
|
2055
|
-
type:
|
|
2155
|
+
positions: Lt.id,
|
|
2156
|
+
type: Ot.BUTTON
|
|
2056
2157
|
};
|
|
2057
2158
|
}
|
|
2058
|
-
function
|
|
2159
|
+
function Ja(i) {
|
|
2059
2160
|
return {
|
|
2060
|
-
id:
|
|
2061
|
-
type:
|
|
2161
|
+
id: Mn.id,
|
|
2162
|
+
type: Ot.BUTTON,
|
|
2062
2163
|
title: "formula.operation.pasteFormula",
|
|
2063
|
-
positions: [
|
|
2164
|
+
positions: [Nr]
|
|
2064
2165
|
};
|
|
2065
2166
|
}
|
|
2066
|
-
const
|
|
2167
|
+
const jn = "meta_key_ctrl_And_Shift", st = [
|
|
2067
2168
|
O.ARROW_DOWN,
|
|
2068
2169
|
O.ARROW_UP,
|
|
2069
2170
|
O.ARROW_LEFT,
|
|
2070
2171
|
O.ARROW_RIGHT
|
|
2071
|
-
],
|
|
2072
|
-
function
|
|
2172
|
+
], Za = [...st, O.ENTER, O.TAB];
|
|
2173
|
+
function es() {
|
|
2073
2174
|
const i = [];
|
|
2074
|
-
for (const e of
|
|
2175
|
+
for (const e of Za)
|
|
2075
2176
|
i.push({
|
|
2076
|
-
id:
|
|
2177
|
+
id: Pe.id,
|
|
2077
2178
|
binding: e,
|
|
2078
|
-
preconditions: (t) =>
|
|
2179
|
+
preconditions: (t) => ye(t),
|
|
2079
2180
|
staticParameters: {
|
|
2080
2181
|
eventType: ae.Keyboard,
|
|
2081
2182
|
keycode: e
|
|
@@ -2083,13 +2184,13 @@ function Qa() {
|
|
|
2083
2184
|
});
|
|
2084
2185
|
return i;
|
|
2085
2186
|
}
|
|
2086
|
-
function
|
|
2187
|
+
function ts() {
|
|
2087
2188
|
const i = [];
|
|
2088
|
-
for (const e of
|
|
2189
|
+
for (const e of st)
|
|
2089
2190
|
i.push({
|
|
2090
|
-
id:
|
|
2191
|
+
id: Pe.id,
|
|
2091
2192
|
binding: e | se.SHIFT,
|
|
2092
|
-
preconditions: (t) =>
|
|
2193
|
+
preconditions: (t) => ye(t),
|
|
2093
2194
|
staticParameters: {
|
|
2094
2195
|
eventType: ae.Keyboard,
|
|
2095
2196
|
keycode: e,
|
|
@@ -2098,13 +2199,13 @@ function Ja() {
|
|
|
2098
2199
|
});
|
|
2099
2200
|
return i;
|
|
2100
2201
|
}
|
|
2101
|
-
function
|
|
2202
|
+
function ns() {
|
|
2102
2203
|
const i = [];
|
|
2103
|
-
for (const e of
|
|
2204
|
+
for (const e of st)
|
|
2104
2205
|
i.push({
|
|
2105
|
-
id:
|
|
2206
|
+
id: Pe.id,
|
|
2106
2207
|
binding: e | se.CTRL_COMMAND,
|
|
2107
|
-
preconditions: (t) =>
|
|
2208
|
+
preconditions: (t) => ye(t),
|
|
2108
2209
|
staticParameters: {
|
|
2109
2210
|
eventType: ae.Keyboard,
|
|
2110
2211
|
keycode: e,
|
|
@@ -2113,32 +2214,32 @@ function Za() {
|
|
|
2113
2214
|
});
|
|
2114
2215
|
return i;
|
|
2115
2216
|
}
|
|
2116
|
-
function
|
|
2217
|
+
function rs() {
|
|
2117
2218
|
const i = [];
|
|
2118
|
-
for (const e of
|
|
2219
|
+
for (const e of st)
|
|
2119
2220
|
i.push({
|
|
2120
|
-
id:
|
|
2221
|
+
id: Pe.id,
|
|
2121
2222
|
binding: e | se.SHIFT | se.CTRL_COMMAND,
|
|
2122
|
-
preconditions: (t) =>
|
|
2223
|
+
preconditions: (t) => ye(t),
|
|
2123
2224
|
staticParameters: {
|
|
2124
2225
|
eventType: ae.Keyboard,
|
|
2125
2226
|
keycode: e,
|
|
2126
|
-
metaKey:
|
|
2227
|
+
metaKey: jn
|
|
2127
2228
|
}
|
|
2128
2229
|
});
|
|
2129
2230
|
return i;
|
|
2130
2231
|
}
|
|
2131
|
-
const
|
|
2132
|
-
id:
|
|
2232
|
+
const is = {
|
|
2233
|
+
id: wt.id,
|
|
2133
2234
|
binding: O.F4,
|
|
2134
|
-
preconditions: (i) =>
|
|
2235
|
+
preconditions: (i) => ye(i)
|
|
2135
2236
|
};
|
|
2136
|
-
var
|
|
2137
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2237
|
+
var as = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, os = (i, e, t, n) => {
|
|
2238
|
+
for (var r = n > 1 ? void 0 : n ? ss(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
2138
2239
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
2139
|
-
return n && r &&
|
|
2140
|
-
},
|
|
2141
|
-
let
|
|
2240
|
+
return n && r && as(e, t, r), r;
|
|
2241
|
+
}, he = (i, e) => (t, n) => e(t, n, i);
|
|
2242
|
+
let Ye = class extends $ {
|
|
2142
2243
|
constructor(i, e, t, n, r, a) {
|
|
2143
2244
|
super(), this._injector = i, this._menuService = e, this._commandService = t, this._shortcutService = n, this._uiController = r, this._componentManager = a, this._initialize();
|
|
2144
2245
|
}
|
|
@@ -2146,7 +2247,7 @@ let Xe = class extends H {
|
|
|
2146
2247
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents();
|
|
2147
2248
|
}
|
|
2148
2249
|
_registerMenus() {
|
|
2149
|
-
[
|
|
2250
|
+
[Xa, Qa, Ja].forEach(
|
|
2150
2251
|
(i) => {
|
|
2151
2252
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(i)));
|
|
2152
2253
|
}
|
|
@@ -2154,23 +2255,23 @@ let Xe = class extends H {
|
|
|
2154
2255
|
}
|
|
2155
2256
|
_registerCommands() {
|
|
2156
2257
|
[
|
|
2258
|
+
On,
|
|
2157
2259
|
Mn,
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
Ot
|
|
2260
|
+
Lt,
|
|
2261
|
+
wn,
|
|
2262
|
+
Ct,
|
|
2263
|
+
Bt,
|
|
2264
|
+
Pe,
|
|
2265
|
+
wt
|
|
2165
2266
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2166
2267
|
}
|
|
2167
2268
|
_registerShortcuts() {
|
|
2168
2269
|
[
|
|
2169
|
-
...Qa(),
|
|
2170
|
-
...Ja(),
|
|
2171
|
-
...Za(),
|
|
2172
2270
|
...es(),
|
|
2173
|
-
ts
|
|
2271
|
+
...ts(),
|
|
2272
|
+
...ns(),
|
|
2273
|
+
...rs(),
|
|
2274
|
+
is
|
|
2174
2275
|
].forEach((i) => {
|
|
2175
2276
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2176
2277
|
});
|
|
@@ -2178,23 +2279,23 @@ let Xe = class extends H {
|
|
|
2178
2279
|
_registerComponents() {
|
|
2179
2280
|
this.disposeWithMe(
|
|
2180
2281
|
this._uiController.registerContentComponent(
|
|
2181
|
-
() =>
|
|
2282
|
+
() => jr(ma, this._injector)
|
|
2182
2283
|
)
|
|
2183
|
-
), this._componentManager.register(
|
|
2284
|
+
), this._componentManager.register(xn, Ya);
|
|
2184
2285
|
}
|
|
2185
2286
|
};
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
],
|
|
2195
|
-
const
|
|
2196
|
-
function
|
|
2197
|
-
const n = i.getCurrentTheme(), r = new
|
|
2287
|
+
Ye = os([
|
|
2288
|
+
X(Q.Ready, Ye),
|
|
2289
|
+
he(0, y(tt)),
|
|
2290
|
+
he(1, qr),
|
|
2291
|
+
he(2, J),
|
|
2292
|
+
he(3, Hr),
|
|
2293
|
+
he(4, $r),
|
|
2294
|
+
he(5, y(Vr))
|
|
2295
|
+
], Ye);
|
|
2296
|
+
const nn = "formula_reference_selection_plugin_name";
|
|
2297
|
+
function pt(i, e, t) {
|
|
2298
|
+
const n = i.getCurrentTheme(), r = new sn(e).setAlpha(0.05).toRgbString();
|
|
2198
2299
|
return {
|
|
2199
2300
|
id: t,
|
|
2200
2301
|
strokeWidth: 1.5,
|
|
@@ -2210,13 +2311,13 @@ function bt(i, e, t) {
|
|
|
2210
2311
|
hasColumnHeader: !1
|
|
2211
2312
|
};
|
|
2212
2313
|
}
|
|
2213
|
-
var
|
|
2214
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2314
|
+
var cs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, ms = (i, e, t, n) => {
|
|
2315
|
+
for (var r = n > 1 ? void 0 : n ? us(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
2215
2316
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
2216
|
-
return n && r &&
|
|
2217
|
-
},
|
|
2218
|
-
let
|
|
2219
|
-
constructor(e, t, n, r, a, s, o, c, u, l, d, m, b, h,
|
|
2317
|
+
return n && r && cs(e, t, r), r;
|
|
2318
|
+
}, F = (i, e) => (t, n) => e(t, n, i);
|
|
2319
|
+
let Xe = class extends $ {
|
|
2320
|
+
constructor(e, t, n, r, a, s, o, c, u, l, d, m, b, h, g, f) {
|
|
2220
2321
|
super();
|
|
2221
2322
|
k(this, "_formulaRefColors", []);
|
|
2222
2323
|
k(this, "_previousSequenceNodes");
|
|
@@ -2231,7 +2332,7 @@ let Ke = class extends H {
|
|
|
2231
2332
|
k(this, "_numberColor", "");
|
|
2232
2333
|
k(this, "_insertSelections", []);
|
|
2233
2334
|
k(this, "_inputPanelState", 0);
|
|
2234
|
-
this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = r, this._formulaPromptService = a, this._lexerTreeBuilder = s, this._renderManagerService = o, this._themeService = c, this._selectionManagerService = u, this._sheetSkeletonManagerService = l, this._currentUniverService = d, this._selectionRenderService = m, this._descriptionService = b, this._textSelectionManagerService = h, this._formulaInputService =
|
|
2335
|
+
this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = r, this._formulaPromptService = a, this._lexerTreeBuilder = s, this._renderManagerService = o, this._themeService = c, this._selectionManagerService = u, this._sheetSkeletonManagerService = l, this._currentUniverService = d, this._selectionRenderService = m, this._descriptionService = b, this._textSelectionManagerService = h, this._formulaInputService = g, this._docViewModelManagerService = f, this._initialize();
|
|
2235
2336
|
}
|
|
2236
2337
|
dispose() {
|
|
2237
2338
|
this._formulaRefColors = [], this._resetTemp();
|
|
@@ -2263,7 +2364,7 @@ let Ke = class extends H {
|
|
|
2263
2364
|
this.disposeWithMe(
|
|
2264
2365
|
w(
|
|
2265
2366
|
this._textSelectionManagerService.textSelection$.subscribe((e) => {
|
|
2266
|
-
if (this._editorBridgeService.isVisible().visible === !1 || this._formulaInputService.isSelectionMoving() || (e == null ? void 0 : e.unitId) == null || ![
|
|
2367
|
+
if (this._editorBridgeService.isVisible().visible === !1 || this._formulaInputService.isSelectionMoving() || (e == null ? void 0 : e.unitId) == null || ![ot, ct].includes(e.unitId))
|
|
2267
2368
|
return;
|
|
2268
2369
|
const n = this._getCurrentBody(), r = (n == null ? void 0 : n.dataStream) || "";
|
|
2269
2370
|
this._contextSwitch(r), this._changeKeepVisibleHideState(), this._switchSelectionPlugin(), !this._formulaInputService.isLockedSelectionChange() && (this._highlightFormula(), this._changeFunctionPanelState());
|
|
@@ -2294,24 +2395,24 @@ let Ke = class extends H {
|
|
|
2294
2395
|
return;
|
|
2295
2396
|
}
|
|
2296
2397
|
const t = this._selectionManagerService.getCurrent();
|
|
2297
|
-
if ((t == null ? void 0 : t.pluginName) ===
|
|
2398
|
+
if ((t == null ? void 0 : t.pluginName) === Ce) {
|
|
2298
2399
|
this._disableForceKeepVisible();
|
|
2299
2400
|
return;
|
|
2300
2401
|
}
|
|
2301
|
-
this._selectionManagerService.clear(), this._selectionManagerService.changePlugin(
|
|
2302
|
-
`, []), this._contextService.setContextValue(
|
|
2402
|
+
this._selectionManagerService.clear(), this._selectionManagerService.changePlugin(Ce), this._updateEditorModel(`\r
|
|
2403
|
+
`, []), this._contextService.setContextValue(xe, !1), this._disableForceKeepVisible(), this._selectionRenderService.resetStyle(), this._resetTemp(), this._hideFunctionPanel();
|
|
2303
2404
|
})
|
|
2304
2405
|
)
|
|
2305
2406
|
);
|
|
2306
2407
|
}
|
|
2307
2408
|
_initialRefSelectionUpdateEvent() {
|
|
2308
|
-
const e = new
|
|
2409
|
+
const e = new Zn();
|
|
2309
2410
|
this.disposeWithMe(
|
|
2310
2411
|
w(
|
|
2311
2412
|
this._selectionManagerService.selectionMoveEnd$.subscribe(() => {
|
|
2312
2413
|
e.dispose();
|
|
2313
2414
|
const t = this._selectionManagerService.getCurrent();
|
|
2314
|
-
if (this._formulaInputService.disableSelectionMoving(), (t == null ? void 0 : t.pluginName) !==
|
|
2415
|
+
if (this._formulaInputService.disableSelectionMoving(), (t == null ? void 0 : t.pluginName) !== nn)
|
|
2315
2416
|
return;
|
|
2316
2417
|
this._updateRefSelectionStyle(this._isSelectionMovingRefSelections), this._selectionRenderService.getCurrentControls().forEach((r) => {
|
|
2317
2418
|
r.disableHelperSelection(), e.add(
|
|
@@ -2366,7 +2467,7 @@ let Ke = class extends H {
|
|
|
2366
2467
|
this._selectionRenderService.selectionMoving$.subscribe((e) => {
|
|
2367
2468
|
this._selectionChanging(
|
|
2368
2469
|
e.map(
|
|
2369
|
-
(t) =>
|
|
2470
|
+
(t) => ut(t)
|
|
2370
2471
|
)
|
|
2371
2472
|
);
|
|
2372
2473
|
})
|
|
@@ -2376,7 +2477,7 @@ let Ke = class extends H {
|
|
|
2376
2477
|
this._selectionRenderService.selectionMoveStart$.subscribe((e) => {
|
|
2377
2478
|
this._selectionChanging(
|
|
2378
2479
|
e.map(
|
|
2379
|
-
(t) =>
|
|
2480
|
+
(t) => ut(t)
|
|
2380
2481
|
),
|
|
2381
2482
|
!0
|
|
2382
2483
|
);
|
|
@@ -2399,7 +2500,7 @@ let Ke = class extends H {
|
|
|
2399
2500
|
return;
|
|
2400
2501
|
}
|
|
2401
2502
|
const o = e.length - s.token.length, c = { ...s };
|
|
2402
|
-
c.token = e, c.endIndex += o, r[a] = c, r.splice(a + 1, 0,
|
|
2503
|
+
c.token = e, c.endIndex += o, r[a] = c, r.splice(a + 1, 0, W.OPEN_BRACKET);
|
|
2403
2504
|
const u = e.length + 1;
|
|
2404
2505
|
for (let l = a + 2, d = r.length; l < d; l++) {
|
|
2405
2506
|
const m = r[l];
|
|
@@ -2424,13 +2525,13 @@ let Ke = class extends H {
|
|
|
2424
2525
|
this._hideFunctionPanel();
|
|
2425
2526
|
return;
|
|
2426
2527
|
}
|
|
2427
|
-
if (typeof n != "string" && n.nodeType ===
|
|
2528
|
+
if (typeof n != "string" && n.nodeType === G.FUNCTION) {
|
|
2428
2529
|
const u = n.token.toUpperCase();
|
|
2429
2530
|
if (this._inputPanelState === 1) {
|
|
2430
|
-
const l = this._descriptionService.
|
|
2531
|
+
const l = this._descriptionService.getSearchListByNameFirstLetter(u);
|
|
2431
2532
|
if (this._hideFunctionPanel(), l == null || l.length === 0)
|
|
2432
2533
|
return;
|
|
2433
|
-
this._commandService.executeCommand(
|
|
2534
|
+
this._commandService.executeCommand(Ct.id, {
|
|
2434
2535
|
visible: !0,
|
|
2435
2536
|
searchText: u,
|
|
2436
2537
|
searchList: l
|
|
@@ -2449,17 +2550,17 @@ let Ke = class extends H {
|
|
|
2449
2550
|
}
|
|
2450
2551
|
_changeHelpFunctionPanelState(e, t) {
|
|
2451
2552
|
const n = this._descriptionService.getFunctionInfo(e);
|
|
2452
|
-
this._hideFunctionPanel(), n != null && this._commandService.executeCommand(
|
|
2553
|
+
this._hideFunctionPanel(), n != null && this._commandService.executeCommand(Bt.id, {
|
|
2453
2554
|
visible: !0,
|
|
2454
2555
|
paramIndex: t,
|
|
2455
2556
|
functionInfo: n
|
|
2456
2557
|
});
|
|
2457
2558
|
}
|
|
2458
2559
|
_hideFunctionPanel() {
|
|
2459
|
-
this._commandService.executeCommand(
|
|
2560
|
+
this._commandService.executeCommand(Ct.id, {
|
|
2460
2561
|
visible: !1,
|
|
2461
2562
|
searchText: ""
|
|
2462
|
-
}), this._commandService.executeCommand(
|
|
2563
|
+
}), this._commandService.executeCommand(Bt.id, {
|
|
2463
2564
|
visible: !1,
|
|
2464
2565
|
paramIndex: -1
|
|
2465
2566
|
});
|
|
@@ -2487,7 +2588,7 @@ let Ke = class extends H {
|
|
|
2487
2588
|
* @returns
|
|
2488
2589
|
*/
|
|
2489
2590
|
_matchRefDrawToken(e) {
|
|
2490
|
-
return
|
|
2591
|
+
return sr(e) && e !== W.CLOSE_BRACES && e !== W.CLOSE_BRACKET && e !== W.SINGLE_QUOTATION && e !== W.DOUBLE_QUOTATION || e === " ";
|
|
2491
2592
|
}
|
|
2492
2593
|
/**
|
|
2493
2594
|
*
|
|
@@ -2516,7 +2617,7 @@ let Ke = class extends H {
|
|
|
2516
2617
|
return (n = t == null ? void 0 : t.snapshot) == null ? void 0 : n.body;
|
|
2517
2618
|
}
|
|
2518
2619
|
_getFormulaAndCellEditorBody() {
|
|
2519
|
-
return [
|
|
2620
|
+
return [ot, ct].map((t) => {
|
|
2520
2621
|
const n = this._currentUniverService.getUniverDocInstance(t);
|
|
2521
2622
|
return n == null ? void 0 : n.getBody();
|
|
2522
2623
|
});
|
|
@@ -2529,8 +2630,8 @@ let Ke = class extends H {
|
|
|
2529
2630
|
* @returns
|
|
2530
2631
|
*/
|
|
2531
2632
|
_contextSwitch(e) {
|
|
2532
|
-
if (
|
|
2533
|
-
this._contextService.setContextValue(
|
|
2633
|
+
if (Re(e)) {
|
|
2634
|
+
this._contextService.setContextValue(xe, !0);
|
|
2534
2635
|
const t = this._lexerTreeBuilder.sequenceNodesBuilder(e.replace(/\r/g, "").replace(/\n/g, "")) || [];
|
|
2535
2636
|
this._formulaInputService.setSequenceNodes(t);
|
|
2536
2637
|
const n = this._textSelectionManagerService.getActiveRange();
|
|
@@ -2539,21 +2640,21 @@ let Ke = class extends H {
|
|
|
2539
2640
|
const { startOffset: r } = n;
|
|
2540
2641
|
this._currentInsertRefStringIndex = r - 1;
|
|
2541
2642
|
} else
|
|
2542
|
-
this._contextService.setContextValue(
|
|
2643
|
+
this._contextService.setContextValue(xe, !1), this._formulaInputService.disableLockedSelectionChange(), this._formulaInputService.disableLockedSelectionInsert(), this._formulaInputService.clearSequenceNodes(), this._hideFunctionPanel();
|
|
2543
2644
|
}
|
|
2544
2645
|
_getContextState() {
|
|
2545
|
-
return this._contextService.getContextValue(
|
|
2646
|
+
return this._contextService.getContextValue(xe);
|
|
2546
2647
|
}
|
|
2547
2648
|
/**
|
|
2548
2649
|
* Switch from formula selection state to regular selection state.
|
|
2549
2650
|
*/
|
|
2550
2651
|
_switchSelectionPlugin() {
|
|
2551
2652
|
if (this._getContextState() === !0) {
|
|
2552
|
-
this._selectionManagerService.changePluginNoRefresh(
|
|
2553
|
-
const e =
|
|
2653
|
+
this._selectionManagerService.changePluginNoRefresh(nn);
|
|
2654
|
+
const e = br(this._themeService);
|
|
2554
2655
|
e.strokeDash = 8, e.hasAutoFill = !1, e.hasRowHeader = !1, e.hasColumnHeader = !1, this._selectionRenderService.setStyle(e);
|
|
2555
2656
|
} else
|
|
2556
|
-
this._selectionManagerService.changePluginNoRefresh(
|
|
2657
|
+
this._selectionManagerService.changePluginNoRefresh(Ce), this._selectionRenderService.resetStyle();
|
|
2557
2658
|
}
|
|
2558
2659
|
/**
|
|
2559
2660
|
* Highlight cell editor and formula bar editor.
|
|
@@ -2585,7 +2686,7 @@ let Ke = class extends H {
|
|
|
2585
2686
|
continue;
|
|
2586
2687
|
const { startIndex: c, endIndex: u, nodeType: l, token: d } = o;
|
|
2587
2688
|
let m = "";
|
|
2588
|
-
if (l ===
|
|
2689
|
+
if (l === G.REFERENCE) {
|
|
2589
2690
|
const b = r % this._formulaRefColors.length;
|
|
2590
2691
|
m = this._formulaRefColors[b], n.push({
|
|
2591
2692
|
refIndex: a,
|
|
@@ -2593,7 +2694,7 @@ let Ke = class extends H {
|
|
|
2593
2694
|
token: d
|
|
2594
2695
|
}), r++;
|
|
2595
2696
|
} else
|
|
2596
|
-
l ===
|
|
2697
|
+
l === G.NUMBER ? m = this._numberColor : l === G.STRING ? m = this._stringColor : l === G.ARRAY && (m = this._stringColor);
|
|
2597
2698
|
m && m.length > 0 && t.push({
|
|
2598
2699
|
st: c + 1,
|
|
2599
2700
|
ed: u + 2,
|
|
@@ -2618,36 +2719,36 @@ let Ke = class extends H {
|
|
|
2618
2719
|
return;
|
|
2619
2720
|
let o = null;
|
|
2620
2721
|
for (let u = 0, l = e.length; u < l; u++) {
|
|
2621
|
-
const d = e[u], { themeColor: m, token: b, refIndex: h } = d,
|
|
2722
|
+
const d = e[u], { themeColor: m, token: b, refIndex: h } = d, g = ge(b), { unitId: f, sheetName: R, range: p } = g;
|
|
2622
2723
|
if (f != null && f.length > 0 && t !== f)
|
|
2623
2724
|
continue;
|
|
2624
|
-
const
|
|
2625
|
-
if (R.length !== 0 &&
|
|
2725
|
+
const I = this._getSheetIdByName(t, R.trim());
|
|
2726
|
+
if (R.length !== 0 && I !== n)
|
|
2626
2727
|
continue;
|
|
2627
2728
|
const C = (c = this._insertSelections.find((S) => {
|
|
2628
|
-
const { startRow: v, startColumn:
|
|
2629
|
-
return v === p.startRow &&
|
|
2729
|
+
const { startRow: v, startColumn: B, endRow: _, endColumn: A } = S.range;
|
|
2730
|
+
return v === p.startRow && B === p.startColumn && _ === p.endRow && A === p.endColumn || v === p.startRow && B === p.startColumn && p.startRow === p.endRow && p.startColumn === p.endColumn;
|
|
2630
2731
|
})) == null ? void 0 : c.primary;
|
|
2631
2732
|
if (C != null) {
|
|
2632
2733
|
const {
|
|
2633
2734
|
isMerged: S,
|
|
2634
2735
|
isMergedMainCell: v,
|
|
2635
|
-
startRow:
|
|
2736
|
+
startRow: B,
|
|
2636
2737
|
endRow: _,
|
|
2637
|
-
startColumn:
|
|
2638
|
-
endColumn:
|
|
2738
|
+
startColumn: A,
|
|
2739
|
+
endColumn: P
|
|
2639
2740
|
} = C;
|
|
2640
|
-
(S || v) &&
|
|
2741
|
+
(S || v) && B === p.startRow && A === p.startColumn && p.startRow === p.endRow && p.startColumn === p.endColumn && (p.endRow = _, p.endColumn = P), o = {
|
|
2641
2742
|
range: p,
|
|
2642
2743
|
primary: C,
|
|
2643
|
-
style:
|
|
2744
|
+
style: pt(this._themeService, m, h.toString())
|
|
2644
2745
|
};
|
|
2645
2746
|
continue;
|
|
2646
2747
|
}
|
|
2647
2748
|
r.push({
|
|
2648
2749
|
range: p,
|
|
2649
2750
|
primary: C,
|
|
2650
|
-
style:
|
|
2751
|
+
style: pt(this._themeService, m, h.toString())
|
|
2651
2752
|
});
|
|
2652
2753
|
}
|
|
2653
2754
|
o && r.push(o), r.length !== 0 && this._selectionManagerService.add(r);
|
|
@@ -2655,13 +2756,13 @@ let Ke = class extends H {
|
|
|
2655
2756
|
_getSheetIdByName(e, t) {
|
|
2656
2757
|
var r;
|
|
2657
2758
|
const n = this._currentUniverService.getUniverSheetInstance(e);
|
|
2658
|
-
return (r = n == null ? void 0 : n.getSheetBySheetName(
|
|
2759
|
+
return (r = n == null ? void 0 : n.getSheetBySheetName(or(t))) == null ? void 0 : r.getSheetId();
|
|
2659
2760
|
}
|
|
2660
2761
|
_getSheetNameById(e, t) {
|
|
2661
2762
|
var a;
|
|
2662
2763
|
const n = this._currentUniverService.getUniverSheetInstance(e);
|
|
2663
2764
|
let r = ((a = n == null ? void 0 : n.getSheetBySheetId(t)) == null ? void 0 : a.getName()) || "";
|
|
2664
|
-
return r.length > 0 &&
|
|
2765
|
+
return r.length > 0 && cr(r) && (r = `'${r}'`), r;
|
|
2665
2766
|
}
|
|
2666
2767
|
_getCurrentUnitIdAndSheetId() {
|
|
2667
2768
|
const e = this._sheetSkeletonManagerService.getCurrent();
|
|
@@ -2695,13 +2796,13 @@ let Ke = class extends H {
|
|
|
2695
2796
|
isMerged: m,
|
|
2696
2797
|
isMergedMainCell: b,
|
|
2697
2798
|
startRow: h,
|
|
2698
|
-
endRow:
|
|
2799
|
+
endRow: g,
|
|
2699
2800
|
startColumn: f,
|
|
2700
2801
|
endColumn: R
|
|
2701
2802
|
} = o;
|
|
2702
|
-
(m || b) && h === c && f === l &&
|
|
2803
|
+
(m || b) && h === c && f === l && g === u && R === d && (c = h, l = f, u = h, d = f);
|
|
2703
2804
|
}
|
|
2704
|
-
return
|
|
2805
|
+
return qe({
|
|
2705
2806
|
sheetName: a,
|
|
2706
2807
|
unitId: r,
|
|
2707
2808
|
range: {
|
|
@@ -2719,13 +2820,13 @@ let Ke = class extends H {
|
|
|
2719
2820
|
* @returns
|
|
2720
2821
|
*/
|
|
2721
2822
|
async _syncToEditor(e, t, n = !0) {
|
|
2722
|
-
const r =
|
|
2823
|
+
const r = un(e), { textRuns: a, refSelections: s } = this._buildTextRuns(e);
|
|
2723
2824
|
this._isSelectionMovingRefSelections = s;
|
|
2724
2825
|
const o = this._textSelectionManagerService.getActiveRange();
|
|
2725
2826
|
if (o == null)
|
|
2726
2827
|
return;
|
|
2727
2828
|
const { collapsed: c, style: u } = o;
|
|
2728
|
-
this._currentInsertRefStringIndex = t, await this._fitEditorSize(), n ? this._commandService.executeCommand(
|
|
2829
|
+
this._currentInsertRefStringIndex = t, await this._fitEditorSize(), n ? this._commandService.executeCommand(xr.id, {
|
|
2729
2830
|
unitId: this._editorBridgeService.getCurrentEditorId(),
|
|
2730
2831
|
body: {
|
|
2731
2832
|
dataStream: `=${r}`,
|
|
@@ -2747,11 +2848,13 @@ let Ke = class extends H {
|
|
|
2747
2848
|
endOffset: t + 1,
|
|
2748
2849
|
style: u
|
|
2749
2850
|
}
|
|
2750
|
-
]))
|
|
2851
|
+
])), setTimeout(() => {
|
|
2852
|
+
this._textSelectionRenderManager.focus();
|
|
2853
|
+
}, 0);
|
|
2751
2854
|
}
|
|
2752
2855
|
async _fitEditorSize() {
|
|
2753
2856
|
const e = this._editorBridgeService.getCurrentEditorId();
|
|
2754
|
-
e != null && await this._commandService.syncExecuteCommand(
|
|
2857
|
+
e != null && await this._commandService.syncExecuteCommand(Mr.id, {
|
|
2755
2858
|
unitId: e
|
|
2756
2859
|
});
|
|
2757
2860
|
}
|
|
@@ -2779,14 +2882,14 @@ let Ke = class extends H {
|
|
|
2779
2882
|
}
|
|
2780
2883
|
_inertControlSelectionReplace(e) {
|
|
2781
2884
|
this._previousSequenceNodes == null && (this._previousSequenceNodes = this._formulaInputService.getSequenceNodes()), this._previousInsertRefStringIndex == null && (this._previousInsertRefStringIndex = this._currentInsertRefStringIndex);
|
|
2782
|
-
const t =
|
|
2885
|
+
const t = K.deepClone(this._previousSequenceNodes);
|
|
2783
2886
|
if (t == null)
|
|
2784
2887
|
return;
|
|
2785
2888
|
const n = this._getRefString(e);
|
|
2786
2889
|
this._formulaInputService.setSequenceNodes(t), this._formulaInputService.insertSequenceRef(this._previousInsertRefStringIndex, n), this._syncToEditor(t, this._previousInsertRefStringIndex + n.length);
|
|
2787
2890
|
const r = this._selectionRenderService.getSelectionDataWithStyle();
|
|
2788
2891
|
this._insertSelections = [], r.forEach((a) => {
|
|
2789
|
-
const s =
|
|
2892
|
+
const s = ut(a);
|
|
2790
2893
|
this._insertSelections.push(s);
|
|
2791
2894
|
});
|
|
2792
2895
|
}
|
|
@@ -2801,7 +2904,7 @@ let Ke = class extends H {
|
|
|
2801
2904
|
const r = this._getCurrentChar();
|
|
2802
2905
|
if (r == null)
|
|
2803
2906
|
return;
|
|
2804
|
-
this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, this._matchRefDrawToken(r) || (this._formulaInputService.insertSequenceString(this._currentInsertRefStringIndex,
|
|
2907
|
+
this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, this._matchRefDrawToken(r) || (this._formulaInputService.insertSequenceString(this._currentInsertRefStringIndex, W.COMMA), n = this._formulaInputService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = K.deepClone(n);
|
|
2805
2908
|
const a = this._getRefString(t);
|
|
2806
2909
|
this._formulaInputService.setSequenceNodes(n), this._formulaInputService.insertSequenceRef(this._previousInsertRefStringIndex, a), this._selectionRenderService.disableSkipRemainLast();
|
|
2807
2910
|
}
|
|
@@ -2810,19 +2913,19 @@ let Ke = class extends H {
|
|
|
2810
2913
|
_updateRefSelectionStyle(e) {
|
|
2811
2914
|
const t = this._selectionRenderService.getCurrentControls(), { unitId: n, sheetId: r } = this._getCurrentUnitIdAndSheetId();
|
|
2812
2915
|
for (let a = 0, s = e.length; a < s; a++) {
|
|
2813
|
-
const o = e[a], { refIndex: c, themeColor: u, token: l } = o, d =
|
|
2916
|
+
const o = e[a], { refIndex: c, themeColor: u, token: l } = o, d = ge(l), { unitId: m, sheetName: b, range: h } = d;
|
|
2814
2917
|
if (m != null && m.length > 0 && n !== m)
|
|
2815
2918
|
continue;
|
|
2816
|
-
const
|
|
2817
|
-
if (
|
|
2919
|
+
const g = this._getSheetIdByName(n, b.trim());
|
|
2920
|
+
if (g != null && g !== r)
|
|
2818
2921
|
continue;
|
|
2819
2922
|
const f = t.find((p) => {
|
|
2820
|
-
const { startRow:
|
|
2821
|
-
return
|
|
2923
|
+
const { startRow: I, startColumn: C, endRow: S, endColumn: v } = p.getRange();
|
|
2924
|
+
return I === h.startRow && C === h.startColumn && S === h.endRow && v === h.endColumn || I === h.startRow && C === h.startColumn && h.startRow === h.endRow && h.startColumn === h.endColumn;
|
|
2822
2925
|
});
|
|
2823
2926
|
if (f == null)
|
|
2824
2927
|
continue;
|
|
2825
|
-
const R =
|
|
2928
|
+
const R = pt(this._themeService, u, c.toString());
|
|
2826
2929
|
f.updateStyle(R);
|
|
2827
2930
|
}
|
|
2828
2931
|
}
|
|
@@ -2833,20 +2936,20 @@ let Ke = class extends H {
|
|
|
2833
2936
|
const { unitId: n, sheetId: r, skeleton: a } = this._getCurrentUnitIdAndSheetId();
|
|
2834
2937
|
this._formulaInputService.enableLockedSelectionChange();
|
|
2835
2938
|
const s = (f = t.selectionStyle) == null ? void 0 : f.id;
|
|
2836
|
-
if (s == null || !
|
|
2939
|
+
if (s == null || !K.isStringNumber(s))
|
|
2837
2940
|
return;
|
|
2838
2941
|
let { startRow: o, endRow: c, startColumn: u, endColumn: l } = e;
|
|
2839
|
-
const d =
|
|
2942
|
+
const d = Or(o, u, a == null ? void 0 : a.mergeData);
|
|
2840
2943
|
if (d) {
|
|
2841
2944
|
const {
|
|
2842
2945
|
isMerged: R,
|
|
2843
2946
|
isMergedMainCell: p,
|
|
2844
|
-
startRow:
|
|
2947
|
+
startRow: I,
|
|
2845
2948
|
endRow: C,
|
|
2846
2949
|
startColumn: S,
|
|
2847
2950
|
endColumn: v
|
|
2848
2951
|
} = d;
|
|
2849
|
-
(R || p) &&
|
|
2952
|
+
(R || p) && I === o && S === u && C === c && v === l && (o = I, u = S, c = I, l = S);
|
|
2850
2953
|
}
|
|
2851
2954
|
const m = this._getRefString({
|
|
2852
2955
|
range: {
|
|
@@ -2859,14 +2962,20 @@ let Ke = class extends H {
|
|
|
2859
2962
|
style: null
|
|
2860
2963
|
}), b = Number(s);
|
|
2861
2964
|
this._formulaInputService.updateSequenceRef(b, m);
|
|
2862
|
-
const h = this._formulaInputService.getSequenceNodes(),
|
|
2863
|
-
typeof
|
|
2965
|
+
const h = this._formulaInputService.getSequenceNodes(), g = h[b];
|
|
2966
|
+
typeof g != "string" && (this._syncToEditor(h, g.endIndex + 1), t.update(
|
|
2967
|
+
e,
|
|
2968
|
+
void 0,
|
|
2969
|
+
void 0,
|
|
2970
|
+
void 0,
|
|
2971
|
+
this._selectionRenderService.convertCellRangeToInfo(d)
|
|
2972
|
+
));
|
|
2864
2973
|
}
|
|
2865
2974
|
_refreshFormulaAndCellEditor() {
|
|
2866
2975
|
var t;
|
|
2867
|
-
const e = [
|
|
2976
|
+
const e = [ot, ct];
|
|
2868
2977
|
for (const n of e) {
|
|
2869
|
-
const r =
|
|
2978
|
+
const r = St(n, this._renderManagerService), a = r == null ? void 0 : r.document;
|
|
2870
2979
|
a != null && ((t = a.getSkeleton()) == null || t.calculate(), a.makeDirty());
|
|
2871
2980
|
}
|
|
2872
2981
|
}
|
|
@@ -2884,7 +2993,7 @@ let Ke = class extends H {
|
|
|
2884
2993
|
);
|
|
2885
2994
|
}
|
|
2886
2995
|
_commandExecutedListener() {
|
|
2887
|
-
const e = [
|
|
2996
|
+
const e = [Pe.id];
|
|
2888
2997
|
this.disposeWithMe(
|
|
2889
2998
|
this._commandService.onCommandExecuted((t) => {
|
|
2890
2999
|
if (e.includes(t.id)) {
|
|
@@ -2940,21 +3049,21 @@ let Ke = class extends H {
|
|
|
2940
3049
|
return;
|
|
2941
3050
|
}
|
|
2942
3051
|
if (this._arrowMoveActionState === 2 && (this._arrowMoveActionState = 3), (this._selectionManagerService.getSelectionRanges() || []).length === 0) {
|
|
2943
|
-
const l = this._selectionManagerService.getLastByPlugin(
|
|
3052
|
+
const l = this._selectionManagerService.getLastByPlugin(Ce);
|
|
2944
3053
|
if (l != null) {
|
|
2945
|
-
const d =
|
|
3054
|
+
const d = K.deepClone(l);
|
|
2946
3055
|
this._selectionManagerService.add([d]);
|
|
2947
3056
|
}
|
|
2948
3057
|
}
|
|
2949
3058
|
let o = M.DOWN;
|
|
2950
3059
|
r === O.ARROW_DOWN ? o = M.DOWN : r === O.ARROW_UP ? o = M.UP : r === O.ARROW_LEFT ? o = M.LEFT : r === O.ARROW_RIGHT && (o = M.RIGHT), a === se.CTRL_COMMAND ? this._commandService.executeCommand(Fe.id, {
|
|
2951
3060
|
direction: o,
|
|
2952
|
-
jumpOver:
|
|
2953
|
-
}) : a === se.SHIFT ? this._commandService.executeCommand(
|
|
3061
|
+
jumpOver: Xt.moveGap
|
|
3062
|
+
}) : a === se.SHIFT ? this._commandService.executeCommand(Qt.id, {
|
|
2954
3063
|
direction: o
|
|
2955
|
-
}) : a ===
|
|
3064
|
+
}) : a === jn ? this._commandService.executeCommand(Qt.id, {
|
|
2956
3065
|
direction: o,
|
|
2957
|
-
jumpOver:
|
|
3066
|
+
jumpOver: Xt.moveGap
|
|
2958
3067
|
}) : this._commandService.executeCommand(Fe.id, {
|
|
2959
3068
|
direction: o
|
|
2960
3069
|
});
|
|
@@ -2968,39 +3077,39 @@ let Ke = class extends H {
|
|
|
2968
3077
|
if (e == null)
|
|
2969
3078
|
return;
|
|
2970
3079
|
let t = M.LEFT;
|
|
2971
|
-
e === O.ARROW_DOWN ? t = M.DOWN : e === O.ARROW_UP ? t = M.UP : e === O.ARROW_RIGHT && (t = M.RIGHT), this._commandService.executeCommand(
|
|
3080
|
+
e === O.ARROW_DOWN ? t = M.DOWN : e === O.ARROW_UP ? t = M.UP : e === O.ARROW_RIGHT && (t = M.RIGHT), this._commandService.executeCommand(wr.id, {
|
|
2972
3081
|
direction: t
|
|
2973
3082
|
});
|
|
2974
3083
|
}
|
|
2975
3084
|
_getEditorObject() {
|
|
2976
|
-
return
|
|
3085
|
+
return St(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
|
|
2977
3086
|
}
|
|
2978
3087
|
};
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
],
|
|
2998
|
-
var
|
|
2999
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3088
|
+
Xe = ms([
|
|
3089
|
+
X(Q.Steady, Xe),
|
|
3090
|
+
F(0, J),
|
|
3091
|
+
F(1, _t),
|
|
3092
|
+
F(2, _n),
|
|
3093
|
+
F(3, y(At)),
|
|
3094
|
+
F(4, y(de)),
|
|
3095
|
+
F(5, y(ve)),
|
|
3096
|
+
F(6, Mt),
|
|
3097
|
+
F(7, y(on)),
|
|
3098
|
+
F(8, y(Tt)),
|
|
3099
|
+
F(9, y(Bn)),
|
|
3100
|
+
F(10, Ie),
|
|
3101
|
+
F(11, y(Cn)),
|
|
3102
|
+
F(12, y(Ft)),
|
|
3103
|
+
F(13, y(Dn)),
|
|
3104
|
+
F(14, Ne),
|
|
3105
|
+
F(15, y(Lr))
|
|
3106
|
+
], Xe);
|
|
3107
|
+
var fs = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, ds = (i, e, t, n) => {
|
|
3108
|
+
for (var r = n > 1 ? void 0 : n ? ls(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
3000
3109
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
3001
|
-
return n && r &&
|
|
3002
|
-
},
|
|
3003
|
-
let
|
|
3110
|
+
return n && r && fs(e, t, r), r;
|
|
3111
|
+
}, rn = (i, e) => (t, n) => e(t, n, i);
|
|
3112
|
+
let Qe = class extends $ {
|
|
3004
3113
|
constructor(e, t) {
|
|
3005
3114
|
super();
|
|
3006
3115
|
k(this, "_waitingCommandQueue", []);
|
|
@@ -3018,12 +3127,12 @@ let Ye = class extends H {
|
|
|
3018
3127
|
if (this._activeDirtyManagerService.get(e.id)) {
|
|
3019
3128
|
if (e.id === ie.id) {
|
|
3020
3129
|
const n = e.params;
|
|
3021
|
-
if (t && t.onlyLocal === !0 || n.trigger ===
|
|
3130
|
+
if (t && t.onlyLocal === !0 || n.trigger === Dt.id || n.trigger === ln.id)
|
|
3022
3131
|
return;
|
|
3023
3132
|
}
|
|
3024
3133
|
this._waitingCommandQueue.push(e), clearTimeout(this._setTimeoutKey), this._setTimeoutKey = setTimeout(() => {
|
|
3025
3134
|
this._commandService.executeCommand(
|
|
3026
|
-
|
|
3135
|
+
Vt.id,
|
|
3027
3136
|
{
|
|
3028
3137
|
...this._generateDirty(this._waitingCommandQueue)
|
|
3029
3138
|
},
|
|
@@ -3070,7 +3179,7 @@ let Ye = class extends H {
|
|
|
3070
3179
|
_initialExecuteFormulaProcessListener() {
|
|
3071
3180
|
this.disposeWithMe(
|
|
3072
3181
|
this._commandService.onCommandExecuted((e) => {
|
|
3073
|
-
if (e.id !==
|
|
3182
|
+
if (e.id !== ur.id)
|
|
3074
3183
|
return;
|
|
3075
3184
|
const t = e.params;
|
|
3076
3185
|
if (t.stageInfo != null) {
|
|
@@ -3090,16 +3199,16 @@ let Ye = class extends H {
|
|
|
3090
3199
|
const n = t.functionsExecutedState;
|
|
3091
3200
|
let r = "";
|
|
3092
3201
|
switch (n) {
|
|
3093
|
-
case
|
|
3202
|
+
case we.NOT_EXECUTED:
|
|
3094
3203
|
r = "No tasks are being executed anymore", this._waitingCommandQueue.unshift(...this._executingCommandQueue), this._executingCommandQueue = [];
|
|
3095
3204
|
break;
|
|
3096
|
-
case
|
|
3205
|
+
case we.STOP_EXECUTION:
|
|
3097
3206
|
r = "The execution of the formula has been stopped", this._waitingCommandQueue.unshift(...this._executingCommandQueue), this._executingCommandQueue = [];
|
|
3098
3207
|
break;
|
|
3099
|
-
case
|
|
3208
|
+
case we.SUCCESS:
|
|
3100
3209
|
r = `Formula calculation succeeded, Total time consumed: ${performance.now() - this._startExecutionTime} ms`, this._executingCommandQueue = [];
|
|
3101
3210
|
break;
|
|
3102
|
-
case
|
|
3211
|
+
case we.INITIAL:
|
|
3103
3212
|
r = "Waiting for calculation", this._executingCommandQueue = [];
|
|
3104
3213
|
break;
|
|
3105
3214
|
}
|
|
@@ -3110,7 +3219,7 @@ let Ye = class extends H {
|
|
|
3110
3219
|
}
|
|
3111
3220
|
_initialExecuteFormula() {
|
|
3112
3221
|
this._commandService.executeCommand(
|
|
3113
|
-
|
|
3222
|
+
Vt.id,
|
|
3114
3223
|
{
|
|
3115
3224
|
commands: [],
|
|
3116
3225
|
forceCalculation: !0
|
|
@@ -3121,54 +3230,54 @@ let Ye = class extends H {
|
|
|
3121
3230
|
);
|
|
3122
3231
|
}
|
|
3123
3232
|
};
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
],
|
|
3129
|
-
function
|
|
3233
|
+
Qe = ds([
|
|
3234
|
+
X(Q.Ready, Qe),
|
|
3235
|
+
rn(0, J),
|
|
3236
|
+
rn(1, xt)
|
|
3237
|
+
], Qe);
|
|
3238
|
+
function Ue(i, e, t, n, r) {
|
|
3130
3239
|
const { id: a } = e;
|
|
3131
|
-
if (
|
|
3240
|
+
if (Wn(i, t, n))
|
|
3132
3241
|
return i;
|
|
3133
3242
|
const s = new x(i[t][n]);
|
|
3134
3243
|
switch (a) {
|
|
3244
|
+
case Sn.id:
|
|
3245
|
+
bs(s, e);
|
|
3246
|
+
break;
|
|
3135
3247
|
case Pn.id:
|
|
3136
|
-
|
|
3248
|
+
ps(s, e, r);
|
|
3137
3249
|
break;
|
|
3138
3250
|
case vn.id:
|
|
3139
|
-
|
|
3251
|
+
hs(s, e, r);
|
|
3140
3252
|
break;
|
|
3141
3253
|
case In.id:
|
|
3142
|
-
|
|
3254
|
+
Es(s, e);
|
|
3143
3255
|
break;
|
|
3144
3256
|
case gn.id:
|
|
3145
|
-
|
|
3257
|
+
Rs(s, e);
|
|
3146
3258
|
break;
|
|
3147
3259
|
case Rn.id:
|
|
3148
|
-
|
|
3260
|
+
gs(s, e);
|
|
3149
3261
|
break;
|
|
3150
3262
|
case En.id:
|
|
3151
|
-
|
|
3263
|
+
Is(s, e);
|
|
3152
3264
|
break;
|
|
3153
3265
|
case hn.id:
|
|
3154
|
-
|
|
3266
|
+
vs(s, e);
|
|
3155
3267
|
break;
|
|
3156
3268
|
case pn.id:
|
|
3157
|
-
|
|
3269
|
+
Ps(s, e);
|
|
3158
3270
|
break;
|
|
3159
3271
|
case bn.id:
|
|
3160
|
-
|
|
3272
|
+
Ss(s, e);
|
|
3161
3273
|
break;
|
|
3162
3274
|
case dn.id:
|
|
3163
|
-
|
|
3164
|
-
break;
|
|
3165
|
-
case ln.id:
|
|
3166
|
-
vs(s, e);
|
|
3275
|
+
Bs(s, e);
|
|
3167
3276
|
break;
|
|
3168
3277
|
}
|
|
3169
3278
|
return i;
|
|
3170
3279
|
}
|
|
3171
|
-
function
|
|
3280
|
+
function bs(i, e) {
|
|
3172
3281
|
const { params: t } = e;
|
|
3173
3282
|
if (!t)
|
|
3174
3283
|
return;
|
|
@@ -3179,98 +3288,98 @@ function fs(i, e) {
|
|
|
3179
3288
|
endColumn: c
|
|
3180
3289
|
} = n, { startRow: u, endRow: l, startColumn: d, endColumn: m } = r, b = new x();
|
|
3181
3290
|
for (let h = a; h <= s; h++)
|
|
3182
|
-
for (let
|
|
3183
|
-
const f = i.getValue(h,
|
|
3184
|
-
b.setValue(h - a,
|
|
3291
|
+
for (let g = o; g <= c; g++) {
|
|
3292
|
+
const f = i.getValue(h, g);
|
|
3293
|
+
b.setValue(h - a, g - o, f), i.setValue(h, g, null);
|
|
3185
3294
|
}
|
|
3186
3295
|
for (let h = u; h <= l; h++)
|
|
3187
|
-
for (let
|
|
3188
|
-
const f = b.getValue(h - u,
|
|
3189
|
-
i.setValue(h,
|
|
3296
|
+
for (let g = d; g <= m; g++) {
|
|
3297
|
+
const f = b.getValue(h - u, g - d);
|
|
3298
|
+
i.setValue(h, g, f);
|
|
3190
3299
|
}
|
|
3191
3300
|
}
|
|
3192
|
-
function
|
|
3301
|
+
function ps(i, e, t) {
|
|
3193
3302
|
const { params: n } = e;
|
|
3194
3303
|
if (!n)
|
|
3195
3304
|
return;
|
|
3196
3305
|
const { fromRow: r, toRow: a } = n, s = t == null ? void 0 : t.filter(
|
|
3197
|
-
(l) => l.range.rangeType ===
|
|
3306
|
+
(l) => l.range.rangeType === Ee.ROW && l.range.startRow <= r && r <= l.range.endRow
|
|
3198
3307
|
);
|
|
3199
3308
|
if ((s == null ? void 0 : s.length) !== 1)
|
|
3200
3309
|
return;
|
|
3201
3310
|
const o = s[0].range, c = o.startRow, u = o.endRow - o.startRow + 1;
|
|
3202
3311
|
i.moveRows(c, u, a);
|
|
3203
3312
|
}
|
|
3204
|
-
function
|
|
3313
|
+
function hs(i, e, t) {
|
|
3205
3314
|
const { params: n } = e;
|
|
3206
3315
|
if (!n)
|
|
3207
3316
|
return;
|
|
3208
3317
|
const { fromCol: r, toCol: a } = n, s = t == null ? void 0 : t.filter(
|
|
3209
|
-
(l) => l.range.rangeType ===
|
|
3318
|
+
(l) => l.range.rangeType === Ee.COLUMN && l.range.startColumn <= r && r <= l.range.endColumn
|
|
3210
3319
|
);
|
|
3211
3320
|
if ((s == null ? void 0 : s.length) !== 1)
|
|
3212
3321
|
return;
|
|
3213
3322
|
const o = s[0].range, c = o.startColumn, u = o.endColumn - o.startColumn + 1;
|
|
3214
3323
|
i.moveColumns(c, u, a);
|
|
3215
3324
|
}
|
|
3216
|
-
function
|
|
3325
|
+
function Es(i, e) {
|
|
3217
3326
|
const { params: t } = e;
|
|
3218
3327
|
if (!t)
|
|
3219
3328
|
return;
|
|
3220
3329
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3221
|
-
|
|
3330
|
+
rt(i, n, r, a, Y.ROWS);
|
|
3222
3331
|
}
|
|
3223
|
-
function
|
|
3332
|
+
function Rs(i, e) {
|
|
3224
3333
|
const { params: t } = e;
|
|
3225
3334
|
if (!t)
|
|
3226
3335
|
return;
|
|
3227
3336
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3228
|
-
|
|
3337
|
+
rt(i, n, r, a, Y.COLUMNS);
|
|
3229
3338
|
}
|
|
3230
|
-
function
|
|
3339
|
+
function gs(i, e) {
|
|
3231
3340
|
const { params: t } = e;
|
|
3232
3341
|
if (!t)
|
|
3233
3342
|
return;
|
|
3234
3343
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3235
|
-
|
|
3344
|
+
rt(i, n, r, a, Y.COLUMNS);
|
|
3236
3345
|
}
|
|
3237
|
-
function
|
|
3346
|
+
function Is(i, e) {
|
|
3238
3347
|
const { params: t } = e;
|
|
3239
3348
|
if (!t)
|
|
3240
3349
|
return;
|
|
3241
3350
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3242
|
-
|
|
3351
|
+
rt(i, n, r, a, Y.ROWS);
|
|
3243
3352
|
}
|
|
3244
|
-
function
|
|
3353
|
+
function vs(i, e) {
|
|
3245
3354
|
const { params: t } = e;
|
|
3246
3355
|
if (!t)
|
|
3247
3356
|
return;
|
|
3248
3357
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3249
|
-
|
|
3358
|
+
it(i, n, r, a, Y.ROWS);
|
|
3250
3359
|
}
|
|
3251
|
-
function
|
|
3360
|
+
function Ps(i, e) {
|
|
3252
3361
|
const { params: t } = e;
|
|
3253
3362
|
if (!t)
|
|
3254
3363
|
return;
|
|
3255
3364
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3256
|
-
|
|
3365
|
+
it(i, n, r, a, Y.COLUMNS);
|
|
3257
3366
|
}
|
|
3258
|
-
function
|
|
3367
|
+
function Ss(i, e) {
|
|
3259
3368
|
const { params: t } = e;
|
|
3260
3369
|
if (!t)
|
|
3261
3370
|
return;
|
|
3262
3371
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3263
|
-
|
|
3372
|
+
it(i, n, r, a, Y.ROWS);
|
|
3264
3373
|
}
|
|
3265
|
-
function
|
|
3374
|
+
function Bs(i, e) {
|
|
3266
3375
|
const { params: t } = e;
|
|
3267
3376
|
if (!t)
|
|
3268
3377
|
return;
|
|
3269
3378
|
const { range: n } = t, r = i.getLength() - 1, a = i.getRange().endColumn;
|
|
3270
|
-
|
|
3379
|
+
it(i, n, r, a, Y.COLUMNS);
|
|
3271
3380
|
}
|
|
3272
|
-
function
|
|
3273
|
-
if (
|
|
3381
|
+
function Cs(i, e, t) {
|
|
3382
|
+
if (Wn(i, e, t))
|
|
3274
3383
|
return i;
|
|
3275
3384
|
const n = new x(i[e][t]);
|
|
3276
3385
|
return n.forValue((r, a, s) => {
|
|
@@ -3286,15 +3395,18 @@ function Ps(i, e, t) {
|
|
|
3286
3395
|
n.setValue(r, a, b);
|
|
3287
3396
|
}), i;
|
|
3288
3397
|
}
|
|
3289
|
-
function
|
|
3398
|
+
function Wn(i, e, t) {
|
|
3290
3399
|
return i == null || i[e] == null || i[e][t] == null;
|
|
3291
3400
|
}
|
|
3292
|
-
|
|
3293
|
-
|
|
3401
|
+
function ht(i, e, t) {
|
|
3402
|
+
i && i[e] && i[e][t] && delete i[e][t];
|
|
3403
|
+
}
|
|
3404
|
+
var ks = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, Ds = (i, e, t, n) => {
|
|
3405
|
+
for (var r = n > 1 ? void 0 : n ? _s(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
3294
3406
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
3295
|
-
return n && r &&
|
|
3407
|
+
return n && r && ks(e, t, r), r;
|
|
3296
3408
|
}, le = (i, e) => (t, n) => e(t, n, i);
|
|
3297
|
-
let
|
|
3409
|
+
let Je = class extends $ {
|
|
3298
3410
|
constructor(i, e, t, n, r, a, s) {
|
|
3299
3411
|
super(), this._currentUniverService = i, this._commandService = e, this._lexerTreeBuilder = t, this._formulaDataModel = n, this._sheetInterceptorService = r, this._selectionManagerService = a, this._injector = s, this._initialize();
|
|
3300
3412
|
}
|
|
@@ -3311,18 +3423,18 @@ let Qe = class extends H {
|
|
|
3311
3423
|
if (i.params)
|
|
3312
3424
|
if (i.id === ie.id) {
|
|
3313
3425
|
const t = i.params;
|
|
3314
|
-
if (e && e.onlyLocal === !0 || t.trigger ===
|
|
3426
|
+
if (e && e.onlyLocal === !0 || t.trigger === Dt.id || t.trigger === ln.id)
|
|
3315
3427
|
return;
|
|
3316
3428
|
this._handleSetRangeValuesMutation(t, e);
|
|
3317
3429
|
} else
|
|
3318
|
-
i.id ===
|
|
3430
|
+
i.id === vt.id ? this._handleRemoveSheetMutation(i.params) : i.id === Pt.id && this._handleInsertSheetMutation(i.params);
|
|
3319
3431
|
})
|
|
3320
3432
|
);
|
|
3321
3433
|
}
|
|
3322
3434
|
_handleSetRangeValuesMutation(i, e) {
|
|
3323
3435
|
const { subUnitId: t, unitId: n, cellValue: r } = i;
|
|
3324
3436
|
e && e.onlyLocal === !0 || r == null || (this._formulaDataModel.updateFormulaData(n, t, r), this._commandService.executeCommand(
|
|
3325
|
-
|
|
3437
|
+
Le.id,
|
|
3326
3438
|
{
|
|
3327
3439
|
formulaData: this._formulaDataModel.getFormulaData()
|
|
3328
3440
|
},
|
|
@@ -3333,20 +3445,20 @@ let Qe = class extends H {
|
|
|
3333
3445
|
}
|
|
3334
3446
|
_handleRemoveSheetMutation(i) {
|
|
3335
3447
|
const { subUnitId: e, unitId: t } = i, n = this._formulaDataModel.getFormulaData();
|
|
3336
|
-
|
|
3448
|
+
ht(n, t, e);
|
|
3337
3449
|
const r = this._formulaDataModel.getArrayFormulaRange();
|
|
3338
|
-
|
|
3450
|
+
ht(r, t, e);
|
|
3339
3451
|
const a = this._formulaDataModel.getArrayFormulaCellData();
|
|
3340
|
-
|
|
3452
|
+
ht(a, t, e), this._commandService.executeCommand(Le.id, {
|
|
3341
3453
|
formulaData: n
|
|
3342
|
-
}), this._commandService.executeCommand(
|
|
3454
|
+
}), this._commandService.executeCommand(It.id, {
|
|
3343
3455
|
arrayFormulaRange: r,
|
|
3344
3456
|
arrayFormulaCellData: a
|
|
3345
3457
|
});
|
|
3346
3458
|
}
|
|
3347
3459
|
_handleInsertSheetMutation(i) {
|
|
3348
3460
|
const { sheet: e, unitId: t } = i, n = this._formulaDataModel.getFormulaData(), { id: r, cellData: a } = e, s = new x(a);
|
|
3349
|
-
|
|
3461
|
+
mr(n, t, r, s), this._commandService.executeCommand(Le.id, {
|
|
3350
3462
|
formulaData: n
|
|
3351
3463
|
});
|
|
3352
3464
|
}
|
|
@@ -3354,40 +3466,40 @@ let Qe = class extends H {
|
|
|
3354
3466
|
const { id: e } = i;
|
|
3355
3467
|
let t = null;
|
|
3356
3468
|
switch (e) {
|
|
3357
|
-
case
|
|
3469
|
+
case Sn.id:
|
|
3358
3470
|
t = this._handleMoveRange(i);
|
|
3359
3471
|
break;
|
|
3360
|
-
case
|
|
3472
|
+
case Pn.id:
|
|
3361
3473
|
t = this._handleMoveRows(i);
|
|
3362
3474
|
break;
|
|
3363
|
-
case
|
|
3475
|
+
case vn.id:
|
|
3364
3476
|
t = this._handleMoveCols(i);
|
|
3365
3477
|
break;
|
|
3366
|
-
case
|
|
3478
|
+
case In.id:
|
|
3367
3479
|
t = this._handleInsertRow(i);
|
|
3368
3480
|
break;
|
|
3369
|
-
case
|
|
3481
|
+
case gn.id:
|
|
3370
3482
|
t = this._handleInsertCol(i);
|
|
3371
3483
|
break;
|
|
3372
|
-
case
|
|
3484
|
+
case Rn.id:
|
|
3373
3485
|
t = this._handleInsertRangeMoveRight(i);
|
|
3374
3486
|
break;
|
|
3375
|
-
case
|
|
3487
|
+
case En.id:
|
|
3376
3488
|
t = this._handleInsertRangeMoveDown(i);
|
|
3377
3489
|
break;
|
|
3378
|
-
case
|
|
3490
|
+
case hn.id:
|
|
3379
3491
|
t = this._handleRemoveRow(i);
|
|
3380
3492
|
break;
|
|
3381
|
-
case
|
|
3493
|
+
case pn.id:
|
|
3382
3494
|
t = this._handleRemoveCol(i);
|
|
3383
3495
|
break;
|
|
3384
|
-
case
|
|
3496
|
+
case bn.id:
|
|
3385
3497
|
t = this._handleDeleteRangeMoveUp(i);
|
|
3386
3498
|
break;
|
|
3387
|
-
case
|
|
3499
|
+
case dn.id:
|
|
3388
3500
|
t = this._handleDeleteRangeMoveLeft(i);
|
|
3389
3501
|
break;
|
|
3390
|
-
case
|
|
3502
|
+
case pr.id:
|
|
3391
3503
|
t = this._handleSetWorksheetName(i);
|
|
3392
3504
|
break;
|
|
3393
3505
|
}
|
|
@@ -3395,9 +3507,9 @@ let Qe = class extends H {
|
|
|
3395
3507
|
const { unitSheetNameMap: n } = this._formulaDataModel.getCalculateData();
|
|
3396
3508
|
let r = this._formulaDataModel.getFormulaData();
|
|
3397
3509
|
const a = this._getFormulaReferenceMoveInfo(r, n, t), s = this._currentUniverService.getCurrentUniverSheetInstance(), o = s.getUnitId(), c = s.getActiveSheet().getSheetId(), u = this._selectionManagerService.getSelections(), l = this._formulaDataModel.getArrayFormulaRange(), d = this._formulaDataModel.getArrayFormulaCellData();
|
|
3398
|
-
let m =
|
|
3399
|
-
m =
|
|
3400
|
-
const b =
|
|
3510
|
+
let m = Ue(l, i, o, c, u);
|
|
3511
|
+
m = Cs(m, o, c);
|
|
3512
|
+
const b = Ue(
|
|
3401
3513
|
d,
|
|
3402
3514
|
i,
|
|
3403
3515
|
o,
|
|
@@ -3405,7 +3517,7 @@ let Qe = class extends H {
|
|
|
3405
3517
|
u
|
|
3406
3518
|
);
|
|
3407
3519
|
this._commandService.executeCommand(
|
|
3408
|
-
|
|
3520
|
+
It.id,
|
|
3409
3521
|
{
|
|
3410
3522
|
arrayFormulaRange: m,
|
|
3411
3523
|
arrayFormulaCellData: b
|
|
@@ -3413,9 +3525,9 @@ let Qe = class extends H {
|
|
|
3413
3525
|
{
|
|
3414
3526
|
local: !0
|
|
3415
3527
|
}
|
|
3416
|
-
), r =
|
|
3417
|
-
const h =
|
|
3418
|
-
return this._commandService.executeCommand(
|
|
3528
|
+
), r = Ue(r, i, o, c, u);
|
|
3529
|
+
const h = Ue(a, i, o, c, u);
|
|
3530
|
+
return this._commandService.executeCommand(Le.id, {
|
|
3419
3531
|
formulaData: this._formulaDataModel.getFormulaData()
|
|
3420
3532
|
}), this._getUpdateFormulaMutations(r, h);
|
|
3421
3533
|
}
|
|
@@ -3449,13 +3561,13 @@ let Qe = class extends H {
|
|
|
3449
3561
|
startColumn: 0,
|
|
3450
3562
|
endRow: t,
|
|
3451
3563
|
endColumn: s.getColumnCount() - 1,
|
|
3452
|
-
rangeType:
|
|
3564
|
+
rangeType: Ee.ROW
|
|
3453
3565
|
}, u = {
|
|
3454
3566
|
startRow: n,
|
|
3455
3567
|
startColumn: 0,
|
|
3456
3568
|
endRow: n,
|
|
3457
3569
|
endColumn: s.getColumnCount() - 1,
|
|
3458
|
-
rangeType:
|
|
3570
|
+
rangeType: Ee.ROW
|
|
3459
3571
|
};
|
|
3460
3572
|
return {
|
|
3461
3573
|
type: 0,
|
|
@@ -3474,13 +3586,13 @@ let Qe = class extends H {
|
|
|
3474
3586
|
startColumn: t,
|
|
3475
3587
|
endRow: s.getRowCount() - 1,
|
|
3476
3588
|
endColumn: t,
|
|
3477
|
-
rangeType:
|
|
3589
|
+
rangeType: Ee.COLUMN
|
|
3478
3590
|
}, u = {
|
|
3479
3591
|
startRow: 0,
|
|
3480
3592
|
startColumn: n,
|
|
3481
3593
|
endRow: s.getRowCount() - 1,
|
|
3482
3594
|
endColumn: n,
|
|
3483
|
-
rangeType:
|
|
3595
|
+
rangeType: Ee.COLUMN
|
|
3484
3596
|
};
|
|
3485
3597
|
return {
|
|
3486
3598
|
type: 0,
|
|
@@ -3608,11 +3720,11 @@ let Qe = class extends H {
|
|
|
3608
3720
|
const l = new x(i[s][u]), d = new x(o[u]), m = new x();
|
|
3609
3721
|
d.forValue((f, R, p) => {
|
|
3610
3722
|
var S;
|
|
3611
|
-
const
|
|
3612
|
-
|
|
3723
|
+
const I = (p == null ? void 0 : p.f) || "", C = ((S = l.getValue(f, R)) == null ? void 0 : S.f) || "";
|
|
3724
|
+
Re(I) && (Re(C) && I !== C ? m.setValue(f, R, { f: I }) : m.setValue(f, R, { f: I, si: null }));
|
|
3613
3725
|
});
|
|
3614
3726
|
const b = m.getData();
|
|
3615
|
-
if (
|
|
3727
|
+
if (K.isEmptyObject(b))
|
|
3616
3728
|
continue;
|
|
3617
3729
|
const h = {
|
|
3618
3730
|
subUnitId: u,
|
|
@@ -3623,10 +3735,10 @@ let Qe = class extends H {
|
|
|
3623
3735
|
id: ie.id,
|
|
3624
3736
|
params: h
|
|
3625
3737
|
});
|
|
3626
|
-
const
|
|
3738
|
+
const g = fn(r, h);
|
|
3627
3739
|
n.push({
|
|
3628
3740
|
id: ie.id,
|
|
3629
|
-
params:
|
|
3741
|
+
params: g
|
|
3630
3742
|
});
|
|
3631
3743
|
}
|
|
3632
3744
|
}
|
|
@@ -3636,7 +3748,12 @@ let Qe = class extends H {
|
|
|
3636
3748
|
};
|
|
3637
3749
|
}
|
|
3638
3750
|
_getFormulaReferenceMoveInfo(i, e, t) {
|
|
3639
|
-
|
|
3751
|
+
if (i == null)
|
|
3752
|
+
return {};
|
|
3753
|
+
const n = Object.keys(i);
|
|
3754
|
+
if (n.length === 0)
|
|
3755
|
+
return {};
|
|
3756
|
+
const r = {};
|
|
3640
3757
|
for (const a of n) {
|
|
3641
3758
|
const s = i[a], o = Object.keys(s);
|
|
3642
3759
|
r[a] == null && (r[a] = {});
|
|
@@ -3646,55 +3763,55 @@ let Qe = class extends H {
|
|
|
3646
3763
|
var v;
|
|
3647
3764
|
if (!b)
|
|
3648
3765
|
return !0;
|
|
3649
|
-
const { f: h, x:
|
|
3766
|
+
const { f: h, x: g, y: f, si: R } = b, p = this._lexerTreeBuilder.sequenceNodesBuilder(h);
|
|
3650
3767
|
if (p == null)
|
|
3651
3768
|
return !0;
|
|
3652
|
-
let
|
|
3769
|
+
let I = !1;
|
|
3653
3770
|
const C = [];
|
|
3654
|
-
for (let
|
|
3655
|
-
const
|
|
3656
|
-
if (typeof
|
|
3771
|
+
for (let B = 0, _ = p.length; B < _; B++) {
|
|
3772
|
+
const A = p[B];
|
|
3773
|
+
if (typeof A == "string" || A.nodeType !== G.REFERENCE)
|
|
3657
3774
|
continue;
|
|
3658
|
-
const { token:
|
|
3775
|
+
const { token: P } = A, T = ge(P), { range: D, sheetName: j, unitId: U } = T, ce = U == null || U.length === 0 ? a : U, be = (v = e == null ? void 0 : e[ce]) == null ? void 0 : v[j], ue = {
|
|
3659
3776
|
range: D,
|
|
3660
3777
|
sheetId: be,
|
|
3661
3778
|
unitId: U,
|
|
3662
|
-
sheetName:
|
|
3663
|
-
refOffsetX:
|
|
3779
|
+
sheetName: j,
|
|
3780
|
+
refOffsetX: g || 0,
|
|
3664
3781
|
refOffsetY: f || 0
|
|
3665
3782
|
};
|
|
3666
|
-
let
|
|
3783
|
+
let Oe = null;
|
|
3667
3784
|
if (t.type === 9) {
|
|
3668
3785
|
const {
|
|
3669
|
-
unitId:
|
|
3670
|
-
sheetId:
|
|
3671
|
-
sheetName:
|
|
3786
|
+
unitId: uo,
|
|
3787
|
+
sheetId: Gn,
|
|
3788
|
+
sheetName: zt
|
|
3672
3789
|
} = t;
|
|
3673
|
-
if (
|
|
3790
|
+
if (zt == null || be == null || be.length === 0 || Gn !== be)
|
|
3674
3791
|
continue;
|
|
3675
|
-
|
|
3792
|
+
Oe = qe({
|
|
3676
3793
|
range: D,
|
|
3677
|
-
sheetName:
|
|
3794
|
+
sheetName: zt,
|
|
3678
3795
|
unitId: U
|
|
3679
3796
|
});
|
|
3680
3797
|
} else
|
|
3681
|
-
|
|
3798
|
+
Oe = this._getNewRangeByMoveParam(
|
|
3682
3799
|
ue,
|
|
3683
3800
|
t,
|
|
3684
3801
|
a,
|
|
3685
3802
|
c
|
|
3686
3803
|
);
|
|
3687
|
-
|
|
3688
|
-
...
|
|
3689
|
-
token:
|
|
3690
|
-
},
|
|
3804
|
+
Oe != null && (p[B] = {
|
|
3805
|
+
...A,
|
|
3806
|
+
token: Oe
|
|
3807
|
+
}, I = !0, C.push(B));
|
|
3691
3808
|
}
|
|
3692
|
-
if (!
|
|
3809
|
+
if (!I)
|
|
3693
3810
|
return !0;
|
|
3694
|
-
const S = this._updateRefOffset(p, C,
|
|
3811
|
+
const S = this._updateRefOffset(p, C, g, f);
|
|
3695
3812
|
l.setValue(d, m, {
|
|
3696
|
-
f: `=${
|
|
3697
|
-
x:
|
|
3813
|
+
f: `=${un(S)}`,
|
|
3814
|
+
x: g,
|
|
3698
3815
|
y: f,
|
|
3699
3816
|
si: R
|
|
3700
3817
|
});
|
|
@@ -3710,7 +3827,7 @@ let Qe = class extends H {
|
|
|
3710
3827
|
unitId: m,
|
|
3711
3828
|
sheetName: b,
|
|
3712
3829
|
refOffsetX: h,
|
|
3713
|
-
refOffsetY:
|
|
3830
|
+
refOffsetY: g
|
|
3714
3831
|
} = i;
|
|
3715
3832
|
if (!this._checkIsSameUnitAndSheet(
|
|
3716
3833
|
a,
|
|
@@ -3721,139 +3838,139 @@ let Qe = class extends H {
|
|
|
3721
3838
|
d
|
|
3722
3839
|
))
|
|
3723
3840
|
return;
|
|
3724
|
-
const f =
|
|
3841
|
+
const f = Ve.moveOffset(l, h, g);
|
|
3725
3842
|
let R = null;
|
|
3726
3843
|
if (r === 0) {
|
|
3727
3844
|
if (c == null || u == null)
|
|
3728
3845
|
return;
|
|
3729
|
-
const p = this._checkMoveEdge(f, c),
|
|
3730
|
-
if (
|
|
3846
|
+
const p = this._checkMoveEdge(f, c), I = Ve.getIntersects(f, c);
|
|
3847
|
+
if (I == null)
|
|
3731
3848
|
return;
|
|
3732
|
-
const C =
|
|
3733
|
-
{ id:
|
|
3734
|
-
|
|
3735
|
-
), S =
|
|
3849
|
+
const C = hr(
|
|
3850
|
+
{ id: Z.MoveRangeCommandId, params: { toRange: u, fromRange: c } },
|
|
3851
|
+
I
|
|
3852
|
+
), S = ee(C, I);
|
|
3736
3853
|
if (S == null)
|
|
3737
3854
|
return;
|
|
3738
|
-
R = this._getMoveNewRange(p, S, c, u, f,
|
|
3855
|
+
R = this._getMoveNewRange(p, S, c, u, f, I);
|
|
3739
3856
|
}
|
|
3740
3857
|
if (o != null) {
|
|
3741
3858
|
if (r === 1) {
|
|
3742
|
-
const p =
|
|
3859
|
+
const p = Er(
|
|
3743
3860
|
{
|
|
3744
|
-
id:
|
|
3861
|
+
id: Z.InsertRowCommandId,
|
|
3745
3862
|
params: { range: o, unitId: "", subUnitId: "", direction: M.DOWN }
|
|
3746
3863
|
},
|
|
3747
3864
|
f
|
|
3748
|
-
),
|
|
3749
|
-
if (
|
|
3865
|
+
), I = ee(p, f);
|
|
3866
|
+
if (I == null)
|
|
3750
3867
|
return;
|
|
3751
3868
|
R = {
|
|
3752
3869
|
...f,
|
|
3753
|
-
...
|
|
3870
|
+
...I
|
|
3754
3871
|
};
|
|
3755
3872
|
} else if (r === 2) {
|
|
3756
|
-
const p =
|
|
3873
|
+
const p = Rr(
|
|
3757
3874
|
{
|
|
3758
|
-
id:
|
|
3875
|
+
id: Z.InsertColCommandId,
|
|
3759
3876
|
params: { range: o, unitId: "", subUnitId: "", direction: M.RIGHT }
|
|
3760
3877
|
},
|
|
3761
3878
|
f
|
|
3762
|
-
),
|
|
3763
|
-
if (
|
|
3879
|
+
), I = ee(p, f);
|
|
3880
|
+
if (I == null)
|
|
3764
3881
|
return;
|
|
3765
3882
|
R = {
|
|
3766
3883
|
...f,
|
|
3767
|
-
...
|
|
3884
|
+
...I
|
|
3768
3885
|
};
|
|
3769
3886
|
} else if (r === 3) {
|
|
3770
|
-
const p =
|
|
3887
|
+
const p = gr(
|
|
3771
3888
|
{
|
|
3772
|
-
id:
|
|
3889
|
+
id: Z.RemoveRowCommandId,
|
|
3773
3890
|
params: { range: o }
|
|
3774
3891
|
},
|
|
3775
3892
|
f
|
|
3776
|
-
),
|
|
3777
|
-
if (
|
|
3893
|
+
), I = ee(p, f);
|
|
3894
|
+
if (I == null)
|
|
3778
3895
|
return;
|
|
3779
3896
|
R = {
|
|
3780
3897
|
...f,
|
|
3781
|
-
...
|
|
3898
|
+
...I
|
|
3782
3899
|
};
|
|
3783
3900
|
} else if (r === 4) {
|
|
3784
|
-
const p =
|
|
3901
|
+
const p = Ir(
|
|
3785
3902
|
{
|
|
3786
|
-
id:
|
|
3903
|
+
id: Z.RemoveColCommandId,
|
|
3787
3904
|
params: { range: o }
|
|
3788
3905
|
},
|
|
3789
3906
|
f
|
|
3790
|
-
),
|
|
3791
|
-
if (
|
|
3907
|
+
), I = ee(p, f);
|
|
3908
|
+
if (I == null)
|
|
3792
3909
|
return;
|
|
3793
3910
|
R = {
|
|
3794
3911
|
...f,
|
|
3795
|
-
...
|
|
3912
|
+
...I
|
|
3796
3913
|
};
|
|
3797
3914
|
} else if (r === 5) {
|
|
3798
|
-
const p =
|
|
3915
|
+
const p = vr(
|
|
3799
3916
|
{
|
|
3800
|
-
id:
|
|
3917
|
+
id: Z.DeleteRangeMoveLeftCommandId,
|
|
3801
3918
|
params: { range: o }
|
|
3802
3919
|
},
|
|
3803
3920
|
f
|
|
3804
|
-
),
|
|
3805
|
-
if (
|
|
3921
|
+
), I = ee(p, f);
|
|
3922
|
+
if (I == null)
|
|
3806
3923
|
return;
|
|
3807
3924
|
R = {
|
|
3808
3925
|
...f,
|
|
3809
|
-
...
|
|
3926
|
+
...I
|
|
3810
3927
|
};
|
|
3811
3928
|
} else if (r === 6) {
|
|
3812
|
-
const p =
|
|
3929
|
+
const p = Pr(
|
|
3813
3930
|
{
|
|
3814
|
-
id:
|
|
3931
|
+
id: Z.DeleteRangeMoveUpCommandId,
|
|
3815
3932
|
params: { range: o }
|
|
3816
3933
|
},
|
|
3817
3934
|
f
|
|
3818
|
-
),
|
|
3819
|
-
if (
|
|
3935
|
+
), I = ee(p, f);
|
|
3936
|
+
if (I == null)
|
|
3820
3937
|
return;
|
|
3821
3938
|
R = {
|
|
3822
3939
|
...f,
|
|
3823
|
-
...
|
|
3940
|
+
...I
|
|
3824
3941
|
};
|
|
3825
3942
|
} else if (r === 7) {
|
|
3826
|
-
const p =
|
|
3943
|
+
const p = Sr(
|
|
3827
3944
|
{
|
|
3828
|
-
id:
|
|
3945
|
+
id: Z.InsertRangeMoveDownCommandId,
|
|
3829
3946
|
params: { range: o }
|
|
3830
3947
|
},
|
|
3831
3948
|
f
|
|
3832
|
-
),
|
|
3833
|
-
if (
|
|
3949
|
+
), I = ee(p, f);
|
|
3950
|
+
if (I == null)
|
|
3834
3951
|
return;
|
|
3835
3952
|
R = {
|
|
3836
3953
|
...f,
|
|
3837
|
-
...
|
|
3954
|
+
...I
|
|
3838
3955
|
};
|
|
3839
3956
|
} else if (r === 8) {
|
|
3840
|
-
const p =
|
|
3957
|
+
const p = Br(
|
|
3841
3958
|
{
|
|
3842
|
-
id:
|
|
3959
|
+
id: Z.InsertRangeMoveRightCommandId,
|
|
3843
3960
|
params: { range: o }
|
|
3844
3961
|
},
|
|
3845
3962
|
f
|
|
3846
|
-
),
|
|
3847
|
-
if (
|
|
3963
|
+
), I = ee(p, f);
|
|
3964
|
+
if (I == null)
|
|
3848
3965
|
return;
|
|
3849
3966
|
R = {
|
|
3850
3967
|
...f,
|
|
3851
|
-
...
|
|
3968
|
+
...I
|
|
3852
3969
|
};
|
|
3853
3970
|
}
|
|
3854
3971
|
}
|
|
3855
3972
|
if (R != null)
|
|
3856
|
-
return
|
|
3973
|
+
return qe({
|
|
3857
3974
|
range: R,
|
|
3858
3975
|
sheetName: b,
|
|
3859
3976
|
unitId: m
|
|
@@ -3874,14 +3991,14 @@ let Qe = class extends H {
|
|
|
3874
3991
|
const r = [];
|
|
3875
3992
|
for (let a = 0, s = i.length; a < s; a++) {
|
|
3876
3993
|
const o = i[a];
|
|
3877
|
-
if (typeof o == "string" || o.nodeType !==
|
|
3994
|
+
if (typeof o == "string" || o.nodeType !== G.REFERENCE || e.includes(a)) {
|
|
3878
3995
|
r.push(o);
|
|
3879
3996
|
continue;
|
|
3880
3997
|
}
|
|
3881
|
-
const { token: c } = o, u =
|
|
3998
|
+
const { token: c } = o, u = ge(c), { range: l, sheetName: d, unitId: m } = u, b = Ve.moveOffset(l, t, n);
|
|
3882
3999
|
r.push({
|
|
3883
4000
|
...o,
|
|
3884
|
-
token:
|
|
4001
|
+
token: qe({
|
|
3885
4002
|
range: b,
|
|
3886
4003
|
unitId: m,
|
|
3887
4004
|
sheetName: d
|
|
@@ -3930,68 +4047,68 @@ let Qe = class extends H {
|
|
|
3930
4047
|
startColumn: d,
|
|
3931
4048
|
endRow: m,
|
|
3932
4049
|
endColumn: b
|
|
3933
|
-
} = t, { startRow: h, startColumn:
|
|
4050
|
+
} = t, { startRow: h, startColumn: g, endRow: f, endColumn: R } = n, {
|
|
3934
4051
|
startRow: p,
|
|
3935
|
-
endRow:
|
|
4052
|
+
endRow: I,
|
|
3936
4053
|
startColumn: C,
|
|
3937
4054
|
endColumn: S
|
|
3938
4055
|
} = a, {
|
|
3939
4056
|
startRow: v,
|
|
3940
|
-
endRow:
|
|
4057
|
+
endRow: B,
|
|
3941
4058
|
startColumn: _,
|
|
3942
|
-
endColumn:
|
|
3943
|
-
} = r,
|
|
4059
|
+
endColumn: A
|
|
4060
|
+
} = r, P = { ...r };
|
|
3944
4061
|
if (i === 0)
|
|
3945
|
-
if (c === _ && u ===
|
|
4062
|
+
if (c === _ && u === A)
|
|
3946
4063
|
if (s < v)
|
|
3947
|
-
|
|
3948
|
-
else if (o <
|
|
3949
|
-
|
|
3950
|
-
else if (o >=
|
|
3951
|
-
|
|
4064
|
+
P.startRow = s;
|
|
4065
|
+
else if (o < B)
|
|
4066
|
+
P.startRow = s;
|
|
4067
|
+
else if (o >= B && h <= B)
|
|
4068
|
+
P.startRow = m + 1, P.endRow = o;
|
|
3952
4069
|
else
|
|
3953
4070
|
return;
|
|
3954
4071
|
else
|
|
3955
4072
|
return;
|
|
3956
4073
|
else if (i === 1)
|
|
3957
|
-
if (c === _ && u ===
|
|
3958
|
-
if (o >
|
|
3959
|
-
|
|
4074
|
+
if (c === _ && u === A)
|
|
4075
|
+
if (o > B)
|
|
4076
|
+
P.endRow = o;
|
|
3960
4077
|
else if (s > v)
|
|
3961
|
-
|
|
4078
|
+
P.endRow = o;
|
|
3962
4079
|
else if (s <= v && f >= v)
|
|
3963
|
-
|
|
4080
|
+
P.endRow = l + 1, P.startRow = s;
|
|
3964
4081
|
else
|
|
3965
4082
|
return;
|
|
3966
4083
|
else
|
|
3967
4084
|
return;
|
|
3968
4085
|
else if (i === 2)
|
|
3969
|
-
if (s === v && o ===
|
|
4086
|
+
if (s === v && o === B)
|
|
3970
4087
|
if (c < _)
|
|
3971
|
-
|
|
3972
|
-
else if (u <
|
|
3973
|
-
|
|
3974
|
-
else if (u >=
|
|
3975
|
-
|
|
4088
|
+
P.startColumn = c;
|
|
4089
|
+
else if (u < A)
|
|
4090
|
+
P.startColumn = c;
|
|
4091
|
+
else if (u >= A && g <= A)
|
|
4092
|
+
P.startColumn = b + 1, P.endColumn = u;
|
|
3976
4093
|
else
|
|
3977
4094
|
return;
|
|
3978
4095
|
else
|
|
3979
4096
|
return;
|
|
3980
4097
|
else if (i === 3)
|
|
3981
|
-
if (s === v && o ===
|
|
3982
|
-
if (u >
|
|
3983
|
-
|
|
4098
|
+
if (s === v && o === B)
|
|
4099
|
+
if (u > A)
|
|
4100
|
+
P.endColumn = u;
|
|
3984
4101
|
else if (c > _)
|
|
3985
|
-
|
|
4102
|
+
P.endColumn = u;
|
|
3986
4103
|
else if (c <= _ && R >= _)
|
|
3987
|
-
|
|
4104
|
+
P.endColumn = d + 1, P.startColumn = c;
|
|
3988
4105
|
else
|
|
3989
4106
|
return;
|
|
3990
4107
|
else
|
|
3991
4108
|
return;
|
|
3992
4109
|
else
|
|
3993
|
-
(i === 4 || (
|
|
3994
|
-
return
|
|
4110
|
+
(i === 4 || (g <= S + 1 && R >= A || g <= _ && R >= C - 1) && h <= v && f >= B || (h <= I + 1 && f >= B || h <= v && f >= p - 1) && g <= _ && R >= A) && (P.startRow = s, P.startColumn = c, P.endRow = o, P.endColumn = u);
|
|
4111
|
+
return P;
|
|
3995
4112
|
}
|
|
3996
4113
|
_getInsertNewRange() {
|
|
3997
4114
|
}
|
|
@@ -4003,17 +4120,17 @@ let Qe = class extends H {
|
|
|
4003
4120
|
};
|
|
4004
4121
|
}
|
|
4005
4122
|
};
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
le(0,
|
|
4009
|
-
le(1,
|
|
4010
|
-
le(2, y(
|
|
4011
|
-
le(3, y(
|
|
4012
|
-
le(4, y(
|
|
4013
|
-
le(5, y(
|
|
4014
|
-
le(6, y(
|
|
4015
|
-
],
|
|
4016
|
-
const
|
|
4123
|
+
Je = Ds([
|
|
4124
|
+
X(Q.Ready, Je),
|
|
4125
|
+
le(0, Ie),
|
|
4126
|
+
le(1, J),
|
|
4127
|
+
le(2, y(ve)),
|
|
4128
|
+
le(3, y(nt)),
|
|
4129
|
+
le(4, y(yt)),
|
|
4130
|
+
le(5, y(Tt)),
|
|
4131
|
+
le(6, y(tt))
|
|
4132
|
+
], Je);
|
|
4133
|
+
const ys = {}, Ts = {
|
|
4017
4134
|
BETADIST: {
|
|
4018
4135
|
description: "Returns the beta cumulative distribution function",
|
|
4019
4136
|
abstract: "Returns the beta cumulative distribution function",
|
|
@@ -4588,7 +4705,7 @@ const Cs = {}, _s = {
|
|
|
4588
4705
|
number2: { name: "number2", detail: "second" }
|
|
4589
4706
|
}
|
|
4590
4707
|
}
|
|
4591
|
-
},
|
|
4708
|
+
}, As = {
|
|
4592
4709
|
CUBEKPIMEMBER: {
|
|
4593
4710
|
description: "Returns a key performance indicator (KPI) property and displays the KPI name in the cell. A KPI is a quantifiable measurement, such as monthly gross profit or quarterly employee turnover, that is used to monitor an organization's performance.",
|
|
4594
4711
|
abstract: "Returns a key performance indicator (KPI) property and displays the KPI name in the cell. A KPI is a quantifiable measurement, such as monthly gross profit or quarterly employee turnover, that is used to monitor an organization's performance.",
|
|
@@ -4687,7 +4804,7 @@ const Cs = {}, _s = {
|
|
|
4687
4804
|
number2: { name: "number2", detail: "second" }
|
|
4688
4805
|
}
|
|
4689
4806
|
}
|
|
4690
|
-
},
|
|
4807
|
+
}, Ns = {
|
|
4691
4808
|
DAVERAGE: {
|
|
4692
4809
|
description: "Returns the average of selected database entries",
|
|
4693
4810
|
abstract: "Returns the average of selected database entries",
|
|
@@ -4856,7 +4973,7 @@ const Cs = {}, _s = {
|
|
|
4856
4973
|
number2: { name: "number2", detail: "second" }
|
|
4857
4974
|
}
|
|
4858
4975
|
}
|
|
4859
|
-
},
|
|
4976
|
+
}, Ms = {
|
|
4860
4977
|
DATE: {
|
|
4861
4978
|
description: "Returns the serial number of a particular date",
|
|
4862
4979
|
abstract: "Returns the serial number of a particular date",
|
|
@@ -5207,7 +5324,7 @@ const Cs = {}, _s = {
|
|
|
5207
5324
|
number2: { name: "number2", detail: "second" }
|
|
5208
5325
|
}
|
|
5209
5326
|
}
|
|
5210
|
-
},
|
|
5327
|
+
}, Os = {
|
|
5211
5328
|
BESSELI: {
|
|
5212
5329
|
description: "Returns the modified Bessel function In(x)",
|
|
5213
5330
|
abstract: "Returns the modified Bessel function In(x)",
|
|
@@ -5964,7 +6081,7 @@ const Cs = {}, _s = {
|
|
|
5964
6081
|
number2: { name: "number2", detail: "second" }
|
|
5965
6082
|
}
|
|
5966
6083
|
}
|
|
5967
|
-
},
|
|
6084
|
+
}, xs = {
|
|
5968
6085
|
ACCRINT: {
|
|
5969
6086
|
description: "Returns the accrued interest for a security that pays periodic interest",
|
|
5970
6087
|
abstract: "Returns the accrued interest for a security that pays periodic interest",
|
|
@@ -6735,7 +6852,7 @@ const Cs = {}, _s = {
|
|
|
6735
6852
|
number2: { name: "number2", detail: "second" }
|
|
6736
6853
|
}
|
|
6737
6854
|
}
|
|
6738
|
-
},
|
|
6855
|
+
}, ws = {
|
|
6739
6856
|
CELL: {
|
|
6740
6857
|
description: "Returns information about the formatting, location, or contents of a cell",
|
|
6741
6858
|
abstract: "Returns information about the formatting, location, or contents of a cell",
|
|
@@ -7030,7 +7147,7 @@ const Cs = {}, _s = {
|
|
|
7030
7147
|
number2: { name: "number2", detail: "second" }
|
|
7031
7148
|
}
|
|
7032
7149
|
}
|
|
7033
|
-
},
|
|
7150
|
+
}, Ls = {
|
|
7034
7151
|
AND: {
|
|
7035
7152
|
description: "Returns TRUE if all of its arguments are TRUE",
|
|
7036
7153
|
abstract: "Returns TRUE if all of its arguments are TRUE",
|
|
@@ -7181,8 +7298,12 @@ const Cs = {}, _s = {
|
|
|
7181
7298
|
}
|
|
7182
7299
|
],
|
|
7183
7300
|
functionParameter: {
|
|
7184
|
-
number1: { name: "
|
|
7185
|
-
number2: { name: "
|
|
7301
|
+
number1: { name: "rows", detail: "The number of rows in the array. Must be greater than zero." },
|
|
7302
|
+
number2: { name: "cols", detail: "The number of columns in the array. Must be greater than zero." },
|
|
7303
|
+
value3: {
|
|
7304
|
+
name: "lambda",
|
|
7305
|
+
detail: " A LAMBDA that is called to create the array. The LAMBDA takes two parameters: row (The row index of the array), col (The column index of the array)."
|
|
7306
|
+
}
|
|
7186
7307
|
}
|
|
7187
7308
|
},
|
|
7188
7309
|
MAP: {
|
|
@@ -7297,7 +7418,7 @@ const Cs = {}, _s = {
|
|
|
7297
7418
|
number2: { name: "number2", detail: "second" }
|
|
7298
7419
|
}
|
|
7299
7420
|
}
|
|
7300
|
-
},
|
|
7421
|
+
}, Fs = {
|
|
7301
7422
|
ADDRESS: {
|
|
7302
7423
|
description: "Returns a reference as text to a single cell in a worksheet",
|
|
7303
7424
|
abstract: "Returns a reference as text to a single cell in a worksheet",
|
|
@@ -7816,9 +7937,9 @@ const Cs = {}, _s = {
|
|
|
7816
7937
|
number2: { name: "number2", detail: "second" }
|
|
7817
7938
|
}
|
|
7818
7939
|
}
|
|
7819
|
-
},
|
|
7940
|
+
}, zs = {
|
|
7820
7941
|
ABS: {
|
|
7821
|
-
description: "Returns the absolute value of a number",
|
|
7942
|
+
description: "Returns the absolute value of a number. The absolute value of a number is the number without its sign.",
|
|
7822
7943
|
abstract: "Returns the absolute value of a number",
|
|
7823
7944
|
links: [
|
|
7824
7945
|
{
|
|
@@ -7827,12 +7948,11 @@ const Cs = {}, _s = {
|
|
|
7827
7948
|
}
|
|
7828
7949
|
],
|
|
7829
7950
|
functionParameter: {
|
|
7830
|
-
|
|
7831
|
-
number2: { name: "number2", detail: "second" }
|
|
7951
|
+
number: { name: "number", detail: "The real number of which you want the absolute value." }
|
|
7832
7952
|
}
|
|
7833
7953
|
},
|
|
7834
7954
|
ACOS: {
|
|
7835
|
-
description: "Returns the arccosine of a number",
|
|
7955
|
+
description: "Returns the arccosine, or inverse cosine, of a number. The arccosine is the angle whose cosine is number. The returned angle is given in radians in the range 0 (zero) to pi.",
|
|
7836
7956
|
abstract: "Returns the arccosine of a number",
|
|
7837
7957
|
links: [
|
|
7838
7958
|
{
|
|
@@ -7841,12 +7961,11 @@ const Cs = {}, _s = {
|
|
|
7841
7961
|
}
|
|
7842
7962
|
],
|
|
7843
7963
|
functionParameter: {
|
|
7844
|
-
|
|
7845
|
-
number2: { name: "number2", detail: "second" }
|
|
7964
|
+
number: { name: "number", detail: "The cosine of the angle you want and must be from -1 to 1." }
|
|
7846
7965
|
}
|
|
7847
7966
|
},
|
|
7848
7967
|
ACOSH: {
|
|
7849
|
-
description: "Returns the inverse hyperbolic cosine of a number",
|
|
7968
|
+
description: "Returns the inverse hyperbolic cosine of a number. The number must be greater than or equal to 1. The inverse hyperbolic cosine is the value whose hyperbolic cosine is number, so ACOSH(COSH(number)) equals number.",
|
|
7850
7969
|
abstract: "Returns the inverse hyperbolic cosine of a number",
|
|
7851
7970
|
links: [
|
|
7852
7971
|
{
|
|
@@ -7855,12 +7974,11 @@ const Cs = {}, _s = {
|
|
|
7855
7974
|
}
|
|
7856
7975
|
],
|
|
7857
7976
|
functionParameter: {
|
|
7858
|
-
|
|
7859
|
-
number2: { name: "number2", detail: "second" }
|
|
7977
|
+
number: { name: "number", detail: "Any real number equal to or greater than 1." }
|
|
7860
7978
|
}
|
|
7861
7979
|
},
|
|
7862
7980
|
ACOT: {
|
|
7863
|
-
description: "Returns the arccotangent of a number",
|
|
7981
|
+
description: "Returns the principal value of the arccotangent, or inverse cotangent, of a number.",
|
|
7864
7982
|
abstract: "Returns the arccotangent of a number",
|
|
7865
7983
|
links: [
|
|
7866
7984
|
{
|
|
@@ -7869,8 +7987,10 @@ const Cs = {}, _s = {
|
|
|
7869
7987
|
}
|
|
7870
7988
|
],
|
|
7871
7989
|
functionParameter: {
|
|
7872
|
-
|
|
7873
|
-
|
|
7990
|
+
number: {
|
|
7991
|
+
name: "number",
|
|
7992
|
+
detail: "Number is the cotangent of the angle you want. This must be a real number."
|
|
7993
|
+
}
|
|
7874
7994
|
}
|
|
7875
7995
|
},
|
|
7876
7996
|
ACOTH: {
|
|
@@ -8981,7 +9101,7 @@ const Cs = {}, _s = {
|
|
|
8981
9101
|
number2: { name: "number2", detail: "second" }
|
|
8982
9102
|
}
|
|
8983
9103
|
}
|
|
8984
|
-
},
|
|
9104
|
+
}, Us = {
|
|
8985
9105
|
AVEDEV: {
|
|
8986
9106
|
description: "Returns the average of the absolute deviations of data points from their mean",
|
|
8987
9107
|
abstract: "Returns the average of the absolute deviations of data points from their mean",
|
|
@@ -10567,7 +10687,7 @@ const Cs = {}, _s = {
|
|
|
10567
10687
|
number2: { name: "number2", detail: "second" }
|
|
10568
10688
|
}
|
|
10569
10689
|
}
|
|
10570
|
-
},
|
|
10690
|
+
}, Vs = {
|
|
10571
10691
|
ASC: {
|
|
10572
10692
|
description: "Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters",
|
|
10573
10693
|
abstract: "Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters",
|
|
@@ -11226,7 +11346,7 @@ const Cs = {}, _s = {
|
|
|
11226
11346
|
number2: { name: "number2", detail: "second" }
|
|
11227
11347
|
}
|
|
11228
11348
|
}
|
|
11229
|
-
},
|
|
11349
|
+
}, qs = {}, Hs = {
|
|
11230
11350
|
ENCODEURL: {
|
|
11231
11351
|
description: "Returns a URL-encoded string",
|
|
11232
11352
|
abstract: "Returns a URL-encoded string",
|
|
@@ -11269,7 +11389,7 @@ const Cs = {}, _s = {
|
|
|
11269
11389
|
number2: { name: "number2", detail: "second" }
|
|
11270
11390
|
}
|
|
11271
11391
|
}
|
|
11272
|
-
},
|
|
11392
|
+
}, Bo = {
|
|
11273
11393
|
formula: {
|
|
11274
11394
|
insert: {
|
|
11275
11395
|
tooltip: "Functions",
|
|
@@ -11281,21 +11401,21 @@ const Cs = {}, _s = {
|
|
|
11281
11401
|
more: "More Functions..."
|
|
11282
11402
|
},
|
|
11283
11403
|
functionList: {
|
|
11284
|
-
...Ns,
|
|
11285
|
-
...Ts,
|
|
11286
|
-
...ws,
|
|
11287
|
-
...Fs,
|
|
11288
11404
|
...xs,
|
|
11289
|
-
...
|
|
11405
|
+
...Ms,
|
|
11406
|
+
...zs,
|
|
11407
|
+
...Us,
|
|
11408
|
+
...Fs,
|
|
11409
|
+
...Ns,
|
|
11410
|
+
...Vs,
|
|
11290
11411
|
...Ls,
|
|
11412
|
+
...ws,
|
|
11291
11413
|
...Os,
|
|
11292
|
-
...Ms,
|
|
11293
11414
|
...As,
|
|
11294
|
-
...
|
|
11295
|
-
...
|
|
11296
|
-
...
|
|
11297
|
-
...
|
|
11298
|
-
...zs
|
|
11415
|
+
...Ts,
|
|
11416
|
+
...Hs,
|
|
11417
|
+
...ys,
|
|
11418
|
+
...qs
|
|
11299
11419
|
},
|
|
11300
11420
|
prompt: {
|
|
11301
11421
|
helpExample: "EXAMPLE",
|
|
@@ -11332,7 +11452,7 @@ const Cs = {}, _s = {
|
|
|
11332
11452
|
pasteFormula: "Paste Formula"
|
|
11333
11453
|
}
|
|
11334
11454
|
}
|
|
11335
|
-
},
|
|
11455
|
+
}, $s = {}, js = {
|
|
11336
11456
|
BETADIST: {
|
|
11337
11457
|
description: "返回 beta 累积分布函数",
|
|
11338
11458
|
abstract: "返回 beta 累积分布函数",
|
|
@@ -11907,7 +12027,7 @@ const Cs = {}, _s = {
|
|
|
11907
12027
|
number2: { name: "number2", detail: "second" }
|
|
11908
12028
|
}
|
|
11909
12029
|
}
|
|
11910
|
-
},
|
|
12030
|
+
}, Ws = {
|
|
11911
12031
|
CUBEKPIMEMBER: {
|
|
11912
12032
|
description: "返回重要性能指示器 (KPI) 属性,并在单元格中显示 KPI 名称。 KPI 是一种用于监控单位绩效的可计量度量值,如每月总利润或季度员工调整。",
|
|
11913
12033
|
abstract: "返回重要性能指示器 (KPI) 属性,并在单元格中显示 KPI 名称。 KPI 是一种用于监控单位绩效的可计量度量值,如每月总利润或季度员工调整。",
|
|
@@ -12006,7 +12126,7 @@ const Cs = {}, _s = {
|
|
|
12006
12126
|
number2: { name: "number2", detail: "second" }
|
|
12007
12127
|
}
|
|
12008
12128
|
}
|
|
12009
|
-
},
|
|
12129
|
+
}, Gs = {
|
|
12010
12130
|
DAVERAGE: {
|
|
12011
12131
|
description: "返回所选数据库条目的平均值",
|
|
12012
12132
|
abstract: "返回所选数据库条目的平均值",
|
|
@@ -12175,7 +12295,7 @@ const Cs = {}, _s = {
|
|
|
12175
12295
|
number2: { name: "number2", detail: "second" }
|
|
12176
12296
|
}
|
|
12177
12297
|
}
|
|
12178
|
-
},
|
|
12298
|
+
}, Ks = {
|
|
12179
12299
|
DATE: {
|
|
12180
12300
|
description: "返回特定日期的序列号",
|
|
12181
12301
|
abstract: "返回特定日期的序列号",
|
|
@@ -12526,7 +12646,7 @@ const Cs = {}, _s = {
|
|
|
12526
12646
|
number2: { name: "number2", detail: "second" }
|
|
12527
12647
|
}
|
|
12528
12648
|
}
|
|
12529
|
-
},
|
|
12649
|
+
}, Ys = {
|
|
12530
12650
|
BESSELI: {
|
|
12531
12651
|
description: "返回修正的贝赛耳函数 In(x)",
|
|
12532
12652
|
abstract: "返回修正的贝赛耳函数 In(x)",
|
|
@@ -13283,7 +13403,7 @@ const Cs = {}, _s = {
|
|
|
13283
13403
|
number2: { name: "number2", detail: "second" }
|
|
13284
13404
|
}
|
|
13285
13405
|
}
|
|
13286
|
-
},
|
|
13406
|
+
}, Xs = {
|
|
13287
13407
|
ACCRINT: {
|
|
13288
13408
|
description: "返回定期支付利息的债券的应计利息",
|
|
13289
13409
|
abstract: "返回定期支付利息的债券的应计利息",
|
|
@@ -14054,7 +14174,7 @@ const Cs = {}, _s = {
|
|
|
14054
14174
|
number2: { name: "number2", detail: "second" }
|
|
14055
14175
|
}
|
|
14056
14176
|
}
|
|
14057
|
-
},
|
|
14177
|
+
}, Qs = {
|
|
14058
14178
|
CELL: {
|
|
14059
14179
|
description: "返回有关单元格格式、位置或内容的信息",
|
|
14060
14180
|
abstract: "返回有关单元格格式、位置或内容的信息",
|
|
@@ -14349,7 +14469,7 @@ const Cs = {}, _s = {
|
|
|
14349
14469
|
number2: { name: "number2", detail: "second" }
|
|
14350
14470
|
}
|
|
14351
14471
|
}
|
|
14352
|
-
},
|
|
14472
|
+
}, Js = {
|
|
14353
14473
|
AND: {
|
|
14354
14474
|
description: "如果其所有参数均为 TRUE,则返回 TRUE",
|
|
14355
14475
|
abstract: "如果其所有参数均为 TRUE,则返回 TRUE",
|
|
@@ -14500,8 +14620,12 @@ const Cs = {}, _s = {
|
|
|
14500
14620
|
}
|
|
14501
14621
|
],
|
|
14502
14622
|
functionParameter: {
|
|
14503
|
-
number1: { name: "
|
|
14504
|
-
number2: { name: "
|
|
14623
|
+
number1: { name: "rows", detail: "数组中的行数。 必须大于零" },
|
|
14624
|
+
number2: { name: "cols", detail: "数组中的列数。 必须大于零" },
|
|
14625
|
+
value3: {
|
|
14626
|
+
name: "lambda",
|
|
14627
|
+
detail: "调用 LAMBDA 来创建数组。 LAMBDA 接受两个参数:row数组的行索引, col数组的列索引"
|
|
14628
|
+
}
|
|
14505
14629
|
}
|
|
14506
14630
|
},
|
|
14507
14631
|
MAP: {
|
|
@@ -14616,7 +14740,7 @@ const Cs = {}, _s = {
|
|
|
14616
14740
|
number2: { name: "number2", detail: "second" }
|
|
14617
14741
|
}
|
|
14618
14742
|
}
|
|
14619
|
-
},
|
|
14743
|
+
}, Zs = {
|
|
14620
14744
|
ADDRESS: {
|
|
14621
14745
|
description: "以文本形式将引用值返回到工作表的单个单元格",
|
|
14622
14746
|
abstract: "以文本形式将引用值返回到工作表的单个单元格",
|
|
@@ -15135,9 +15259,9 @@ const Cs = {}, _s = {
|
|
|
15135
15259
|
number2: { name: "number2", detail: "second" }
|
|
15136
15260
|
}
|
|
15137
15261
|
}
|
|
15138
|
-
},
|
|
15262
|
+
}, eo = {
|
|
15139
15263
|
ABS: {
|
|
15140
|
-
description: "
|
|
15264
|
+
description: "返回数字的绝对值。一个数字的绝对值是该数字不带其符号的形式。",
|
|
15141
15265
|
abstract: "返回数字的绝对值",
|
|
15142
15266
|
links: [
|
|
15143
15267
|
{
|
|
@@ -15146,12 +15270,11 @@ const Cs = {}, _s = {
|
|
|
15146
15270
|
}
|
|
15147
15271
|
],
|
|
15148
15272
|
functionParameter: {
|
|
15149
|
-
|
|
15150
|
-
number2: { name: "number2", detail: "second" }
|
|
15273
|
+
number: { name: "数值", detail: "需要计算其绝对值的实数。" }
|
|
15151
15274
|
}
|
|
15152
15275
|
},
|
|
15153
15276
|
ACOS: {
|
|
15154
|
-
description: "
|
|
15277
|
+
description: "返回数字的反余弦值。 反余弦值是指余弦值为 number 的角度。 返回的角度以弧度表示,弧度值在 0(零)到 pi 之间。",
|
|
15155
15278
|
abstract: "返回数字的反余弦值",
|
|
15156
15279
|
links: [
|
|
15157
15280
|
{
|
|
@@ -15160,12 +15283,11 @@ const Cs = {}, _s = {
|
|
|
15160
15283
|
}
|
|
15161
15284
|
],
|
|
15162
15285
|
functionParameter: {
|
|
15163
|
-
|
|
15164
|
-
number2: { name: "number2", detail: "second" }
|
|
15286
|
+
number: { name: "数值", detail: "所求角度的余弦值,必须介于 -1 到 1 之间。" }
|
|
15165
15287
|
}
|
|
15166
15288
|
},
|
|
15167
15289
|
ACOSH: {
|
|
15168
|
-
description: "
|
|
15290
|
+
description: "返回数字的反双曲余弦值。 该数字必须大于或等于 1。 反双曲余弦值是指双曲余弦值为 number 的值,因此 ACOSH(COSH(number)) 等于 number。",
|
|
15169
15291
|
abstract: "返回数字的反双曲余弦值",
|
|
15170
15292
|
links: [
|
|
15171
15293
|
{
|
|
@@ -15174,12 +15296,11 @@ const Cs = {}, _s = {
|
|
|
15174
15296
|
}
|
|
15175
15297
|
],
|
|
15176
15298
|
functionParameter: {
|
|
15177
|
-
|
|
15178
|
-
number2: { name: "number2", detail: "second" }
|
|
15299
|
+
number: { name: "数值", detail: "大于或等于 1 的任意实数。" }
|
|
15179
15300
|
}
|
|
15180
15301
|
},
|
|
15181
15302
|
ACOT: {
|
|
15182
|
-
description: "
|
|
15303
|
+
description: "返回数字的反余切值的主值。",
|
|
15183
15304
|
abstract: "返回一个数的反余切值",
|
|
15184
15305
|
links: [
|
|
15185
15306
|
{
|
|
@@ -15188,8 +15309,7 @@ const Cs = {}, _s = {
|
|
|
15188
15309
|
}
|
|
15189
15310
|
],
|
|
15190
15311
|
functionParameter: {
|
|
15191
|
-
|
|
15192
|
-
number2: { name: "number2", detail: "second" }
|
|
15312
|
+
number: { name: "数值", detail: "Number 是需要的角度的正切值。 这必须是实数。" }
|
|
15193
15313
|
}
|
|
15194
15314
|
},
|
|
15195
15315
|
ACOTH: {
|
|
@@ -16300,7 +16420,7 @@ const Cs = {}, _s = {
|
|
|
16300
16420
|
number2: { name: "number2", detail: "second" }
|
|
16301
16421
|
}
|
|
16302
16422
|
}
|
|
16303
|
-
},
|
|
16423
|
+
}, to = {
|
|
16304
16424
|
AVEDEV: {
|
|
16305
16425
|
description: "返回数据点与它们的平均值的绝对偏差平均值",
|
|
16306
16426
|
abstract: "返回数据点与它们的平均值的绝对偏差平均值",
|
|
@@ -17886,7 +18006,7 @@ const Cs = {}, _s = {
|
|
|
17886
18006
|
number2: { name: "number2", detail: "second" }
|
|
17887
18007
|
}
|
|
17888
18008
|
}
|
|
17889
|
-
},
|
|
18009
|
+
}, no = {
|
|
17890
18010
|
ASC: {
|
|
17891
18011
|
description: "将字符串中的全角(双字节)英文字母或片假名更改为半角(单字节)字符",
|
|
17892
18012
|
abstract: "将字符串中的全角(双字节)英文字母或片假名更改为半角(单字节)字符",
|
|
@@ -18545,7 +18665,7 @@ const Cs = {}, _s = {
|
|
|
18545
18665
|
number2: { name: "number2", detail: "second" }
|
|
18546
18666
|
}
|
|
18547
18667
|
}
|
|
18548
|
-
},
|
|
18668
|
+
}, ro = {}, io = {
|
|
18549
18669
|
ENCODEURL: {
|
|
18550
18670
|
description: "返回 URL 编码的字符串",
|
|
18551
18671
|
abstract: "返回 URL 编码的字符串",
|
|
@@ -18588,7 +18708,7 @@ const Cs = {}, _s = {
|
|
|
18588
18708
|
number2: { name: "number2", detail: "second" }
|
|
18589
18709
|
}
|
|
18590
18710
|
}
|
|
18591
|
-
},
|
|
18711
|
+
}, ao = {
|
|
18592
18712
|
formula: {
|
|
18593
18713
|
insert: {
|
|
18594
18714
|
tooltip: "函数",
|
|
@@ -18600,21 +18720,21 @@ const Cs = {}, _s = {
|
|
|
18600
18720
|
more: "更多函数..."
|
|
18601
18721
|
},
|
|
18602
18722
|
functionList: {
|
|
18723
|
+
...Xs,
|
|
18724
|
+
...Ks,
|
|
18725
|
+
...eo,
|
|
18726
|
+
...to,
|
|
18727
|
+
...Zs,
|
|
18603
18728
|
...Gs,
|
|
18604
|
-
...
|
|
18605
|
-
...Qs,
|
|
18729
|
+
...no,
|
|
18606
18730
|
...Js,
|
|
18731
|
+
...Qs,
|
|
18607
18732
|
...Ys,
|
|
18608
|
-
...$s,
|
|
18609
|
-
...Zs,
|
|
18610
|
-
...Ks,
|
|
18611
|
-
...Xs,
|
|
18612
18733
|
...Ws,
|
|
18613
|
-
...
|
|
18614
|
-
...
|
|
18615
|
-
|
|
18616
|
-
...
|
|
18617
|
-
...eo
|
|
18734
|
+
...js,
|
|
18735
|
+
...io,
|
|
18736
|
+
...$s,
|
|
18737
|
+
...ro
|
|
18618
18738
|
},
|
|
18619
18739
|
prompt: {
|
|
18620
18740
|
helpExample: "示例",
|
|
@@ -18652,57 +18772,57 @@ const Cs = {}, _s = {
|
|
|
18652
18772
|
}
|
|
18653
18773
|
}
|
|
18654
18774
|
};
|
|
18655
|
-
var
|
|
18656
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
18775
|
+
var so = Object.defineProperty, oo = Object.getOwnPropertyDescriptor, co = (i, e, t, n) => {
|
|
18776
|
+
for (var r = n > 1 ? void 0 : n ? oo(e, t) : e, a = i.length - 1, s; a >= 0; a--)
|
|
18657
18777
|
(s = i[a]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
18658
|
-
return n && r &&
|
|
18659
|
-
},
|
|
18660
|
-
let
|
|
18778
|
+
return n && r && so(e, t, r), r;
|
|
18779
|
+
}, Et = (i, e) => (t, n) => e(t, n, i), Rt;
|
|
18780
|
+
let an = (Rt = class extends er {
|
|
18661
18781
|
constructor(i, e, t, n) {
|
|
18662
|
-
super(
|
|
18782
|
+
super(An), this._config = i, this._injector = e, this._localeService = t, this._currentUniverService = n;
|
|
18663
18783
|
}
|
|
18664
18784
|
initialize() {
|
|
18665
18785
|
this._localeService.load({
|
|
18666
|
-
zhCN:
|
|
18786
|
+
zhCN: ao
|
|
18667
18787
|
}), [
|
|
18668
18788
|
// services
|
|
18669
|
-
[de, { useClass:
|
|
18670
|
-
[
|
|
18789
|
+
[de, { useClass: gi }],
|
|
18790
|
+
[Ne, { useClass: pi }],
|
|
18671
18791
|
[
|
|
18672
|
-
|
|
18792
|
+
Ft,
|
|
18673
18793
|
{
|
|
18674
18794
|
useFactory: () => {
|
|
18675
18795
|
var e;
|
|
18676
|
-
return this._injector.createInstance(
|
|
18796
|
+
return this._injector.createInstance(kt, ((e = this._config) == null ? void 0 : e.description) || []);
|
|
18677
18797
|
}
|
|
18678
18798
|
// TODO@Dusuhir: initialize config with asynchronous method?
|
|
18679
18799
|
}
|
|
18680
18800
|
],
|
|
18681
|
-
[
|
|
18801
|
+
[xt, { useClass: Xr }],
|
|
18682
18802
|
// controllers
|
|
18803
|
+
[Ye],
|
|
18683
18804
|
[Xe],
|
|
18684
18805
|
[Ke],
|
|
18685
|
-
[Ge],
|
|
18686
|
-
[$e],
|
|
18687
18806
|
[je],
|
|
18688
|
-
[He],
|
|
18689
|
-
[Ye],
|
|
18690
|
-
[Qe],
|
|
18691
18807
|
[We],
|
|
18692
|
-
[
|
|
18808
|
+
[$e],
|
|
18809
|
+
[Qe],
|
|
18810
|
+
[Je],
|
|
18811
|
+
[Ge],
|
|
18812
|
+
[He]
|
|
18693
18813
|
].forEach((e) => this._injector.add(e));
|
|
18694
18814
|
}
|
|
18695
18815
|
onReady() {
|
|
18696
18816
|
this.initialize();
|
|
18697
18817
|
}
|
|
18698
|
-
}, k(
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
],
|
|
18818
|
+
}, k(Rt, "type", tr.Sheet), Rt);
|
|
18819
|
+
an = co([
|
|
18820
|
+
Et(1, y(tt)),
|
|
18821
|
+
Et(2, y(De)),
|
|
18822
|
+
Et(3, Ie)
|
|
18823
|
+
], an);
|
|
18704
18824
|
export {
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18825
|
+
an as UniverSheetsFormulaPlugin,
|
|
18826
|
+
Bo as enUS,
|
|
18827
|
+
ao as zhCN
|
|
18708
18828
|
};
|