maz-ui 3.47.2-beta.19 → 3.47.2-beta.20

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.
Files changed (50) hide show
  1. package/components/MazBackdrop.d.ts +21 -13
  2. package/components/MazBackdrop.mjs +107 -82
  3. package/components/MazBottomSheet.d.ts +11 -24
  4. package/components/MazBottomSheet.mjs +1 -1
  5. package/components/MazDialog.d.ts +20 -31
  6. package/components/MazDialog.mjs +1 -1
  7. package/components/MazDialogPromise.d.ts +3 -3
  8. package/components/MazDialogPromise.mjs +1 -1
  9. package/components/MazDrawer.d.ts +7 -4
  10. package/components/MazDrawer.mjs +2 -194
  11. package/components/assets/MazBackdrop.css +1 -1
  12. package/components/assets/MazBottomSheet.css +1 -1
  13. package/components/assets/MazDialog.css +1 -1
  14. package/components/assets/MazDialogPromise.css +1 -1
  15. package/components/assets/MazDrawer.css +1 -1
  16. package/components/chunks/MazBottomSheet-DGsGO0zo.mjs +224 -0
  17. package/components/chunks/{MazBtn-ZigrzA2_.mjs → MazBtn-BS2kvd1Z.mjs} +2 -2
  18. package/components/chunks/{MazBtn-BDrYYq_W.mjs → MazBtn-C60T0UDa.mjs} +2 -2
  19. package/components/chunks/{MazBtn-BQwIuO_Q.mjs → MazBtn-CsLtHm4K.mjs} +2 -2
  20. package/components/chunks/MazBtn-ZAcYNusG.mjs +103 -0
  21. package/components/chunks/MazDialog-Ca3jJ12T.mjs +297 -0
  22. package/components/chunks/MazDialogPromise-DOnmLhui.mjs +551 -0
  23. package/components/chunks/MazDrawer-Bas9dy0D.mjs +226 -0
  24. package/components/chunks/{MazSpinner-1F6A6qVD.mjs → MazSpinner-C6h03sqc.mjs} +1 -1
  25. package/components/chunks/{MazSpinner-Cc-KlPEG.mjs → MazSpinner-D5Sbo759.mjs} +1 -1
  26. package/components/chunks/{MazSpinner-DzFcVNs_.mjs → MazSpinner-DPur0-r-.mjs} +1 -1
  27. package/components/chunks/{MazSpinner-wQasUhyI.mjs → MazSpinner-ZFhNCy24.mjs} +1 -1
  28. package/css/main.css +1 -1
  29. package/modules/assets/index.css +1 -1
  30. package/modules/chunks/{MazBtn-DZ5uD4Ie.cjs → MazBtn-CFge_w1W.cjs} +1 -1
  31. package/modules/chunks/{MazBtn-C2iBdVnK.mjs → MazBtn-yNCoLFA6.mjs} +2 -2
  32. package/modules/chunks/{MazIcon-trV1gyry.mjs → MazIcon-C3__MBEL.mjs} +1 -1
  33. package/modules/chunks/{MazIcon-BYvF8LQu.cjs → MazIcon-CqhvM2xp.cjs} +1 -1
  34. package/modules/chunks/{MazSpinner-Dxfnhjcc.mjs → MazSpinner-C4XtaFJk.mjs} +1 -1
  35. package/modules/chunks/{MazSpinner-2MEHiA8E.cjs → MazSpinner-DkJAN36F.cjs} +1 -1
  36. package/modules/chunks/{index-BjpJ5NSX.cjs → index-Bawg2UGE.cjs} +2 -2
  37. package/modules/chunks/{index-C3k5P1Gx.mjs → index-CXu9R01-.mjs} +900 -837
  38. package/modules/index.cjs +1 -1
  39. package/modules/index.mjs +1 -1
  40. package/nuxt/index.json +1 -1
  41. package/package.json +1 -1
  42. package/types/components/MazBackdrop.vue.d.ts +21 -13
  43. package/types/components/MazBottomSheet.vue.d.ts +11 -24
  44. package/types/components/MazDialog.vue.d.ts +20 -31
  45. package/types/components/MazDialogPromise.vue.d.ts +3 -3
  46. package/types/components/MazDrawer.vue.d.ts +7 -4
  47. package/components/chunks/MazBottomSheet-B1cqFZxd.mjs +0 -208
  48. package/components/chunks/MazBtn-CIAdgMGr.mjs +0 -111
  49. package/components/chunks/MazDialog-C3h6Ydey.mjs +0 -237
  50. package/components/chunks/MazDialogPromise-BZm1F0X2.mjs +0 -488
@@ -1,488 +0,0 @@
1
- import { defineComponent as K, ref as L, onMounted as U, watch as q, openBlock as p, createBlock as D, Teleport as X, createVNode as G, Transition as J, withCtx as g, createElementBlock as j, normalizeClass as P, createElementVNode as V, withModifiers as Q, mergeProps as h, renderSlot as B, createCommentVNode as S, defineAsyncComponent as x, useAttrs as R, computed as $, createTextVNode as w, toDisplayString as T, unref as f, Fragment as W, renderList as Y } from "vue";
2
- import '../assets/MazDialogPromise.css';const F = "--backdrop-present", Z = /* @__PURE__ */ K({
3
- inheritAttrs: !1,
4
- __name: "MazBackdrop",
5
- props: {
6
- modelValue: { type: Boolean, default: !1 },
7
- teleportSelector: { default: "body" },
8
- beforeClose: { type: Function, default: void 0 },
9
- persistent: { type: Boolean, default: !1 },
10
- noCloseOnEscKey: { type: Boolean, default: !1 },
11
- transitionName: { default: "backdrop-anim" },
12
- backdropClass: { default: void 0 },
13
- backdropContentClass: { default: void 0 }
14
- },
15
- emits: ["open", "close", "update:model-value", "before-close"],
16
- setup(r, { expose: s, emit: o }) {
17
- const l = r, u = o;
18
- function v() {
19
- document.documentElement.classList.add(F);
20
- }
21
- function y() {
22
- document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(F);
23
- }
24
- const c = L(l.modelValue);
25
- function C() {
26
- t(!1);
27
- }
28
- async function t(e) {
29
- var n;
30
- e || (u("before-close"), await ((n = l.beforeClose) == null ? void 0 : n.call(l))), c.value = e;
31
- }
32
- function d() {
33
- u("open");
34
- }
35
- function i() {
36
- u("update:model-value", !1), u("close"), M();
37
- }
38
- function m() {
39
- l.persistent || C();
40
- }
41
- function A(e) {
42
- !l.noCloseOnEscKey && e.key === "Escape" && !l.persistent && C();
43
- }
44
- function N() {
45
- v(), document.addEventListener("keyup", A, !1);
46
- }
47
- function M() {
48
- document.removeEventListener("keyup", A), y();
49
- }
50
- return U(() => {
51
- l.modelValue ? N() : M();
52
- }), q(
53
- () => l.modelValue,
54
- (e) => {
55
- c.value = e, e ? N() : M();
56
- }
57
- ), s({
58
- onBackdropAnimationEnter: d,
59
- onBackdropAnimationLeave: i,
60
- onBackdropClicked: m,
61
- close: C,
62
- present: c,
63
- toggleModal: t,
64
- onKeyPress: A
65
- }), (e, n) => (p(), D(X, { to: e.teleportSelector }, [
66
- G(J, {
67
- appear: "",
68
- name: e.transitionName,
69
- onAfterEnter: d,
70
- onAfterLeave: i
71
- }, {
72
- default: g(() => [
73
- c.value ? (p(), j(
74
- "div",
75
- {
76
- key: 0,
77
- class: P(["m-backdrop --present", [e.backdropClass]]),
78
- tabindex: "-1",
79
- role: "dialog"
80
- },
81
- [
82
- V(
83
- "button",
84
- {
85
- class: P(["m-backdrop-overlay", { "--disabled": e.persistent }]),
86
- tabindex: "-1",
87
- onClick: Q(m, ["self"])
88
- },
89
- null,
90
- 2
91
- /* CLASS */
92
- ),
93
- V(
94
- "div",
95
- h({
96
- class: ["m-backdrop-content", e.backdropContentClass]
97
- }, e.$attrs, {
98
- role: "document",
99
- tabindex: "0"
100
- }),
101
- [
102
- B(e.$slots, "default", { close: C })
103
- ],
104
- 16
105
- /* FULL_PROPS */
106
- )
107
- ],
108
- 2
109
- /* CLASS */
110
- )) : S("v-if", !0)
111
- ]),
112
- _: 3
113
- /* FORWARDED */
114
- }, 8, ["name"])
115
- ], 8, ["to"]));
116
- }
117
- }), _ = {
118
- key: 0,
119
- id: "dialogTitle",
120
- class: "maz-my-0 maz-text-xl maz-font-semibold"
121
- }, ee = {
122
- id: "dialogDesc",
123
- class: "m-dialog-content"
124
- }, te = {
125
- key: 0,
126
- class: "m-dialog-footer"
127
- }, oe = /* @__PURE__ */ K({
128
- __name: "MazDialog",
129
- props: {
130
- modelValue: { type: Boolean },
131
- title: { default: void 0 },
132
- noClose: { type: Boolean, default: !1 },
133
- width: { default: "500px" },
134
- maxWidth: { default: "95vw" },
135
- maxHeight: { default: "95vh" },
136
- scrollable: { type: Boolean, default: !1 },
137
- persistent: { type: Boolean, default: !1 },
138
- teleportSelector: {},
139
- beforeClose: {},
140
- noCloseOnEscKey: { type: Boolean },
141
- transitionName: {},
142
- backdropClass: {},
143
- backdropContentClass: {}
144
- },
145
- emits: ["open", "close", "update:model-value"],
146
- setup(r, { expose: s }) {
147
- const o = r, l = x(() => import("./MazBtn-BQwIuO_Q.mjs")), u = x(() => import("./x-mark-CnZwVvA7.mjs")), v = R(), y = L();
148
- s({
149
- close: () => {
150
- var t, d;
151
- return (d = (t = y.value) == null ? void 0 : t.close) == null ? void 0 : d.call(t);
152
- }
153
- });
154
- const c = $(() => ({
155
- ...v,
156
- class: void 0,
157
- style: void 0
158
- })), C = $(() => ({
159
- class: v.class,
160
- style: v.style
161
- }));
162
- return (t, d) => (p(), D(Z, h({ ...c.value, ...o }, {
163
- ref_key: "backdrop",
164
- ref: y,
165
- persistent: t.persistent,
166
- "model-value": t.modelValue,
167
- "transition-name": "modal-anim",
168
- "aria-labelledby": "dialogTitle",
169
- "aria-describedby": "dialogDesc",
170
- onClose: d[0] || (d[0] = (i) => t.$emit("close", i)),
171
- onOpen: d[1] || (d[1] = (i) => t.$emit("open", i)),
172
- "onUpdate:modelValue": d[2] || (d[2] = (i) => t.$emit("update:model-value", i))
173
- }), {
174
- default: g(({ close: i }) => [
175
- V(
176
- "div",
177
- h({
178
- class: ["m-dialog", { "--scrollable": t.scrollable }],
179
- role: "dialog",
180
- "aria-modal": "true",
181
- style: [{ width: t.width, maxWidth: t.maxWidth, maxHeight: t.maxHeight }]
182
- }, C.value),
183
- [
184
- B(t.$slots, "header", { close: i }, () => [
185
- V(
186
- "div",
187
- {
188
- class: P(["m-dialog-header", { "--has-title": t.$slots.title || t.title }])
189
- },
190
- [
191
- t.$slots.title || t.title ? (p(), j("h2", _, [
192
- B(t.$slots, "title", {}, () => [
193
- w(
194
- T(t.title),
195
- 1
196
- /* TEXT */
197
- )
198
- ], !0)
199
- ])) : S("v-if", !0),
200
- !t.noClose && !t.persistent ? (p(), D(f(l), {
201
- key: 1,
202
- class: "m-dialog-closebtn",
203
- color: "transparent",
204
- size: "sm",
205
- icon: f(u),
206
- onClick: i
207
- }, null, 8, ["icon", "onClick"])) : S("v-if", !0)
208
- ],
209
- 2
210
- /* CLASS */
211
- )
212
- ], !0),
213
- V("div", ee, [
214
- B(t.$slots, "default", { close: i }, void 0, !0)
215
- ]),
216
- t.$slots.footer ? (p(), j("div", te, [
217
- B(t.$slots, "footer", { close: i }, void 0, !0)
218
- ])) : S("v-if", !0)
219
- ],
220
- 16
221
- /* FULL_PROPS */
222
- )
223
- ]),
224
- _: 3
225
- /* FORWARDED */
226
- }, 16, ["persistent", "model-value"]));
227
- }
228
- }), ae = (r, s) => {
229
- const o = r.__vccOpts || r;
230
- for (const [l, u] of s)
231
- o[l] = u;
232
- return o;
233
- }, ne = /* @__PURE__ */ ae(oe, [["__scopeId", "data-v-50775b17"]]), z = {
234
- cancelText: "Cancel",
235
- confirmText: "Confirm",
236
- cancelButton: {
237
- text: "Cancel",
238
- color: "danger"
239
- },
240
- confirmButton: {
241
- text: "Confirm",
242
- color: "success"
243
- }
244
- }, se = L(z), O = L([]);
245
- function le(r, s) {
246
- return new Promise((o, l) => {
247
- O.value = [
248
- ...O.value,
249
- {
250
- id: r,
251
- isActive: !0,
252
- resolve: async (u) => {
253
- o(u), await (s == null ? void 0 : s());
254
- },
255
- reject: async (u) => {
256
- l(u), await (s == null ? void 0 : s());
257
- }
258
- }
259
- ];
260
- });
261
- }
262
- function I(r) {
263
- return O.value = O.value.filter(({ id: s }) => s !== r), O.value;
264
- }
265
- function H(r, s, o) {
266
- var l;
267
- s && ((l = s[r]) == null || l.call(s, o), s.isActive = !1, setTimeout(() => {
268
- I(s.id);
269
- }, 500));
270
- }
271
- function re() {
272
- return {
273
- data: se,
274
- dialogState: O,
275
- showDialogAndWaitChoice: le,
276
- removeDialogFromState: I,
277
- rejectDialog: async (r, s = new Error("cancel"), o) => (await (o == null ? void 0 : o()), H("reject", r, s)),
278
- resolveDialog: async (r, s = "accept", o) => (await (o == null ? void 0 : o()), H("resolve", r, s))
279
- };
280
- }
281
- const ie = { class: "maz-flex maz-items-center maz-gap-2" }, ue = /* @__PURE__ */ K({
282
- __name: "MazDialogPromise",
283
- props: {
284
- data: { default: void 0 },
285
- message: { default: void 0 },
286
- identifier: { default: void 0 },
287
- buttons: { default: void 0 },
288
- modelValue: { type: Boolean },
289
- title: {},
290
- noClose: { type: Boolean },
291
- width: {},
292
- maxWidth: {},
293
- maxHeight: {},
294
- scrollable: { type: Boolean },
295
- persistent: { type: Boolean },
296
- teleportSelector: {},
297
- beforeClose: {},
298
- noCloseOnEscKey: { type: Boolean },
299
- transitionName: {},
300
- backdropClass: {},
301
- backdropContentClass: {},
302
- cancelText: {},
303
- cancelButton: { type: [Boolean, Object] },
304
- confirmText: {},
305
- confirmButton: { type: [Boolean, Object] }
306
- },
307
- emits: ["open", "close"],
308
- setup(r, { expose: s }) {
309
- const o = r, l = x(() => import("./MazBtn-BQwIuO_Q.mjs")), { dialogState: u, rejectDialog: v, resolveDialog: y, data: c } = re(), C = $(() => {
310
- var e;
311
- return o.buttons ?? ((e = o.data) == null ? void 0 : e.buttons) ?? c.value.buttons;
312
- }), t = $(() => ({
313
- ...z,
314
- ...c.value,
315
- ...o.data
316
- })), d = $(() => {
317
- var k, a, b, E;
318
- if (!(((k = c.value) == null ? void 0 : k.cancelButton) ?? ((a = o.data) == null ? void 0 : a.cancelButton) ?? z.cancelButton))
319
- return;
320
- const n = {
321
- ...z.cancelButton,
322
- ...(b = c.value) == null ? void 0 : b.cancelButton,
323
- ...(E = o.data) == null ? void 0 : E.cancelButton
324
- };
325
- return {
326
- ...n,
327
- text: o.cancelText || t.value.cancelText || n.text
328
- };
329
- }), i = $(() => {
330
- var k, a, b, E;
331
- if (!(((k = c.value) == null ? void 0 : k.confirmButton) ?? ((a = o.data) == null ? void 0 : a.confirmButton) ?? z.confirmButton))
332
- return;
333
- const n = {
334
- ...z.confirmButton,
335
- ...(b = c.value) == null ? void 0 : b.confirmButton,
336
- ...(E = o.data) == null ? void 0 : E.confirmButton
337
- };
338
- return {
339
- ...n,
340
- text: o.confirmText || t.value.confirmText || n.text
341
- };
342
- }), m = $(
343
- () => u.value.find(({ id: e }) => e === o.identifier)
344
- ), A = L();
345
- s({
346
- close: () => {
347
- var e, n;
348
- return (n = (e = A.value) == null ? void 0 : e.close) == null ? void 0 : n.call(e);
349
- }
350
- });
351
- function N(e) {
352
- return "type" in e && (e.type === "resolve" || e.type === "reject");
353
- }
354
- function M(e, n) {
355
- return N(n) ? n.type === "resolve" ? y(e, n.response) : v(e, n.response) : y(e, void 0, n.action);
356
- }
357
- return (e, n) => {
358
- var k;
359
- return p(), D(ne, h({
360
- ref_key: "dialog",
361
- ref: A
362
- }, { ...e.$attrs, ...o }, {
363
- "model-value": ((k = m.value) == null ? void 0 : k.isActive) ?? e.modelValue ?? !1,
364
- onClose: n[2] || (n[2] = (a) => e.$emit("close", a)),
365
- onOpen: n[3] || (n[3] = (a) => e.$emit("open", a)),
366
- "onUpdate:modelValue": n[4] || (n[4] = (a) => f(v)(m.value))
367
- }), {
368
- title: g(() => [
369
- B(e.$slots, "title", {}, () => {
370
- var a;
371
- return [
372
- w(
373
- T(e.title || ((a = t.value) == null ? void 0 : a.title)),
374
- 1
375
- /* TEXT */
376
- )
377
- ];
378
- })
379
- ]),
380
- default: g(() => [
381
- B(e.$slots, "default", {
382
- resolve: (a) => f(y)(m.value, a),
383
- reject: (a) => f(v)(m.value, a)
384
- }, () => {
385
- var a;
386
- return [
387
- w(
388
- T(e.message || ((a = t.value) == null ? void 0 : a.message)),
389
- 1
390
- /* TEXT */
391
- )
392
- ];
393
- })
394
- ]),
395
- footer: g(() => [
396
- B(e.$slots, "footer-button", {
397
- resolve: (a) => f(y)(m.value, a),
398
- reject: (a) => f(v)(m.value, a)
399
- }, () => [
400
- V("div", ie, [
401
- C.value ? (p(!0), j(
402
- W,
403
- { key: 0 },
404
- Y(C.value, (a, b) => (p(), D(f(l), h({
405
- key: b,
406
- ref_for: !0
407
- }, {
408
- ...a,
409
- type: "button"
410
- }, {
411
- onClick: (E) => M(m.value, a)
412
- }), {
413
- default: g(() => [
414
- w(
415
- T(a.text),
416
- 1
417
- /* TEXT */
418
- )
419
- ]),
420
- _: 2
421
- /* DYNAMIC */
422
- }, 1040, ["onClick"]))),
423
- 128
424
- /* KEYED_FRAGMENT */
425
- )) : (p(), j(
426
- W,
427
- { key: 1 },
428
- [
429
- d.value ? (p(), D(
430
- f(l),
431
- h({ key: 0 }, d.value, {
432
- onClick: n[0] || (n[0] = (a) => f(v)(m.value))
433
- }),
434
- {
435
- default: g(() => [
436
- B(e.$slots, "cancel-text", {}, () => [
437
- w(
438
- T(d.value.text),
439
- 1
440
- /* TEXT */
441
- )
442
- ])
443
- ]),
444
- _: 3
445
- /* FORWARDED */
446
- },
447
- 16
448
- /* FULL_PROPS */
449
- )) : S("v-if", !0),
450
- i.value ? (p(), D(
451
- f(l),
452
- h({ key: 1 }, i.value, {
453
- onClick: n[1] || (n[1] = (a) => f(y)(m.value))
454
- }),
455
- {
456
- default: g(() => [
457
- B(e.$slots, "confirm-text", {}, () => [
458
- w(
459
- T(i.value.text),
460
- 1
461
- /* TEXT */
462
- )
463
- ])
464
- ]),
465
- _: 3
466
- /* FORWARDED */
467
- },
468
- 16
469
- /* FULL_PROPS */
470
- )) : S("v-if", !0)
471
- ],
472
- 64
473
- /* STABLE_FRAGMENT */
474
- ))
475
- ])
476
- ])
477
- ]),
478
- _: 3
479
- /* FORWARDED */
480
- }, 16, ["model-value"]);
481
- };
482
- }
483
- });
484
- export {
485
- ae as _,
486
- ue as a,
487
- re as u
488
- };