@univerjs/sheets-ui v0.5.4


Class: FSheetsUIEventName

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:318

Extends

Implements

Constructors

new FSheetsUIEventName()

new FSheetsUIEventName(): FSheetsUIEventName

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:114

Returns

FSheetsUIEventName

Inherited from

FEventName.constructor

Properties

PropertyModifierTypeInherited fromDefined in
_instancestaticnull | FEventNameFEventName._instancesubmodules/univer/packages/core/src/facade/f-event.ts:87

Accessors

BeforeClipboardChange

Get Signature

get BeforeClipboardChange(): "BeforeClipboardChange"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:319

Trigger this event before the clipboard content changes. Type of the event parameter is IBeforeClipboardChangeParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeClipboardChange, (param) => {
  const {text, html} = param;
  console.log('debugger', text, html); // {text: '...', html: '...'}
  // if want to cancel the clipboard change
  param.cancel = true;
})
Returns

"BeforeClipboardChange"

Trigger this event before the clipboard content changes. Type of the event parameter is IBeforeClipboardChangeParam

Example

univerAPI.addEvent(univerAPI.Event.BeforeClipboardChange, (param) => {
  const {text, html} = param;
  console.log('debugger', text, html); // {text: '...', html: '...'}
  // if want to cancel the clipboard change
  param.cancel = true;
})

Implementation of

IFSheetsUIEventNameMixin.BeforeClipboardChange

Overrides

FEventName.BeforeClipboardChange

BeforeClipboardPaste

Get Signature

get BeforeClipboardPaste(): "BeforeClipboardPaste"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:327

Trigger this event before pasting. Type of the event parameter is IBeforeClipboardPasteParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeClipboardPaste, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html);
 // if want to cancel the clipboard paste
 param.cancel = true;
})
Returns

"BeforeClipboardPaste"

Trigger this event before pasting. Type of the event parameter is IBeforeClipboardPasteParam

Example

univerAPI.addEvent(univerAPI.Event.BeforeClipboardPaste, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html);
 // if want to cancel the clipboard paste
 param.cancel = true;
})

Implementation of

IFSheetsUIEventNameMixin.BeforeClipboardPaste

Overrides

FEventName.BeforeClipboardPaste

BeforeCommandExecute

Get Signature

get BeforeCommandExecute(): "BeforeCommandExecute"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:252

Event fired before a command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.BeforeCommandExecute, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"BeforeCommandExecute"

Inherited from

FEventName.BeforeCommandExecute


BeforeRedo

Get Signature

get BeforeRedo(): "BeforeRedo"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:207

Event fired before a redo command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.BeforeRedo, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"BeforeRedo"

Inherited from

FEventName.BeforeRedo


BeforeSheetCreate

Get Signature

get BeforeSheetCreate(): "BeforeSheetCreate"

Defined in: submodules/univer/packages/sheets/src/facade/f-event.ts:46

Event fired before a sheet is created

See

IBeforeSheetCreateEventParams

Example
univerAPI.addEvent(univerAPI.event.BeforeSheetCreate, (params) => {
     const { workbook, index, sheet } = params;
    console.log('unit created', params);
});
Returns

"BeforeSheetCreate"

Inherited from

FEventName.BeforeSheetCreate

BeforeSheetEditEnd

Get Signature

get BeforeSheetEditEnd(): "BeforeSheetEditEnd"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:347

Event fired before a cell edit ends

See

IBeforeSheetEditEndEventParams

Example
univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {
     const { worksheet, workbook, row, column, value, eventType, keycode, isZenEditor } = params;
});
Returns

"BeforeSheetEditEnd"

Event fired before a cell edit ends

See

IBeforeSheetEditEndEventParams

Example

univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {
     const { worksheet, workbook, row, column, value, eventType, keycode, isZenEditor } = params;
});

Implementation of

IFSheetsUIEventNameMixin.BeforeSheetEditEnd

Overrides

FEventName.BeforeSheetEditEnd

BeforeSheetEditStart

Get Signature

get BeforeSheetEditStart(): "BeforeSheetEditStart"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:335

Event fired before a cell is edited

See

IBeforeSheetEditStartEventParams

Example
univerAPI.addEvent(univerAPI.Event.BeforeSheetEditStart, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});
Returns

"BeforeSheetEditStart"

Event fired before a cell is edited

See

IBeforeSheetEditStartEventParams

Example

univerAPI.addEvent(univerAPI.Event.BeforeSheetEditStart, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});

Implementation of

IFSheetsUIEventNameMixin.BeforeSheetEditStart

Overrides

FEventName.BeforeSheetEditStart

BeforeUndo

Get Signature

get BeforeUndo(): "BeforeUndo"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:222

Event fired before an undo command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.BeforeUndo, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"BeforeUndo"

Inherited from

FEventName.BeforeUndo


CellClicked

Get Signature

get CellClicked(): "CellClicked"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:355

Event fired when a cell is clicked

Example
univerAPI.getActiveWorkbook().addEvent('CellClicked', (p)=> console.log(p));
Returns

"CellClicked"

Event fired when a cell is clicked

Example

univerAPI.getActiveWorkbook().addEvent('CellClicked', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.CellClicked

Overrides

FEventName.CellClicked

CellHover

Get Signature

get CellHover(): "CellHover"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:359

Event fired when a cell is hovered

Example
univerAPI.getActiveWorkbook().addEvent('CellHover', (p)=> console.log(p));
Returns

"CellHover"

Event fired when a cell is hovered

Example

univerAPI.getActiveWorkbook().addEvent('CellHover', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.CellHover

Overrides

FEventName.CellHover

CellPointerDown

Get Signature

get CellPointerDown(): "CellPointerDown"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:363

Event fired when a cell is pointer down

Example
univerAPI.getActiveWorkbook().addEvent('CellPointerDown', (p)=> console.log(p));
Returns

"CellPointerDown"

Event fired when a cell is pointer down

Example

univerAPI.getActiveWorkbook().addEvent('CellPointerDown', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.CellPointerDown

Overrides

FEventName.CellPointerDown

CellPointerMove

Get Signature

get CellPointerMove(): "CellPointerMove"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:371

Event fired when move on spreadsheet cells

Example
univerAPI.getActiveWorkbook().addEvent('CellPointerMove', (p)=> console.log(p));
Returns

"CellPointerMove"

Event fired when move on spreadsheet cells

Example

univerAPI.getActiveWorkbook().addEvent('CellPointerMove', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.CellPointerMove

Overrides

FEventName.CellPointerMove

CellPointerUp

Get Signature

get CellPointerUp(): "CellPointerUp"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:367

Event fired when a cell is pointer up

Example
univerAPI.getActiveWorkbook().addEvent('CellPointerUp', (p)=> console.log(p));
Returns

"CellPointerUp"

Event fired when a cell is pointer up

Example

univerAPI.getActiveWorkbook().addEvent('CellPointerUp', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.CellPointerUp

Overrides

FEventName.CellPointerUp

ClipboardChanged

Get Signature

get ClipboardChanged(): "ClipboardChanged"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:323

Trigger this event after the clipboard content changes. Type of the event parameter is IClipboardChangedParam

Example
univerAPI.addEvent(univerAPI.Event.ClipboardChanged, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html); // {text: '...', html: '...'}
})
Returns

"ClipboardChanged"

Trigger this event after the clipboard content changes. Type of the event parameter is IClipboardChangedParam

Example

univerAPI.addEvent(univerAPI.Event.ClipboardChanged, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html); // {text: '...', html: '...'}
})

Implementation of

IFSheetsUIEventNameMixin.ClipboardChanged

Overrides

FEventName.ClipboardChanged

ClipboardPasted

Get Signature

get ClipboardPasted(): "ClipboardPasted"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:331

Trigger this event after pasting. Type of the event parameter is IClipboardPastedParam

Example
univerAPI.addEvent(univerAPI.Event.ClipboardPasted, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html); // {text: '...', html: '...'}
})
Returns

"ClipboardPasted"

Trigger this event after pasting. Type of the event parameter is IClipboardPastedParam

Example

univerAPI.addEvent(univerAPI.Event.ClipboardPasted, (param) => {
 const {text, html} = param;
 console.log('debugger', text, html); // {text: '...', html: '...'}
})

Implementation of

IFSheetsUIEventNameMixin.ClipboardPasted

Overrides

FEventName.ClipboardPasted

CommandExecuted

Get Signature

get CommandExecuted(): "CommandExecuted"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:237

Event fired when a command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.CommandExecuted, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"CommandExecuted"

Inherited from

FEventName.CommandExecuted


DocCreated

Get Signature

get DocCreated(): "DocCreated"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:132

Event fired when a document is created

See

IDocCreatedParam

Example
univerAPI.addEvent(univerAPI.event.DocCreated, (params) => {
    const { unitId, type, doc, unit } = params;
    console.log('doc created', params);
});
Returns

"DocCreated"

Inherited from

FEventName.DocCreated


DocDisposed

Get Signature

get DocDisposed(): "DocDisposed"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:147

Event fired when a document is disposed

See

IDocDisposedEvent

Example
univerAPI.addEvent(univerAPI.event.DocDisposed, (params) => {
    const { unitId, unitType, snapshot } = params;
    console.log('doc disposed', params);
});
Returns

"DocDisposed"

Inherited from

FEventName.DocDisposed


DragOver

Get Signature

get DragOver(): "DragOver"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:375

Event fired when drag over spreadsheet cells

Example
univerAPI.getActiveWorkbook().addEvent('DragOver', (p)=> console.log(p));
Returns

"DragOver"

Event fired when drag over spreadsheet cells

Example

univerAPI.getActiveWorkbook().addEvent('DragOver', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.DragOver

Overrides

FEventName.DragOver

Drop

Get Signature

get Drop(): "Drop"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:379

Event fired when drop on spreadsheet cells

Example
univerAPI.getActiveWorkbook().addEvent('Drop', (p)=> console.log(p));
Returns

"Drop"

Event fired when drop on spreadsheet cells

Example

univerAPI.getActiveWorkbook().addEvent('Drop', (p)=> console.log(p));

Implementation of

IFSheetsUIEventNameMixin.Drop

Overrides

FEventName.Drop

LifeCycleChanged

Get Signature

get LifeCycleChanged(): "LifeCycleChanged"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:162

Event fired when life cycle is changed

See

ILifeCycleChangedEvent

Example
univerAPI.addEvent(univerAPI.event.LifeCycleChanged, (params) => {
     const { stage } = params;
    console.log('life cycle changed', params);
});
Returns

"LifeCycleChanged"

Inherited from

FEventName.LifeCycleChanged


Redo

Get Signature

get Redo(): "Redo"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:177

Event fired when a redo command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.Redo, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"Redo"

Inherited from

FEventName.Redo


SheetCreated

Get Signature

get SheetCreated(): "SheetCreated"

Defined in: submodules/univer/packages/sheets/src/facade/f-event.ts:34

Event fired after a sheet is created

See

ISheetCreatedEventParams

Example
univerAPI.addEvent(univerAPI.event.SheetCreated, (params) => {
     const { workbook, worksheet } = params;
    console.log('unit created', params);
});
Returns

"SheetCreated"

Inherited from

FEventName.SheetCreated

SheetEditChanging

Get Signature

get SheetEditChanging(): "SheetEditChanging"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:343

Event fired when a cell is being edited

See

ISheetEditChangingEventParams

Example
univerAPI.addEvent(univerAPI.Event.SheetEditChanging, (params) => {
     const { worksheet, workbook, row, column, value, isZenEditor } = params;
});
Returns

"SheetEditChanging"

Event fired when a cell is being edited

See

ISheetEditChangingEventParams

Example

univerAPI.addEvent(univerAPI.Event.SheetEditChanging, (params) => {
     const { worksheet, workbook, row, column, value, isZenEditor } = params;
});

Implementation of

IFSheetsUIEventNameMixin.SheetEditChanging

Overrides

FEventName.SheetEditChanging

SheetEditEnded

Get Signature

get SheetEditEnded(): "SheetEditEnded"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:351

Event fired after a cell edit ends

See

ISheetEditEndedEventParams

Example
univerAPI.addEvent(univerAPI.Event.SheetEditEnded, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});
Returns

"SheetEditEnded"

Event fired after a cell edit ends

See

ISheetEditEndedEventParams

Example

univerAPI.addEvent(univerAPI.Event.SheetEditEnded, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});

Implementation of

IFSheetsUIEventNameMixin.SheetEditEnded

Overrides

FEventName.SheetEditEnded

SheetEditStarted

Get Signature

get SheetEditStarted(): "SheetEditStarted"

Defined in: submodules/univer/packages/sheets-ui/src/facade/f-event.ts:339

Event fired after a cell is edited

See

ISheetEditEndedEventParams

Example
univerAPI.addEvent(univerAPI.Event.SheetEditStarted, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});
Returns

"SheetEditStarted"

Event fired after a cell is edited

See

ISheetEditEndedEventParams

Example

univerAPI.addEvent(univerAPI.Event.SheetEditStarted, (params) => {
     const { worksheet, workbook, row, column, eventType, keycode, isZenEditor } = params;
});

Implementation of

IFSheetsUIEventNameMixin.SheetEditStarted

Overrides

FEventName.SheetEditStarted

Undo

Get Signature

get Undo(): "Undo"

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:192

Event fired when an undo command is executed

See

ICommandEvent

Example
univerAPI.addEvent(univerAPI.event.Undo, (event) => {
    const { params, id, type } = event;
    console.log('command executed', event);
});
Returns

"Undo"

Inherited from

FEventName.Undo


WorkbookCreated

Get Signature

get WorkbookCreated(): "WorkbookCreated"

Defined in: submodules/univer/packages/sheets/src/facade/f-event.ts:58

Event fired after a workbook is created

See

IWorkbookCreateParam

Example
univerAPI.addEvent(univerAPI.event.WorkbookCreated, (params) => {
     const { unitId, type, workbook, unit } = params;
    console.log('unit created', params);
});
Returns

"WorkbookCreated"

Inherited from

FEventName.WorkbookCreated

WorkbookDisposed

Get Signature

get WorkbookDisposed(): "WorkbookDisposed"

Defined in: submodules/univer/packages/sheets/src/facade/f-event.ts:70

Event fired after a workbook is disposed

See

IWorkbookDisposedEvent

Example
univerAPI.addEvent(univerAPI.event.WorkbookDisposed, (params) => {
     const { unitId, unitType, snapshot } = params;
    console.log('unit disposed', params);
});
Returns

"WorkbookDisposed"

Inherited from

FEventName.WorkbookDisposed

Methods

extend()

static extend(source): void

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:98

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FEventName.extend


get()

static get(): FEventName

Defined in: submodules/univer/packages/core/src/facade/f-event.ts:88

Returns

FEventName

Inherited from

FEventName.get