maz-ui 3.47.1 → 3.47.2-beta.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.
Files changed (163) 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.d.ts +1 -1
  8. package/components/MazChart.mjs +23 -32
  9. package/components/MazChecklist.mjs +1 -1
  10. package/components/MazCircularProgressBar.mjs +66 -71
  11. package/components/MazDialog.mjs +1 -1
  12. package/components/MazDialogPromise.mjs +1 -1
  13. package/components/MazDrawer.mjs +1 -1
  14. package/components/MazDropdown.mjs +162 -185
  15. package/components/MazExpandAnimation.mjs +20 -21
  16. package/components/MazGallery.mjs +1 -1
  17. package/components/MazInput.mjs +1 -1
  18. package/components/MazInputCode.mjs +30 -31
  19. package/components/MazInputNumber.mjs +1 -1
  20. package/components/MazInputPrice.mjs +1 -1
  21. package/components/MazInputTags.mjs +1 -1
  22. package/components/MazLink.mjs +18 -30
  23. package/components/MazPagination.mjs +1 -1
  24. package/components/MazPhoneNumberInput.mjs +1 -1
  25. package/components/MazPicker.mjs +1 -1
  26. package/components/MazRadio.mjs +37 -42
  27. package/components/MazRadioButtons.mjs +61 -66
  28. package/components/MazSelect.mjs +1 -1
  29. package/components/MazSlider.mjs +107 -116
  30. package/components/MazStepper.mjs +1 -1
  31. package/components/MazSwitch.mjs +24 -28
  32. package/components/MazTable.d.ts +31 -54
  33. package/components/MazTable.mjs +1 -1
  34. package/components/MazTabsBar.mjs +1 -1
  35. package/components/MazTextarea.mjs +32 -34
  36. package/components/assets/MazDropdown.css +1 -1
  37. package/components/assets/MazGallery.css +1 -1
  38. package/components/assets/MazInput.css +1 -1
  39. package/components/assets/MazInputNumber.css +1 -1
  40. package/components/assets/MazInputPrice.css +1 -1
  41. package/components/assets/MazInputTags.css +1 -1
  42. package/components/assets/MazLink.css +1 -1
  43. package/components/assets/MazPhoneNumberInput.css +1 -1
  44. package/components/assets/MazPicker.css +1 -1
  45. package/components/assets/MazSelect.css +1 -1
  46. package/components/assets/MazTable.css +1 -1
  47. package/components/assets/MazTabsBar.css +1 -1
  48. package/components/chunks/{MazBadge-CNSfzYq-.mjs → MazBadge-CqppWg2j.mjs} +1 -1
  49. package/components/chunks/{MazBottomSheet-DqK0EOsq.mjs → MazBottomSheet-CGRvZmGd.mjs} +28 -29
  50. package/{modules/chunks/MazBtn-CTqI4qhg.mjs → components/chunks/MazBtn-2VKM1wZu.mjs} +37 -49
  51. package/components/chunks/{MazBtn-TkePGm5o.mjs → MazBtn-40lm8-AL.mjs} +37 -49
  52. package/components/chunks/{MazBtn-DzBXfedt.mjs → MazBtn-BB1FyYWv.mjs} +35 -44
  53. package/components/chunks/{MazBtn-CnqRnXh_.mjs → MazBtn-BMYXMZuX.mjs} +37 -49
  54. package/components/chunks/{MazBtn-D6Jxw9Nr.mjs → MazBtn-BijEMn4r.mjs} +37 -49
  55. package/components/chunks/MazBtn-BmrcK2af.mjs +106 -0
  56. package/components/chunks/MazBtn-C72_1uvu.mjs +106 -0
  57. package/components/chunks/MazBtn-CWloP6MI.mjs +111 -0
  58. package/components/chunks/MazBtn-CcyV4DCc.mjs +106 -0
  59. package/components/chunks/MazBtn-DENEMy-c.mjs +106 -0
  60. package/components/chunks/MazBtn-DfqRZvbB.mjs +106 -0
  61. package/components/chunks/MazBtn-UnZQuu6P.mjs +106 -0
  62. package/components/chunks/MazBtn-cDJlUVVY.mjs +106 -0
  63. package/components/chunks/MazBtn-hUslV7wO.mjs +106 -0
  64. package/components/chunks/{MazCard-CfkvpcGL.mjs → MazCard-BYB8y1_u.mjs} +18 -19
  65. package/components/chunks/{MazCarousel-BEl86YGW.mjs → MazCarousel-DccWVW8H.mjs} +20 -21
  66. package/components/chunks/{MazCheckbox-BKCo6EzO.mjs → MazCheckbox-B22OcHt8.mjs} +1 -1
  67. package/components/chunks/{MazCheckbox-CI8ml-P8.mjs → MazCheckbox-DMogZVHl.mjs} +1 -1
  68. package/components/chunks/{MazCheckbox-Byqz8JJB.mjs → MazCheckbox-Db6sPUbV.mjs} +1 -1
  69. package/components/chunks/{MazChecklist-BLxsNHMP.mjs → MazChecklist-C95Y4Hb-.mjs} +112 -118
  70. package/components/chunks/{MazDialog-CPgFpAlq.mjs → MazDialog-khofH-7I.mjs} +66 -81
  71. package/components/chunks/MazDialogPromise-ZRA2ZrO4.mjs +488 -0
  72. package/components/chunks/{MazExpandAnimation-Bkw_wFTi.mjs → MazExpandAnimation-MDimlZGj.mjs} +7 -8
  73. package/components/chunks/{MazGallery-BMFwld84.mjs → MazGallery-CXQiXWFr.mjs} +267 -225
  74. package/components/chunks/{MazGallery-BKL7gfrz.mjs → MazGallery-VTZUhBKC.mjs} +249 -207
  75. package/components/chunks/{MazIcon-D8V8ixhf.mjs → MazIcon-BF5TFzse.mjs} +1 -1
  76. package/components/chunks/{MazInput-O6Q41Fm0.mjs → MazInput-DC3S-CVu.mjs} +43 -52
  77. package/components/chunks/{MazInput-CBiCdd0F.mjs → MazInput-DzWkS-g8.mjs} +41 -50
  78. package/components/chunks/{MazInput-Dx2cCzFS.mjs → MazInput-NE6H-10w.mjs} +38 -47
  79. package/components/chunks/{MazInputNumber-DYPVUz4k.mjs → MazInputNumber-DRXQXHRv.mjs} +168 -189
  80. package/components/chunks/{MazInputPrice-DZD7ZZpm.mjs → MazInputPrice-DoTnDDIN.mjs} +49 -58
  81. package/components/chunks/{MazInputTags-CxXBsTdM.mjs → MazInputTags-Dj3sW-e5.mjs} +189 -209
  82. package/components/chunks/{MazLink-Dl9ePCGm.mjs → MazLink-C_3Wya94.mjs} +19 -31
  83. package/components/chunks/{MazLoadingBar-Di2OIrPD.mjs → MazLoadingBar-DdjHRC7g.mjs} +1 -1
  84. package/components/chunks/MazPagination-BkT4_LLW.mjs +330 -0
  85. package/components/chunks/{MazPhoneNumberInput-C4TX1tGw.mjs → MazPhoneNumberInput-BbssOUzo.mjs} +503 -547
  86. package/components/chunks/{MazPicker-BcQ_-AJH.mjs → MazPicker-DwWiIYAR.mjs} +244 -265
  87. package/components/chunks/{MazPickerMonthSwitcher-hCAkEd5r.mjs → MazPickerMonthSwitcher-CmFFQoPA.mjs} +1 -1
  88. package/components/chunks/{MazPickerShortcuts-vpLyw1de.mjs → MazPickerShortcuts-DaELz7aq.mjs} +1 -1
  89. package/components/chunks/{MazPickerYearSwitcher-DvC79vrt.mjs → MazPickerYearSwitcher-m1_KXnpA.mjs} +1 -1
  90. package/components/chunks/{MazSelect-BXzgSKmL.mjs → MazSelect-BJ07NVXQ.mjs} +160 -180
  91. package/components/chunks/{MazSelect-Baj2BQH7.mjs → MazSelect-CDV9Fx6m.mjs} +124 -136
  92. package/components/chunks/{MazSpinner-Bvb-lKER.mjs → MazSpinner-Bb3f2t6w.mjs} +1 -1
  93. package/components/chunks/{MazSpinner-Cqp-BMvL.mjs → MazSpinner-BcB0szZB.mjs} +1 -1
  94. package/components/chunks/{MazSpinner-C1SiKhfK.mjs → MazSpinner-BpkPcfCt.mjs} +1 -1
  95. package/components/chunks/{MazSpinner-CAbYLlEZ.mjs → MazSpinner-BsYJDmi9.mjs} +1 -1
  96. package/components/chunks/MazSpinner-BymqEMBk.mjs +34 -0
  97. package/components/chunks/MazSpinner-C-64WJje.mjs +34 -0
  98. package/components/chunks/MazSpinner-CEFbkZkM.mjs +34 -0
  99. package/components/chunks/{MazSpinner-B8akphXs.mjs → MazSpinner-CfiIXW8y.mjs} +1 -1
  100. package/components/chunks/MazSpinner-CykRbNHD.mjs +34 -0
  101. package/components/chunks/{MazSpinner-C-z3-68w.mjs → MazSpinner-D3-pqOh3.mjs} +1 -1
  102. package/components/chunks/{MazSpinner-B5lezvu4.mjs → MazSpinner-DS58mtzm.mjs} +1 -1
  103. package/components/chunks/{MazSpinner-DwSGm0-X.mjs → MazSpinner-DmiLBQgR.mjs} +1 -1
  104. package/components/chunks/MazSpinner-Dmkr_r9u.mjs +34 -0
  105. package/components/chunks/MazSpinner-DoRGA1RI.mjs +34 -0
  106. package/components/chunks/MazSpinner-eC03bFP5.mjs +34 -0
  107. package/components/chunks/{MazSpinner-Cb3_S0zT.mjs → MazSpinner-edxn0ncQ.mjs} +1 -1
  108. package/components/chunks/MazSpinner-f2Mc2eRO.mjs +34 -0
  109. package/components/chunks/MazSpinner-n4Dp5ZsH.mjs +34 -0
  110. package/components/chunks/MazStepper-BREfkpUb.mjs +213 -0
  111. package/components/chunks/{MazTable-CulBGLaj.mjs → MazTable-BJDPdIJB.mjs} +183 -227
  112. package/components/chunks/{MazTableCell-BXDbkEJq.mjs → MazTableCell-DILuUCTe.mjs} +1 -1
  113. package/components/chunks/{MazTableRow-Ds3CDEit.mjs → MazTableRow-D6H6-c8J.mjs} +1 -1
  114. package/components/chunks/{MazTableTitle-uirsgvk_.mjs → MazTableTitle-Ch-nyY1E.mjs} +1 -1
  115. package/components/chunks/MazTabsBar-CM-w7V97.mjs +193 -0
  116. package/components/chunks/{MazTransitionExpand-4Ll_5LDO.mjs → MazTransitionExpand-PmUDa51_.mjs} +1 -1
  117. package/css/main.css +1 -1
  118. package/modules/assets/index.css +1 -1
  119. package/modules/chunks/MazBtn-B_Xlvgbg.cjs +1 -0
  120. package/modules/chunks/MazBtn-Dsr06Zgg.mjs +106 -0
  121. package/modules/chunks/{MazIcon-BtomZnkQ.cjs → MazIcon-CkuzyufF.cjs} +1 -1
  122. package/modules/chunks/{MazIcon-BB0DMfOc.mjs → MazIcon-DEgoQbMj.mjs} +1 -1
  123. package/modules/chunks/{MazSpinner-CDJhmIRl.mjs → MazSpinner-BurN-1pb.mjs} +1 -1
  124. package/modules/chunks/{MazSpinner-BASKjaLe.cjs → MazSpinner-jP4QsCNE.cjs} +1 -1
  125. package/modules/chunks/index-CUNN0eIB.cjs +124 -0
  126. package/modules/chunks/{index-C2yAjM0P.mjs → index-CxFUggmu.mjs} +925 -931
  127. package/modules/index.cjs +1 -1
  128. package/modules/index.mjs +1 -1
  129. package/nuxt/index.json +1 -1
  130. package/package.json +1 -1
  131. package/types/components/MazChart.vue.d.ts +1 -1
  132. package/types/components/MazTable.vue.d.ts +31 -54
  133. package/types/modules/composables/useFormValidator/types.d.ts +5 -1
  134. package/types/modules/composables/useFormValidator/useFormField.d.ts +3 -3
  135. package/types/modules/composables/useFormValidator/useFormValidator.d.ts +2 -2
  136. package/types/modules/composables/useFormValidator/utils.d.ts +12 -12
  137. package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +5 -5
  138. package/types/modules/helpers/check-availability.d.ts +1 -0
  139. package/components/chunks/MazBtn-BRUaoP8j.mjs +0 -126
  140. package/components/chunks/MazBtn-BRnLMzhy.mjs +0 -118
  141. package/components/chunks/MazBtn-BhnOApJu.mjs +0 -118
  142. package/components/chunks/MazBtn-C28vKP_v.mjs +0 -118
  143. package/components/chunks/MazBtn-CweCwE_4.mjs +0 -118
  144. package/components/chunks/MazBtn-D7IKoL2c.mjs +0 -118
  145. package/components/chunks/MazBtn-DlD5m7T4.mjs +0 -118
  146. package/components/chunks/MazBtn-Dt8lr0GH.mjs +0 -118
  147. package/components/chunks/MazBtn-Mu18egu5.mjs +0 -118
  148. package/components/chunks/MazBtn-igor8wRn.mjs +0 -118
  149. package/components/chunks/MazDialogPromise-BCCdkrea.mjs +0 -522
  150. package/components/chunks/MazPagination-CHTMRRqE.mjs +0 -362
  151. package/components/chunks/MazSpinner-Cg26sBU2.mjs +0 -34
  152. package/components/chunks/MazSpinner-CvT-9sC7.mjs +0 -34
  153. package/components/chunks/MazSpinner-DH6C15pU.mjs +0 -34
  154. package/components/chunks/MazSpinner-DlMKBtyt.mjs +0 -34
  155. package/components/chunks/MazSpinner-Dyf9yb51.mjs +0 -34
  156. package/components/chunks/MazSpinner-M4r0cykl.mjs +0 -34
  157. package/components/chunks/MazSpinner-QHjOczon.mjs +0 -34
  158. package/components/chunks/MazSpinner-cqcpf_FX.mjs +0 -34
  159. package/components/chunks/MazSpinner-yPkPj7Q8.mjs +0 -34
  160. package/components/chunks/MazStepper-DRWtYHZR.mjs +0 -232
  161. package/components/chunks/MazTabsBar-MZYefBb8.mjs +0 -204
  162. package/modules/chunks/MazBtn-D_CpNgpD.cjs +0 -9
  163. package/modules/chunks/index-BIX1NMzX.cjs +0 -149
@@ -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
- };