@univerjs/sheets-ui v0.4.2 • 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,
_highlightHeader,
options?): SelectionShape
Parameters
Parameter | Type | Default value |
---|---|---|
_scene | Scene | undefined |
_zIndex | number | undefined |
_themeService | ThemeService | undefined |
_highlightHeader | boolean | true |
options ? | object | undefined |
options.columnHeaderHeight ? | number | undefined |
options.rowHeaderWidth ? | number | undefined |
Returns
Overrides
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:145 (opens in a new tab)
Properties
Accessors
backgroundControlBottom
get backgroundControlBottom(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:189 (opens in a new tab)
backgroundControlMiddleLeft
get backgroundControlMiddleLeft(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:193 (opens in a new tab)
backgroundControlMiddleRight
get backgroundControlMiddleRight(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:197 (opens in a new tab)
backgroundControlTop
get backgroundControlTop(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:185 (opens in a new tab)
bottomCenterWidget
get bottomCenterWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:245 (opens in a new tab)
bottomControl
get bottomControl(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:177 (opens in a new tab)
bottomLeftWidget
get bottomLeftWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:241 (opens in a new tab)
bottomRightWidget
get bottomRightWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:249 (opens in a new tab)
columnHeaderGroup
get columnHeaderGroup(): Group
Returns
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
Parameter | Type |
---|---|
height | number |
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
Parameter | Type |
---|---|
style | Nullable <ISelectionStyle > |
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:277 (opens in a new tab)
dashedRect
get dashedRect(): Rect<IRectProps>
Returns
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
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:265 (opens in a new tab)
fillControl
get fillControl(): Rect<IRectProps>
Returns
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
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:165 (opens in a new tab)
middleLeftWidget
get middleLeftWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:233 (opens in a new tab)
middleRightWidget
get middleRightWidget(): Rect<IRectProps>
Returns
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
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:169 (opens in a new tab)
rowHeaderGroup
get rowHeaderGroup(): Group
Returns
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
Parameter | Type |
---|---|
width | number |
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
Parameter | Type |
---|---|
model | SelectionRenderModel |
Returns
SelectionRenderModel
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:257 (opens in a new tab)
selectionShape
get selectionShape(): Group
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:201 (opens in a new tab)
selectionShapeGroup
get selectionShapeGroup(): Group
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:213 (opens in a new tab)
themeService
get themeService(): ThemeService
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:253 (opens in a new tab)
topCenterWidget
get topCenterWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:225 (opens in a new tab)
topControl
get topControl(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:173 (opens in a new tab)
topLeftWidget
get topLeftWidget(): Rect<IRectProps>
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:221 (opens in a new tab)
topRightWidget
get topRightWidget(): Rect<IRectProps>
Returns
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
Parameter | Type |
---|---|
widgets | ISelectionWidgetConfig |
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
Parameter | Type |
---|---|
selectionStyle | ISelectionStyle |
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
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:519 (opens in a new tab)
disposeWithMe()
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)
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
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
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:557 (opens in a new tab)
getRange()
getRange(): IRangeWithCoord
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:601 (opens in a new tab)
getScene()
getScene(): Scene
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:514 (opens in a new tab)
getValue()
getValue(): ISelectionWithCoordAndStyle
Returns
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:594 (opens in a new tab)
refreshSelectionFilled()
refreshSelectionFilled(val): void
Parameters
Parameter | Type |
---|---|
val | IRangeWithCoord |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:314 (opens in a new tab)
setEvent()
setEvent(state): void
Parameters
Parameter | Type |
---|---|
state | boolean |
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
Parameter | Type | Default value | Description |
---|---|---|---|
newSelectionRange | IRangeWithCoord | undefined | - |
rowHeaderWidth | number | 0 | - |
columnHeaderHeight | number | 0 | - |
style ? | Nullable <ISelectionStyle > | undefined | - |
primaryCell ? | Nullable <ISelectionCellWithMergeInfo > | undefined | primary 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
Parameter | Type | Description |
---|---|---|
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
Parameter | Type |
---|---|
range | IRangeWithCoord |
primaryCell | Nullable <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
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
Defined in
packages/sheets-ui/src/services/selection/selection-control.ts:466 (opens in a new tab)