@univerjs/sheets-ui v0.5.1Docs


Class: FUniverSheetsUIMixin

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 FUniverSheetsUIMixin()

new FUniverSheetsUIMixin(
   _injector, 
   _commandService, 
   _univerInstanceService): FUniverSheetsUIMixin

Parameters

ParameterType
_injectorInjector
_commandServiceICommandService
_univerInstanceServiceIUniverInstanceService

Returns

FUniverSheetsUIMixin

Inherited from

FUniver.constructor

Defined in

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

Properties

PropertyModifierTypeInherited fromDefined in
_commandServicereadonlyICommandServiceFUniver._commandServicesubmodules/univer/packages/core/src/facade/f-univer.ts:45
_injectorreadonlyInjectorFUniver._injectorsubmodules/univer/packages/core/src/facade/f-univer.ts:44
_univerInstanceServicereadonlyIUniverInstanceServiceFUniver._univerInstanceServicesubmodules/univer/packages/core/src/facade/f-univer.ts:46

Methods

_initialize()

_initialize(): void

Returns

void

Inherited from

FUniver._initialize

Defined in

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


createUniverSheet()

createUniverSheet(data): FWorkbook

Create a new spreadsheet and get the API handler of that spreadsheet.

Parameters

ParameterTypeDescription
dataPartial<IWorkbookData>The snapshot of the spreadsheet.

Returns

FWorkbook

FWorkbook API instance.

Inherited from

FUniver.createUniverSheet

Defined in

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


customizeColumnHeader()

customizeColumnHeader(cfg): void

Customize the column header of the spreadsheet.

Parameters

ParameterTypeDescription
cfgIColumnsHeaderCfgParamThe configuration of the column header.

Returns

void

Example

customizeColumnHeader({ headerStyle: { backgroundColor: 'pink', fontSize: 9 }, columnsCfg: ['MokaII', undefined, null, { text: 'Size', textAlign: 'left' }] });

Implementation of

IFUniverSheetsUIMixin.customizeColumnHeader

Overrides

FUniver.customizeColumnHeader

Defined in

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


customizeRowHeader()

customizeRowHeader(cfg): void

Customize the row header of the spreadsheet.

Parameters

ParameterTypeDescription
cfgIRowsHeaderCfgParamThe configuration of the row header.

Returns

void

Example

customizeRowHeader({ headerStyle: { backgroundColor: 'pink', fontSize: 9 }, rowsCfg: ['MokaII', undefined, null, { text: 'Size', textAlign: 'left' }] });

Implementation of

IFUniverSheetsUIMixin.customizeRowHeader

Overrides

FUniver.customizeRowHeader

Defined in

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


disposeUnit()

disposeUnit(unitId): boolean

Dispose the UniverSheet by the unitId. The UniverSheet would be unload from the application.

Parameters

ParameterTypeDescription
unitIdstringThe unit id of the UniverSheet.

Returns

boolean

Whether the Univer instance is disposed successfully.

Inherited from

FUniver.disposeUnit

Defined in

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


executeCommand()

executeCommand<P, R>(
   id, 
   params?, 
options?): Promise<R>

Execute a command with the given id and parameters.

Type Parameters

Type ParameterDefault type
P extends objectobject
Rboolean

Parameters

ParameterTypeDescription
idstringIdentifier of the command.
params?PParameters of this execution.
options?IExecutionOptionsOptions of this execution.

Returns

Promise<R>

The result of the execution. It is a boolean value by default which indicates the command is executed.

Inherited from

FUniver.executeCommand

Defined in

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


getActiveWorkbook()

getActiveWorkbook(): null | FWorkbook

Get the currently focused Univer spreadsheet.

Returns

null | FWorkbook

The currently focused Univer spreadsheet.

Inherited from

FUniver.getActiveWorkbook

Defined in

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


getCurrentLifecycleStage()

getCurrentLifecycleStage(): LifecycleStages

Get the current lifecycle stage.

Returns

LifecycleStages

  • The current lifecycle stage.

Inherited from

FUniver.getCurrentLifecycleStage

Defined in

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


getHooks()

getHooks(): FHooks

Get hooks.

Returns

FHooks

FHooks instance

Inherited from

FUniver.getHooks

Defined in

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


getPermission()

getPermission(): FPermission

Get the PermissionInstance.

Returns

FPermission

  • The PermissionInstance.

Inherited from

FUniver.getPermission

Defined in

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


getSheetHooks()

getSheetHooks(): FSheetHooks

Get sheet hooks.

Returns

FSheetHooks

FSheetHooks instance

Implementation of

IFUniverSheetsUIMixin.getSheetHooks

Overrides

FUniver.getSheetHooks

Defined in

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


getUniverSheet()

getUniverSheet(id): null | FWorkbook

Get the spreadsheet API handler by the spreadsheet id.

Parameters

ParameterTypeDescription
idstringThe spreadsheet id.

Returns

null | FWorkbook

The spreadsheet API instance.

Inherited from

FUniver.getUniverSheet

Defined in

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


onBeforeCommandExecute()

onBeforeCommandExecute(callback): IDisposable

Register a callback that will be triggered before invoking a command.

Parameters

ParameterTypeDescription
callbackCommandListenerThe callback.

Returns

IDisposable

The disposable instance.

Inherited from

FUniver.onBeforeCommandExecute

Defined in

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


onCommandExecuted()

onCommandExecuted(callback): IDisposable

Register a callback that will be triggered when a command is invoked.

Parameters

ParameterTypeDescription
callbackCommandListenerThe callback.

Returns

IDisposable

The disposable instance.

Inherited from

FUniver.onCommandExecuted

Defined in

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


redo()

redo(): Promise<boolean>

Redo an editing on the currently focused document.

Returns

Promise<boolean>

redo result

Inherited from

FUniver.redo

Defined in

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


registerSheetColumnHeaderExtension()

registerSheetColumnHeaderExtension(unitId, ...extensions): IDisposable

Register sheet column header render extensions.

Parameters

ParameterTypeDescription
unitIdstringThe unit id of the spreadsheet.
extensionsSheetExtension[]The extensions to register.

Returns

IDisposable

The disposable instance.

Implementation of

IFUniverSheetsUIMixin.registerSheetColumnHeaderExtension

Overrides

FUniver.registerSheetColumnHeaderExtension

Defined in

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


registerSheetMainExtension()

registerSheetMainExtension(unitId, ...extensions): IDisposable

Register sheet main render extensions.

Parameters

ParameterTypeDescription
unitIdstringThe unit id of the spreadsheet.
extensionsSheetExtension[]The extensions to register.

Returns

IDisposable

The disposable instance.

Implementation of

IFUniverSheetsUIMixin.registerSheetMainExtension

Overrides

FUniver.registerSheetMainExtension

Defined in

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


registerSheetRowHeaderExtension()

registerSheetRowHeaderExtension(unitId, ...extensions): IDisposable

Register sheet row header render extensions.

Parameters

ParameterTypeDescription
unitIdstringThe unit id of the spreadsheet.
extensionsSheetExtension[]The extensions to register.

Returns

IDisposable

The disposable instance.

Implementation of

IFUniverSheetsUIMixin.registerSheetRowHeaderExtension

Overrides

FUniver.registerSheetRowHeaderExtension

Defined in

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


syncExecuteCommand()

syncExecuteCommand<P, R>(
   id, 
   params?, 
   options?): R

Execute a command with the given id and parameters synchronously.

Type Parameters

Type ParameterDefault type
P extends objectobject
Rboolean

Parameters

ParameterTypeDescription
idstringIdentifier of the command.
params?PParameters of this execution.
options?IExecutionOptionsOptions of this execution.

Returns

R

The result of the execution. It is a boolean value by default which indicates the command is executed.

Inherited from

FUniver.syncExecuteCommand

Defined in

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


undo()

undo(): Promise<boolean>

Undo an editing on the currently focused document.

Returns

Promise<boolean>

undo result

Inherited from

FUniver.undo

Defined in

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


extend()

static extend(source): void

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FUniver.extend

Defined in

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


newAPI()

static newAPI(wrapped): FUniver

Create an FUniver instance, if the injector is not provided, it will create a new Univer instance.

Parameters

ParameterTypeDescription
wrappedInjector | UniverThe Univer instance or injector instance.

Returns

FUniver

  • The FUniver instance.

Static

Inherited from

FUniver.newAPI

Defined in

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