maz-ui 3.22.3 → 3.23.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.
Files changed (243) hide show
  1. package/components/MazAvatar.mjs +2 -2
  2. package/components/MazBackdrop.mjs +67 -107
  3. package/components/MazBadge.mjs +41 -50
  4. package/components/MazBottomSheet.mjs +2 -2
  5. package/components/MazBtn.mjs +2 -2
  6. package/components/MazCard.mjs +2 -2
  7. package/components/MazCarousel.mjs +2 -2
  8. package/components/MazChart.mjs +53 -63
  9. package/components/MazCheckbox.mjs +84 -128
  10. package/components/MazDialog.mjs +2 -2
  11. package/components/MazDialogPromise.mjs +3 -3
  12. package/components/MazDrawer.mjs +2 -2
  13. package/components/MazDropdown.mjs +2 -2
  14. package/components/MazDropzone.mjs +2 -2
  15. package/components/MazFullscreenLoader.mjs +14 -18
  16. package/components/MazGallery.d.ts +41 -0
  17. package/components/MazGallery.mjs +370 -567
  18. package/components/MazIcon.mjs +76 -140
  19. package/components/MazInput.mjs +2 -2
  20. package/components/MazInputNumber.mjs +72 -99
  21. package/components/MazInputPrice.mjs +2 -2
  22. package/components/MazInputTags.mjs +2 -2
  23. package/components/MazLazyImg.mjs +2 -2
  24. package/components/MazPhoneNumberInput.mjs +2 -2
  25. package/components/MazPicker.mjs +2 -2
  26. package/components/MazRadio.mjs +65 -94
  27. package/components/MazRadioButtons.mjs +64 -78
  28. package/components/MazSelect.mjs +2 -2
  29. package/components/MazSlider.mjs +213 -325
  30. package/components/MazSpinner.mjs +25 -34
  31. package/components/MazStepper.mjs +2 -2
  32. package/components/MazSwitch.mjs +43 -60
  33. package/components/MazTabs.mjs +16 -25
  34. package/components/MazTabsBar.mjs +2 -2
  35. package/components/MazTabsContent.mjs +34 -43
  36. package/components/MazTabsContentItem.mjs +49 -63
  37. package/components/MazTextarea.mjs +124 -169
  38. package/components/MazTransitionExpand.mjs +36 -54
  39. package/components/assets/MazBackdrop.css +1 -1
  40. package/components/assets/MazBottomSheet.css +1 -1
  41. package/components/assets/MazDialog.css +1 -1
  42. package/components/assets/MazDialogPromise.css +1 -1
  43. package/components/assets/MazDrawer.css +1 -1
  44. package/components/assets/MazGallery.css +1 -1
  45. package/components/assets/MazPhoneNumberInput.css +1 -1
  46. package/components/assets/MazSelect.css +1 -1
  47. package/components/chunks/MazAvatar-1636f58b.mjs +126 -0
  48. package/components/chunks/MazBottomSheet-c24f92f8.mjs +217 -0
  49. package/components/chunks/MazBtn-124f3700.mjs +153 -0
  50. package/components/chunks/MazBtn-1e61862b.mjs +153 -0
  51. package/components/chunks/MazBtn-2d1d1ba5.mjs +153 -0
  52. package/components/chunks/MazBtn-3d74f737.mjs +153 -0
  53. package/components/chunks/MazBtn-4a447126.mjs +153 -0
  54. package/components/chunks/MazBtn-555928ed.mjs +153 -0
  55. package/components/chunks/MazBtn-571454f6.mjs +153 -0
  56. package/components/chunks/MazBtn-5e426592.mjs +153 -0
  57. package/components/chunks/MazBtn-6905cc39.mjs +153 -0
  58. package/components/chunks/MazBtn-6ce4cfd3.mjs +153 -0
  59. package/components/chunks/MazBtn-74656d5b.mjs +153 -0
  60. package/components/chunks/MazBtn-7706b2da.mjs +158 -0
  61. package/components/chunks/MazBtn-a7a913dd.mjs +153 -0
  62. package/components/chunks/MazBtn-ba27c61d.mjs +153 -0
  63. package/components/chunks/MazBtn-fb3c7af8.mjs +153 -0
  64. package/components/chunks/MazCard-bcc36489.mjs +214 -0
  65. package/components/chunks/MazCarousel-6da75122.mjs +107 -0
  66. package/components/chunks/MazCheckbox-040dc2c4.mjs +117 -0
  67. package/components/chunks/MazCheckbox-3a2b48b4.mjs +117 -0
  68. package/components/chunks/MazDialog-44eda544.mjs +250 -0
  69. package/components/chunks/MazDialogPromise-eec5acde.mjs +419 -0
  70. package/components/chunks/MazDrawer-b628b37e.mjs +206 -0
  71. package/components/chunks/MazDropdown-6f2248b0.mjs +345 -0
  72. package/components/chunks/MazDropzone-8cac10a6.mjs +242 -0
  73. package/components/chunks/MazGallery-6b8ecedf.mjs +617 -0
  74. package/components/chunks/MazIcon-52a76873.mjs +101 -0
  75. package/components/chunks/MazIcon-95e31ff8.mjs +96 -0
  76. package/components/chunks/MazInput-1ed4f946.mjs +283 -0
  77. package/components/chunks/MazInput-c51881ea.mjs +278 -0
  78. package/components/chunks/MazInput-e1373eaf.mjs +271 -0
  79. package/components/chunks/MazInputPrice-cd348d46.mjs +392 -0
  80. package/components/chunks/MazInputTags-aa95fae7.mjs +446 -0
  81. package/components/chunks/MazLazyImg-0412ab38.mjs +259 -0
  82. package/components/chunks/MazLazyImg-47d3449a.mjs +254 -0
  83. package/components/chunks/MazPhoneNumberInput-e1bf46f9.mjs +1216 -0
  84. package/components/chunks/MazPicker-c85774e5.mjs +1140 -0
  85. package/components/chunks/MazPickerCalendar-f5bbea58.mjs +532 -0
  86. package/components/chunks/MazPickerHeader-31a3619b.mjs +186 -0
  87. package/components/chunks/MazPickerMonthSwitcher-aaa759b9.mjs +97 -0
  88. package/components/chunks/MazPickerShortcuts-d0623e2d.mjs +74 -0
  89. package/components/chunks/MazPickerTime-de9cfc63.mjs +219 -0
  90. package/components/chunks/MazPickerYearSwitcher-746c84fc.mjs +106 -0
  91. package/components/chunks/MazSelect-6ff6bb96.mjs +652 -0
  92. package/components/chunks/MazSpinner-054f948c.mjs +39 -0
  93. package/components/chunks/MazSpinner-059ee1d2.mjs +39 -0
  94. package/components/chunks/MazSpinner-08ee440b.mjs +39 -0
  95. package/components/chunks/MazSpinner-13403729.mjs +39 -0
  96. package/components/chunks/MazSpinner-44011019.mjs +39 -0
  97. package/components/chunks/MazSpinner-452a1534.mjs +39 -0
  98. package/components/chunks/MazSpinner-4c02cfd2.mjs +39 -0
  99. package/components/chunks/MazSpinner-6d1d24d5.mjs +39 -0
  100. package/components/chunks/MazSpinner-6e7c4705.mjs +39 -0
  101. package/components/chunks/MazSpinner-7895f54f.mjs +39 -0
  102. package/components/chunks/MazSpinner-7eee202e.mjs +39 -0
  103. package/components/chunks/MazSpinner-805e14a6.mjs +39 -0
  104. package/components/chunks/MazSpinner-85080b43.mjs +39 -0
  105. package/components/chunks/MazSpinner-a13a50c9.mjs +39 -0
  106. package/components/chunks/MazSpinner-a6d61cee.mjs +43 -0
  107. package/components/chunks/MazSpinner-b065168a.mjs +39 -0
  108. package/components/chunks/MazSpinner-c67b05bb.mjs +39 -0
  109. package/components/chunks/MazSpinner-caa33afc.mjs +39 -0
  110. package/components/chunks/MazSpinner-cb8fbe9a.mjs +39 -0
  111. package/components/chunks/MazSpinner-d9ef329f.mjs +39 -0
  112. package/components/chunks/MazStepper-39f018f3.mjs +191 -0
  113. package/components/chunks/MazTabsBar-27965f16.mjs +132 -0
  114. package/components/chunks/MazTransitionExpand-55cfbecb.mjs +41 -0
  115. package/components/chunks/MazTransitionExpand-cd24498f.mjs +41 -0
  116. package/components/chunks/_plugin-vue_export-helper-dad06003.mjs +9 -0
  117. package/components/chunks/check-31d7ba2f.mjs +30 -0
  118. package/components/chunks/check-c9b483c0.mjs +30 -0
  119. package/components/chunks/{check-circle-7acfa4c4.mjs → check-circle-59c383ed.mjs} +10 -12
  120. package/components/chunks/chevron-down-2b60111a.mjs +30 -0
  121. package/components/chunks/chevron-left-39b4621e.mjs +30 -0
  122. package/components/chunks/chevron-right-949a60fa.mjs +30 -0
  123. package/components/chunks/debounce-19c516b6.mjs +11 -0
  124. package/components/chunks/examples.mobile.json-f63d22fb.mjs +4 -0
  125. package/components/chunks/{exclamation-circle-2e115536.mjs → exclamation-circle-e2620aab.mjs} +10 -12
  126. package/components/chunks/{exclamation-triangle-10eb48dc.mjs → exclamation-triangle-21bf116a.mjs} +10 -12
  127. package/components/chunks/{eye-fbb13657.mjs → eye-dc12ce09.mjs} +12 -15
  128. package/components/chunks/{eye-slash-342420ff.mjs → eye-slash-fa42a017.mjs} +10 -12
  129. package/components/chunks/{magnifying-glass-5dffa35e.mjs → magnifying-glass-908981c0.mjs} +10 -12
  130. package/components/chunks/minus-e71140e1.mjs +30 -0
  131. package/components/chunks/no-photography-4c6c77cf.mjs +4 -0
  132. package/components/chunks/{no-photography-b0d08d6f.mjs → no-photography-be94ddda.mjs} +12 -15
  133. package/components/chunks/{no-symbol-975ce547.mjs → no-symbol-87477ad0.mjs} +10 -12
  134. package/components/chunks/{pencil-2f766dc8.mjs → pencil-4c35b4e7.mjs} +10 -12
  135. package/components/chunks/plus-c20544c3.mjs +30 -0
  136. package/components/chunks/x-mark-35f2f1e7.mjs +30 -0
  137. package/components/chunks/x-mark-7761acf4.mjs +29 -0
  138. package/modules/chunks/MazBtn-82a868df.mjs +153 -0
  139. package/modules/chunks/MazIcon-169747b4.mjs +96 -0
  140. package/modules/chunks/MazSpinner-3febbfdc.mjs +39 -0
  141. package/modules/chunks/{arrow-top-right-on-square-32bbe5a1.mjs → arrow-top-right-on-square-15191934.mjs} +10 -12
  142. package/modules/chunks/chevron-left-39b4621e.mjs +30 -0
  143. package/modules/chunks/index-d9a25303.mjs +1628 -0
  144. package/modules/chunks/{link-4eb05848.mjs → link-bb14441d.mjs} +10 -12
  145. package/modules/chunks/no-photography-4c6c77cf.mjs +4 -0
  146. package/modules/chunks/x-mark-35f2f1e7.mjs +30 -0
  147. package/modules/index.mjs +45 -44
  148. package/nuxt/index.json +1 -1
  149. package/nuxt/types.d.mts +3 -2
  150. package/nuxt/types.d.ts +3 -2
  151. package/package.json +11 -7
  152. package/types/components/MazGallery.vue.d.ts +41 -0
  153. package/types/modules/index.d.ts +1 -0
  154. package/types/modules/resolvers/index.d.ts +2 -0
  155. package/components/chunks/MazAvatar-358d78d4.mjs +0 -138
  156. package/components/chunks/MazBottomSheet-61090f4a.mjs +0 -267
  157. package/components/chunks/MazBtn-0e02f0da.mjs +0 -184
  158. package/components/chunks/MazBtn-2f4fa942.mjs +0 -184
  159. package/components/chunks/MazBtn-31c6b731.mjs +0 -184
  160. package/components/chunks/MazBtn-48382169.mjs +0 -184
  161. package/components/chunks/MazBtn-4e1e116e.mjs +0 -184
  162. package/components/chunks/MazBtn-50abc4c5.mjs +0 -184
  163. package/components/chunks/MazBtn-84e12b6a.mjs +0 -184
  164. package/components/chunks/MazBtn-b42e3575.mjs +0 -184
  165. package/components/chunks/MazBtn-b56a7278.mjs +0 -184
  166. package/components/chunks/MazBtn-bbd6e9c8.mjs +0 -184
  167. package/components/chunks/MazBtn-cf0c8fcb.mjs +0 -184
  168. package/components/chunks/MazBtn-d92908b2.mjs +0 -191
  169. package/components/chunks/MazBtn-f48da79c.mjs +0 -184
  170. package/components/chunks/MazBtn-f7e94b59.mjs +0 -184
  171. package/components/chunks/MazBtn-fec4c3b7.mjs +0 -184
  172. package/components/chunks/MazCard-01b81dd2.mjs +0 -237
  173. package/components/chunks/MazCarousel-7825c7c9.mjs +0 -133
  174. package/components/chunks/MazCheckbox-ab5ddda2.mjs +0 -153
  175. package/components/chunks/MazCheckbox-e0bbe6ec.mjs +0 -153
  176. package/components/chunks/MazDialog-83e54b8c.mjs +0 -290
  177. package/components/chunks/MazDialogPromise-6967e821.mjs +0 -474
  178. package/components/chunks/MazDrawer-d778b3d2.mjs +0 -256
  179. package/components/chunks/MazDropdown-6f4482d7.mjs +0 -426
  180. package/components/chunks/MazDropzone-d1bb62dc.mjs +0 -325
  181. package/components/chunks/MazGallery-a8f6748b.mjs +0 -812
  182. package/components/chunks/MazIcon-b779da0a.mjs +0 -159
  183. package/components/chunks/MazIcon-bda198b4.mjs +0 -165
  184. package/components/chunks/MazInput-713b00d0.mjs +0 -326
  185. package/components/chunks/MazInput-b9386887.mjs +0 -341
  186. package/components/chunks/MazInput-c33627dd.mjs +0 -334
  187. package/components/chunks/MazInputPrice-452297f5.mjs +0 -481
  188. package/components/chunks/MazInputTags-7a463b81.mjs +0 -526
  189. package/components/chunks/MazLazyImg-6e395356.mjs +0 -336
  190. package/components/chunks/MazLazyImg-e0d8b6d0.mjs +0 -329
  191. package/components/chunks/MazPhoneNumberInput-48fe2445.mjs +0 -1536
  192. package/components/chunks/MazPicker-50fc11d1.mjs +0 -1352
  193. package/components/chunks/MazPickerCalendar-cacb361c.mjs +0 -689
  194. package/components/chunks/MazPickerHeader-63d45179.mjs +0 -216
  195. package/components/chunks/MazPickerMonthSwitcher-913c6e2c.mjs +0 -110
  196. package/components/chunks/MazPickerShortcuts-c6fabfc6.mjs +0 -88
  197. package/components/chunks/MazPickerTime-5e4475da.mjs +0 -301
  198. package/components/chunks/MazPickerYearSwitcher-dd4fa89c.mjs +0 -125
  199. package/components/chunks/MazSelect-2e5cd411.mjs +0 -850
  200. package/components/chunks/MazSpinner-022d7bee.mjs +0 -46
  201. package/components/chunks/MazSpinner-100c99b8.mjs +0 -46
  202. package/components/chunks/MazSpinner-191ad23b.mjs +0 -46
  203. package/components/chunks/MazSpinner-3155378b.mjs +0 -46
  204. package/components/chunks/MazSpinner-339a9006.mjs +0 -46
  205. package/components/chunks/MazSpinner-53979e96.mjs +0 -46
  206. package/components/chunks/MazSpinner-68d2f2ac.mjs +0 -46
  207. package/components/chunks/MazSpinner-6b563b22.mjs +0 -46
  208. package/components/chunks/MazSpinner-7cdc13e7.mjs +0 -46
  209. package/components/chunks/MazSpinner-8859d658.mjs +0 -46
  210. package/components/chunks/MazSpinner-8e180605.mjs +0 -52
  211. package/components/chunks/MazSpinner-98dd1f9d.mjs +0 -46
  212. package/components/chunks/MazSpinner-9950424b.mjs +0 -46
  213. package/components/chunks/MazSpinner-c8270a93.mjs +0 -46
  214. package/components/chunks/MazSpinner-cb491238.mjs +0 -46
  215. package/components/chunks/MazSpinner-cb6f99f3.mjs +0 -46
  216. package/components/chunks/MazSpinner-ce4be8f1.mjs +0 -46
  217. package/components/chunks/MazSpinner-e5a9f319.mjs +0 -46
  218. package/components/chunks/MazSpinner-e92bd359.mjs +0 -46
  219. package/components/chunks/MazSpinner-eea9056d.mjs +0 -46
  220. package/components/chunks/MazStepper-4c19dbfc.mjs +0 -255
  221. package/components/chunks/MazTabsBar-3c2e2d69.mjs +0 -157
  222. package/components/chunks/MazTransitionExpand-f293b830.mjs +0 -57
  223. package/components/chunks/MazTransitionExpand-f9e5a2d6.mjs +0 -57
  224. package/components/chunks/_plugin-vue_export-helper-cc2b3d55.mjs +0 -10
  225. package/components/chunks/check-8da249b1.mjs +0 -32
  226. package/components/chunks/check-f2fcce10.mjs +0 -32
  227. package/components/chunks/chevron-down-a78b9604.mjs +0 -32
  228. package/components/chunks/chevron-left-3365d59b.mjs +0 -32
  229. package/components/chunks/chevron-right-02f9e837.mjs +0 -32
  230. package/components/chunks/debounce-7d66ffa9.mjs +0 -12
  231. package/components/chunks/examples.mobile.json-618ba782.mjs +0 -4
  232. package/components/chunks/minus-c9cdee90.mjs +0 -32
  233. package/components/chunks/no-photography-7f2be516.mjs +0 -4
  234. package/components/chunks/plus-b1b0a5a8.mjs +0 -32
  235. package/components/chunks/x-mark-3b05101b.mjs +0 -31
  236. package/components/chunks/x-mark-c6ff45dd.mjs +0 -32
  237. package/modules/chunks/MazBtn-90ffd148.mjs +0 -184
  238. package/modules/chunks/MazIcon-988edef7.mjs +0 -159
  239. package/modules/chunks/MazSpinner-a16a3d8f.mjs +0 -46
  240. package/modules/chunks/chevron-left-3365d59b.mjs +0 -32
  241. package/modules/chunks/index-b1625fc2.mjs +0 -2315
  242. package/modules/chunks/no-photography-7f2be516.mjs +0 -4
  243. package/modules/chunks/x-mark-c6ff45dd.mjs +0 -32
@@ -0,0 +1,419 @@
1
+ import "../assets/MazDialogPromise.css";
2
+ import { ref as M, defineComponent as F, onMounted as O, watch as P, openBlock as m, createBlock as $, Teleport as N, createVNode as B, Transition as H, withCtx as p, createElementBlock as A, normalizeClass as E, createElementVNode as k, withModifiers as W, mergeProps as z, renderSlot as u, createCommentVNode as c, defineAsyncComponent as h, useAttrs as K, computed as D, createTextVNode as y, toDisplayString as g, unref as d, Fragment as j, renderList as q } from "vue";
3
+ const I = M(), C = M([]), U = (e, o) => new Promise((i, s) => {
4
+ C.value = [
5
+ ...C.value,
6
+ {
7
+ id: e,
8
+ isActive: !0,
9
+ resolve: async () => {
10
+ await (o == null ? void 0 : o()), i(!0);
11
+ },
12
+ reject: s
13
+ }
14
+ ];
15
+ }), L = (e) => (C.value = C.value.filter(({ id: o }) => o !== e), C.value), w = (e, o, i = !1) => {
16
+ var s;
17
+ o && ((s = o[e]) == null || s.call(o, i), o.isActive = !1, setTimeout(() => {
18
+ L(o.id);
19
+ }, 500));
20
+ }, X = () => ({
21
+ confirmDialogData: I,
22
+ dialogState: C,
23
+ showDialogAndWaitChoice: U,
24
+ removeDialogFromState: L,
25
+ rejectDialog: (e, o = !1) => w("reject", e, o),
26
+ resolveDialog: (e, o = !1) => w("resolve", e, o)
27
+ }), T = "--backdrop-present", x = () => {
28
+ document.documentElement.classList.add(T);
29
+ }, G = async () => {
30
+ document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(T);
31
+ }, J = F({
32
+ inheritAttrs: !1,
33
+ props: {
34
+ modelValue: { type: Boolean, default: !1 },
35
+ teleportSelector: { type: String, default: "body" },
36
+ beforeClose: {
37
+ // eslint-disable-next-line @typescript-eslint/ban-types
38
+ type: Function,
39
+ default: void 0
40
+ },
41
+ persistent: { type: Boolean, default: !1 },
42
+ noCloseOnEscKey: { type: Boolean, default: !1 },
43
+ transitionName: { type: String, default: "backdrop-anim" },
44
+ backdropClass: { type: [Array, String, Object], default: void 0 },
45
+ backdropContentClass: {
46
+ type: [Array, String, Object],
47
+ default: void 0
48
+ }
49
+ },
50
+ emits: ["open", "before-close", "close", "update:model-value"],
51
+ setup(e, { emit: o }) {
52
+ const i = M(e.modelValue), s = () => {
53
+ r(!1);
54
+ }, r = async (v) => {
55
+ var S;
56
+ v || (o("before-close"), await ((S = e.beforeClose) == null ? void 0 : S.call(e))), i.value = v;
57
+ }, f = () => {
58
+ o("open");
59
+ }, n = () => {
60
+ o("update:model-value", !1), o("close"), t();
61
+ }, a = () => {
62
+ e.persistent || s();
63
+ }, l = (v) => {
64
+ !e.noCloseOnEscKey && v.key === "Escape" && !e.persistent && s();
65
+ }, b = () => {
66
+ x(), document.addEventListener("keyup", l, !1);
67
+ }, t = () => {
68
+ document.removeEventListener("keyup", l), G();
69
+ };
70
+ return O(() => {
71
+ e.modelValue ? b() : t();
72
+ }), P(
73
+ () => e.modelValue,
74
+ (v) => {
75
+ i.value = v, v ? b() : t();
76
+ }
77
+ ), {
78
+ onBackdropAnimationEnter: f,
79
+ onBackdropAnimationLeave: n,
80
+ onBackdropClicked: a,
81
+ close: s,
82
+ present: i,
83
+ toggleModal: r,
84
+ onKeyPress: l
85
+ };
86
+ }
87
+ });
88
+ const V = (e, o) => {
89
+ const i = e.__vccOpts || e;
90
+ for (const [s, r] of o)
91
+ i[s] = r;
92
+ return i;
93
+ };
94
+ function Q(e, o, i, s, r, f) {
95
+ return m(), $(N, { to: e.teleportSelector }, [
96
+ B(H, {
97
+ appear: "",
98
+ name: e.transitionName,
99
+ onAfterEnter: e.onBackdropAnimationEnter,
100
+ onAfterLeave: e.onBackdropAnimationLeave
101
+ }, {
102
+ default: p(() => [
103
+ e.present ? (m(), A(
104
+ "div",
105
+ {
106
+ key: 0,
107
+ class: E(["m-backdrop --present", [e.backdropClass]]),
108
+ tabindex: "-1",
109
+ role: "dialog"
110
+ },
111
+ [
112
+ k(
113
+ "button",
114
+ {
115
+ class: E(["m-backdrop-overlay", { "--disabled": e.persistent }]),
116
+ tabindex: "-1",
117
+ onClick: o[0] || (o[0] = W((...n) => e.onBackdropClicked && e.onBackdropClicked(...n), ["self"]))
118
+ },
119
+ null,
120
+ 2
121
+ /* CLASS */
122
+ ),
123
+ k(
124
+ "div",
125
+ z({
126
+ class: ["m-backdrop-content", e.backdropContentClass]
127
+ }, e.$attrs, {
128
+ role: "document",
129
+ tabindex: "0"
130
+ }),
131
+ [
132
+ u(e.$slots, "default", { close: e.close })
133
+ ],
134
+ 16
135
+ /* FULL_PROPS */
136
+ )
137
+ ],
138
+ 2
139
+ /* CLASS */
140
+ )) : c("v-if", !0)
141
+ ]),
142
+ _: 3
143
+ /* FORWARDED */
144
+ }, 8, ["name", "onAfterEnter", "onAfterLeave"])
145
+ ], 8, ["to"]);
146
+ }
147
+ const R = /* @__PURE__ */ V(J, [["render", Q]]), Y = {
148
+ key: 0,
149
+ class: "maz-my-0 maz-text-xl maz-font-semibold"
150
+ }, Z = { class: "m-dialog-content" }, _ = {
151
+ key: 0,
152
+ class: "m-dialog-footer"
153
+ }, ee = /* @__PURE__ */ F({
154
+ __name: "MazDialog",
155
+ props: {
156
+ /** Modal's title in header */
157
+ title: { type: String, default: void 0 },
158
+ /** Remove the close button in header */
159
+ noClose: { type: Boolean, default: !1 },
160
+ /** Modal's width */
161
+ width: { type: String, default: "500px" },
162
+ /** Modal's max-width */
163
+ maxWidth: { type: String, default: "95vw" },
164
+ /** Modal's max-height */
165
+ maxHeight: { type: String, default: "95vh" },
166
+ /** Modal's content becomes scrollable - warning: a overflow is applied */
167
+ scrollable: { type: Boolean, default: !1 }
168
+ },
169
+ emits: [
170
+ /** Model binding */
171
+ "update:model-value",
172
+ /** Emitted when dialog is closed (after animation) */
173
+ "close",
174
+ /** Emitted when dialog is opened (after animation) */
175
+ "open"
176
+ ],
177
+ setup(e) {
178
+ const o = h(() => import("./MazBtn-3d74f737.mjs")), i = h(() => import("./x-mark-35f2f1e7.mjs")), s = K(), r = D(() => ({
179
+ ...s,
180
+ class: void 0,
181
+ style: void 0
182
+ })), f = D(() => ({
183
+ class: s.class,
184
+ style: s.style
185
+ }));
186
+ return (n, a) => (m(), $(
187
+ R,
188
+ z(r.value, {
189
+ "transition-name": "modal-anim",
190
+ onClose: a[0] || (a[0] = (l) => n.$emit("close", l)),
191
+ onOpen: a[1] || (a[1] = (l) => n.$emit("open", l)),
192
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => n.$emit("update:model-value", l))
193
+ }),
194
+ {
195
+ default: p(({ close: l }) => [
196
+ k(
197
+ "div",
198
+ z({
199
+ class: ["m-dialog", { "--scrollable": e.scrollable }],
200
+ style: [{ width: e.width, maxWidth: e.maxWidth, maxHeight: e.maxHeight }]
201
+ }, f.value),
202
+ [
203
+ c(`
204
+ @slot Header slot
205
+ @binding {Function} close close function
206
+ `),
207
+ u(n.$slots, "header", { close: l }, () => [
208
+ k(
209
+ "div",
210
+ {
211
+ class: E(["m-dialog-header", { "--has-title": n.$slots.title || e.title }])
212
+ },
213
+ [
214
+ n.$slots.title || e.title ? (m(), A("h2", Y, [
215
+ c(`
216
+ @slot Title slot in the header
217
+ `),
218
+ u(n.$slots, "title", {}, () => [
219
+ y(
220
+ g(e.title),
221
+ 1
222
+ /* TEXT */
223
+ )
224
+ ], !0)
225
+ ])) : c("v-if", !0),
226
+ e.noClose ? c("v-if", !0) : (m(), $(d(o), {
227
+ key: 1,
228
+ class: "m-dialog-closebtn",
229
+ color: "transparent",
230
+ onClick: l
231
+ }, {
232
+ default: p(() => [
233
+ B(d(i), { class: "maz-text-lg" })
234
+ ]),
235
+ _: 2
236
+ /* DYNAMIC */
237
+ }, 1032, ["onClick"]))
238
+ ],
239
+ 2
240
+ /* CLASS */
241
+ )
242
+ ], !0),
243
+ k("div", Z, [
244
+ c(`
245
+ @slot Default content
246
+ @binding {Function} close close function
247
+ `),
248
+ u(n.$slots, "default", { close: l }, void 0, !0)
249
+ ]),
250
+ n.$slots.footer ? (m(), A("div", _, [
251
+ c(`
252
+ @slot Footer slot
253
+ @binding {Function} close close function
254
+ `),
255
+ u(n.$slots, "footer", { close: l }, void 0, !0)
256
+ ])) : c("v-if", !0)
257
+ ],
258
+ 16
259
+ /* FULL_PROPS */
260
+ )
261
+ ]),
262
+ _: 3
263
+ /* FORWARDED */
264
+ },
265
+ 16
266
+ /* FULL_PROPS */
267
+ ));
268
+ }
269
+ });
270
+ const te = /* @__PURE__ */ V(ee, [["__scopeId", "data-v-085e6d92"]]), oe = { class: "maz-space-x-2" }, se = /* @__PURE__ */ F({
271
+ __name: "MazDialogPromise",
272
+ props: {
273
+ /** Dialog Data - type DialogData */
274
+ data: { type: Object, default: void 0 },
275
+ /** Uniq identifier */
276
+ identifier: { type: String, required: !0 },
277
+ /** Custom buttons - type DialogButton[] */
278
+ buttons: { type: Array, default: () => [] }
279
+ },
280
+ setup(e) {
281
+ const o = h(() => import("./MazBtn-3d74f737.mjs")), i = e, { dialogState: s, rejectDialog: r, resolveDialog: f } = X(), n = D(
282
+ () => s.value.find(({ id: a }) => a === i.identifier)
283
+ );
284
+ return (a, l) => {
285
+ var b;
286
+ return m(), $(te, z(a.$attrs, {
287
+ "model-value": ((b = n.value) == null ? void 0 : b.isActive) ?? !1,
288
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => d(r)(n.value))
289
+ }), {
290
+ title: p(() => [
291
+ u(a.$slots, "title", {}, () => {
292
+ var t;
293
+ return [
294
+ y(
295
+ g((t = e.data) == null ? void 0 : t.title),
296
+ 1
297
+ /* TEXT */
298
+ )
299
+ ];
300
+ })
301
+ ]),
302
+ default: p(() => [
303
+ c(`
304
+ @slot Default slot - Place your content
305
+ @binding {Function} resolve resolve function
306
+ @binding {Function} reject reject function
307
+ `),
308
+ u(a.$slots, "default", {
309
+ resolve: (t) => d(f)(n.value, t),
310
+ reject: (t) => d(r)(n.value, t)
311
+ }, () => {
312
+ var t;
313
+ return [
314
+ y(
315
+ g((t = e.data) == null ? void 0 : t.message),
316
+ 1
317
+ /* TEXT */
318
+ )
319
+ ];
320
+ })
321
+ ]),
322
+ footer: p(() => [
323
+ c(`
324
+ @slot Footer Buttons slot
325
+ @binding {Function} resolve resolve function
326
+ @binding {Function} reject reject function
327
+ `),
328
+ u(a.$slots, "footer-button", {
329
+ resolve: (t) => d(f)(n.value, t),
330
+ reject: (t) => d(r)(n.value, t)
331
+ }, () => [
332
+ k("div", oe, [
333
+ e.buttons.length > 0 ? (m(!0), A(
334
+ j,
335
+ { key: 0 },
336
+ q(e.buttons, (t, v) => (m(), $(d(o), {
337
+ key: v,
338
+ color: t.color,
339
+ size: t.size,
340
+ outline: t.outline,
341
+ rounded: t.rounded,
342
+ disabled: t.disabled,
343
+ block: t.block,
344
+ loading: t.loading,
345
+ onClick: (S) => t.type === "resolve" ? d(f)(n.value, t.response) : d(r)(n.value, t.response)
346
+ }, {
347
+ default: p(() => [
348
+ y(
349
+ g(t.text),
350
+ 1
351
+ /* TEXT */
352
+ )
353
+ ]),
354
+ _: 2
355
+ /* DYNAMIC */
356
+ }, 1032, ["color", "size", "outline", "rounded", "disabled", "block", "loading", "onClick"]))),
357
+ 128
358
+ /* KEYED_FRAGMENT */
359
+ )) : (m(), A(
360
+ j,
361
+ { key: 1 },
362
+ [
363
+ B(d(o), {
364
+ color: "danger",
365
+ outline: "",
366
+ onClick: l[0] || (l[0] = (t) => d(r)(n.value))
367
+ }, {
368
+ default: p(() => [
369
+ u(a.$slots, "cancel-text", {}, () => {
370
+ var t;
371
+ return [
372
+ y(
373
+ g(((t = e.data) == null ? void 0 : t.cancelText) || "Cancel"),
374
+ 1
375
+ /* TEXT */
376
+ )
377
+ ];
378
+ })
379
+ ]),
380
+ _: 3
381
+ /* FORWARDED */
382
+ }),
383
+ B(d(o), {
384
+ color: "success",
385
+ onClick: l[1] || (l[1] = (t) => d(f)(n.value))
386
+ }, {
387
+ default: p(() => [
388
+ u(a.$slots, "confirm-text", {}, () => {
389
+ var t;
390
+ return [
391
+ y(
392
+ g(((t = e.data) == null ? void 0 : t.confirmText) || "Confirm"),
393
+ 1
394
+ /* TEXT */
395
+ )
396
+ ];
397
+ })
398
+ ]),
399
+ _: 3
400
+ /* FORWARDED */
401
+ })
402
+ ],
403
+ 64
404
+ /* STABLE_FRAGMENT */
405
+ ))
406
+ ])
407
+ ])
408
+ ]),
409
+ _: 3
410
+ /* FORWARDED */
411
+ }, 16, ["model-value"]);
412
+ };
413
+ }
414
+ });
415
+ export {
416
+ V as _,
417
+ se as a,
418
+ X as u
419
+ };
@@ -0,0 +1,206 @@
1
+ import "../assets/MazDrawer.css";
2
+ import { defineComponent as g, ref as z, onMounted as _, watch as L, openBlock as d, createBlock as B, Teleport as M, createVNode as p, Transition as D, withCtx as f, createElementBlock as E, normalizeClass as i, createElementVNode as l, withModifiers as V, mergeProps as A, renderSlot as k, createCommentVNode as $, defineAsyncComponent as b, createTextVNode as h, toDisplayString as O, unref as C } from "vue";
3
+ const w = "--backdrop-present", N = () => {
4
+ document.documentElement.classList.add(w);
5
+ }, T = async () => {
6
+ document.querySelector(".m-backdrop.--present") || document.documentElement.classList.remove(w);
7
+ }, P = g({
8
+ inheritAttrs: !1,
9
+ props: {
10
+ modelValue: { type: Boolean, default: !1 },
11
+ teleportSelector: { type: String, default: "body" },
12
+ beforeClose: {
13
+ // eslint-disable-next-line @typescript-eslint/ban-types
14
+ type: Function,
15
+ default: void 0
16
+ },
17
+ persistent: { type: Boolean, default: !1 },
18
+ noCloseOnEscKey: { type: Boolean, default: !1 },
19
+ transitionName: { type: String, default: "backdrop-anim" },
20
+ backdropClass: { type: [Array, String, Object], default: void 0 },
21
+ backdropContentClass: {
22
+ type: [Array, String, Object],
23
+ default: void 0
24
+ }
25
+ },
26
+ emits: ["open", "before-close", "close", "update:model-value"],
27
+ setup(e, { emit: a }) {
28
+ const s = z(e.modelValue), t = () => {
29
+ o(!1);
30
+ }, o = async (r) => {
31
+ var y;
32
+ r || (a("before-close"), await ((y = e.beforeClose) == null ? void 0 : y.call(e))), s.value = r;
33
+ }, n = () => {
34
+ a("open");
35
+ }, c = () => {
36
+ a("update:model-value", !1), a("close"), u();
37
+ }, S = () => {
38
+ e.persistent || t();
39
+ }, m = (r) => {
40
+ !e.noCloseOnEscKey && r.key === "Escape" && !e.persistent && t();
41
+ }, v = () => {
42
+ N(), document.addEventListener("keyup", m, !1);
43
+ }, u = () => {
44
+ document.removeEventListener("keyup", m), T();
45
+ };
46
+ return _(() => {
47
+ e.modelValue ? v() : u();
48
+ }), L(
49
+ () => e.modelValue,
50
+ (r) => {
51
+ s.value = r, r ? v() : u();
52
+ }
53
+ ), {
54
+ onBackdropAnimationEnter: n,
55
+ onBackdropAnimationLeave: c,
56
+ onBackdropClicked: S,
57
+ close: t,
58
+ present: s,
59
+ toggleModal: o,
60
+ onKeyPress: m
61
+ };
62
+ }
63
+ });
64
+ const K = (e, a) => {
65
+ const s = e.__vccOpts || e;
66
+ for (const [t, o] of a)
67
+ s[t] = o;
68
+ return s;
69
+ };
70
+ function j(e, a, s, t, o, n) {
71
+ return d(), B(M, { to: e.teleportSelector }, [
72
+ p(D, {
73
+ appear: "",
74
+ name: e.transitionName,
75
+ onAfterEnter: e.onBackdropAnimationEnter,
76
+ onAfterLeave: e.onBackdropAnimationLeave
77
+ }, {
78
+ default: f(() => [
79
+ e.present ? (d(), E(
80
+ "div",
81
+ {
82
+ key: 0,
83
+ class: i(["m-backdrop --present", [e.backdropClass]]),
84
+ tabindex: "-1",
85
+ role: "dialog"
86
+ },
87
+ [
88
+ l(
89
+ "button",
90
+ {
91
+ class: i(["m-backdrop-overlay", { "--disabled": e.persistent }]),
92
+ tabindex: "-1",
93
+ onClick: a[0] || (a[0] = V((...c) => e.onBackdropClicked && e.onBackdropClicked(...c), ["self"]))
94
+ },
95
+ null,
96
+ 2
97
+ /* CLASS */
98
+ ),
99
+ l(
100
+ "div",
101
+ A({
102
+ class: ["m-backdrop-content", e.backdropContentClass]
103
+ }, e.$attrs, {
104
+ role: "document",
105
+ tabindex: "0"
106
+ }),
107
+ [
108
+ k(e.$slots, "default", { close: e.close })
109
+ ],
110
+ 16
111
+ /* FULL_PROPS */
112
+ )
113
+ ],
114
+ 2
115
+ /* CLASS */
116
+ )) : $("v-if", !0)
117
+ ]),
118
+ _: 3
119
+ /* FORWARDED */
120
+ }, 8, ["name", "onAfterEnter", "onAfterLeave"])
121
+ ], 8, ["to"]);
122
+ }
123
+ const F = /* @__PURE__ */ K(P, [["render", j]]), q = { class: "m-drawer-header__title" }, I = {
124
+ key: 0,
125
+ class: "m-drawer-header__close"
126
+ }, U = { class: "m-drawer-body" }, H = /* @__PURE__ */ g({
127
+ __name: "MazDrawer",
128
+ props: {
129
+ noClose: { type: Boolean, default: !1 },
130
+ title: { type: String, default: void 0 },
131
+ variant: {
132
+ type: String,
133
+ default: "right",
134
+ validator: (e) => ["right", "top", "left", "bottom"].includes(e)
135
+ },
136
+ backdropClass: { type: String, default: void 0 },
137
+ size: { type: String, default: "30rem" }
138
+ },
139
+ emits: ["open", "close", "update:model-value"],
140
+ setup(e) {
141
+ const a = b(() => import("./MazBtn-1e61862b.mjs")), s = b(() => import("./x-mark-35f2f1e7.mjs"));
142
+ return (t, o) => (d(), B(F, A(t.$attrs, {
143
+ "backdrop-class": ["m-drawer", `--${e.variant}`, e.backdropClass],
144
+ style: {
145
+ "--maz-drawer-size": e.size
146
+ },
147
+ onClose: o[0] || (o[0] = (n) => t.$emit("close", n)),
148
+ onOpen: o[1] || (o[1] = (n) => t.$emit("open", n)),
149
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t.$emit("update:model-value", n))
150
+ }), {
151
+ default: f(({ close: n }) => [
152
+ l(
153
+ "div",
154
+ {
155
+ class: i(["m-drawer-content-wrap", [`--${e.variant}`]])
156
+ },
157
+ [
158
+ l(
159
+ "header",
160
+ {
161
+ class: i(["m-drawer-header", [t.$slots.title || e.title ? "--between" : "--end"]])
162
+ },
163
+ [
164
+ l("h4", q, [
165
+ k(t.$slots, "title", { close: n }, () => [
166
+ h(
167
+ O(e.title),
168
+ 1
169
+ /* TEXT */
170
+ )
171
+ ])
172
+ ]),
173
+ e.noClose ? $("v-if", !0) : (d(), E("div", I, [
174
+ p(C(a), {
175
+ size: "sm",
176
+ color: "transparent",
177
+ onClick: n
178
+ }, {
179
+ default: f(() => [
180
+ p(C(s), { class: "icon maz-text-lg" })
181
+ ]),
182
+ _: 2
183
+ /* DYNAMIC */
184
+ }, 1032, ["onClick"])
185
+ ]))
186
+ ],
187
+ 2
188
+ /* CLASS */
189
+ ),
190
+ l("div", U, [
191
+ k(t.$slots, "default", { close: n })
192
+ ])
193
+ ],
194
+ 2
195
+ /* CLASS */
196
+ )
197
+ ]),
198
+ _: 3
199
+ /* FORWARDED */
200
+ }, 16, ["backdrop-class", "style"]));
201
+ }
202
+ });
203
+ export {
204
+ K as _,
205
+ H as a
206
+ };