@univerjs/sheets-ui v0.2.11 • Docs
Class: BaseSelectionRenderService
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): BaseSelectionRenderService
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_themeService | ThemeService |
_shortcutService | IShortcutService |
_sheetSkeletonManagerService | SheetSkeletonManagerService |
Returns
Overrides
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:164 (opens in a new tab)
Properties
Accessors
selectionMoving
get selectionMoving(): boolean
Returns
boolean
Implementation of
ISheetSelectionRenderService
.selectionMoving
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:154 (opens in a new tab)
Methods
_addEndingListeners()
protected _addEndingListeners(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:848 (opens in a new tab)
_addSelectionControlBySelectionData()
protected _addSelectionControlBySelectionData(selection): void
Add a selection in spreadsheet, create a new SelectionControl and then update this control by range derives from selection.
Parameters
Parameter | Type |
---|---|
selection | ISelectionWithCoordAndStyle |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:210 (opens in a new tab)
_changeRuntime()
protected _changeRuntime(
skeleton,
scene,
viewport?): void
Parameters
Parameter | Type |
---|---|
skeleton | SpreadsheetSkeleton |
scene | Scene |
viewport ? | Viewport |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:284 (opens in a new tab)
_checkClearPreviousControls()
protected _checkClearPreviousControls(evt): void
Parameters
Parameter | Type |
---|---|
evt | IMouseEvent | IPointerEvent |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:936 (opens in a new tab)
_clearSelectionControls()
protected _clearSelectionControls(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:313 (opens in a new tab)
_clearUpdatingListeners()
protected _clearUpdatingListeners(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:833 (opens in a new tab)
_getCellRangeByCursorPosition()
protected _getCellRangeByCursorPosition(
offsetX,
offsetY,
scaleX,
scaleY,
scrollXY): Nullable<ISelectionWithCoord>
Parameters
Parameter | Type |
---|---|
offsetX | number |
offsetY | number |
scaleX | number |
scaleY | number |
scrollXY | object |
scrollXY.x | number |
scrollXY.y | number |
Returns
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:864 (opens in a new tab)
_getFreeze()
protected _getFreeze(): Nullable<IFreeze>
Returns
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:322 (opens in a new tab)
_getViewportByCell()
protected _getViewportByCell(row?, column?): Nullable<Viewport>
Parameters
Parameter | Type |
---|---|
row ? | number |
column ? | number |
Returns
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:327 (opens in a new tab)
_movingHandler()
protected _movingHandler(
offsetX,
offsetY,
activeSelectionControl,
rangeType): void
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 <SelectionShape > |
rangeType | RANGE_TYPE |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:730 (opens in a new tab)
_onPointerDown()
protected _onPointerDown(
evt,
_zIndex,
rangeType,
viewport,
scrollTimerType): void
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
evt | IMouseEvent | IPointerEvent | undefined | component point event |
_zIndex | number | 0 | Stacking order of the selection object |
rangeType | RANGE_TYPE | RANGE_TYPE.NORMAL | Determines whether the selection is made normally according to the range or by rows and columns |
viewport | Nullable <Viewport > | undefined | - |
scrollTimerType | ScrollTimerType | ScrollTimerType.ALL | - |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:413 (opens in a new tab)
_refreshSelectionControl()
protected _refreshSelectionControl(selectionsData): void
Reset all this.selectionControls by selectionsData.
Parameters
Parameter | Type |
---|---|
selectionsData | readonly ISelectionWithStyle [] |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:1012 (opens in a new tab)
_reset()
protected _reset(): void
Clear existed selections.
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:392 (opens in a new tab)
_resetSelectionStyle()
protected _resetSelectionStyle(): void
Reset this._selectionStyle to default normal selection style
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:193 (opens in a new tab)
_setSelectionStyle()
protected _setSelectionStyle(style): void
Parameters
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:186 (opens in a new tab)
_setupPointerMoveListener()
protected _setupPointerMoveListener(
viewportMain,
activeSelectionControl,
rangeType,
scrollTimerType,
moveStartPosX,
moveStartPosY): void
Init pointer move listener, bind in each pointer down, unbind in each pointer up
Parameters
Parameter | Type | Default value |
---|---|---|
viewportMain | Nullable <Viewport > | undefined |
activeSelectionControl | SelectionShape | undefined |
rangeType | RANGE_TYPE | undefined |
scrollTimerType | ScrollTimerType | ScrollTimerType.ALL |
moveStartPosX | number | undefined |
moveStartPosY | number | undefined |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:549 (opens in a new tab)
_updateSelectionControlByRange()
protected _updateSelectionControlByRange(
control,
newSelectionRange,
highlight): void
Update the selection control by range.
Parameters
Parameter | Type |
---|---|
control | SelectionShape |
newSelectionRange | IRangeWithCoord |
highlight | Nullable <ISelectionCellWithMergeInfo > |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:823 (opens in a new tab)
attachPrimaryWithCoord()
attachPrimaryWithCoord(primary): ISelectionCellWithMergeInfo
Parameters
Parameter | Type |
---|---|
primary | ISelectionCell |
Returns
Deprecated
Use the function attachPrimaryWithCoord
instead`.
Implementation of
ISheetSelectionRenderService
.attachPrimaryWithCoord
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:707 (opens in a new tab)
attachSelectionWithCoord()
attachSelectionWithCoord(selectionWithStyle): ISelectionWithCoordAndStyle
Parameters
Parameter | Type |
---|---|
selectionWithStyle | ISelectionWithStyle |
Returns
Deprecated
Use the function attachSelectionWithCoord
instead`.
Implementation of
ISheetSelectionRenderService
.attachSelectionWithCoord
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:702 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Implementation of
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
protected disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
endSelection()
endSelection(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:380 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
getActiveRange()
getActiveRange(): Nullable<IRange>
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
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:356 (opens in a new tab)
getActiveSelectionControl()
getActiveSelectionControl<T>(): Nullable<T>
get active selection control
Type Parameters
Type Parameter | Default type |
---|---|
T extends SelectionShape | SelectionShape |
Returns
Nullable
<T
>
T extends SelectionControl
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:373 (opens in a new tab)
getSelectionCellByPosition()
getSelectionCellByPosition(x, y): Nullable<ISelectionCellWithMergeInfo>
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Nullable
<ISelectionCellWithMergeInfo
>
Implementation of
ISheetSelectionRenderService
.getSelectionCellByPosition
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:711 (opens in a new tab)
getSelectionControls()
getSelectionControls(): SelectionShape[]
Returns
Implementation of
ISheetSelectionRenderService
.getSelectionControls
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:309 (opens in a new tab)
getSelectionDataWithStyle()
getSelectionDataWithStyle(): ISelectionWithCoordAndStyle[]
Generate selectionData from this._selectionControls.model .
Returns
{range, primary, style}[]
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:298 (opens in a new tab)
getSkeleton()
getSkeleton(): SpreadsheetSkeleton
Returns
Implementation of
ISheetSelectionRenderService
.getSkeleton
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:290 (opens in a new tab)
getViewPort()
getViewPort(): Viewport
Returns
Deprecated
This should not be provided by the selection render service.
Implementation of
ISheetSelectionRenderService
.getViewPort
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:198 (opens in a new tab)
newSelectionControl()
newSelectionControl(
scene,
_rangeType,
skeleton): SelectionShape
Parameters
Parameter | Type |
---|---|
scene | Scene |
_rangeType | RANGE_TYPE |
skeleton | SpreadsheetSkeleton |
Returns
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:234 (opens in a new tab)
refreshSelectionMoveStart()
refreshSelectionMoveStart(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:280 (opens in a new tab)
resetAndEndSelection()
resetAndEndSelection(): void
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:398 (opens in a new tab)
setSingleSelectionEnabled()
setSingleSelectionEnabled(enabled): void
Parameters
Parameter | Type | Default value |
---|---|---|
enabled | boolean | false |
Returns
void
Implementation of
ISheetSelectionRenderService
.setSingleSelectionEnabled
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:202 (opens in a new tab)
updateControlForCurrentByRangeData()
updateControlForCurrentByRangeData(selections): void
Update the corresponding selectionControl based on selectionsData. selectionData[i] syncs selectionControls[i]
Parameters
Parameter | Type |
---|---|
selections | ISelectionWithCoordAndStyle [] |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/base-selection-render.service.ts:252 (opens in a new tab)