Class: BaseSelectionRenderService
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:95
The basic implementation of selection rendering logics. It is designed to be reused for different purposes.
Extends
Extended by
Implements
Constructors
new BaseSelectionRenderService()
new BaseSelectionRenderService(
_injector,
_themeService,
_shortcutService,
_sheetSkeletonManagerService,
contextService): BaseSelectionRenderService
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:190
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_themeService | ThemeService |
_shortcutService | IShortcutService |
_sheetSkeletonManagerService | SheetSkeletonManagerService |
contextService | IContextService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
---|---|---|---|---|---|---|
_activeControlIndex | protected | number | -1 | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:118 |
_activeViewport | protected | Nullable <Viewport > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:184 |
_disposed | protected | boolean | false | - | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_escapeShortcutDisposable | protected | Nullable <IDisposable > | null | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:188 |
_highlightHeader | protected | boolean | true | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:143 |
_injector | readonly | Injector | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:191 |
_rangeType | protected | RANGE_TYPE | RANGE_TYPE.NORMAL | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:146 |
_remainLastEnabled | protected | boolean | false | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:154 |
_scene | protected | Scene | undefined | From renderContext. | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:140 |
_scenePointerMoveSub | protected | Nullable <Subscription > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:97 |
_scenePointerUpSub | protected | Nullable <Subscription > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:98 |
_scrollTimer | protected | ScrollTimer | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:130 |
_selectionControls | protected | SelectionControl [] | [] | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:105 |
_selectionMoveEnd$ | readonly | BehaviorSubject <ISelectionWithCoord []> | undefined | Mainly emit by pointerup in spreadsheet. (pointerup is handled in _onPointerdown) | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:162 |
_selectionMoveStart$ | readonly | Subject <ISelectionWithCoord []> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:175 |
_selectionMoving$ | readonly | Subject <ISelectionWithCoord []> | undefined | Mainly emit by pointermove in spreadsheet | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:170 |
_selectionStyle | protected | ISelectionStyle | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:149 |
_selectionTheme | protected | ThemeService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:179 |
_sheetSkeletonManagerService | readonly | SheetSkeletonManagerService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:195 |
_shortcutService | readonly | IShortcutService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:194 |
_singleSelectionEnabled | protected | boolean | false | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:156 |
_skeleton | protected | SpreadsheetSkeleton | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:135 |
_skipLastEnabled | protected | boolean | false | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:155 |
_startRangeWhenPointerDown | protected | IRangeWithCoord | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:107 |
_startViewportPosX | protected | number | 0 | the posX of viewport when the pointer down | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:123 |
_startViewportPosY | protected | number | 0 | the posY of viewport when the pointer down | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:128 |
_themeService | readonly | ThemeService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:192 |
contextService | readonly | IContextService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:196 |
controlFillConfig$ | readonly | Observable <null | IControlFillConfig > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:103 |
interceptor | readonly | InterceptorManager <{ RANGE_FILL_PERMISSION_CHECK : IInterceptor <boolean , { scene : Scene ; skeleton : SpreadsheetSkeleton ; x : number ; y : number ; }>; RANGE_MOVE_PERMISSION_CHECK : IInterceptor <boolean , null >; }> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:186 |
selectionMoveEnd$ | readonly | Observable <ISelectionWithCoord []> | undefined | Pointerup in spreadsheet | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:166 |
selectionMoveStart$ | readonly | Observable <ISelectionWithCoord []> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:176 |
selectionMoving$ | readonly | Observable <ISelectionWithCoord []> | undefined | Pointermove in spreadsheet | - | submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:174 |
Accessors
selectionMoving
Get Signature
get selectionMoving(): boolean
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:180
Returns
boolean
Implementation of
ISheetSelectionRenderService
.selectionMoving
Methods
_addEndingListeners()
protected _addEndingListeners(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:762
Returns
void
_addSelectionControlByModelData()
protected _addSelectionControlByModelData(selectionWithStyle): SelectionControl
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:358
Add a selection in spreadsheet, create a new SelectionControl and then update this control by range derives from selection.
Parameters
Parameter | Type |
---|---|
selectionWithStyle | ISelectionWithStyle |
Returns
_changeRuntime()
protected _changeRuntime(
skeleton,
scene,
viewport?): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:318
Parameters
Parameter | Type |
---|---|
skeleton | SpreadsheetSkeleton |
scene | Scene |
viewport ? | Viewport |
Returns
void
_checkClearPreviousControls()
protected _checkClearPreviousControls(evt): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:858
Parameters
Parameter | Type |
---|---|
evt | | IMouseEvent | IPointerEvent |
Returns
void
_clearAllSelectionControls()
protected _clearAllSelectionControls(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:368
Returns
void
_clearUpdatingListeners()
protected _clearUpdatingListeners(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:747
Returns
void
_getFreeze()
protected _getFreeze(): Nullable<IFreeze>
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:377
Returns
_getSelectionWithCoordByOffset()
protected _getSelectionWithCoordByOffset(
offsetX,
offsetY,
scaleX,
scaleY,
scrollXY): Nullable<ISelectionWithCoord>
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:792
Get visible selection range & coord by offset on viewport. Nearly same as skeleton.getCellWithCoordByOffset Returning selection is only one cell. primary and range are same cell.
visible selection range means getCellWithCoordByOffset needs first matched row/col in rowHeightAccumulation & colWidthAccumulation. Original name: _getCellRangeByCursorPosition
Parameters
Parameter | Type | Description |
---|---|---|
offsetX | number | position X in viewport. |
offsetY | number | - |
scaleX | number | - |
scaleY | number | - |
scrollXY | { x : number ; y : number ; } | - |
scrollXY.x | number | - |
scrollXY.y | number | - |
Returns
selection range with coord.
_getViewportByCell()
protected _getViewportByCell(row?, column?): Nullable<Viewport>
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:382
Parameters
Parameter | Type |
---|---|
row ? | number |
column ? | number |
Returns
_initSelectionThemeFromThemeService()
_initSelectionThemeFromThemeService(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:308
Returns
void
_makeSelectionByTwoCells()
protected _makeSelectionByTwoCells(
currentCell,
startSelectionRange,
skeleton,
rangeType,
activeControl): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:871
Parameters
Parameter | Type |
---|---|
currentCell | ICellWithCoord |
startSelectionRange | IRangeWithCoord |
skeleton | SpreadsheetSkeleton |
rangeType | RANGE_TYPE |
activeControl | SelectionControl |
Returns
void
_movingHandler()
protected _movingHandler(
offsetX,
offsetY,
activeSelectionControl,
rangeType): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:675
When mousedown and mouseup need to go to the coordination and undo stack, when mousemove does not need to go to the coordination and undo stack
Parameters
Parameter | Type |
---|---|
offsetX | number |
offsetY | number |
activeSelectionControl | Nullable <SelectionControl > |
rangeType | RANGE_TYPE |
Returns
void
_reset()
protected _reset(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:459
Clear existed selections by workbookSelections.selectionMoveEnd$
Returns
void
_setSelectionStyle()
protected _setSelectionStyle(style): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:222
Parameters
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
_setupPointerMoveListener()
protected _setupPointerMoveListener(
viewportMain,
activeSelectionControl,
rangeType,
scrollTimerType,
moveStartPosX,
moveStartPosY): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:475
Init pointer move listener in each pointer down, unbind in each pointer up. Both cell selections and row-column selections are supported by this method.
Parameters
Parameter | Type | Default value |
---|---|---|
viewportMain | Nullable <Viewport > | undefined |
activeSelectionControl | SelectionControl | undefined |
rangeType | RANGE_TYPE | undefined |
scrollTimerType | ScrollTimerType | ScrollTimerType.ALL |
moveStartPosX | number | undefined |
moveStartPosY | number | undefined |
Returns
void
attachPrimaryWithCoord()
attachPrimaryWithCoord(primary): ICellWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:651
Parameters
Parameter | Type |
---|---|
primary | ICellInfo |
Returns
Deprecated
Use the function attachPrimaryWithCoord
instead`.
Implementation of
ISheetSelectionRenderService
.attachPrimaryWithCoord
attachSelectionWithCoord()
attachSelectionWithCoord(selectionWithStyle): ISelectionWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:646
Parameters
Parameter | Type |
---|---|
selectionWithStyle | ISelectionWithStyle |
Returns
Deprecated
Use the function attachSelectionWithCoord
instead`.
Implementation of
ISheetSelectionRenderService
.attachSelectionWithCoord
dispose()
dispose(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109
Returns
void
Implementation of
Inherited from
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
endSelection()
endSelection(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:447
Returns
void
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
getActiveRange()
getActiveRange(): Nullable<IRange>
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:411
Returns the selected range in the active sheet, or null if there is no active range. If multiple ranges are selected this method returns only the last selected range.
Returns
getActiveSelectionControl()
getActiveSelectionControl<T>(): Nullable<T>
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:436
get active(actually last) selection control
Type Parameters
Type Parameter | Default type |
---|---|
T extends SelectionControl | SelectionControl |
Returns
Nullable
<T
>
T extends SelectionControl
getCellWithCoordByOffset()
getCellWithCoordByOffset(
x,
y,
skeletonParam?): ICellWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:662
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
skeletonParam ? | SpreadsheetSkeleton |
Returns
Implementation of
ISheetSelectionRenderService
.getCellWithCoordByOffset
getSelectionCellByPosition()
getSelectionCellByPosition(x, y): ICellWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:658
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Deprecated
Please use getCellWithCoordByOffset
instead.
Implementation of
ISheetSelectionRenderService
.getSelectionCellByPosition
getSelectionControls()
getSelectionControls(): SelectionControl[]
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:350
Returns
TODO
lumixraku DO NOT expose private props.
Implementation of
ISheetSelectionRenderService
.getSelectionControls
getSelectionDataWithStyle()
getSelectionDataWithStyle(): ISelectionWithCoord[]
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:336
Generate selectionData from this._selectionControls.model .
Returns
{range, primary, style}[]
getSkeleton()
getSkeleton(): SpreadsheetSkeleton
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:328
Returns
Implementation of
ISheetSelectionRenderService
.getSkeleton
getViewPort()
getViewPort(): Viewport
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:234
Returns
Deprecated
This should not be provided by the selection render service.
Implementation of
ISheetSelectionRenderService
.getViewPort
inRefSelectionMode()
inRefSelectionMode(): boolean
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:937
Returns
boolean
isSelectionDisabled()
isSelectionDisabled(): boolean
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:933
Returns
boolean
isSelectionEnabled()
isSelectionEnabled(): boolean
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:929
Returns
boolean
newSelectionControl()
newSelectionControl(
scene,
skeleton,
selection): SelectionControl
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:242
Parameters
Parameter | Type |
---|---|
scene | Scene |
skeleton | SpreadsheetSkeleton |
selection | ISelectionWithStyle |
Returns
refreshSelectionMoveEnd()
refreshSelectionMoveEnd(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:304
Returns
void
Implementation of
ISheetSelectionRenderService
.refreshSelectionMoveEnd
refreshSelectionMoveStart()
refreshSelectionMoveStart(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:300
Returns
void
resetActiveSelectionIndex()
resetActiveSelectionIndex(): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:428
Returns
void
resetSelectionsByModelData()
resetSelectionsByModelData(selectionsWithStyleList): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:274
Update the corresponding selectionControl based on selectionsData from WorkbookSelectionModel selectionData[i] —> selectionControls[i]
Parameters
Parameter | Type | Description |
---|---|---|
selectionsWithStyleList | readonly ISelectionWithStyle [] | {ISelectionWithStyle[]} selectionsData from WorkbookSelectionModel |
Returns
void
setActiveSelectionIndex()
setActiveSelectionIndex(index): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:424
Parameters
Parameter | Type |
---|---|
index | number |
Returns
void
setSelectionTheme()
setSelectionTheme(prop): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:314
Parameters
Parameter | Type |
---|---|
prop | IStyleSheet |
Returns
void
setSingleSelectionEnabled()
setSingleSelectionEnabled(enabled): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/base-selection-render.service.ts:238
Parameters
Parameter | Type | Default value |
---|---|---|
enabled | boolean | false |
Returns
void