@univerjs/sheets-ui 0.4.0 → 0.4.1-experimental.20241023-bbb123f

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.
@@ -1,4 +1,7 @@
1
1
  import { IWorkbookData } from '@univerjs/core';
2
+ export declare const SELECTION_WITH_EMPTY_CELLS_DATA: IWorkbookData;
3
+ export declare const SELECTION_WITH_MERGED_CELLS_DATA: IWorkbookData;
4
+ export declare const SIMPLE_SELECTION_WORKBOOK_DATA: IWorkbookData;
2
5
  export declare function createSelectionCommandTestBed(workbookData?: IWorkbookData): {
3
6
  univer: import('@univerjs/core').Univer;
4
7
  get: {
@@ -23,6 +26,3 @@ export declare function createFrozenCommandTestBed(workbookData?: IWorkbookData)
23
26
  };
24
27
  sheet: import('@univerjs/core').Workbook;
25
28
  };
26
- export declare const SELECTION_WITH_EMPTY_CELLS_DATA: IWorkbookData;
27
- export declare const SELECTION_WITH_MERGED_CELLS_DATA: IWorkbookData;
28
- export declare const SIMPLE_SELECTION_WORKBOOK_DATA: IWorkbookData;
@@ -14,3 +14,4 @@ export declare const SetRangeSuperscriptCommand: ICommand;
14
14
  export declare const SetRangeFontSizeCommand: ICommand;
15
15
  export declare const SetRangeFontFamilyCommand: ICommand;
16
16
  export declare const SetRangeTextColorCommand: ICommand;
17
+ export declare const ResetRangeTextColorCommand: ICommand;
@@ -11,14 +11,14 @@ export interface IMoveSelectionCommandParams {
11
11
  jumpOver?: JumpOver;
12
12
  nextStep?: number;
13
13
  }
14
- /**
15
- * Move selection
16
- */
17
- export declare const MoveSelectionCommand: ICommand<IMoveSelectionCommandParams>;
18
14
  export interface IMoveSelectionEnterAndTabCommandParams {
19
15
  direction: Direction;
20
16
  keycode: KeyCode;
21
17
  }
18
+ /**
19
+ * Move selection (Mainly by keyboard arrow keys, Tab and Enter key see MoveSelectionEnterAndTabCommand)
20
+ */
21
+ export declare const MoveSelectionCommand: ICommand<IMoveSelectionCommandParams>;
22
22
  /**
23
23
  * Move selection for enter and tab.
24
24
  */
@@ -22,6 +22,7 @@ export declare class EditingRenderController extends Disposable implements IRend
22
22
  protected readonly _localService: LocaleService;
23
23
  private readonly _editorService;
24
24
  private readonly _sheetCellEditorResizeService;
25
+ private readonly _univerInstanceService;
25
26
  /**
26
27
  * It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
27
28
  */
@@ -31,7 +32,7 @@ export declare class EditingRenderController extends Disposable implements IRend
31
32
  private _workbookSelections;
32
33
  private _d;
33
34
  _cursorTimeout: NodeJS.Timeout;
34
- constructor(_context: IRenderContext<Workbook>, selectionManagerService: SheetsSelectionsService, _undoRedoService: IUndoRedoService, _contextService: IContextService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _cellEditorManagerService: ICellEditorManagerService, _lexerTreeBuilder: LexerTreeBuilder, _functionService: IFunctionService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService, _sheetCellEditorResizeService: SheetCellEditorResizeService);
35
+ constructor(_context: IRenderContext<Workbook>, selectionManagerService: SheetsSelectionsService, _undoRedoService: IUndoRedoService, _contextService: IContextService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _cellEditorManagerService: ICellEditorManagerService, _lexerTreeBuilder: LexerTreeBuilder, _functionService: IFunctionService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService, _sheetCellEditorResizeService: SheetCellEditorResizeService, _univerInstanceService: IUniverInstanceService);
35
36
  dispose(): void;
36
37
  private _disposeCurrent;
37
38
  private _init;
@@ -1,4 +1,4 @@
1
- import { IUniverInstanceService, IAccessor, IPermissionTypes, Workbook, WorkbookPermissionPointConstructor, Worksheet } from '@univerjs/core';
1
+ import { IAccessor, IPermissionTypes, Workbook, WorkbookPermissionPointConstructor, Worksheet, IUniverInstanceService } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  interface IActive {
4
4
  workbook: Workbook;
@@ -20,7 +20,7 @@ export declare function getCurrentExclusiveRangeInterest$(accessor: IAccessor, d
20
20
  * @returns {Observable<boolean>} The observable combine with exclusive range
21
21
  */
22
22
  export declare function getObservableWithExclusiveRange$(accessor: IAccessor, observable$: Observable<boolean>, disableGroupSet?: Set<string>): Observable<boolean>;
23
- export declare function getCurrentRangeDisable$(accessor: IAccessor, permissionTypes?: IPermissionTypes): Observable<boolean>;
23
+ export declare function getCurrentRangeDisable$(accessor: IAccessor, permissionTypes?: IPermissionTypes, supportCellEdit?: boolean): Observable<boolean>;
24
24
  export declare function getBaseRangeMenuHidden$(accessor: IAccessor): Observable<boolean>;
25
25
  export declare function getInsertAfterMenuHidden$(accessor: IAccessor, type: 'row' | 'col'): Observable<boolean>;
26
26
  export declare function getInsertBeforeMenuHidden$(accessor: IAccessor, type: 'row' | 'col'): Observable<boolean>;
@@ -1,4 +1,4 @@
1
- import { HorizontalAlign, VerticalAlign, WrapStrategy, IAccessor } from '@univerjs/core';
1
+ import { IAccessor, HorizontalAlign, VerticalAlign, WrapStrategy } from '@univerjs/core';
2
2
  import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
3
3
  export declare enum SheetMenuPosition {
4
4
  ROW_HEADER_CONTEXT_MENU = "ROW_HEADER_CONTEXT_MENU",
@@ -1,5 +1,5 @@
1
- import { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
2
1
  import { IAccessor } from '@univerjs/core';
2
+ import { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
3
3
  export declare const SHEET_PERMISSION_CONTEXT_MENU_ID = "sheet.contextMenu.permission";
4
4
  export declare function sheetPermissionToolbarMenuFactory(accessor: IAccessor): IMenuItem;
5
5
  export declare function sheetPermissionContextMenuFactory(accessor: IAccessor): IMenuSelectorItem<string>;
@@ -21,8 +21,6 @@ export declare class SheetPermissionInitController extends Disposable {
21
21
  private _initWorksheetPermissionPointsChange;
22
22
  private _initWorksheetPermissionFromSnapshot;
23
23
  private _initUserChange;
24
- private _initViewModelByRangeInterceptor;
25
- private _initViewModelBySheetInterceptor;
26
24
  refreshPermission(unitId: string, permissionId: string): void;
27
25
  private _refreshPermissionByCollaCreate;
28
26
  }
@@ -0,0 +1,11 @@
1
+ import { Disposable, IPermissionService } from '@univerjs/core';
2
+ import { RangeProtectionCache, SheetInterceptorService, WorksheetProtectionRuleModel } from '@univerjs/sheets';
3
+ export declare class SheetPermissionViewModelController extends Disposable {
4
+ private _permissionService;
5
+ private _worksheetProtectionRuleModel;
6
+ private _sheetInterceptorService;
7
+ private _rangeProtectionCache;
8
+ constructor(_permissionService: IPermissionService, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _sheetInterceptorService: SheetInterceptorService, _rangeProtectionCache: RangeProtectionCache);
9
+ private _initViewModelByRangeInterceptor;
10
+ private _initViewModelBySheetInterceptor;
11
+ }
@@ -99,7 +99,7 @@ export { type ISheetPasteParams, SheetCopyCommand, SheetCutCommand, SheetPasteBe
99
99
  export { DeleteRangeMoveLeftConfirmCommand } from './commands/commands/delete-range-move-left-confirm.command';
100
100
  export { DeleteRangeMoveUpConfirmCommand } from './commands/commands/delete-range-move-up-confirm.command';
101
101
  export { HideColConfirmCommand, HideRowConfirmCommand } from './commands/commands/hide-row-col-confirm.command';
102
- export { SetRangeBoldCommand, SetRangeFontFamilyCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, } from './commands/commands/inline-format.command';
102
+ export { ResetRangeTextColorCommand, SetRangeBoldCommand, SetRangeFontFamilyCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, } from './commands/commands/inline-format.command';
103
103
  export { InsertRangeMoveDownConfirmCommand } from './commands/commands/insert-range-move-down-confirm.command';
104
104
  export { InsertRangeMoveRightConfirmCommand } from './commands/commands/insert-range-move-right-confirm.command';
105
105
  export { AddRangeProtectionCommand, AddRangeProtectionFromContextMenuCommand, AddRangeProtectionFromSheetBarCommand, AddRangeProtectionFromToolbarCommand, DeleteRangeProtectionFromContextMenuCommand, DeleteRangeSelectionCommand, SetProtectionCommand, SetRangeProtectionCommand, SetRangeProtectionFromContextMenuCommand, ViewSheetPermissionFromContextMenuCommand, ViewSheetPermissionFromSheetBarCommand, } from './commands/commands/range-protection.command';
@@ -34,6 +34,7 @@ export interface ISheetSelectionRenderService {
34
34
  attachPrimaryWithCoord(primary: Nullable<Partial<ISelectionCell>>): Nullable<ISelectionCellWithMergeInfo>;
35
35
  getSelectionCellByPosition(x: number, y: number): Nullable<ISelectionCellWithMergeInfo>;
36
36
  setSingleSelectionEnabled(enabled: boolean): void;
37
+ refreshSelectionMoveEnd(): void;
37
38
  }
38
39
  export declare const ISheetSelectionRenderService: import('@wendellhu/redi').IdentifierDecorator<ISheetSelectionRenderService>;
39
40
  /**
@@ -70,10 +71,16 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
70
71
  protected _remainLastEnabled: boolean;
71
72
  protected _skipLastEnabled: boolean;
72
73
  protected _singleSelectionEnabled: boolean;
74
+ /**
75
+ * Mainly emit by pointerup (pointerup is handled in _onPointerdown)
76
+ */
73
77
  protected readonly _selectionMoveEnd$: BehaviorSubject<ISelectionWithCoordAndStyle[]>;
74
78
  readonly selectionMoveEnd$: Observable<ISelectionWithCoordAndStyle[]>;
75
79
  protected readonly _selectionMoving$: Subject<ISelectionWithCoordAndStyle[]>;
76
80
  readonly selectionMoving$: Observable<ISelectionWithCoordAndStyle[]>;
81
+ /**
82
+ * Mainly emit by pointerdown
83
+ */
77
84
  protected readonly _selectionMoveStart$: Subject<ISelectionWithCoordAndStyle[]>;
78
85
  readonly selectionMoveStart$: Observable<ISelectionWithCoordAndStyle[]>;
79
86
  private _selectionMoving;
@@ -140,11 +147,12 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
140
147
  protected _reset(): void;
141
148
  resetAndEndSelection(): void;
142
149
  /**
143
- *
144
- * @param evt component point event
145
- * @param style selection style, Styles for user-customized selectors
146
- * @param _zIndex Stacking order of the selection object
147
- * @param rangeType Determines whether the selection is made normally according to the range or by rows and columns
150
+ * Handle pointer down event, then trigger selectionMoveStart$.
151
+ * @param evt
152
+ * @param _zIndex
153
+ * @param rangeType
154
+ * @param viewport
155
+ * @param scrollTimerType
148
156
  */
149
157
  protected _onPointerDown(evt: IPointerEvent | IMouseEvent, _zIndex: number | undefined, rangeType: RANGE_TYPE | undefined, viewport: Nullable<Viewport>, scrollTimerType?: ScrollTimerType): void;
150
158
  /**
@@ -48,7 +48,6 @@ export declare class MobileSheetsSelectionRenderService extends BaseSelectionRen
48
48
  * new selection control for mobile do one more thing: bind event for two control points.
49
49
  * @param scene
50
50
  * @param rangeType
51
- * @returns
52
51
  */
53
52
  newSelectionControl(scene: Scene, rangeType: RANGE_TYPE): MobileSelectionControl;
54
53
  private _getActiveViewport;