UNPKG

sard-uniapp

Version:

sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库

544 lines (543 loc) 16.4 kB
import { type StyleValue } from 'vue'; import { type TransitionHookEmits } from '../popup/common'; export type PopoutBeforeClose = (type: 'close' | 'cancel' | 'confirm', loading: { readonly cancel: boolean; readonly confirm: boolean; readonly close: boolean; }) => any | Promise<any>; export interface PopoutProps { rootStyle?: StyleValue; rootClass?: string; visible?: boolean; duration?: number; title?: string; type?: 'compact' | 'loose'; showCancel?: boolean; cancelText?: string; showConfirm?: boolean; confirmText?: string; confirmDisabled?: boolean; showClose?: boolean; showFooter?: boolean; overlay?: boolean; overlayClass?: string; overlayStyle?: string; background?: string; transparent?: boolean; overlayClosable?: boolean; beforeClose?: PopoutBeforeClose; keepRender?: boolean; } export declare const defaultPopoutProps: { rootStyle?: (string | false | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string | false | import("vue").CSSProperties | StyleValue[]) | null) | undefined; rootClass?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; visible?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; duration?: (number | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => number)) | undefined; title?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; type?: ("compact" | "loose" | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => "compact" | "loose")) | undefined; showCancel?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; cancelText?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; showConfirm?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; confirmText?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; confirmDisabled?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; showClose?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; showFooter?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; overlay?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; overlayClass?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; overlayStyle?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; background?: (string | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => string)) | undefined; transparent?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; overlayClosable?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; beforeClose?: (PopoutBeforeClose | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => PopoutBeforeClose)) | undefined; keepRender?: (boolean | ((props: { rootStyle: StyleValue; rootClass: string; visible: boolean; duration: number; title: string; type: "compact" | "loose"; showCancel: boolean; cancelText: string; showConfirm: boolean; confirmText: string; confirmDisabled: boolean; showClose: boolean; showFooter: boolean; overlay: boolean; overlayClass: string; overlayStyle: string; background: string; transparent: boolean; overlayClosable: boolean; beforeClose: PopoutBeforeClose; keepRender: boolean; }) => boolean)) | undefined; }; export interface PopoutSlots { default?(props: Record<string, never>): any; title?(props: Record<string, never>): any; cancel?(props: { onClick: () => void; loading: boolean; visible?: boolean; text: string; }): any; confirm?(props: { onClick: () => void; loading: boolean; visible?: boolean; text: string; disabled?: boolean; }): any; visible?(props: { whole: boolean; already: boolean; }): any; 'title-prepend'?(props: Record<string, never>): any; } export interface PopoutEmits extends TransitionHookEmits { (e: 'update:visible', visible: boolean): void; (e: 'close'): void; (e: 'cancel'): void; (e: 'confirm'): void; }