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,232 +0,0 @@
1
- import { defineComponent as J, useCssVars as K, defineAsyncComponent as f, computed as h, useSlots as Q, ref as U, openBlock as a, createElementBlock as c, Fragment as b, renderList as X, normalizeClass as M, createElementVNode as u, createBlock as w, resolveDynamicComponent as A, createCommentVNode as l, renderSlot as v, unref as P, createTextVNode as y, toDisplayString as g, createVNode as Y, withCtx as Z } from "vue";
2
- import '../assets/MazStepper.css';const ee = { class: "m-stepper" }, te = ["id", "disabled", "onClick"], ne = { class: "m-stepper__header__wrapper" }, oe = { class: "m-stepper__count --primary" }, se = { class: "m-stepper__count__circle" }, ae = { class: "m-stepper__header__content" }, le = { class: "m-stepper__title" }, ie = {
3
- key: 0,
4
- class: "m-stepper__subtitle"
5
- }, re = {
6
- key: 0,
7
- class: "m-stepper__right"
8
- }, ce = { class: "m-stepper__content__wrapper" }, ue = /* @__PURE__ */ J({
9
- __name: "MazStepper",
10
- props: {
11
- modelValue: { default: void 0 },
12
- steps: { default: void 0 },
13
- color: { default: "primary" },
14
- disabledNextSteps: { type: Boolean },
15
- disabledPreviousSteps: { type: Boolean },
16
- autoValidateSteps: { type: Boolean },
17
- allStepsOpened: { type: Boolean },
18
- allStepsValidated: { type: Boolean },
19
- canCloseSteps: { type: Boolean }
20
- },
21
- emits: ["update:model-value"],
22
- setup(m, { emit: $ }) {
23
- K((t) => ({
24
- "151573d6": R.value,
25
- "86f40424": q.value
26
- }));
27
- const n = m, C = $, k = f(() => import("./MazIcon-BbvBov5G.mjs")), W = f(() => import("./MazExpandAnimation-Bkw_wFTi.mjs")), T = f(() => import("./check-circle-Bf7AGSQ-.mjs")), j = f(
28
- () => import("./exclamation-circle-CUk0ZajS.mjs")
29
- ), L = f(() => import("./exclamation-triangle-Z6d0ygp8.mjs")), R = h(() => `var(--maz-color-${n.color})`), q = h(() => `var(--maz-color-${n.color}-contrast)`), z = Q(), S = h(
30
- () => Object.keys(z).filter((t) => t.startsWith("content-")).length
31
- ), E = U(1), s = h({
32
- get: () => n.modelValue ?? E.value,
33
- set: (t) => {
34
- E.value = t, C("update:model-value", t);
35
- }
36
- });
37
- function I(t) {
38
- return N(t) ? { icon: T, class: "--success" } : O(t) ? { icon: L, class: "--warning" } : D(t) ? { icon: j, class: "--error" } : { class: "--normal" };
39
- }
40
- function p(t) {
41
- var o, e;
42
- return (e = (o = n.steps) == null ? void 0 : o[t - 1]) == null ? void 0 : e.icon;
43
- }
44
- function V(t, o) {
45
- var e, i;
46
- return (i = (e = n.steps) == null ? void 0 : e[o - 1]) == null ? void 0 : i[t];
47
- }
48
- function x(t) {
49
- s.value === t && n.canCloseSteps ? s.value = 0 : t < 1 ? s.value = 1 : t > S.value ? s.value = S.value : s.value = t;
50
- }
51
- function B(t, o) {
52
- var r, _;
53
- const e = t === "titleInfo" ? "title-info" : t, i = Object.keys(z).filter((H) => H.startsWith(`${e}-`)).includes(`${e}-${o}`), d = !!((_ = (r = n.steps) == null ? void 0 : r[o - 1]) != null && _[t]);
54
- return i || d;
55
- }
56
- function N(t) {
57
- var d, r;
58
- const o = (r = (d = n.steps) == null ? void 0 : d[t - 1]) == null ? void 0 : r.success, e = D(t) || O(t), i = n.autoValidateSteps && t < s.value && !e;
59
- return o ?? (i || n.allStepsValidated);
60
- }
61
- function F(t) {
62
- var r, _;
63
- const o = (_ = (r = n.steps) == null ? void 0 : r[t - 1]) == null ? void 0 : _.disabled, e = s.value === t && !n.canCloseSteps, i = n.disabledNextSteps && t > s.value, d = n.disabledPreviousSteps && t < s.value;
64
- return o ?? (e || i || d || n.allStepsOpened);
65
- }
66
- function D(t) {
67
- var o, e;
68
- return (e = (o = n.steps) == null ? void 0 : o[t - 1]) == null ? void 0 : e.error;
69
- }
70
- function O(t) {
71
- var o, e;
72
- return (e = (o = n.steps) == null ? void 0 : o[t - 1]) == null ? void 0 : e.warning;
73
- }
74
- function G(t) {
75
- return t === S.value;
76
- }
77
- return (t, o) => (a(), c("div", ee, [
78
- (a(!0), c(
79
- b,
80
- null,
81
- X(S.value, (e) => (a(), c(
82
- b,
83
- { key: e },
84
- [
85
- B("title", e) ? (a(), c("button", {
86
- key: 0,
87
- id: `header-step-${e}`,
88
- type: "button",
89
- disabled: F(e),
90
- class: M(["m-stepper__header", [
91
- {
92
- "--is-current-step": e === s.value || t.allStepsOpened,
93
- "--disabled": e !== s.value && !t.allStepsOpened && F(e)
94
- },
95
- `${I(e).class}`
96
- ]]),
97
- onClick: (i) => x(e)
98
- }, [
99
- u("div", ne, [
100
- u("span", oe, [
101
- u("div", se, [
102
- I(e).icon ? (a(), w(A(I(e).icon), {
103
- key: 0,
104
- class: "icon maz-text-xl"
105
- })) : l("v-if", !0)
106
- ]),
107
- l(`
108
- @slot icon-\${step} - Replace step number in the circle by an icon for the step
109
- `),
110
- v(t.$slots, `icon-${e}`, {}, () => [
111
- p(e) ? (a(), c(
112
- b,
113
- { key: 0 },
114
- [
115
- typeof p(e) == "string" ? (a(), w(P(k), {
116
- key: 0,
117
- name: p(e)
118
- }, null, 8, ["name"])) : p(e) ? (a(), w(A(p(e)), { key: 1 })) : l("v-if", !0)
119
- ],
120
- 64
121
- /* STABLE_FRAGMENT */
122
- )) : (a(), c(
123
- b,
124
- { key: 1 },
125
- [
126
- y(
127
- g(e),
128
- 1
129
- /* TEXT */
130
- )
131
- ],
132
- 64
133
- /* STABLE_FRAGMENT */
134
- ))
135
- ], !0)
136
- ]),
137
- u("div", ae, [
138
- u("span", le, [
139
- l(`
140
- @slot title-\${step} - Title of the step
141
- `),
142
- v(t.$slots, `title-${e}`, {}, () => [
143
- y(
144
- g(V("title", e)),
145
- 1
146
- /* TEXT */
147
- )
148
- ], !0)
149
- ]),
150
- B("subtitle", e) ? (a(), c("span", ie, [
151
- l(`
152
- @slot title-\${step} - Subtitle of the step
153
- `),
154
- v(t.$slots, `subtitle-${e}`, {}, () => [
155
- y(
156
- g(V("subtitle", e)),
157
- 1
158
- /* TEXT */
159
- )
160
- ], !0)
161
- ])) : l("v-if", !0)
162
- ])
163
- ]),
164
- B("titleInfo", e) ? (a(), c("span", re, [
165
- l(`
166
- @slot title-info-\${step} - Info of the right of the step
167
- `),
168
- v(t.$slots, `title-info-${e}`, {}, () => [
169
- y(
170
- g(V("titleInfo", e)),
171
- 1
172
- /* TEXT */
173
- )
174
- ], !0)
175
- ])) : l("v-if", !0)
176
- ], 10, te)) : l("v-if", !0),
177
- u(
178
- "div",
179
- {
180
- class: M(["m-stepper__content", {
181
- "--no-border": G(e)
182
- }])
183
- },
184
- [
185
- Y(P(W), {
186
- "model-value": t.allStepsOpened || s.value === e,
187
- "aria-labelledby": `header-step-${e}`
188
- }, {
189
- default: Z(() => [
190
- u("div", ce, [
191
- l(` @slot content-\${step} - Content of the step
192
- @binding {boolean} validated - If the step is validated
193
- @binding {boolean} error - If the step has an error
194
- @binding {boolean} warning - If the step has a warning
195
- @binding {Function} previous-step - Function to go to the previous step
196
- @binding {Function} next-step - Function to go to the next step
197
- `),
198
- v(t.$slots, `content-${e}`, {
199
- validated: N(e),
200
- error: D(e),
201
- warning: O(e),
202
- nextStep: () => x(e + 1),
203
- previousStep: () => x(e - 1)
204
- }, void 0, !0)
205
- ])
206
- ]),
207
- _: 2
208
- /* DYNAMIC */
209
- }, 1032, ["model-value", "aria-labelledby"])
210
- ],
211
- 2
212
- /* CLASS */
213
- )
214
- ],
215
- 64
216
- /* STABLE_FRAGMENT */
217
- ))),
218
- 128
219
- /* KEYED_FRAGMENT */
220
- ))
221
- ]));
222
- }
223
- }), de = (m, $) => {
224
- const n = m.__vccOpts || m;
225
- for (const [C, k] of $)
226
- n[C] = k;
227
- return n;
228
- }, _e = /* @__PURE__ */ de(ue, [["__scopeId", "data-v-8407eada"]]);
229
- export {
230
- _e as M,
231
- de as _
232
- };
@@ -1,203 +0,0 @@
1
- import { inject as I, ref as l, defineComponent as N, defineAsyncComponent as x, computed as O, onBeforeMount as V, onMounted as B, watch as W, openBlock as f, createElementBlock as m, normalizeClass as p, createElementVNode as j, normalizeStyle as z, Fragment as q, renderList as H, createCommentVNode as g, renderSlot as C, createTextVNode as S, toDisplayString as T, createBlock as U, unref as D, withCtx as Q } from "vue";
2
- import '../assets/MazTabsBar.css';function X(r, a) {
3
- const i = I(r, a);
4
- if (!i)
5
- throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${r}`);
6
- return i;
7
- }
8
- l("system");
9
- l("system");
10
- function F(r) {
11
- return new Promise((a) => setTimeout(a, r));
12
- }
13
- const G = (r, a) => {
14
- const i = r.__vccOpts || r;
15
- for (const [o, c] of a)
16
- i[o] = c;
17
- return i;
18
- }, J = {
19
- cancelText: "Cancel",
20
- confirmText: "Confirm",
21
- cancelButton: {
22
- text: "Cancel",
23
- color: "danger"
24
- },
25
- confirmButton: {
26
- text: "Confirm",
27
- color: "success"
28
- }
29
- };
30
- l(J);
31
- l([]);
32
- const K = ["disabled", "onClick"], Y = /* @__PURE__ */ N({
33
- __name: "MazTabsBar",
34
- props: {
35
- items: {},
36
- persistent: { type: Boolean },
37
- queryParam: { default: "tab" },
38
- block: { type: Boolean },
39
- noElevation: { type: Boolean },
40
- autoScroll: { type: Boolean, default: !0 }
41
- },
42
- setup(r) {
43
- const a = r, i = x(() => import("./MazBadge-CvIiiTdM.mjs")), { currentTab: o, updateCurrentTab: c } = X("maz-tabs");
44
- function k(e) {
45
- c(e + 1), a.persistent && M(e + 1);
46
- }
47
- const v = l(), h = l([]);
48
- function y(e) {
49
- return o.value === e + 1;
50
- }
51
- function L({
52
- mazBtn: e,
53
- index: t
54
- }) {
55
- h.value[t] = e && "$el" in e ? e.$el : e;
56
- }
57
- const d = O(
58
- () => a.items.map((e) => ({
59
- label: typeof e == "string" ? e : e.label,
60
- disabled: typeof e == "string" ? !1 : e.disabled ?? !1,
61
- badge: typeof e == "string" ? void 0 : e.badge
62
- }))
63
- ), _ = l(), b = l(!1);
64
- async function w() {
65
- if (!a.autoScroll)
66
- return;
67
- await F(150);
68
- const e = v.value, t = h.value[o.value - 1];
69
- if (!e || !t)
70
- return;
71
- const n = 50;
72
- if (t.offsetLeft - n < e.scrollLeft || t.offsetLeft + t.offsetWidth > e.scrollLeft + e.clientWidth) {
73
- const E = window.getComputedStyle(e, "padding-left").paddingLeft, R = Number(E.slice(0, -2));
74
- e.scrollTo({
75
- left: t.offsetLeft - R - n,
76
- behavior: b.value ? "smooth" : "instant"
77
- });
78
- }
79
- if (typeof o.value != "number")
80
- return;
81
- const s = (t == null ? void 0 : t.offsetWidth) ?? 0, u = (t == null ? void 0 : t.offsetHeight) ?? 0, A = (t == null ? void 0 : t.offsetLeft) ?? 0;
82
- _.value = {
83
- transform: `translateX(${A}px)`,
84
- width: `${s}px`,
85
- height: `${u}px`
86
- }, b.value = !0;
87
- }
88
- function P(e, t) {
89
- return t ? {} : o.value === e + 1 ? "color: var(--maz-color-text)" : "color: var(--maz-color-muted)";
90
- }
91
- V(() => {
92
- (o.value < 1 || o.value > d.value.length) && console.error(
93
- `[maz-ui](MazTabsBar) The model-value should be between 1 and ${d.value.length}`
94
- );
95
- }), B(() => {
96
- (a.persistent || o.value) && w();
97
- }), W(
98
- () => [o.value, d.value],
99
- () => {
100
- w();
101
- }
102
- );
103
- function $() {
104
- const e = new URL(window.location.href);
105
- return Number(e.searchParams.get(a.queryParam));
106
- }
107
- function M(e) {
108
- const t = new URL(window.location.href);
109
- t.searchParams.set(a.queryParam, String(e)), window.history.replaceState({}, document.title, t.toString());
110
- }
111
- return B(async () => {
112
- a.persistent && c($() || o.value || 1);
113
- }), (e, t) => (f(), m(
114
- "div",
115
- {
116
- ref_key: "tabsBarRef",
117
- ref: v,
118
- class: p(["m-tabs-bar", {
119
- "--block": e.block,
120
- "--elevation": !e.noElevation
121
- }])
122
- },
123
- [
124
- j(
125
- "div",
126
- {
127
- class: p(["m-tabs-bar__indicator", { "--animated": b.value }]),
128
- style: z([_.value])
129
- },
130
- null,
131
- 6
132
- /* CLASS, STYLE */
133
- ),
134
- (f(!0), m(
135
- q,
136
- null,
137
- H(d.value, (n, s) => (f(), m("button", {
138
- key: s,
139
- ref_for: !0,
140
- ref: (u) => L({ mazBtn: u, index: s }),
141
- class: p([{ "--active": y(s), "--disabled": n.disabled }, "m-tabs-bar__item"]),
142
- disabled: n.disabled,
143
- style: z(P(s, n.disabled)),
144
- onClick: (u) => n.disabled ? void 0 : k(s)
145
- }, [
146
- g(`
147
- @slot item - Content of item to display in the tabs bar
148
- @binding {MazTabsBarItem[]} item - all data of the item
149
- @binding {boolean} active - \`true\` if the tab is active
150
- @binding {number} index - index of the item
151
- `),
152
- C(e.$slots, "item", {
153
- item: n,
154
- active: y(s),
155
- index: s
156
- }, () => [
157
- S(
158
- T(n.label) + " ",
159
- 1
160
- /* TEXT */
161
- ),
162
- n.badge ? (f(), U(D(i), {
163
- key: 0,
164
- color: n.badge.color,
165
- pastel: n.badge.pastel,
166
- outline: n.badge.outline,
167
- "rounded-size": n.badge.roundedSize,
168
- size: n.badge.size ?? "0.7rem",
169
- class: "m-tabs-bar__item__badge"
170
- }, {
171
- default: Q(() => [
172
- g(`
173
- @slot badge-content - Content in the badge
174
- @binding {string | number | boolean} content - content of the badge provided in item
175
- `),
176
- C(e.$slots, "badge-content", {
177
- content: n.badge.content
178
- }, () => [
179
- S(
180
- T(n.badge.content),
181
- 1
182
- /* TEXT */
183
- )
184
- ], !0)
185
- ]),
186
- _: 2
187
- /* DYNAMIC */
188
- }, 1032, ["color", "pastel", "outline", "rounded-size", "size"])) : g("v-if", !0)
189
- ], !0)
190
- ], 14, K))),
191
- 128
192
- /* KEYED_FRAGMENT */
193
- ))
194
- ],
195
- 2
196
- /* CLASS */
197
- ));
198
- }
199
- }), ee = /* @__PURE__ */ G(Y, [["__scopeId", "data-v-c3d56dd1"]]);
200
- export {
201
- ee as M,
202
- G as _
203
- };
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/MazBtn.css');const e=require("vue"),B=require("./index-BPqjUr5e.cjs"),g={key:2,class:"m-btn-loader-container"},j=e.defineComponent({__name:"MazBtn",props:{variant:{default:"button"},size:{default:"md"},color:{default:"primary"},type:{default:"button"},rounded:{type:Boolean},roundedSize:{default:"lg"},noRounded:{type:Boolean},outline:{type:Boolean},pastel:{type:Boolean},block:{type:Boolean},noUnderline:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},fab:{type:Boolean},icon:{type:[String,Function,Object],default:void 0},leftIcon:{type:[String,Function,Object],default:void 0},rightIcon:{type:[String,Function,Object],default:void 0},noPadding:{type:Boolean},noElevation:{type:Boolean},justify:{default:"center"}},setup(u){const n=u,c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazSpinner-CiIyZ8gs.cjs"))),l=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazIcon-dhyR9Q8a.cjs"))),{href:d,to:m}=e.useAttrs(),a=e.useSlots(),r=e.computed(()=>d?"a":m?"router-link":"button"),f=e.computed(()=>n.pastel?`--${n.color}-pastel`:n.outline?`--${n.color}-outline`:`--${n.color}`),s=e.computed(()=>(n.loading||n.disabled)&&r.value==="button"),p=e.computed(()=>s.value?"--cursor-default":"--cursor-pointer"),y=e.computed(()=>`--is-${n.variant}`),v=e.computed(()=>n.loading&&n.variant==="button"),b=e.computed(()=>!!a["left-icon"]||n.leftIcon),i=e.computed(()=>!!a["right-icon"]||n.rightIcon),z=e.computed(()=>b.value||i.value),C=e.computed(()=>n.icon||!!a.icon),h=e.computed(()=>r.value==="button"?n.type:void 0),t=e.computed(()=>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"),k=e.computed(()=>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");return(o,S)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{disabled:s.value||void 0,class:e.normalizeClass(["m-btn",[`--${o.size}`,!o.fab&&!o.rounded&&o.roundedSize&&`--rounded-${o.roundedSize}`,f.value,p.value,y.value,k.value,{"--block":o.block,"--no-underline":o.noUnderline,"--fab":o.fab,"--loading":o.loading,"--disabled":s.value,"--icon":z.value,"--rounded":o.rounded,"--no-rounded":o.noRounded,"--no-padding":o.noPadding,"--no-elevation":o.noElevation}]]),type:h.value},{default:e.withCtx(()=>[e.createCommentVNode(`
2
- @slot left-icon - The icon to display on the left of the button
3
- `),e.renderSlot(o.$slots,"left-icon",{},()=>[typeof o.leftIcon=="string"?(e.openBlock(),e.createBlock(e.unref(l),{key:0,name:o.leftIcon,class:e.normalizeClass([t.value])},null,8,["name","class"])):o.leftIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.leftIcon),{key:1,class:e.normalizeClass([t.value])},null,8,["class"])):e.createCommentVNode("v-if",!0)],!0),e.createCommentVNode(`
4
- @slot icon - The icon to display on the fab button
5
- `),C.value?e.renderSlot(o.$slots,"icon",{key:0},()=>[typeof o.icon=="string"?(e.openBlock(),e.createBlock(e.unref(l),{key:0,name:o.icon,class:e.normalizeClass([t.value])},null,8,["name","class"])):o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:1,class:e.normalizeClass([t.value])},null,8,["class"])):e.createCommentVNode("v-if",!0)],!0):e.createCommentVNode("v-if",!0),e.createCommentVNode(`
6
- @slot default - The content of the button
7
- `),e.renderSlot(o.$slots,"default",{},void 0,!0),e.createCommentVNode(`
8
- @slot left-icon - The icon to display on the left of the button
9
- `),i.value?e.renderSlot(o.$slots,"right-icon",{key:1},()=>[typeof o.rightIcon=="string"?(e.openBlock(),e.createBlock(e.unref(l),{key:0,name:o.rightIcon,class:e.normalizeClass([t.value])},null,8,["name","class"])):o.rightIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.rightIcon),{key:1,class:e.normalizeClass([t.value])},null,8,["class"])):e.createCommentVNode("v-if",!0)],!0):e.createCommentVNode("v-if",!0),v.value?(e.openBlock(),e.createElementBlock("div",g,[e.createVNode(e.unref(c),{size:"2em",color:o.color},null,8,["color"])])):e.createCommentVNode("v-if",!0)]),_:3},8,["disabled","class","type"]))}}),I=B._export_sfc(j,[["__scopeId","data-v-d3a1ed01"]]);exports.default=I;