@univerjs/sheets-drawing-ui 0.6.0-nightly.202502111606 → 0.6.0-nightly.202502131606

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/es/facade.js CHANGED
@@ -1,8 +1,9 @@
1
1
  var L = Object.defineProperty;
2
- var X = (i, t, e) => t in i ? L(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var x = (i, t, e) => X(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { Inject as P, Injector as j, ICommandService as W, generateRandomId as Y, DrawingTypeEnum as _, ImageSourceType as I, FBase as V, ArrangeTypeEnum as v, toDisposable as k, FEnum as M, FEventName as H, FUniver as z } from "@univerjs/core";
5
- import { getImageSize as q, IDrawingManagerService as f, SetDrawingSelectedOperation as A } from "@univerjs/drawing";
2
+ var X = (t, r, e) => r in t ? L(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
+ var x = (t, r, e) => X(t, typeof r != "symbol" ? r + "" : r, e);
4
+ import { Inject as P, Injector as j, ICommandService as W, ImageSourceType as f, ArrangeTypeEnum as v, DrawingTypeEnum as _, generateRandomId as Y, toDisposable as E } from "@univerjs/core";
5
+ import { FBase as V, FEnum as M, FEventName as H, FUniver as z } from "@univerjs/core/facade";
6
+ import { getImageSize as q, IDrawingManagerService as I, SetDrawingSelectedOperation as A } from "@univerjs/drawing";
6
7
  import { IRenderManagerService as F } from "@univerjs/engine-render";
7
8
  import { SetSheetDrawingCommand as h, SetDrawingArrangeCommand as w, SheetCanvasFloatDomManagerService as C, InsertSheetDrawingCommand as S, RemoveSheetDrawingCommand as R } from "@univerjs/sheets-drawing-ui";
8
9
  import { SheetSkeletonManagerService as U, ISheetSelectionRenderService as J, convertPositionSheetOverGridToAbsolute as Q, convertPositionCellToSheetOverGrid as Z } from "@univerjs/sheets-ui";
@@ -10,25 +11,25 @@ import { ISheetDrawingService as l, SheetDrawingAnchorType as ee } from "@univer
10
11
  import { transformComponentKey as y } from "@univerjs/sheets-ui/facade";
11
12
  import { FWorksheet as N } from "@univerjs/sheets/facade";
12
13
  import { ComponentManager as D } from "@univerjs/ui";
13
- var te = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, $ = (i, t, e, r) => {
14
- for (var n = r > 1 ? void 0 : r ? ie(t, e) : t, s = i.length - 1, o; s >= 0; s--)
15
- (o = i[s]) && (n = (r ? o(t, e, n) : o(n)) || n);
16
- return r && n && te(t, e, n), n;
17
- }, G = (i, t) => (e, r) => t(e, r, i);
18
- function re(i, t) {
19
- const { from: e, to: r, flipY: n = !1, flipX: s = !1, angle: o = 0, skewX: d = 0, skewY: a = 0 } = i.sheetTransform, { column: g, columnOffset: c, row: u, rowOffset: b } = e, O = Q(
20
- i.unitId,
21
- i.subUnitId,
22
- { from: e, to: r },
23
- t
24
- ), { left: B, top: T, width: E, height: K } = O;
14
+ var te = Object.getOwnPropertyDescriptor, $ = (t, r, e, i) => {
15
+ for (var n = i > 1 ? void 0 : i ? te(r, e) : r, s = t.length - 1, o; s >= 0; s--)
16
+ (o = t[s]) && (n = o(n) || n);
17
+ return n;
18
+ }, G = (t, r) => (e, i) => r(e, i, t);
19
+ function re(t, r) {
20
+ const { from: e, to: i, flipY: n = !1, flipX: s = !1, angle: o = 0, skewX: d = 0, skewY: a = 0 } = t.sheetTransform, { column: g, columnOffset: c, row: u, rowOffset: b } = e, O = Q(
21
+ t.unitId,
22
+ t.subUnitId,
23
+ { from: e, to: i },
24
+ r
25
+ ), { left: B, top: T, width: k, height: K } = O;
25
26
  return {
26
- ...i,
27
+ ...t,
27
28
  column: g,
28
29
  columnOffset: c,
29
30
  row: u,
30
31
  rowOffset: b,
31
- width: E,
32
+ width: k,
32
33
  height: K,
33
34
  flipY: n,
34
35
  flipX: s,
@@ -37,18 +38,18 @@ function re(i, t) {
37
38
  skewY: a
38
39
  };
39
40
  }
40
- function ne(i, t, e) {
41
- const { column: r, columnOffset: n, row: s, rowOffset: o, flipY: d = !1, flipX: a = !1, angle: g = 0, skewX: c = 0, skewY: u = 0, width: b, height: O } = i, B = Z(
42
- i.unitId,
43
- i.subUnitId,
44
- { column: r, columnOffset: n, row: s, rowOffset: o },
41
+ function ie(t, r, e) {
42
+ const { column: i, columnOffset: n, row: s, rowOffset: o, flipY: d = !1, flipX: a = !1, angle: g = 0, skewX: c = 0, skewY: u = 0, width: b, height: O } = t, B = Z(
43
+ t.unitId,
44
+ t.subUnitId,
45
+ { column: i, columnOffset: n, row: s, rowOffset: o },
45
46
  b,
46
47
  O,
47
- t,
48
+ r,
48
49
  e
49
- ), { sheetTransform: T, transform: E } = B;
50
+ ), { sheetTransform: T, transform: k } = B;
50
51
  return {
51
- ...i,
52
+ ...t,
52
53
  sheetTransform: {
53
54
  ...T,
54
55
  flipY: d,
@@ -58,7 +59,7 @@ function ne(i, t, e) {
58
59
  skewY: u
59
60
  },
60
61
  transform: {
61
- ...E,
62
+ ...k,
62
63
  flipY: d,
63
64
  flipX: a,
64
65
  angle: g,
@@ -68,15 +69,15 @@ function ne(i, t, e) {
68
69
  };
69
70
  }
70
71
  let p = class {
71
- constructor(i, t, e) {
72
+ constructor(t, r, e) {
72
73
  x(this, "_image");
73
74
  this._injector = e, this._image = {
74
75
  drawingId: Y(6),
75
76
  drawingType: _.DRAWING_IMAGE,
76
- imageSourceType: I.BASE64,
77
+ imageSourceType: f.BASE64,
77
78
  source: "",
78
- unitId: i,
79
- subUnitId: t,
79
+ unitId: t,
80
+ subUnitId: r,
80
81
  column: 0,
81
82
  columnOffset: 0,
82
83
  row: 0,
@@ -106,12 +107,12 @@ let p = class {
106
107
  * activeSheet.insertImages([param]);
107
108
  * ```
108
109
  */
109
- setImage(i) {
110
- const e = this._injector.get(F).getRenderById(i.unitId);
110
+ setImage(t) {
111
+ const e = this._injector.get(F).getRenderById(t.unitId);
111
112
  if (!e)
112
- throw new Error(`Render Unit with unitId ${i.unitId} not found`);
113
- const r = e.with(U);
114
- return i.sheetTransform == null && (i.sheetTransform = {
113
+ throw new Error(`Render Unit with unitId ${t.unitId} not found`);
114
+ const i = e.with(U);
115
+ return t.sheetTransform == null && (t.sheetTransform = {
115
116
  from: {
116
117
  column: 0,
117
118
  columnOffset: 0,
@@ -124,11 +125,11 @@ let p = class {
124
125
  row: 0,
125
126
  rowOffset: 0
126
127
  }
127
- }), this._image = re(i, r), this;
128
+ }), this._image = re(t, i), this;
128
129
  }
129
- setSource(i, t) {
130
- const e = t != null ? t : I.URL;
131
- return this._image.source = i, this._image.imageSourceType = e, this;
130
+ setSource(t, r) {
131
+ const e = r != null ? r : f.URL;
132
+ return this._image.source = t, this._image.imageSourceType = e, this;
132
133
  }
133
134
  getsource() {
134
135
  return this._image.source;
@@ -150,8 +151,8 @@ let p = class {
150
151
  * activeSheet.insertImages([param]);
151
152
  * ```
152
153
  */
153
- setColumn(i) {
154
- return this._image.column = i, this;
154
+ setColumn(t) {
155
+ return this._image.column = t, this;
155
156
  }
156
157
  /**
157
158
  * Set the position of the image
@@ -167,8 +168,8 @@ let p = class {
167
168
  * activeSheet.insertImages([param]);
168
169
  * ```
169
170
  */
170
- setRow(i) {
171
- return this._image.row = i, this;
171
+ setRow(t) {
172
+ return this._image.row = t, this;
172
173
  }
173
174
  /**
174
175
  * Set the column offset of the image in a unit
@@ -184,8 +185,8 @@ let p = class {
184
185
  * activeSheet.insertImages([param]);
185
186
  * ```
186
187
  */
187
- setColumnOffset(i) {
188
- return this._image.columnOffset = i, this;
188
+ setColumnOffset(t) {
189
+ return this._image.columnOffset = t, this;
189
190
  }
190
191
  /**
191
192
  * Set the row offset of the image in a unit
@@ -201,8 +202,8 @@ let p = class {
201
202
  * activeSheet.insertImages([param]);
202
203
  * ```
203
204
  */
204
- setRowOffset(i) {
205
- return this._image.rowOffset = i, this;
205
+ setRowOffset(t) {
206
+ return this._image.rowOffset = t, this;
206
207
  }
207
208
  /**
208
209
  * set the width of the image
@@ -218,8 +219,8 @@ let p = class {
218
219
  * activeSheet.insertImages([param]);
219
220
  * ```
220
221
  */
221
- setWidth(i) {
222
- return this._image.width = i, this;
222
+ setWidth(t) {
223
+ return this._image.width = t, this;
223
224
  }
224
225
  /**
225
226
  * Set the height of the image
@@ -235,8 +236,8 @@ let p = class {
235
236
  * activeSheet.insertImages([param]);
236
237
  * ```
237
238
  */
238
- setHeight(i) {
239
- return this._image.height = i, this;
239
+ setHeight(t) {
240
+ return this._image.height = t, this;
240
241
  }
241
242
  /**
242
243
  * Set the anchor type of the image, whether the position and size change with the cell
@@ -252,8 +253,8 @@ let p = class {
252
253
  * activeSheet.insertImages([param]);
253
254
  * ```
254
255
  */
255
- setAnchorType(i) {
256
- return this._image.anchorType = i, this;
256
+ setAnchorType(t) {
257
+ return this._image.anchorType = t, this;
257
258
  }
258
259
  /**
259
260
  * Set the cropping region of the image by defining the top edges, thereby displaying the specific part of the image you want.
@@ -269,8 +270,8 @@ let p = class {
269
270
  * activeSheet.insertImages([param]);
270
271
  * ```
271
272
  */
272
- setCropTop(i) {
273
- return this._initializeSrcRect(), this._image.srcRect.top = i, this;
273
+ setCropTop(t) {
274
+ return this._initializeSrcRect(), this._image.srcRect.top = t, this;
274
275
  }
275
276
  /**
276
277
  * Set the cropping region of the image by defining the left edges, thereby displaying the specific part of the image you want.
@@ -286,8 +287,8 @@ let p = class {
286
287
  * activeSheet.insertImages([param]);
287
288
  * ```
288
289
  */
289
- setCropLeft(i) {
290
- return this._initializeSrcRect(), this._image.srcRect.left = i, this;
290
+ setCropLeft(t) {
291
+ return this._initializeSrcRect(), this._image.srcRect.left = t, this;
291
292
  }
292
293
  /**
293
294
  * Set the cropping region of the image by defining the bottom edges, thereby displaying the specific part of the image you want.
@@ -303,8 +304,8 @@ let p = class {
303
304
  * activeSheet.insertImages([param]);
304
305
  * ```
305
306
  */
306
- setCropBottom(i) {
307
- return this._initializeSrcRect(), this._image.srcRect.bottom = i, this;
307
+ setCropBottom(t) {
308
+ return this._initializeSrcRect(), this._image.srcRect.bottom = t, this;
308
309
  }
309
310
  /**
310
311
  * Set the cropping region of the image by defining the right edges, thereby displaying the specific part of the image you want.
@@ -320,8 +321,8 @@ let p = class {
320
321
  * activeSheet.insertImages([param]);
321
322
  * ```
322
323
  */
323
- setCropRight(i) {
324
- return this._initializeSrcRect(), this._image.srcRect.right = i, this;
324
+ setCropRight(t) {
325
+ return this._initializeSrcRect(), this._image.srcRect.right = t, this;
325
326
  }
326
327
  _initializeSrcRect() {
327
328
  this._image.srcRect == null && (this._image.srcRect = {
@@ -345,37 +346,37 @@ let p = class {
345
346
  * activeSheet.insertImages([param]);
346
347
  * ```
347
348
  */
348
- setRotate(i) {
349
- return this._image.angle = i, this;
349
+ setRotate(t) {
350
+ return this._image.angle = t, this;
350
351
  }
351
352
  // setPresetGeometry(prstGeom: PresetGeometryType): FOverGridImageBuilder {
352
353
  // this._image.prstGeom = prstGeom;
353
354
  // return this;
354
355
  // }
355
- setUnitId(i) {
356
- return this._image.unitId = i, this;
356
+ setUnitId(t) {
357
+ return this._image.unitId = t, this;
357
358
  }
358
- setSubUnitId(i) {
359
- return this._image.subUnitId = i, this;
359
+ setSubUnitId(t) {
360
+ return this._image.subUnitId = t, this;
360
361
  }
361
362
  async buildAsync() {
362
- const t = this._injector.get(F).getRenderById(this._image.unitId);
363
- if (!t)
363
+ const r = this._injector.get(F).getRenderById(this._image.unitId);
364
+ if (!r)
364
365
  throw new Error(`Render Unit with unitId ${this._image.unitId} not found`);
365
- const e = t.with(J), r = t.with(U);
366
+ const e = r.with(J), i = r.with(U);
366
367
  if (this._image.width === 0 || this._image.height === 0) {
367
368
  const n = await q(this._image.source), s = n.width, o = n.height;
368
369
  this._image.width === 0 && (this._image.width = s), this._image.height === 0 && (this._image.height = o);
369
370
  }
370
- return ne(this._image, e, r);
371
+ return ie(this._image, e, i);
371
372
  }
372
373
  };
373
374
  p = $([
374
375
  G(2, P(j))
375
376
  ], p);
376
377
  let m = class extends V {
377
- constructor(i, t, e) {
378
- super(), this._image = i, this._commandService = t, this._injector = e;
378
+ constructor(t, r, e) {
379
+ super(), this._image = t, this._commandService = r, this._injector = e;
379
380
  }
380
381
  getId() {
381
382
  return this._image.drawingId;
@@ -413,16 +414,16 @@ let m = class extends V {
413
414
  * ```
414
415
  */
415
416
  toBuilder() {
416
- const i = this._injector.createInstance(p);
417
- return i.setImage(this._image), i;
417
+ const t = this._injector.createInstance(p);
418
+ return t.setImage(this._image), t;
418
419
  }
419
- setSource(i, t) {
420
- const e = t != null ? t : I.URL;
421
- return this._image.source = i, this._image.imageSourceType = e, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
420
+ setSource(t, r) {
421
+ const e = r != null ? r : f.URL;
422
+ return this._image.source = t, this._image.imageSourceType = e, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
422
423
  }
423
- async setPositionAsync(i, t, e, r) {
424
+ async setPositionAsync(t, r, e, i) {
424
425
  const n = this.toBuilder();
425
- n.setColumn(t), n.setRow(i), e != null && n.setRowOffset(e), r != null && n.setColumnOffset(r);
426
+ n.setColumn(r), n.setRow(t), e != null && n.setRowOffset(e), i != null && n.setColumnOffset(i);
426
427
  const s = await n.buildAsync();
427
428
  return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [s] });
428
429
  }
@@ -439,11 +440,11 @@ let m = class extends V {
439
440
  * const image = activeSheet.getImages()[0];
440
441
  * console.log('Set size state is ', image.setSize(50, 120));
441
442
  */
442
- async setSizeAsync(i, t) {
443
+ async setSizeAsync(t, r) {
443
444
  const e = this.toBuilder();
444
- e.setWidth(i), e.setHeight(t);
445
- const r = await e.buildAsync();
446
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [r] });
445
+ e.setWidth(t), e.setHeight(r);
446
+ const i = await e.buildAsync();
447
+ return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [i] });
447
448
  }
448
449
  /**
449
450
  * Set the cropping region of the image by defining the top, bottom, left, and right edges, thereby displaying the specific part of the image you want.
@@ -461,13 +462,13 @@ let m = class extends V {
461
462
  * console.log('Set crop state is ', image.setCrop(10, 10, 10, 10));
462
463
  * ```
463
464
  */
464
- setCrop(i, t, e, r) {
465
+ setCrop(t, r, e, i) {
465
466
  return this._image.srcRect == null && (this._image.srcRect = {
466
467
  top: 0,
467
468
  left: 0,
468
469
  bottom: 0,
469
470
  right: 0
470
- }), i != null && (this._image.srcRect.top = i), t != null && (this._image.srcRect.left = t), e != null && (this._image.srcRect.bottom = e), r != null && (this._image.srcRect.right = r), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
471
+ }), t != null && (this._image.srcRect.top = t), r != null && (this._image.srcRect.left = r), e != null && (this._image.srcRect.bottom = e), i != null && (this._image.srcRect.right = i), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
471
472
  }
472
473
  // setPresetGeometry(prstGeom: PresetGeometryType): boolean {
473
474
  // this._image.prstGeom = prstGeom;
@@ -486,8 +487,8 @@ let m = class extends V {
486
487
  * console.log('Set rotate state is ', image.setRotate(90));
487
488
  * ```
488
489
  */
489
- setRotate(i) {
490
- return this._image.sheetTransform.angle = i, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
490
+ setRotate(t) {
491
+ return this._image.sheetTransform.angle = t, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
491
492
  }
492
493
  /**
493
494
  * Move the image layer forward by one level
@@ -574,9 +575,9 @@ m = $([
574
575
  G(1, W),
575
576
  G(2, P(j))
576
577
  ], m);
577
- class se extends N {
578
- addFloatDomToPosition(t, e) {
579
- const r = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), { key: s, disposableCollection: o } = y(t, this._injector.get(D)), a = this._injector.get(C).addFloatDomToPosition({ ...t, componentKey: s, unitId: r, subUnitId: n }, e);
578
+ class ne extends N {
579
+ addFloatDomToPosition(r, e) {
580
+ const i = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), { key: s, disposableCollection: o } = y(r, this._injector.get(D)), a = this._injector.get(C).addFloatDomToPosition({ ...r, componentKey: s, unitId: i, subUnitId: n }, e);
580
581
  return a ? (o.add(a.dispose), {
581
582
  id: a.id,
582
583
  dispose: () => {
@@ -584,8 +585,8 @@ class se extends N {
584
585
  }
585
586
  }) : (o.dispose(), null);
586
587
  }
587
- addFloatDomToRange(t, e, r, n) {
588
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = y(e, this._injector.get(D)), c = this._injector.get(C).addFloatDomToRange(t.getRange(), { ...e, componentKey: d, unitId: s, subUnitId: o }, r, n);
588
+ addFloatDomToRange(r, e, i, n) {
589
+ const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = y(e, this._injector.get(D)), c = this._injector.get(C).addFloatDomToRange(r.getRange(), { ...e, componentKey: d, unitId: s, subUnitId: o }, i, n);
589
590
  return c ? (a.add(c.dispose), {
590
591
  id: c.id,
591
592
  dispose: () => {
@@ -593,8 +594,8 @@ class se extends N {
593
594
  }
594
595
  }) : (a.dispose(), null);
595
596
  }
596
- addFloatDomToColumnHeader(t, e, r, n) {
597
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = y(e, this._injector.get(D)), c = this._injector.get(C).addFloatDomToColumnHeader(t, { ...e, componentKey: d, unitId: s, subUnitId: o }, r, n);
597
+ addFloatDomToColumnHeader(r, e, i, n) {
598
+ const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = y(e, this._injector.get(D)), c = this._injector.get(C).addFloatDomToColumnHeader(r, { ...e, componentKey: d, unitId: s, subUnitId: o }, i, n);
598
599
  return c ? (a.add(c.dispose), {
599
600
  id: c.id,
600
601
  dispose: () => {
@@ -602,100 +603,100 @@ class se extends N {
602
603
  }
603
604
  }) : (a.dispose(), null);
604
605
  }
605
- async insertImage(t, e, r, n, s) {
606
+ async insertImage(r, e, i, n, s) {
606
607
  const o = this.newOverGridImage();
607
- if (typeof t == "string")
608
- o.setSource(t);
608
+ if (typeof r == "string")
609
+ o.setSource(r);
609
610
  else {
610
- const g = await t.getBlob().getDataAsString();
611
- o.setSource(g, I.BASE64);
611
+ const g = await r.getBlob().getDataAsString();
612
+ o.setSource(g, f.BASE64);
612
613
  }
613
- e !== void 0 ? o.setColumn(e) : o.setColumn(0), r !== void 0 ? o.setRow(r) : o.setRow(0), n !== void 0 ? o.setColumnOffset(n) : o.setColumnOffset(0), s !== void 0 ? o.setRowOffset(s) : o.setRowOffset(0);
614
+ e !== void 0 ? o.setColumn(e) : o.setColumn(0), i !== void 0 ? o.setRow(i) : o.setRow(0), n !== void 0 ? o.setColumnOffset(n) : o.setColumnOffset(0), s !== void 0 ? o.setRowOffset(s) : o.setRowOffset(0);
614
615
  const d = await o.buildAsync();
615
616
  return this._commandService.syncExecuteCommand(S.id, { unitId: this._fWorkbook.getId(), drawings: [d] });
616
617
  }
617
- insertImages(t) {
618
- const e = t.map((r) => (r.unitId = this._fWorkbook.getId(), r.subUnitId = this.getSheetId(), r));
618
+ insertImages(r) {
619
+ const e = r.map((i) => (i.unitId = this._fWorkbook.getId(), i.subUnitId = this.getSheetId(), i));
619
620
  return this._commandService.syncExecuteCommand(S.id, { unitId: this._fWorkbook.getId(), drawings: e }), this;
620
621
  }
621
- deleteImages(t) {
622
- const e = t.map((r) => ({
622
+ deleteImages(r) {
623
+ const e = r.map((i) => ({
623
624
  unitId: this._fWorkbook.getId(),
624
- drawingId: r.getId(),
625
+ drawingId: i.getId(),
625
626
  subUnitId: this.getSheetId(),
626
- drawingType: r.getType()
627
+ drawingType: i.getType()
627
628
  }));
628
629
  return this._commandService.syncExecuteCommand(R.id, { unitId: this._fWorkbook.getId(), drawings: e }), this;
629
630
  }
630
631
  getImages() {
631
- const e = this._injector.get(l).getDrawingData(this._fWorkbook.getId(), this.getSheetId()), r = [];
632
+ const e = this._injector.get(l).getDrawingData(this._fWorkbook.getId(), this.getSheetId()), i = [];
632
633
  for (const n in e) {
633
634
  const s = e[n];
634
- s.drawingType === _.DRAWING_IMAGE && r.push(this._injector.createInstance(m, s));
635
+ s.drawingType === _.DRAWING_IMAGE && i.push(this._injector.createInstance(m, s));
635
636
  }
636
- return r;
637
+ return i;
637
638
  }
638
- getImageById(t) {
639
- const r = this._injector.get(l).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: t });
640
- return r && r.drawingType === _.DRAWING_IMAGE ? this._injector.createInstance(m, r) : null;
639
+ getImageById(r) {
640
+ const i = this._injector.get(l).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: r });
641
+ return i && i.drawingType === _.DRAWING_IMAGE ? this._injector.createInstance(m, i) : null;
641
642
  }
642
643
  getActiveImages() {
643
- const e = this._injector.get(l).getFocusDrawings(), r = [];
644
+ const e = this._injector.get(l).getFocusDrawings(), i = [];
644
645
  for (const n in e) {
645
646
  const s = e[n];
646
- r.push(this._injector.createInstance(m, s));
647
+ i.push(this._injector.createInstance(m, s));
647
648
  }
648
- return r;
649
+ return i;
649
650
  }
650
- updateImages(t) {
651
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._fWorkbook.getId(), drawings: t }), this;
651
+ updateImages(r) {
652
+ return this._commandService.syncExecuteCommand(h.id, { unitId: this._fWorkbook.getId(), drawings: r }), this;
652
653
  }
653
- onImageInserted(t) {
654
+ onImageInserted(r) {
654
655
  const e = this._injector.get(l);
655
- return k(e.add$.subscribe((r) => {
656
- const n = r.map(
656
+ return E(e.add$.subscribe((i) => {
657
+ const n = i.map(
657
658
  (s) => this._injector.createInstance(m, e.getDrawingByParam(s))
658
659
  );
659
- t(n);
660
+ r(n);
660
661
  }));
661
662
  }
662
- onImageDeleted(t) {
663
+ onImageDeleted(r) {
663
664
  const e = this._injector.get(l);
664
- return k(e.remove$.subscribe((r) => {
665
- const n = r.map(
665
+ return E(e.remove$.subscribe((i) => {
666
+ const n = i.map(
666
667
  (s) => this._injector.createInstance(m, e.getDrawingByParam(s))
667
668
  );
668
- t(n);
669
+ r(n);
669
670
  }));
670
671
  }
671
- onImageChanged(t) {
672
+ onImageChanged(r) {
672
673
  const e = this._injector.get(l);
673
- return k(e.update$.subscribe((r) => {
674
- const n = r.map(
674
+ return E(e.update$.subscribe((i) => {
675
+ const n = i.map(
675
676
  (s) => this._injector.createInstance(m, e.getDrawingByParam(s))
676
677
  );
677
- t(n);
678
+ r(n);
678
679
  }));
679
680
  }
680
681
  newOverGridImage() {
681
- const t = this._fWorkbook.getId(), e = this.getSheetId();
682
- return this._injector.createInstance(p, t, e);
682
+ const r = this._fWorkbook.getId(), e = this.getSheetId();
683
+ return this._injector.createInstance(p, r, e);
683
684
  }
684
685
  }
685
- N.extend(se);
686
- class oe extends M {
686
+ N.extend(ne);
687
+ class se extends M {
687
688
  get DrawingType() {
688
689
  return _;
689
690
  }
690
691
  get ImageSourceType() {
691
- return I;
692
+ return f;
692
693
  }
693
694
  get SheetDrawingAnchorType() {
694
695
  return ee;
695
696
  }
696
697
  }
697
- M.extend(oe);
698
- class ae extends H {
698
+ M.extend(se);
699
+ class oe extends H {
699
700
  get BeforeOverGridImageChange() {
700
701
  return "BeforeOverGridImageChange";
701
702
  }
@@ -721,19 +722,19 @@ class ae extends H {
721
722
  return "OverGridImageSelected";
722
723
  }
723
724
  }
724
- H.extend(ae);
725
- class de extends z {
725
+ H.extend(oe);
726
+ class ae extends z {
726
727
  /**
727
728
  * @ignore
728
729
  */
729
730
  // eslint-disable-next-line max-lines-per-function
730
- _initialize(t) {
731
- const e = t.get(W);
731
+ _initialize(r) {
732
+ const e = r.get(W);
732
733
  this.registerEventHandler(
733
734
  this.Event.BeforeOverGridImageInsert,
734
- () => e.beforeCommandExecuted((r) => {
735
- if (r.id !== S.id) return;
736
- const n = r.params, s = this.getActiveWorkbook();
735
+ () => e.beforeCommandExecuted((i) => {
736
+ if (i.id !== S.id) return;
737
+ const n = i.params, s = this.getActiveWorkbook();
737
738
  if (s == null || n == null)
738
739
  return;
739
740
  const { drawings: o } = n, d = {
@@ -745,12 +746,12 @@ class de extends z {
745
746
  })
746
747
  ), this.registerEventHandler(
747
748
  this.Event.BeforeOverGridImageRemove,
748
- () => e.beforeCommandExecuted((r) => {
749
- if (r.id !== R.id) return;
750
- const n = r.params, s = this.getActiveWorkbook();
749
+ () => e.beforeCommandExecuted((i) => {
750
+ if (i.id !== R.id) return;
751
+ const n = i.params, s = this.getActiveWorkbook();
751
752
  if (s == null || n == null)
752
753
  return;
753
- const o = t.get(f), { drawings: d } = n, a = d.map((c) => o.getDrawingByParam(c)), g = {
754
+ const o = r.get(I), { drawings: d } = n, a = d.map((c) => o.getDrawingByParam(c)), g = {
754
755
  workbook: s,
755
756
  images: this._createFOverGridImage(a)
756
757
  };
@@ -759,12 +760,12 @@ class de extends z {
759
760
  })
760
761
  ), this.registerEventHandler(
761
762
  this.Event.BeforeOverGridImageChange,
762
- () => e.beforeCommandExecuted((r) => {
763
- if (r.id !== h.id) return;
764
- const n = r.params, s = this.getActiveWorkbook();
763
+ () => e.beforeCommandExecuted((i) => {
764
+ if (i.id !== h.id) return;
765
+ const n = i.params, s = this.getActiveWorkbook();
765
766
  if (s == null || n == null)
766
767
  return;
767
- const { drawings: o } = n, d = t.get(f), a = [];
768
+ const { drawings: o } = n, d = r.get(I), a = [];
768
769
  o.forEach((c) => {
769
770
  const u = d.getDrawingByParam(c);
770
771
  u != null && a.push({
@@ -781,12 +782,12 @@ class de extends z {
781
782
  })
782
783
  ), this.registerEventHandler(
783
784
  this.Event.BeforeOverGridImageSelect,
784
- () => e.beforeCommandExecuted((r) => {
785
- if (r.id !== A.id) return;
786
- const n = r.params, s = this.getActiveWorkbook();
785
+ () => e.beforeCommandExecuted((i) => {
786
+ if (i.id !== A.id) return;
787
+ const n = i.params, s = this.getActiveWorkbook();
787
788
  if (s == null)
788
789
  return;
789
- const o = t.get(f), d = o.getFocusDrawings(), a = n.map((c) => o.getDrawingByParam(c)), g = {
790
+ const o = r.get(I), d = o.getFocusDrawings(), a = n.map((c) => o.getDrawingByParam(c)), g = {
790
791
  workbook: s,
791
792
  selectedImages: this._createFOverGridImage(a),
792
793
  oldSelectedImages: this._createFOverGridImage(d)
@@ -796,9 +797,9 @@ class de extends z {
796
797
  })
797
798
  ), this.registerEventHandler(
798
799
  this.Event.OverGridImageInserted,
799
- () => e.onCommandExecuted((r) => {
800
- if (r.id !== S.id) return;
801
- const n = r.params, s = this.getActiveWorkbook();
800
+ () => e.onCommandExecuted((i) => {
801
+ if (i.id !== S.id) return;
802
+ const n = i.params, s = this.getActiveWorkbook();
802
803
  if (s == null || n == null)
803
804
  return;
804
805
  const { drawings: o } = n;
@@ -809,9 +810,9 @@ class de extends z {
809
810
  })
810
811
  ), this.registerEventHandler(
811
812
  this.Event.OverGridImageRemoved,
812
- () => e.onCommandExecuted((r) => {
813
- if (r.id !== R.id) return;
814
- const n = r.params, s = this.getActiveWorkbook();
813
+ () => e.onCommandExecuted((i) => {
814
+ if (i.id !== R.id) return;
815
+ const n = i.params, s = this.getActiveWorkbook();
815
816
  if (s == null || n == null)
816
817
  return;
817
818
  const { drawings: o } = n;
@@ -822,12 +823,12 @@ class de extends z {
822
823
  })
823
824
  ), this.registerEventHandler(
824
825
  this.Event.OverGridImageChanged,
825
- () => e.onCommandExecuted((r) => {
826
- if (r.id !== h.id) return;
827
- const n = r.params, s = this.getActiveWorkbook();
826
+ () => e.onCommandExecuted((i) => {
827
+ if (i.id !== h.id) return;
828
+ const n = i.params, s = this.getActiveWorkbook();
828
829
  if (s == null || n == null)
829
830
  return;
830
- const { drawings: o } = n, d = t.get(f), a = o.map((g) => this._injector.createInstance(m, d.getDrawingByParam(g)));
831
+ const { drawings: o } = n, d = r.get(I), a = o.map((g) => this._injector.createInstance(m, d.getDrawingByParam(g)));
831
832
  this.fireEvent(this.Event.OverGridImageChanged, {
832
833
  workbook: s,
833
834
  images: a
@@ -835,12 +836,12 @@ class de extends z {
835
836
  })
836
837
  ), this.registerEventHandler(
837
838
  this.Event.OverGridImageSelected,
838
- () => e.onCommandExecuted((r) => {
839
- if (r.id !== A.id) return;
840
- const n = r.params, s = this.getActiveWorkbook();
839
+ () => e.onCommandExecuted((i) => {
840
+ if (i.id !== A.id) return;
841
+ const n = i.params, s = this.getActiveWorkbook();
841
842
  if (s == null)
842
843
  return;
843
- const o = t.get(f), d = n.map((a) => o.getDrawingByParam(a));
844
+ const o = r.get(I), d = n.map((a) => o.getDrawingByParam(a));
844
845
  this.fireEvent(this.Event.OverGridImageSelected, {
845
846
  workbook: s,
846
847
  selectedImages: this._createFOverGridImage(d)
@@ -848,8 +849,8 @@ class de extends z {
848
849
  })
849
850
  );
850
851
  }
851
- _createFOverGridImage(t) {
852
- return t.map((e) => this._injector.createInstance(m, e));
852
+ _createFOverGridImage(r) {
853
+ return r.map((e) => this._injector.createInstance(m, e));
853
854
  }
854
855
  }
855
- z.extend(de);
856
+ z.extend(ae);