@univerjs/sheets-formula-ui 0.6.6 → 0.6.7-experimental.20250328-3aaa828
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 +12 -12
- package/lib/es/index.js +1383 -1382
- package/lib/facade.js +11 -0
- package/lib/index.js +3716 -0
- package/lib/locale/en-US.js +7906 -0
- package/lib/locale/fa-IR.js +7906 -0
- package/lib/locale/fr-FR.js +7906 -0
- package/lib/locale/ru-RU.js +7905 -0
- package/lib/locale/vi-VN.js +7703 -0
- package/lib/locale/zh-CN.js +7883 -0
- package/lib/locale/zh-TW.js +7877 -0
- package/lib/umd/index.js +14 -14
- package/package.json +16 -16
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var B = (t, e, n) =>
|
|
4
|
-
import { CommandType as Ie, ICommandService as ae, createIdentifier as
|
|
5
|
-
import { SheetPasteCommand as
|
|
6
|
-
import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as
|
|
7
|
-
import { Subject as st, BehaviorSubject as
|
|
8
|
-
import { IEditorService as be, DocSelectionRenderService as
|
|
9
|
-
import { DeviceInputEventType as
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as b, jsxs as
|
|
14
|
-
import { clsx as
|
|
15
|
-
import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
1
|
+
var Zo = Object.defineProperty;
|
|
2
|
+
var Xo = (t, e, n) => e in t ? Zo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var B = (t, e, n) => Xo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as Ie, ICommandService as ae, createIdentifier as Qo, IContextService as on, IUniverInstanceService as oe, Rectangle as Gn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as rn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Zn, DEFAULT_EMPTY_DOCUMENT_VALUE as Xn, isRealNum as Jo, CellValueType as En, getCellValueType as er, LocaleService as je, Tools as ft, Inject as K, Injector as mt, ThemeService as gt, toDisposable as Qn, DisposableCollection as Ve, RANGE_TYPE as ge, UniverInstanceType as ue, ColorKit as sn, getBodySlice as bn, Direction as ne, EDITOR_ACTIVATED as bt, createInternalEditorID as tr, generateRandomId as nr, BuildTextUtils as or, RichTextBuilder as rr, isFormulaString as Re, isFormulaId as Be, FOCUSING_DOC as sr, FOCUSING_UNIVER_EDITOR as ir, Disposable as pt, isICellData as cr, ObjectMatrix as tt, ILogService as lr, RxDisposable as ar, InterceptorEffectEnum as ur, DependentOn as fr, IConfigService as hr, Plugin as dr, merge as mr, registerDependencies as gr, touchDependencies as pr } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as Sr, PREDEFINED_HOOK_NAME as Je, IEditorBridgeService as Jn, SetCellEditVisibleOperation as eo, SheetSkeletonManagerService as Lt, BaseSelectionRenderService as Cr, getCoordByOffset as yn, checkInHeaderRanges as Nn, getAllSelection as vr, genNormalSelectionStyle as to, getSheetObject as _r, attachSelectionWithCoord as Xt, SelectionControl as no, MoveSelectionCommand as Tn, JumpOver as Fn, ExpandSelectionCommand as On, EMBEDDING_FORMULA_EDITOR as Rr, IMarkSelectionService as Ir, HoverManagerService as Er, CellAlertManagerService as br, CellAlertType as yr, IAutoFillService as Nr, APPLY_TYPE as Tr, DATA_TYPE as Mn, ISheetClipboardService as Fr, COPY_TYPE as oo, SELECTION_SHAPE_DEPTH as Or, useActiveWorkbook as Mr, getCurrentRangeDisable$ as ro, PASTE_SPECIAL_MENU_ID as Ar, whenFormulaEditorActivated as St, SheetsUIPart as Pr, RANGE_SELECTOR_COMPONENT_KEY as xr, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as wr } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as Dr, matchRefDrawToken as Lr, isFormulaLexerToken as $r, matchToken as nt, deserializeRangeWithSheet as ot, serializeRangeWithSheet as ht, generateStringWithSequence as kr, operatorToken as so, ERROR_TYPE_SET as Hr, ErrorType as se, FormulaDataModel as $t, SetFormulaCalculationResultMutation as Wr, SetArrayFormulaDataMutation as Ur, SetFormulaCalculationStopMutation as Vr, FunctionType as Br, UniverFormulaEnginePlugin as qr } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as st, BehaviorSubject as io, throttleTime as co, debounceTime as cn, filter as Qt, map as lo, distinctUntilChanged as jr, merge as Kr, combineLatestWith as Yr, switchMap as zr, of as An, Observable as Gr } from "rxjs";
|
|
8
|
+
import { IEditorService as be, DocSelectionRenderService as ao, ReplaceTextRunsCommand as Pn, MoveSelectionOperation as Zr, MoveCursorOperation as Xr, useKeyboardEvent as Qr, useResize as Jr, DocBackScrollRenderController as es, RichTextEditor as ts } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as ye, ScrollTimerType as jt, SHEET_VIEWPORT_KEY as xn, Vector2 as wn, IRenderManagerService as Ne } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as ln, getSheetCommandTarget as uo, getCellAtRowCol as ns, SetSelectionsOperation as an, IRefSelectionsService as kt, SelectionMoveType as Kt, convertSelectionDataToRange as os, setEndForRange as rs, REF_SELECTIONS_ENABLED as Dn, SetWorksheetActiveOperation as Ln, SetRangeValuesMutation as $n, SetRangeValuesUndoMutationFactory as ss, SheetInterceptorService as fo, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as ho, WorksheetEditPermission as mo, RangeProtectionPermissionEditPoint as go, WorkbookEditablePermission as po } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as as, IDescriptionService as Ht, TriggerCalculationController as us, UniverSheetsFormulaPlugin as fs } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as Wt, useDependency as O, useEvent as ee, RectPopup as So, IShortcutService as Ut, KeyCode as D, MetaKeys as U, IContextMenuService as hs, useObservable as qe, useUpdateEffect as ds, IZenZoneService as ms, ProgressBar as gs, useInjector as ps, ILayoutService as Ss, MenuItemType as un, getMenuHiddenObservable as Cs, IClipboardInterfaceService as kn, RibbonStartGroup as vs, IMenuManagerService as _s, IUIPartsService as Co, ComponentManager as vo, BuiltInUIPart as _o, connectInjector as Jt } from "@univerjs/ui";
|
|
13
|
+
import { jsx as b, jsxs as k, Fragment as ut } from "react/jsx-runtime";
|
|
14
|
+
import { clsx as Hn, Tooltip as Rs, Dialog as Is, Input as Ro, Button as et, Popup as Io, Select as Es } from "@univerjs/design";
|
|
15
|
+
import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as $, useCallback as Ft, useLayoutEffect as Ot } from "react";
|
|
16
|
+
import { DocSelectionManagerService as Eo } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as bs } from "rxjs/operators";
|
|
18
|
+
const fn = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
20
|
type: Ie.COMMAND,
|
|
21
|
-
handler: async (t) => t.get(ae).executeCommand(
|
|
22
|
-
value:
|
|
21
|
+
handler: async (t) => t.get(ae).executeCommand(Sr.id, {
|
|
22
|
+
value: Je.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
|
-
},
|
|
24
|
+
}, rt = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
26
|
type: Ie.OPERATION,
|
|
27
27
|
handler: (t, e) => !0
|
|
28
28
|
};
|
|
29
|
-
var
|
|
30
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
29
|
+
var ys = Object.getOwnPropertyDescriptor, Ns = (t, e, n, o) => {
|
|
30
|
+
for (var r = o > 1 ? void 0 : o ? ys(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
31
31
|
(i = t[s]) && (r = i(r) || r);
|
|
32
32
|
return r;
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
let
|
|
33
|
+
}, Ts = (t, e) => (n, o) => e(n, o, t);
|
|
34
|
+
const Fs = "FORMULA_PROMPT_ACTIVATED", Ct = Qo("formula-ui.prompt-service");
|
|
35
|
+
let en = class {
|
|
36
36
|
constructor(t) {
|
|
37
37
|
B(this, "_search$", new st());
|
|
38
38
|
B(this, "_help$", new st());
|
|
@@ -55,7 +55,7 @@ let Qt = 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(t) {
|
|
58
|
-
this._contextService.setContextValue(
|
|
58
|
+
this._contextService.setContextValue(Fs, t.visible), this._searching = t.visible, this._search$.next(t);
|
|
59
59
|
}
|
|
60
60
|
isSearching() {
|
|
61
61
|
return this._searching;
|
|
@@ -125,8 +125,8 @@ let Qt = class {
|
|
|
125
125
|
const c = this._sequenceNodes[s];
|
|
126
126
|
if (typeof c == "string")
|
|
127
127
|
continue;
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const l = { ...c };
|
|
129
|
+
l.startIndex += o, l.endIndex += o, this._sequenceNodes[s] = l;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -164,8 +164,8 @@ let Qt = class {
|
|
|
164
164
|
const c = this._sequenceNodes[s];
|
|
165
165
|
if (typeof c == "string")
|
|
166
166
|
continue;
|
|
167
|
-
const
|
|
168
|
-
|
|
167
|
+
const l = { ...c };
|
|
168
|
+
l.startIndex += r, l.endIndex += r, this._sequenceNodes[s] = l;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
enableLockedSelectionChange() {
|
|
@@ -187,85 +187,85 @@ let Qt = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
const
|
|
190
|
+
en = Ns([
|
|
191
|
+
Ts(0, on)
|
|
192
|
+
], en);
|
|
193
|
+
const Os = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
195
|
type: Ie.OPERATION,
|
|
196
196
|
handler: async (t, e) => (t.get(Ct).help(e), !0)
|
|
197
|
-
},
|
|
197
|
+
}, hn = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
199
|
type: Ie.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (t, e) => {
|
|
202
|
-
var
|
|
203
|
-
const n = t.get(
|
|
202
|
+
var C, S;
|
|
203
|
+
const n = t.get(ln), o = t.get(be), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
|
-
const s =
|
|
206
|
+
const s = uo(t.get(oe));
|
|
207
207
|
if (!s) return !1;
|
|
208
|
-
const { worksheet: i, unitId: c, subUnitId:
|
|
209
|
-
t.get(
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
if (r.length === 1 && (
|
|
213
|
-
const { range: v, primary:
|
|
214
|
-
|
|
215
|
-
const A =
|
|
208
|
+
const { worksheet: i, unitId: c, subUnitId: l } = s, h = i.getCellMatrix(), { value: f } = e, m = t.get(ae);
|
|
209
|
+
t.get(Jn);
|
|
210
|
+
const u = [], d = [];
|
|
211
|
+
let a = null, I = 0, g = 0, p = "";
|
|
212
|
+
if (r.length === 1 && (Ps(r[0].range) || xs(r[0].range) && Un(h, r[0].range))) {
|
|
213
|
+
const { range: v, primary: _ } = r[0], T = (C = _ == null ? void 0 : _.actualRow) != null ? C : v.startRow, w = (S = _ == null ? void 0 : _.actualColumn) != null ? S : v.startColumn;
|
|
214
|
+
a = v, I = T, g = w;
|
|
215
|
+
const A = Wn(h, T, w);
|
|
216
216
|
A && (p = pe(A));
|
|
217
217
|
} else
|
|
218
218
|
r.some((v) => {
|
|
219
219
|
var w, A;
|
|
220
|
-
const { range:
|
|
221
|
-
if (
|
|
222
|
-
const M = (w = T == null ? void 0 : T.actualRow) != null ? w :
|
|
223
|
-
if (!
|
|
224
|
-
return
|
|
225
|
-
const P = pe(
|
|
226
|
-
|
|
227
|
-
range:
|
|
220
|
+
const { range: _, primary: T } = v;
|
|
221
|
+
if (Un(h, _)) {
|
|
222
|
+
const M = (w = T == null ? void 0 : T.actualRow) != null ? w : _.startRow, R = (A = T == null ? void 0 : T.actualColumn) != null ? A : _.startColumn, y = Wn(h, M, R);
|
|
223
|
+
if (!y)
|
|
224
|
+
return a = _, I = M, g = R, !0;
|
|
225
|
+
const P = pe(y), N = `=${f}(${P})`;
|
|
226
|
+
u.push({
|
|
227
|
+
range: _,
|
|
228
228
|
primary: {
|
|
229
229
|
row: M,
|
|
230
|
-
column:
|
|
230
|
+
column: R
|
|
231
231
|
},
|
|
232
|
-
formula:
|
|
232
|
+
formula: N
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
|
-
const { startRow: M, startColumn:
|
|
236
|
-
if (M ===
|
|
237
|
-
const
|
|
235
|
+
const { startRow: M, startColumn: R, endRow: y, endColumn: P } = _;
|
|
236
|
+
if (M === y) {
|
|
237
|
+
const N = ws(h, M, P, i.getColumnCount() - 1), E = N === P ? P - 1 : P, F = pe({
|
|
238
238
|
startRow: M,
|
|
239
|
-
endRow:
|
|
240
|
-
startColumn:
|
|
239
|
+
endRow: y,
|
|
240
|
+
startColumn: R,
|
|
241
241
|
endColumn: E
|
|
242
|
-
}), x = `=${
|
|
242
|
+
}), x = `=${f}(${F})`;
|
|
243
243
|
d.push({
|
|
244
|
-
range:
|
|
244
|
+
range: _,
|
|
245
245
|
primary: {
|
|
246
246
|
row: M,
|
|
247
|
-
column:
|
|
247
|
+
column: N
|
|
248
248
|
},
|
|
249
249
|
formula: x
|
|
250
250
|
});
|
|
251
251
|
} else {
|
|
252
|
-
let
|
|
253
|
-
for (let F =
|
|
254
|
-
const x =
|
|
255
|
-
|
|
252
|
+
let N = -1;
|
|
253
|
+
for (let F = R; F <= P; F++) {
|
|
254
|
+
const x = Ds(h, F, y, i.getRowCount() - 1);
|
|
255
|
+
N = Math.max(N, x);
|
|
256
256
|
}
|
|
257
|
-
const E =
|
|
258
|
-
for (let F =
|
|
257
|
+
const E = N === y ? y - 1 : y;
|
|
258
|
+
for (let F = R; F <= P; F++) {
|
|
259
259
|
const x = pe({
|
|
260
260
|
startRow: M,
|
|
261
261
|
endRow: E,
|
|
262
262
|
startColumn: F,
|
|
263
263
|
endColumn: F
|
|
264
|
-
}), H = `=${
|
|
264
|
+
}), H = `=${f}(${x})`;
|
|
265
265
|
d.push({
|
|
266
|
-
range:
|
|
266
|
+
range: _,
|
|
267
267
|
primary: {
|
|
268
|
-
row:
|
|
268
|
+
row: N,
|
|
269
269
|
column: F
|
|
270
270
|
},
|
|
271
271
|
formula: H
|
|
@@ -275,42 +275,42 @@ const ys = {
|
|
|
275
275
|
}
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
|
-
if (
|
|
279
|
-
const v =
|
|
280
|
-
range:
|
|
278
|
+
if (a) {
|
|
279
|
+
const v = ns(I, g, i), _ = {
|
|
280
|
+
range: Gn.clone(a),
|
|
281
281
|
primary: {
|
|
282
282
|
startRow: v.startRow,
|
|
283
283
|
startColumn: v.startColumn,
|
|
284
284
|
endRow: v.endRow,
|
|
285
285
|
endColumn: v.endColumn,
|
|
286
|
-
actualRow:
|
|
286
|
+
actualRow: I,
|
|
287
287
|
actualColumn: g,
|
|
288
288
|
isMerged: v.isMerged,
|
|
289
|
-
isMergedMainCell: v.startRow ===
|
|
289
|
+
isMergedMainCell: v.startRow === I && v.startColumn === g
|
|
290
290
|
}
|
|
291
291
|
}, T = {
|
|
292
292
|
unitId: c,
|
|
293
|
-
subUnitId:
|
|
294
|
-
selections: [
|
|
293
|
+
subUnitId: l,
|
|
294
|
+
selections: [_]
|
|
295
295
|
};
|
|
296
|
-
await m.executeCommand(
|
|
297
|
-
const w = o.getEditor(
|
|
298
|
-
m.syncExecuteCommand(
|
|
296
|
+
await m.executeCommand(an.id, T);
|
|
297
|
+
const w = o.getEditor(rn), A = o.getEditor(Zn);
|
|
298
|
+
m.syncExecuteCommand(eo.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: c,
|
|
301
|
-
eventType:
|
|
301
|
+
eventType: ye.Dblclick
|
|
302
302
|
});
|
|
303
|
-
const M = `=${
|
|
303
|
+
const M = `=${f}(${p}`;
|
|
304
304
|
w == null || w.replaceText(M), A == null || A.replaceText(M, !1);
|
|
305
305
|
}
|
|
306
|
-
return
|
|
307
|
-
list:
|
|
306
|
+
return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(as.id, {
|
|
307
|
+
list: u,
|
|
308
308
|
listOfRangeHasNumber: d
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
function
|
|
313
|
-
const o =
|
|
312
|
+
function Wn(t, e, n) {
|
|
313
|
+
const o = Ms(t, e, n);
|
|
314
314
|
if (o !== e)
|
|
315
315
|
return {
|
|
316
316
|
startRow: o,
|
|
@@ -318,7 +318,7 @@ function $n(t, e, n) {
|
|
|
318
318
|
startColumn: n,
|
|
319
319
|
endColumn: n
|
|
320
320
|
};
|
|
321
|
-
const r =
|
|
321
|
+
const r = As(t, e, n);
|
|
322
322
|
return r !== n ? {
|
|
323
323
|
startRow: e,
|
|
324
324
|
endRow: e,
|
|
@@ -326,7 +326,7 @@ function $n(t, e, n) {
|
|
|
326
326
|
endColumn: n - 1
|
|
327
327
|
} : null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Ms(t, e, n) {
|
|
330
330
|
let o = !1;
|
|
331
331
|
if (e === 0) return e;
|
|
332
332
|
for (let r = e - 1; r >= 0; r--) {
|
|
@@ -343,7 +343,7 @@ function Ts(t, e, n) {
|
|
|
343
343
|
}
|
|
344
344
|
return e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function As(t, e, n) {
|
|
347
347
|
let o = !1;
|
|
348
348
|
if (n === 0) return n;
|
|
349
349
|
for (let r = n - 1; r >= 0; r--) {
|
|
@@ -365,52 +365,52 @@ function dt(t) {
|
|
|
365
365
|
const e = t == null ? void 0 : t.p.body;
|
|
366
366
|
if (e == null)
|
|
367
367
|
return !1;
|
|
368
|
-
const n = e.dataStream, r = n.substring(n.length - 2, n.length) ===
|
|
369
|
-
return
|
|
368
|
+
const n = e.dataStream, r = n.substring(n.length - 2, n.length) === Xn ? n.substring(0, n.length - 2) : n;
|
|
369
|
+
return Jo(r);
|
|
370
370
|
}
|
|
371
|
-
return t && (t.t ===
|
|
371
|
+
return t && (t.t === En.NUMBER || er(t) === En.NUMBER);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ps(t) {
|
|
374
374
|
return t.startRow === t.endRow && t.startColumn === t.endColumn;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function xs(t) {
|
|
377
377
|
return t.startRow !== t.endRow && t.startColumn !== t.endColumn;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Un(t, e) {
|
|
380
380
|
for (let n = e.startRow; n <= e.endRow; n++)
|
|
381
381
|
for (let o = e.startColumn; o <= e.endColumn; o++)
|
|
382
382
|
if (dt(t.getValue(n, o)))
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ws(t, e, n, o) {
|
|
387
387
|
for (let r = n; r <= o; r++)
|
|
388
388
|
if (!t.getValue(e, r))
|
|
389
389
|
return r;
|
|
390
390
|
return o;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Ds(t, e, n, o) {
|
|
393
393
|
for (let r = n; r <= o; r++)
|
|
394
394
|
if (!t.getValue(r, e))
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const bo = "SHEET_FORMULA_UI_PLUGIN", yo = `${bo}_MORE_FUNCTIONS_COMPONENT`, dn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
400
|
type: Ie.OPERATION,
|
|
401
|
-
handler: async (t) => (t.get(
|
|
401
|
+
handler: async (t) => (t.get(Wt).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
|
-
children: { label:
|
|
403
|
+
children: { label: yo }
|
|
404
404
|
}), !0)
|
|
405
|
-
},
|
|
405
|
+
}, No = {
|
|
406
406
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
407
407
|
type: Ie.OPERATION,
|
|
408
408
|
handler: async (t) => !0
|
|
409
|
-
},
|
|
409
|
+
}, Ls = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
411
|
type: Ie.OPERATION,
|
|
412
412
|
handler: async (t, e) => (t.get(Ct).search(e), !0)
|
|
413
|
-
},
|
|
413
|
+
}, mn = (t, e, n = !0) => {
|
|
414
414
|
let o = -1;
|
|
415
415
|
return t.reduce((r, s, i) => {
|
|
416
416
|
if (r.isFinish)
|
|
@@ -419,12 +419,12 @@ const Io = "SHEET_FORMULA_UI_PLUGIN", Eo = `${Io}_MORE_FUNCTIONS_COMPONENT`, fn
|
|
|
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 === e : e > c && e <= r.currentIndex) && (o = i, r.isFinish = !0), r;
|
|
426
426
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
427
|
-
},
|
|
427
|
+
}, To = (t, e) => {
|
|
428
428
|
const n = t[e];
|
|
429
429
|
let o = -1;
|
|
430
430
|
if (!n || typeof n == "string" || n.nodeType !== z.REFERENCE) return -1;
|
|
@@ -442,23 +442,23 @@ var ce = function() {
|
|
|
442
442
|
}
|
|
443
443
|
return t;
|
|
444
444
|
}, ce.apply(this, arguments);
|
|
445
|
-
},
|
|
445
|
+
}, $s = function(t, e) {
|
|
446
446
|
var n = {};
|
|
447
447
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
|
|
448
448
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
449
449
|
for (var r = 0, o = Object.getOwnPropertySymbols(t); r < o.length; r++)
|
|
450
450
|
e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]]);
|
|
451
451
|
return n;
|
|
452
|
-
},
|
|
453
|
-
var n = t.icon, o = t.id, r = t.className, s = t.extend, i =
|
|
454
|
-
return
|
|
452
|
+
}, $e = Te(function(t, e) {
|
|
453
|
+
var n = t.icon, o = t.id, r = t.className, s = t.extend, i = $s(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = j("_".concat(Ws()));
|
|
454
|
+
return Fo(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, ce({ ref: e, className: c }, i), s);
|
|
455
455
|
});
|
|
456
|
-
function
|
|
457
|
-
return Le(t.tag, ce(ce({ key: e },
|
|
458
|
-
return
|
|
456
|
+
function Fo(t, e, n, o, r) {
|
|
457
|
+
return Le(t.tag, ce(ce({ key: e }, ks(t, n, r)), o), (Hs(t, n).children || []).map(function(s, i) {
|
|
458
|
+
return Fo(s, "".concat(e, "-").concat(t.tag, "-").concat(i), n, void 0, r);
|
|
459
459
|
}));
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function ks(t, e, n) {
|
|
462
462
|
var o = ce({}, t.attrs);
|
|
463
463
|
n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), t.tag === "mask" && o.id && (o.id = o.id + e.idSuffix), Object.entries(o).forEach(function(s) {
|
|
464
464
|
var i = s[0], c = s[1];
|
|
@@ -470,79 +470,79 @@ function Ds(t, e, n) {
|
|
|
470
470
|
typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
471
471
|
})), o;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Hs(t, e) {
|
|
474
474
|
var n, o = e.defIds;
|
|
475
475
|
return !o || o.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? ce(ce({}, t), { children: t.children.map(function(r) {
|
|
476
476
|
return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ? ce(ce({}, r), { attrs: ce(ce({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
477
477
|
}) }) : t;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Ws() {
|
|
480
480
|
return Math.random().toString(36).substring(2, 8);
|
|
481
481
|
}
|
|
482
|
-
|
|
483
|
-
var
|
|
484
|
-
return Le(
|
|
482
|
+
$e.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" } }] }, Oo = Te(function(t, e) {
|
|
484
|
+
return Le($e, Object.assign({}, t, {
|
|
485
485
|
id: "check-mark-single",
|
|
486
486
|
ref: e,
|
|
487
|
-
icon:
|
|
487
|
+
icon: Us
|
|
488
488
|
}));
|
|
489
489
|
});
|
|
490
|
-
|
|
491
|
-
var
|
|
492
|
-
return Le(
|
|
490
|
+
Oo.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" } }] }, Vt = Te(function(t, e) {
|
|
492
|
+
return Le($e, Object.assign({}, t, {
|
|
493
493
|
id: "close-single",
|
|
494
494
|
ref: e,
|
|
495
|
-
icon:
|
|
495
|
+
icon: Vs
|
|
496
496
|
}));
|
|
497
497
|
});
|
|
498
|
-
|
|
499
|
-
var
|
|
500
|
-
return Le(
|
|
498
|
+
Vt.displayName = "CloseSingle";
|
|
499
|
+
var Bs = { 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" } }] }, Mo = Te(function(t, e) {
|
|
500
|
+
return Le($e, Object.assign({}, t, {
|
|
501
501
|
id: "delete-single",
|
|
502
502
|
ref: e,
|
|
503
|
-
icon:
|
|
503
|
+
icon: Bs
|
|
504
504
|
}));
|
|
505
505
|
});
|
|
506
|
-
|
|
507
|
-
var
|
|
508
|
-
return Le(
|
|
506
|
+
Mo.displayName = "DeleteSingle";
|
|
507
|
+
var qs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.75 5.32495C8.75 5.73916 8.41421 6.07495 8 6.07495 7.58579 6.07495 7.25 5.73916 7.25 5.32495 7.25 4.91074 7.58579 4.57495 8 4.57495 8.41421 4.57495 8.75 4.91074 8.75 5.32495zM8.5999 7.52505C8.5999 7.19368 8.33127 6.92505 7.9999 6.92505 7.66853 6.92505 7.3999 7.19368 7.3999 7.52505V11.425C7.3999 11.7564 7.66853 12.025 7.9999 12.025 8.33127 12.025 8.5999 11.7564 8.5999 11.425V7.52505z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M0.899902 8.00002C0.899902 4.0788 4.07868 0.900024 7.9999 0.900024C11.9211 0.900024 15.0999 4.0788 15.0999 8.00002C15.0999 11.9212 11.9211 15.1 7.9999 15.1C4.07868 15.1 0.899902 11.9212 0.899902 8.00002ZM7.9999 2.10002C4.74142 2.10002 2.0999 4.74154 2.0999 8.00002C2.0999 11.2585 4.74142 13.9 7.9999 13.9C11.2584 13.9 13.8999 11.2585 13.8999 8.00002C13.8999 4.74154 11.2584 2.10002 7.9999 2.10002Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ao = Te(function(t, e) {
|
|
508
|
+
return Le($e, Object.assign({}, t, {
|
|
509
509
|
id: "details-single",
|
|
510
510
|
ref: e,
|
|
511
|
-
icon:
|
|
511
|
+
icon: qs
|
|
512
512
|
}));
|
|
513
513
|
});
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
return Le(
|
|
514
|
+
Ao.displayName = "DetailsSingle";
|
|
515
|
+
var js = { 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" } }] }, Po = Te(function(t, e) {
|
|
516
|
+
return Le($e, Object.assign({}, t, {
|
|
517
517
|
id: "increase-single",
|
|
518
518
|
ref: e,
|
|
519
|
-
icon:
|
|
519
|
+
icon: js
|
|
520
520
|
}));
|
|
521
521
|
});
|
|
522
|
-
|
|
523
|
-
var
|
|
524
|
-
return Le(
|
|
522
|
+
Po.displayName = "IncreaseSingle";
|
|
523
|
+
var Ks = { 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" } }] }, gn = Te(function(t, e) {
|
|
524
|
+
return Le($e, Object.assign({}, t, {
|
|
525
525
|
id: "more-single",
|
|
526
526
|
ref: e,
|
|
527
|
-
icon:
|
|
527
|
+
icon: Ks
|
|
528
528
|
}));
|
|
529
529
|
});
|
|
530
|
-
|
|
531
|
-
var
|
|
532
|
-
return Le(
|
|
530
|
+
gn.displayName = "MoreSingle";
|
|
531
|
+
var Ys = { 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" } }] }, xo = Te(function(t, e) {
|
|
532
|
+
return Le($e, Object.assign({}, t, {
|
|
533
533
|
id: "select-range-single",
|
|
534
534
|
ref: e,
|
|
535
|
-
icon:
|
|
535
|
+
icon: Ys
|
|
536
536
|
}));
|
|
537
537
|
});
|
|
538
|
-
|
|
539
|
-
function
|
|
538
|
+
xo.displayName = "SelectRangeSingle";
|
|
539
|
+
function zs(t, e) {
|
|
540
540
|
return Object.keys(t).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
|
|
541
541
|
label: e.t(`formula.functionType.${n.toLocaleLowerCase()}`),
|
|
542
542
|
value: `${t[n]}`
|
|
543
543
|
}));
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function pn(t) {
|
|
546
546
|
if (!t.require && !t.repeat)
|
|
547
547
|
return `[${t.name}]`;
|
|
548
548
|
if (t.require && !t.repeat)
|
|
@@ -552,7 +552,7 @@ function mn(t) {
|
|
|
552
552
|
if (t.require && t.repeat)
|
|
553
553
|
return `${t.name},...`;
|
|
554
554
|
}
|
|
555
|
-
const
|
|
555
|
+
const Gs = (t, e = 100) => {
|
|
556
556
|
L(() => {
|
|
557
557
|
let n = null;
|
|
558
558
|
const o = () => {
|
|
@@ -565,58 +565,58 @@ const Ks = (t, e = 100) => {
|
|
|
565
565
|
};
|
|
566
566
|
}, [t, e]);
|
|
567
567
|
};
|
|
568
|
-
function
|
|
569
|
-
const o = O(be), r = le(() => new
|
|
570
|
-
const
|
|
571
|
-
if (!
|
|
568
|
+
function wo(t, e, n) {
|
|
569
|
+
const o = O(be), r = le(() => new io({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O(Wt), i = O(oe), c = ee(() => {
|
|
570
|
+
const l = o.getEditor(t);
|
|
571
|
+
if (!l)
|
|
572
572
|
return;
|
|
573
|
-
const h =
|
|
574
|
-
if (!(
|
|
575
|
-
return r.next({ left:
|
|
573
|
+
const h = l.getBoundingClientRect(), { left: f, top: m, right: u, bottom: d } = h, a = r.getValue();
|
|
574
|
+
if (!(a.left === f && a.top === m && a.right === u && a.bottom === d))
|
|
575
|
+
return r.next({ left: f - 1, right: u + 1, top: m - 1, bottom: d + 1 }), h;
|
|
576
576
|
});
|
|
577
577
|
return L(() => {
|
|
578
578
|
e && c();
|
|
579
|
-
}, [t, o, i.unitAdded$, c, e, ...n != null ? n : []]),
|
|
580
|
-
const
|
|
579
|
+
}, [t, o, i.unitAdded$, c, e, ...n != null ? n : []]), Gs(c), L(() => {
|
|
580
|
+
const l = s.scrollEvent$.pipe(co(100)).subscribe(c);
|
|
581
581
|
return () => {
|
|
582
|
-
|
|
582
|
+
l.unsubscribe();
|
|
583
583
|
};
|
|
584
584
|
}, []), [r, c];
|
|
585
585
|
}
|
|
586
|
-
const
|
|
586
|
+
const Ke = (t) => {
|
|
587
587
|
const e = j(t);
|
|
588
588
|
return e.current = t, e;
|
|
589
|
-
},
|
|
590
|
-
const o = O(
|
|
591
|
-
|
|
589
|
+
}, Zs = (t, e, n) => {
|
|
590
|
+
const o = O(Ht), r = O(Ee), [s, i] = $(), [c, l] = $(-1), [h, f] = $(!0), m = Ke(h), u = j(e);
|
|
591
|
+
u.current = e;
|
|
592
592
|
const d = () => {
|
|
593
|
-
i(void 0),
|
|
593
|
+
i(void 0), l(-1), f(!1);
|
|
594
594
|
};
|
|
595
595
|
return L(() => {
|
|
596
596
|
if (n && t) {
|
|
597
|
-
const
|
|
597
|
+
const a = n.selectionChange$.pipe(cn(50)).subscribe((g) => {
|
|
598
598
|
if (g.textRanges.length === 1) {
|
|
599
599
|
const [p] = g.textRanges;
|
|
600
600
|
if (p.collapsed && m.current) {
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
603
|
-
const { functionName:
|
|
604
|
-
i(
|
|
601
|
+
const C = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
|
|
602
|
+
if (C) {
|
|
603
|
+
const { functionName: S, paramIndex: v } = C, _ = o.getFunctionInfo(S);
|
|
604
|
+
i(_), l(v);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
i(void 0),
|
|
610
|
-
}),
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
609
|
+
i(void 0), l(-1);
|
|
610
|
+
}), I = n.selectionChange$.pipe(
|
|
611
|
+
Qt((g) => g.isEditing),
|
|
612
|
+
Qt((g) => g.textRanges.length === 1),
|
|
613
|
+
lo((g) => g.textRanges[0].startOffset),
|
|
614
|
+
jr()
|
|
615
615
|
).subscribe(() => {
|
|
616
|
-
|
|
616
|
+
f(!0);
|
|
617
617
|
});
|
|
618
618
|
return () => {
|
|
619
|
-
|
|
619
|
+
a.unsubscribe(), I.unsubscribe();
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
}, [n, t]), L(() => {
|
|
@@ -626,22 +626,22 @@ const je = (t) => {
|
|
|
626
626
|
paramIndex: c,
|
|
627
627
|
reset: d
|
|
628
628
|
};
|
|
629
|
-
},
|
|
630
|
-
formulaHelpFunction:
|
|
631
|
-
formulaHelpFunctionTitle:
|
|
632
|
-
formulaHelpFunctionTitleIcons:
|
|
633
|
-
formulaHelpFunctionTitleIcon:
|
|
634
|
-
formulaHelpFunctionContent:
|
|
635
|
-
formulaHelpFunctionContentInner:
|
|
636
|
-
formulaHelpFunctionContentParams:
|
|
637
|
-
formulaHelpFunctionContentParamsTitle:
|
|
638
|
-
formulaHelpFunctionContentParamsDetail:
|
|
639
|
-
formulaHelpFunctionActive:
|
|
640
|
-
formulaHelpParam:
|
|
641
|
-
formulaHelpParamPrefix:
|
|
642
|
-
formulaHelpParamItem:
|
|
643
|
-
formulaHelpParamActive:
|
|
644
|
-
},
|
|
629
|
+
}, Xs = "univer-formula-help-function", Qs = "univer-formula-help-function-title", Js = "univer-formula-help-function-title-icons", ei = "univer-formula-help-function-title-icon", ti = "univer-formula-help-function-content", ni = "univer-formula-help-function-content-inner", oi = "univer-formula-help-function-content-params", ri = "univer-formula-help-function-content-params-title", si = "univer-formula-help-function-content-params-detail", ii = "univer-formula-help-function-active", ci = "univer-formula-help-param", li = "univer-formula-help-param-prefix", ai = "univer-formula-help-param-item", ui = "univer-formula-help-param-active", J = {
|
|
630
|
+
formulaHelpFunction: Xs,
|
|
631
|
+
formulaHelpFunctionTitle: Qs,
|
|
632
|
+
formulaHelpFunctionTitleIcons: Js,
|
|
633
|
+
formulaHelpFunctionTitleIcon: ei,
|
|
634
|
+
formulaHelpFunctionContent: ti,
|
|
635
|
+
formulaHelpFunctionContentInner: ni,
|
|
636
|
+
formulaHelpFunctionContentParams: oi,
|
|
637
|
+
formulaHelpFunctionContentParamsTitle: ri,
|
|
638
|
+
formulaHelpFunctionContentParamsDetail: si,
|
|
639
|
+
formulaHelpFunctionActive: ii,
|
|
640
|
+
formulaHelpParam: ci,
|
|
641
|
+
formulaHelpParamPrefix: li,
|
|
642
|
+
formulaHelpParamItem: ai,
|
|
643
|
+
formulaHelpParamActive: ui
|
|
644
|
+
}, Yt = ({ className: t, title: e, value: n }) => /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionContentParams, children: [
|
|
645
645
|
/* @__PURE__ */ b(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
@@ -653,40 +653,40 @@ const je = (t) => {
|
|
|
653
653
|
}
|
|
654
654
|
),
|
|
655
655
|
/* @__PURE__ */ b("div", { className: J.formulaHelpFunctionContentParamsDetail, children: n })
|
|
656
|
-
] }),
|
|
656
|
+
] }), fi = (t) => {
|
|
657
657
|
const { prefix: e, value: n, active: o, onClick: r } = t;
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ k("div", { className: J.formulaHelpParam, children: [
|
|
659
|
+
/* @__PURE__ */ k("span", { className: J.formulaHelpParamPrefix, children: [
|
|
660
660
|
e,
|
|
661
661
|
"("
|
|
662
662
|
] }),
|
|
663
|
-
n && n.map((s, i) => /* @__PURE__ */
|
|
663
|
+
n && n.map((s, i) => /* @__PURE__ */ k("span", { className: J.formulaHelpParamItem, children: [
|
|
664
664
|
/* @__PURE__ */ b(
|
|
665
665
|
"span",
|
|
666
666
|
{
|
|
667
667
|
className: o === i ? J.formulaHelpFunctionActive : J.formulaHelpParamActive,
|
|
668
668
|
onClick: () => r(i),
|
|
669
|
-
children:
|
|
669
|
+
children: pn(s)
|
|
670
670
|
}
|
|
671
671
|
),
|
|
672
672
|
i === n.length - 1 ? "" : ","
|
|
673
673
|
] }, s.name)),
|
|
674
674
|
")"
|
|
675
675
|
] });
|
|
676
|
-
},
|
|
676
|
+
}, Vn = () => {
|
|
677
677
|
};
|
|
678
|
-
function
|
|
679
|
-
const { onParamsSwitch: e =
|
|
680
|
-
function p(
|
|
681
|
-
e && e(
|
|
678
|
+
function hi(t) {
|
|
679
|
+
const { onParamsSwitch: e = Vn, onClose: n = Vn, isFocus: o, editor: r, formulaText: s } = t, { functionInfo: i, paramIndex: c, reset: l } = Zs(o, s, r), h = le(() => !!i && c >= 0, [i, c]), [f, m] = $(!0), u = O(je), d = u.t("formula.prompt.required"), a = u.t("formula.prompt.optional"), I = r.getEditorId(), [g] = wo(I, h, [i, c]);
|
|
680
|
+
function p(S) {
|
|
681
|
+
e && e(S);
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
|
|
683
|
+
const C = () => {
|
|
684
|
+
l(), n();
|
|
685
685
|
};
|
|
686
|
-
return h && i ? /* @__PURE__ */ b(
|
|
687
|
-
/* @__PURE__ */
|
|
686
|
+
return h && i ? /* @__PURE__ */ b(So, { portal: !0, onClickOutside: () => l(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ k("div", { className: J.formulaHelpFunction, children: [
|
|
687
|
+
/* @__PURE__ */ k("div", { className: J.formulaHelpFunctionTitle, children: [
|
|
688
688
|
/* @__PURE__ */ b(
|
|
689
|
-
|
|
689
|
+
fi,
|
|
690
690
|
{
|
|
691
691
|
prefix: i.functionName,
|
|
692
692
|
value: i.functionParameter,
|
|
@@ -694,22 +694,22 @@ function ai(t) {
|
|
|
694
694
|
onClick: p
|
|
695
695
|
}
|
|
696
696
|
),
|
|
697
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ k("div", { className: J.formulaHelpFunctionTitleIcons, children: [
|
|
698
698
|
/* @__PURE__ */ b(
|
|
699
699
|
"div",
|
|
700
700
|
{
|
|
701
701
|
className: J.formulaHelpFunctionTitleIcon,
|
|
702
|
-
style: { transform:
|
|
703
|
-
onClick: () => m(!
|
|
704
|
-
children: /* @__PURE__ */ b(
|
|
702
|
+
style: { transform: f ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
703
|
+
onClick: () => m(!f),
|
|
704
|
+
children: /* @__PURE__ */ b(gn, {})
|
|
705
705
|
}
|
|
706
706
|
),
|
|
707
707
|
/* @__PURE__ */ b(
|
|
708
708
|
"div",
|
|
709
709
|
{
|
|
710
710
|
className: J.formulaHelpFunctionTitleIcon,
|
|
711
|
-
onClick:
|
|
712
|
-
children: /* @__PURE__ */ b(
|
|
711
|
+
onClick: C,
|
|
712
|
+
children: /* @__PURE__ */ b(Vt, {})
|
|
713
713
|
}
|
|
714
714
|
)
|
|
715
715
|
] })
|
|
@@ -719,30 +719,30 @@ function ai(t) {
|
|
|
719
719
|
{
|
|
720
720
|
className: J.formulaHelpFunctionContent,
|
|
721
721
|
style: {
|
|
722
|
-
height:
|
|
723
|
-
padding:
|
|
722
|
+
height: f ? "unset" : 0,
|
|
723
|
+
padding: f ? "revert-layer" : 0
|
|
724
724
|
},
|
|
725
|
-
children: /* @__PURE__ */
|
|
725
|
+
children: /* @__PURE__ */ k("div", { className: J.formulaHelpFunctionContentInner, children: [
|
|
726
726
|
/* @__PURE__ */ b(
|
|
727
|
-
|
|
727
|
+
Yt,
|
|
728
728
|
{
|
|
729
|
-
title:
|
|
730
|
-
value: `${i.functionName}(${i.functionParameter.map((
|
|
729
|
+
title: u.t("formula.prompt.helpExample"),
|
|
730
|
+
value: `${i.functionName}(${i.functionParameter.map((S) => S.example).join(",")})`
|
|
731
731
|
}
|
|
732
732
|
),
|
|
733
733
|
/* @__PURE__ */ b(
|
|
734
|
-
|
|
734
|
+
Yt,
|
|
735
735
|
{
|
|
736
|
-
title:
|
|
736
|
+
title: u.t("formula.prompt.helpAbstract"),
|
|
737
737
|
value: i.description
|
|
738
738
|
}
|
|
739
739
|
),
|
|
740
|
-
i && i.functionParameter && i.functionParameter.map((
|
|
741
|
-
|
|
740
|
+
i && i.functionParameter && i.functionParameter.map((S, v) => /* @__PURE__ */ b(
|
|
741
|
+
Yt,
|
|
742
742
|
{
|
|
743
743
|
className: c === v ? J.formulaHelpFunctionActive : "",
|
|
744
|
-
title:
|
|
745
|
-
value: `${
|
|
744
|
+
title: S.name,
|
|
745
|
+
value: `${S.require ? d : a} ${S.detail}`
|
|
746
746
|
},
|
|
747
747
|
v
|
|
748
748
|
))
|
|
@@ -751,7 +751,7 @@ function ai(t) {
|
|
|
751
751
|
)
|
|
752
752
|
] }) }) : null;
|
|
753
753
|
}
|
|
754
|
-
const
|
|
754
|
+
const di = (t) => {
|
|
755
755
|
const e = O(be);
|
|
756
756
|
return ee((o) => {
|
|
757
757
|
var r, s;
|
|
@@ -762,18 +762,18 @@ const ui = (t) => {
|
|
|
762
762
|
t.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
763
763
|
else if (!i.length && !t.docSelectionRenderService.isOnPointerEvent) {
|
|
764
764
|
const c = (s = (r = t.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
765
|
-
`,
|
|
766
|
-
t.setSelectionRanges([{ startOffset:
|
|
765
|
+
`, l = Math.max(c.length - 2, 0);
|
|
766
|
+
t.setSelectionRanges([{ startOffset: l, endOffset: l }]);
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
});
|
|
770
770
|
};
|
|
771
|
-
var
|
|
772
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
771
|
+
var mi = Object.getOwnPropertyDescriptor, gi = (t, e, n, o) => {
|
|
772
|
+
for (var r = o > 1 ? void 0 : o ? mi(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
773
773
|
(i = t[s]) && (r = i(r) || r);
|
|
774
774
|
return r;
|
|
775
|
-
},
|
|
776
|
-
let De = class extends
|
|
775
|
+
}, Xe = (t, e) => (n, o) => e(n, o, t);
|
|
776
|
+
let De = class extends Cr {
|
|
777
777
|
constructor(e, n, o, r, s, i, c) {
|
|
778
778
|
super(
|
|
779
779
|
n,
|
|
@@ -784,7 +784,7 @@ let De = class extends gr {
|
|
|
784
784
|
);
|
|
785
785
|
B(this, "_workbookSelections");
|
|
786
786
|
B(this, "_eventDisposables");
|
|
787
|
-
this._context = e, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(
|
|
787
|
+
this._context = e, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(pi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
788
788
|
}
|
|
789
789
|
getLocation() {
|
|
790
790
|
return this._skeleton.getLocation();
|
|
@@ -808,7 +808,7 @@ let De = class extends gr {
|
|
|
808
808
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
809
809
|
*/
|
|
810
810
|
enableSelectionChanging() {
|
|
811
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
811
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), Qn(() => this._disableSelectionChanging());
|
|
812
812
|
}
|
|
813
813
|
_disableSelectionChanging() {
|
|
814
814
|
var e;
|
|
@@ -818,27 +818,27 @@ let De = class extends gr {
|
|
|
818
818
|
this._disableSelectionChanging();
|
|
819
819
|
}
|
|
820
820
|
_initCanvasEventListeners() {
|
|
821
|
-
const e = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = e, { scene: i } = this._context, c = new
|
|
822
|
-
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((
|
|
823
|
-
this.inRefSelectionMode() && (this._onPointerDown(
|
|
821
|
+
const e = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = e, { scene: i } = this._context, c = new Ve();
|
|
822
|
+
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, h) => {
|
|
823
|
+
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, ge.NORMAL, this._getActiveViewport(l)), l.button !== 2 && h.stopPropagation());
|
|
824
824
|
})), c.add(
|
|
825
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((
|
|
825
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, h) => {
|
|
826
826
|
if (!this.inRefSelectionMode()) return;
|
|
827
|
-
const
|
|
828
|
-
|
|
827
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = yn(l.offsetX, l.offsetY, i, f);
|
|
828
|
+
Nn(this._workbookSelections.getCurrentSelections(), m, ge.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ge.ROW, this._getActiveViewport(l), jt.Y), l.button !== 2 && h.stopPropagation());
|
|
829
829
|
})
|
|
830
|
-
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((
|
|
830
|
+
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, h) => {
|
|
831
831
|
if (!this.inRefSelectionMode()) return;
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((
|
|
832
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = yn(l.offsetX, l.offsetY, i, f);
|
|
833
|
+
Nn(this._workbookSelections.getCurrentSelections(), m, ge.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ge.COLUMN, this._getActiveViewport(l), jt.X), l.button !== 2 && h.stopPropagation());
|
|
834
|
+
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, h) => {
|
|
835
835
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
836
|
-
const
|
|
836
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = vr(f);
|
|
837
837
|
this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
838
|
-
const
|
|
839
|
-
|
|
838
|
+
const u = i.onPointerUp$.subscribeEvent(() => {
|
|
839
|
+
u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
840
840
|
});
|
|
841
|
-
|
|
841
|
+
l.button !== 2 && h.stopPropagation();
|
|
842
842
|
})), c;
|
|
843
843
|
}
|
|
844
844
|
/**
|
|
@@ -848,7 +848,7 @@ let De = class extends gr {
|
|
|
848
848
|
*/
|
|
849
849
|
_addSelectionControlByModelData(e) {
|
|
850
850
|
var i;
|
|
851
|
-
const n = this._skeleton, o = (i = e.style) != null ? i :
|
|
851
|
+
const n = this._skeleton, o = (i = e.style) != null ? i : to(this._themeService), r = this._scene;
|
|
852
852
|
return e.style = o, this.newSelectionControl(r, n, e);
|
|
853
853
|
}
|
|
854
854
|
_initSelectionChangeListener() {
|
|
@@ -861,18 +861,18 @@ let De = class extends gr {
|
|
|
861
861
|
*/
|
|
862
862
|
_initUserActionSyncListener() {
|
|
863
863
|
this.disposeWithMe(this.selectionMoveStart$.subscribe((e) => {
|
|
864
|
-
this._updateSelections(e,
|
|
864
|
+
this._updateSelections(e, Kt.MOVE_START);
|
|
865
865
|
})), this.disposeWithMe(this.selectionMoving$.subscribe((e) => {
|
|
866
|
-
this._updateSelections(e,
|
|
866
|
+
this._updateSelections(e, Kt.MOVING);
|
|
867
867
|
})), this.disposeWithMe(this.selectionMoveEnd$.subscribe((e) => {
|
|
868
|
-
this._updateSelections(e,
|
|
868
|
+
this._updateSelections(e, Kt.MOVE_END);
|
|
869
869
|
}));
|
|
870
870
|
}
|
|
871
871
|
_updateSelections(e, n) {
|
|
872
872
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
873
873
|
e.length !== 0 && this._workbookSelections.setSelections(
|
|
874
874
|
r,
|
|
875
|
-
e.map((s) =>
|
|
875
|
+
e.map((s) => os(s)),
|
|
876
876
|
n
|
|
877
877
|
);
|
|
878
878
|
}
|
|
@@ -880,7 +880,7 @@ let De = class extends gr {
|
|
|
880
880
|
this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
881
881
|
if (!e)
|
|
882
882
|
return;
|
|
883
|
-
const { skeleton: n } = e, { scene: o } = this._context, r = o.getViewport(
|
|
883
|
+
const { skeleton: n } = e, { scene: o } = this._context, r = o.getViewport(xn.VIEW_MAIN);
|
|
884
884
|
this._skeleton && this._skeleton.worksheet.getSheetId() !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
|
|
885
885
|
const s = this._workbookSelections.getCurrentSelections();
|
|
886
886
|
this.resetSelectionsByModelData(s);
|
|
@@ -888,10 +888,10 @@ let De = class extends gr {
|
|
|
888
888
|
}
|
|
889
889
|
_getActiveViewport(e) {
|
|
890
890
|
const n = this._getSheetObject();
|
|
891
|
-
return n == null ? void 0 : n.scene.getActiveViewportByCoord(
|
|
891
|
+
return n == null ? void 0 : n.scene.getActiveViewportByCoord(wn.FromArray([e.offsetX, e.offsetY]));
|
|
892
892
|
}
|
|
893
893
|
_getSheetObject() {
|
|
894
|
-
return
|
|
894
|
+
return _r(this._context.unit, this._context);
|
|
895
895
|
}
|
|
896
896
|
/**
|
|
897
897
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -904,18 +904,18 @@ let De = class extends gr {
|
|
|
904
904
|
* @param scrollTimerType
|
|
905
905
|
*/
|
|
906
906
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
907
|
-
_onPointerDown(e, n = 0, o = ge.NORMAL, r, s =
|
|
908
|
-
var
|
|
907
|
+
_onPointerDown(e, n = 0, o = ge.NORMAL, r, s = jt.ALL) {
|
|
908
|
+
var R;
|
|
909
909
|
this._rangeType = o;
|
|
910
910
|
const i = this._skeleton, c = this._scene;
|
|
911
911
|
if (!c || !i)
|
|
912
912
|
return;
|
|
913
913
|
r && (this._activeViewport = r);
|
|
914
|
-
const { offsetX:
|
|
915
|
-
if (!
|
|
916
|
-
const m = c.getCoordRelativeToViewport(
|
|
917
|
-
this._startViewportPosX =
|
|
918
|
-
const
|
|
914
|
+
const { offsetX: l, offsetY: h } = e, f = c.getViewport(xn.VIEW_MAIN);
|
|
915
|
+
if (!f) return;
|
|
916
|
+
const m = c.getCoordRelativeToViewport(wn.FromArray([l, h])), { x: u, y: d } = m;
|
|
917
|
+
this._startViewportPosX = u, this._startViewportPosY = d;
|
|
918
|
+
const a = c.getScrollXYInfoByViewport(m), { scaleX: I, scaleY: g } = c.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, I, g, a);
|
|
919
919
|
if (!p) return;
|
|
920
920
|
switch (o) {
|
|
921
921
|
case ge.NORMAL:
|
|
@@ -929,38 +929,38 @@ let De = class extends gr {
|
|
|
929
929
|
case ge.ALL:
|
|
930
930
|
p.startRow = 0, p.startColumn = 0, p.endRow = this._skeleton.getRowCount() - 1, p.endColumn = this._skeleton.getColumnCount() - 1;
|
|
931
931
|
}
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
const
|
|
935
|
-
this._startRangeWhenPointerDown = { ...
|
|
936
|
-
const v = { ...
|
|
937
|
-
let
|
|
932
|
+
const C = { range: p, primary: p, style: null };
|
|
933
|
+
C.range.rangeType = o;
|
|
934
|
+
const S = Xt(C, this._skeleton);
|
|
935
|
+
this._startRangeWhenPointerDown = { ...S.rangeWithCoord };
|
|
936
|
+
const v = { ...S.rangeWithCoord, rangeType: o };
|
|
937
|
+
let _ = this.getActiveSelectionControl();
|
|
938
938
|
const T = this.getSelectionControls();
|
|
939
|
-
for (const
|
|
940
|
-
if (e.button === 2 &&
|
|
941
|
-
|
|
939
|
+
for (const y of T) {
|
|
940
|
+
if (e.button === 2 && Gn.contains(y.model, v)) {
|
|
941
|
+
_ = y;
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
if (
|
|
945
|
-
|
|
944
|
+
if (y.model.isEqual(v)) {
|
|
945
|
+
_ = y;
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
this._checkClearPreviousControls(e);
|
|
950
|
-
const w =
|
|
950
|
+
const w = _ == null ? void 0 : _.model.currentCell, A = e.shiftKey && w, M = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
951
951
|
A && w ? this._makeSelectionByTwoCells(
|
|
952
952
|
w,
|
|
953
953
|
v,
|
|
954
954
|
i,
|
|
955
955
|
o,
|
|
956
|
-
|
|
956
|
+
_
|
|
957
957
|
// Get updated in this method
|
|
958
|
-
) : M &&
|
|
959
|
-
for (let
|
|
960
|
-
this.getSelectionControls()[
|
|
961
|
-
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (
|
|
962
|
-
var
|
|
963
|
-
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (
|
|
958
|
+
) : M && _ ? _.updateRangeBySelectionWithCoord(S) : _ = this.newSelectionControl(c, i, C);
|
|
959
|
+
for (let y = 0; y < this.getSelectionControls().length - 1; y++)
|
|
960
|
+
this.getSelectionControls()[y].clearHighlight();
|
|
961
|
+
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (R = c.getTransformer()) == null || R.clearSelectedObjects(), this._setupPointerMoveListener(f, _, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
|
|
962
|
+
var y;
|
|
963
|
+
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (y = this._escapeShortcutDisposable) == null || y.dispose(), this._escapeShortcutDisposable = null;
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
/**
|
|
@@ -971,13 +971,13 @@ let De = class extends gr {
|
|
|
971
971
|
* @returns {SelectionControl} selectionControl just created
|
|
972
972
|
*/
|
|
973
973
|
newSelectionControl(e, n, o) {
|
|
974
|
-
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new
|
|
974
|
+
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new no(e, r, this._themeService, {
|
|
975
975
|
highlightHeader: this._highlightHeader,
|
|
976
976
|
enableAutoFill: !1,
|
|
977
977
|
rowHeaderWidth: s,
|
|
978
978
|
columnHeaderHeight: i
|
|
979
|
-
}),
|
|
980
|
-
return c.updateRangeBySelectionWithCoord(
|
|
979
|
+
}), l = Xt(o, n);
|
|
980
|
+
return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
|
|
981
981
|
skeleton: n,
|
|
982
982
|
scene: e,
|
|
983
983
|
themeService: this._themeService,
|
|
@@ -990,102 +990,102 @@ let De = class extends gr {
|
|
|
990
990
|
}), c;
|
|
991
991
|
}
|
|
992
992
|
};
|
|
993
|
-
De =
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
993
|
+
De = gi([
|
|
994
|
+
Xe(1, K(mt)),
|
|
995
|
+
Xe(2, K(gt)),
|
|
996
|
+
Xe(3, Ut),
|
|
997
|
+
Xe(4, K(Lt)),
|
|
998
|
+
Xe(5, on),
|
|
999
|
+
Xe(6, kt)
|
|
1000
1000
|
], De);
|
|
1001
|
-
function
|
|
1002
|
-
const e =
|
|
1001
|
+
function pi(t) {
|
|
1002
|
+
const e = to(t);
|
|
1003
1003
|
return e.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, e;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function Si(t) {
|
|
1006
1006
|
var r, s;
|
|
1007
1007
|
const n = t.get(oe).getCurrentUniverDocInstance();
|
|
1008
1008
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
1009
1009
|
}
|
|
1010
1010
|
var we = /* @__PURE__ */ ((t) => (t[t.NOT_SELECT = 0] = "NOT_SELECT", t[t.NEED_ADD = 1] = "NEED_ADD", t[t.CAN_EDIT = 2] = "CAN_EDIT", t[t.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", t))(we || {});
|
|
1011
|
-
function
|
|
1011
|
+
function Ci(t) {
|
|
1012
1012
|
var w;
|
|
1013
|
-
const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(
|
|
1013
|
+
const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(Ne), c = O(oe), l = i.getRenderById(r), h = i.getRenderById(e), f = h == null ? void 0 : h.with(ao), m = O(Eo), u = O(mt), [d, a] = $(
|
|
1014
1014
|
0
|
|
1015
1015
|
/* NOT_SELECT */
|
|
1016
|
-
),
|
|
1016
|
+
), I = O(Ee), g = j(!0), p = l == null ? void 0 : l.with(De), C = Ke(d), S = c.getUnit(r, ue.UNIVER_SHEET), v = S == null ? void 0 : S.getSheetBySheetId(s), _ = ee((A) => {
|
|
1017
1017
|
p && p.setSkipLastEnabled(
|
|
1018
1018
|
A === 1 || A === 3
|
|
1019
1019
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
1020
|
-
),
|
|
1020
|
+
), C.current = A, a(A);
|
|
1021
1021
|
}), T = ee(() => {
|
|
1022
1022
|
var te, ie;
|
|
1023
|
-
if (!
|
|
1024
|
-
const A =
|
|
1025
|
-
if (!
|
|
1026
|
-
const P = (te =
|
|
1023
|
+
if (!S) return;
|
|
1024
|
+
const A = S.getActiveSheet(), M = f == null ? void 0 : f.getActiveTextRange(), R = M != null && M.collapsed ? M.startOffset : -1, y = Si(u);
|
|
1025
|
+
if (!y) return;
|
|
1026
|
+
const P = (te = y == null ? void 0 : y.dataStream) == null ? void 0 : te.slice(0, -2), N = ((ie = I.sequenceNodesBuilder(P)) != null ? ie : []).map((q) => typeof q == "object" ? q.nodeType === z.REFERENCE ? {
|
|
1027
1027
|
...q,
|
|
1028
|
-
range:
|
|
1028
|
+
range: Dr(q.token)
|
|
1029
1029
|
} : {
|
|
1030
1030
|
...q,
|
|
1031
1031
|
range: void 0
|
|
1032
|
-
} : q), E = P[
|
|
1032
|
+
} : q), E = P[R - 1], F = P[R], x = N.find((q) => typeof q == "object" && q.nodeType === z.REFERENCE && R === q.endIndex + 2), H = E && Lr(E) && (!F || $r(F) && F !== nt.OPEN_BRACKET), V = !!x;
|
|
1033
1033
|
if ((P == null ? void 0 : P.substring(0, 1)) === "=" && (H || V))
|
|
1034
1034
|
if (V) {
|
|
1035
1035
|
if (g.current)
|
|
1036
1036
|
return;
|
|
1037
|
-
!x.range.sheetName && A.getSheetId() === (v == null ? void 0 : v.getSheetId()) || x.range.sheetName === A.getName() ?
|
|
1037
|
+
!x.range.sheetName && A.getSheetId() === (v == null ? void 0 : v.getSheetId()) || x.range.sheetName === A.getName() ? _(
|
|
1038
1038
|
2
|
|
1039
1039
|
/* CAN_EDIT */
|
|
1040
|
-
) :
|
|
1040
|
+
) : _(
|
|
1041
1041
|
3
|
|
1042
1042
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
1043
1043
|
);
|
|
1044
1044
|
} else
|
|
1045
|
-
g.current = !1,
|
|
1045
|
+
g.current = !1, _(
|
|
1046
1046
|
1
|
|
1047
1047
|
/* NEED_ADD */
|
|
1048
1048
|
);
|
|
1049
1049
|
else
|
|
1050
|
-
|
|
1050
|
+
_(
|
|
1051
1051
|
0
|
|
1052
1052
|
/* NOT_SELECT */
|
|
1053
1053
|
);
|
|
1054
1054
|
});
|
|
1055
1055
|
return L(() => {
|
|
1056
|
-
const A = m.textSelection$.pipe(
|
|
1056
|
+
const A = m.textSelection$.pipe(Qt((M) => M.unitId === e)).subscribe(() => {
|
|
1057
1057
|
T();
|
|
1058
1058
|
});
|
|
1059
1059
|
return () => A.unsubscribe();
|
|
1060
1060
|
}, [T, m.textSelection$, e]), L(() => {
|
|
1061
|
-
n || (
|
|
1061
|
+
n || (_(
|
|
1062
1062
|
0
|
|
1063
1063
|
/* NOT_SELECT */
|
|
1064
1064
|
), g.current = !0);
|
|
1065
|
-
}, [n,
|
|
1065
|
+
}, [n, _]), L(() => {
|
|
1066
1066
|
var M;
|
|
1067
1067
|
if (!o) return;
|
|
1068
1068
|
const A = (M = h == null ? void 0 : h.mainComponent) == null ? void 0 : M.onPointerDown$.subscribeEvent(() => {
|
|
1069
|
-
|
|
1069
|
+
_(
|
|
1070
1070
|
0
|
|
1071
1071
|
/* NOT_SELECT */
|
|
1072
1072
|
), g.current = !0;
|
|
1073
1073
|
});
|
|
1074
1074
|
return () => A == null ? void 0 : A.unsubscribe();
|
|
1075
|
-
}, [o, (w = h == null ? void 0 : h.mainComponent) == null ? void 0 : w.onPointerDown$,
|
|
1075
|
+
}, [o, (w = h == null ? void 0 : h.mainComponent) == null ? void 0 : w.onPointerDown$, _]), L(() => {
|
|
1076
1076
|
if (!n) return;
|
|
1077
|
-
const A =
|
|
1077
|
+
const A = S == null ? void 0 : S.activeSheet$.subscribe(() => {
|
|
1078
1078
|
T();
|
|
1079
1079
|
});
|
|
1080
1080
|
return () => A == null ? void 0 : A.unsubscribe();
|
|
1081
|
-
}, [T, n,
|
|
1081
|
+
}, [T, n, S == null ? void 0 : S.activeSheet$]), { isSelecting: d, isSelectingRef: C };
|
|
1082
1082
|
}
|
|
1083
|
-
const
|
|
1083
|
+
const vi = () => {
|
|
1084
1084
|
const t = O(Ee);
|
|
1085
|
-
return
|
|
1085
|
+
return Ft((n) => t.sequenceNodesBuilder(n) || [], [t]);
|
|
1086
1086
|
};
|
|
1087
|
-
function
|
|
1088
|
-
const o = t.getCurrentTheme(), r = new
|
|
1087
|
+
function _i(t, e, n) {
|
|
1088
|
+
const o = t.getCurrentTheme(), r = new sn(e).setAlpha(0.05).toRgbString();
|
|
1089
1089
|
return {
|
|
1090
1090
|
id: n,
|
|
1091
1091
|
strokeWidth: 1,
|
|
@@ -1097,8 +1097,8 @@ function Si(t, e, n) {
|
|
|
1097
1097
|
widgetStroke: o.colorWhite
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
var p,
|
|
1100
|
+
function Do(t) {
|
|
1101
|
+
var p, C, S;
|
|
1102
1102
|
const {
|
|
1103
1103
|
unitId: e,
|
|
1104
1104
|
subUnitId: n,
|
|
@@ -1107,101 +1107,101 @@ function xo(t) {
|
|
|
1107
1107
|
refSelectionsService: s,
|
|
1108
1108
|
refSelectionsRenderService: i,
|
|
1109
1109
|
sheetSkeletonManagerService: c,
|
|
1110
|
-
themeService:
|
|
1110
|
+
themeService: l,
|
|
1111
1111
|
univerInstanceService: h
|
|
1112
|
-
} = t,
|
|
1113
|
-
if (!
|
|
1114
|
-
s.setSelections(
|
|
1112
|
+
} = t, f = h.getUnit(e, ue.UNIVER_SHEET), m = f == null ? void 0 : f.getActiveSheet(), u = [];
|
|
1113
|
+
if (!f || !m) {
|
|
1114
|
+
s.setSelections(u);
|
|
1115
1115
|
return;
|
|
1116
1116
|
}
|
|
1117
|
-
const d = m.getSheetId(),
|
|
1118
|
-
var
|
|
1119
|
-
return (
|
|
1117
|
+
const d = m.getSheetId(), a = (v) => {
|
|
1118
|
+
var _;
|
|
1119
|
+
return (_ = f == null ? void 0 : f.getSheetBySheetName(v)) == null ? void 0 : _.getSheetId();
|
|
1120
1120
|
};
|
|
1121
1121
|
if (!((p = c == null ? void 0 : c.getWorksheetSkeleton(d)) == null ? void 0 : p.skeleton)) return;
|
|
1122
1122
|
const g = [];
|
|
1123
|
-
for (let v = 0,
|
|
1124
|
-
const T = o[v], { themeColor: w, token: A, refIndex: M, endIndex:
|
|
1123
|
+
for (let v = 0, _ = o.length; v < _; v++) {
|
|
1124
|
+
const T = o[v], { themeColor: w, token: A, refIndex: M, endIndex: R } = T, y = ot(A), { unitId: P, sheetName: N, range: E } = y;
|
|
1125
1125
|
if (P && e !== P)
|
|
1126
1126
|
continue;
|
|
1127
|
-
const F =
|
|
1127
|
+
const F = a(N);
|
|
1128
1128
|
if (F && F !== d || !F && d !== n)
|
|
1129
1129
|
continue;
|
|
1130
|
-
const x =
|
|
1131
|
-
x.unitId = e, x.sheetId = d,
|
|
1130
|
+
const x = rs(E, m.getRowCount(), m.getColumnCount());
|
|
1131
|
+
x.unitId = e, x.sheetId = d, u.push({
|
|
1132
1132
|
range: x,
|
|
1133
1133
|
primary: null,
|
|
1134
|
-
style:
|
|
1135
|
-
}), g.push(
|
|
1134
|
+
style: _i(l, w, M.toString())
|
|
1135
|
+
}), g.push(R);
|
|
1136
1136
|
}
|
|
1137
1137
|
if (r) {
|
|
1138
|
-
const v = (
|
|
1139
|
-
|
|
1138
|
+
const v = (S = (C = r.getSelectionRanges()) == null ? void 0 : C[0]) == null ? void 0 : S.startOffset, _ = g.findIndex((T) => T + 2 === v);
|
|
1139
|
+
_ !== -1 ? i == null || i.setActiveSelectionIndex(_) : i == null || i.resetActiveSelectionIndex();
|
|
1140
1140
|
}
|
|
1141
|
-
return
|
|
1141
|
+
return u;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1144
|
-
const n = O(oe), o = O(gt), r = O(
|
|
1143
|
+
function Ri(t, e) {
|
|
1144
|
+
const n = O(oe), o = O(gt), r = O(kt), i = O(Ne).getRenderById(t), c = i == null ? void 0 : i.with(De), l = i == null ? void 0 : i.with(Lt), h = ee((f, m) => {
|
|
1145
1145
|
if (c != null && c.selectionMoving) return;
|
|
1146
|
-
const
|
|
1146
|
+
const u = Do({
|
|
1147
1147
|
unitId: t,
|
|
1148
1148
|
subUnitId: e,
|
|
1149
|
-
refSelections:
|
|
1149
|
+
refSelections: f,
|
|
1150
1150
|
editor: m,
|
|
1151
1151
|
refSelectionsService: r,
|
|
1152
1152
|
refSelectionsRenderService: c,
|
|
1153
|
-
sheetSkeletonManagerService:
|
|
1153
|
+
sheetSkeletonManagerService: l,
|
|
1154
1154
|
themeService: o,
|
|
1155
1155
|
univerInstanceService: n
|
|
1156
1156
|
});
|
|
1157
|
-
if (!
|
|
1158
|
-
((c == null ? void 0 : c.getSelectionControls()) || []).length ===
|
|
1157
|
+
if (!u) return;
|
|
1158
|
+
((c == null ? void 0 : c.getSelectionControls()) || []).length === u.length ? c == null || c.resetSelectionsByModelData(u) : r.setSelections(u);
|
|
1159
1159
|
});
|
|
1160
1160
|
return L(() => () => {
|
|
1161
1161
|
c == null || c.resetActiveSelectionIndex();
|
|
1162
1162
|
}, [c]), h;
|
|
1163
1163
|
}
|
|
1164
|
-
function
|
|
1165
|
-
const e = O(
|
|
1166
|
-
return ee((i, c,
|
|
1167
|
-
const
|
|
1168
|
-
if (!
|
|
1164
|
+
function Lo(t = "") {
|
|
1165
|
+
const e = O(Ht), n = Ii(), o = O(ae), r = le(() => t.length, [t]);
|
|
1166
|
+
return ee((i, c, l = !0, h) => {
|
|
1167
|
+
const f = i.getDocumentData(), m = i.getEditorId();
|
|
1168
|
+
if (!f)
|
|
1169
1169
|
return [];
|
|
1170
|
-
const
|
|
1171
|
-
if (!
|
|
1170
|
+
const u = f.body;
|
|
1171
|
+
if (!u)
|
|
1172
1172
|
return [];
|
|
1173
|
-
const d =
|
|
1173
|
+
const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...f.body };
|
|
1174
1174
|
if (!d.startsWith(t)) return [];
|
|
1175
1175
|
if (c == null || c.length === 0)
|
|
1176
|
-
return
|
|
1176
|
+
return a.textRuns = [], o.syncExecuteCommand(Pn.id, {
|
|
1177
1177
|
unitId: m,
|
|
1178
|
-
body:
|
|
1178
|
+
body: bn(a, 0, a.dataStream.length - 2)
|
|
1179
1179
|
}), [];
|
|
1180
1180
|
{
|
|
1181
|
-
const { textRuns:
|
|
1182
|
-
r &&
|
|
1183
|
-
|
|
1184
|
-
}),
|
|
1185
|
-
const p = c.reduce((
|
|
1186
|
-
|
|
1181
|
+
const { textRuns: I, refSelections: g } = Ei(e, n, c);
|
|
1182
|
+
r && I.forEach((S) => {
|
|
1183
|
+
S.ed = S.ed + r, S.st = S.st + r;
|
|
1184
|
+
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...I];
|
|
1185
|
+
const p = c.reduce((S, v) => typeof v == "string" ? `${S}${v}` : `${S}${v.token}`, "");
|
|
1186
|
+
a.dataStream = `${t}${p}\r
|
|
1187
1187
|
`;
|
|
1188
|
-
let
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1191
|
-
const
|
|
1192
|
-
|
|
1193
|
-
v.startOffset = Math.max(0, Math.min(v.startOffset,
|
|
1188
|
+
let C;
|
|
1189
|
+
if (l) {
|
|
1190
|
+
C = i.getSelectionRanges();
|
|
1191
|
+
const S = a.dataStream.length - 2 + r;
|
|
1192
|
+
C.forEach((v) => {
|
|
1193
|
+
v.startOffset = Math.max(0, Math.min(v.startOffset, S)), v.endOffset = Math.max(0, Math.min(v.endOffset, S));
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
|
-
return o.syncExecuteCommand(
|
|
1196
|
+
return o.syncExecuteCommand(Pn.id, {
|
|
1197
1197
|
unitId: m,
|
|
1198
|
-
body:
|
|
1199
|
-
textRanges: h != null ? h :
|
|
1198
|
+
body: bn(a, 0, a.dataStream.length - 2),
|
|
1199
|
+
textRanges: h != null ? h : C
|
|
1200
1200
|
}), g;
|
|
1201
1201
|
}
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Ii() {
|
|
1205
1205
|
const e = O(gt).getCurrentTheme();
|
|
1206
1206
|
return le(() => {
|
|
1207
1207
|
const o = [
|
|
@@ -1221,16 +1221,16 @@ function vi() {
|
|
|
1221
1221
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
1222
1222
|
}, [e]);
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1225
|
-
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = e, c = [],
|
|
1226
|
-
let
|
|
1227
|
-
for (let m = 0,
|
|
1224
|
+
function Ei(t, e, n) {
|
|
1225
|
+
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = e, c = [], l = [], h = /* @__PURE__ */ new Map();
|
|
1226
|
+
let f = 0;
|
|
1227
|
+
for (let m = 0, u = n.length; m < u; m++) {
|
|
1228
1228
|
const d = n[m];
|
|
1229
1229
|
if (typeof d == "string") {
|
|
1230
|
-
const
|
|
1230
|
+
const S = c[c.length - 1], v = S ? S.ed : 0, _ = v + d.length;
|
|
1231
1231
|
c.push({
|
|
1232
1232
|
st: v,
|
|
1233
|
-
ed:
|
|
1233
|
+
ed: _,
|
|
1234
1234
|
ts: {
|
|
1235
1235
|
cl: {
|
|
1236
1236
|
rgb: i
|
|
@@ -1253,36 +1253,36 @@ function _i(t, e, n) {
|
|
|
1253
1253
|
});
|
|
1254
1254
|
continue;
|
|
1255
1255
|
}
|
|
1256
|
-
const { startIndex:
|
|
1257
|
-
let
|
|
1256
|
+
const { startIndex: a, endIndex: I, nodeType: g, token: p } = d;
|
|
1257
|
+
let C = "";
|
|
1258
1258
|
if (g === z.REFERENCE) {
|
|
1259
1259
|
if (h.has(p))
|
|
1260
|
-
|
|
1260
|
+
C = h.get(p);
|
|
1261
1261
|
else {
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1262
|
+
const S = f % o.length;
|
|
1263
|
+
C = o[S], h.set(p, C), f++;
|
|
1264
1264
|
}
|
|
1265
|
-
|
|
1265
|
+
l.push({
|
|
1266
1266
|
refIndex: m,
|
|
1267
|
-
themeColor:
|
|
1267
|
+
themeColor: C,
|
|
1268
1268
|
token: p,
|
|
1269
1269
|
startIndex: d.startIndex,
|
|
1270
1270
|
endIndex: d.endIndex,
|
|
1271
|
-
index:
|
|
1271
|
+
index: l.length
|
|
1272
1272
|
});
|
|
1273
|
-
} else g === z.NUMBER ?
|
|
1274
|
-
|
|
1275
|
-
st:
|
|
1276
|
-
ed:
|
|
1273
|
+
} else g === z.NUMBER ? C = r : (g === z.STRING || g === z.ARRAY) && (C = s);
|
|
1274
|
+
C && C.length > 0 ? c.push({
|
|
1275
|
+
st: a,
|
|
1276
|
+
ed: I + 1,
|
|
1277
1277
|
ts: {
|
|
1278
1278
|
cl: {
|
|
1279
|
-
rgb:
|
|
1279
|
+
rgb: C
|
|
1280
1280
|
},
|
|
1281
1281
|
fs: 11
|
|
1282
1282
|
}
|
|
1283
1283
|
}) : c.push({
|
|
1284
|
-
st:
|
|
1285
|
-
ed:
|
|
1284
|
+
st: a,
|
|
1285
|
+
ed: I + 1,
|
|
1286
1286
|
ts: {
|
|
1287
1287
|
cl: {
|
|
1288
1288
|
rgb: i
|
|
@@ -1291,52 +1291,52 @@ function _i(t, e, n) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
|
-
return { textRuns: c, refSelections:
|
|
1294
|
+
return { textRuns: c, refSelections: l };
|
|
1295
1295
|
}
|
|
1296
|
-
const
|
|
1297
|
-
const r = O(ae), s = O(
|
|
1296
|
+
const bi = (t, e, n, o) => {
|
|
1297
|
+
const r = O(ae), s = O(Ut), i = j(e);
|
|
1298
1298
|
i.current = e;
|
|
1299
1299
|
const c = j(o);
|
|
1300
1300
|
c.current = o, L(() => {
|
|
1301
1301
|
if (!n || !t)
|
|
1302
1302
|
return;
|
|
1303
|
-
const h = `sheet.formula-embedding-editor.${n.getEditorId()}`,
|
|
1303
|
+
const h = `sheet.formula-embedding-editor.${n.getEditorId()}`, f = new Ve(), m = (a, I) => {
|
|
1304
1304
|
if (c.current) {
|
|
1305
|
-
c.current(
|
|
1305
|
+
c.current(a, I);
|
|
1306
1306
|
return;
|
|
1307
1307
|
}
|
|
1308
1308
|
let g = ne.LEFT;
|
|
1309
|
-
|
|
1309
|
+
a === D.ARROW_DOWN ? g = ne.DOWN : a === D.ARROW_UP ? g = ne.UP : a === D.ARROW_RIGHT && (g = ne.RIGHT), I === U.SHIFT ? r.executeCommand(Zr.id, {
|
|
1310
1310
|
direction: g
|
|
1311
|
-
}) : r.executeCommand(
|
|
1311
|
+
}) : r.executeCommand(Xr.id, {
|
|
1312
1312
|
direction: g
|
|
1313
1313
|
});
|
|
1314
|
-
},
|
|
1314
|
+
}, u = (a, I) => {
|
|
1315
1315
|
let g = ne.DOWN;
|
|
1316
|
-
|
|
1316
|
+
a === D.ARROW_DOWN ? g = ne.DOWN : a === D.ARROW_UP ? g = ne.UP : a === D.ARROW_LEFT ? g = ne.LEFT : a === D.ARROW_RIGHT && (g = ne.RIGHT), i.current ? I === U.CTRL_COMMAND ? r.executeCommand(Tn.id, {
|
|
1317
1317
|
direction: g,
|
|
1318
|
-
jumpOver:
|
|
1318
|
+
jumpOver: Fn.moveGap,
|
|
1319
1319
|
extra: "formula-editor",
|
|
1320
1320
|
fromCurrentSelection: i.current === we.NEED_ADD || i.current === we.EDIT_OTHER_SHEET_REFERENCE
|
|
1321
|
-
}) :
|
|
1321
|
+
}) : I === U.SHIFT ? r.executeCommand(On.id, {
|
|
1322
1322
|
direction: g,
|
|
1323
1323
|
extra: "formula-editor"
|
|
1324
|
-
}) :
|
|
1324
|
+
}) : I === (U.CTRL_COMMAND | U.SHIFT) ? r.executeCommand(On.id, {
|
|
1325
1325
|
direction: g,
|
|
1326
|
-
jumpOver:
|
|
1326
|
+
jumpOver: Fn.moveGap,
|
|
1327
1327
|
extra: "formula-editor"
|
|
1328
|
-
}) : r.executeCommand(
|
|
1328
|
+
}) : r.executeCommand(Tn.id, {
|
|
1329
1329
|
direction: g,
|
|
1330
1330
|
extra: "formula-editor",
|
|
1331
1331
|
fromCurrentSelection: i.current === we.NEED_ADD || i.current === we.EDIT_OTHER_SHEET_REFERENCE
|
|
1332
|
-
}) : m(
|
|
1332
|
+
}) : m(a, I);
|
|
1333
1333
|
};
|
|
1334
|
-
return
|
|
1334
|
+
return f.add(r.registerCommand({
|
|
1335
1335
|
id: h,
|
|
1336
1336
|
type: Ie.OPERATION,
|
|
1337
|
-
handler(
|
|
1338
|
-
const { keyCode: g, metaKey: p } =
|
|
1339
|
-
|
|
1337
|
+
handler(a, I) {
|
|
1338
|
+
const { keyCode: g, metaKey: p } = I;
|
|
1339
|
+
u(g, p);
|
|
1340
1340
|
}
|
|
1341
1341
|
})), [
|
|
1342
1342
|
{ keyCode: D.ARROW_DOWN },
|
|
@@ -1355,245 +1355,245 @@ const Ri = (t, e, n, o) => {
|
|
|
1355
1355
|
{ keyCode: D.ARROW_LEFT, metaKey: U.CTRL_COMMAND | U.SHIFT },
|
|
1356
1356
|
{ keyCode: D.ARROW_RIGHT, metaKey: U.CTRL_COMMAND | U.SHIFT },
|
|
1357
1357
|
{ keyCode: D.ARROW_UP, metaKey: U.CTRL_COMMAND | U.SHIFT }
|
|
1358
|
-
].map(({ keyCode:
|
|
1358
|
+
].map(({ keyCode: a, metaKey: I }) => ({
|
|
1359
1359
|
id: h,
|
|
1360
|
-
binding:
|
|
1360
|
+
binding: I ? a | I : a,
|
|
1361
1361
|
preconditions: () => !0,
|
|
1362
1362
|
priority: 900,
|
|
1363
1363
|
staticParameters: {
|
|
1364
|
-
eventType:
|
|
1365
|
-
keyCode:
|
|
1366
|
-
metaKey:
|
|
1364
|
+
eventType: ye.Keyboard,
|
|
1365
|
+
keyCode: a,
|
|
1366
|
+
metaKey: I
|
|
1367
1367
|
}
|
|
1368
|
-
})).forEach((
|
|
1369
|
-
|
|
1368
|
+
})).forEach((a) => {
|
|
1369
|
+
f.add(s.registerShortcut(a));
|
|
1370
1370
|
}), () => {
|
|
1371
|
-
|
|
1371
|
+
f.dispose();
|
|
1372
1372
|
};
|
|
1373
1373
|
}, [r, n, t, s]);
|
|
1374
|
-
},
|
|
1375
|
-
const r = O(
|
|
1376
|
-
|
|
1374
|
+
}, yi = (t, e, n, o = !0) => {
|
|
1375
|
+
const r = O(Ne), s = O(on), i = O(hs), c = O(kt), l = r.getRenderById(n), h = l == null ? void 0 : l.with(De);
|
|
1376
|
+
Ot(() => {
|
|
1377
1377
|
if (t)
|
|
1378
|
-
return s.setContextValue(
|
|
1379
|
-
s.setContextValue(
|
|
1378
|
+
return s.setContextValue(bt, !0), () => {
|
|
1379
|
+
s.setContextValue(bt, !1), c.clear();
|
|
1380
1380
|
};
|
|
1381
|
-
}, [s, t, c]),
|
|
1381
|
+
}, [s, t, c]), Ot(() => {
|
|
1382
1382
|
if (t && e) {
|
|
1383
|
-
const
|
|
1384
|
-
return s.setContextValue(
|
|
1385
|
-
s.setContextValue(
|
|
1383
|
+
const f = h == null ? void 0 : h.enableSelectionChanging();
|
|
1384
|
+
return s.setContextValue(Dn, !0), () => {
|
|
1385
|
+
s.setContextValue(Dn, !1), f == null || f.dispose();
|
|
1386
1386
|
};
|
|
1387
1387
|
}
|
|
1388
1388
|
}, [s, t, h, e]), L(() => {
|
|
1389
1389
|
if (t)
|
|
1390
|
-
return s.setContextValue(
|
|
1391
|
-
s.setContextValue(
|
|
1390
|
+
return s.setContextValue(bt, !0), o && i.disable(), () => {
|
|
1391
|
+
s.setContextValue(bt, !1), o && i.enable();
|
|
1392
1392
|
};
|
|
1393
1393
|
}, [i, s, t, o]), L(() => {
|
|
1394
1394
|
t && (h == null || h.setSkipLastEnabled(!1));
|
|
1395
1395
|
}, [t, h]);
|
|
1396
|
-
},
|
|
1397
|
-
const o = O(oe), r = O(
|
|
1398
|
-
return
|
|
1396
|
+
}, Ni = (t, e, n) => {
|
|
1397
|
+
const o = O(oe), r = O(ln);
|
|
1398
|
+
return Ft(() => {
|
|
1399
1399
|
if (t) {
|
|
1400
|
-
const i = [...r.getWorkbookSelections(e).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(ue.UNIVER_SHEET),
|
|
1401
|
-
|
|
1400
|
+
const i = [...r.getWorkbookSelections(e).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(ue.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
|
|
1401
|
+
l && l.getSheetId() === n && r.setSelections(i);
|
|
1402
1402
|
}
|
|
1403
1403
|
}, [t, r, n, e, o]);
|
|
1404
|
-
},
|
|
1405
|
-
var
|
|
1404
|
+
}, Ti = (t) => t.reduce((e, n) => typeof n == "string" ? e + n.length : e + n.token.length, 0), tn = (t) => t.map((e) => typeof e == "string" ? e : e.token).join(""), yt = (t, e = !1, n = "") => e ? t.map((o) => o.sheetName !== "" && o.sheetName !== n ? ht(o.sheetName, o.range) : pe(o.range)) : t.map((o) => pe(o.range)), Fi = (t) => {
|
|
1405
|
+
var f, m, u;
|
|
1406
1406
|
const { editor: e, lexerTreeBuilder: n } = t, o = e == null ? void 0 : e.getSelectionRanges();
|
|
1407
1407
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
1408
1408
|
return;
|
|
1409
|
-
const s = o[0].startOffset - 1, i = ((m = (
|
|
1410
|
-
`).slice(0, -2), c = (
|
|
1409
|
+
const s = o[0].startOffset - 1, i = ((m = (f = e == null ? void 0 : e.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? m : `\r
|
|
1410
|
+
`).slice(0, -2), c = (u = n.sequenceNodesBuilder(i.slice(1))) != null ? u : [], l = mn(c, s, !1), h = To(c, l);
|
|
1411
1411
|
return {
|
|
1412
|
-
nodeIndex:
|
|
1412
|
+
nodeIndex: l,
|
|
1413
1413
|
updatingRefIndex: h,
|
|
1414
1414
|
sequenceNodes: c,
|
|
1415
1415
|
offset: s
|
|
1416
1416
|
};
|
|
1417
|
-
},
|
|
1418
|
-
},
|
|
1419
|
-
const
|
|
1420
|
-
var
|
|
1421
|
-
return (P = (
|
|
1422
|
-
}),
|
|
1423
|
-
var H, V, te, ie, q,
|
|
1424
|
-
const P =
|
|
1417
|
+
}, Oi = () => {
|
|
1418
|
+
}, Mi = (t, e, n, o, r, s, i, c, l, h = Oi) => {
|
|
1419
|
+
const f = O(Ne), m = O(oe), u = O(ae), d = O(Eo), a = O(gt), I = O(Ee), g = m.getUnit(o), p = ee((R) => {
|
|
1420
|
+
var y, P;
|
|
1421
|
+
return (P = (y = g == null ? void 0 : g.getSheetBySheetId(R)) == null ? void 0 : y.getName()) != null ? P : "";
|
|
1422
|
+
}), C = le(() => p(r), [p, r]), S = qe(g == null ? void 0 : g.activeSheet$), v = Ke({ activeSheet: S, sheetName: C }), _ = f.getRenderById(o), T = _ == null ? void 0 : _.with(De), w = _ == null ? void 0 : _.with(Lt), A = O(kt), M = ee((R, y) => {
|
|
1423
|
+
var H, V, te, ie, q, Ye;
|
|
1424
|
+
const P = Fi({ editor: l, lexerTreeBuilder: I });
|
|
1425
1425
|
if (!P) return;
|
|
1426
|
-
const { nodeIndex:
|
|
1426
|
+
const { nodeIndex: N, updatingRefIndex: E, sequenceNodes: F, offset: x } = P;
|
|
1427
1427
|
if (n.current === we.NEED_ADD)
|
|
1428
1428
|
if (x !== 0) {
|
|
1429
|
-
if (
|
|
1429
|
+
if (N === -1 && F.length)
|
|
1430
1430
|
return;
|
|
1431
|
-
const W =
|
|
1431
|
+
const W = R[R.length - 1], Z = F.splice(N + 1), fe = (H = W.sheetId) != null ? H : r, he = {
|
|
1432
1432
|
range: W,
|
|
1433
1433
|
unitId: (V = W.unitId) != null ? V : o,
|
|
1434
1434
|
sheetName: p(fe)
|
|
1435
|
-
}, de =
|
|
1435
|
+
}, de = yt([he], i && fe !== r, C);
|
|
1436
1436
|
F.push({ token: de[0], nodeType: z.REFERENCE });
|
|
1437
|
-
const Fe = [...F, ...Z], vt =
|
|
1438
|
-
h(vt,
|
|
1437
|
+
const Fe = [...F, ...Z], vt = tn(Fe);
|
|
1438
|
+
h(vt, Ti(F), y);
|
|
1439
1439
|
} else {
|
|
1440
|
-
const W =
|
|
1440
|
+
const W = R[R.length - 1], Z = (te = W.sheetId) != null ? te : r, fe = {
|
|
1441
1441
|
range: W,
|
|
1442
1442
|
unitId: (ie = W.unitId) != null ? ie : o,
|
|
1443
1443
|
sheetName: p(Z)
|
|
1444
|
-
}, re =
|
|
1444
|
+
}, re = yt([fe], i && Z !== r);
|
|
1445
1445
|
F.unshift({ token: re[0], nodeType: z.REFERENCE });
|
|
1446
|
-
const de =
|
|
1447
|
-
h(de, re[0].length,
|
|
1446
|
+
const de = tn(F);
|
|
1447
|
+
h(de, re[0].length, y);
|
|
1448
1448
|
}
|
|
1449
1449
|
else if (n.current === we.EDIT_OTHER_SHEET_REFERENCE) {
|
|
1450
|
-
const W =
|
|
1450
|
+
const W = R.pop();
|
|
1451
1451
|
if (!W) return;
|
|
1452
|
-
const Z = F[
|
|
1452
|
+
const Z = F[N];
|
|
1453
1453
|
if (typeof Z == "object" && Z.nodeType === z.REFERENCE) {
|
|
1454
1454
|
const fe = Z.token;
|
|
1455
|
-
Z.token =
|
|
1455
|
+
Z.token = C === (S == null ? void 0 : S.getName()) ? pe(W) : ht(S.getName(), W);
|
|
1456
1456
|
const he = x + (Z.token.length - fe.length);
|
|
1457
|
-
h(
|
|
1457
|
+
h(kr(F), he, y);
|
|
1458
1458
|
}
|
|
1459
1459
|
} else {
|
|
1460
|
-
const W = [...
|
|
1460
|
+
const W = [...R];
|
|
1461
1461
|
if (E !== -1) {
|
|
1462
1462
|
const Y = W.pop();
|
|
1463
1463
|
Y && W.splice(E, 0, Y);
|
|
1464
1464
|
}
|
|
1465
1465
|
let Z = 0;
|
|
1466
1466
|
const fe = F.map((Y) => {
|
|
1467
|
-
var me,
|
|
1467
|
+
var me, ke, Oe;
|
|
1468
1468
|
if (typeof Y == "string")
|
|
1469
1469
|
return Y;
|
|
1470
1470
|
if (Y.nodeType === z.REFERENCE) {
|
|
1471
|
-
const Me =
|
|
1472
|
-
if (Me.sheetName || (Me.sheetName =
|
|
1471
|
+
const Me = ot(Y.token);
|
|
1472
|
+
if (Me.sheetName || (Me.sheetName = C), i && ((me = v.current.activeSheet) == null ? void 0 : me.getName()) !== Me.sheetName)
|
|
1473
1473
|
return Y.token;
|
|
1474
1474
|
const Se = W[Z];
|
|
1475
1475
|
if (Z++, !Se)
|
|
1476
1476
|
return "";
|
|
1477
|
-
const _t = (
|
|
1477
|
+
const _t = (ke = Se.sheetId) != null ? ke : r, qt = {
|
|
1478
1478
|
range: Se,
|
|
1479
1479
|
unitId: (Oe = Se.unitId) != null ? Oe : o,
|
|
1480
1480
|
sheetName: p(_t)
|
|
1481
1481
|
};
|
|
1482
|
-
return
|
|
1482
|
+
return yt([qt], i, C)[0];
|
|
1483
1483
|
}
|
|
1484
1484
|
return Y.token;
|
|
1485
1485
|
});
|
|
1486
1486
|
let he = "", re;
|
|
1487
1487
|
fe.forEach((Y, me) => {
|
|
1488
|
-
he += Y, me ===
|
|
1488
|
+
he += Y, me === N && (re = he.length);
|
|
1489
1489
|
});
|
|
1490
1490
|
const de = [];
|
|
1491
|
-
for (let Y = Z; Y <=
|
|
1492
|
-
const me =
|
|
1491
|
+
for (let Y = Z; Y <= R.length - 1; Y++) {
|
|
1492
|
+
const me = R[Y], ke = (q = me.sheetId) != null ? q : r, Oe = {
|
|
1493
1493
|
range: me,
|
|
1494
|
-
unitId: (
|
|
1495
|
-
sheetName: p(
|
|
1496
|
-
}, Se =
|
|
1494
|
+
unitId: (Ye = me.unitId) != null ? Ye : o,
|
|
1495
|
+
sheetName: p(ke)
|
|
1496
|
+
}, Se = yt([Oe], i && ke !== r, C);
|
|
1497
1497
|
de.push(Se[0]);
|
|
1498
1498
|
}
|
|
1499
|
-
const Fe = F[F.length - 1], vt = Fe && (typeof Fe == "string" ? !1 : Fe.nodeType === z.REFERENCE),
|
|
1500
|
-
h(
|
|
1499
|
+
const Fe = F[F.length - 1], vt = Fe && (typeof Fe == "string" ? !1 : Fe.nodeType === z.REFERENCE), ze = `${he}${de.length && vt ? "," : ""}${de.join(",")}`;
|
|
1500
|
+
h(ze, !de.length && re ? re : ze.length, y);
|
|
1501
1501
|
}
|
|
1502
1502
|
});
|
|
1503
1503
|
L(() => {
|
|
1504
1504
|
if (T && t) {
|
|
1505
|
-
let
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1508
|
-
|
|
1505
|
+
let R = !0;
|
|
1506
|
+
const y = (N, E) => {
|
|
1507
|
+
if (R) {
|
|
1508
|
+
R = !1;
|
|
1509
1509
|
return;
|
|
1510
1510
|
}
|
|
1511
|
-
M(
|
|
1512
|
-
}, P = new
|
|
1513
|
-
return P.add(T.selectionMoving$.subscribe((
|
|
1514
|
-
N
|
|
1515
|
-
})), P.add(T.selectionMoveEnd$.subscribe((
|
|
1516
|
-
N
|
|
1511
|
+
M(N.map((F) => F.rangeWithCoord), E);
|
|
1512
|
+
}, P = new Ve();
|
|
1513
|
+
return P.add(T.selectionMoving$.subscribe((N) => {
|
|
1514
|
+
y(N, !1);
|
|
1515
|
+
})), P.add(T.selectionMoveEnd$.subscribe((N) => {
|
|
1516
|
+
y(N, !0);
|
|
1517
1517
|
})), () => {
|
|
1518
1518
|
P.dispose();
|
|
1519
1519
|
};
|
|
1520
1520
|
}
|
|
1521
1521
|
}, [t, M, T]), L(() => {
|
|
1522
|
-
if (e && T &&
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1525
|
-
|
|
1522
|
+
if (e && T && l) {
|
|
1523
|
+
const R = new Ve(), y = () => {
|
|
1524
|
+
R.dispose(), T.getSelectionControls().forEach((E, F) => {
|
|
1525
|
+
R.add(
|
|
1526
1526
|
E.selectionScaling$.subscribe((x) => {
|
|
1527
1527
|
const H = T.getSelectionDataWithStyle().map((te) => te.rangeWithCoord), V = H[F];
|
|
1528
1528
|
x.sheetId = V.sheetId, x.unitId = V.unitId, H[F] = x, M(H, !1);
|
|
1529
1529
|
})
|
|
1530
|
-
),
|
|
1530
|
+
), R.add(
|
|
1531
1531
|
E.selectionMoving$.subscribe((x) => {
|
|
1532
1532
|
const H = T.getSelectionDataWithStyle().map((te) => te.rangeWithCoord), V = H[F];
|
|
1533
1533
|
x.sheetId = V.sheetId, x.unitId = V.unitId, H[F] = x, M(H, !0);
|
|
1534
1534
|
})
|
|
1535
1535
|
);
|
|
1536
1536
|
});
|
|
1537
|
-
}, P =
|
|
1538
|
-
|
|
1537
|
+
}, P = Kr(
|
|
1538
|
+
l.input$,
|
|
1539
1539
|
A.selectionSet$,
|
|
1540
1540
|
T.selectionMoveEnd$
|
|
1541
1541
|
).pipe(
|
|
1542
|
-
|
|
1542
|
+
bs(50)
|
|
1543
1543
|
).subscribe(() => {
|
|
1544
|
-
|
|
1544
|
+
y();
|
|
1545
1545
|
});
|
|
1546
1546
|
return () => {
|
|
1547
|
-
P.unsubscribe(),
|
|
1547
|
+
P.unsubscribe(), R.dispose();
|
|
1548
1548
|
};
|
|
1549
1549
|
}
|
|
1550
|
-
}, [
|
|
1550
|
+
}, [l, e, M, T, A.selectionSet$]), T == null || T.getSelectionDataWithStyle(), L(() => {
|
|
1551
1551
|
if (c) {
|
|
1552
|
-
const
|
|
1553
|
-
var
|
|
1554
|
-
if (
|
|
1552
|
+
const R = u.onCommandExecuted((y) => {
|
|
1553
|
+
var N;
|
|
1554
|
+
if (y.id !== an.id)
|
|
1555
1555
|
return;
|
|
1556
|
-
const P =
|
|
1556
|
+
const P = y.params;
|
|
1557
1557
|
if (P.extra === "formula-editor" && P.selections.length) {
|
|
1558
1558
|
const E = P.selections[P.selections.length - 1];
|
|
1559
1559
|
if (E) {
|
|
1560
|
-
const F = n.current === we.NEED_ADD, x = ((
|
|
1560
|
+
const F = n.current === we.NEED_ADD, x = ((N = T == null ? void 0 : T.getSelectionDataWithStyle()) != null ? N : []).map((H) => H.rangeWithCoord);
|
|
1561
1561
|
F ? x.push(E.range) : x[x.length - 1] = E.range, M(x, !0);
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
1564
|
});
|
|
1565
1565
|
return () => {
|
|
1566
|
-
|
|
1566
|
+
R.dispose();
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
|
-
}, [
|
|
1570
|
-
if (!
|
|
1569
|
+
}, [u, l, n, I, c, M, T]), L(() => {
|
|
1570
|
+
if (!l)
|
|
1571
1571
|
return;
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1572
|
+
const R = d.textSelection$.subscribe((y) => {
|
|
1573
|
+
y.unitId === l.getEditorId() && Do({
|
|
1574
1574
|
unitId: o,
|
|
1575
1575
|
subUnitId: r,
|
|
1576
1576
|
refSelections: s.current,
|
|
1577
|
-
editor:
|
|
1577
|
+
editor: l,
|
|
1578
1578
|
refSelectionsService: A,
|
|
1579
1579
|
refSelectionsRenderService: T,
|
|
1580
1580
|
sheetSkeletonManagerService: w,
|
|
1581
|
-
themeService:
|
|
1581
|
+
themeService: a,
|
|
1582
1582
|
univerInstanceService: m
|
|
1583
1583
|
});
|
|
1584
1584
|
});
|
|
1585
|
-
return () =>
|
|
1586
|
-
}, [d.textSelection$,
|
|
1587
|
-
},
|
|
1588
|
-
const i = O(ae), c = O(be), h = O(
|
|
1585
|
+
return () => R.unsubscribe();
|
|
1586
|
+
}, [d.textSelection$, l, s, T, A, w, r, a, o, m]);
|
|
1587
|
+
}, Ai = (t, e, n, o, r, s) => {
|
|
1588
|
+
const i = O(ae), c = O(be), h = O(Ne).getRenderById(e), f = h == null ? void 0 : h.with(De);
|
|
1589
1589
|
L(() => {
|
|
1590
|
-
if (t &&
|
|
1590
|
+
if (t && f)
|
|
1591
1591
|
if (n) {
|
|
1592
|
-
const m = i.onCommandExecuted((
|
|
1593
|
-
if (
|
|
1594
|
-
const d =
|
|
1595
|
-
for (let
|
|
1596
|
-
|
|
1592
|
+
const m = i.onCommandExecuted((u) => {
|
|
1593
|
+
if (u.id === Ln.id) {
|
|
1594
|
+
const d = f.getSelectionControls().length;
|
|
1595
|
+
for (let a = 1; a <= d; a++)
|
|
1596
|
+
f.clearLastSelection();
|
|
1597
1597
|
setTimeout(() => {
|
|
1598
1598
|
s();
|
|
1599
1599
|
}, 30);
|
|
@@ -1603,10 +1603,10 @@ const Ri = (t, e, n, o) => {
|
|
|
1603
1603
|
m.dispose();
|
|
1604
1604
|
};
|
|
1605
1605
|
} else {
|
|
1606
|
-
const m = i.beforeCommandExecuted((
|
|
1607
|
-
if (
|
|
1606
|
+
const m = i.beforeCommandExecuted((u) => {
|
|
1607
|
+
if (u.id === Ln.id) {
|
|
1608
1608
|
o(!1), r(), s();
|
|
1609
|
-
const d = c.getEditor(
|
|
1609
|
+
const d = c.getEditor(rn);
|
|
1610
1610
|
d == null || d.focus();
|
|
1611
1611
|
}
|
|
1612
1612
|
});
|
|
@@ -1614,8 +1614,8 @@ const Ri = (t, e, n, o) => {
|
|
|
1614
1614
|
m.dispose();
|
|
1615
1615
|
};
|
|
1616
1616
|
}
|
|
1617
|
-
}, [t,
|
|
1618
|
-
},
|
|
1617
|
+
}, [t, f]);
|
|
1618
|
+
}, Pi = (t, e, n) => {
|
|
1619
1619
|
const o = O(Ee), r = j(!0);
|
|
1620
1620
|
L(() => {
|
|
1621
1621
|
if (t) {
|
|
@@ -1629,85 +1629,85 @@ const Ri = (t, e, n, o) => {
|
|
|
1629
1629
|
}, [t]), L(() => {
|
|
1630
1630
|
if (!r.current && e) {
|
|
1631
1631
|
const s = o.checkIfAddBracket(n);
|
|
1632
|
-
e(s === 0 && n.startsWith(
|
|
1632
|
+
e(s === 0 && n.startsWith(so.EQUALS), `${n}`);
|
|
1633
1633
|
}
|
|
1634
1634
|
}, [n, e]);
|
|
1635
|
-
},
|
|
1636
|
-
sheetEmbeddingFormulaEditorActive:
|
|
1637
|
-
sheetEmbeddingFormulaEditorWrap:
|
|
1638
|
-
sheetEmbeddingFormulaEditorText:
|
|
1639
|
-
sheetEmbeddingFormulaEditorError:
|
|
1640
|
-
sheetEmbeddingFormulaEditor:
|
|
1641
|
-
sheetEmbeddingFormulaEditorErrorWrap:
|
|
1642
|
-
},
|
|
1643
|
-
const o = O(
|
|
1644
|
-
s([]), c(""),
|
|
1635
|
+
}, xi = "univer-sheet-embedding-formula-editor-active", wi = "univer-sheet-embedding-formula-editor-wrap", Di = "univer-sheet-embedding-formula-editor-text", Li = "univer-sheet-embedding-formula-editor-error", $i = "univer-sheet-embedding-formula-editor", ki = "univer-sheet-embedding-formula-editor-error-wrap", Qe = {
|
|
1636
|
+
sheetEmbeddingFormulaEditorActive: xi,
|
|
1637
|
+
sheetEmbeddingFormulaEditorWrap: wi,
|
|
1638
|
+
sheetEmbeddingFormulaEditorText: Di,
|
|
1639
|
+
sheetEmbeddingFormulaEditorError: Li,
|
|
1640
|
+
sheetEmbeddingFormulaEditor: $i,
|
|
1641
|
+
sheetEmbeddingFormulaEditorErrorWrap: ki
|
|
1642
|
+
}, Hi = (t, e = [], n) => {
|
|
1643
|
+
const o = O(Ht), [r, s] = $([]), [i, c] = $(""), l = j(-1), h = Ke({ nodes: e }), f = () => {
|
|
1644
|
+
s([]), c(""), l.current = -1;
|
|
1645
1645
|
};
|
|
1646
1646
|
return L(() => {
|
|
1647
1647
|
if (n && t) {
|
|
1648
|
-
const
|
|
1648
|
+
const u = n.input$.pipe(cn(300)).subscribe(() => {
|
|
1649
1649
|
const d = n.getSelectionRanges();
|
|
1650
1650
|
if (d.length === 1) {
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1653
|
-
const g =
|
|
1654
|
-
|
|
1655
|
-
const p =
|
|
1651
|
+
const a = h.current.nodes, I = d[0];
|
|
1652
|
+
if (I.collapsed) {
|
|
1653
|
+
const g = mn(a, I.startOffset - 1, !1);
|
|
1654
|
+
l.current = g;
|
|
1655
|
+
const p = a[g];
|
|
1656
1656
|
if (p && typeof p != "string" && p.nodeType === z.FUNCTION) {
|
|
1657
|
-
|
|
1658
|
-
const
|
|
1659
|
-
s(
|
|
1657
|
+
l.current = g;
|
|
1658
|
+
const C = p.token, S = o.getSearchListByNameFirstLetter(C);
|
|
1659
|
+
s(S), c(C);
|
|
1660
1660
|
return;
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
|
-
|
|
1664
|
+
l.current = -1, c(""), s((a) => a != null && a.length ? [] : a);
|
|
1665
1665
|
});
|
|
1666
1666
|
return () => {
|
|
1667
|
-
|
|
1667
|
+
u.unsubscribe();
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
1670
|
}, [n, t]), L(() => {
|
|
1671
|
-
t ||
|
|
1671
|
+
t || f();
|
|
1672
1672
|
}, [t]), {
|
|
1673
1673
|
searchList: r,
|
|
1674
1674
|
searchText: i,
|
|
1675
|
-
handlerFormulaReplace: (
|
|
1675
|
+
handlerFormulaReplace: (u) => {
|
|
1676
1676
|
const d = [...h.current.nodes];
|
|
1677
|
-
if (
|
|
1678
|
-
const
|
|
1679
|
-
let g = (typeof
|
|
1680
|
-
return d.push(
|
|
1677
|
+
if (l.current !== -1) {
|
|
1678
|
+
const a = d.splice(l.current + 1), I = d.pop() || "";
|
|
1679
|
+
let g = (typeof I == "string" ? I.length : I.token.length) - u.length;
|
|
1680
|
+
return d.push(u), a[0] !== nt.OPEN_BRACKET && (d.push(nt.OPEN_BRACKET), g--), { text: tn([...d, ...a]), offset: g };
|
|
1681
1681
|
}
|
|
1682
1682
|
},
|
|
1683
|
-
reset:
|
|
1683
|
+
reset: f
|
|
1684
1684
|
};
|
|
1685
|
-
},
|
|
1686
|
-
formulaSearchFunction:
|
|
1687
|
-
formulaSearchFunctionItem:
|
|
1688
|
-
formulaSearchFunctionItemName:
|
|
1689
|
-
formulaSearchFunctionItemNameLight:
|
|
1690
|
-
formulaSearchFunctionItemDesc:
|
|
1691
|
-
formulaSearchFunctionItemActive:
|
|
1692
|
-
},
|
|
1693
|
-
},
|
|
1694
|
-
function
|
|
1695
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i =
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1685
|
+
}, Wi = "univer-formula-search-function", Ui = "univer-formula-search-function-item", Vi = "univer-formula-search-function-item-name", Bi = "univer-formula-search-function-item-name-light", qi = "univer-formula-search-function-item-desc", ji = "univer-formula-search-function-item-active", Pe = {
|
|
1686
|
+
formulaSearchFunction: Wi,
|
|
1687
|
+
formulaSearchFunctionItem: Ui,
|
|
1688
|
+
formulaSearchFunctionItemName: Vi,
|
|
1689
|
+
formulaSearchFunctionItemNameLight: Bi,
|
|
1690
|
+
formulaSearchFunctionItemDesc: qi,
|
|
1691
|
+
formulaSearchFunctionItemActive: ji
|
|
1692
|
+
}, Ki = () => {
|
|
1693
|
+
}, Yi = Te(zi);
|
|
1694
|
+
function zi(t, e) {
|
|
1695
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Ki } = t, c = s.getEditorId(), l = O(Ut), h = O(ae), { searchList: f, searchText: m, handlerFormulaReplace: u, reset: d } = Hi(n, o, s), a = le(() => !!f.length, [f]), I = j(void 0), [g, p] = $(0), C = j(!1), [S] = wo(c, a, [m, f]), v = Ke({ searchList: f, active: g }), _ = (R) => {
|
|
1696
|
+
const y = u(R);
|
|
1697
|
+
y && (d(), r(y));
|
|
1698
1698
|
};
|
|
1699
|
-
function T(
|
|
1700
|
-
|
|
1699
|
+
function T(R) {
|
|
1700
|
+
C.current && p(R);
|
|
1701
1701
|
}
|
|
1702
1702
|
function w() {
|
|
1703
|
-
|
|
1703
|
+
C.current && p(-1);
|
|
1704
1704
|
}
|
|
1705
1705
|
L(() => {
|
|
1706
|
-
if (!
|
|
1706
|
+
if (!f.length)
|
|
1707
1707
|
return;
|
|
1708
|
-
const
|
|
1708
|
+
const R = `sheet.formula-embedding-editor.search_function.${c}`, y = new Ve(), P = (N) => {
|
|
1709
1709
|
const { searchList: E, active: F } = v.current;
|
|
1710
|
-
switch (
|
|
1710
|
+
switch (N) {
|
|
1711
1711
|
case D.ARROW_UP: {
|
|
1712
1712
|
p((x) => {
|
|
1713
1713
|
const H = Math.max(0, x - 1);
|
|
@@ -1725,7 +1725,7 @@ function ji(t, e) {
|
|
|
1725
1725
|
case D.TAB:
|
|
1726
1726
|
case D.ENTER: {
|
|
1727
1727
|
const x = E[F];
|
|
1728
|
-
|
|
1728
|
+
_(x.name);
|
|
1729
1729
|
break;
|
|
1730
1730
|
}
|
|
1731
1731
|
case D.ESC: {
|
|
@@ -1734,88 +1734,88 @@ function ji(t, e) {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
};
|
|
1737
|
-
return
|
|
1738
|
-
id:
|
|
1737
|
+
return y.add(h.registerCommand({
|
|
1738
|
+
id: R,
|
|
1739
1739
|
type: Ie.OPERATION,
|
|
1740
|
-
handler(
|
|
1740
|
+
handler(N, E) {
|
|
1741
1741
|
const { keyCode: F } = E;
|
|
1742
1742
|
P(F);
|
|
1743
1743
|
}
|
|
1744
|
-
})), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((
|
|
1745
|
-
id:
|
|
1746
|
-
binding:
|
|
1744
|
+
})), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((N) => ({
|
|
1745
|
+
id: R,
|
|
1746
|
+
binding: N,
|
|
1747
1747
|
preconditions: () => !0,
|
|
1748
1748
|
priority: 1e3,
|
|
1749
1749
|
staticParameters: {
|
|
1750
|
-
eventType:
|
|
1751
|
-
keyCode:
|
|
1750
|
+
eventType: ye.Keyboard,
|
|
1751
|
+
keyCode: N
|
|
1752
1752
|
}
|
|
1753
|
-
})).forEach((
|
|
1754
|
-
|
|
1753
|
+
})).forEach((N) => {
|
|
1754
|
+
y.add(l.registerShortcut(N));
|
|
1755
1755
|
}), () => {
|
|
1756
|
-
|
|
1756
|
+
y.dispose();
|
|
1757
1757
|
};
|
|
1758
|
-
}, [
|
|
1759
|
-
function A(
|
|
1758
|
+
}, [f]);
|
|
1759
|
+
function A(R) {
|
|
1760
1760
|
var ie;
|
|
1761
|
-
const
|
|
1762
|
-
if (!
|
|
1763
|
-
const P =
|
|
1761
|
+
const y = (ie = I.current) == null ? void 0 : ie.querySelectorAll(`.${Pe.formulaSearchFunctionItem}`)[R];
|
|
1762
|
+
if (!y) return;
|
|
1763
|
+
const P = y.parentNode;
|
|
1764
1764
|
if (!P) return;
|
|
1765
|
-
const E = P.getBoundingClientRect().top, F = P.offsetHeight, x =
|
|
1765
|
+
const E = P.getBoundingClientRect().top, F = P.offsetHeight, x = y.getBoundingClientRect(), H = x.top, V = x.height;
|
|
1766
1766
|
if (H >= 0 && H > E && H - E + V <= F)
|
|
1767
1767
|
return;
|
|
1768
|
-
const te =
|
|
1768
|
+
const te = y.offsetTop - (F - V) / 2;
|
|
1769
1769
|
P.scrollTo({
|
|
1770
1770
|
top: te,
|
|
1771
1771
|
behavior: "smooth"
|
|
1772
1772
|
});
|
|
1773
1773
|
}
|
|
1774
1774
|
const M = le(() => {
|
|
1775
|
-
let
|
|
1775
|
+
let R = "";
|
|
1776
1776
|
return () => {
|
|
1777
|
-
clearTimeout(
|
|
1778
|
-
|
|
1777
|
+
clearTimeout(R), C.current = !0, R = setTimeout(() => {
|
|
1778
|
+
C.current = !1;
|
|
1779
1779
|
}, 300);
|
|
1780
1780
|
};
|
|
1781
1781
|
}, []);
|
|
1782
|
-
return
|
|
1782
|
+
return f.length > 0 && a && /* @__PURE__ */ b(So, { portal: !0, anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ b(
|
|
1783
1783
|
"ul",
|
|
1784
1784
|
{
|
|
1785
1785
|
className: Pe.formulaSearchFunction,
|
|
1786
|
-
ref: (
|
|
1787
|
-
|
|
1786
|
+
ref: (R) => {
|
|
1787
|
+
I.current = R, e && (e.current = R);
|
|
1788
1788
|
},
|
|
1789
|
-
children:
|
|
1789
|
+
children: f.map((R, y) => /* @__PURE__ */ k(
|
|
1790
1790
|
"li",
|
|
1791
1791
|
{
|
|
1792
|
-
className: g ===
|
|
1792
|
+
className: g === y ? `
|
|
1793
1793
|
${Pe.formulaSearchFunctionItem}
|
|
1794
1794
|
${Pe.formulaSearchFunctionItemActive}
|
|
1795
1795
|
` : Pe.formulaSearchFunctionItem,
|
|
1796
|
-
onMouseEnter: () => T(
|
|
1796
|
+
onMouseEnter: () => T(y),
|
|
1797
1797
|
onMouseLeave: w,
|
|
1798
1798
|
onMouseMove: M,
|
|
1799
1799
|
onClick: () => {
|
|
1800
|
-
|
|
1800
|
+
_(R.name), s && s.focus();
|
|
1801
1801
|
},
|
|
1802
1802
|
children: [
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemNameLight, children:
|
|
1805
|
-
/* @__PURE__ */ b("span", { children:
|
|
1803
|
+
/* @__PURE__ */ k("span", { className: Pe.formulaSearchFunctionItemName, children: [
|
|
1804
|
+
/* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemNameLight, children: R.name.substring(0, m.length) }),
|
|
1805
|
+
/* @__PURE__ */ b("span", { children: R.name.slice(m.length) })
|
|
1806
1806
|
] }),
|
|
1807
|
-
/* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemDesc, children:
|
|
1807
|
+
/* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemDesc, children: R.desc })
|
|
1808
1808
|
]
|
|
1809
1809
|
},
|
|
1810
|
-
|
|
1810
|
+
R.name
|
|
1811
1811
|
))
|
|
1812
1812
|
}
|
|
1813
1813
|
) });
|
|
1814
1814
|
}
|
|
1815
|
-
const
|
|
1815
|
+
const Gi = (t) => t.startsWith(so.EQUALS) ? t.slice(1) : "", Bn = () => {
|
|
1816
1816
|
};
|
|
1817
|
-
function
|
|
1818
|
-
var
|
|
1817
|
+
function Zi(t) {
|
|
1818
|
+
var vn, _n;
|
|
1819
1819
|
const {
|
|
1820
1820
|
errorText: e,
|
|
1821
1821
|
initValue: n,
|
|
@@ -1823,66 +1823,66 @@ function Yi(t) {
|
|
|
1823
1823
|
subUnitId: r,
|
|
1824
1824
|
isFocus: s = !0,
|
|
1825
1825
|
isSupportAcrossSheet: i = !1,
|
|
1826
|
-
onFocus: c =
|
|
1827
|
-
onBlur:
|
|
1826
|
+
onFocus: c = Bn,
|
|
1827
|
+
onBlur: l = Bn,
|
|
1828
1828
|
onChange: h,
|
|
1829
|
-
onVerify:
|
|
1829
|
+
onVerify: f,
|
|
1830
1830
|
actions: m,
|
|
1831
|
-
className:
|
|
1831
|
+
className: u,
|
|
1832
1832
|
editorId: d,
|
|
1833
|
-
moveCursor:
|
|
1834
|
-
onFormulaSelectingChange:
|
|
1833
|
+
moveCursor: a = !0,
|
|
1834
|
+
onFormulaSelectingChange: I,
|
|
1835
1835
|
keyboradEventConfig: g,
|
|
1836
1836
|
onMoveInEditor: p,
|
|
1837
|
-
resetSelectionOnBlur:
|
|
1838
|
-
autoScrollbar:
|
|
1837
|
+
resetSelectionOnBlur: C = !0,
|
|
1838
|
+
autoScrollbar: S = !0,
|
|
1839
1839
|
isSingle: v = !0,
|
|
1840
|
-
disableSelectionOnClick:
|
|
1840
|
+
disableSelectionOnClick: _ = !1,
|
|
1841
1841
|
disableContextMenu: T,
|
|
1842
1842
|
style: w
|
|
1843
|
-
} = t, A = O(be), M = j(null),
|
|
1843
|
+
} = t, A = O(be), M = j(null), R = ee(h);
|
|
1844
1844
|
m && (m.handleOutClick = (X, Q) => {
|
|
1845
1845
|
M.current && !M.current.contains(X.target) && Q();
|
|
1846
1846
|
});
|
|
1847
|
-
const
|
|
1848
|
-
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
}, [W,
|
|
1853
|
-
const
|
|
1854
|
-
if (!
|
|
1847
|
+
const y = ee(I), P = j(null), N = j(void 0), E = N.current, [F, x] = $(s), H = j(null), V = le(() => d != null ? d : tr(`${Rr}-${nr(4)}`), []), te = le(() => e !== void 0, [e]), ie = O(oe), q = ie.getUnit(V);
|
|
1848
|
+
qe(q == null ? void 0 : q.change$);
|
|
1849
|
+
const Ye = vi(), W = or.transform.getPlainText((_n = (vn = q == null ? void 0 : q.getBody()) == null ? void 0 : vn.dataStream) != null ? _n : ""), Z = Ke(W), fe = le(() => Gi(W), [W]), he = le(() => Ye(fe), [fe, Ye]), { isSelecting: re, isSelectingRef: de } = Ci({ unitId: o, subUnitId: r, editorId: V, isFocus: F, disableOnClick: _ }), Fe = j(""), ze = O(Ne).getRenderById(V), Y = ze == null ? void 0 : ze.with(ao), me = Y == null ? void 0 : Y.isFocusing, ke = le(() => ie.getCurrentTypeOfUnit$(ue.UNIVER_DOC), [ie]), Oe = qe(ke), Me = (Oe == null ? void 0 : Oe.getUnitId()) === V, Se = j([]), _t = re;
|
|
1850
|
+
ds(() => {
|
|
1851
|
+
R(W);
|
|
1852
|
+
}, [W, R]);
|
|
1853
|
+
const qt = Lo("="), Sn = Ri(o, r), Ge = ee((X, Q = !0, Ce, ve) => {
|
|
1854
|
+
if (!N.current) return;
|
|
1855
1855
|
Fe.current = X;
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
|
|
1856
|
+
const Rt = X[0] === "=" ? X.slice(1) : "", Ae = Ye(Rt), Yo = Ae.reduce((He, Et) => typeof Et == "object" ? `${He}${Et.token}` : `${He}${Et}`, ""), It = qt(
|
|
1857
|
+
N.current,
|
|
1858
|
+
Yo === Rt ? Ae : [],
|
|
1859
1859
|
Q,
|
|
1860
1860
|
ve
|
|
1861
1861
|
);
|
|
1862
|
-
if (Se.current =
|
|
1863
|
-
const
|
|
1864
|
-
if ((
|
|
1862
|
+
if (Se.current = It, Ce) {
|
|
1863
|
+
const He = ve != null ? ve : E == null ? void 0 : E.getSelectionRanges();
|
|
1864
|
+
if ((He == null ? void 0 : He.length) !== 1)
|
|
1865
1865
|
return;
|
|
1866
|
-
const
|
|
1867
|
-
if (
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1866
|
+
const zo = He[0].startOffset - 1, Go = mn(Ae, zo, !1), Rn = To(Ae, Go);
|
|
1867
|
+
if (Rn >= 0) {
|
|
1868
|
+
const In = It.splice(Rn, 1)[0];
|
|
1869
|
+
In && It.push(In);
|
|
1870
1870
|
}
|
|
1871
|
-
|
|
1871
|
+
Sn(F ? It : [], N.current);
|
|
1872
1872
|
}
|
|
1873
1873
|
});
|
|
1874
1874
|
L(() => {
|
|
1875
|
-
F &&
|
|
1875
|
+
F && Ge(W, !1, !0);
|
|
1876
1876
|
}, [F]), L(() => {
|
|
1877
1877
|
if (F) {
|
|
1878
1878
|
if (Fe.current === W) return;
|
|
1879
|
-
|
|
1879
|
+
Ge(W, !1, !0);
|
|
1880
1880
|
}
|
|
1881
|
-
}, [W]),
|
|
1882
|
-
const
|
|
1881
|
+
}, [W]), Pi(F, f, W);
|
|
1882
|
+
const Ze = di(E), Cn = Ni(F, o, r);
|
|
1883
1883
|
L(() => {
|
|
1884
|
-
|
|
1885
|
-
}, [
|
|
1884
|
+
y(re);
|
|
1885
|
+
}, [y, re]), Qr(F, g, E), Ot(() => {
|
|
1886
1886
|
let X;
|
|
1887
1887
|
if (H.current) {
|
|
1888
1888
|
X = A.register({
|
|
@@ -1902,26 +1902,26 @@ function Yi(t) {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
}, H.current);
|
|
1904
1904
|
const Q = A.getEditor(V);
|
|
1905
|
-
|
|
1905
|
+
N.current = Q, Ge(n, !1, !0);
|
|
1906
1906
|
}
|
|
1907
1907
|
return () => {
|
|
1908
1908
|
X == null || X.dispose();
|
|
1909
1909
|
};
|
|
1910
|
-
}, []),
|
|
1911
|
-
s ? (x(s),
|
|
1912
|
-
}, [s, E,
|
|
1913
|
-
const { checkScrollBar:
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1910
|
+
}, []), Ot(() => {
|
|
1911
|
+
s ? (x(s), Ze()) : (C && (E == null || E.blur(), Cn()), x(s));
|
|
1912
|
+
}, [s, E, Ze, Cn, C]);
|
|
1913
|
+
const { checkScrollBar: Bo } = Jr(E, v, S);
|
|
1914
|
+
yi(F, !!(re && Me), o, T), bi(F && a, _t, E, p);
|
|
1915
|
+
const qo = ee((X, Q, Ce) => {
|
|
1916
1916
|
if (!me)
|
|
1917
1917
|
return;
|
|
1918
1918
|
const ve = Q !== -1 ? [{ startOffset: Q + 1, endOffset: Q + 1, collapsed: !0 }] : void 0;
|
|
1919
|
-
|
|
1920
|
-
const
|
|
1921
|
-
Ae == null || Ae.scrollToRange({ ...
|
|
1922
|
-
}, 50),
|
|
1919
|
+
Ge(`=${X}`, !0, Ce, ve), Ce && (Ze(), Q !== -1 && setTimeout(() => {
|
|
1920
|
+
const Rt = { startOffset: Q + 1, endOffset: Q + 1 }, Ae = E == null ? void 0 : E.render.with(es);
|
|
1921
|
+
Ae == null || Ae.scrollToRange({ ...Rt, collapsed: !0 });
|
|
1922
|
+
}, 50), Bo());
|
|
1923
1923
|
});
|
|
1924
|
-
|
|
1924
|
+
Mi(
|
|
1925
1925
|
F && !!(re && Me),
|
|
1926
1926
|
F,
|
|
1927
1927
|
de,
|
|
@@ -1931,11 +1931,11 @@ function Yi(t) {
|
|
|
1931
1931
|
i,
|
|
1932
1932
|
!!_t,
|
|
1933
1933
|
E,
|
|
1934
|
-
|
|
1935
|
-
),
|
|
1936
|
-
|
|
1934
|
+
qo
|
|
1935
|
+
), Ai(F && !!(re && Me), o, i, x, l, () => {
|
|
1936
|
+
Ge(Z.current, !1, !0);
|
|
1937
1937
|
});
|
|
1938
|
-
const
|
|
1938
|
+
const jo = (X) => {
|
|
1939
1939
|
if (X) {
|
|
1940
1940
|
const Q = E == null ? void 0 : E.getSelectionRanges();
|
|
1941
1941
|
if (Q && Q.length === 1) {
|
|
@@ -1947,64 +1947,64 @@ function Yi(t) {
|
|
|
1947
1947
|
}, 30);
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
|
-
|
|
1950
|
+
Ze(), Ge(`=${X.text}`);
|
|
1951
1951
|
}
|
|
1952
|
-
},
|
|
1953
|
-
x(!0), c(),
|
|
1952
|
+
}, Ko = () => {
|
|
1953
|
+
x(!0), c(), Ze();
|
|
1954
1954
|
};
|
|
1955
|
-
return /* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ k("div", { style: w, className: Hn(Qe.sheetEmbeddingFormulaEditor, u), children: [
|
|
1956
1956
|
/* @__PURE__ */ b(
|
|
1957
1957
|
"div",
|
|
1958
1958
|
{
|
|
1959
|
-
className:
|
|
1960
|
-
[
|
|
1961
|
-
[
|
|
1959
|
+
className: Hn(Qe.sheetEmbeddingFormulaEditorWrap, {
|
|
1960
|
+
[Qe.sheetEmbeddingFormulaEditorActive]: F,
|
|
1961
|
+
[Qe.sheetEmbeddingFormulaEditorError]: te
|
|
1962
1962
|
}),
|
|
1963
1963
|
ref: M,
|
|
1964
1964
|
children: /* @__PURE__ */ b(
|
|
1965
1965
|
"div",
|
|
1966
1966
|
{
|
|
1967
|
-
className:
|
|
1967
|
+
className: Qe.sheetEmbeddingFormulaEditorText,
|
|
1968
1968
|
ref: H,
|
|
1969
|
-
onMouseUp:
|
|
1969
|
+
onMouseUp: Ko
|
|
1970
1970
|
}
|
|
1971
1971
|
)
|
|
1972
1972
|
}
|
|
1973
1973
|
),
|
|
1974
|
-
e !== void 0 ? /* @__PURE__ */ b("div", { className:
|
|
1974
|
+
e !== void 0 ? /* @__PURE__ */ b("div", { className: Qe.sheetEmbeddingFormulaEditorErrorWrap, children: e }) : null,
|
|
1975
1975
|
E ? /* @__PURE__ */ b(
|
|
1976
|
-
|
|
1976
|
+
hi,
|
|
1977
1977
|
{
|
|
1978
1978
|
editor: E,
|
|
1979
1979
|
isFocus: F,
|
|
1980
1980
|
formulaText: W,
|
|
1981
|
-
onClose: () =>
|
|
1981
|
+
onClose: () => Ze()
|
|
1982
1982
|
}
|
|
1983
1983
|
) : null,
|
|
1984
1984
|
E ? /* @__PURE__ */ b(
|
|
1985
|
-
|
|
1985
|
+
Yi,
|
|
1986
1986
|
{
|
|
1987
1987
|
isFocus: F,
|
|
1988
1988
|
sequenceNodes: he,
|
|
1989
|
-
onSelect:
|
|
1989
|
+
onSelect: jo,
|
|
1990
1990
|
ref: P,
|
|
1991
1991
|
editor: E
|
|
1992
1992
|
}
|
|
1993
1993
|
) : null
|
|
1994
1994
|
] });
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const r = O(Ee), s =
|
|
1996
|
+
function Xi(t, e, n, o) {
|
|
1997
|
+
const r = O(Ee), s = Lo(""), i = qe(t == null ? void 0 : t.getDocumentDataModel().change$), [c, l] = $([]), h = O(Ir), f = j(""), m = O(oe);
|
|
1998
1998
|
return L(() => {
|
|
1999
1999
|
if (!t) return;
|
|
2000
|
-
const
|
|
2001
|
-
if (
|
|
2000
|
+
const u = t.getDocumentDataModel().getPlainText();
|
|
2001
|
+
if (f.current === u)
|
|
2002
2002
|
return;
|
|
2003
|
-
|
|
2004
|
-
const d = r.sequenceNodesBuilder(
|
|
2005
|
-
|
|
2003
|
+
f.current = u;
|
|
2004
|
+
const d = r.sequenceNodesBuilder(u);
|
|
2005
|
+
l(d != null ? d : []);
|
|
2006
2006
|
}, [i, t, r]), L(() => {
|
|
2007
|
-
var
|
|
2007
|
+
var a, I;
|
|
2008
2008
|
if (!t) return;
|
|
2009
2009
|
if (!e) {
|
|
2010
2010
|
const g = t.getDocumentData();
|
|
@@ -2012,18 +2012,18 @@ function zi(t, e, n, o) {
|
|
|
2012
2012
|
...g,
|
|
2013
2013
|
body: {
|
|
2014
2014
|
...g.body,
|
|
2015
|
-
dataStream: (
|
|
2015
|
+
dataStream: (I = (a = g.body) == null ? void 0 : a.dataStream) != null ? I : "",
|
|
2016
2016
|
textRuns: []
|
|
2017
2017
|
}
|
|
2018
2018
|
});
|
|
2019
2019
|
return;
|
|
2020
2020
|
}
|
|
2021
|
-
const
|
|
2022
|
-
return
|
|
2023
|
-
const p =
|
|
2024
|
-
if (!p.sheetName && o !== (
|
|
2021
|
+
const u = s(t, c, !1), d = new Ve();
|
|
2022
|
+
return u.forEach((g) => {
|
|
2023
|
+
const p = ot(g.token), C = m.getCurrentUnitForType(ue.UNIVER_SHEET), S = C == null ? void 0 : C.getActiveSheet();
|
|
2024
|
+
if (!p.sheetName && o !== (S == null ? void 0 : S.getSheetId()) || p.sheetName && (S == null ? void 0 : S.getName()) !== p.sheetName)
|
|
2025
2025
|
return;
|
|
2026
|
-
const v = new
|
|
2026
|
+
const v = new sn(g.themeColor).toRgb(), _ = h.addShape({
|
|
2027
2027
|
range: p.range,
|
|
2028
2028
|
style: {
|
|
2029
2029
|
stroke: g.themeColor,
|
|
@@ -2032,49 +2032,49 @@ function zi(t, e, n, o) {
|
|
|
2032
2032
|
},
|
|
2033
2033
|
primary: null
|
|
2034
2034
|
});
|
|
2035
|
-
|
|
2035
|
+
_ && d.add(() => h.removeShape(_));
|
|
2036
2036
|
}), () => {
|
|
2037
2037
|
d.dispose();
|
|
2038
2038
|
};
|
|
2039
2039
|
}, [t, e, s, h, c]), { sequenceNodes: c };
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2042
|
-
const e = O(
|
|
2043
|
-
const
|
|
2044
|
-
if (!
|
|
2045
|
-
const d =
|
|
2046
|
-
range:
|
|
2041
|
+
function Qi(t) {
|
|
2042
|
+
const e = O(ln), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = t, c = O(oe).getUnit(o, ue.UNIVER_SHEET), l = ee(s), h = ee((f, m) => {
|
|
2043
|
+
const u = c == null ? void 0 : c.getActiveSheet();
|
|
2044
|
+
if (!u || !n && u.getSheetId() !== r || !(f != null && f.length)) return;
|
|
2045
|
+
const d = f.map((a) => ({
|
|
2046
|
+
range: a.range,
|
|
2047
2047
|
unitId: o,
|
|
2048
|
-
sheetName:
|
|
2048
|
+
sheetName: u.getSheetId() === r ? "" : u.getName()
|
|
2049
2049
|
}));
|
|
2050
|
-
|
|
2050
|
+
l(d, m);
|
|
2051
2051
|
});
|
|
2052
2052
|
L(() => {
|
|
2053
|
-
const
|
|
2054
|
-
return
|
|
2053
|
+
const f = new Ve();
|
|
2054
|
+
return f.add(e.selectionMoveStart$.subscribe((m) => {
|
|
2055
2055
|
h(m, !0);
|
|
2056
|
-
})),
|
|
2056
|
+
})), f.add(e.selectionMoving$.subscribe((m) => {
|
|
2057
2057
|
h(m, !1);
|
|
2058
|
-
})),
|
|
2058
|
+
})), f.add(e.selectionMoveEnd$.subscribe((m) => {
|
|
2059
2059
|
h(m, !1);
|
|
2060
2060
|
})), () => {
|
|
2061
|
-
|
|
2061
|
+
f.dispose();
|
|
2062
2062
|
};
|
|
2063
2063
|
}, [h, e.selectionMoveEnd$, e.selectionMoveStart$, e.selectionMoving$]);
|
|
2064
2064
|
}
|
|
2065
|
-
const
|
|
2066
|
-
sheetRangeSelectorIcon:
|
|
2067
|
-
sheetRangeSelectorDialog:
|
|
2068
|
-
sheetRangeSelectorDialogItem:
|
|
2069
|
-
sheetRangeSelectorDialogItemDelete:
|
|
2070
|
-
},
|
|
2065
|
+
const Ji = "univer-sheet-range-selector-icon", ec = "univer-sheet-range-selector-dialog", tc = "univer-sheet-range-selector-dialog-item", nc = "univer-sheet-range-selector-dialog-item-delete", Tt = {
|
|
2066
|
+
sheetRangeSelectorIcon: Ji,
|
|
2067
|
+
sheetRangeSelectorDialog: ec,
|
|
2068
|
+
sheetRangeSelectorDialogItem: tc,
|
|
2069
|
+
sheetRangeSelectorDialogItemDelete: nc
|
|
2070
|
+
}, qn = (t) => !t.some((n) => {
|
|
2071
2071
|
if (typeof n == "string") {
|
|
2072
|
-
if (n !==
|
|
2072
|
+
if (n !== nt.COMMA)
|
|
2073
2073
|
return !0;
|
|
2074
2074
|
} else if (n.nodeType !== z.REFERENCE)
|
|
2075
2075
|
return !0;
|
|
2076
2076
|
return !1;
|
|
2077
|
-
}),
|
|
2077
|
+
}), oc = (t) => {
|
|
2078
2078
|
if (t.endColumn < t.startColumn) {
|
|
2079
2079
|
const e = t.endColumn;
|
|
2080
2080
|
t.endColumn = t.startColumn, t.startColumn = e;
|
|
@@ -2085,124 +2085,124 @@ const Zi = "univer-sheet-range-selector-icon", Xi = "univer-sheet-range-selector
|
|
|
2085
2085
|
}
|
|
2086
2086
|
return t;
|
|
2087
2087
|
};
|
|
2088
|
-
function
|
|
2089
|
-
const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose:
|
|
2088
|
+
function rc(t) {
|
|
2089
|
+
const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose: l, onShowBySelection: h } = t, f = O(je), m = O(Ee), [u, d] = $([]), [a, I] = $(0), g = j(null);
|
|
2090
2090
|
L(() => {
|
|
2091
2091
|
if (e && n.length) {
|
|
2092
|
-
const v = n.map((
|
|
2093
|
-
d(v),
|
|
2092
|
+
const v = n.map((_) => _.sheetName ? ht(_.sheetName, _.range) : pe(_.range));
|
|
2093
|
+
d(v), I(v.length - 1);
|
|
2094
2094
|
} else
|
|
2095
|
-
d([""]),
|
|
2095
|
+
d([""]), I(0);
|
|
2096
2096
|
}, [e]);
|
|
2097
|
-
const p = (v,
|
|
2098
|
-
const T = [...
|
|
2099
|
-
T[v] =
|
|
2100
|
-
},
|
|
2101
|
-
d([...
|
|
2102
|
-
},
|
|
2103
|
-
|
|
2097
|
+
const p = (v, _) => {
|
|
2098
|
+
const T = [...u];
|
|
2099
|
+
T[v] = _, d(T);
|
|
2100
|
+
}, C = () => {
|
|
2101
|
+
d([...u, ""]), I(u.length);
|
|
2102
|
+
}, S = (v) => {
|
|
2103
|
+
u.splice(v, 1), d([...u]);
|
|
2104
2104
|
};
|
|
2105
|
-
return
|
|
2105
|
+
return Qi({
|
|
2106
2106
|
unitId: o,
|
|
2107
2107
|
subUnitId: r,
|
|
2108
2108
|
supportAcrossSheet: i,
|
|
2109
|
-
onChange: (v,
|
|
2109
|
+
onChange: (v, _) => {
|
|
2110
2110
|
if (!e && h != null && h(v))
|
|
2111
2111
|
return;
|
|
2112
|
-
const T = new Set(
|
|
2112
|
+
const T = new Set(u), w = v.map((R) => R.sheetName ? ht(R.sheetName, R.range) : pe(R.range)), A = w.filter((R) => !T.has(R));
|
|
2113
2113
|
if (!A.length) return;
|
|
2114
|
-
const M = [...
|
|
2114
|
+
const M = [...u];
|
|
2115
2115
|
if (w.length > 1) {
|
|
2116
|
-
|
|
2117
|
-
const
|
|
2118
|
-
d(
|
|
2119
|
-
var
|
|
2120
|
-
(
|
|
2116
|
+
_ || M.splice(a, 1), M.push(...A);
|
|
2117
|
+
const R = M.slice(0, s);
|
|
2118
|
+
d(R), I(R.length - 1), requestAnimationFrame(() => {
|
|
2119
|
+
var y;
|
|
2120
|
+
(y = g.current) == null || y.scrollTo({ top: g.current.scrollHeight });
|
|
2121
2121
|
});
|
|
2122
2122
|
} else {
|
|
2123
|
-
M.splice(
|
|
2124
|
-
const
|
|
2125
|
-
d(
|
|
2123
|
+
M.splice(a, 1, ...A);
|
|
2124
|
+
const R = M.slice(0, s);
|
|
2125
|
+
d(R), I(a + A.length - 1);
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
}), /* @__PURE__ */ b(
|
|
2129
|
-
|
|
2129
|
+
Is,
|
|
2130
2130
|
{
|
|
2131
2131
|
width: "328px",
|
|
2132
2132
|
visible: e,
|
|
2133
|
-
title:
|
|
2133
|
+
title: f.t("rangeSelector.title"),
|
|
2134
2134
|
draggable: !0,
|
|
2135
|
-
closeIcon: /* @__PURE__ */ b(
|
|
2136
|
-
footer: /* @__PURE__ */
|
|
2137
|
-
/* @__PURE__ */ b(
|
|
2135
|
+
closeIcon: /* @__PURE__ */ b(Vt, {}),
|
|
2136
|
+
footer: /* @__PURE__ */ k("footer", { children: [
|
|
2137
|
+
/* @__PURE__ */ b(et, { onClick: l, children: f.t("rangeSelector.cancel") }),
|
|
2138
2138
|
/* @__PURE__ */ b(
|
|
2139
|
-
|
|
2139
|
+
et,
|
|
2140
2140
|
{
|
|
2141
2141
|
style: { marginLeft: 10 },
|
|
2142
2142
|
onClick: () => {
|
|
2143
2143
|
c(
|
|
2144
|
-
|
|
2145
|
-
const
|
|
2146
|
-
return
|
|
2147
|
-
}).map((v) =>
|
|
2144
|
+
u.filter((v) => {
|
|
2145
|
+
const _ = m.sequenceNodesBuilder(v);
|
|
2146
|
+
return _ && _.length === 1 && typeof _[0] != "string" && _[0].nodeType === z.REFERENCE;
|
|
2147
|
+
}).map((v) => ot(v)).map((v) => ({ ...v, range: oc(v.range) }))
|
|
2148
2148
|
);
|
|
2149
2149
|
},
|
|
2150
2150
|
type: "primary",
|
|
2151
|
-
children:
|
|
2151
|
+
children: f.t("rangeSelector.confirm")
|
|
2152
2152
|
}
|
|
2153
2153
|
)
|
|
2154
2154
|
] }),
|
|
2155
|
-
onClose:
|
|
2156
|
-
children: /* @__PURE__ */
|
|
2157
|
-
|
|
2155
|
+
onClose: l,
|
|
2156
|
+
children: /* @__PURE__ */ k("div", { ref: g, className: Tt.sheetRangeSelectorDialog, children: [
|
|
2157
|
+
u.map((v, _) => /* @__PURE__ */ k("div", { className: Tt.sheetRangeSelectorDialogItem, children: [
|
|
2158
2158
|
/* @__PURE__ */ b(
|
|
2159
|
-
|
|
2159
|
+
Ro,
|
|
2160
2160
|
{
|
|
2161
2161
|
affixWrapperStyle: { width: "100%" },
|
|
2162
|
-
placeholder:
|
|
2163
|
-
onFocus: () =>
|
|
2162
|
+
placeholder: f.t("rangeSelector.placeHolder"),
|
|
2163
|
+
onFocus: () => I(_),
|
|
2164
2164
|
value: v,
|
|
2165
|
-
onChange: (T) => p(
|
|
2166
|
-
style: { borderColor:
|
|
2165
|
+
onChange: (T) => p(_, T),
|
|
2166
|
+
style: { borderColor: a === _ ? "rgb(var(--primary-color))" : void 0 }
|
|
2167
2167
|
}
|
|
2168
2168
|
),
|
|
2169
|
-
|
|
2170
|
-
] },
|
|
2171
|
-
|
|
2172
|
-
/* @__PURE__ */ b(
|
|
2173
|
-
/* @__PURE__ */ b("span", { children:
|
|
2169
|
+
u.length > 1 && /* @__PURE__ */ b(Mo, { className: Tt.sheetRangeSelectorDialogItemDelete, onClick: () => S(_) })
|
|
2170
|
+
] }, _)),
|
|
2171
|
+
u.length < s && /* @__PURE__ */ b("div", { children: /* @__PURE__ */ k(et, { type: "link", size: "small", onClick: C, children: [
|
|
2172
|
+
/* @__PURE__ */ b(Po, {}),
|
|
2173
|
+
/* @__PURE__ */ b("span", { children: f.t("rangeSelector.addAnotherRange") })
|
|
2174
2174
|
] }) })
|
|
2175
2175
|
] })
|
|
2176
2176
|
}
|
|
2177
2177
|
);
|
|
2178
2178
|
}
|
|
2179
|
-
function
|
|
2180
|
-
return t.split(
|
|
2179
|
+
function sc(t) {
|
|
2180
|
+
return t.split(nt.COMMA).filter((e) => !!e).map((e) => ot(e));
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2183
|
-
return t.map((e) => e.sheetName ? ht(e.sheetName, e.range) : pe(e.range)).join(
|
|
2182
|
+
function ic(t) {
|
|
2183
|
+
return t.map((e) => e.sheetName ? ht(e.sheetName, e.range) : pe(e.range)).join(nt.COMMA);
|
|
2184
2184
|
}
|
|
2185
|
-
function
|
|
2186
|
-
const [e, n] =
|
|
2185
|
+
function $o(t) {
|
|
2186
|
+
const [e, n] = $(null), {
|
|
2187
2187
|
onVerify: o,
|
|
2188
2188
|
selectorRef: r,
|
|
2189
2189
|
unitId: s,
|
|
2190
2190
|
subUnitId: i,
|
|
2191
2191
|
maxRangeCount: c,
|
|
2192
|
-
supportAcrossSheet:
|
|
2192
|
+
supportAcrossSheet: l,
|
|
2193
2193
|
autoFocus: h,
|
|
2194
|
-
onChange:
|
|
2194
|
+
onChange: f,
|
|
2195
2195
|
onRangeSelectorDialogVisibleChange: m,
|
|
2196
|
-
onClickOutside:
|
|
2196
|
+
onClickOutside: u,
|
|
2197
2197
|
onFocusChange: d,
|
|
2198
|
-
forceShowDialogWhenSelectionChanged:
|
|
2199
|
-
hideEditor:
|
|
2198
|
+
forceShowDialogWhenSelectionChanged: a,
|
|
2199
|
+
hideEditor: I,
|
|
2200
2200
|
resetRange: g
|
|
2201
|
-
} = t, [p,
|
|
2201
|
+
} = t, [p, C] = $(h != null ? h : !1), [S, v] = $(!1), [_, T] = $([]), w = O(je), A = O(be), { sequenceNodes: M } = Xi(e, p, s, i), R = Ke(M), y = O(ae), P = ee(() => {
|
|
2202
2202
|
e == null || e.setSelectionRanges([]), e == null || e.blur(), A.blur();
|
|
2203
|
-
}),
|
|
2203
|
+
}), N = ee(() => {
|
|
2204
2204
|
var E;
|
|
2205
|
-
P(), T(
|
|
2205
|
+
P(), T(sc((E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "")), v(!0);
|
|
2206
2206
|
});
|
|
2207
2207
|
return L(() => {
|
|
2208
2208
|
r && (r.current = {
|
|
@@ -2213,7 +2213,7 @@ function Do(t) {
|
|
|
2213
2213
|
A.focus(e.getEditorId());
|
|
2214
2214
|
},
|
|
2215
2215
|
blur: P,
|
|
2216
|
-
verify: () =>
|
|
2216
|
+
verify: () => qn(R.current),
|
|
2217
2217
|
showDialog: (E) => {
|
|
2218
2218
|
P(), T(E), v(!0);
|
|
2219
2219
|
},
|
|
@@ -2225,63 +2225,63 @@ function Do(t) {
|
|
|
2225
2225
|
return (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "";
|
|
2226
2226
|
}
|
|
2227
2227
|
});
|
|
2228
|
-
}, [P, e, A, r,
|
|
2228
|
+
}, [P, e, A, r, R]), L(() => {
|
|
2229
2229
|
var E;
|
|
2230
|
-
o == null || o(
|
|
2230
|
+
o == null || o(qn(M), (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "");
|
|
2231
2231
|
}, [M]), L(() => {
|
|
2232
|
-
m == null || m(
|
|
2233
|
-
}, [
|
|
2234
|
-
if (
|
|
2232
|
+
m == null || m(S);
|
|
2233
|
+
}, [S]), L(() => {
|
|
2234
|
+
if (S && g)
|
|
2235
2235
|
return () => {
|
|
2236
2236
|
const E = {
|
|
2237
2237
|
unitId: s,
|
|
2238
2238
|
subUnitId: i,
|
|
2239
2239
|
selections: g
|
|
2240
2240
|
};
|
|
2241
|
-
|
|
2241
|
+
y.executeCommand(an.id, E);
|
|
2242
2242
|
};
|
|
2243
|
-
}, [
|
|
2244
|
-
|
|
2245
|
-
|
|
2243
|
+
}, [S]), /* @__PURE__ */ k(ut, { children: [
|
|
2244
|
+
I ? null : /* @__PURE__ */ b(
|
|
2245
|
+
ts,
|
|
2246
2246
|
{
|
|
2247
2247
|
isSingle: !0,
|
|
2248
2248
|
...t,
|
|
2249
2249
|
onFocusChange: (E, F) => {
|
|
2250
|
-
|
|
2250
|
+
C(E), d == null || d(E, F);
|
|
2251
2251
|
},
|
|
2252
2252
|
editorRef: n,
|
|
2253
2253
|
onClickOutside: () => {
|
|
2254
|
-
|
|
2254
|
+
C(!1), P(), u == null || u();
|
|
2255
2255
|
},
|
|
2256
|
-
icon: /* @__PURE__ */ b(
|
|
2256
|
+
icon: /* @__PURE__ */ b(Rs, { title: w.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ b(xo, { className: Tt.sheetRangeSelectorIcon, onClick: N }) })
|
|
2257
2257
|
}
|
|
2258
2258
|
),
|
|
2259
2259
|
/* @__PURE__ */ b(
|
|
2260
|
-
|
|
2260
|
+
rc,
|
|
2261
2261
|
{
|
|
2262
|
-
initialValue:
|
|
2262
|
+
initialValue: _,
|
|
2263
2263
|
unitId: s,
|
|
2264
2264
|
subUnitId: i,
|
|
2265
|
-
visible:
|
|
2265
|
+
visible: S,
|
|
2266
2266
|
maxRangeCount: c,
|
|
2267
2267
|
onConfirm: (E) => {
|
|
2268
|
-
const F =
|
|
2269
|
-
x.body.dataStream = F, e == null || e.replaceText(F, !1),
|
|
2268
|
+
const F = ic(E), x = rr.newEmptyData();
|
|
2269
|
+
x.body.dataStream = F, e == null || e.replaceText(F, !1), f == null || f(x, F), v(!1), T([]), requestAnimationFrame(() => {
|
|
2270
2270
|
P();
|
|
2271
2271
|
});
|
|
2272
2272
|
},
|
|
2273
2273
|
onClose: () => {
|
|
2274
2274
|
v(!1), T([]);
|
|
2275
2275
|
},
|
|
2276
|
-
supportAcrossSheet:
|
|
2277
|
-
onShowBySelection: (E) => p ||
|
|
2276
|
+
supportAcrossSheet: l,
|
|
2277
|
+
onShowBySelection: (E) => p || a ? (T(E), v(!0), !1) : !0
|
|
2278
2278
|
}
|
|
2279
2279
|
)
|
|
2280
2280
|
] });
|
|
2281
2281
|
}
|
|
2282
|
-
class
|
|
2282
|
+
class ko {
|
|
2283
2283
|
constructor() {
|
|
2284
|
-
B(this, "_currentSelector$", new
|
|
2284
|
+
B(this, "_currentSelector$", new io(null));
|
|
2285
2285
|
B(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
2286
2286
|
}
|
|
2287
2287
|
showRangeSelectorDialog(e) {
|
|
@@ -2293,19 +2293,19 @@ class Lo {
|
|
|
2293
2293
|
return this._currentSelector$.next(e), o;
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
|
-
const
|
|
2297
|
-
function
|
|
2298
|
-
return t.getContextValue(
|
|
2296
|
+
const cc = "sheets-formula-ui.base.config", jn = {};
|
|
2297
|
+
function lc(t) {
|
|
2298
|
+
return t.getContextValue(sr) && t.getContextValue(ir);
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2301
|
-
return !e && !(Re(t == null ? void 0 : t.f) ||
|
|
2300
|
+
function Ho(t, e = !1) {
|
|
2301
|
+
return !e && !(Re(t == null ? void 0 : t.f) || Be(t == null ? void 0 : t.si)) ? null : typeof (t == null ? void 0 : t.v) == "string" && Hr.has(t.v) ? t.v : null;
|
|
2302
2302
|
}
|
|
2303
|
-
var
|
|
2304
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2303
|
+
var ac = Object.getOwnPropertyDescriptor, uc = (t, e, n, o) => {
|
|
2304
|
+
for (var r = o > 1 ? void 0 : o ? ac(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2305
2305
|
(i = t[s]) && (r = i(r) || r);
|
|
2306
2306
|
return r;
|
|
2307
2307
|
}, it = (t, e) => (n, o) => e(n, o, t);
|
|
2308
|
-
const
|
|
2308
|
+
const zt = "SHEET_FORMULA_ALERT", fc = {
|
|
2309
2309
|
[se.DIV_BY_ZERO]: "divByZero",
|
|
2310
2310
|
[se.NAME]: "name",
|
|
2311
2311
|
[se.VALUE]: "value",
|
|
@@ -2319,7 +2319,7 @@ const Kt = "SHEET_FORMULA_ALERT", lc = {
|
|
|
2319
2319
|
[se.CONNECT]: "connect",
|
|
2320
2320
|
[se.NULL]: "null"
|
|
2321
2321
|
};
|
|
2322
|
-
let
|
|
2322
|
+
let nn = class extends pt {
|
|
2323
2323
|
constructor(t, e, n, o, r, s) {
|
|
2324
2324
|
super(), this._context = t, this._hoverManagerService = e, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
|
|
2325
2325
|
}
|
|
@@ -2327,29 +2327,29 @@ let en = class extends pt {
|
|
|
2327
2327
|
this._initCellAlertPopup(), this._initZenService();
|
|
2328
2328
|
}
|
|
2329
2329
|
_initCellAlertPopup() {
|
|
2330
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
|
2330
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(cn(100)).subscribe((t) => {
|
|
2331
2331
|
var e, n, o, r, s;
|
|
2332
2332
|
if (t) {
|
|
2333
2333
|
const c = this._context.unit.getActiveSheet();
|
|
2334
2334
|
if (!c) return;
|
|
2335
|
-
const
|
|
2336
|
-
if (
|
|
2337
|
-
const
|
|
2338
|
-
if (!
|
|
2335
|
+
const l = c.getCell(t.location.row, t.location.col), h = (r = (o = (n = (e = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : e[t.location.unitId]) == null ? void 0 : n[t.location.subUnitId]) == null ? void 0 : o[t.location.row]) == null ? void 0 : r[t.location.col];
|
|
2336
|
+
if (cr(l)) {
|
|
2337
|
+
const f = Ho(l, !!h);
|
|
2338
|
+
if (!f) {
|
|
2339
2339
|
this._hideAlert();
|
|
2340
2340
|
return;
|
|
2341
2341
|
}
|
|
2342
|
-
const m = this._cellAlertManagerService.currentAlert.get(
|
|
2343
|
-
if (
|
|
2342
|
+
const m = this._cellAlertManagerService.currentAlert.get(zt), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
|
|
2343
|
+
if (u && u.row === t.location.row && u.col === t.location.col && u.subUnitId === t.location.subUnitId && u.unitId === t.location.unitId)
|
|
2344
2344
|
return;
|
|
2345
2345
|
this._cellAlertManagerService.showAlert({
|
|
2346
|
-
type:
|
|
2346
|
+
type: yr.ERROR,
|
|
2347
2347
|
title: this._localeService.t("formula.error.title"),
|
|
2348
|
-
message: this._localeService.t(`formula.error.${
|
|
2348
|
+
message: this._localeService.t(`formula.error.${fc[f]}`),
|
|
2349
2349
|
location: t.location,
|
|
2350
2350
|
width: 200,
|
|
2351
2351
|
height: 74,
|
|
2352
|
-
key:
|
|
2352
|
+
key: zt
|
|
2353
2353
|
});
|
|
2354
2354
|
return;
|
|
2355
2355
|
}
|
|
@@ -2363,92 +2363,93 @@ let en = class extends pt {
|
|
|
2363
2363
|
}));
|
|
2364
2364
|
}
|
|
2365
2365
|
_hideAlert() {
|
|
2366
|
-
this._cellAlertManagerService.removeAlert(
|
|
2366
|
+
this._cellAlertManagerService.removeAlert(zt);
|
|
2367
2367
|
}
|
|
2368
2368
|
};
|
|
2369
|
-
|
|
2370
|
-
it(1, K(
|
|
2371
|
-
it(2, K(
|
|
2372
|
-
it(3, K(
|
|
2373
|
-
it(4, K(
|
|
2374
|
-
it(5,
|
|
2375
|
-
],
|
|
2376
|
-
var
|
|
2377
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2369
|
+
nn = uc([
|
|
2370
|
+
it(1, K(Er)),
|
|
2371
|
+
it(2, K(br)),
|
|
2372
|
+
it(3, K(je)),
|
|
2373
|
+
it(4, K($t)),
|
|
2374
|
+
it(5, ms)
|
|
2375
|
+
], nn);
|
|
2376
|
+
var hc = Object.getOwnPropertyDescriptor, dc = (t, e, n, o) => {
|
|
2377
|
+
for (var r = o > 1 ? void 0 : o ? hc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2378
2378
|
(i = t[s]) && (r = i(r) || r);
|
|
2379
2379
|
return r;
|
|
2380
|
-
},
|
|
2381
|
-
let
|
|
2380
|
+
}, Kn = (t, e) => (n, o) => e(n, o, t);
|
|
2381
|
+
let Mt = class extends pt {
|
|
2382
2382
|
constructor(t, e) {
|
|
2383
2383
|
super(), this._autoFillService = t, this._lexerTreeBuilder = e, this._registerAutoFill();
|
|
2384
2384
|
}
|
|
2385
2385
|
_registerAutoFill() {
|
|
2386
2386
|
const t = {
|
|
2387
|
-
type:
|
|
2387
|
+
type: Mn.FORMULA,
|
|
2388
2388
|
priority: 1001,
|
|
2389
|
-
match: (e) => Re(e == null ? void 0 : e.f) ||
|
|
2390
|
-
isContinue: (e, n) => e.type ===
|
|
2389
|
+
match: (e) => Re(e == null ? void 0 : e.f) || Be(e == null ? void 0 : e.si),
|
|
2390
|
+
isContinue: (e, n) => e.type === Mn.FORMULA,
|
|
2391
2391
|
applyFunctions: {
|
|
2392
|
-
[
|
|
2393
|
-
const { data:
|
|
2394
|
-
return this._fillCopyFormula(
|
|
2392
|
+
[Tr.COPY]: (e, n, o, r, s) => {
|
|
2393
|
+
const { data: i, index: c } = e;
|
|
2394
|
+
return this._fillCopyFormula(i, n, o, c, r, s);
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
2397
|
};
|
|
2398
2398
|
this._autoFillService.registerRule(t);
|
|
2399
2399
|
}
|
|
2400
|
-
_fillCopyFormula(t, e, n, o, r) {
|
|
2401
|
-
var
|
|
2402
|
-
const
|
|
2403
|
-
for (let
|
|
2404
|
-
const
|
|
2405
|
-
if (
|
|
2406
|
-
const
|
|
2407
|
-
if (
|
|
2408
|
-
|
|
2409
|
-
else if (
|
|
2410
|
-
let
|
|
2411
|
-
if (
|
|
2412
|
-
|
|
2400
|
+
_fillCopyFormula(t, e, n, o, r, s) {
|
|
2401
|
+
var h, f;
|
|
2402
|
+
const i = gc(r), c = [], l = /* @__PURE__ */ new Map();
|
|
2403
|
+
for (let m = 1; m <= e; m++) {
|
|
2404
|
+
const u = (m - 1) % t.length, d = o[u], a = ft.deepClone(t[u]);
|
|
2405
|
+
if (a) {
|
|
2406
|
+
const I = ((h = t[u]) == null ? void 0 : h.f) || "", g = ((f = t[u]) == null ? void 0 : f.si) || "", p = Re(I);
|
|
2407
|
+
if (Be(g))
|
|
2408
|
+
a.si = g, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
|
|
2409
|
+
else if (p) {
|
|
2410
|
+
let S = l.get(u);
|
|
2411
|
+
if (S)
|
|
2412
|
+
a.si = S, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
2413
2413
|
else {
|
|
2414
|
-
|
|
2415
|
-
const { offsetX:
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2414
|
+
S = ft.generateRandomId(6), l.set(u, S);
|
|
2415
|
+
const { offsetX: v, offsetY: _ } = mc(i, e, n, s, d), T = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
2416
|
+
I,
|
|
2417
|
+
v,
|
|
2418
|
+
_
|
|
2419
2419
|
);
|
|
2420
|
-
|
|
2420
|
+
a.si = S, a.f = T, a.v = null, a.p = null, a.t = null;
|
|
2421
2421
|
}
|
|
2422
|
-
|
|
2422
|
+
c.push(a);
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
2425
|
}
|
|
2426
|
-
return
|
|
2426
|
+
return c;
|
|
2427
2427
|
}
|
|
2428
2428
|
};
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
],
|
|
2433
|
-
function
|
|
2434
|
-
|
|
2429
|
+
Mt = dc([
|
|
2430
|
+
Kn(0, Nr),
|
|
2431
|
+
Kn(1, K(Ee))
|
|
2432
|
+
], Mt);
|
|
2433
|
+
function mc(t, e, n, o, r) {
|
|
2434
|
+
const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
|
|
2435
|
+
let h = 0, f = 0;
|
|
2435
2436
|
switch (n) {
|
|
2436
2437
|
case ne.UP:
|
|
2437
|
-
|
|
2438
|
+
f = c[r] - l[r];
|
|
2438
2439
|
break;
|
|
2439
2440
|
case ne.RIGHT:
|
|
2440
|
-
|
|
2441
|
+
h = t;
|
|
2441
2442
|
break;
|
|
2442
2443
|
case ne.DOWN:
|
|
2443
|
-
|
|
2444
|
+
f = c[r] - l[r];
|
|
2444
2445
|
break;
|
|
2445
2446
|
case ne.LEFT:
|
|
2446
|
-
|
|
2447
|
+
h = -t * e;
|
|
2447
2448
|
break;
|
|
2448
2449
|
}
|
|
2449
|
-
return { offsetX:
|
|
2450
|
+
return { offsetX: h, offsetY: f };
|
|
2450
2451
|
}
|
|
2451
|
-
function
|
|
2452
|
+
function gc(t) {
|
|
2452
2453
|
let e = 0;
|
|
2453
2454
|
for (const n in t)
|
|
2454
2455
|
t[n].forEach((o) => {
|
|
@@ -2456,13 +2457,13 @@ function hc(t) {
|
|
|
2456
2457
|
});
|
|
2457
2458
|
return e;
|
|
2458
2459
|
}
|
|
2459
|
-
var
|
|
2460
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2460
|
+
var pc = Object.getOwnPropertyDescriptor, Sc = (t, e, n, o) => {
|
|
2461
|
+
for (var r = o > 1 ? void 0 : o ? pc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2461
2462
|
(i = t[s]) && (r = i(r) || r);
|
|
2462
2463
|
return r;
|
|
2463
2464
|
}, ct = (t, e) => (n, o) => e(n, o, t);
|
|
2464
|
-
const
|
|
2465
|
-
let
|
|
2465
|
+
const Cc = "default-paste-formula";
|
|
2466
|
+
let At = class extends pt {
|
|
2466
2467
|
constructor(t, e, n, o, r) {
|
|
2467
2468
|
super(), this._currentUniverSheet = t, this._lexerTreeBuilder = e, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
2468
2469
|
}
|
|
@@ -2474,7 +2475,7 @@ let Ot = class extends pt {
|
|
|
2474
2475
|
}
|
|
2475
2476
|
_pasteFormulaHook() {
|
|
2476
2477
|
return {
|
|
2477
|
-
id:
|
|
2478
|
+
id: Je.SPECIAL_PASTE_FORMULA,
|
|
2478
2479
|
priority: 10,
|
|
2479
2480
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
2480
2481
|
onPasteCells: (t, e, n, o) => this._onPasteCells(t, e, n, o, !0)
|
|
@@ -2482,37 +2483,37 @@ let Ot = class extends pt {
|
|
|
2482
2483
|
}
|
|
2483
2484
|
_pasteWithFormulaHook() {
|
|
2484
2485
|
return {
|
|
2485
|
-
id:
|
|
2486
|
+
id: Cc,
|
|
2486
2487
|
priority: 10,
|
|
2487
2488
|
onPasteCells: (t, e, n, o) => this._onPasteCells(t, e, n, o, !1)
|
|
2488
2489
|
};
|
|
2489
2490
|
}
|
|
2490
2491
|
_onPasteCells(t, e, n, o, r) {
|
|
2491
|
-
var
|
|
2492
|
+
var u;
|
|
2492
2493
|
if ([
|
|
2493
|
-
|
|
2494
|
-
|
|
2494
|
+
Je.SPECIAL_PASTE_FORMAT,
|
|
2495
|
+
Je.SPECIAL_PASTE_COL_WIDTH
|
|
2495
2496
|
].includes(o.pasteType))
|
|
2496
2497
|
return {
|
|
2497
2498
|
undos: [],
|
|
2498
2499
|
redos: []
|
|
2499
2500
|
};
|
|
2500
|
-
const i = this._currentUniverSheet.getCurrentUnitForType(ue.UNIVER_SHEET), c = e.unitId || i.getUnitId(),
|
|
2501
|
-
if (!c || !
|
|
2501
|
+
const i = this._currentUniverSheet.getCurrentUnitForType(ue.UNIVER_SHEET), c = e.unitId || i.getUnitId(), l = e.subUnitId || ((u = i.getActiveSheet()) == null ? void 0 : u.getSheetId());
|
|
2502
|
+
if (!c || !l)
|
|
2502
2503
|
return {
|
|
2503
2504
|
undos: [],
|
|
2504
2505
|
redos: []
|
|
2505
2506
|
};
|
|
2506
|
-
const h = e.range,
|
|
2507
|
-
copyType: o.copyType ||
|
|
2507
|
+
const h = e.range, f = n, m = {
|
|
2508
|
+
copyType: o.copyType || oo.COPY,
|
|
2508
2509
|
copyRange: t == null ? void 0 : t.range,
|
|
2509
2510
|
pasteType: o.pasteType
|
|
2510
2511
|
};
|
|
2511
|
-
return this._injector.invoke((d) =>
|
|
2512
|
+
return this._injector.invoke((d) => vc(
|
|
2512
2513
|
c,
|
|
2513
|
-
|
|
2514
|
+
l,
|
|
2514
2515
|
h,
|
|
2515
|
-
|
|
2516
|
+
f,
|
|
2516
2517
|
d,
|
|
2517
2518
|
m,
|
|
2518
2519
|
this._lexerTreeBuilder,
|
|
@@ -2522,16 +2523,16 @@ let Ot = class extends pt {
|
|
|
2522
2523
|
));
|
|
2523
2524
|
}
|
|
2524
2525
|
};
|
|
2525
|
-
|
|
2526
|
+
At = Sc([
|
|
2526
2527
|
ct(0, oe),
|
|
2527
2528
|
ct(1, K(Ee)),
|
|
2528
|
-
ct(2,
|
|
2529
|
+
ct(2, Fr),
|
|
2529
2530
|
ct(3, K(mt)),
|
|
2530
|
-
ct(4, K(
|
|
2531
|
-
],
|
|
2532
|
-
function
|
|
2533
|
-
const
|
|
2534
|
-
if (!
|
|
2531
|
+
ct(4, K($t))
|
|
2532
|
+
], At);
|
|
2533
|
+
function vc(t, e, n, o, r, s, i, c, l = !1, h) {
|
|
2534
|
+
const f = [], m = [], u = _c(t, e, n, o, s, i, c, h);
|
|
2535
|
+
if (!u.hasValue())
|
|
2535
2536
|
return {
|
|
2536
2537
|
undos: [],
|
|
2537
2538
|
redos: []
|
|
@@ -2539,175 +2540,175 @@ function pc(t, e, n, o, r, s, i, c, a = !1, h) {
|
|
|
2539
2540
|
const d = {
|
|
2540
2541
|
unitId: t,
|
|
2541
2542
|
subUnitId: e,
|
|
2542
|
-
cellValue:
|
|
2543
|
+
cellValue: u.getData()
|
|
2543
2544
|
};
|
|
2544
|
-
|
|
2545
|
-
id:
|
|
2545
|
+
f.push({
|
|
2546
|
+
id: $n.id,
|
|
2546
2547
|
params: d
|
|
2547
2548
|
});
|
|
2548
|
-
const
|
|
2549
|
+
const a = ss(
|
|
2549
2550
|
r,
|
|
2550
2551
|
d
|
|
2551
2552
|
);
|
|
2552
2553
|
return m.push({
|
|
2553
|
-
id:
|
|
2554
|
-
params:
|
|
2554
|
+
id: $n.id,
|
|
2555
|
+
params: a
|
|
2555
2556
|
}), {
|
|
2556
2557
|
undos: m,
|
|
2557
|
-
redos:
|
|
2558
|
+
redos: f
|
|
2558
2559
|
};
|
|
2559
2560
|
}
|
|
2560
|
-
function
|
|
2561
|
-
return c ? r.pasteType ===
|
|
2561
|
+
function _c(t, e, n, o, r, s, i, c) {
|
|
2562
|
+
return c ? r.pasteType === Je.SPECIAL_PASTE_VALUE ? Ic(t, e, n, o, i, c) : r.pasteType === Je.SPECIAL_PASTE_FORMULA ? Ec(t, e, n, o, s, i, c) : bc(t, e, n, o, r.copyType, s, i, c) : Rc(t, e, n, o, i);
|
|
2562
2563
|
}
|
|
2563
|
-
function
|
|
2564
|
-
const s = new
|
|
2565
|
-
return o.forValue((c,
|
|
2564
|
+
function Rc(t, e, n, o, r) {
|
|
2565
|
+
const s = new tt(), i = r.getSheetFormulaData(t, e);
|
|
2566
|
+
return o.forValue((c, l, h) => {
|
|
2566
2567
|
var d;
|
|
2567
|
-
const
|
|
2568
|
-
Re(h.v) ? (
|
|
2568
|
+
const f = n.rows[c], m = n.cols[l], u = {};
|
|
2569
|
+
Re(h.v) ? (u.v = null, u.f = `${h.v}`, u.si = null, u.p = null, s.setValue(f, m, u)) : (d = i == null ? void 0 : i[f]) != null && d[m] && (u.v = h.v, u.f = null, u.si = null, u.p = null, s.setValue(f, m, u));
|
|
2569
2570
|
}), s;
|
|
2570
2571
|
}
|
|
2571
|
-
function
|
|
2572
|
-
var h,
|
|
2573
|
-
const i = new
|
|
2574
|
-
return o.forValue((m,
|
|
2575
|
-
var
|
|
2576
|
-
const
|
|
2577
|
-
if (Re(d.f) ||
|
|
2578
|
-
|
|
2579
|
-
else if ((
|
|
2580
|
-
const
|
|
2581
|
-
|
|
2582
|
-
} else if ((v =
|
|
2583
|
-
if (
|
|
2584
|
-
const
|
|
2585
|
-
|
|
2572
|
+
function Ic(t, e, n, o, r, s) {
|
|
2573
|
+
var h, f;
|
|
2574
|
+
const i = new tt(), c = (f = (h = r.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : f[s.subUnitId], l = r.getSheetFormulaData(t, e);
|
|
2575
|
+
return o.forValue((m, u, d) => {
|
|
2576
|
+
var S, v;
|
|
2577
|
+
const a = s.range.rows[m % s.range.rows.length], I = s.range.cols[u % s.range.cols.length], g = n.rows[m], p = n.cols[u], C = {};
|
|
2578
|
+
if (Re(d.f) || Be(d.si))
|
|
2579
|
+
C.v = d.v, C.f = null, C.si = null, C.p = null, i.setValue(g, p, C);
|
|
2580
|
+
else if ((S = c == null ? void 0 : c[a]) != null && S[I]) {
|
|
2581
|
+
const _ = c[a][I];
|
|
2582
|
+
C.v = _.v, C.f = null, C.si = null, C.p = null, i.setValue(g, p, C);
|
|
2583
|
+
} else if ((v = l == null ? void 0 : l[g]) != null && v[p]) {
|
|
2584
|
+
if (C.v = d.v, C.f = null, C.si = null, C.p = null, d.p) {
|
|
2585
|
+
const _ = Wo(d);
|
|
2586
|
+
_ && (C.v = _);
|
|
2586
2587
|
}
|
|
2587
|
-
i.setValue(g, p,
|
|
2588
|
+
i.setValue(g, p, C);
|
|
2588
2589
|
}
|
|
2589
2590
|
}), i;
|
|
2590
2591
|
}
|
|
2591
|
-
function
|
|
2592
|
-
const c = new
|
|
2593
|
-
return o.forValue((h,
|
|
2594
|
-
const
|
|
2595
|
-
if (
|
|
2592
|
+
function Ec(t, e, n, o, r, s, i) {
|
|
2593
|
+
const c = new tt(), l = /* @__PURE__ */ new Map();
|
|
2594
|
+
return o.forValue((h, f, m) => {
|
|
2595
|
+
const u = n.rows[h], d = n.cols[f], a = {};
|
|
2596
|
+
if (Be(m.si)) {
|
|
2596
2597
|
if (i.unitId !== t || i.subUnitId !== e) {
|
|
2597
|
-
const
|
|
2598
|
+
const I = s.getFormulaStringByCell(
|
|
2598
2599
|
i.range.rows[h % i.range.rows.length],
|
|
2599
|
-
i.range.cols[
|
|
2600
|
+
i.range.cols[f % i.range.cols.length],
|
|
2600
2601
|
i.subUnitId,
|
|
2601
2602
|
i.unitId
|
|
2602
|
-
), g = n.cols[
|
|
2603
|
-
|
|
2603
|
+
), g = n.cols[f] - i.range.cols[f % i.range.cols.length], p = n.rows[h] - i.range.rows[h % i.range.rows.length], C = r.moveFormulaRefOffset(I || "", g, p);
|
|
2604
|
+
a.si = null, a.f = C;
|
|
2604
2605
|
} else
|
|
2605
|
-
|
|
2606
|
-
|
|
2606
|
+
a.si = m.si, a.f = null;
|
|
2607
|
+
a.v = null, a.p = null, c.setValue(u, d, a);
|
|
2607
2608
|
} else if (Re(m.f)) {
|
|
2608
|
-
const
|
|
2609
|
-
let g =
|
|
2609
|
+
const I = `${h % i.range.rows.length}_${f % i.range.cols.length}`;
|
|
2610
|
+
let g = l.get(I);
|
|
2610
2611
|
if (g)
|
|
2611
|
-
|
|
2612
|
+
a.si = g, a.f = null;
|
|
2612
2613
|
else {
|
|
2613
|
-
g = ft.generateRandomId(6),
|
|
2614
|
-
const p = n.cols[
|
|
2615
|
-
|
|
2614
|
+
g = ft.generateRandomId(6), l.set(I, g);
|
|
2615
|
+
const p = n.cols[f] - i.range.cols[f % i.range.cols.length], C = n.rows[h] - i.range.rows[h % i.range.rows.length], S = r.moveFormulaRefOffset(m.f || "", p, C);
|
|
2616
|
+
a.si = g, a.f = S;
|
|
2616
2617
|
}
|
|
2617
|
-
|
|
2618
|
+
a.v = null, a.p = null, c.setValue(u, d, a);
|
|
2618
2619
|
} else {
|
|
2619
|
-
if (
|
|
2620
|
-
const
|
|
2621
|
-
|
|
2620
|
+
if (a.v = m.v, a.f = null, a.si = null, a.p = null, m.p) {
|
|
2621
|
+
const I = Wo(m);
|
|
2622
|
+
I && (a.v = I);
|
|
2622
2623
|
}
|
|
2623
|
-
c.setValue(
|
|
2624
|
+
c.setValue(u, d, a);
|
|
2624
2625
|
}
|
|
2625
2626
|
}), c;
|
|
2626
2627
|
}
|
|
2627
|
-
function
|
|
2628
|
-
const
|
|
2629
|
-
return r ===
|
|
2630
|
-
const
|
|
2631
|
-
if (
|
|
2632
|
-
if (Re(
|
|
2633
|
-
m.push(
|
|
2634
|
-
else if (m.includes(
|
|
2635
|
-
p.f = null, p.si =
|
|
2628
|
+
function bc(t, e, n, o, r, s, i, c) {
|
|
2629
|
+
const l = new tt(), h = /* @__PURE__ */ new Map(), f = i.getSheetFormulaData(t, e), m = [];
|
|
2630
|
+
return r === oo.CUT ? o.forValue((u, d, a) => {
|
|
2631
|
+
const I = n.rows[u], g = n.cols[d], p = {};
|
|
2632
|
+
if (Be(a.si)) {
|
|
2633
|
+
if (Re(a.f))
|
|
2634
|
+
m.push(a.si), p.f = a.f, p.si = a.si;
|
|
2635
|
+
else if (m.includes(a.si))
|
|
2636
|
+
p.f = null, p.si = a.si;
|
|
2636
2637
|
else {
|
|
2637
|
-
const
|
|
2638
|
-
c.range.rows[
|
|
2638
|
+
const C = i.getFormulaStringByCell(
|
|
2639
|
+
c.range.rows[u % c.range.rows.length],
|
|
2639
2640
|
c.range.cols[d % c.range.cols.length],
|
|
2640
2641
|
c.subUnitId,
|
|
2641
2642
|
c.unitId
|
|
2642
2643
|
);
|
|
2643
|
-
p.f =
|
|
2644
|
+
p.f = C, p.si = null;
|
|
2644
2645
|
}
|
|
2645
|
-
p.v = null, p.p = null,
|
|
2646
|
-
} else Re(
|
|
2647
|
-
}) : o.forValue((
|
|
2648
|
-
var
|
|
2649
|
-
const
|
|
2650
|
-
if (
|
|
2646
|
+
p.v = null, p.p = null, l.setValue(I, g, p);
|
|
2647
|
+
} else Re(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(I, g, p));
|
|
2648
|
+
}) : o.forValue((u, d, a) => {
|
|
2649
|
+
var C;
|
|
2650
|
+
const I = n.rows[u], g = n.cols[d], p = {};
|
|
2651
|
+
if (Be(a.si)) {
|
|
2651
2652
|
if (c.unitId !== t || c.subUnitId !== e) {
|
|
2652
|
-
const
|
|
2653
|
-
c.range.rows[
|
|
2653
|
+
const S = i.getFormulaStringByCell(
|
|
2654
|
+
c.range.rows[u % c.range.rows.length],
|
|
2654
2655
|
c.range.cols[d % c.range.cols.length],
|
|
2655
2656
|
c.subUnitId,
|
|
2656
2657
|
c.unitId
|
|
2657
|
-
), v = n.cols[d] - c.range.cols[d % c.range.cols.length],
|
|
2658
|
+
), v = n.cols[d] - c.range.cols[d % c.range.cols.length], _ = n.rows[u] - c.range.rows[u % c.range.rows.length], T = s.moveFormulaRefOffset(S || "", v, _);
|
|
2658
2659
|
p.si = null, p.f = T;
|
|
2659
2660
|
} else
|
|
2660
|
-
p.si =
|
|
2661
|
-
p.v = null, p.p = null,
|
|
2662
|
-
} else if (Re(
|
|
2663
|
-
const
|
|
2664
|
-
let v = h.get(
|
|
2661
|
+
p.si = a.si, p.f = null;
|
|
2662
|
+
p.v = null, p.p = null, l.setValue(I, g, p);
|
|
2663
|
+
} else if (Re(a.f)) {
|
|
2664
|
+
const S = `${u % c.range.rows.length}_${d % c.range.cols.length}`;
|
|
2665
|
+
let v = h.get(S);
|
|
2665
2666
|
if (v)
|
|
2666
2667
|
p.si = v, p.f = null;
|
|
2667
2668
|
else {
|
|
2668
|
-
v = ft.generateRandomId(6), h.set(
|
|
2669
|
-
const
|
|
2669
|
+
v = ft.generateRandomId(6), h.set(S, v);
|
|
2670
|
+
const _ = n.cols[d] - c.range.cols[d % c.range.cols.length], T = n.rows[u] - c.range.rows[u % c.range.rows.length], w = s.moveFormulaRefOffset(a.f || "", _, T);
|
|
2670
2671
|
p.si = v, p.f = w;
|
|
2671
2672
|
}
|
|
2672
|
-
p.v = null, p.p = null,
|
|
2673
|
-
} else (
|
|
2674
|
-
}), m.length > 0 && new
|
|
2675
|
-
if (!(c.range.rows.includes(
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2673
|
+
p.v = null, p.p = null, l.setValue(I, g, p);
|
|
2674
|
+
} else (C = f == null ? void 0 : f[I]) != null && C[g] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(I, g, p));
|
|
2675
|
+
}), m.length > 0 && new tt(f).forValue((u, d, a) => {
|
|
2676
|
+
if (!(c.range.rows.includes(u) && c.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(a == null ? void 0 : a.si)) {
|
|
2677
|
+
const I = i.getFormulaStringByCell(
|
|
2678
|
+
u,
|
|
2678
2679
|
d,
|
|
2679
2680
|
c.subUnitId,
|
|
2680
2681
|
c.unitId
|
|
2681
2682
|
);
|
|
2682
|
-
|
|
2683
|
-
f:
|
|
2683
|
+
l.setValue(u, d, {
|
|
2684
|
+
f: I,
|
|
2684
2685
|
si: null,
|
|
2685
2686
|
v: null,
|
|
2686
2687
|
p: null
|
|
2687
2688
|
});
|
|
2688
2689
|
}
|
|
2689
|
-
}),
|
|
2690
|
+
}), l;
|
|
2690
2691
|
}
|
|
2691
|
-
function
|
|
2692
|
+
function Wo(t) {
|
|
2692
2693
|
if (t != null && t.p) {
|
|
2693
2694
|
const e = t == null ? void 0 : t.p.body;
|
|
2694
2695
|
if (e == null)
|
|
2695
2696
|
return;
|
|
2696
2697
|
const n = e.dataStream;
|
|
2697
|
-
return n.substring(n.length - 2, n.length) ===
|
|
2698
|
+
return n.substring(n.length - 2, n.length) === Xn ? n.substring(0, n.length - 2) : n;
|
|
2698
2699
|
}
|
|
2699
2700
|
}
|
|
2700
|
-
var
|
|
2701
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2701
|
+
var yc = Object.getOwnPropertyDescriptor, Nc = (t, e, n, o) => {
|
|
2702
|
+
for (var r = o > 1 ? void 0 : o ? yc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2702
2703
|
(i = t[s]) && (r = i(r) || r);
|
|
2703
2704
|
return r;
|
|
2704
|
-
},
|
|
2705
|
-
let
|
|
2706
|
-
constructor(e, n, o, r, s, i, c,
|
|
2705
|
+
}, We = (t, e) => (n, o) => e(n, o, t);
|
|
2706
|
+
let Pt = class extends pt {
|
|
2707
|
+
constructor(e, n, o, r, s, i, c, l) {
|
|
2707
2708
|
super();
|
|
2708
2709
|
B(this, "_previousShape");
|
|
2709
2710
|
B(this, "_skeleton");
|
|
2710
|
-
this._context = e, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService =
|
|
2711
|
+
this._context = e, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
|
|
2711
2712
|
}
|
|
2712
2713
|
_initSkeletonChangeListener() {
|
|
2713
2714
|
this.disposeWithMe(
|
|
@@ -2732,19 +2733,19 @@ let Mt = class extends pt {
|
|
|
2732
2733
|
}
|
|
2733
2734
|
_initInterceptorEditorStart() {
|
|
2734
2735
|
this.disposeWithMe(
|
|
2735
|
-
|
|
2736
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
2736
|
+
Qn(
|
|
2737
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
|
|
2737
2738
|
handler: (e, n, o) => {
|
|
2738
|
-
var
|
|
2739
|
-
const { row: r, col: s, unitId: i, subUnitId: c, worksheet:
|
|
2739
|
+
var a, I, g, p;
|
|
2740
|
+
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, h = this._formulaDataModel.getArrayFormulaRange(), f = this._formulaDataModel.getArrayFormulaCellData();
|
|
2740
2741
|
if (this._removeArrayFormulaRangeShape(), e == null)
|
|
2741
2742
|
return o(e);
|
|
2742
2743
|
let m = null;
|
|
2743
|
-
const
|
|
2744
|
-
if (
|
|
2744
|
+
const u = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
|
|
2745
|
+
if (u !== null && (m = { f: u }), e.v != null && e.v !== "" && ((g = (I = (a = f[i]) == null ? void 0 : a[c]) == null ? void 0 : I[r]) == null ? void 0 : g[s]) == null)
|
|
2745
2746
|
return m ? { ...e, ...m } : o(e);
|
|
2746
2747
|
const d = (p = h == null ? void 0 : h[i]) == null ? void 0 : p[c];
|
|
2747
|
-
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c,
|
|
2748
|
+
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c, l, m)), m ? { ...e, ...m } : o(e);
|
|
2748
2749
|
}
|
|
2749
2750
|
})
|
|
2750
2751
|
)
|
|
@@ -2752,10 +2753,10 @@ let Mt = class extends pt {
|
|
|
2752
2753
|
}
|
|
2753
2754
|
_commandExecutedListener() {
|
|
2754
2755
|
this.disposeWithMe(this._commandService.onCommandExecuted((e, n) => {
|
|
2755
|
-
(e.id ===
|
|
2756
|
+
(e.id === Wr.id || e.id === Ur.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
2756
2757
|
})), this.disposeWithMe(
|
|
2757
2758
|
this._commandService.beforeCommandExecuted((e) => {
|
|
2758
|
-
|
|
2759
|
+
cs.id === e.id && requestIdleCallback(() => {
|
|
2759
2760
|
const n = e.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
2760
2761
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
2761
2762
|
});
|
|
@@ -2763,21 +2764,21 @@ let Mt = class extends pt {
|
|
|
2763
2764
|
);
|
|
2764
2765
|
}
|
|
2765
2766
|
_displayArrayFormulaRangeShape(e, n, o, r, s, i, c) {
|
|
2766
|
-
const
|
|
2767
|
-
return new
|
|
2767
|
+
const l = this._formulaDataModel.getSheetFormulaData(r, s);
|
|
2768
|
+
return new tt(e).forValue((h, f, m) => {
|
|
2768
2769
|
var g;
|
|
2769
2770
|
if (m == null)
|
|
2770
2771
|
return !0;
|
|
2771
|
-
const { startRow:
|
|
2772
|
-
if (h === n &&
|
|
2772
|
+
const { startRow: u, startColumn: d, endRow: a, endColumn: I } = m;
|
|
2773
|
+
if (h === n && f === o)
|
|
2773
2774
|
return this._createArrayFormulaRangeShape(m, r), !1;
|
|
2774
|
-
if (n >=
|
|
2775
|
-
const p = i.getCell(
|
|
2775
|
+
if (n >= u && n <= a && o >= d && o <= I) {
|
|
2776
|
+
const p = i.getCell(u, d);
|
|
2776
2777
|
if ((p == null ? void 0 : p.v) === se.SPILL)
|
|
2777
2778
|
return;
|
|
2778
|
-
const
|
|
2779
|
-
return
|
|
2780
|
-
f:
|
|
2779
|
+
const C = (g = l == null ? void 0 : l[h]) == null ? void 0 : g[f];
|
|
2780
|
+
return C == null || C.f == null ? !0 : (c == null && (c = {
|
|
2781
|
+
f: C.f,
|
|
2781
2782
|
isInArrayFormulaRange: !0
|
|
2782
2783
|
}), this._createArrayFormulaRangeShape(m, r), !1);
|
|
2783
2784
|
}
|
|
@@ -2794,15 +2795,15 @@ let Mt = class extends pt {
|
|
|
2794
2795
|
style: {
|
|
2795
2796
|
strokeWidth: 1,
|
|
2796
2797
|
stroke: i.hyacinth700,
|
|
2797
|
-
fill: new
|
|
2798
|
+
fill: new sn(i.colorWhite).setAlpha(0).toString(),
|
|
2798
2799
|
widgets: {}
|
|
2799
2800
|
}
|
|
2800
|
-
},
|
|
2801
|
+
}, l = Xt(c, r), { rowHeaderWidth: h, columnHeaderHeight: f } = r, m = new no(s, Or.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
2801
2802
|
highlightHeader: !1,
|
|
2802
2803
|
rowHeaderWidth: h,
|
|
2803
|
-
columnHeaderHeight:
|
|
2804
|
+
columnHeaderHeight: f
|
|
2804
2805
|
});
|
|
2805
|
-
m.updateRangeBySelectionWithCoord(
|
|
2806
|
+
m.updateRangeBySelectionWithCoord(l), m.setEvent(!1), this._previousShape = m;
|
|
2806
2807
|
}
|
|
2807
2808
|
_removeArrayFormulaRangeShape() {
|
|
2808
2809
|
this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
|
|
@@ -2825,55 +2826,55 @@ let Mt = class extends pt {
|
|
|
2825
2826
|
_refreshArrayFormulaRangeShapeByRow(e, n, o) {
|
|
2826
2827
|
if (!this._checkCurrentSheet(e, n) || !this._previousShape) return;
|
|
2827
2828
|
const { startRow: r, endRow: s, startColumn: i, endColumn: c } = this._previousShape.getRange();
|
|
2828
|
-
for (let
|
|
2829
|
-
const { row: h } = o[
|
|
2829
|
+
for (let l = 0; l < o.length; l++) {
|
|
2830
|
+
const { row: h } = o[l];
|
|
2830
2831
|
if (r >= h) {
|
|
2831
|
-
const
|
|
2832
|
+
const f = {
|
|
2832
2833
|
startRow: r,
|
|
2833
2834
|
endRow: s,
|
|
2834
2835
|
startColumn: i,
|
|
2835
2836
|
endColumn: c
|
|
2836
2837
|
};
|
|
2837
|
-
this._refreshArrayFormulaRangeShape(e,
|
|
2838
|
+
this._refreshArrayFormulaRangeShape(e, f);
|
|
2838
2839
|
break;
|
|
2839
2840
|
}
|
|
2840
2841
|
}
|
|
2841
2842
|
}
|
|
2842
2843
|
};
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
],
|
|
2852
|
-
var
|
|
2853
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
2844
|
+
Pt = Nc([
|
|
2845
|
+
We(1, K(fo)),
|
|
2846
|
+
We(2, K($t)),
|
|
2847
|
+
We(3, K(gt)),
|
|
2848
|
+
We(4, Ne),
|
|
2849
|
+
We(5, K(Lt)),
|
|
2850
|
+
We(6, ae),
|
|
2851
|
+
We(7, lr)
|
|
2852
|
+
], Pt);
|
|
2853
|
+
var Tc = Object.getOwnPropertyDescriptor, Fc = (t, e, n, o) => {
|
|
2854
|
+
for (var r = o > 1 ? void 0 : o ? Tc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2854
2855
|
(i = t[s]) && (r = i(r) || r);
|
|
2855
2856
|
return r;
|
|
2856
|
-
},
|
|
2857
|
-
const
|
|
2857
|
+
}, Yn = (t, e) => (n, o) => e(n, o, t);
|
|
2858
|
+
const Oc = {
|
|
2858
2859
|
tl: {
|
|
2859
2860
|
size: 6,
|
|
2860
2861
|
color: "#409f11"
|
|
2861
2862
|
}
|
|
2862
2863
|
};
|
|
2863
|
-
let
|
|
2864
|
+
let xt = class extends ar {
|
|
2864
2865
|
constructor(t, e) {
|
|
2865
2866
|
super(), this._sheetInterceptorService = t, this._formulaDataModel = e, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
2866
|
-
|
|
2867
|
+
ls.CELL_CONTENT,
|
|
2867
2868
|
{
|
|
2868
|
-
effect:
|
|
2869
|
+
effect: ur.Style,
|
|
2869
2870
|
handler: (n, o, r) => {
|
|
2870
|
-
var c,
|
|
2871
|
-
const s = (
|
|
2872
|
-
return
|
|
2871
|
+
var c, l, h, f;
|
|
2872
|
+
const s = (f = (h = (l = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : h[o.row]) == null ? void 0 : f[o.col];
|
|
2873
|
+
return Ho(n, !!s) ? r({
|
|
2873
2874
|
...n,
|
|
2874
2875
|
markers: {
|
|
2875
2876
|
...n == null ? void 0 : n.markers,
|
|
2876
|
-
...
|
|
2877
|
+
...Oc
|
|
2877
2878
|
}
|
|
2878
2879
|
}) : r(n);
|
|
2879
2880
|
},
|
|
@@ -2882,19 +2883,19 @@ let At = class extends ir {
|
|
|
2882
2883
|
));
|
|
2883
2884
|
}
|
|
2884
2885
|
};
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
],
|
|
2889
|
-
function
|
|
2890
|
-
const t = O(
|
|
2891
|
-
e.executeCommand(
|
|
2892
|
-
}, [e]), r =
|
|
2886
|
+
xt = Fc([
|
|
2887
|
+
Yn(0, K(fo)),
|
|
2888
|
+
Yn(1, K($t))
|
|
2889
|
+
], xt);
|
|
2890
|
+
function Mc() {
|
|
2891
|
+
const t = O(us), e = O(ae), n = qe(t.progress$), o = Ft(() => {
|
|
2892
|
+
e.executeCommand(Vr.id);
|
|
2893
|
+
}, [e]), r = Ft(() => {
|
|
2893
2894
|
t.clearProgress();
|
|
2894
2895
|
}, [t]);
|
|
2895
|
-
return /* @__PURE__ */ b(
|
|
2896
|
+
return /* @__PURE__ */ b(gs, { progress: n, onTerminate: o, onClearProgress: r });
|
|
2896
2897
|
}
|
|
2897
|
-
const
|
|
2898
|
+
const Ac = (t, e = 100) => {
|
|
2898
2899
|
L(() => {
|
|
2899
2900
|
let n = null;
|
|
2900
2901
|
const o = () => {
|
|
@@ -2906,86 +2907,86 @@ const Fc = (t, e = 100) => {
|
|
|
2906
2907
|
n !== null && clearTimeout(n), window.removeEventListener("scroll", o), window.removeEventListener("resize", o);
|
|
2907
2908
|
};
|
|
2908
2909
|
}, [t, e]);
|
|
2909
|
-
},
|
|
2910
|
-
formulaHelpFunction:
|
|
2911
|
-
formulaHelpFunctionTitle:
|
|
2912
|
-
formulaHelpFunctionTitleIcons:
|
|
2913
|
-
formulaHelpFunctionTitleIcon:
|
|
2914
|
-
formulaHelpFunctionContent:
|
|
2915
|
-
formulaHelpFunctionContentInner:
|
|
2916
|
-
formulaHelpFunctionContentParams:
|
|
2917
|
-
formulaHelpFunctionContentParamsTitle:
|
|
2918
|
-
formulaHelpFunctionContentParamsDetail:
|
|
2919
|
-
formulaHelpFunctionActive:
|
|
2920
|
-
formulaHelpDecorator:
|
|
2921
|
-
formulaHelpParam:
|
|
2922
|
-
formulaHelpParamPrefix:
|
|
2923
|
-
formulaHelpParamItem:
|
|
2924
|
-
formulaHelpParamActive:
|
|
2910
|
+
}, Pc = "univer-formula-help-function", xc = "univer-formula-help-function-title", wc = "univer-formula-help-function-title-icons", Dc = "univer-formula-help-function-title-icon", Lc = "univer-formula-help-function-content", $c = "univer-formula-help-function-content-inner", kc = "univer-formula-help-function-content-params", Hc = "univer-formula-help-function-content-params-title", Wc = "univer-formula-help-function-content-params-detail", Uc = "univer-formula-help-function-active", Vc = "univer-formula-help-decorator", Bc = "univer-formula-help-param", qc = "univer-formula-help-param-prefix", jc = "univer-formula-help-param-item", Kc = "univer-formula-help-param-active", G = {
|
|
2911
|
+
formulaHelpFunction: Pc,
|
|
2912
|
+
formulaHelpFunctionTitle: xc,
|
|
2913
|
+
formulaHelpFunctionTitleIcons: wc,
|
|
2914
|
+
formulaHelpFunctionTitleIcon: Dc,
|
|
2915
|
+
formulaHelpFunctionContent: Lc,
|
|
2916
|
+
formulaHelpFunctionContentInner: $c,
|
|
2917
|
+
formulaHelpFunctionContentParams: kc,
|
|
2918
|
+
formulaHelpFunctionContentParamsTitle: Hc,
|
|
2919
|
+
formulaHelpFunctionContentParamsDetail: Wc,
|
|
2920
|
+
formulaHelpFunctionActive: Uc,
|
|
2921
|
+
formulaHelpDecorator: Vc,
|
|
2922
|
+
formulaHelpParam: Bc,
|
|
2923
|
+
formulaHelpParamPrefix: qc,
|
|
2924
|
+
formulaHelpParamItem: jc,
|
|
2925
|
+
formulaHelpParamActive: Kc
|
|
2925
2926
|
};
|
|
2926
|
-
function
|
|
2927
|
-
const [t, e] =
|
|
2928
|
-
|
|
2929
|
-
const
|
|
2930
|
-
const { visible:
|
|
2931
|
-
if (!
|
|
2932
|
-
e(
|
|
2927
|
+
function Yc() {
|
|
2928
|
+
const [t, e] = $(!1), [n, o] = $(!0), [r, s] = $(!0), [i, c] = $(0), [l, h] = $([0, 0]), [f, m] = $({ left: 0, top: 0 }), [u, d] = $(null), a = O(Ct), I = O(je), g = I.t("formula.prompt.required"), p = I.t("formula.prompt.optional"), C = O(oe), S = O(be), v = O(Wt), _ = ps();
|
|
2929
|
+
Ac(T), L(() => {
|
|
2930
|
+
const R = a.help$.subscribe((P) => {
|
|
2931
|
+
const { visible: N, paramIndex: E, functionInfo: F } = P;
|
|
2932
|
+
if (!N) {
|
|
2933
|
+
e(N);
|
|
2933
2934
|
return;
|
|
2934
2935
|
}
|
|
2935
2936
|
const x = w();
|
|
2936
2937
|
if (x == null)
|
|
2937
2938
|
return;
|
|
2938
2939
|
const { left: H, top: V, height: te } = x;
|
|
2939
|
-
F.description === "" && F.functionParameter.length === 0 || (h([H, V + te]), c(E), d(F), m({ left: H, top: V }), e(
|
|
2940
|
-
}),
|
|
2940
|
+
F.description === "" && F.functionParameter.length === 0 || (h([H, V + te]), c(E), d(F), m({ left: H, top: V }), e(N));
|
|
2941
|
+
}), y = v.scrollEvent$.pipe(co(100)).subscribe(T);
|
|
2941
2942
|
return () => {
|
|
2942
|
-
|
|
2943
|
+
R == null || R.unsubscribe(), y.unsubscribe();
|
|
2943
2944
|
};
|
|
2944
2945
|
}, []);
|
|
2945
2946
|
function T() {
|
|
2946
2947
|
if (!r)
|
|
2947
2948
|
return;
|
|
2948
|
-
const
|
|
2949
|
-
if (
|
|
2949
|
+
const R = w();
|
|
2950
|
+
if (R == null)
|
|
2950
2951
|
return;
|
|
2951
|
-
const { left:
|
|
2952
|
-
h([
|
|
2952
|
+
const { left: y, top: P, height: N } = R;
|
|
2953
|
+
h([y, P + N]);
|
|
2953
2954
|
}
|
|
2954
2955
|
function w() {
|
|
2955
|
-
const
|
|
2956
|
-
if (!
|
|
2956
|
+
const R = C.getCurrentUniverDocInstance();
|
|
2957
|
+
if (!R)
|
|
2957
2958
|
return;
|
|
2958
|
-
const
|
|
2959
|
-
if (!
|
|
2959
|
+
const y = R.getUnitId();
|
|
2960
|
+
if (!S.isEditor(y))
|
|
2960
2961
|
return;
|
|
2961
|
-
const P =
|
|
2962
|
+
const P = S.getEditor(y);
|
|
2962
2963
|
return P == null ? void 0 : P.getBoundingClientRect();
|
|
2963
2964
|
}
|
|
2964
|
-
function A(
|
|
2965
|
-
c(
|
|
2965
|
+
function A(R) {
|
|
2966
|
+
c(R);
|
|
2966
2967
|
}
|
|
2967
2968
|
function M() {
|
|
2968
|
-
s(!r),
|
|
2969
|
+
s(!r), _.get(Ss).focus();
|
|
2969
2970
|
}
|
|
2970
|
-
return /* @__PURE__ */ b(ut, { children: r ? /* @__PURE__ */ b(
|
|
2971
|
-
/* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ b(ut, { children: r ? /* @__PURE__ */ b(Io, { visible: t, offset: l, children: u ? /* @__PURE__ */ k("div", { className: G.formulaHelpFunction, children: [
|
|
2972
|
+
/* @__PURE__ */ k("div", { className: G.formulaHelpFunctionTitle, children: [
|
|
2972
2973
|
/* @__PURE__ */ b(
|
|
2973
|
-
|
|
2974
|
+
zc,
|
|
2974
2975
|
{
|
|
2975
|
-
prefix:
|
|
2976
|
-
value:
|
|
2976
|
+
prefix: u.functionName,
|
|
2977
|
+
value: u.functionParameter,
|
|
2977
2978
|
active: i,
|
|
2978
2979
|
onClick: A
|
|
2979
2980
|
}
|
|
2980
2981
|
),
|
|
2981
|
-
/* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ k("div", { className: G.formulaHelpFunctionTitleIcons, children: [
|
|
2982
2983
|
/* @__PURE__ */ b(
|
|
2983
2984
|
"div",
|
|
2984
2985
|
{
|
|
2985
2986
|
className: G.formulaHelpFunctionTitleIcon,
|
|
2986
2987
|
style: { transform: n ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2987
2988
|
onClick: () => o(!n),
|
|
2988
|
-
children: /* @__PURE__ */ b(
|
|
2989
|
+
children: /* @__PURE__ */ b(gn, {})
|
|
2989
2990
|
}
|
|
2990
2991
|
),
|
|
2991
2992
|
/* @__PURE__ */ b(
|
|
@@ -2993,7 +2994,7 @@ function qc() {
|
|
|
2993
2994
|
{
|
|
2994
2995
|
className: G.formulaHelpFunctionTitleIcon,
|
|
2995
2996
|
onClick: M,
|
|
2996
|
-
children: /* @__PURE__ */ b(
|
|
2997
|
+
children: /* @__PURE__ */ b(Vt, {})
|
|
2997
2998
|
}
|
|
2998
2999
|
)
|
|
2999
3000
|
] })
|
|
@@ -3006,29 +3007,29 @@ function qc() {
|
|
|
3006
3007
|
height: n ? "unset" : 0,
|
|
3007
3008
|
padding: n ? "revert-layer" : 0
|
|
3008
3009
|
},
|
|
3009
|
-
children: /* @__PURE__ */
|
|
3010
|
+
children: /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionContentInner, children: [
|
|
3010
3011
|
/* @__PURE__ */ b(
|
|
3011
|
-
|
|
3012
|
+
Gt,
|
|
3012
3013
|
{
|
|
3013
|
-
title:
|
|
3014
|
-
value: `${
|
|
3014
|
+
title: I.t("formula.prompt.helpExample"),
|
|
3015
|
+
value: `${u.functionName}(${u.functionParameter.map((R) => R.example).join(",")})`
|
|
3015
3016
|
}
|
|
3016
3017
|
),
|
|
3017
3018
|
/* @__PURE__ */ b(
|
|
3018
|
-
|
|
3019
|
+
Gt,
|
|
3019
3020
|
{
|
|
3020
|
-
title:
|
|
3021
|
-
value:
|
|
3021
|
+
title: I.t("formula.prompt.helpAbstract"),
|
|
3022
|
+
value: u.description
|
|
3022
3023
|
}
|
|
3023
3024
|
),
|
|
3024
|
-
|
|
3025
|
-
|
|
3025
|
+
u && u.functionParameter && u.functionParameter.map((R, y) => /* @__PURE__ */ b(
|
|
3026
|
+
Gt,
|
|
3026
3027
|
{
|
|
3027
|
-
className: i ===
|
|
3028
|
-
title:
|
|
3029
|
-
value: `${
|
|
3028
|
+
className: i === y ? G.formulaHelpFunctionActive : "",
|
|
3029
|
+
title: R.name,
|
|
3030
|
+
value: `${R.require ? g : p} ${R.detail}`
|
|
3030
3031
|
},
|
|
3031
|
-
|
|
3032
|
+
y
|
|
3032
3033
|
))
|
|
3033
3034
|
] })
|
|
3034
3035
|
}
|
|
@@ -3038,12 +3039,12 @@ function qc() {
|
|
|
3038
3039
|
{
|
|
3039
3040
|
className: G.formulaHelpDecorator,
|
|
3040
3041
|
onClick: () => s(!r),
|
|
3041
|
-
style: { left:
|
|
3042
|
-
children: /* @__PURE__ */ b(
|
|
3042
|
+
style: { left: f.left - 24, top: f.top },
|
|
3043
|
+
children: /* @__PURE__ */ b(Ao, {})
|
|
3043
3044
|
}
|
|
3044
3045
|
) : /* @__PURE__ */ b(ut, {}) });
|
|
3045
3046
|
}
|
|
3046
|
-
const
|
|
3047
|
+
const Gt = (t) => /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionContentParams, children: [
|
|
3047
3048
|
/* @__PURE__ */ b(
|
|
3048
3049
|
"div",
|
|
3049
3050
|
{
|
|
@@ -3055,22 +3056,22 @@ const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionCon
|
|
|
3055
3056
|
}
|
|
3056
3057
|
),
|
|
3057
3058
|
/* @__PURE__ */ b("div", { className: G.formulaHelpFunctionContentParamsDetail, children: t.value })
|
|
3058
|
-
] }),
|
|
3059
|
+
] }), zc = (t) => {
|
|
3059
3060
|
const { prefix: e, value: n, active: o, onClick: r } = t;
|
|
3060
|
-
return /* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ k("div", { className: G.formulaHelpParam, children: [
|
|
3062
|
+
/* @__PURE__ */ k("span", { className: G.formulaHelpParamPrefix, children: [
|
|
3062
3063
|
e,
|
|
3063
3064
|
"("
|
|
3064
3065
|
] }),
|
|
3065
3066
|
n && n.map((s, i) => (
|
|
3066
3067
|
// TODO@Dushusir: more params needs to be active
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
+
/* @__PURE__ */ k("span", { className: G.formulaHelpParamItem, children: [
|
|
3068
3069
|
/* @__PURE__ */ b(
|
|
3069
3070
|
"span",
|
|
3070
3071
|
{
|
|
3071
3072
|
className: o === i ? G.formulaHelpFunctionActive : G.formulaHelpParamActive,
|
|
3072
3073
|
onClick: () => r(i),
|
|
3073
|
-
children:
|
|
3074
|
+
children: pn(s)
|
|
3074
3075
|
}
|
|
3075
3076
|
),
|
|
3076
3077
|
i === n.length - 1 ? "" : ","
|
|
@@ -3078,236 +3079,236 @@ const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionCon
|
|
|
3078
3079
|
)),
|
|
3079
3080
|
")"
|
|
3080
3081
|
] });
|
|
3081
|
-
},
|
|
3082
|
-
formulaSearchFunction:
|
|
3083
|
-
formulaSearchFunctionItem:
|
|
3084
|
-
formulaSearchFunctionItemName:
|
|
3085
|
-
formulaSearchFunctionItemNameLight:
|
|
3086
|
-
formulaSearchFunctionItemDesc:
|
|
3087
|
-
formulaSearchFunctionItemActive:
|
|
3082
|
+
}, Gc = "univer-formula-search-function", Zc = "univer-formula-search-function-item", Xc = "univer-formula-search-function-item-name", Qc = "univer-formula-search-function-item-name-light", Jc = "univer-formula-search-function-item-desc", el = "univer-formula-search-function-item-active", xe = {
|
|
3083
|
+
formulaSearchFunction: Gc,
|
|
3084
|
+
formulaSearchFunctionItem: Zc,
|
|
3085
|
+
formulaSearchFunctionItemName: Xc,
|
|
3086
|
+
formulaSearchFunctionItemNameLight: Qc,
|
|
3087
|
+
formulaSearchFunctionItemDesc: Jc,
|
|
3088
|
+
formulaSearchFunctionItemActive: el
|
|
3088
3089
|
};
|
|
3089
|
-
function
|
|
3090
|
-
const [t, e] =
|
|
3090
|
+
function tl() {
|
|
3091
|
+
const [t, e] = $(!1), [n, o] = $(0), [r, s] = $([0, 0]), [i, c] = $([]), [l, h] = $(""), f = j(null), m = O(Ct), u = O(oe), d = O(be);
|
|
3091
3092
|
L(() => {
|
|
3092
|
-
let
|
|
3093
|
+
let C = [], S = 0;
|
|
3093
3094
|
const v = m.search$.subscribe((w) => {
|
|
3094
|
-
const { visible: A, searchText: M, searchList:
|
|
3095
|
+
const { visible: A, searchText: M, searchList: R } = w;
|
|
3095
3096
|
if (!A) {
|
|
3096
3097
|
e(A);
|
|
3097
3098
|
return;
|
|
3098
3099
|
}
|
|
3099
|
-
const
|
|
3100
|
-
if (
|
|
3100
|
+
const y = a();
|
|
3101
|
+
if (y == null)
|
|
3101
3102
|
return;
|
|
3102
|
-
const { left: P, top:
|
|
3103
|
-
h(M), c(
|
|
3104
|
-
}),
|
|
3103
|
+
const { left: P, top: N, height: E } = y;
|
|
3104
|
+
h(M), c(R), C = R, s([P, N + E]), e(A), o(0), S = 0;
|
|
3105
|
+
}), _ = m.navigate$.subscribe((w) => {
|
|
3105
3106
|
const { direction: A } = w;
|
|
3106
3107
|
if (A === ne.UP) {
|
|
3107
|
-
let M =
|
|
3108
|
-
M = M < 0 ?
|
|
3108
|
+
let M = S - 1;
|
|
3109
|
+
M = M < 0 ? C.length - 1 : M, o(M), S = M;
|
|
3109
3110
|
} else if (A === ne.DOWN) {
|
|
3110
|
-
let M =
|
|
3111
|
-
M = M >=
|
|
3111
|
+
let M = S + 1;
|
|
3112
|
+
M = M >= C.length ? 0 : M, o(M), S = M;
|
|
3112
3113
|
}
|
|
3113
|
-
p(
|
|
3114
|
+
p(S);
|
|
3114
3115
|
}), T = m.accept$.subscribe((w) => {
|
|
3115
|
-
const A = S
|
|
3116
|
+
const A = C[S].name;
|
|
3116
3117
|
m.acceptFormulaName(A);
|
|
3117
3118
|
});
|
|
3118
3119
|
return () => {
|
|
3119
|
-
v == null || v.unsubscribe(),
|
|
3120
|
+
v == null || v.unsubscribe(), _ == null || _.unsubscribe(), T == null || T.unsubscribe();
|
|
3120
3121
|
};
|
|
3121
3122
|
}, []);
|
|
3122
|
-
function
|
|
3123
|
-
const
|
|
3124
|
-
if (!d.isEditor(
|
|
3123
|
+
function a() {
|
|
3124
|
+
const S = u.getCurrentUniverDocInstance().getUnitId();
|
|
3125
|
+
if (!d.isEditor(S))
|
|
3125
3126
|
return;
|
|
3126
|
-
const v = d.getEditor(
|
|
3127
|
+
const v = d.getEditor(S);
|
|
3127
3128
|
return v == null ? void 0 : v.getBoundingClientRect();
|
|
3128
3129
|
}
|
|
3129
|
-
function
|
|
3130
|
-
o(
|
|
3130
|
+
function I(C) {
|
|
3131
|
+
o(C);
|
|
3131
3132
|
}
|
|
3132
3133
|
function g() {
|
|
3133
3134
|
o(-1);
|
|
3134
3135
|
}
|
|
3135
|
-
function p(
|
|
3136
|
+
function p(C) {
|
|
3136
3137
|
var P;
|
|
3137
|
-
const
|
|
3138
|
-
if (!
|
|
3139
|
-
const v =
|
|
3138
|
+
const S = (P = f.current) == null ? void 0 : P.querySelectorAll(`.${xe.formulaSearchFunctionItem}`)[C];
|
|
3139
|
+
if (!S) return;
|
|
3140
|
+
const v = S.parentNode;
|
|
3140
3141
|
if (!v) return;
|
|
3141
|
-
const T = v.getBoundingClientRect().top, w = v.offsetHeight, A =
|
|
3142
|
-
if (M >= 0 && M > T && M - T +
|
|
3142
|
+
const T = v.getBoundingClientRect().top, w = v.offsetHeight, A = S.getBoundingClientRect(), M = A.top, R = A.height;
|
|
3143
|
+
if (M >= 0 && M > T && M - T + R <= w)
|
|
3143
3144
|
return;
|
|
3144
|
-
const
|
|
3145
|
+
const y = S.offsetTop - (w - R) / 2;
|
|
3145
3146
|
v.scrollTo({
|
|
3146
|
-
top:
|
|
3147
|
+
top: y,
|
|
3147
3148
|
behavior: "smooth"
|
|
3148
3149
|
});
|
|
3149
3150
|
}
|
|
3150
|
-
return i.length > 0 && /* @__PURE__ */ b(
|
|
3151
|
+
return i.length > 0 && /* @__PURE__ */ b(Io, { visible: t, offset: r, children: /* @__PURE__ */ b("ul", { className: xe.formulaSearchFunction, ref: f, children: i.map((C, S) => /* @__PURE__ */ k(
|
|
3151
3152
|
"li",
|
|
3152
3153
|
{
|
|
3153
|
-
className: n ===
|
|
3154
|
+
className: n === S ? `
|
|
3154
3155
|
${xe.formulaSearchFunctionItem}
|
|
3155
3156
|
${xe.formulaSearchFunctionItemActive}
|
|
3156
3157
|
` : xe.formulaSearchFunctionItem,
|
|
3157
|
-
onMouseEnter: () =>
|
|
3158
|
+
onMouseEnter: () => I(S),
|
|
3158
3159
|
onMouseLeave: g,
|
|
3159
|
-
onClick: () => m.acceptFormulaName(
|
|
3160
|
+
onClick: () => m.acceptFormulaName(C.name),
|
|
3160
3161
|
children: [
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemNameLight, children:
|
|
3163
|
-
/* @__PURE__ */ b("span", { children:
|
|
3162
|
+
/* @__PURE__ */ k("span", { className: xe.formulaSearchFunctionItemName, children: [
|
|
3163
|
+
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemNameLight, children: C.name.substring(0, l.length) }),
|
|
3164
|
+
/* @__PURE__ */ b("span", { children: C.name.slice(l.length) })
|
|
3164
3165
|
] }),
|
|
3165
|
-
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemDesc, children:
|
|
3166
|
+
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemDesc, children: C.desc })
|
|
3166
3167
|
]
|
|
3167
3168
|
},
|
|
3168
|
-
|
|
3169
|
+
S
|
|
3169
3170
|
)) }) });
|
|
3170
3171
|
}
|
|
3171
|
-
function
|
|
3172
|
-
return /* @__PURE__ */
|
|
3173
|
-
/* @__PURE__ */ b(
|
|
3174
|
-
/* @__PURE__ */ b(
|
|
3172
|
+
function nl() {
|
|
3173
|
+
return /* @__PURE__ */ k(ut, { children: [
|
|
3174
|
+
/* @__PURE__ */ b(tl, {}),
|
|
3175
|
+
/* @__PURE__ */ b(Yc, {})
|
|
3175
3176
|
] });
|
|
3176
3177
|
}
|
|
3177
|
-
const
|
|
3178
|
-
formulaMoreFunctions:
|
|
3179
|
-
formulaMoreFunctionsOperation:
|
|
3178
|
+
const ol = "univer-formula-more-functions", rl = "univer-formula-more-functions-operation", zn = {
|
|
3179
|
+
formulaMoreFunctions: ol,
|
|
3180
|
+
formulaMoreFunctionsOperation: rl
|
|
3180
3181
|
};
|
|
3181
|
-
function
|
|
3182
|
+
function Uo(t) {
|
|
3182
3183
|
const { prefix: e, value: n } = t;
|
|
3183
|
-
return /* @__PURE__ */
|
|
3184
|
-
/* @__PURE__ */
|
|
3184
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
3185
|
+
/* @__PURE__ */ k("span", { children: [
|
|
3185
3186
|
e,
|
|
3186
3187
|
"("
|
|
3187
3188
|
] }),
|
|
3188
|
-
n && n.map((o, r) => /* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */ b("span", { children:
|
|
3189
|
+
n && n.map((o, r) => /* @__PURE__ */ k("span", { children: [
|
|
3190
|
+
/* @__PURE__ */ b("span", { children: pn(o) }),
|
|
3190
3191
|
r === n.length - 1 ? "" : ","
|
|
3191
3192
|
] }, r)),
|
|
3192
3193
|
")"
|
|
3193
3194
|
] });
|
|
3194
3195
|
}
|
|
3195
|
-
const
|
|
3196
|
-
formulaFunctionParams:
|
|
3197
|
-
formulaFunctionParamsTitle:
|
|
3198
|
-
formulaFunctionParamsDetail:
|
|
3196
|
+
const sl = "univer-formula-function-params", il = "univer-formula-function-params-title", cl = "univer-formula-function-params-detail", Zt = {
|
|
3197
|
+
formulaFunctionParams: sl,
|
|
3198
|
+
formulaFunctionParamsTitle: il,
|
|
3199
|
+
formulaFunctionParamsDetail: cl
|
|
3199
3200
|
};
|
|
3200
3201
|
function at(t) {
|
|
3201
3202
|
const { className: e, value: n, title: o } = t;
|
|
3202
|
-
return /* @__PURE__ */
|
|
3203
|
+
return /* @__PURE__ */ k("div", { className: Zt.formulaFunctionParams, children: [
|
|
3203
3204
|
/* @__PURE__ */ b(
|
|
3204
3205
|
"div",
|
|
3205
3206
|
{
|
|
3206
3207
|
className: `
|
|
3207
|
-
${
|
|
3208
|
+
${Zt.formulaFunctionParamsTitle}
|
|
3208
3209
|
${e}
|
|
3209
3210
|
`,
|
|
3210
3211
|
children: o
|
|
3211
3212
|
}
|
|
3212
3213
|
),
|
|
3213
|
-
/* @__PURE__ */ b("div", { className:
|
|
3214
|
+
/* @__PURE__ */ b("div", { className: Zt.formulaFunctionParamsDetail, children: n })
|
|
3214
3215
|
] });
|
|
3215
3216
|
}
|
|
3216
|
-
const
|
|
3217
|
-
formulaInputParamsList:
|
|
3218
|
-
formulaInputParamsListItemName:
|
|
3219
|
-
formulaInputParamsListItemSelector:
|
|
3217
|
+
const ll = "univer-formula-input-params-list", al = "univer-formula-input-params-list-item-name", ul = "univer-formula-input-params-list-item-selector", lt = {
|
|
3218
|
+
formulaInputParamsList: ll,
|
|
3219
|
+
formulaInputParamsListItemName: al,
|
|
3220
|
+
formulaInputParamsListItemSelector: ul
|
|
3220
3221
|
};
|
|
3221
|
-
function
|
|
3222
|
+
function fl(t) {
|
|
3222
3223
|
const { functionInfo: e, onChange: n } = t;
|
|
3223
3224
|
if (!e) return null;
|
|
3224
|
-
const [o, r] =
|
|
3225
|
-
return /* @__PURE__ */
|
|
3226
|
-
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsList, children: s.map((h,
|
|
3225
|
+
const [o, r] = $([]), [s, i] = $(e.functionParameter), [c, l] = $(-1);
|
|
3226
|
+
return /* @__PURE__ */ k("div", { className: lt.formulaInputParams, children: [
|
|
3227
|
+
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsList, children: s.map((h, f) => /* @__PURE__ */ k("div", { children: [
|
|
3227
3228
|
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemName, children: h.name }),
|
|
3228
3229
|
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemSelector })
|
|
3229
|
-
] },
|
|
3230
|
+
] }, f)) }),
|
|
3230
3231
|
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsInfo, children: /* @__PURE__ */ b(
|
|
3231
3232
|
at,
|
|
3232
3233
|
{
|
|
3233
|
-
title: c === -1 ? /* @__PURE__ */ b(
|
|
3234
|
+
title: c === -1 ? /* @__PURE__ */ b(Uo, { prefix: e.functionName, value: s }) : s[c].name,
|
|
3234
3235
|
value: c === -1 ? e.description : s[c].detail
|
|
3235
3236
|
}
|
|
3236
3237
|
) })
|
|
3237
3238
|
] });
|
|
3238
3239
|
}
|
|
3239
|
-
const
|
|
3240
|
-
formulaSelectFunctionSelect:
|
|
3241
|
-
formulaSelectFunctionResult:
|
|
3242
|
-
formulaSelectFunctionResultItem:
|
|
3243
|
-
formulaSelectFunctionResultItemNameLight:
|
|
3244
|
-
formulaSelectFunctionResultItemSelected:
|
|
3245
|
-
formulaSelectFunctionResultItemActive:
|
|
3246
|
-
formulaSelectFunctionContent:
|
|
3240
|
+
const hl = "univer-formula-select-function-select", dl = "univer-formula-select-function-result", ml = "univer-formula-select-function-result-item", gl = "univer-formula-select-function-result-item-name-light", pl = "univer-formula-select-function-result-item-selected", Sl = "univer-formula-select-function-result-item-active", Cl = "univer-formula-select-function-content", _e = {
|
|
3241
|
+
formulaSelectFunctionSelect: hl,
|
|
3242
|
+
formulaSelectFunctionResult: dl,
|
|
3243
|
+
formulaSelectFunctionResultItem: ml,
|
|
3244
|
+
formulaSelectFunctionResultItemNameLight: gl,
|
|
3245
|
+
formulaSelectFunctionResultItemSelected: pl,
|
|
3246
|
+
formulaSelectFunctionResultItemActive: Sl,
|
|
3247
|
+
formulaSelectFunctionContent: Cl
|
|
3247
3248
|
};
|
|
3248
|
-
function
|
|
3249
|
-
const { onChange: e } = t, n = "-1", [o, r] =
|
|
3250
|
-
|
|
3249
|
+
function vl(t) {
|
|
3250
|
+
const { onChange: e } = t, n = "-1", [o, r] = $(""), [s, i] = $([]), [c, l] = $(0), [h, f] = $(n), [m, u] = $(0), [d, a] = $(null), I = O(Ht), g = O(je), p = O(Wt), C = qe(p.sidebarOptions$), S = zs(Br, g);
|
|
3251
|
+
S.unshift({
|
|
3251
3252
|
label: g.t("formula.moreFunctions.allFunctions"),
|
|
3252
3253
|
value: n
|
|
3253
3254
|
});
|
|
3254
|
-
const v = g.t("formula.prompt.required"),
|
|
3255
|
+
const v = g.t("formula.prompt.required"), _ = g.t("formula.prompt.optional");
|
|
3255
3256
|
L(() => {
|
|
3256
3257
|
A(n);
|
|
3257
3258
|
}, []), L(() => {
|
|
3258
3259
|
w(0);
|
|
3259
3260
|
}, [s]), L(() => {
|
|
3260
|
-
|
|
3261
|
-
}, [
|
|
3262
|
-
const T = (
|
|
3263
|
-
if (o.trim() === "") return
|
|
3261
|
+
C != null && C.visible && (r(""), i([]), l(0), f(n), u(0), a(null), A(n));
|
|
3262
|
+
}, [C]);
|
|
3263
|
+
const T = (N) => {
|
|
3264
|
+
if (o.trim() === "") return N;
|
|
3264
3265
|
const E = new RegExp(`(${o.toLocaleUpperCase()})`);
|
|
3265
|
-
return
|
|
3266
|
-
}, w = (
|
|
3266
|
+
return N.split(E).filter(Boolean).map((x, H) => x.match(E) ? /* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemNameLight, children: x }, H) : x);
|
|
3267
|
+
}, w = (N) => {
|
|
3267
3268
|
if (s.length === 0) {
|
|
3268
|
-
|
|
3269
|
+
a(null);
|
|
3269
3270
|
return;
|
|
3270
3271
|
}
|
|
3271
|
-
|
|
3272
|
-
const E =
|
|
3272
|
+
u(N);
|
|
3273
|
+
const E = I.getFunctionInfo(s[N].name);
|
|
3273
3274
|
if (!E) {
|
|
3274
|
-
|
|
3275
|
+
a(null);
|
|
3275
3276
|
return;
|
|
3276
3277
|
}
|
|
3277
|
-
|
|
3278
|
+
a(E), e(E);
|
|
3278
3279
|
};
|
|
3279
|
-
function A(
|
|
3280
|
-
|
|
3281
|
-
const E =
|
|
3280
|
+
function A(N) {
|
|
3281
|
+
f(N);
|
|
3282
|
+
const E = I.getSearchListByType(+N);
|
|
3282
3283
|
i(E);
|
|
3283
3284
|
}
|
|
3284
|
-
function M(
|
|
3285
|
-
r(
|
|
3286
|
-
const E =
|
|
3285
|
+
function M(N) {
|
|
3286
|
+
r(N);
|
|
3287
|
+
const E = I.getSearchListByName(N);
|
|
3287
3288
|
i(E);
|
|
3288
3289
|
}
|
|
3289
|
-
function
|
|
3290
|
-
if (
|
|
3290
|
+
function R(N) {
|
|
3291
|
+
if (N.stopPropagation(), N.key === "ArrowDown") {
|
|
3291
3292
|
const E = c + 1;
|
|
3292
|
-
|
|
3293
|
-
} else if (
|
|
3293
|
+
l(E === s.length ? 0 : E);
|
|
3294
|
+
} else if (N.key === "ArrowUp") {
|
|
3294
3295
|
const E = c - 1;
|
|
3295
|
-
|
|
3296
|
-
} else
|
|
3296
|
+
l(E === -1 ? s.length - 1 : E);
|
|
3297
|
+
} else N.key === "Enter" && w(c);
|
|
3297
3298
|
}
|
|
3298
|
-
const
|
|
3299
|
-
|
|
3299
|
+
const y = (N) => {
|
|
3300
|
+
l(N);
|
|
3300
3301
|
}, P = () => {
|
|
3301
|
-
|
|
3302
|
+
l(-1);
|
|
3302
3303
|
};
|
|
3303
|
-
return /* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */ b(
|
|
3304
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
3305
|
+
/* @__PURE__ */ k("div", { className: _e.formulaSelectFunctionSelect, children: [
|
|
3306
|
+
/* @__PURE__ */ b(Es, { value: h, options: S, onChange: A }),
|
|
3306
3307
|
/* @__PURE__ */ b(
|
|
3307
|
-
|
|
3308
|
+
Ro,
|
|
3308
3309
|
{
|
|
3309
3310
|
placeholder: g.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
3310
|
-
onKeyDown:
|
|
3311
|
+
onKeyDown: R,
|
|
3311
3312
|
value: o,
|
|
3312
3313
|
onChange: M,
|
|
3313
3314
|
size: "small",
|
|
@@ -3315,85 +3316,85 @@ function pl(t) {
|
|
|
3315
3316
|
}
|
|
3316
3317
|
)
|
|
3317
3318
|
] }),
|
|
3318
|
-
/* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown:
|
|
3319
|
+
/* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown: R, tabIndex: -1, children: s.map(({ name: N }, E) => /* @__PURE__ */ k(
|
|
3319
3320
|
"li",
|
|
3320
3321
|
{
|
|
3321
3322
|
className: c === E ? `
|
|
3322
3323
|
${_e.formulaSelectFunctionResultItem}
|
|
3323
3324
|
${_e.formulaSelectFunctionResultItemActive}
|
|
3324
3325
|
` : _e.formulaSelectFunctionResultItem,
|
|
3325
|
-
onMouseEnter: () =>
|
|
3326
|
+
onMouseEnter: () => y(E),
|
|
3326
3327
|
onMouseLeave: P,
|
|
3327
3328
|
onClick: () => w(E),
|
|
3328
3329
|
children: [
|
|
3329
|
-
m === E && /* @__PURE__ */ b(
|
|
3330
|
-
/* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemName, children: T(
|
|
3330
|
+
m === E && /* @__PURE__ */ b(Oo, { className: _e.formulaSelectFunctionResultItemSelected }),
|
|
3331
|
+
/* @__PURE__ */ b("span", { className: _e.formulaSelectFunctionResultItemName, children: T(N) })
|
|
3331
3332
|
]
|
|
3332
3333
|
},
|
|
3333
3334
|
E
|
|
3334
3335
|
)) }),
|
|
3335
|
-
d && /* @__PURE__ */
|
|
3336
|
+
d && /* @__PURE__ */ k("div", { className: _e.formulaSelectFunctionContent, children: [
|
|
3336
3337
|
/* @__PURE__ */ b(at, { title: d.functionName, value: d.description }),
|
|
3337
3338
|
/* @__PURE__ */ b(
|
|
3338
3339
|
at,
|
|
3339
3340
|
{
|
|
3340
3341
|
title: g.t("formula.moreFunctions.syntax"),
|
|
3341
|
-
value: /* @__PURE__ */ b(
|
|
3342
|
+
value: /* @__PURE__ */ b(Uo, { prefix: d.functionName, value: d.functionParameter })
|
|
3342
3343
|
}
|
|
3343
3344
|
),
|
|
3344
3345
|
/* @__PURE__ */ b(
|
|
3345
3346
|
at,
|
|
3346
3347
|
{
|
|
3347
3348
|
title: g.t("formula.prompt.helpExample"),
|
|
3348
|
-
value: `${d.functionName}(${d.functionParameter.map((
|
|
3349
|
+
value: `${d.functionName}(${d.functionParameter.map((N) => N.example).join(",")})`
|
|
3349
3350
|
}
|
|
3350
3351
|
),
|
|
3351
|
-
d.functionParameter && d.functionParameter.map((
|
|
3352
|
+
d.functionParameter && d.functionParameter.map((N) => /* @__PURE__ */ b(
|
|
3352
3353
|
at,
|
|
3353
3354
|
{
|
|
3354
|
-
title:
|
|
3355
|
-
value: `${
|
|
3355
|
+
title: N.name,
|
|
3356
|
+
value: `${N.require ? v : _} ${N.detail}`
|
|
3356
3357
|
},
|
|
3357
|
-
|
|
3358
|
+
N.name
|
|
3358
3359
|
))
|
|
3359
3360
|
] })
|
|
3360
3361
|
] });
|
|
3361
3362
|
}
|
|
3362
|
-
function
|
|
3363
|
-
const t =
|
|
3364
|
-
O(
|
|
3365
|
-
const c = O(
|
|
3363
|
+
function _l() {
|
|
3364
|
+
const t = Mr(), [e, n] = $(!0), [o, r] = $(!1), [s, i] = $(null);
|
|
3365
|
+
O(Jn);
|
|
3366
|
+
const c = O(je), l = O(be), h = O(oe), f = O(ae);
|
|
3366
3367
|
function m() {
|
|
3367
3368
|
n(!e), r(!o);
|
|
3368
3369
|
}
|
|
3369
|
-
function
|
|
3370
|
-
const d =
|
|
3370
|
+
function u() {
|
|
3371
|
+
const d = uo(h);
|
|
3371
3372
|
if (!d) return;
|
|
3372
|
-
|
|
3373
|
+
f.executeCommand(eo.id, {
|
|
3373
3374
|
visible: !0,
|
|
3374
3375
|
unitId: d.unitId,
|
|
3375
|
-
eventType:
|
|
3376
|
+
eventType: ye.Dblclick
|
|
3376
3377
|
});
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3378
|
+
const a = l.getEditor(rn), I = l.getEditor(Zn), g = `=${s == null ? void 0 : s.functionName}(`;
|
|
3379
|
+
a == null || a.replaceText(g), I == null || I.replaceText(g, !1);
|
|
3379
3380
|
}
|
|
3380
|
-
return /* @__PURE__ */
|
|
3381
|
-
e && /* @__PURE__ */ b(
|
|
3382
|
-
o && /* @__PURE__ */ b(
|
|
3381
|
+
return /* @__PURE__ */ k("div", { className: zn.formulaMoreFunctions, children: [
|
|
3382
|
+
e && /* @__PURE__ */ b(vl, { onChange: i }),
|
|
3383
|
+
o && /* @__PURE__ */ b(fl, { functionInfo: s, onChange: () => {
|
|
3383
3384
|
} }),
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
o && /* @__PURE__ */ b(
|
|
3386
|
-
o && /* @__PURE__ */ b(
|
|
3387
|
-
e && !!t && /* @__PURE__ */ b(
|
|
3385
|
+
/* @__PURE__ */ k("div", { className: zn.formulaMoreFunctionsOperation, children: [
|
|
3386
|
+
o && /* @__PURE__ */ b(et, { type: "primary", size: "small", onClick: m, children: c.t("formula.moreFunctions.next") }),
|
|
3387
|
+
o && /* @__PURE__ */ b(et, { size: "small", onClick: m, children: c.t("formula.moreFunctions.prev") }),
|
|
3388
|
+
e && !!t && /* @__PURE__ */ b(et, { type: "primary", size: "small", onClick: u, children: c.t("formula.moreFunctions.confirm") })
|
|
3388
3389
|
] })
|
|
3389
3390
|
] });
|
|
3390
3391
|
}
|
|
3391
|
-
function
|
|
3392
|
+
function Rl(t) {
|
|
3392
3393
|
return {
|
|
3393
|
-
id:
|
|
3394
|
+
id: hn.id,
|
|
3394
3395
|
icon: "FunctionSingle",
|
|
3395
3396
|
tooltip: "formula.insert.tooltip",
|
|
3396
|
-
type:
|
|
3397
|
+
type: un.SELECTOR,
|
|
3397
3398
|
selections: [
|
|
3398
3399
|
{
|
|
3399
3400
|
label: {
|
|
@@ -3436,141 +3437,141 @@ function Cl(t) {
|
|
|
3436
3437
|
icon: "MinSingle"
|
|
3437
3438
|
}
|
|
3438
3439
|
],
|
|
3439
|
-
hidden$:
|
|
3440
|
-
disabled$:
|
|
3440
|
+
hidden$: Cs(t, ue.UNIVER_SHEET),
|
|
3441
|
+
disabled$: ro(t, { workbookTypes: [po], worksheetTypes: [mo, ho], rangeTypes: [go] })
|
|
3441
3442
|
};
|
|
3442
3443
|
}
|
|
3443
|
-
function
|
|
3444
|
+
function Il(t) {
|
|
3444
3445
|
return {
|
|
3445
|
-
id:
|
|
3446
|
+
id: dn.id,
|
|
3446
3447
|
title: "formula.insert.more",
|
|
3447
|
-
type:
|
|
3448
|
+
type: un.BUTTON
|
|
3448
3449
|
};
|
|
3449
3450
|
}
|
|
3450
|
-
function
|
|
3451
|
+
function El(t) {
|
|
3451
3452
|
return t.get(oe).getCurrentTypeOfUnit$(ue.UNIVER_SHEET).pipe(
|
|
3452
|
-
|
|
3453
|
+
zr((o) => o ? t.get(kn) ? new Gr((s) => s.next(!t.get(kn).supportClipboard)) : An(!0) : An(!0))
|
|
3453
3454
|
);
|
|
3454
3455
|
}
|
|
3455
|
-
function
|
|
3456
|
+
function bl(t) {
|
|
3456
3457
|
return {
|
|
3457
|
-
id:
|
|
3458
|
-
type:
|
|
3458
|
+
id: fn.id,
|
|
3459
|
+
type: un.BUTTON,
|
|
3459
3460
|
title: "formula.operation.pasteFormula",
|
|
3460
|
-
disabled$:
|
|
3461
|
-
|
|
3462
|
-
|
|
3461
|
+
disabled$: El(t).pipe(
|
|
3462
|
+
Yr(ro(t, { workbookTypes: [po], rangeTypes: [go], worksheetTypes: [ho, mo] })),
|
|
3463
|
+
lo(([e, n]) => e || n)
|
|
3463
3464
|
)
|
|
3464
3465
|
};
|
|
3465
3466
|
}
|
|
3466
|
-
const
|
|
3467
|
-
[
|
|
3468
|
-
[
|
|
3467
|
+
const yl = {
|
|
3468
|
+
[vs.FORMULAS_INSERT]: {
|
|
3469
|
+
[hn.id]: {
|
|
3469
3470
|
order: 1,
|
|
3470
|
-
menuItemFactory:
|
|
3471
|
-
[
|
|
3471
|
+
menuItemFactory: Rl,
|
|
3472
|
+
[dn.id]: {
|
|
3472
3473
|
order: 1,
|
|
3473
|
-
menuItemFactory:
|
|
3474
|
+
menuItemFactory: Il
|
|
3474
3475
|
}
|
|
3475
3476
|
}
|
|
3476
3477
|
},
|
|
3477
|
-
[
|
|
3478
|
-
[
|
|
3478
|
+
[Ar]: {
|
|
3479
|
+
[fn.id]: {
|
|
3479
3480
|
order: 4,
|
|
3480
|
-
menuItemFactory:
|
|
3481
|
+
menuItemFactory: bl
|
|
3481
3482
|
}
|
|
3482
3483
|
}
|
|
3483
|
-
},
|
|
3484
|
+
}, Nl = "meta_key_ctrl_And_Shift", Bt = [
|
|
3484
3485
|
D.ARROW_DOWN,
|
|
3485
3486
|
D.ARROW_UP,
|
|
3486
3487
|
D.ARROW_LEFT,
|
|
3487
3488
|
D.ARROW_RIGHT
|
|
3488
|
-
],
|
|
3489
|
-
function
|
|
3489
|
+
], Tl = [...Bt, D.ENTER, D.TAB, D.ESC];
|
|
3490
|
+
function Fl() {
|
|
3490
3491
|
const t = [];
|
|
3491
|
-
for (const e of
|
|
3492
|
+
for (const e of Tl)
|
|
3492
3493
|
t.push({
|
|
3493
|
-
id:
|
|
3494
|
+
id: rt.id,
|
|
3494
3495
|
binding: e,
|
|
3495
3496
|
preconditions: (n) => St(n),
|
|
3496
3497
|
staticParameters: {
|
|
3497
|
-
eventType:
|
|
3498
|
+
eventType: ye.Keyboard,
|
|
3498
3499
|
keycode: e
|
|
3499
3500
|
}
|
|
3500
3501
|
});
|
|
3501
3502
|
return t;
|
|
3502
3503
|
}
|
|
3503
|
-
function
|
|
3504
|
+
function Ol() {
|
|
3504
3505
|
const t = [];
|
|
3505
|
-
for (const e of
|
|
3506
|
+
for (const e of Bt)
|
|
3506
3507
|
t.push({
|
|
3507
|
-
id:
|
|
3508
|
+
id: rt.id,
|
|
3508
3509
|
binding: e | U.SHIFT,
|
|
3509
3510
|
preconditions: (n) => St(n),
|
|
3510
3511
|
staticParameters: {
|
|
3511
|
-
eventType:
|
|
3512
|
+
eventType: ye.Keyboard,
|
|
3512
3513
|
keycode: e,
|
|
3513
3514
|
metaKey: U.SHIFT
|
|
3514
3515
|
}
|
|
3515
3516
|
});
|
|
3516
3517
|
return t;
|
|
3517
3518
|
}
|
|
3518
|
-
function
|
|
3519
|
+
function Ml() {
|
|
3519
3520
|
const t = [];
|
|
3520
|
-
for (const e of
|
|
3521
|
+
for (const e of Bt)
|
|
3521
3522
|
t.push({
|
|
3522
|
-
id:
|
|
3523
|
+
id: rt.id,
|
|
3523
3524
|
binding: e | U.CTRL_COMMAND,
|
|
3524
3525
|
preconditions: (n) => St(n),
|
|
3525
3526
|
staticParameters: {
|
|
3526
|
-
eventType:
|
|
3527
|
+
eventType: ye.Keyboard,
|
|
3527
3528
|
keycode: e,
|
|
3528
3529
|
metaKey: U.CTRL_COMMAND
|
|
3529
3530
|
}
|
|
3530
3531
|
});
|
|
3531
3532
|
return t;
|
|
3532
3533
|
}
|
|
3533
|
-
function
|
|
3534
|
+
function Al() {
|
|
3534
3535
|
const t = [];
|
|
3535
|
-
for (const e of
|
|
3536
|
+
for (const e of Bt)
|
|
3536
3537
|
t.push({
|
|
3537
|
-
id:
|
|
3538
|
+
id: rt.id,
|
|
3538
3539
|
binding: e | U.SHIFT | U.CTRL_COMMAND,
|
|
3539
3540
|
preconditions: (n) => St(n),
|
|
3540
3541
|
staticParameters: {
|
|
3541
|
-
eventType:
|
|
3542
|
+
eventType: ye.Keyboard,
|
|
3542
3543
|
keycode: e,
|
|
3543
|
-
metaKey:
|
|
3544
|
+
metaKey: Nl
|
|
3544
3545
|
}
|
|
3545
3546
|
});
|
|
3546
3547
|
return t;
|
|
3547
3548
|
}
|
|
3548
|
-
const
|
|
3549
|
-
id:
|
|
3549
|
+
const Pl = {
|
|
3550
|
+
id: No.id,
|
|
3550
3551
|
binding: D.F4,
|
|
3551
3552
|
preconditions: (t) => St(t)
|
|
3552
3553
|
};
|
|
3553
|
-
function
|
|
3554
|
+
function xl() {
|
|
3554
3555
|
const t = [];
|
|
3555
3556
|
for (const e of [D.ENTER, D.TAB, D.ARROW_DOWN, D.ARROW_UP])
|
|
3556
3557
|
t.push({
|
|
3557
|
-
id:
|
|
3558
|
+
id: rt.id,
|
|
3558
3559
|
binding: e,
|
|
3559
|
-
preconditions: (n) =>
|
|
3560
|
+
preconditions: (n) => lc(n),
|
|
3560
3561
|
staticParameters: {
|
|
3561
|
-
eventType:
|
|
3562
|
+
eventType: ye.Keyboard,
|
|
3562
3563
|
keycode: e,
|
|
3563
3564
|
isSingleEditor: !0
|
|
3564
3565
|
}
|
|
3565
3566
|
});
|
|
3566
3567
|
return t;
|
|
3567
3568
|
}
|
|
3568
|
-
var
|
|
3569
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3569
|
+
var wl = Object.getOwnPropertyDescriptor, Dl = (t, e, n, o) => {
|
|
3570
|
+
for (var r = o > 1 ? void 0 : o ? wl(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
3570
3571
|
(i = t[s]) && (r = i(r) || r);
|
|
3571
3572
|
return r;
|
|
3572
|
-
},
|
|
3573
|
-
let
|
|
3573
|
+
}, Ue = (t, e) => (n, o) => e(n, o, t);
|
|
3574
|
+
let wt = class extends pt {
|
|
3574
3575
|
constructor(t, e, n, o, r, s, i) {
|
|
3575
3576
|
super(), this._injector = t, this._menuManagerService = e, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
|
|
3576
3577
|
}
|
|
@@ -3578,50 +3579,50 @@ let Pt = class extends pt {
|
|
|
3578
3579
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
3579
3580
|
}
|
|
3580
3581
|
_registerMenus() {
|
|
3581
|
-
this._menuManagerService.mergeMenu(
|
|
3582
|
+
this._menuManagerService.mergeMenu(yl);
|
|
3582
3583
|
}
|
|
3583
3584
|
_registerCommands() {
|
|
3584
3585
|
[
|
|
3585
|
-
an,
|
|
3586
|
-
un,
|
|
3587
3586
|
fn,
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3587
|
+
hn,
|
|
3588
|
+
dn,
|
|
3589
|
+
Ls,
|
|
3590
|
+
Os,
|
|
3591
|
+
rt,
|
|
3592
|
+
No
|
|
3592
3593
|
].forEach((t) => this.disposeWithMe(this._commandService.registerCommand(t)));
|
|
3593
3594
|
}
|
|
3594
3595
|
_registerShortcuts() {
|
|
3595
3596
|
[
|
|
3596
|
-
...Nl(),
|
|
3597
|
-
...yl(),
|
|
3598
|
-
...Tl(),
|
|
3599
3597
|
...Fl(),
|
|
3598
|
+
...Ol(),
|
|
3600
3599
|
...Ml(),
|
|
3601
|
-
|
|
3600
|
+
...Al(),
|
|
3601
|
+
...xl(),
|
|
3602
|
+
Pl
|
|
3602
3603
|
].forEach((t) => {
|
|
3603
3604
|
this.disposeWithMe(this._shortcutService.registerShortcut(t));
|
|
3604
3605
|
});
|
|
3605
3606
|
}
|
|
3606
3607
|
_registerComponents() {
|
|
3607
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
3608
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(_o.CONTENT, () => Jt(nl, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(Pr.FORMULA_AUX, () => Jt(Mc, this._injector))), this._componentManager.register(yo, _l);
|
|
3608
3609
|
}
|
|
3609
3610
|
_registerRenderModules() {
|
|
3610
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, [
|
|
3611
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, [Pt]));
|
|
3611
3612
|
}
|
|
3612
3613
|
};
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
],
|
|
3622
|
-
const
|
|
3614
|
+
wt = Dl([
|
|
3615
|
+
Ue(0, K(mt)),
|
|
3616
|
+
Ue(1, _s),
|
|
3617
|
+
Ue(2, ae),
|
|
3618
|
+
Ue(3, Ut),
|
|
3619
|
+
Ue(4, Co),
|
|
3620
|
+
Ue(5, Ne),
|
|
3621
|
+
Ue(6, K(vo))
|
|
3622
|
+
], wt);
|
|
3623
|
+
const Ll = () => {
|
|
3623
3624
|
var o, r;
|
|
3624
|
-
const t = O(
|
|
3625
|
+
const t = O(ko), e = qe(t.currentSelector$), n = j(null);
|
|
3625
3626
|
return L(() => {
|
|
3626
3627
|
var s, i;
|
|
3627
3628
|
if (e)
|
|
@@ -3630,7 +3631,7 @@ const xl = () => {
|
|
|
3630
3631
|
(c = n.current) == null || c.hideDialog();
|
|
3631
3632
|
};
|
|
3632
3633
|
}, [e]), /* @__PURE__ */ b(
|
|
3633
|
-
|
|
3634
|
+
$o,
|
|
3634
3635
|
{
|
|
3635
3636
|
unitId: (o = e == null ? void 0 : e.unitId) != null ? o : "",
|
|
3636
3637
|
subUnitId: (r = e == null ? void 0 : e.subUnitId) != null ? r : "",
|
|
@@ -3638,78 +3639,78 @@ const xl = () => {
|
|
|
3638
3639
|
selectorRef: n,
|
|
3639
3640
|
onChange: (s, i) => {
|
|
3640
3641
|
var c;
|
|
3641
|
-
e == null || e.callback((c = i == null ? void 0 : i.split(",").map((
|
|
3642
|
+
e == null || e.callback((c = i == null ? void 0 : i.split(",").map((l) => ot(l))) != null ? c : []);
|
|
3642
3643
|
}
|
|
3643
3644
|
}
|
|
3644
3645
|
);
|
|
3645
3646
|
};
|
|
3646
|
-
var
|
|
3647
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3647
|
+
var $l = Object.defineProperty, kl = Object.getOwnPropertyDescriptor, Hl = (t, e, n) => e in t ? $l(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Wl = (t, e, n, o) => {
|
|
3648
|
+
for (var r = o > 1 ? void 0 : o ? kl(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
3648
3649
|
(i = t[s]) && (r = i(r) || r);
|
|
3649
3650
|
return r;
|
|
3650
|
-
},
|
|
3651
|
-
let
|
|
3652
|
-
constructor(t =
|
|
3651
|
+
}, Nt = (t, e) => (n, o) => e(n, o, t), Vo = (t, e, n) => Hl(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3652
|
+
let Dt = class extends dr {
|
|
3653
|
+
constructor(t = jn, e, n, o, r) {
|
|
3653
3654
|
super(), this._config = t, this._injector = e, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3654
|
-
const { menu: s, ...i } =
|
|
3655
|
-
|
|
3655
|
+
const { menu: s, ...i } = mr(
|
|
3656
|
+
jn,
|
|
3656
3657
|
this._config
|
|
3657
3658
|
);
|
|
3658
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3659
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(cc, i, { merge: !0 });
|
|
3659
3660
|
}
|
|
3660
3661
|
onStarting() {
|
|
3661
|
-
|
|
3662
|
-
[Ct, { useClass:
|
|
3663
|
-
[
|
|
3664
|
-
[
|
|
3665
|
-
[Ft],
|
|
3666
|
-
[Ot],
|
|
3662
|
+
gr(this._injector, [
|
|
3663
|
+
[Ct, { useClass: en }],
|
|
3664
|
+
[ko],
|
|
3665
|
+
[wt],
|
|
3667
3666
|
[Mt],
|
|
3668
|
-
[At]
|
|
3667
|
+
[At],
|
|
3668
|
+
[Pt],
|
|
3669
|
+
[xt]
|
|
3669
3670
|
]);
|
|
3670
3671
|
}
|
|
3671
3672
|
onRendered() {
|
|
3672
3673
|
[
|
|
3673
3674
|
[De],
|
|
3674
|
-
[
|
|
3675
|
+
[nn]
|
|
3675
3676
|
].forEach((t) => {
|
|
3676
3677
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, t));
|
|
3677
|
-
}),
|
|
3678
|
-
[
|
|
3678
|
+
}), pr(this._injector, [
|
|
3679
|
+
[wt],
|
|
3679
3680
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3680
|
-
[
|
|
3681
|
-
[
|
|
3681
|
+
[At],
|
|
3682
|
+
[xt]
|
|
3682
3683
|
]), this._initUIPart();
|
|
3683
3684
|
}
|
|
3684
3685
|
onSteady() {
|
|
3685
|
-
this._injector.get(
|
|
3686
|
+
this._injector.get(Mt);
|
|
3686
3687
|
}
|
|
3687
3688
|
_initUIPart() {
|
|
3688
|
-
const t = this._injector.get(
|
|
3689
|
-
this.disposeWithMe(t.register(
|
|
3689
|
+
const t = this._injector.get(vo);
|
|
3690
|
+
this.disposeWithMe(t.register(xr, $o)), this.disposeWithMe(t.register(wr, Zi)), this.disposeWithMe(this._uiPartsService.registerComponent(_o.GLOBAL, () => Jt(Ll, this._injector)));
|
|
3690
3691
|
}
|
|
3691
3692
|
};
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
],
|
|
3693
|
+
Vo(Dt, "pluginName", bo);
|
|
3694
|
+
Vo(Dt, "type", ue.UNIVER_SHEET);
|
|
3695
|
+
Dt = Wl([
|
|
3696
|
+
fr(qr, fs),
|
|
3697
|
+
Nt(1, K(mt)),
|
|
3698
|
+
Nt(2, Ne),
|
|
3699
|
+
Nt(3, hr),
|
|
3700
|
+
Nt(4, Co)
|
|
3701
|
+
], Dt);
|
|
3701
3702
|
export {
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3703
|
+
Fs as FORMULA_PROMPT_ACTIVATED,
|
|
3704
|
+
Zi as FormulaEditor,
|
|
3705
|
+
ko as GlobalRangeSelectorService,
|
|
3706
|
+
Os as HelpFunctionOperation,
|
|
3707
|
+
hn as InsertFunctionOperation,
|
|
3708
|
+
dn as MoreFunctionsOperation,
|
|
3709
|
+
$o as RangeSelector,
|
|
3709
3710
|
De as RefSelectionsRenderService,
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3711
|
+
No as ReferenceAbsoluteOperation,
|
|
3712
|
+
Ls as SearchFunctionOperation,
|
|
3713
|
+
rt as SelectEditorFormulaOperation,
|
|
3714
|
+
fn as SheetOnlyPasteFormulaCommand,
|
|
3715
|
+
Dt as UniverSheetsFormulaUIPlugin
|
|
3715
3716
|
};
|