API Reference
@univerjs
@univerjs/sheets-ui
classes
Selectionshape

@univerjs/sheets-ui v0.4.2Docs


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, 
   _highlightHeader, 
   options?): SelectionShape

Parameters

ParameterTypeDefault value
_sceneSceneundefined
_zIndexnumberundefined
_themeServiceThemeServiceundefined
_highlightHeaderbooleantrue
options?objectundefined
options.columnHeaderHeight?numberundefined
options.rowHeaderWidth?numberundefined

Returns

SelectionShape

Overrides

Disposable.constructor

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:145 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_columnHeaderHeightprotectednumber0--packages/sheets-ui/src/services/selection/selection-control.ts:122 (opens in a new tab)
_disposedprotectedbooleanfalse-Disposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_highlightHeaderprotectedbooleantrue--packages/sheets-ui/src/services/selection/selection-control.ts:149 (opens in a new tab)
_rowHeaderWidthprotectednumber0--packages/sheets-ui/src/services/selection/selection-control.ts:121 (opens in a new tab)
_sceneprotectedSceneundefined--packages/sheets-ui/src/services/selection/selection-control.ts:146 (opens in a new tab)
_selectionModelprotectedSelectionRenderModelundefined--packages/sheets-ui/src/services/selection/selection-control.ts:114 (opens in a new tab)
_themeServicereadonlyThemeServiceundefined--packages/sheets-ui/src/services/selection/selection-control.ts:148 (opens in a new tab)
_widgetRectsprotectedRect<IRectProps>[][]--packages/sheets-ui/src/services/selection/selection-control.ts:124 (opens in a new tab)
_zIndexprotectednumberundefined--packages/sheets-ui/src/services/selection/selection-control.ts:147 (opens in a new tab)
dispose$readonlyObservable<SelectionShape>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:127 (opens in a new tab)
selectionFilled$readonlyObservable<Nullable<IRangeWithCoord>>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:141 (opens in a new tab)
selectionFilling$readonlySubject<Nullable<IRangeWithCoord>>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:137 (opens in a new tab)
selectionMoved$readonlySubject<IRangeWithCoord>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:134 (opens in a new tab)
selectionMoving$readonlySubject<IRangeWithCoord>undefinedeventSource: selectionShapeExtension selectionMoving$.next, Observer: prompt.controller-packages/sheets-ui/src/services/selection/selection-control.ts:133 (opens in a new tab)
selectionScaled$readonlySubject<Nullable<IRangeWithCoord>>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:136 (opens in a new tab)
selectionScaling$readonlySubject<IRangeWithCoord>undefined--packages/sheets-ui/src/services/selection/selection-control.ts:135 (opens in a new tab)

Accessors

backgroundControlBottom

get backgroundControlBottom(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:189 (opens in a new tab)


backgroundControlMiddleLeft

get backgroundControlMiddleLeft(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:193 (opens in a new tab)


backgroundControlMiddleRight

get backgroundControlMiddleRight(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:197 (opens in a new tab)


backgroundControlTop

get backgroundControlTop(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:185 (opens in a new tab)


bottomCenterWidget

get bottomCenterWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:245 (opens in a new tab)


bottomControl

get bottomControl(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:177 (opens in a new tab)


bottomLeftWidget

get bottomLeftWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:241 (opens in a new tab)


bottomRightWidget

get bottomRightWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:249 (opens in a new tab)


columnHeaderGroup

get columnHeaderGroup(): Group

Returns

Group

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:205 (opens in a new tab)


columnHeaderHeight

get columnHeaderHeight(): number
set columnHeaderHeight(height): void

Parameters

ParameterType
heightnumber

Returns

number

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:299 (opens in a new tab)


currentStyle

get currentStyle(): Nullable<ISelectionStyle>
set currentStyle(style): void

Parameters

ParameterType
styleNullable<ISelectionStyle>

Returns

Nullable<ISelectionStyle>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:277 (opens in a new tab)


dashedRect

get dashedRect(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:273 (opens in a new tab)


defaultStyle

get defaultStyle(): ISelectionStyle
set defaultStyle(style): void

Parameters

ParameterType
styleISelectionStyle

Returns

ISelectionStyle

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:265 (opens in a new tab)


fillControl

get fillControl(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:181 (opens in a new tab)


isHelperSelection

get isHelperSelection(): boolean

Returns

boolean

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:287 (opens in a new tab)


leftControl

get leftControl(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:165 (opens in a new tab)


middleLeftWidget

get middleLeftWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:233 (opens in a new tab)


middleRightWidget

get middleRightWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:237 (opens in a new tab)


model

get model(): SelectionRenderModel

Returns

SelectionRenderModel

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:217 (opens in a new tab)


rightControl

get rightControl(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:169 (opens in a new tab)


rowHeaderGroup

get rowHeaderGroup(): Group

Returns

Group

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:209 (opens in a new tab)


rowHeaderWidth

get rowHeaderWidth(): number
set rowHeaderWidth(width): void

Parameters

ParameterType
widthnumber

Returns

number

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:291 (opens in a new tab)


selectionModel

get selectionModel(): SelectionRenderModel
set selectionModel(model): void

Parameters

ParameterType
modelSelectionRenderModel

Returns

SelectionRenderModel

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:257 (opens in a new tab)


selectionShape

get selectionShape(): Group

Returns

Group

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:201 (opens in a new tab)


selectionShapeGroup

get selectionShapeGroup(): Group

Returns

Group

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:213 (opens in a new tab)


themeService

get themeService(): ThemeService

Returns

ThemeService

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:253 (opens in a new tab)


topCenterWidget

get topCenterWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:225 (opens in a new tab)


topControl

get topControl(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:173 (opens in a new tab)


topLeftWidget

get topLeftWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:221 (opens in a new tab)


topRightWidget

get topRightWidget(): Rect<IRectProps>

Returns

Rect<IRectProps>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:229 (opens in a new tab)


zIndex

get zIndex(): number

Returns

number

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:161 (opens in a new tab)

Methods

_hasWidgets()

protected _hasWidgets(widgets): boolean

Parameters

ParameterType
widgetsISelectionWidgetConfig

Returns

boolean

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:1035 (opens in a new tab)


_refreshControlPosition()

protected _refreshControlPosition(): void

update selection control position by curr selection model

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:459 (opens in a new tab)


_setSizeAndStyleForSelectionControl()

protected _setSizeAndStyleForSelectionControl(selectionStyle): void

Update Control Style And Position of SelectionControl

Parameters

ParameterType
selectionStyleISelectionStyle

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:323 (opens in a new tab)


clearHighlight()

clearHighlight(): void

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:509 (opens in a new tab)


disableHelperSelection()

disableHelperSelection(): void

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:609 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:519 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


enableHelperSelection()

enableHelperSelection(): void

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:605 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getCurrentCellInfo()

getCurrentCellInfo(): Nullable<IRangeWithCoord>

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

Returns

Nullable<IRangeWithCoord>

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:557 (opens in a new tab)


getRange()

getRange(): IRangeWithCoord

Returns

IRangeWithCoord

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:601 (opens in a new tab)


getScene()

getScene(): Scene

Returns

Scene

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:514 (opens in a new tab)


getValue()

getValue(): ISelectionWithCoordAndStyle

Returns

ISelectionWithCoordAndStyle

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:594 (opens in a new tab)


refreshSelectionFilled()

refreshSelectionFilled(val): void

Parameters

ParameterType
valIRangeWithCoord

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:314 (opens in a new tab)


setEvent()

setEvent(state): void

Parameters

ParameterType
stateboolean

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:307 (opens in a new tab)


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<ISelectionCellWithMergeInfo>undefinedprimary cell

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:486 (opens in a new tab)


updateCurrCell()

updateCurrCell(primaryCell?): void

update primary range

Parameters

ParameterTypeDescription
primaryCell?Nullable<ISelectionCellWithMergeInfo>model.current (aka: highlight)

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:505 (opens in a new tab)


updateRange()

updateRange(range, primaryCell): void

Parameters

ParameterType
rangeIRangeWithCoord
primaryCellNullable<ISelectionCellWithMergeInfo>

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:471 (opens in a new tab)


updateStyle()

updateStyle(style): void

Parameters

ParameterType
styleISelectionStyle

Returns

void

Defined in

packages/sheets-ui/src/services/selection/selection-control.ts:466 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.