maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
271 lines (270 loc) • 15.2 kB
TypeScript
import { ComponentPublicInstance, ComputedRef } from 'vue';
import { MazBtnProps } from './MazBtn.vue';
import { MazDialogProps } from './MazDialog.vue';
import { MazDialogConfirmButton, MazDialogConfirmData } from './MazDialogConfirm/useMazDialogConfirm';
export interface MazDialogConfirmInternalProps {
/**
* Uniq identifier of the dialog
* @description This is used to identify the dialog in the state
*/
identifier: string;
/**
* Dialog title displayed in the header
*/
title?: string;
/**
* Dialog message displayed in the body
*/
message?: string;
/**
* Text for the reject button - will be applied only if buttons props is not provided
* @default undefined
*/
rejectText?: string;
/**
* Props for the reject button - will be applied only if buttons props is not provided
* @default { color: 'destructive', type: 'reject', text: 'Cancel', response: 'reject' }
* @type {Omit<MazBtnProps, 'type'> & MazDialogConfirmButton}
*/
rejectProps?: Omit<MazBtnProps, 'type'> & MazDialogConfirmButton;
/**
* Whether to display the reject button
* @default true
*/
hideRejectButton?: boolean;
/**
* Text for the accept button
* @default undefined
*/
acceptText?: string;
/**
* Props for the accept button - will be applied only if buttons props is not provided
* @default { color: 'success', type: 'accept', text: 'Confirm', response: 'accept' }
* @type {Omit<MazBtnProps, 'type'> & MazDialogConfirmButton}
*/
acceptProps?: Omit<MazBtnProps, 'type'> & MazDialogConfirmButton;
/**
* Whether to display the accept button
* @default true
*/
hideAcceptButton?: boolean;
/**
* Buttons to display in the footer
* @default undefined
*/
buttons?: MazDialogConfirmButton[];
}
export type MazDialogConfirmProps = MazDialogConfirmInternalProps & MazDialogConfirmData & MazDialogProps;
export { useMazDialogConfirm } from './MazDialogConfirm/useMazDialogConfirm';
export type { MazDialogConfirmButton, MazDialogConfirmData } from './MazDialogConfirm/useMazDialogConfirm';
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<MazDialogConfirmProps, {
close: () => void;
isActive: ComputedRef<boolean>;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
close: (value: void) => any;
open: (value: void) => any;
}, string, import('vue').PublicProps, Readonly<MazDialogConfirmProps> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
dialog: ({
$: import('vue').ComponentInternalInstance;
$data: {};
$props: {
readonly modelValue?: boolean | undefined;
readonly title?: string | undefined;
readonly hideCloseButton?: boolean | undefined;
readonly maxWidth?: string | undefined;
readonly minWidth?: string | undefined;
readonly scrollable?: boolean | undefined;
readonly persistent?: boolean | undefined;
readonly teleportSelector?: string | undefined;
readonly beforeClose?: (() => Promise<void> | void) | undefined;
readonly closeOnEscape?: boolean | undefined;
readonly transitionName?: string | undefined;
readonly backdropClass?: import('vue').HTMLAttributes["class"];
readonly backdropContentClass?: import('vue').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 ariaLabelledby?: string | undefined;
readonly ariaDescribedby?: string | undefined;
readonly onClose?: ((value?: void | undefined) => any) | undefined;
readonly onOpen?: ((value?: void | undefined) => any) | undefined;
readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
} & {
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 closeOnEscape?: boolean | undefined;
readonly transitionName?: string | undefined;
readonly backdropClass?: import('vue').HTMLAttributes["class"];
readonly backdropContentClass?: import('vue').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 ariaLabelledby?: string | undefined;
readonly ariaDescribedby?: string | 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<import('./MazBackdrop.vue').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;
}>, {
onBackdropAnimationLeave: () => void;
close: () => void;
present: import('vue').Ref<boolean, boolean>;
toggleModal: (value?: boolean) => 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 import('vue').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<import('./MazBackdrop.vue').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" | "onBackdropAnimationLeave" | "present" | "toggleModal" | "onKeyPress"> & import('vue').ShallowUnwrapRef<{
onBackdropAnimationLeave: () => void;
close: () => void;
present: import('vue').Ref<boolean, boolean>;
toggleModal: (value?: boolean) => Promise<void>;
onKeyPress: (event: KeyboardEvent) => void;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: {
default?(_: {
close: () => void;
}): any;
};
}) | null;
dialogContent: HTMLDivElement;
};
$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);
$el: any;
$options: import('vue').ComponentOptionsBase<Readonly<import('./MazDialog.vue').DialogProps & import('./MazBackdrop.vue').MazBackdropProps> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
}>, {
close: () => any;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
close: (value: void) => any;
open: (value: void) => any;
"update:model-value": (value: boolean) => 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 import('vue').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<import('./MazDialog.vue').DialogProps & import('./MazBackdrop.vue').MazBackdropProps> & Readonly<{
onClose?: ((value?: void | undefined) => any) | undefined;
onOpen?: ((value?: void | undefined) => any) | undefined;
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
}>, "close"> & import('vue').ShallowUnwrapRef<{
close: () => any;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: {
header?(_: {
close: () => void;
}): any;
title?(_: {}): any;
default?(_: {
close: () => void;
}): any;
footer?(_: {
close: () => void;
}): any;
};
}) | null;
}, any>, {
title?(_: {}): any;
default?(_: {
accept: (reason?: unknown) => Promise<unknown>;
reject: (reason?: unknown) => Promise<unknown>;
}): any;
'footer-button'?(_: {
accept: (reason?: unknown) => Promise<unknown>;
reject: (reason?: unknown) => Promise<unknown>;
}): any;
}>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};