Class: WorkbookSelectionModel
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:28
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
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:49
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_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
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:65
Parameters
Parameter | Type |
---|---|
sheetId | string |
selectionDatas | ISelectionWithStyle [] |
Returns
void
clear()
clear(): void
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:135
Clear all selections in this workbook.
Returns
void
deleteSheetSelection()
deleteSheetSelection(sheetId): void
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:130
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
void
dispose()
dispose(): void
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:55
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
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
getCurrentLastSelection()
getCurrentLastSelection(): Readonly<Nullable<ISelectionWithStyle & {
primary: ISelectionCell;
}>>
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:144
Returns
Readonly
<Nullable
<ISelectionWithStyle
& {
primary
: ISelectionCell
;
}>>
getCurrentSelections()
getCurrentSelections(): readonly ISelectionWithStyle[]
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:105
Returns
readonly ISelectionWithStyle
[]
getSelectionOfWorksheet()
getSelectionOfWorksheet(sheetId): ISelectionWithStyle[]
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:114
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
Deprecated
use getSelectionsOfWorksheet
instead.
getSelectionsOfWorksheet()
getSelectionsOfWorksheet(sheetId): ISelectionWithStyle[]
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:118
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
setSelections()
setSelections(
sheetId,
selectionDatas,
type): void
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:77
Set selectionDatas to _worksheetSelections, and emit selectionDatas by type.
Parameters
Parameter | Type | Default value |
---|---|---|
sheetId | string | undefined |
selectionDatas | ISelectionWithStyle [] | [] |
type | SelectionMoveType | undefined |
Returns
void
setSelectionsOfWorksheet()
setSelectionsOfWorksheet(sheetId, selections): void
Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:126
Parameters
Parameter | Type |
---|---|
sheetId | string |
selections | ISelectionWithStyle [] |
Returns
void