@univerjs/sheets-ui 0.2.8 → 0.2.10

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 (34) hide show
  1. package/lib/cjs/index.js +10 -9
  2. package/lib/es/index.js +1082 -853
  3. package/lib/index.css +1 -1
  4. package/lib/types/{basics/const → consts}/ui-name.d.ts +2 -1
  5. package/lib/types/controllers/editor/editing.render-controller.d.ts +2 -1
  6. package/lib/types/controllers/menu/menu.d.ts +2 -1
  7. package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +4 -2
  8. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +3 -7
  9. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -0
  10. package/lib/types/controllers/sheet-ui.controller.d.ts +1 -0
  11. package/lib/types/index.d.ts +5 -1
  12. package/lib/types/services/canvas-pop-manager.service.d.ts +1 -1
  13. package/lib/types/services/format-painter/format-painter.service.d.ts +11 -2
  14. package/lib/types/services/mark-selection/mark-selection.service.d.ts +3 -0
  15. package/lib/types/services/permission/sheet-permission-panel.model.d.ts +9 -0
  16. package/lib/types/services/permission/sheet-permission-user-list.service.d.ts +1 -0
  17. package/lib/types/services/select-all/select-all.service.d.ts +5 -0
  18. package/lib/types/services/selection/base-selection-render.service.d.ts +44 -43
  19. package/lib/types/services/selection/const.d.ts +4 -0
  20. package/lib/types/services/selection/mobile-selection-render.service.d.ts +3 -4
  21. package/lib/types/services/selection/mobile-selection-shape.d.ts +3 -3
  22. package/lib/types/services/selection/selection-render-model.d.ts +7 -3
  23. package/lib/types/services/selection/selection-render.service.d.ts +3 -6
  24. package/lib/types/services/selection/selection-shape-extension.d.ts +13 -3
  25. package/lib/types/services/selection/selection-shape.d.ts +48 -42
  26. package/lib/types/sheets-ui-plugin.d.ts +1 -0
  27. package/lib/types/views/permission/panel/index.d.ts +1 -1
  28. package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +1 -1
  29. package/lib/umd/index.js +10 -9
  30. package/package.json +20 -20
  31. package/lib/types/basics/const/index.d.ts +0 -17
  32. package/lib/types/basics/index.d.ts +0 -16
  33. /package/lib/types/{basics/const → consts}/permission.d.ts +0 -0
  34. /package/lib/types/{basics/const → consts}/plugin-name.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { Workbook, ICommandService, IContextService, ILogService, Injector, ThemeService } from '@univerjs/core';
2
- import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
2
+ import { IRenderContext, IRenderModule } 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';
@@ -10,14 +10,12 @@ import { BaseSelectionRenderService } from './base-selection-render.service';
10
10
  */
11
11
  export declare class SheetSelectionRenderService extends BaseSelectionRenderService implements IRenderModule {
12
12
  private readonly _context;
13
- private readonly _selectionManagerService;
14
13
  private readonly _logService;
15
14
  private readonly _commandService;
16
15
  private readonly _contextService;
17
- private readonly _sheetSkeletonManagerService;
18
16
  private readonly _workbookSelections;
19
17
  private _renderDisposable;
20
- constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, renderManagerService: IRenderManagerService, _selectionManagerService: SheetsSelectionsService, _logService: ILogService, _commandService: ICommandService, _contextService: IContextService, _sheetSkeletonManagerService: SheetSkeletonManagerService);
18
+ constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, selectionManagerService: SheetsSelectionsService, sheetSkeletonManagerService: SheetSkeletonManagerService, _logService: ILogService, _commandService: ICommandService, _contextService: IContextService);
21
19
  private _init;
22
20
  private _initEventListeners;
23
21
  private _initThemeChangeListener;
@@ -25,8 +23,7 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
25
23
  private _initSelectionChangeListener;
26
24
  private _initUserActionSyncListener;
27
25
  /**
28
- * set new selection range in seletion model
29
- * selectionMoveEnd$ ---> _updateSelections --> selectionOperation@selectionManagerService.setSelections
26
+ * Update selectionData to current sheet.
30
27
  * @param selectionDataWithStyleList
31
28
  * @param type
32
29
  */
@@ -41,15 +41,25 @@ export declare class SelectionShapeExtension {
41
41
  private _clearObserverEvent;
42
42
  private _initialControl;
43
43
  private _controlMoving;
44
+ /**
45
+ * Drag move whole selectionControl when cusor turns to crosshair. Not for dragging 8 control points.
46
+ * @param evt
47
+ */
44
48
  private _controlEvent;
45
49
  private _initialWidget;
46
- private _widgetMoving;
47
50
  /**
48
- * Events for 8 control point
51
+ * Pointer down Events for 8 control point.
49
52
  * @param evt
50
53
  * @param cursor
51
54
  */
52
- private _widgetEvent;
55
+ private _widgetPointerDownEvent;
56
+ /**
57
+ * Pointer move Events for 8 control point.
58
+ * @param moveOffsetX
59
+ * @param moveOffsetY
60
+ * @param cursor
61
+ */
62
+ private _widgetMoving;
53
63
  private _initialFill;
54
64
  private _fillMoving;
55
65
  private _fillEvent;
@@ -1,5 +1,5 @@
1
1
  import { IRangeWithCoord, ISelectionCellWithMergeInfo, Nullable, ThemeService, Disposable } from '@univerjs/core';
2
- import { IRectProps, Scene, Group, Rect } from '@univerjs/engine-render';
2
+ import { Scene, Group, Rect } from '@univerjs/engine-render';
3
3
  import { ISelectionStyle, ISelectionWidgetConfig, ISelectionWithCoordAndStyle } from '@univerjs/sheets';
4
4
  import { Subject } from 'rxjs';
5
5
  import { SelectionRenderModel } from './selection-render-model';
@@ -38,13 +38,13 @@ export declare enum SELECTION_MANAGER_KEY {
38
38
  bottomRightWidget = "__SpreadSheetSelectionBottomRightWidget__"
39
39
  }
40
40
  /**
41
- * The main selection canvas component
41
+ * The main selection canvas component, includes leftControl,rightControl,topControl,bottomControl,backgroundControlTop,backgroundControlMiddleLeft,backgroundControlMiddleRight,backgroundControlBottom,fillControl
42
42
  */
43
43
  export declare class SelectionControl extends Disposable {
44
44
  protected _scene: Scene;
45
45
  protected _zIndex: number;
46
- protected _isHeaderHighlight: boolean;
47
46
  protected readonly _themeService: ThemeService;
47
+ protected _highlightHeader: boolean;
48
48
  private _leftControl;
49
49
  private _rightControl;
50
50
  private _topControl;
@@ -58,11 +58,9 @@ export declare class SelectionControl extends Disposable {
58
58
  private _rowHeaderBackground;
59
59
  private _rowHeaderBorder;
60
60
  private _rowHeaderGroup;
61
- private _rowHeaderHighlight;
62
61
  private _columnHeaderBackground;
63
62
  private _columnHeaderBorder;
64
63
  private _columnHeaderGroup;
65
- private _columnHeaderHighlight;
66
64
  private _topLeftWidget;
67
65
  private _topCenterWidget;
68
66
  private _topRightWidget;
@@ -73,12 +71,17 @@ export declare class SelectionControl extends Disposable {
73
71
  private _bottomRightWidget;
74
72
  private _dashRect;
75
73
  protected _selectionModel: SelectionRenderModel;
76
- protected _selectionStyle: Nullable<ISelectionStyle>;
74
+ private _defaultStyle;
75
+ private _currentStyle;
77
76
  protected _rowHeaderWidth: number;
78
77
  protected _columnHeaderHeight: number;
79
78
  protected _widgetRects: Rect[];
80
79
  private _dispose$;
81
80
  readonly dispose$: import('rxjs').Observable<SelectionControl>;
81
+ /**
82
+ * eventSource: selectionShapeExtension selectionMoving$.next,
83
+ * Observer: prompt.controller
84
+ */
82
85
  readonly selectionMoving$: Subject<IRangeWithCoord>;
83
86
  readonly selectionMoved$: Subject<IRangeWithCoord>;
84
87
  readonly selectionScaling$: Subject<IRangeWithCoord>;
@@ -86,41 +89,40 @@ export declare class SelectionControl extends Disposable {
86
89
  readonly selectionFilling$: Subject<Nullable<IRangeWithCoord>>;
87
90
  private readonly _selectionFilled$;
88
91
  readonly selectionFilled$: import('rxjs').Observable<Nullable<IRangeWithCoord>>;
89
- private _defaultStyle;
90
- private _currentStyle;
91
92
  private _isHelperSelection;
92
- constructor(_scene: Scene, _zIndex: number, _isHeaderHighlight: boolean, _themeService: ThemeService);
93
+ constructor(_scene: Scene, _zIndex: number, _themeService: ThemeService, _highlightHeader?: boolean, options?: {
94
+ rowHeaderWidth: number;
95
+ columnHeaderHeight: number;
96
+ });
93
97
  get zIndex(): number;
94
- get leftControl(): Rect<IRectProps>;
95
- get rightControl(): Rect<IRectProps>;
96
- get topControl(): Rect<IRectProps>;
97
- get bottomControl(): Rect<IRectProps>;
98
- get fillControl(): Rect<IRectProps>;
99
- get backgroundControlTop(): Rect<IRectProps>;
100
- get backgroundControlBottom(): Rect<IRectProps>;
101
- get backgroundControlMiddleLeft(): Rect<IRectProps>;
102
- get backgroundControlMiddleRight(): Rect<IRectProps>;
98
+ get leftControl(): Rect;
99
+ get rightControl(): Rect;
100
+ get topControl(): Rect;
101
+ get bottomControl(): Rect;
102
+ get fillControl(): Rect;
103
+ get backgroundControlTop(): Rect;
104
+ get backgroundControlBottom(): Rect;
105
+ get backgroundControlMiddleLeft(): Rect;
106
+ get backgroundControlMiddleRight(): Rect;
103
107
  get selectionShape(): Group;
104
108
  get columnHeaderGroup(): Group;
105
109
  get rowHeaderGroup(): Group;
106
110
  get selectionShapeGroup(): Group;
107
111
  get model(): SelectionRenderModel;
108
- get topLeftWidget(): Rect<IRectProps>;
109
- get topCenterWidget(): Rect<IRectProps>;
110
- get topRightWidget(): Rect<IRectProps>;
111
- get middleLeftWidget(): Rect<IRectProps>;
112
- get middleRightWidget(): Rect<IRectProps>;
113
- get bottomLeftWidget(): Rect<IRectProps>;
114
- get bottomCenterWidget(): Rect<IRectProps>;
115
- get bottomRightWidget(): Rect<IRectProps>;
112
+ get topLeftWidget(): Rect;
113
+ get topCenterWidget(): Rect;
114
+ get topRightWidget(): Rect;
115
+ get middleLeftWidget(): Rect;
116
+ get middleRightWidget(): Rect;
117
+ get bottomLeftWidget(): Rect;
118
+ get bottomCenterWidget(): Rect;
119
+ get bottomRightWidget(): Rect;
116
120
  get themeService(): ThemeService;
117
- get selectionStyle(): Nullable<ISelectionStyle>;
118
- set selectionStyle(style: Nullable<ISelectionStyle>);
119
121
  get selectionModel(): SelectionRenderModel;
120
122
  set selectionModel(model: SelectionRenderModel);
121
123
  get defaultStyle(): ISelectionStyle;
122
124
  set defaultStyle(style: ISelectionStyle);
123
- get dashRect(): Rect<IRectProps>;
125
+ get dashRect(): Rect;
124
126
  get currentStyle(): Nullable<ISelectionStyle>;
125
127
  set currentStyle(style: Nullable<ISelectionStyle>);
126
128
  get isHelperSelection(): boolean;
@@ -130,18 +132,27 @@ export declare class SelectionControl extends Disposable {
130
132
  set columnHeaderHeight(height: number);
131
133
  setEvent(state: boolean): void;
132
134
  refreshSelectionFilled(val: IRangeWithCoord): void;
135
+ /**
136
+ * invoked when update selection style & range change, invoked by updateStyle, updateRange, update
137
+ */
138
+ protected _updateControlStyleAndLayout(selectionStyle: Nullable<ISelectionStyle>): void;
133
139
  updateStyle(style: ISelectionStyle): void;
134
- updateRange(range: IRangeWithCoord): void;
140
+ updateRange(range: IRangeWithCoord, primaryCell: Nullable<ISelectionCellWithMergeInfo>): void;
135
141
  /**
136
- * update seleciton model(new range)
137
- * @param newSelectionRange update new selection range!!
142
+ * update selection model with new range & primary cell(aka: highlight/current), also update row/col selection size & style.
143
+ *
144
+ * @param newSelectionRange
138
145
  * @param rowHeaderWidth
139
146
  * @param columnHeaderHeight
140
147
  * @param style
141
- * @param highlight
148
+ * @param primaryCell primary cell
149
+ */
150
+ update(newSelectionRange: IRangeWithCoord, rowHeaderWidth?: number, columnHeaderHeight?: number, style?: Nullable<ISelectionStyle>, primaryCell?: Nullable<ISelectionCellWithMergeInfo>): void;
151
+ /**
152
+ * update primary range
153
+ * @param primaryCell model.current (aka: highlight)
142
154
  */
143
- update(newSelectionRange: IRangeWithCoord, rowHeaderWidth?: number, columnHeaderHeight?: number, style?: Nullable<ISelectionStyle>, highlight?: Nullable<ISelectionCellWithMergeInfo>): void;
144
- updateCurrCell(highlight?: Nullable<ISelectionCellWithMergeInfo>): void;
155
+ updateCurrCell(primaryCell?: Nullable<ISelectionCellWithMergeInfo>): void;
145
156
  clearHighlight(): void;
146
157
  getScene(): Scene;
147
158
  dispose(): void;
@@ -153,15 +164,10 @@ export declare class SelectionControl extends Disposable {
153
164
  getRange(): IRangeWithCoord;
154
165
  enableHelperSelection(): void;
155
166
  disableHelperSelection(): void;
156
- updateStyleId(id: string): void;
157
- /**
158
- * invoked when update selection style & range change
159
- */
160
- protected _updateControl(style: Nullable<ISelectionStyle>, rowHeaderWidth: number, columnHeaderHeight: number): void;
161
167
  private _initialize;
162
- private _initialTitle;
168
+ private _initialHeader;
163
169
  private _initialWidget;
164
- private _updateBackgroundTitle;
170
+ private _updateHeaderBackground;
165
171
  private _updateBackgroundControl;
166
172
  private _updateWidgets;
167
173
  protected _hasWidgets(widgets: ISelectionWidgetConfig): boolean;
@@ -8,6 +8,7 @@ export declare class UniverSheetsUIPlugin extends Plugin {
8
8
  private readonly _univerInstanceService;
9
9
  static pluginName: string;
10
10
  static type: UniverInstanceType;
11
+ /** @ignore */
11
12
  constructor(_config: Partial<IUniverSheetsUIConfig>, _injector: Injector, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
12
13
  onStarting(): void;
13
14
  onReady(): void;
@@ -3,5 +3,5 @@ interface ISheetPermissionPanelProps {
3
3
  showDetail: boolean;
4
4
  fromSheetBar: boolean;
5
5
  }
6
- export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar }: ISheetPermissionPanelProps) => React.JSX.Element;
6
+ export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar }: ISheetPermissionPanelProps) => React.JSX.Element | null;
7
7
  export {};
@@ -12,5 +12,5 @@ interface FunctionNameMap {
12
12
  [key: string]: string;
13
13
  }
14
14
  export declare const CopyableStatisticItem: React.FC<IStatisticItem>;
15
- export declare function formatNumber(item: IStatisticItem): any;
15
+ export declare function formatNumber(item: IStatisticItem): string | 0;
16
16
  export {};