UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

55 lines (54 loc) 1.54 kB
import { App, VNode } from "vue"; import { JSX } from "vue/jsx-runtime"; import { IResizeEvent } from "./resizeable/resize-event"; /** 自定义按钮结构 */ export interface ModalButton { name?: string; class: string; focusedByDefault?: boolean; disabled?: boolean; iconClass?: string; handle: ($event: MouseEvent, context: any) => any; text: string; } export interface ModalOptions { class?: string; title?: string; width?: number; height?: number; minWidth?: number; minHeight?: number; showButtons?: boolean; showHeader?: boolean; showFloatingClose?: boolean; content?: { render(): JSX.Element; }; render?: (app: App) => JSX.Element; fitContent?: boolean; buttons?: ModalButton[]; draggable?: boolean; dragHandle?: string | HTMLElement; resizeable?: boolean; showMaxButton?: boolean; showCloseButton?: boolean; beforeClose?: () => boolean; acceptCallback?: () => void; rejectCallback?: () => void; closedCallback?: ($event?: Event, from?: 'esc' | 'icon' | 'button') => void; resizeHandle?: (event: IResizeEvent) => void; stopMoveHandle?: (event?: MouseEvent) => void; enableEsc?: boolean; dialogType?: string; src?: string; host?: string | HTMLElement; } export interface ModalFunctions { update: (options: ModalOptions) => void; destroy: () => void; modalRef: any; close: (modalRef?: any) => void; } export interface UseModal { FModalContextHolder: () => VNode; }