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