maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
164 lines (163 loc) • 8.59 kB
TypeScript
import type { ComponentPublicInstance, HTMLAttributes } from 'vue';
import { nextTick } from 'vue';
import { type MazBackdropProps } from './MazBackdrop.vue';
export interface InternalProps {
/** @model Modal's model value */
modelValue?: boolean;
/** Title of the modal in header */
title?: string;
/** Remove the close button in header */
noClose?: boolean;
/** Modal's max-width */
maxWidth?: string;
/** Modal's min-width */
minWidth?: string;
/** Modal's content becomes scrollable - warning: a overflow is applied */
scrollable?: boolean;
/** Persistent dialog (not closable by clicking outside and remove close button) */
persistent?: boolean;
}
export type MazDialogProps = InternalProps & MazBackdropProps;
type __VLS_Props = InternalProps & MazBackdropProps;
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: {
header?(_: {
close: () => void;
onBackdropClicked: () => void;
}): any;
title?(_: {}): any;
default?(_: {
close: () => void;
onBackdropClicked: () => void;
}): any;
footer?(_: {
close: () => void;
onBackdropClicked: () => void;
}): any;
};
refs: {
backdrop: ({
$: import("vue").ComponentInternalInstance;
$data: {};
$props: {
readonly modelValue?: boolean | undefined;
readonly teleportSelector?: string | undefined;
readonly beforeClose?: (() => Promise<void> | void) | undefined;
readonly persistent?: boolean | undefined;
readonly noCloseOnEscKey?: boolean | undefined;
readonly transitionName?: string | undefined;
readonly backdropClass?: HTMLAttributes["class"];
readonly backdropContentClass?: HTMLAttributes["class"];
readonly contentPadding?: boolean | undefined;
readonly justify?: ("center" | "end" | "start" | "space-between" | "space-around" | "none") | undefined;
readonly align?: ("center" | "end" | "start" | "none") | undefined;
readonly variant?: ("bottom-sheet" | "dialog" | "drawer") | undefined;
readonly onClose?: ((value?: void | undefined) => any) | undefined;
readonly onOpen?: ((value?: void | undefined) => any) | undefined;
readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
readonly "onBefore-close"?: ((value?: void | undefined) => any) | undefined;
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
};
$slots: Readonly<{
[name: string]: import("vue").Slot<any> | undefined;
}>;
$root: ComponentPublicInstance | null;
$parent: ComponentPublicInstance | null;
$host: Element | null;
$emit: ((event: "close", value?: void | undefined) => void) & ((event: "open", value?: void | undefined) => void) & ((event: "update:model-value", value: boolean) => void) & ((event: "before-close", value?: void | undefined) => void);
$el: any;
$options: import("vue").ComponentOptionsBase<Readonly<MazBackdropProps> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
}>, {
onBackdropAnimationEnter: () => void;
onBackdropAnimationLeave: () => void;
onBackdropClicked: () => void;
close: () => void;
present: import("vue").Ref<boolean, boolean>;
toggleModal: (value: any) => Promise<void>;
onKeyPress: (event: KeyboardEvent) => void;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
close: (value: void) => any;
open: (value: void) => any;
"update:model-value": (value: boolean) => any;
"before-close": (value: void) => any;
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
beforeCreate?: (() => void) | (() => void)[];
created?: (() => void) | (() => void)[];
beforeMount?: (() => void) | (() => void)[];
mounted?: (() => void) | (() => void)[];
beforeUpdate?: (() => void) | (() => void)[];
updated?: (() => void) | (() => void)[];
activated?: (() => void) | (() => void)[];
deactivated?: (() => void) | (() => void)[];
beforeDestroy?: (() => void) | (() => void)[];
beforeUnmount?: (() => void) | (() => void)[];
destroyed?: (() => void) | (() => void)[];
unmounted?: (() => void) | (() => void)[];
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
};
$forceUpdate: () => void;
$nextTick: typeof nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
} & Readonly<{}> & Omit<Readonly<MazBackdropProps> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
}>, "close" | "onBackdropAnimationEnter" | "onBackdropAnimationLeave" | "onBackdropClicked" | "present" | "toggleModal" | "onKeyPress"> & import("vue").ShallowUnwrapRef<{
onBackdropAnimationEnter: () => void;
onBackdropAnimationLeave: () => void;
onBackdropClicked: () => void;
close: () => void;
present: import("vue").Ref<boolean, boolean>;
toggleModal: (value: any) => Promise<void>;
onKeyPress: (event: KeyboardEvent) => void;
}> & {} & import("vue").ComponentCustomProperties & {} & {
$slots: {
default?(_: {
close: () => void;
onBackdropClicked: () => void;
}): any;
};
}) | null;
dialogContent: HTMLDivElement;
};
rootEl: any;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
close: () => any;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
close: (value: void) => any;
open: (value: void) => any;
"update:model-value": (value: boolean) => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
}>, {
title: string;
persistent: boolean;
noClose: boolean;
maxWidth: string;
minWidth: string;
scrollable: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};