@univerjs/sheets-drawing-ui 0.7.0-nightly.202505141607 → 0.7.0-nightly.202505161607
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 +2 -2
- package/lib/es/index.js +335 -333
- package/lib/index.css +1 -1
- package/lib/index.js +335 -333
- package/lib/umd/index.js +2 -2
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var Nr = Object.defineProperty;
|
|
2
2
|
var kr = (i, t, e) => t in i ? Nr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var ee = (i, t, e) => kr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { CommandType as Z, ICommandService as G, IUndoRedoService as
|
|
4
|
+
import { CommandType as Z, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as Yn, LocaleService as nt, IUniverInstanceService as Se, Inject as A, Injector as Le, IContextService as Ln, IImageIoService as Wr, RxDisposable as jr, UniverInstanceType as x, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as j, Disposable as re, ArrangeTypeEnum as pt, createDocumentModelWithStyle as Ht, ObjectRelativeFromV as pn, ObjectRelativeFromH as wn, WrapTextType as _n, PositionedObjectLayoutType as vn, BooleanNumber as Sn, BuildTextUtils as zt, ImageSourceType as In, generateRandomId as bt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Br, ObjectMatrix as $r, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as xr, Tools as Re, IPermissionService as Fr, UserManagerService as Yr, LifecycleService as Lr, LifecycleStages as Gr, DisposableCollection as wt, fromEventSubject as Xr, PRINT_CHART_COMPONENT_KEY as Vr, Rectangle as Hr, Direction as ve, FOCUSING_FX_BAR_EDITOR as zr, EDITOR_ACTIVATED as Kr, FOCUSING_PANEL_EDITOR as Zr, DependentOn as Jr, IConfigService as qr, Plugin as Qr, merge as ei, registerDependencies as ti, touchDependencies as Ft } from "@univerjs/core";
|
|
5
5
|
import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
|
|
6
|
-
import { SetDrawingSelectedOperation as Nt, IDrawingManagerService as ie, IImageIoService as ii, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Cn, DRAWING_IMAGE_COUNT_LIMIT as Dn, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as bn, getImageSize as
|
|
6
|
+
import { SetDrawingSelectedOperation as Nt, IDrawingManagerService as ie, IImageIoService as ii, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Cn, DRAWING_IMAGE_COUNT_LIMIT as Dn, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as bn, getImageSize as Yt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, ImageSourceType as si, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as oi } from "@univerjs/drawing";
|
|
7
7
|
import { ImageCropperObject as ai, COMPONENT_IMAGE_POPUP_MENU as ci, OpenImageCropOperation as di, ImageResetSizeOperation as li, DrawingRenderService as Gn, DrawingCommonPanel as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
|
|
8
|
-
import { IRenderManagerService as J, CURSOR_TYPE as gi, precisionTo as _t, transformObjectOutOfGroup as fi, getGroupState as mi, getCurrentTypeOfRenderer as on, RENDER_CLASS_TYPE as Ae, Rect as Ne, ObjectType as yn, DRAWING_OBJECT_LAYER_INDEX as
|
|
8
|
+
import { IRenderManagerService as J, CURSOR_TYPE as gi, precisionTo as _t, transformObjectOutOfGroup as fi, getGroupState as mi, getCurrentTypeOfRenderer as on, RENDER_CLASS_TYPE as Ae, Rect as Ne, ObjectType as yn, DRAWING_OBJECT_LAYER_INDEX as Lt, SHEET_VIEWPORT_KEY as Xn } from "@univerjs/engine-render";
|
|
9
9
|
import { ISheetDrawingService as se, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
|
|
10
10
|
import { MessageType as we, render as wi, unmount as _i, clsx as vi, RadioGroup as Si, Radio as Gt } from "@univerjs/design";
|
|
11
11
|
import { SheetCanvasPopManagerService as Ii, HoverManagerService as Ci, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as Di, ISheetSelectionRenderService as Ge, attachRangeWithCoord as Vn, IEditorBridgeService as bi, IAutoFillService as Ri, EditingRenderController as Mi, SetCellEditVisibleOperation as En, PREDEFINED_HOOK_NAME as $e, COPY_TYPE as Ce, discreteRangeToRange as Tn, virtualizeDiscreteRanges as yi, ISheetClipboardService as Ei, SetZoomRatioOperation as On, SetScrollOperation as Ti, SheetPrintInterceptorService as Oi, getCurrentRangeDisable$ as Ui } from "@univerjs/sheets-ui";
|
|
12
|
-
import { ISidebarService as Pi, IMessageService as Hn, ILocalFileService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as ji, ComponentManager as zn, connectInjector as Bi, getMenuHiddenObservable as an, MenuItemType as cn, useDependency as Qe,
|
|
13
|
-
import { takeUntil as Un, throttleTime as
|
|
12
|
+
import { ISidebarService as Pi, IMessageService as Hn, ILocalFileService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as ji, ComponentManager as zn, connectInjector as Bi, getMenuHiddenObservable as an, MenuItemType as cn, useDependency as Qe, RibbonInsertGroup as $i, KeyCode as Fe, IMenuManagerService as xi, IShortcutService as Fi } from "@univerjs/ui";
|
|
13
|
+
import { takeUntil as Un, throttleTime as Yi, combineLatest as vt, switchMap as _e, EMPTY as me, tap as Pn, map as Me, distinctUntilChanged as An, Subject as Xt, filter as Li, take as Gi, BehaviorSubject as je, of as Nn } from "rxjs";
|
|
14
14
|
import { SheetInterceptorService as kt, getSheetCommandTarget as oe, SheetsSelectionsService as dn, SetRangeValuesCommand as kn, INTERCEPTOR_POINT as Xi, InterceptCellContentPriority as Vi, WorkbookViewPermission as Wn, WorksheetViewPermission as jn, WorkbookEditablePermission as Kt, WorksheetEditPermission as Zt, SetFrozenMutation as Hi, SetWorksheetRowAutoHeightMutation as zi, COMMAND_LISTENER_SKELETON_CHANGE as Ki, InsertRowCommand as Kn, InsertColCommand as Zn, RemoveRowCommand as Jn, RemoveColCommand as qn, DeleteRangeMoveLeftCommand as Qn, DeleteRangeMoveUpCommand as er, InsertRangeMoveDownCommand as tr, InsertRangeMoveRightCommand as nr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as qt, DeltaColumnWidthCommand as rr, SetColWidthCommand as ir, SetRowHiddenCommand as sr, SetSpecificRowsVisibleCommand as or, SetSpecificColsVisibleCommand as ar, SetColHiddenCommand as cr, MoveColsCommand as dr, MoveRowsCommand as lr, MoveRangeCommand as ur, SetRowVisibleMutation as Zi, SetRowHiddenMutation as Ji, SetColVisibleMutation as qi, SetColHiddenMutation as Qi, SetWorksheetRowHeightMutation as es, SetWorksheetColWidthMutation as ts, SetWorksheetActiveOperation as ns, RangeProtectionPermissionEditPoint as rs } from "@univerjs/sheets";
|
|
15
15
|
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as is, InnerPasteCommand as ss } from "@univerjs/docs-ui";
|
|
16
16
|
import { jsx as ae, jsxs as Qt } from "react/jsx-runtime";
|
|
17
17
|
import { useMemo as os, forwardRef as hr, useRef as as, createElement as gr, useState as en, useEffect as fr } from "react";
|
|
18
|
-
const cs = "sheets-drawing-ui.config", $n = {},
|
|
18
|
+
const cs = "sheets-drawing-ui.config", $n = {}, Y = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: Z.MUTATION,
|
|
21
21
|
handler: (i, t) => {
|
|
@@ -30,27 +30,27 @@ const cs = "sheets-drawing-ui.config", $n = {}, L = {
|
|
|
30
30
|
type: Z.COMMAND,
|
|
31
31
|
handler: (i, t) => {
|
|
32
32
|
var S, I, b;
|
|
33
|
-
const e = i.get(G), n = i.get(
|
|
33
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(kt), s = i.get(se);
|
|
34
34
|
if (!t) return !1;
|
|
35
35
|
const { drawings: o } = t, a = [];
|
|
36
36
|
o.forEach((v) => {
|
|
37
|
-
const { unitId:
|
|
38
|
-
a.push(
|
|
37
|
+
const { unitId: C } = v;
|
|
38
|
+
a.push(C);
|
|
39
39
|
});
|
|
40
|
-
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d,
|
|
41
|
-
return
|
|
40
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
41
|
+
return Yn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
|
-
...(I =
|
|
45
|
-
|
|
46
|
-
...
|
|
47
|
-
{ id:
|
|
44
|
+
...(I = f.preUndos) != null ? I : [],
|
|
45
|
+
m,
|
|
46
|
+
...f.undos,
|
|
47
|
+
{ id: Y.id, params: a }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
|
-
...(b =
|
|
50
|
+
...(b = f.preRedos) != null ? b : [],
|
|
51
51
|
p,
|
|
52
|
-
...
|
|
53
|
-
{ id:
|
|
52
|
+
...f.redos,
|
|
53
|
+
{ id: Y.id, params: a }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
@@ -154,8 +154,8 @@ let Rt = class extends jr {
|
|
|
154
154
|
const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
|
|
155
155
|
if (!u)
|
|
156
156
|
return;
|
|
157
|
-
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u,
|
|
158
|
-
if (
|
|
157
|
+
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, f = u.data;
|
|
158
|
+
if (f && f.disablePopup)
|
|
159
159
|
return;
|
|
160
160
|
r == null || r.dispose();
|
|
161
161
|
const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
@@ -216,14 +216,14 @@ let Rt = class extends jr {
|
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
Rt = ls([
|
|
219
|
-
de(0, A(
|
|
219
|
+
de(0, A(Le)),
|
|
220
220
|
de(1, A(nt)),
|
|
221
221
|
de(2, ie),
|
|
222
222
|
de(3, A(Ii)),
|
|
223
223
|
de(4, J),
|
|
224
224
|
de(5, Se),
|
|
225
225
|
de(6, Hn),
|
|
226
|
-
de(7,
|
|
226
|
+
de(7, Ln),
|
|
227
227
|
de(8, Wr),
|
|
228
228
|
de(9, G)
|
|
229
229
|
], Rt);
|
|
@@ -239,7 +239,7 @@ let tn = class extends re {
|
|
|
239
239
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
240
240
|
}
|
|
241
241
|
_initHover() {
|
|
242
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
242
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Yi(33)).subscribe((t) => {
|
|
243
243
|
var n, r;
|
|
244
244
|
let e = [];
|
|
245
245
|
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(gi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
@@ -272,9 +272,9 @@ function z(i, t, e) {
|
|
|
272
272
|
{ from: n, to: r },
|
|
273
273
|
e
|
|
274
274
|
);
|
|
275
|
-
let { left: g, top: h, width:
|
|
276
|
-
const
|
|
277
|
-
return g +
|
|
275
|
+
let { left: g, top: h, width: f, height: p } = l;
|
|
276
|
+
const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, S = m.columnHeaderHeight + m.rowTotalHeight;
|
|
277
|
+
return g + f > _ && (g = _ - f), h + p > S && (h = S - p), {
|
|
278
278
|
flipY: s,
|
|
279
279
|
flipX: o,
|
|
280
280
|
angle: a,
|
|
@@ -282,7 +282,7 @@ function z(i, t, e) {
|
|
|
282
282
|
skewY: u,
|
|
283
283
|
left: g,
|
|
284
284
|
top: h,
|
|
285
|
-
width:
|
|
285
|
+
width: f,
|
|
286
286
|
height: p
|
|
287
287
|
};
|
|
288
288
|
}
|
|
@@ -298,7 +298,7 @@ function $(i, t) {
|
|
|
298
298
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
299
299
|
if (h == null)
|
|
300
300
|
return;
|
|
301
|
-
const
|
|
301
|
+
const f = {
|
|
302
302
|
column: h.actualColumn,
|
|
303
303
|
columnOffset: _t(e + r - h.startX, 1),
|
|
304
304
|
row: h.actualRow,
|
|
@@ -311,7 +311,7 @@ function $(i, t) {
|
|
|
311
311
|
skewX: u,
|
|
312
312
|
skewY: c,
|
|
313
313
|
from: g,
|
|
314
|
-
to:
|
|
314
|
+
to: f
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
var gs = Object.getOwnPropertyDescriptor, fs = (i, t, e, n) => {
|
|
@@ -349,10 +349,10 @@ function ms(i) {
|
|
|
349
349
|
const t = [];
|
|
350
350
|
return i.forEach((e) => {
|
|
351
351
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = mi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
352
|
-
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId:
|
|
352
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
|
|
353
353
|
return {
|
|
354
354
|
unitId: h,
|
|
355
|
-
subUnitId:
|
|
355
|
+
subUnitId: f,
|
|
356
356
|
drawingId: p,
|
|
357
357
|
transform: {
|
|
358
358
|
...g,
|
|
@@ -381,12 +381,12 @@ function ps(i) {
|
|
|
381
381
|
if (d == null)
|
|
382
382
|
return;
|
|
383
383
|
const u = r.map((l) => {
|
|
384
|
-
const { transform: g } = l, { unitId: h, subUnitId:
|
|
384
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = fi(g || {}, d, d.width || 0, d.height || 0);
|
|
385
385
|
return {
|
|
386
386
|
unitId: h,
|
|
387
|
-
subUnitId:
|
|
387
|
+
subUnitId: f,
|
|
388
388
|
drawingId: p,
|
|
389
|
-
transform:
|
|
389
|
+
transform: m,
|
|
390
390
|
groupId: void 0
|
|
391
391
|
};
|
|
392
392
|
}), c = {
|
|
@@ -409,11 +409,11 @@ const _r = {
|
|
|
409
409
|
id: "sheet.command.group-sheet-image",
|
|
410
410
|
type: Z.COMMAND,
|
|
411
411
|
handler: (i, t) => {
|
|
412
|
-
const e = i.get(G), n = i.get(
|
|
412
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(se);
|
|
413
413
|
if (!t) return !1;
|
|
414
414
|
const s = [];
|
|
415
|
-
t.forEach(({ parent: h, children:
|
|
416
|
-
s.push(h.unitId),
|
|
415
|
+
t.forEach(({ parent: h, children: f }) => {
|
|
416
|
+
s.push(h.unitId), f.forEach((p) => {
|
|
417
417
|
s.push(p.unitId);
|
|
418
418
|
});
|
|
419
419
|
});
|
|
@@ -422,11 +422,11 @@ const _r = {
|
|
|
422
422
|
unitID: a,
|
|
423
423
|
undoMutations: [
|
|
424
424
|
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ps(l), type: U.UNGROUP } },
|
|
425
|
-
{ id:
|
|
425
|
+
{ id: Y.id, params: s }
|
|
426
426
|
],
|
|
427
427
|
redoMutations: [
|
|
428
428
|
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
|
|
429
|
-
{ id:
|
|
429
|
+
{ id: Y.id, params: s }
|
|
430
430
|
]
|
|
431
431
|
}), !0) : !1;
|
|
432
432
|
}
|
|
@@ -435,22 +435,22 @@ const _r = {
|
|
|
435
435
|
type: Z.COMMAND,
|
|
436
436
|
handler: (i, t) => {
|
|
437
437
|
var S, I, b;
|
|
438
|
-
const e = i.get(G), n = i.get(
|
|
438
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(se), s = i.get(kt);
|
|
439
439
|
if (!t) return !1;
|
|
440
|
-
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d,
|
|
441
|
-
return
|
|
440
|
+
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: Wt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
441
|
+
return Yn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
442
442
|
unitID: u,
|
|
443
443
|
undoMutations: [
|
|
444
|
-
...(I =
|
|
445
|
-
|
|
446
|
-
...
|
|
447
|
-
{ id:
|
|
444
|
+
...(I = f.preUndos) != null ? I : [],
|
|
445
|
+
m,
|
|
446
|
+
...f.undos,
|
|
447
|
+
{ id: Y.id, params: a }
|
|
448
448
|
],
|
|
449
449
|
redoMutations: [
|
|
450
|
-
...(b =
|
|
450
|
+
...(b = f.preRedos) != null ? b : [],
|
|
451
451
|
p,
|
|
452
|
-
...
|
|
453
|
-
{ id:
|
|
452
|
+
...f.redos,
|
|
453
|
+
{ id: Y.id, params: a }
|
|
454
454
|
]
|
|
455
455
|
}), !0) : !1;
|
|
456
456
|
}
|
|
@@ -458,7 +458,7 @@ const _r = {
|
|
|
458
458
|
id: "sheet.command.set-drawing-arrange",
|
|
459
459
|
type: Z.COMMAND,
|
|
460
460
|
handler: (i, t) => {
|
|
461
|
-
const e = i.get(G), n = i.get(
|
|
461
|
+
const e = i.get(G), n = i.get(Ye);
|
|
462
462
|
if (!t) return !1;
|
|
463
463
|
const r = i.get(se), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
464
464
|
let c;
|
|
@@ -479,18 +479,18 @@ const _r = {
|
|
|
479
479
|
id: "sheet.command.set-sheet-image",
|
|
480
480
|
type: Z.COMMAND,
|
|
481
481
|
handler: (i, t) => {
|
|
482
|
-
const e = i.get(G), n = i.get(
|
|
482
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(se);
|
|
483
483
|
if (!t) return !1;
|
|
484
484
|
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
485
485
|
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
|
|
486
486
|
unitID: a,
|
|
487
487
|
undoMutations: [
|
|
488
488
|
{ id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
|
|
489
|
-
{ id:
|
|
489
|
+
{ id: Y.id, params: [a] }
|
|
490
490
|
],
|
|
491
491
|
redoMutations: [
|
|
492
492
|
{ id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
|
|
493
|
-
{ id:
|
|
493
|
+
{ id: Y.id, params: [a] }
|
|
494
494
|
]
|
|
495
495
|
}), !0) : !1;
|
|
496
496
|
}
|
|
@@ -498,11 +498,11 @@ const _r = {
|
|
|
498
498
|
id: "sheet.command.ungroup-sheet-image",
|
|
499
499
|
type: Z.COMMAND,
|
|
500
500
|
handler: (i, t) => {
|
|
501
|
-
const e = i.get(G), n = i.get(
|
|
501
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(se);
|
|
502
502
|
if (!t) return !1;
|
|
503
503
|
const s = [];
|
|
504
|
-
t.forEach(({ parent: h, children:
|
|
505
|
-
s.push(h.unitId),
|
|
504
|
+
t.forEach(({ parent: h, children: f }) => {
|
|
505
|
+
s.push(h.unitId), f.forEach((p) => {
|
|
506
506
|
s.push(p.unitId);
|
|
507
507
|
});
|
|
508
508
|
});
|
|
@@ -511,11 +511,11 @@ const _r = {
|
|
|
511
511
|
unitID: a,
|
|
512
512
|
undoMutations: [
|
|
513
513
|
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ms(l), type: U.GROUP } },
|
|
514
|
-
{ id:
|
|
514
|
+
{ id: Y.id, params: s }
|
|
515
515
|
],
|
|
516
516
|
redoMutations: [
|
|
517
517
|
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
|
|
518
|
-
{ id:
|
|
518
|
+
{ id: Y.id, params: s }
|
|
519
519
|
]
|
|
520
520
|
}), !0) : !1;
|
|
521
521
|
}
|
|
@@ -537,7 +537,7 @@ function rn(i, t, e, n, r) {
|
|
|
537
537
|
const c = (S = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
538
538
|
if (c == null)
|
|
539
539
|
return !1;
|
|
540
|
-
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2,
|
|
540
|
+
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
|
|
541
541
|
return {
|
|
542
542
|
width: e * _,
|
|
543
543
|
height: n * _
|
|
@@ -588,15 +588,15 @@ let et = class extends re {
|
|
|
588
588
|
}
|
|
589
589
|
if (e == null)
|
|
590
590
|
return;
|
|
591
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await
|
|
591
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Yt(u || ""), { width: h, height: f } = this._context.scene;
|
|
592
592
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
593
593
|
let p = 1;
|
|
594
594
|
if (c > Rn || l > Mn) {
|
|
595
595
|
const S = Rn / c, I = Mn / l;
|
|
596
596
|
p = Math.max(S, I);
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
598
|
+
const m = this._getImagePosition(c * p, l * p, h, f);
|
|
599
|
+
if (m == null)
|
|
600
600
|
return;
|
|
601
601
|
const _ = {
|
|
602
602
|
unitId: r,
|
|
@@ -605,8 +605,8 @@ let et = class extends re {
|
|
|
605
605
|
drawingType: j.DRAWING_IMAGE,
|
|
606
606
|
imageSourceType: a,
|
|
607
607
|
source: d,
|
|
608
|
-
transform: z(
|
|
609
|
-
sheetTransform:
|
|
608
|
+
transform: z(m, this._selectionRenderService, this._skeletonManagerService),
|
|
609
|
+
sheetTransform: m
|
|
610
610
|
};
|
|
611
611
|
return this._commandService.executeCommand(Wt.id, {
|
|
612
612
|
unitId: r,
|
|
@@ -615,48 +615,50 @@ let et = class extends re {
|
|
|
615
615
|
}
|
|
616
616
|
// eslint-disable-next-line max-lines-per-function
|
|
617
617
|
async _insertCellImage(t, e) {
|
|
618
|
-
var
|
|
618
|
+
var I, b;
|
|
619
619
|
let n;
|
|
620
620
|
try {
|
|
621
621
|
n = await this._imageIoService.saveImage(t);
|
|
622
|
-
} catch (
|
|
623
|
-
const
|
|
624
|
-
|
|
622
|
+
} catch (v) {
|
|
623
|
+
const C = v.message;
|
|
624
|
+
C === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
625
625
|
type: we.Error,
|
|
626
626
|
content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
|
|
627
|
-
}) :
|
|
627
|
+
}) : C === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
628
628
|
type: we.Error,
|
|
629
629
|
content: this._localeService.t("update-status.invalidImageType")
|
|
630
|
-
}) :
|
|
630
|
+
}) : C === Pe.ERROR_IMAGE && this._messageService.show({
|
|
631
631
|
type: we.Error,
|
|
632
632
|
content: this._localeService.t("update-status.invalidImage")
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
635
|
if (n == null)
|
|
636
636
|
return !1;
|
|
637
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await
|
|
637
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Yt(a || "");
|
|
638
638
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
639
639
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
640
640
|
if (!l)
|
|
641
641
|
return !1;
|
|
642
|
-
|
|
642
|
+
let g = l.primary.actualRow, h = l.primary.actualColumn;
|
|
643
|
+
l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
|
|
644
|
+
const f = Ht("", {}), p = rn(
|
|
643
645
|
this._injector,
|
|
644
646
|
{
|
|
645
647
|
unitId: this._context.unitId,
|
|
646
648
|
subUnitId: this._context.unit.getActiveSheet().getSheetId(),
|
|
647
|
-
row:
|
|
648
|
-
col:
|
|
649
|
+
row: g,
|
|
650
|
+
col: h
|
|
649
651
|
},
|
|
650
652
|
d,
|
|
651
653
|
u,
|
|
652
654
|
0
|
|
653
655
|
);
|
|
654
|
-
if (!
|
|
656
|
+
if (!p)
|
|
655
657
|
return !1;
|
|
656
658
|
const m = {
|
|
657
659
|
size: {
|
|
658
|
-
width:
|
|
659
|
-
height:
|
|
660
|
+
width: p.width,
|
|
661
|
+
height: p.height
|
|
660
662
|
},
|
|
661
663
|
positionH: {
|
|
662
664
|
relativeFrom: wn.PAGE,
|
|
@@ -667,9 +669,9 @@ let et = class extends re {
|
|
|
667
669
|
posOffset: 0
|
|
668
670
|
},
|
|
669
671
|
angle: 0
|
|
670
|
-
},
|
|
671
|
-
unitId:
|
|
672
|
-
subUnitId:
|
|
672
|
+
}, _ = {
|
|
673
|
+
unitId: f.getUnitId(),
|
|
674
|
+
subUnitId: f.getUnitId(),
|
|
673
675
|
drawingId: r,
|
|
674
676
|
drawingType: j.DRAWING_IMAGE,
|
|
675
677
|
imageSourceType: s,
|
|
@@ -686,20 +688,20 @@ let et = class extends re {
|
|
|
686
688
|
distL: 0,
|
|
687
689
|
distR: 0,
|
|
688
690
|
distT: 0
|
|
689
|
-
},
|
|
690
|
-
documentDataModel:
|
|
691
|
-
drawings: [
|
|
691
|
+
}, S = zt.drawing.add({
|
|
692
|
+
documentDataModel: f,
|
|
693
|
+
drawings: [_],
|
|
692
694
|
selection: {
|
|
693
695
|
collapsed: !0,
|
|
694
696
|
startOffset: 0,
|
|
695
697
|
endOffset: 0
|
|
696
698
|
}
|
|
697
699
|
});
|
|
698
|
-
return
|
|
700
|
+
return S ? (f.apply(S), this._commandService.syncExecuteCommand(kn.id, {
|
|
699
701
|
value: {
|
|
700
|
-
[(
|
|
701
|
-
[(
|
|
702
|
-
p:
|
|
702
|
+
[(I = e == null ? void 0 : e.row) != null ? I : g]: {
|
|
703
|
+
[(b = e == null ? void 0 : e.col) != null ? b : h]: {
|
|
704
|
+
p: f.getSnapshot(),
|
|
703
705
|
t: 1
|
|
704
706
|
}
|
|
705
707
|
}
|
|
@@ -711,7 +713,7 @@ let et = class extends re {
|
|
|
711
713
|
// eslint-disable-next-line max-lines-per-function
|
|
712
714
|
async insertCellImageByUrl(t, e) {
|
|
713
715
|
var g, h;
|
|
714
|
-
const { width: n, height: r, image: s } = await
|
|
716
|
+
const { width: n, height: r, image: s } = await Yt(t || "");
|
|
715
717
|
this._imageIoService.addImageSourceCache(t, In.URL, s);
|
|
716
718
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
717
719
|
if (!o)
|
|
@@ -806,24 +808,24 @@ let et = class extends re {
|
|
|
806
808
|
return;
|
|
807
809
|
let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
|
|
808
810
|
if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
+
const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
|
|
812
|
+
if (m == null)
|
|
811
813
|
return;
|
|
812
|
-
c =
|
|
814
|
+
c = m.startX, l = m.startY, d = m.actualColumn, u = m.actualRow;
|
|
813
815
|
}
|
|
814
816
|
const h = {
|
|
815
817
|
column: d,
|
|
816
818
|
columnOffset: 0,
|
|
817
819
|
row: u,
|
|
818
820
|
rowOffset: 0
|
|
819
|
-
},
|
|
820
|
-
if (
|
|
821
|
+
}, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
822
|
+
if (f == null)
|
|
821
823
|
return;
|
|
822
824
|
const p = {
|
|
823
|
-
column:
|
|
824
|
-
columnOffset: c + t -
|
|
825
|
-
row:
|
|
826
|
-
rowOffset: l + e -
|
|
825
|
+
column: f.actualColumn,
|
|
826
|
+
columnOffset: c + t - f.startX,
|
|
827
|
+
row: f.actualRow,
|
|
828
|
+
rowOffset: l + e - f.startY
|
|
827
829
|
};
|
|
828
830
|
return {
|
|
829
831
|
from: h,
|
|
@@ -891,11 +893,11 @@ et = _s([
|
|
|
891
893
|
te(5, Ai),
|
|
892
894
|
te(6, se),
|
|
893
895
|
te(7, ie),
|
|
894
|
-
te(8,
|
|
896
|
+
te(8, Ln),
|
|
895
897
|
te(9, Hn),
|
|
896
898
|
te(10, A(nt)),
|
|
897
899
|
te(11, A(dn)),
|
|
898
|
-
te(12, A(
|
|
900
|
+
te(12, A(Le))
|
|
899
901
|
], et);
|
|
900
902
|
var Ss = Object.getOwnPropertyDescriptor, Is = (i, t, e, n) => {
|
|
901
903
|
for (var r = n > 1 ? void 0 : n ? Ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -952,7 +954,7 @@ let Mt = class extends re {
|
|
|
952
954
|
Mt = Is([
|
|
953
955
|
ke(0, G),
|
|
954
956
|
ke(1, A(kt)),
|
|
955
|
-
ke(2, A(
|
|
957
|
+
ke(2, A(Le)),
|
|
956
958
|
ke(3, ie),
|
|
957
959
|
ke(4, A(ni)),
|
|
958
960
|
ke(5, A(bi))
|
|
@@ -981,7 +983,7 @@ let yt = class extends re {
|
|
|
981
983
|
};
|
|
982
984
|
yt = Ds([
|
|
983
985
|
xn(0, A(Ri)),
|
|
984
|
-
xn(1, A(
|
|
986
|
+
xn(1, A(Le))
|
|
985
987
|
], yt);
|
|
986
988
|
var bs = Object.getOwnPropertyDescriptor, Rs = (i, t, e, n) => {
|
|
987
989
|
for (var r = n > 1 ? void 0 : n ? bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1204,16 +1206,16 @@ let Tt = class extends re {
|
|
|
1204
1206
|
return;
|
|
1205
1207
|
const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
|
|
1206
1208
|
if (Object.keys(c).forEach((h) => {
|
|
1207
|
-
const
|
|
1208
|
-
if (
|
|
1209
|
+
const f = c[h], { transform: p } = f;
|
|
1210
|
+
if (f.anchorType !== O.Both || !p)
|
|
1209
1211
|
return;
|
|
1210
|
-
const { left:
|
|
1211
|
-
drawingStartX:
|
|
1212
|
-
drawingEndX:
|
|
1212
|
+
const { left: m = 0, top: _ = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: C, drawingEndY: w } = {
|
|
1213
|
+
drawingStartX: m,
|
|
1214
|
+
drawingEndX: m + S,
|
|
1213
1215
|
drawingStartY: _,
|
|
1214
1216
|
drawingEndY: _ + I
|
|
1215
1217
|
};
|
|
1216
|
-
o <= b && v <= a && d <=
|
|
1218
|
+
o <= b && v <= a && d <= C && w <= u && l.push(f);
|
|
1217
1219
|
}), l.length)
|
|
1218
1220
|
return {
|
|
1219
1221
|
copyRange: n,
|
|
@@ -1234,17 +1236,17 @@ let Tt = class extends re {
|
|
|
1234
1236
|
unitId: s,
|
|
1235
1237
|
subUnitId: o,
|
|
1236
1238
|
isCut: e === Ce.CUT,
|
|
1237
|
-
getTransform: (
|
|
1239
|
+
getTransform: (f, p) => {
|
|
1238
1240
|
var S;
|
|
1239
|
-
const
|
|
1241
|
+
const m = u.attachRangeWithCoord({
|
|
1240
1242
|
startRow: h.startRow,
|
|
1241
1243
|
endRow: h.endRow,
|
|
1242
1244
|
startColumn: h.startColumn,
|
|
1243
1245
|
endColumn: h.endColumn
|
|
1244
1246
|
}), _ = {
|
|
1245
|
-
...
|
|
1246
|
-
left:
|
|
1247
|
-
top:
|
|
1247
|
+
...f,
|
|
1248
|
+
left: m == null ? void 0 : m.startX,
|
|
1249
|
+
top: m == null ? void 0 : m.startY
|
|
1248
1250
|
};
|
|
1249
1251
|
return {
|
|
1250
1252
|
transform: _,
|
|
@@ -1264,7 +1266,7 @@ let Tt = class extends re {
|
|
|
1264
1266
|
const { transform: l, sheetTransform: g } = c;
|
|
1265
1267
|
if (!l)
|
|
1266
1268
|
return;
|
|
1267
|
-
const h = s(l, g),
|
|
1269
|
+
const h = s(l, g), f = {
|
|
1268
1270
|
...c,
|
|
1269
1271
|
unitId: n,
|
|
1270
1272
|
subUnitId: r,
|
|
@@ -1273,14 +1275,14 @@ let Tt = class extends re {
|
|
|
1273
1275
|
sheetTransform: h.sheetTransform
|
|
1274
1276
|
};
|
|
1275
1277
|
if (o) {
|
|
1276
|
-
const { undo: p, redo:
|
|
1278
|
+
const { undo: p, redo: m, objects: _ } = u.getBatchUpdateOp([f]);
|
|
1277
1279
|
a.push({
|
|
1278
1280
|
id: P.id,
|
|
1279
1281
|
params: {
|
|
1280
1282
|
unitId: n,
|
|
1281
1283
|
subUnitId: r,
|
|
1282
1284
|
type: U.UPDATE,
|
|
1283
|
-
op:
|
|
1285
|
+
op: m,
|
|
1284
1286
|
objects: _
|
|
1285
1287
|
}
|
|
1286
1288
|
}), d.push({
|
|
@@ -1294,8 +1296,8 @@ let Tt = class extends re {
|
|
|
1294
1296
|
}
|
|
1295
1297
|
});
|
|
1296
1298
|
} else {
|
|
1297
|
-
const { undo: p, redo:
|
|
1298
|
-
a.push({ id: P.id, params: { op:
|
|
1299
|
+
const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
|
|
1300
|
+
a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
|
|
1299
1301
|
}
|
|
1300
1302
|
}), { redos: a, undos: d };
|
|
1301
1303
|
}
|
|
@@ -1322,41 +1324,41 @@ let Tt = class extends re {
|
|
|
1322
1324
|
pasteTo: { unitId: n, subUnitId: r, range: Tn(o) },
|
|
1323
1325
|
pasteType: s
|
|
1324
1326
|
}, d);
|
|
1325
|
-
const { ranges: [l, g], mapFunc: h } = yi([a, o]), { row:
|
|
1326
|
-
startRow:
|
|
1327
|
-
endRow:
|
|
1327
|
+
const { ranges: [l, g], mapFunc: h } = yi([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1328
|
+
startRow: f,
|
|
1329
|
+
endRow: f,
|
|
1328
1330
|
startColumn: p,
|
|
1329
1331
|
endColumn: p
|
|
1330
1332
|
}), I = u.attachRangeWithCoord({
|
|
1331
|
-
startRow:
|
|
1332
|
-
endRow:
|
|
1333
|
+
startRow: m,
|
|
1334
|
+
endRow: m,
|
|
1333
1335
|
startColumn: _,
|
|
1334
1336
|
endColumn: _
|
|
1335
1337
|
});
|
|
1336
1338
|
if (!S || !I || !this._copyInfo)
|
|
1337
1339
|
return { redos: [], undos: [] };
|
|
1338
|
-
const b = I.startX - S.startX, v = I.startY - S.startY,
|
|
1340
|
+
const b = I.startX - S.startX, v = I.startY - S.startY, C = m - f, w = _ - p;
|
|
1339
1341
|
return this._generateMutations(c, {
|
|
1340
1342
|
unitId: n,
|
|
1341
1343
|
subUnitId: r,
|
|
1342
|
-
getTransform: (
|
|
1344
|
+
getTransform: (D, E) => {
|
|
1343
1345
|
var T, M;
|
|
1344
1346
|
return {
|
|
1345
1347
|
transform: {
|
|
1346
|
-
...
|
|
1347
|
-
left: ((T =
|
|
1348
|
-
top: ((M =
|
|
1348
|
+
...D,
|
|
1349
|
+
left: ((T = D == null ? void 0 : D.left) != null ? T : 0) + b,
|
|
1350
|
+
top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + v
|
|
1349
1351
|
},
|
|
1350
1352
|
sheetTransform: {
|
|
1351
1353
|
...E,
|
|
1352
1354
|
to: {
|
|
1353
1355
|
...E.to,
|
|
1354
|
-
row: E.to.row +
|
|
1356
|
+
row: E.to.row + C,
|
|
1355
1357
|
column: E.to.column + w
|
|
1356
1358
|
},
|
|
1357
1359
|
from: {
|
|
1358
1360
|
...E.from,
|
|
1359
|
-
row: E.from.row +
|
|
1361
|
+
row: E.from.row + C,
|
|
1360
1362
|
column: E.from.column + w
|
|
1361
1363
|
}
|
|
1362
1364
|
}
|
|
@@ -1551,7 +1553,7 @@ Ot = As([
|
|
|
1551
1553
|
Ze(1, J),
|
|
1552
1554
|
Ze(2, Fr),
|
|
1553
1555
|
Ze(3, Se),
|
|
1554
|
-
Ze(4, A(
|
|
1556
|
+
Ze(4, A(Yr))
|
|
1555
1557
|
], Ot);
|
|
1556
1558
|
var Ns = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
|
|
1557
1559
|
for (var r = n > 1 ? void 0 : n ? Ns(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1559,7 +1561,7 @@ var Ns = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
|
|
|
1559
1561
|
return r;
|
|
1560
1562
|
}, De = (i, t) => (e, n) => t(e, n, i);
|
|
1561
1563
|
function Dr(i, t, e, n, r, s = !1) {
|
|
1562
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u,
|
|
1564
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
|
|
1563
1565
|
left: !0,
|
|
1564
1566
|
// left means the left of pic is in a viewMainLeft
|
|
1565
1567
|
top: !0
|
|
@@ -1567,36 +1569,36 @@ function Dr(i, t, e, n, r, s = !1) {
|
|
|
1567
1569
|
if (!d)
|
|
1568
1570
|
return {
|
|
1569
1571
|
...i,
|
|
1570
|
-
absolute:
|
|
1572
|
+
absolute: f
|
|
1571
1573
|
};
|
|
1572
|
-
const { left: p, right:
|
|
1573
|
-
let { top: I, left: b, viewportScrollX: v, viewportScrollY:
|
|
1574
|
-
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth:
|
|
1574
|
+
const { left: p, right: m, top: _, bottom: S } = i;
|
|
1575
|
+
let { top: I, left: b, viewportScrollX: v, viewportScrollY: C } = d;
|
|
1576
|
+
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
|
|
1575
1577
|
top: s ? 0 : E,
|
|
1576
|
-
left: s ? 0 :
|
|
1578
|
+
left: s ? 0 : D
|
|
1577
1579
|
};
|
|
1578
|
-
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (
|
|
1580
|
+
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
|
|
1579
1581
|
let M = 0, R = 0;
|
|
1580
|
-
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) +
|
|
1582
|
+
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + D, q = e.rowStartY(l) + E, H = e.colStartX(c) + D;
|
|
1581
1583
|
if (g === 0)
|
|
1582
|
-
|
|
1584
|
+
f.left = !1, M = (p - v) * o, R = (m - v) * o;
|
|
1583
1585
|
else {
|
|
1584
|
-
const k = p - (F -
|
|
1585
|
-
|
|
1586
|
+
const k = p - (F - D), ce = m - (F - D);
|
|
1587
|
+
m < H ? (M = k * o, R = ce * o) : p <= H && m >= H ? (M = k * o, R = Math.max(b, (m - v) * o)) : p > H && (f.left = !1, M = Math.max((p - v) * o, b), R = Math.max((m - v) * o, b));
|
|
1586
1588
|
}
|
|
1587
|
-
let X = 0,
|
|
1589
|
+
let X = 0, L = 0;
|
|
1588
1590
|
if (h === 0)
|
|
1589
|
-
|
|
1591
|
+
f.top = !1, X = (_ - C) * a, L = (S - C) * a;
|
|
1590
1592
|
else {
|
|
1591
1593
|
const k = _ - (N - E), ce = S - (N - E);
|
|
1592
|
-
S < q ? (X = k * a,
|
|
1594
|
+
S < q ? (X = k * a, L = ce * a) : _ <= q && S >= q ? (X = k * a, L = Math.max(I, (S - C) * a)) : _ > q && (f.top = !1, X = Math.max((_ - C) * a, I), L = Math.max((S - C) * a, I));
|
|
1593
1595
|
}
|
|
1594
|
-
return M = Math.max(M, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left),
|
|
1596
|
+
return M = Math.max(M, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left), L = Math.max(L, T.top), {
|
|
1595
1597
|
left: M,
|
|
1596
1598
|
right: R,
|
|
1597
1599
|
top: X,
|
|
1598
|
-
bottom:
|
|
1599
|
-
absolute:
|
|
1600
|
+
bottom: L,
|
|
1601
|
+
absolute: f
|
|
1600
1602
|
};
|
|
1601
1603
|
}
|
|
1602
1604
|
const fe = (i, t, e, n, r) => {
|
|
@@ -1633,7 +1635,7 @@ let tt = class extends re {
|
|
|
1633
1635
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1634
1636
|
}
|
|
1635
1637
|
_bindScrollEvent() {
|
|
1636
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
1638
|
+
this._lifecycleService.lifecycle$.pipe(Li((t) => t === Gr.Rendered), Gi(1)).subscribe(() => {
|
|
1637
1639
|
this._scrollUpdateListener();
|
|
1638
1640
|
});
|
|
1639
1641
|
}
|
|
@@ -1671,17 +1673,17 @@ let tt = class extends re {
|
|
|
1671
1673
|
const { transform: l, drawingType: g, data: h } = a;
|
|
1672
1674
|
if (g !== j.DRAWING_DOM && g !== j.DRAWING_CHART)
|
|
1673
1675
|
return;
|
|
1674
|
-
const
|
|
1675
|
-
if (
|
|
1676
|
+
const f = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1677
|
+
if (f == null)
|
|
1676
1678
|
return;
|
|
1677
|
-
const { scene: p, canvas:
|
|
1679
|
+
const { scene: p, canvas: m } = f;
|
|
1678
1680
|
if (l == null)
|
|
1679
1681
|
return !0;
|
|
1680
1682
|
if (u !== r)
|
|
1681
1683
|
return;
|
|
1682
|
-
const { left: _, top: S, width: I, height: b, angle: v, flipX:
|
|
1684
|
+
const { left: _, top: S, width: I, height: b, angle: v, flipX: C, flipY: w, skewX: y, skewY: D } = l, E = Ie({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
1683
1685
|
if (T != null) {
|
|
1684
|
-
T.transformByState({ left: _, top: S, width: I, height: b, angle: v, flipX:
|
|
1686
|
+
T.transformByState({ left: _, top: S, width: I, height: b, angle: v, flipX: C, flipY: w, skewX: y, skewY: D });
|
|
1685
1687
|
return;
|
|
1686
1688
|
}
|
|
1687
1689
|
const M = {
|
|
@@ -1696,8 +1698,8 @@ let tt = class extends re {
|
|
|
1696
1698
|
M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1697
1699
|
}
|
|
1698
1700
|
const N = new Ne(E, M);
|
|
1699
|
-
R && N.setObjectType(yn.CHART), p.addObject(N,
|
|
1700
|
-
const F = new wt(), q = fe(N,
|
|
1701
|
+
R && N.setObjectType(yn.CHART), p.addObject(N, Lt), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1702
|
+
const F = new wt(), q = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new je(q), X = {
|
|
1701
1703
|
dispose: F,
|
|
1702
1704
|
rect: N,
|
|
1703
1705
|
position$: H,
|
|
@@ -1710,29 +1712,29 @@ let tt = class extends re {
|
|
|
1710
1712
|
id: s,
|
|
1711
1713
|
componentKey: a.componentKey,
|
|
1712
1714
|
onPointerDown: (k) => {
|
|
1713
|
-
|
|
1715
|
+
m.dispatchEvent(new PointerEvent(k.type, k));
|
|
1714
1716
|
},
|
|
1715
1717
|
onPointerMove: (k) => {
|
|
1716
|
-
|
|
1718
|
+
m.dispatchEvent(new PointerEvent(k.type, k));
|
|
1717
1719
|
},
|
|
1718
1720
|
onPointerUp: (k) => {
|
|
1719
|
-
|
|
1721
|
+
m.dispatchEvent(new PointerEvent(k.type, k));
|
|
1720
1722
|
},
|
|
1721
1723
|
onWheel: (k) => {
|
|
1722
|
-
|
|
1724
|
+
m.dispatchEvent(new WheelEvent(k.type, k));
|
|
1723
1725
|
},
|
|
1724
1726
|
data: h,
|
|
1725
1727
|
unitId: n
|
|
1726
1728
|
});
|
|
1727
|
-
const
|
|
1728
|
-
const k = fe(N,
|
|
1729
|
+
const L = N.onTransformChange$.subscribeEvent(() => {
|
|
1730
|
+
const k = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet);
|
|
1729
1731
|
H.next(
|
|
1730
1732
|
k
|
|
1731
1733
|
);
|
|
1732
1734
|
});
|
|
1733
1735
|
F.add(() => {
|
|
1734
1736
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1735
|
-
}),
|
|
1737
|
+
}), L && F.add(L), this._domLayerInfoMap.set(s, X);
|
|
1736
1738
|
});
|
|
1737
1739
|
})
|
|
1738
1740
|
), this.disposeWithMe(
|
|
@@ -1900,7 +1902,7 @@ let tt = class extends re {
|
|
|
1900
1902
|
}
|
|
1901
1903
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1902
1904
|
addFloatDomToRange(t, e, n, r) {
|
|
1903
|
-
var
|
|
1905
|
+
var C, w, y;
|
|
1904
1906
|
const s = oe(this._univerInstanceService, {
|
|
1905
1907
|
unitId: e.unitId,
|
|
1906
1908
|
subUnitId: e.subUnitId
|
|
@@ -1911,15 +1913,15 @@ let tt = class extends re {
|
|
|
1911
1913
|
if (!d) return;
|
|
1912
1914
|
const u = this._renderManagerService.getRenderById(o);
|
|
1913
1915
|
if (!u) return;
|
|
1914
|
-
const c = (
|
|
1916
|
+
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
|
|
1915
1917
|
if (!c) return;
|
|
1916
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
1918
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : bt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1917
1919
|
if (this._getPosition(p, o) == null)
|
|
1918
1920
|
return;
|
|
1919
1921
|
const S = d.scene, { scaleX: I } = S.getAncestorScale(), b = Ct(p, n, I), v = {
|
|
1920
1922
|
unitId: o,
|
|
1921
1923
|
subUnitId: a,
|
|
1922
|
-
drawingId:
|
|
1924
|
+
drawingId: f,
|
|
1923
1925
|
drawingType: e.type || j.DRAWING_DOM,
|
|
1924
1926
|
componentKey: l,
|
|
1925
1927
|
transform: {
|
|
@@ -1932,28 +1934,28 @@ let tt = class extends re {
|
|
|
1932
1934
|
allowTransform: h
|
|
1933
1935
|
};
|
|
1934
1936
|
{
|
|
1935
|
-
const { unitId:
|
|
1937
|
+
const { unitId: D, subUnitId: E, drawingId: T } = v, M = oe(this._univerInstanceService, { unitId: D, subUnitId: E }), R = v, N = this._univerInstanceService.getUnit(D, x.UNIVER_SHEET);
|
|
1936
1938
|
if (!N)
|
|
1937
1939
|
return;
|
|
1938
1940
|
const F = N.getActiveSheet().getSheetId();
|
|
1939
1941
|
if (!R || !M)
|
|
1940
1942
|
return;
|
|
1941
|
-
const q = (w = this._renderManagerService.getRenderById(
|
|
1943
|
+
const q = (w = this._renderManagerService.getRenderById(D)) == null ? void 0 : w.with(V);
|
|
1942
1944
|
if (!q)
|
|
1943
1945
|
return;
|
|
1944
1946
|
const H = q.getWorksheetSkeleton(E);
|
|
1945
1947
|
if (!H)
|
|
1946
1948
|
return;
|
|
1947
|
-
const { transform: X, drawingType:
|
|
1948
|
-
if (
|
|
1949
|
+
const { transform: X, drawingType: L, data: K } = R;
|
|
1950
|
+
if (L !== j.DRAWING_DOM && L !== j.DRAWING_CHART)
|
|
1949
1951
|
return;
|
|
1950
|
-
const k = this._getSceneAndTransformerByDrawingSearch(
|
|
1952
|
+
const k = this._getSceneAndTransformerByDrawingSearch(D);
|
|
1951
1953
|
if (k == null)
|
|
1952
1954
|
return;
|
|
1953
1955
|
const { scene: ce, canvas: ye } = k;
|
|
1954
1956
|
if (X == null || F !== E)
|
|
1955
1957
|
return;
|
|
1956
|
-
const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId:
|
|
1958
|
+
const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId: D, subUnitId: E, drawingId: T }), le = ce.getObject(ht);
|
|
1957
1959
|
if (le != null) {
|
|
1958
1960
|
le.transformByState({ left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee });
|
|
1959
1961
|
return;
|
|
@@ -1964,14 +1966,14 @@ let tt = class extends re {
|
|
|
1964
1966
|
top: at,
|
|
1965
1967
|
width: ct,
|
|
1966
1968
|
height: dt,
|
|
1967
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
1968
|
-
}, Te =
|
|
1969
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
1970
|
+
}, Te = L === j.DRAWING_CHART;
|
|
1969
1971
|
if (Te) {
|
|
1970
1972
|
const W = K ? K.backgroundColor : "white";
|
|
1971
1973
|
Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
|
|
1972
1974
|
}
|
|
1973
1975
|
const ue = new Ne(ht, Q);
|
|
1974
|
-
Te && ue.setObjectType(yn.CHART), ce.addObject(ue,
|
|
1976
|
+
Te && ue.setObjectType(yn.CHART), ce.addObject(ue, Lt), R.allowTransform !== !1 && ce.attachTransformerTo(ue);
|
|
1975
1977
|
const he = new wt(), gt = ce.getMainViewport(), { rowHeaderWidth: Oe, columnHeaderHeight: Xe } = H.skeleton, ft = {
|
|
1976
1978
|
top: Xe,
|
|
1977
1979
|
left: Oe,
|
|
@@ -1982,7 +1984,7 @@ let tt = class extends re {
|
|
|
1982
1984
|
rect: ue,
|
|
1983
1985
|
boundsOfViewArea: ft,
|
|
1984
1986
|
domAnchor: n,
|
|
1985
|
-
unitId:
|
|
1987
|
+
unitId: D,
|
|
1986
1988
|
subUnitId: E
|
|
1987
1989
|
}, B = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge), Ue = new je(B);
|
|
1988
1990
|
ge.position$ = Ue;
|
|
@@ -2000,7 +2002,7 @@ let tt = class extends re {
|
|
|
2000
2002
|
ye.dispatchEvent(new WheelEvent(W.type, W));
|
|
2001
2003
|
},
|
|
2002
2004
|
data: K,
|
|
2003
|
-
unitId:
|
|
2005
|
+
unitId: D
|
|
2004
2006
|
};
|
|
2005
2007
|
e.eventPassThrough && (Ve = {
|
|
2006
2008
|
...Ve,
|
|
@@ -2013,7 +2015,7 @@ let tt = class extends re {
|
|
|
2013
2015
|
onPointerUp: (W) => {
|
|
2014
2016
|
ye.dispatchEvent(new PointerEvent(W.type, W));
|
|
2015
2017
|
}
|
|
2016
|
-
}), this._canvasFloatDomService.addFloatDom(Ve), this.disposeWithMe(
|
|
2018
|
+
}), this._canvasFloatDomService.addFloatDom(Ve), this.disposeWithMe(m.subscribe((W) => {
|
|
2017
2019
|
var hn, gn, fn, mn;
|
|
2018
2020
|
const un = Ct({
|
|
2019
2021
|
startX: W.startX,
|
|
@@ -2026,18 +2028,18 @@ let tt = class extends re {
|
|
|
2026
2028
|
left: p.absolute.left,
|
|
2027
2029
|
top: p.absolute.top
|
|
2028
2030
|
}
|
|
2029
|
-
}, n), Ur = Ie({ unitId:
|
|
2031
|
+
}, n), Ur = Ie({ unitId: D, subUnitId: E, drawingId: T }), Pr = new Ne(Ur, {
|
|
2030
2032
|
left: un.startX,
|
|
2031
2033
|
top: un.startY,
|
|
2032
2034
|
width: (fn = n.width) != null ? fn : W.width,
|
|
2033
2035
|
height: (mn = n.height) != null ? mn : W.height,
|
|
2034
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2036
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
2035
2037
|
}), Ar = fe(Pr, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
2036
2038
|
Ue.next(Ar);
|
|
2037
2039
|
}));
|
|
2038
|
-
const He = (y = this._renderManagerService.getRenderById(
|
|
2040
|
+
const He = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
|
|
2039
2041
|
He == null || He.currentSkeleton$.subscribe((W) => {
|
|
2040
|
-
W && H.sheetId !== W.sheetId && this._removeDom(
|
|
2042
|
+
W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
|
|
2041
2043
|
});
|
|
2042
2044
|
const mt = ue.onTransformChange$.subscribeEvent(() => {
|
|
2043
2045
|
const W = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
@@ -2050,15 +2052,15 @@ let tt = class extends re {
|
|
|
2050
2052
|
}), mt && he.add(mt), this._domLayerInfoMap.set(T, ge);
|
|
2051
2053
|
}
|
|
2052
2054
|
return {
|
|
2053
|
-
id:
|
|
2055
|
+
id: f,
|
|
2054
2056
|
dispose: () => {
|
|
2055
|
-
this._removeDom(
|
|
2057
|
+
this._removeDom(f, !0);
|
|
2056
2058
|
}
|
|
2057
2059
|
};
|
|
2058
2060
|
}
|
|
2059
2061
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2060
2062
|
addFloatDomToColumnHeader(t, e, n, r) {
|
|
2061
|
-
var b, v,
|
|
2063
|
+
var b, v, C;
|
|
2062
2064
|
const s = oe(this._univerInstanceService, {
|
|
2063
2065
|
unitId: e.unitId,
|
|
2064
2066
|
subUnitId: e.subUnitId
|
|
@@ -2071,7 +2073,7 @@ let tt = class extends re {
|
|
|
2071
2073
|
if (!u) return;
|
|
2072
2074
|
const c = (b = this._renderManagerService.getRenderById(o)) == null ? void 0 : b.with(V).getWorksheetSkeleton(a);
|
|
2073
2075
|
if (!c) return;
|
|
2074
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
2076
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : bt(), { position: p, position$: m } = this._createRangePositionObserver({
|
|
2075
2077
|
startRow: 0,
|
|
2076
2078
|
endRow: 0,
|
|
2077
2079
|
startColumn: t,
|
|
@@ -2082,7 +2084,7 @@ let tt = class extends re {
|
|
|
2082
2084
|
const I = {
|
|
2083
2085
|
unitId: o,
|
|
2084
2086
|
subUnitId: a,
|
|
2085
|
-
drawingId:
|
|
2087
|
+
drawingId: f,
|
|
2086
2088
|
drawingType: e.type || j.DRAWING_DOM,
|
|
2087
2089
|
componentKey: l,
|
|
2088
2090
|
transform: {
|
|
@@ -2095,7 +2097,7 @@ let tt = class extends re {
|
|
|
2095
2097
|
allowTransform: h
|
|
2096
2098
|
};
|
|
2097
2099
|
{
|
|
2098
|
-
const { unitId: w, subUnitId: y, drawingId:
|
|
2100
|
+
const { unitId: w, subUnitId: y, drawingId: D } = I, E = oe(this._univerInstanceService, { unitId: w, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(w, x.UNIVER_SHEET);
|
|
2099
2101
|
if (!M)
|
|
2100
2102
|
return;
|
|
2101
2103
|
const R = M.getActiveSheet().getSheetId();
|
|
@@ -2110,10 +2112,10 @@ let tt = class extends re {
|
|
|
2110
2112
|
const { transform: q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2111
2113
|
if (X == null)
|
|
2112
2114
|
return;
|
|
2113
|
-
const { scene:
|
|
2115
|
+
const { scene: L, canvas: K } = X;
|
|
2114
2116
|
if (q == null || R !== y)
|
|
2115
2117
|
return;
|
|
2116
|
-
const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId:
|
|
2118
|
+
const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId: D }), ut = L.getObject(lt);
|
|
2117
2119
|
if (ut != null) {
|
|
2118
2120
|
ut.transformByState({ left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt });
|
|
2119
2121
|
return;
|
|
@@ -2136,8 +2138,8 @@ let tt = class extends re {
|
|
|
2136
2138
|
height: Ee.height,
|
|
2137
2139
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2138
2140
|
}, le = new Ne(lt, ht);
|
|
2139
|
-
|
|
2140
|
-
const Q = new wt(), Te =
|
|
2141
|
+
L.addObject(le, Lt), T.allowTransform !== !1 && L.attachTransformerTo(le);
|
|
2142
|
+
const Q = new wt(), Te = L.getMainViewport(), ue = {
|
|
2141
2143
|
top: 0,
|
|
2142
2144
|
//viewMain.top,
|
|
2143
2145
|
left: Te.left,
|
|
@@ -2157,7 +2159,7 @@ let tt = class extends re {
|
|
|
2157
2159
|
he.position$ = Oe;
|
|
2158
2160
|
let Xe = {
|
|
2159
2161
|
position$: Oe,
|
|
2160
|
-
id:
|
|
2162
|
+
id: D,
|
|
2161
2163
|
componentKey: T.componentKey,
|
|
2162
2164
|
onPointerDown: () => {
|
|
2163
2165
|
},
|
|
@@ -2189,7 +2191,7 @@ let tt = class extends re {
|
|
|
2189
2191
|
B
|
|
2190
2192
|
);
|
|
2191
2193
|
});
|
|
2192
|
-
this.disposeWithMe(
|
|
2194
|
+
this.disposeWithMe(m.subscribe((B) => {
|
|
2193
2195
|
const Ue = Ct({
|
|
2194
2196
|
startX: B.startX,
|
|
2195
2197
|
startY: 0,
|
|
@@ -2201,7 +2203,7 @@ let tt = class extends re {
|
|
|
2201
2203
|
left: p.absolute.left,
|
|
2202
2204
|
top: p.absolute.top
|
|
2203
2205
|
}
|
|
2204
|
-
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId:
|
|
2206
|
+
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: D }), He = new Ne(Ve, {
|
|
2205
2207
|
left: Ue.startX,
|
|
2206
2208
|
top: 0,
|
|
2207
2209
|
width: n.width,
|
|
@@ -2210,17 +2212,17 @@ let tt = class extends re {
|
|
|
2210
2212
|
}), mt = fe(He, X.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2211
2213
|
Oe.next(mt);
|
|
2212
2214
|
}));
|
|
2213
|
-
const ge = (
|
|
2215
|
+
const ge = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
|
|
2214
2216
|
ge == null || ge.currentSkeleton$.subscribe((B) => {
|
|
2215
|
-
B && c.sheetId !== B.sheetId && this._removeDom(
|
|
2217
|
+
B && c.sheetId !== B.sheetId && this._removeDom(f, !0);
|
|
2216
2218
|
}), Q.add(() => {
|
|
2217
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2218
|
-
}), ft && Q.add(ft), this._domLayerInfoMap.set(
|
|
2219
|
+
this._canvasFloatDomService.removeFloatDom(D);
|
|
2220
|
+
}), ft && Q.add(ft), this._domLayerInfoMap.set(D, he);
|
|
2219
2221
|
}
|
|
2220
2222
|
return {
|
|
2221
|
-
id:
|
|
2223
|
+
id: f,
|
|
2222
2224
|
dispose: () => {
|
|
2223
|
-
this._removeDom(
|
|
2225
|
+
this._removeDom(f, !0);
|
|
2224
2226
|
}
|
|
2225
2227
|
};
|
|
2226
2228
|
}
|
|
@@ -2238,18 +2240,18 @@ let tt = class extends re {
|
|
|
2238
2240
|
_createRangePositionObserver(t, e, n) {
|
|
2239
2241
|
let { startRow: r, startColumn: s } = t;
|
|
2240
2242
|
const o = Je(r, s, n), a = new je(o), d = Je(t.endRow, t.endColumn, n), u = new je(d), c = () => {
|
|
2241
|
-
const
|
|
2242
|
-
a.next(
|
|
2243
|
+
const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
|
|
2244
|
+
a.next(m), u.next(_);
|
|
2243
2245
|
}, l = new wt();
|
|
2244
|
-
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((
|
|
2245
|
-
if (
|
|
2246
|
+
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
|
|
2247
|
+
if (m.id === zi.id && m.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2246
2248
|
c();
|
|
2247
2249
|
return;
|
|
2248
2250
|
}
|
|
2249
|
-
(Ki.indexOf(
|
|
2251
|
+
(Ki.indexOf(m.id) > -1 || m.id === Ti.id || m.id === On.id) && c();
|
|
2250
2252
|
}));
|
|
2251
|
-
const g = (
|
|
2252
|
-
r =
|
|
2253
|
+
const g = (m, _) => {
|
|
2254
|
+
r = m, s = _, c();
|
|
2253
2255
|
}, h = () => ({
|
|
2254
2256
|
rotate: 0,
|
|
2255
2257
|
width: d.right - o.left,
|
|
@@ -2262,26 +2264,26 @@ let tt = class extends re {
|
|
|
2262
2264
|
startY: o.top,
|
|
2263
2265
|
endX: d.right,
|
|
2264
2266
|
endY: d.bottom
|
|
2265
|
-
}),
|
|
2266
|
-
Me((
|
|
2267
|
+
}), f = a.pipe(
|
|
2268
|
+
Me((m) => {
|
|
2267
2269
|
const _ = Je(t.endRow, t.endColumn, n);
|
|
2268
2270
|
return {
|
|
2269
2271
|
rotate: 0,
|
|
2270
|
-
width: _.right -
|
|
2271
|
-
height: _.bottom -
|
|
2272
|
+
width: _.right - m.left,
|
|
2273
|
+
height: _.bottom - m.top,
|
|
2272
2274
|
absolute: {
|
|
2273
2275
|
left: !0,
|
|
2274
2276
|
top: !0
|
|
2275
2277
|
},
|
|
2276
|
-
startX:
|
|
2277
|
-
startY:
|
|
2278
|
+
startX: m.left,
|
|
2279
|
+
startY: m.top,
|
|
2278
2280
|
endX: _.right,
|
|
2279
2281
|
endY: _.bottom
|
|
2280
2282
|
};
|
|
2281
2283
|
})
|
|
2282
2284
|
), p = h();
|
|
2283
2285
|
return {
|
|
2284
|
-
position$:
|
|
2286
|
+
position$: f,
|
|
2285
2287
|
position: p,
|
|
2286
2288
|
updateRowCol: g,
|
|
2287
2289
|
topLeftPos$: a,
|
|
@@ -2297,7 +2299,7 @@ tt = ks([
|
|
|
2297
2299
|
De(3, ie),
|
|
2298
2300
|
De(4, A(Wi)),
|
|
2299
2301
|
De(5, se),
|
|
2300
|
-
De(6, A(
|
|
2302
|
+
De(6, A(Lr))
|
|
2301
2303
|
], tt);
|
|
2302
2304
|
function Je(i, t, e) {
|
|
2303
2305
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
@@ -2359,16 +2361,16 @@ const Ws = (i) => {
|
|
|
2359
2361
|
r,
|
|
2360
2362
|
void 0,
|
|
2361
2363
|
!0
|
|
2362
|
-
), { scaleX: h, scaleY:
|
|
2364
|
+
), { scaleX: h, scaleY: f } = e.getAncestorScale(), p = {
|
|
2363
2365
|
startX: g.left,
|
|
2364
2366
|
endX: g.right,
|
|
2365
2367
|
startY: g.top,
|
|
2366
2368
|
endY: g.bottom,
|
|
2367
2369
|
rotate: u,
|
|
2368
2370
|
width: a * h,
|
|
2369
|
-
height: d *
|
|
2371
|
+
height: d * f,
|
|
2370
2372
|
absolute: g.absolute
|
|
2371
|
-
},
|
|
2373
|
+
}, m = {
|
|
2372
2374
|
position$: new je(p),
|
|
2373
2375
|
position: p,
|
|
2374
2376
|
id: o.drawingId,
|
|
@@ -2384,7 +2386,7 @@ const Ws = (i) => {
|
|
|
2384
2386
|
unitId: o.unitId,
|
|
2385
2387
|
data: o.data
|
|
2386
2388
|
};
|
|
2387
|
-
return [o.drawingId,
|
|
2389
|
+
return [o.drawingId, m];
|
|
2388
2390
|
}), [t, e, n, r]);
|
|
2389
2391
|
return /* @__PURE__ */ ae("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ ae(ji, { layer: a, id: o, position: a.position }, o)) });
|
|
2390
2392
|
};
|
|
@@ -2428,8 +2430,8 @@ let Ut = class extends re {
|
|
|
2428
2430
|
const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
|
|
2429
2431
|
return g.length ? (g.forEach((h) => {
|
|
2430
2432
|
if (!h.groupId && h.transform && Re.isDefine(h.transform.left) && Re.isDefine(h.transform.top) && Re.isDefine(h.transform.width) && Re.isDefine(h.transform.height)) {
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
+
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2434
|
+
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2433
2435
|
}
|
|
2434
2436
|
}), e(l)) : e(i);
|
|
2435
2437
|
}
|
|
@@ -2481,7 +2483,7 @@ Ut = Bs([
|
|
|
2481
2483
|
be(3, J),
|
|
2482
2484
|
be(4, A(tt)),
|
|
2483
2485
|
be(5, A(zn)),
|
|
2484
|
-
be(6, A(
|
|
2486
|
+
be(6, A(Le))
|
|
2485
2487
|
], Ut);
|
|
2486
2488
|
var $s = Object.getOwnPropertyDescriptor, xs = (i, t, e, n) => {
|
|
2487
2489
|
for (var r = n > 1 ? void 0 : n ? $s(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -2508,7 +2510,7 @@ const Fs = [
|
|
|
2508
2510
|
dr.id,
|
|
2509
2511
|
lr.id,
|
|
2510
2512
|
ur.id
|
|
2511
|
-
],
|
|
2513
|
+
], Ys = [
|
|
2512
2514
|
Zi.id,
|
|
2513
2515
|
Ji.id,
|
|
2514
2516
|
qi.id,
|
|
@@ -2600,42 +2602,42 @@ let sn = class extends re {
|
|
|
2600
2602
|
const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
|
|
2601
2603
|
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
|
|
2602
2604
|
}
|
|
2603
|
-
return s.push({ id:
|
|
2605
|
+
return s.push({ id: Y.id, params: [n] }), o.push({ id: Y.id, params: [n] }), {
|
|
2604
2606
|
redos: s,
|
|
2605
2607
|
undos: o
|
|
2606
2608
|
};
|
|
2607
2609
|
}
|
|
2608
2610
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2609
|
-
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column:
|
|
2611
|
+
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2610
2612
|
if (s == null || a == null)
|
|
2611
2613
|
return {
|
|
2612
2614
|
updateDrawings: n,
|
|
2613
2615
|
deleteDrawings: r
|
|
2614
2616
|
};
|
|
2615
2617
|
const { startRow: _, endRow: S, startColumn: I, endColumn: b } = i;
|
|
2616
|
-
let v = null,
|
|
2618
|
+
let v = null, C = null;
|
|
2617
2619
|
if (t === 0 && h >= _ && p <= S)
|
|
2618
|
-
if (
|
|
2620
|
+
if (f >= I && m <= b)
|
|
2619
2621
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2620
2622
|
else {
|
|
2621
2623
|
const w = this._shrinkCol(s, a, I, b, o);
|
|
2622
|
-
v = w == null ? void 0 : w.newSheetTransform,
|
|
2624
|
+
v = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2623
2625
|
}
|
|
2624
|
-
else if (t === 1 &&
|
|
2626
|
+
else if (t === 1 && f >= I && m <= b)
|
|
2625
2627
|
if (h >= _ && p <= S)
|
|
2626
2628
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2627
2629
|
else {
|
|
2628
2630
|
const w = this._shrinkRow(s, a, _, S, o);
|
|
2629
|
-
v = w == null ? void 0 : w.newSheetTransform,
|
|
2631
|
+
v = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2630
2632
|
}
|
|
2631
2633
|
else if (t === 2) {
|
|
2632
2634
|
const w = this._expandRow(s, a, _, S, o);
|
|
2633
|
-
v = w == null ? void 0 : w.newSheetTransform,
|
|
2635
|
+
v = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2634
2636
|
} else if (t === 3) {
|
|
2635
2637
|
const w = this._expandCol(s, a, I, b, o);
|
|
2636
|
-
v = w == null ? void 0 : w.newSheetTransform,
|
|
2638
|
+
v = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2637
2639
|
}
|
|
2638
|
-
if (v != null &&
|
|
2640
|
+
if (v != null && C != null) {
|
|
2639
2641
|
const w = z(v, this._selectionRenderService, this._skeletonManagerService);
|
|
2640
2642
|
n.push({ ...e, sheetTransform: v, transform: w });
|
|
2641
2643
|
}
|
|
@@ -2652,19 +2654,19 @@ let sn = class extends re {
|
|
|
2652
2654
|
_getDrawingUndoForColVisible(i, t, e) {
|
|
2653
2655
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2654
2656
|
if (Object.keys(n).forEach((c) => {
|
|
2655
|
-
const l = n[c], { sheetTransform: g, transform: h, anchorType:
|
|
2656
|
-
if (
|
|
2657
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
|
|
2658
|
+
if (f === O.None)
|
|
2657
2659
|
this._remainDrawingSize(h, r, l);
|
|
2658
2660
|
else {
|
|
2659
|
-
const { from: p, to:
|
|
2661
|
+
const { from: p, to: m } = g, { row: _, column: S } = p, { row: I, column: b } = m;
|
|
2660
2662
|
for (let v = 0; v < e.length; v++) {
|
|
2661
|
-
const
|
|
2662
|
-
if (b <
|
|
2663
|
+
const C = e[v], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
|
|
2664
|
+
if (b < D)
|
|
2663
2665
|
continue;
|
|
2664
|
-
if (
|
|
2666
|
+
if (f === O.Position) {
|
|
2665
2667
|
let R = null, N = null;
|
|
2666
|
-
if (S >=
|
|
2667
|
-
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow:
|
|
2668
|
+
if (S >= D && S <= E) {
|
|
2669
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2668
2670
|
if (F == null)
|
|
2669
2671
|
return;
|
|
2670
2672
|
N = { ...h, left: F.startX };
|
|
@@ -2676,11 +2678,11 @@ let sn = class extends re {
|
|
|
2676
2678
|
this._remainDrawingSize(h, r, l);
|
|
2677
2679
|
continue;
|
|
2678
2680
|
}
|
|
2679
|
-
if (S >=
|
|
2681
|
+
if (S >= D && b <= E)
|
|
2680
2682
|
continue;
|
|
2681
2683
|
let T = null, M = null;
|
|
2682
|
-
if (S >=
|
|
2683
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow:
|
|
2684
|
+
if (S >= D && S <= E) {
|
|
2685
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2684
2686
|
if (R == null)
|
|
2685
2687
|
return;
|
|
2686
2688
|
M = {
|
|
@@ -2688,8 +2690,8 @@ let sn = class extends re {
|
|
|
2688
2690
|
left: (R == null ? void 0 : R.startX) || 0,
|
|
2689
2691
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2690
2692
|
};
|
|
2691
|
-
} else if (b >=
|
|
2692
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
2693
|
+
} else if (b >= D && b <= E) {
|
|
2694
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: b, startRow: p.row, endRow: m.row });
|
|
2693
2695
|
if (R == null)
|
|
2694
2696
|
return;
|
|
2695
2697
|
M = {
|
|
@@ -2697,7 +2699,7 @@ let sn = class extends re {
|
|
|
2697
2699
|
left: R.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2698
2700
|
};
|
|
2699
2701
|
} else {
|
|
2700
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
2702
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2701
2703
|
if (R == null)
|
|
2702
2704
|
return;
|
|
2703
2705
|
if (M = {
|
|
@@ -2732,10 +2734,10 @@ let sn = class extends re {
|
|
|
2732
2734
|
_createUndoAndRedoMutation(i, t, e) {
|
|
2733
2735
|
const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
|
|
2734
2736
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
|
|
2735
|
-
{ id:
|
|
2737
|
+
{ id: Y.id, params: [i] }
|
|
2736
2738
|
], d = [
|
|
2737
2739
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
|
|
2738
|
-
{ id:
|
|
2740
|
+
{ id: Y.id, params: [i] }
|
|
2739
2741
|
];
|
|
2740
2742
|
return {
|
|
2741
2743
|
redos: a,
|
|
@@ -2746,19 +2748,19 @@ let sn = class extends re {
|
|
|
2746
2748
|
_getDrawingUndoForRowVisible(i, t, e) {
|
|
2747
2749
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2748
2750
|
if (Object.keys(n).forEach((c) => {
|
|
2749
|
-
const l = n[c], { sheetTransform: g, transform: h, anchorType:
|
|
2750
|
-
if (
|
|
2751
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
|
|
2752
|
+
if (f === O.None)
|
|
2751
2753
|
this._remainDrawingSize(h, r, l);
|
|
2752
2754
|
else {
|
|
2753
|
-
const { from: p, to:
|
|
2755
|
+
const { from: p, to: m } = g, { row: _, column: S } = p, { row: I, column: b } = m;
|
|
2754
2756
|
for (let v = 0; v < e.length; v++) {
|
|
2755
|
-
const
|
|
2757
|
+
const C = e[v], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
|
|
2756
2758
|
if (I < w)
|
|
2757
2759
|
continue;
|
|
2758
|
-
if (
|
|
2760
|
+
if (f === O.Position) {
|
|
2759
2761
|
let R = null, N = null;
|
|
2760
2762
|
if (_ >= w && _ <= y) {
|
|
2761
|
-
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2763
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
|
|
2762
2764
|
if (F == null)
|
|
2763
2765
|
return;
|
|
2764
2766
|
N = { ...h, top: F.startY };
|
|
@@ -2774,7 +2776,7 @@ let sn = class extends re {
|
|
|
2774
2776
|
continue;
|
|
2775
2777
|
let T = null, M = null;
|
|
2776
2778
|
if (_ >= w && _ <= y) {
|
|
2777
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2779
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
|
|
2778
2780
|
if (R == null)
|
|
2779
2781
|
return;
|
|
2780
2782
|
M = {
|
|
@@ -2783,7 +2785,7 @@ let sn = class extends re {
|
|
|
2783
2785
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2784
2786
|
};
|
|
2785
2787
|
} else if (I >= w && I <= y) {
|
|
2786
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2788
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: I });
|
|
2787
2789
|
if (R == null)
|
|
2788
2790
|
return;
|
|
2789
2791
|
M = {
|
|
@@ -2791,7 +2793,7 @@ let sn = class extends re {
|
|
|
2791
2793
|
top: R.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2792
2794
|
};
|
|
2793
2795
|
} else {
|
|
2794
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2796
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: y });
|
|
2795
2797
|
if (R == null)
|
|
2796
2798
|
return;
|
|
2797
2799
|
if (M = {
|
|
@@ -2830,12 +2832,12 @@ let sn = class extends re {
|
|
|
2830
2832
|
if (c === O.None)
|
|
2831
2833
|
this._remainDrawingSize(u, s, a);
|
|
2832
2834
|
else {
|
|
2833
|
-
const { from: l, to: g } = d, { row: h, column:
|
|
2835
|
+
const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2834
2836
|
for (let _ = 0; _ < e.length; _++) {
|
|
2835
|
-
const S = e[_], { startRow: I, endRow: b, startColumn: v, endColumn:
|
|
2836
|
-
if (p < I ||
|
|
2837
|
+
const S = e[_], { startRow: I, endRow: b, startColumn: v, endColumn: C } = S;
|
|
2838
|
+
if (p < I || m < v)
|
|
2837
2839
|
continue;
|
|
2838
|
-
if (c === O.Position && (h <= I && p >= b ||
|
|
2840
|
+
if (c === O.Position && (h <= I && p >= b || f <= v && m >= C)) {
|
|
2839
2841
|
this._remainDrawingSize(u, s, a);
|
|
2840
2842
|
continue;
|
|
2841
2843
|
}
|
|
@@ -2876,24 +2878,24 @@ let sn = class extends re {
|
|
|
2876
2878
|
return { redos: [], undos: [] };
|
|
2877
2879
|
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2878
2880
|
Object.keys(g).forEach((v) => {
|
|
2879
|
-
const
|
|
2880
|
-
if (
|
|
2881
|
+
const C = g[v];
|
|
2882
|
+
if (C.anchorType !== O.Both)
|
|
2881
2883
|
return;
|
|
2882
|
-
const { transform: w } =
|
|
2884
|
+
const { transform: w } = C;
|
|
2883
2885
|
if (!w)
|
|
2884
2886
|
return;
|
|
2885
|
-
const { left: y = 0, top:
|
|
2887
|
+
const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: R, drawingStartY: N, drawingEndY: F } = {
|
|
2886
2888
|
drawingStartX: y,
|
|
2887
2889
|
drawingEndX: y + E,
|
|
2888
|
-
drawingStartY:
|
|
2889
|
-
drawingEndY:
|
|
2890
|
+
drawingStartY: D,
|
|
2891
|
+
drawingEndY: D + T
|
|
2890
2892
|
};
|
|
2891
|
-
d <= M && R <= u && c <= N && F <= l && h.push(
|
|
2893
|
+
d <= M && R <= u && c <= N && F <= l && h.push(C);
|
|
2892
2894
|
});
|
|
2893
|
-
const
|
|
2894
|
-
const
|
|
2895
|
-
to: { ...
|
|
2896
|
-
from: { ...
|
|
2895
|
+
const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
2896
|
+
const C = v.sheetTransform, w = {
|
|
2897
|
+
to: { ...C.to, row: C.to.row + m, column: C.to.column + _ },
|
|
2898
|
+
from: { ...C.from, row: C.from.row + m, column: C.from.column + _ }
|
|
2897
2899
|
}, y = z(w, this._selectionRenderService, this._skeletonManagerService);
|
|
2898
2900
|
return {
|
|
2899
2901
|
unitId: r,
|
|
@@ -2904,10 +2906,10 @@ let sn = class extends re {
|
|
|
2904
2906
|
};
|
|
2905
2907
|
});
|
|
2906
2908
|
if (S.length) {
|
|
2907
|
-
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo:
|
|
2908
|
-
|
|
2909
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: w, objects: y } = v;
|
|
2910
|
+
f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
|
|
2909
2911
|
}
|
|
2910
|
-
return { redos:
|
|
2912
|
+
return { redos: f, undos: p };
|
|
2911
2913
|
}
|
|
2912
2914
|
_moveRowInterceptor(i, t) {
|
|
2913
2915
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
@@ -2915,20 +2917,20 @@ let sn = class extends re {
|
|
|
2915
2917
|
return { redos: [], undos: [] };
|
|
2916
2918
|
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2917
2919
|
if (Object.keys(c).forEach((h) => {
|
|
2918
|
-
const
|
|
2919
|
-
if (p == null ||
|
|
2920
|
+
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2921
|
+
if (p == null || m == null)
|
|
2920
2922
|
return;
|
|
2921
2923
|
let S, I;
|
|
2922
2924
|
if (t === "insert") {
|
|
2923
|
-
const v = this._expandRow(p,
|
|
2925
|
+
const v = this._expandRow(p, m, o, a, _);
|
|
2924
2926
|
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2925
2927
|
} else {
|
|
2926
|
-
const { from: v, to:
|
|
2928
|
+
const { from: v, to: C } = p, { row: w } = v, { row: y } = C;
|
|
2927
2929
|
if (_ === O.Both && w >= o && y <= a)
|
|
2928
2930
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2929
2931
|
else {
|
|
2930
|
-
const
|
|
2931
|
-
S =
|
|
2932
|
+
const D = this._shrinkRow(p, m, o, a, _);
|
|
2933
|
+
S = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
2932
2934
|
}
|
|
2933
2935
|
}
|
|
2934
2936
|
if (!S || !I)
|
|
@@ -2938,14 +2940,14 @@ let sn = class extends re {
|
|
|
2938
2940
|
}), l.length === 0 && g.length === 0)
|
|
2939
2941
|
return { redos: [], undos: [] };
|
|
2940
2942
|
if (l.length > 0) {
|
|
2941
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
2942
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects:
|
|
2943
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
2944
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
|
|
2943
2945
|
}
|
|
2944
2946
|
if (g.length > 0) {
|
|
2945
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
2946
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects:
|
|
2947
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
2948
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
|
|
2947
2949
|
}
|
|
2948
|
-
return d.push({ id:
|
|
2950
|
+
return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
|
|
2949
2951
|
redos: d,
|
|
2950
2952
|
undos: u
|
|
2951
2953
|
};
|
|
@@ -2956,20 +2958,20 @@ let sn = class extends re {
|
|
|
2956
2958
|
return { redos: [], undos: [] };
|
|
2957
2959
|
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2958
2960
|
if (Object.keys(c).forEach((h) => {
|
|
2959
|
-
const
|
|
2960
|
-
if (p == null ||
|
|
2961
|
+
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2962
|
+
if (p == null || m == null)
|
|
2961
2963
|
return;
|
|
2962
2964
|
let S, I;
|
|
2963
2965
|
if (t === "insert") {
|
|
2964
|
-
const v = this._expandCol(p,
|
|
2966
|
+
const v = this._expandCol(p, m, o, a, _);
|
|
2965
2967
|
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2966
2968
|
} else {
|
|
2967
|
-
const { from: v, to:
|
|
2969
|
+
const { from: v, to: C } = p, { column: w } = v, { column: y } = C;
|
|
2968
2970
|
if (_ === O.Both && w >= o && y <= a)
|
|
2969
2971
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2970
2972
|
else {
|
|
2971
|
-
const
|
|
2972
|
-
S =
|
|
2973
|
+
const D = this._shrinkCol(p, m, o, a, _);
|
|
2974
|
+
S = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
2973
2975
|
}
|
|
2974
2976
|
}
|
|
2975
2977
|
if (!S || !I)
|
|
@@ -2979,14 +2981,14 @@ let sn = class extends re {
|
|
|
2979
2981
|
}), l.length === 0 && g.length === 0)
|
|
2980
2982
|
return { redos: [], undos: [] };
|
|
2981
2983
|
if (l.length > 0) {
|
|
2982
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
2983
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects:
|
|
2984
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
2985
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
|
|
2984
2986
|
}
|
|
2985
2987
|
if (g.length > 0) {
|
|
2986
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
2987
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects:
|
|
2988
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
2989
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
|
|
2988
2990
|
}
|
|
2989
|
-
return d.push({ id:
|
|
2991
|
+
return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: d, undos: u };
|
|
2990
2992
|
}
|
|
2991
2993
|
_expandCol(i, t, e, n, r = O.Position) {
|
|
2992
2994
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
@@ -3215,7 +3217,7 @@ let sn = class extends re {
|
|
|
3215
3217
|
_sheetRefreshListener() {
|
|
3216
3218
|
this.disposeWithMe(
|
|
3217
3219
|
this._commandService.onCommandExecuted((i) => {
|
|
3218
|
-
|
|
3220
|
+
Ys.includes(i.id) && requestIdleCallback(() => {
|
|
3219
3221
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3220
3222
|
this._refreshDrawingTransform(e, n, r);
|
|
3221
3223
|
});
|
|
@@ -3228,9 +3230,9 @@ let sn = class extends re {
|
|
|
3228
3230
|
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3229
3231
|
if (u === O.None)
|
|
3230
3232
|
return !0;
|
|
3231
|
-
const { from: c, to: l } = a, { row: g, column: h } = c, { row:
|
|
3232
|
-
for (let
|
|
3233
|
-
const _ = e[
|
|
3233
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
|
|
3234
|
+
for (let m = 0; m < e.length; m++) {
|
|
3235
|
+
const _ = e[m], { startRow: S, endRow: I, startColumn: b, endColumn: v } = _;
|
|
3234
3236
|
if (Hr.intersects(
|
|
3235
3237
|
{
|
|
3236
3238
|
startRow: S,
|
|
@@ -3240,24 +3242,24 @@ let sn = class extends re {
|
|
|
3240
3242
|
},
|
|
3241
3243
|
{
|
|
3242
3244
|
startRow: g,
|
|
3243
|
-
endRow:
|
|
3245
|
+
endRow: f,
|
|
3244
3246
|
startColumn: h,
|
|
3245
3247
|
endColumn: p
|
|
3246
3248
|
}
|
|
3247
3249
|
) || g > I || h > v) {
|
|
3248
|
-
const
|
|
3250
|
+
const C = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3249
3251
|
r.push({
|
|
3250
3252
|
...o,
|
|
3251
3253
|
transform: {
|
|
3252
3254
|
...w,
|
|
3253
|
-
width:
|
|
3254
|
-
height:
|
|
3255
|
+
width: C ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
|
|
3256
|
+
height: C ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
|
|
3255
3257
|
}
|
|
3256
3258
|
});
|
|
3257
3259
|
break;
|
|
3258
3260
|
}
|
|
3259
3261
|
}
|
|
3260
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
3262
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(Y.id, [i]));
|
|
3261
3263
|
}
|
|
3262
3264
|
};
|
|
3263
3265
|
sn = xs([
|
|
@@ -3278,7 +3280,7 @@ var ne = function() {
|
|
|
3278
3280
|
}
|
|
3279
3281
|
return i;
|
|
3280
3282
|
}, ne.apply(this, arguments);
|
|
3281
|
-
},
|
|
3283
|
+
}, Ls = function(i, t) {
|
|
3282
3284
|
var e = {};
|
|
3283
3285
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3284
3286
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -3286,7 +3288,7 @@ var ne = function() {
|
|
|
3286
3288
|
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3287
3289
|
return e;
|
|
3288
3290
|
}, br = hr(function(i, t) {
|
|
3289
|
-
var e = i.icon, n = i.id, r = i.className, s = i.extend, o =
|
|
3291
|
+
var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Ls(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = as("_".concat(Vs()));
|
|
3290
3292
|
return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, ne({ ref: t, className: a }, o), s);
|
|
3291
3293
|
});
|
|
3292
3294
|
function Rr(i, t, e, n, r) {
|
|
@@ -3356,8 +3358,8 @@ const yr = {
|
|
|
3356
3358
|
const { transform: l } = c;
|
|
3357
3359
|
if (l == null)
|
|
3358
3360
|
return null;
|
|
3359
|
-
const g = { ...l }, { left: h = 0, top:
|
|
3360
|
-
return s === ve.UP ? g.top =
|
|
3361
|
+
const g = { ...l }, { left: h = 0, top: f = 0 } = l;
|
|
3362
|
+
return s === ve.UP ? g.top = f - 1 : s === ve.DOWN ? g.top = f + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
|
|
3361
3363
|
...c,
|
|
3362
3364
|
transform: g,
|
|
3363
3365
|
sheetTransform: $(g, r)
|
|
@@ -3366,7 +3368,7 @@ const yr = {
|
|
|
3366
3368
|
return e.syncExecuteCommand(jt.id, {
|
|
3367
3369
|
unitId: a,
|
|
3368
3370
|
drawings: d
|
|
3369
|
-
}) ? (e.syncExecuteCommand(
|
|
3371
|
+
}) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
|
|
3370
3372
|
}
|
|
3371
3373
|
}, Er = "addition-and-subtraction-single", Tr = "sheet.menu.image";
|
|
3372
3374
|
function zs(i) {
|
|
@@ -3403,16 +3405,16 @@ const Js = (i) => {
|
|
|
3403
3405
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3404
3406
|
if (u == null)
|
|
3405
3407
|
return;
|
|
3406
|
-
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (S = o.anchorType) != null ? S : O.Position, [
|
|
3407
|
-
function
|
|
3408
|
+
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (S = o.anchorType) != null ? S : O.Position, [f, p] = en(h);
|
|
3409
|
+
function m(I, b) {
|
|
3408
3410
|
const v = [];
|
|
3409
|
-
return I.forEach((
|
|
3410
|
-
const { oKey: w } =
|
|
3411
|
+
return I.forEach((C) => {
|
|
3412
|
+
const { oKey: w } = C, y = b.getDrawingOKey(w);
|
|
3411
3413
|
if (y == null)
|
|
3412
3414
|
return v.push(null), !0;
|
|
3413
|
-
const { unitId:
|
|
3415
|
+
const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType: R, sheetTransform: N } = y;
|
|
3414
3416
|
v.push({
|
|
3415
|
-
unitId:
|
|
3417
|
+
unitId: D,
|
|
3416
3418
|
subUnitId: E,
|
|
3417
3419
|
drawingId: T,
|
|
3418
3420
|
anchorType: R,
|
|
@@ -3426,13 +3428,13 @@ const Js = (i) => {
|
|
|
3426
3428
|
v === !0 && g(!1);
|
|
3427
3429
|
}), b = c.changeStart$.subscribe((v) => {
|
|
3428
3430
|
var y;
|
|
3429
|
-
const { objects:
|
|
3431
|
+
const { objects: C } = v, w = m(C, n);
|
|
3430
3432
|
if (w.length === 0)
|
|
3431
3433
|
g(!1);
|
|
3432
3434
|
else if (w.length >= 1) {
|
|
3433
3435
|
g(!0);
|
|
3434
|
-
const
|
|
3435
|
-
p(
|
|
3436
|
+
const D = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3437
|
+
p(D);
|
|
3436
3438
|
}
|
|
3437
3439
|
});
|
|
3438
3440
|
return () => {
|
|
@@ -3444,10 +3446,10 @@ const Js = (i) => {
|
|
|
3444
3446
|
const b = n.getFocusDrawings();
|
|
3445
3447
|
if (b.length === 0)
|
|
3446
3448
|
return;
|
|
3447
|
-
const v = b.map((
|
|
3448
|
-
unitId:
|
|
3449
|
-
subUnitId:
|
|
3450
|
-
drawingId:
|
|
3449
|
+
const v = b.map((C) => ({
|
|
3450
|
+
unitId: C.unitId,
|
|
3451
|
+
subUnitId: C.subUnitId,
|
|
3452
|
+
drawingId: C.drawingId,
|
|
3451
3453
|
anchorType: I
|
|
3452
3454
|
}));
|
|
3453
3455
|
t.executeCommand(jt.id, {
|
|
@@ -3465,11 +3467,11 @@ const Js = (i) => {
|
|
|
3465
3467
|
/* @__PURE__ */ ae(
|
|
3466
3468
|
"header",
|
|
3467
3469
|
{
|
|
3468
|
-
className: "univer-text-gray-600 dark
|
|
3470
|
+
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
3469
3471
|
children: /* @__PURE__ */ ae("div", { children: e.t("drawing-anchor.title") })
|
|
3470
3472
|
}
|
|
3471
3473
|
),
|
|
3472
|
-
/* @__PURE__ */ ae("div", { children: /* @__PURE__ */ Qt(Si, { value:
|
|
3474
|
+
/* @__PURE__ */ ae("div", { children: /* @__PURE__ */ Qt(Si, { value: f, onChange: _, direction: "vertical", children: [
|
|
3473
3475
|
/* @__PURE__ */ ae(Gt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3474
3476
|
/* @__PURE__ */ ae(Gt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3475
3477
|
/* @__PURE__ */ ae(Gt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
@@ -3491,9 +3493,9 @@ const Js = (i) => {
|
|
|
3491
3493
|
/* @__PURE__ */ ae(Js, { drawings: e })
|
|
3492
3494
|
] });
|
|
3493
3495
|
}, Qs = {
|
|
3494
|
-
[$i.
|
|
3496
|
+
[$i.MEDIA]: {
|
|
3495
3497
|
[Tr]: {
|
|
3496
|
-
order:
|
|
3498
|
+
order: 0,
|
|
3497
3499
|
menuItemFactory: zs,
|
|
3498
3500
|
[Bt.id]: {
|
|
3499
3501
|
order: 0,
|
|
@@ -3582,7 +3584,7 @@ let Pt = class extends re {
|
|
|
3582
3584
|
rt,
|
|
3583
3585
|
jt,
|
|
3584
3586
|
pr,
|
|
3585
|
-
|
|
3587
|
+
Y,
|
|
3586
3588
|
wr,
|
|
3587
3589
|
_r,
|
|
3588
3590
|
Sr,
|
|
@@ -3679,12 +3681,12 @@ Or(At, "type", x.UNIVER_SHEET);
|
|
|
3679
3681
|
Or(At, "pluginName", ho);
|
|
3680
3682
|
At = uo([
|
|
3681
3683
|
Jr(oi, ri, hi, pi),
|
|
3682
|
-
Vt(1, A(
|
|
3684
|
+
Vt(1, A(Le)),
|
|
3683
3685
|
Vt(2, J),
|
|
3684
3686
|
Vt(3, qr)
|
|
3685
3687
|
], At);
|
|
3686
3688
|
export {
|
|
3687
|
-
|
|
3689
|
+
Y as ClearSheetDrawingTransformerOperation,
|
|
3688
3690
|
yr as DeleteDrawingsCommand,
|
|
3689
3691
|
wr as EditSheetDrawingOperation,
|
|
3690
3692
|
_r as GroupSheetDrawingCommand,
|