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