@univerjs/sheets v0.5.0-beta.1 • Docs
Class: WorkbookSelectionModel
Origin name: WorkbookSelections NOT Same as @univerjs/sheets-ui.SelectionRenderModel, that’s data for SelectionControl in rendering.
Extends
Constructors
new WorkbookSelectionModel()
new WorkbookSelectionModel(_workbook): WorkbookSelectionModel
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
Returns
Overrides
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:49
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_selectionMoveEnd$ | readonly | BehaviorSubject <ISelectionWithStyle []> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:40 |
beforeSelectionMoveEnd$ | readonly | Observable <ISelectionWithStyle []> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:47 |
selectionMoveEnd$ | readonly | Observable <ISelectionWithStyle []> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:41 |
selectionMoveStart$ | readonly | Observable <Nullable <ISelectionWithStyle []>> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:35 |
selectionMoving$ | readonly | Observable <Nullable <ISelectionWithStyle []>> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:38 |
selectionSet$ | readonly | Observable <ISelectionWithStyle []> | undefined | - | submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:44 |
Methods
addSelections()
addSelections(sheetId, selectionDatas): void
Parameters
Parameter | Type |
---|---|
sheetId | string |
selectionDatas | ISelectionWithStyle [] |
Returns
void
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:71
clear()
clear(): void
Clear all selections in this workbook.
Returns
void
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:66
deleteSheetSelection()
deleteSheetSelection(sheetId): void
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
void
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:155
dispose()
dispose(): void
Returns
void
Overrides
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:55
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:100
getCurrentLastSelection()
getCurrentLastSelection(): Readonly<Nullable<ISelectionWithStyle & {
primary: ISelectionCell;
}>>
Returns
Readonly
<Nullable
<ISelectionWithStyle
& {
primary
: ISelectionCell
;
}>>
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:137
getCurrentSelections()
getCurrentSelections(): readonly ISelectionWithStyle[]
Returns
readonly ISelectionWithStyle
[]
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:112
getSelectionOfWorksheet()
getSelectionOfWorksheet(sheetId): ISelectionWithStyle[]
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
Deprecated
use getSelectionsOfWorksheet
instead.
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:121
getSelectionsOfWorksheet()
getSelectionsOfWorksheet(sheetId): ISelectionWithStyle[]
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:125
setSelections()
setSelections(
sheetId,
selectionDatas,
type): void
Set selectionDatas to _worksheetSelections, and emit selectionDatas by type.
Parameters
Parameter | Type | Default value |
---|---|---|
sheetId | string | undefined |
selectionDatas | ISelectionWithStyle [] | [] |
type | SelectionMoveType | undefined |
Returns
void
Defined in
submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:83