@univerjs/sheets-ui v0.5.0-beta.1 • Docs


Class: SelectionShape

The main selection canvas component, includes leftControl,rightControl,topControl,bottomControl,backgroundControlTop,backgroundControlMiddleLeft,backgroundControlMiddleRight,backgroundControlBottom,fillControl

Extends

Constructors

new SelectionShape()

new SelectionShape(
   _scene, 
   _zIndex, 
   _themeService, 
   options?): SelectionShape

Parameters

ParameterType
_sceneScene
_zIndexnumber
_themeServiceThemeService
options?object
options.columnHeaderHeight?number
options.enableAutoFill?boolean
options.highlightHeader?boolean
options.rangeType?RANGE_TYPE
options.rowHeaderWidth?number

Returns

SelectionShape

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:155

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_columnHeaderHeightprotectednumber0--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:133
_controlExtensionprotectedNullable<SelectionShapeExtension>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:137
_disposedprotectedbooleanfalse-Disposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93
_enableAutoFillprotectedbooleantrueFor ref selections, there is no auto fill.-submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:86
_highlightHeaderprotectedbooleantrueIf rowHeader & col Header would be highlighted with selection.-submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:96
_rowHeaderWidthprotectednumber0--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:132
_sceneprotectedSceneundefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:156
_selectionRenderModelprotectedSelectionRenderModelundefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:98
_themeServicereadonlyThemeServiceundefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:158
_widgetRectsprotectedRect<IRectProps>[][]--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:135
_zIndexprotectednumberundefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:157
dispose$readonlyObservable<SelectionShape>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:140
selectionFilled$readonlyObservable<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:153
selectionFilling$readonlySubject<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:150
selectionMoved$readonlySubject<IRangeWithCoord>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:147
selectionMoving$readonlySubject<IRangeWithCoord>undefinedeventSource: selectionShapeExtension selectionMoving$.next, Observer: prompt.controller-submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:146
selectionScaled$readonlySubject<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:149
selectionScaling$readonlySubject<IRangeWithCoord>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:148

Accessors

backgroundControlBottom

Get Signature

get backgroundControlBottom(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:384


backgroundControlMiddleLeft

Get Signature

get backgroundControlMiddleLeft(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:388


backgroundControlMiddleRight

Get Signature

get backgroundControlMiddleRight(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:392


backgroundControlTop

Get Signature

get backgroundControlTop(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:380


bottomCenterWidget

Get Signature

get bottomCenterWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:441


bottomControl

Get Signature

get bottomControl(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:372


bottomLeftWidget

Get Signature

get bottomLeftWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:437


bottomRightWidget

Get Signature

get bottomRightWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:445


columnHeaderGroup

Get Signature

get columnHeaderGroup(): Group
Returns

Group

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:400


columnHeaderHeight

Get Signature

get columnHeaderHeight(): number
Returns

number

Set Signature

set columnHeaderHeight(height): void
Parameters
ParameterType
heightnumber
Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:493


currentStyle

Get Signature

get currentStyle(): ISelectionStyle
Returns

ISelectionStyle

Set Signature

set currentStyle(style): void
Parameters
ParameterType
styleISelectionStyle
Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:469


dashedRect

Get Signature

get dashedRect(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:477


fillControl

Get Signature

get fillControl(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:376


isHelperSelection

Get Signature

get isHelperSelection(): boolean
Returns

boolean

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:481


leftControl

Get Signature

get leftControl(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:360


middleLeftWidget

Get Signature

get middleLeftWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:429


middleRightWidget

Get Signature

get middleRightWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:433


model

Get Signature

get model(): SelectionRenderModel
Returns

SelectionRenderModel

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:413


rightControl

Get Signature

get rightControl(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:364


rowHeaderGroup

Get Signature

get rowHeaderGroup(): Group
Returns

Group

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:404


rowHeaderWidth

Get Signature

get rowHeaderWidth(): number
Returns

number

Set Signature

set rowHeaderWidth(width): void
Parameters
ParameterType
widthnumber
Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:485


selectionModel

Get Signature

get selectionModel(): SelectionRenderModel
Returns

SelectionRenderModel

Set Signature

set selectionModel(model): void
Parameters
ParameterType
modelSelectionRenderModel
Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:453


selectionShape

Get Signature

get selectionShape(): Group
Returns

Group

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:396


selectionShapeGroup

Get Signature

get selectionShapeGroup(): Group
Returns

Group

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:408


themeService

Get Signature

get themeService(): ThemeService
Returns

ThemeService

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:449


topCenterWidget

Get Signature

get topCenterWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:421


topControl

Get Signature

get topControl(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:368


topLeftWidget

Get Signature

get topLeftWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:417


topRightWidget

Get Signature

get topRightWidget(): Rect<IRectProps>
Returns

Rect<IRectProps>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:425


zIndex

Get Signature

get zIndex(): number
Returns

number

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:356

Methods

_hasWidgets()

protected _hasWidgets(widgets): boolean

Parameters

ParameterType
widgetsISelectionWidgetConfig

Returns

boolean

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:1061


_updateControlCoord()

protected _updateControlCoord(): void

update selection control coordination by curr selection model

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:654


_updateLayoutOfSelectionControl()

protected _updateLayoutOfSelectionControl(selectionStyle?): void

Update Control Style And Position of SelectionControl

Parameters

ParameterType
selectionStyle?Nullable<Partial<ISelectionStyle>>

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:521


clearHighlight()

clearHighlight(): void

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:728


disableHelperSelection()

disableHelperSelection(): void

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:832


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:740


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96


enableHelperSelection()

enableHelperSelection(): void

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:828


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100


getCurrentCellInfo()

getCurrentCellInfo(): Nullable<IRangeWithCoord>

Get the cell information of the current selection, considering the case of merging cells

Returns

Nullable<IRangeWithCoord>

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:780


getRange()

getRange(): IRangeWithCoord

Returns

IRangeWithCoord

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:824


getScene()

getScene(): Scene

Returns

Scene

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:735


getValue()

getValue(): ISelectionWithCoord

Returns

ISelectionWithCoord

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:817


refreshSelectionFilled()

refreshSelectionFilled(val): void

Parameters

ParameterType
valIRangeWithCoord

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:512


setControlExtension()

setControlExtension(options): void

Parameters

ParameterType
optionsISelectionShapeExtensionOption

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:501


setEvent()

setEvent(state): void

Parameters

ParameterType
stateboolean

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:505


update()

update(
   newSelectionRange, 
   rowHeaderWidth, 
   columnHeaderHeight, 
   style?, 
   primaryCell?): void

Update selection model with new range & primary cell(aka: highlight/current), also update row/col selection size & style.

Parameters

ParameterTypeDefault valueDescription
newSelectionRangeIRangeWithCoordundefined-
rowHeaderWidthnumber0-
columnHeaderHeightnumber0-
style?Nullable<ISelectionStyle>undefined-
primaryCell?Nullable<ICellWithCoord>undefinedprimary cell

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:699


updateCurrCell()

updateCurrCell(primaryCell): void

update primary range

Parameters

ParameterTypeDescription
primaryCellNullable<ICellWithCoord>model.current (aka: highlight)

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:722


updateRange()

updateRange(range, primaryCell): void

Update range, primary may be null, especially for moving handler.

Parameters

ParameterType
rangeIRangeWithCoord
primaryCellNullable<ICellWithCoord>

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:671


updateRangeBySelectionWithCoord()

updateRangeBySelectionWithCoord(selectionWthCoord): void

Parameters

ParameterType
selectionWthCoordISelectionWithCoord

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:678


updateStyle()

updateStyle(style): void

Parameters

ParameterType
stylePartial<ISelectionStyle>

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:661