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
Parameter | Type |
---|---|
_scene | Scene |
_zIndex | number |
_themeService | ThemeService |
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
Overrides
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:136 |
_disposed | protected | boolean | false | - | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_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:155 |
_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:157 |
_widgetRects | protected | Rect [] | [] | - | - | 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:156 |
dispose$ | readonly | Observable <SelectionControl > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:139 |
selectionFilled$ | readonly | Observable <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:152 |
selectionFilling$ | readonly | Subject <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:149 |
selectionMoveEnd$ | readonly | Subject <IRangeWithCoord > | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:146 |
selectionMoving$ | readonly | Subject <IRangeWithCoord > | undefined | eventSource: selectionShapeExtension selectionMoving$.next, Observer: prompt.controller | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:145 |
selectionScaled$ | readonly | Subject <Nullable <IRangeWithCoord >> | undefined | - | - | submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:148 |
selectionScaling$ | readonly | Subject <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
backgroundControlMiddleLeft
Get Signature
get backgroundControlMiddleLeft(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:386
Returns
backgroundControlMiddleRight
Get Signature
get backgroundControlMiddleRight(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:390
Returns
backgroundControlTop
Get Signature
get backgroundControlTop(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:378
Returns
bottomCenterWidget
Get Signature
get bottomCenterWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:439
Returns
bottomControl
Get Signature
get bottomControl(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:370
Returns
bottomLeftWidget
Get Signature
get bottomLeftWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:435
Returns
bottomRightWidget
Get Signature
get bottomRightWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:443
Returns
columnHeaderGroup
Get Signature
get columnHeaderGroup(): Group
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:398
Returns
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
Parameter | Type |
---|---|
height | number |
Returns
void
currentStyle
Get Signature
get currentStyle(): ISelectionStyle
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:467
Returns
Set Signature
set currentStyle(style): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:471
Parameters
Parameter | Type |
---|---|
style | ISelectionStyle |
Returns
void
dashedRect
Get Signature
get dashedRect(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:475
Returns
fillControl
Get Signature
get fillControl(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:374
Returns
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
middleLeftWidget
Get Signature
get middleLeftWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:427
Returns
middleRightWidget
Get Signature
get middleRightWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:431
Returns
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
rowHeaderGroup
Get Signature
get rowHeaderGroup(): Group
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:402
Returns
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
Parameter | Type |
---|---|
width | number |
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
Parameter | Type |
---|---|
model | SelectionRenderModel |
Returns
void
selectionShape
Get Signature
get selectionShape(): Group
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:394
Returns
selectionShapeGroup
Get Signature
get selectionShapeGroup(): Group
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:406
Returns
themeService
Get Signature
get themeService(): ThemeService
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:447
Returns
topCenterWidget
Get Signature
get topCenterWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:419
Returns
topControl
Get Signature
get topControl(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:366
Returns
topLeftWidget
Get Signature
get topLeftWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:415
Returns
topRightWidget
Get Signature
get topRightWidget(): Rect
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:423
Returns
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
Parameter | Type |
---|---|
widgets | ISelectionWidgetConfig |
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
Parameter | Type |
---|---|
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
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
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
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
getRange()
getRange(): IRangeWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:833
Returns
getScene()
getScene(): Scene
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:744
Returns
getValue()
getValue(): ISelectionWithCoord
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:826
Returns
refreshSelectionFilled()
refreshSelectionFilled(val): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:510
Parameters
Parameter | Type |
---|---|
val | IRangeWithCoord |
Returns
void
setControlExtension()
setControlExtension(options): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:499
Parameters
Parameter | Type |
---|---|
options | ISelectionShapeExtensionOption |
Returns
void
setEvent()
setEvent(state): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:503
Parameters
Parameter | Type |
---|---|
state | boolean |
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
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
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
Parameter | Type | Description |
---|---|---|
primaryCell | Nullable <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
Parameter | Type |
---|---|
rangeWithCoord | IRangeWithCoord |
primaryWithCoord | Nullable <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
Parameter | Type |
---|---|
selectionWthCoord | ISelectionWithCoord |
Returns
void
updateStyle()
updateStyle(style): void
Defined in: submodules/univer/packages/sheets-ui/src/services/selection/selection-control.ts:658
Parameters
Parameter | Type |
---|---|
style | Partial <ISelectionStyle > |
Returns
void