@univerjs/sheets-ui 0.5.0-alpha.0 → 0.5.0-beta.0

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.
Files changed (29) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +13 -13
  3. package/lib/es/facade.js +6 -6
  4. package/lib/es/index.js +5119 -5034
  5. package/lib/types/consts/permission.d.ts +1 -0
  6. package/lib/types/controllers/config.schema.d.ts +1 -0
  7. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +5 -3
  8. package/lib/types/controllers/render-controllers/header-move.render-controller.d.ts +2 -2
  9. package/lib/types/facade/f-range.d.ts +2 -2
  10. package/lib/types/index.d.ts +8 -4
  11. package/lib/types/services/mark-selection/mark-selection.service.d.ts +3 -1
  12. package/lib/types/services/scroll-manager.service.d.ts +1 -1
  13. package/lib/types/services/selection/base-selection-render.service.d.ts +72 -59
  14. package/lib/types/services/selection/const.d.ts +3 -0
  15. package/lib/types/services/selection/mobile-selection-render.service.d.ts +7 -7
  16. package/lib/types/services/selection/mobile-selection-shape.d.ts +9 -4
  17. package/lib/types/services/selection/selection-control.d.ts +44 -22
  18. package/lib/types/services/selection/selection-render-model.d.ts +14 -7
  19. package/lib/types/services/selection/selection-render.service.d.ts +14 -3
  20. package/lib/types/services/selection/selection-shape-extension.d.ts +35 -13
  21. package/lib/types/services/selection/util.d.ts +18 -4
  22. package/lib/types/services/sheet-skeleton-manager.service.d.ts +0 -1
  23. package/lib/types/services/utils/doc-skeleton-util.d.ts +2 -2
  24. package/lib/types/services/utils/selection-util.d.ts +1 -1
  25. package/lib/types/views/permission/extensions/range-protection.render.d.ts +1 -1
  26. package/lib/types/views/permission/extensions/worksheet-permission.render.d.ts +1 -1
  27. package/lib/umd/facade.js +1 -1
  28. package/lib/umd/index.js +13 -13
  29. package/package.json +16 -17
@@ -1,4 +1,9 @@
1
- import { IRangeWithCoord, ISelectionCellWithMergeInfo, ISelectionWithCoord, Nullable, RANGE_TYPE } from '@univerjs/core';
1
+ import { ICellWithCoord, IRangeWithCoord, Nullable, RANGE_TYPE } from '@univerjs/core';
2
+ import { ISelectionWithCoord } from '@univerjs/sheets';
3
+ /**
4
+ * Data model for SelectionControl.model
5
+ * NOT Same as @univerjs/sheet.WorkbookSelectionModel, that's data model for Workbook
6
+ */
2
7
  export declare class SelectionRenderModel implements IRangeWithCoord {
3
8
  private _startColumn;
4
9
  private _startRow;
@@ -13,6 +18,7 @@ export declare class SelectionRenderModel implements IRangeWithCoord {
13
18
  */
14
19
  private _primary;
15
20
  private _rangeType;
21
+ constructor();
16
22
  get startColumn(): number;
17
23
  get startRow(): number;
18
24
  get endColumn(): number;
@@ -21,7 +27,7 @@ export declare class SelectionRenderModel implements IRangeWithCoord {
21
27
  get startY(): number;
22
28
  get endX(): number;
23
29
  get endY(): number;
24
- get currentCell(): Nullable<ISelectionCellWithMergeInfo>;
30
+ get currentCell(): Nullable<ICellWithCoord>;
25
31
  get rangeType(): RANGE_TYPE;
26
32
  /**
27
33
  * @deprecated, Duplicate with `Rectangle`
@@ -31,19 +37,20 @@ export declare class SelectionRenderModel implements IRangeWithCoord {
31
37
  * @deprecated, Duplicate with `Rectangle`
32
38
  */
33
39
  isInclude(rangeWithCoord: IRangeWithCoord): boolean;
34
- highlightToSelection(): IRangeWithCoord | undefined;
40
+ highlightToSelection(): Nullable<IRangeWithCoord>;
35
41
  getRange(): IRangeWithCoord;
36
- getCell(): Nullable<ISelectionCellWithMergeInfo>;
42
+ getCell(): Nullable<ICellWithCoord>;
37
43
  getRangeType(): RANGE_TYPE;
38
44
  setRangeType(rangeType: RANGE_TYPE): void;
39
45
  getValue(): ISelectionWithCoord;
40
- setValue(newSelectionRange: IRangeWithCoord, currentCell: Nullable<ISelectionCellWithMergeInfo>): void;
46
+ setValue(newSelectionRange: IRangeWithCoord, currentCell: Nullable<ICellWithCoord>): void;
41
47
  /**
42
48
  * Set primary cell.
43
49
  *
44
- * TODO @lumixraku there are 3 concepts for same thing, primary and current and highlight, primary is better cuz selectionModel is using primary.
50
+ * @TODO lumixraku there are 3 concepts for same thing, primary and current and highlight
51
+ * highlight is best. primary sometimes means the actual cell(actual means ignore merge)
45
52
  * @param currentCell
46
53
  */
47
- setCurrentCell(currentCell: Nullable<ISelectionCellWithMergeInfo>): void;
54
+ setCurrentCell(currentCell: Nullable<ICellWithCoord>): void;
48
55
  clearCurrentCell(): void;
49
56
  }
@@ -1,5 +1,5 @@
1
- import { Workbook, ICommandService, IContextService, ILogService, Injector, ThemeService } from '@univerjs/core';
2
- import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
1
+ import { Nullable, Workbook, ICommandService, IContextService, ILogService, Injector, RANGE_TYPE, ThemeService } from '@univerjs/core';
2
+ import { IMouseEvent, IPointerEvent, IRenderContext, IRenderModule, Viewport, ScrollTimerType } from '@univerjs/engine-render';
3
3
  import { SheetsSelectionsService } from '@univerjs/sheets';
4
4
  import { IShortcutService } from '@univerjs/ui';
5
5
  import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
@@ -23,7 +23,7 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
23
23
  private _initSelectionChangeListener;
24
24
  private _initUserActionSyncListener;
25
25
  /**
26
- * Update selectionData to current sheet.
26
+ * Update selectionData to selectionDataModel (WorkBookSelections) by SetSelectionsOperation.
27
27
  * @param selectionDataWithStyleList
28
28
  * @param type
29
29
  */
@@ -31,4 +31,15 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
31
31
  private _initSkeletonChangeListener;
32
32
  private _getActiveViewport;
33
33
  private _getSheetObject;
34
+ /**
35
+ * Handle pointer down event, bind pointermove & pointerup handler.
36
+ * then trigger selectionMoveStart$.
37
+ *
38
+ * @param evt
39
+ * @param _zIndex
40
+ * @param rangeType
41
+ * @param viewport
42
+ * @param scrollTimerType
43
+ */
44
+ protected _onPointerDown(evt: IPointerEvent | IMouseEvent, _zIndex: number | undefined, rangeType: RANGE_TYPE | undefined, viewport: Nullable<Viewport>, scrollTimerType?: ScrollTimerType): void;
34
45
  }
@@ -5,18 +5,19 @@ export interface ISelectionShapeTargetSelection {
5
5
  originControl: SelectionControl;
6
6
  targetSelection: IRangeWithCoord;
7
7
  }
8
+ export interface ISelectionShapeExtensionOption {
9
+ skeleton: SpreadsheetSkeleton;
10
+ scene: Scene;
11
+ themeService: ThemeService;
12
+ injector: Injector;
13
+ selectionHooks: Record<string, () => void>;
14
+ }
8
15
  /**
9
16
  * for auto-fill (crosshair expand selection range)
10
17
  * drag selection range
11
18
  */
12
19
  export declare class SelectionShapeExtension {
13
20
  private _control;
14
- private _skeleton;
15
- private _scene;
16
- private readonly _themeService;
17
- /** @deprecated injection in extensions should be strictly limited. */
18
- private readonly _injector;
19
- private _selectionHooks;
20
21
  private _startOffsetX;
21
22
  private _startOffsetY;
22
23
  private _relativeSelectionPositionRow;
@@ -25,24 +26,36 @@ export declare class SelectionShapeExtension {
25
26
  private _relativeSelectionColumnLength;
26
27
  private _scenePointerMoveSub;
27
28
  private _scenePointerUpSub;
29
+ /**
30
+ * The shadow selection under cursor when move whole selection control(for moving normal selection)
31
+ */
28
32
  private _helperSelection;
29
33
  private _scrollTimer;
30
34
  private _activeViewport;
31
35
  private _targetSelection;
32
36
  private _isInMergeState;
33
37
  private _fillControlColors;
34
- constructor(_control: SelectionControl, _skeleton: SpreadsheetSkeleton, _scene: Scene, _themeService: ThemeService,
35
- /** @deprecated injection in extensions should be strictly limited. */
36
- _injector: Injector, _selectionHooks: Record<string, () => void>);
38
+ private _skeleton;
39
+ private _scene;
40
+ private readonly _themeService;
41
+ private readonly _injector;
42
+ private _selectionHooks;
43
+ constructor(_control: SelectionControl, options: ISelectionShapeExtensionOption);
37
44
  get isHelperSelection(): boolean;
38
45
  dispose(): void;
39
46
  private _getFreeze;
40
47
  private _isSelectionInViewport;
41
48
  private _clearObserverEvent;
42
49
  private _initialControl;
50
+ /**
51
+ * Move the whole selection control after cursor turn into move state.
52
+ * NOT same as widgetMoving, that's for 8 control points.
53
+ * @param moveOffsetX
54
+ * @param moveOffsetY
55
+ */
43
56
  private _controlMoving;
44
57
  /**
45
- * Drag move whole selectionControl when cusor turns to crosshair. Not for dragging 8 control points.
58
+ * Drag move whole selectionControl when cursor turns to crosshair. Not for dragging 8 control points.
46
59
  * @param evt
47
60
  */
48
61
  private _controlEvent;
@@ -60,10 +73,19 @@ export declare class SelectionShapeExtension {
60
73
  * @param cursor
61
74
  */
62
75
  private _widgetMoving;
63
- private _initialFill;
64
- private _fillMoving;
65
- private _fillEvent;
76
+ private _initialAutoFill;
77
+ private _autoFillMoving;
78
+ private _autoFillForPointerdown;
66
79
  private _hasMergeInRange;
80
+ /**
81
+ * Make sure startRow < endRow and startColumn < endColumn
82
+ *
83
+ * @param startRow
84
+ * @param startColumn
85
+ * @param endRow
86
+ * @param endColumn
87
+ * @returns {IRange} range
88
+ */
67
89
  private _swapPositions;
68
90
  private _controlHandler;
69
91
  private _fillRuler;
@@ -1,5 +1,19 @@
1
- import { ISelectionCell, ISelectionCellWithMergeInfo } from '@univerjs/core';
1
+ import { ICellWithCoord, IRange, IRangeWithCoord, ISelectionCell } from '@univerjs/core';
2
2
  import { SpreadsheetSkeleton } from '@univerjs/engine-render';
3
- import { ISelectionWithCoordAndStyle, ISelectionWithStyle } from '@univerjs/sheets';
4
- export declare function attachSelectionWithCoord(selection: ISelectionWithStyle, skeleton: SpreadsheetSkeleton): ISelectionWithCoordAndStyle;
5
- export declare function attachPrimaryWithCoord(primary: ISelectionCell, skeleton: SpreadsheetSkeleton): ISelectionCellWithMergeInfo;
3
+ import { ISelectionWithCoord, ISelectionWithStyle } from '@univerjs/sheets';
4
+ /**
5
+ * Add startXY endXY to range, XY are no merge cell position.
6
+ * @param skeleton
7
+ * @param range
8
+ * @returns {IRangeWithCoord}
9
+ */
10
+ export declare function attachRangeWithCoord(skeleton: SpreadsheetSkeleton, range: IRange): IRangeWithCoord;
11
+ /**
12
+ * Return selection with coord and style from selection, which has range & primary & style.
13
+ * coord are no merge cell position.
14
+ * @param selection
15
+ * @param skeleton
16
+ * @returns {ISelectionWithCoord} selection with coord and style
17
+ */
18
+ export declare function attachSelectionWithCoord(selection: ISelectionWithStyle, skeleton: SpreadsheetSkeleton): ISelectionWithCoord;
19
+ export declare function attachPrimaryWithCoord(skeleton: SpreadsheetSkeleton, primary: ISelectionCell): ICellWithCoord;
@@ -59,4 +59,3 @@ export declare class SheetSkeletonManagerService extends Disposable implements I
59
59
  private _getSkeleton;
60
60
  private _buildSkeleton;
61
61
  }
62
- export declare function attachRangeWithCoord(skeleton: SpreadsheetSkeleton, range: IRange): IRangeWithCoord;
@@ -1,4 +1,4 @@
1
- import { ICustomRange, Injector, IParagraph, ISelectionCellWithMergeInfo } from '@univerjs/core';
1
+ import { ICellWithCoord, ICustomRange, Injector, IParagraph } from '@univerjs/core';
2
2
  import { DocumentSkeleton, IFontCacheItem } from '@univerjs/engine-render';
3
3
  export declare const calculateDocSkeletonRects: (docSkeleton: DocumentSkeleton, paddingLeft?: number, paddingTop?: number) => {
4
4
  links: {
@@ -22,7 +22,7 @@ export declare const calculateDocSkeletonRects: (docSkeleton: DocumentSkeleton,
22
22
  paragraph: IParagraph;
23
23
  }[];
24
24
  };
25
- export declare function calcPadding(cell: ISelectionCellWithMergeInfo, font: IFontCacheItem): {
25
+ export declare function calcPadding(cell: ICellWithCoord, font: IFontCacheItem): {
26
26
  paddingLeft: number;
27
27
  paddingTop: number;
28
28
  };
@@ -1,3 +1,3 @@
1
1
  import { ThemeService } from '@univerjs/core';
2
2
  import { ISelectionStyle } from '@univerjs/sheets';
3
- export declare function createCopyPasteSelectionStyle(themeService: ThemeService): ISelectionStyle;
3
+ export declare function createCopyPasteSelectionStyle(themeService: ThemeService): Partial<ISelectionStyle>;
@@ -1,5 +1,5 @@
1
- import { SheetExtension, SpreadsheetSkeleton, UniverRenderingContext } from '@univerjs/engine-render';
2
1
  import { ICellDataForSheetInterceptor, IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
3
  import { ICellPermission } from '@univerjs/sheets';
4
4
  export declare const RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY";
5
5
  export declare const RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY";
@@ -1,5 +1,5 @@
1
- import { SheetExtension, SpreadsheetSkeleton, UniverRenderingContext } from '@univerjs/engine-render';
2
1
  import { IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
3
  export declare const worksheetProtectionKey = "worksheet-protection";
4
4
  export declare class WorksheetProtectionRenderExtension extends SheetExtension {
5
5
  uKey: string;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/sheets/facade"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/sheets/facade","@univerjs/ui"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsUiFacade={},s.UniverCore,s.UniverEngineRender,s.UniverSheetsUi,s.UniverSheetsFacade,s.UniverUi))})(this,function(s,o,u,a,h,g){"use strict";class S extends o.FUniver{customizeColumnHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.COLUMN).setCustomHeader(e)}customizeRowHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}registerSheetRowHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.ROW),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetColumnHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.COLUMN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetMainExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.MAIN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}_getSheetRenderComponent(e,t){const n=this._injector.get(u.IRenderManagerService).getRenderById(e);if(!n)throw new Error("Render not found");const{components:i}=n,d=i.get(t);if(!d)throw new Error("Render component not found");return d}}o.FUniver.extend(S);class v extends h.FWorkbook{openSiderbar(e){return this._logDeprecation("openSiderbar"),this._injector.get(g.ISidebarService).open(e)}openDialog(e){this._logDeprecation("openDialog");const r=this._injector.get(g.IDialogService).open({...e,onClose:()=>{r.dispose()}});return r}_logDeprecation(e){this._injector.get(o.ILogService).warn("[FWorkbook]",`${e} is deprecated. Please use the function of the same name on "FUniver".`)}}h.FWorkbook.extend(v);class _ extends h.FPermission{setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}}h.FPermission.extend(_);class m extends h.FRange{getCell(){const e=this._injector.get(u.IRenderManagerService),t=this._workbook.getUnitId(),r=this._worksheet.getSheetId();return e.getRenderById(t).with(a.SheetSkeletonManagerService).getWorksheetSkeleton(r).skeleton.getCellByIndex(this._range.startRow,this._range.startColumn)}getCellRect(){const{startX:e,startY:t,endX:r,endY:n}=this.getCell(),i={x:e,y:t,width:r-e,height:n-t,top:t,left:e,bottom:n,right:r};return{...i,toJSON:()=>JSON.stringify(i)}}generateHTML(){var t;const e=this._injector.get(a.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(),this._worksheet.getSheetId(),this._range);return(t=e==null?void 0:e.html)!=null?t:""}attachPopup(e){const{key:t,disposableCollection:r}=p(e,this._injector.get(g.ComponentManager)),i=this._injector.get(a.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow,this._range.startColumn,{...e,componentKey:t},this.getUnitId(),this._worksheet.getSheetId());return i?(r.add(i),r):(r.dispose(),null)}attachAlertPopup(e){const t=this._injector.get(a.CellAlertManagerService),r={workbook:this._workbook,worksheet:this._worksheet,row:this._range.startRow,col:this._range.startColumn,unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId()};return t.showAlert({...e,location:r}),{dispose:()=>{t.removeAlert(e.key)}}}}h.FRange.extend(m);function p(c,e){const{componentKey:t,isVue3:r}=c;let n;const i=new o.DisposableCollection;return typeof t=="string"?n=t:(n=`External_${o.generateRandomId(6)}`,i.add(e.register(n,t,{framework:r?"vue3":"react"}))),{key:n,disposableCollection:i}}var C=Object.defineProperty,k=Object.getOwnPropertyDescriptor,I=(c,e,t,r)=>{for(var n=r>1?void 0:r?k(e,t):e,i=c.length-1,d;i>=0;i--)(d=c[i])&&(n=(r?d(e,t,n):d(n))||n);return r&&n&&C(e,t,n),n},l=(c,e)=>(t,r)=>e(t,r,c);s.FSheetHooks=class{constructor(e,t,r){this._injector=e,this._hoverManagerService=t,this._dragManagerService=r}onCellPointerMove(e){return o.toDisposable(this._hoverManagerService.currentPosition$.subscribe(e))}onCellPointerOver(e){return o.toDisposable(this._hoverManagerService.currentCell$.subscribe(e))}onCellDragOver(e){return o.toDisposable(this._dragManagerService.currentCell$.subscribe(e))}onCellDrop(e){return o.toDisposable(this._dragManagerService.endCell$.subscribe(e))}},s.FSheetHooks=I([l(0,o.Inject(o.Injector)),l(1,o.Inject(a.HoverManagerService)),l(2,o.Inject(a.DragManagerService))],s.FSheetHooks),s.transformComponentKey=p,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
1
+ (function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/sheets/facade"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/sheets/facade","@univerjs/ui"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsUiFacade={},s.UniverCore,s.UniverEngineRender,s.UniverSheetsUi,s.UniverSheetsFacade,s.UniverUi))})(this,function(s,o,u,a,h,g){"use strict";class S extends o.FUniver{customizeColumnHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.COLUMN).setCustomHeader(e)}customizeRowHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}registerSheetRowHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.ROW),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetColumnHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.COLUMN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetMainExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.MAIN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}_getSheetRenderComponent(e,t){const n=this._injector.get(u.IRenderManagerService).getRenderById(e);if(!n)throw new Error("Render not found");const{components:i}=n,d=i.get(t);if(!d)throw new Error("Render component not found");return d}}o.FUniver.extend(S);class v extends h.FWorkbook{openSiderbar(e){return this._logDeprecation("openSiderbar"),this._injector.get(g.ISidebarService).open(e)}openDialog(e){this._logDeprecation("openDialog");const r=this._injector.get(g.IDialogService).open({...e,onClose:()=>{r.dispose()}});return r}_logDeprecation(e){this._injector.get(o.ILogService).warn("[FWorkbook]",`${e} is deprecated. Please use the function of the same name on "FUniver".`)}}h.FWorkbook.extend(v);class _ extends h.FPermission{setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}}h.FPermission.extend(_);class m extends h.FRange{getCell(){const e=this._injector.get(u.IRenderManagerService),t=this._workbook.getUnitId(),r=this._worksheet.getSheetId();return e.getRenderById(t).with(a.SheetSkeletonManagerService).getWorksheetSkeleton(r).skeleton.getCellWithCoordByIndex(this._range.startRow,this._range.startColumn)}getCellRect(){const{startX:e,startY:t,endX:r,endY:n}=this.getCell(),i={x:e,y:t,width:r-e,height:n-t,top:t,left:e,bottom:n,right:r};return{...i,toJSON:()=>JSON.stringify(i)}}generateHTML(){var t;const e=this._injector.get(a.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(),this._worksheet.getSheetId(),this._range);return(t=e==null?void 0:e.html)!=null?t:""}attachPopup(e){const{key:t,disposableCollection:r}=p(e,this._injector.get(g.ComponentManager)),i=this._injector.get(a.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow,this._range.startColumn,{...e,componentKey:t},this.getUnitId(),this._worksheet.getSheetId());return i?(r.add(i),r):(r.dispose(),null)}attachAlertPopup(e){const t=this._injector.get(a.CellAlertManagerService),r={workbook:this._workbook,worksheet:this._worksheet,row:this._range.startRow,col:this._range.startColumn,unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId()};return t.showAlert({...e,location:r}),{dispose:()=>{t.removeAlert(e.key)}}}}h.FRange.extend(m);function p(c,e){const{componentKey:t,isVue3:r}=c;let n;const i=new o.DisposableCollection;return typeof t=="string"?n=t:(n=`External_${o.generateRandomId(6)}`,i.add(e.register(n,t,{framework:r?"vue3":"react"}))),{key:n,disposableCollection:i}}var C=Object.defineProperty,k=Object.getOwnPropertyDescriptor,I=(c,e,t,r)=>{for(var n=r>1?void 0:r?k(e,t):e,i=c.length-1,d;i>=0;i--)(d=c[i])&&(n=(r?d(e,t,n):d(n))||n);return r&&n&&C(e,t,n),n},l=(c,e)=>(t,r)=>e(t,r,c);s.FSheetHooks=class{constructor(e,t,r){this._injector=e,this._hoverManagerService=t,this._dragManagerService=r}onCellPointerMove(e){return o.toDisposable(this._hoverManagerService.currentPosition$.subscribe(e))}onCellPointerOver(e){return o.toDisposable(this._hoverManagerService.currentCell$.subscribe(e))}onCellDragOver(e){return o.toDisposable(this._dragManagerService.currentCell$.subscribe(e))}onCellDrop(e){return o.toDisposable(this._dragManagerService.endCell$.subscribe(e))}},s.FSheetHooks=I([l(0,o.Inject(o.Injector)),l(1,o.Inject(a.HoverManagerService)),l(2,o.Inject(a.DragManagerService))],s.FSheetHooks),s.transformComponentKey=p,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});