@aomao/plugin-table

Form plugin

Installation

$ yarn add @aomao/plugin-table

Add to engine

import Engine, {EngineInterface} from'@aomao/engine';
import Table, {TableComponent} from'@aomao/plugin-table';
new Engine(...,{ plugins:[Table], cards:[TableComponent]})

Optional

Hotkey

No shortcut keys by default

//Shortcut keys, key combination keys, args, execution parameters, [rows?: string, cols?: string] Number of rows: default 3 rows, number of columns: default 3 columns
hotkey?:string | {key:string,args:Array<string>};//default none
//Use configuration
new Engine(...,{
config:{
"table":{
//Modify shortcut keys
hotkey:{
key:"mod+t",
args:[5,5]
}
}
}
})

Overflow display, enableScrollbar needs to be turned on to take effect

overflow?: {
// Relative to the maximum displayable width on the left side of the editor
maxLeftWidth?: () => number;
// Relative to the maximum displayable width on the right side of the editor
maxRightWidth?: () => number;
};

Minimum column width

colMinWidth: number; //default 40

Minimum line height

rowMinHeight: number; //default 30

Maximum row/column inserted at a time

maxInsertNum: number; //default 50

Whether to enable the scroll bar

enableScrollbar: boolean; //default true

Command

//Can carry two parameters, the number of rows and the number of columns, all are optional
engine.command.execute('table', 5, 5);