maz-ui 3.25.1 → 3.25.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 (44) hide show
  1. package/components/MazBadge.mjs +6 -6
  2. package/components/MazCard.d.ts +3 -1
  3. package/components/MazCard.mjs +1 -1
  4. package/components/MazCheckbox.mjs +10 -10
  5. package/components/MazPhoneNumberInput.mjs +1 -1
  6. package/components/MazSelect.mjs +1 -1
  7. package/components/MazTabsBar.d.ts +3 -3
  8. package/components/MazTabsBar.mjs +104 -2
  9. package/components/assets/MazBadge.css +1 -1
  10. package/components/assets/MazCard.css +1 -1
  11. package/components/assets/MazCheckbox.css +1 -1
  12. package/components/assets/MazTabsBar.css +1 -1
  13. package/components/chunks/{MazBtn-V74h4t6N.mjs → MazBtn-E_7uvjFN.mjs} +2 -2
  14. package/components/chunks/{MazBtn-8jL2kd1s.mjs → MazBtn-fgZZAln0.mjs} +2 -2
  15. package/components/chunks/{MazBtn-JxVNeBVQ.mjs → MazBtn-wAxVJRSU.mjs} +2 -2
  16. package/components/chunks/{MazCard-kNaVJd_g.mjs → MazCard-AcRp4dYY.mjs} +17 -15
  17. package/components/chunks/{MazCheckbox-jW6eRxo-.mjs → MazCheckbox-Ur6iYj4S.mjs} +9 -9
  18. package/components/chunks/{MazCheckbox-PPOcnk4M.mjs → MazCheckbox-jGECM3j3.mjs} +9 -9
  19. package/components/chunks/{MazGallery-FIb-5maS.mjs → MazGallery-p-vm15yn.mjs} +1 -1
  20. package/components/chunks/{MazPhoneNumberInput--P0rJeR6.mjs → MazPhoneNumberInput-UpZj2xCt.mjs} +2 -2
  21. package/components/chunks/{MazSelect-mFss30EN.mjs → MazSelect-0T1qVxT5.mjs} +2 -2
  22. package/components/chunks/{MazSpinner-hj4vBKGe.mjs → MazSpinner-0anK9siv.mjs} +1 -1
  23. package/components/chunks/{MazSpinner-0_bDB0ly.mjs → MazSpinner-GDyFbUT-.mjs} +1 -1
  24. package/components/chunks/{MazSpinner-e-wVuIa6.mjs → MazSpinner-ymiFQY_u.mjs} +1 -1
  25. package/components/chunks/{MazTransitionExpand-k3LqGgNc.mjs → MazTransitionExpand-H8rF9skG.mjs} +1 -1
  26. package/css/main.css +1 -1
  27. package/modules/chunks/{MazBtn-Dh9CWXCs.mjs → MazBtn-JRiYAnNE.mjs} +2 -2
  28. package/modules/chunks/{MazBtn-7fc6CaEx.cjs → MazBtn-XlYmCiY7.cjs} +1 -1
  29. package/modules/chunks/{MazIcon-rmruhJWI.cjs → MazIcon-1rUbp3IR.cjs} +1 -1
  30. package/modules/chunks/{MazIcon-O2qhlLgd.mjs → MazIcon-jN7MCOTm.mjs} +1 -1
  31. package/modules/chunks/{MazSpinner-D_vmUW7o.cjs → MazSpinner-9nuTFEMU.cjs} +1 -1
  32. package/modules/chunks/{MazSpinner-NY1ndqV7.mjs → MazSpinner-U-92TzUo.mjs} +1 -1
  33. package/modules/chunks/{index-A4ZKAAN1.mjs → index-0wbCxej8.mjs} +3 -3
  34. package/modules/chunks/{index-4-P6-Fmb.cjs → index-fNfaYOpu.cjs} +2 -2
  35. package/modules/index.cjs +1 -1
  36. package/modules/index.mjs +1 -1
  37. package/nuxt/index.json +1 -1
  38. package/package.json +1 -1
  39. package/types/components/MazCard.vue.d.ts +3 -1
  40. package/types/components/MazTabsBar.vue.d.ts +3 -3
  41. package/components/chunks/MazBtn-Qa9DSsQk.mjs +0 -152
  42. package/components/chunks/MazIcon-4RyBw86a.mjs +0 -96
  43. package/components/chunks/MazSpinner-o7NBR-qR.mjs +0 -38
  44. package/components/chunks/MazTabsBar-WKO9upP5.mjs +0 -131
@@ -1,152 +0,0 @@
1
- import "../assets/MazBtn.css";
2
- import { defineComponent as M, defineAsyncComponent as z, useAttrs as E, useSlots as L, onBeforeMount as R, computed as t, openBlock as o, createBlock as i, resolveDynamicComponent as w, normalizeClass as u, withCtx as A, createElementBlock as v, renderSlot as r, unref as d, createCommentVNode as a, createElementVNode as D } from "vue";
3
- import { _ as N } from "./MazTabsBar-WKO9upP5.mjs";
4
- const P = /* @__PURE__ */ M({
5
- __name: "MazBtn",
6
- props: {
7
- variant: {
8
- type: String,
9
- default: "button",
10
- validator: (e) => ["button", "link"].includes(e)
11
- },
12
- size: {
13
- type: String,
14
- default: "md",
15
- validator: (e) => ["mini", "xs", "sm", "md", "lg", "xl"].includes(e)
16
- },
17
- color: {
18
- type: String,
19
- default: "primary"
20
- },
21
- type: {
22
- type: String,
23
- default: "button",
24
- validator: (e) => ["button", "submit", "reset"].includes(e)
25
- },
26
- rounded: { type: Boolean, default: !1 },
27
- noRounded: { type: Boolean, default: !1 },
28
- outline: { type: Boolean, default: !1 },
29
- pastel: { type: Boolean, default: !1 },
30
- block: { type: Boolean, default: !1 },
31
- noUnderline: { type: Boolean, default: !1 },
32
- noLeading: { type: Boolean, default: !1 },
33
- loading: { type: Boolean, default: !1 },
34
- disabled: { type: Boolean, default: !1 },
35
- fab: { type: Boolean, default: !1 },
36
- icon: { type: String, default: void 0 },
37
- leftIcon: { type: String, default: void 0 },
38
- rightIcon: { type: String, default: void 0 },
39
- noPadding: { type: Boolean, default: !1 },
40
- noElevation: { type: Boolean, default: !1 }
41
- },
42
- setup(e) {
43
- const p = z(() => import("./MazSpinner-hj4vBKGe.mjs")), c = z(() => import("./MazIcon-4RyBw86a.mjs")), { href: B, to: h } = E(), b = L(), n = e;
44
- R(() => {
45
- n.icon && !n.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
46
- });
47
- const f = t(() => B ? "a" : h ? "router-link" : "button"), k = t(
48
- () => n.pastel ? `--${n.color}-pastel` : n.outline ? `--${n.color}-outline` : `--${n.color}`
49
- ), m = t(
50
- () => (n.loading || n.disabled) && f.value === "button"
51
- ), I = t(() => m.value ? "--cursor-default" : "--cursor-pointer"), x = t(() => `--is-${n.variant}`), l = t(() => n.loading && n.variant === "button"), y = t(() => !!b["left-icon"] || n.leftIcon), g = t(() => !!b["right-icon"] || n.rightIcon), C = t(() => y.value || g.value), S = t(() => n.fab && n.icon), $ = t(() => f.value === "button" ? n.type : void 0);
52
- return (s, U) => (o(), i(w(f.value), {
53
- disabled: m.value,
54
- class: u(["m-btn", [
55
- `--${e.size}`,
56
- k.value,
57
- I.value,
58
- x.value,
59
- {
60
- "--block": e.block,
61
- "--no-underline": e.noUnderline,
62
- "--no-leading": e.noLeading,
63
- "--fab": e.fab,
64
- "--loading": e.loading,
65
- "--disabled": m.value,
66
- "--icon": C.value,
67
- "--rounded": e.rounded,
68
- "--no-rounded": e.noRounded,
69
- "--no-padding": e.noPadding,
70
- "--no-elevation": e.noElevation
71
- }
72
- ]]),
73
- type: $.value
74
- }, {
75
- default: A(() => [
76
- y.value ? (o(), v(
77
- "div",
78
- {
79
- key: 0,
80
- class: u(["m-btn__icon-left maz-flex maz-flex-center", { "maz-invisible": l.value }])
81
- },
82
- [
83
- r(s.$slots, "left-icon", {}, () => [
84
- e.leftIcon ? (o(), i(d(c), {
85
- key: 0,
86
- name: e.leftIcon
87
- }, null, 8, ["name"])) : a("v-if", !0)
88
- ], !0)
89
- ],
90
- 2
91
- /* CLASS */
92
- )) : a("v-if", !0),
93
- S.value ? (o(), v(
94
- "div",
95
- {
96
- key: 1,
97
- class: u(["m-btn__icon maz-flex maz-flex-center", { "maz-invisible": l.value }])
98
- },
99
- [
100
- r(s.$slots, "icon", {}, () => [
101
- e.icon ? (o(), i(d(c), {
102
- key: 0,
103
- name: e.icon
104
- }, null, 8, ["name"])) : a("v-if", !0)
105
- ], !0)
106
- ],
107
- 2
108
- /* CLASS */
109
- )) : a("v-if", !0),
110
- D(
111
- "span",
112
- {
113
- class: u(["maz-flex maz-flex-center", { "maz-invisible": l.value }])
114
- },
115
- [
116
- r(s.$slots, "default", {}, void 0, !0)
117
- ],
118
- 2
119
- /* CLASS */
120
- ),
121
- g.value ? (o(), v(
122
- "div",
123
- {
124
- key: 2,
125
- class: u(["m-btn__icon-right maz-flex maz-flex-center", { "maz-invisible": l.value }])
126
- },
127
- [
128
- r(s.$slots, "right-icon", {}, () => [
129
- e.rightIcon ? (o(), i(d(c), {
130
- key: 0,
131
- name: e.rightIcon
132
- }, null, 8, ["name"])) : a("v-if", !0)
133
- ], !0)
134
- ],
135
- 2
136
- /* CLASS */
137
- )) : a("v-if", !0),
138
- l.value ? (o(), i(d(p), {
139
- key: 3,
140
- size: "2em",
141
- color: e.color,
142
- class: "maz-absolute"
143
- }, null, 8, ["color"])) : a("v-if", !0)
144
- ]),
145
- _: 3
146
- /* FORWARDED */
147
- }, 8, ["disabled", "class", "type"]));
148
- }
149
- }), j = /* @__PURE__ */ N(P, [["__scopeId", "data-v-78782cb0"]]);
150
- export {
151
- j as default
152
- };
@@ -1,96 +0,0 @@
1
- import { defineComponent as b, ref as f, computed as g, onMounted as P, watchEffect as _, openBlock as p, createElementBlock as h, Fragment as A, createCommentVNode as s, mergeProps as C, nextTick as $ } from "vue";
2
- import { i as q } from "./MazTabsBar-WKO9upP5.mjs";
3
- const H = ["innerHTML"], G = /* @__PURE__ */ b({
4
- __name: "MazIcon",
5
- props: {
6
- src: { type: String, default: void 0 },
7
- path: { type: String, default: void 0 },
8
- name: { type: String, default: void 0 },
9
- size: { type: String, default: void 0 },
10
- title: { type: String, default: void 0 },
11
- transformSource: {
12
- type: Function,
13
- default: (a) => a
14
- }
15
- },
16
- emits: ["loaded", "unloaded", "error"],
17
- setup(a, { emit: S }) {
18
- const i = {}, l = f(), d = f(), w = () => {
19
- try {
20
- return q("mazIconPath");
21
- } catch {
22
- return;
23
- }
24
- }, o = a, c = S, m = g(() => o.path ?? w()), y = g(() => o.src ? o.src : m.value ? `${m.value}/${o.name}.svg` : `/${o.name}.svg`);
25
- P(() => {
26
- !o.name && !o.src && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
27
- });
28
- const E = (e, n) => {
29
- const t = e.querySelectorAll("title");
30
- if (t.length > 0)
31
- t[0].textContent = n;
32
- else {
33
- const r = document.createElementNS("http://www.w3.org/2000/svg", "title");
34
- r.textContent = n, e.append(r);
35
- }
36
- }, M = (e) => Object.keys(e).reduce((n, t) => (e[t] !== !1 && e[t] !== null && e[t] !== void 0 && (n[t] = e[t]), n), {}), z = (e) => {
37
- const n = {}, t = e.attributes;
38
- if (!t)
39
- return n;
40
- for (let r = t.length - 1; r >= 0; r--)
41
- n[t[r].name] = t[r].value;
42
- return n;
43
- }, T = (e) => {
44
- let n = e.cloneNode(!0);
45
- return n = o.transformSource(e), o.title && E(n, o.title), e.innerHTML;
46
- }, x = async (e) => {
47
- i[e] || (i[e] = L(e));
48
- try {
49
- l.value = await i[e], await $(), c("loaded", d.value);
50
- } catch (n) {
51
- l.value && (l.value = void 0, c("unloaded")), delete i[e], c("error", n);
52
- }
53
- }, L = (e) => new Promise((n, t) => {
54
- const r = new XMLHttpRequest();
55
- r.open("GET", e, !0), r.addEventListener("load", () => {
56
- if (r.status >= 200 && r.status < 400)
57
- try {
58
- let u = new DOMParser().parseFromString(r.responseText, "text/xml").querySelectorAll("svg")[0];
59
- u ? (u = o.transformSource(u), n(u)) : t(new Error('Loaded file is not valid SVG"'));
60
- } catch (v) {
61
- t(v);
62
- }
63
- else
64
- t(new Error("Error loading SVG"));
65
- }), r.addEventListener("error", () => t()), r.send();
66
- });
67
- return _(() => x(y.value)), (e, n) => (p(), h(
68
- A,
69
- null,
70
- [
71
- s(" eslint-disable vue/no-v-html "),
72
- s(" eslint-disable vue/html-self-closing "),
73
- l.value ? (p(), h("svg", C({
74
- key: 0,
75
- ref_key: "svgElem",
76
- ref: d,
77
- width: "1em",
78
- height: "1em"
79
- }, {
80
- ...z(l.value),
81
- ...M(e.$attrs)
82
- }, {
83
- style: `font-size: ${a.size}`,
84
- innerHTML: T(l.value)
85
- }), null, 16, H)) : s("v-if", !0),
86
- s(" eslint-enable vue/no-v-html "),
87
- s(" eslint-enable vue/html-self-closing ")
88
- ],
89
- 2112
90
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
91
- ));
92
- }
93
- });
94
- export {
95
- G as default
96
- };
@@ -1,38 +0,0 @@
1
- import "../assets/MazSpinner.css";
2
- import { defineComponent as t, openBlock as o, createElementBlock as c, normalizeClass as n, pushScopeId as s, popScopeId as r, createElementVNode as i } from "vue";
3
- import { _ as p } from "./MazPhoneNumberInput--P0rJeR6.mjs";
4
- const a = (e) => (s("data-v-c67298ec"), e = e(), r(), e), d = ["width", "height"], l = /* @__PURE__ */ a(() => /* @__PURE__ */ i(
5
- "path",
6
- { d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" },
7
- null,
8
- -1
9
- /* HOISTED */
10
- )), m = [
11
- l
12
- ], h = /* @__PURE__ */ t({
13
- __name: "MazSpinner",
14
- props: {
15
- size: { type: String, default: "2em" },
16
- color: {
17
- type: String,
18
- default: "primary"
19
- }
20
- },
21
- setup(e) {
22
- return (_, u) => (o(), c("svg", {
23
- width: e.size,
24
- height: e.size,
25
- version: "1.1",
26
- xmlns: "http://www.w3.org/2000/svg",
27
- x: "0px",
28
- y: "0px",
29
- viewBox: "0 0 50 50",
30
- "xml:space": "preserve",
31
- class: n(["m-spinner", `m-spinner--${e.color}`]),
32
- style: { "enable-background": "new 0 0 50 50" }
33
- }, m, 10, d));
34
- }
35
- }), g = /* @__PURE__ */ p(h, [["__scopeId", "data-v-c67298ec"]]);
36
- export {
37
- g as default
38
- };
@@ -1,131 +0,0 @@
1
- import "../assets/MazTabsBar.css";
2
- import { inject as M, defineComponent as k, defineAsyncComponent as S, ref as h, computed as _, onBeforeMount as x, onMounted as A, openBlock as f, createElementBlock as g, normalizeClass as z, Fragment as E, renderList as R, createBlock as V, unref as p, normalizeStyle as m, withCtx as j, createTextVNode as I, toDisplayString as L, createElementVNode as C } from "vue";
3
- function X(t, s) {
4
- const r = M(t, s);
5
- if (!r)
6
- throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${t}`);
7
- return r;
8
- }
9
- const N = /* @__PURE__ */ k({
10
- __name: "MazTabsBar",
11
- props: {
12
- items: { type: Array, required: !0 },
13
- useAnchor: { type: Boolean, default: !1 },
14
- color: { type: String, default: "primary" },
15
- noRounded: { type: Boolean, default: !1 }
16
- },
17
- setup(t) {
18
- const s = S(() => import("./MazBtn-Qa9DSsQk.mjs"));
19
- function r(e) {
20
- return e.replaceAll(/([a-z])([A-Z])/g, "$1-$2").replaceAll(/[\s_]+/g, "-").toLowerCase();
21
- }
22
- const i = (e, a) => {
23
- if (typeof window > "u")
24
- return a;
25
- const c = window.location.hash.replace("#", ""), l = e.findIndex(({ label: n }) => r(n) === c);
26
- return l === -1 ? 1 : l + 1;
27
- }, { currentTab: o, updateCurrentTab: b } = X("maz-tabs"), d = t, T = h(), v = h([]);
28
- function $({
29
- mazBtn: e,
30
- index: a
31
- }) {
32
- e && "$el" in e && (v.value[a] = e.$el);
33
- }
34
- const u = _(
35
- () => d.items.map((e) => ({
36
- label: typeof e == "string" ? e : e.label,
37
- disabled: typeof e == "string" ? !1 : e.disabled ?? !1
38
- }))
39
- ), w = _(() => {
40
- if (typeof o.value != "number")
41
- return {};
42
- const e = v.value[o.value - 1], a = (e == null ? void 0 : e.clientWidth) ?? 0;
43
- return {
44
- transform: `translateX(${(e == null ? void 0 : e.offsetLeft) ?? 0}px)`,
45
- width: `${a}px`
46
- };
47
- });
48
- function B(e) {
49
- return o.value === e ? `color: var(--maz-color-${d.color})` : "";
50
- }
51
- return x(() => {
52
- (o.value < 1 || o.value > u.value.length) && console.error(
53
- `[maz-ui](MazTabsBar) The model-value should be between 1 and ${u.value.length}`
54
- );
55
- }), A(async () => {
56
- d.useAnchor && b(i(u.value, o.value) ?? 1);
57
- }), (e, a) => (f(), g(
58
- "div",
59
- {
60
- ref_key: "MazTabsBar",
61
- ref: T,
62
- class: z(["m-tabs-bar", {
63
- "--no-rounded": t.noRounded
64
- }])
65
- },
66
- [
67
- (f(!0), g(
68
- E,
69
- null,
70
- R(u.value, ({ label: c, disabled: l }, n) => (f(), V(p(s), {
71
- key: n,
72
- ref_for: !0,
73
- ref: (y) => $({ mazBtn: y, index: n }),
74
- color: "transparent",
75
- class: z([{ "--active": p(o) === n, "--disabled": l }, "m-tabs-bar__item --no-styling"]),
76
- disabled: l,
77
- to: t.useAnchor && !l ? `#${r(c)}` : void 0,
78
- style: m(B(n + 1)),
79
- "no-rounded": "",
80
- onClick: (y) => p(b)(n + 1)
81
- }, {
82
- default: j(() => [
83
- I(
84
- L(c),
85
- 1
86
- /* TEXT */
87
- )
88
- ]),
89
- _: 2
90
- /* DYNAMIC */
91
- }, 1032, ["class", "disabled", "to", "style", "onClick"]))),
92
- 128
93
- /* KEYED_FRAGMENT */
94
- )),
95
- C(
96
- "div",
97
- {
98
- style: m(w.value),
99
- class: "m-tabs-bar__indicator"
100
- },
101
- [
102
- C(
103
- "div",
104
- {
105
- class: "m-sub-bar",
106
- style: m({ backgroundColor: `var(--maz-color-${t.color})` })
107
- },
108
- null,
109
- 4
110
- /* STYLE */
111
- )
112
- ],
113
- 4
114
- /* STYLE */
115
- )
116
- ],
117
- 2
118
- /* CLASS */
119
- ));
120
- }
121
- }), O = (t, s) => {
122
- const r = t.__vccOpts || t;
123
- for (const [i, o] of s)
124
- r[i] = o;
125
- return r;
126
- }, D = /* @__PURE__ */ O(N, [["__scopeId", "data-v-784ac8f6"]]);
127
- export {
128
- D as M,
129
- O as _,
130
- X as i
131
- };