@univerjs/sheets-drawing-ui v0.5.4
Class: FUniverDrawingMixin
Defined in: sheets-drawing-ui/src/facade/f-univer.ts:48
Extends
Constructors
new FUniverDrawingMixin()
new FUniverDrawingMixin(
_injector,
_commandService,
_univerInstanceService,
_lifecycleService): FUniverDrawingMixin
Defined in: core/src/facade/f-univer.ts:65
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_commandService | ICommandService |
_univerInstanceService | IUniverInstanceService |
_lifecycleService | LifecycleService |
Returns
Inherited from
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_commandService | readonly | ICommandService | undefined | FUniver ._commandService | core/src/facade/f-univer.ts:67 |
_disposed | protected | boolean | false | FUniver ._disposed | core/src/shared/lifecycle.ts:96 |
_eventRegistry | protected | Map <string , Registry <(param ) => void >> | undefined | FUniver ._eventRegistry | core/src/facade/f-univer.ts:55 |
_injector | readonly | Injector | undefined | FUniver ._injector | core/src/facade/f-univer.ts:66 |
_lifecycleService | readonly | LifecycleService | undefined | FUniver ._lifecycleService | core/src/facade/f-univer.ts:69 |
_univerInstanceService | readonly | IUniverInstanceService | undefined | FUniver ._univerInstanceService | core/src/facade/f-univer.ts:68 |
Accessors
Enum
Get Signature
get Enum(): FEnum
Defined in: core/src/facade/f-univer.ts:281
Returns
Inherited from
Event
Get Signature
get Event(): FEventName
Defined in: core/src/facade/f-univer.ts:285
Returns
Inherited from
Util
Get Signature
get Util(): FUtil
Defined in: core/src/facade/f-univer.ts:289
Returns
Inherited from
Methods
_ensureEventRegistry()
protected _ensureEventRegistry(event): Registry<(param) => void>
Defined in: core/src/facade/f-univer.ts:57
Parameters
Parameter | Type |
---|---|
event | string |
Returns
Registry
<(param
) => void
>
Inherited from
_eventListend()
protected _eventListend(key):
| undefined
| Registry<(param) => void>
Defined in: core/src/facade/f-univer.ts:180
Parameters
Parameter | Type |
---|---|
key | string |
Returns
| undefined
| Registry
<(param
) => void
>
Inherited from
_initialize()
_initialize(injector): void
Defined in: sheets-drawing-ui/src/facade/f-univer.ts:49
Parameters
Parameter | Type |
---|---|
injector | Injector |
Returns
void
Overrides
addEvent()
addEvent(event, callback): IDisposable
Defined in: core/src/facade/f-univer.ts:305
Add an event listener
Parameters
Parameter | Type | Description |
---|---|---|
event | keyof IEventParamConfig | key of event |
callback | (params ) => void | callback when event triggered |
Returns
The Disposable instance, for remove the listener
Example
univerAPI.addEvent(univerAPI.event.UnitCreated, (params) => {
console.log('unit created', params);
});
Inherited from
createUniverSheet()
createUniverSheet(data): FWorkbook
Defined in: sheets/src/facade/f-univer.ts:31
Parameters
Parameter | Type |
---|---|
data | Partial <IWorkbookData > |
Returns
Deprecated
use univerAPI.createWorkbook
instead.
Inherited from
FUniver.createUniverSheet
createWorkbook()
createWorkbook(data): FWorkbook
Defined in: sheets/src/facade/f-univer.ts:42
Create a new spreadsheet and get the API handler of that spreadsheet.
Parameters
Parameter | Type | Description |
---|---|---|
data | Partial <IWorkbookData > | The snapshot of the spreadsheet. |
Returns
FWorkbook API instance.
Example
univerAPI.createWorkbook({ id: 'Sheet1', name: 'Sheet1' });
Inherited from
FUniver.createWorkbook
customizeColumnHeader()
customizeColumnHeader(cfg): void
Defined in: sheets-ui/src/facade/f-univer.ts:46
Customize the column header of the spreadsheet.
Parameters
Parameter | Type | Description |
---|---|---|
cfg | IColumnsHeaderCfgParam | The configuration of the column header. |
Returns
void
Example
univerAPI.customizeColumnHeader({ headerStyle: { backgroundColor: 'pink', fontSize: 9 }, columnsCfg: ['MokaII', undefined, null, { text: 'Size', textAlign: 'left' }] });
Inherited from
FUniver.customizeColumnHeader
customizeRowHeader()
customizeRowHeader(cfg): void
Defined in: sheets-ui/src/facade/f-univer.ts:55
Customize the row header of the spreadsheet.
Parameters
Parameter | Type | Description |
---|---|---|
cfg | IRowsHeaderCfgParam | The configuration of the row header. |
Returns
void
Example
univerAPI.customizeRowHeader({ headerStyle: { backgroundColor: 'pink', fontSize: 9 }, rowsCfg: ['MokaII', undefined, null, { text: 'Size', textAlign: 'left' }] });
Inherited from
FUniver.customizeRowHeader
dispose()
dispose(): void
Defined in: core/src/shared/lifecycle.ts:109
Returns
void
Inherited from
disposeUnit()
disposeUnit(unitId): boolean
Defined in: core/src/facade/f-univer.ts:189
Dispose the UniverSheet by the unitId
. The UniverSheet would be unload from the application.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unit id of the UniverSheet. |
Returns
boolean
Whether the Univer instance is disposed successfully.
Inherited from
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
executeCommand()
executeCommand<P, R>(
id,
params?,
options?): Promise<R>
Defined in: core/src/facade/f-univer.ts:249
Execute a command with the given id and parameters.
Type Parameters
Type Parameter | Default type |
---|---|
P extends object | object |
R | boolean |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | Identifier of the command. |
params ? | P | Parameters of this execution. |
options ? | IExecutionOptions | Options 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
fireEvent()
protected fireEvent<T>(event, params): undefined | boolean
Defined in: core/src/facade/f-univer.ts:320
Fire an event, used in internal only.
Type Parameters
Type Parameter |
---|
T extends keyof IEventParamConfig |
Parameters
Parameter | Type | Description |
---|---|---|
event | T | {string} key of event |
params | IEventParamConfig [T ] | {any} params of event |
Returns
undefined
| boolean
should cancel
Example
this.fireEvent(univerAPI.event.UnitCreated, params);
Inherited from
getActiveUniverSheet()
getActiveUniverSheet(): null | FWorkbook
Defined in: sheets/src/facade/f-univer.ts:57
Returns
null
| FWorkbook
Deprecated
use univerAPI.getActiveWorkbook
instead
Inherited from
FUniver.getActiveUniverSheet
getActiveWorkbook()
getActiveWorkbook(): null | FWorkbook
Defined in: sheets/src/facade/f-univer.ts:52
Get the currently focused Univer spreadsheet.
Returns
null
| FWorkbook
The currently focused Univer spreadsheet.
Example
univerAPI.getActiveWorkbook();
Inherited from
FUniver.getActiveWorkbook
getCommandSheetTarget()
getCommandSheetTarget(commandInfo): Nullable<{
workbook: FWorkbook;
worksheet: FWorksheet;
}>
Defined in: sheets/src/facade/f-univer.ts:113
Get the target of the sheet.
Parameters
Parameter | Type | Description |
---|---|---|
commandInfo | ICommandInfo | The commandInfo of the command. |
Returns
Nullable
<{
workbook
: FWorkbook
;
worksheet
: FWorksheet
;
}>
- The target of the sheet.
Example
univerAPI.addEvent(univerAPI.event.CommandExecuted, (commandInfo) => {
const target = univerAPI.getCommandSheetTarget(commandInfo);
if (!target) return;
const { workbook, worksheet } = target;
});
Inherited from
FUniver.getCommandSheetTarget
getCurrentLifecycleStage()
getCurrentLifecycleStage(): LifecycleStages
Defined in: core/src/facade/f-univer.ts:197
Get the current lifecycle stage.
Returns
- The current lifecycle stage.
Inherited from
FUniver
.getCurrentLifecycleStage
getHooks()
getHooks(): FHooks
Defined in: core/src/facade/f-univer.ts:277
Get hooks.
Returns
FHooks instance
Deprecated
use addEvent
instead.
Inherited from
getPermission()
getPermission(): FPermission
Defined in: sheets/src/facade/f-univer.ts:71
Get the PermissionInstance.
Returns
Deprecated
This function is deprecated and will be removed in version 0.6.0. Please use the function with the same name on the FWorkbook
instance instead.
Inherited from
FUniver.getPermission
getSheetHooks()
getSheetHooks(): FSheetHooks
Defined in: sheets-ui/src/facade/f-univer.ts:81
Returns
Deprecated
use univerAPI.addEvent
as instead.
Inherited from
FUniver.getSheetHooks
getSheetTarget()
getSheetTarget(unitId, subUnitId): Nullable<{
workbook: FWorkbook;
worksheet: FWorksheet;
}>
Defined in: sheets/src/facade/f-univer.ts:98
Get the target of the sheet.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unitId of the sheet. |
subUnitId | string | The subUnitId of the sheet. |
Returns
Nullable
<{
workbook
: FWorkbook
;
worksheet
: FWorksheet
;
}>
- The target of the sheet.
Example
univerAPI.getSheetTarget('unitId', 'subUnitId');
Inherited from
FUniver.getSheetTarget
getUniverSheet()
getUniverSheet(id): null | FWorkbook
Defined in: sheets/src/facade/f-univer.ts:64
Get the spreadsheet API handler by the spreadsheet id.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The spreadsheet id. |
Returns
null
| FWorkbook
The spreadsheet API instance.
Inherited from
FUniver.getUniverSheet
getUserManager()
getUserManager(): FUserManager
Defined in: core/src/facade/f-univer.ts:338
Returns
FUserManager
Inherited from
getWorkbook()
getWorkbook(id): null | FWorkbook
Defined in: sheets/src/facade/f-univer.ts:66
Parameters
Parameter | Type |
---|---|
id | string |
Returns
null
| FWorkbook
Inherited from
FUniver.getWorkbook
hasEventCallback()
protected hasEventCallback(event): boolean
Defined in: core/src/facade/f-univer.ts:333
Get the callback map corresponding to the event
Parameters
Parameter | Type |
---|---|
event | keyof IEventParamConfig |
Returns
boolean
The number of callbacks
Inherited from
newBlob()
newBlob(): FBlob
Defined in: core/src/facade/f-univer.ts:350
Create a new blob.
Returns
The new blob instance
Example
const blob = univerApi.newBlob();
Inherited from
newColor()
newColor(): ColorBuilder
Defined in: core/src/facade/f-univer.ts:362
Create a new color.
Returns
The new color instance
Example
const color = univerApi.newColor();
Inherited from
newDefinedName()
newDefinedName(): FDefinedNameBuilder
Defined in: sheets/src/facade/f-univer.ts:86
Create a new defined name builder.
Returns
FDefinedNameBuilder
- The defined name builder.
Example
univerAPI.newDefinedName();
Inherited from
FUniver.newDefinedName
newParagraphStyle()
newParagraphStyle(style?): ParagraphStyleBuilder
Defined in: core/src/facade/f-univer.ts:401
Create a new paragraph style.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | IParagraphStyle | The paragraph style |
Returns
The new paragraph style instance
Example
const paragraphStyle = univerApi.newParagraphStyle();
Inherited from
newParagraphStyleValue()
newParagraphStyleValue(style?): ParagraphStyleValue
Defined in: core/src/facade/f-univer.ts:414
Create a new paragraph style value.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | IParagraphStyle | The paragraph style |
Returns
The new paragraph style value instance
Example
const paragraphStyleValue = univerApi.newParagraphStyleValue();
Inherited from
FUniver
.newParagraphStyleValue
newRichText()
newRichText(data?): RichTextBuilder
Defined in: core/src/facade/f-univer.ts:375
Create a new rich text.
Parameters
Parameter | Type |
---|---|
data ? | IDocumentData |
Returns
The new rich text instance
Example
const richText = univerApi.newRichText();
Inherited from
newRichTextValue()
newRichTextValue(data): RichTextValue
Defined in: core/src/facade/f-univer.ts:388
Create a new rich text value.
Parameters
Parameter | Type | Description |
---|---|---|
data | IDocumentData | The rich text data |
Returns
The new rich text value instance
Example
const richTextValue = univerApi.newRichTextValue();
Inherited from
newTextDecoration()
newTextDecoration(decoration?): TextDecorationBuilder
Defined in: core/src/facade/f-univer.ts:444
Parameters
Parameter | Type |
---|---|
decoration ? | ITextDecoration |
Returns
Inherited from
newTextStyle()
newTextStyle(style?): TextStyleBuilder
Defined in: core/src/facade/f-univer.ts:427
Create a new text style.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | ITextStyle | The text style |
Returns
The new text style instance
Example
const textStyle = univerApi.newTextStyle();
Inherited from
newTextStyleValue()
newTextStyleValue(style?): TextStyleValue
Defined in: core/src/facade/f-univer.ts:440
Create a new text style value.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | ITextStyle | The text style |
Returns
The new text style value instance
Example
const textStyleValue = univerApi.newTextStyleValue();
Inherited from
onBeforeCommandExecute()
onBeforeCommandExecute(callback): IDisposable
Defined in: core/src/facade/f-univer.ts:224
Register a callback that will be triggered before invoking a command.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Deprecated
use addEvent(univerAPI.event.BeforeCommandExecute, () => {})
instead.
Inherited from
FUniver
.onBeforeCommandExecute
onCommandExecuted()
onCommandExecuted(callback): IDisposable
Defined in: core/src/facade/f-univer.ts:236
Register a callback that will be triggered when a command is invoked.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Deprecated
use addEvent(univerAPI.event.CommandExecuted, () => {})
instead.
Inherited from
onUniverSheetCreated()
onUniverSheetCreated(callback): IDisposable
Defined in: sheets/src/facade/f-univer.ts:76
Parameters
Parameter | Type |
---|---|
callback | (workbook ) => void |
Returns
Deprecated
Use univerAPI.addEvent(univerAPI.Event.UnitCreated, () => {})
Inherited from
FUniver.onUniverSheetCreated
redo()
redo(): Promise<boolean>
Defined in: core/src/facade/f-univer.ts:214
Redo an editing on the currently focused document.
Returns
Promise
<boolean
>
redo result
Inherited from
registerSheetColumnHeaderExtension()
registerSheetColumnHeaderExtension(unitId, ...extensions): IDisposable
Defined in: sheets-ui/src/facade/f-univer.ts:69
Register sheet column header render extensions.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unit id of the spreadsheet. |
…extensions | SheetExtension [] | The extensions to register. |
Returns
The disposable instance.
Inherited from
FUniver.registerSheetColumnHeaderExtension
registerSheetMainExtension()
registerSheetMainExtension(unitId, ...extensions): IDisposable
Defined in: sheets-ui/src/facade/f-univer.ts:76
Register sheet main render extensions.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unit id of the spreadsheet. |
…extensions | SheetExtension [] | The extensions to register. |
Returns
The disposable instance.
Inherited from
FUniver.registerSheetMainExtension
registerSheetRowHeaderExtension()
registerSheetRowHeaderExtension(unitId, ...extensions): IDisposable
Defined in: sheets-ui/src/facade/f-univer.ts:62
Register sheet row header render extensions.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unit id of the spreadsheet. |
…extensions | SheetExtension [] | The extensions to register. |
Returns
The disposable instance.
Inherited from
FUniver.registerSheetRowHeaderExtension
syncExecuteCommand()
syncExecuteCommand<P, R>(
id,
params?,
options?): R
Defined in: core/src/facade/f-univer.ts:264
Execute a command with the given id and parameters synchronously.
Type Parameters
Type Parameter | Default type |
---|---|
P extends object | object |
R | boolean |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | Identifier of the command. |
params ? | P | Parameters of this execution. |
options ? | IExecutionOptions | Options 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
undo()
undo(): Promise<boolean>
Defined in: core/src/facade/f-univer.ts:206
Undo an editing on the currently focused document.
Returns
Promise
<boolean
>
undo result
Inherited from
extend()
static extend(source): void
Defined in: core/src/facade/f-base.ts:68
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
newAPI()
static newAPI(wrapped): FUniver
Defined in: core/src/facade/f-univer.ts:50
Create an FUniver instance, if the injector is not provided, it will create a new Univer instance.
Parameters
Parameter | Type | Description |
---|---|---|
wrapped | | Injector | Univer | The Univer instance or injector instance. |
Returns
- The FUniver instance.