@univerjs/sheets-ui 0.2.5 → 0.2.6
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/index.js +15 -15
- package/lib/es/index.js +14718 -14424
- package/lib/types/commands/commands/utils/selection-utils.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/mobile-sheets-ui-plugin.d.ts +1 -1
- package/lib/types/services/selection/base-selection-render.service.d.ts +14 -1
- package/lib/types/services/selection/selection-render.service.d.ts +8 -2
- package/lib/types/services/selection/selection-shape-extension.d.ts +7 -1
- package/lib/types/sheets-ui-plugin.d.ts +1 -1
- package/lib/umd/index.js +15 -15
- package/package.json +23 -23
|
@@ -30,7 +30,6 @@ export declare function shrinkToNextGapRange(startRange: IRange, anchorRange: IR
|
|
|
30
30
|
* @param worksheet
|
|
31
31
|
*/
|
|
32
32
|
export declare function shrinkToNextCell(startRange: IRange, direction: Direction, worksheet: Worksheet): IRange;
|
|
33
|
-
export declare function expandToContinuousRange(startRange: IRange, directions: IExpandParams, worksheet: Worksheet): IRange;
|
|
34
33
|
export declare function expandToWholeSheet(worksheet: Worksheet): IRange;
|
|
35
34
|
export declare function getStartRange(range: IRange, primary: Nullable<ISelectionCell>, direction: Direction): IRange;
|
|
36
35
|
export declare function checkIfShrink(selection: ISelection, direction: Direction, worksheet: Worksheet): boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -76,7 +76,6 @@ export type { IRangeProtectionRenderCellData } from './views/permission/extensio
|
|
|
76
76
|
export { SheetPrintInterceptorService } from './services/print-interceptor.service';
|
|
77
77
|
export { UniverSheetsMobileUIPlugin } from './mobile-sheets-ui-plugin';
|
|
78
78
|
export { MobileSheetBar } from './views/mobile/sheet-bar/MobileSheetBar';
|
|
79
|
-
export { expandToContinuousRange } from './commands/commands/utils/selection-utils';
|
|
80
79
|
export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller';
|
|
81
80
|
export { AddWorksheetMergeCommand, AddWorksheetMergeAllCommand, AddWorksheetMergeVerticalCommand, AddWorksheetMergeHorizontalCommand } from './commands/commands/add-worksheet-merge.command';
|
|
82
81
|
export { AutoFillCommand, AutoClearContentCommand } from './commands/commands/auto-fill.command';
|
|
@@ -108,3 +107,4 @@ export { SetZoomRatioOperation } from './commands/operations/set-zoom-ratio.oper
|
|
|
108
107
|
export { SheetPermissionOpenDialogOperation } from './commands/operations/sheet-permission-open-dialog.operation';
|
|
109
108
|
export { SheetPermissionOpenPanelOperation } from './commands/operations/sheet-permission-open-panel.operation';
|
|
110
109
|
export { SidebarDefinedNameOperation } from './commands/operations/sidebar-defined-name.operation';
|
|
110
|
+
export { attachSelectionWithCoord, attachPrimaryWithCoord } from './services/selection/util';
|
|
@@ -13,7 +13,7 @@ export declare class UniverSheetsMobileUIPlugin extends Plugin {
|
|
|
13
13
|
static pluginName: string;
|
|
14
14
|
static type: UniverInstanceType;
|
|
15
15
|
constructor(_config: Partial<IUniverSheetsUIConfig>, _injector: Injector, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
|
|
16
|
-
onStarting(
|
|
16
|
+
onStarting(): void;
|
|
17
17
|
onReady(): void;
|
|
18
18
|
onRendered(): void;
|
|
19
19
|
private _registerRenderBasics;
|
|
@@ -71,6 +71,11 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
71
71
|
protected _skipLastEnabled: boolean;
|
|
72
72
|
protected _singleSelectionEnabled: boolean;
|
|
73
73
|
protected readonly _selectionMoveEnd$: BehaviorSubject<ISelectionWithCoordAndStyle[]>;
|
|
74
|
+
/**
|
|
75
|
+
* trigger when selection move end(pointerup)
|
|
76
|
+
* and then update selection model in selectionManagerService
|
|
77
|
+
* selectionMoveEnd$ ---> _updateSelections --> selectionOperation@selectionManagerService.setSelections
|
|
78
|
+
*/
|
|
74
79
|
readonly selectionMoveEnd$: Observable<ISelectionWithCoordAndStyle[]>;
|
|
75
80
|
protected readonly _selectionMoving$: Subject<ISelectionWithCoordAndStyle[]>;
|
|
76
81
|
readonly selectionMoving$: Observable<ISelectionWithCoordAndStyle[]>;
|
|
@@ -119,11 +124,15 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
119
124
|
* selectionManagerService@_emitOnEnd -->
|
|
120
125
|
* _workbookSelections.selectionMoveEnd$ --> _addSelectionControlBySelectionData
|
|
121
126
|
*
|
|
122
|
-
*
|
|
123
127
|
* @param selectionData
|
|
124
128
|
*/
|
|
125
129
|
protected _addSelectionControlBySelectionData(selection: ISelectionWithCoordAndStyle): void;
|
|
126
130
|
newSelectionControl(scene: Scene, _rangeType: RANGE_TYPE): SelectionControl;
|
|
131
|
+
/**
|
|
132
|
+
* Update the corresponding selectionControl based on selectionsData.
|
|
133
|
+
* selectionData[i] ---- selectionControls[i]
|
|
134
|
+
* @param selections
|
|
135
|
+
*/
|
|
127
136
|
updateControlForCurrentByRangeData(selections: ISelectionWithCoordAndStyle[]): void;
|
|
128
137
|
refreshSelectionMoveStart(): void;
|
|
129
138
|
protected _changeRuntime(skeleton: SpreadsheetSkeleton, scene: Scene, viewport?: Viewport): void;
|
|
@@ -143,6 +152,9 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
143
152
|
*/
|
|
144
153
|
getActiveSelectionControl<T extends SelectionControl = SelectionControl>(): Nullable<T>;
|
|
145
154
|
endSelection(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Clear existed selections.
|
|
157
|
+
*/
|
|
146
158
|
protected _reset(): void;
|
|
147
159
|
resetAndEndSelection(): void;
|
|
148
160
|
/**
|
|
@@ -172,6 +184,7 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
172
184
|
}): Nullable<ISelectionWithCoord>;
|
|
173
185
|
protected _checkClearPreviousControls(evt: IPointerEvent | IMouseEvent): void;
|
|
174
186
|
private _performSelectionByTwoCells;
|
|
187
|
+
protected _refreshSelectionControl(selectionsData: readonly ISelectionWithStyle[]): void;
|
|
175
188
|
}
|
|
176
189
|
export declare function getAllSelection(skeleton: SpreadsheetSkeleton): ISelectionWithStyle;
|
|
177
190
|
export declare function getTopLeftSelection(skeleton: SpreadsheetSkeleton): ISelectionWithStyle;
|
|
@@ -11,20 +11,26 @@ import { BaseSelectionRenderService } from './base-selection-render.service';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class SheetSelectionRenderService extends BaseSelectionRenderService implements IRenderModule {
|
|
13
13
|
private readonly _context;
|
|
14
|
+
private readonly _selectionManagerService;
|
|
14
15
|
private readonly _logService;
|
|
15
16
|
private readonly _commandService;
|
|
16
17
|
private readonly _contextService;
|
|
17
18
|
private readonly _sheetSkeletonManagerService;
|
|
18
19
|
private readonly _workbookSelections;
|
|
19
20
|
private _renderDisposable;
|
|
20
|
-
constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, renderManagerService: IRenderManagerService,
|
|
21
|
+
constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, renderManagerService: IRenderManagerService, _selectionManagerService: SheetsSelectionsService, _logService: ILogService, _commandService: ICommandService, _contextService: IContextService, _sheetSkeletonManagerService: SheetSkeletonManagerService);
|
|
21
22
|
private _init;
|
|
22
23
|
private _initEventListeners;
|
|
23
24
|
private _initThemeChangeListener;
|
|
24
|
-
private _refreshSelection;
|
|
25
25
|
private _normalSelectionDisabled;
|
|
26
26
|
private _initSelectionChangeListener;
|
|
27
27
|
private _initUserActionSyncListener;
|
|
28
|
+
/**
|
|
29
|
+
* set new selection range in seletion model
|
|
30
|
+
* selectionMoveEnd$ ---> _updateSelections --> selectionOperation@selectionManagerService.setSelections
|
|
31
|
+
* @param selectionDataWithStyleList
|
|
32
|
+
* @param type
|
|
33
|
+
*/
|
|
28
34
|
private _updateSelections;
|
|
29
35
|
private _initSkeletonChangeListener;
|
|
30
36
|
private _getActiveViewport;
|
|
@@ -17,6 +17,7 @@ export declare class SelectionShapeExtension {
|
|
|
17
17
|
private readonly _themeService;
|
|
18
18
|
/** @deprecated injection in extensions should be strictly limited. */
|
|
19
19
|
private readonly _injector;
|
|
20
|
+
private _selectionHooks;
|
|
20
21
|
private _startOffsetX;
|
|
21
22
|
private _startOffsetY;
|
|
22
23
|
private _relativeSelectionPositionRow;
|
|
@@ -33,7 +34,7 @@ export declare class SelectionShapeExtension {
|
|
|
33
34
|
private _fillControlColors;
|
|
34
35
|
constructor(_control: SelectionControl, _skeleton: SpreadsheetSkeleton, _scene: Scene, _themeService: ThemeService,
|
|
35
36
|
/** @deprecated injection in extensions should be strictly limited. */
|
|
36
|
-
_injector: Injector);
|
|
37
|
+
_injector: Injector, _selectionHooks: Record<string, () => void>);
|
|
37
38
|
get isHelperSelection(): boolean;
|
|
38
39
|
dispose(): void;
|
|
39
40
|
private _getFreeze;
|
|
@@ -44,6 +45,11 @@ export declare class SelectionShapeExtension {
|
|
|
44
45
|
private _controlEvent;
|
|
45
46
|
private _initialWidget;
|
|
46
47
|
private _widgetMoving;
|
|
48
|
+
/**
|
|
49
|
+
* Events for 8 control point
|
|
50
|
+
* @param evt
|
|
51
|
+
* @param cursor
|
|
52
|
+
*/
|
|
47
53
|
private _widgetEvent;
|
|
48
54
|
private _initialFill;
|
|
49
55
|
private _fillMoving;
|
|
@@ -10,7 +10,7 @@ export declare class UniverSheetsUIPlugin extends Plugin {
|
|
|
10
10
|
static pluginName: string;
|
|
11
11
|
static type: UniverInstanceType;
|
|
12
12
|
constructor(_config: Partial<IUniverSheetsUIConfig>, _injector: Injector, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
|
|
13
|
-
onStarting(
|
|
13
|
+
onStarting(): void;
|
|
14
14
|
onReady(): void;
|
|
15
15
|
onRendered(): void;
|
|
16
16
|
private _registerRenderBasics;
|