UNPKG

2.73 kBTypeScriptView Raw
1import { RenderFunction, SetupContext, Ref, ComponentPublicInstance } from 'vue'
2import { VXEComponent, VxeComponentBase } from '../component'
3import { VxeTableDataRow } from '../table'
4
5/* eslint-disable no-use-before-define */
6
7/**
8 * 表格模块 - 快捷菜单
9 */
10export const VxeTableMenuModule: VXEComponent<{ [key: string]: any }>
11/**
12 * 表格模块 - 快捷菜单
13 */
14export const Menu: VXEComponent<{ [key: string]: any }>
15
16export type VxeTableMenuPanelInstance = ComponentPublicInstance<VxeTableMenuPanelProps, VxeTableMenuPanelConstructor>
17
18export interface VxeTableMenuPanelConstructor extends VxeComponentBase, VxeTableMenuPanelMethods {
19 props: VxeTableMenuPanelProps
20 context: SetupContext
21 getRefMaps(): MenuPanelPrivateRef
22 renderVN: RenderFunction
23}
24
25export interface MenuPanelPrivateRef {
26 refElem: Ref<HTMLDivElement>
27}
28export interface VxeTableMenuPanelPrivateRef extends MenuPanelPrivateRef { }
29
30export interface VxeTableMenuPanelMethods { }
31
32export type VxeTableMenuPanelProps = {
33 [key: string]: any
34}
35
36export interface TableMenuMethods<D = VxeTableDataRow> {
37 /**
38 * 手动关闭快捷菜单
39 */
40 closeMenu(): Promise<any>
41}
42
43export interface TableMenuPrivateMethods<D = VxeTableDataRow> {
44 moveCtxMenu(evnt: any, ctxMenuStore: any, property: any, hasOper: boolean, operRest: any, menuList: any): void
45 handleOpenMenuEvent(evnt: Event, type: 'header' | 'body' | 'footer', params: any): void
46 handleGlobalContextmenuEvent(evnt: any): void
47 ctxMenuMouseoverEvent(evnt: any, item: any, child?: any): void
48 ctxMenuMouseoutEvent(evnt: any, item: any): void
49 ctxMenuLinkEvent(evnt: any, menu: any): void
50}
51
52declare module '../grid' {
53 export interface VxeGridMethods<D = VxeTableDataRow> extends TableMenuMethods<D> { }
54}
55
56declare module '../table' {
57 export interface VxeTableMethods<D = VxeTableDataRow> extends TableMenuMethods<D> { }
58 export interface VxeTablePrivateMethods<D = VxeTableDataRow> extends TableMenuPrivateMethods<D> { }
59 export namespace VxeTableDefines {
60 export interface MenuOptions {
61 disabled?: boolean
62 options?: MenuFirstOption[][]
63 }
64 export interface MenuFirstOption {
65 code?: string
66 name?: string
67 prefixIcon?: string
68 suffixIcon?: string
69 className?: string
70 visible?: boolean
71 disabled?: boolean
72 children?: MenuChildOption[]
73 params?: any
74 [key: string]: any
75 }
76 export interface MenuChildOption {
77 code?: string
78 name?: string
79 prefixIcon?: string
80 className?: string
81 visible?: boolean
82 disabled?: boolean
83 params?: any
84 [key: string]: any
85 }
86 }
87}