maz-ui 3.47.2-beta.0 → 3.47.2-beta.3

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 (145) hide show
  1. package/components/MazAccordion.mjs +36 -37
  2. package/components/MazAnimatedCounter.mjs +14 -16
  3. package/components/MazBottomSheet.mjs +1 -1
  4. package/components/MazBtn.mjs +1 -1
  5. package/components/MazCard.mjs +1 -1
  6. package/components/MazCarousel.mjs +1 -1
  7. package/components/MazChart.mjs +23 -32
  8. package/components/MazChecklist.mjs +1 -1
  9. package/components/MazCircularProgressBar.mjs +66 -71
  10. package/components/MazDialog.mjs +1 -1
  11. package/components/MazDialogPromise.mjs +1 -1
  12. package/components/MazDrawer.mjs +1 -1
  13. package/components/MazDropdown.mjs +162 -185
  14. package/components/MazExpandAnimation.mjs +20 -21
  15. package/components/MazGallery.mjs +1 -1
  16. package/components/MazInput.mjs +1 -1
  17. package/components/MazInputCode.mjs +30 -31
  18. package/components/MazInputNumber.mjs +1 -1
  19. package/components/MazInputPrice.mjs +1 -1
  20. package/components/MazInputTags.mjs +1 -1
  21. package/components/MazLink.mjs +18 -30
  22. package/components/MazPagination.mjs +1 -1
  23. package/components/MazPhoneNumberInput.mjs +1 -1
  24. package/components/MazPicker.mjs +1 -1
  25. package/components/MazRadio.mjs +37 -42
  26. package/components/MazRadioButtons.mjs +61 -66
  27. package/components/MazSelect.mjs +1 -1
  28. package/components/MazSlider.mjs +107 -116
  29. package/components/MazStepper.mjs +1 -1
  30. package/components/MazSwitch.mjs +24 -28
  31. package/components/MazTable.d.ts +6 -6
  32. package/components/MazTable.mjs +1 -1
  33. package/components/MazTabsBar.mjs +1 -1
  34. package/components/MazTextarea.mjs +32 -34
  35. package/components/assets/MazLink.css +1 -1
  36. package/components/assets/MazTable.css +1 -1
  37. package/components/chunks/{MazBadge-CvIiiTdM.mjs → MazBadge-CqppWg2j.mjs} +1 -1
  38. package/components/chunks/{MazBottomSheet-DqK0EOsq.mjs → MazBottomSheet-CGRvZmGd.mjs} +28 -29
  39. package/{modules/chunks/MazBtn-BSnVxud6.mjs → components/chunks/MazBtn-2VKM1wZu.mjs} +37 -49
  40. package/components/chunks/{MazBtn-DVkwISlp.mjs → MazBtn-40lm8-AL.mjs} +37 -49
  41. package/components/chunks/{MazBtn-DzBXfedt.mjs → MazBtn-BB1FyYWv.mjs} +35 -44
  42. package/components/chunks/{MazBtn-BO3G90L3.mjs → MazBtn-BMYXMZuX.mjs} +37 -49
  43. package/components/chunks/{MazBtn-DJOUeES7.mjs → MazBtn-BijEMn4r.mjs} +37 -49
  44. package/components/chunks/MazBtn-BmrcK2af.mjs +106 -0
  45. package/components/chunks/MazBtn-C72_1uvu.mjs +106 -0
  46. package/components/chunks/MazBtn-CWloP6MI.mjs +111 -0
  47. package/components/chunks/MazBtn-CcyV4DCc.mjs +106 -0
  48. package/components/chunks/MazBtn-DENEMy-c.mjs +106 -0
  49. package/components/chunks/MazBtn-DfqRZvbB.mjs +106 -0
  50. package/components/chunks/MazBtn-UnZQuu6P.mjs +106 -0
  51. package/components/chunks/MazBtn-cDJlUVVY.mjs +106 -0
  52. package/components/chunks/MazBtn-hUslV7wO.mjs +106 -0
  53. package/components/chunks/{MazCard-FSXmHyhj.mjs → MazCard-BYB8y1_u.mjs} +18 -19
  54. package/components/chunks/{MazCarousel-BEl86YGW.mjs → MazCarousel-DccWVW8H.mjs} +20 -21
  55. package/components/chunks/{MazCheckbox-2G4VkxDz.mjs → MazCheckbox-B22OcHt8.mjs} +1 -1
  56. package/components/chunks/{MazCheckbox-Cq9gpTEw.mjs → MazCheckbox-DMogZVHl.mjs} +1 -1
  57. package/components/chunks/{MazCheckbox-BmnqBHaY.mjs → MazCheckbox-Db6sPUbV.mjs} +1 -1
  58. package/components/chunks/{MazChecklist-CY1Cv70T.mjs → MazChecklist-C95Y4Hb-.mjs} +112 -118
  59. package/components/chunks/{MazDialog-CPgFpAlq.mjs → MazDialog-khofH-7I.mjs} +66 -81
  60. package/components/chunks/MazDialogPromise-ZRA2ZrO4.mjs +488 -0
  61. package/components/chunks/{MazExpandAnimation-Bkw_wFTi.mjs → MazExpandAnimation-MDimlZGj.mjs} +7 -8
  62. package/components/chunks/{MazGallery-BknvUeo1.mjs → MazGallery-CXQiXWFr.mjs} +32 -33
  63. package/components/chunks/{MazGallery-CZOokGAt.mjs → MazGallery-VTZUhBKC.mjs} +33 -34
  64. package/components/chunks/{MazIcon-z-jTiuyI.mjs → MazIcon-BF5TFzse.mjs} +1 -1
  65. package/components/chunks/{MazInput-oOA7gdLO.mjs → MazInput-DC3S-CVu.mjs} +44 -53
  66. package/components/chunks/{MazInput-BQoQSRyL.mjs → MazInput-DzWkS-g8.mjs} +40 -49
  67. package/components/chunks/{MazInput-CJQB68c-.mjs → MazInput-NE6H-10w.mjs} +42 -51
  68. package/components/chunks/{MazInputNumber-B4mQJcVB.mjs → MazInputNumber-DRXQXHRv.mjs} +168 -189
  69. package/components/chunks/{MazInputPrice-BrxE5WVf.mjs → MazInputPrice-DoTnDDIN.mjs} +49 -58
  70. package/components/chunks/{MazInputTags-BVCej_gW.mjs → MazInputTags-Dj3sW-e5.mjs} +181 -202
  71. package/components/chunks/{MazLink-Dl9ePCGm.mjs → MazLink-C_3Wya94.mjs} +19 -31
  72. package/components/chunks/{MazLoadingBar-Dwf55oHy.mjs → MazLoadingBar-DdjHRC7g.mjs} +1 -1
  73. package/components/chunks/MazPagination-BkT4_LLW.mjs +330 -0
  74. package/components/chunks/{MazPhoneNumberInput-Cd25AzXc.mjs → MazPhoneNumberInput-BbssOUzo.mjs} +500 -544
  75. package/components/chunks/{MazPicker-C78yxilJ.mjs → MazPicker-DwWiIYAR.mjs} +243 -264
  76. package/components/chunks/{MazPickerMonthSwitcher-CyHYx8TT.mjs → MazPickerMonthSwitcher-CmFFQoPA.mjs} +1 -1
  77. package/components/chunks/{MazPickerShortcuts-Bsi8cnox.mjs → MazPickerShortcuts-DaELz7aq.mjs} +1 -1
  78. package/components/chunks/{MazPickerYearSwitcher-DLUSMAtz.mjs → MazPickerYearSwitcher-m1_KXnpA.mjs} +1 -1
  79. package/components/chunks/{MazSelect-CQDoUpgp.mjs → MazSelect-BJ07NVXQ.mjs} +149 -170
  80. package/components/chunks/{MazSelect-uCJPMXF-.mjs → MazSelect-CDV9Fx6m.mjs} +124 -136
  81. package/components/chunks/{MazSpinner-Bvb-lKER.mjs → MazSpinner-Bb3f2t6w.mjs} +1 -1
  82. package/components/chunks/{MazSpinner-Cqp-BMvL.mjs → MazSpinner-BcB0szZB.mjs} +1 -1
  83. package/components/chunks/{MazSpinner-BT_717pD.mjs → MazSpinner-BpkPcfCt.mjs} +1 -1
  84. package/components/chunks/{MazSpinner-CAbYLlEZ.mjs → MazSpinner-BsYJDmi9.mjs} +1 -1
  85. package/components/chunks/{MazSpinner-B9OwpEP_.mjs → MazSpinner-BymqEMBk.mjs} +1 -1
  86. package/components/chunks/MazSpinner-C-64WJje.mjs +34 -0
  87. package/components/chunks/MazSpinner-CEFbkZkM.mjs +34 -0
  88. package/components/chunks/{MazSpinner-EFo8dM46.mjs → MazSpinner-CfiIXW8y.mjs} +1 -1
  89. package/components/chunks/MazSpinner-CykRbNHD.mjs +34 -0
  90. package/components/chunks/{MazSpinner-C-z3-68w.mjs → MazSpinner-D3-pqOh3.mjs} +1 -1
  91. package/components/chunks/MazSpinner-DS58mtzm.mjs +34 -0
  92. package/components/chunks/{MazSpinner-2D0ZmAQz.mjs → MazSpinner-DmiLBQgR.mjs} +1 -1
  93. package/components/chunks/{MazSpinner-C1Ip-Dwh.mjs → MazSpinner-Dmkr_r9u.mjs} +1 -1
  94. package/components/chunks/MazSpinner-DoRGA1RI.mjs +34 -0
  95. package/components/chunks/MazSpinner-eC03bFP5.mjs +34 -0
  96. package/components/chunks/{MazSpinner-Cb3_S0zT.mjs → MazSpinner-edxn0ncQ.mjs} +1 -1
  97. package/components/chunks/MazSpinner-f2Mc2eRO.mjs +34 -0
  98. package/components/chunks/MazSpinner-n4Dp5ZsH.mjs +34 -0
  99. package/components/chunks/MazStepper-BREfkpUb.mjs +213 -0
  100. package/components/chunks/{MazTable-Cuz5QI08.mjs → MazTable-BJDPdIJB.mjs} +183 -227
  101. package/components/chunks/{MazTableCell-D_OTOJiy.mjs → MazTableCell-DILuUCTe.mjs} +1 -1
  102. package/components/chunks/{MazTableRow-BTcVAyOy.mjs → MazTableRow-D6H6-c8J.mjs} +1 -1
  103. package/components/chunks/{MazTableTitle-BDA9G6Zw.mjs → MazTableTitle-Ch-nyY1E.mjs} +1 -1
  104. package/components/chunks/MazTabsBar-CM-w7V97.mjs +193 -0
  105. package/components/chunks/{MazTransitionExpand-C-FHhOGB.mjs → MazTransitionExpand-PmUDa51_.mjs} +1 -1
  106. package/modules/chunks/MazBtn-QVmZ90t5.mjs +106 -0
  107. package/modules/chunks/MazBtn-R7z-Hxp-.cjs +1 -0
  108. package/modules/chunks/{MazIcon-dhyR9Q8a.cjs → MazIcon-CKCoY05P.cjs} +1 -1
  109. package/modules/chunks/{MazIcon-DllGg8tw.mjs → MazIcon-DJfEPmBG.mjs} +1 -1
  110. package/modules/chunks/{MazSpinner-bdGjxsu6.mjs → MazSpinner-C95OqwKl.mjs} +1 -1
  111. package/modules/chunks/{MazSpinner-CiIyZ8gs.cjs → MazSpinner-DYT43E6e.cjs} +1 -1
  112. package/modules/chunks/{index-x2F1l5sr.mjs → index-CjsYU5rv.mjs} +191 -226
  113. package/modules/chunks/{index-BPqjUr5e.cjs → index-oVi9-l4o.cjs} +2 -27
  114. package/modules/index.cjs +1 -1
  115. package/modules/index.mjs +1 -1
  116. package/nuxt/index.json +1 -1
  117. package/package.json +1 -1
  118. package/types/components/MazTable.vue.d.ts +6 -6
  119. package/types/modules/composables/useFormValidator/types.d.ts +5 -1
  120. package/types/modules/composables/useFormValidator/useFormField.d.ts +3 -3
  121. package/types/modules/composables/useFormValidator/useFormValidator.d.ts +2 -2
  122. package/types/modules/composables/useFormValidator/utils.d.ts +12 -12
  123. package/components/chunks/MazBtn-BRUaoP8j.mjs +0 -126
  124. package/components/chunks/MazBtn-BhnOApJu.mjs +0 -118
  125. package/components/chunks/MazBtn-C28vKP_v.mjs +0 -118
  126. package/components/chunks/MazBtn-C87UEsVs.mjs +0 -118
  127. package/components/chunks/MazBtn-C_l3xuAh.mjs +0 -118
  128. package/components/chunks/MazBtn-CweCwE_4.mjs +0 -118
  129. package/components/chunks/MazBtn-D7IKoL2c.mjs +0 -118
  130. package/components/chunks/MazBtn-DadFupkY.mjs +0 -118
  131. package/components/chunks/MazBtn-GGcGrIH4.mjs +0 -118
  132. package/components/chunks/MazBtn-Mu18egu5.mjs +0 -118
  133. package/components/chunks/MazDialogPromise-BCCdkrea.mjs +0 -522
  134. package/components/chunks/MazPagination-CHTMRRqE.mjs +0 -362
  135. package/components/chunks/MazSpinner-C23CZ_Za.mjs +0 -34
  136. package/components/chunks/MazSpinner-CViChjTw.mjs +0 -34
  137. package/components/chunks/MazSpinner-CZMBhCOJ.mjs +0 -34
  138. package/components/chunks/MazSpinner-D4C84xZe.mjs +0 -34
  139. package/components/chunks/MazSpinner-Dyf9yb51.mjs +0 -34
  140. package/components/chunks/MazSpinner-QHjOczon.mjs +0 -34
  141. package/components/chunks/MazSpinner-u8WQTgUR.mjs +0 -34
  142. package/components/chunks/MazSpinner-w-S5uCxg.mjs +0 -34
  143. package/components/chunks/MazStepper-DRWtYHZR.mjs +0 -232
  144. package/components/chunks/MazTabsBar-JkRzMDM6.mjs +0 -203
  145. package/modules/chunks/MazBtn-Bf9Cq5M7.cjs +0 -9
@@ -1,118 +0,0 @@
1
- import { defineComponent as M, defineAsyncComponent as v, useAttrs as w, useSlots as E, computed as o, openBlock as l, createBlock as a, resolveDynamicComponent as r, normalizeClass as s, withCtx as O, createCommentVNode as t, renderSlot as u, unref as d, createElementBlock as R, createVNode as A } from "vue";
2
- import { _ as D } from "./MazBottomSheet-DqK0EOsq.mjs";
3
- import '../assets/MazBtn.css';const L = {
4
- key: 2,
5
- class: "m-btn-loader-container"
6
- }, N = /* @__PURE__ */ M({
7
- __name: "MazBtn",
8
- props: {
9
- variant: { default: "button" },
10
- size: { default: "md" },
11
- color: { default: "primary" },
12
- type: { default: "button" },
13
- rounded: { type: Boolean },
14
- roundedSize: { default: "lg" },
15
- noRounded: { type: Boolean },
16
- outline: { type: Boolean },
17
- pastel: { type: Boolean },
18
- block: { type: Boolean },
19
- noUnderline: { type: Boolean },
20
- loading: { type: Boolean },
21
- disabled: { type: Boolean },
22
- fab: { type: Boolean },
23
- icon: { type: [String, Function, Object], default: void 0 },
24
- leftIcon: { type: [String, Function, Object], default: void 0 },
25
- rightIcon: { type: [String, Function, Object], default: void 0 },
26
- noPadding: { type: Boolean },
27
- noElevation: { type: Boolean },
28
- justify: { default: "center" }
29
- },
30
- setup(b) {
31
- const n = b, z = v(() => import("./MazSpinner-Dyf9yb51.mjs")), c = v(() => import("./MazIcon-BbvBov5G.mjs")), { href: h, to: g } = w(), f = E(), y = o(() => h ? "a" : g ? "router-link" : "button"), j = o(
32
- () => n.pastel ? `--${n.color}-pastel` : n.outline ? `--${n.color}-outline` : `--${n.color}`
33
- ), p = o(
34
- () => (n.loading || n.disabled) && y.value === "button"
35
- ), I = o(() => p.value ? "--cursor-default" : "--cursor-pointer"), k = o(() => `--is-${n.variant}`), B = o(() => n.loading && n.variant === "button"), C = o(() => !!f["left-icon"] || n.leftIcon), m = o(() => !!f["right-icon"] || n.rightIcon), S = o(() => C.value || m.value), $ = o(() => n.icon || !!f.icon), T = o(() => y.value === "button" ? n.type : void 0), i = o(() => n.size === "xl" ? "maz-text-3xl" : n.size === "lg" ? "maz-text-2xl" : n.size === "md" ? "maz-text-xl" : n.size === "sm" ? "maz-text-lg" : n.size === "xs" ? "maz-text-base" : n.size === "mini" ? "maz-text-sm" : "md"), F = o(() => n.justify === "start" ? "maz-justify-start" : n.justify === "end" ? "maz-justify-end" : n.justify === "center" ? "maz-justify-center" : n.justify === "between" ? "maz-justify-between" : n.justify === "around" ? "maz-justify-around" : n.justify === "evenly" ? "maz-justify-evenly" : "maz-justify-center");
36
- return (e, P) => (l(), a(r(y.value), {
37
- disabled: p.value || void 0,
38
- class: s(["m-btn", [
39
- `--${e.size}`,
40
- !e.fab && !e.rounded && e.roundedSize && `--rounded-${e.roundedSize}`,
41
- j.value,
42
- I.value,
43
- k.value,
44
- F.value,
45
- {
46
- "--block": e.block,
47
- "--no-underline": e.noUnderline,
48
- "--fab": e.fab,
49
- "--loading": e.loading,
50
- "--disabled": p.value,
51
- "--icon": S.value,
52
- "--rounded": e.rounded,
53
- "--no-rounded": e.noRounded,
54
- "--no-padding": e.noPadding,
55
- "--no-elevation": e.noElevation
56
- }
57
- ]]),
58
- type: T.value
59
- }, {
60
- default: O(() => [
61
- t(`
62
- @slot left-icon - The icon to display on the left of the button
63
- `),
64
- u(e.$slots, "left-icon", {}, () => [
65
- typeof e.leftIcon == "string" ? (l(), a(d(c), {
66
- key: 0,
67
- name: e.leftIcon,
68
- class: s([i.value])
69
- }, null, 8, ["name", "class"])) : e.leftIcon ? (l(), a(r(e.leftIcon), {
70
- key: 1,
71
- class: s([i.value])
72
- }, null, 8, ["class"])) : t("v-if", !0)
73
- ], !0),
74
- t(`
75
- @slot icon - The icon to display on the fab button
76
- `),
77
- $.value ? u(e.$slots, "icon", { key: 0 }, () => [
78
- typeof e.icon == "string" ? (l(), a(d(c), {
79
- key: 0,
80
- name: e.icon,
81
- class: s([i.value])
82
- }, null, 8, ["name", "class"])) : e.icon ? (l(), a(r(e.icon), {
83
- key: 1,
84
- class: s([i.value])
85
- }, null, 8, ["class"])) : t("v-if", !0)
86
- ], !0) : t("v-if", !0),
87
- t(`
88
- @slot default - The content of the button
89
- `),
90
- u(e.$slots, "default", {}, void 0, !0),
91
- t(`
92
- @slot left-icon - The icon to display on the left of the button
93
- `),
94
- m.value ? u(e.$slots, "right-icon", { key: 1 }, () => [
95
- typeof e.rightIcon == "string" ? (l(), a(d(c), {
96
- key: 0,
97
- name: e.rightIcon,
98
- class: s([i.value])
99
- }, null, 8, ["name", "class"])) : e.rightIcon ? (l(), a(r(e.rightIcon), {
100
- key: 1,
101
- class: s([i.value])
102
- }, null, 8, ["class"])) : t("v-if", !0)
103
- ], !0) : t("v-if", !0),
104
- B.value ? (l(), R("div", L, [
105
- A(d(z), {
106
- size: "2em",
107
- color: e.color
108
- }, null, 8, ["color"])
109
- ])) : t("v-if", !0)
110
- ]),
111
- _: 3
112
- /* FORWARDED */
113
- }, 8, ["disabled", "class", "type"]));
114
- }
115
- }), q = /* @__PURE__ */ D(N, [["__scopeId", "data-v-d3a1ed01"]]);
116
- export {
117
- q as default
118
- };
@@ -1,522 +0,0 @@
1
- import { defineComponent as x, ref as O, onMounted as U, watch as q, openBlock as v, createBlock as h, Teleport as X, createVNode as G, Transition as J, withCtx as k, createElementBlock as S, normalizeClass as L, createElementVNode as j, withModifiers as Q, mergeProps as A, renderSlot as C, createCommentVNode as d, defineAsyncComponent as N, useAttrs as R, computed as D, createTextVNode as T, toDisplayString as z, unref as p, Fragment as H, renderList as Y } from "vue";
2
- import '../assets/MazDialogPromise.css';const K = "--backdrop-present", Z = /* @__PURE__ */ x({
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(i, { expose: s, emit: l }) {
17
- const a = i, c = l;
18
- function y() {
19
- document.documentElement.classList.add(K);
20
- }
21
- async function B() {
22
- document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(K);
23
- }
24
- const m = O(a.modelValue);
25
- function g() {
26
- t(!1);
27
- }
28
- async function t(e) {
29
- var n;
30
- e || (c("before-close"), await ((n = a.beforeClose) == null ? void 0 : n.call(a))), m.value = e;
31
- }
32
- function u() {
33
- c("open");
34
- }
35
- function r() {
36
- c("update:model-value", !1), c("close"), P();
37
- }
38
- function f() {
39
- a.persistent || g();
40
- }
41
- function E(e) {
42
- !a.noCloseOnEscKey && e.key === "Escape" && !a.persistent && g();
43
- }
44
- function M() {
45
- y(), document.addEventListener("keyup", E, !1);
46
- }
47
- function P() {
48
- document.removeEventListener("keyup", E), B();
49
- }
50
- return U(() => {
51
- a.modelValue ? M() : P();
52
- }), q(
53
- () => a.modelValue,
54
- (e) => {
55
- m.value = e, e ? M() : P();
56
- }
57
- ), s({
58
- onBackdropAnimationEnter: u,
59
- onBackdropAnimationLeave: r,
60
- onBackdropClicked: f,
61
- close: g,
62
- present: m,
63
- toggleModal: t,
64
- onKeyPress: E
65
- }), (e, n) => (v(), h(X, { to: e.teleportSelector }, [
66
- G(J, {
67
- appear: "",
68
- name: e.transitionName,
69
- onAfterEnter: u,
70
- onAfterLeave: r
71
- }, {
72
- default: k(() => [
73
- m.value ? (v(), S(
74
- "div",
75
- {
76
- key: 0,
77
- class: L(["m-backdrop --present", [e.backdropClass]]),
78
- tabindex: "-1",
79
- role: "dialog"
80
- },
81
- [
82
- j(
83
- "button",
84
- {
85
- class: L(["m-backdrop-overlay", { "--disabled": e.persistent }]),
86
- tabindex: "-1",
87
- onClick: Q(f, ["self"])
88
- },
89
- null,
90
- 2
91
- /* CLASS */
92
- ),
93
- j(
94
- "div",
95
- A({
96
- class: ["m-backdrop-content", e.backdropContentClass]
97
- }, e.$attrs, {
98
- role: "document",
99
- tabindex: "0"
100
- }),
101
- [
102
- C(e.$slots, "default", { close: g })
103
- ],
104
- 16
105
- /* FULL_PROPS */
106
- )
107
- ],
108
- 2
109
- /* CLASS */
110
- )) : d("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__ */ x({
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(i, { expose: s }) {
147
- const l = i, a = N(() => import("./MazBtn-D7IKoL2c.mjs")), c = N(() => import("./x-mark-CnZwVvA7.mjs")), y = R(), B = O();
148
- s({
149
- close: () => {
150
- var t, u;
151
- return (u = (t = B.value) == null ? void 0 : t.close) == null ? void 0 : u.call(t);
152
- }
153
- });
154
- const m = D(() => ({
155
- ...y,
156
- class: void 0,
157
- style: void 0
158
- })), g = D(() => ({
159
- class: y.class,
160
- style: y.style
161
- }));
162
- return (t, u) => (v(), h(Z, A({ ...m.value, ...l }, {
163
- ref_key: "backdrop",
164
- ref: B,
165
- persistent: t.persistent,
166
- "model-value": t.modelValue,
167
- "transition-name": "modal-anim",
168
- "aria-labelledby": "dialogTitle",
169
- "aria-describedby": "dialogDesc",
170
- onClose: u[0] || (u[0] = (r) => t.$emit("close", r)),
171
- onOpen: u[1] || (u[1] = (r) => t.$emit("open", r)),
172
- "onUpdate:modelValue": u[2] || (u[2] = (r) => t.$emit("update:model-value", r))
173
- }), {
174
- default: k(({ close: r }) => [
175
- j(
176
- "div",
177
- A({
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
- }, g.value),
183
- [
184
- d(`
185
- @slot Header slot
186
- @binding {Function} close close function
187
- `),
188
- C(t.$slots, "header", { close: r }, () => [
189
- j(
190
- "div",
191
- {
192
- class: L(["m-dialog-header", { "--has-title": t.$slots.title || t.title }])
193
- },
194
- [
195
- t.$slots.title || t.title ? (v(), S("h2", _, [
196
- d(`
197
- @slot Title slot in the header
198
- `),
199
- C(t.$slots, "title", {}, () => [
200
- T(
201
- z(t.title),
202
- 1
203
- /* TEXT */
204
- )
205
- ], !0)
206
- ])) : d("v-if", !0),
207
- !t.noClose && !t.persistent ? (v(), h(p(a), {
208
- key: 1,
209
- class: "m-dialog-closebtn",
210
- color: "transparent",
211
- size: "sm",
212
- icon: p(c),
213
- onClick: r
214
- }, null, 8, ["icon", "onClick"])) : d("v-if", !0)
215
- ],
216
- 2
217
- /* CLASS */
218
- )
219
- ], !0),
220
- j("div", ee, [
221
- d(`
222
- @slot Default content
223
- @binding {Function} close close function
224
- `),
225
- C(t.$slots, "default", { close: r }, void 0, !0)
226
- ]),
227
- t.$slots.footer ? (v(), S("div", te, [
228
- d(`
229
- @slot Footer slot
230
- @binding {Function} close close function
231
- `),
232
- C(t.$slots, "footer", { close: r }, void 0, !0)
233
- ])) : d("v-if", !0)
234
- ],
235
- 16
236
- /* FULL_PROPS */
237
- )
238
- ]),
239
- _: 3
240
- /* FORWARDED */
241
- }, 16, ["persistent", "model-value"]));
242
- }
243
- }), ne = (i, s) => {
244
- const l = i.__vccOpts || i;
245
- for (const [a, c] of s)
246
- l[a] = c;
247
- return l;
248
- }, le = /* @__PURE__ */ ne(oe, [["__scopeId", "data-v-50775b17"]]), V = {
249
- cancelText: "Cancel",
250
- confirmText: "Confirm",
251
- cancelButton: {
252
- text: "Cancel",
253
- color: "danger"
254
- },
255
- confirmButton: {
256
- text: "Confirm",
257
- color: "success"
258
- }
259
- }, se = O(V), F = O([]);
260
- function ae(i, s) {
261
- return new Promise((l, a) => {
262
- F.value = [
263
- ...F.value,
264
- {
265
- id: i,
266
- isActive: !0,
267
- resolve: async (c) => {
268
- l(c), await (s == null ? void 0 : s());
269
- },
270
- reject: async (c) => {
271
- a(c), await (s == null ? void 0 : s());
272
- }
273
- }
274
- ];
275
- });
276
- }
277
- function I(i) {
278
- return F.value = F.value.filter(({ id: s }) => s !== i), F.value;
279
- }
280
- function W(i, s, l) {
281
- var a;
282
- s && ((a = s[i]) == null || a.call(s, l), s.isActive = !1, setTimeout(() => {
283
- I(s.id);
284
- }, 500));
285
- }
286
- function ie() {
287
- return {
288
- data: se,
289
- dialogState: F,
290
- showDialogAndWaitChoice: ae,
291
- removeDialogFromState: I,
292
- rejectDialog: async (i, s = new Error("cancel"), l) => (await (l == null ? void 0 : l()), W("reject", i, s)),
293
- resolveDialog: async (i, s = "accept", l) => (await (l == null ? void 0 : l()), W("resolve", i, s))
294
- };
295
- }
296
- const re = { class: "maz-flex maz-items-center maz-gap-2" }, de = /* @__PURE__ */ x({
297
- __name: "MazDialogPromise",
298
- props: {
299
- data: { default: void 0 },
300
- message: { default: void 0 },
301
- identifier: { default: void 0 },
302
- buttons: { default: void 0 },
303
- modelValue: { type: Boolean },
304
- title: {},
305
- noClose: { type: Boolean },
306
- width: {},
307
- maxWidth: {},
308
- maxHeight: {},
309
- scrollable: { type: Boolean },
310
- persistent: { type: Boolean },
311
- teleportSelector: {},
312
- beforeClose: {},
313
- noCloseOnEscKey: { type: Boolean },
314
- transitionName: {},
315
- backdropClass: {},
316
- backdropContentClass: {},
317
- cancelText: {},
318
- cancelButton: { type: [Boolean, Object] },
319
- confirmText: {},
320
- confirmButton: { type: [Boolean, Object] }
321
- },
322
- emits: ["open", "close"],
323
- setup(i, { expose: s }) {
324
- const l = i, a = N(() => import("./MazBtn-D7IKoL2c.mjs")), { dialogState: c, rejectDialog: y, resolveDialog: B, data: m } = ie(), g = D(() => {
325
- var e;
326
- return l.buttons ?? ((e = l.data) == null ? void 0 : e.buttons) ?? m.value.buttons;
327
- }), t = D(() => ({
328
- ...V,
329
- ...m.value,
330
- ...l.data
331
- })), u = D(() => {
332
- var b, o, $, w;
333
- if (!(((b = m.value) == null ? void 0 : b.cancelButton) ?? ((o = l.data) == null ? void 0 : o.cancelButton) ?? V.cancelButton))
334
- return;
335
- const n = {
336
- ...V.cancelButton,
337
- ...($ = m.value) == null ? void 0 : $.cancelButton,
338
- ...(w = l.data) == null ? void 0 : w.cancelButton
339
- };
340
- return {
341
- ...n,
342
- text: t.value.cancelText || n.text
343
- };
344
- }), r = D(() => {
345
- var b, o, $, w;
346
- if (!(((b = m.value) == null ? void 0 : b.confirmButton) ?? ((o = l.data) == null ? void 0 : o.confirmButton) ?? V.confirmButton))
347
- return;
348
- const n = {
349
- ...V.confirmButton,
350
- ...($ = m.value) == null ? void 0 : $.confirmButton,
351
- ...(w = l.data) == null ? void 0 : w.confirmButton
352
- };
353
- return {
354
- ...n,
355
- text: t.value.confirmText || n.text
356
- };
357
- }), f = D(
358
- () => c.value.find(({ id: e }) => e === l.identifier)
359
- ), E = O();
360
- s({
361
- close: () => {
362
- var e, n;
363
- return (n = (e = E.value) == null ? void 0 : e.close) == null ? void 0 : n.call(e);
364
- }
365
- });
366
- function M(e) {
367
- return "type" in e && (e.type === "resolve" || e.type === "reject");
368
- }
369
- function P(e, n) {
370
- return M(n) ? n.type === "resolve" ? B(e, n.response) : y(e, n.response) : B(e, void 0, n.action);
371
- }
372
- return (e, n) => {
373
- var b;
374
- return v(), h(le, A({
375
- ref_key: "dialog",
376
- ref: E
377
- }, { ...e.$attrs, ...l }, {
378
- "model-value": ((b = f.value) == null ? void 0 : b.isActive) ?? e.modelValue ?? !1,
379
- onClose: n[2] || (n[2] = (o) => e.$emit("close", o)),
380
- onOpen: n[3] || (n[3] = (o) => e.$emit("open", o)),
381
- "onUpdate:modelValue": n[4] || (n[4] = (o) => p(y)(f.value))
382
- }), {
383
- title: k(() => [
384
- d(`
385
- @slot title slot - Place your title
386
- `),
387
- C(e.$slots, "title", {}, () => {
388
- var o;
389
- return [
390
- T(
391
- z(e.title || ((o = t.value) == null ? void 0 : o.title)),
392
- 1
393
- /* TEXT */
394
- )
395
- ];
396
- })
397
- ]),
398
- default: k(() => [
399
- d(`
400
- @slot Default slot - Place your content
401
- @binding {Function} resolve resolve function
402
- @binding {Function} reject reject function
403
- `),
404
- C(e.$slots, "default", {
405
- resolve: (o) => p(B)(f.value, o),
406
- reject: (o) => p(y)(f.value, o)
407
- }, () => {
408
- var o;
409
- return [
410
- T(
411
- z(e.message || ((o = t.value) == null ? void 0 : o.message)),
412
- 1
413
- /* TEXT */
414
- )
415
- ];
416
- })
417
- ]),
418
- footer: k(() => [
419
- d(`
420
- @slot Footer slot
421
- @binding {Function} resolve resolve function
422
- @binding {Function} reject reject function
423
- `),
424
- C(e.$slots, "footer-button", {
425
- resolve: (o) => p(B)(f.value, o),
426
- reject: (o) => p(y)(f.value, o)
427
- }, () => [
428
- j("div", re, [
429
- g.value ? (v(!0), S(
430
- H,
431
- { key: 0 },
432
- Y(g.value, (o, $) => (v(), h(p(a), A({
433
- key: $,
434
- ref_for: !0
435
- }, {
436
- ...o,
437
- type: "button"
438
- }, {
439
- onClick: (w) => P(f.value, o)
440
- }), {
441
- default: k(() => [
442
- T(
443
- z(o.text),
444
- 1
445
- /* TEXT */
446
- )
447
- ]),
448
- _: 2
449
- /* DYNAMIC */
450
- }, 1040, ["onClick"]))),
451
- 128
452
- /* KEYED_FRAGMENT */
453
- )) : (v(), S(
454
- H,
455
- { key: 1 },
456
- [
457
- u.value ? (v(), h(
458
- p(a),
459
- A({ key: 0 }, u.value, {
460
- onClick: n[0] || (n[0] = (o) => p(y)(f.value))
461
- }),
462
- {
463
- default: k(() => [
464
- d(`
465
- @slot cancel-text slot - Place your cancel text
466
- `),
467
- C(e.$slots, "cancel-text", {}, () => [
468
- T(
469
- z(u.value.text),
470
- 1
471
- /* TEXT */
472
- )
473
- ])
474
- ]),
475
- _: 3
476
- /* FORWARDED */
477
- },
478
- 16
479
- /* FULL_PROPS */
480
- )) : d("v-if", !0),
481
- r.value ? (v(), h(
482
- p(a),
483
- A({ key: 1 }, r.value, {
484
- onClick: n[1] || (n[1] = (o) => p(B)(f.value))
485
- }),
486
- {
487
- default: k(() => [
488
- d(`
489
- @slot confirm-text slot - Place your confirm text
490
- `),
491
- C(e.$slots, "confirm-text", {}, () => [
492
- T(
493
- z(r.value.text),
494
- 1
495
- /* TEXT */
496
- )
497
- ])
498
- ]),
499
- _: 3
500
- /* FORWARDED */
501
- },
502
- 16
503
- /* FULL_PROPS */
504
- )) : d("v-if", !0)
505
- ],
506
- 64
507
- /* STABLE_FRAGMENT */
508
- ))
509
- ])
510
- ])
511
- ]),
512
- _: 3
513
- /* FORWARDED */
514
- }, 16, ["model-value"]);
515
- };
516
- }
517
- });
518
- export {
519
- ne as _,
520
- de as a,
521
- ie as u
522
- };