@univerjssheets-uifacadeclassesFworokbooksheetsuimixin

@univerjs/sheets-ui v0.5.1Docs


Class: FWorokbookSheetsUIMixin

FBase is a base class for all facade classes. It provides a way to extend classes with static and instance methods. The _initialize as a special method that will be called after the constructor. You should never call it directly.

Extends

Implements

Constructors

new FWorokbookSheetsUIMixin()

new FWorokbookSheetsUIMixin(
   _workbook, 
   _injector, 
   _resourceLoaderService, 
   _selectionManagerService, 
   _univerInstanceService, 
   _commandService, 
   _permissionService, 
   _logService): FWorokbookSheetsUIMixin

Parameters

ParameterType
_workbookWorkbook
_injectorInjector
_resourceLoaderServiceIResourceLoaderService
_selectionManagerServiceSheetsSelectionsService
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_permissionServiceIPermissionService
_logServiceILogService

Returns

FWorokbookSheetsUIMixin

Inherited from

FWorkbook.constructor

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:27

Properties

PropertyModifierTypeInherited fromDefined in
_commandServicereadonlyICommandServiceFWorkbook._commandServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:33
_injectorreadonlyInjectorFWorkbook._injectorsubmodules/univer/packages/sheets/src/facade/f-workbook.ts:29
_logServicereadonlyILogServiceFWorkbook._logServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:35
_permissionServicereadonlyIPermissionServiceFWorkbook._permissionServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:34
_resourceLoaderServicereadonlyIResourceLoaderServiceFWorkbook._resourceLoaderServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:30
_selectionManagerServicereadonlySheetsSelectionsServiceFWorkbook._selectionManagerServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:31
_univerInstanceServicereadonlyIUniverInstanceServiceFWorkbook._univerInstanceServicesubmodules/univer/packages/sheets/src/facade/f-workbook.ts:32
_workbookreadonlyWorkbookFWorkbook._workbooksubmodules/univer/packages/sheets/src/facade/f-workbook.ts:28
idreadonlystringFWorkbook.idsubmodules/univer/packages/sheets/src/facade/f-workbook.ts:25

Methods

_initialize()

_initialize(): void

Returns

void

Inherited from

FWorkbook._initialize

Defined in

submodules/univer/packages/core/src/facade/f-base.ts:33


create()

create(
   name, 
   rows, 
   column): FWorksheet

Create a new worksheet and returns a handle to it.

Parameters

ParameterTypeDescription
namestringName of the new sheet
rowsnumberHow may rows would the new sheet have
columnnumberHow many columns would the new sheet have

Returns

FWorksheet

The new created sheet

Inherited from

FWorkbook.create

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:94


deleteSheet()

deleteSheet(sheet): void

Deletes the specified worksheet.

Parameters

ParameterTypeDescription
sheetFWorksheetThe worksheet to delete.

Returns

void

Inherited from

FWorkbook.deleteSheet

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:189


endEditing()

endEditing(save?): Promise<boolean>

End the editing process

Parameters

ParameterTypeDescription
save?booleanWhether to save the changes

Returns

Promise<boolean>

A promise that resolves to a boolean value

Async

Implementation of

IFWorkbookSheetsUIMixin.endEditing

Overrides

FWorkbook.endEditing

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:133


getActiveRange()

getActiveRange(): null | FRange

Returns the selected range in the active sheet, or null if there is no active range.

Returns

null | FRange

the active range

Inherited from

FWorkbook.getActiveRange

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:303


getActiveSheet()

getActiveSheet(): FWorksheet

Get the active sheet of the workbook.

Returns

FWorksheet

The active sheet of the workbook

Inherited from

FWorkbook.getActiveSheet

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:72


getId()

getId(): string

Returns

string

Inherited from

FWorkbook.getId

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:42


getName()

getName(): string

Returns

string

Inherited from

FWorkbook.getName

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:46


getSheetByName()

getSheetByName(name): null | FWorksheet

Get a worksheet by sheet name.

Parameters

ParameterTypeDescription
namestringThe name of the sheet to get.

Returns

null | FWorksheet

The worksheet with given sheet name

Inherited from

FWorkbook.getSheetByName

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:139


getSheetBySheetId()

getSheetBySheetId(sheetId): null | FWorksheet

Get a worksheet by sheet id.

Parameters

ParameterTypeDescription
sheetIdstringThe id of the sheet to get.

Returns

null | FWorksheet

The worksheet with given sheet id

Inherited from

FWorkbook.getSheetBySheetId

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:125


getSheets()

getSheets(): FWorksheet[]

Gets all the worksheets in this workbook

Returns

FWorksheet[]

An array of all the worksheets in the workbook

Inherited from

FWorkbook.getSheets

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:81


getSnapshot()

getSnapshot(): IWorkbookData

Returns

IWorkbookData

{IWorkbookData}

Deprecated

use ‘save’ instead.

Memberof

FWorkbook

Inherited from

FWorkbook.getSnapshot

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:63


insertSheet()

insertSheet(): FWorksheet

Inserts a new worksheet into the workbook. Using a default sheet name. The new sheet becomes the active sheet

Returns

FWorksheet

The new sheet

Inherited from

FWorkbook.insertSheet

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:167


onBeforeCommandExecute()

onBeforeCommandExecute(callback): IDisposable

Register a callback that will be triggered before invoking a command targeting the Univer sheet.

Parameters

ParameterTypeDescription
callbackCommandListenerthe callback.

Returns

IDisposable

A function to dispose the listening.

Inherited from

FWorkbook.onBeforeCommandExecute

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:215


onCellClick()

onCellClick(callback): IDisposable

Subscribe to cell click events

Parameters

ParameterTypeDescription
callback(cell) => voidThe callback function to be called when a cell is clicked

Returns

IDisposable

A disposable object that can be used to unsubscribe from the event

Implementation of

IFWorkbookSheetsUIMixin.onCellClick

Overrides

FWorkbook.onCellClick

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:106


onCellHover()

onCellHover(callback): IDisposable

Subscribe cell hover events

Parameters

ParameterTypeDescription
callback(cell) => voidThe callback function to be called when a cell is hovered

Returns

IDisposable

A disposable object that can be used to unsubscribe from the event

Implementation of

IFWorkbookSheetsUIMixin.onCellHover

Overrides

FWorkbook.onCellHover

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:115


onCommandExecuted()

onCommandExecuted(callback): IDisposable

Register a callback that will be triggered when a command is invoked targeting the Univer sheet.

Parameters

ParameterTypeDescription
callbackCommandListenerthe callback.

Returns

IDisposable

A function to dispose the listening.

Inherited from

FWorkbook.onCommandExecuted

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:230


onSelectionChange()

onSelectionChange(callback): IDisposable

Parameters

ParameterType
callback(selections) => void

Returns

IDisposable

Inherited from

FWorkbook.onSelectionChange

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:240


openDialog()

openDialog(dialog): IDisposable

Open a dialog.

Parameters

ParameterTypeDescription
dialogIDialogPartMethodOptionsthe dialog options

Returns

IDisposable

the disposable object

Deprecated

Implementation of

IFWorkbookSheetsUIMixin.openDialog

Overrides

FWorkbook.openDialog

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:86


openSiderbar()

openSiderbar(params): IDisposable

Open a sidebar.

Parameters

ParameterTypeDescription
paramsISidebarMethodOptionsthe sidebar options

Returns

IDisposable

the disposable object

Deprecated

Implementation of

IFWorkbookSheetsUIMixin.openSiderbar

Overrides

FWorkbook.openSiderbar

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:79


redo()

redo(): Promise<boolean>

Returns

Promise<boolean>

Inherited from

FWorkbook.redo

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:205


save()

save(): IWorkbookData

save workbook snapshot data, including conditional formatting, data validation, and other plugin data.

Returns

IWorkbookData

Inherited from

FWorkbook.save

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:53


setActiveRange()

setActiveRange(range): void

Sets the active selection region for this sheet.

Parameters

ParameterTypeDescription
rangeFRangeThe range to set as the active selection.

Returns

void

Inherited from

FWorkbook.setActiveRange

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:274


setActiveSheet()

setActiveSheet(sheet): FWorksheet

Sets the given worksheet to be the active worksheet in the workbook.

Parameters

ParameterTypeDescription
sheetFWorksheetThe worksheet to set as the active worksheet.

Returns

FWorksheet

The active worksheet

Inherited from

FWorkbook.setActiveSheet

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:153


setEditable()

setEditable(value): void

Used to modify the editing permissions of the workbook. When the value is false, editing is not allowed.

Parameters

ParameterTypeDescription
valuebooleaneditable value want to set

Returns

void

Inherited from

FWorkbook.setEditable

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:261


startEditing()

startEditing(): boolean

Start the editing process

Returns

boolean

A boolean value

Implementation of

IFWorkbookSheetsUIMixin.startEditing

Overrides

FWorkbook.startEditing

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-workbook.ts:124


undo()

undo(): Promise<boolean>

Returns

Promise<boolean>

Inherited from

FWorkbook.undo

Defined in

submodules/univer/packages/sheets/src/facade/f-workbook.ts:200


extend()

static extend(source): void

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FWorkbook.extend

Defined in

submodules/univer/packages/core/src/facade/f-base.ts:35