@univerjs/sheets-ui 0.15.4 → 0.15.5
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 +16 -16
- package/lib/es/facade.js +84 -103
- package/lib/es/index.js +13265 -14584
- package/lib/facade.js +84 -103
- package/lib/index.js +13265 -14584
- package/lib/types/controllers/{auto-fill.controller.d.ts → auto-fill-ui.controller.d.ts} +5 -17
- package/lib/types/controllers/auto-height.controller.d.ts +0 -1
- package/lib/types/controllers/auto-width.controller.d.ts +0 -1
- package/lib/types/controllers/clipboard/utils.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-check-ui.controller.d.ts +1 -4
- package/lib/types/controllers/utils/range-tools.d.ts +2 -7
- package/lib/types/facade/f-range.d.ts +1 -40
- package/lib/types/index.d.ts +3 -10
- package/lib/types/services/clipboard/clipboard.service.d.ts +1 -2
- package/lib/types/services/clipboard/copy-content-cache.d.ts +1 -1
- package/lib/types/services/clipboard/type.d.ts +1 -1
- package/lib/types/services/clipboard/usm-to-html/convertor.d.ts +1 -1
- package/lib/types/services/clipboard/utils.d.ts +1 -2
- package/lib/types/views/auto-fill-popup-menu/AutoFillPopupMenu.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +15 -15
- package/package.json +12 -12
- package/lib/types/commands/commands/auto-fill.command.d.ts +0 -15
- package/lib/types/commands/commands/refill.command.d.ts +0 -2
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +0 -76
- package/lib/types/services/auto-fill/rules.d.ts +0 -10
- package/lib/types/services/auto-fill/tools.d.ts +0 -115
- package/lib/types/services/auto-fill/type.d.ts +0 -70
package/lib/es/facade.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ICommandService as
|
|
2
|
-
import { FUniver as G, FEventName as
|
|
3
|
-
import { RichTextEditingMutation as
|
|
4
|
-
import { IRenderManagerService as v, DeviceInputEventType as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SetCellEditVisibleOperation as k, IEditorBridgeService as
|
|
1
|
+
import { ICommandService as I, CanceledError as E, IUniverInstanceService as W, RichTextValue as $, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as x, LifecycleService as oe, DisposableCollection as T, LifecycleStages as O, UniverInstanceType as se, ILogService as H, toDisposable as S, IPermissionService as ae, awaitTime as ce, InterceptorEffectEnum as de, generateRandomId as he } from "@univerjs/core";
|
|
2
|
+
import { FUniver as G, FEventName as ge, FEnum as le } from "@univerjs/core/facade";
|
|
3
|
+
import { RichTextEditingMutation as ue } from "@univerjs/docs";
|
|
4
|
+
import { IRenderManagerService as v, DeviceInputEventType as z, SHEET_VIEWPORT_KEY as q } from "@univerjs/engine-render";
|
|
5
|
+
import { SheetsSelectionsService as ve, COMMAND_LISTENER_SKELETON_CHANGE as Se, getSkeletonChangedEffectedRange as me, SetWorksheetRowIsAutoHeightCommand as Ce, InterceptCellContentPriority as pe, SheetInterceptorService as Ee, INTERCEPTOR_POINT as be } from "@univerjs/sheets";
|
|
6
|
+
import { SetCellEditVisibleOperation as k, IEditorBridgeService as w, SetZoomRatioCommand as A, HoverManagerService as f, DragManagerService as R, SheetScrollManagerService as y, SheetPasteShortKeyCommand as B, ISheetClipboardService as Q, SheetSkeletonManagerService as b, SHEET_VIEW_KEY as p, SheetPermissionRenderManagerService as D, ISheetSelectionRenderService as M, IMarkSelectionService as ee, SheetsScrollRenderController as we, SetWorksheetColAutoWidthCommand as fe, SetColumnHeaderHeightCommand as ke, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as F, CellAlertManagerService as Ie, ISheetCellDropdownManagerService as Pe } from "@univerjs/sheets-ui";
|
|
7
7
|
import { FSheetHooks as j, FWorkbook as te, FWorksheet as re, FPermission as ne, FRange as ie } from "@univerjs/sheets/facade";
|
|
8
|
-
import { KeyCode as U, CutCommand as L, CopyCommand as N, PasteCommand as V, IClipboardInterfaceService as
|
|
9
|
-
import { filter as u, combineLatest as
|
|
10
|
-
class
|
|
8
|
+
import { KeyCode as U, CutCommand as L, CopyCommand as N, PasteCommand as V, IClipboardInterfaceService as Re, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Z, HTML_CLIPBOARD_MIME_TYPE as K, supportClipboardAPI as Y, ISidebarService as Me, IDialogService as He, ComponentManager as X } from "@univerjs/ui";
|
|
9
|
+
import { filter as u, combineLatest as ye } from "rxjs";
|
|
10
|
+
class Ue extends G {
|
|
11
11
|
// eslint-disable-next-line max-lines-per-function
|
|
12
12
|
_initSheetUIEvent(e) {
|
|
13
|
-
const r = e.get(
|
|
13
|
+
const r = e.get(I);
|
|
14
14
|
this.disposeWithMe(
|
|
15
15
|
this.registerEventHandler(
|
|
16
16
|
this.Event.BeforeSheetEditStart,
|
|
@@ -18,7 +18,7 @@ class Be extends G {
|
|
|
18
18
|
if (t.id !== k.id) return;
|
|
19
19
|
const i = this.getActiveSheet();
|
|
20
20
|
if (!i) return;
|
|
21
|
-
const { workbook: o, worksheet: a } = i, d = e.get(
|
|
21
|
+
const { workbook: o, worksheet: a } = i, d = e.get(w), h = t.params, { visible: l, keycode: g, eventType: c } = h, n = d.getEditLocation();
|
|
22
22
|
if (l) {
|
|
23
23
|
const s = {
|
|
24
24
|
row: n.row,
|
|
@@ -41,7 +41,7 @@ class Be extends G {
|
|
|
41
41
|
if (t.id !== k.id) return;
|
|
42
42
|
const i = this.getActiveSheet();
|
|
43
43
|
if (!i) return;
|
|
44
|
-
const { workbook: o, worksheet: a } = i, d = e.get(
|
|
44
|
+
const { workbook: o, worksheet: a } = i, d = e.get(w), h = e.get(W), l = t.params, { visible: g, keycode: c, eventType: n } = l, s = d.getEditLocation();
|
|
45
45
|
if (!g) {
|
|
46
46
|
const m = {
|
|
47
47
|
row: s.row,
|
|
@@ -66,7 +66,7 @@ class Be extends G {
|
|
|
66
66
|
if (t.id !== k.id) return;
|
|
67
67
|
const i = this.getCommandSheetTarget(t);
|
|
68
68
|
if (!i) return;
|
|
69
|
-
const { workbook: o, worksheet: a } = i, d = e.get(
|
|
69
|
+
const { workbook: o, worksheet: a } = i, d = e.get(w), h = t.params, { visible: l, keycode: g, eventType: c } = h, n = d.getEditLocation();
|
|
70
70
|
if (l) {
|
|
71
71
|
const s = {
|
|
72
72
|
row: n.row,
|
|
@@ -88,7 +88,7 @@ class Be extends G {
|
|
|
88
88
|
if (t.id !== k.id) return;
|
|
89
89
|
const i = this.getCommandSheetTarget(t);
|
|
90
90
|
if (!i) return;
|
|
91
|
-
const { workbook: o, worksheet: a } = i, d = e.get(
|
|
91
|
+
const { workbook: o, worksheet: a } = i, d = e.get(w), h = t.params, { visible: l, keycode: g, eventType: c } = h, n = d.getEditLocation();
|
|
92
92
|
if (!l) {
|
|
93
93
|
const s = {
|
|
94
94
|
row: n.row,
|
|
@@ -108,10 +108,10 @@ class Be extends G {
|
|
|
108
108
|
this.registerEventHandler(
|
|
109
109
|
this.Event.SheetEditChanging,
|
|
110
110
|
() => r.onCommandExecuted((t) => {
|
|
111
|
-
if (t.id !==
|
|
111
|
+
if (t.id !== ue.id) return;
|
|
112
112
|
const i = this.getActiveSheet();
|
|
113
113
|
if (!i) return;
|
|
114
|
-
const { workbook: o, worksheet: a } = i, d = e.get(
|
|
114
|
+
const { workbook: o, worksheet: a } = i, d = e.get(w), h = e.get(W), l = t.params;
|
|
115
115
|
if (!d.isVisible().visible) return;
|
|
116
116
|
const { unitId: g } = l;
|
|
117
117
|
if (g === x) {
|
|
@@ -165,7 +165,7 @@ class Be extends G {
|
|
|
165
165
|
const r = e.get(v), t = e.get(oe), i = new T();
|
|
166
166
|
this.disposeWithMe(t.lifecycle$.subscribe((h) => {
|
|
167
167
|
if (h !== O.Rendered) return;
|
|
168
|
-
const l = e.get(f), g = e.get(
|
|
168
|
+
const l = e.get(f), g = e.get(R);
|
|
169
169
|
l && (i.dispose(), i.add(
|
|
170
170
|
this.registerEventHandler(
|
|
171
171
|
this.Event.CellClicked,
|
|
@@ -393,7 +393,7 @@ class Be extends G {
|
|
|
393
393
|
), this.disposeWithMe(i));
|
|
394
394
|
}));
|
|
395
395
|
let o;
|
|
396
|
-
const a =
|
|
396
|
+
const a = ye([
|
|
397
397
|
r.created$,
|
|
398
398
|
t.lifecycle$
|
|
399
399
|
]), d = new T();
|
|
@@ -402,7 +402,7 @@ class Be extends G {
|
|
|
402
402
|
const g = this.getWorkbook(o.unitId);
|
|
403
403
|
if (!g) return;
|
|
404
404
|
d.dispose();
|
|
405
|
-
const c = o.with(y), n = o.with(
|
|
405
|
+
const c = o.with(y), n = o.with(ve);
|
|
406
406
|
d.add(
|
|
407
407
|
this.registerEventHandler(
|
|
408
408
|
this.Event.Scroll,
|
|
@@ -422,7 +422,7 @@ class Be extends G {
|
|
|
422
422
|
this.fireEvent(this.Event.SelectionMoveStart, {
|
|
423
423
|
workbook: g,
|
|
424
424
|
worksheet: g.getActiveSheet(),
|
|
425
|
-
selections: (m = s == null ? void 0 : s.map((
|
|
425
|
+
selections: (m = s == null ? void 0 : s.map((_) => _.range)) != null ? m : []
|
|
426
426
|
});
|
|
427
427
|
})
|
|
428
428
|
)
|
|
@@ -434,7 +434,7 @@ class Be extends G {
|
|
|
434
434
|
this.fireEvent(this.Event.SelectionMoving, {
|
|
435
435
|
workbook: g,
|
|
436
436
|
worksheet: g.getActiveSheet(),
|
|
437
|
-
selections: (m = s == null ? void 0 : s.map((
|
|
437
|
+
selections: (m = s == null ? void 0 : s.map((_) => _.range)) != null ? m : []
|
|
438
438
|
});
|
|
439
439
|
})
|
|
440
440
|
)
|
|
@@ -446,7 +446,7 @@ class Be extends G {
|
|
|
446
446
|
this.fireEvent(this.Event.SelectionMoveEnd, {
|
|
447
447
|
workbook: g,
|
|
448
448
|
worksheet: g.getActiveSheet(),
|
|
449
|
-
selections: (m = s == null ? void 0 : s.map((
|
|
449
|
+
selections: (m = s == null ? void 0 : s.map((_) => _.range)) != null ? m : []
|
|
450
450
|
});
|
|
451
451
|
})
|
|
452
452
|
)
|
|
@@ -458,7 +458,7 @@ class Be extends G {
|
|
|
458
458
|
this.fireEvent(this.Event.SelectionChanged, {
|
|
459
459
|
workbook: g,
|
|
460
460
|
worksheet: g.getActiveSheet(),
|
|
461
|
-
selections: (m = s == null ? void 0 : s.map((
|
|
461
|
+
selections: (m = s == null ? void 0 : s.map((_) => _.range)) != null ? m : []
|
|
462
462
|
});
|
|
463
463
|
})
|
|
464
464
|
)
|
|
@@ -471,7 +471,7 @@ class Be extends G {
|
|
|
471
471
|
// eslint-disable-next-line max-lines-per-function
|
|
472
472
|
_initialize(e) {
|
|
473
473
|
this._initSheetUIEvent(e), this._initObserverListener(e);
|
|
474
|
-
const r = e.get(
|
|
474
|
+
const r = e.get(I);
|
|
475
475
|
this.disposeWithMe(
|
|
476
476
|
this.registerEventHandler(
|
|
477
477
|
this.Event.BeforeClipboardChange,
|
|
@@ -528,10 +528,10 @@ class Be extends G {
|
|
|
528
528
|
this.registerEventHandler(
|
|
529
529
|
this.Event.SheetSkeletonChanged,
|
|
530
530
|
() => r.onCommandExecuted((t) => {
|
|
531
|
-
if (
|
|
531
|
+
if (Se.indexOf(t.id) > -1) {
|
|
532
532
|
const i = this.getActiveSheet();
|
|
533
533
|
if (!i) return;
|
|
534
|
-
const o =
|
|
534
|
+
const o = me(t, i.worksheet.getMaxColumns()).map((a) => {
|
|
535
535
|
var d, h;
|
|
536
536
|
return (h = (d = this.getWorkbook(a.unitId)) == null ? void 0 : d.getSheetBySheetId(a.subUnitId)) == null ? void 0 : h.getRange(a.range);
|
|
537
537
|
}).filter(Boolean);
|
|
@@ -589,7 +589,7 @@ class Be extends G {
|
|
|
589
589
|
const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
|
|
590
590
|
if (!e || !r)
|
|
591
591
|
return;
|
|
592
|
-
const o = (await this._injector.get(
|
|
592
|
+
const o = (await this._injector.get(Re).read())[0];
|
|
593
593
|
let a;
|
|
594
594
|
if (o) {
|
|
595
595
|
const d = o.types, h = d.indexOf(Z) !== -1 ? await o.getType(Z).then((g) => g && g.text()) : "", l = d.indexOf(K) !== -1 ? await o.getType(K).then((g) => g && g.text()) : "";
|
|
@@ -638,7 +638,7 @@ class Be extends G {
|
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
640
|
const t = r == null ? void 0 : r.getId(), i = this._injector.get(v), o = r.getActiveSheet(), a = o.getSheetId(), d = i.getRenderById(t);
|
|
641
|
-
d && ((l = e.headerStyle) != null && l.size) && (d.with(b).setColumnHeaderSize(d, a, (g = e.headerStyle) == null ? void 0 : g.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t,
|
|
641
|
+
d && ((l = e.headerStyle) != null && l.size) && (d.with(b).setColumnHeaderSize(d, a, (g = e.headerStyle) == null ? void 0 : g.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, p.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
|
|
642
642
|
}
|
|
643
643
|
customizeRowHeader(e) {
|
|
644
644
|
const r = this.getActiveWorkbook();
|
|
@@ -647,22 +647,22 @@ class Be extends G {
|
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
const t = r == null ? void 0 : r.getId();
|
|
650
|
-
this._getSheetRenderComponent(t,
|
|
650
|
+
this._getSheetRenderComponent(t, p.ROW).setCustomHeader(e);
|
|
651
651
|
}
|
|
652
652
|
registerSheetRowHeaderExtension(e, ...r) {
|
|
653
|
-
const t = this._getSheetRenderComponent(e,
|
|
653
|
+
const t = this._getSheetRenderComponent(e, p.ROW), i = t.register(...r);
|
|
654
654
|
return S(() => {
|
|
655
655
|
i.dispose(), t.makeDirty(!0);
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
658
|
registerSheetColumnHeaderExtension(e, ...r) {
|
|
659
|
-
const t = this._getSheetRenderComponent(e,
|
|
659
|
+
const t = this._getSheetRenderComponent(e, p.COLUMN), i = t.register(...r);
|
|
660
660
|
return S(() => {
|
|
661
661
|
i.dispose(), t.makeDirty(!0);
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
registerSheetMainExtension(e, ...r) {
|
|
665
|
-
const t = this._getSheetRenderComponent(e,
|
|
665
|
+
const t = this._getSheetRenderComponent(e, p.MAIN), i = t.register(...r);
|
|
666
666
|
return S(() => {
|
|
667
667
|
i.dispose(), t.makeDirty(!0);
|
|
668
668
|
});
|
|
@@ -706,14 +706,14 @@ class Be extends G {
|
|
|
706
706
|
this._injector.get(ae).setShowComponents(e);
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
-
G.extend(
|
|
710
|
-
class
|
|
709
|
+
G.extend(Ue);
|
|
710
|
+
class xe extends te {
|
|
711
711
|
openSiderbar(e) {
|
|
712
|
-
return this._logDeprecation("openSiderbar"), this._injector.get(
|
|
712
|
+
return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
|
|
713
713
|
}
|
|
714
714
|
openDialog(e) {
|
|
715
715
|
this._logDeprecation("openDialog");
|
|
716
|
-
const t = this._injector.get(
|
|
716
|
+
const t = this._injector.get(He).open({
|
|
717
717
|
...e,
|
|
718
718
|
onClose: () => {
|
|
719
719
|
t.dispose();
|
|
@@ -723,11 +723,11 @@ class De extends te {
|
|
|
723
723
|
}
|
|
724
724
|
customizeColumnHeader(e) {
|
|
725
725
|
const r = this._workbook.getUnitId();
|
|
726
|
-
this._getSheetRenderComponent(r,
|
|
726
|
+
this._getSheetRenderComponent(r, p.COLUMN).setCustomHeader(e);
|
|
727
727
|
}
|
|
728
728
|
customizeRowHeader(e) {
|
|
729
729
|
const r = this._workbook.getUnitId();
|
|
730
|
-
this._getSheetRenderComponent(r,
|
|
730
|
+
this._getSheetRenderComponent(r, p.ROW).setCustomHeader(e);
|
|
731
731
|
}
|
|
732
732
|
/**
|
|
733
733
|
* Get sheet render component from render by unitId and view key.
|
|
@@ -792,7 +792,7 @@ class De extends te {
|
|
|
792
792
|
);
|
|
793
793
|
}
|
|
794
794
|
onDragOver(e) {
|
|
795
|
-
const r = this._injector.get(
|
|
795
|
+
const r = this._injector.get(R);
|
|
796
796
|
return S(
|
|
797
797
|
r.currentCell$.pipe(u((t) => !!t)).subscribe((t) => {
|
|
798
798
|
e(t);
|
|
@@ -800,7 +800,7 @@ class De extends te {
|
|
|
800
800
|
);
|
|
801
801
|
}
|
|
802
802
|
onDrop(e) {
|
|
803
|
-
const r = this._injector.get(
|
|
803
|
+
const r = this._injector.get(R);
|
|
804
804
|
return S(
|
|
805
805
|
r.endCell$.pipe(u((t) => !!t)).subscribe((t) => {
|
|
806
806
|
e(t);
|
|
@@ -808,17 +808,17 @@ class De extends te {
|
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
810
|
startEditing() {
|
|
811
|
-
const e = this._injector.get(
|
|
812
|
-
return this._injector.get(
|
|
813
|
-
eventType:
|
|
811
|
+
const e = this._injector.get(I);
|
|
812
|
+
return this._injector.get(w).isVisible().visible ? !0 : e.syncExecuteCommand(k.id, {
|
|
813
|
+
eventType: z.Dblclick,
|
|
814
814
|
unitId: this._workbook.getUnitId(),
|
|
815
815
|
visible: !0
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
818
|
async endEditing(e) {
|
|
819
|
-
const r = this._injector.get(
|
|
820
|
-
return this._injector.get(
|
|
821
|
-
eventType:
|
|
819
|
+
const r = this._injector.get(I);
|
|
820
|
+
return this._injector.get(w).isVisible().visible && r.syncExecuteCommand(k.id, {
|
|
821
|
+
eventType: z.Keyboard,
|
|
822
822
|
keycode: e ? U.ENTER : U.ESC,
|
|
823
823
|
visible: !1,
|
|
824
824
|
unitId: this._workbook.getUnitId()
|
|
@@ -831,7 +831,7 @@ class De extends te {
|
|
|
831
831
|
return this.endEditingAsync(!1);
|
|
832
832
|
}
|
|
833
833
|
isCellEditing() {
|
|
834
|
-
return this._injector.get(
|
|
834
|
+
return this._injector.get(w).isVisible().visible;
|
|
835
835
|
}
|
|
836
836
|
/**
|
|
837
837
|
* Get scroll state of specified sheet.
|
|
@@ -863,8 +863,8 @@ class De extends te {
|
|
|
863
863
|
return t && t.with(M).showSelection(), this;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
|
-
te.extend(
|
|
867
|
-
class
|
|
866
|
+
te.extend(xe);
|
|
867
|
+
class Be extends re {
|
|
868
868
|
refreshCanvas() {
|
|
869
869
|
const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
|
|
870
870
|
if (!t)
|
|
@@ -890,7 +890,7 @@ class Te extends re {
|
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
892
|
zoom(e) {
|
|
893
|
-
const r = this._injector.get(
|
|
893
|
+
const r = this._injector.get(I), t = Math.min(Math.max(e, 0.1), 4);
|
|
894
894
|
return r.executeCommand(A.id, {
|
|
895
895
|
unitId: this._workbook.getUnitId(),
|
|
896
896
|
subUnitId: this._worksheet.getSheetId(),
|
|
@@ -914,7 +914,7 @@ class Te extends re {
|
|
|
914
914
|
}
|
|
915
915
|
scrollToCell(e, r, t) {
|
|
916
916
|
const i = this._workbook.getUnitId(), a = this._injector.get(v).getRenderById(i);
|
|
917
|
-
return a && (a == null ? void 0 : a.with(
|
|
917
|
+
return a && (a == null ? void 0 : a.with(we)).scrollToCell(e, r, t), this;
|
|
918
918
|
}
|
|
919
919
|
getScrollState() {
|
|
920
920
|
const e = {
|
|
@@ -954,7 +954,7 @@ class Te extends re {
|
|
|
954
954
|
endRow: this._worksheet.getRowCount() - 1
|
|
955
955
|
}
|
|
956
956
|
];
|
|
957
|
-
return this._commandService.syncExecuteCommand(
|
|
957
|
+
return this._commandService.syncExecuteCommand(fe.id, {
|
|
958
958
|
unitId: t,
|
|
959
959
|
subUnitId: i,
|
|
960
960
|
ranges: o
|
|
@@ -972,7 +972,7 @@ class Te extends re {
|
|
|
972
972
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
973
973
|
}
|
|
974
974
|
];
|
|
975
|
-
return this._commandService.syncExecuteCommand(
|
|
975
|
+
return this._commandService.syncExecuteCommand(Ce.id, {
|
|
976
976
|
unitId: t,
|
|
977
977
|
subUnitId: i,
|
|
978
978
|
ranges: o
|
|
@@ -981,16 +981,16 @@ class Te extends re {
|
|
|
981
981
|
customizeColumnHeader(e) {
|
|
982
982
|
var d, h;
|
|
983
983
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
984
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(b).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r,
|
|
984
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(b).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, p.COLUMN).setCustomHeader(e, t);
|
|
985
985
|
}
|
|
986
986
|
customizeRowHeader(e) {
|
|
987
987
|
var d, h;
|
|
988
988
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
989
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(b).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r,
|
|
989
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(b).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, p.ROW).setCustomHeader(e, t);
|
|
990
990
|
}
|
|
991
991
|
setColumnHeaderHeight(e) {
|
|
992
992
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
993
|
-
return this._commandService.executeCommand(
|
|
993
|
+
return this._commandService.executeCommand(ke.id, {
|
|
994
994
|
unitId: r,
|
|
995
995
|
subUnitId: t,
|
|
996
996
|
size: e
|
|
@@ -1021,14 +1021,14 @@ class Te extends re {
|
|
|
1021
1021
|
return a;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
re.extend(
|
|
1025
|
-
class
|
|
1024
|
+
re.extend(Be);
|
|
1025
|
+
class De extends ne {
|
|
1026
1026
|
setPermissionDialogVisible(e) {
|
|
1027
1027
|
this._permissionService.setShowComponents(e);
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
ne.extend(
|
|
1031
|
-
class
|
|
1030
|
+
ne.extend(De);
|
|
1031
|
+
class Te extends j {
|
|
1032
1032
|
onCellPointerMove(e) {
|
|
1033
1033
|
return S(this._injector.get(f).currentPosition$.subscribe(e));
|
|
1034
1034
|
}
|
|
@@ -1036,40 +1036,40 @@ class je extends j {
|
|
|
1036
1036
|
return S(this._injector.get(f).currentCell$.subscribe(e));
|
|
1037
1037
|
}
|
|
1038
1038
|
onCellDragOver(e) {
|
|
1039
|
-
return S(this._injector.get(
|
|
1039
|
+
return S(this._injector.get(R).currentCell$.subscribe(e));
|
|
1040
1040
|
}
|
|
1041
1041
|
onCellDrop(e) {
|
|
1042
|
-
return S(this._injector.get(
|
|
1042
|
+
return S(this._injector.get(R).endCell$.subscribe(e));
|
|
1043
1043
|
}
|
|
1044
|
-
onCellRender(e, r = de.Style, t =
|
|
1045
|
-
return this._injector.get(
|
|
1044
|
+
onCellRender(e, r = de.Style, t = pe.DATA_VALIDATION) {
|
|
1045
|
+
return this._injector.get(Ee).intercept(be.CELL_CONTENT, {
|
|
1046
1046
|
effect: r,
|
|
1047
1047
|
handler: (i, o, a) => (i && !i.customRender && e && (i.customRender = [...e]), a(i)),
|
|
1048
1048
|
priority: t
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
onBeforeCellEdit(e) {
|
|
1052
|
-
return this._injector.get(
|
|
1052
|
+
return this._injector.get(I).beforeCommandExecuted((r) => {
|
|
1053
1053
|
const t = r.params;
|
|
1054
1054
|
r.id === k.id && t.visible && e(t);
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
1057
1057
|
onAfterCellEdit(e) {
|
|
1058
|
-
return this._injector.get(
|
|
1058
|
+
return this._injector.get(I).onCommandExecuted((r) => {
|
|
1059
1059
|
const t = r.params;
|
|
1060
1060
|
r.id === k.id && !t.visible && e(t);
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
j.extend(
|
|
1065
|
-
const
|
|
1064
|
+
j.extend(Te);
|
|
1065
|
+
const P = {
|
|
1066
1066
|
CellClicked: "CellClicked",
|
|
1067
1067
|
CellPointerDown: "CellPointerDown",
|
|
1068
1068
|
CellPointerUp: "CellPointerUp",
|
|
1069
1069
|
CellPointerMove: "CellPointerMove",
|
|
1070
1070
|
CellHover: "CellHover"
|
|
1071
1071
|
};
|
|
1072
|
-
class
|
|
1072
|
+
class Ae {
|
|
1073
1073
|
get BeforeClipboardChange() {
|
|
1074
1074
|
return "BeforeClipboardChange";
|
|
1075
1075
|
}
|
|
@@ -1098,19 +1098,19 @@ class We {
|
|
|
1098
1098
|
return "SheetEditEnded";
|
|
1099
1099
|
}
|
|
1100
1100
|
get CellClicked() {
|
|
1101
|
-
return
|
|
1101
|
+
return P.CellClicked;
|
|
1102
1102
|
}
|
|
1103
1103
|
get CellHover() {
|
|
1104
|
-
return
|
|
1104
|
+
return P.CellHover;
|
|
1105
1105
|
}
|
|
1106
1106
|
get CellPointerDown() {
|
|
1107
|
-
return
|
|
1107
|
+
return P.CellPointerDown;
|
|
1108
1108
|
}
|
|
1109
1109
|
get CellPointerUp() {
|
|
1110
|
-
return
|
|
1110
|
+
return P.CellPointerUp;
|
|
1111
1111
|
}
|
|
1112
1112
|
get CellPointerMove() {
|
|
1113
|
-
return
|
|
1113
|
+
return P.CellPointerMove;
|
|
1114
1114
|
}
|
|
1115
1115
|
get DragOver() {
|
|
1116
1116
|
return "DragOver";
|
|
@@ -1167,14 +1167,14 @@ class We {
|
|
|
1167
1167
|
return "SheetZoomChanged";
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
|
|
1171
|
-
class
|
|
1170
|
+
ge.extend(Ae);
|
|
1171
|
+
class je {
|
|
1172
1172
|
get SHEET_VIEWPORT_KEY() {
|
|
1173
1173
|
return q;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
|
|
1177
|
-
class
|
|
1176
|
+
le.extend(je);
|
|
1177
|
+
class We extends ie {
|
|
1178
1178
|
getCell() {
|
|
1179
1179
|
var d;
|
|
1180
1180
|
const e = this._injector.get(v), r = this._injector.get(H), t = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(t), a = (d = o == null ? void 0 : o.with(b).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
|
|
@@ -1198,7 +1198,7 @@ class Oe extends ie {
|
|
|
1198
1198
|
attachPopup(e) {
|
|
1199
1199
|
var a, d, h;
|
|
1200
1200
|
e.direction = (a = e.direction) != null ? a : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1201
|
-
const { key: r, disposableCollection: t } = J(e, this._injector.get(X)), o = this._injector.get(
|
|
1201
|
+
const { key: r, disposableCollection: t } = J(e, this._injector.get(X)), o = this._injector.get(F).attachPopupToCell(
|
|
1202
1202
|
this._range.startRow,
|
|
1203
1203
|
this._range.startColumn,
|
|
1204
1204
|
{ ...e, componentKey: r },
|
|
@@ -1208,7 +1208,7 @@ class Oe extends ie {
|
|
|
1208
1208
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1209
1209
|
}
|
|
1210
1210
|
attachAlertPopup(e) {
|
|
1211
|
-
const r = this._injector.get(
|
|
1211
|
+
const r = this._injector.get(Ie), t = {
|
|
1212
1212
|
workbook: this._workbook,
|
|
1213
1213
|
worksheet: this._worksheet,
|
|
1214
1214
|
row: this._range.startRow,
|
|
@@ -1240,7 +1240,7 @@ class Oe extends ie {
|
|
|
1240
1240
|
attachRangePopup(e) {
|
|
1241
1241
|
var a, d, h;
|
|
1242
1242
|
e.direction = (a = e.direction) != null ? a : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1243
|
-
const { key: r, disposableCollection: t } = J(e, this._injector.get(X)), o = this._injector.get(
|
|
1243
|
+
const { key: r, disposableCollection: t } = J(e, this._injector.get(X)), o = this._injector.get(F).attachRangePopup(
|
|
1244
1244
|
this._range,
|
|
1245
1245
|
{ ...e, componentKey: r },
|
|
1246
1246
|
this.getUnitId(),
|
|
@@ -1259,37 +1259,18 @@ class Oe extends ie {
|
|
|
1259
1259
|
showDropdown(e) {
|
|
1260
1260
|
return this._injector.get(Pe).showDropdown(e);
|
|
1261
1261
|
}
|
|
1262
|
-
async autoFill(e, r) {
|
|
1263
|
-
const t = this.getRange(), i = e.getRange();
|
|
1264
|
-
if (!he.contains(i, t))
|
|
1265
|
-
throw new Error("AutoFill target range must contain source range");
|
|
1266
|
-
const { startRow: o, startColumn: a, endRow: d, endColumn: h } = t, { startRow: l, startColumn: g, endRow: c, endColumn: n } = i;
|
|
1267
|
-
if (d - o !== c - l && h - a !== n - g)
|
|
1268
|
-
throw new Error("AutoFill can only fill in one direction");
|
|
1269
|
-
if (d - o === c - l && a !== g && h !== n)
|
|
1270
|
-
throw new Error("AutoFill can only fill in one direction");
|
|
1271
|
-
if (h - a === n - g && o !== l && d !== c)
|
|
1272
|
-
throw new Error("AutoFill can only fill in one direction");
|
|
1273
|
-
return this._commandService.executeCommand(Me.id, {
|
|
1274
|
-
sourceRange: t,
|
|
1275
|
-
targetRange: i,
|
|
1276
|
-
unitId: this.getUnitId(),
|
|
1277
|
-
subUnitId: this.getSheetId(),
|
|
1278
|
-
applyType: r
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
1262
|
}
|
|
1282
|
-
ie.extend(
|
|
1263
|
+
ie.extend(We);
|
|
1283
1264
|
function J(C, e) {
|
|
1284
1265
|
const { componentKey: r, isVue3: t } = C;
|
|
1285
1266
|
let i;
|
|
1286
1267
|
const o = new T();
|
|
1287
|
-
return typeof r == "string" ? i = r : (i = `External_${
|
|
1268
|
+
return typeof r == "string" ? i = r : (i = `External_${he(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
|
|
1288
1269
|
key: i,
|
|
1289
1270
|
disposableCollection: o
|
|
1290
1271
|
};
|
|
1291
1272
|
}
|
|
1292
1273
|
export {
|
|
1293
|
-
|
|
1274
|
+
je as FSheetsUIEnum,
|
|
1294
1275
|
J as transformComponentKey
|
|
1295
1276
|
};
|