UNPKG

tav-ui

Version:
1 lines 9.7 kB
{"version":3,"file":"types2.mjs","sources":["../../../../../../../packages/components/modal/src/types.ts"],"sourcesContent":["import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'\nimport type { CSSProperties, ComputedRef, PropType, VNodeChild } from 'vue'\nexport type VueNode = VNodeChild | JSX.Element\nexport const modalProps = {\n visible: { type: Boolean },\n scrollTop: { type: Boolean, default: true },\n height: { type: Number },\n minHeight: { type: Number },\n // open drag\n draggable: { type: Boolean, default: false },\n centered: { type: Boolean },\n cancelText: { type: String },\n okText: { type: String },\n\n closeFunc: Function as PropType<() => Promise<boolean>>,\n}\n// export type ModalProps = ExtractPropTypes<typeof modalProps>\nexport const basicProps = Object.assign({}, modalProps, {\n defaultFullscreen: { type: Boolean },\n // Can it be full screen\n canFullscreen: { type: Boolean, default: false },\n // After enabling the wrapper, the bottom can be increased in height\n wrapperFooterOffset: { type: Number, default: 0 },\n // Warm reminder message\n helpMessage: [String, Array] as PropType<string | string[]>,\n // Whether to setting wrapper\n useWrapper: { type: Boolean, default: true },\n loading: { type: Boolean },\n loadingTip: { type: String },\n /**\n * @description: Show close button\n */\n showCancelBtn: { type: Boolean, default: true },\n /**\n * @description: Show confirmation button\n */\n showOkBtn: { type: Boolean, default: true },\n\n wrapperProps: Object as PropType<Partial<ModalWrapperProps>>,\n\n afterClose: Function as PropType<() => Promise<VueNode>>,\n\n bodyStyle: Object as PropType<CSSProperties>,\n style: Object as PropType<CSSProperties>,\n\n closable: { type: Boolean, default: true },\n\n closeIcon: Object as PropType<VueNode>,\n\n confirmLoading: { type: Boolean },\n\n destroyOnClose: { type: Boolean },\n\n footer: Object as PropType<VueNode>,\n\n getContainer: Function as PropType<() => any>,\n\n mask: { type: Boolean, default: true },\n\n maskClosable: { type: Boolean, default: false },\n keyboard: { type: Boolean, default: true },\n\n maskStyle: Object as PropType<CSSProperties>,\n\n okType: { type: String, default: 'primary' },\n\n okButtonProps: Object as PropType<ButtonProps>,\n\n cancelButtonProps: Object as PropType<ButtonProps>,\n\n title: { type: String },\n\n visible: { type: Boolean },\n\n width: [String, Number] as PropType<string | number>,\n\n wrapClassName: { type: String },\n\n zIndex: { type: Number },\n})\n/**\n * @description: 弹窗对外暴露的方法\n */\nexport interface ModalMethods {\n redoThumbHeight: () => void\n setModalProps: (props: Partial<ModalProps>) => void\n emitVisible?: (visible: boolean, uid: number) => void\n redoModalHeight?: () => void\n}\n\ntype RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void\n\nexport interface ModalReturnMethods extends ModalMethods {\n openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void\n closeModal: () => void\n getVisible?: ComputedRef<boolean>\n}\n\nexport type UseModalReturnType = [RegisterFn, ModalReturnMethods]\n\nexport interface ReturnInnerMethods extends ModalMethods {\n closeModal: () => void\n changeLoading: (loading: boolean) => void\n changeOkLoading: (loading: boolean) => void\n getVisible?: ComputedRef<boolean>\n redoModalHeight: () => void\n}\n\nexport type UseModalInnerReturnType = [RegisterFn, ReturnInnerMethods]\n\nexport interface ModalProps {\n minHeight?: number\n height?: number\n // 启用wrapper后 底部可以适当增加高度\n wrapperFooterOffset?: number\n draggable?: boolean\n scrollTop?: boolean\n\n // 是否可以进行全屏\n canFullscreen?: boolean\n defaultFullscreen?: boolean\n visible?: boolean\n // 温馨提醒信息\n helpMessage: string | string[]\n\n // 是否使用modalWrapper\n useWrapper: boolean\n\n loading: boolean\n loadingTip?: string\n\n wrapperProps: Omit<ModalWrapperProps, 'loading'>\n\n showOkBtn: boolean\n showCancelBtn: boolean\n closeFunc: () => Promise<any>\n\n /**\n * Specify a function that will be called when modal is closed completely.\n * @type Function\n */\n afterClose?: () => any\n\n /**\n * Body style for modal body element. Such as height, padding etc.\n * @default {}\n * @type object\n */\n bodyStyle?: CSSProperties\n style?: CSSProperties\n\n /**\n * Text of the Cancel button\n * @default 'cancel'\n * @type string\n */\n cancelText?: string\n\n /**\n * Centered Modal\n * @default false\n * @type boolean\n */\n centered?: boolean\n\n /**\n * Whether a close (x) button is visible on top right of the modal dialog or not\n * @default true\n * @type boolean\n */\n closable?: boolean\n /**\n * Whether a close (x) button is visible on top right of the modal dialog or not\n */\n closeIcon?: VNodeChild | JSX.Element\n\n /**\n * Whether to apply loading visual effect for OK button or not\n * @default false\n * @type boolean\n */\n confirmLoading?: boolean\n\n /**\n * Whether to unmount child components on onClose\n * @default false\n * @type boolean\n */\n destroyOnClose?: boolean\n\n /**\n * Footer content, set as :footer=\"null\" when you don't need default buttons\n * @default OK and Cancel buttons\n * @type any (string | slot)\n */\n footer?: VNodeChild | JSX.Element\n\n /**\n * Return the mount node for Modal\n * @default () => document.body\n * @type Function\n */\n getContainer?: (instance: any) => HTMLElement\n\n /**\n * Whether show mask or not.\n * @default true\n * @type boolean\n */\n mask?: boolean\n\n /**\n * Whether to close the modal dialog when the mask (area outside the modal) is clicked\n * @default true\n * @type boolean\n */\n maskClosable?: boolean\n\n /**\n * Style for modal's mask element.\n * @default {}\n * @type object\n */\n maskStyle?: CSSProperties\n\n /**\n * Text of the OK button\n * @default 'OK'\n * @type string\n */\n okText?: string\n\n /**\n * Button type of the OK button\n * @default 'primary'\n * @type string\n */\n okType?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'\n\n /**\n * The ok button props, follow jsx rules\n * @type object\n */\n okButtonProps?: ButtonProps\n\n /**\n * The cancel button props, follow jsx rules\n * @type object\n */\n cancelButtonProps?: ButtonProps\n\n /**\n * The modal dialog's title\n * @type any (string | slot)\n */\n title?: VNodeChild | JSX.Element\n\n /**\n * Width of the modal dialog\n * @default 520\n * @type string | number\n */\n width?: string | number\n\n /**\n * The class name of the container of the modal dialog\n * @type string\n */\n wrapClassName?: string\n\n /**\n * The z-index of the Modal\n * @default 1000\n * @type number\n */\n zIndex?: number\n}\n\nexport interface ModalWrapperProps {\n footerOffset?: number\n loading: boolean\n modalHeaderHeight: number\n modalFooterHeight: number\n minHeight: number\n height: number\n visible: boolean\n fullScreen: boolean\n useWrapper: boolean\n}\nexport type Recordable<T = any> = Record<string, T>\nexport type Record<K extends keyof any, T> = {\n [P in K]: T\n}\nexport interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {\n $el: T\n}\n\nexport type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null\nexport interface Fn<T = any, R = T> {\n (...arg: T[]): R\n}\nexport type Nullable<T> = T | null\nexport type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>\n"],"names":[],"mappings":"AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AAC5B,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC7C,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC1B,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC7B,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC9C,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AAC7B,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC9B,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC1B,EAAE,SAAS,EAAE,QAAQ;AACrB,EAAE;AACU,MAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE;AACxD,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AACtC,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAClD,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE;AACnD,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AAC9B,EAAE,UAAU,EAAE,E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