maz-ui 3.42.1 → 3.42.2
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/MazDialogPromise/use-maz-dialog-promise.d.ts +1 -1
- package/components/MazDialogPromise.d.ts +32 -28
- package/components/MazDialogPromise.mjs +1 -1
- package/components/chunks/{MazBtn-CauvhLv6.mjs → MazBtn-Bnvl3FXX.mjs} +2 -2
- package/components/chunks/MazDialogPromise-CS8SGV4-.mjs +410 -0
- package/components/chunks/{MazSpinner-DWts_Ogu.mjs → MazSpinner-CkOtx69J.mjs} +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazDialogPromise/use-maz-dialog-promise.d.ts +1 -1
- package/types/components/MazDialogPromise.vue.d.ts +32 -28
- package/components/chunks/MazDialogPromise-C4xTbUi9.mjs +0 -413
|
@@ -11,7 +11,7 @@ export interface DialogData {
|
|
|
11
11
|
confirmText?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const useMazDialogPromise: () => {
|
|
14
|
-
|
|
14
|
+
data: import("vue").Ref<DialogData | undefined>;
|
|
15
15
|
dialogState: import("vue").Ref<{
|
|
16
16
|
id: string;
|
|
17
17
|
isActive: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type PropType } from 'vue';
|
|
2
1
|
import { type Color, type Size } from './types';
|
|
3
2
|
import { type DialogData } from './MazDialogPromise/use-maz-dialog-promise';
|
|
4
3
|
export type DialogButton = {
|
|
@@ -15,39 +14,27 @@ export type DialogButton = {
|
|
|
15
14
|
};
|
|
16
15
|
export { useMazDialogPromise, type DialogState, type DialogData, } from './MazDialogPromise/use-maz-dialog-promise';
|
|
17
16
|
export type { Color, Size } from './types';
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
19
18
|
/** Dialog Data - type DialogData */
|
|
20
|
-
data:
|
|
21
|
-
type: PropType<DialogData>;
|
|
22
|
-
default: undefined;
|
|
23
|
-
};
|
|
19
|
+
data: DialogData;
|
|
24
20
|
/** Uniq identifier */
|
|
25
|
-
identifier:
|
|
26
|
-
type: StringConstructor;
|
|
27
|
-
required: true;
|
|
28
|
-
};
|
|
21
|
+
identifier: string;
|
|
29
22
|
/** Custom buttons - type DialogButton[] */
|
|
30
|
-
buttons:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
23
|
+
buttons: DialogButton[];
|
|
24
|
+
}>, {
|
|
25
|
+
data: undefined;
|
|
26
|
+
buttons: () => never[];
|
|
27
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
35
28
|
/** Dialog Data - type DialogData */
|
|
36
|
-
data:
|
|
37
|
-
type: PropType<DialogData>;
|
|
38
|
-
default: undefined;
|
|
39
|
-
};
|
|
29
|
+
data: DialogData;
|
|
40
30
|
/** Uniq identifier */
|
|
41
|
-
identifier:
|
|
42
|
-
type: StringConstructor;
|
|
43
|
-
required: true;
|
|
44
|
-
};
|
|
31
|
+
identifier: string;
|
|
45
32
|
/** Custom buttons - type DialogButton[] */
|
|
46
|
-
buttons:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
33
|
+
buttons: DialogButton[];
|
|
34
|
+
}>, {
|
|
35
|
+
data: undefined;
|
|
36
|
+
buttons: () => never[];
|
|
37
|
+
}>>>, {
|
|
51
38
|
data: DialogData;
|
|
52
39
|
buttons: DialogButton[];
|
|
53
40
|
}, {}>, {
|
|
@@ -64,8 +51,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
64
51
|
"confirm-text"?(_: {}): any;
|
|
65
52
|
}>;
|
|
66
53
|
export default _default;
|
|
54
|
+
type __VLS_WithDefaults<P, D> = {
|
|
55
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
56
|
+
default: D[K];
|
|
57
|
+
}> : P[K];
|
|
58
|
+
};
|
|
59
|
+
type __VLS_Prettify<T> = {
|
|
60
|
+
[K in keyof T]: T[K];
|
|
61
|
+
} & {};
|
|
67
62
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
68
63
|
new (): {
|
|
69
64
|
$slots: S;
|
|
70
65
|
};
|
|
71
66
|
};
|
|
67
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
68
|
+
type __VLS_TypePropsToOption<T> = {
|
|
69
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
70
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
71
|
+
} : {
|
|
72
|
+
type: import('vue').PropType<T[K]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../assets/MazBtn.css';
|
|
2
2
|
import { defineComponent as E, defineAsyncComponent as h, useAttrs as R, useSlots as w, onBeforeMount as A, computed as l, openBlock as n, createBlock as a, resolveDynamicComponent as r, normalizeClass as s, withCtx as D, createElementBlock as u, createCommentVNode as t, renderSlot as d, unref as c } from "vue";
|
|
3
|
-
import { _ as L } from "./MazDialogPromise-
|
|
3
|
+
import { _ as L } from "./MazDialogPromise-CS8SGV4-.mjs";
|
|
4
4
|
const P = /* @__PURE__ */ E({
|
|
5
5
|
__name: "MazBtn",
|
|
6
6
|
props: {
|
|
@@ -26,7 +26,7 @@ const P = /* @__PURE__ */ E({
|
|
|
26
26
|
contentClass: { default: void 0 }
|
|
27
27
|
},
|
|
28
28
|
setup(g) {
|
|
29
|
-
const z = h(() => import("./MazSpinner-
|
|
29
|
+
const z = h(() => import("./MazSpinner-CkOtx69J.mjs")), f = h(() => import("./MazIcon-Cxrv3_OK.mjs")), { href: k, to: B } = R(), p = w(), o = g;
|
|
30
30
|
A(() => {
|
|
31
31
|
o.icon && !o.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
|
|
32
32
|
});
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import '../assets/MazDialogPromise.css';
|
|
2
|
+
import { ref as j, defineComponent as L, onMounted as W, watch as K, openBlock as v, createBlock as D, Teleport as I, createVNode as B, Transition as U, withCtx as k, createElementBlock as z, normalizeClass as T, createElementVNode as C, withModifiers as q, mergeProps as S, renderSlot as p, createCommentVNode as f, defineAsyncComponent as V, useAttrs as X, computed as E, createTextVNode as y, toDisplayString as b, unref as r, Fragment as P, renderList as G } from "vue";
|
|
3
|
+
const J = j(), $ = j([]), Q = (n, t) => new Promise((d, i) => {
|
|
4
|
+
$.value = [
|
|
5
|
+
...$.value,
|
|
6
|
+
{
|
|
7
|
+
id: n,
|
|
8
|
+
isActive: !0,
|
|
9
|
+
resolve: async () => {
|
|
10
|
+
await (t == null ? void 0 : t()), d(!0);
|
|
11
|
+
},
|
|
12
|
+
reject: i
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
}), H = (n) => ($.value = $.value.filter(({ id: t }) => t !== n), $.value), N = (n, t, d = !1) => {
|
|
16
|
+
var i;
|
|
17
|
+
t && ((i = t[n]) == null || i.call(t, d), t.isActive = !1, setTimeout(() => {
|
|
18
|
+
H(t.id);
|
|
19
|
+
}, 500));
|
|
20
|
+
}, R = () => ({
|
|
21
|
+
data: J,
|
|
22
|
+
dialogState: $,
|
|
23
|
+
showDialogAndWaitChoice: Q,
|
|
24
|
+
removeDialogFromState: H,
|
|
25
|
+
rejectDialog: (n, t = "cancel") => N("reject", n, t),
|
|
26
|
+
resolveDialog: (n, t = "accept") => N("resolve", n, t)
|
|
27
|
+
}), O = "--backdrop-present", Y = /* @__PURE__ */ L({
|
|
28
|
+
inheritAttrs: !1,
|
|
29
|
+
__name: "MazBackdrop",
|
|
30
|
+
props: {
|
|
31
|
+
modelValue: { type: Boolean, default: !1 },
|
|
32
|
+
teleportSelector: { default: "body" },
|
|
33
|
+
beforeClose: { type: Function, default: void 0 },
|
|
34
|
+
persistent: { type: Boolean, default: !1 },
|
|
35
|
+
noCloseOnEscKey: { type: Boolean, default: !1 },
|
|
36
|
+
transitionName: { default: "backdrop-anim" },
|
|
37
|
+
backdropClass: { default: void 0 },
|
|
38
|
+
backdropContentClass: { default: void 0 }
|
|
39
|
+
},
|
|
40
|
+
emits: ["open", "close", "update:model-value", "before-close"],
|
|
41
|
+
setup(n, { expose: t, emit: d }) {
|
|
42
|
+
const i = () => {
|
|
43
|
+
document.documentElement.classList.add(O);
|
|
44
|
+
}, c = async () => {
|
|
45
|
+
document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(O);
|
|
46
|
+
}, m = d, o = n, l = j(o.modelValue);
|
|
47
|
+
function s() {
|
|
48
|
+
u(!1);
|
|
49
|
+
}
|
|
50
|
+
async function u(a) {
|
|
51
|
+
var M;
|
|
52
|
+
a || (m("before-close"), await ((M = o.beforeClose) == null ? void 0 : M.call(o))), l.value = a;
|
|
53
|
+
}
|
|
54
|
+
function g() {
|
|
55
|
+
m("open");
|
|
56
|
+
}
|
|
57
|
+
function h() {
|
|
58
|
+
m("update:model-value", !1), m("close"), w();
|
|
59
|
+
}
|
|
60
|
+
function e() {
|
|
61
|
+
o.persistent || s();
|
|
62
|
+
}
|
|
63
|
+
function A(a) {
|
|
64
|
+
!o.noCloseOnEscKey && a.key === "Escape" && !o.persistent && s();
|
|
65
|
+
}
|
|
66
|
+
function F() {
|
|
67
|
+
i(), document.addEventListener("keyup", A, !1);
|
|
68
|
+
}
|
|
69
|
+
function w() {
|
|
70
|
+
document.removeEventListener("keyup", A), c();
|
|
71
|
+
}
|
|
72
|
+
return W(() => {
|
|
73
|
+
o.modelValue ? F() : w();
|
|
74
|
+
}), K(
|
|
75
|
+
() => o.modelValue,
|
|
76
|
+
(a) => {
|
|
77
|
+
l.value = a, a ? F() : w();
|
|
78
|
+
}
|
|
79
|
+
), t({
|
|
80
|
+
onBackdropAnimationEnter: g,
|
|
81
|
+
onBackdropAnimationLeave: h,
|
|
82
|
+
onBackdropClicked: e,
|
|
83
|
+
close: s,
|
|
84
|
+
present: l,
|
|
85
|
+
toggleModal: u,
|
|
86
|
+
onKeyPress: A
|
|
87
|
+
}), (a, M) => (v(), D(I, { to: a.teleportSelector }, [
|
|
88
|
+
B(U, {
|
|
89
|
+
appear: "",
|
|
90
|
+
name: a.transitionName,
|
|
91
|
+
onAfterEnter: g,
|
|
92
|
+
onAfterLeave: h
|
|
93
|
+
}, {
|
|
94
|
+
default: k(() => [
|
|
95
|
+
l.value ? (v(), z(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
key: 0,
|
|
99
|
+
class: T(["m-backdrop --present", [a.backdropClass]]),
|
|
100
|
+
tabindex: "-1",
|
|
101
|
+
role: "dialog"
|
|
102
|
+
},
|
|
103
|
+
[
|
|
104
|
+
C(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
class: T(["m-backdrop-overlay", { "--disabled": a.persistent }]),
|
|
108
|
+
tabindex: "-1",
|
|
109
|
+
onClick: q(e, ["self"])
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
2
|
|
113
|
+
/* CLASS */
|
|
114
|
+
),
|
|
115
|
+
C(
|
|
116
|
+
"div",
|
|
117
|
+
S({
|
|
118
|
+
class: ["m-backdrop-content", a.backdropContentClass]
|
|
119
|
+
}, a.$attrs, {
|
|
120
|
+
role: "document",
|
|
121
|
+
tabindex: "0"
|
|
122
|
+
}),
|
|
123
|
+
[
|
|
124
|
+
p(a.$slots, "default", { close: s })
|
|
125
|
+
],
|
|
126
|
+
16
|
|
127
|
+
/* FULL_PROPS */
|
|
128
|
+
)
|
|
129
|
+
],
|
|
130
|
+
2
|
|
131
|
+
/* CLASS */
|
|
132
|
+
)) : f("v-if", !0)
|
|
133
|
+
]),
|
|
134
|
+
_: 3
|
|
135
|
+
/* FORWARDED */
|
|
136
|
+
}, 8, ["name"])
|
|
137
|
+
], 8, ["to"]));
|
|
138
|
+
}
|
|
139
|
+
}), Z = {
|
|
140
|
+
key: 0,
|
|
141
|
+
id: "dialogTitle",
|
|
142
|
+
class: "maz-my-0 maz-text-xl maz-font-semibold"
|
|
143
|
+
}, _ = {
|
|
144
|
+
id: "dialogDesc",
|
|
145
|
+
class: "m-dialog-content"
|
|
146
|
+
}, x = {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "m-dialog-footer"
|
|
149
|
+
}, ee = /* @__PURE__ */ L({
|
|
150
|
+
__name: "MazDialog",
|
|
151
|
+
props: {
|
|
152
|
+
title: { default: void 0 },
|
|
153
|
+
noClose: { type: Boolean, default: !1 },
|
|
154
|
+
width: { default: "500px" },
|
|
155
|
+
maxWidth: { default: "95vw" },
|
|
156
|
+
maxHeight: { default: "95vh" },
|
|
157
|
+
scrollable: { type: Boolean, default: !1 },
|
|
158
|
+
persistent: { type: Boolean, default: !1 }
|
|
159
|
+
},
|
|
160
|
+
emits: [
|
|
161
|
+
/** Model binding */
|
|
162
|
+
"update:model-value",
|
|
163
|
+
/** Emitted when dialog is closed (after animation) */
|
|
164
|
+
"close",
|
|
165
|
+
/** Emitted when dialog is opened (after animation) */
|
|
166
|
+
"open"
|
|
167
|
+
],
|
|
168
|
+
setup(n) {
|
|
169
|
+
const t = V(() => import("./MazBtn-Bnvl3FXX.mjs")), d = V(() => import("./x-mark-BP8zWe_C.mjs")), i = X(), c = E(() => ({
|
|
170
|
+
...i,
|
|
171
|
+
class: void 0,
|
|
172
|
+
style: void 0
|
|
173
|
+
})), m = E(() => ({
|
|
174
|
+
class: i.class,
|
|
175
|
+
style: i.style
|
|
176
|
+
}));
|
|
177
|
+
return (o, l) => (v(), D(Y, S(c.value, {
|
|
178
|
+
persistent: o.persistent,
|
|
179
|
+
"transition-name": "modal-anim",
|
|
180
|
+
"aria-labelledby": "dialogTitle",
|
|
181
|
+
"aria-describedby": "dialogDesc",
|
|
182
|
+
onClose: l[0] || (l[0] = (s) => o.$emit("close", s)),
|
|
183
|
+
onOpen: l[1] || (l[1] = (s) => o.$emit("open", s)),
|
|
184
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => o.$emit("update:model-value", s))
|
|
185
|
+
}), {
|
|
186
|
+
default: k(({ close: s }) => [
|
|
187
|
+
C(
|
|
188
|
+
"div",
|
|
189
|
+
S({
|
|
190
|
+
class: ["m-dialog", { "--scrollable": o.scrollable }],
|
|
191
|
+
role: "dialog",
|
|
192
|
+
"aria-modal": "true",
|
|
193
|
+
style: [{ width: o.width, maxWidth: o.maxWidth, maxHeight: o.maxHeight }]
|
|
194
|
+
}, m.value),
|
|
195
|
+
[
|
|
196
|
+
f(`
|
|
197
|
+
@slot Header slot
|
|
198
|
+
@binding {Function} close close function
|
|
199
|
+
`),
|
|
200
|
+
p(o.$slots, "header", { close: s }, () => [
|
|
201
|
+
C(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
class: T(["m-dialog-header", { "--has-title": o.$slots.title || o.title }])
|
|
205
|
+
},
|
|
206
|
+
[
|
|
207
|
+
o.$slots.title || o.title ? (v(), z("h2", Z, [
|
|
208
|
+
f(`
|
|
209
|
+
@slot Title slot in the header
|
|
210
|
+
`),
|
|
211
|
+
p(o.$slots, "title", {}, () => [
|
|
212
|
+
y(
|
|
213
|
+
b(o.title),
|
|
214
|
+
1
|
|
215
|
+
/* TEXT */
|
|
216
|
+
)
|
|
217
|
+
], !0)
|
|
218
|
+
])) : f("v-if", !0),
|
|
219
|
+
!o.noClose && !o.persistent ? (v(), D(r(t), {
|
|
220
|
+
key: 1,
|
|
221
|
+
class: "m-dialog-closebtn",
|
|
222
|
+
color: "transparent",
|
|
223
|
+
onClick: s
|
|
224
|
+
}, {
|
|
225
|
+
default: k(() => [
|
|
226
|
+
B(r(d), { class: "maz-text-lg" })
|
|
227
|
+
]),
|
|
228
|
+
_: 2
|
|
229
|
+
/* DYNAMIC */
|
|
230
|
+
}, 1032, ["onClick"])) : f("v-if", !0)
|
|
231
|
+
],
|
|
232
|
+
2
|
|
233
|
+
/* CLASS */
|
|
234
|
+
)
|
|
235
|
+
], !0),
|
|
236
|
+
C("div", _, [
|
|
237
|
+
f(`
|
|
238
|
+
@slot Default content
|
|
239
|
+
@binding {Function} close close function
|
|
240
|
+
`),
|
|
241
|
+
p(o.$slots, "default", { close: s }, void 0, !0)
|
|
242
|
+
]),
|
|
243
|
+
o.$slots.footer ? (v(), z("div", x, [
|
|
244
|
+
f(`
|
|
245
|
+
@slot Footer slot
|
|
246
|
+
@binding {Function} close close function
|
|
247
|
+
`),
|
|
248
|
+
p(o.$slots, "footer", { close: s }, void 0, !0)
|
|
249
|
+
])) : f("v-if", !0)
|
|
250
|
+
],
|
|
251
|
+
16
|
|
252
|
+
/* FULL_PROPS */
|
|
253
|
+
)
|
|
254
|
+
]),
|
|
255
|
+
_: 3
|
|
256
|
+
/* FORWARDED */
|
|
257
|
+
}, 16, ["persistent"]));
|
|
258
|
+
}
|
|
259
|
+
}), oe = (n, t) => {
|
|
260
|
+
const d = n.__vccOpts || n;
|
|
261
|
+
for (const [i, c] of t)
|
|
262
|
+
d[i] = c;
|
|
263
|
+
return d;
|
|
264
|
+
}, te = /* @__PURE__ */ oe(ee, [["__scopeId", "data-v-6ded3568"]]), se = { class: "maz-space-x-2" }, le = /* @__PURE__ */ L({
|
|
265
|
+
__name: "MazDialogPromise",
|
|
266
|
+
props: {
|
|
267
|
+
data: { default: void 0 },
|
|
268
|
+
identifier: {},
|
|
269
|
+
buttons: { default: () => [] }
|
|
270
|
+
},
|
|
271
|
+
setup(n) {
|
|
272
|
+
const t = V(() => import("./MazBtn-Bnvl3FXX.mjs")), d = n, { dialogState: i, rejectDialog: c, resolveDialog: m, data: o } = R(), l = E(() => d.data ?? o.value), s = E(
|
|
273
|
+
() => i.value.find(({ id: u }) => u === d.identifier)
|
|
274
|
+
);
|
|
275
|
+
return (u, g) => {
|
|
276
|
+
var h;
|
|
277
|
+
return v(), D(te, {
|
|
278
|
+
"model-value": ((h = s.value) == null ? void 0 : h.isActive) ?? !1,
|
|
279
|
+
"onUpdate:modelValue": g[2] || (g[2] = (e) => r(c)(s.value))
|
|
280
|
+
}, {
|
|
281
|
+
title: k(() => [
|
|
282
|
+
p(u.$slots, "title", {}, () => {
|
|
283
|
+
var e;
|
|
284
|
+
return [
|
|
285
|
+
y(
|
|
286
|
+
b((e = l.value) == null ? void 0 : e.title),
|
|
287
|
+
1
|
|
288
|
+
/* TEXT */
|
|
289
|
+
)
|
|
290
|
+
];
|
|
291
|
+
})
|
|
292
|
+
]),
|
|
293
|
+
default: k(() => [
|
|
294
|
+
f(`
|
|
295
|
+
@slot Default slot - Place your content
|
|
296
|
+
@binding {Function} resolve resolve function
|
|
297
|
+
@binding {Function} reject reject function
|
|
298
|
+
`),
|
|
299
|
+
p(u.$slots, "default", {
|
|
300
|
+
resolve: (e) => r(m)(s.value, e),
|
|
301
|
+
reject: (e) => r(c)(s.value, e)
|
|
302
|
+
}, () => {
|
|
303
|
+
var e;
|
|
304
|
+
return [
|
|
305
|
+
y(
|
|
306
|
+
b((e = l.value) == null ? void 0 : e.message),
|
|
307
|
+
1
|
|
308
|
+
/* TEXT */
|
|
309
|
+
)
|
|
310
|
+
];
|
|
311
|
+
})
|
|
312
|
+
]),
|
|
313
|
+
footer: k(() => [
|
|
314
|
+
f(`
|
|
315
|
+
@slot Footer Buttons slot
|
|
316
|
+
@binding {Function} resolve resolve function
|
|
317
|
+
@binding {Function} reject reject function
|
|
318
|
+
`),
|
|
319
|
+
p(u.$slots, "footer-button", {
|
|
320
|
+
resolve: (e) => r(m)(s.value, e),
|
|
321
|
+
reject: (e) => r(c)(s.value, e)
|
|
322
|
+
}, () => [
|
|
323
|
+
C("div", se, [
|
|
324
|
+
u.buttons.length > 0 ? (v(!0), z(
|
|
325
|
+
P,
|
|
326
|
+
{ key: 0 },
|
|
327
|
+
G(u.buttons, (e, A) => (v(), D(r(t), {
|
|
328
|
+
key: A,
|
|
329
|
+
color: e.color,
|
|
330
|
+
size: e.size,
|
|
331
|
+
outline: e.outline,
|
|
332
|
+
rounded: e.rounded,
|
|
333
|
+
disabled: e.disabled,
|
|
334
|
+
block: e.block,
|
|
335
|
+
loading: e.loading,
|
|
336
|
+
onClick: (F) => e.type === "resolve" ? r(m)(s.value, e.response) : r(c)(s.value, e.response)
|
|
337
|
+
}, {
|
|
338
|
+
default: k(() => [
|
|
339
|
+
y(
|
|
340
|
+
b(e.text),
|
|
341
|
+
1
|
|
342
|
+
/* TEXT */
|
|
343
|
+
)
|
|
344
|
+
]),
|
|
345
|
+
_: 2
|
|
346
|
+
/* DYNAMIC */
|
|
347
|
+
}, 1032, ["color", "size", "outline", "rounded", "disabled", "block", "loading", "onClick"]))),
|
|
348
|
+
128
|
|
349
|
+
/* KEYED_FRAGMENT */
|
|
350
|
+
)) : (v(), z(
|
|
351
|
+
P,
|
|
352
|
+
{ key: 1 },
|
|
353
|
+
[
|
|
354
|
+
B(r(t), {
|
|
355
|
+
color: "danger",
|
|
356
|
+
outline: "",
|
|
357
|
+
onClick: g[0] || (g[0] = (e) => r(c)(s.value))
|
|
358
|
+
}, {
|
|
359
|
+
default: k(() => [
|
|
360
|
+
p(u.$slots, "cancel-text", {}, () => {
|
|
361
|
+
var e;
|
|
362
|
+
return [
|
|
363
|
+
y(
|
|
364
|
+
b(((e = l.value) == null ? void 0 : e.cancelText) || "Cancel"),
|
|
365
|
+
1
|
|
366
|
+
/* TEXT */
|
|
367
|
+
)
|
|
368
|
+
];
|
|
369
|
+
})
|
|
370
|
+
]),
|
|
371
|
+
_: 3
|
|
372
|
+
/* FORWARDED */
|
|
373
|
+
}),
|
|
374
|
+
B(r(t), {
|
|
375
|
+
color: "success",
|
|
376
|
+
onClick: g[1] || (g[1] = (e) => r(m)(s.value))
|
|
377
|
+
}, {
|
|
378
|
+
default: k(() => [
|
|
379
|
+
p(u.$slots, "confirm-text", {}, () => {
|
|
380
|
+
var e;
|
|
381
|
+
return [
|
|
382
|
+
y(
|
|
383
|
+
b(((e = l.value) == null ? void 0 : e.confirmText) || "Confirm"),
|
|
384
|
+
1
|
|
385
|
+
/* TEXT */
|
|
386
|
+
)
|
|
387
|
+
];
|
|
388
|
+
})
|
|
389
|
+
]),
|
|
390
|
+
_: 3
|
|
391
|
+
/* FORWARDED */
|
|
392
|
+
})
|
|
393
|
+
],
|
|
394
|
+
64
|
|
395
|
+
/* STABLE_FRAGMENT */
|
|
396
|
+
))
|
|
397
|
+
])
|
|
398
|
+
])
|
|
399
|
+
]),
|
|
400
|
+
_: 3
|
|
401
|
+
/* FORWARDED */
|
|
402
|
+
}, 8, ["model-value"]);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
export {
|
|
407
|
+
oe as _,
|
|
408
|
+
le as a,
|
|
409
|
+
R as u
|
|
410
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../assets/MazSpinner.css';
|
|
2
2
|
import { defineComponent as t, openBlock as o, createElementBlock as c, normalizeClass as n, pushScopeId as s, popScopeId as r, createElementVNode as i } from "vue";
|
|
3
|
-
import { _ as p } from "./MazDialogPromise-
|
|
3
|
+
import { _ as p } from "./MazDialogPromise-CS8SGV4-.mjs";
|
|
4
4
|
const a = (e) => (s("data-v-c67298ec"), e = e(), r(), e), d = ["width", "height"], l = /* @__PURE__ */ a(() => /* @__PURE__ */ i(
|
|
5
5
|
"path",
|
|
6
6
|
{ d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" },
|
package/nuxt/index.json
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export interface DialogData {
|
|
|
11
11
|
confirmText?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const useMazDialogPromise: () => {
|
|
14
|
-
|
|
14
|
+
data: import("vue").Ref<DialogData | undefined>;
|
|
15
15
|
dialogState: import("vue").Ref<{
|
|
16
16
|
id: string;
|
|
17
17
|
isActive: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type PropType } from 'vue';
|
|
2
1
|
import { type Color, type Size } from './types';
|
|
3
2
|
import { type DialogData } from './MazDialogPromise/use-maz-dialog-promise';
|
|
4
3
|
export type DialogButton = {
|
|
@@ -15,39 +14,27 @@ export type DialogButton = {
|
|
|
15
14
|
};
|
|
16
15
|
export { useMazDialogPromise, type DialogState, type DialogData, } from './MazDialogPromise/use-maz-dialog-promise';
|
|
17
16
|
export type { Color, Size } from './types';
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
19
18
|
/** Dialog Data - type DialogData */
|
|
20
|
-
data:
|
|
21
|
-
type: PropType<DialogData>;
|
|
22
|
-
default: undefined;
|
|
23
|
-
};
|
|
19
|
+
data: DialogData;
|
|
24
20
|
/** Uniq identifier */
|
|
25
|
-
identifier:
|
|
26
|
-
type: StringConstructor;
|
|
27
|
-
required: true;
|
|
28
|
-
};
|
|
21
|
+
identifier: string;
|
|
29
22
|
/** Custom buttons - type DialogButton[] */
|
|
30
|
-
buttons:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
23
|
+
buttons: DialogButton[];
|
|
24
|
+
}>, {
|
|
25
|
+
data: undefined;
|
|
26
|
+
buttons: () => never[];
|
|
27
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
35
28
|
/** Dialog Data - type DialogData */
|
|
36
|
-
data:
|
|
37
|
-
type: PropType<DialogData>;
|
|
38
|
-
default: undefined;
|
|
39
|
-
};
|
|
29
|
+
data: DialogData;
|
|
40
30
|
/** Uniq identifier */
|
|
41
|
-
identifier:
|
|
42
|
-
type: StringConstructor;
|
|
43
|
-
required: true;
|
|
44
|
-
};
|
|
31
|
+
identifier: string;
|
|
45
32
|
/** Custom buttons - type DialogButton[] */
|
|
46
|
-
buttons:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
33
|
+
buttons: DialogButton[];
|
|
34
|
+
}>, {
|
|
35
|
+
data: undefined;
|
|
36
|
+
buttons: () => never[];
|
|
37
|
+
}>>>, {
|
|
51
38
|
data: DialogData;
|
|
52
39
|
buttons: DialogButton[];
|
|
53
40
|
}, {}>, {
|
|
@@ -64,8 +51,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
64
51
|
"confirm-text"?(_: {}): any;
|
|
65
52
|
}>;
|
|
66
53
|
export default _default;
|
|
54
|
+
type __VLS_WithDefaults<P, D> = {
|
|
55
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
56
|
+
default: D[K];
|
|
57
|
+
}> : P[K];
|
|
58
|
+
};
|
|
59
|
+
type __VLS_Prettify<T> = {
|
|
60
|
+
[K in keyof T]: T[K];
|
|
61
|
+
} & {};
|
|
67
62
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
68
63
|
new (): {
|
|
69
64
|
$slots: S;
|
|
70
65
|
};
|
|
71
66
|
};
|
|
67
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
68
|
+
type __VLS_TypePropsToOption<T> = {
|
|
69
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
70
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
71
|
+
} : {
|
|
72
|
+
type: import('vue').PropType<T[K]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
import '../assets/MazDialogPromise.css';
|
|
2
|
-
import { ref as j, defineComponent as V, onMounted as W, watch as K, openBlock as p, createBlock as $, Teleport as q, createVNode as D, Transition as I, withCtx as v, createElementBlock as h, normalizeClass as w, createElementVNode as k, withModifiers as U, mergeProps as M, renderSlot as f, createCommentVNode as m, defineAsyncComponent as T, useAttrs as X, computed as S, createTextVNode as g, toDisplayString as y, unref as d, Fragment as P, renderList as G } from "vue";
|
|
3
|
-
const J = j(), b = j([]), Q = (n, o) => new Promise((r, i) => {
|
|
4
|
-
b.value = [
|
|
5
|
-
...b.value,
|
|
6
|
-
{
|
|
7
|
-
id: n,
|
|
8
|
-
isActive: !0,
|
|
9
|
-
resolve: async () => {
|
|
10
|
-
await (o == null ? void 0 : o()), r(!0);
|
|
11
|
-
},
|
|
12
|
-
reject: i
|
|
13
|
-
}
|
|
14
|
-
];
|
|
15
|
-
}), H = (n) => (b.value = b.value.filter(({ id: o }) => o !== n), b.value), N = (n, o, r = !1) => {
|
|
16
|
-
var i;
|
|
17
|
-
o && ((i = o[n]) == null || i.call(o, r), o.isActive = !1, setTimeout(() => {
|
|
18
|
-
H(o.id);
|
|
19
|
-
}, 500));
|
|
20
|
-
}, R = () => ({
|
|
21
|
-
confirmDialogData: J,
|
|
22
|
-
dialogState: b,
|
|
23
|
-
showDialogAndWaitChoice: Q,
|
|
24
|
-
removeDialogFromState: H,
|
|
25
|
-
rejectDialog: (n, o = "cancel") => N("reject", n, o),
|
|
26
|
-
resolveDialog: (n, o = "accept") => N("resolve", n, o)
|
|
27
|
-
}), O = "--backdrop-present", Y = /* @__PURE__ */ V({
|
|
28
|
-
inheritAttrs: !1,
|
|
29
|
-
__name: "MazBackdrop",
|
|
30
|
-
props: {
|
|
31
|
-
modelValue: { type: Boolean, default: !1 },
|
|
32
|
-
teleportSelector: { default: "body" },
|
|
33
|
-
beforeClose: { type: Function, default: void 0 },
|
|
34
|
-
persistent: { type: Boolean, default: !1 },
|
|
35
|
-
noCloseOnEscKey: { type: Boolean, default: !1 },
|
|
36
|
-
transitionName: { default: "backdrop-anim" },
|
|
37
|
-
backdropClass: { default: void 0 },
|
|
38
|
-
backdropContentClass: { default: void 0 }
|
|
39
|
-
},
|
|
40
|
-
emits: ["open", "close", "update:model-value", "before-close"],
|
|
41
|
-
setup(n, { expose: o, emit: r }) {
|
|
42
|
-
const i = () => {
|
|
43
|
-
document.documentElement.classList.add(O);
|
|
44
|
-
}, c = async () => {
|
|
45
|
-
document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(O);
|
|
46
|
-
}, u = r, e = n, l = j(e.modelValue);
|
|
47
|
-
function s() {
|
|
48
|
-
C(!1);
|
|
49
|
-
}
|
|
50
|
-
async function C(a) {
|
|
51
|
-
var F;
|
|
52
|
-
a || (u("before-close"), await ((F = e.beforeClose) == null ? void 0 : F.call(e))), l.value = a;
|
|
53
|
-
}
|
|
54
|
-
function t() {
|
|
55
|
-
u("open");
|
|
56
|
-
}
|
|
57
|
-
function A() {
|
|
58
|
-
u("update:model-value", !1), u("close"), E();
|
|
59
|
-
}
|
|
60
|
-
function z() {
|
|
61
|
-
e.persistent || s();
|
|
62
|
-
}
|
|
63
|
-
function B(a) {
|
|
64
|
-
!e.noCloseOnEscKey && a.key === "Escape" && !e.persistent && s();
|
|
65
|
-
}
|
|
66
|
-
function L() {
|
|
67
|
-
i(), document.addEventListener("keyup", B, !1);
|
|
68
|
-
}
|
|
69
|
-
function E() {
|
|
70
|
-
document.removeEventListener("keyup", B), c();
|
|
71
|
-
}
|
|
72
|
-
return W(() => {
|
|
73
|
-
e.modelValue ? L() : E();
|
|
74
|
-
}), K(
|
|
75
|
-
() => e.modelValue,
|
|
76
|
-
(a) => {
|
|
77
|
-
l.value = a, a ? L() : E();
|
|
78
|
-
}
|
|
79
|
-
), o({
|
|
80
|
-
onBackdropAnimationEnter: t,
|
|
81
|
-
onBackdropAnimationLeave: A,
|
|
82
|
-
onBackdropClicked: z,
|
|
83
|
-
close: s,
|
|
84
|
-
present: l,
|
|
85
|
-
toggleModal: C,
|
|
86
|
-
onKeyPress: B
|
|
87
|
-
}), (a, F) => (p(), $(q, { to: a.teleportSelector }, [
|
|
88
|
-
D(I, {
|
|
89
|
-
appear: "",
|
|
90
|
-
name: a.transitionName,
|
|
91
|
-
onAfterEnter: t,
|
|
92
|
-
onAfterLeave: A
|
|
93
|
-
}, {
|
|
94
|
-
default: v(() => [
|
|
95
|
-
l.value ? (p(), h(
|
|
96
|
-
"div",
|
|
97
|
-
{
|
|
98
|
-
key: 0,
|
|
99
|
-
class: w(["m-backdrop --present", [a.backdropClass]]),
|
|
100
|
-
tabindex: "-1",
|
|
101
|
-
role: "dialog"
|
|
102
|
-
},
|
|
103
|
-
[
|
|
104
|
-
k(
|
|
105
|
-
"button",
|
|
106
|
-
{
|
|
107
|
-
class: w(["m-backdrop-overlay", { "--disabled": a.persistent }]),
|
|
108
|
-
tabindex: "-1",
|
|
109
|
-
onClick: U(z, ["self"])
|
|
110
|
-
},
|
|
111
|
-
null,
|
|
112
|
-
2
|
|
113
|
-
/* CLASS */
|
|
114
|
-
),
|
|
115
|
-
k(
|
|
116
|
-
"div",
|
|
117
|
-
M({
|
|
118
|
-
class: ["m-backdrop-content", a.backdropContentClass]
|
|
119
|
-
}, a.$attrs, {
|
|
120
|
-
role: "document",
|
|
121
|
-
tabindex: "0"
|
|
122
|
-
}),
|
|
123
|
-
[
|
|
124
|
-
f(a.$slots, "default", { close: s })
|
|
125
|
-
],
|
|
126
|
-
16
|
|
127
|
-
/* FULL_PROPS */
|
|
128
|
-
)
|
|
129
|
-
],
|
|
130
|
-
2
|
|
131
|
-
/* CLASS */
|
|
132
|
-
)) : m("v-if", !0)
|
|
133
|
-
]),
|
|
134
|
-
_: 3
|
|
135
|
-
/* FORWARDED */
|
|
136
|
-
}, 8, ["name"])
|
|
137
|
-
], 8, ["to"]));
|
|
138
|
-
}
|
|
139
|
-
}), Z = {
|
|
140
|
-
key: 0,
|
|
141
|
-
id: "dialogTitle",
|
|
142
|
-
class: "maz-my-0 maz-text-xl maz-font-semibold"
|
|
143
|
-
}, x = {
|
|
144
|
-
id: "dialogDesc",
|
|
145
|
-
class: "m-dialog-content"
|
|
146
|
-
}, _ = {
|
|
147
|
-
key: 0,
|
|
148
|
-
class: "m-dialog-footer"
|
|
149
|
-
}, ee = /* @__PURE__ */ V({
|
|
150
|
-
__name: "MazDialog",
|
|
151
|
-
props: {
|
|
152
|
-
title: { default: void 0 },
|
|
153
|
-
noClose: { type: Boolean, default: !1 },
|
|
154
|
-
width: { default: "500px" },
|
|
155
|
-
maxWidth: { default: "95vw" },
|
|
156
|
-
maxHeight: { default: "95vh" },
|
|
157
|
-
scrollable: { type: Boolean, default: !1 },
|
|
158
|
-
persistent: { type: Boolean, default: !1 }
|
|
159
|
-
},
|
|
160
|
-
emits: [
|
|
161
|
-
/** Model binding */
|
|
162
|
-
"update:model-value",
|
|
163
|
-
/** Emitted when dialog is closed (after animation) */
|
|
164
|
-
"close",
|
|
165
|
-
/** Emitted when dialog is opened (after animation) */
|
|
166
|
-
"open"
|
|
167
|
-
],
|
|
168
|
-
setup(n) {
|
|
169
|
-
const o = T(() => import("./MazBtn-CauvhLv6.mjs")), r = T(() => import("./x-mark-BP8zWe_C.mjs")), i = X(), c = S(() => ({
|
|
170
|
-
...i,
|
|
171
|
-
class: void 0,
|
|
172
|
-
style: void 0
|
|
173
|
-
})), u = S(() => ({
|
|
174
|
-
class: i.class,
|
|
175
|
-
style: i.style
|
|
176
|
-
}));
|
|
177
|
-
return (e, l) => (p(), $(Y, M(c.value, {
|
|
178
|
-
persistent: e.persistent,
|
|
179
|
-
"transition-name": "modal-anim",
|
|
180
|
-
"aria-labelledby": "dialogTitle",
|
|
181
|
-
"aria-describedby": "dialogDesc",
|
|
182
|
-
onClose: l[0] || (l[0] = (s) => e.$emit("close", s)),
|
|
183
|
-
onOpen: l[1] || (l[1] = (s) => e.$emit("open", s)),
|
|
184
|
-
"onUpdate:modelValue": l[2] || (l[2] = (s) => e.$emit("update:model-value", s))
|
|
185
|
-
}), {
|
|
186
|
-
default: v(({ close: s }) => [
|
|
187
|
-
k(
|
|
188
|
-
"div",
|
|
189
|
-
M({
|
|
190
|
-
class: ["m-dialog", { "--scrollable": e.scrollable }],
|
|
191
|
-
role: "dialog",
|
|
192
|
-
"aria-modal": "true",
|
|
193
|
-
style: [{ width: e.width, maxWidth: e.maxWidth, maxHeight: e.maxHeight }]
|
|
194
|
-
}, u.value),
|
|
195
|
-
[
|
|
196
|
-
m(`
|
|
197
|
-
@slot Header slot
|
|
198
|
-
@binding {Function} close close function
|
|
199
|
-
`),
|
|
200
|
-
f(e.$slots, "header", { close: s }, () => [
|
|
201
|
-
k(
|
|
202
|
-
"div",
|
|
203
|
-
{
|
|
204
|
-
class: w(["m-dialog-header", { "--has-title": e.$slots.title || e.title }])
|
|
205
|
-
},
|
|
206
|
-
[
|
|
207
|
-
e.$slots.title || e.title ? (p(), h("h2", Z, [
|
|
208
|
-
m(`
|
|
209
|
-
@slot Title slot in the header
|
|
210
|
-
`),
|
|
211
|
-
f(e.$slots, "title", {}, () => [
|
|
212
|
-
g(
|
|
213
|
-
y(e.title),
|
|
214
|
-
1
|
|
215
|
-
/* TEXT */
|
|
216
|
-
)
|
|
217
|
-
], !0)
|
|
218
|
-
])) : m("v-if", !0),
|
|
219
|
-
!e.noClose && !e.persistent ? (p(), $(d(o), {
|
|
220
|
-
key: 1,
|
|
221
|
-
class: "m-dialog-closebtn",
|
|
222
|
-
color: "transparent",
|
|
223
|
-
onClick: s
|
|
224
|
-
}, {
|
|
225
|
-
default: v(() => [
|
|
226
|
-
D(d(r), { class: "maz-text-lg" })
|
|
227
|
-
]),
|
|
228
|
-
_: 2
|
|
229
|
-
/* DYNAMIC */
|
|
230
|
-
}, 1032, ["onClick"])) : m("v-if", !0)
|
|
231
|
-
],
|
|
232
|
-
2
|
|
233
|
-
/* CLASS */
|
|
234
|
-
)
|
|
235
|
-
], !0),
|
|
236
|
-
k("div", x, [
|
|
237
|
-
m(`
|
|
238
|
-
@slot Default content
|
|
239
|
-
@binding {Function} close close function
|
|
240
|
-
`),
|
|
241
|
-
f(e.$slots, "default", { close: s }, void 0, !0)
|
|
242
|
-
]),
|
|
243
|
-
e.$slots.footer ? (p(), h("div", _, [
|
|
244
|
-
m(`
|
|
245
|
-
@slot Footer slot
|
|
246
|
-
@binding {Function} close close function
|
|
247
|
-
`),
|
|
248
|
-
f(e.$slots, "footer", { close: s }, void 0, !0)
|
|
249
|
-
])) : m("v-if", !0)
|
|
250
|
-
],
|
|
251
|
-
16
|
|
252
|
-
/* FULL_PROPS */
|
|
253
|
-
)
|
|
254
|
-
]),
|
|
255
|
-
_: 3
|
|
256
|
-
/* FORWARDED */
|
|
257
|
-
}, 16, ["persistent"]));
|
|
258
|
-
}
|
|
259
|
-
}), te = (n, o) => {
|
|
260
|
-
const r = n.__vccOpts || n;
|
|
261
|
-
for (const [i, c] of o)
|
|
262
|
-
r[i] = c;
|
|
263
|
-
return r;
|
|
264
|
-
}, oe = /* @__PURE__ */ te(ee, [["__scopeId", "data-v-6ded3568"]]), ne = { class: "maz-space-x-2" }, le = /* @__PURE__ */ V({
|
|
265
|
-
__name: "MazDialogPromise",
|
|
266
|
-
props: {
|
|
267
|
-
/** Dialog Data - type DialogData */
|
|
268
|
-
data: { type: Object, default: void 0 },
|
|
269
|
-
/** Uniq identifier */
|
|
270
|
-
identifier: { type: String, required: !0 },
|
|
271
|
-
/** Custom buttons - type DialogButton[] */
|
|
272
|
-
buttons: { type: Array, default: () => [] }
|
|
273
|
-
},
|
|
274
|
-
setup(n) {
|
|
275
|
-
const o = T(() => import("./MazBtn-CauvhLv6.mjs")), r = n, { dialogState: i, rejectDialog: c, resolveDialog: u } = R(), e = S(
|
|
276
|
-
() => i.value.find(({ id: l }) => l === r.identifier)
|
|
277
|
-
);
|
|
278
|
-
return (l, s) => {
|
|
279
|
-
var C;
|
|
280
|
-
return p(), $(oe, {
|
|
281
|
-
"model-value": ((C = e.value) == null ? void 0 : C.isActive) ?? !1,
|
|
282
|
-
"onUpdate:modelValue": s[2] || (s[2] = (t) => d(c)(e.value))
|
|
283
|
-
}, {
|
|
284
|
-
title: v(() => [
|
|
285
|
-
f(l.$slots, "title", {}, () => {
|
|
286
|
-
var t;
|
|
287
|
-
return [
|
|
288
|
-
g(
|
|
289
|
-
y((t = n.data) == null ? void 0 : t.title),
|
|
290
|
-
1
|
|
291
|
-
/* TEXT */
|
|
292
|
-
)
|
|
293
|
-
];
|
|
294
|
-
})
|
|
295
|
-
]),
|
|
296
|
-
default: v(() => [
|
|
297
|
-
m(`
|
|
298
|
-
@slot Default slot - Place your content
|
|
299
|
-
@binding {Function} resolve resolve function
|
|
300
|
-
@binding {Function} reject reject function
|
|
301
|
-
`),
|
|
302
|
-
f(l.$slots, "default", {
|
|
303
|
-
resolve: (t) => d(u)(e.value, t),
|
|
304
|
-
reject: (t) => d(c)(e.value, t)
|
|
305
|
-
}, () => {
|
|
306
|
-
var t;
|
|
307
|
-
return [
|
|
308
|
-
g(
|
|
309
|
-
y((t = n.data) == null ? void 0 : t.message),
|
|
310
|
-
1
|
|
311
|
-
/* TEXT */
|
|
312
|
-
)
|
|
313
|
-
];
|
|
314
|
-
})
|
|
315
|
-
]),
|
|
316
|
-
footer: v(() => [
|
|
317
|
-
m(`
|
|
318
|
-
@slot Footer Buttons slot
|
|
319
|
-
@binding {Function} resolve resolve function
|
|
320
|
-
@binding {Function} reject reject function
|
|
321
|
-
`),
|
|
322
|
-
f(l.$slots, "footer-button", {
|
|
323
|
-
resolve: (t) => d(u)(e.value, t),
|
|
324
|
-
reject: (t) => d(c)(e.value, t)
|
|
325
|
-
}, () => [
|
|
326
|
-
k("div", ne, [
|
|
327
|
-
n.buttons.length > 0 ? (p(!0), h(
|
|
328
|
-
P,
|
|
329
|
-
{ key: 0 },
|
|
330
|
-
G(n.buttons, (t, A) => (p(), $(d(o), {
|
|
331
|
-
key: A,
|
|
332
|
-
color: t.color,
|
|
333
|
-
size: t.size,
|
|
334
|
-
outline: t.outline,
|
|
335
|
-
rounded: t.rounded,
|
|
336
|
-
disabled: t.disabled,
|
|
337
|
-
block: t.block,
|
|
338
|
-
loading: t.loading,
|
|
339
|
-
onClick: (z) => t.type === "resolve" ? d(u)(e.value, t.response) : d(c)(e.value, t.response)
|
|
340
|
-
}, {
|
|
341
|
-
default: v(() => [
|
|
342
|
-
g(
|
|
343
|
-
y(t.text),
|
|
344
|
-
1
|
|
345
|
-
/* TEXT */
|
|
346
|
-
)
|
|
347
|
-
]),
|
|
348
|
-
_: 2
|
|
349
|
-
/* DYNAMIC */
|
|
350
|
-
}, 1032, ["color", "size", "outline", "rounded", "disabled", "block", "loading", "onClick"]))),
|
|
351
|
-
128
|
|
352
|
-
/* KEYED_FRAGMENT */
|
|
353
|
-
)) : (p(), h(
|
|
354
|
-
P,
|
|
355
|
-
{ key: 1 },
|
|
356
|
-
[
|
|
357
|
-
D(d(o), {
|
|
358
|
-
color: "danger",
|
|
359
|
-
outline: "",
|
|
360
|
-
onClick: s[0] || (s[0] = (t) => d(c)(e.value))
|
|
361
|
-
}, {
|
|
362
|
-
default: v(() => [
|
|
363
|
-
f(l.$slots, "cancel-text", {}, () => {
|
|
364
|
-
var t;
|
|
365
|
-
return [
|
|
366
|
-
g(
|
|
367
|
-
y(((t = n.data) == null ? void 0 : t.cancelText) || "Cancel"),
|
|
368
|
-
1
|
|
369
|
-
/* TEXT */
|
|
370
|
-
)
|
|
371
|
-
];
|
|
372
|
-
})
|
|
373
|
-
]),
|
|
374
|
-
_: 3
|
|
375
|
-
/* FORWARDED */
|
|
376
|
-
}),
|
|
377
|
-
D(d(o), {
|
|
378
|
-
color: "success",
|
|
379
|
-
onClick: s[1] || (s[1] = (t) => d(u)(e.value))
|
|
380
|
-
}, {
|
|
381
|
-
default: v(() => [
|
|
382
|
-
f(l.$slots, "confirm-text", {}, () => {
|
|
383
|
-
var t;
|
|
384
|
-
return [
|
|
385
|
-
g(
|
|
386
|
-
y(((t = n.data) == null ? void 0 : t.confirmText) || "Confirm"),
|
|
387
|
-
1
|
|
388
|
-
/* TEXT */
|
|
389
|
-
)
|
|
390
|
-
];
|
|
391
|
-
})
|
|
392
|
-
]),
|
|
393
|
-
_: 3
|
|
394
|
-
/* FORWARDED */
|
|
395
|
-
})
|
|
396
|
-
],
|
|
397
|
-
64
|
|
398
|
-
/* STABLE_FRAGMENT */
|
|
399
|
-
))
|
|
400
|
-
])
|
|
401
|
-
])
|
|
402
|
-
]),
|
|
403
|
-
_: 3
|
|
404
|
-
/* FORWARDED */
|
|
405
|
-
}, 8, ["model-value"]);
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
export {
|
|
410
|
-
te as _,
|
|
411
|
-
le as a,
|
|
412
|
-
R as u
|
|
413
|
-
};
|