UNPKG

tav-ui

Version:
1 lines 2.17 kB
{"version":3,"file":"types2.mjs","sources":["../../../../../../../packages/components/context-menu/src/types.ts"],"sourcesContent":["import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'\nexport interface Axis {\n x: number\n y: number\n}\nexport interface Fn<T = any, R = T> {\n (...arg: T[]): R\n}\nexport interface ContextMenuItem {\n label: string\n icon?: string\n disabled?: boolean\n handler?: Fn\n divider?: boolean\n children?: ContextMenuItem[]\n}\nexport interface ContextMenuOptions {\n event: MouseEvent\n icon?: string\n styles?: any\n items?: ContextMenuItem[]\n}\nexport interface ItemContentProps {\n showIcon: boolean | undefined\n item: ContextMenuItem\n handler: Fn\n}\n\nexport const contextMenuProps = {\n width: { type: Number, default: 156 },\n customEvent: { type: Object as PropType<Event>, default: null },\n styles: { type: Object as PropType<CSSProperties> },\n showIcon: { type: Boolean, default: true },\n axis: {\n // The position of the right mouse button click\n type: Object as PropType<Axis>,\n default() {\n return { x: 0, y: 0 }\n },\n },\n items: {\n // The most important list, if not, will not be displayed\n type: Array as PropType<ContextMenuItem[]>,\n default() {\n return [\n {\n label: '',\n },\n ]\n },\n },\n event: {\n type: Object as PropType<MouseEvent>,\n },\n}\n\nexport type ContextMenuProps = ExtractPropTypes<typeof contextMenuProps>\n"],"names":[],"mappings":"AAAY,MAAC,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE;AACvC,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC1B,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC5C,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,GAAG;AACd,MAAM,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5B,KAAK;AACL,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,GAAG;AACd,MAAM,OAAO;AACb,QAAQ;AACR,UAAU,KAAK,EAAE,EAAE;AACnB,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH;;;;"}