@univerjs/sheets-ui 0.10.14-nightly.202511070628 → 0.10.14-nightly.202511070939
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/facade.js +1 -1
- package/lib/cjs/index.js +12 -12
- package/lib/es/facade.js +93 -84
- package/lib/es/index.js +2437 -2339
- package/lib/facade.js +93 -84
- package/lib/index.js +2437 -2339
- package/lib/types/controllers/config.schema.d.ts +15 -2
- package/lib/types/facade/f-univer.d.ts +54 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/permission/sheet-permission-render-manager.service.d.ts +36 -0
- package/lib/types/views/permission/extensions/range-protection.render.d.ts +13 -3
- package/lib/types/views/permission/extensions/worksheet-permission.render.d.ts +11 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +12 -12
- package/package.json +11 -11
package/lib/es/facade.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ICommandService as P, CanceledError as E, IUniverInstanceService as
|
|
2
|
-
import { FUniver as
|
|
3
|
-
import { RichTextEditingMutation as
|
|
4
|
-
import { IRenderManagerService as v, DeviceInputEventType as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as
|
|
7
|
-
import { FSheetHooks as
|
|
8
|
-
import { KeyCode as B, CutCommand as
|
|
9
|
-
import { filter as u, combineLatest as
|
|
10
|
-
class
|
|
1
|
+
import { ICommandService as P, CanceledError as E, IUniverInstanceService as O, RichTextValue as z, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as D, LifecycleService as se, DisposableCollection as j, LifecycleStages as L, UniverInstanceType as ae, ILogService as U, toDisposable as m, awaitTime as ce, InterceptorEffectEnum as de, generateRandomId as he } from "@univerjs/core";
|
|
2
|
+
import { FUniver as Q, FEventName as ge } from "@univerjs/core/facade";
|
|
3
|
+
import { RichTextEditingMutation as le } from "@univerjs/docs";
|
|
4
|
+
import { IRenderManagerService as v, DeviceInputEventType as N, SHEET_VIEWPORT_KEY as ue, sheetContentViewportKeys as ve } from "@univerjs/engine-render";
|
|
5
|
+
import { SheetsSelectionsService as Se, COMMAND_LISTENER_SKELETON_CHANGE as me, getSkeletonChangedEffectedRange as Ce, SetWorksheetRowIsAutoHeightCommand as we, InterceptCellContentPriority as be, SheetInterceptorService as Ee, INTERCEPTOR_POINT as pe } from "@univerjs/sheets";
|
|
6
|
+
import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as $, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as ee, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, SheetPermissionRenderManagerService as A, ISheetSelectionRenderService as y, IMarkSelectionService as te, SheetsScrollRenderController as fe, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as F, CellAlertManagerService as Pe, ISheetCellDropdownManagerService as Re } from "@univerjs/sheets-ui";
|
|
7
|
+
import { FSheetHooks as W, FWorkbook as re, FWorksheet as ne, FPermission as ie, FRange as oe } from "@univerjs/sheets/facade";
|
|
8
|
+
import { KeyCode as B, CutCommand as V, CopyCommand as Z, PasteCommand as K, IClipboardInterfaceService as He, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Y, HTML_CLIPBOARD_MIME_TYPE as X, supportClipboardAPI as J, ISidebarService as Me, IDialogService as ye, ComponentManager as G } from "@univerjs/ui";
|
|
9
|
+
import { filter as u, combineLatest as Ue } from "rxjs";
|
|
10
|
+
class xe extends Q {
|
|
11
11
|
// eslint-disable-next-line max-lines-per-function
|
|
12
12
|
_initSheetUIEvent(e) {
|
|
13
13
|
const r = e.get(P);
|
|
@@ -38,7 +38,7 @@ class Ue extends q {
|
|
|
38
38
|
if (t.id !== k.id) return;
|
|
39
39
|
const i = this.getActiveSheet();
|
|
40
40
|
if (!i) return;
|
|
41
|
-
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(
|
|
41
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params, { visible: l, keycode: a, eventType: n } = g, c = d.getEditLocation();
|
|
42
42
|
if (!l) {
|
|
43
43
|
const R = {
|
|
44
44
|
row: c.row,
|
|
@@ -48,7 +48,7 @@ class Ue extends q {
|
|
|
48
48
|
workbook: o,
|
|
49
49
|
worksheet: s,
|
|
50
50
|
isZenEditor: !1,
|
|
51
|
-
value:
|
|
51
|
+
value: z.create(h.getUnit(D).getSnapshot()),
|
|
52
52
|
isConfirm: a !== B.ESC
|
|
53
53
|
};
|
|
54
54
|
if (this.fireEvent(this.Event.BeforeSheetEditEnd, R), R.cancel)
|
|
@@ -99,10 +99,10 @@ class Ue extends q {
|
|
|
99
99
|
), this.registerEventHandler(
|
|
100
100
|
this.Event.SheetEditChanging,
|
|
101
101
|
() => r.onCommandExecuted((t) => {
|
|
102
|
-
if (t.id !==
|
|
102
|
+
if (t.id !== le.id) return;
|
|
103
103
|
const i = this.getActiveSheet();
|
|
104
104
|
if (!i) return;
|
|
105
|
-
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(
|
|
105
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params;
|
|
106
106
|
if (!d.isVisible().visible) return;
|
|
107
107
|
const { unitId: l } = g;
|
|
108
108
|
if (l === D) {
|
|
@@ -111,7 +111,7 @@ class Ue extends q {
|
|
|
111
111
|
worksheet: s,
|
|
112
112
|
row: a,
|
|
113
113
|
column: n,
|
|
114
|
-
value:
|
|
114
|
+
value: z.create(h.getUnit(D).getSnapshot()),
|
|
115
115
|
isZenEditor: !1
|
|
116
116
|
};
|
|
117
117
|
this.fireEvent(this.Event.SheetEditChanging, c);
|
|
@@ -120,7 +120,7 @@ class Ue extends q {
|
|
|
120
120
|
), this.registerEventHandler(
|
|
121
121
|
this.Event.BeforeSheetZoomChange,
|
|
122
122
|
() => r.beforeCommandExecuted((t) => {
|
|
123
|
-
if (t.id !==
|
|
123
|
+
if (t.id !== $.id) return;
|
|
124
124
|
const i = this.getCommandSheetTarget(t);
|
|
125
125
|
if (!i) return;
|
|
126
126
|
const { workbook: o, worksheet: s } = i, d = {
|
|
@@ -134,7 +134,7 @@ class Ue extends q {
|
|
|
134
134
|
), this.registerEventHandler(
|
|
135
135
|
this.Event.SheetZoomChanged,
|
|
136
136
|
() => r.onCommandExecuted((t) => {
|
|
137
|
-
if (t.id !==
|
|
137
|
+
if (t.id !== $.id) return;
|
|
138
138
|
const i = this.getCommandSheetTarget(t);
|
|
139
139
|
if (!i) return;
|
|
140
140
|
const { workbook: o, worksheet: s } = i;
|
|
@@ -148,9 +148,9 @@ class Ue extends q {
|
|
|
148
148
|
}
|
|
149
149
|
// eslint-disable-next-line max-lines-per-function
|
|
150
150
|
_initObserverListener(e) {
|
|
151
|
-
const r = e.get(v), t = e.get(
|
|
151
|
+
const r = e.get(v), t = e.get(se), i = new j();
|
|
152
152
|
this.disposeWithMe(t.lifecycle$.subscribe((h) => {
|
|
153
|
-
if (h !==
|
|
153
|
+
if (h !== L.Rendered) return;
|
|
154
154
|
i.dispose();
|
|
155
155
|
const g = e.get(f), l = e.get(M);
|
|
156
156
|
g && (this.registerEventHandler(
|
|
@@ -351,17 +351,17 @@ class Ue extends q {
|
|
|
351
351
|
})), this.disposeWithMe(i);
|
|
352
352
|
const o = /* @__PURE__ */ new Map();
|
|
353
353
|
let s;
|
|
354
|
-
const d =
|
|
354
|
+
const d = Ue([
|
|
355
355
|
r.created$,
|
|
356
356
|
t.lifecycle$
|
|
357
357
|
]);
|
|
358
358
|
this.disposeWithMe(d.subscribe(([h, g]) => {
|
|
359
359
|
var R;
|
|
360
|
-
if (h.type ===
|
|
361
|
-
const l = new
|
|
360
|
+
if (h.type === ae.UNIVER_SHEET && (s = h), g <= L.Rendered || !s) return;
|
|
361
|
+
const l = new j(), a = this.getWorkbook(s.unitId);
|
|
362
362
|
if (!a) return;
|
|
363
363
|
o.get(s.unitId) && ((R = o.get(s.unitId)) == null || R.dispose()), o.set(s.unitId, l);
|
|
364
|
-
const n = s.with(x), c = s.with(
|
|
364
|
+
const n = s.with(x), c = s.with(Se);
|
|
365
365
|
l.add(this.registerEventHandler(
|
|
366
366
|
this.Event.Scroll,
|
|
367
367
|
() => n.validViewportScrollInfo$.subscribe((S) => {
|
|
@@ -431,8 +431,8 @@ class Ue extends q {
|
|
|
431
431
|
this.Event.BeforeClipboardChange,
|
|
432
432
|
() => r.beforeCommandExecuted((t) => {
|
|
433
433
|
switch (t.id) {
|
|
434
|
+
case Z.id:
|
|
434
435
|
case V.id:
|
|
435
|
-
case F.id:
|
|
436
436
|
this._beforeClipboardChange();
|
|
437
437
|
break;
|
|
438
438
|
}
|
|
@@ -441,8 +441,8 @@ class Ue extends q {
|
|
|
441
441
|
this.Event.ClipboardChanged,
|
|
442
442
|
() => r.onCommandExecuted((t) => {
|
|
443
443
|
switch (t.id) {
|
|
444
|
+
case Z.id:
|
|
444
445
|
case V.id:
|
|
445
|
-
case F.id:
|
|
446
446
|
this._clipboardChanged();
|
|
447
447
|
break;
|
|
448
448
|
}
|
|
@@ -454,7 +454,7 @@ class Ue extends q {
|
|
|
454
454
|
case T.id:
|
|
455
455
|
this._beforeClipboardPaste(t.params);
|
|
456
456
|
break;
|
|
457
|
-
case
|
|
457
|
+
case K.id:
|
|
458
458
|
this._beforeClipboardPasteAsync();
|
|
459
459
|
break;
|
|
460
460
|
}
|
|
@@ -466,7 +466,7 @@ class Ue extends q {
|
|
|
466
466
|
case T.id:
|
|
467
467
|
this._clipboardPaste(t.params);
|
|
468
468
|
break;
|
|
469
|
-
case
|
|
469
|
+
case K.id:
|
|
470
470
|
this._clipboardPasteAsync();
|
|
471
471
|
break;
|
|
472
472
|
}
|
|
@@ -474,10 +474,10 @@ class Ue extends q {
|
|
|
474
474
|
), this.registerEventHandler(
|
|
475
475
|
this.Event.SheetSkeletonChanged,
|
|
476
476
|
() => r.onCommandExecuted((t) => {
|
|
477
|
-
if (
|
|
477
|
+
if (me.indexOf(t.id) > -1) {
|
|
478
478
|
const i = this.getActiveSheet();
|
|
479
479
|
if (!i) return;
|
|
480
|
-
const o =
|
|
480
|
+
const o = Ce(t, i.worksheet.getMaxColumns()).map((s) => {
|
|
481
481
|
var d, h;
|
|
482
482
|
return (h = (d = this.getWorkbook(s.unitId)) == null ? void 0 : d.getSheetBySheetId(s.subUnitId)) == null ? void 0 : h.getRange(s.range);
|
|
483
483
|
}).filter(Boolean);
|
|
@@ -497,7 +497,7 @@ class Ue extends q {
|
|
|
497
497
|
const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet(), t = e == null ? void 0 : e.getActiveRange();
|
|
498
498
|
if (!e || !r || !t)
|
|
499
499
|
return;
|
|
500
|
-
const o = this._injector.get(
|
|
500
|
+
const o = this._injector.get(ee).generateCopyContent(e.getId(), r.getSheetId(), t.getRange());
|
|
501
501
|
if (!o)
|
|
502
502
|
return;
|
|
503
503
|
const { html: s, plain: d } = o;
|
|
@@ -534,10 +534,10 @@ class Ue extends q {
|
|
|
534
534
|
const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
|
|
535
535
|
if (!e || !r)
|
|
536
536
|
return;
|
|
537
|
-
const o = (await this._injector.get(
|
|
537
|
+
const o = (await this._injector.get(He).read())[0];
|
|
538
538
|
let s;
|
|
539
539
|
if (o) {
|
|
540
|
-
const d = o.types, h = d.indexOf(
|
|
540
|
+
const d = o.types, h = d.indexOf(Y) !== -1 ? await o.getType(Y).then((l) => l && l.text()) : "", g = d.indexOf(X) !== -1 ? await o.getType(X).then((l) => l && l.text()) : "";
|
|
541
541
|
s = {
|
|
542
542
|
workbook: e,
|
|
543
543
|
worksheet: r,
|
|
@@ -558,7 +558,7 @@ class Ue extends q {
|
|
|
558
558
|
throw new E();
|
|
559
559
|
}
|
|
560
560
|
async _beforeClipboardPasteAsync() {
|
|
561
|
-
if (!
|
|
561
|
+
if (!J()) {
|
|
562
562
|
this._injector.get(U).warn("[Facade]: The navigator object only supports the browser environment");
|
|
563
563
|
return;
|
|
564
564
|
}
|
|
@@ -567,7 +567,7 @@ class Ue extends q {
|
|
|
567
567
|
throw new E();
|
|
568
568
|
}
|
|
569
569
|
async _clipboardPasteAsync() {
|
|
570
|
-
if (!
|
|
570
|
+
if (!J()) {
|
|
571
571
|
this._injector.get(U).warn("[Facade]: The navigator object only supports the browser environment");
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
@@ -583,7 +583,7 @@ class Ue extends q {
|
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
585
|
const t = r == null ? void 0 : r.getId(), i = this._injector.get(v), o = r.getActiveSheet(), s = o.getSheetId(), d = i.getRenderById(t);
|
|
586
|
-
d && ((g = e.headerStyle) != null && g.size) && (d.with(_).setColumnHeaderSize(d, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t,
|
|
586
|
+
d && ((g = e.headerStyle) != null && g.size) && (d.with(_).setColumnHeaderSize(d, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, w.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
|
|
587
587
|
}
|
|
588
588
|
customizeRowHeader(e) {
|
|
589
589
|
const r = this.getActiveWorkbook();
|
|
@@ -592,22 +592,22 @@ class Ue extends q {
|
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
594
|
const t = r == null ? void 0 : r.getId();
|
|
595
|
-
this._getSheetRenderComponent(t,
|
|
595
|
+
this._getSheetRenderComponent(t, w.ROW).setCustomHeader(e);
|
|
596
596
|
}
|
|
597
597
|
registerSheetRowHeaderExtension(e, ...r) {
|
|
598
|
-
const t = this._getSheetRenderComponent(e,
|
|
598
|
+
const t = this._getSheetRenderComponent(e, w.ROW), i = t.register(...r);
|
|
599
599
|
return m(() => {
|
|
600
600
|
i.dispose(), t.makeDirty(!0);
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
603
|
registerSheetColumnHeaderExtension(e, ...r) {
|
|
604
|
-
const t = this._getSheetRenderComponent(e,
|
|
604
|
+
const t = this._getSheetRenderComponent(e, w.COLUMN), i = t.register(...r);
|
|
605
605
|
return m(() => {
|
|
606
606
|
i.dispose(), t.makeDirty(!0);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
registerSheetMainExtension(e, ...r) {
|
|
610
|
-
const t = this._getSheetRenderComponent(e,
|
|
610
|
+
const t = this._getSheetRenderComponent(e, w.MAIN), i = t.register(...r);
|
|
611
611
|
return m(() => {
|
|
612
612
|
i.dispose(), t.makeDirty(!0);
|
|
613
613
|
});
|
|
@@ -633,20 +633,29 @@ class Ue extends q {
|
|
|
633
633
|
* @returns {FSheetHooks} FSheetHooks instance
|
|
634
634
|
*/
|
|
635
635
|
getSheetHooks() {
|
|
636
|
-
return this._injector.createInstance(
|
|
636
|
+
return this._injector.createInstance(W);
|
|
637
637
|
}
|
|
638
638
|
pasteIntoSheet(e, r, t) {
|
|
639
639
|
return this._commandService.executeCommand(T.id, { htmlContent: e, textContent: r, files: t });
|
|
640
640
|
}
|
|
641
|
+
setProtectedRangeShadowStrategy(e) {
|
|
642
|
+
this._injector.get(A).setProtectedRangeShadowStrategy(e);
|
|
643
|
+
}
|
|
644
|
+
getProtectedRangeShadowStrategy() {
|
|
645
|
+
return this._injector.get(A).getProtectedRangeShadowStrategy();
|
|
646
|
+
}
|
|
647
|
+
getProtectedRangeShadowStrategy$() {
|
|
648
|
+
return this._injector.get(A).getProtectedRangeShadowStrategy$();
|
|
649
|
+
}
|
|
641
650
|
}
|
|
642
|
-
|
|
643
|
-
class
|
|
651
|
+
Q.extend(xe);
|
|
652
|
+
class Be extends re {
|
|
644
653
|
openSiderbar(e) {
|
|
645
|
-
return this._logDeprecation("openSiderbar"), this._injector.get(
|
|
654
|
+
return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
|
|
646
655
|
}
|
|
647
656
|
openDialog(e) {
|
|
648
657
|
this._logDeprecation("openDialog");
|
|
649
|
-
const t = this._injector.get(
|
|
658
|
+
const t = this._injector.get(ye).open({
|
|
650
659
|
...e,
|
|
651
660
|
onClose: () => {
|
|
652
661
|
t.dispose();
|
|
@@ -656,11 +665,11 @@ class xe extends te {
|
|
|
656
665
|
}
|
|
657
666
|
customizeColumnHeader(e) {
|
|
658
667
|
const r = this._workbook.getUnitId();
|
|
659
|
-
this._getSheetRenderComponent(r,
|
|
668
|
+
this._getSheetRenderComponent(r, w.COLUMN).setCustomHeader(e);
|
|
660
669
|
}
|
|
661
670
|
customizeRowHeader(e) {
|
|
662
671
|
const r = this._workbook.getUnitId();
|
|
663
|
-
this._getSheetRenderComponent(r,
|
|
672
|
+
this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e);
|
|
664
673
|
}
|
|
665
674
|
/**
|
|
666
675
|
* Get sheet render component from render by unitId and view key.
|
|
@@ -743,7 +752,7 @@ class xe extends te {
|
|
|
743
752
|
startEditing() {
|
|
744
753
|
const e = this._injector.get(P);
|
|
745
754
|
return this._injector.get(p).isVisible().visible ? !0 : e.syncExecuteCommand(k.id, {
|
|
746
|
-
eventType:
|
|
755
|
+
eventType: N.Dblclick,
|
|
747
756
|
unitId: this._workbook.getUnitId(),
|
|
748
757
|
visible: !0
|
|
749
758
|
});
|
|
@@ -751,11 +760,11 @@ class xe extends te {
|
|
|
751
760
|
async endEditing(e) {
|
|
752
761
|
const r = this._injector.get(P);
|
|
753
762
|
return this._injector.get(p).isVisible().visible && r.syncExecuteCommand(k.id, {
|
|
754
|
-
eventType:
|
|
763
|
+
eventType: N.Keyboard,
|
|
755
764
|
keycode: e ? B.ENTER : B.ESC,
|
|
756
765
|
visible: !1,
|
|
757
766
|
unitId: this._workbook.getUnitId()
|
|
758
|
-
}), await
|
|
767
|
+
}), await ce(0), !0;
|
|
759
768
|
}
|
|
760
769
|
endEditingAsync(e = !0) {
|
|
761
770
|
return this.endEditing(e);
|
|
@@ -796,8 +805,8 @@ class xe extends te {
|
|
|
796
805
|
return t && t.with(y).showSelection(), this;
|
|
797
806
|
}
|
|
798
807
|
}
|
|
799
|
-
|
|
800
|
-
class
|
|
808
|
+
re.extend(Be);
|
|
809
|
+
class De extends ne {
|
|
801
810
|
refreshCanvas() {
|
|
802
811
|
const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
|
|
803
812
|
if (!t)
|
|
@@ -809,7 +818,7 @@ class Be extends re {
|
|
|
809
818
|
return i.makeDirty(), this;
|
|
810
819
|
}
|
|
811
820
|
highlightRanges(e, r, t) {
|
|
812
|
-
const i = this._injector.get(
|
|
821
|
+
const i = this._injector.get(te), o = [];
|
|
813
822
|
for (const s of e) {
|
|
814
823
|
const d = s.getRange(), h = i.addShapeWithNoFresh({ range: d, style: r, primary: t });
|
|
815
824
|
h && o.push(h);
|
|
@@ -824,7 +833,7 @@ class Be extends re {
|
|
|
824
833
|
}
|
|
825
834
|
zoom(e) {
|
|
826
835
|
const r = this._injector.get(P), t = Math.min(Math.max(e, 0.1), 4);
|
|
827
|
-
return r.executeCommand(
|
|
836
|
+
return r.executeCommand($.id, {
|
|
828
837
|
unitId: this._workbook.getUnitId(),
|
|
829
838
|
subUnitId: this._worksheet.getSheetId(),
|
|
830
839
|
zoomRatio: t
|
|
@@ -846,14 +855,14 @@ class Be extends re {
|
|
|
846
855
|
if (!s) return i;
|
|
847
856
|
const d = s == null ? void 0 : s.getVisibleRanges();
|
|
848
857
|
if (!d) return i;
|
|
849
|
-
i = s.getVisibleRangeByViewport(
|
|
858
|
+
i = s.getVisibleRangeByViewport(ue.VIEW_MAIN);
|
|
850
859
|
for (const [h, g] of d)
|
|
851
|
-
|
|
860
|
+
ve.indexOf(h) !== -1 && (i.startColumn = Math.min(i.startColumn, g.startColumn), i.startRow = Math.min(i.startRow, g.startRow), i.endColumn = Math.max(i.endColumn, g.endColumn), i.endRow = Math.max(i.endRow, g.endRow));
|
|
852
861
|
return i;
|
|
853
862
|
}
|
|
854
863
|
scrollToCell(e, r, t) {
|
|
855
864
|
const i = this._workbook.getUnitId(), s = this._injector.get(v).getRenderById(i);
|
|
856
|
-
return s && (s == null ? void 0 : s.with(
|
|
865
|
+
return s && (s == null ? void 0 : s.with(fe)).scrollToCell(e, r, t), this;
|
|
857
866
|
}
|
|
858
867
|
getScrollState() {
|
|
859
868
|
const e = {
|
|
@@ -893,7 +902,7 @@ class Be extends re {
|
|
|
893
902
|
endRow: this._worksheet.getRowCount() - 1
|
|
894
903
|
}
|
|
895
904
|
];
|
|
896
|
-
return this._commandService.syncExecuteCommand(
|
|
905
|
+
return this._commandService.syncExecuteCommand(ke.id, {
|
|
897
906
|
unitId: t,
|
|
898
907
|
subUnitId: i,
|
|
899
908
|
ranges: o
|
|
@@ -911,7 +920,7 @@ class Be extends re {
|
|
|
911
920
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
912
921
|
}
|
|
913
922
|
];
|
|
914
|
-
return this._commandService.syncExecuteCommand(
|
|
923
|
+
return this._commandService.syncExecuteCommand(we.id, {
|
|
915
924
|
unitId: t,
|
|
916
925
|
subUnitId: i,
|
|
917
926
|
ranges: o
|
|
@@ -920,16 +929,16 @@ class Be extends re {
|
|
|
920
929
|
customizeColumnHeader(e) {
|
|
921
930
|
var d, h;
|
|
922
931
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
923
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r,
|
|
932
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, w.COLUMN).setCustomHeader(e, t);
|
|
924
933
|
}
|
|
925
934
|
customizeRowHeader(e) {
|
|
926
935
|
var d, h;
|
|
927
936
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
928
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r,
|
|
937
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e, t);
|
|
929
938
|
}
|
|
930
939
|
setColumnHeaderHeight(e) {
|
|
931
940
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
932
|
-
return this._commandService.executeCommand(
|
|
941
|
+
return this._commandService.executeCommand(Ie.id, {
|
|
933
942
|
unitId: r,
|
|
934
943
|
subUnitId: t,
|
|
935
944
|
size: e
|
|
@@ -937,7 +946,7 @@ class Be extends re {
|
|
|
937
946
|
}
|
|
938
947
|
setRowHeaderWidth(e) {
|
|
939
948
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
940
|
-
return this._commandService.executeCommand(
|
|
949
|
+
return this._commandService.executeCommand(_e.id, {
|
|
941
950
|
unitId: r,
|
|
942
951
|
subUnitId: t,
|
|
943
952
|
size: e
|
|
@@ -960,14 +969,14 @@ class Be extends re {
|
|
|
960
969
|
return s;
|
|
961
970
|
}
|
|
962
971
|
}
|
|
963
|
-
|
|
964
|
-
class
|
|
972
|
+
ne.extend(De);
|
|
973
|
+
class Te extends ie {
|
|
965
974
|
setPermissionDialogVisible(e) {
|
|
966
975
|
this._permissionService.setShowComponents(e);
|
|
967
976
|
}
|
|
968
977
|
}
|
|
969
|
-
|
|
970
|
-
class
|
|
978
|
+
ie.extend(Te);
|
|
979
|
+
class Ae extends W {
|
|
971
980
|
onCellPointerMove(e) {
|
|
972
981
|
return m(this._injector.get(f).currentPosition$.subscribe(e));
|
|
973
982
|
}
|
|
@@ -980,8 +989,8 @@ class Te extends $ {
|
|
|
980
989
|
onCellDrop(e) {
|
|
981
990
|
return m(this._injector.get(M).endCell$.subscribe(e));
|
|
982
991
|
}
|
|
983
|
-
onCellRender(e, r =
|
|
984
|
-
return this._injector.get(
|
|
992
|
+
onCellRender(e, r = de.Style, t = be.DATA_VALIDATION) {
|
|
993
|
+
return this._injector.get(Ee).intercept(pe.CELL_CONTENT, {
|
|
985
994
|
effect: r,
|
|
986
995
|
handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
|
|
987
996
|
priority: t
|
|
@@ -1000,7 +1009,7 @@ class Te extends $ {
|
|
|
1000
1009
|
});
|
|
1001
1010
|
}
|
|
1002
1011
|
}
|
|
1003
|
-
|
|
1012
|
+
W.extend(Ae);
|
|
1004
1013
|
const H = {
|
|
1005
1014
|
CellClicked: "CellClicked",
|
|
1006
1015
|
CellPointerDown: "CellPointerDown",
|
|
@@ -1008,7 +1017,7 @@ const H = {
|
|
|
1008
1017
|
CellPointerMove: "CellPointerMove",
|
|
1009
1018
|
CellHover: "CellHover"
|
|
1010
1019
|
};
|
|
1011
|
-
class
|
|
1020
|
+
class je {
|
|
1012
1021
|
get BeforeClipboardChange() {
|
|
1013
1022
|
return "BeforeClipboardChange";
|
|
1014
1023
|
}
|
|
@@ -1106,8 +1115,8 @@ class Ae {
|
|
|
1106
1115
|
return "SheetZoomChanged";
|
|
1107
1116
|
}
|
|
1108
1117
|
}
|
|
1109
|
-
|
|
1110
|
-
class
|
|
1118
|
+
ge.extend(je);
|
|
1119
|
+
class $e extends oe {
|
|
1111
1120
|
getCell() {
|
|
1112
1121
|
var d;
|
|
1113
1122
|
const e = this._injector.get(v), r = this._injector.get(U), t = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (d = o == null ? void 0 : o.with(_).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
|
|
@@ -1121,7 +1130,7 @@ class je extends ie {
|
|
|
1121
1130
|
}
|
|
1122
1131
|
generateHTML() {
|
|
1123
1132
|
var t;
|
|
1124
|
-
const r = this._injector.get(
|
|
1133
|
+
const r = this._injector.get(ee).generateCopyContent(
|
|
1125
1134
|
this._workbook.getUnitId(),
|
|
1126
1135
|
this._worksheet.getSheetId(),
|
|
1127
1136
|
this._range
|
|
@@ -1131,7 +1140,7 @@ class je extends ie {
|
|
|
1131
1140
|
attachPopup(e) {
|
|
1132
1141
|
var s, d, h;
|
|
1133
1142
|
e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1134
|
-
const { key: r, disposableCollection: t } =
|
|
1143
|
+
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(F).attachPopupToCell(
|
|
1135
1144
|
this._range.startRow,
|
|
1136
1145
|
this._range.startColumn,
|
|
1137
1146
|
{ ...e, componentKey: r },
|
|
@@ -1141,7 +1150,7 @@ class je extends ie {
|
|
|
1141
1150
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1142
1151
|
}
|
|
1143
1152
|
attachAlertPopup(e) {
|
|
1144
|
-
const r = this._injector.get(
|
|
1153
|
+
const r = this._injector.get(Pe), t = {
|
|
1145
1154
|
workbook: this._workbook,
|
|
1146
1155
|
worksheet: this._worksheet,
|
|
1147
1156
|
row: this._range.startRow,
|
|
@@ -1173,7 +1182,7 @@ class je extends ie {
|
|
|
1173
1182
|
attachRangePopup(e) {
|
|
1174
1183
|
var s, d, h;
|
|
1175
1184
|
e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1176
|
-
const { key: r, disposableCollection: t } =
|
|
1185
|
+
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(F).attachRangePopup(
|
|
1177
1186
|
this._range,
|
|
1178
1187
|
{ ...e, componentKey: r },
|
|
1179
1188
|
this.getUnitId(),
|
|
@@ -1182,7 +1191,7 @@ class je extends ie {
|
|
|
1182
1191
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1183
1192
|
}
|
|
1184
1193
|
highlight(e, r) {
|
|
1185
|
-
const t = this._injector.get(
|
|
1194
|
+
const t = this._injector.get(te), i = t.addShape({ range: this._range, style: e, primary: r });
|
|
1186
1195
|
if (!i)
|
|
1187
1196
|
throw new Error("Failed to highlight current range");
|
|
1188
1197
|
return m(() => {
|
|
@@ -1190,19 +1199,19 @@ class je extends ie {
|
|
|
1190
1199
|
});
|
|
1191
1200
|
}
|
|
1192
1201
|
showDropdown(e) {
|
|
1193
|
-
return this._injector.get(
|
|
1202
|
+
return this._injector.get(Re).showDropdown(e);
|
|
1194
1203
|
}
|
|
1195
1204
|
}
|
|
1196
|
-
|
|
1197
|
-
function
|
|
1198
|
-
const { componentKey: r, isVue3: t } =
|
|
1205
|
+
oe.extend($e);
|
|
1206
|
+
function q(b, e) {
|
|
1207
|
+
const { componentKey: r, isVue3: t } = b;
|
|
1199
1208
|
let i;
|
|
1200
|
-
const o = new
|
|
1201
|
-
return typeof r == "string" ? i = r : (i = `External_${
|
|
1209
|
+
const o = new j();
|
|
1210
|
+
return typeof r == "string" ? i = r : (i = `External_${he(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
|
|
1202
1211
|
key: i,
|
|
1203
1212
|
disposableCollection: o
|
|
1204
1213
|
};
|
|
1205
1214
|
}
|
|
1206
1215
|
export {
|
|
1207
|
-
|
|
1216
|
+
q as transformComponentKey
|
|
1208
1217
|
};
|