@univerjs/sheets-ui v0.5.4


Class: SelectionControl

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:80

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

Extends

Constructors

new SelectionControl()

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

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:154

Parameters

ParameterType
_sceneScene
_zIndexnumber
_themeServiceThemeService
options?{ columnHeaderHeight: number; enableAutoFill: boolean; highlightHeader: boolean; rangeType: RANGE_TYPE; rowHeaderWidth: number; }
options.columnHeaderHeight?number
options.enableAutoFill?boolean
options.highlightHeader?boolean
options.rangeType?RANGE_TYPE
options.rowHeaderWidth?number

Returns

SelectionControl

Overrides

Disposable.constructor

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:136
_disposedprotectedbooleanfalse-Disposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_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:155
_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:157
_widgetRectsprotectedRect[][]--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:135
_zIndexprotectednumberundefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:156
dispose$readonlyObservable<SelectionControl>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:139
selectionFilled$readonlyObservable<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:152
selectionFilling$readonlySubject<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:149
selectionMoveEnd$readonlySubject<IRangeWithCoord>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:146
selectionMoving$readonlySubject<IRangeWithCoord>undefinedeventSource: selectionShapeExtension selectionMoving$.next, Observer: prompt.controller-submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:145
selectionScaled$readonlySubject<Nullable<IRangeWithCoord>>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:148
selectionScaling$readonlySubject<IRangeWithCoord>undefined--submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:147

Accessors

backgroundControlBottom

Get Signature

get backgroundControlBottom(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:382

Returns

Rect


backgroundControlMiddleLeft

Get Signature

get backgroundControlMiddleLeft(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:386

Returns

Rect


backgroundControlMiddleRight

Get Signature

get backgroundControlMiddleRight(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:390

Returns

Rect


backgroundControlTop

Get Signature

get backgroundControlTop(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:378

Returns

Rect


bottomCenterWidget

Get Signature

get bottomCenterWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:439

Returns

Rect


bottomControl

Get Signature

get bottomControl(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:370

Returns

Rect


bottomLeftWidget

Get Signature

get bottomLeftWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:435

Returns

Rect


bottomRightWidget

Get Signature

get bottomRightWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:443

Returns

Rect


columnHeaderGroup

Get Signature

get columnHeaderGroup(): Group

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:398

Returns

Group


columnHeaderHeight

Get Signature

get columnHeaderHeight(): number

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:491

Returns

number

Set Signature

set columnHeaderHeight(height): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:495

Parameters
ParameterType
heightnumber
Returns

void


currentStyle

Get Signature

get currentStyle(): ISelectionStyle

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:467

Returns

ISelectionStyle

Set Signature

set currentStyle(style): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:471

Parameters
ParameterType
styleISelectionStyle
Returns

void


dashedRect

Get Signature

get dashedRect(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:475

Returns

Rect


fillControl

Get Signature

get fillControl(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:374

Returns

Rect


isHelperSelection

Get Signature

get isHelperSelection(): boolean

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:479

Returns

boolean


leftControl

Get Signature

get leftControl(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:358

Returns

Rect


middleLeftWidget

Get Signature

get middleLeftWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:427

Returns

Rect


middleRightWidget

Get Signature

get middleRightWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:431

Returns

Rect


model

Get Signature

get model(): SelectionRenderModel

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:411

Returns

SelectionRenderModel


rightControl

Get Signature

get rightControl(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:362

Returns

Rect


rowHeaderGroup

Get Signature

get rowHeaderGroup(): Group

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:402

Returns

Group


rowHeaderWidth

Get Signature

get rowHeaderWidth(): number

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:483

Returns

number

Set Signature

set rowHeaderWidth(width): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:487

Parameters
ParameterType
widthnumber
Returns

void


selectionModel

Get Signature

get selectionModel(): SelectionRenderModel

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:451

Returns

SelectionRenderModel

Set Signature

set selectionModel(model): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:455

Parameters
ParameterType
modelSelectionRenderModel
Returns

void


selectionShape

Get Signature

get selectionShape(): Group

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:394

Returns

Group


selectionShapeGroup

Get Signature

get selectionShapeGroup(): Group

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:406

Returns

Group


themeService

Get Signature

get themeService(): ThemeService

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:447

Returns

ThemeService


topCenterWidget

Get Signature

get topCenterWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:419

Returns

Rect


topControl

Get Signature

get topControl(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:366

Returns

Rect


topLeftWidget

Get Signature

get topLeftWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:415

Returns

Rect


topRightWidget

Get Signature

get topRightWidget(): Rect

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:423

Returns

Rect


zIndex

Get Signature

get zIndex(): number

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:354

Returns

number

Methods

_hasWidgets()

protected _hasWidgets(widgets): boolean

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:1070

Parameters

ParameterType
widgetsISelectionWidgetConfig

Returns

boolean


_updateControlCoord()

protected _updateControlCoord(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:651

update selection control coordination by curr selection model

Returns

void


_updateLayoutOfSelectionControl()

protected _updateLayoutOfSelectionControl(selectionStyle?): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:518

Update Control Style And Position of SelectionControl

Parameters

ParameterType
selectionStyle?Nullable<Partial<ISelectionStyle>>

Returns

void


clearHighlight()

clearHighlight(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:737

Returns

void


disableHelperSelection()

disableHelperSelection(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:841

Returns

void


dispose()

dispose(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:749

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


enableHelperSelection()

enableHelperSelection(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:837

Returns

void


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getCurrentCellInfo()

getCurrentCellInfo(): Nullable<IRangeWithCoord>

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:789

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

Returns

Nullable<IRangeWithCoord>


getRange()

getRange(): IRangeWithCoord

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:833

Returns

IRangeWithCoord


getScene()

getScene(): Scene

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:744

Returns

Scene


getValue()

getValue(): ISelectionWithCoord

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:826

Returns

ISelectionWithCoord


refreshSelectionFilled()

refreshSelectionFilled(val): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:510

Parameters

ParameterType
valIRangeWithCoord

Returns

void


setControlExtension()

setControlExtension(options): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:499

Parameters

ParameterType
optionsISelectionShapeExtensionOption

Returns

void


setEvent()

setEvent(state): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:503

Parameters

ParameterType
stateboolean

Returns

void


update()

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

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:702

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

Deprecated

use updateRangeBySelectionWithCoord and updateStyle to do same thing.


updateCurrCell()

updateCurrCell(primaryCell): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:731

Update primary range. highlight cell would update if primary cell has value. highlight cell would be cleared if primary cell is null. highlight would keep prev value if primary cell is undefined.

Parameters

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

Returns

void


updateRange()

updateRange(rangeWithCoord, primaryWithCoord): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:672

Update range and primary range.

highlight cell would update if primaryWithCoord has value. highlight cell would be cleared if primaryWithCoord is null. highlight would keep prev value if primaryWithCoord is undefined.

Parameters

ParameterType
rangeWithCoordIRangeWithCoord
primaryWithCoordNullable<ICellWithCoord>

Returns

void


updateRangeBySelectionWithCoord()

updateRangeBySelectionWithCoord(selectionWthCoord): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:683

Update range and primary range and style.

Parameters

ParameterType
selectionWthCoordISelectionWithCoord

Returns

void


updateStyle()

updateStyle(style): void

Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:658

Parameters

ParameterType
stylePartial<ISelectionStyle>

Returns

void