@univerjs/sheets-drawing-ui v0.5.4


Class: FDrawingEventNameMixin

Defined in: sheets-drawing-ui/src/facade/f-event.ts:145

Extends

Implements

  • IFDrawingEventNameMixin

Constructors

new FDrawingEventNameMixin()

new FDrawingEventNameMixin(): FDrawingEventNameMixin

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

Returns

FDrawingEventNameMixin

Inherited from

FEventName.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
BeforeClipboardChangereadonly"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; })FEventName.BeforeClipboardChangesheets-ui/src/facade/f-event.ts:160
BeforeClipboardPastereadonly"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; })FEventName.BeforeClipboardPastesheets-ui/src/facade/f-event.ts:187
BeforeSheetEditEndreadonly"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; });FEventName.BeforeSheetEditEndsheets-ui/src/facade/f-event.ts:244
BeforeSheetEditStartreadonly"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; });FEventName.BeforeSheetEditStartsheets-ui/src/facade/f-event.ts:211
CellClickedreadonly"CellClicked"Event fired when a cell is clicked Example univerAPI.getActiveWorkbook().addEvent('CellClicked', (p)=> console.log(p));FEventName.CellClickedsheets-ui/src/facade/f-event.ts:264
CellHoverreadonly"CellHover"Event fired when a cell is hovered Example univerAPI.getActiveWorkbook().addEvent('CellHover', (p)=> console.log(p));FEventName.CellHoversheets-ui/src/facade/f-event.ts:290
CellPointerDownreadonly"CellPointerDown"Event fired when a cell is pointer down Example univerAPI.getActiveWorkbook().addEvent('CellPointerDown', (p)=> console.log(p));FEventName.CellPointerDownsheets-ui/src/facade/f-event.ts:272
CellPointerMovereadonly"CellPointerMove"Event fired when move on spreadsheet cells Example univerAPI.getActiveWorkbook().addEvent('CellPointerMove', (p)=> console.log(p));FEventName.CellPointerMovesheets-ui/src/facade/f-event.ts:298
CellPointerUpreadonly"CellPointerUp"Event fired when a cell is pointer up Example univerAPI.getActiveWorkbook().addEvent('CellPointerUp', (p)=> console.log(p));FEventName.CellPointerUpsheets-ui/src/facade/f-event.ts:281
ClipboardChangedreadonly"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: '...'} })FEventName.ClipboardChangedsheets-ui/src/facade/f-event.ts:173
ClipboardPastedreadonly"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: '...'} })FEventName.ClipboardPastedsheets-ui/src/facade/f-event.ts:199
DragOverreadonly"DragOver"Event fired when drag over spreadsheet cells Example univerAPI.getActiveWorkbook().addEvent('DragOver', (p)=> console.log(p));FEventName.DragOversheets-ui/src/facade/f-event.ts:306
Dropreadonly"Drop"Event fired when drop on spreadsheet cells Example univerAPI.getActiveWorkbook().addEvent('Drop', (p)=> console.log(p));FEventName.Dropsheets-ui/src/facade/f-event.ts:315
SheetEditChangingreadonly"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; });FEventName.SheetEditChangingsheets-ui/src/facade/f-event.ts:233
SheetEditEndedreadonly"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; });FEventName.SheetEditEndedsheets-ui/src/facade/f-event.ts:255
SheetEditStartedreadonly"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; });FEventName.SheetEditStartedsheets-ui/src/facade/f-event.ts:222
_instancestaticnull | FEventName-FEventName._instancecore/src/facade/f-event.ts:87

Accessors

BeforeCommandExecute

Get Signature

get BeforeCommandExecute(): "BeforeCommandExecute"

Defined in: 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


BeforeOverGridImageChange

Get Signature

get BeforeOverGridImageChange(): "BeforeOverGridImageChange"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:146

Triggered before floating image change. Type of the event parameter is IBeforeOverGridImageChangeParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageChange, (param) => {
  const { workbook, images } = param;
  // do something
  console.log(workbook, images);
  // Cancel the image change
  param.cancel = true;
})
Returns

"BeforeOverGridImageChange"

Implementation of

IFDrawingEventNameMixin.BeforeOverGridImageChange

Overrides

FEventName.BeforeOverGridImageChange

BeforeOverGridImageInsert

Get Signature

get BeforeOverGridImageInsert(): "BeforeOverGridImageInsert"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:154

Triggered before floating image insertion. Type of the event parameter is IBeforeOverGridImageInsertParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageInsert, (param) => {
   const { workbook, insertImageParams } = param;
   // do something
   console.log(workbook, insertImageParams);
   // Cancel the insertion operation
   param.cancel = true;
})
Returns

"BeforeOverGridImageInsert"

Implementation of

IFDrawingEventNameMixin.BeforeOverGridImageInsert

Overrides

FEventName.BeforeOverGridImageInsert

BeforeOverGridImageRemove

Get Signature

get BeforeOverGridImageRemove(): "BeforeOverGridImageRemove"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:162

Triggered before floating image removal. Type of the event parameter is IBeforeOverGridImageRemoveParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageRemove, (param) => {
 const { workbook, images } = param;
// do something
console.log(workbook, images);
// Cancel the removal operation
param.cancel = true;
})
Returns

"BeforeOverGridImageRemove"

Implementation of

IFDrawingEventNameMixin.BeforeOverGridImageRemove

Overrides

FEventName.BeforeOverGridImageRemove

BeforeOverGridImageSelect

Get Signature

get BeforeOverGridImageSelect(): "BeforeOverGridImageSelect"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:170

Triggered before floating image selection. Type of the event parameter is IBeforeOverGridImageSelectParam

Example
univerAPI.addEvent(univerAPI.Event.BeforeOverGridImageSelect, (param) => {
  const { workbook, selectedImages, oldSelectedImages } = param;
  // do something
  console.log(workbook, selectedImages, oldSelectedImages);
  // cancel the event
  param.cancel = true;
})
Returns

"BeforeOverGridImageSelect"

Implementation of

IFDrawingEventNameMixin.BeforeOverGridImageSelect

Overrides

FEventName.BeforeOverGridImageSelect

BeforeRedo

Get Signature

get BeforeRedo(): "BeforeRedo"

Defined in: 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: 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

BeforeUndo

Get Signature

get BeforeUndo(): "BeforeUndo"

Defined in: 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


CommandExecuted

Get Signature

get CommandExecuted(): "CommandExecuted"

Defined in: 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: 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: 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


LifeCycleChanged

Get Signature

get LifeCycleChanged(): "LifeCycleChanged"

Defined in: 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


OverGridImageChanged

Get Signature

get OverGridImageChanged(): "OverGridImageChanged"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:150

Triggered after floating image change. Type of the event parameter is IOverGridImageChangedParam

Example
univerAPI.addEvent(univerAPI.Event.OverGridImageChanged, (param) => {
const { workbook, images } = param;
// do something
console.log(workbook, images);
})
Returns

"OverGridImageChanged"

Implementation of

IFDrawingEventNameMixin.OverGridImageChanged

Overrides

FEventName.OverGridImageChanged

OverGridImageInserted

Get Signature

get OverGridImageInserted(): "OverGridImageInserted"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:158

Triggered after floating image insertion. Type of the event parameter is IOverGridImageInsertedParam

Example
univerAPI.addEvent(univerAPI.Event.OverGridImageInserted, (param) => {
  const { workbook, images } = param;
 // do something
 console.log(workbook, images);
})
Returns

"OverGridImageInserted"

Implementation of

IFDrawingEventNameMixin.OverGridImageInserted

Overrides

FEventName.OverGridImageInserted

OverGridImageRemoved

Get Signature

get OverGridImageRemoved(): "OverGridImageRemoved"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:166

Triggered after floating image removal. Type of the event parameter is IOverGridImageRemovedParam

Example
univerAPI.addEvent(univerAPI.Event.OverGridImageRemoved, (param) => {
const { workbook, removeImageParams } = param;
// do something
console.log(workbook, removeImageParams);
})
Returns

"OverGridImageRemoved"

Implementation of

IFDrawingEventNameMixin.OverGridImageRemoved

Overrides

FEventName.OverGridImageRemoved

OverGridImageSelected

Get Signature

get OverGridImageSelected(): "OverGridImageSelected"

Defined in: sheets-drawing-ui/src/facade/f-event.ts:174

Triggered after floating image selection. Type of the event parameter is IOverGridImageSelectedParam

Example
univerAPI.addEvent(univerAPI.Event.OverGridImageSelected, (param) => {
const { workbook, selectedImages } = param;
// do something
console.log(workbook, selectedImages);
})
Returns

"OverGridImageSelected"

Implementation of

IFDrawingEventNameMixin.OverGridImageSelected

Overrides

FEventName.OverGridImageSelected

Redo

Get Signature

get Redo(): "Redo"

Defined in: 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: 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

Undo

Get Signature

get Undo(): "Undo"

Defined in: 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: 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: 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: core/src/facade/f-event.ts:98

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FEventName.extend


get()

static get(): FEventName

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

Returns

FEventName

Inherited from

FEventName.get