maz-ui 3.32.2 → 3.33.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.
- package/components/MazPagination.d.ts +98 -0
- package/components/MazPagination.mjs +4 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.d.ts +2 -2
- package/components/MazTable.mjs +1 -1
- package/components/assets/MazPagination.css +1 -0
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/chunks/{MazBtn-BSbEqTOO.mjs → MazBtn-BdEnwPnp.mjs} +2 -2
- package/components/chunks/{MazBtn-EtLqM2iD.mjs → MazBtn-DEM8T_xK.mjs} +2 -2
- package/components/chunks/{MazCheckbox-BPkflsJh.mjs → MazCheckbox-DDw-_poJ.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CPcllL6q.mjs → MazCheckbox-DKvq4VIy.mjs} +1 -1
- package/components/chunks/{MazIcon-CtSznV7P.mjs → MazIcon-CSZF8Zgz.mjs} +1 -1
- package/components/chunks/MazPagination-Br-f0ZVV.mjs +389 -0
- package/components/chunks/{MazPhoneNumberInput-XtiVMdCD.mjs → MazPhoneNumberInput-srnmCNgX.mjs} +46 -45
- package/components/chunks/{MazSelect-DR7qJS0-.mjs → MazSelect-qw3H2BrO.mjs} +161 -160
- package/components/chunks/{MazSpinner-CzQz8yXB.mjs → MazSpinner-6_mdlWzG.mjs} +1 -1
- package/components/chunks/{MazSpinner-DqdhKhP4.mjs → MazSpinner-Ben5F7h9.mjs} +1 -1
- package/components/chunks/MazSpinner-DpeLSgmM.mjs +38 -0
- package/components/chunks/{MazSpinner-DB5-SHwJ.mjs → MazSpinner-Pnq_8QwR.mjs} +1 -1
- package/components/chunks/{MazTable-DX4Pdzt_.mjs → MazTable-BL_3hR2Z.mjs} +120 -119
- package/components/chunks/chevron-double-left-zoBBzOlh.mjs +30 -0
- package/components/chunks/ellipsis-horizontal-VGAsnCwV.mjs +30 -0
- package/components/index.d.ts +1 -0
- package/components/index.mjs +1 -0
- package/css/main.css +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +15 -15
- package/types/components/MazPagination.vue.d.ts +98 -0
- package/types/components/MazTable.vue.d.ts +2 -2
- package/types/components/index.d.ts +1 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import "../assets/MazPagination.css";
|
|
2
|
+
import { defineComponent as q, defineAsyncComponent as L, useAttrs as H, useSlots as J, onBeforeMount as K, computed as t, openBlock as s, createBlock as c, resolveDynamicComponent as F, normalizeClass as S, withCtx as k, createElementBlock as b, createCommentVNode as l, renderSlot as p, unref as m, createElementVNode as u, createVNode as v, mergeProps as h, createTextVNode as $, toDisplayString as M, Fragment as Q, renderList as W } from "vue";
|
|
3
|
+
const X = /* @__PURE__ */ q({
|
|
4
|
+
__name: "MazBtn",
|
|
5
|
+
props: {
|
|
6
|
+
variant: { default: "button" },
|
|
7
|
+
size: { default: "md" },
|
|
8
|
+
color: { default: "primary" },
|
|
9
|
+
type: { default: "button" },
|
|
10
|
+
rounded: { type: Boolean },
|
|
11
|
+
noRounded: { type: Boolean },
|
|
12
|
+
outline: { type: Boolean },
|
|
13
|
+
pastel: { type: Boolean },
|
|
14
|
+
block: { type: Boolean },
|
|
15
|
+
noUnderline: { type: Boolean },
|
|
16
|
+
noLeading: { type: Boolean },
|
|
17
|
+
loading: { type: Boolean },
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
fab: { type: Boolean },
|
|
20
|
+
icon: { default: void 0 },
|
|
21
|
+
leftIcon: { default: void 0 },
|
|
22
|
+
rightIcon: { default: void 0 },
|
|
23
|
+
noPadding: { type: Boolean },
|
|
24
|
+
noElevation: { type: Boolean },
|
|
25
|
+
contentClass: { default: void 0 }
|
|
26
|
+
},
|
|
27
|
+
setup(y) {
|
|
28
|
+
const V = L(() => import("./MazSpinner-DpeLSgmM.mjs")), d = L(() => import("./MazIcon-Cxrv3_OK.mjs")), { href: P, to: C } = H(), B = J(), e = y;
|
|
29
|
+
K(() => {
|
|
30
|
+
e.icon && !e.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
|
|
31
|
+
});
|
|
32
|
+
const I = t(() => P ? "a" : C ? "router-link" : "button"), i = t(
|
|
33
|
+
() => e.pastel ? `--${e.color}-pastel` : e.outline ? `--${e.color}-outline` : `--${e.color}`
|
|
34
|
+
), g = t(
|
|
35
|
+
() => (e.loading || e.disabled) && I.value === "button"
|
|
36
|
+
), f = t(() => g.value ? "--cursor-default" : "--cursor-pointer"), R = t(() => `--is-${e.variant}`), z = t(() => e.loading && e.variant === "button"), T = t(() => !!B["left-icon"] || e.leftIcon), E = t(() => !!B["right-icon"] || e.rightIcon), O = t(() => T.value || E.value), U = t(() => e.fab && (e.icon || !!B.icon)), w = t(() => I.value === "button" ? e.type : void 0);
|
|
37
|
+
return (a, j) => (s(), c(F(I.value), {
|
|
38
|
+
disabled: g.value,
|
|
39
|
+
class: S(["m-btn", [
|
|
40
|
+
`--${a.size}`,
|
|
41
|
+
i.value,
|
|
42
|
+
f.value,
|
|
43
|
+
R.value,
|
|
44
|
+
{
|
|
45
|
+
"--block": a.block,
|
|
46
|
+
"--no-underline": a.noUnderline,
|
|
47
|
+
"--no-leading": a.noLeading,
|
|
48
|
+
"--fab": a.fab,
|
|
49
|
+
"--loading": a.loading,
|
|
50
|
+
"--disabled": g.value,
|
|
51
|
+
"--icon": O.value,
|
|
52
|
+
"--rounded": a.rounded,
|
|
53
|
+
"--no-rounded": a.noRounded,
|
|
54
|
+
"--no-padding": a.noPadding,
|
|
55
|
+
"--no-elevation": a.noElevation
|
|
56
|
+
}
|
|
57
|
+
]]),
|
|
58
|
+
type: w.value
|
|
59
|
+
}, {
|
|
60
|
+
default: k(() => [
|
|
61
|
+
T.value ? (s(), b(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
key: 0,
|
|
65
|
+
class: S(["m-btn__icon-left maz-flex maz-flex-center", { "maz-invisible": z.value }])
|
|
66
|
+
},
|
|
67
|
+
[
|
|
68
|
+
l(`
|
|
69
|
+
@slot left-icon - The icon to display on the left of the button
|
|
70
|
+
`),
|
|
71
|
+
p(a.$slots, "left-icon", {}, () => [
|
|
72
|
+
typeof a.leftIcon == "string" ? (s(), c(m(d), {
|
|
73
|
+
key: 0,
|
|
74
|
+
name: a.leftIcon
|
|
75
|
+
}, null, 8, ["name"])) : a.leftIcon ? (s(), c(F(a.leftIcon), { key: 1 })) : l("v-if", !0)
|
|
76
|
+
], !0)
|
|
77
|
+
],
|
|
78
|
+
2
|
|
79
|
+
/* CLASS */
|
|
80
|
+
)) : l("v-if", !0),
|
|
81
|
+
U.value ? (s(), b(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
key: 1,
|
|
85
|
+
class: S(["m-btn__icon", { "maz-invisible": z.value }])
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
l(`
|
|
89
|
+
@slot icon - The icon to display on the fab button
|
|
90
|
+
`),
|
|
91
|
+
p(a.$slots, "icon", {}, () => [
|
|
92
|
+
typeof a.icon == "string" ? (s(), c(m(d), {
|
|
93
|
+
key: 0,
|
|
94
|
+
name: a.icon
|
|
95
|
+
}, null, 8, ["name"])) : a.icon ? (s(), c(F(a.icon), { key: 1 })) : l("v-if", !0)
|
|
96
|
+
], !0)
|
|
97
|
+
],
|
|
98
|
+
2
|
|
99
|
+
/* CLASS */
|
|
100
|
+
)) : l("v-if", !0),
|
|
101
|
+
a.$slots.default ? (s(), b(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
key: 2,
|
|
105
|
+
class: S([{ "maz-invisible": z.value }, a.contentClass])
|
|
106
|
+
},
|
|
107
|
+
[
|
|
108
|
+
l(`
|
|
109
|
+
@slot default - The content of the button
|
|
110
|
+
`),
|
|
111
|
+
p(a.$slots, "default", {}, void 0, !0)
|
|
112
|
+
],
|
|
113
|
+
2
|
|
114
|
+
/* CLASS */
|
|
115
|
+
)) : l("v-if", !0),
|
|
116
|
+
E.value ? (s(), b(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
key: 3,
|
|
120
|
+
class: S(["m-btn__icon-right", { "maz-invisible": z.value }])
|
|
121
|
+
},
|
|
122
|
+
[
|
|
123
|
+
l(`
|
|
124
|
+
@slot right-icon - The icon to display on the right of the button
|
|
125
|
+
`),
|
|
126
|
+
p(a.$slots, "right-icon", {}, () => [
|
|
127
|
+
typeof a.rightIcon == "string" ? (s(), c(m(d), {
|
|
128
|
+
key: 0,
|
|
129
|
+
name: a.rightIcon
|
|
130
|
+
}, null, 8, ["name"])) : a.rightIcon ? (s(), c(F(a.rightIcon), { key: 1 })) : l("v-if", !0)
|
|
131
|
+
], !0)
|
|
132
|
+
],
|
|
133
|
+
2
|
|
134
|
+
/* CLASS */
|
|
135
|
+
)) : l("v-if", !0),
|
|
136
|
+
z.value ? (s(), c(m(V), {
|
|
137
|
+
key: 4,
|
|
138
|
+
class: "m-btn-loader",
|
|
139
|
+
size: "2em",
|
|
140
|
+
color: a.color
|
|
141
|
+
}, null, 8, ["color"])) : l("v-if", !0)
|
|
142
|
+
]),
|
|
143
|
+
_: 3
|
|
144
|
+
/* FORWARDED */
|
|
145
|
+
}, 8, ["disabled", "class", "type"]));
|
|
146
|
+
}
|
|
147
|
+
}), G = (y, V) => {
|
|
148
|
+
const d = y.__vccOpts || y;
|
|
149
|
+
for (const [P, C] of V)
|
|
150
|
+
d[P] = C;
|
|
151
|
+
return d;
|
|
152
|
+
}, N = /* @__PURE__ */ G(X, [["__scopeId", "data-v-9a42c0cb"]]), Y = {
|
|
153
|
+
class: "m-pagination",
|
|
154
|
+
role: "navigation",
|
|
155
|
+
"aria-label": "page navigation"
|
|
156
|
+
}, Z = { class: "maz-sr-only" }, _ = { class: "maz-sr-only" }, x = ["id"], ee = { class: "maz-sr-only" }, ae = { class: "maz-sr-only" }, oe = { class: "maz-sr-only" }, ne = /* @__PURE__ */ q({
|
|
157
|
+
__name: "MazPagination",
|
|
158
|
+
props: {
|
|
159
|
+
modelValue: { default: 1 },
|
|
160
|
+
buttonProps: { default: void 0 },
|
|
161
|
+
resultsSize: { default: void 0 },
|
|
162
|
+
activeColor: { default: "primary" },
|
|
163
|
+
size: { default: "md" },
|
|
164
|
+
totalPages: {},
|
|
165
|
+
pageRange: { default: 2 },
|
|
166
|
+
loading: { type: Boolean }
|
|
167
|
+
},
|
|
168
|
+
emits: ["update:model-value"],
|
|
169
|
+
setup(y, { emit: V }) {
|
|
170
|
+
const d = L(() => import("./chevron-left-CcZaP3Rc.mjs")), P = L(() => import("./chevron-double-left-zoBBzOlh.mjs")), C = L(() => import("./ellipsis-horizontal-VGAsnCwV.mjs")), B = {
|
|
171
|
+
size: "md",
|
|
172
|
+
color: "theme",
|
|
173
|
+
outline: !0,
|
|
174
|
+
noElevation: !0,
|
|
175
|
+
fab: !0
|
|
176
|
+
}, e = y, I = V, i = t(() => ({
|
|
177
|
+
...B,
|
|
178
|
+
...e.buttonProps
|
|
179
|
+
})), g = t(() => e.modelValue > 1 ? e.modelValue - 1 : 1), f = t(
|
|
180
|
+
() => e.modelValue < e.totalPages ? e.modelValue + 1 : e.totalPages
|
|
181
|
+
), R = t(
|
|
182
|
+
() => Array.from({ length: e.totalPages }, (o, r) => {
|
|
183
|
+
const n = r + 1;
|
|
184
|
+
return {
|
|
185
|
+
number: n,
|
|
186
|
+
isActive: n === e.modelValue,
|
|
187
|
+
loading: n === e.modelValue && e.loading
|
|
188
|
+
};
|
|
189
|
+
})
|
|
190
|
+
), z = t(
|
|
191
|
+
() => e.modelValue - e.pageRange > 1 ? R.value.slice(0, 1) : []
|
|
192
|
+
), T = t(
|
|
193
|
+
() => e.modelValue < e.totalPages - e.pageRange ? R.value.slice(-1) : []
|
|
194
|
+
), E = t(() => e.modelValue - e.pageRange - 1 < 0 ? 0 : e.modelValue - e.pageRange - 1 > e.totalPages - e.pageRange ? e.totalPages - e.pageRange : e.modelValue - e.pageRange - 1), O = t(
|
|
195
|
+
() => e.modelValue + e.pageRange > e.totalPages ? e.totalPages : e.modelValue + e.pageRange < e.pageRange ? e.pageRange : e.modelValue + e.pageRange
|
|
196
|
+
), U = t(() => R.value.slice(E.value, O.value)), w = t(
|
|
197
|
+
() => e.modelValue - e.pageRange > 2 ? [{ divider: !0 }] : []
|
|
198
|
+
), a = t(
|
|
199
|
+
() => e.modelValue < e.totalPages - e.pageRange - 1 ? [{ divider: !0 }] : []
|
|
200
|
+
), j = t(() => [
|
|
201
|
+
...z.value,
|
|
202
|
+
...w.value,
|
|
203
|
+
...U.value,
|
|
204
|
+
...a.value,
|
|
205
|
+
...T.value
|
|
206
|
+
]);
|
|
207
|
+
function A(o) {
|
|
208
|
+
o !== e.modelValue && I("update:model-value", o);
|
|
209
|
+
}
|
|
210
|
+
return (o, r) => (s(), b("nav", Y, [
|
|
211
|
+
u("ul", null, [
|
|
212
|
+
u("li", null, [
|
|
213
|
+
v(N, h(i.value, {
|
|
214
|
+
disabled: o.modelValue === 1,
|
|
215
|
+
"aria-label": "First Page, Page 1",
|
|
216
|
+
"aria-setsize": o.resultsSize ?? void 0,
|
|
217
|
+
"aria-posinset": "1",
|
|
218
|
+
size: o.size,
|
|
219
|
+
onClick: r[0] || (r[0] = (n) => A(1))
|
|
220
|
+
}), {
|
|
221
|
+
default: k(() => [
|
|
222
|
+
u("span", Z, [
|
|
223
|
+
l(`
|
|
224
|
+
@slot Accessible text for screen reader of the previous page button
|
|
225
|
+
@binding {number} page - first page number
|
|
226
|
+
`),
|
|
227
|
+
p(o.$slots, "first-page-sr", { page: 1 }, () => [
|
|
228
|
+
$("First Page, page 1")
|
|
229
|
+
], !0)
|
|
230
|
+
]),
|
|
231
|
+
v(m(P))
|
|
232
|
+
]),
|
|
233
|
+
_: 3
|
|
234
|
+
/* FORWARDED */
|
|
235
|
+
}, 16, ["disabled", "aria-setsize", "size"])
|
|
236
|
+
]),
|
|
237
|
+
u("li", null, [
|
|
238
|
+
v(N, h(i.value, {
|
|
239
|
+
disabled: o.modelValue === 1,
|
|
240
|
+
"aria-label": `Previous Page, Page ${g.value}`,
|
|
241
|
+
"aria-setsize": o.resultsSize ?? void 0,
|
|
242
|
+
"aria-posinset": g.value,
|
|
243
|
+
size: o.size,
|
|
244
|
+
onClick: r[1] || (r[1] = (n) => A(g.value))
|
|
245
|
+
}), {
|
|
246
|
+
default: k(() => [
|
|
247
|
+
u("span", _, [
|
|
248
|
+
l(`
|
|
249
|
+
@slot Accessible text for screen reader of the first page button
|
|
250
|
+
@binding {number} page - previous page number
|
|
251
|
+
`),
|
|
252
|
+
p(o.$slots, "previous-page-sr", { page: g.value }, () => [
|
|
253
|
+
$(
|
|
254
|
+
" Previous Page, page " + M(g.value),
|
|
255
|
+
1
|
|
256
|
+
/* TEXT */
|
|
257
|
+
)
|
|
258
|
+
], !0)
|
|
259
|
+
]),
|
|
260
|
+
v(m(d))
|
|
261
|
+
]),
|
|
262
|
+
_: 3
|
|
263
|
+
/* FORWARDED */
|
|
264
|
+
}, 16, ["disabled", "aria-label", "aria-setsize", "aria-posinset", "size"])
|
|
265
|
+
]),
|
|
266
|
+
(s(!0), b(
|
|
267
|
+
Q,
|
|
268
|
+
null,
|
|
269
|
+
W(j.value, (n, D) => (s(), b("li", {
|
|
270
|
+
id: "number" in n ? `button-${D}-${n.number}` : `ellipsis-${D}`,
|
|
271
|
+
key: "number" in n ? `button-${D}-${n.number}` : `ellipsis-${D}`
|
|
272
|
+
}, [
|
|
273
|
+
"number" in n ? (s(), c(N, h({ key: 0 }, {
|
|
274
|
+
...i.value,
|
|
275
|
+
color: n.isActive ? o.activeColor : i.value.color,
|
|
276
|
+
outline: n.isActive ? !1 : i.value.outline
|
|
277
|
+
}, {
|
|
278
|
+
size: o.size,
|
|
279
|
+
"aria-label": `Page ${n.number}`,
|
|
280
|
+
"aria-current": n.isActive ? "true" : "false",
|
|
281
|
+
"aria-setsize": o.resultsSize ?? void 0,
|
|
282
|
+
loading: n.loading,
|
|
283
|
+
"aria-posinset": n.number,
|
|
284
|
+
class: { active: n.isActive },
|
|
285
|
+
onClick: (te) => n.isActive ? void 0 : A(n.number)
|
|
286
|
+
}), {
|
|
287
|
+
default: k(() => [
|
|
288
|
+
u("span", ee, [
|
|
289
|
+
l(`
|
|
290
|
+
@slot Accessible text for screen reader of the current page button
|
|
291
|
+
@binding {number} page - current page number
|
|
292
|
+
`),
|
|
293
|
+
p(o.$slots, "page-sr", {
|
|
294
|
+
page: n.number
|
|
295
|
+
}, () => [
|
|
296
|
+
$(
|
|
297
|
+
"Page " + M(n.number),
|
|
298
|
+
1
|
|
299
|
+
/* TEXT */
|
|
300
|
+
)
|
|
301
|
+
], !0)
|
|
302
|
+
]),
|
|
303
|
+
$(
|
|
304
|
+
" " + M(n.number),
|
|
305
|
+
1
|
|
306
|
+
/* TEXT */
|
|
307
|
+
)
|
|
308
|
+
]),
|
|
309
|
+
_: 2
|
|
310
|
+
/* DYNAMIC */
|
|
311
|
+
}, 1040, ["size", "aria-label", "aria-current", "aria-setsize", "loading", "aria-posinset", "class", "onClick"])) : n.divider ? (s(), b(
|
|
312
|
+
"div",
|
|
313
|
+
h({ key: 1 }, i.value, { class: "flex p-2 flex-center" }),
|
|
314
|
+
[
|
|
315
|
+
v(m(C))
|
|
316
|
+
],
|
|
317
|
+
16
|
|
318
|
+
/* FULL_PROPS */
|
|
319
|
+
)) : l("v-if", !0)
|
|
320
|
+
], 8, x))),
|
|
321
|
+
128
|
|
322
|
+
/* KEYED_FRAGMENT */
|
|
323
|
+
)),
|
|
324
|
+
u("li", null, [
|
|
325
|
+
v(N, h(i.value, {
|
|
326
|
+
disabled: o.modelValue === o.totalPages,
|
|
327
|
+
"aria-label": `Next Page, Page ${f.value}`,
|
|
328
|
+
"aria-setsize": o.resultsSize ?? void 0,
|
|
329
|
+
"aria-posinset": f.value,
|
|
330
|
+
size: o.size,
|
|
331
|
+
onClick: r[2] || (r[2] = (n) => A(f.value))
|
|
332
|
+
}), {
|
|
333
|
+
default: k(() => [
|
|
334
|
+
u("span", ae, [
|
|
335
|
+
l(`
|
|
336
|
+
@slot Accessible text for screen reader of the next page button
|
|
337
|
+
@binding {number} page - next page number
|
|
338
|
+
`),
|
|
339
|
+
p(o.$slots, "next-page-sr", { page: f.value }, () => [
|
|
340
|
+
$(
|
|
341
|
+
"Next Page, page " + M(f.value),
|
|
342
|
+
1
|
|
343
|
+
/* TEXT */
|
|
344
|
+
)
|
|
345
|
+
], !0)
|
|
346
|
+
]),
|
|
347
|
+
v(m(d), { class: "-maz-rotate-180" })
|
|
348
|
+
]),
|
|
349
|
+
_: 3
|
|
350
|
+
/* FORWARDED */
|
|
351
|
+
}, 16, ["disabled", "aria-label", "aria-setsize", "aria-posinset", "size"])
|
|
352
|
+
]),
|
|
353
|
+
u("li", null, [
|
|
354
|
+
v(N, h(i.value, {
|
|
355
|
+
disabled: o.modelValue === o.totalPages,
|
|
356
|
+
"aria-label": `Next Page, Page ${o.totalPages}`,
|
|
357
|
+
"aria-setsize": o.resultsSize ?? void 0,
|
|
358
|
+
"aria-posinset": o.totalPages,
|
|
359
|
+
size: o.size,
|
|
360
|
+
onClick: r[3] || (r[3] = (n) => A(o.totalPages))
|
|
361
|
+
}), {
|
|
362
|
+
default: k(() => [
|
|
363
|
+
u("span", oe, [
|
|
364
|
+
l(`
|
|
365
|
+
@slot Accessible text for screen reader of the last page button
|
|
366
|
+
@binding {number} page - last page number
|
|
367
|
+
`),
|
|
368
|
+
p(o.$slots, "last-page-sr", { page: o.totalPages }, () => [
|
|
369
|
+
$(
|
|
370
|
+
"Last Page, page " + M(o.totalPages),
|
|
371
|
+
1
|
|
372
|
+
/* TEXT */
|
|
373
|
+
)
|
|
374
|
+
], !0)
|
|
375
|
+
]),
|
|
376
|
+
v(m(P), { class: "-maz-rotate-180" })
|
|
377
|
+
]),
|
|
378
|
+
_: 3
|
|
379
|
+
/* FORWARDED */
|
|
380
|
+
}, 16, ["disabled", "aria-label", "aria-setsize", "aria-posinset", "size"])
|
|
381
|
+
])
|
|
382
|
+
])
|
|
383
|
+
]));
|
|
384
|
+
}
|
|
385
|
+
}), ie = /* @__PURE__ */ G(ne, [["__scopeId", "data-v-0b7b19dd"]]);
|
|
386
|
+
export {
|
|
387
|
+
ie as M,
|
|
388
|
+
G as _
|
|
389
|
+
};
|
package/components/chunks/{MazPhoneNumberInput-XtiVMdCD.mjs → MazPhoneNumberInput-srnmCNgX.mjs}
RENAMED
|
@@ -4,7 +4,7 @@ import { isSupportedCountry as Ye, getCountryCallingCode as Ce, getExampleNumber
|
|
|
4
4
|
function Fe(r) {
|
|
5
5
|
return !!r;
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const $e = ({
|
|
8
8
|
componentName: r,
|
|
9
9
|
instance: u,
|
|
10
10
|
providedId: a
|
|
@@ -195,7 +195,7 @@ const fo = {
|
|
|
195
195
|
},
|
|
196
196
|
emits: ["update:model-value", "focus", "blur", "click", "change"],
|
|
197
197
|
setup(r, { emit: u }) {
|
|
198
|
-
const a = R(() => import("./MazBtn-
|
|
198
|
+
const a = R(() => import("./MazBtn-BdEnwPnp.mjs")), B = R(() => import("./MazIcon-Cxrv3_OK.mjs")), k = R(() => import("./eye-slash-tjfxO0LK.mjs")), H = R(() => import("./eye-DqO_Jx56.mjs")), D = R(() => import("./check-7UA4j2f2.mjs")), t = r, S = u, $ = h(!1), c = h(!1), i = h(), te = ke(), le = $e({
|
|
199
199
|
componentName: "MazInput",
|
|
200
200
|
instance: te,
|
|
201
201
|
providedId: t.id
|
|
@@ -204,7 +204,7 @@ const fo = {
|
|
|
204
204
|
var l;
|
|
205
205
|
t.autoFocus && ((l = i.value) == null || l.focus());
|
|
206
206
|
});
|
|
207
|
-
const W = d(() => t.type === "password"), A = d(() =>
|
|
207
|
+
const W = d(() => t.type === "password"), A = d(() => $.value ? "text" : t.type), w = d(() => {
|
|
208
208
|
if (!t.noBorder) {
|
|
209
209
|
if (t.error)
|
|
210
210
|
return "maz-border-danger";
|
|
@@ -232,7 +232,7 @@ const fo = {
|
|
|
232
232
|
}
|
|
233
233
|
return "--default-border";
|
|
234
234
|
}
|
|
235
|
-
}),
|
|
235
|
+
}), P = Ne(), L = d(() => {
|
|
236
236
|
const { required: l, placeholder: g } = t;
|
|
237
237
|
if (g)
|
|
238
238
|
return l ? `${g} *` : g;
|
|
@@ -250,10 +250,10 @@ const fo = {
|
|
|
250
250
|
}
|
|
251
251
|
}), U = d(() => (!!t.label || !!t.hint) && (c.value || !!x.value || !!t.placeholder || ["date", "month", "week"].includes(t.type))), Y = d(() => !!t.label || !!t.hint);
|
|
252
252
|
function N() {
|
|
253
|
-
return
|
|
253
|
+
return !!P["right-icon"] || W.value || !!P["valid-button"] || t.validButton || !!t.rightIcon;
|
|
254
254
|
}
|
|
255
255
|
function ne() {
|
|
256
|
-
return
|
|
256
|
+
return !!P["left-icon"] || !!t.leftIcon;
|
|
257
257
|
}
|
|
258
258
|
function K(l) {
|
|
259
259
|
S("focus", l), c.value = !0;
|
|
@@ -378,10 +378,10 @@ const fo = {
|
|
|
378
378
|
color: "transparent",
|
|
379
379
|
tabindex: "-1",
|
|
380
380
|
size: "mini",
|
|
381
|
-
onClick: g[2] || (g[2] = ue((v) =>
|
|
381
|
+
onClick: g[2] || (g[2] = ue((v) => $.value = !$.value, ["stop"]))
|
|
382
382
|
}, {
|
|
383
383
|
default: se(() => [
|
|
384
|
-
|
|
384
|
+
$.value ? (y(), M(C(k), {
|
|
385
385
|
key: 0,
|
|
386
386
|
class: "maz-text-xl maz-text-muted"
|
|
387
387
|
})) : (y(), M(C(H), {
|
|
@@ -422,23 +422,23 @@ const fo = {
|
|
|
422
422
|
/* CLASS, STYLE */
|
|
423
423
|
));
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), Pe = (r, u) => {
|
|
426
426
|
const a = r.__vccOpts || r;
|
|
427
427
|
for (const [B, k] of u)
|
|
428
428
|
a[B] = k;
|
|
429
429
|
return a;
|
|
430
|
-
}, we = /* @__PURE__ */
|
|
430
|
+
}, we = /* @__PURE__ */ Pe(ho, [["__scopeId", "data-v-2b90b4c7"]]);
|
|
431
431
|
h("system");
|
|
432
432
|
h("system");
|
|
433
433
|
let ge = null;
|
|
434
434
|
function bo(r, u) {
|
|
435
435
|
ge && clearTimeout(ge), ge = setTimeout(r, u);
|
|
436
436
|
}
|
|
437
|
-
const go = { class: "m-select-list__no-results" },
|
|
437
|
+
const go = ["aria-label"], zo = { class: "m-select-list__no-results" }, Co = {
|
|
438
438
|
key: 2,
|
|
439
439
|
class: "m-select-list__scroll-wrapper",
|
|
440
440
|
tabindex: "-1"
|
|
441
|
-
},
|
|
441
|
+
}, Vo = ["onClick"], wo = /* @__PURE__ */ Ie({
|
|
442
442
|
inheritAttrs: !1,
|
|
443
443
|
__name: "MazSelect",
|
|
444
444
|
props: {
|
|
@@ -466,11 +466,11 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
466
466
|
emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
|
|
467
467
|
setup(r, { emit: u }) {
|
|
468
468
|
Ue((e) => ({
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
469
|
+
"4675cece": W.value,
|
|
470
|
+
"0e35d418": te.value,
|
|
471
|
+
"2238cc80": le.value
|
|
472
472
|
}));
|
|
473
|
-
const a = R(() => import("./MazCheckbox-
|
|
473
|
+
const a = R(() => import("./MazCheckbox-DDw-_poJ.mjs")), B = R(() => import("./magnifying-glass-DZGg7953.mjs")), k = R(() => import("./chevron-down-CzMH-gFW.mjs")), H = R(() => import("./no-symbol-QAqP9IlR.mjs")), D = ke(), t = r, S = u, $ = h(!1), c = h(), i = d(
|
|
474
474
|
() => ["black", "transparent", "white"].includes(t.color)
|
|
475
475
|
), te = d(
|
|
476
476
|
() => i.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
@@ -478,11 +478,11 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
478
478
|
() => i.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
479
479
|
), W = d(
|
|
480
480
|
() => i.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
481
|
-
), A = d(() =>
|
|
481
|
+
), A = d(() => $.value || t.open), w = $e({
|
|
482
482
|
componentName: "MazSelect",
|
|
483
483
|
instance: D,
|
|
484
484
|
providedId: t.id
|
|
485
|
-
}),
|
|
485
|
+
}), P = d(
|
|
486
486
|
() => {
|
|
487
487
|
var e;
|
|
488
488
|
return (e = t.options) == null ? void 0 : e.map((o) => typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? {
|
|
@@ -499,7 +499,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
499
499
|
), L = d(
|
|
500
500
|
() => {
|
|
501
501
|
var e;
|
|
502
|
-
return ((e =
|
|
502
|
+
return ((e = P.value) == null ? void 0 : e.filter((o) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(o[t.optionValueKey]) && !U(o[t.optionValueKey]) : !1 : t.modelValue === o[t.optionValueKey] && !U(o[t.optionValueKey]))) ?? [];
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
505
|
Re(() => {
|
|
@@ -518,9 +518,9 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
518
518
|
return t.multiple && t.modelValue && Array.isArray(t.modelValue) ? t.modelValue.map(
|
|
519
519
|
(n) => {
|
|
520
520
|
var s, p;
|
|
521
|
-
return (p = (s =
|
|
521
|
+
return (p = (s = P.value) == null ? void 0 : s.find((V) => V[t.optionValueKey] === n)) == null ? void 0 : p[t.optionInputValueKey];
|
|
522
522
|
}
|
|
523
|
-
).join(", ") : (o = (e =
|
|
523
|
+
).join(", ") : (o = (e = P.value) == null ? void 0 : e.find(
|
|
524
524
|
(n) => n[t.optionValueKey] === t.modelValue
|
|
525
525
|
)) == null ? void 0 : o[t.optionInputValueKey];
|
|
526
526
|
}), ne = d(
|
|
@@ -534,25 +534,25 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
534
534
|
);
|
|
535
535
|
function g(e) {
|
|
536
536
|
var o;
|
|
537
|
-
return e ? (o =
|
|
537
|
+
return e ? (o = P.value) == null ? void 0 : o.filter((n) => {
|
|
538
538
|
const s = n[t.optionLabelKey], p = n[t.optionValueKey], V = n[t.optionInputValueKey];
|
|
539
539
|
return l(s, e) || l(p, e) || l(V, e);
|
|
540
|
-
}) :
|
|
540
|
+
}) : P.value;
|
|
541
541
|
}
|
|
542
542
|
const v = d(() => g(K.value)), z = async (e) => {
|
|
543
543
|
var o;
|
|
544
544
|
if (e && ("relatedTarget" in e && ((o = x.value) != null && o.contains(e.relatedTarget)) || e.type === "keydown"))
|
|
545
545
|
return e.preventDefault();
|
|
546
|
-
await X(),
|
|
546
|
+
await X(), $.value = !1, c.value = 0, S("close", e);
|
|
547
547
|
}, j = async (e) => {
|
|
548
|
-
t.disabled || A.value || (e == null || e.preventDefault(),
|
|
548
|
+
t.disabled || A.value || (e == null || e.preventDefault(), $.value = !0, await G(), S("focus", e), S("open", $.value));
|
|
549
549
|
};
|
|
550
550
|
function ie() {
|
|
551
551
|
var e, o;
|
|
552
552
|
(o = ((e = q.value) == null ? void 0 : e.$el).querySelector("input")) == null || o.focus();
|
|
553
553
|
}
|
|
554
554
|
function ye(e) {
|
|
555
|
-
|
|
555
|
+
$.value ? z(e) : ie();
|
|
556
556
|
}
|
|
557
557
|
function de(e) {
|
|
558
558
|
var o, n;
|
|
@@ -636,7 +636,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
636
636
|
class: "m-select-input"
|
|
637
637
|
}, e.$attrs, {
|
|
638
638
|
required: e.required,
|
|
639
|
-
"border-active":
|
|
639
|
+
"border-active": $.value,
|
|
640
640
|
color: e.color,
|
|
641
641
|
"model-value": N.value,
|
|
642
642
|
autocomplete: "off",
|
|
@@ -652,10 +652,11 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
652
652
|
tabindex: "-1",
|
|
653
653
|
type: "button",
|
|
654
654
|
class: "m-select-input__toggle-button maz-custom",
|
|
655
|
+
"aria-label": `${A.value ? "collapse" : "expand"} list of options`,
|
|
655
656
|
onClick: ue(ye, ["stop"])
|
|
656
657
|
}, [
|
|
657
658
|
J(C(k), { class: "m-select-chevron maz-text-xl" })
|
|
658
|
-
])
|
|
659
|
+
], 8, go)
|
|
659
660
|
]),
|
|
660
661
|
_: 1
|
|
661
662
|
/* STABLE */
|
|
@@ -703,10 +704,10 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
703
704
|
@slot No results slot - Displayed when no results corresponding with search query
|
|
704
705
|
`),
|
|
705
706
|
!v.value || v.value.length <= 0 ? Z(e.$slots, "no-results", { key: 1 }, () => [
|
|
706
|
-
O("span",
|
|
707
|
+
O("span", zo, [
|
|
707
708
|
J(C(H), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
708
709
|
])
|
|
709
|
-
], !0) : (y(), I("div",
|
|
710
|
+
], !0) : (y(), I("div", Co, [
|
|
710
711
|
(y(!0), I(
|
|
711
712
|
qe,
|
|
712
713
|
null,
|
|
@@ -748,7 +749,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
748
749
|
/* TEXT */
|
|
749
750
|
)
|
|
750
751
|
], !0)
|
|
751
|
-
], 14,
|
|
752
|
+
], 14, Vo))),
|
|
752
753
|
128
|
|
753
754
|
/* KEYED_FRAGMENT */
|
|
754
755
|
))
|
|
@@ -766,10 +767,10 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
766
767
|
/* CLASS, STYLE, NEED_HYDRATION */
|
|
767
768
|
));
|
|
768
769
|
}
|
|
769
|
-
}),
|
|
770
|
+
}), Io = /* @__PURE__ */ Pe(wo, [["__scopeId", "data-v-0fceffd9"]]), ko = ["id"], So = {
|
|
770
771
|
key: 0,
|
|
771
772
|
class: "maz-text-lg"
|
|
772
|
-
},
|
|
773
|
+
}, $o = /* @__PURE__ */ Ie({
|
|
773
774
|
inheritAttrs: !1,
|
|
774
775
|
__name: "MazPhoneNumberInput",
|
|
775
776
|
props: {
|
|
@@ -816,8 +817,8 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
816
817
|
getCountriesList: D,
|
|
817
818
|
getPhoneNumberExample: t,
|
|
818
819
|
sanitizePhoneNumber: S,
|
|
819
|
-
loadPhoneNumberExamplesFile:
|
|
820
|
-
} = io(), c = u, i = r, te = ke(), le =
|
|
820
|
+
loadPhoneNumberExamplesFile: $
|
|
821
|
+
} = io(), c = u, i = r, te = ke(), le = $e({
|
|
821
822
|
componentName: "MazPhoneNumberInput",
|
|
822
823
|
instance: te,
|
|
823
824
|
providedId: i.id
|
|
@@ -825,7 +826,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
825
826
|
start: 0,
|
|
826
827
|
end: 0,
|
|
827
828
|
cursorAtEnd: !0
|
|
828
|
-
}),
|
|
829
|
+
}), P = h(!1), L = h(!1), x = d(() => D(i.countryLocale, i.customCountriesList)), q = d(() => {
|
|
829
830
|
var e;
|
|
830
831
|
return (e = x.value) == null ? void 0 : e.filter((o) => {
|
|
831
832
|
var n;
|
|
@@ -858,7 +859,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
858
859
|
if (i.placeholder)
|
|
859
860
|
return i.placeholder;
|
|
860
861
|
const e = N.value.phoneInput.placeholder;
|
|
861
|
-
if (i.noExample ||
|
|
862
|
+
if (i.noExample || !P.value)
|
|
862
863
|
return e;
|
|
863
864
|
{
|
|
864
865
|
const o = t(f.value);
|
|
@@ -902,7 +903,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
902
903
|
}
|
|
903
904
|
async function ie() {
|
|
904
905
|
try {
|
|
905
|
-
!i.noExample &&
|
|
906
|
+
!i.noExample && !P.value && (await $(), P.value = !0);
|
|
906
907
|
} catch {
|
|
907
908
|
console.error("[maz-ui](MazPhoneNumberInput) while loading phone number examples file");
|
|
908
909
|
}
|
|
@@ -1025,7 +1026,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
1025
1026
|
2
|
|
1026
1027
|
/* CLASS */
|
|
1027
1028
|
)) : m("v-if", !0),
|
|
1028
|
-
e.noCountrySelector ? m("v-if", !0) : (y(), M(
|
|
1029
|
+
e.noCountrySelector ? m("v-if", !0) : (y(), M(Io, {
|
|
1029
1030
|
key: 1,
|
|
1030
1031
|
ref_key: "CountrySelector",
|
|
1031
1032
|
ref: A,
|
|
@@ -1061,7 +1062,7 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
1061
1062
|
}])
|
|
1062
1063
|
},
|
|
1063
1064
|
[
|
|
1064
|
-
!e.noFlags && typeof b.iso2 == "string" ? (y(), I("span",
|
|
1065
|
+
!e.noFlags && typeof b.iso2 == "string" ? (y(), I("span", So, [
|
|
1065
1066
|
m(`
|
|
1066
1067
|
@slot Country list flag
|
|
1067
1068
|
@binding {String} country-code - country code of option - Ex: \`"FR"\`
|
|
@@ -1132,12 +1133,12 @@ const go = { class: "m-select-list__no-results" }, zo = {
|
|
|
1132
1133
|
onBlur: o[3] || (o[3] = (b) => L.value = !1),
|
|
1133
1134
|
"onUpdate:modelValue": o[4] || (o[4] = (b) => ce(b))
|
|
1134
1135
|
}), null, 16, ["id", "model-value", "label", "disabled", "color", "error", "size", "success", "class"])
|
|
1135
|
-
], 14,
|
|
1136
|
+
], 14, ko);
|
|
1136
1137
|
};
|
|
1137
1138
|
}
|
|
1138
|
-
}),
|
|
1139
|
+
}), Lo = /* @__PURE__ */ Pe($o, [["__scopeId", "data-v-3bb3ee5f"]]);
|
|
1139
1140
|
export {
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1141
|
+
Lo as M,
|
|
1142
|
+
Pe as _,
|
|
1143
|
+
$e as u
|
|
1143
1144
|
};
|