@ -1,13 +1,46 @@
import { INTERNAL_CONTEXT_MENU_KEY } from '../../../dataset/constant/ContextMenu'
import { VerticalAlign } from '../../../dataset/enum/VerticalAlign'
import { TableBorder , TdBorder , TdSlash } from '../../../dataset/enum/table/Table'
import {
TableBorder ,
TdBorder ,
TdSlash
} from '../../../dataset/enum/table/Table'
import { IRegisterContextMenu } from '../../../interface/contextmenu/ContextMenu'
import { Command } from '../../command/Command'
const {
TABLE : {
BORDER ,
BORDER_ALL ,
BORDER_EMPTY ,
BORDER_EXTERNAL ,
BORDER_TD ,
BORDER_TD_BOTTOM ,
BORDER_TD_BACK ,
BORDER_TD_FORWARD ,
VERTICAL_ALIGN ,
VERTICAL_ALIGN_TOP ,
VERTICAL_ALIGN_MIDDLE ,
VERTICAL_ALIGN_BOTTOM ,
INSERT_ROW_COL ,
INSERT_TOP_ROW ,
INSERT_BOTTOM_ROW ,
INSERT_LEFT_COL ,
INSERT_RIGHT_COL ,
DELETE_ROW_COL ,
DELETE_ROW ,
DELETE_COL ,
DELETE_TABLE ,
MERGE_CELL ,
CANCEL_MERGE_CELL
}
} = INTERNAL_CONTEXT_MENU_KEY
export const tableMenus : IRegisterContextMenu [ ] = [
{
isDivider : true
} ,
{
key : BORDER ,
i18nPath : 'contextmenu.table.border' ,
icon : 'border-all' ,
when : payload = > {
@ -15,6 +48,7 @@ export const tableMenus: IRegisterContextMenu[] = [
} ,
childMenus : [
{
key : BORDER_ALL ,
i18nPath : 'contextmenu.table.borderAll' ,
icon : 'border-all' ,
when : ( ) = > true ,
@ -23,6 +57,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : BORDER_EMPTY ,
i18nPath : 'contextmenu.table.borderEmpty' ,
icon : 'border-empty' ,
when : ( ) = > true ,
@ -31,6 +66,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : BORDER_EXTERNAL ,
i18nPath : 'contextmenu.table.borderExternal' ,
icon : 'border-external' ,
when : ( ) = > true ,
@ -39,11 +75,13 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : BORDER_TD ,
i18nPath : 'contextmenu.table.borderTd' ,
icon : 'border-td' ,
when : ( ) = > true ,
childMenus : [
{
key : BORDER_TD_BOTTOM ,
i18nPath : 'contextmenu.table.borderTdBottom' ,
icon : 'border-td-bottom' ,
when : ( ) = > true ,
@ -52,6 +90,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : BORDER_TD_FORWARD ,
i18nPath : 'contextmenu.table.borderTdForward' ,
icon : 'border-td-forward' ,
when : ( ) = > true ,
@ -60,6 +99,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : BORDER_TD_BACK ,
i18nPath : 'contextmenu.table.borderTdBack' ,
icon : 'border-td-back' ,
when : ( ) = > true ,
@ -72,6 +112,7 @@ export const tableMenus: IRegisterContextMenu[] = [
]
} ,
{
key : VERTICAL_ALIGN ,
i18nPath : 'contextmenu.table.verticalAlign' ,
icon : 'vertical-align' ,
when : payload = > {
@ -79,6 +120,7 @@ export const tableMenus: IRegisterContextMenu[] = [
} ,
childMenus : [
{
key : VERTICAL_ALIGN_TOP ,
i18nPath : 'contextmenu.table.verticalAlignTop' ,
icon : 'vertical-align-top' ,
when : ( ) = > true ,
@ -87,6 +129,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : VERTICAL_ALIGN_MIDDLE ,
i18nPath : 'contextmenu.table.verticalAlignMiddle' ,
icon : 'vertical-align-middle' ,
when : ( ) = > true ,
@ -95,6 +138,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : VERTICAL_ALIGN_BOTTOM ,
i18nPath : 'contextmenu.table.verticalAlignBottom' ,
icon : 'vertical-align-bottom' ,
when : ( ) = > true ,
@ -105,6 +149,7 @@ export const tableMenus: IRegisterContextMenu[] = [
]
} ,
{
key : INSERT_ROW_COL ,
i18nPath : 'contextmenu.table.insertRowCol' ,
icon : 'insert-row-col' ,
when : payload = > {
@ -112,6 +157,7 @@ export const tableMenus: IRegisterContextMenu[] = [
} ,
childMenus : [
{
key : INSERT_TOP_ROW ,
i18nPath : 'contextmenu.table.insertTopRow' ,
icon : 'insert-top-row' ,
when : ( ) = > true ,
@ -120,6 +166,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : INSERT_BOTTOM_ROW ,
i18nPath : 'contextmenu.table.insertBottomRow' ,
icon : 'insert-bottom-row' ,
when : ( ) = > true ,
@ -128,6 +175,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : INSERT_LEFT_COL ,
i18nPath : 'contextmenu.table.insertLeftCol' ,
icon : 'insert-left-col' ,
when : ( ) = > true ,
@ -136,6 +184,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : INSERT_RIGHT_COL ,
i18nPath : 'contextmenu.table.insertRightCol' ,
icon : 'insert-right-col' ,
when : ( ) = > true ,
@ -146,6 +195,7 @@ export const tableMenus: IRegisterContextMenu[] = [
]
} ,
{
key : DELETE_ROW_COL ,
i18nPath : 'contextmenu.table.deleteRowCol' ,
icon : 'delete-row-col' ,
when : payload = > {
@ -153,6 +203,7 @@ export const tableMenus: IRegisterContextMenu[] = [
} ,
childMenus : [
{
key : DELETE_ROW ,
i18nPath : 'contextmenu.table.deleteRow' ,
icon : 'delete-row' ,
when : ( ) = > true ,
@ -161,6 +212,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : DELETE_COL ,
i18nPath : 'contextmenu.table.deleteCol' ,
icon : 'delete-col' ,
when : ( ) = > true ,
@ -169,6 +221,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : DELETE_TABLE ,
i18nPath : 'contextmenu.table.deleteTable' ,
icon : 'delete-table' ,
when : ( ) = > true ,
@ -179,6 +232,7 @@ export const tableMenus: IRegisterContextMenu[] = [
]
} ,
{
key : MERGE_CELL ,
i18nPath : 'contextmenu.table.mergeCell' ,
icon : 'merge-cell' ,
when : payload = > {
@ -189,6 +243,7 @@ export const tableMenus: IRegisterContextMenu[] = [
}
} ,
{
key : CANCEL_MERGE_CELL ,
i18nPath : 'contextmenu.table.mergeCancelCell' ,
icon : 'merge-cancel-cell' ,
when : payload = > {