@univerjs/sheets-formula-ui 0.7.0 → 0.8.0-beta.0
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 +7 -7
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1434 -1359
- package/lib/es/locale/en-US.js +5 -0
- package/lib/es/locale/fa-IR.js +5 -0
- package/lib/es/locale/fr-FR.js +5 -0
- package/lib/es/locale/ru-RU.js +5 -0
- package/lib/es/locale/vi-VN.js +5 -0
- package/lib/es/locale/zh-CN.js +5 -0
- package/lib/es/locale/zh-TW.js +5 -0
- package/lib/index.css +1 -1
- package/lib/index.js +1434 -1359
- package/lib/locale/en-US.js +5 -0
- package/lib/locale/fa-IR.js +5 -0
- package/lib/locale/fr-FR.js +5 -0
- package/lib/locale/ru-RU.js +5 -0
- package/lib/locale/vi-VN.js +5 -0
- package/lib/locale/zh-CN.js +5 -0
- package/lib/locale/zh-TW.js +5 -0
- package/lib/types/controllers/menu.d.ts +6 -0
- package/lib/types/controllers/shortcuts/quick-sum.shortcut.d.ts +2 -0
- package/lib/types/locale/en-US.d.ts +5 -0
- package/lib/types/locale/fa-IR.d.ts +5 -0
- package/lib/types/locale/fr-FR.d.ts +5 -0
- package/lib/types/locale/ru-RU.d.ts +5 -0
- package/lib/types/locale/vi-VN.d.ts +5 -0
- package/lib/types/locale/zh-CN.d.ts +5 -0
- package/lib/types/locale/zh-TW.d.ts +5 -0
- package/lib/umd/index.js +7 -7
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var j = (e, t, n) =>
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { SheetPasteCommand as
|
|
6
|
-
import { sequenceNodeType as
|
|
7
|
-
import { Subject as
|
|
8
|
-
import { IEditorService as
|
|
9
|
-
import { DeviceInputEventType as
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as O, jsxs as
|
|
14
|
-
import { clsx as
|
|
15
|
-
import { forwardRef as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
1
|
+
var Vr = Object.defineProperty;
|
|
2
|
+
var Wr = (e, t, n) => t in e ? Vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var j = (e, t, n) => Wr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { CommandType as Te, ICommandService as ue, createIdentifier as Hr, IContextService as rn, IUniverInstanceService as ee, Rectangle as Kn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as on, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yn, DEFAULT_EMPTY_DOCUMENT_VALUE as Gn, isRealNum as Br, CellValueType as En, getCellValueType as jr, LocaleService as at, Tools as it, Inject as B, Injector as Ct, ThemeService as _t, toDisposable as zn, DisposableCollection as He, RANGE_TYPE as Se, UniverInstanceType as q, ColorKit as sn, getBodySlice as bn, Direction as ce, EDITOR_ACTIVATED as Tt, createInternalEditorID as qr, generateRandomId as Kr, BuildTextUtils as Yr, RichTextBuilder as Gr, Disposable as lt, ObjectMatrix as Fe, Range as zr, isFormulaString as ye, isFormulaId as Be, FOCUSING_DOC as Zr, FOCUSING_UNIVER_EDITOR as Xr, isICellData as Qr, ILogService as Jr, RxDisposable as eo, InterceptorEffectEnum as to, DependentOn as no, IConfigService as ro, Plugin as oo, merge as so, registerDependencies as io, touchDependencies as co } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as ot, IEditorBridgeService as cn, SetCellEditVisibleOperation as Zn, SheetSkeletonManagerService as Vt, BaseSelectionRenderService as lo, getCoordByOffset as In, checkInHeaderRanges as yn, getAllSelection as uo, genNormalSelectionStyle as Xn, getSheetObject as ho, attachSelectionWithCoord as Xt, SelectionControl as Qn, MoveSelectionCommand as Tn, JumpOver as xn, ExpandSelectionCommand as On, EMBEDDING_FORMULA_EDITOR as fo, IMarkSelectionService as go, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as So, IAutoFillService as vo, APPLY_TYPE as Co, DATA_TYPE as Nn, ISheetClipboardService as _o, COPY_TYPE as Jn, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Eo, getCurrentRangeDisable$ as je, PASTE_SPECIAL_MENU_ID as bo, whenFormulaEditorActivated as Rt, whenSheetEditorFocused as Io, SheetsUIPart as yo, RANGE_SELECTOR_COMPONENT_KEY as To, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as xo } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Z, serializeRange as ve, LexerTreeBuilder as _e, deserializeRangeWithSheetWithCache as Oo, matchRefDrawToken as No, isFormulaLexerToken as Mo, matchToken as ct, deserializeRangeWithSheet as ut, serializeRangeToRefString as wo, serializeRangeWithSheet as St, generateStringWithSequence as Ao, operatorToken as er, FormulaDataModel as Et, ERROR_TYPE_SET as ko, ErrorType as ie, SetFormulaCalculationResultMutation as Fo, SetArrayFormulaDataMutation as Do, SetFormulaCalculationStopMutation as Lo, FunctionType as $o, UniverFormulaEnginePlugin as Po } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as ft, BehaviorSubject as tr, throttleTime as Uo, debounceTime as an, filter as Qt, map as nr, distinctUntilChanged as Vo, merge as Wo, combineLatestWith as Ho, switchMap as Bo, of as Mn, Observable as jo } from "rxjs";
|
|
8
|
+
import { IEditorService as qe, DocSelectionRenderService as rr, ReplaceTextRunsCommand as wn, MoveSelectionOperation as qo, MoveCursorOperation as Ko, useKeyboardEvent as Yo, useResize as Go, DocBackScrollRenderController as zo, RichTextEditor as Zo } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as xe, ScrollTimerType as Yt, SHEET_VIEWPORT_KEY as An, Vector2 as kn, IRenderManagerService as Oe } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as ln, getSheetCommandTarget as or, getCellAtRowCol as Xo, SetSelectionsOperation as un, IRefSelectionsService as Wt, SelectionMoveType as Gt, convertSelectionDataToRange as Qo, setEndForRange as Jo, REF_SELECTIONS_ENABLED as Fn, SetWorksheetActiveOperation as Dn, SheetInterceptorService as dn, ReorderRangeCommand as es, SetRangeValuesMutation as Mt, SetRangeValuesUndoMutationFactory as ts, BEFORE_CELL_EDIT as ns, SetWorksheetRowAutoHeightMutation as rs, INTERCEPTOR_POINT as os, WorksheetSetCellValuePermission as Ke, WorksheetEditPermission as Ye, RangeProtectionPermissionEditPoint as Ge, WorkbookEditablePermission as ze } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as ss, IDescriptionService as Ht, TriggerCalculationController as is, QuickSumCommand as cs, UniverSheetsFormulaPlugin as as } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as hn, useDependency as T, useEvent as J, useObservable as Ce, RectPopup as Jt, IShortcutService as Bt, KeyCode as D, MetaKeys as P, IContextMenuService as ls, useUpdateEffect as us, IZenZoneService as ds, ProgressBar as hs, MenuItemType as Ze, getMenuHiddenObservable as dt, IClipboardInterfaceService as Ln, RibbonFormulasGroup as $n, IMenuManagerService as fs, IUIPartsService as sr, ComponentManager as ir, connectInjector as cr, BuiltInUIPart as gs } from "@univerjs/ui";
|
|
13
|
+
import { jsx as O, jsxs as W, Fragment as ms } from "react/jsx-runtime";
|
|
14
|
+
import { clsx as fe, borderTopClassName as ps, borderClassName as fn, scrollbarClassName as ar, Tooltip as Ss, Dialog as vs, Input as lr, Button as st, borderLeftClassName as Cs, Select as _s } from "@univerjs/design";
|
|
15
|
+
import { forwardRef as Ne, useRef as G, createElement as Xe, useEffect as $, useMemo as oe, useState as V, useCallback as wt, useLayoutEffect as At, useImperativeHandle as Rs } from "react";
|
|
16
|
+
import { DocSelectionManagerService as ur } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as Es } from "rxjs/operators";
|
|
18
|
+
const gn = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
|
-
type:
|
|
21
|
-
handler: async (e) => e.get(ue).executeCommand(
|
|
22
|
-
value:
|
|
20
|
+
type: Te.COMMAND,
|
|
21
|
+
handler: async (e) => e.get(ue).executeCommand(ao.id, {
|
|
22
|
+
value: ot.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
|
-
},
|
|
24
|
+
}, ht = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
|
-
type:
|
|
26
|
+
type: Te.OPERATION,
|
|
27
27
|
handler: (e, t) => !0
|
|
28
28
|
};
|
|
29
|
-
var
|
|
30
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
29
|
+
var bs = Object.getOwnPropertyDescriptor, Is = (e, t, n, o) => {
|
|
30
|
+
for (var r = o > 1 ? void 0 : o ? bs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
31
31
|
(c = e[s]) && (r = c(r) || r);
|
|
32
32
|
return r;
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
let
|
|
33
|
+
}, ys = (e, t) => (n, o) => t(n, o, e);
|
|
34
|
+
const Ts = "FORMULA_PROMPT_ACTIVATED", mn = Hr("formula-ui.prompt-service");
|
|
35
|
+
let en = class {
|
|
36
36
|
constructor(e) {
|
|
37
|
-
j(this, "_search$", new
|
|
38
|
-
j(this, "_help$", new
|
|
39
|
-
j(this, "_navigate$", new
|
|
40
|
-
j(this, "_accept$", new
|
|
41
|
-
j(this, "_acceptFormulaName$", new
|
|
37
|
+
j(this, "_search$", new ft());
|
|
38
|
+
j(this, "_help$", new ft());
|
|
39
|
+
j(this, "_navigate$", new ft());
|
|
40
|
+
j(this, "_accept$", new ft());
|
|
41
|
+
j(this, "_acceptFormulaName$", new ft());
|
|
42
42
|
j(this, "search$", this._search$.asObservable());
|
|
43
43
|
j(this, "help$", this._help$.asObservable());
|
|
44
44
|
j(this, "navigate$", this._navigate$.asObservable());
|
|
@@ -55,7 +55,7 @@ let Kt = class {
|
|
|
55
55
|
this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
|
|
56
56
|
}
|
|
57
57
|
search(e) {
|
|
58
|
-
this._contextService.setContextValue(
|
|
58
|
+
this._contextService.setContextValue(Ts, e.visible), this._searching = e.visible, this._search$.next(e);
|
|
59
59
|
}
|
|
60
60
|
isSearching() {
|
|
61
61
|
return this._searching;
|
|
@@ -117,7 +117,7 @@ let Kt = class {
|
|
|
117
117
|
*/
|
|
118
118
|
updateSequenceRef(e, t) {
|
|
119
119
|
const n = this._sequenceNodes[e];
|
|
120
|
-
if (typeof n == "string" || n.nodeType !==
|
|
120
|
+
if (typeof n == "string" || n.nodeType !== Z.REFERENCE)
|
|
121
121
|
return;
|
|
122
122
|
const o = t.length - n.token.length, r = { ...n };
|
|
123
123
|
r.token = t, r.endIndex += o, this._sequenceNodes[e] = r;
|
|
@@ -125,8 +125,8 @@ let Kt = class {
|
|
|
125
125
|
const i = this._sequenceNodes[s];
|
|
126
126
|
if (typeof i == "string")
|
|
127
127
|
continue;
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const l = { ...i };
|
|
129
|
+
l.startIndex += o, l.endIndex += o, this._sequenceNodes[s] = l;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -141,7 +141,7 @@ let Kt = class {
|
|
|
141
141
|
token: t,
|
|
142
142
|
startIndex: e,
|
|
143
143
|
endIndex: e + n - 1,
|
|
144
|
-
nodeType:
|
|
144
|
+
nodeType: Z.REFERENCE
|
|
145
145
|
});
|
|
146
146
|
for (let r = o + 1, s = this._sequenceNodes.length; r < s; r++) {
|
|
147
147
|
const c = this._sequenceNodes[r];
|
|
@@ -164,8 +164,8 @@ let Kt = class {
|
|
|
164
164
|
const i = this._sequenceNodes[s];
|
|
165
165
|
if (typeof i == "string")
|
|
166
166
|
continue;
|
|
167
|
-
const
|
|
168
|
-
|
|
167
|
+
const l = { ...i };
|
|
168
|
+
l.startIndex += r, l.endIndex += r, this._sequenceNodes[s] = l;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
enableLockedSelectionChange() {
|
|
@@ -187,130 +187,130 @@ let Kt = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
const
|
|
190
|
+
en = Is([
|
|
191
|
+
ys(0, rn)
|
|
192
|
+
], en);
|
|
193
|
+
const xs = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
|
-
type:
|
|
196
|
-
handler: async (e, t) => (e.get(
|
|
197
|
-
},
|
|
195
|
+
type: Te.OPERATION,
|
|
196
|
+
handler: async (e, t) => (e.get(mn).help(t), !0)
|
|
197
|
+
}, he = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
|
-
type:
|
|
199
|
+
type: Te.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (e, t) => {
|
|
202
|
-
var
|
|
203
|
-
const n = e.get(
|
|
202
|
+
var v, _;
|
|
203
|
+
const n = e.get(ln), o = e.get(qe), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
|
-
const s =
|
|
206
|
+
const s = or(e.get(ee));
|
|
207
207
|
if (!s) return !1;
|
|
208
|
-
const { worksheet: c, unitId: i, subUnitId:
|
|
209
|
-
e.get(
|
|
208
|
+
const { worksheet: c, unitId: i, subUnitId: l } = s, f = c.getCellMatrix(), { value: h } = t, m = e.get(ue);
|
|
209
|
+
e.get(cn);
|
|
210
210
|
const u = [], d = [];
|
|
211
|
-
let
|
|
212
|
-
if (r.length === 1 && (
|
|
213
|
-
const { range: R, primary: C } = r[0], y = (
|
|
214
|
-
|
|
215
|
-
const k =
|
|
216
|
-
k && (
|
|
211
|
+
let a = null, S = 0, g = 0, p = "";
|
|
212
|
+
if (r.length === 1 && (Ms(r[0].range) || ws(r[0].range) && Un(f, r[0].range))) {
|
|
213
|
+
const { range: R, primary: C } = r[0], y = (v = C == null ? void 0 : C.actualRow) != null ? v : R.startRow, N = (_ = C == null ? void 0 : C.actualColumn) != null ? _ : R.startColumn;
|
|
214
|
+
a = R, S = y, g = N;
|
|
215
|
+
const k = Pn(f, y, N);
|
|
216
|
+
k && (p = ve(k));
|
|
217
217
|
} else
|
|
218
218
|
r.some((R) => {
|
|
219
219
|
var N, k;
|
|
220
220
|
const { range: C, primary: y } = R;
|
|
221
|
-
if (
|
|
222
|
-
const F = (N = y == null ? void 0 : y.actualRow) != null ? N : C.startRow, x = (k = y == null ? void 0 : y.actualColumn) != null ? k : C.startColumn, w =
|
|
221
|
+
if (Un(f, C)) {
|
|
222
|
+
const F = (N = y == null ? void 0 : y.actualRow) != null ? N : C.startRow, x = (k = y == null ? void 0 : y.actualColumn) != null ? k : C.startColumn, w = Pn(f, F, x);
|
|
223
223
|
if (!w)
|
|
224
|
-
return
|
|
225
|
-
const M =
|
|
224
|
+
return a = C, S = F, g = x, !0;
|
|
225
|
+
const M = ve(w), b = `=${h}(${M})`;
|
|
226
226
|
u.push({
|
|
227
227
|
range: C,
|
|
228
228
|
primary: {
|
|
229
229
|
row: F,
|
|
230
230
|
column: x
|
|
231
231
|
},
|
|
232
|
-
formula:
|
|
232
|
+
formula: b
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
235
|
const { startRow: F, startColumn: x, endRow: w, endColumn: M } = C;
|
|
236
236
|
if (F === w) {
|
|
237
|
-
const
|
|
237
|
+
const b = As(f, F, M, c.getColumnCount() - 1), E = b === M ? M - 1 : M, I = ve({
|
|
238
238
|
startRow: F,
|
|
239
239
|
endRow: w,
|
|
240
240
|
startColumn: x,
|
|
241
|
-
endColumn:
|
|
241
|
+
endColumn: E
|
|
242
242
|
}), A = `=${h}(${I})`;
|
|
243
243
|
d.push({
|
|
244
244
|
range: C,
|
|
245
245
|
primary: {
|
|
246
246
|
row: F,
|
|
247
|
-
column:
|
|
247
|
+
column: b
|
|
248
248
|
},
|
|
249
249
|
formula: A
|
|
250
250
|
});
|
|
251
251
|
} else {
|
|
252
|
-
let
|
|
252
|
+
let b = -1;
|
|
253
253
|
for (let I = x; I <= M; I++) {
|
|
254
|
-
const A =
|
|
255
|
-
|
|
254
|
+
const A = ks(f, I, w, c.getRowCount() - 1);
|
|
255
|
+
b = Math.max(b, A);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const E = b === w ? w - 1 : w;
|
|
258
258
|
for (let I = x; I <= M; I++) {
|
|
259
|
-
const A =
|
|
259
|
+
const A = ve({
|
|
260
260
|
startRow: F,
|
|
261
|
-
endRow:
|
|
261
|
+
endRow: E,
|
|
262
262
|
startColumn: I,
|
|
263
263
|
endColumn: I
|
|
264
|
-
}),
|
|
264
|
+
}), L = `=${h}(${A})`;
|
|
265
265
|
d.push({
|
|
266
266
|
range: C,
|
|
267
267
|
primary: {
|
|
268
|
-
row:
|
|
268
|
+
row: b,
|
|
269
269
|
column: I
|
|
270
270
|
},
|
|
271
|
-
formula:
|
|
271
|
+
formula: L
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
|
-
if (
|
|
279
|
-
const R =
|
|
280
|
-
range:
|
|
278
|
+
if (a) {
|
|
279
|
+
const R = Xo(S, g, c), C = {
|
|
280
|
+
range: Kn.clone(a),
|
|
281
281
|
primary: {
|
|
282
282
|
startRow: R.startRow,
|
|
283
283
|
startColumn: R.startColumn,
|
|
284
284
|
endRow: R.endRow,
|
|
285
285
|
endColumn: R.endColumn,
|
|
286
|
-
actualRow:
|
|
286
|
+
actualRow: S,
|
|
287
287
|
actualColumn: g,
|
|
288
288
|
isMerged: R.isMerged,
|
|
289
|
-
isMergedMainCell: R.startRow ===
|
|
289
|
+
isMergedMainCell: R.startRow === S && R.startColumn === g
|
|
290
290
|
}
|
|
291
291
|
}, y = {
|
|
292
292
|
unitId: i,
|
|
293
|
-
subUnitId:
|
|
293
|
+
subUnitId: l,
|
|
294
294
|
selections: [C]
|
|
295
295
|
};
|
|
296
|
-
await m.executeCommand(
|
|
297
|
-
const N = o.getEditor(
|
|
298
|
-
m.syncExecuteCommand(
|
|
296
|
+
await m.executeCommand(un.id, y);
|
|
297
|
+
const N = o.getEditor(on), k = o.getEditor(Yn);
|
|
298
|
+
m.syncExecuteCommand(Zn.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: i,
|
|
301
|
-
eventType:
|
|
301
|
+
eventType: xe.Dblclick
|
|
302
302
|
});
|
|
303
|
-
const F = `=${h}(${
|
|
303
|
+
const F = `=${h}(${p}`;
|
|
304
304
|
N == null || N.replaceText(F), k == null || k.replaceText(F, !1);
|
|
305
305
|
}
|
|
306
|
-
return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(
|
|
306
|
+
return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(ss.id, {
|
|
307
307
|
list: u,
|
|
308
308
|
listOfRangeHasNumber: d
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
function
|
|
313
|
-
const o =
|
|
312
|
+
function Pn(e, t, n) {
|
|
313
|
+
const o = Os(e, t, n);
|
|
314
314
|
if (o !== t)
|
|
315
315
|
return {
|
|
316
316
|
startRow: o,
|
|
@@ -318,7 +318,7 @@ function An(e, t, n) {
|
|
|
318
318
|
startColumn: n,
|
|
319
319
|
endColumn: n
|
|
320
320
|
};
|
|
321
|
-
const r =
|
|
321
|
+
const r = Ns(e, t, n);
|
|
322
322
|
return r !== n ? {
|
|
323
323
|
startRow: t,
|
|
324
324
|
endRow: t,
|
|
@@ -326,16 +326,16 @@ function An(e, t, n) {
|
|
|
326
326
|
endColumn: n - 1
|
|
327
327
|
} : null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Os(e, t, n) {
|
|
330
330
|
let o = !1;
|
|
331
331
|
if (t === 0) return t;
|
|
332
332
|
for (let r = t - 1; r >= 0; r--) {
|
|
333
333
|
const s = e.getValue(r, n);
|
|
334
|
-
if (
|
|
334
|
+
if (vt(s) && !o) {
|
|
335
335
|
if (r === 0) return 0;
|
|
336
336
|
o = !0;
|
|
337
337
|
} else {
|
|
338
|
-
if (o && !
|
|
338
|
+
if (o && !vt(s))
|
|
339
339
|
return r + 1;
|
|
340
340
|
if (o && r === 0)
|
|
341
341
|
return 0;
|
|
@@ -343,16 +343,16 @@ function Ts(e, t, n) {
|
|
|
343
343
|
}
|
|
344
344
|
return t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ns(e, t, n) {
|
|
347
347
|
let o = !1;
|
|
348
348
|
if (n === 0) return n;
|
|
349
349
|
for (let r = n - 1; r >= 0; r--) {
|
|
350
350
|
const s = e.getValue(t, r);
|
|
351
|
-
if (
|
|
351
|
+
if (vt(s) && !o) {
|
|
352
352
|
if (r === 0) return 0;
|
|
353
353
|
o = !0;
|
|
354
354
|
} else {
|
|
355
|
-
if (o && !
|
|
355
|
+
if (o && !vt(s))
|
|
356
356
|
return r + 1;
|
|
357
357
|
if (o && r === 0)
|
|
358
358
|
return 0;
|
|
@@ -360,57 +360,57 @@ function xs(e, t, n) {
|
|
|
360
360
|
}
|
|
361
361
|
return n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function vt(e) {
|
|
364
364
|
if (e != null && e.p) {
|
|
365
365
|
const t = e == null ? void 0 : e.p.body;
|
|
366
366
|
if (t == null)
|
|
367
367
|
return !1;
|
|
368
|
-
const n = t.dataStream, r = n.substring(n.length - 2, n.length) ===
|
|
369
|
-
return
|
|
368
|
+
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
|
|
369
|
+
return Br(r);
|
|
370
370
|
}
|
|
371
|
-
return e && (e.t ===
|
|
371
|
+
return e && (e.t === En.NUMBER || jr(e) === En.NUMBER);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ms(e) {
|
|
374
374
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function ws(e) {
|
|
377
377
|
return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Un(e, t) {
|
|
380
380
|
for (let n = t.startRow; n <= t.endRow; n++)
|
|
381
381
|
for (let o = t.startColumn; o <= t.endColumn; o++)
|
|
382
|
-
if (
|
|
382
|
+
if (vt(e.getValue(n, o)))
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function As(e, t, n, o) {
|
|
387
387
|
for (let r = n; r <= o; r++)
|
|
388
388
|
if (!e.getValue(t, r))
|
|
389
389
|
return r;
|
|
390
390
|
return o;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function ks(e, t, n, o) {
|
|
393
393
|
for (let r = n; r <= o; r++)
|
|
394
394
|
if (!e.getValue(r, t))
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const dr = "SHEET_FORMULA_UI_PLUGIN", hr = `${dr}_MORE_FUNCTIONS_COMPONENT`, fr = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
|
-
type:
|
|
401
|
-
handler: async (e) => (e.get(
|
|
400
|
+
type: Te.OPERATION,
|
|
401
|
+
handler: async (e) => (e.get(hn).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
|
-
children: { label:
|
|
403
|
+
children: { label: hr }
|
|
404
404
|
}), !0)
|
|
405
|
-
},
|
|
405
|
+
}, gr = {
|
|
406
406
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
407
|
-
type:
|
|
407
|
+
type: Te.OPERATION,
|
|
408
408
|
handler: async (e) => !0
|
|
409
|
-
},
|
|
409
|
+
}, Fs = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
|
-
type:
|
|
412
|
-
handler: async (e, t) => (e.get(
|
|
413
|
-
},
|
|
411
|
+
type: Te.OPERATION,
|
|
412
|
+
handler: async (e, t) => (e.get(mn).search(t), !0)
|
|
413
|
+
}, pn = (e, t, n = !0) => {
|
|
414
414
|
let o = -1;
|
|
415
415
|
return e.reduce((r, s, c) => {
|
|
416
416
|
if (r.isFinish)
|
|
@@ -419,47 +419,47 @@ const ur = "SHEET_FORMULA_UI_PLUGIN", dr = `${ur}_MORE_FUNCTIONS_COMPONENT`, un
|
|
|
419
419
|
if (typeof s != "string")
|
|
420
420
|
r.currentIndex += s.token.length;
|
|
421
421
|
else {
|
|
422
|
-
const
|
|
423
|
-
r.currentIndex +=
|
|
422
|
+
const l = s.length;
|
|
423
|
+
r.currentIndex += l;
|
|
424
424
|
}
|
|
425
425
|
return (n ? r.currentIndex === t : t > i && t <= r.currentIndex) && (o = c, r.isFinish = !0), r;
|
|
426
426
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
427
|
-
},
|
|
427
|
+
}, mr = (e, t) => {
|
|
428
428
|
const n = e[t];
|
|
429
429
|
let o = -1;
|
|
430
|
-
if (!n || typeof n == "string" || n.nodeType !==
|
|
430
|
+
if (!n || typeof n == "string" || n.nodeType !== Z.REFERENCE) return -1;
|
|
431
431
|
for (let r = 0; r <= t; r++) {
|
|
432
432
|
const s = e[r];
|
|
433
|
-
typeof s != "string" && s.nodeType ===
|
|
433
|
+
typeof s != "string" && s.nodeType === Z.REFERENCE && o++;
|
|
434
434
|
}
|
|
435
435
|
return o;
|
|
436
436
|
};
|
|
437
|
-
var
|
|
438
|
-
return
|
|
437
|
+
var le = function() {
|
|
438
|
+
return le = Object.assign || function(e) {
|
|
439
439
|
for (var t, n = 1, o = arguments.length; n < o; n++) {
|
|
440
440
|
t = arguments[n];
|
|
441
441
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
442
442
|
}
|
|
443
443
|
return e;
|
|
444
|
-
},
|
|
445
|
-
},
|
|
444
|
+
}, le.apply(this, arguments);
|
|
445
|
+
}, Ds = function(e, t) {
|
|
446
446
|
var n = {};
|
|
447
447
|
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
|
|
448
448
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
449
449
|
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
450
450
|
t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
|
|
451
451
|
return n;
|
|
452
|
-
},
|
|
453
|
-
var n = e.icon, o = e.id, r = e.className, s = e.extend, c =
|
|
454
|
-
return
|
|
452
|
+
}, Qe = Ne(function(e, t) {
|
|
453
|
+
var n = e.icon, o = e.id, r = e.className, s = e.extend, c = Ds(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = G("_".concat(Ps()));
|
|
454
|
+
return pr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, le({ ref: t, className: i }, c), s);
|
|
455
455
|
});
|
|
456
|
-
function
|
|
457
|
-
return
|
|
458
|
-
return
|
|
456
|
+
function pr(e, t, n, o, r) {
|
|
457
|
+
return Xe(e.tag, le(le({ key: t }, Ls(e, n, r)), o), ($s(e, n).children || []).map(function(s, c) {
|
|
458
|
+
return pr(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
|
|
459
459
|
}));
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
var o =
|
|
461
|
+
function Ls(e, t, n) {
|
|
462
|
+
var o = le({}, e.attrs);
|
|
463
463
|
n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(function(s) {
|
|
464
464
|
var c = s[0], i = s[1];
|
|
465
465
|
c === "mask" && typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
@@ -470,71 +470,71 @@ function Fs(e, t, n) {
|
|
|
470
470
|
typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
471
471
|
})), o;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function $s(e, t) {
|
|
474
474
|
var n, o = t.defIds;
|
|
475
|
-
return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ?
|
|
476
|
-
return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ?
|
|
475
|
+
return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? le(le({}, e), { children: e.children.map(function(r) {
|
|
476
|
+
return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ? le(le({}, r), { attrs: le(le({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
|
|
477
477
|
}) }) : e;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Ps() {
|
|
480
480
|
return Math.random().toString(36).substring(2, 8);
|
|
481
481
|
}
|
|
482
|
-
|
|
483
|
-
var
|
|
484
|
-
return
|
|
482
|
+
Qe.displayName = "UniverIcon";
|
|
483
|
+
var Us = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Sr = Ne(function(e, t) {
|
|
484
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
485
485
|
id: "check-mark-single",
|
|
486
486
|
ref: t,
|
|
487
|
-
icon:
|
|
487
|
+
icon: Us
|
|
488
488
|
}));
|
|
489
489
|
});
|
|
490
|
-
|
|
491
|
-
var
|
|
492
|
-
return
|
|
490
|
+
Sr.displayName = "CheckMarkSingle";
|
|
491
|
+
var Vs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, vr = Ne(function(e, t) {
|
|
492
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
493
493
|
id: "close-single",
|
|
494
494
|
ref: t,
|
|
495
|
-
icon:
|
|
495
|
+
icon: Vs
|
|
496
496
|
}));
|
|
497
497
|
});
|
|
498
|
-
|
|
499
|
-
var
|
|
500
|
-
return
|
|
498
|
+
vr.displayName = "CloseSingle";
|
|
499
|
+
var Ws = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Cr = Ne(function(e, t) {
|
|
500
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
501
501
|
id: "delete-single",
|
|
502
502
|
ref: t,
|
|
503
|
-
icon:
|
|
503
|
+
icon: Ws
|
|
504
504
|
}));
|
|
505
505
|
});
|
|
506
|
-
|
|
507
|
-
var
|
|
508
|
-
return
|
|
506
|
+
Cr.displayName = "DeleteSingle";
|
|
507
|
+
var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, _r = Ne(function(e, t) {
|
|
508
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
509
509
|
id: "increase-single",
|
|
510
510
|
ref: t,
|
|
511
|
-
icon:
|
|
511
|
+
icon: Hs
|
|
512
512
|
}));
|
|
513
513
|
});
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
return
|
|
514
|
+
_r.displayName = "IncreaseSingle";
|
|
515
|
+
var Bs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr = Ne(function(e, t) {
|
|
516
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
517
517
|
id: "more-single",
|
|
518
518
|
ref: t,
|
|
519
|
-
icon:
|
|
519
|
+
icon: Bs
|
|
520
520
|
}));
|
|
521
521
|
});
|
|
522
|
-
|
|
523
|
-
var
|
|
524
|
-
return
|
|
522
|
+
Rr.displayName = "MoreSingle";
|
|
523
|
+
var js = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Er = Ne(function(e, t) {
|
|
524
|
+
return Xe(Qe, Object.assign({}, e, {
|
|
525
525
|
id: "select-range-single",
|
|
526
526
|
ref: t,
|
|
527
|
-
icon:
|
|
527
|
+
icon: js
|
|
528
528
|
}));
|
|
529
529
|
});
|
|
530
|
-
|
|
531
|
-
function
|
|
530
|
+
Er.displayName = "SelectRangeSingle";
|
|
531
|
+
function qs(e, t) {
|
|
532
532
|
return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
|
|
533
533
|
label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
|
|
534
534
|
value: `${e[n]}`
|
|
535
535
|
}));
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function br(e) {
|
|
538
538
|
if (!e.require && !e.repeat)
|
|
539
539
|
return `[${e.name}]`;
|
|
540
540
|
if (e.require && !e.repeat)
|
|
@@ -544,8 +544,8 @@ function Rr(e) {
|
|
|
544
544
|
if (e.require && e.repeat)
|
|
545
545
|
return `${e.name},...`;
|
|
546
546
|
}
|
|
547
|
-
const
|
|
548
|
-
|
|
547
|
+
const Ks = (e, t = 100) => {
|
|
548
|
+
$(() => {
|
|
549
549
|
let n = null;
|
|
550
550
|
const o = () => {
|
|
551
551
|
n === null && (n = window.setTimeout(() => {
|
|
@@ -557,85 +557,85 @@ const js = (e, t = 100) => {
|
|
|
557
557
|
};
|
|
558
558
|
}, [e, t]);
|
|
559
559
|
};
|
|
560
|
-
function
|
|
561
|
-
const o = T(
|
|
560
|
+
function Ir(e, t, n) {
|
|
561
|
+
const o = T(qe), r = oe(() => new tr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(hn), c = T(ee), i = J(() => {
|
|
562
562
|
var _;
|
|
563
|
-
const
|
|
564
|
-
if (!
|
|
563
|
+
const l = o.getEditor(e);
|
|
564
|
+
if (!l)
|
|
565
565
|
return;
|
|
566
|
-
const f =
|
|
566
|
+
const f = l.getBoundingClientRect(), { marginTop: h = 0, marginBottom: m = 0 } = l.getDocumentData().documentStyle, u = l.getSkeleton();
|
|
567
567
|
if (!u) return;
|
|
568
568
|
const d = (_ = u.getSkeletonData()) == null ? void 0 : _.pages[0].height;
|
|
569
|
-
let { left:
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
if (!(
|
|
573
|
-
return r.next({ left:
|
|
569
|
+
let { left: a, top: S, right: g, bottom: p } = f;
|
|
570
|
+
S = S + h, p = d ? S + d : p - m;
|
|
571
|
+
const v = r.getValue();
|
|
572
|
+
if (!(v.left === a && v.top === S && v.right === g && v.bottom === p))
|
|
573
|
+
return r.next({ left: a - 1, right: g + 1, top: S - 1, bottom: p + 1 }), f;
|
|
574
574
|
});
|
|
575
|
-
return
|
|
575
|
+
return $(() => {
|
|
576
576
|
t && i();
|
|
577
|
-
}, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]),
|
|
578
|
-
const
|
|
577
|
+
}, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]), Ks(i), $(() => {
|
|
578
|
+
const l = s.scrollEvent$.pipe(Uo(100)).subscribe(i);
|
|
579
579
|
return () => {
|
|
580
|
-
|
|
580
|
+
l.unsubscribe();
|
|
581
581
|
};
|
|
582
582
|
}, []), [r, i];
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
const t =
|
|
584
|
+
const Je = (e) => {
|
|
585
|
+
const t = G(e);
|
|
586
586
|
return t.current = e, t;
|
|
587
|
-
},
|
|
588
|
-
const o = T(
|
|
587
|
+
}, Ys = (e, t, n) => {
|
|
588
|
+
const o = T(Ht), r = T(_e), [s, c] = V(), [i, l] = V(-1), [f, h] = V(!0), m = Je(f), u = G(t);
|
|
589
589
|
u.current = t;
|
|
590
590
|
const d = () => {
|
|
591
|
-
c(void 0),
|
|
591
|
+
c(void 0), l(-1), h(!1);
|
|
592
592
|
};
|
|
593
|
-
return
|
|
593
|
+
return $(() => {
|
|
594
594
|
if (n && e) {
|
|
595
|
-
const
|
|
595
|
+
const a = n.selectionChange$.pipe(an(50)).subscribe((g) => {
|
|
596
596
|
if (g.textRanges.length === 1) {
|
|
597
|
-
const [
|
|
598
|
-
if (
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const { functionName: _, paramIndex: R } =
|
|
602
|
-
c(C),
|
|
597
|
+
const [p] = g.textRanges;
|
|
598
|
+
if (p.collapsed && m.current) {
|
|
599
|
+
const v = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
|
|
600
|
+
if (v) {
|
|
601
|
+
const { functionName: _, paramIndex: R } = v, C = o.getFunctionInfo(_);
|
|
602
|
+
c(C), l(R);
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
c(void 0),
|
|
608
|
-
}),
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
607
|
+
c(void 0), l(-1);
|
|
608
|
+
}), S = n.selectionChange$.pipe(
|
|
609
|
+
Qt((g) => g.isEditing),
|
|
610
|
+
Qt((g) => g.textRanges.length === 1),
|
|
611
|
+
nr((g) => g.textRanges[0].startOffset),
|
|
612
|
+
Vo()
|
|
613
613
|
).subscribe(() => {
|
|
614
614
|
h(!0);
|
|
615
615
|
});
|
|
616
616
|
return () => {
|
|
617
|
-
|
|
617
|
+
a.unsubscribe(), S.unsubscribe();
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
}, [n, e]),
|
|
620
|
+
}, [n, e]), $(() => {
|
|
621
621
|
e || d();
|
|
622
622
|
}, [e]), {
|
|
623
623
|
functionInfo: s,
|
|
624
624
|
paramIndex: i,
|
|
625
625
|
reset: d
|
|
626
626
|
};
|
|
627
|
-
},
|
|
627
|
+
}, Gs = ({ onClick: e }) => /* @__PURE__ */ O(
|
|
628
628
|
"div",
|
|
629
629
|
{
|
|
630
630
|
className: "univer-z-[15] univer-box-border univer-h-[18px] univer-cursor-pointer univer-overflow-visible univer-whitespace-nowrap univer-rounded-l univer-border univer-border-r-0 univer-border-gray-600 univer-bg-primary-600 univer-p-0.5 univer-text-xs univer-font-bold univer-leading-[13px] univer-text-white",
|
|
631
631
|
onClick: e,
|
|
632
632
|
children: "?"
|
|
633
633
|
}
|
|
634
|
-
),
|
|
634
|
+
), zt = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
|
|
635
635
|
/* @__PURE__ */ O(
|
|
636
636
|
"div",
|
|
637
637
|
{
|
|
638
|
-
className:
|
|
638
|
+
className: fe("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-white", e),
|
|
639
639
|
children: t
|
|
640
640
|
}
|
|
641
641
|
),
|
|
@@ -646,50 +646,50 @@ const Ke = (e) => {
|
|
|
646
646
|
children: n
|
|
647
647
|
}
|
|
648
648
|
)
|
|
649
|
-
] }),
|
|
649
|
+
] }), zs = (e) => {
|
|
650
650
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
651
|
-
return /* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ W("div", { children: [
|
|
652
|
+
/* @__PURE__ */ W("span", { children: [
|
|
653
653
|
t,
|
|
654
654
|
"("
|
|
655
655
|
] }),
|
|
656
|
-
n && n.map((s, c) => /* @__PURE__ */
|
|
656
|
+
n && n.map((s, c) => /* @__PURE__ */ W("span", { children: [
|
|
657
657
|
/* @__PURE__ */ O(
|
|
658
658
|
"span",
|
|
659
659
|
{
|
|
660
660
|
className: o === c ? "univer-text-primary-500" : "",
|
|
661
661
|
onClick: () => r(c),
|
|
662
|
-
children:
|
|
662
|
+
children: br(s)
|
|
663
663
|
}
|
|
664
664
|
),
|
|
665
665
|
c === n.length - 1 ? "" : ","
|
|
666
666
|
] }, s.name)),
|
|
667
667
|
")"
|
|
668
668
|
] });
|
|
669
|
-
},
|
|
669
|
+
}, Vn = () => {
|
|
670
670
|
};
|
|
671
|
-
function
|
|
672
|
-
const { onParamsSwitch: t =
|
|
671
|
+
function Zs(e) {
|
|
672
|
+
const { onParamsSwitch: t = Vn, onClose: n = Vn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = Ys(o, s, r), f = oe(() => !!c && i >= 0, [c, i]), h = T(cn), m = !Ce(h.helpFunctionVisible$), [u, d] = V(!0), a = T(at), S = a.t("formula.prompt.required"), g = a.t("formula.prompt.optional"), p = r.getEditorId(), [v] = Ir(p, f, [c, i]);
|
|
673
673
|
function _(y) {
|
|
674
674
|
t && t(y);
|
|
675
675
|
}
|
|
676
|
-
const R =
|
|
676
|
+
const R = J((y) => {
|
|
677
677
|
h.helpFunctionVisible$.next(!y);
|
|
678
678
|
}), C = () => {
|
|
679
679
|
R(!0), n();
|
|
680
680
|
};
|
|
681
|
-
return f && c ? m ? /* @__PURE__ */ O(
|
|
681
|
+
return f && c ? m ? /* @__PURE__ */ O(Jt, { portal: !0, anchorRect$: v, direction: "left-center", children: /* @__PURE__ */ O(Gs, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ O(Jt, { portal: !0, onClickOutside: () => l(), anchorRect$: v, direction: "vertical", children: /* @__PURE__ */ W(
|
|
682
682
|
"div",
|
|
683
683
|
{
|
|
684
|
-
className:
|
|
684
|
+
className: fe("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", fn),
|
|
685
685
|
children: [
|
|
686
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ W(
|
|
687
687
|
"div",
|
|
688
688
|
{
|
|
689
|
-
className:
|
|
689
|
+
className: fe("univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 univer-wrap-anywhere dark:!univer-text-white", ps),
|
|
690
690
|
children: [
|
|
691
691
|
/* @__PURE__ */ O(
|
|
692
|
-
|
|
692
|
+
zs,
|
|
693
693
|
{
|
|
694
694
|
prefix: c.functionName,
|
|
695
695
|
value: c.functionParameter,
|
|
@@ -697,22 +697,22 @@ function Gs(e) {
|
|
|
697
697
|
onClick: _
|
|
698
698
|
}
|
|
699
699
|
),
|
|
700
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ W("div", { className: "univer-flex", children: [
|
|
701
701
|
/* @__PURE__ */ O(
|
|
702
702
|
"div",
|
|
703
703
|
{
|
|
704
704
|
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200",
|
|
705
705
|
style: { transform: u ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
706
706
|
onClick: () => d(!u),
|
|
707
|
-
children: /* @__PURE__ */ O(
|
|
707
|
+
children: /* @__PURE__ */ O(Rr, {})
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
710
|
/* @__PURE__ */ O(
|
|
711
711
|
"div",
|
|
712
712
|
{
|
|
713
|
-
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors dark
|
|
713
|
+
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors dark:!univer-text-gray-200 hover:univer-bg-gray-300",
|
|
714
714
|
onClick: C,
|
|
715
|
-
children: /* @__PURE__ */ O(
|
|
715
|
+
children: /* @__PURE__ */ O(vr, {})
|
|
716
716
|
}
|
|
717
717
|
)
|
|
718
718
|
] })
|
|
@@ -727,27 +727,27 @@ function Gs(e) {
|
|
|
727
727
|
height: u ? "unset" : 0,
|
|
728
728
|
padding: u ? "revert-layer" : 0
|
|
729
729
|
},
|
|
730
|
-
children: /* @__PURE__ */
|
|
730
|
+
children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
|
|
731
731
|
/* @__PURE__ */ O(
|
|
732
|
-
|
|
732
|
+
zt,
|
|
733
733
|
{
|
|
734
|
-
title:
|
|
734
|
+
title: a.t("formula.prompt.helpExample"),
|
|
735
735
|
value: `${c.functionName}(${c.functionParameter.map((y) => y.example).join(",")})`
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ O(
|
|
739
|
-
|
|
739
|
+
zt,
|
|
740
740
|
{
|
|
741
|
-
title:
|
|
741
|
+
title: a.t("formula.prompt.helpAbstract"),
|
|
742
742
|
value: c.description
|
|
743
743
|
}
|
|
744
744
|
),
|
|
745
745
|
c && c.functionParameter && c.functionParameter.map((y, N) => /* @__PURE__ */ O(
|
|
746
|
-
|
|
746
|
+
zt,
|
|
747
747
|
{
|
|
748
748
|
className: i === N ? "univer-text-primary-500" : "",
|
|
749
749
|
title: y.name,
|
|
750
|
-
value: `${y.require ?
|
|
750
|
+
value: `${y.require ? S : g} ${y.detail}`
|
|
751
751
|
},
|
|
752
752
|
N
|
|
753
753
|
))
|
|
@@ -758,30 +758,30 @@ function Gs(e) {
|
|
|
758
758
|
}
|
|
759
759
|
) }, "show") : null;
|
|
760
760
|
}
|
|
761
|
-
const
|
|
762
|
-
const t = T(
|
|
763
|
-
return
|
|
761
|
+
const Xs = (e) => {
|
|
762
|
+
const t = T(qe);
|
|
763
|
+
return J((o) => {
|
|
764
764
|
var r, s;
|
|
765
765
|
if (e) {
|
|
766
766
|
t.focus(e.getEditorId());
|
|
767
767
|
const c = [...e.getSelectionRanges()];
|
|
768
|
-
if (
|
|
768
|
+
if (it.isDefine(o))
|
|
769
769
|
e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
770
770
|
else if (!c.length && !e.docSelectionRenderService.isOnPointerEvent) {
|
|
771
771
|
const i = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
772
|
-
`,
|
|
773
|
-
e.setSelectionRanges([{ startOffset:
|
|
772
|
+
`, l = Math.max(i.length - 2, 0);
|
|
773
|
+
e.setSelectionRanges([{ startOffset: l, endOffset: l }]);
|
|
774
774
|
} else
|
|
775
775
|
e.setSelectionRanges(c);
|
|
776
776
|
}
|
|
777
777
|
});
|
|
778
778
|
};
|
|
779
|
-
var
|
|
780
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
779
|
+
var Qs = Object.getOwnPropertyDescriptor, Js = (e, t, n, o) => {
|
|
780
|
+
for (var r = o > 1 ? void 0 : o ? Qs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
781
781
|
(c = e[s]) && (r = c(r) || r);
|
|
782
782
|
return r;
|
|
783
|
-
},
|
|
784
|
-
let
|
|
783
|
+
}, rt = (e, t) => (n, o) => t(n, o, e);
|
|
784
|
+
let De = class extends lo {
|
|
785
785
|
constructor(t, n, o, r, s, c, i) {
|
|
786
786
|
super(
|
|
787
787
|
n,
|
|
@@ -792,7 +792,7 @@ let Fe = class extends co {
|
|
|
792
792
|
);
|
|
793
793
|
j(this, "_workbookSelections");
|
|
794
794
|
j(this, "_eventDisposables");
|
|
795
|
-
this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(
|
|
795
|
+
this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(ei(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
796
796
|
}
|
|
797
797
|
getLocation() {
|
|
798
798
|
return this._skeleton.getLocation();
|
|
@@ -816,7 +816,7 @@ let Fe = class extends co {
|
|
|
816
816
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
817
817
|
*/
|
|
818
818
|
enableSelectionChanging() {
|
|
819
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
819
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), zn(() => this._disableSelectionChanging());
|
|
820
820
|
}
|
|
821
821
|
_disableSelectionChanging() {
|
|
822
822
|
var t;
|
|
@@ -826,27 +826,27 @@ let Fe = class extends co {
|
|
|
826
826
|
this._disableSelectionChanging();
|
|
827
827
|
}
|
|
828
828
|
_initCanvasEventListeners() {
|
|
829
|
-
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new
|
|
830
|
-
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((
|
|
831
|
-
this.inRefSelectionMode() && (this._onPointerDown(
|
|
829
|
+
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new He();
|
|
830
|
+
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, f) => {
|
|
831
|
+
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Se.NORMAL, this._getActiveViewport(l)), l.button !== 2 && f.stopPropagation());
|
|
832
832
|
})), i.add(
|
|
833
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((
|
|
833
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, f) => {
|
|
834
834
|
if (!this.inRefSelectionMode()) return;
|
|
835
|
-
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } =
|
|
836
|
-
|
|
835
|
+
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = In(l.offsetX, l.offsetY, c, h);
|
|
836
|
+
yn(this._workbookSelections.getCurrentSelections(), m, Se.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.ROW, this._getActiveViewport(l), Yt.Y), l.button !== 2 && f.stopPropagation());
|
|
837
837
|
})
|
|
838
|
-
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((
|
|
838
|
+
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, f) => {
|
|
839
839
|
if (!this.inRefSelectionMode()) return;
|
|
840
|
-
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } =
|
|
841
|
-
|
|
842
|
-
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((
|
|
840
|
+
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = In(l.offsetX, l.offsetY, c, h);
|
|
841
|
+
yn(this._workbookSelections.getCurrentSelections(), m, Se.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.COLUMN, this._getActiveViewport(l), Yt.X), l.button !== 2 && f.stopPropagation());
|
|
842
|
+
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, f) => {
|
|
843
843
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
844
|
-
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, m =
|
|
844
|
+
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, m = uo(h);
|
|
845
845
|
this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
846
846
|
const u = c.onPointerUp$.subscribeEvent(() => {
|
|
847
847
|
u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
848
848
|
});
|
|
849
|
-
|
|
849
|
+
l.button !== 2 && f.stopPropagation();
|
|
850
850
|
})), i;
|
|
851
851
|
}
|
|
852
852
|
/**
|
|
@@ -856,7 +856,7 @@ let Fe = class extends co {
|
|
|
856
856
|
*/
|
|
857
857
|
_addSelectionControlByModelData(t) {
|
|
858
858
|
var c;
|
|
859
|
-
const n = this._skeleton, o = (c = t.style) != null ? c :
|
|
859
|
+
const n = this._skeleton, o = (c = t.style) != null ? c : Xn(this._themeService), r = this._scene;
|
|
860
860
|
return t.style = o, this.newSelectionControl(r, n, t);
|
|
861
861
|
}
|
|
862
862
|
_initSelectionChangeListener() {
|
|
@@ -869,18 +869,18 @@ let Fe = class extends co {
|
|
|
869
869
|
*/
|
|
870
870
|
_initUserActionSyncListener() {
|
|
871
871
|
this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
|
|
872
|
-
this._updateSelections(t,
|
|
872
|
+
this._updateSelections(t, Gt.MOVE_START);
|
|
873
873
|
})), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
|
|
874
|
-
this._updateSelections(t,
|
|
874
|
+
this._updateSelections(t, Gt.MOVING);
|
|
875
875
|
})), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
|
|
876
|
-
this._updateSelections(t,
|
|
876
|
+
this._updateSelections(t, Gt.MOVE_END);
|
|
877
877
|
}));
|
|
878
878
|
}
|
|
879
879
|
_updateSelections(t, n) {
|
|
880
880
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
881
881
|
t.length !== 0 && this._workbookSelections.setSelections(
|
|
882
882
|
r,
|
|
883
|
-
t.map((s) =>
|
|
883
|
+
t.map((s) => Qo(s)),
|
|
884
884
|
n
|
|
885
885
|
);
|
|
886
886
|
}
|
|
@@ -888,7 +888,7 @@ let Fe = class extends co {
|
|
|
888
888
|
this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((t) => {
|
|
889
889
|
if (!t)
|
|
890
890
|
return;
|
|
891
|
-
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(
|
|
891
|
+
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(An.VIEW_MAIN);
|
|
892
892
|
this._skeleton && this._skeleton.worksheet.getSheetId() !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
|
|
893
893
|
const s = this._workbookSelections.getCurrentSelections();
|
|
894
894
|
this.resetSelectionsByModelData(s);
|
|
@@ -896,10 +896,10 @@ let Fe = class extends co {
|
|
|
896
896
|
}
|
|
897
897
|
_getActiveViewport(t) {
|
|
898
898
|
const n = this._getSheetObject();
|
|
899
|
-
return n == null ? void 0 : n.scene.getActiveViewportByCoord(
|
|
899
|
+
return n == null ? void 0 : n.scene.getActiveViewportByCoord(kn.FromArray([t.offsetX, t.offsetY]));
|
|
900
900
|
}
|
|
901
901
|
_getSheetObject() {
|
|
902
|
-
return
|
|
902
|
+
return ho(this._context.unit, this._context);
|
|
903
903
|
}
|
|
904
904
|
/**
|
|
905
905
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -912,40 +912,40 @@ let Fe = class extends co {
|
|
|
912
912
|
* @param scrollTimerType
|
|
913
913
|
*/
|
|
914
914
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
915
|
-
_onPointerDown(t, n = 0, o =
|
|
915
|
+
_onPointerDown(t, n = 0, o = Se.NORMAL, r, s = Yt.ALL) {
|
|
916
916
|
var x;
|
|
917
917
|
this._rangeType = o;
|
|
918
918
|
const c = this._skeleton, i = this._scene;
|
|
919
919
|
if (!i || !c)
|
|
920
920
|
return;
|
|
921
921
|
r && (this._activeViewport = r);
|
|
922
|
-
const { offsetX:
|
|
922
|
+
const { offsetX: l, offsetY: f } = t, h = i.getViewport(An.VIEW_MAIN);
|
|
923
923
|
if (!h) return;
|
|
924
|
-
const m = i.getCoordRelativeToViewport(
|
|
924
|
+
const m = i.getCoordRelativeToViewport(kn.FromArray([l, f])), { x: u, y: d } = m;
|
|
925
925
|
this._startViewportPosX = u, this._startViewportPosY = d;
|
|
926
|
-
const
|
|
927
|
-
if (!
|
|
926
|
+
const a = i.getScrollXYInfoByViewport(m), { scaleX: S, scaleY: g } = i.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, S, g, a);
|
|
927
|
+
if (!p) return;
|
|
928
928
|
switch (o) {
|
|
929
|
-
case
|
|
929
|
+
case Se.NORMAL:
|
|
930
930
|
break;
|
|
931
|
-
case
|
|
932
|
-
|
|
931
|
+
case Se.ROW:
|
|
932
|
+
p.startColumn = 0, p.endColumn = this._skeleton.getColumnCount() - 1;
|
|
933
933
|
break;
|
|
934
|
-
case
|
|
935
|
-
|
|
934
|
+
case Se.COLUMN:
|
|
935
|
+
p.startRow = 0, p.endRow = this._skeleton.getRowCount() - 1;
|
|
936
936
|
break;
|
|
937
|
-
case
|
|
938
|
-
|
|
937
|
+
case Se.ALL:
|
|
938
|
+
p.startRow = 0, p.startColumn = 0, p.endRow = this._skeleton.getRowCount() - 1, p.endColumn = this._skeleton.getColumnCount() - 1;
|
|
939
939
|
}
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
const _ =
|
|
940
|
+
const v = { range: p, primary: p, style: null };
|
|
941
|
+
v.range.rangeType = o;
|
|
942
|
+
const _ = Xt(v, this._skeleton);
|
|
943
943
|
this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
|
|
944
944
|
const R = { ..._.rangeWithCoord, rangeType: o };
|
|
945
945
|
let C = this.getActiveSelectionControl();
|
|
946
946
|
const y = this.getSelectionControls();
|
|
947
947
|
for (const w of y) {
|
|
948
|
-
if (t.button === 2 &&
|
|
948
|
+
if (t.button === 2 && Kn.contains(w.model, R)) {
|
|
949
949
|
C = w;
|
|
950
950
|
return;
|
|
951
951
|
}
|
|
@@ -963,7 +963,7 @@ let Fe = class extends co {
|
|
|
963
963
|
o,
|
|
964
964
|
C
|
|
965
965
|
// Get updated in this method
|
|
966
|
-
) : F && C ? C.updateRangeBySelectionWithCoord(_) : C = this.newSelectionControl(i, c,
|
|
966
|
+
) : F && C ? C.updateRangeBySelectionWithCoord(_) : C = this.newSelectionControl(i, c, v);
|
|
967
967
|
for (let w = 0; w < this.getSelectionControls().length - 1; w++)
|
|
968
968
|
this.getSelectionControls()[w].clearHighlight();
|
|
969
969
|
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (x = i.getTransformer()) == null || x.clearSelectedObjects(), this._setupPointerMoveListener(h, C, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
|
|
@@ -979,13 +979,13 @@ let Fe = class extends co {
|
|
|
979
979
|
* @returns {SelectionControl} selectionControl just created
|
|
980
980
|
*/
|
|
981
981
|
newSelectionControl(t, n, o) {
|
|
982
|
-
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new
|
|
982
|
+
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new Qn(t, r, this._themeService, {
|
|
983
983
|
highlightHeader: this._highlightHeader,
|
|
984
984
|
enableAutoFill: !1,
|
|
985
985
|
rowHeaderWidth: s,
|
|
986
986
|
columnHeaderHeight: c
|
|
987
|
-
}),
|
|
988
|
-
return i.updateRangeBySelectionWithCoord(
|
|
987
|
+
}), l = Xt(o, n);
|
|
988
|
+
return i.updateRangeBySelectionWithCoord(l), this._selectionControls.push(i), i.setControlExtension({
|
|
989
989
|
skeleton: n,
|
|
990
990
|
scene: t,
|
|
991
991
|
themeService: this._themeService,
|
|
@@ -998,48 +998,48 @@ let Fe = class extends co {
|
|
|
998
998
|
}), i;
|
|
999
999
|
}
|
|
1000
1000
|
};
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
],
|
|
1009
|
-
function
|
|
1010
|
-
const t =
|
|
1001
|
+
De = Js([
|
|
1002
|
+
rt(1, B(Ct)),
|
|
1003
|
+
rt(2, B(_t)),
|
|
1004
|
+
rt(3, Bt),
|
|
1005
|
+
rt(4, B(Vt)),
|
|
1006
|
+
rt(5, rn),
|
|
1007
|
+
rt(6, Wt)
|
|
1008
|
+
], De);
|
|
1009
|
+
function ei(e) {
|
|
1010
|
+
const t = Xn(e);
|
|
1011
1011
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function ti(e) {
|
|
1014
1014
|
var r, s;
|
|
1015
1015
|
const n = e.get(ee).getCurrentUniverDocInstance();
|
|
1016
1016
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
1017
1017
|
}
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1018
|
+
var ke = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e))(ke || {});
|
|
1019
|
+
function ni(e) {
|
|
1020
1020
|
var N;
|
|
1021
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(
|
|
1021
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(Oe), i = T(ee), l = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(rr), m = T(ur), u = T(Ct), [d, a] = V(
|
|
1022
1022
|
0
|
|
1023
1023
|
/* NOT_SELECT */
|
|
1024
|
-
),
|
|
1025
|
-
|
|
1024
|
+
), S = T(_e), g = G(!0), p = l == null ? void 0 : l.with(De), v = Je(d), _ = i.getUnit(r, q.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), C = J((k) => {
|
|
1025
|
+
p && p.setSkipLastEnabled(
|
|
1026
1026
|
k === 1 || k === 3
|
|
1027
1027
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
1028
|
-
),
|
|
1029
|
-
}), y =
|
|
1028
|
+
), v.current = k, a(k);
|
|
1029
|
+
}), y = J(() => {
|
|
1030
1030
|
var H, se;
|
|
1031
1031
|
if (!_) return;
|
|
1032
|
-
const k = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, w =
|
|
1032
|
+
const k = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, w = ti(u);
|
|
1033
1033
|
if (!w) return;
|
|
1034
|
-
const M = (H = w == null ? void 0 : w.dataStream) == null ? void 0 : H.slice(0, -2),
|
|
1035
|
-
...
|
|
1036
|
-
range:
|
|
1034
|
+
const M = (H = w == null ? void 0 : w.dataStream) == null ? void 0 : H.slice(0, -2), b = ((se = S.sequenceNodesBuilder(M)) != null ? se : []).map((K) => typeof K == "object" ? K.nodeType === Z.REFERENCE ? {
|
|
1035
|
+
...K,
|
|
1036
|
+
range: Oo(K.token)
|
|
1037
1037
|
} : {
|
|
1038
|
-
...
|
|
1038
|
+
...K,
|
|
1039
1039
|
range: void 0
|
|
1040
|
-
} :
|
|
1041
|
-
if ((M == null ? void 0 : M.substring(0, 1)) === "=" && (
|
|
1042
|
-
if (
|
|
1040
|
+
} : K), E = M[x - 1], I = M[x], A = b.find((K) => typeof K == "object" && K.nodeType === Z.REFERENCE && x === K.endIndex + 2), L = E && No(E) && (!I || Mo(I) && I !== ct.OPEN_BRACKET), U = !!A;
|
|
1041
|
+
if ((M == null ? void 0 : M.substring(0, 1)) === "=" && (L || U))
|
|
1042
|
+
if (U) {
|
|
1043
1043
|
if (g.current)
|
|
1044
1044
|
return;
|
|
1045
1045
|
!A.range.sheetName && k.getSheetId() === (R == null ? void 0 : R.getSheetId()) || A.range.sheetName === k.getName() ? C(
|
|
@@ -1060,17 +1060,17 @@ function ei(e) {
|
|
|
1060
1060
|
/* NOT_SELECT */
|
|
1061
1061
|
);
|
|
1062
1062
|
});
|
|
1063
|
-
return
|
|
1064
|
-
const k = m.textSelection$.pipe(
|
|
1063
|
+
return $(() => {
|
|
1064
|
+
const k = m.textSelection$.pipe(Qt((F) => F.unitId === t)).subscribe(() => {
|
|
1065
1065
|
y();
|
|
1066
1066
|
});
|
|
1067
1067
|
return () => k.unsubscribe();
|
|
1068
|
-
}, [y, m.textSelection$, t]),
|
|
1068
|
+
}, [y, m.textSelection$, t]), $(() => {
|
|
1069
1069
|
n || (C(
|
|
1070
1070
|
0
|
|
1071
1071
|
/* NOT_SELECT */
|
|
1072
1072
|
), g.current = !0);
|
|
1073
|
-
}, [n, C]),
|
|
1073
|
+
}, [n, C]), $(() => {
|
|
1074
1074
|
var F;
|
|
1075
1075
|
if (!o) return;
|
|
1076
1076
|
const k = (F = f == null ? void 0 : f.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
|
|
@@ -1080,20 +1080,20 @@ function ei(e) {
|
|
|
1080
1080
|
), g.current = !0;
|
|
1081
1081
|
});
|
|
1082
1082
|
return () => k == null ? void 0 : k.unsubscribe();
|
|
1083
|
-
}, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, C]),
|
|
1083
|
+
}, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, C]), $(() => {
|
|
1084
1084
|
if (!n) return;
|
|
1085
1085
|
const k = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
|
|
1086
1086
|
y();
|
|
1087
1087
|
});
|
|
1088
1088
|
return () => k == null ? void 0 : k.unsubscribe();
|
|
1089
|
-
}, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef:
|
|
1089
|
+
}, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef: v };
|
|
1090
1090
|
}
|
|
1091
|
-
const
|
|
1092
|
-
const e = T(
|
|
1093
|
-
return
|
|
1091
|
+
const ri = () => {
|
|
1092
|
+
const e = T(_e);
|
|
1093
|
+
return wt((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
1094
1094
|
};
|
|
1095
|
-
function
|
|
1096
|
-
const o = new
|
|
1095
|
+
function oi(e, t, n) {
|
|
1096
|
+
const o = new sn(t).setAlpha(0.05).toRgbString();
|
|
1097
1097
|
return {
|
|
1098
1098
|
id: n,
|
|
1099
1099
|
strokeWidth: 1,
|
|
@@ -1105,7 +1105,7 @@ function ni(e, t, n) {
|
|
|
1105
1105
|
widgetStroke: e.getColorFromTheme("white")
|
|
1106
1106
|
};
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function yr(e) {
|
|
1109
1109
|
var _, R, C;
|
|
1110
1110
|
const {
|
|
1111
1111
|
unitId: t,
|
|
@@ -1115,42 +1115,42 @@ function Er(e) {
|
|
|
1115
1115
|
editor: s,
|
|
1116
1116
|
refSelectionsService: c,
|
|
1117
1117
|
refSelectionsRenderService: i,
|
|
1118
|
-
sheetSkeletonManagerService:
|
|
1118
|
+
sheetSkeletonManagerService: l,
|
|
1119
1119
|
themeService: f,
|
|
1120
1120
|
univerInstanceService: h
|
|
1121
|
-
} = e, m = o.getUnitId(), u = h.getUnit(t,
|
|
1121
|
+
} = e, m = o.getUnitId(), u = h.getUnit(t, q.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), a = [];
|
|
1122
1122
|
if (!u || !d) {
|
|
1123
|
-
c.setSelections(
|
|
1123
|
+
c.setSelections(a);
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const S = d.getSheetId(), g = (y) => {
|
|
1127
1127
|
var N;
|
|
1128
1128
|
return (N = u == null ? void 0 : u.getSheetBySheetName(y)) == null ? void 0 : N.getSheetId();
|
|
1129
1129
|
};
|
|
1130
|
-
if (!((_ =
|
|
1131
|
-
const
|
|
1130
|
+
if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(S)) == null ? void 0 : _.skeleton)) return;
|
|
1131
|
+
const v = [];
|
|
1132
1132
|
for (let y = 0, N = r.length; y < N; y++) {
|
|
1133
|
-
const k = r[y], { themeColor: F, token: x, refIndex: w, endIndex: M } = k,
|
|
1134
|
-
if (m !== t &&
|
|
1133
|
+
const k = r[y], { themeColor: F, token: x, refIndex: w, endIndex: M } = k, b = ut(x), { unitId: E, sheetName: I, range: A } = b, L = g(I);
|
|
1134
|
+
if (m !== t && E !== m || E && E !== m || L && L !== S || !L && S !== n)
|
|
1135
1135
|
continue;
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1138
|
-
range:
|
|
1136
|
+
const U = Jo(A, d.getRowCount(), d.getColumnCount());
|
|
1137
|
+
U.unitId = t, U.sheetId = S, a.push({
|
|
1138
|
+
range: U,
|
|
1139
1139
|
primary: null,
|
|
1140
|
-
style:
|
|
1141
|
-
}),
|
|
1140
|
+
style: oi(f, F, w.toString())
|
|
1141
|
+
}), v.push(M);
|
|
1142
1142
|
}
|
|
1143
1143
|
if (s) {
|
|
1144
|
-
const y = (C = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : C.startOffset, N =
|
|
1144
|
+
const y = (C = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : C.startOffset, N = v.findIndex((k) => k + 2 === y);
|
|
1145
1145
|
N !== -1 ? i == null || i.setActiveSelectionIndex(N) : i == null || i.resetActiveSelectionIndex();
|
|
1146
1146
|
}
|
|
1147
|
-
return
|
|
1147
|
+
return a;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const n = T(ee), o = T(
|
|
1151
|
-
const u = n.getCurrentUnitOfType(
|
|
1149
|
+
function si(e, t) {
|
|
1150
|
+
const n = T(ee), o = T(_t), r = T(Wt), c = T(Oe).getRenderById(e), i = c == null ? void 0 : c.with(De), l = c == null ? void 0 : c.with(Vt), f = J((h, m) => {
|
|
1151
|
+
const u = n.getCurrentUnitOfType(q.UNIVER_SHEET);
|
|
1152
1152
|
if (!u || i != null && i.selectionMoving) return;
|
|
1153
|
-
const d =
|
|
1153
|
+
const d = yr({
|
|
1154
1154
|
unitId: e,
|
|
1155
1155
|
subUnitId: t,
|
|
1156
1156
|
currentWorkbook: u,
|
|
@@ -1158,59 +1158,59 @@ function ri(e, t) {
|
|
|
1158
1158
|
editor: m,
|
|
1159
1159
|
refSelectionsService: r,
|
|
1160
1160
|
refSelectionsRenderService: i,
|
|
1161
|
-
sheetSkeletonManagerService:
|
|
1161
|
+
sheetSkeletonManagerService: l,
|
|
1162
1162
|
themeService: o,
|
|
1163
1163
|
univerInstanceService: n
|
|
1164
1164
|
});
|
|
1165
1165
|
if (!d) return;
|
|
1166
1166
|
((i == null ? void 0 : i.getSelectionControls()) || []).length === d.length ? i == null || i.resetSelectionsByModelData(d) : r.setSelections(d);
|
|
1167
1167
|
});
|
|
1168
|
-
return
|
|
1168
|
+
return $(() => () => {
|
|
1169
1169
|
i == null || i.resetActiveSelectionIndex();
|
|
1170
1170
|
}, [i]), f;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const t = T(
|
|
1174
|
-
return
|
|
1172
|
+
function Tr(e = "") {
|
|
1173
|
+
const t = T(Ht), n = ii(), o = T(ue), r = oe(() => e.length, [e]);
|
|
1174
|
+
return J((c, i, l = !0, f) => {
|
|
1175
1175
|
const h = c.getDocumentData(), m = c.getEditorId();
|
|
1176
1176
|
if (!h)
|
|
1177
1177
|
return [];
|
|
1178
1178
|
const u = h.body;
|
|
1179
1179
|
if (!u)
|
|
1180
1180
|
return [];
|
|
1181
|
-
const d = u.dataStream.slice(0, u.dataStream.length - 2),
|
|
1181
|
+
const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...h.body };
|
|
1182
1182
|
if (!d.startsWith(e)) return [];
|
|
1183
1183
|
if (i == null || i.length === 0)
|
|
1184
|
-
return
|
|
1184
|
+
return a.textRuns = [], o.syncExecuteCommand(wn.id, {
|
|
1185
1185
|
unitId: m,
|
|
1186
|
-
body:
|
|
1186
|
+
body: bn(a, 0, a.dataStream.length - 2)
|
|
1187
1187
|
}), [];
|
|
1188
1188
|
{
|
|
1189
|
-
const { textRuns:
|
|
1190
|
-
r &&
|
|
1189
|
+
const { textRuns: S, refSelections: g } = ci(t, n, i);
|
|
1190
|
+
r && S.forEach((_) => {
|
|
1191
1191
|
_.ed = _.ed + r, _.st = _.st + r;
|
|
1192
|
-
}),
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1192
|
+
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
|
|
1193
|
+
const p = i.reduce((_, R) => typeof R == "string" ? `${_}${R}` : `${_}${R.token}`, "");
|
|
1194
|
+
a.dataStream = `${e}${p}\r
|
|
1195
1195
|
`;
|
|
1196
|
-
let
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
1199
|
-
const _ =
|
|
1200
|
-
|
|
1196
|
+
let v;
|
|
1197
|
+
if (l) {
|
|
1198
|
+
v = c.getSelectionRanges();
|
|
1199
|
+
const _ = a.dataStream.length - 2 + r;
|
|
1200
|
+
v.forEach((R) => {
|
|
1201
1201
|
R.startOffset = Math.max(0, Math.min(R.startOffset, _)), R.endOffset = Math.max(0, Math.min(R.endOffset, _));
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
return o.syncExecuteCommand(
|
|
1204
|
+
return o.syncExecuteCommand(wn.id, {
|
|
1205
1205
|
unitId: m,
|
|
1206
|
-
body:
|
|
1207
|
-
textRanges: f != null ? f :
|
|
1206
|
+
body: bn(a, 0, a.dataStream.length - 2),
|
|
1207
|
+
textRanges: f != null ? f : v
|
|
1208
1208
|
}), g;
|
|
1209
1209
|
}
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1213
|
-
const e = T(
|
|
1212
|
+
function ii() {
|
|
1213
|
+
const e = T(_t), t = e.getCurrentTheme();
|
|
1214
1214
|
return oe(() => {
|
|
1215
1215
|
const o = [
|
|
1216
1216
|
e.getColorFromTheme("loop-color.1"),
|
|
@@ -1229,8 +1229,8 @@ function oi() {
|
|
|
1229
1229
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c };
|
|
1230
1230
|
}, [t]);
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1233
|
-
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [],
|
|
1232
|
+
function ci(e, t, n) {
|
|
1233
|
+
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [], f = /* @__PURE__ */ new Map();
|
|
1234
1234
|
let h = 0;
|
|
1235
1235
|
for (let m = 0, u = n.length; m < u; m++) {
|
|
1236
1236
|
const d = n[m];
|
|
@@ -1261,36 +1261,36 @@ function si(e, t, n) {
|
|
|
1261
1261
|
});
|
|
1262
1262
|
continue;
|
|
1263
1263
|
}
|
|
1264
|
-
const { startIndex:
|
|
1265
|
-
let
|
|
1266
|
-
if (g ===
|
|
1267
|
-
if (f.has(
|
|
1268
|
-
|
|
1264
|
+
const { startIndex: a, endIndex: S, nodeType: g, token: p } = d;
|
|
1265
|
+
let v = "";
|
|
1266
|
+
if (g === Z.REFERENCE) {
|
|
1267
|
+
if (f.has(p))
|
|
1268
|
+
v = f.get(p);
|
|
1269
1269
|
else {
|
|
1270
1270
|
const _ = h % o.length;
|
|
1271
|
-
|
|
1271
|
+
v = o[_], f.set(p, v), h++;
|
|
1272
1272
|
}
|
|
1273
|
-
|
|
1273
|
+
l.push({
|
|
1274
1274
|
refIndex: m,
|
|
1275
|
-
themeColor:
|
|
1276
|
-
token:
|
|
1275
|
+
themeColor: v,
|
|
1276
|
+
token: p,
|
|
1277
1277
|
startIndex: d.startIndex,
|
|
1278
1278
|
endIndex: d.endIndex,
|
|
1279
|
-
index:
|
|
1279
|
+
index: l.length
|
|
1280
1280
|
});
|
|
1281
|
-
} else g ===
|
|
1282
|
-
|
|
1283
|
-
st:
|
|
1284
|
-
ed:
|
|
1281
|
+
} else g === Z.NUMBER ? v = r : (g === Z.STRING || g === Z.ARRAY) && (v = s);
|
|
1282
|
+
v && v.length > 0 ? i.push({
|
|
1283
|
+
st: a,
|
|
1284
|
+
ed: S + 1,
|
|
1285
1285
|
ts: {
|
|
1286
1286
|
cl: {
|
|
1287
|
-
rgb:
|
|
1287
|
+
rgb: v
|
|
1288
1288
|
},
|
|
1289
1289
|
fs: 11
|
|
1290
1290
|
}
|
|
1291
1291
|
}) : i.push({
|
|
1292
|
-
st:
|
|
1293
|
-
ed:
|
|
1292
|
+
st: a,
|
|
1293
|
+
ed: S + 1,
|
|
1294
1294
|
ts: {
|
|
1295
1295
|
cl: {
|
|
1296
1296
|
rgb: c
|
|
@@ -1299,276 +1299,276 @@ function si(e, t, n) {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
|
-
return { textRuns: i, refSelections:
|
|
1302
|
+
return { textRuns: i, refSelections: l };
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1305
|
-
const r = T(ue), s = T(
|
|
1304
|
+
const ai = (e, t, n, o) => {
|
|
1305
|
+
const r = T(ue), s = T(Bt), c = G(t);
|
|
1306
1306
|
c.current = t;
|
|
1307
|
-
const i =
|
|
1308
|
-
i.current = o,
|
|
1307
|
+
const i = G(o);
|
|
1308
|
+
i.current = o, $(() => {
|
|
1309
1309
|
if (!n || !e)
|
|
1310
1310
|
return;
|
|
1311
|
-
const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new
|
|
1311
|
+
const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new He(), m = (a, S) => {
|
|
1312
1312
|
if (i.current) {
|
|
1313
|
-
i.current(
|
|
1313
|
+
i.current(a, S);
|
|
1314
1314
|
return;
|
|
1315
1315
|
}
|
|
1316
1316
|
let g = ce.LEFT;
|
|
1317
|
-
|
|
1317
|
+
a === D.ARROW_DOWN ? g = ce.DOWN : a === D.ARROW_UP ? g = ce.UP : a === D.ARROW_RIGHT && (g = ce.RIGHT), S === P.SHIFT ? r.executeCommand(qo.id, {
|
|
1318
1318
|
direction: g
|
|
1319
|
-
}) : r.executeCommand(
|
|
1319
|
+
}) : r.executeCommand(Ko.id, {
|
|
1320
1320
|
direction: g
|
|
1321
1321
|
});
|
|
1322
|
-
}, u = (
|
|
1322
|
+
}, u = (a, S) => {
|
|
1323
1323
|
let g = ce.DOWN;
|
|
1324
|
-
|
|
1324
|
+
a === D.ARROW_DOWN ? g = ce.DOWN : a === D.ARROW_UP ? g = ce.UP : a === D.ARROW_LEFT ? g = ce.LEFT : a === D.ARROW_RIGHT && (g = ce.RIGHT), c.current ? S === P.CTRL_COMMAND ? r.executeCommand(Tn.id, {
|
|
1325
1325
|
direction: g,
|
|
1326
|
-
jumpOver:
|
|
1326
|
+
jumpOver: xn.moveGap,
|
|
1327
1327
|
extra: "formula-editor",
|
|
1328
|
-
fromCurrentSelection: c.current ===
|
|
1329
|
-
}) :
|
|
1328
|
+
fromCurrentSelection: c.current === ke.NEED_ADD || c.current === ke.EDIT_OTHER_SHEET_REFERENCE
|
|
1329
|
+
}) : S === P.SHIFT ? r.executeCommand(On.id, {
|
|
1330
1330
|
direction: g,
|
|
1331
1331
|
extra: "formula-editor"
|
|
1332
|
-
}) :
|
|
1332
|
+
}) : S === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(On.id, {
|
|
1333
1333
|
direction: g,
|
|
1334
|
-
jumpOver:
|
|
1334
|
+
jumpOver: xn.moveGap,
|
|
1335
1335
|
extra: "formula-editor"
|
|
1336
|
-
}) : r.executeCommand(
|
|
1336
|
+
}) : r.executeCommand(Tn.id, {
|
|
1337
1337
|
direction: g,
|
|
1338
1338
|
extra: "formula-editor",
|
|
1339
|
-
fromCurrentSelection: c.current ===
|
|
1340
|
-
}) : m(
|
|
1339
|
+
fromCurrentSelection: c.current === ke.NEED_ADD || c.current === ke.EDIT_OTHER_SHEET_REFERENCE
|
|
1340
|
+
}) : m(a, S);
|
|
1341
1341
|
};
|
|
1342
1342
|
return h.add(r.registerCommand({
|
|
1343
1343
|
id: f,
|
|
1344
|
-
type:
|
|
1345
|
-
handler(
|
|
1346
|
-
const { keyCode: g, metaKey:
|
|
1347
|
-
u(g,
|
|
1344
|
+
type: Te.OPERATION,
|
|
1345
|
+
handler(a, S) {
|
|
1346
|
+
const { keyCode: g, metaKey: p } = S;
|
|
1347
|
+
u(g, p);
|
|
1348
1348
|
}
|
|
1349
1349
|
})), [
|
|
1350
|
-
{ keyCode:
|
|
1351
|
-
{ keyCode:
|
|
1352
|
-
{ keyCode:
|
|
1353
|
-
{ keyCode:
|
|
1354
|
-
{ keyCode:
|
|
1355
|
-
{ keyCode:
|
|
1356
|
-
{ keyCode:
|
|
1357
|
-
{ keyCode:
|
|
1358
|
-
{ keyCode:
|
|
1359
|
-
{ keyCode:
|
|
1360
|
-
{ keyCode:
|
|
1361
|
-
{ keyCode:
|
|
1362
|
-
{ keyCode:
|
|
1363
|
-
{ keyCode:
|
|
1364
|
-
{ keyCode:
|
|
1365
|
-
{ keyCode:
|
|
1366
|
-
].map(({ keyCode:
|
|
1350
|
+
{ keyCode: D.ARROW_DOWN },
|
|
1351
|
+
{ keyCode: D.ARROW_LEFT },
|
|
1352
|
+
{ keyCode: D.ARROW_RIGHT },
|
|
1353
|
+
{ keyCode: D.ARROW_UP },
|
|
1354
|
+
{ keyCode: D.ARROW_DOWN, metaKey: P.SHIFT },
|
|
1355
|
+
{ keyCode: D.ARROW_LEFT, metaKey: P.SHIFT },
|
|
1356
|
+
{ keyCode: D.ARROW_RIGHT, metaKey: P.SHIFT },
|
|
1357
|
+
{ keyCode: D.ARROW_UP, metaKey: P.SHIFT },
|
|
1358
|
+
{ keyCode: D.ARROW_DOWN, metaKey: P.CTRL_COMMAND },
|
|
1359
|
+
{ keyCode: D.ARROW_LEFT, metaKey: P.CTRL_COMMAND },
|
|
1360
|
+
{ keyCode: D.ARROW_RIGHT, metaKey: P.CTRL_COMMAND },
|
|
1361
|
+
{ keyCode: D.ARROW_UP, metaKey: P.CTRL_COMMAND },
|
|
1362
|
+
{ keyCode: D.ARROW_DOWN, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
1363
|
+
{ keyCode: D.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
1364
|
+
{ keyCode: D.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
1365
|
+
{ keyCode: D.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
|
|
1366
|
+
].map(({ keyCode: a, metaKey: S }) => ({
|
|
1367
1367
|
id: f,
|
|
1368
|
-
binding:
|
|
1368
|
+
binding: S ? a | S : a,
|
|
1369
1369
|
preconditions: () => !0,
|
|
1370
1370
|
priority: 900,
|
|
1371
1371
|
staticParameters: {
|
|
1372
|
-
eventType:
|
|
1373
|
-
keyCode:
|
|
1374
|
-
metaKey:
|
|
1372
|
+
eventType: xe.Keyboard,
|
|
1373
|
+
keyCode: a,
|
|
1374
|
+
metaKey: S
|
|
1375
1375
|
}
|
|
1376
|
-
})).forEach((
|
|
1377
|
-
h.add(s.registerShortcut(
|
|
1376
|
+
})).forEach((a) => {
|
|
1377
|
+
h.add(s.registerShortcut(a));
|
|
1378
1378
|
}), () => {
|
|
1379
1379
|
h.dispose();
|
|
1380
1380
|
};
|
|
1381
1381
|
}, [r, n, e, s]);
|
|
1382
|
-
},
|
|
1382
|
+
}, li = (e, t, n, o = !0) => {
|
|
1383
1383
|
var u;
|
|
1384
|
-
const r = T(
|
|
1385
|
-
|
|
1384
|
+
const r = T(Oe), s = T(rn), c = T(ls), i = T(Wt), l = T(ee), f = Ce(oe(() => l.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [l])), h = r.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), m = h == null ? void 0 : h.with(De);
|
|
1385
|
+
At(() => {
|
|
1386
1386
|
if (e)
|
|
1387
|
-
return s.setContextValue(
|
|
1388
|
-
s.setContextValue(
|
|
1387
|
+
return s.setContextValue(Tt, !0), () => {
|
|
1388
|
+
s.setContextValue(Tt, !1), i.clear();
|
|
1389
1389
|
};
|
|
1390
|
-
}, [s, e, i]),
|
|
1390
|
+
}, [s, e, i]), At(() => {
|
|
1391
1391
|
if (e && t) {
|
|
1392
1392
|
const d = m == null ? void 0 : m.enableSelectionChanging();
|
|
1393
|
-
return s.setContextValue(
|
|
1394
|
-
s.setContextValue(
|
|
1393
|
+
return s.setContextValue(Fn, !0), () => {
|
|
1394
|
+
s.setContextValue(Fn, !1), d == null || d.dispose();
|
|
1395
1395
|
};
|
|
1396
1396
|
}
|
|
1397
|
-
}, [s, e, m, t]),
|
|
1397
|
+
}, [s, e, m, t]), $(() => {
|
|
1398
1398
|
if (e)
|
|
1399
|
-
return s.setContextValue(
|
|
1400
|
-
s.setContextValue(
|
|
1399
|
+
return s.setContextValue(Tt, !0), o && c.disable(), () => {
|
|
1400
|
+
s.setContextValue(Tt, !1), o && c.enable();
|
|
1401
1401
|
};
|
|
1402
|
-
}, [c, s, e, o]),
|
|
1402
|
+
}, [c, s, e, o]), $(() => {
|
|
1403
1403
|
e && (m == null || m.setSkipLastEnabled(!1));
|
|
1404
1404
|
}, [e, m]);
|
|
1405
|
-
},
|
|
1406
|
-
const o = T(ee), r = T(
|
|
1407
|
-
return
|
|
1405
|
+
}, ui = (e, t, n) => {
|
|
1406
|
+
const o = T(ee), r = T(ln);
|
|
1407
|
+
return wt(() => {
|
|
1408
1408
|
if (e) {
|
|
1409
|
-
const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(
|
|
1410
|
-
(i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t),
|
|
1409
|
+
const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(q.UNIVER_SHEET), l = i == null ? void 0 : i.getActiveSheet();
|
|
1410
|
+
(i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(c);
|
|
1411
1411
|
}
|
|
1412
1412
|
}, [e, r, n, t, o]);
|
|
1413
|
-
},
|
|
1413
|
+
}, di = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), tn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), xt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => ve(r.range)) : e.map((r) => o ? wo(r) : r.sheetName !== "" && r.sheetName !== n ? St(r.sheetName, r.range) : ve(r.range)), hi = (e) => {
|
|
1414
1414
|
var h, m, u;
|
|
1415
1415
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
1416
1416
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
1417
1417
|
return;
|
|
1418
1418
|
const s = o[0].startOffset - 1, c = ((m = (h = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : h.dataStream) != null ? m : `\r
|
|
1419
|
-
`).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [],
|
|
1419
|
+
`).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], l = pn(i, s, !1), f = mr(i, l);
|
|
1420
1420
|
return {
|
|
1421
|
-
nodeIndex:
|
|
1421
|
+
nodeIndex: l,
|
|
1422
1422
|
updatingRefIndex: f,
|
|
1423
1423
|
sequenceNodes: i,
|
|
1424
1424
|
offset: s
|
|
1425
1425
|
};
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1426
|
+
}, fi = () => {
|
|
1427
|
+
}, gi = (e, t, n, o, r, s, c, i, l, f = fi) => {
|
|
1428
1428
|
var w;
|
|
1429
|
-
const h = T(
|
|
1430
|
-
var
|
|
1431
|
-
return (
|
|
1432
|
-
}),
|
|
1433
|
-
var H, se,
|
|
1434
|
-
const
|
|
1435
|
-
if (!
|
|
1436
|
-
const { nodeIndex: I, updatingRefIndex: A, sequenceNodes:
|
|
1437
|
-
if (n.current ===
|
|
1438
|
-
if (
|
|
1439
|
-
if (I === -1 &&
|
|
1429
|
+
const h = T(Oe), m = T(ee), u = T(ue), d = T(ur), a = T(_t), S = T(_e), g = m.getUnit(o), p = J((M) => {
|
|
1430
|
+
var b, E;
|
|
1431
|
+
return (E = (b = g == null ? void 0 : g.getSheetBySheetId(M)) == null ? void 0 : b.getName()) != null ? E : "";
|
|
1432
|
+
}), v = oe(() => p(r), [p, r]), _ = Ce(g == null ? void 0 : g.activeSheet$), R = Je({ activeSheet: _, sheetName: v }), C = Ce(oe(() => m.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [m])), y = h.getRenderById((w = C == null ? void 0 : C.getUnitId()) != null ? w : ""), N = y == null ? void 0 : y.with(De), k = y == null ? void 0 : y.with(Vt), F = T(Wt), x = J((M, b) => {
|
|
1433
|
+
var H, se, K, Re, et, ne;
|
|
1434
|
+
const E = hi({ editor: l, lexerTreeBuilder: S });
|
|
1435
|
+
if (!E) return;
|
|
1436
|
+
const { nodeIndex: I, updatingRefIndex: A, sequenceNodes: L, offset: U } = E;
|
|
1437
|
+
if (n.current === ke.NEED_ADD)
|
|
1438
|
+
if (U !== 0) {
|
|
1439
|
+
if (I === -1 && L.length)
|
|
1440
1440
|
return;
|
|
1441
|
-
const
|
|
1442
|
-
range:
|
|
1443
|
-
unitId: (se =
|
|
1444
|
-
sheetName:
|
|
1445
|
-
},
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
f(de,
|
|
1441
|
+
const X = M[M.length - 1], Q = L.splice(I + 1), ge = (H = X.sheetId) != null ? H : r, te = {
|
|
1442
|
+
range: X,
|
|
1443
|
+
unitId: (se = X.unitId) != null ? se : C.getUnitId(),
|
|
1444
|
+
sheetName: p(ge)
|
|
1445
|
+
}, me = ge !== r, ae = (C == null ? void 0 : C.getUnitId()) !== o, tt = xt([te], c && (me || ae), v, ae);
|
|
1446
|
+
L.push({ token: tt[0], nodeType: Z.REFERENCE });
|
|
1447
|
+
const Le = [...L, ...Q], de = tn(Le);
|
|
1448
|
+
f(de, di(L), b);
|
|
1449
1449
|
} else {
|
|
1450
|
-
const
|
|
1451
|
-
range:
|
|
1452
|
-
unitId: (
|
|
1453
|
-
sheetName:
|
|
1454
|
-
},
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
f(
|
|
1450
|
+
const X = M[M.length - 1], Q = (K = X.sheetId) != null ? K : r, ge = {
|
|
1451
|
+
range: X,
|
|
1452
|
+
unitId: (Re = X.unitId) != null ? Re : o,
|
|
1453
|
+
sheetName: p(Q)
|
|
1454
|
+
}, me = xt([ge], c && Q !== r);
|
|
1455
|
+
L.unshift({ token: me[0], nodeType: Z.REFERENCE });
|
|
1456
|
+
const ae = tn(L);
|
|
1457
|
+
f(ae, me[0].length, b);
|
|
1458
1458
|
}
|
|
1459
|
-
else if (n.current ===
|
|
1460
|
-
const
|
|
1461
|
-
if (!
|
|
1462
|
-
const
|
|
1463
|
-
if (typeof
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
const te =
|
|
1467
|
-
f(
|
|
1459
|
+
else if (n.current === ke.EDIT_OTHER_SHEET_REFERENCE) {
|
|
1460
|
+
const X = M.pop();
|
|
1461
|
+
if (!X) return;
|
|
1462
|
+
const Q = L[I];
|
|
1463
|
+
if (typeof Q == "object" && Q.nodeType === Z.REFERENCE) {
|
|
1464
|
+
const ge = Q.token;
|
|
1465
|
+
Q.token = v === (_ == null ? void 0 : _.getName()) ? ve(X) : St(_.getName(), X);
|
|
1466
|
+
const te = U + (Q.token.length - ge.length);
|
|
1467
|
+
f(Ao(L), te, b);
|
|
1468
1468
|
}
|
|
1469
1469
|
} else {
|
|
1470
|
-
const
|
|
1470
|
+
const X = [...M];
|
|
1471
1471
|
if (A !== -1) {
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1472
|
+
const z = X.pop();
|
|
1473
|
+
z && X.splice(A, 0, z);
|
|
1474
1474
|
}
|
|
1475
|
-
let
|
|
1476
|
-
const
|
|
1477
|
-
var
|
|
1478
|
-
if (typeof
|
|
1479
|
-
return
|
|
1480
|
-
if (
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1483
|
-
return
|
|
1484
|
-
const be =
|
|
1485
|
-
if (
|
|
1475
|
+
let Q = 0;
|
|
1476
|
+
const ge = L.map((z) => {
|
|
1477
|
+
var pe, Ee, Me;
|
|
1478
|
+
if (typeof z == "string")
|
|
1479
|
+
return z;
|
|
1480
|
+
if (z.nodeType === Z.REFERENCE) {
|
|
1481
|
+
const $e = ut(z.token);
|
|
1482
|
+
if ($e.sheetName || ($e.sheetName = v), c && ((pe = R.current.activeSheet) == null ? void 0 : pe.getName()) !== $e.sheetName)
|
|
1483
|
+
return z.token;
|
|
1484
|
+
const be = X[Q];
|
|
1485
|
+
if (Q++, !be)
|
|
1486
1486
|
return "";
|
|
1487
|
-
const
|
|
1487
|
+
const qt = (Ee = be.sheetId) != null ? Ee : r, Kt = {
|
|
1488
1488
|
range: be,
|
|
1489
|
-
unitId: (
|
|
1490
|
-
sheetName:
|
|
1489
|
+
unitId: (Me = be.unitId) != null ? Me : o,
|
|
1490
|
+
sheetName: p(qt)
|
|
1491
1491
|
};
|
|
1492
|
-
return
|
|
1492
|
+
return xt([Kt], c, v)[0];
|
|
1493
1493
|
}
|
|
1494
|
-
return
|
|
1494
|
+
return z.token;
|
|
1495
1495
|
});
|
|
1496
|
-
let te = "",
|
|
1497
|
-
|
|
1498
|
-
te +=
|
|
1496
|
+
let te = "", me;
|
|
1497
|
+
ge.forEach((z, pe) => {
|
|
1498
|
+
te += z, pe === I && (me = te.length);
|
|
1499
1499
|
});
|
|
1500
|
-
const
|
|
1501
|
-
for (let
|
|
1502
|
-
const
|
|
1503
|
-
range:
|
|
1504
|
-
unitId: (ne =
|
|
1505
|
-
sheetName:
|
|
1506
|
-
}, be =
|
|
1507
|
-
|
|
1500
|
+
const ae = [];
|
|
1501
|
+
for (let z = Q; z <= M.length - 1; z++) {
|
|
1502
|
+
const pe = M[z], Ee = (et = pe.sheetId) != null ? et : r, Me = {
|
|
1503
|
+
range: pe,
|
|
1504
|
+
unitId: (ne = pe.unitId) != null ? ne : o,
|
|
1505
|
+
sheetName: p(Ee)
|
|
1506
|
+
}, be = xt([Me], c && Ee !== r, v);
|
|
1507
|
+
ae.push(be[0]);
|
|
1508
1508
|
}
|
|
1509
|
-
const
|
|
1510
|
-
f(de, !
|
|
1509
|
+
const tt = L[L.length - 1], Le = tt && (typeof tt == "string" ? !1 : tt.nodeType === Z.REFERENCE), de = `${te}${ae.length && Le ? "," : ""}${ae.join(",")}`;
|
|
1510
|
+
f(de, !ae.length && me ? me : de.length, b);
|
|
1511
1511
|
}
|
|
1512
1512
|
});
|
|
1513
|
-
|
|
1513
|
+
$(() => {
|
|
1514
1514
|
if (N && e) {
|
|
1515
1515
|
let M = !0;
|
|
1516
|
-
const
|
|
1516
|
+
const b = (I, A) => {
|
|
1517
1517
|
if (M) {
|
|
1518
1518
|
M = !1;
|
|
1519
1519
|
return;
|
|
1520
1520
|
}
|
|
1521
|
-
x(I.map((
|
|
1522
|
-
},
|
|
1523
|
-
return
|
|
1524
|
-
|
|
1525
|
-
})),
|
|
1526
|
-
|
|
1521
|
+
x(I.map((L) => L.rangeWithCoord), A);
|
|
1522
|
+
}, E = new He();
|
|
1523
|
+
return E.add(N.selectionMoving$.subscribe((I) => {
|
|
1524
|
+
b(I, !1);
|
|
1525
|
+
})), E.add(N.selectionMoveEnd$.subscribe((I) => {
|
|
1526
|
+
b(I, !0);
|
|
1527
1527
|
})), () => {
|
|
1528
|
-
|
|
1528
|
+
E.dispose();
|
|
1529
1529
|
};
|
|
1530
1530
|
}
|
|
1531
|
-
}, [e, x, N]),
|
|
1532
|
-
if (t && N &&
|
|
1533
|
-
const M = new
|
|
1534
|
-
M.dispose(), N.getSelectionControls().forEach((A,
|
|
1531
|
+
}, [e, x, N]), $(() => {
|
|
1532
|
+
if (t && N && l) {
|
|
1533
|
+
const M = new He(), b = () => {
|
|
1534
|
+
M.dispose(), N.getSelectionControls().forEach((A, L) => {
|
|
1535
1535
|
M.add(
|
|
1536
|
-
A.selectionScaling$.subscribe((
|
|
1537
|
-
const H = N.getSelectionDataWithStyle().map((
|
|
1538
|
-
|
|
1536
|
+
A.selectionScaling$.subscribe((U) => {
|
|
1537
|
+
const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), se = H[L];
|
|
1538
|
+
U.sheetId = se.sheetId, U.unitId = se.unitId, H[L] = U, x(H, !1);
|
|
1539
1539
|
})
|
|
1540
1540
|
), M.add(
|
|
1541
|
-
A.selectionMoving$.subscribe((
|
|
1542
|
-
const H = N.getSelectionDataWithStyle().map((
|
|
1543
|
-
|
|
1541
|
+
A.selectionMoving$.subscribe((U) => {
|
|
1542
|
+
const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), se = H[L];
|
|
1543
|
+
U.sheetId = se.sheetId, U.unitId = se.unitId, H[L] = U, x(H, !0);
|
|
1544
1544
|
})
|
|
1545
1545
|
);
|
|
1546
1546
|
});
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1547
|
+
}, E = Wo(
|
|
1548
|
+
l.input$,
|
|
1549
1549
|
F.selectionSet$,
|
|
1550
1550
|
N.selectionMoveEnd$
|
|
1551
1551
|
).pipe(
|
|
1552
|
-
|
|
1552
|
+
Es(50)
|
|
1553
1553
|
).subscribe(() => {
|
|
1554
|
-
|
|
1554
|
+
b();
|
|
1555
1555
|
});
|
|
1556
1556
|
return () => {
|
|
1557
|
-
|
|
1557
|
+
E.unsubscribe(), M.dispose();
|
|
1558
1558
|
};
|
|
1559
1559
|
}
|
|
1560
|
-
}, [
|
|
1560
|
+
}, [l, t, x, N, F.selectionSet$]), N == null || N.getSelectionDataWithStyle(), $(() => {
|
|
1561
1561
|
if (i) {
|
|
1562
|
-
const M = u.onCommandExecuted((
|
|
1562
|
+
const M = u.onCommandExecuted((b) => {
|
|
1563
1563
|
var I;
|
|
1564
|
-
if (
|
|
1564
|
+
if (b.id !== un.id)
|
|
1565
1565
|
return;
|
|
1566
|
-
const
|
|
1567
|
-
if (
|
|
1568
|
-
const A =
|
|
1566
|
+
const E = b.params;
|
|
1567
|
+
if (E.extra === "formula-editor" && E.selections.length) {
|
|
1568
|
+
const A = E.selections[E.selections.length - 1];
|
|
1569
1569
|
if (A) {
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1570
|
+
const L = n.current === ke.NEED_ADD, U = ((I = N == null ? void 0 : N.getSelectionDataWithStyle()) != null ? I : []).map((H) => H.rangeWithCoord);
|
|
1571
|
+
L ? U.push(A.range) : U[U.length - 1] = A.range, x(U, !0);
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
1574
|
});
|
|
@@ -1576,51 +1576,51 @@ const ii = (e, t, n, o) => {
|
|
|
1576
1576
|
M.dispose();
|
|
1577
1577
|
};
|
|
1578
1578
|
}
|
|
1579
|
-
}, [u,
|
|
1580
|
-
if (!
|
|
1579
|
+
}, [u, l, n, S, i, x, N]), $(() => {
|
|
1580
|
+
if (!l)
|
|
1581
1581
|
return;
|
|
1582
|
-
const M = d.textSelection$.subscribe((
|
|
1583
|
-
|
|
1582
|
+
const M = d.textSelection$.subscribe((b) => {
|
|
1583
|
+
b.unitId === l.getEditorId() && yr({
|
|
1584
1584
|
unitId: o,
|
|
1585
1585
|
subUnitId: r,
|
|
1586
1586
|
refSelections: s.current,
|
|
1587
|
-
editor:
|
|
1587
|
+
editor: l,
|
|
1588
1588
|
refSelectionsService: F,
|
|
1589
1589
|
refSelectionsRenderService: N,
|
|
1590
1590
|
sheetSkeletonManagerService: k,
|
|
1591
|
-
themeService:
|
|
1591
|
+
themeService: a,
|
|
1592
1592
|
univerInstanceService: m,
|
|
1593
1593
|
currentWorkbook: C
|
|
1594
1594
|
});
|
|
1595
1595
|
});
|
|
1596
1596
|
return () => M.unsubscribe();
|
|
1597
|
-
}, [d.textSelection$,
|
|
1598
|
-
},
|
|
1599
|
-
const c = T(ue), i = T(
|
|
1600
|
-
|
|
1597
|
+
}, [d.textSelection$, l, s, N, F, k, r, a, o, m]);
|
|
1598
|
+
}, mi = (e, t, n, o, r, s) => {
|
|
1599
|
+
const c = T(ue), i = T(qe), f = T(Oe).getRenderById(t), h = T(ee), m = f == null ? void 0 : f.with(De);
|
|
1600
|
+
$(() => {
|
|
1601
1601
|
if (e && m)
|
|
1602
1602
|
if (n) {
|
|
1603
1603
|
const u = () => {
|
|
1604
|
-
const
|
|
1605
|
-
for (let g = 1; g <=
|
|
1604
|
+
const S = m.getSelectionControls().length;
|
|
1605
|
+
for (let g = 1; g <= S; g++)
|
|
1606
1606
|
m.clearLastSelection();
|
|
1607
1607
|
return setTimeout(() => {
|
|
1608
1608
|
s();
|
|
1609
1609
|
}, 30);
|
|
1610
|
-
}, d = c.onCommandExecuted((
|
|
1611
|
-
|
|
1612
|
-
}),
|
|
1610
|
+
}, d = c.onCommandExecuted((S) => {
|
|
1611
|
+
S.id === Dn.id && u();
|
|
1612
|
+
}), a = h.getCurrentTypeOfUnit$(q.UNIVER_SHEET).subscribe((S) => {
|
|
1613
1613
|
u();
|
|
1614
1614
|
});
|
|
1615
1615
|
return () => {
|
|
1616
|
-
d.dispose(),
|
|
1616
|
+
d.dispose(), a.unsubscribe();
|
|
1617
1617
|
};
|
|
1618
1618
|
} else {
|
|
1619
1619
|
const u = c.beforeCommandExecuted((d) => {
|
|
1620
|
-
if (d.id ===
|
|
1620
|
+
if (d.id === Dn.id) {
|
|
1621
1621
|
o(!1), r(), s();
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1622
|
+
const a = i.getEditor(on);
|
|
1623
|
+
a == null || a.focus();
|
|
1624
1624
|
}
|
|
1625
1625
|
});
|
|
1626
1626
|
return () => {
|
|
@@ -1628,9 +1628,9 @@ const ii = (e, t, n, o) => {
|
|
|
1628
1628
|
};
|
|
1629
1629
|
}
|
|
1630
1630
|
}, [e, m]);
|
|
1631
|
-
},
|
|
1632
|
-
const o = T(
|
|
1633
|
-
|
|
1631
|
+
}, pi = (e, t, n) => {
|
|
1632
|
+
const o = T(_e), r = G(!0);
|
|
1633
|
+
$(() => {
|
|
1634
1634
|
if (e) {
|
|
1635
1635
|
const s = setTimeout(() => {
|
|
1636
1636
|
r.current = !1;
|
|
@@ -1639,95 +1639,95 @@ const ii = (e, t, n, o) => {
|
|
|
1639
1639
|
clearTimeout(s);
|
|
1640
1640
|
};
|
|
1641
1641
|
}
|
|
1642
|
-
}, [e]),
|
|
1642
|
+
}, [e]), $(() => {
|
|
1643
1643
|
if (!r.current && t) {
|
|
1644
1644
|
const s = o.checkIfAddBracket(n);
|
|
1645
|
-
t(s === 0 && n.startsWith(
|
|
1645
|
+
t(s === 0 && n.startsWith(er.EQUALS), `${n}`);
|
|
1646
1646
|
}
|
|
1647
1647
|
}, [n, t]);
|
|
1648
|
-
},
|
|
1649
|
-
const o = T(
|
|
1650
|
-
s([]), i(""),
|
|
1648
|
+
}, Si = (e, t = [], n) => {
|
|
1649
|
+
const o = T(Ht), [r, s] = V([]), [c, i] = V(""), l = G(-1), f = Je({ nodes: t }), h = () => {
|
|
1650
|
+
s([]), i(""), l.current = -1;
|
|
1651
1651
|
};
|
|
1652
|
-
return
|
|
1652
|
+
return $(() => {
|
|
1653
1653
|
if (n && e) {
|
|
1654
|
-
const u = n.input$.pipe(
|
|
1654
|
+
const u = n.input$.pipe(an(300)).subscribe(() => {
|
|
1655
1655
|
const d = n.getSelectionRanges();
|
|
1656
1656
|
if (d.length === 1) {
|
|
1657
|
-
const
|
|
1658
|
-
if (
|
|
1659
|
-
const g =
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1662
|
-
if (
|
|
1663
|
-
|
|
1664
|
-
const
|
|
1665
|
-
s(_), i(
|
|
1657
|
+
const a = f.current.nodes, S = d[0];
|
|
1658
|
+
if (S.collapsed) {
|
|
1659
|
+
const g = pn(a, S.startOffset - 1, !1);
|
|
1660
|
+
l.current = g;
|
|
1661
|
+
const p = a[g];
|
|
1662
|
+
if (p && typeof p != "string" && p.nodeType === Z.FUNCTION) {
|
|
1663
|
+
l.current = g;
|
|
1664
|
+
const v = p.token, _ = o.getSearchListByNameFirstLetter(v);
|
|
1665
|
+
s(_), i(v);
|
|
1666
1666
|
return;
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
|
-
|
|
1670
|
+
l.current = -1, i(""), s((a) => a != null && a.length ? [] : a);
|
|
1671
1671
|
});
|
|
1672
1672
|
return () => {
|
|
1673
1673
|
u.unsubscribe();
|
|
1674
1674
|
};
|
|
1675
1675
|
}
|
|
1676
|
-
}, [n, e]),
|
|
1676
|
+
}, [n, e]), $(() => {
|
|
1677
1677
|
e || h();
|
|
1678
1678
|
}, [e]), {
|
|
1679
1679
|
searchList: r,
|
|
1680
1680
|
searchText: c,
|
|
1681
1681
|
handlerFormulaReplace: (u) => {
|
|
1682
1682
|
const d = [...f.current.nodes];
|
|
1683
|
-
if (
|
|
1684
|
-
const
|
|
1685
|
-
let g = (typeof
|
|
1686
|
-
return d.push(u),
|
|
1683
|
+
if (l.current !== -1) {
|
|
1684
|
+
const a = d.splice(l.current + 1), S = d.pop() || "";
|
|
1685
|
+
let g = (typeof S == "string" ? S.length : S.token.length) - u.length;
|
|
1686
|
+
return d.push(u), a[0] !== ct.OPEN_BRACKET && (d.push(ct.OPEN_BRACKET), g--), { text: tn([...d, ...a]), offset: g };
|
|
1687
1687
|
}
|
|
1688
1688
|
},
|
|
1689
1689
|
reset: h
|
|
1690
1690
|
};
|
|
1691
|
-
},
|
|
1692
|
-
},
|
|
1693
|
-
function
|
|
1694
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c =
|
|
1691
|
+
}, vi = () => {
|
|
1692
|
+
}, Ci = Ne(_i);
|
|
1693
|
+
function _i(e, t) {
|
|
1694
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = vi } = e, i = s.getEditorId(), l = T(Bt), f = T(ue), { searchList: h, searchText: m, handlerFormulaReplace: u, reset: d } = Si(n, o, s), a = oe(() => !!h.length, [h]), S = G(void 0), [g, p] = V(0), v = G(!1), [_] = Ir(i, a, [m, h]), R = Je({ searchList: h, active: g }), C = (x) => {
|
|
1695
1695
|
const w = u(x);
|
|
1696
1696
|
w && (d(), r(w));
|
|
1697
1697
|
};
|
|
1698
1698
|
function y(x) {
|
|
1699
|
-
|
|
1699
|
+
v.current && p(x);
|
|
1700
1700
|
}
|
|
1701
1701
|
function N() {
|
|
1702
|
-
|
|
1702
|
+
v.current && p(-1);
|
|
1703
1703
|
}
|
|
1704
|
-
|
|
1704
|
+
$(() => {
|
|
1705
1705
|
if (!h.length)
|
|
1706
1706
|
return;
|
|
1707
|
-
const x = `sheet.formula-embedding-editor.search_function.${i}`, w = new
|
|
1708
|
-
const { searchList:
|
|
1709
|
-
switch (
|
|
1710
|
-
case
|
|
1711
|
-
|
|
1712
|
-
const
|
|
1713
|
-
return k(
|
|
1707
|
+
const x = `sheet.formula-embedding-editor.search_function.${i}`, w = new He(), M = (b) => {
|
|
1708
|
+
const { searchList: E, active: I } = R.current;
|
|
1709
|
+
switch (b) {
|
|
1710
|
+
case D.ARROW_UP: {
|
|
1711
|
+
p((A) => {
|
|
1712
|
+
const L = Math.max(0, A - 1);
|
|
1713
|
+
return k(L), L;
|
|
1714
1714
|
});
|
|
1715
1715
|
break;
|
|
1716
1716
|
}
|
|
1717
|
-
case
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1720
|
-
return k(
|
|
1717
|
+
case D.ARROW_DOWN: {
|
|
1718
|
+
p((A) => {
|
|
1719
|
+
const L = Math.min(E.length - 1, A + 1);
|
|
1720
|
+
return k(L), L;
|
|
1721
1721
|
});
|
|
1722
1722
|
break;
|
|
1723
1723
|
}
|
|
1724
|
-
case
|
|
1725
|
-
case
|
|
1726
|
-
const A =
|
|
1724
|
+
case D.TAB:
|
|
1725
|
+
case D.ENTER: {
|
|
1726
|
+
const A = E[I];
|
|
1727
1727
|
C(A.name);
|
|
1728
1728
|
break;
|
|
1729
1729
|
}
|
|
1730
|
-
case
|
|
1730
|
+
case D.ESC: {
|
|
1731
1731
|
d(), c();
|
|
1732
1732
|
break;
|
|
1733
1733
|
}
|
|
@@ -1735,35 +1735,35 @@ function pi(e, t) {
|
|
|
1735
1735
|
};
|
|
1736
1736
|
return w.add(f.registerCommand({
|
|
1737
1737
|
id: x,
|
|
1738
|
-
type:
|
|
1739
|
-
handler(
|
|
1740
|
-
const { keyCode: I } =
|
|
1738
|
+
type: Te.OPERATION,
|
|
1739
|
+
handler(b, E) {
|
|
1740
|
+
const { keyCode: I } = E;
|
|
1741
1741
|
M(I);
|
|
1742
1742
|
}
|
|
1743
|
-
})), [
|
|
1743
|
+
})), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((b) => ({
|
|
1744
1744
|
id: x,
|
|
1745
|
-
binding:
|
|
1745
|
+
binding: b,
|
|
1746
1746
|
preconditions: () => !0,
|
|
1747
1747
|
priority: 1e3,
|
|
1748
1748
|
staticParameters: {
|
|
1749
|
-
eventType:
|
|
1750
|
-
keyCode:
|
|
1749
|
+
eventType: xe.Keyboard,
|
|
1750
|
+
keyCode: b
|
|
1751
1751
|
}
|
|
1752
|
-
})).forEach((
|
|
1753
|
-
w.add(
|
|
1752
|
+
})).forEach((b) => {
|
|
1753
|
+
w.add(l.registerShortcut(b));
|
|
1754
1754
|
}), () => {
|
|
1755
1755
|
w.dispose();
|
|
1756
1756
|
};
|
|
1757
1757
|
}, [h]);
|
|
1758
1758
|
function k(x) {
|
|
1759
|
-
const w =
|
|
1759
|
+
const w = S.current;
|
|
1760
1760
|
if (!w) return;
|
|
1761
1761
|
const M = w.children[x];
|
|
1762
1762
|
if (!M) return;
|
|
1763
|
-
const
|
|
1764
|
-
if (
|
|
1763
|
+
const E = w.getBoundingClientRect().top, I = w.offsetHeight, A = M.getBoundingClientRect(), L = A.top, U = A.height;
|
|
1764
|
+
if (L >= 0 && L > E && L - E + U <= I)
|
|
1765
1765
|
return;
|
|
1766
|
-
const H = M.offsetTop - (I -
|
|
1766
|
+
const H = M.offsetTop - (I - U) / 2;
|
|
1767
1767
|
w.scrollTo({
|
|
1768
1768
|
top: H,
|
|
1769
1769
|
behavior: "smooth"
|
|
@@ -1772,23 +1772,24 @@ function pi(e, t) {
|
|
|
1772
1772
|
const F = oe(() => {
|
|
1773
1773
|
let x = "";
|
|
1774
1774
|
return () => {
|
|
1775
|
-
clearTimeout(x),
|
|
1776
|
-
|
|
1775
|
+
clearTimeout(x), v.current = !0, x = setTimeout(() => {
|
|
1776
|
+
v.current = !1;
|
|
1777
1777
|
}, 300);
|
|
1778
1778
|
};
|
|
1779
1779
|
}, []);
|
|
1780
|
-
return h.length > 0 &&
|
|
1780
|
+
return h.length > 0 && a && /* @__PURE__ */ O(Jt, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ O(
|
|
1781
1781
|
"ul",
|
|
1782
1782
|
{
|
|
1783
1783
|
ref: (x) => {
|
|
1784
|
-
|
|
1784
|
+
S.current = x, t && (t.current = x);
|
|
1785
1785
|
},
|
|
1786
|
-
|
|
1787
|
-
|
|
1786
|
+
"data-u-comp": "sheets-formula-editor",
|
|
1787
|
+
className: fe("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", fn, ar),
|
|
1788
|
+
children: h.map((x, w) => /* @__PURE__ */ W(
|
|
1788
1789
|
"li",
|
|
1789
1790
|
{
|
|
1790
|
-
className:
|
|
1791
|
-
"univer-bg-gray-200 dark
|
|
1791
|
+
className: fe("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
1792
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": g === w
|
|
1792
1793
|
}),
|
|
1793
1794
|
onMouseEnter: () => y(w),
|
|
1794
1795
|
onMouseLeave: N,
|
|
@@ -1797,7 +1798,7 @@ function pi(e, t) {
|
|
|
1797
1798
|
C(x.name), s && s.focus();
|
|
1798
1799
|
},
|
|
1799
1800
|
children: [
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
|
|
1801
1802
|
/* @__PURE__ */ O("span", { className: "univer-text-red-500", children: x.name.substring(0, m.length) }),
|
|
1802
1803
|
/* @__PURE__ */ O("span", { children: x.name.slice(m.length) })
|
|
1803
1804
|
] }),
|
|
@@ -1815,9 +1816,9 @@ function pi(e, t) {
|
|
|
1815
1816
|
}
|
|
1816
1817
|
) });
|
|
1817
1818
|
}
|
|
1818
|
-
const
|
|
1819
|
-
},
|
|
1820
|
-
var
|
|
1819
|
+
const Ri = (e) => e.startsWith(er.EQUALS) ? e.slice(1) : "", Wn = () => {
|
|
1820
|
+
}, Ei = Ne((e, t) => {
|
|
1821
|
+
var vn, Cn;
|
|
1821
1822
|
const {
|
|
1822
1823
|
errorText: n,
|
|
1823
1824
|
initValue: o,
|
|
@@ -1825,70 +1826,70 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
|
|
|
1825
1826
|
subUnitId: s,
|
|
1826
1827
|
isFocus: c = !0,
|
|
1827
1828
|
isSupportAcrossSheet: i = !1,
|
|
1828
|
-
onFocus:
|
|
1829
|
-
onBlur: f =
|
|
1829
|
+
onFocus: l = Wn,
|
|
1830
|
+
onBlur: f = Wn,
|
|
1830
1831
|
onChange: h,
|
|
1831
1832
|
onVerify: m,
|
|
1832
1833
|
className: u,
|
|
1833
1834
|
editorId: d,
|
|
1834
|
-
moveCursor:
|
|
1835
|
-
onFormulaSelectingChange:
|
|
1835
|
+
moveCursor: a = !0,
|
|
1836
|
+
onFormulaSelectingChange: S,
|
|
1836
1837
|
keyboardEventConfig: g,
|
|
1837
|
-
onMoveInEditor:
|
|
1838
|
-
resetSelectionOnBlur:
|
|
1838
|
+
onMoveInEditor: p,
|
|
1839
|
+
resetSelectionOnBlur: v = !0,
|
|
1839
1840
|
autoScrollbar: _ = !0,
|
|
1840
1841
|
isSingle: R = !0,
|
|
1841
1842
|
disableSelectionOnClick: C = !1,
|
|
1842
1843
|
autofocus: y = !0,
|
|
1843
1844
|
disableContextMenu: N,
|
|
1844
1845
|
style: k
|
|
1845
|
-
} = e, F = T(
|
|
1846
|
-
|
|
1847
|
-
isClickOutSide: (
|
|
1846
|
+
} = e, F = T(qe), x = G(null), w = J(h);
|
|
1847
|
+
Rs(t, () => ({
|
|
1848
|
+
isClickOutSide: (Y) => x.current ? !x.current.contains(Y.target) : !1
|
|
1848
1849
|
}));
|
|
1849
|
-
const M =
|
|
1850
|
-
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1850
|
+
const M = J(S), b = G(null), E = G(void 0), I = E.current, [A, L] = V(c), U = G(null), H = oe(() => d != null ? d : qr(`${fo}-${Kr(4)}`), []), se = oe(() => n !== void 0, [n]), K = T(ee), Re = K.getUnit(H);
|
|
1851
|
+
Ce(Re == null ? void 0 : Re.change$);
|
|
1852
|
+
const et = ri(), ne = Yr.transform.getPlainText((Cn = (vn = Re == null ? void 0 : Re.getBody()) == null ? void 0 : vn.dataStream) != null ? Cn : ""), X = Je(ne), Q = oe(() => Ri(ne), [ne]), ge = oe(() => et(Q), [Q, et]), { isSelecting: te, isSelectingRef: me } = ni({ unitId: r, subUnitId: s, editorId: H, isFocus: A, disableOnClick: C }), ae = G(""), Le = T(Oe).getRenderById(H), de = Le == null ? void 0 : Le.with(rr), z = de == null ? void 0 : de.isFocusing, pe = oe(() => K.getCurrentTypeOfUnit$(q.UNIVER_DOC), [K]), Ee = Ce(pe), Me = (Ee == null ? void 0 : Ee.getUnitId()) === H, $e = G([]), be = te;
|
|
1853
|
+
us(() => {
|
|
1853
1854
|
w(ne);
|
|
1854
1855
|
}, [ne, w]);
|
|
1855
|
-
const
|
|
1856
|
-
if (!
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1860
|
-
|
|
1856
|
+
const qt = Tr("="), Kt = si(r, s), Pe = J((Y, re = !0, we, Ie) => {
|
|
1857
|
+
if (!E.current) return;
|
|
1858
|
+
ae.current = Y;
|
|
1859
|
+
const bt = Y[0] === "=" ? Y.slice(1) : "", Ae = et(bt), $r = Ae.reduce((Ue, yt) => typeof yt == "object" ? `${Ue}${yt.token}` : `${Ue}${yt}`, ""), It = qt(
|
|
1860
|
+
E.current,
|
|
1861
|
+
$r === bt ? Ae : [],
|
|
1861
1862
|
re,
|
|
1862
|
-
|
|
1863
|
+
Ie
|
|
1863
1864
|
);
|
|
1864
|
-
if (
|
|
1865
|
-
const
|
|
1866
|
-
if ((
|
|
1865
|
+
if ($e.current = It, we) {
|
|
1866
|
+
const Ue = Ie != null ? Ie : I == null ? void 0 : I.getSelectionRanges();
|
|
1867
|
+
if ((Ue == null ? void 0 : Ue.length) !== 1)
|
|
1867
1868
|
return;
|
|
1868
|
-
const
|
|
1869
|
-
if (
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1869
|
+
const Pr = Ue[0].startOffset - 1, Ur = pn(Ae, Pr, !1), _n = mr(Ae, Ur);
|
|
1870
|
+
if (_n >= 0) {
|
|
1871
|
+
const Rn = It.splice(_n, 1)[0];
|
|
1872
|
+
Rn && It.push(Rn);
|
|
1872
1873
|
}
|
|
1873
|
-
|
|
1874
|
+
Kt(A ? It : [], E.current);
|
|
1874
1875
|
}
|
|
1875
1876
|
});
|
|
1876
|
-
|
|
1877
|
+
$(() => {
|
|
1877
1878
|
A && Pe(ne, !1, !0);
|
|
1878
|
-
}, [A]),
|
|
1879
|
+
}, [A]), $(() => {
|
|
1879
1880
|
if (A) {
|
|
1880
|
-
if (
|
|
1881
|
+
if (ae.current === ne) return;
|
|
1881
1882
|
Pe(ne, !1, !0);
|
|
1882
1883
|
}
|
|
1883
|
-
}, [ne]),
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1886
|
-
var
|
|
1887
|
-
M(te, (
|
|
1888
|
-
}, [M, te]),
|
|
1889
|
-
let
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1884
|
+
}, [ne]), pi(A, m, ne);
|
|
1885
|
+
const nt = Xs(I), Sn = ui(A, r, s);
|
|
1886
|
+
$(() => {
|
|
1887
|
+
var Y;
|
|
1888
|
+
M(te, (Y = de == null ? void 0 : de.isFocusing) != null ? Y : !0);
|
|
1889
|
+
}, [M, te]), Yo(A, g, I), At(() => {
|
|
1890
|
+
let Y;
|
|
1891
|
+
if (U.current) {
|
|
1892
|
+
Y = F.register({
|
|
1892
1893
|
autofocus: y,
|
|
1893
1894
|
editorUnitId: H,
|
|
1894
1895
|
initialSnapshot: {
|
|
@@ -1903,63 +1904,63 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
|
|
|
1903
1904
|
},
|
|
1904
1905
|
documentStyle: {}
|
|
1905
1906
|
}
|
|
1906
|
-
},
|
|
1907
|
+
}, U.current);
|
|
1907
1908
|
const re = F.getEditor(H);
|
|
1908
|
-
|
|
1909
|
+
E.current = re, Pe(o, !1, !0);
|
|
1909
1910
|
}
|
|
1910
1911
|
return () => {
|
|
1911
|
-
|
|
1912
|
+
Y == null || Y.dispose();
|
|
1912
1913
|
};
|
|
1913
|
-
}, []),
|
|
1914
|
-
c ? (
|
|
1915
|
-
}, [c, I,
|
|
1916
|
-
const { checkScrollBar:
|
|
1917
|
-
|
|
1918
|
-
const
|
|
1919
|
-
if (!
|
|
1914
|
+
}, []), At(() => {
|
|
1915
|
+
c ? (L(c), nt()) : (v && (I == null || I.blur(), Sn()), L(c));
|
|
1916
|
+
}, [c, I, nt, Sn, v]);
|
|
1917
|
+
const { checkScrollBar: kr } = Go(I, R, _);
|
|
1918
|
+
li(A, !!(te && Me), r, N), ai(!!(A && z && a), be, I, p);
|
|
1919
|
+
const Fr = J((Y, re, we) => {
|
|
1920
|
+
if (!z)
|
|
1920
1921
|
return;
|
|
1921
|
-
const
|
|
1922
|
-
Pe(`=${
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1925
|
-
}, 50),
|
|
1922
|
+
const Ie = re !== -1 ? [{ startOffset: re + 1, endOffset: re + 1, collapsed: !0 }] : void 0;
|
|
1923
|
+
Pe(`=${Y}`, !0, we, Ie), we && (nt(), re !== -1 && setTimeout(() => {
|
|
1924
|
+
const bt = { startOffset: re + 1, endOffset: re + 1 }, Ae = I == null ? void 0 : I.render.with(zo);
|
|
1925
|
+
Ae == null || Ae.scrollToRange({ ...bt, collapsed: !0 });
|
|
1926
|
+
}, 50), kr());
|
|
1926
1927
|
});
|
|
1927
|
-
|
|
1928
|
-
A && !!(te &&
|
|
1928
|
+
gi(
|
|
1929
|
+
A && !!(te && Me),
|
|
1929
1930
|
A,
|
|
1930
|
-
|
|
1931
|
+
me,
|
|
1931
1932
|
r,
|
|
1932
1933
|
s,
|
|
1933
|
-
|
|
1934
|
+
$e,
|
|
1934
1935
|
i,
|
|
1935
1936
|
!!be,
|
|
1936
1937
|
I,
|
|
1937
|
-
|
|
1938
|
-
),
|
|
1939
|
-
Pe(
|
|
1938
|
+
Fr
|
|
1939
|
+
), mi(A && !!(te && Me), r, i, L, f, () => {
|
|
1940
|
+
Pe(X.current, !1, !0);
|
|
1940
1941
|
});
|
|
1941
|
-
const
|
|
1942
|
-
if (
|
|
1942
|
+
const Dr = (Y) => {
|
|
1943
|
+
if (Y) {
|
|
1943
1944
|
const re = I == null ? void 0 : I.getSelectionRanges();
|
|
1944
1945
|
if (re && re.length === 1) {
|
|
1945
|
-
const
|
|
1946
|
-
if (
|
|
1947
|
-
const
|
|
1946
|
+
const we = re[0];
|
|
1947
|
+
if (we.collapsed) {
|
|
1948
|
+
const Ie = Y.offset;
|
|
1948
1949
|
setTimeout(() => {
|
|
1949
|
-
I == null || I.setSelectionRanges([{ startOffset:
|
|
1950
|
+
I == null || I.setSelectionRanges([{ startOffset: we.startOffset - Ie, endOffset: we.endOffset - Ie }]);
|
|
1950
1951
|
}, 30);
|
|
1951
1952
|
}
|
|
1952
1953
|
}
|
|
1953
|
-
|
|
1954
|
+
nt(), Pe(`=${Y.text}`);
|
|
1954
1955
|
}
|
|
1955
|
-
},
|
|
1956
|
-
|
|
1956
|
+
}, Lr = () => {
|
|
1957
|
+
L(!0), l(), nt();
|
|
1957
1958
|
};
|
|
1958
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ W("div", { className: u, children: [
|
|
1959
1960
|
/* @__PURE__ */ O(
|
|
1960
1961
|
"div",
|
|
1961
1962
|
{
|
|
1962
|
-
className:
|
|
1963
|
+
className: fe(
|
|
1963
1964
|
`
|
|
1964
1965
|
univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center
|
|
1965
1966
|
univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1
|
|
@@ -1973,47 +1974,47 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
|
|
|
1973
1974
|
children: /* @__PURE__ */ O(
|
|
1974
1975
|
"div",
|
|
1975
1976
|
{
|
|
1976
|
-
ref:
|
|
1977
|
+
ref: U,
|
|
1977
1978
|
className: "univer-relative univer-h-full univer-w-full",
|
|
1978
|
-
onMouseUp:
|
|
1979
|
+
onMouseUp: Lr
|
|
1979
1980
|
}
|
|
1980
1981
|
)
|
|
1981
1982
|
}
|
|
1982
1983
|
),
|
|
1983
1984
|
n !== void 0 ? /* @__PURE__ */ O("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }) : null,
|
|
1984
1985
|
I ? /* @__PURE__ */ O(
|
|
1985
|
-
|
|
1986
|
+
Zs,
|
|
1986
1987
|
{
|
|
1987
1988
|
editor: I,
|
|
1988
1989
|
isFocus: A,
|
|
1989
1990
|
formulaText: ne,
|
|
1990
|
-
onClose: () =>
|
|
1991
|
+
onClose: () => nt()
|
|
1991
1992
|
}
|
|
1992
1993
|
) : null,
|
|
1993
1994
|
I ? /* @__PURE__ */ O(
|
|
1994
|
-
|
|
1995
|
+
Ci,
|
|
1995
1996
|
{
|
|
1996
1997
|
isFocus: A,
|
|
1997
|
-
sequenceNodes:
|
|
1998
|
-
onSelect:
|
|
1999
|
-
ref:
|
|
1998
|
+
sequenceNodes: ge,
|
|
1999
|
+
onSelect: Dr,
|
|
2000
|
+
ref: b,
|
|
2000
2001
|
editor: I
|
|
2001
2002
|
}
|
|
2002
2003
|
) : null
|
|
2003
2004
|
] });
|
|
2004
2005
|
});
|
|
2005
|
-
function
|
|
2006
|
-
const r = T(
|
|
2007
|
-
return
|
|
2006
|
+
function bi(e, t, n, o) {
|
|
2007
|
+
const r = T(_e), s = Tr(""), c = Ce(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), f = T(go), h = G(""), m = T(ee);
|
|
2008
|
+
return $(() => {
|
|
2008
2009
|
if (!e) return;
|
|
2009
2010
|
const u = e.getDocumentDataModel().getPlainText();
|
|
2010
2011
|
if (h.current === u)
|
|
2011
2012
|
return;
|
|
2012
2013
|
h.current = u;
|
|
2013
2014
|
const d = r.sequenceNodesBuilder(u);
|
|
2014
|
-
|
|
2015
|
-
}, [c, e, r]),
|
|
2016
|
-
var
|
|
2015
|
+
l(d != null ? d : []);
|
|
2016
|
+
}, [c, e, r]), $(() => {
|
|
2017
|
+
var a, S;
|
|
2017
2018
|
if (!e) return;
|
|
2018
2019
|
if (!t) {
|
|
2019
2020
|
const g = e.getDocumentData();
|
|
@@ -2021,19 +2022,19 @@ function Ri(e, t, n, o) {
|
|
|
2021
2022
|
...g,
|
|
2022
2023
|
body: {
|
|
2023
2024
|
...g.body,
|
|
2024
|
-
dataStream: (
|
|
2025
|
+
dataStream: (S = (a = g.body) == null ? void 0 : a.dataStream) != null ? S : "",
|
|
2025
2026
|
textRuns: []
|
|
2026
2027
|
}
|
|
2027
2028
|
});
|
|
2028
2029
|
return;
|
|
2029
2030
|
}
|
|
2030
|
-
const u = s(e, i, !1), d = new
|
|
2031
|
+
const u = s(e, i, !1), d = new He();
|
|
2031
2032
|
return u.forEach((g) => {
|
|
2032
|
-
const
|
|
2033
|
-
if (!
|
|
2033
|
+
const p = ut(g.token), v = m.getCurrentUnitForType(q.UNIVER_SHEET), _ = v == null ? void 0 : v.getActiveSheet();
|
|
2034
|
+
if (!p.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || p.sheetName && (_ == null ? void 0 : _.getName()) !== p.sheetName)
|
|
2034
2035
|
return;
|
|
2035
|
-
const R = new
|
|
2036
|
-
range:
|
|
2036
|
+
const R = new sn(g.themeColor).toRgb(), C = f.addShape({
|
|
2037
|
+
range: p.range,
|
|
2037
2038
|
style: {
|
|
2038
2039
|
stroke: g.themeColor,
|
|
2039
2040
|
fill: `rgba(${R.r}, ${R.g}, ${R.b}, 0.1)`,
|
|
@@ -2047,19 +2048,19 @@ function Ri(e, t, n, o) {
|
|
|
2047
2048
|
};
|
|
2048
2049
|
}, [e, t, s, f, i]), { sequenceNodes: i };
|
|
2049
2050
|
}
|
|
2050
|
-
function
|
|
2051
|
-
const t = T(
|
|
2051
|
+
function Ii(e) {
|
|
2052
|
+
const t = T(ln), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(ee).getUnit(o, q.UNIVER_SHEET), l = J(s), f = J((h, m) => {
|
|
2052
2053
|
const u = i == null ? void 0 : i.getActiveSheet();
|
|
2053
2054
|
if (!u || !n && u.getSheetId() !== r || !(h != null && h.length)) return;
|
|
2054
|
-
const d = h.map((
|
|
2055
|
-
range:
|
|
2055
|
+
const d = h.map((a) => ({
|
|
2056
|
+
range: a.range,
|
|
2056
2057
|
unitId: o,
|
|
2057
2058
|
sheetName: u.getSheetId() === r ? "" : u.getName()
|
|
2058
2059
|
}));
|
|
2059
|
-
|
|
2060
|
+
l(d, m);
|
|
2060
2061
|
});
|
|
2061
|
-
|
|
2062
|
-
const h = new
|
|
2062
|
+
$(() => {
|
|
2063
|
+
const h = new He();
|
|
2063
2064
|
return h.add(t.selectionMoveStart$.subscribe((m) => {
|
|
2064
2065
|
f(m, !0);
|
|
2065
2066
|
})), h.add(t.selectionMoving$.subscribe((m) => {
|
|
@@ -2071,14 +2072,14 @@ function bi(e) {
|
|
|
2071
2072
|
};
|
|
2072
2073
|
}, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
2073
2074
|
}
|
|
2074
|
-
const
|
|
2075
|
+
const Hn = (e) => !e.some((n) => {
|
|
2075
2076
|
if (typeof n == "string") {
|
|
2076
|
-
if (n !==
|
|
2077
|
+
if (n !== ct.COMMA)
|
|
2077
2078
|
return !0;
|
|
2078
|
-
} else if (n.nodeType !==
|
|
2079
|
+
} else if (n.nodeType !== Z.REFERENCE)
|
|
2079
2080
|
return !0;
|
|
2080
2081
|
return !1;
|
|
2081
|
-
}),
|
|
2082
|
+
}), yi = (e) => {
|
|
2082
2083
|
if (e.endColumn < e.startColumn) {
|
|
2083
2084
|
const t = e.endColumn;
|
|
2084
2085
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -2089,7 +2090,7 @@ const Ln = (e) => !e.some((n) => {
|
|
|
2089
2090
|
}
|
|
2090
2091
|
return e;
|
|
2091
2092
|
};
|
|
2092
|
-
function
|
|
2093
|
+
function Ti(e) {
|
|
2093
2094
|
const {
|
|
2094
2095
|
visible: t,
|
|
2095
2096
|
initialValue: n,
|
|
@@ -2098,49 +2099,49 @@ function Ii(e) {
|
|
|
2098
2099
|
maxRangeCount: s = 1 / 0,
|
|
2099
2100
|
supportAcrossSheet: c,
|
|
2100
2101
|
onConfirm: i,
|
|
2101
|
-
onClose:
|
|
2102
|
+
onClose: l,
|
|
2102
2103
|
onShowBySelection: f
|
|
2103
|
-
} = e, h = T(
|
|
2104
|
-
|
|
2104
|
+
} = e, h = T(at), m = T(_e), [u, d] = V([]), [a, S] = V(0), g = G(null);
|
|
2105
|
+
$(() => {
|
|
2105
2106
|
if (t && n.length) {
|
|
2106
|
-
const R = n.map((C) => C.sheetName ?
|
|
2107
|
-
d(R),
|
|
2107
|
+
const R = n.map((C) => C.sheetName ? St(C.sheetName, C.range) : ve(C.range));
|
|
2108
|
+
d(R), S(R.length - 1);
|
|
2108
2109
|
} else
|
|
2109
|
-
d([""]),
|
|
2110
|
+
d([""]), S(0);
|
|
2110
2111
|
}, [t]);
|
|
2111
|
-
const
|
|
2112
|
+
const p = (R, C) => {
|
|
2112
2113
|
const y = [...u];
|
|
2113
2114
|
y[R] = C, d(y);
|
|
2114
|
-
},
|
|
2115
|
-
d([...u, ""]),
|
|
2115
|
+
}, v = () => {
|
|
2116
|
+
d([...u, ""]), S(u.length);
|
|
2116
2117
|
}, _ = (R) => {
|
|
2117
2118
|
u.splice(R, 1), d([...u]);
|
|
2118
2119
|
};
|
|
2119
|
-
return
|
|
2120
|
+
return Ii({
|
|
2120
2121
|
unitId: o,
|
|
2121
2122
|
subUnitId: r,
|
|
2122
2123
|
supportAcrossSheet: c,
|
|
2123
2124
|
onChange: (R, C) => {
|
|
2124
2125
|
if (!t && f != null && f(R))
|
|
2125
2126
|
return;
|
|
2126
|
-
const y = new Set(u), N = R.map((x) => x.sheetName ?
|
|
2127
|
+
const y = new Set(u), N = R.map((x) => x.sheetName ? St(x.sheetName, x.range) : ve(x.range)), k = N.filter((x) => !y.has(x));
|
|
2127
2128
|
if (!k.length) return;
|
|
2128
2129
|
const F = [...u];
|
|
2129
2130
|
if (N.length > 1) {
|
|
2130
|
-
C || F.splice(
|
|
2131
|
+
C || F.splice(a, 1), F.push(...k);
|
|
2131
2132
|
const x = F.slice(0, s);
|
|
2132
|
-
d(x),
|
|
2133
|
+
d(x), S(x.length - 1), requestAnimationFrame(() => {
|
|
2133
2134
|
var w;
|
|
2134
2135
|
(w = g.current) == null || w.scrollTo({ top: g.current.scrollHeight });
|
|
2135
2136
|
});
|
|
2136
2137
|
} else {
|
|
2137
|
-
F.splice(
|
|
2138
|
+
F.splice(a, 1, ...k);
|
|
2138
2139
|
const x = F.slice(0, s);
|
|
2139
|
-
d(x),
|
|
2140
|
+
d(x), S(a + k.length - 1);
|
|
2140
2141
|
}
|
|
2141
2142
|
}
|
|
2142
2143
|
}), /* @__PURE__ */ O(
|
|
2143
|
-
|
|
2144
|
+
vs,
|
|
2144
2145
|
{
|
|
2145
2146
|
width: "328px",
|
|
2146
2147
|
open: t,
|
|
@@ -2148,33 +2149,32 @@ function Ii(e) {
|
|
|
2148
2149
|
draggable: !0,
|
|
2149
2150
|
mask: !1,
|
|
2150
2151
|
maskClosable: !1,
|
|
2151
|
-
footer: /* @__PURE__ */
|
|
2152
|
-
/* @__PURE__ */ O(
|
|
2152
|
+
footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
|
|
2153
|
+
/* @__PURE__ */ O(st, { onClick: l, children: h.t("rangeSelector.cancel") }),
|
|
2153
2154
|
/* @__PURE__ */ O(
|
|
2154
|
-
|
|
2155
|
+
st,
|
|
2155
2156
|
{
|
|
2156
|
-
style: { marginLeft: 10 },
|
|
2157
2157
|
variant: "primary",
|
|
2158
2158
|
onClick: () => {
|
|
2159
2159
|
i(
|
|
2160
2160
|
u.filter((R) => {
|
|
2161
2161
|
const C = m.sequenceNodesBuilder(R);
|
|
2162
|
-
return C && C.length === 1 && typeof C[0] != "string" && C[0].nodeType ===
|
|
2163
|
-
}).map((R) =>
|
|
2162
|
+
return C && C.length === 1 && typeof C[0] != "string" && C[0].nodeType === Z.REFERENCE;
|
|
2163
|
+
}).map((R) => ut(R)).map((R) => ({ ...R, range: yi(R.range) }))
|
|
2164
2164
|
);
|
|
2165
2165
|
},
|
|
2166
2166
|
children: h.t("rangeSelector.confirm")
|
|
2167
2167
|
}
|
|
2168
2168
|
)
|
|
2169
2169
|
] }),
|
|
2170
|
-
onClose:
|
|
2171
|
-
children: /* @__PURE__ */
|
|
2170
|
+
onClose: l,
|
|
2171
|
+
children: /* @__PURE__ */ W(
|
|
2172
2172
|
"div",
|
|
2173
2173
|
{
|
|
2174
2174
|
ref: g,
|
|
2175
|
-
className:
|
|
2175
|
+
className: fe("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ar),
|
|
2176
2176
|
children: [
|
|
2177
|
-
u.map((R, C) => /* @__PURE__ */
|
|
2177
|
+
u.map((R, C) => /* @__PURE__ */ W(
|
|
2178
2178
|
"div",
|
|
2179
2179
|
{
|
|
2180
2180
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
@@ -2182,16 +2182,17 @@ function Ii(e) {
|
|
|
2182
2182
|
/* @__PURE__ */ O(
|
|
2183
2183
|
lr,
|
|
2184
2184
|
{
|
|
2185
|
-
className: "univer-w-full",
|
|
2185
|
+
className: fe("univer-w-full", {
|
|
2186
|
+
"univer-border-primary-600": a === C
|
|
2187
|
+
}),
|
|
2186
2188
|
placeholder: h.t("rangeSelector.placeHolder"),
|
|
2187
|
-
onFocus: () =>
|
|
2189
|
+
onFocus: () => S(C),
|
|
2188
2190
|
value: R,
|
|
2189
|
-
onChange: (y) =>
|
|
2190
|
-
style: { borderColor: l === C ? "rgb(var(--primary-color))" : void 0 }
|
|
2191
|
+
onChange: (y) => p(C, y)
|
|
2191
2192
|
}
|
|
2192
2193
|
),
|
|
2193
2194
|
u.length > 1 && /* @__PURE__ */ O(
|
|
2194
|
-
|
|
2195
|
+
Cr,
|
|
2195
2196
|
{
|
|
2196
2197
|
className: "univer-cursor-pointer",
|
|
2197
2198
|
onClick: () => _(C)
|
|
@@ -2201,8 +2202,8 @@ function Ii(e) {
|
|
|
2201
2202
|
},
|
|
2202
2203
|
C
|
|
2203
2204
|
)),
|
|
2204
|
-
u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */ O(
|
|
2205
|
+
u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */ W(st, { variant: "link", onClick: v, children: [
|
|
2206
|
+
/* @__PURE__ */ O(_r, {}),
|
|
2206
2207
|
/* @__PURE__ */ O("span", { children: h.t("rangeSelector.addAnotherRange") })
|
|
2207
2208
|
] }) })
|
|
2208
2209
|
]
|
|
@@ -2211,35 +2212,35 @@ function Ii(e) {
|
|
|
2211
2212
|
}
|
|
2212
2213
|
);
|
|
2213
2214
|
}
|
|
2214
|
-
function
|
|
2215
|
-
return e.split(
|
|
2215
|
+
function xi(e) {
|
|
2216
|
+
return e.split(ct.COMMA).filter((t) => !!t).map((t) => ut(t));
|
|
2216
2217
|
}
|
|
2217
|
-
function
|
|
2218
|
-
return e.map((t) => t.sheetName ?
|
|
2218
|
+
function Oi(e) {
|
|
2219
|
+
return e.map((t) => t.sheetName ? St(t.sheetName, t.range) : ve(t.range)).join(ct.COMMA);
|
|
2219
2220
|
}
|
|
2220
|
-
function
|
|
2221
|
-
const [t, n] =
|
|
2221
|
+
function xr(e) {
|
|
2222
|
+
const [t, n] = V(null), {
|
|
2222
2223
|
onVerify: o,
|
|
2223
2224
|
selectorRef: r,
|
|
2224
2225
|
unitId: s,
|
|
2225
2226
|
subUnitId: c,
|
|
2226
2227
|
maxRangeCount: i,
|
|
2227
|
-
supportAcrossSheet:
|
|
2228
|
+
supportAcrossSheet: l,
|
|
2228
2229
|
autoFocus: f,
|
|
2229
2230
|
onChange: h,
|
|
2230
2231
|
onRangeSelectorDialogVisibleChange: m,
|
|
2231
2232
|
onClickOutside: u,
|
|
2232
2233
|
onFocusChange: d,
|
|
2233
|
-
forceShowDialogWhenSelectionChanged:
|
|
2234
|
-
hideEditor:
|
|
2234
|
+
forceShowDialogWhenSelectionChanged: a,
|
|
2235
|
+
hideEditor: S,
|
|
2235
2236
|
resetRange: g
|
|
2236
|
-
} = e, [
|
|
2237
|
+
} = e, [p, v] = V(f != null ? f : !1), [_, R] = V(!1), [C, y] = V([]), N = T(at), k = T(qe), { sequenceNodes: F } = bi(t, p, s, c), x = Je(F), w = T(ue), M = J(() => {
|
|
2237
2238
|
t == null || t.setSelectionRanges([]), t == null || t.blur(), k.blur();
|
|
2238
|
-
}),
|
|
2239
|
-
var
|
|
2240
|
-
M(), y(
|
|
2239
|
+
}), b = J(() => {
|
|
2240
|
+
var E;
|
|
2241
|
+
M(), y(xi((E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "")), R(!0);
|
|
2241
2242
|
});
|
|
2242
|
-
return
|
|
2243
|
+
return $(() => {
|
|
2243
2244
|
r && (r.current = {
|
|
2244
2245
|
get editor() {
|
|
2245
2246
|
return t;
|
|
@@ -2248,59 +2249,65 @@ function yr(e) {
|
|
|
2248
2249
|
k.focus(t.getEditorId());
|
|
2249
2250
|
},
|
|
2250
2251
|
blur: M,
|
|
2251
|
-
verify: () =>
|
|
2252
|
-
showDialog: (
|
|
2253
|
-
M(), y(
|
|
2252
|
+
verify: () => Hn(x.current),
|
|
2253
|
+
showDialog: (E) => {
|
|
2254
|
+
M(), y(E), R(!0);
|
|
2254
2255
|
},
|
|
2255
2256
|
hideDialog: () => {
|
|
2256
2257
|
y([]), R(!1);
|
|
2257
2258
|
},
|
|
2258
2259
|
getValue: () => {
|
|
2259
|
-
var
|
|
2260
|
-
return (
|
|
2260
|
+
var E;
|
|
2261
|
+
return (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "";
|
|
2261
2262
|
}
|
|
2262
2263
|
});
|
|
2263
|
-
}, [M, t, k, r, x]),
|
|
2264
|
-
var
|
|
2265
|
-
o == null || o(
|
|
2266
|
-
}, [F]),
|
|
2264
|
+
}, [M, t, k, r, x]), $(() => {
|
|
2265
|
+
var E;
|
|
2266
|
+
o == null || o(Hn(F), (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "");
|
|
2267
|
+
}, [F]), $(() => {
|
|
2267
2268
|
m == null || m(_);
|
|
2268
|
-
}, [_]),
|
|
2269
|
+
}, [_]), $(() => {
|
|
2269
2270
|
if (_ && g)
|
|
2270
2271
|
return () => {
|
|
2271
|
-
const
|
|
2272
|
+
const E = {
|
|
2272
2273
|
unitId: s,
|
|
2273
2274
|
subUnitId: c,
|
|
2274
2275
|
selections: g
|
|
2275
2276
|
};
|
|
2276
|
-
w.executeCommand(
|
|
2277
|
+
w.executeCommand(un.id, E);
|
|
2277
2278
|
};
|
|
2278
|
-
}, [_]), /* @__PURE__ */
|
|
2279
|
-
|
|
2280
|
-
|
|
2279
|
+
}, [_]), /* @__PURE__ */ W(ms, { children: [
|
|
2280
|
+
S ? null : /* @__PURE__ */ O(
|
|
2281
|
+
Zo,
|
|
2281
2282
|
{
|
|
2282
2283
|
isSingle: !0,
|
|
2283
2284
|
...e,
|
|
2284
|
-
onFocusChange: (
|
|
2285
|
-
|
|
2285
|
+
onFocusChange: (E, I) => {
|
|
2286
|
+
v(E), d == null || d(E, I);
|
|
2286
2287
|
},
|
|
2287
2288
|
editorRef: n,
|
|
2288
2289
|
onClickOutside: () => {
|
|
2289
|
-
|
|
2290
|
+
v(!1), M(), u == null || u();
|
|
2290
2291
|
},
|
|
2291
|
-
icon: /* @__PURE__ */ O(
|
|
2292
|
+
icon: /* @__PURE__ */ O(Ss, { title: N.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ O(
|
|
2293
|
+
Er,
|
|
2294
|
+
{
|
|
2295
|
+
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
2296
|
+
onClick: b
|
|
2297
|
+
}
|
|
2298
|
+
) })
|
|
2292
2299
|
}
|
|
2293
2300
|
),
|
|
2294
2301
|
/* @__PURE__ */ O(
|
|
2295
|
-
|
|
2302
|
+
Ti,
|
|
2296
2303
|
{
|
|
2297
2304
|
initialValue: C,
|
|
2298
2305
|
unitId: s,
|
|
2299
2306
|
subUnitId: c,
|
|
2300
2307
|
visible: _,
|
|
2301
2308
|
maxRangeCount: i,
|
|
2302
|
-
onConfirm: (
|
|
2303
|
-
const I =
|
|
2309
|
+
onConfirm: (E) => {
|
|
2310
|
+
const I = Oi(E), A = Gr.newEmptyData();
|
|
2304
2311
|
A.body.dataStream = I, t == null || t.replaceText(I, !1), h == null || h(A, I), R(!1), y([]), requestAnimationFrame(() => {
|
|
2305
2312
|
M();
|
|
2306
2313
|
});
|
|
@@ -2308,15 +2315,15 @@ function yr(e) {
|
|
|
2308
2315
|
onClose: () => {
|
|
2309
2316
|
R(!1), y([]);
|
|
2310
2317
|
},
|
|
2311
|
-
supportAcrossSheet:
|
|
2312
|
-
onShowBySelection: (
|
|
2318
|
+
supportAcrossSheet: l,
|
|
2319
|
+
onShowBySelection: (E) => p || a ? (y(E), R(!0), !1) : !0
|
|
2313
2320
|
}
|
|
2314
2321
|
)
|
|
2315
2322
|
] });
|
|
2316
2323
|
}
|
|
2317
|
-
class
|
|
2324
|
+
class Or {
|
|
2318
2325
|
constructor() {
|
|
2319
|
-
j(this, "_currentSelector$", new
|
|
2326
|
+
j(this, "_currentSelector$", new tr(null));
|
|
2320
2327
|
j(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
2321
2328
|
}
|
|
2322
2329
|
showRangeSelectorDialog(t) {
|
|
@@ -2328,56 +2335,56 @@ class Tr {
|
|
|
2328
2335
|
return this._currentSelector$.next(t), o;
|
|
2329
2336
|
}
|
|
2330
2337
|
}
|
|
2331
|
-
var
|
|
2332
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2338
|
+
var Ni = Object.getOwnPropertyDescriptor, Mi = (e, t, n, o) => {
|
|
2339
|
+
for (var r = o > 1 ? void 0 : o ? Ni(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2333
2340
|
(c = e[s]) && (r = c(r) || r);
|
|
2334
2341
|
return r;
|
|
2335
|
-
},
|
|
2336
|
-
let
|
|
2342
|
+
}, Ot = (e, t) => (n, o) => t(n, o, e);
|
|
2343
|
+
let kt = class extends lt {
|
|
2337
2344
|
constructor(e, t, n, o) {
|
|
2338
2345
|
super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
|
|
2339
2346
|
}
|
|
2340
2347
|
_initialize() {
|
|
2341
2348
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
2342
|
-
getMutations: (e) => e.id ===
|
|
2349
|
+
getMutations: (e) => e.id === es.id ? this._reorderFormula(e.params) : {
|
|
2343
2350
|
redos: [],
|
|
2344
2351
|
undos: []
|
|
2345
2352
|
}
|
|
2346
2353
|
}));
|
|
2347
2354
|
}
|
|
2348
2355
|
_reorderFormula(e) {
|
|
2349
|
-
const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o),
|
|
2350
|
-
if (!
|
|
2356
|
+
const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o), l = i == null ? void 0 : i.getSheetBySheetId(r);
|
|
2357
|
+
if (!l)
|
|
2351
2358
|
return {
|
|
2352
2359
|
redos: t,
|
|
2353
2360
|
undos: n
|
|
2354
2361
|
};
|
|
2355
|
-
const f =
|
|
2362
|
+
const f = l.getCellMatrix(), h = new Fe(), m = new Fe();
|
|
2356
2363
|
let u = !1;
|
|
2357
|
-
return
|
|
2358
|
-
let
|
|
2359
|
-
c.hasOwnProperty(d) && (
|
|
2360
|
-
const g = f.getValue(
|
|
2364
|
+
return zr.foreach(s, (d, a) => {
|
|
2365
|
+
let S = d;
|
|
2366
|
+
c.hasOwnProperty(d) && (S = c[d]);
|
|
2367
|
+
const g = f.getValue(S, a);
|
|
2361
2368
|
if (g != null && g.f || g != null && g.si) {
|
|
2362
2369
|
u = !0;
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2370
|
+
const p = this._formulaDataModel.getFormulaStringByCell(S, a, r, o), v = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
2371
|
+
p,
|
|
2365
2372
|
0,
|
|
2366
|
-
d -
|
|
2367
|
-
), _ =
|
|
2368
|
-
_.f =
|
|
2373
|
+
d - S
|
|
2374
|
+
), _ = it.deepClone(g);
|
|
2375
|
+
_.f = v, _.si = null, h.setValue(d, a, _);
|
|
2369
2376
|
} else
|
|
2370
|
-
h.setValue(d,
|
|
2371
|
-
m.setValue(d,
|
|
2377
|
+
h.setValue(d, a, g);
|
|
2378
|
+
m.setValue(d, a, f.getValue(d, a));
|
|
2372
2379
|
}), u ? (t.push({
|
|
2373
|
-
id:
|
|
2380
|
+
id: Mt.id,
|
|
2374
2381
|
params: {
|
|
2375
2382
|
unitId: o,
|
|
2376
2383
|
subUnitId: r,
|
|
2377
2384
|
cellValue: h.getMatrix()
|
|
2378
2385
|
}
|
|
2379
2386
|
}), n.push({
|
|
2380
|
-
id:
|
|
2387
|
+
id: Mt.id,
|
|
2381
2388
|
params: {
|
|
2382
2389
|
unitId: o,
|
|
2383
2390
|
subUnitId: r,
|
|
@@ -2392,25 +2399,25 @@ let yt = class extends nt {
|
|
|
2392
2399
|
};
|
|
2393
2400
|
}
|
|
2394
2401
|
};
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
],
|
|
2401
|
-
const
|
|
2402
|
-
function
|
|
2403
|
-
return e.getContextValue(
|
|
2404
|
-
}
|
|
2405
|
-
function
|
|
2406
|
-
return !t && !(
|
|
2407
|
-
}
|
|
2408
|
-
var
|
|
2409
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2402
|
+
kt = Mi([
|
|
2403
|
+
Ot(0, B(dn)),
|
|
2404
|
+
Ot(1, B(ee)),
|
|
2405
|
+
Ot(2, B(Et)),
|
|
2406
|
+
Ot(3, B(_e))
|
|
2407
|
+
], kt);
|
|
2408
|
+
const wi = "sheets-formula-ui.base.config", Bn = {};
|
|
2409
|
+
function Ai(e) {
|
|
2410
|
+
return e.getContextValue(Zr) && e.getContextValue(Xr);
|
|
2411
|
+
}
|
|
2412
|
+
function Nr(e, t = !1) {
|
|
2413
|
+
return !t && !(ye(e == null ? void 0 : e.f) || Be(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && ko.has(e.v) ? e.v : null;
|
|
2414
|
+
}
|
|
2415
|
+
var ki = Object.getOwnPropertyDescriptor, Fi = (e, t, n, o) => {
|
|
2416
|
+
for (var r = o > 1 ? void 0 : o ? ki(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2410
2417
|
(c = e[s]) && (r = c(r) || r);
|
|
2411
2418
|
return r;
|
|
2412
|
-
},
|
|
2413
|
-
const
|
|
2419
|
+
}, gt = (e, t) => (n, o) => t(n, o, e);
|
|
2420
|
+
const Zt = "SHEET_FORMULA_ALERT", Di = {
|
|
2414
2421
|
[ie.DIV_BY_ZERO]: "divByZero",
|
|
2415
2422
|
[ie.NAME]: "name",
|
|
2416
2423
|
[ie.VALUE]: "value",
|
|
@@ -2424,7 +2431,7 @@ const Ht = "SHEET_FORMULA_ALERT", ki = {
|
|
|
2424
2431
|
[ie.CONNECT]: "connect",
|
|
2425
2432
|
[ie.NULL]: "null"
|
|
2426
2433
|
};
|
|
2427
|
-
let
|
|
2434
|
+
let nn = class extends lt {
|
|
2428
2435
|
constructor(e, t, n, o, r, s) {
|
|
2429
2436
|
super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
|
|
2430
2437
|
}
|
|
@@ -2432,29 +2439,29 @@ let Gt = class extends nt {
|
|
|
2432
2439
|
this._initCellAlertPopup(), this._initZenService();
|
|
2433
2440
|
}
|
|
2434
2441
|
_initCellAlertPopup() {
|
|
2435
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
|
2442
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(an(100)).subscribe((e) => {
|
|
2436
2443
|
var t, n, o, r, s;
|
|
2437
2444
|
if (e) {
|
|
2438
2445
|
const i = this._context.unit.getActiveSheet();
|
|
2439
2446
|
if (!i) return;
|
|
2440
|
-
const
|
|
2441
|
-
if (
|
|
2442
|
-
const h =
|
|
2447
|
+
const l = i.getCell(e.location.row, e.location.col), f = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
|
|
2448
|
+
if (Qr(l)) {
|
|
2449
|
+
const h = Nr(l, !!f);
|
|
2443
2450
|
if (!h) {
|
|
2444
2451
|
this._hideAlert();
|
|
2445
2452
|
return;
|
|
2446
2453
|
}
|
|
2447
|
-
const m = this._cellAlertManagerService.currentAlert.get(
|
|
2454
|
+
const m = this._cellAlertManagerService.currentAlert.get(Zt), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
|
|
2448
2455
|
if (u && u.row === e.location.row && u.col === e.location.col && u.subUnitId === e.location.subUnitId && u.unitId === e.location.unitId)
|
|
2449
2456
|
return;
|
|
2450
2457
|
this._cellAlertManagerService.showAlert({
|
|
2451
|
-
type:
|
|
2458
|
+
type: So.ERROR,
|
|
2452
2459
|
title: this._localeService.t("formula.error.title"),
|
|
2453
|
-
message: this._localeService.t(`formula.error.${
|
|
2460
|
+
message: this._localeService.t(`formula.error.${Di[h]}`),
|
|
2454
2461
|
location: e.location,
|
|
2455
2462
|
width: 200,
|
|
2456
2463
|
height: 74,
|
|
2457
|
-
key:
|
|
2464
|
+
key: Zt
|
|
2458
2465
|
});
|
|
2459
2466
|
return;
|
|
2460
2467
|
}
|
|
@@ -2468,33 +2475,33 @@ let Gt = class extends nt {
|
|
|
2468
2475
|
}));
|
|
2469
2476
|
}
|
|
2470
2477
|
_hideAlert() {
|
|
2471
|
-
this._cellAlertManagerService.removeAlert(
|
|
2478
|
+
this._cellAlertManagerService.removeAlert(Zt);
|
|
2472
2479
|
}
|
|
2473
2480
|
};
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
],
|
|
2481
|
-
var
|
|
2482
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2481
|
+
nn = Fi([
|
|
2482
|
+
gt(1, B(mo)),
|
|
2483
|
+
gt(2, B(po)),
|
|
2484
|
+
gt(3, B(at)),
|
|
2485
|
+
gt(4, B(Et)),
|
|
2486
|
+
gt(5, ds)
|
|
2487
|
+
], nn);
|
|
2488
|
+
var Li = Object.getOwnPropertyDescriptor, $i = (e, t, n, o) => {
|
|
2489
|
+
for (var r = o > 1 ? void 0 : o ? Li(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2483
2490
|
(c = e[s]) && (r = c(r) || r);
|
|
2484
2491
|
return r;
|
|
2485
|
-
},
|
|
2486
|
-
let
|
|
2492
|
+
}, jn = (e, t) => (n, o) => t(n, o, e);
|
|
2493
|
+
let Ft = class extends lt {
|
|
2487
2494
|
constructor(e, t) {
|
|
2488
2495
|
super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
|
|
2489
2496
|
}
|
|
2490
2497
|
_registerAutoFill() {
|
|
2491
2498
|
const e = {
|
|
2492
|
-
type:
|
|
2499
|
+
type: Nn.FORMULA,
|
|
2493
2500
|
priority: 1001,
|
|
2494
|
-
match: (t) =>
|
|
2495
|
-
isContinue: (t, n) => t.type ===
|
|
2501
|
+
match: (t) => ye(t == null ? void 0 : t.f) || Be(t == null ? void 0 : t.si),
|
|
2502
|
+
isContinue: (t, n) => t.type === Nn.FORMULA,
|
|
2496
2503
|
applyFunctions: {
|
|
2497
|
-
[
|
|
2504
|
+
[Co.COPY]: (t, n, o, r, s) => {
|
|
2498
2505
|
const { data: c, index: i } = t;
|
|
2499
2506
|
return this._fillCopyFormula(c, n, o, i, r, s);
|
|
2500
2507
|
}
|
|
@@ -2504,49 +2511,49 @@ let Tt = class extends nt {
|
|
|
2504
2511
|
}
|
|
2505
2512
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
2506
2513
|
var f, h;
|
|
2507
|
-
const c =
|
|
2514
|
+
const c = Ui(r), i = [], l = /* @__PURE__ */ new Map();
|
|
2508
2515
|
for (let m = 1; m <= t; m++) {
|
|
2509
|
-
const u = (m - 1) % e.length, d = o[u],
|
|
2510
|
-
if (
|
|
2511
|
-
const
|
|
2512
|
-
if (
|
|
2513
|
-
|
|
2514
|
-
else if (
|
|
2515
|
-
let _ =
|
|
2516
|
+
const u = (m - 1) % e.length, d = o[u], a = it.deepClone(e[u]);
|
|
2517
|
+
if (a) {
|
|
2518
|
+
const S = ((f = e[u]) == null ? void 0 : f.f) || "", g = ((h = e[u]) == null ? void 0 : h.si) || "", p = ye(S);
|
|
2519
|
+
if (Be(g))
|
|
2520
|
+
a.si = g, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
|
|
2521
|
+
else if (p) {
|
|
2522
|
+
let _ = l.get(u);
|
|
2516
2523
|
if (_)
|
|
2517
|
-
|
|
2524
|
+
a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
2518
2525
|
else {
|
|
2519
|
-
_ =
|
|
2520
|
-
const { offsetX: R, offsetY: C } =
|
|
2521
|
-
|
|
2526
|
+
_ = it.generateRandomId(6), l.set(u, _);
|
|
2527
|
+
const { offsetX: R, offsetY: C } = Pi(c, t, n, s, d), y = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
2528
|
+
S,
|
|
2522
2529
|
R,
|
|
2523
2530
|
C
|
|
2524
2531
|
);
|
|
2525
|
-
|
|
2532
|
+
a.si = _, a.f = y, a.v = null, a.p = null, a.t = null;
|
|
2526
2533
|
}
|
|
2527
|
-
i.push(
|
|
2534
|
+
i.push(a);
|
|
2528
2535
|
}
|
|
2529
2536
|
}
|
|
2530
2537
|
}
|
|
2531
2538
|
return i;
|
|
2532
2539
|
}
|
|
2533
2540
|
};
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
],
|
|
2538
|
-
function
|
|
2539
|
-
const { source: s, target: c } = o, { rows: i } = c, { rows:
|
|
2541
|
+
Ft = $i([
|
|
2542
|
+
jn(0, vo),
|
|
2543
|
+
jn(1, B(_e))
|
|
2544
|
+
], Ft);
|
|
2545
|
+
function Pi(e, t, n, o, r) {
|
|
2546
|
+
const { source: s, target: c } = o, { rows: i } = c, { rows: l } = s;
|
|
2540
2547
|
let f = 0, h = 0;
|
|
2541
2548
|
switch (n) {
|
|
2542
2549
|
case ce.UP:
|
|
2543
|
-
h = i[r] -
|
|
2550
|
+
h = i[r] - l[r];
|
|
2544
2551
|
break;
|
|
2545
2552
|
case ce.RIGHT:
|
|
2546
2553
|
f = e;
|
|
2547
2554
|
break;
|
|
2548
2555
|
case ce.DOWN:
|
|
2549
|
-
h = i[r] -
|
|
2556
|
+
h = i[r] - l[r];
|
|
2550
2557
|
break;
|
|
2551
2558
|
case ce.LEFT:
|
|
2552
2559
|
f = -e * t;
|
|
@@ -2554,7 +2561,7 @@ function Li(e, t, n, o, r) {
|
|
|
2554
2561
|
}
|
|
2555
2562
|
return { offsetX: f, offsetY: h };
|
|
2556
2563
|
}
|
|
2557
|
-
function
|
|
2564
|
+
function Ui(e) {
|
|
2558
2565
|
let t = 0;
|
|
2559
2566
|
for (const n in e)
|
|
2560
2567
|
e[n].forEach((o) => {
|
|
@@ -2562,13 +2569,13 @@ function Pi(e) {
|
|
|
2562
2569
|
});
|
|
2563
2570
|
return t;
|
|
2564
2571
|
}
|
|
2565
|
-
var
|
|
2566
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2572
|
+
var Vi = Object.getOwnPropertyDescriptor, Wi = (e, t, n, o) => {
|
|
2573
|
+
for (var r = o > 1 ? void 0 : o ? Vi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2567
2574
|
(c = e[s]) && (r = c(r) || r);
|
|
2568
2575
|
return r;
|
|
2569
|
-
},
|
|
2570
|
-
const
|
|
2571
|
-
let
|
|
2576
|
+
}, mt = (e, t) => (n, o) => t(n, o, e);
|
|
2577
|
+
const Hi = "default-paste-formula";
|
|
2578
|
+
let Dt = class extends lt {
|
|
2572
2579
|
constructor(e, t, n, o, r) {
|
|
2573
2580
|
super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
2574
2581
|
}
|
|
@@ -2580,7 +2587,7 @@ let xt = class extends nt {
|
|
|
2580
2587
|
}
|
|
2581
2588
|
_pasteFormulaHook() {
|
|
2582
2589
|
return {
|
|
2583
|
-
id:
|
|
2590
|
+
id: ot.SPECIAL_PASTE_FORMULA,
|
|
2584
2591
|
priority: 10,
|
|
2585
2592
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
2586
2593
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
|
|
@@ -2588,7 +2595,7 @@ let xt = class extends nt {
|
|
|
2588
2595
|
}
|
|
2589
2596
|
_pasteWithFormulaHook() {
|
|
2590
2597
|
return {
|
|
2591
|
-
id:
|
|
2598
|
+
id: Hi,
|
|
2592
2599
|
priority: 10,
|
|
2593
2600
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
|
|
2594
2601
|
};
|
|
@@ -2596,27 +2603,27 @@ let xt = class extends nt {
|
|
|
2596
2603
|
_onPasteCells(e, t, n, o, r) {
|
|
2597
2604
|
var u;
|
|
2598
2605
|
if ([
|
|
2599
|
-
|
|
2600
|
-
|
|
2606
|
+
ot.SPECIAL_PASTE_FORMAT,
|
|
2607
|
+
ot.SPECIAL_PASTE_COL_WIDTH
|
|
2601
2608
|
].includes(o.pasteType))
|
|
2602
2609
|
return {
|
|
2603
2610
|
undos: [],
|
|
2604
2611
|
redos: []
|
|
2605
2612
|
};
|
|
2606
|
-
const c = this._currentUniverSheet.getCurrentUnitForType(
|
|
2607
|
-
if (!i || !
|
|
2613
|
+
const c = this._currentUniverSheet.getCurrentUnitForType(q.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
|
|
2614
|
+
if (!i || !l)
|
|
2608
2615
|
return {
|
|
2609
2616
|
undos: [],
|
|
2610
2617
|
redos: []
|
|
2611
2618
|
};
|
|
2612
2619
|
const f = t.range, h = n, m = {
|
|
2613
|
-
copyType: o.copyType ||
|
|
2620
|
+
copyType: o.copyType || Jn.COPY,
|
|
2614
2621
|
copyRange: e == null ? void 0 : e.range,
|
|
2615
2622
|
pasteType: o.pasteType
|
|
2616
2623
|
};
|
|
2617
|
-
return this._injector.invoke((d) =>
|
|
2624
|
+
return this._injector.invoke((d) => Bi(
|
|
2618
2625
|
i,
|
|
2619
|
-
|
|
2626
|
+
l,
|
|
2620
2627
|
f,
|
|
2621
2628
|
h,
|
|
2622
2629
|
d,
|
|
@@ -2628,15 +2635,15 @@ let xt = class extends nt {
|
|
|
2628
2635
|
));
|
|
2629
2636
|
}
|
|
2630
2637
|
};
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
],
|
|
2638
|
-
function
|
|
2639
|
-
const h = [], m = [], u =
|
|
2638
|
+
Dt = Wi([
|
|
2639
|
+
mt(0, ee),
|
|
2640
|
+
mt(1, B(_e)),
|
|
2641
|
+
mt(2, _o),
|
|
2642
|
+
mt(3, B(Ct)),
|
|
2643
|
+
mt(4, B(Et))
|
|
2644
|
+
], Dt);
|
|
2645
|
+
function Bi(e, t, n, o, r, s, c, i, l = !1, f) {
|
|
2646
|
+
const h = [], m = [], u = ji(e, t, n, o, s, c, i, f);
|
|
2640
2647
|
if (!u.hasValue())
|
|
2641
2648
|
return {
|
|
2642
2649
|
undos: [],
|
|
@@ -2648,112 +2655,112 @@ function Wi(e, t, n, o, r, s, c, i, a = !1, f) {
|
|
|
2648
2655
|
cellValue: u.getData()
|
|
2649
2656
|
};
|
|
2650
2657
|
h.push({
|
|
2651
|
-
id:
|
|
2658
|
+
id: Mt.id,
|
|
2652
2659
|
params: d
|
|
2653
2660
|
});
|
|
2654
|
-
const
|
|
2661
|
+
const a = ts(
|
|
2655
2662
|
r,
|
|
2656
2663
|
d
|
|
2657
2664
|
);
|
|
2658
2665
|
return m.push({
|
|
2659
|
-
id:
|
|
2660
|
-
params:
|
|
2666
|
+
id: Mt.id,
|
|
2667
|
+
params: a
|
|
2661
2668
|
}), {
|
|
2662
2669
|
undos: m,
|
|
2663
2670
|
redos: h
|
|
2664
2671
|
};
|
|
2665
2672
|
}
|
|
2666
|
-
function
|
|
2667
|
-
return i ? r.pasteType ===
|
|
2673
|
+
function ji(e, t, n, o, r, s, c, i) {
|
|
2674
|
+
return i ? r.pasteType === ot.SPECIAL_PASTE_VALUE ? Ki(e, t, n, o, c, i) : r.pasteType === ot.SPECIAL_PASTE_FORMULA ? Yi(e, t, n, o, s, c, i) : Gi(e, t, n, o, r.copyType, s, c, i) : qi(e, t, n, o, c);
|
|
2668
2675
|
}
|
|
2669
|
-
function
|
|
2670
|
-
const s = new
|
|
2671
|
-
return o.forValue((i,
|
|
2676
|
+
function qi(e, t, n, o, r) {
|
|
2677
|
+
const s = new Fe(), c = r.getSheetFormulaData(e, t);
|
|
2678
|
+
return o.forValue((i, l, f) => {
|
|
2672
2679
|
var d;
|
|
2673
|
-
const h = n.rows[i], m = n.cols[
|
|
2674
|
-
|
|
2680
|
+
const h = n.rows[i], m = n.cols[l], u = {};
|
|
2681
|
+
ye(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, m, u)) : (d = c == null ? void 0 : c[h]) != null && d[m] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, m, u));
|
|
2675
2682
|
}), s;
|
|
2676
2683
|
}
|
|
2677
|
-
function
|
|
2684
|
+
function Ki(e, t, n, o, r, s) {
|
|
2678
2685
|
var f, h;
|
|
2679
|
-
const c = new
|
|
2686
|
+
const c = new Fe(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], l = r.getSheetFormulaData(e, t);
|
|
2680
2687
|
return o.forValue((m, u, d) => {
|
|
2681
2688
|
var _, R;
|
|
2682
|
-
const
|
|
2683
|
-
if (
|
|
2684
|
-
|
|
2685
|
-
else if ((_ = i == null ? void 0 : i[
|
|
2686
|
-
const C = i[
|
|
2687
|
-
|
|
2688
|
-
} else if ((R =
|
|
2689
|
-
if (
|
|
2690
|
-
const C =
|
|
2691
|
-
C && (
|
|
2689
|
+
const a = s.range.rows[m % s.range.rows.length], S = s.range.cols[u % s.range.cols.length], g = n.rows[m], p = n.cols[u], v = {};
|
|
2690
|
+
if (ye(d.f) || Be(d.si))
|
|
2691
|
+
v.v = d.v, v.f = null, v.si = null, v.p = null, c.setValue(g, p, v);
|
|
2692
|
+
else if ((_ = i == null ? void 0 : i[a]) != null && _[S]) {
|
|
2693
|
+
const C = i[a][S];
|
|
2694
|
+
v.v = C.v, v.f = null, v.si = null, v.p = null, c.setValue(g, p, v);
|
|
2695
|
+
} else if ((R = l == null ? void 0 : l[g]) != null && R[p]) {
|
|
2696
|
+
if (v.v = d.v, v.f = null, v.si = null, v.p = null, d.p) {
|
|
2697
|
+
const C = Mr(d);
|
|
2698
|
+
C && (v.v = C);
|
|
2692
2699
|
}
|
|
2693
|
-
c.setValue(g,
|
|
2700
|
+
c.setValue(g, p, v);
|
|
2694
2701
|
}
|
|
2695
2702
|
}), c;
|
|
2696
2703
|
}
|
|
2697
|
-
function
|
|
2698
|
-
const i = new
|
|
2704
|
+
function Yi(e, t, n, o, r, s, c) {
|
|
2705
|
+
const i = new Fe(), l = /* @__PURE__ */ new Map();
|
|
2699
2706
|
return o.forValue((f, h, m) => {
|
|
2700
|
-
const u = n.rows[f], d = n.cols[h],
|
|
2701
|
-
if (
|
|
2707
|
+
const u = n.rows[f], d = n.cols[h], a = {};
|
|
2708
|
+
if (Be(m.si)) {
|
|
2702
2709
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
2703
|
-
const
|
|
2710
|
+
const S = s.getFormulaStringByCell(
|
|
2704
2711
|
c.range.rows[f % c.range.rows.length],
|
|
2705
2712
|
c.range.cols[h % c.range.cols.length],
|
|
2706
2713
|
c.subUnitId,
|
|
2707
2714
|
c.unitId
|
|
2708
|
-
), g = n.cols[h] - c.range.cols[h % c.range.cols.length],
|
|
2709
|
-
|
|
2715
|
+
), g = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[f] - c.range.rows[f % c.range.rows.length], v = r.moveFormulaRefOffset(S || "", g, p);
|
|
2716
|
+
a.si = null, a.f = v;
|
|
2710
2717
|
} else
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
} else if (
|
|
2714
|
-
const
|
|
2715
|
-
let g =
|
|
2718
|
+
a.si = m.si, a.f = null;
|
|
2719
|
+
a.v = null, a.p = null, i.setValue(u, d, a);
|
|
2720
|
+
} else if (ye(m.f)) {
|
|
2721
|
+
const S = `${f % c.range.rows.length}_${h % c.range.cols.length}`;
|
|
2722
|
+
let g = l.get(S);
|
|
2716
2723
|
if (g)
|
|
2717
|
-
|
|
2724
|
+
a.si = g, a.f = null;
|
|
2718
2725
|
else {
|
|
2719
|
-
g =
|
|
2720
|
-
const
|
|
2721
|
-
|
|
2726
|
+
g = it.generateRandomId(6), l.set(S, g);
|
|
2727
|
+
const p = n.cols[h] - c.range.cols[h % c.range.cols.length], v = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(m.f || "", p, v);
|
|
2728
|
+
a.si = g, a.f = _;
|
|
2722
2729
|
}
|
|
2723
|
-
|
|
2730
|
+
a.v = null, a.p = null, i.setValue(u, d, a);
|
|
2724
2731
|
} else {
|
|
2725
|
-
if (
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2732
|
+
if (a.v = m.v, a.f = null, a.si = null, a.p = null, m.p) {
|
|
2733
|
+
const S = Mr(m);
|
|
2734
|
+
S && (a.v = S);
|
|
2728
2735
|
}
|
|
2729
|
-
i.setValue(u, d,
|
|
2736
|
+
i.setValue(u, d, a);
|
|
2730
2737
|
}
|
|
2731
2738
|
}), i;
|
|
2732
2739
|
}
|
|
2733
|
-
function
|
|
2734
|
-
const
|
|
2735
|
-
return r ===
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2738
|
-
if (
|
|
2739
|
-
m.push(
|
|
2740
|
-
else if (m.includes(
|
|
2741
|
-
|
|
2740
|
+
function Gi(e, t, n, o, r, s, c, i) {
|
|
2741
|
+
const l = new Fe(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), m = [];
|
|
2742
|
+
return r === Jn.CUT ? o.forValue((u, d, a) => {
|
|
2743
|
+
const S = n.rows[u], g = n.cols[d], p = {};
|
|
2744
|
+
if (Be(a.si)) {
|
|
2745
|
+
if (ye(a.f))
|
|
2746
|
+
m.push(a.si), p.f = a.f, p.si = a.si;
|
|
2747
|
+
else if (m.includes(a.si))
|
|
2748
|
+
p.f = null, p.si = a.si;
|
|
2742
2749
|
else {
|
|
2743
|
-
const
|
|
2750
|
+
const v = c.getFormulaStringByCell(
|
|
2744
2751
|
i.range.rows[u % i.range.rows.length],
|
|
2745
2752
|
i.range.cols[d % i.range.cols.length],
|
|
2746
2753
|
i.subUnitId,
|
|
2747
2754
|
i.unitId
|
|
2748
2755
|
);
|
|
2749
|
-
|
|
2756
|
+
p.f = v, p.si = null;
|
|
2750
2757
|
}
|
|
2751
|
-
|
|
2752
|
-
} else
|
|
2753
|
-
}) : o.forValue((u, d,
|
|
2754
|
-
var
|
|
2755
|
-
const
|
|
2756
|
-
if (
|
|
2758
|
+
p.v = null, p.p = null, l.setValue(S, g, p);
|
|
2759
|
+
} else ye(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(S, g, p));
|
|
2760
|
+
}) : o.forValue((u, d, a) => {
|
|
2761
|
+
var v;
|
|
2762
|
+
const S = n.rows[u], g = n.cols[d], p = {};
|
|
2763
|
+
if (Be(a.si)) {
|
|
2757
2764
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
2758
2765
|
const _ = c.getFormulaStringByCell(
|
|
2759
2766
|
i.range.rows[u % i.range.rows.length],
|
|
@@ -2761,59 +2768,59 @@ function Ki(e, t, n, o, r, s, c, i) {
|
|
|
2761
2768
|
i.subUnitId,
|
|
2762
2769
|
i.unitId
|
|
2763
2770
|
), R = n.cols[d] - i.range.cols[d % i.range.cols.length], C = n.rows[u] - i.range.rows[u % i.range.rows.length], y = s.moveFormulaRefOffset(_ || "", R, C);
|
|
2764
|
-
|
|
2771
|
+
p.si = null, p.f = y;
|
|
2765
2772
|
} else
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
} else if (
|
|
2773
|
+
p.si = a.si, p.f = null;
|
|
2774
|
+
p.v = null, p.p = null, l.setValue(S, g, p);
|
|
2775
|
+
} else if (ye(a.f)) {
|
|
2769
2776
|
const _ = `${u % i.range.rows.length}_${d % i.range.cols.length}`;
|
|
2770
2777
|
let R = f.get(_);
|
|
2771
2778
|
if (R)
|
|
2772
|
-
|
|
2779
|
+
p.si = R, p.f = null;
|
|
2773
2780
|
else {
|
|
2774
|
-
R =
|
|
2775
|
-
const C = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(
|
|
2776
|
-
|
|
2781
|
+
R = it.generateRandomId(6), f.set(_, R);
|
|
2782
|
+
const C = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(a.f || "", C, y);
|
|
2783
|
+
p.si = R, p.f = N;
|
|
2777
2784
|
}
|
|
2778
|
-
|
|
2779
|
-
} else (
|
|
2780
|
-
}), m.length > 0 && new
|
|
2781
|
-
if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(
|
|
2782
|
-
const
|
|
2785
|
+
p.v = null, p.p = null, l.setValue(S, g, p);
|
|
2786
|
+
} else (v = h == null ? void 0 : h[S]) != null && v[g] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(S, g, p));
|
|
2787
|
+
}), m.length > 0 && new Fe(h).forValue((u, d, a) => {
|
|
2788
|
+
if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(a == null ? void 0 : a.si)) {
|
|
2789
|
+
const S = c.getFormulaStringByCell(
|
|
2783
2790
|
u,
|
|
2784
2791
|
d,
|
|
2785
2792
|
i.subUnitId,
|
|
2786
2793
|
i.unitId
|
|
2787
2794
|
);
|
|
2788
|
-
|
|
2789
|
-
f:
|
|
2795
|
+
l.setValue(u, d, {
|
|
2796
|
+
f: S,
|
|
2790
2797
|
si: null,
|
|
2791
2798
|
v: null,
|
|
2792
2799
|
p: null
|
|
2793
2800
|
});
|
|
2794
2801
|
}
|
|
2795
|
-
}),
|
|
2802
|
+
}), l;
|
|
2796
2803
|
}
|
|
2797
|
-
function
|
|
2804
|
+
function Mr(e) {
|
|
2798
2805
|
if (e != null && e.p) {
|
|
2799
2806
|
const t = e == null ? void 0 : e.p.body;
|
|
2800
2807
|
if (t == null)
|
|
2801
2808
|
return;
|
|
2802
2809
|
const n = t.dataStream;
|
|
2803
|
-
return n.substring(n.length - 2, n.length) ===
|
|
2810
|
+
return n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
|
|
2804
2811
|
}
|
|
2805
2812
|
}
|
|
2806
|
-
var
|
|
2807
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2813
|
+
var zi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
|
|
2814
|
+
for (var r = o > 1 ? void 0 : o ? zi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2808
2815
|
(c = e[s]) && (r = c(r) || r);
|
|
2809
2816
|
return r;
|
|
2810
|
-
},
|
|
2811
|
-
let
|
|
2812
|
-
constructor(t, n, o, r, s, c, i,
|
|
2817
|
+
}, Ve = (e, t) => (n, o) => t(n, o, e);
|
|
2818
|
+
let Lt = class extends lt {
|
|
2819
|
+
constructor(t, n, o, r, s, c, i, l) {
|
|
2813
2820
|
super();
|
|
2814
2821
|
j(this, "_previousShape");
|
|
2815
2822
|
j(this, "_skeleton");
|
|
2816
|
-
this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService =
|
|
2823
|
+
this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
|
|
2817
2824
|
}
|
|
2818
2825
|
_initSkeletonChangeListener() {
|
|
2819
2826
|
this.disposeWithMe(
|
|
@@ -2838,19 +2845,19 @@ let Ot = class extends nt {
|
|
|
2838
2845
|
}
|
|
2839
2846
|
_initInterceptorEditorStart() {
|
|
2840
2847
|
this.disposeWithMe(
|
|
2841
|
-
|
|
2842
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
2848
|
+
zn(
|
|
2849
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(ns, {
|
|
2843
2850
|
handler: (t, n, o) => {
|
|
2844
|
-
var
|
|
2845
|
-
const { row: r, col: s, unitId: c, subUnitId: i, worksheet:
|
|
2851
|
+
var a, S, g, p;
|
|
2852
|
+
const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n, f = this._formulaDataModel.getArrayFormulaRange(), h = this._formulaDataModel.getArrayFormulaCellData();
|
|
2846
2853
|
if (this._removeArrayFormulaRangeShape(), t == null)
|
|
2847
2854
|
return o(t);
|
|
2848
2855
|
let m = null;
|
|
2849
2856
|
const u = this._formulaDataModel.getFormulaStringByCell(r, s, i, c);
|
|
2850
|
-
if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((g = (
|
|
2857
|
+
if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((g = (S = (a = h[c]) == null ? void 0 : a[i]) == null ? void 0 : S[r]) == null ? void 0 : g[s]) == null)
|
|
2851
2858
|
return m ? { ...t, ...m } : o(t);
|
|
2852
|
-
const d = (
|
|
2853
|
-
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, c, i,
|
|
2859
|
+
const d = (p = f == null ? void 0 : f[c]) == null ? void 0 : p[i];
|
|
2860
|
+
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, c, i, l, m)), m ? { ...t, ...m } : o(t);
|
|
2854
2861
|
}
|
|
2855
2862
|
})
|
|
2856
2863
|
)
|
|
@@ -2858,10 +2865,10 @@ let Ot = class extends nt {
|
|
|
2858
2865
|
}
|
|
2859
2866
|
_commandExecutedListener() {
|
|
2860
2867
|
this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
|
|
2861
|
-
(t.id ===
|
|
2868
|
+
(t.id === Fo.id || t.id === Do.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
2862
2869
|
})), this.disposeWithMe(
|
|
2863
2870
|
this._commandService.beforeCommandExecuted((t) => {
|
|
2864
|
-
|
|
2871
|
+
rs.id === t.id && requestIdleCallback(() => {
|
|
2865
2872
|
const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
2866
2873
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
2867
2874
|
});
|
|
@@ -2869,21 +2876,21 @@ let Ot = class extends nt {
|
|
|
2869
2876
|
);
|
|
2870
2877
|
}
|
|
2871
2878
|
_displayArrayFormulaRangeShape(t, n, o, r, s, c, i) {
|
|
2872
|
-
const
|
|
2873
|
-
return new
|
|
2879
|
+
const l = this._formulaDataModel.getSheetFormulaData(r, s);
|
|
2880
|
+
return new Fe(t).forValue((f, h, m) => {
|
|
2874
2881
|
var g;
|
|
2875
2882
|
if (m == null)
|
|
2876
2883
|
return !0;
|
|
2877
|
-
const { startRow: u, startColumn: d, endRow:
|
|
2884
|
+
const { startRow: u, startColumn: d, endRow: a, endColumn: S } = m;
|
|
2878
2885
|
if (f === n && h === o)
|
|
2879
2886
|
return this._createArrayFormulaRangeShape(m, r), !1;
|
|
2880
|
-
if (n >= u && n <=
|
|
2881
|
-
const
|
|
2882
|
-
if ((
|
|
2887
|
+
if (n >= u && n <= a && o >= d && o <= S) {
|
|
2888
|
+
const p = c.getCell(u, d);
|
|
2889
|
+
if ((p == null ? void 0 : p.v) === ie.SPILL)
|
|
2883
2890
|
return;
|
|
2884
|
-
const
|
|
2885
|
-
return
|
|
2886
|
-
f:
|
|
2891
|
+
const v = (g = l == null ? void 0 : l[f]) == null ? void 0 : g[h];
|
|
2892
|
+
return v == null || v.f == null ? !0 : (i == null && (i = {
|
|
2893
|
+
f: v.f,
|
|
2887
2894
|
isInArrayFormulaRange: !0
|
|
2888
2895
|
}), this._createArrayFormulaRangeShape(m, r), !1);
|
|
2889
2896
|
}
|
|
@@ -2900,12 +2907,12 @@ let Ot = class extends nt {
|
|
|
2900
2907
|
style: {
|
|
2901
2908
|
strokeWidth: 1,
|
|
2902
2909
|
stroke: this._themeService.getColorFromTheme("primary.600"),
|
|
2903
|
-
fill: new
|
|
2910
|
+
fill: new sn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
2904
2911
|
widgets: {}
|
|
2905
2912
|
}
|
|
2906
|
-
}, i =
|
|
2913
|
+
}, i = Xt(c, r), { rowHeaderWidth: l, columnHeaderHeight: f } = r, h = new Qn(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
2907
2914
|
highlightHeader: !1,
|
|
2908
|
-
rowHeaderWidth:
|
|
2915
|
+
rowHeaderWidth: l,
|
|
2909
2916
|
columnHeaderHeight: f
|
|
2910
2917
|
});
|
|
2911
2918
|
h.updateRangeBySelectionWithCoord(i), h.setEvent(!1), this._previousShape = h;
|
|
@@ -2931,8 +2938,8 @@ let Ot = class extends nt {
|
|
|
2931
2938
|
_refreshArrayFormulaRangeShapeByRow(t, n, o) {
|
|
2932
2939
|
if (!this._checkCurrentSheet(t, n) || !this._previousShape) return;
|
|
2933
2940
|
const { startRow: r, endRow: s, startColumn: c, endColumn: i } = this._previousShape.getRange();
|
|
2934
|
-
for (let
|
|
2935
|
-
const { row: f } = o[
|
|
2941
|
+
for (let l = 0; l < o.length; l++) {
|
|
2942
|
+
const { row: f } = o[l];
|
|
2936
2943
|
if (r >= f) {
|
|
2937
2944
|
const h = {
|
|
2938
2945
|
startRow: r,
|
|
@@ -2946,40 +2953,40 @@ let Ot = class extends nt {
|
|
|
2946
2953
|
}
|
|
2947
2954
|
}
|
|
2948
2955
|
};
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
],
|
|
2958
|
-
var
|
|
2959
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2956
|
+
Lt = Zi([
|
|
2957
|
+
Ve(1, B(dn)),
|
|
2958
|
+
Ve(2, B(Et)),
|
|
2959
|
+
Ve(3, B(_t)),
|
|
2960
|
+
Ve(4, Oe),
|
|
2961
|
+
Ve(5, B(Vt)),
|
|
2962
|
+
Ve(6, ue),
|
|
2963
|
+
Ve(7, Jr)
|
|
2964
|
+
], Lt);
|
|
2965
|
+
var Xi = Object.getOwnPropertyDescriptor, Qi = (e, t, n, o) => {
|
|
2966
|
+
for (var r = o > 1 ? void 0 : o ? Xi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
2960
2967
|
(c = e[s]) && (r = c(r) || r);
|
|
2961
2968
|
return r;
|
|
2962
|
-
},
|
|
2963
|
-
const
|
|
2969
|
+
}, qn = (e, t) => (n, o) => t(n, o, e);
|
|
2970
|
+
const Ji = {
|
|
2964
2971
|
tl: {
|
|
2965
2972
|
size: 6,
|
|
2966
2973
|
color: "#409f11"
|
|
2967
2974
|
}
|
|
2968
2975
|
};
|
|
2969
|
-
let
|
|
2976
|
+
let $t = class extends eo {
|
|
2970
2977
|
constructor(e, t) {
|
|
2971
2978
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
2972
|
-
|
|
2979
|
+
os.CELL_CONTENT,
|
|
2973
2980
|
{
|
|
2974
|
-
effect:
|
|
2981
|
+
effect: to.Style,
|
|
2975
2982
|
handler: (n, o, r) => {
|
|
2976
|
-
var i,
|
|
2977
|
-
const s = (h = (f = (
|
|
2978
|
-
return
|
|
2983
|
+
var i, l, f, h;
|
|
2984
|
+
const s = (h = (f = (l = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : f[o.row]) == null ? void 0 : h[o.col];
|
|
2985
|
+
return Nr(n, !!s) ? r({
|
|
2979
2986
|
...n,
|
|
2980
2987
|
markers: {
|
|
2981
2988
|
...n == null ? void 0 : n.markers,
|
|
2982
|
-
...
|
|
2989
|
+
...Ji
|
|
2983
2990
|
}
|
|
2984
2991
|
}) : r(n);
|
|
2985
2992
|
},
|
|
@@ -2988,35 +2995,35 @@ let Nt = class extends Qr {
|
|
|
2988
2995
|
));
|
|
2989
2996
|
}
|
|
2990
2997
|
};
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
],
|
|
2995
|
-
function
|
|
2996
|
-
const e = T(
|
|
2997
|
-
t.executeCommand(
|
|
2998
|
-
}, [t]), r =
|
|
2998
|
+
$t = Qi([
|
|
2999
|
+
qn(0, B(dn)),
|
|
3000
|
+
qn(1, B(Et))
|
|
3001
|
+
], $t);
|
|
3002
|
+
function ec() {
|
|
3003
|
+
const e = T(is), t = T(ue), n = Ce(e.progress$), o = wt(() => {
|
|
3004
|
+
t.executeCommand(Lo.id);
|
|
3005
|
+
}, [t]), r = wt(() => {
|
|
2999
3006
|
e.clearProgress();
|
|
3000
3007
|
}, [e]);
|
|
3001
|
-
return /* @__PURE__ */ O(
|
|
3008
|
+
return /* @__PURE__ */ O(hs, { progress: n, onTerminate: o, onClearProgress: r });
|
|
3002
3009
|
}
|
|
3003
|
-
function
|
|
3010
|
+
function wr(e) {
|
|
3004
3011
|
const { prefix: t, value: n } = e;
|
|
3005
|
-
return /* @__PURE__ */
|
|
3006
|
-
/* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ W("div", { children: [
|
|
3013
|
+
/* @__PURE__ */ W("span", { children: [
|
|
3007
3014
|
t,
|
|
3008
3015
|
"("
|
|
3009
3016
|
] }),
|
|
3010
|
-
n && n.map((o, r) => /* @__PURE__ */
|
|
3011
|
-
/* @__PURE__ */ O("span", { children:
|
|
3017
|
+
n && n.map((o, r) => /* @__PURE__ */ W("span", { children: [
|
|
3018
|
+
/* @__PURE__ */ O("span", { children: br(o) }),
|
|
3012
3019
|
r === n.length - 1 ? "" : ","
|
|
3013
3020
|
] }, r)),
|
|
3014
3021
|
")"
|
|
3015
3022
|
] });
|
|
3016
3023
|
}
|
|
3017
|
-
function
|
|
3024
|
+
function pt(e) {
|
|
3018
3025
|
const { className: t, value: n, title: o } = e;
|
|
3019
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
|
|
3020
3027
|
/* @__PURE__ */ O(
|
|
3021
3028
|
"div",
|
|
3022
3029
|
{
|
|
@@ -3030,88 +3037,88 @@ function lt(e) {
|
|
|
3030
3037
|
/* @__PURE__ */ O(
|
|
3031
3038
|
"div",
|
|
3032
3039
|
{
|
|
3033
|
-
className: "univer-text-gray-900 dark
|
|
3040
|
+
className: "univer-text-gray-900 dark:!univer-text-white",
|
|
3034
3041
|
children: n
|
|
3035
3042
|
}
|
|
3036
3043
|
)
|
|
3037
3044
|
] });
|
|
3038
3045
|
}
|
|
3039
|
-
function
|
|
3046
|
+
function tc(e) {
|
|
3040
3047
|
const { functionInfo: t, onChange: n } = e;
|
|
3041
3048
|
if (!t) return null;
|
|
3042
|
-
const [o, r] =
|
|
3043
|
-
return /* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */ O("div", { className: "univer-h-[364px] univer-overflow-y-auto", children: s.map((f, h) => /* @__PURE__ */
|
|
3049
|
+
const [o, r] = V([]), [s, c] = V(t.functionParameter), [i, l] = V(-1);
|
|
3050
|
+
return /* @__PURE__ */ W("div", { children: [
|
|
3051
|
+
/* @__PURE__ */ O("div", { className: "univer-h-[364px] univer-overflow-y-auto", children: s.map((f, h) => /* @__PURE__ */ W("div", { children: [
|
|
3045
3052
|
/* @__PURE__ */ O("div", { className: "univer-text-sm", children: f.name }),
|
|
3046
3053
|
/* @__PURE__ */ O("div", { className: "univer-mb-2 univer-mt-1" })
|
|
3047
3054
|
] }, h)) }),
|
|
3048
|
-
/* @__PURE__ */ O("div", { className:
|
|
3049
|
-
|
|
3055
|
+
/* @__PURE__ */ O("div", { className: fe("univer-flex-1 univer-p-3", Cs), children: /* @__PURE__ */ O(
|
|
3056
|
+
pt,
|
|
3050
3057
|
{
|
|
3051
|
-
title: i === -1 ? /* @__PURE__ */ O(
|
|
3058
|
+
title: i === -1 ? /* @__PURE__ */ O(wr, { prefix: t.functionName, value: s }) : s[i].name,
|
|
3052
3059
|
value: i === -1 ? t.description : s[i].detail
|
|
3053
3060
|
}
|
|
3054
3061
|
) })
|
|
3055
3062
|
] });
|
|
3056
3063
|
}
|
|
3057
|
-
function
|
|
3058
|
-
const { onChange: t } = e, n = "-1", [o, r] =
|
|
3064
|
+
function nc(e) {
|
|
3065
|
+
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [f, h] = V(n), [m, u] = V(0), [d, a] = V(null), S = T(Ht), g = T(at), p = T(hn), v = Ce(p.sidebarOptions$), _ = qs($o, g);
|
|
3059
3066
|
_.unshift({
|
|
3060
3067
|
label: g.t("formula.moreFunctions.allFunctions"),
|
|
3061
3068
|
value: n
|
|
3062
3069
|
});
|
|
3063
3070
|
const R = g.t("formula.prompt.required"), C = g.t("formula.prompt.optional");
|
|
3064
|
-
|
|
3071
|
+
$(() => {
|
|
3065
3072
|
k(n);
|
|
3066
|
-
}, []),
|
|
3073
|
+
}, []), $(() => {
|
|
3067
3074
|
N(0);
|
|
3068
|
-
}, [s]),
|
|
3069
|
-
|
|
3070
|
-
}, [
|
|
3071
|
-
const y = (
|
|
3072
|
-
if (o.trim() === "") return
|
|
3073
|
-
const
|
|
3074
|
-
return
|
|
3075
|
-
}, N = (
|
|
3075
|
+
}, [s]), $(() => {
|
|
3076
|
+
v != null && v.visible && (r(""), c([]), l(0), h(n), u(0), a(null), k(n));
|
|
3077
|
+
}, [v]);
|
|
3078
|
+
const y = (b) => {
|
|
3079
|
+
if (o.trim() === "") return b;
|
|
3080
|
+
const E = new RegExp(`(${o.toLocaleUpperCase()})`);
|
|
3081
|
+
return b.split(E).filter(Boolean).map((A, L) => A.match(E) ? /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: A }, L) : A);
|
|
3082
|
+
}, N = (b) => {
|
|
3076
3083
|
if (s.length === 0) {
|
|
3077
|
-
|
|
3084
|
+
a(null);
|
|
3078
3085
|
return;
|
|
3079
3086
|
}
|
|
3080
|
-
u(
|
|
3081
|
-
const
|
|
3082
|
-
if (!
|
|
3083
|
-
|
|
3087
|
+
u(b);
|
|
3088
|
+
const E = S.getFunctionInfo(s[b].name);
|
|
3089
|
+
if (!E) {
|
|
3090
|
+
a(null);
|
|
3084
3091
|
return;
|
|
3085
3092
|
}
|
|
3086
|
-
|
|
3093
|
+
a(E), t(E);
|
|
3087
3094
|
};
|
|
3088
|
-
function k(
|
|
3089
|
-
h(
|
|
3090
|
-
const
|
|
3091
|
-
c(
|
|
3092
|
-
}
|
|
3093
|
-
function F(
|
|
3094
|
-
r(
|
|
3095
|
-
const
|
|
3096
|
-
c(
|
|
3097
|
-
}
|
|
3098
|
-
function x(
|
|
3099
|
-
if (
|
|
3100
|
-
const
|
|
3101
|
-
|
|
3102
|
-
} else if (
|
|
3103
|
-
const
|
|
3104
|
-
|
|
3105
|
-
} else
|
|
3106
|
-
}
|
|
3107
|
-
const w = (
|
|
3108
|
-
|
|
3095
|
+
function k(b) {
|
|
3096
|
+
h(b);
|
|
3097
|
+
const E = S.getSearchListByType(+b);
|
|
3098
|
+
c(E);
|
|
3099
|
+
}
|
|
3100
|
+
function F(b) {
|
|
3101
|
+
r(b);
|
|
3102
|
+
const E = S.getSearchListByName(b);
|
|
3103
|
+
c(E);
|
|
3104
|
+
}
|
|
3105
|
+
function x(b) {
|
|
3106
|
+
if (b.stopPropagation(), b.key === "ArrowDown") {
|
|
3107
|
+
const E = i + 1;
|
|
3108
|
+
l(E === s.length ? 0 : E);
|
|
3109
|
+
} else if (b.key === "ArrowUp") {
|
|
3110
|
+
const E = i - 1;
|
|
3111
|
+
l(E === -1 ? s.length - 1 : E);
|
|
3112
|
+
} else b.key === "Enter" && N(i);
|
|
3113
|
+
}
|
|
3114
|
+
const w = (b) => {
|
|
3115
|
+
l(b);
|
|
3109
3116
|
}, M = () => {
|
|
3110
|
-
|
|
3117
|
+
l(-1);
|
|
3111
3118
|
};
|
|
3112
|
-
return /* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */ O(
|
|
3119
|
+
return /* @__PURE__ */ W("div", { children: [
|
|
3120
|
+
/* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-[10%]", children: [
|
|
3121
|
+
/* @__PURE__ */ O(_s, { value: f, options: _, onChange: k }),
|
|
3115
3122
|
/* @__PURE__ */ O(
|
|
3116
3123
|
lr,
|
|
3117
3124
|
{
|
|
@@ -3127,88 +3134,88 @@ function ec(e) {
|
|
|
3127
3134
|
/* @__PURE__ */ O(
|
|
3128
3135
|
"ul",
|
|
3129
3136
|
{
|
|
3130
|
-
className:
|
|
3137
|
+
className: fe("univer-mx-0 univer-mb-0 univer-mt-2 univer-box-border univer-max-h-[364px] univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", fn),
|
|
3131
3138
|
onKeyDown: x,
|
|
3132
3139
|
tabIndex: -1,
|
|
3133
|
-
children: s.map(({ name:
|
|
3140
|
+
children: s.map(({ name: b }, E) => /* @__PURE__ */ W(
|
|
3134
3141
|
"li",
|
|
3135
3142
|
{
|
|
3136
|
-
className:
|
|
3137
|
-
"univer-bg-gray-200": i ===
|
|
3143
|
+
className: fe("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
3144
|
+
"univer-bg-gray-200": i === E
|
|
3138
3145
|
}),
|
|
3139
|
-
onMouseEnter: () => w(
|
|
3146
|
+
onMouseEnter: () => w(E),
|
|
3140
3147
|
onMouseLeave: M,
|
|
3141
|
-
onClick: () => N(
|
|
3148
|
+
onClick: () => N(E),
|
|
3142
3149
|
children: [
|
|
3143
|
-
m ===
|
|
3144
|
-
|
|
3150
|
+
m === E && /* @__PURE__ */ O(
|
|
3151
|
+
Sr,
|
|
3145
3152
|
{
|
|
3146
3153
|
className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
|
|
3147
3154
|
}
|
|
3148
3155
|
),
|
|
3149
|
-
/* @__PURE__ */ O("span", { className: "univer-block", children: y(
|
|
3156
|
+
/* @__PURE__ */ O("span", { className: "univer-block", children: y(b) })
|
|
3150
3157
|
]
|
|
3151
3158
|
},
|
|
3152
|
-
|
|
3159
|
+
E
|
|
3153
3160
|
))
|
|
3154
3161
|
}
|
|
3155
3162
|
),
|
|
3156
|
-
d && /* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */ O(
|
|
3163
|
+
d && /* @__PURE__ */ W("div", { className: "univer-mx-0 univer-my-2 univer-max-h-[307px] univer-overflow-y-auto", children: [
|
|
3164
|
+
/* @__PURE__ */ O(pt, { title: d.functionName, value: d.description }),
|
|
3158
3165
|
/* @__PURE__ */ O(
|
|
3159
|
-
|
|
3166
|
+
pt,
|
|
3160
3167
|
{
|
|
3161
3168
|
title: g.t("formula.moreFunctions.syntax"),
|
|
3162
|
-
value: /* @__PURE__ */ O(
|
|
3169
|
+
value: /* @__PURE__ */ O(wr, { prefix: d.functionName, value: d.functionParameter })
|
|
3163
3170
|
}
|
|
3164
3171
|
),
|
|
3165
3172
|
/* @__PURE__ */ O(
|
|
3166
|
-
|
|
3173
|
+
pt,
|
|
3167
3174
|
{
|
|
3168
3175
|
title: g.t("formula.prompt.helpExample"),
|
|
3169
|
-
value: `${d.functionName}(${d.functionParameter.map((
|
|
3176
|
+
value: `${d.functionName}(${d.functionParameter.map((b) => b.example).join(",")})`
|
|
3170
3177
|
}
|
|
3171
3178
|
),
|
|
3172
|
-
d.functionParameter && d.functionParameter.map((
|
|
3173
|
-
|
|
3179
|
+
d.functionParameter && d.functionParameter.map((b) => /* @__PURE__ */ O(
|
|
3180
|
+
pt,
|
|
3174
3181
|
{
|
|
3175
|
-
title:
|
|
3176
|
-
value: `${
|
|
3182
|
+
title: b.name,
|
|
3183
|
+
value: `${b.require ? R : C} ${b.detail}`
|
|
3177
3184
|
},
|
|
3178
|
-
|
|
3185
|
+
b.name
|
|
3179
3186
|
))
|
|
3180
3187
|
] })
|
|
3181
3188
|
] });
|
|
3182
3189
|
}
|
|
3183
|
-
function
|
|
3184
|
-
const e =
|
|
3185
|
-
T(
|
|
3186
|
-
const i = T(
|
|
3190
|
+
function rc() {
|
|
3191
|
+
const e = Eo(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
|
|
3192
|
+
T(cn);
|
|
3193
|
+
const i = T(at), l = T(qe), f = T(ee), h = T(ue);
|
|
3187
3194
|
function m() {
|
|
3188
3195
|
n(!t), r(!o);
|
|
3189
3196
|
}
|
|
3190
3197
|
function u() {
|
|
3191
|
-
const d =
|
|
3198
|
+
const d = or(f);
|
|
3192
3199
|
if (!d) return;
|
|
3193
|
-
h.executeCommand(
|
|
3200
|
+
h.executeCommand(Zn.id, {
|
|
3194
3201
|
visible: !0,
|
|
3195
3202
|
unitId: d.unitId,
|
|
3196
|
-
eventType:
|
|
3203
|
+
eventType: xe.Dblclick
|
|
3197
3204
|
});
|
|
3198
|
-
const
|
|
3199
|
-
|
|
3205
|
+
const a = l.getEditor(on), S = l.getEditor(Yn), g = `=${s == null ? void 0 : s.functionName}(`;
|
|
3206
|
+
a == null || a.replaceText(g), S == null || S.replaceText(g, !1);
|
|
3200
3207
|
}
|
|
3201
|
-
return /* @__PURE__ */
|
|
3202
|
-
t && /* @__PURE__ */ O(
|
|
3203
|
-
o && /* @__PURE__ */ O(
|
|
3208
|
+
return /* @__PURE__ */ W("div", { className: "univer-flex univer-h-full univer-flex-col univer-justify-between univer-leading-5", children: [
|
|
3209
|
+
t && /* @__PURE__ */ O(nc, { onChange: c }),
|
|
3210
|
+
o && /* @__PURE__ */ O(tc, { functionInfo: s, onChange: () => {
|
|
3204
3211
|
} }),
|
|
3205
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ W(
|
|
3206
3213
|
"div",
|
|
3207
3214
|
{
|
|
3208
3215
|
className: "univer-flex univer-justify-end",
|
|
3209
3216
|
children: [
|
|
3210
3217
|
o && /* @__PURE__ */ O(
|
|
3211
|
-
|
|
3218
|
+
st,
|
|
3212
3219
|
{
|
|
3213
3220
|
variant: "primary",
|
|
3214
3221
|
onClick: m,
|
|
@@ -3216,9 +3223,9 @@ function tc() {
|
|
|
3216
3223
|
children: i.t("formula.moreFunctions.next")
|
|
3217
3224
|
}
|
|
3218
3225
|
),
|
|
3219
|
-
o && /* @__PURE__ */ O(
|
|
3226
|
+
o && /* @__PURE__ */ O(st, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
|
|
3220
3227
|
t && !!e && /* @__PURE__ */ O(
|
|
3221
|
-
|
|
3228
|
+
st,
|
|
3222
3229
|
{
|
|
3223
3230
|
variant: "primary",
|
|
3224
3231
|
onClick: u,
|
|
@@ -3231,189 +3238,256 @@ function tc() {
|
|
|
3231
3238
|
)
|
|
3232
3239
|
] });
|
|
3233
3240
|
}
|
|
3234
|
-
function
|
|
3241
|
+
function oc(e) {
|
|
3235
3242
|
return {
|
|
3236
|
-
id:
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
type:
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3243
|
+
id: he.id,
|
|
3244
|
+
title: "SUM",
|
|
3245
|
+
icon: "SumSingle",
|
|
3246
|
+
type: Ze.BUTTON,
|
|
3247
|
+
params: {
|
|
3248
|
+
value: "SUM"
|
|
3249
|
+
},
|
|
3250
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3251
|
+
disabled$: je(e, {
|
|
3252
|
+
workbookTypes: [ze],
|
|
3253
|
+
worksheetTypes: [Ye, Ke],
|
|
3254
|
+
rangeTypes: [Ge]
|
|
3255
|
+
})
|
|
3256
|
+
};
|
|
3257
|
+
}
|
|
3258
|
+
function sc(e) {
|
|
3259
|
+
return {
|
|
3260
|
+
id: he.id,
|
|
3261
|
+
title: "COUNT",
|
|
3262
|
+
icon: "CntSingle",
|
|
3263
|
+
type: Ze.BUTTON,
|
|
3264
|
+
params: {
|
|
3265
|
+
value: "COUNT"
|
|
3266
|
+
},
|
|
3267
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3268
|
+
disabled$: je(e, {
|
|
3269
|
+
workbookTypes: [ze],
|
|
3270
|
+
worksheetTypes: [Ye, Ke],
|
|
3271
|
+
rangeTypes: [Ge]
|
|
3272
|
+
})
|
|
3273
|
+
};
|
|
3274
|
+
}
|
|
3275
|
+
function ic(e) {
|
|
3276
|
+
return {
|
|
3277
|
+
id: he.id,
|
|
3278
|
+
title: "AVERAGE",
|
|
3279
|
+
icon: "AvgSingle",
|
|
3280
|
+
type: Ze.BUTTON,
|
|
3281
|
+
params: {
|
|
3282
|
+
value: "AVERAGE"
|
|
3283
|
+
},
|
|
3284
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3285
|
+
disabled$: je(e, {
|
|
3286
|
+
workbookTypes: [ze],
|
|
3287
|
+
worksheetTypes: [Ye, Ke],
|
|
3288
|
+
rangeTypes: [Ge]
|
|
3289
|
+
})
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
function cc(e) {
|
|
3293
|
+
return {
|
|
3294
|
+
id: he.id,
|
|
3295
|
+
title: "MAX",
|
|
3296
|
+
icon: "MaxSingle",
|
|
3297
|
+
type: Ze.BUTTON,
|
|
3298
|
+
params: {
|
|
3299
|
+
value: "MAX"
|
|
3300
|
+
},
|
|
3301
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3302
|
+
disabled$: je(e, {
|
|
3303
|
+
workbookTypes: [ze],
|
|
3304
|
+
worksheetTypes: [Ye, Ke],
|
|
3305
|
+
rangeTypes: [Ge]
|
|
3306
|
+
})
|
|
3307
|
+
};
|
|
3308
|
+
}
|
|
3309
|
+
function ac(e) {
|
|
3310
|
+
return {
|
|
3311
|
+
id: he.id,
|
|
3312
|
+
title: "MIN",
|
|
3313
|
+
icon: "MinSingle",
|
|
3314
|
+
type: Ze.BUTTON,
|
|
3315
|
+
params: {
|
|
3316
|
+
value: "MIN"
|
|
3317
|
+
},
|
|
3318
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3319
|
+
disabled$: je(e, {
|
|
3320
|
+
workbookTypes: [ze],
|
|
3321
|
+
worksheetTypes: [Ye, Ke],
|
|
3322
|
+
rangeTypes: [Ge]
|
|
3323
|
+
})
|
|
3284
3324
|
};
|
|
3285
3325
|
}
|
|
3286
|
-
function
|
|
3326
|
+
function lc(e) {
|
|
3287
3327
|
return {
|
|
3288
|
-
id:
|
|
3328
|
+
id: fr.id,
|
|
3289
3329
|
title: "formula.insert.more",
|
|
3290
|
-
type:
|
|
3330
|
+
type: Ze.BUTTON,
|
|
3331
|
+
hidden$: dt(e, q.UNIVER_SHEET),
|
|
3332
|
+
disabled$: je(e, {
|
|
3333
|
+
workbookTypes: [ze],
|
|
3334
|
+
worksheetTypes: [Ye, Ke],
|
|
3335
|
+
rangeTypes: [Ge]
|
|
3336
|
+
})
|
|
3291
3337
|
};
|
|
3292
3338
|
}
|
|
3293
|
-
function
|
|
3294
|
-
return e.get(ee).getCurrentTypeOfUnit$(
|
|
3295
|
-
|
|
3339
|
+
function uc(e) {
|
|
3340
|
+
return e.get(ee).getCurrentTypeOfUnit$(q.UNIVER_SHEET).pipe(
|
|
3341
|
+
Bo((o) => o ? e.get(Ln) ? new jo((s) => s.next(!e.get(Ln).supportClipboard)) : Mn(!0) : Mn(!0))
|
|
3296
3342
|
);
|
|
3297
3343
|
}
|
|
3298
|
-
function
|
|
3344
|
+
function dc(e) {
|
|
3299
3345
|
return {
|
|
3300
|
-
id:
|
|
3301
|
-
type:
|
|
3346
|
+
id: gn.id,
|
|
3347
|
+
type: Ze.BUTTON,
|
|
3302
3348
|
title: "formula.operation.pasteFormula",
|
|
3303
|
-
disabled$:
|
|
3304
|
-
|
|
3305
|
-
|
|
3349
|
+
disabled$: uc(e).pipe(
|
|
3350
|
+
Ho(je(e, {
|
|
3351
|
+
workbookTypes: [ze],
|
|
3352
|
+
rangeTypes: [Ge],
|
|
3353
|
+
worksheetTypes: [Ke, Ye]
|
|
3354
|
+
})),
|
|
3355
|
+
nr(([t, n]) => t || n)
|
|
3306
3356
|
)
|
|
3307
3357
|
};
|
|
3308
3358
|
}
|
|
3309
|
-
const
|
|
3310
|
-
[
|
|
3311
|
-
[
|
|
3312
|
-
order:
|
|
3313
|
-
menuItemFactory:
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3359
|
+
const hc = {
|
|
3360
|
+
[$n.BASIC]: {
|
|
3361
|
+
[`${he.id}.sum`]: {
|
|
3362
|
+
order: 0,
|
|
3363
|
+
menuItemFactory: oc
|
|
3364
|
+
},
|
|
3365
|
+
[`${he.id}.count`]: {
|
|
3366
|
+
order: 0,
|
|
3367
|
+
menuItemFactory: sc
|
|
3368
|
+
},
|
|
3369
|
+
[`${he.id}.average`]: {
|
|
3370
|
+
order: 0,
|
|
3371
|
+
menuItemFactory: ic
|
|
3372
|
+
},
|
|
3373
|
+
[`${he.id}.max`]: {
|
|
3374
|
+
order: 0,
|
|
3375
|
+
menuItemFactory: cc
|
|
3376
|
+
},
|
|
3377
|
+
[`${he.id}.min`]: {
|
|
3378
|
+
order: 0,
|
|
3379
|
+
menuItemFactory: ac
|
|
3318
3380
|
}
|
|
3319
3381
|
},
|
|
3320
|
-
[
|
|
3321
|
-
|
|
3382
|
+
[$n.OTHERS]: {
|
|
3383
|
+
order: 0,
|
|
3384
|
+
menuItemFactory: lc
|
|
3385
|
+
},
|
|
3386
|
+
[bo]: {
|
|
3387
|
+
[gn.id]: {
|
|
3322
3388
|
order: 4,
|
|
3323
|
-
menuItemFactory:
|
|
3389
|
+
menuItemFactory: dc
|
|
3324
3390
|
}
|
|
3325
3391
|
}
|
|
3326
|
-
},
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
],
|
|
3332
|
-
function
|
|
3392
|
+
}, fc = "meta_key_ctrl_And_Shift", jt = [
|
|
3393
|
+
D.ARROW_DOWN,
|
|
3394
|
+
D.ARROW_UP,
|
|
3395
|
+
D.ARROW_LEFT,
|
|
3396
|
+
D.ARROW_RIGHT
|
|
3397
|
+
], gc = [...jt, D.ENTER, D.TAB, D.ESC];
|
|
3398
|
+
function mc() {
|
|
3333
3399
|
const e = [];
|
|
3334
|
-
for (const t of
|
|
3400
|
+
for (const t of gc)
|
|
3335
3401
|
e.push({
|
|
3336
|
-
id:
|
|
3402
|
+
id: ht.id,
|
|
3337
3403
|
binding: t,
|
|
3338
|
-
preconditions: (n) =>
|
|
3404
|
+
preconditions: (n) => Rt(n),
|
|
3339
3405
|
staticParameters: {
|
|
3340
|
-
eventType:
|
|
3406
|
+
eventType: xe.Keyboard,
|
|
3341
3407
|
keycode: t
|
|
3342
3408
|
}
|
|
3343
3409
|
});
|
|
3344
3410
|
return e;
|
|
3345
3411
|
}
|
|
3346
|
-
function
|
|
3412
|
+
function pc() {
|
|
3347
3413
|
const e = [];
|
|
3348
|
-
for (const t of
|
|
3414
|
+
for (const t of jt)
|
|
3349
3415
|
e.push({
|
|
3350
|
-
id:
|
|
3351
|
-
binding: t |
|
|
3352
|
-
preconditions: (n) =>
|
|
3416
|
+
id: ht.id,
|
|
3417
|
+
binding: t | P.SHIFT,
|
|
3418
|
+
preconditions: (n) => Rt(n),
|
|
3353
3419
|
staticParameters: {
|
|
3354
|
-
eventType:
|
|
3420
|
+
eventType: xe.Keyboard,
|
|
3355
3421
|
keycode: t,
|
|
3356
|
-
metaKey:
|
|
3422
|
+
metaKey: P.SHIFT
|
|
3357
3423
|
}
|
|
3358
3424
|
});
|
|
3359
3425
|
return e;
|
|
3360
3426
|
}
|
|
3361
|
-
function
|
|
3427
|
+
function Sc() {
|
|
3362
3428
|
const e = [];
|
|
3363
|
-
for (const t of
|
|
3429
|
+
for (const t of jt)
|
|
3364
3430
|
e.push({
|
|
3365
|
-
id:
|
|
3366
|
-
binding: t |
|
|
3367
|
-
preconditions: (n) =>
|
|
3431
|
+
id: ht.id,
|
|
3432
|
+
binding: t | P.CTRL_COMMAND,
|
|
3433
|
+
preconditions: (n) => Rt(n),
|
|
3368
3434
|
staticParameters: {
|
|
3369
|
-
eventType:
|
|
3435
|
+
eventType: xe.Keyboard,
|
|
3370
3436
|
keycode: t,
|
|
3371
|
-
metaKey:
|
|
3437
|
+
metaKey: P.CTRL_COMMAND
|
|
3372
3438
|
}
|
|
3373
3439
|
});
|
|
3374
3440
|
return e;
|
|
3375
3441
|
}
|
|
3376
|
-
function
|
|
3442
|
+
function vc() {
|
|
3377
3443
|
const e = [];
|
|
3378
|
-
for (const t of
|
|
3444
|
+
for (const t of jt)
|
|
3379
3445
|
e.push({
|
|
3380
|
-
id:
|
|
3381
|
-
binding: t |
|
|
3382
|
-
preconditions: (n) =>
|
|
3446
|
+
id: ht.id,
|
|
3447
|
+
binding: t | P.SHIFT | P.CTRL_COMMAND,
|
|
3448
|
+
preconditions: (n) => Rt(n),
|
|
3383
3449
|
staticParameters: {
|
|
3384
|
-
eventType:
|
|
3450
|
+
eventType: xe.Keyboard,
|
|
3385
3451
|
keycode: t,
|
|
3386
|
-
metaKey:
|
|
3452
|
+
metaKey: fc
|
|
3387
3453
|
}
|
|
3388
3454
|
});
|
|
3389
3455
|
return e;
|
|
3390
3456
|
}
|
|
3391
|
-
const
|
|
3392
|
-
id:
|
|
3393
|
-
binding:
|
|
3394
|
-
preconditions: (e) =>
|
|
3457
|
+
const Cc = {
|
|
3458
|
+
id: gr.id,
|
|
3459
|
+
binding: D.F4,
|
|
3460
|
+
preconditions: (e) => Rt(e)
|
|
3395
3461
|
};
|
|
3396
|
-
function
|
|
3462
|
+
function _c() {
|
|
3397
3463
|
const e = [];
|
|
3398
|
-
for (const t of [
|
|
3464
|
+
for (const t of [D.ENTER, D.TAB, D.ARROW_DOWN, D.ARROW_UP])
|
|
3399
3465
|
e.push({
|
|
3400
|
-
id:
|
|
3466
|
+
id: ht.id,
|
|
3401
3467
|
binding: t,
|
|
3402
|
-
preconditions: (n) =>
|
|
3468
|
+
preconditions: (n) => Ai(n),
|
|
3403
3469
|
staticParameters: {
|
|
3404
|
-
eventType:
|
|
3470
|
+
eventType: xe.Keyboard,
|
|
3405
3471
|
keycode: t,
|
|
3406
3472
|
isSingleEditor: !0
|
|
3407
3473
|
}
|
|
3408
3474
|
});
|
|
3409
3475
|
return e;
|
|
3410
3476
|
}
|
|
3411
|
-
|
|
3412
|
-
|
|
3477
|
+
const Rc = {
|
|
3478
|
+
id: cs.id,
|
|
3479
|
+
binding: P.ALT | D.EQUAL,
|
|
3480
|
+
preconditions: Io,
|
|
3481
|
+
mac: P.CTRL_COMMAND | P.ALT | D.EQUAL,
|
|
3482
|
+
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
3483
|
+
group: "4_sheet-edit"
|
|
3484
|
+
};
|
|
3485
|
+
var Ec = Object.getOwnPropertyDescriptor, bc = (e, t, n, o) => {
|
|
3486
|
+
for (var r = o > 1 ? void 0 : o ? Ec(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
3413
3487
|
(c = e[s]) && (r = c(r) || r);
|
|
3414
3488
|
return r;
|
|
3415
|
-
},
|
|
3416
|
-
let
|
|
3489
|
+
}, We = (e, t) => (n, o) => t(n, o, e);
|
|
3490
|
+
let Pt = class extends lt {
|
|
3417
3491
|
constructor(e, t, n, o, r, s, c) {
|
|
3418
3492
|
super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = c, this._initialize();
|
|
3419
3493
|
}
|
|
@@ -3421,51 +3495,52 @@ let Mt = class extends nt {
|
|
|
3421
3495
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
3422
3496
|
}
|
|
3423
3497
|
_registerMenus() {
|
|
3424
|
-
this._menuManagerService.mergeMenu(
|
|
3498
|
+
this._menuManagerService.mergeMenu(hc);
|
|
3425
3499
|
}
|
|
3426
3500
|
_registerCommands() {
|
|
3427
3501
|
[
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3502
|
+
gn,
|
|
3503
|
+
he,
|
|
3504
|
+
fr,
|
|
3505
|
+
Fs,
|
|
3506
|
+
xs,
|
|
3507
|
+
ht,
|
|
3508
|
+
gr
|
|
3435
3509
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
3436
3510
|
}
|
|
3437
3511
|
_registerShortcuts() {
|
|
3438
3512
|
[
|
|
3439
|
-
...
|
|
3440
|
-
...
|
|
3441
|
-
...
|
|
3442
|
-
...
|
|
3443
|
-
...
|
|
3444
|
-
|
|
3513
|
+
...mc(),
|
|
3514
|
+
...pc(),
|
|
3515
|
+
...Sc(),
|
|
3516
|
+
...vc(),
|
|
3517
|
+
..._c(),
|
|
3518
|
+
Rc,
|
|
3519
|
+
Cc
|
|
3445
3520
|
].forEach((e) => {
|
|
3446
3521
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
3447
3522
|
});
|
|
3448
3523
|
}
|
|
3449
3524
|
_registerComponents() {
|
|
3450
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
3525
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => cr(ec, this._injector))), this._componentManager.register(hr, rc);
|
|
3451
3526
|
}
|
|
3452
3527
|
_registerRenderModules() {
|
|
3453
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3528
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, [Lt]));
|
|
3454
3529
|
}
|
|
3455
3530
|
};
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
],
|
|
3465
|
-
const
|
|
3531
|
+
Pt = bc([
|
|
3532
|
+
We(0, B(Ct)),
|
|
3533
|
+
We(1, fs),
|
|
3534
|
+
We(2, ue),
|
|
3535
|
+
We(3, Bt),
|
|
3536
|
+
We(4, sr),
|
|
3537
|
+
We(5, Oe),
|
|
3538
|
+
We(6, B(ir))
|
|
3539
|
+
], Pt);
|
|
3540
|
+
const Ic = () => {
|
|
3466
3541
|
var o, r;
|
|
3467
|
-
const e = T(
|
|
3468
|
-
return
|
|
3542
|
+
const e = T(Or), t = Ce(e.currentSelector$), n = G(null);
|
|
3543
|
+
return $(() => {
|
|
3469
3544
|
var s, c;
|
|
3470
3545
|
if (t)
|
|
3471
3546
|
return (c = n.current) == null || c.showDialog((s = t.initialValue) != null ? s : []), () => {
|
|
@@ -3473,7 +3548,7 @@ const vc = () => {
|
|
|
3473
3548
|
(i = n.current) == null || i.hideDialog();
|
|
3474
3549
|
};
|
|
3475
3550
|
}, [t]), /* @__PURE__ */ O(
|
|
3476
|
-
|
|
3551
|
+
xr,
|
|
3477
3552
|
{
|
|
3478
3553
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
3479
3554
|
subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
|
|
@@ -3481,86 +3556,86 @@ const vc = () => {
|
|
|
3481
3556
|
selectorRef: n,
|
|
3482
3557
|
onChange: (s, c) => {
|
|
3483
3558
|
var i;
|
|
3484
|
-
t == null || t.callback((i = c == null ? void 0 : c.split(",").map((
|
|
3559
|
+
t == null || t.callback((i = c == null ? void 0 : c.split(",").map((l) => ut(l))) != null ? i : []);
|
|
3485
3560
|
}
|
|
3486
3561
|
}
|
|
3487
3562
|
);
|
|
3488
3563
|
};
|
|
3489
|
-
var
|
|
3490
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3564
|
+
var yc = Object.defineProperty, Tc = Object.getOwnPropertyDescriptor, xc = (e, t, n) => t in e ? yc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Oc = (e, t, n, o) => {
|
|
3565
|
+
for (var r = o > 1 ? void 0 : o ? Tc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
3491
3566
|
(c = e[s]) && (r = c(r) || r);
|
|
3492
3567
|
return r;
|
|
3493
|
-
},
|
|
3494
|
-
let
|
|
3495
|
-
constructor(e =
|
|
3568
|
+
}, Nt = (e, t) => (n, o) => t(n, o, e), Ar = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3569
|
+
let Ut = class extends oo {
|
|
3570
|
+
constructor(e = Bn, t, n, o, r) {
|
|
3496
3571
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3497
|
-
const { menu: s, ...c } =
|
|
3498
|
-
|
|
3572
|
+
const { menu: s, ...c } = so(
|
|
3573
|
+
Bn,
|
|
3499
3574
|
this._config
|
|
3500
3575
|
);
|
|
3501
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3576
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(wi, c, { merge: !0 });
|
|
3502
3577
|
}
|
|
3503
3578
|
onStarting() {
|
|
3504
|
-
|
|
3505
|
-
[
|
|
3506
|
-
[
|
|
3507
|
-
[
|
|
3508
|
-
[
|
|
3509
|
-
[
|
|
3510
|
-
[
|
|
3511
|
-
[
|
|
3512
|
-
[
|
|
3579
|
+
io(this._injector, [
|
|
3580
|
+
[mn, { useClass: en }],
|
|
3581
|
+
[Or],
|
|
3582
|
+
[Pt],
|
|
3583
|
+
[Ft],
|
|
3584
|
+
[Dt],
|
|
3585
|
+
[Lt],
|
|
3586
|
+
[$t],
|
|
3587
|
+
[kt]
|
|
3513
3588
|
]), this._initUIPart();
|
|
3514
3589
|
}
|
|
3515
3590
|
onReady() {
|
|
3516
3591
|
[
|
|
3517
|
-
[
|
|
3592
|
+
[De]
|
|
3518
3593
|
].forEach((e) => {
|
|
3519
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3594
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
|
|
3520
3595
|
});
|
|
3521
3596
|
}
|
|
3522
3597
|
onRendered() {
|
|
3523
3598
|
[
|
|
3524
|
-
[
|
|
3599
|
+
[nn]
|
|
3525
3600
|
].forEach((e) => {
|
|
3526
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3527
|
-
}),
|
|
3528
|
-
[
|
|
3601
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
|
|
3602
|
+
}), co(this._injector, [
|
|
3603
|
+
[Pt],
|
|
3529
3604
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3530
|
-
[
|
|
3531
|
-
[
|
|
3605
|
+
[Dt],
|
|
3606
|
+
[$t]
|
|
3532
3607
|
]);
|
|
3533
3608
|
}
|
|
3534
3609
|
onSteady() {
|
|
3535
|
-
this._injector.get(
|
|
3610
|
+
this._injector.get(Ft), this._injector.get(kt);
|
|
3536
3611
|
}
|
|
3537
3612
|
_initUIPart() {
|
|
3538
|
-
const e = this._injector.get(
|
|
3539
|
-
this.disposeWithMe(e.register(
|
|
3613
|
+
const e = this._injector.get(ir);
|
|
3614
|
+
this.disposeWithMe(e.register(To, xr)), this.disposeWithMe(e.register(xo, Ei)), this.disposeWithMe(this._uiPartsService.registerComponent(gs.GLOBAL, () => cr(Ic, this._injector)));
|
|
3540
3615
|
}
|
|
3541
3616
|
};
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
],
|
|
3617
|
+
Ar(Ut, "pluginName", dr);
|
|
3618
|
+
Ar(Ut, "type", q.UNIVER_SHEET);
|
|
3619
|
+
Ut = Oc([
|
|
3620
|
+
no(Po, as),
|
|
3621
|
+
Nt(1, B(Ct)),
|
|
3622
|
+
Nt(2, Oe),
|
|
3623
|
+
Nt(3, ro),
|
|
3624
|
+
Nt(4, sr)
|
|
3625
|
+
], Ut);
|
|
3551
3626
|
export {
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3627
|
+
Ts as FORMULA_PROMPT_ACTIVATED,
|
|
3628
|
+
Ei as FormulaEditor,
|
|
3629
|
+
kt as FormulaReorderController,
|
|
3630
|
+
Or as GlobalRangeSelectorService,
|
|
3631
|
+
xs as HelpFunctionOperation,
|
|
3632
|
+
he as InsertFunctionOperation,
|
|
3633
|
+
fr as MoreFunctionsOperation,
|
|
3634
|
+
xr as RangeSelector,
|
|
3635
|
+
De as RefSelectionsRenderService,
|
|
3636
|
+
gr as ReferenceAbsoluteOperation,
|
|
3637
|
+
Fs as SearchFunctionOperation,
|
|
3638
|
+
ht as SelectEditorFormulaOperation,
|
|
3639
|
+
gn as SheetOnlyPasteFormulaCommand,
|
|
3640
|
+
Ut as UniverSheetsFormulaUIPlugin
|
|
3566
3641
|
};
|