maz-ui 3.45.6 → 3.46.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MazAvatar.d.ts +12 -0
- package/components/MazAvatar.mjs +1 -1
- package/components/MazBackdrop.d.ts +4 -4
- package/components/MazBtn.d.ts +2 -2
- package/components/MazCard.mjs +1 -1
- package/components/MazChart.d.ts +1 -1
- package/components/MazDialog.d.ts +121 -4
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise/useMazDialogPromise.d.ts +80 -0
- package/components/MazDialogPromise.d.ts +20 -10
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.d.ts +2 -2
- package/components/MazDropdown.d.ts +11 -7
- package/components/MazDropdown.mjs +136 -141
- package/components/MazGallery.d.ts +1 -1
- package/components/MazGallery.mjs +1 -1
- package/components/MazIcon.d.ts +1 -1
- package/components/MazInputNumber.d.ts +1 -1
- package/components/MazInputPrice.d.ts +1 -1
- package/components/MazInputTags.d.ts +1 -1
- package/components/MazLink.d.ts +6 -2
- package/components/MazLink.mjs +3 -3
- package/components/MazPhoneNumberInput/PhoneInput.vue.d.ts +2 -2
- package/components/MazPhoneNumberInput.d.ts +18 -6
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.d.ts +3 -3
- package/components/MazPullToRefresh.d.ts +2 -2
- package/components/MazSelect.d.ts +5 -0
- package/components/MazSelect.mjs +1 -1
- package/components/MazSwitch.d.ts +1 -1
- package/components/MazTable.d.ts +1 -1
- package/components/MazTable.mjs +1 -1
- package/components/MazTabsBar.mjs +1 -1
- package/components/MazTextarea.d.ts +3 -3
- package/components/assets/MazAvatar.css +1 -1
- package/components/assets/MazDialog.css +1 -1
- package/components/assets/MazDialogPromise.css +1 -1
- package/components/assets/MazDropdown.css +1 -1
- package/components/assets/MazLink.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTabsBar.css +1 -1
- package/components/chunks/MazAvatar-BXZpFUaZ.mjs +154 -0
- package/components/chunks/{MazBadge-BtT5dcnQ.mjs → MazBadge-CNSfzYq-.mjs} +1 -1
- package/components/chunks/{MazBtn-DY7j6OiY.mjs → MazBtn-BFG89vCa.mjs} +2 -2
- package/components/chunks/{MazBtn-FrVhILjZ.mjs → MazBtn-BGoomw9I.mjs} +2 -2
- package/components/chunks/{MazBtn-BdOCsAcJ.mjs → MazBtn-Bv2ZJa_R.mjs} +2 -2
- package/components/chunks/MazBtn-Da2iB5Ca.mjs +150 -0
- package/components/chunks/{MazBtn-BiqIAH4q.mjs → MazBtn-K-VSnuAG.mjs} +2 -2
- package/components/chunks/{MazCard-BY62rYtJ.mjs → MazCard-dFVJALiZ.mjs} +1 -1
- package/components/chunks/{MazCheckbox-DH9P-r_8.mjs → MazCheckbox-BOQ3rCJA.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CR_iUN0_.mjs → MazCheckbox-Dia9JuH9.mjs} +1 -1
- package/components/chunks/{MazDialog-DZhBJeVd.mjs → MazDialog-C3DzTTKe.mjs} +82 -73
- package/components/chunks/MazDialogPromise-BjfZazCh.mjs +519 -0
- package/components/chunks/{MazGallery-Dpo7kTFH.mjs → MazGallery-BOmH2smL.mjs} +60 -60
- package/components/chunks/{MazGallery-CKofGCb2.mjs → MazGallery-PjwNt897.mjs} +61 -61
- package/components/chunks/{MazIcon-B5s0fahc.mjs → MazIcon-BJbOf-7v.mjs} +1 -1
- package/components/chunks/{MazIcon-ufe3UEle.mjs → MazIcon-DtpY3t9J.mjs} +1 -1
- package/components/chunks/{MazLazyImg-BmmDjOiK.mjs → MazLazyImg-D2seDVoC.mjs} +2 -2
- package/components/chunks/{MazPhoneNumberInput-CSCiLEae.mjs → MazPhoneNumberInput-ahQrhENR.mjs} +207 -197
- package/components/chunks/{MazSelect-C7j7fHLt.mjs → MazSelect-DZ86urPA.mjs} +11 -9
- package/components/chunks/{MazSpinner-B5tlgNCz.mjs → MazSpinner-C6h_11fE.mjs} +1 -1
- package/components/chunks/MazSpinner-CQbd8Ovn.mjs +37 -0
- package/components/chunks/{MazSpinner-SlwNtf5M.mjs → MazSpinner-CeYCrySe.mjs} +1 -1
- package/components/chunks/{MazSpinner-D0Z_mIJF.mjs → MazSpinner-DCpFSO05.mjs} +1 -1
- package/components/chunks/{MazSpinner-C5wp4j5g.mjs → MazSpinner-Dr_lfVQQ.mjs} +1 -1
- package/components/chunks/{MazSpinner-DAAoiGES.mjs → MazSpinner-XWBim6LV.mjs} +1 -1
- package/components/chunks/MazSpinner-dU5ZzoYV.mjs +37 -0
- package/components/chunks/{MazSpinner-DfHwN_9D.mjs → MazSpinner-gYRmfrSM.mjs} +1 -1
- package/components/chunks/{MazTable-DjAvTaKP.mjs → MazTable-CverwWXf.mjs} +39 -37
- package/components/chunks/{MazTabsBar-BzmfPGf0.mjs → MazTabsBar-MZYefBb8.mjs} +73 -59
- package/components/chunks/{MazTransitionExpand-pD1Oj5jl.mjs → MazTransitionExpand-C1PC0VLx.mjs} +1 -1
- package/modules/assets/index.css +1 -1
- package/modules/chunks/{MazBtn-DBCfLTEq.cjs → MazBtn-O5zWLH6k.cjs} +1 -1
- package/modules/chunks/{MazBtn-ZodGJGYi.mjs → MazBtn-VbPzVjkw.mjs} +2 -2
- package/modules/chunks/{MazIcon-BmzyL3xC.cjs → MazIcon-5tUs5Esl.cjs} +1 -1
- package/modules/chunks/{MazIcon-Cc_Rfdkr.mjs → MazIcon-B-f-2ZQG.mjs} +1 -1
- package/modules/chunks/{MazSpinner-CqfQGJXH.cjs → MazSpinner-BUSCYYJR.cjs} +1 -1
- package/modules/chunks/{MazSpinner-1HepG9lI.mjs → MazSpinner-fEByRc1j.mjs} +1 -1
- package/modules/chunks/index-B26Eo5t8.mjs +3316 -0
- package/modules/chunks/index-Bos4zUyQ.cjs +149 -0
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +55 -52
- package/nuxt/index.d.mts +6 -1
- package/nuxt/index.d.ts +6 -1
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +8 -0
- package/nuxt/runtime/composables/useDialog.d.ts +2 -0
- package/nuxt/runtime/composables/useDialog.js +5 -0
- package/nuxt/runtime/plugins/dialog.d.ts +8 -0
- package/nuxt/runtime/plugins/dialog.js +23 -0
- package/package.json +10 -10
- package/types/components/MazAvatar.vue.d.ts +12 -0
- package/types/components/MazBackdrop.vue.d.ts +4 -4
- package/types/components/MazBtn.vue.d.ts +2 -2
- package/types/components/MazChart.vue.d.ts +1 -1
- package/types/components/MazDialog.vue.d.ts +121 -4
- package/types/components/MazDialogPromise/useMazDialogPromise.d.ts +80 -0
- package/types/components/MazDialogPromise.vue.d.ts +20 -10
- package/types/components/MazDrawer.vue.d.ts +2 -2
- package/types/components/MazDropdown.vue.d.ts +11 -7
- package/types/components/MazGallery.vue.d.ts +1 -1
- package/types/components/MazIcon.vue.d.ts +1 -1
- package/types/components/MazInputNumber.vue.d.ts +1 -1
- package/types/components/MazInputPrice.vue.d.ts +1 -1
- package/types/components/MazInputTags.vue.d.ts +1 -1
- package/types/components/MazLink.vue.d.ts +6 -2
- package/types/components/MazPhoneNumberInput/PhoneInput.vue.d.ts +2 -2
- package/types/components/MazPhoneNumberInput.vue.d.ts +18 -6
- package/types/components/MazPicker.vue.d.ts +3 -3
- package/types/components/MazPullToRefresh.vue.d.ts +2 -2
- package/types/components/MazSelect.vue.d.ts +5 -0
- package/types/components/MazSwitch.vue.d.ts +1 -1
- package/types/components/MazTable.vue.d.ts +1 -1
- package/types/components/MazTextarea.vue.d.ts +3 -3
- package/types/modules/composables/index.d.ts +1 -0
- package/types/modules/composables/useDialog.d.ts +2 -0
- package/types/modules/composables/useToast.d.ts +1 -1
- package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +3 -3
- package/types/modules/helpers/mount-component.d.ts +3 -3
- package/types/modules/plugins/dialog/DialogHandler.d.ts +15 -0
- package/types/modules/plugins/dialog/index.d.ts +6 -0
- package/types/modules/plugins/index.d.ts +1 -0
- package/types/modules/plugins/toaster/MazToast.vue.d.ts +2 -2
- package/types/modules/plugins/toaster/index.d.ts +2 -2
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +0 -201
- package/components/chunks/MazAvatar-DVjTbmNj.mjs +0 -127
- package/components/chunks/MazBtn-hPyCTfnD.mjs +0 -150
- package/components/chunks/MazDialogPromise-B5xH3Ew4.mjs +0 -478
- package/components/chunks/MazSpinner-DhtejNvD.mjs +0 -37
- package/components/chunks/MazSpinner-DyOBVD2n.mjs +0 -37
- package/modules/chunks/index-BbpA7Mc4.cjs +0 -124
- package/modules/chunks/index-CR18QNVD.mjs +0 -2768
- package/types/components/MazDialogPromise/use-maz-dialog-promise.d.ts +0 -201
- /package/types/modules/plugins/toaster/{toaster-handler.d.ts → ToasterHandler.d.ts} +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
1
2
|
import type { Color } from './types';
|
|
2
3
|
export type { Color };
|
|
3
4
|
export interface Props {
|
|
5
|
+
/** The style of the component */
|
|
6
|
+
style?: HTMLAttributes['style'];
|
|
7
|
+
/** The class of the component */
|
|
8
|
+
class?: HTMLAttributes['class'];
|
|
4
9
|
/** The source of the image */
|
|
5
10
|
src?: string | null;
|
|
6
11
|
/** The caption of the avatar */
|
|
@@ -44,6 +49,12 @@ export interface Props {
|
|
|
44
49
|
fallbackSrc?: string;
|
|
45
50
|
/** Load the fallback image by default */
|
|
46
51
|
noPhoto?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The loading strategy of the image - lazy, eager or intersecting
|
|
54
|
+
* @default 'intersecting'
|
|
55
|
+
* @values `'lazy' | 'eager' | 'intersecting'`
|
|
56
|
+
*/
|
|
57
|
+
loading?: 'lazy' | 'eager' | 'intersecting';
|
|
47
58
|
}
|
|
48
59
|
declare function __VLS_template(): {
|
|
49
60
|
slots: {
|
|
@@ -72,6 +83,7 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
|
|
|
72
83
|
size: string;
|
|
73
84
|
src: string | null;
|
|
74
85
|
roundedSize: "none" | "sm" | "md" | "lg" | "xl" | "full";
|
|
86
|
+
loading: "lazy" | "eager" | "intersecting";
|
|
75
87
|
href: string;
|
|
76
88
|
to: string | Record<string, unknown>;
|
|
77
89
|
target: string;
|
package/components/MazAvatar.mjs
CHANGED
|
@@ -36,20 +36,20 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
|
36
36
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
37
|
close: (value: void) => any;
|
|
38
38
|
open: (value: void) => any;
|
|
39
|
-
"before-close": (value: void) => any;
|
|
40
39
|
"update:model-value": (value: boolean) => any;
|
|
40
|
+
"before-close": (value: void) => any;
|
|
41
41
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
42
42
|
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
43
43
|
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
44
|
-
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
45
44
|
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
45
|
+
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
46
46
|
}>, {
|
|
47
|
-
persistent: boolean;
|
|
48
|
-
transitionName: string;
|
|
49
47
|
modelValue: boolean;
|
|
50
48
|
teleportSelector: string;
|
|
51
49
|
beforeClose: () => Promise<void> | void;
|
|
50
|
+
persistent: boolean;
|
|
52
51
|
noCloseOnEscKey: boolean;
|
|
52
|
+
transitionName: string;
|
|
53
53
|
backdropClass: HTMLAttributes["class"];
|
|
54
54
|
backdropContentClass: HTMLAttributes["class"];
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/components/MazBtn.d.ts
CHANGED
|
@@ -115,10 +115,10 @@ declare function __VLS_template(): {
|
|
|
115
115
|
};
|
|
116
116
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
117
117
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
118
|
-
type: "submit" | "reset" | "button";
|
|
119
118
|
size: Size;
|
|
120
|
-
variant: "button" | "link";
|
|
121
119
|
color: Color;
|
|
120
|
+
type: "submit" | "reset" | "button";
|
|
121
|
+
variant: "button" | "link";
|
|
122
122
|
roundedSize: "none" | "sm" | "md" | "lg" | "xl" | "full";
|
|
123
123
|
icon: string | Icon;
|
|
124
124
|
leftIcon: string | Icon;
|
package/components/MazCard.mjs
CHANGED
package/components/MazChart.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
97
97
|
};
|
|
98
98
|
}>> & Readonly<{}>, {
|
|
99
99
|
options: Record<string, any>;
|
|
100
|
-
updateMode: "reset" | "resize" | "
|
|
100
|
+
updateMode: "reset" | "resize" | "default" | "none" | "hide" | "show" | "active";
|
|
101
101
|
plugins: unknown[];
|
|
102
102
|
datasetIdKey: string;
|
|
103
103
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, HTMLAttributes } from 'vue';
|
|
1
2
|
import { type Props as MazBackdropProps } from './MazBackdrop.vue';
|
|
2
|
-
export interface
|
|
3
|
+
export interface InternalProps {
|
|
3
4
|
/** @model Modal's model value */
|
|
4
5
|
modelValue?: boolean;
|
|
5
6
|
/** Title of the modal in header */
|
|
@@ -17,6 +18,7 @@ export interface Props {
|
|
|
17
18
|
/** Persistent dialog (not closable by clicking outside and remove close button) */
|
|
18
19
|
persistent?: boolean;
|
|
19
20
|
}
|
|
21
|
+
export type Props = InternalProps & MazBackdropProps;
|
|
20
22
|
declare function __VLS_template(): {
|
|
21
23
|
slots: {
|
|
22
24
|
header?(_: {
|
|
@@ -30,15 +32,130 @@ declare function __VLS_template(): {
|
|
|
30
32
|
close: () => void;
|
|
31
33
|
}): any;
|
|
32
34
|
};
|
|
33
|
-
refs: {
|
|
35
|
+
refs: {
|
|
36
|
+
backdrop: ({
|
|
37
|
+
$: import("vue").ComponentInternalInstance;
|
|
38
|
+
$data: {};
|
|
39
|
+
$props: {
|
|
40
|
+
readonly modelValue?: boolean | undefined;
|
|
41
|
+
readonly teleportSelector?: string | undefined;
|
|
42
|
+
readonly beforeClose?: (() => Promise<void> | void) | undefined;
|
|
43
|
+
readonly persistent?: boolean | undefined;
|
|
44
|
+
readonly noCloseOnEscKey?: boolean | undefined;
|
|
45
|
+
readonly transitionName?: string | undefined;
|
|
46
|
+
readonly backdropClass?: HTMLAttributes["class"];
|
|
47
|
+
readonly backdropContentClass?: HTMLAttributes["class"];
|
|
48
|
+
readonly onClose?: ((value?: void | undefined) => any) | undefined;
|
|
49
|
+
readonly onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
50
|
+
readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
51
|
+
readonly "onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
52
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<MazBackdropProps> & Readonly<{
|
|
53
|
+
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
54
|
+
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
55
|
+
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
56
|
+
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
$attrs: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
$refs: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
$slots: Readonly<{
|
|
65
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
$root: ComponentPublicInstance | null;
|
|
68
|
+
$parent: ComponentPublicInstance | null;
|
|
69
|
+
$host: Element | null;
|
|
70
|
+
$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);
|
|
71
|
+
$el: any;
|
|
72
|
+
$options: import("vue").ComponentOptionsBase<Readonly<MazBackdropProps> & Readonly<{
|
|
73
|
+
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
74
|
+
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
75
|
+
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
76
|
+
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
onBackdropAnimationEnter: () => void;
|
|
79
|
+
onBackdropAnimationLeave: () => void;
|
|
80
|
+
onBackdropClicked: () => void;
|
|
81
|
+
close: () => void;
|
|
82
|
+
present: import("vue").Ref<boolean, boolean>;
|
|
83
|
+
toggleModal: (value: any) => Promise<void>;
|
|
84
|
+
onKeyPress: (event: KeyboardEvent) => void;
|
|
85
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
86
|
+
close: (value: void) => any;
|
|
87
|
+
open: (value: void) => any;
|
|
88
|
+
"update:model-value": (value: boolean) => any;
|
|
89
|
+
"before-close": (value: void) => any;
|
|
90
|
+
}, string, {
|
|
91
|
+
modelValue: boolean;
|
|
92
|
+
teleportSelector: string;
|
|
93
|
+
beforeClose: () => Promise<void> | void;
|
|
94
|
+
persistent: boolean;
|
|
95
|
+
noCloseOnEscKey: boolean;
|
|
96
|
+
transitionName: string;
|
|
97
|
+
backdropClass: HTMLAttributes["class"];
|
|
98
|
+
backdropContentClass: HTMLAttributes["class"];
|
|
99
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
100
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
101
|
+
created?: (() => void) | (() => void)[];
|
|
102
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
103
|
+
mounted?: (() => void) | (() => void)[];
|
|
104
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
105
|
+
updated?: (() => void) | (() => void)[];
|
|
106
|
+
activated?: (() => void) | (() => void)[];
|
|
107
|
+
deactivated?: (() => void) | (() => void)[];
|
|
108
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
109
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
110
|
+
destroyed?: (() => void) | (() => void)[];
|
|
111
|
+
unmounted?: (() => void) | (() => void)[];
|
|
112
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
113
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
114
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
115
|
+
};
|
|
116
|
+
$forceUpdate: () => void;
|
|
117
|
+
$nextTick: typeof import("vue").nextTick;
|
|
118
|
+
$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;
|
|
119
|
+
} & Readonly<{
|
|
120
|
+
modelValue: boolean;
|
|
121
|
+
teleportSelector: string;
|
|
122
|
+
beforeClose: () => Promise<void> | void;
|
|
123
|
+
persistent: boolean;
|
|
124
|
+
noCloseOnEscKey: boolean;
|
|
125
|
+
transitionName: string;
|
|
126
|
+
backdropClass: HTMLAttributes["class"];
|
|
127
|
+
backdropContentClass: HTMLAttributes["class"];
|
|
128
|
+
}> & Omit<Readonly<MazBackdropProps> & Readonly<{
|
|
129
|
+
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
130
|
+
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
131
|
+
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
132
|
+
"onBefore-close"?: ((value?: void | undefined) => any) | undefined;
|
|
133
|
+
}>, "close" | "onBackdropAnimationEnter" | "onBackdropAnimationLeave" | "onBackdropClicked" | "present" | "toggleModal" | "onKeyPress" | ("modelValue" | "teleportSelector" | "beforeClose" | "persistent" | "noCloseOnEscKey" | "transitionName" | "backdropClass" | "backdropContentClass")> & import("vue").ShallowUnwrapRef<{
|
|
134
|
+
onBackdropAnimationEnter: () => void;
|
|
135
|
+
onBackdropAnimationLeave: () => void;
|
|
136
|
+
onBackdropClicked: () => void;
|
|
137
|
+
close: () => void;
|
|
138
|
+
present: import("vue").Ref<boolean, boolean>;
|
|
139
|
+
toggleModal: (value: any) => Promise<void>;
|
|
140
|
+
onKeyPress: (event: KeyboardEvent) => void;
|
|
141
|
+
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
142
|
+
$slots: {
|
|
143
|
+
default?(_: {
|
|
144
|
+
close: () => void;
|
|
145
|
+
}): any;
|
|
146
|
+
};
|
|
147
|
+
}) | null;
|
|
148
|
+
};
|
|
34
149
|
attrs: Partial<{}>;
|
|
35
150
|
};
|
|
36
151
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
37
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
152
|
+
declare const __VLS_component: import("vue").DefineComponent<InternalProps & MazBackdropProps, {
|
|
153
|
+
close: () => any;
|
|
154
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
155
|
close: (value: void) => any;
|
|
39
156
|
open: (value: void) => any;
|
|
40
157
|
"update:model-value": (value: boolean) => any;
|
|
41
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
158
|
+
}, string, import("vue").PublicProps, Readonly<InternalProps & MazBackdropProps> & Readonly<{
|
|
42
159
|
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
43
160
|
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
44
161
|
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
package/components/MazDialog.mjs
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { Props } from '../MazBtn.vue';
|
|
3
|
+
import type { Size } from './../types';
|
|
4
|
+
export interface DialogState {
|
|
5
|
+
id: string;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
resolve: (value: unknown) => void;
|
|
8
|
+
reject?: (reason?: unknown) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface DialogButton extends Props {
|
|
11
|
+
text?: string;
|
|
12
|
+
size?: Size;
|
|
13
|
+
}
|
|
14
|
+
export interface ActionButton {
|
|
15
|
+
text: string;
|
|
16
|
+
action: () => unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface PromiseButton {
|
|
19
|
+
text: string;
|
|
20
|
+
type: 'resolve' | 'reject';
|
|
21
|
+
response?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export type DialogCustomButton = Omit<DialogButton, 'type'> & (PromiseButton | ActionButton);
|
|
24
|
+
export interface DialogData {
|
|
25
|
+
/**
|
|
26
|
+
* Dialog title
|
|
27
|
+
*/
|
|
28
|
+
title?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Dialog message
|
|
31
|
+
*/
|
|
32
|
+
message?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Dialog cancel text
|
|
35
|
+
* @default 'Cancel'
|
|
36
|
+
*/
|
|
37
|
+
cancelText?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Dialog cancel button
|
|
40
|
+
* @default { text: 'Cancel', color: 'danger', outline: true }`
|
|
41
|
+
*/
|
|
42
|
+
cancelButton?: false | DialogButton;
|
|
43
|
+
/**
|
|
44
|
+
* Dialog confirm text
|
|
45
|
+
* @default 'Confirm'
|
|
46
|
+
*/
|
|
47
|
+
confirmText?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Dialog confirm button
|
|
50
|
+
* @default { text: 'Confirm', color: 'success' }
|
|
51
|
+
*/
|
|
52
|
+
confirmButton?: false | DialogButton;
|
|
53
|
+
/**
|
|
54
|
+
* This is a list of custom buttons that will replace the default confirm and cancel buttons
|
|
55
|
+
*/
|
|
56
|
+
buttons?: DialogCustomButton[];
|
|
57
|
+
}
|
|
58
|
+
export declare const defaultData: {
|
|
59
|
+
cancelText: string;
|
|
60
|
+
confirmText: string;
|
|
61
|
+
cancelButton: {
|
|
62
|
+
text: string;
|
|
63
|
+
color: "danger";
|
|
64
|
+
};
|
|
65
|
+
confirmButton: {
|
|
66
|
+
text: string;
|
|
67
|
+
color: "success";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
declare function showDialogAndWaitChoice(identifier: string, callback?: () => unknown): Promise<unknown>;
|
|
71
|
+
declare function removeDialogFromState(identifier: string): DialogState[];
|
|
72
|
+
export declare function useMazDialogPromise(): {
|
|
73
|
+
data: Ref<DialogData, DialogData>;
|
|
74
|
+
dialogState: Ref<DialogState[], DialogState[]>;
|
|
75
|
+
showDialogAndWaitChoice: typeof showDialogAndWaitChoice;
|
|
76
|
+
removeDialogFromState: typeof removeDialogFromState;
|
|
77
|
+
rejectDialog: (currentDialog: DialogState, response?: unknown, action?: () => unknown) => Promise<void>;
|
|
78
|
+
resolveDialog: (currentDialog: DialogState, response?: unknown, action?: () => unknown) => Promise<void>;
|
|
79
|
+
};
|
|
80
|
+
export {};
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
+
import type { DialogCustomButton, DialogData } from './MazDialogPromise/useMazDialogPromise';
|
|
1
2
|
import { type Props as MazDialogProps } from './MazDialog.vue';
|
|
2
|
-
|
|
3
|
-
export interface InternalProps extends MazDialogProps {
|
|
3
|
+
export interface MazDialogPromiseProps {
|
|
4
4
|
/** Dialog Data - @type DialogData */
|
|
5
5
|
data?: DialogData;
|
|
6
|
+
/** Message to display */
|
|
7
|
+
message?: string;
|
|
6
8
|
/** Uniq identifier */
|
|
7
9
|
identifier: string;
|
|
8
10
|
/** Custom buttons - @type DialogCustomButton[] */
|
|
9
11
|
buttons?: DialogCustomButton[];
|
|
10
12
|
}
|
|
11
|
-
export type Props =
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
14
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
13
|
+
export type Props = MazDialogPromiseProps & MazDialogProps & DialogData;
|
|
14
|
+
export { useMazDialogPromise } from './MazDialogPromise/useMazDialogPromise';
|
|
15
|
+
export type { ActionButton, DialogButton, DialogCustomButton, DialogData, DialogState, PromiseButton } from './MazDialogPromise/useMazDialogPromise';
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<MazDialogPromiseProps & import("./MazDialog.vue").InternalProps & import("./MazBackdrop.vue").Props & DialogData, {
|
|
17
|
+
close: () => any;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
close: (value: void) => any;
|
|
20
|
+
open: (value: void) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<MazDialogPromiseProps & import("./MazDialog.vue").InternalProps & import("./MazBackdrop.vue").Props & DialogData> & Readonly<{
|
|
22
|
+
onClose?: ((value?: void | undefined) => any) | undefined;
|
|
23
|
+
onOpen?: ((value?: void | undefined) => any) | undefined;
|
|
24
|
+
}>, {
|
|
15
25
|
data: DialogData;
|
|
16
26
|
buttons: DialogCustomButton[];
|
|
17
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
18
28
|
title?(_: {}): any;
|
|
19
29
|
default?(_: {
|
|
20
|
-
resolve: (reason?:
|
|
21
|
-
reject: (reason?:
|
|
30
|
+
resolve: (reason?: unknown) => Promise<void>;
|
|
31
|
+
reject: (reason?: unknown) => Promise<void>;
|
|
22
32
|
}): any;
|
|
23
33
|
"footer-button"?(_: {
|
|
24
|
-
resolve: (reason?:
|
|
25
|
-
reject: (reason?:
|
|
34
|
+
resolve: (reason?: unknown) => Promise<void>;
|
|
35
|
+
reject: (reason?: unknown) => Promise<void>;
|
|
26
36
|
}): any;
|
|
27
37
|
"cancel-text"?(_: {}): any;
|
|
28
38
|
"confirm-text"?(_: {}): any;
|
|
@@ -26,13 +26,13 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
26
26
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
27
|
close: () => any;
|
|
28
28
|
open: () => any;
|
|
29
|
-
"before-close": () => any;
|
|
30
29
|
"update:model-value": (value: boolean) => any;
|
|
30
|
+
"before-close": () => any;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
32
32
|
onClose?: (() => any) | undefined;
|
|
33
33
|
onOpen?: (() => any) | undefined;
|
|
34
|
-
"onBefore-close"?: (() => any) | undefined;
|
|
35
34
|
"onUpdate:model-value"?: ((value: boolean) => any) | undefined;
|
|
35
|
+
"onBefore-close"?: (() => any) | undefined;
|
|
36
36
|
}>, {
|
|
37
37
|
title: string;
|
|
38
38
|
size: string;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
2
|
import type { Color } from './MazBtn.vue';
|
|
3
|
+
import type { Props as MazLinkProps } from './MazLink.vue';
|
|
3
4
|
import type { Position } from './types';
|
|
4
5
|
import { type HTMLAttributes } from 'vue';
|
|
5
6
|
export type { Color, Position };
|
|
6
|
-
|
|
7
|
+
type ItemBase = Record<string, unknown> & {
|
|
7
8
|
label: string;
|
|
8
|
-
|
|
9
|
+
class?: unknown;
|
|
10
|
+
color?: Color;
|
|
11
|
+
};
|
|
12
|
+
type LinkItem = ItemBase & MazLinkProps & {
|
|
9
13
|
target?: string;
|
|
10
14
|
href?: string;
|
|
11
15
|
to?: RouteLocationRaw;
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
};
|
|
17
|
+
type ActionItem = ItemBase & {
|
|
18
|
+
action?: () => unknown;
|
|
19
|
+
};
|
|
20
|
+
export type MenuItem = (LinkItem | ActionItem);
|
|
14
21
|
export interface Props {
|
|
15
22
|
style?: HTMLAttributes['style'];
|
|
16
23
|
class?: HTMLAttributes['class'];
|
|
@@ -66,9 +73,6 @@ declare function __VLS_template(): {
|
|
|
66
73
|
"menuitem-label"?(_: {
|
|
67
74
|
item: MenuItem;
|
|
68
75
|
}): any;
|
|
69
|
-
"menuitem-label"?(_: {
|
|
70
|
-
item: MenuItem;
|
|
71
|
-
}): any;
|
|
72
76
|
};
|
|
73
77
|
refs: {};
|
|
74
78
|
attrs: Partial<{}>;
|