maz-ui 3.35.0 → 3.35.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 (33) hide show
  1. package/components/MazAvatar.mjs +1 -1
  2. package/components/MazBadge.mjs +4 -4
  3. package/components/MazPhoneNumberInput.mjs +1 -1
  4. package/components/MazSelect.mjs +1 -1
  5. package/components/MazTable.mjs +1 -1
  6. package/components/MazTabsBar.d.ts +5 -2
  7. package/components/MazTabsBar.mjs +1 -1
  8. package/components/assets/MazAvatar.css +1 -1
  9. package/components/assets/MazBadge.css +1 -1
  10. package/components/assets/MazPhoneNumberInput.css +1 -1
  11. package/components/assets/MazSelect.css +1 -1
  12. package/components/assets/MazTable.css +1 -1
  13. package/components/assets/MazTabsBar.css +1 -1
  14. package/components/chunks/{MazAvatar-4EVPBdaz.mjs → MazAvatar-Dv5LXKDM.mjs} +3 -3
  15. package/components/chunks/{MazBadge-DyDXRPZk.mjs → MazBadge-BD-ljwz4.mjs} +4 -4
  16. package/components/chunks/{MazBtn-CR9C_X7R.mjs → MazBtn-BL-LWc8X.mjs} +2 -2
  17. package/components/chunks/{MazBtn-BrGm_GFq.mjs → MazBtn-GCCDnqJA.mjs} +2 -2
  18. package/components/chunks/{MazCheckbox-BBRjlgY4.mjs → MazCheckbox-BAC8XgFg.mjs} +1 -1
  19. package/components/chunks/{MazCheckbox-BzrXpIyp.mjs → MazCheckbox-EG8AZPtG.mjs} +1 -1
  20. package/components/chunks/{MazIcon-COn5JlL6.mjs → MazIcon-pcOKJiIX.mjs} +1 -1
  21. package/components/chunks/{MazLazyImg-Dgf1n6WW.mjs → MazLazyImg-BCfYlc7d.mjs} +2 -2
  22. package/components/chunks/{MazPhoneNumberInput-7Tk_G1ML.mjs → MazPhoneNumberInput-dbbjH9lI.mjs} +58 -58
  23. package/components/chunks/{MazSelect-CVmgnTR-.mjs → MazSelect-8_n2ovqP.mjs} +26 -26
  24. package/components/chunks/{MazSpinner-MuTCx2Oq.mjs → MazSpinner-BVnAAf_I.mjs} +1 -1
  25. package/components/chunks/{MazSpinner-D-L0c6RT.mjs → MazSpinner-CjKNs7lm.mjs} +1 -1
  26. package/components/chunks/{MazSpinner-CCnDkF4m.mjs → MazSpinner-D3U6NnSV.mjs} +1 -1
  27. package/components/chunks/{MazSpinner-C5f5Mg-w.mjs → MazSpinner-DtdabLA2.mjs} +1 -1
  28. package/components/chunks/{MazTable-BNHsIaXl.mjs → MazTable-DECLgD3Z.mjs} +7 -7
  29. package/components/chunks/MazTabsBar-DOoSBfpp.mjs +190 -0
  30. package/nuxt/index.json +1 -1
  31. package/package.json +1 -1
  32. package/types/components/MazTabsBar.vue.d.ts +5 -2
  33. package/components/chunks/MazTabsBar-CMH7Jt-K.mjs +0 -171
@@ -1,6 +1,6 @@
1
1
  import "../assets/MazSpinner.css";
2
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 "./MazTable-BNHsIaXl.mjs";
3
+ import { _ as p } from "./MazTable-DECLgD3Z.mjs";
4
4
  const a = (e) => (s("data-v-c67298ec"), e = e(), r(), e), d = ["width", "height"], l = /* @__PURE__ */ a(() => /* @__PURE__ */ i(
5
5
  "path",
6
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" },
@@ -156,7 +156,7 @@ const Ne = ({
156
156
  },
157
157
  emits: ["update:model-value", "focus", "blur", "click", "change"],
158
158
  setup(v, { emit: y }) {
159
- const a = G(() => Promise.resolve().then(() => No)), c = G(() => import("./MazIcon-COn5JlL6.mjs")), M = G(() => import("./eye-slash-tjfxO0LK.mjs")), S = G(() => import("./eye-DqO_Jx56.mjs")), w = G(() => Promise.resolve().then(() => Go)), o = v, N = y, _ = K(!1), z = K(!1), E = K(), B = Le(), J = Ne({
159
+ const a = G(() => Promise.resolve().then(() => No)), c = G(() => import("./MazIcon-pcOKJiIX.mjs")), M = G(() => import("./eye-slash-tjfxO0LK.mjs")), S = G(() => import("./eye-DqO_Jx56.mjs")), w = G(() => Promise.resolve().then(() => Go)), o = v, N = y, _ = K(!1), z = K(!1), E = K(), B = Le(), J = Ne({
160
160
  componentName: "MazInput",
161
161
  instance: B,
162
162
  providedId: o.id
@@ -433,9 +433,9 @@ const Ao = ["aria-label"], Ko = { class: "m-select-list__no-results" }, Mo = {
433
433
  emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
434
434
  setup(v, { emit: y }) {
435
435
  Ve((e) => ({
436
- "48350faf": H.value,
437
- "234b58a4": B.value,
438
- 27843996: J.value
436
+ "021d98d9": H.value,
437
+ "3f038458": B.value,
438
+ c194e680: J.value
439
439
  }));
440
440
  const a = G(() => Promise.resolve().then(() => el)), c = G(() => Promise.resolve().then(() => ro)), M = G(() => import("./chevron-down-CzMH-gFW.mjs")), S = G(() => import("./no-symbol-QAqP9IlR.mjs")), w = Le(), o = v, N = y, _ = K(!1), z = K(), E = d(
441
441
  () => ["black", "transparent", "white"].includes(o.color)
@@ -701,7 +701,7 @@ const Ao = ["aria-label"], Ko = { class: "m-select-list__no-results" }, Mo = {
701
701
  @slot Custom optgroup label
702
702
  @binding {String} label - the label of the optgroup
703
703
  `),
704
- r.label && !r[e.optionValueKey] ? k(e.$slots, "optgroup", {
704
+ r.label && R(r[e.optionValueKey]) ? k(e.$slots, "optgroup", {
705
705
  key: 0,
706
706
  label: r.label
707
707
  }, () => [
@@ -772,7 +772,7 @@ const Ao = ["aria-label"], Ko = { class: "m-select-list__no-results" }, Mo = {
772
772
  /* CLASS, STYLE, NEED_HYDRATION */
773
773
  ));
774
774
  }
775
- }), Fe = /* @__PURE__ */ le(To, [["__scopeId", "data-v-45e382c1"]]), Oo = /* @__PURE__ */ oe({
775
+ }), Fe = /* @__PURE__ */ le(To, [["__scopeId", "data-v-48c93d79"]]), Oo = /* @__PURE__ */ oe({
776
776
  __name: "MazBtn",
777
777
  props: {
778
778
  variant: { default: "button" },
@@ -797,7 +797,7 @@ const Ao = ["aria-label"], Ko = { class: "m-select-list__no-results" }, Mo = {
797
797
  contentClass: { default: void 0 }
798
798
  },
799
799
  setup(v) {
800
- const y = G(() => import("./MazSpinner-C5f5Mg-w.mjs")), a = G(() => import("./MazIcon-COn5JlL6.mjs")), { href: c, to: M } = oo(), S = Pe(), w = v;
800
+ const y = G(() => import("./MazSpinner-DtdabLA2.mjs")), a = G(() => import("./MazIcon-pcOKJiIX.mjs")), { href: c, to: M } = oo(), S = Pe(), w = v;
801
801
  Oe(() => {
802
802
  w.icon && !w.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
803
803
  });
@@ -0,0 +1,190 @@
1
+ import "../assets/MazTabsBar.css";
2
+ import { inject as I, ref as i, defineComponent as N, defineAsyncComponent as O, computed as V, onBeforeMount as W, onMounted as B, watch as j, openBlock as f, createElementBlock as p, normalizeClass as g, createElementVNode as q, normalizeStyle as S, Fragment as H, renderList as U, createCommentVNode as v, renderSlot as C, createTextVNode as T, toDisplayString as k, createBlock as Q, unref as X, withCtx as D } from "vue";
3
+ function F(n, s) {
4
+ const o = I(n, s);
5
+ if (!o)
6
+ throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${n}`);
7
+ return o;
8
+ }
9
+ const x = (n) => new Promise((s) => {
10
+ setTimeout(s, n);
11
+ }), G = (n, s) => {
12
+ const o = n.__vccOpts || n;
13
+ for (const [c, b] of s)
14
+ o[c] = b;
15
+ return o;
16
+ };
17
+ i("system");
18
+ i("system");
19
+ const J = ["disabled", "onClick"], K = /* @__PURE__ */ N({
20
+ __name: "MazTabsBar",
21
+ props: {
22
+ items: {},
23
+ persistent: { type: Boolean },
24
+ queryParam: { default: "tab" },
25
+ block: { type: Boolean },
26
+ noElevation: { type: Boolean },
27
+ autoScroll: { type: Boolean, default: !0 }
28
+ },
29
+ setup(n) {
30
+ const s = O(() => import("./MazBadge-BD-ljwz4.mjs")), { currentTab: o, updateCurrentTab: c } = F("maz-tabs");
31
+ function b(e) {
32
+ c(e + 1), l.persistent && M(e + 1);
33
+ }
34
+ const l = n, h = i(), y = i([]);
35
+ function _(e) {
36
+ return o.value === e + 1;
37
+ }
38
+ function L({
39
+ mazBtn: e,
40
+ index: t
41
+ }) {
42
+ y.value[t] = e && "$el" in e ? e.$el : e;
43
+ }
44
+ const d = V(
45
+ () => l.items.map((e) => ({
46
+ label: typeof e == "string" ? e : e.label,
47
+ disabled: typeof e == "string" ? !1 : e.disabled ?? !1,
48
+ badge: typeof e == "string" ? void 0 : e.badge
49
+ }))
50
+ ), w = i(), m = i(!1);
51
+ async function z() {
52
+ if (!l.autoScroll)
53
+ return;
54
+ await x(150);
55
+ const e = h.value, t = y.value[o.value - 1];
56
+ if (!e || !t)
57
+ return;
58
+ const a = 50;
59
+ if (t.offsetLeft - a < e.scrollLeft || t.offsetLeft + t.offsetWidth > e.scrollLeft + e.clientWidth) {
60
+ const E = window.getComputedStyle(e, "padding-left").paddingLeft, R = Number(E.slice(0, -2));
61
+ e.scrollTo({
62
+ left: t.offsetLeft - R - a,
63
+ behavior: m.value ? "smooth" : "instant"
64
+ });
65
+ }
66
+ if (typeof o.value != "number")
67
+ return;
68
+ const r = (t == null ? void 0 : t.offsetWidth) ?? 0, u = (t == null ? void 0 : t.offsetHeight) ?? 0, A = (t == null ? void 0 : t.offsetLeft) ?? 0;
69
+ w.value = {
70
+ transform: `translateX(${A}px)`,
71
+ width: `${r}px`,
72
+ height: `${u}px`
73
+ }, m.value = !0;
74
+ }
75
+ function P(e, t) {
76
+ return t ? {} : o.value === e + 1 ? "color: var(--maz-color-text)" : "color: var(--maz-color-muted)";
77
+ }
78
+ W(() => {
79
+ (o.value < 1 || o.value > d.value.length) && console.error(
80
+ `[maz-ui](MazTabsBar) The model-value should be between 1 and ${d.value.length}`
81
+ );
82
+ }), B(() => {
83
+ l.persistent && z();
84
+ }), j(
85
+ () => [o.value, d.value],
86
+ () => {
87
+ z();
88
+ }
89
+ );
90
+ function $() {
91
+ const e = new URL(window.location.href);
92
+ return Number(e.searchParams.get(l.queryParam));
93
+ }
94
+ function M(e) {
95
+ const t = new URL(window.location.href);
96
+ t.searchParams.set(l.queryParam, String(e)), window.history.replaceState({}, document.title, t.toString());
97
+ }
98
+ return B(async () => {
99
+ l.persistent && c($() || o.value || 1);
100
+ }), (e, t) => (f(), p(
101
+ "div",
102
+ {
103
+ ref_key: "tabsBarRef",
104
+ ref: h,
105
+ class: g(["m-tabs-bar", {
106
+ "--block": e.block,
107
+ "--elevation": !e.noElevation
108
+ }])
109
+ },
110
+ [
111
+ q(
112
+ "div",
113
+ {
114
+ class: g(["m-tabs-bar__indicator", { "--animated": m.value }]),
115
+ style: S([w.value])
116
+ },
117
+ null,
118
+ 6
119
+ /* CLASS, STYLE */
120
+ ),
121
+ (f(!0), p(
122
+ H,
123
+ null,
124
+ U(d.value, (a, r) => (f(), p("button", {
125
+ key: r,
126
+ ref_for: !0,
127
+ ref: (u) => L({ mazBtn: u, index: r }),
128
+ class: g([{ "--active": _(r), "--disabled": a.disabled }, "m-tabs-bar__item"]),
129
+ disabled: a.disabled,
130
+ style: S(P(r, a.disabled)),
131
+ onClick: (u) => a.disabled ? void 0 : b(r)
132
+ }, [
133
+ v(`
134
+ @slot item - Content of item to display in the tabs bar
135
+ @binding {MazTabsBarItem[]} item - all data of the item
136
+ @binding {boolean} active - \`true\` if the tab is active
137
+ @binding {number} index - index of the item
138
+ `),
139
+ C(e.$slots, "item", {
140
+ item: a,
141
+ active: _(r),
142
+ index: r
143
+ }, () => [
144
+ T(
145
+ k(a.label) + " ",
146
+ 1
147
+ /* TEXT */
148
+ ),
149
+ a.badge ? (f(), Q(X(s), {
150
+ key: 0,
151
+ color: a.badge.color,
152
+ pastel: a.badge.pastel,
153
+ outline: a.badge.outline,
154
+ "rounded-size": a.badge.roundedSize,
155
+ size: a.badge.size ?? "0.7rem",
156
+ class: "m-tabs-bar__item__badge"
157
+ }, {
158
+ default: D(() => [
159
+ v(`
160
+ @slot badge-content - Content in the badge
161
+ @binding {string | number | boolean} content - content of the badge provided in item
162
+ `),
163
+ C(e.$slots, "badge-content", {
164
+ content: a.badge.content
165
+ }, () => [
166
+ T(
167
+ k(a.badge.content),
168
+ 1
169
+ /* TEXT */
170
+ )
171
+ ], !0)
172
+ ]),
173
+ _: 2
174
+ /* DYNAMIC */
175
+ }, 1032, ["color", "pastel", "outline", "rounded-size", "size"])) : v("v-if", !0)
176
+ ], !0)
177
+ ], 14, J))),
178
+ 128
179
+ /* KEYED_FRAGMENT */
180
+ ))
181
+ ],
182
+ 2
183
+ /* CLASS */
184
+ ));
185
+ }
186
+ }), ee = /* @__PURE__ */ G(K, [["__scopeId", "data-v-0c9a611c"]]);
187
+ export {
188
+ ee as M,
189
+ G as _
190
+ };
package/nuxt/index.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "3.35.0"
7
+ "version": "3.35.2"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.35.0",
3
+ "version": "3.35.2",
4
4
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
5
5
  "author": "Louis Mazel <me@loicmazuel.com>",
6
6
  "main": "./modules/index.cjs",
@@ -3,7 +3,7 @@ export type MazTabsBarItem = {
3
3
  label: string;
4
4
  disabled?: boolean;
5
5
  badge?: {
6
- value: string | number;
6
+ content: string | number | boolean;
7
7
  color?: BadgeColor;
8
8
  pastel?: boolean;
9
9
  outline?: boolean;
@@ -44,7 +44,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
44
44
  label: string;
45
45
  disabled: boolean;
46
46
  badge: {
47
- value: string | number;
47
+ content: string | number | boolean;
48
48
  color?: BadgeColor | undefined;
49
49
  pastel?: boolean | undefined;
50
50
  outline?: boolean | undefined;
@@ -55,6 +55,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
55
55
  active: boolean;
56
56
  index: number;
57
57
  }): any;
58
+ "badge-content"?(_: {
59
+ content: string | number | boolean;
60
+ }): any;
58
61
  }>;
59
62
  export default _default;
60
63
  type __VLS_WithDefaults<P, D> = {
@@ -1,171 +0,0 @@
1
- import "../assets/MazTabsBar.css";
2
- import { inject as E, defineComponent as R, defineAsyncComponent as N, ref as p, computed as V, watchEffect as W, nextTick as j, onBeforeMount as q, onMounted as O, openBlock as d, createElementBlock as v, normalizeClass as y, createElementVNode as U, normalizeStyle as w, Fragment as x, renderList as H, createCommentVNode as T, renderSlot as Q, createTextVNode as _, toDisplayString as z, createBlock as X, unref as D, withCtx as F } from "vue";
3
- function G(n, l) {
4
- const a = E(n, l);
5
- if (!a)
6
- throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${n}`);
7
- return a;
8
- }
9
- const B = (n) => new Promise((l) => {
10
- setTimeout(l, n);
11
- }), J = ["disabled", "onClick"], K = /* @__PURE__ */ R({
12
- __name: "MazTabsBar",
13
- props: {
14
- items: {},
15
- persistent: { type: Boolean },
16
- queryParam: { default: "tab" },
17
- block: { type: Boolean },
18
- noElevation: { type: Boolean },
19
- autoScroll: { type: Boolean, default: !0 }
20
- },
21
- setup(n) {
22
- const l = N(() => import("./MazBadge-DyDXRPZk.mjs")), { currentTab: a, updateCurrentTab: i } = G("maz-tabs");
23
- function u(e) {
24
- i(e + 1), s.persistent && L(e + 1);
25
- }
26
- const s = n, g = p(), f = p([]);
27
- function m(e) {
28
- return a.value === e + 1;
29
- }
30
- function S({
31
- mazBtn: e,
32
- index: o
33
- }) {
34
- f.value[o] = e && "$el" in e ? e.$el : e;
35
- }
36
- const b = V(
37
- () => s.items.map((e) => ({
38
- label: typeof e == "string" ? e : e.label,
39
- disabled: typeof e == "string" ? !1 : e.disabled ?? !1,
40
- badge: typeof e == "string" ? void 0 : e.badge
41
- }))
42
- ), h = p();
43
- W(async () => {
44
- if (!s.autoScroll)
45
- return;
46
- const e = g.value, o = f.value[a.value - 1];
47
- if (!e || !o)
48
- return;
49
- if (await j(), await B(150), o.offsetLeft < e.scrollLeft || o.offsetLeft + o.offsetWidth > e.scrollLeft + e.clientWidth) {
50
- const $ = window.getComputedStyle(e, "padding-left").paddingLeft, M = Number($.slice(0, -2));
51
- e.scrollTo({
52
- left: o.offsetLeft - M,
53
- behavior: "smooth"
54
- // Ajoutez le défilement fluide
55
- }), await B(150);
56
- }
57
- if (typeof a.value != "number")
58
- return {};
59
- const t = f.value[a.value - 1], r = (t == null ? void 0 : t.offsetWidth) ?? 0, c = (t == null ? void 0 : t.offsetHeight) ?? 0, P = (t == null ? void 0 : t.offsetLeft) ?? 0;
60
- h.value = {
61
- transform: `translateX(${P}px)`,
62
- width: `${r}px`,
63
- height: `${c}px`
64
- };
65
- });
66
- function k(e, o) {
67
- return o ? {} : a.value === e + 1 ? "color: var(--maz-color-text)" : "color: var(--maz-color-muted)";
68
- }
69
- q(() => {
70
- (a.value < 1 || a.value > b.value.length) && console.error(
71
- `[maz-ui](MazTabsBar) The model-value should be between 1 and ${b.value.length}`
72
- );
73
- });
74
- function C() {
75
- const e = new URL(window.location.href);
76
- return Number(e.searchParams.get(s.queryParam));
77
- }
78
- function L(e) {
79
- const o = new URL(window.location.href);
80
- o.searchParams.set(s.queryParam, String(e)), window.history.replaceState({}, document.title, o.toString());
81
- }
82
- return O(async () => {
83
- s.persistent && i(C() || a.value || 1);
84
- }), (e, o) => (d(), v(
85
- "div",
86
- {
87
- ref_key: "tabsBarRef",
88
- ref: g,
89
- class: y(["m-tabs-bar", {
90
- "--block": e.block,
91
- "--elevation": !e.noElevation
92
- }])
93
- },
94
- [
95
- U(
96
- "div",
97
- {
98
- class: "m-tabs-bar__indicator",
99
- style: w([h.value])
100
- },
101
- null,
102
- 4
103
- /* STYLE */
104
- ),
105
- (d(!0), v(
106
- x,
107
- null,
108
- H(b.value, (t, r) => (d(), v("button", {
109
- key: r,
110
- ref_for: !0,
111
- ref: (c) => S({ mazBtn: c, index: r }),
112
- class: y([{ "--active": m(r), "--disabled": t.disabled }, "m-tabs-bar__item"]),
113
- disabled: t.disabled,
114
- style: w(k(r, t.disabled)),
115
- onClick: (c) => t.disabled ? void 0 : u(r)
116
- }, [
117
- T(`
118
- @slot item - Content of item to display in the tabs bar
119
- @binding {MazTabsBarItem[]} item - all data of the item
120
- @binding {boolean} active - \`true\` if the tab is active
121
- @binding {number} index - index of the item
122
- `),
123
- Q(e.$slots, "item", {
124
- item: t,
125
- active: m(r),
126
- index: r
127
- }, () => [
128
- _(
129
- z(t.label) + " ",
130
- 1
131
- /* TEXT */
132
- ),
133
- t.badge ? (d(), X(D(l), {
134
- key: 0,
135
- color: t.badge.color,
136
- pastel: t.badge.pastel,
137
- outline: t.badge.outline,
138
- "rounded-size": t.badge.roundedSize,
139
- size: t.badge.size,
140
- nowrap: ""
141
- }, {
142
- default: F(() => [
143
- _(
144
- z(t.badge.value),
145
- 1
146
- /* TEXT */
147
- )
148
- ]),
149
- _: 2
150
- /* DYNAMIC */
151
- }, 1032, ["color", "pastel", "outline", "rounded-size", "size"])) : T("v-if", !0)
152
- ], !0)
153
- ], 14, J))),
154
- 128
155
- /* KEYED_FRAGMENT */
156
- ))
157
- ],
158
- 2
159
- /* CLASS */
160
- ));
161
- }
162
- }), Y = (n, l) => {
163
- const a = n.__vccOpts || n;
164
- for (const [i, u] of l)
165
- a[i] = u;
166
- return a;
167
- }, I = /* @__PURE__ */ Y(K, [["__scopeId", "data-v-56dbaa48"]]);
168
- export {
169
- I as M,
170
- Y as _
171
- };