maz-ui 3.40.0 → 3.40.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 (30) hide show
  1. package/components/MazDropdown.d.ts +16 -5
  2. package/components/MazDropdown.mjs +5 -5
  3. package/components/MazPhoneNumberInput.mjs +1 -1
  4. package/components/MazSelect.mjs +1 -1
  5. package/components/MazStepper.d.ts +21 -33
  6. package/components/MazStepper.mjs +1 -1
  7. package/components/MazTable.mjs +1 -1
  8. package/components/assets/MazPhoneNumberInput.css +1 -1
  9. package/components/assets/MazSelect.css +1 -1
  10. package/components/assets/MazStepper.css +1 -1
  11. package/components/assets/MazTable.css +1 -1
  12. package/components/chunks/{MazBtn-DX_LieH1.mjs → MazBtn-Cf6bpPps.mjs} +2 -2
  13. package/components/chunks/{MazBtn-D3Mr5fj4.mjs → MazBtn-Dp7XmWvD.mjs} +2 -2
  14. package/components/chunks/{MazCheckbox-C9F7oMqL.mjs → MazCheckbox-CZdX-eyY.mjs} +1 -1
  15. package/components/chunks/{MazCheckbox-CoVoZqmg.mjs → MazCheckbox-Dqw5B6BC.mjs} +1 -1
  16. package/components/chunks/{MazIcon-DzD_cBdk.mjs → MazIcon-B-UuPklS.mjs} +1 -1
  17. package/components/chunks/{MazIcon-DYbPgfIV.mjs → MazIcon-DgT8iWEh.mjs} +1 -1
  18. package/components/chunks/{MazPhoneNumberInput-mcDMFmP2.mjs → MazPhoneNumberInput-DGf04XP4.mjs} +8 -6
  19. package/components/chunks/{MazSelect-Df0VSEUM.mjs → MazSelect-BsWij77Q.mjs} +8 -6
  20. package/components/chunks/{MazSpinner-C2M_vLCD.mjs → MazSpinner-CPFxMAVg.mjs} +1 -1
  21. package/components/chunks/{MazSpinner-DcHEWAt2.mjs → MazSpinner-DzWvDo6x.mjs} +1 -1
  22. package/components/chunks/{MazSpinner-CIs_kJJn.mjs → MazSpinner-S7b1mVEd.mjs} +1 -1
  23. package/components/chunks/MazStepper-BvKEjtJo.mjs +233 -0
  24. package/components/chunks/{MazTable-BjoWOw75.mjs → MazTable-Ds_9n2ph.mjs} +8 -6
  25. package/components/chunks/{MazTransitionExpand-Qi1Ryuww.mjs → MazTransitionExpand-C6uOt--l.mjs} +1 -1
  26. package/nuxt/index.json +1 -1
  27. package/package.json +1 -1
  28. package/types/components/MazDropdown.vue.d.ts +16 -5
  29. package/types/components/MazStepper.vue.d.ts +21 -33
  30. package/components/chunks/MazStepper-BrVzcmp3.mjs +0 -187
@@ -160,7 +160,7 @@ const Bt = {
160
160
  },
161
161
  emits: ["update:model-value", "focus", "blur", "click", "change"],
162
162
  setup(r, { emit: d }) {
163
- const t = J(() => Promise.resolve().then(() => Qt)), b = J(() => import("./MazIcon-DzD_cBdk.mjs")), z = J(() => import("./eye-slash-tjfxO0LK.mjs")), m = J(() => import("./eye-DqO_Jx56.mjs")), h = J(() => Promise.resolve().then(() => no)), o = r, L = d, T = E(!1), w = E(!1), F = E(), _ = Ee({
163
+ const t = J(() => Promise.resolve().then(() => Qt)), b = J(() => import("./MazIcon-B-UuPklS.mjs")), z = J(() => import("./eye-slash-tjfxO0LK.mjs")), m = J(() => import("./eye-DqO_Jx56.mjs")), h = J(() => Promise.resolve().then(() => no)), o = r, L = d, T = E(!1), w = E(!1), F = E(), _ = Ee({
164
164
  componentName: "MazInput",
165
165
  providedId: o.id
166
166
  });
@@ -503,13 +503,15 @@ const Nt = {
503
503
  emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
504
504
  setup(r, { expose: d, emit: t }) {
505
505
  Ve((e) => ({
506
- "0be73248": k.value,
507
- "64cc5eca": _.value,
508
- "9f2fe47a": R.value
506
+ "417b570e": k.value,
507
+ "16c577f8": _.value,
508
+ "081fe860": R.value
509
509
  }));
510
510
  const b = J(() => Promise.resolve().then(() => uo)), z = J(() => Promise.resolve().then(() => pt)), m = J(() => import("./chevron-down-CzMH-gFW.mjs")), h = J(() => import("./no-symbol-QAqP9IlR.mjs"));
511
511
  d({
512
+ /** Method to open the option list */
512
513
  openList: D,
514
+ /** Method to close the option list */
513
515
  closeList: q
514
516
  });
515
517
  const o = r, L = t, T = E(!1), w = E(), F = c(
@@ -869,7 +871,7 @@ const Nt = {
869
871
  ]);
870
872
  };
871
873
  }
872
- }), He = /* @__PURE__ */ le(qt, [["__scopeId", "data-v-fb03c8b8"]]), Rt = /* @__PURE__ */ oe({
874
+ }), He = /* @__PURE__ */ le(qt, [["__scopeId", "data-v-8441f9de"]]), Rt = /* @__PURE__ */ oe({
873
875
  __name: "MazBtn",
874
876
  props: {
875
877
  variant: { default: "button" },
@@ -894,7 +896,7 @@ const Nt = {
894
896
  contentClass: { default: void 0 }
895
897
  },
896
898
  setup(r) {
897
- const d = J(() => import("./MazSpinner-DcHEWAt2.mjs")), t = J(() => import("./MazIcon-DzD_cBdk.mjs")), { href: b, to: z } = nt(), m = Le(), h = r;
899
+ const d = J(() => import("./MazSpinner-DzWvDo6x.mjs")), t = J(() => import("./MazIcon-B-UuPklS.mjs")), { href: b, to: z } = nt(), m = Le(), h = r;
898
900
  Oe(() => {
899
901
  h.icon && !h.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
900
902
  });
@@ -1,6 +1,6 @@
1
1
  import '../assets/MazTransitionExpand.css';
2
2
  import { defineComponent as e, useCssVars as p, openBlock as d, createBlock as h, TransitionGroup as u, withCtx as y, renderSlot as g, nextTick as s } from "vue";
3
- import { _ as l } from "./MazStepper-BrVzcmp3.mjs";
3
+ import { _ as l } from "./MazStepper-BvKEjtJo.mjs";
4
4
  const f = /* @__PURE__ */ e({
5
5
  __name: "MazTransitionExpand",
6
6
  props: {
package/nuxt/index.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "3.40.0"
7
+ "version": "3.40.2"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.40.0",
3
+ "version": "3.40.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",
@@ -9,7 +9,7 @@ export type MenuItem = {
9
9
  target?: string;
10
10
  href?: string;
11
11
  to?: RouteLocationRaw;
12
- class?: string;
12
+ class?: unknown;
13
13
  } & Record<string, unknown>;
14
14
  export type Props = {
15
15
  style?: HTMLAttributes['style'];
@@ -20,11 +20,19 @@ export type Props = {
20
20
  open?: boolean;
21
21
  /** id of the menu */
22
22
  id?: string;
23
- /** Should open the dropdown on click, hover or both */
23
+ /** Should open the dropdown on click, hover or both
24
+ * @default 'both'
25
+ */
24
26
  trigger?: 'click' | 'hover' | 'both';
25
- /** Button color */
27
+ /**
28
+ * Button color
29
+ * @default 'transparent'
30
+ */
26
31
  color?: Color;
27
- /** Position of the dropdown */
32
+ /**
33
+ * Position of the dropdown
34
+ * @default 'bottom left'
35
+ */
28
36
  position?: Position;
29
37
  /** Disable close menu on menuitem clicked */
30
38
  noCloseOnClick?: boolean;
@@ -32,7 +40,10 @@ export type Props = {
32
40
  disabled?: boolean;
33
41
  /** Remove chevron icon in main button */
34
42
  noChevron?: boolean;
35
- /** Description read by screen reader (accessibility) */
43
+ /**
44
+ * Description read by screen reader (accessibility)
45
+ * @default 'Open menu dropdown'
46
+ */
36
47
  screenReaderDescription?: string;
37
48
  };
38
49
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
@@ -1,5 +1,7 @@
1
+ import { type Component, type ComponentPublicInstance, type SVGAttributes, type FunctionalComponent } from 'vue';
1
2
  import type { Color } from './types';
2
3
  export type { Color };
4
+ export type Icon = FunctionalComponent<SVGAttributes> | ComponentPublicInstance | Component;
3
5
  export interface Step {
4
6
  title?: string;
5
7
  subtitle?: string;
@@ -8,53 +10,39 @@ export interface Step {
8
10
  error?: boolean;
9
11
  success?: boolean;
10
12
  warning?: boolean;
13
+ icon?: string | Icon;
11
14
  }
12
15
  export type Steps = Step[];
13
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
16
+ export type Props = {
14
17
  /** The current step */
15
- modelValue?: number | undefined;
18
+ modelValue?: number;
16
19
  /** The steps */
17
- steps?: Steps | undefined;
18
- /** The color of the stepper */
19
- color?: Color | undefined;
20
+ steps?: Steps;
21
+ /**
22
+ * The color of the stepper
23
+ * @default primary
24
+ */
25
+ color?: Color;
20
26
  /** Disable the next steps */
21
- disabledNextSteps?: boolean | undefined;
27
+ disabledNextSteps?: boolean;
22
28
  /** Disable the previous steps */
23
- disabledPreviousSteps?: boolean | undefined;
29
+ disabledPreviousSteps?: boolean;
24
30
  /** Auto validate the steps */
25
- autoValidateSteps?: boolean | undefined;
31
+ autoValidateSteps?: boolean;
26
32
  /** Open all steps */
27
- allStepsOpened?: boolean | undefined;
33
+ allStepsOpened?: boolean;
28
34
  /** Validate all steps */
29
- allStepsValidated?: boolean | undefined;
35
+ allStepsValidated?: boolean;
30
36
  /** Allow to close the steps */
31
- canCloseSteps?: boolean | undefined;
32
- }>, {
37
+ canCloseSteps?: boolean;
38
+ };
39
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
33
40
  modelValue: undefined;
34
41
  steps: undefined;
35
42
  color: string;
36
43
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
44
  "update:model-value": (value: number) => void;
38
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
39
- /** The current step */
40
- modelValue?: number | undefined;
41
- /** The steps */
42
- steps?: Steps | undefined;
43
- /** The color of the stepper */
44
- color?: Color | undefined;
45
- /** Disable the next steps */
46
- disabledNextSteps?: boolean | undefined;
47
- /** Disable the previous steps */
48
- disabledPreviousSteps?: boolean | undefined;
49
- /** Auto validate the steps */
50
- autoValidateSteps?: boolean | undefined;
51
- /** Open all steps */
52
- allStepsOpened?: boolean | undefined;
53
- /** Validate all steps */
54
- allStepsValidated?: boolean | undefined;
55
- /** Allow to close the steps */
56
- canCloseSteps?: boolean | undefined;
57
- }>, {
45
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
58
46
  modelValue: undefined;
59
47
  steps: undefined;
60
48
  color: string;
@@ -64,7 +52,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
64
52
  color: Color;
65
53
  modelValue: number;
66
54
  steps: Steps;
67
- }, {}>, Partial<Record<`title-${number}`, (_: {}) => any>> & Partial<Record<`subtitle-${number}`, (_: {}) => any>> & Partial<Record<`title-info-${number}`, (_: {}) => any>> & Partial<Record<`content-${number}`, (_: {
55
+ }, {}>, Partial<Record<`icon-${number}`, (_: {}) => any>> & Partial<Record<`title-${number}`, (_: {}) => any>> & Partial<Record<`subtitle-${number}`, (_: {}) => any>> & Partial<Record<`title-info-${number}`, (_: {}) => any>> & Partial<Record<`content-${number}`, (_: {
68
56
  validated: boolean;
69
57
  error: boolean | undefined;
70
58
  warning: boolean | undefined;
@@ -1,187 +0,0 @@
1
- import '../assets/MazStepper.css';
2
- import { defineComponent as L, useCssVars as q, defineAsyncComponent as m, computed as S, useSlots as G, ref as H, openBlock as i, createElementBlock as d, Fragment as E, renderList as J, normalizeClass as N, createElementVNode as r, createBlock as K, resolveDynamicComponent as Q, createCommentVNode as f, createTextVNode as h, toDisplayString as b, renderSlot as y, createVNode as R, unref as U, withCtx as X, withDirectives as Y, vShow as Z } from "vue";
3
- const ee = { class: "m-stepper" }, te = ["disabled", "onClick"], se = { class: "m-stepper__header__wrapper" }, oe = { class: "m-stepper__count --primary" }, ne = { class: "m-stepper__count__circle" }, ae = { class: "m-stepper__header__content" }, le = { class: "m-stepper__title" }, re = {
4
- key: 0,
5
- class: "m-stepper__subtitle"
6
- }, ie = {
7
- key: 0,
8
- class: "m-stepper__right"
9
- }, ce = { class: "m-stepper__content__wrapper" }, de = /* @__PURE__ */ L({
10
- __name: "MazStepper",
11
- props: {
12
- modelValue: { default: void 0 },
13
- steps: { default: void 0 },
14
- color: { default: "primary" },
15
- disabledNextSteps: { type: Boolean },
16
- disabledPreviousSteps: { type: Boolean },
17
- autoValidateSteps: { type: Boolean },
18
- allStepsOpened: { type: Boolean },
19
- allStepsValidated: { type: Boolean },
20
- canCloseSteps: { type: Boolean }
21
- },
22
- emits: ["update:model-value"],
23
- setup(p, { emit: C }) {
24
- q((e) => ({
25
- "029cd67d": P.value,
26
- "65bf52d5": W.value
27
- }));
28
- const _ = m(() => import("./MazTransitionExpand-Qi1Ryuww.mjs")), $ = m(() => import("./check-circle-CtCMBYyp.mjs")), g = m(
29
- () => import("./exclamation-circle-DzBJ8vGa.mjs")
30
- ), M = m(() => import("./exclamation-triangle-BfZLmRbP.mjs")), s = p, A = C, P = S(() => `var(--maz-color-${s.color})`), W = S(() => `var(--maz-color-${s.color}-contrast)`), I = G(), v = S(
31
- () => Object.keys(I).filter((e) => e.startsWith("content-")).length
32
- ), O = H(1), n = S({
33
- get: () => s.modelValue ?? O.value,
34
- set: (e) => {
35
- O.value = e, A("update:model-value", e);
36
- }
37
- }), k = (e) => z(e) ? { icon: $, class: "--success" } : w(e) ? { icon: M, class: "--warning" } : B(e) ? { icon: g, class: "--error" } : { class: "--normal" }, V = (e, o) => {
38
- var t, a;
39
- return (a = (t = s.steps) == null ? void 0 : t[o - 1]) == null ? void 0 : a[e];
40
- }, D = (e) => {
41
- n.value === e && s.canCloseSteps ? n.value = 0 : e < 1 ? n.value = 1 : e > v.value ? n.value = v.value : n.value = e;
42
- }, x = (e, o) => {
43
- var l, u;
44
- const t = e === "titleInfo" ? "title-info" : e, a = Object.keys(I).filter((F) => F.startsWith(`${t}-`)).includes(`${t}-${o}`), c = !!((u = (l = s.steps) == null ? void 0 : l[o - 1]) != null && u[e]);
45
- return a || c;
46
- }, z = (e) => {
47
- var c, l;
48
- const o = (l = (c = s.steps) == null ? void 0 : c[e - 1]) == null ? void 0 : l.success, t = B(e) || w(e), a = s.autoValidateSteps && e < n.value && !t;
49
- return o ?? (a || s.allStepsValidated);
50
- }, T = (e) => {
51
- var l, u;
52
- const o = (u = (l = s.steps) == null ? void 0 : l[e - 1]) == null ? void 0 : u.disabled, t = n.value === e && !s.canCloseSteps, a = s.disabledNextSteps && e > n.value, c = s.disabledPreviousSteps && e < n.value;
53
- return o ?? (t || a || c || s.allStepsOpened);
54
- }, B = (e) => {
55
- var o, t;
56
- return (t = (o = s.steps) == null ? void 0 : o[e - 1]) == null ? void 0 : t.error;
57
- }, w = (e) => {
58
- var o, t;
59
- return (t = (o = s.steps) == null ? void 0 : o[e - 1]) == null ? void 0 : t.warning;
60
- }, j = (e) => e === v.value;
61
- return (e, o) => (i(), d("div", ee, [
62
- (i(!0), d(
63
- E,
64
- null,
65
- J(v.value, (t) => (i(), d(
66
- E,
67
- { key: t },
68
- [
69
- x("title", t) ? (i(), d("button", {
70
- key: 0,
71
- type: "button",
72
- disabled: T(t),
73
- class: N(["m-stepper__header", [
74
- {
75
- "--is-current-step": t === n.value || e.allStepsOpened
76
- },
77
- `${k(t).class}`
78
- ]]),
79
- onClick: (a) => D(t)
80
- }, [
81
- r("div", se, [
82
- r("span", oe, [
83
- r("div", ne, [
84
- k(t).icon ? (i(), K(Q(k(t).icon), {
85
- key: 0,
86
- class: "icon maz-text-xl"
87
- })) : f("v-if", !0)
88
- ]),
89
- h(
90
- " " + b(t),
91
- 1
92
- /* TEXT */
93
- )
94
- ]),
95
- r("div", ae, [
96
- r("span", le, [
97
- y(e.$slots, `title-${t}`, {}, () => [
98
- h(
99
- b(V("title", t)),
100
- 1
101
- /* TEXT */
102
- )
103
- ], !0)
104
- ]),
105
- x("subtitle", t) ? (i(), d("span", re, [
106
- y(e.$slots, `subtitle-${t}`, {}, () => [
107
- h(
108
- b(V("subtitle", t)),
109
- 1
110
- /* TEXT */
111
- )
112
- ], !0)
113
- ])) : f("v-if", !0)
114
- ])
115
- ]),
116
- x("titleInfo", t) ? (i(), d("span", ie, [
117
- y(e.$slots, `title-info-${t}`, {}, () => [
118
- h(
119
- b(V("titleInfo", t)),
120
- 1
121
- /* TEXT */
122
- )
123
- ], !0)
124
- ])) : f("v-if", !0)
125
- ], 10, te)) : f("v-if", !0),
126
- r(
127
- "div",
128
- {
129
- class: N(["m-stepper__content", {
130
- "--no-border": j(t)
131
- }])
132
- },
133
- [
134
- R(
135
- U(_),
136
- null,
137
- {
138
- default: X(() => [
139
- Y(r(
140
- "div",
141
- null,
142
- [
143
- r("div", ce, [
144
- y(e.$slots, `content-${t}`, {
145
- validated: z(t),
146
- error: B(t),
147
- warning: w(t),
148
- nextStep: () => D(t + 1),
149
- previousStep: () => D(t - 1)
150
- }, void 0, !0)
151
- ])
152
- ],
153
- 512
154
- /* NEED_PATCH */
155
- ), [
156
- [Z, e.allStepsOpened || n.value === t]
157
- ])
158
- ]),
159
- _: 2
160
- /* DYNAMIC */
161
- },
162
- 1024
163
- /* DYNAMIC_SLOTS */
164
- )
165
- ],
166
- 2
167
- /* CLASS */
168
- )
169
- ],
170
- 64
171
- /* STABLE_FRAGMENT */
172
- ))),
173
- 128
174
- /* KEYED_FRAGMENT */
175
- ))
176
- ]));
177
- }
178
- }), ue = (p, C) => {
179
- const _ = p.__vccOpts || p;
180
- for (const [$, g] of C)
181
- _[$] = g;
182
- return _;
183
- }, _e = /* @__PURE__ */ ue(de, [["__scopeId", "data-v-7c143d25"]]);
184
- export {
185
- _e as M,
186
- ue as _
187
- };