@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
Parameter | Type |
---|---|
_scene | Scene |
_zIndex | number |
_themeService | ThemeService |
options ? | object |
options.columnHeaderHeight ? | number |
options.enableAutoFill ? | boolean |
options.highlightHeader ? | boolean |
options.rangeType ? | RANGE_TYPE |
options.rowHeaderWidth ? | number |
Returns
Overrides
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:155
Properties
Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
---|---|---|---|---|---|---|
_columnHeaderHeight | protected | number | 0 | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:133 |
_controlExtension | protected | Nullable <SelectionShapeExtension > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:137 |
_disposed | protected | boolean | false | - | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_enableAutoFill | protected | boolean | true | For ref selections, there is no auto fill. | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:86 |
_highlightHeader | protected | boolean | true | If rowHeader & col Header would be highlighted with selection. | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:96 |
_rowHeaderWidth | protected | number | 0 | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:132 |
_scene | protected | Scene | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:156 |
_selectionRenderModel | protected | SelectionRenderModel | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:98 |
_themeService | readonly | ThemeService | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:158 |
_widgetRects | protected | Rect <IRectProps >[] | [] | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:135 |
_zIndex | protected | number | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:157 |
dispose$ | readonly | Observable <SelectionShape > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:140 |
selectionFilled$ | readonly | Observable <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:153 |
selectionFilling$ | readonly | Subject <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:150 |
selectionMoved$ | readonly | Subject <IRangeWithCoord > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:147 |
selectionMoving$ | readonly | Subject <IRangeWithCoord > | undefined | eventSource: selectionShapeExtension selectionMoving$.next, Observer: prompt.controller | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:146 |
selectionScaled$ | readonly | Subject <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:149 |
selectionScaling$ | readonly | Subject <IRangeWithCoord > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:148 |
Accessors
backgroundControlBottom
Get Signature
get backgroundControlBottom(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:384
backgroundControlMiddleLeft
Get Signature
get backgroundControlMiddleLeft(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:388
backgroundControlMiddleRight
Get Signature
get backgroundControlMiddleRight(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:392
backgroundControlTop
Get Signature
get backgroundControlTop(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:380
bottomCenterWidget
Get Signature
get bottomCenterWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:441
bottomControl
Get Signature
get bottomControl(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:372
bottomLeftWidget
Get Signature
get bottomLeftWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:437
bottomRightWidget
Get Signature
get bottomRightWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:445
columnHeaderGroup
Get Signature
get columnHeaderGroup(): Group
Returns
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
Parameter | Type |
---|---|
height | number |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:493
currentStyle
Get Signature
get currentStyle(): ISelectionStyle
Returns
Set Signature
set currentStyle(style): void
Parameters
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:469
dashedRect
Get Signature
get dashedRect(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:477
fillControl
Get Signature
get fillControl(): Rect<IRectProps>
Returns
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
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:360
middleLeftWidget
Get Signature
get middleLeftWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:429
middleRightWidget
Get Signature
get middleRightWidget(): Rect<IRectProps>
Returns
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
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:364
rowHeaderGroup
Get Signature
get rowHeaderGroup(): Group
Returns
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
Parameter | Type |
---|---|
width | number |
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
Parameter | Type |
---|---|
model | SelectionRenderModel |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:453
selectionShape
Get Signature
get selectionShape(): Group
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:396
selectionShapeGroup
Get Signature
get selectionShapeGroup(): Group
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:408
themeService
Get Signature
get themeService(): ThemeService
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:449
topCenterWidget
Get Signature
get topCenterWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:421
topControl
Get Signature
get topControl(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:368
topLeftWidget
Get Signature
get topLeftWidget(): Rect<IRectProps>
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:417
topRightWidget
Get Signature
get topRightWidget(): Rect<IRectProps>
Returns
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
Parameter | Type |
---|---|
widgets | ISelectionWidgetConfig |
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
Parameter | Type |
---|---|
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
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:740
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
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
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
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:780
getRange()
getRange(): IRangeWithCoord
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:824
getScene()
getScene(): Scene
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:735
getValue()
getValue(): ISelectionWithCoord
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:817
refreshSelectionFilled()
refreshSelectionFilled(val): void
Parameters
Parameter | Type |
---|---|
val | IRangeWithCoord |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:512
setControlExtension()
setControlExtension(options): void
Parameters
Parameter | Type |
---|---|
options | ISelectionShapeExtensionOption |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:501
setEvent()
setEvent(state): void
Parameters
Parameter | Type |
---|---|
state | boolean |
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
Parameter | Type | Default value | Description |
---|---|---|---|
newSelectionRange | IRangeWithCoord | undefined | - |
rowHeaderWidth | number | 0 | - |
columnHeaderHeight | number | 0 | - |
style ? | Nullable <ISelectionStyle > | undefined | - |
primaryCell ? | Nullable <ICellWithCoord > | undefined | primary 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
Parameter | Type | Description |
---|---|---|
primaryCell | Nullable <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
Parameter | Type |
---|---|
range | IRangeWithCoord |
primaryCell | Nullable <ICellWithCoord > |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:671
updateRangeBySelectionWithCoord()
updateRangeBySelectionWithCoord(selectionWthCoord): void
Parameters
Parameter | Type |
---|---|
selectionWthCoord | ISelectionWithCoord |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:678
updateStyle()
updateStyle(style): void
Parameters
Parameter | Type |
---|---|
style | Partial <ISelectionStyle > |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:661