@univerjs/sheets-formula-ui v0.4.2 • Docs
Class: RefSelectionsRenderService
This service extends the existing SelectionRenderService
to provide the rendering of prompt selections
when user is editing ref ranges in formulas.
Not that this service works with Uni-mode, which means it should be able to deal with multi render unit and handle selections on them, though each at a time.
Extends
Implements
Constructors
new RefSelectionsRenderService()
new RefSelectionsRenderService(
_context,
injector,
themeService,
shortcutService,
sheetSkeletonManagerService,
_refSelectionsService): RefSelectionsRenderService
Parameters
Parameter | Type |
---|---|
_context | IRenderContext <Workbook > |
injector | Injector |
themeService | ThemeService |
shortcutService | IShortcutService |
sheetSkeletonManagerService | SheetSkeletonManagerService |
_refSelectionsService | SheetsSelectionsService |
Returns
Overrides
BaseSelectionRenderService
.constructor
Defined in
Properties
Accessors
selectionMoving
get selectionMoving(): boolean
Returns
boolean
Inherited from
BaseSelectionRenderService
.selectionMoving
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:165 (opens in a new tab)
Methods
_addEndingListeners()
protected _addEndingListeners(): void
Returns
void
Inherited from
BaseSelectionRenderService
._addEndingListeners
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:888 (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
Inherited from
BaseSelectionRenderService
._addSelectionControlBySelectionData
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:221 (opens in a new tab)
_changeRuntime()
protected _changeRuntime(
skeleton,
scene,
viewport?): void
Parameters
Parameter | Type |
---|---|
skeleton | SpreadsheetSkeleton |
scene | Scene |
viewport ? | Viewport |
Returns
void
Inherited from
BaseSelectionRenderService
._changeRuntime
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:299 (opens in a new tab)
_checkClearPreviousControls()
protected _checkClearPreviousControls(evt): void
Parameters
Parameter | Type |
---|---|
evt | IMouseEvent | IPointerEvent |
Returns
void
Inherited from
BaseSelectionRenderService
._checkClearPreviousControls
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:976 (opens in a new tab)
_clearSelectionControls()
protected _clearSelectionControls(): void
Returns
void
Inherited from
BaseSelectionRenderService
._clearSelectionControls
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:332 (opens in a new tab)
_clearUpdatingListeners()
protected _clearUpdatingListeners(): void
Returns
void
Inherited from
BaseSelectionRenderService
._clearUpdatingListeners
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:873 (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
Inherited from
BaseSelectionRenderService
._getCellRangeByCursorPosition
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:904 (opens in a new tab)
_getFreeze()
protected _getFreeze(): Nullable<IFreeze>
Returns
Inherited from
BaseSelectionRenderService
._getFreeze
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:341 (opens in a new tab)
_getViewportByCell()
protected _getViewportByCell(row?, column?): Nullable<Viewport>
Parameters
Parameter | Type |
---|---|
row ? | number |
column ? | number |
Returns
Inherited from
BaseSelectionRenderService
._getViewportByCell
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:346 (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
Inherited from
BaseSelectionRenderService
._movingHandler
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:768 (opens in a new tab)
_onPointerDown()
protected _onPointerDown(
evt,
_zIndex,
rangeType,
viewport,
scrollTimerType): void
Handle pointer down event, then trigger selectionMoveStart$.
Parameters
Parameter | Type | Default value |
---|---|---|
evt | IMouseEvent | IPointerEvent | undefined |
_zIndex | number | 0 |
rangeType | RANGE_TYPE | RANGE_TYPE.NORMAL |
viewport | Nullable <Viewport > | undefined |
scrollTimerType | ScrollTimerType | ScrollTimerType.ALL |
Returns
void
Inherited from
BaseSelectionRenderService
._onPointerDown
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:433 (opens in a new tab)
_refreshSelectionControl()
protected _refreshSelectionControl(selectionsData): void
Reset all this.selectionControls by selectionsData.
Parameters
Parameter | Type |
---|---|
selectionsData | readonly ISelectionWithStyle [] |
Returns
void
Overrides
BaseSelectionRenderService
._refreshSelectionControl
Defined in
_reset()
protected _reset(): void
Clear existed selections.
Returns
void
Inherited from
BaseSelectionRenderService
._reset
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:411 (opens in a new tab)
_resetSelectionStyle()
protected _resetSelectionStyle(): void
Reset this._selectionStyle to default normal selection style
Returns
void
Inherited from
BaseSelectionRenderService
._resetSelectionStyle
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:204 (opens in a new tab)
_setSelectionStyle()
protected _setSelectionStyle(style): void
Parameters
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
Inherited from
BaseSelectionRenderService
._setSelectionStyle
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:197 (opens in a new tab)
_setupPointerMoveListener()
protected _setupPointerMoveListener(
viewportMain,
activeSelectionControl,
rangeType,
scrollTimerType,
moveStartPosX,
moveStartPosY): void
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 | SelectionShape | undefined |
rangeType | RANGE_TYPE | undefined |
scrollTimerType | ScrollTimerType | ScrollTimerType.ALL |
moveStartPosX | number | undefined |
moveStartPosY | number | undefined |
Returns
void
Inherited from
BaseSelectionRenderService
._setupPointerMoveListener
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:570 (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
Inherited from
BaseSelectionRenderService
._updateSelectionControlByRange
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:863 (opens in a new tab)
attachPrimaryWithCoord()
attachPrimaryWithCoord(primary): ISelectionCellWithMergeInfo
Parameters
Parameter | Type |
---|---|
primary | ISelectionCell |
Returns
Deprecated
Use the function attachPrimaryWithCoord
instead`.
Inherited from
BaseSelectionRenderService
.attachPrimaryWithCoord
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:745 (opens in a new tab)
attachSelectionWithCoord()
attachSelectionWithCoord(selectionWithStyle): ISelectionWithCoordAndStyle
Parameters
Parameter | Type |
---|---|
selectionWithStyle | ISelectionWithStyle |
Returns
Deprecated
Use the function attachSelectionWithCoord
instead`.
Inherited from
BaseSelectionRenderService
.attachSelectionWithCoord
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:740 (opens in a new tab)
clearLastSelection()
clearLastSelection(): void
Returns
void
Defined in
dispose()
dispose(): void
Returns
void
Implementation of
Inherited from
BaseSelectionRenderService
.dispose
Defined in
core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
BaseSelectionRenderService
.disposeWithMe
Defined in
core/src/shared/lifecycle.ts:96 (opens in a new tab)
enableSelectionChanging()
enableSelectionChanging(): IDisposable
Call this method and user will be able to select on the canvas to update selections.
Returns
Defined in
endSelection()
endSelection(): void
Returns
void
Inherited from
BaseSelectionRenderService
.endSelection
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:399 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
BaseSelectionRenderService
.ensureNotDisposed
Defined in
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
Inherited from
BaseSelectionRenderService
.getActiveRange
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:375 (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
Inherited from
BaseSelectionRenderService
.getActiveSelectionControl
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:392 (opens in a new tab)
getLocation()
getLocation(): [string, string]
Returns
[string
, string
]
Defined in
getSelectionCellByPosition()
getSelectionCellByPosition(x, y): Nullable<ISelectionCellWithMergeInfo>
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Nullable
<ISelectionCellWithMergeInfo
>
Inherited from
BaseSelectionRenderService
.getSelectionCellByPosition
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:749 (opens in a new tab)
getSelectionControls()
getSelectionControls(): SelectionShape[]
Returns
Inherited from
BaseSelectionRenderService
.getSelectionControls
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:328 (opens in a new tab)
getSelectionDataWithStyle()
getSelectionDataWithStyle(): ISelectionWithCoordAndStyle[]
Generate selectionData from this._selectionControls.model .
Returns
{range, primary, style}[]
Inherited from
BaseSelectionRenderService
.getSelectionDataWithStyle
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:317 (opens in a new tab)
getSkeleton()
getSkeleton(): SpreadsheetSkeleton
Returns
Inherited from
BaseSelectionRenderService
.getSkeleton
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:309 (opens in a new tab)
getViewPort()
getViewPort(): Viewport
Returns
Deprecated
This should not be provided by the selection render service.
Inherited from
BaseSelectionRenderService
.getViewPort
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:209 (opens in a new tab)
newSelectionControl()
newSelectionControl(
scene,
_rangeType,
skeleton): SelectionShape
Parameters
Parameter | Type |
---|---|
scene | Scene |
_rangeType | RANGE_TYPE |
skeleton | SpreadsheetSkeleton |
Returns
Inherited from
BaseSelectionRenderService
.newSelectionControl
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:245 (opens in a new tab)
refreshSelectionMoveEnd()
refreshSelectionMoveEnd(): void
Returns
void
Inherited from
BaseSelectionRenderService
.refreshSelectionMoveEnd
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:295 (opens in a new tab)
refreshSelectionMoveStart()
refreshSelectionMoveStart(): void
Returns
void
Inherited from
BaseSelectionRenderService
.refreshSelectionMoveStart
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:291 (opens in a new tab)
resetAndEndSelection()
resetAndEndSelection(): void
Returns
void
Inherited from
BaseSelectionRenderService
.resetAndEndSelection
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:417 (opens in a new tab)
setRemainLastEnabled()
setRemainLastEnabled(enabled): void
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
void
Defined in
setSingleSelectionEnabled()
setSingleSelectionEnabled(enabled): void
Parameters
Parameter | Type | Default value |
---|---|---|
enabled | boolean | false |
Returns
void
Inherited from
BaseSelectionRenderService
.setSingleSelectionEnabled
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:213 (opens in a new tab)
setSkipLastEnabled()
setSkipLastEnabled(enabled): void
This is set to true when you need to add a new selection.
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
void
Memberof
RefSelectionsRenderService
Defined in
updateControlForCurrentByRangeData()
updateControlForCurrentByRangeData(selections): void
Update the corresponding selectionControl based on selectionsData. selectionData[i] syncs selectionControls[i]
Parameters
Parameter | Type |
---|---|
selections | ISelectionWithCoordAndStyle [] |
Returns
void
Inherited from
BaseSelectionRenderService
.updateControlForCurrentByRangeData
Defined in
sheets-ui/src/services/selection/base-selection-render.service.ts:263 (opens in a new tab)