maz-ui 3.37.2 → 3.37.4
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/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.d.ts +2 -2
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.d.ts +2 -0
- package/components/MazCard.mjs +1 -1
- package/components/MazCarousel.mjs +1 -1
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.d.ts +4 -4
- package/components/MazInputTags.mjs +1 -1
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +8 -4
- package/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +2 -2
- package/components/MazPhoneNumberInput.d.ts +21 -8
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazRadio.d.ts +89 -92
- package/components/MazRadio.mjs +67 -73
- package/components/MazRadioButtons.d.ts +84 -62
- package/components/MazRadioButtons.mjs +112 -60
- package/components/MazSelect.d.ts +12 -7
- package/components/MazSelect.mjs +1 -1
- package/components/MazSwitch.d.ts +61 -67
- package/components/MazSwitch.mjs +41 -48
- package/components/MazTable.mjs +1 -1
- package/components/MazTextarea.d.ts +23 -8
- package/components/MazTextarea.mjs +1 -1
- package/components/assets/MazBtn.css +1 -1
- package/components/assets/MazCard.css +1 -1
- package/components/assets/MazInputNumber.css +1 -1
- package/components/assets/MazInputTags.css +1 -1
- package/components/assets/MazPagination.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazRadio.css +1 -1
- package/components/assets/MazRadioButtons.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazSwitch.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTextarea.css +1 -1
- package/components/chunks/{MazBottomSheet-DZ1n4bGL.mjs → MazBottomSheet-B9OYmgyx.mjs} +1 -1
- package/components/chunks/{MazBtn-CnZU5zlG.mjs → MazBtn-4stpYG-V.mjs} +8 -8
- package/components/chunks/{MazBtn-Dbe098kd.mjs → MazBtn-BQZOiUux.mjs} +8 -8
- package/components/chunks/{MazBtn-DLYgzr9e.mjs → MazBtn-Bgt41rUb.mjs} +11 -11
- package/components/chunks/MazBtn-CNyFbl9Y.mjs +151 -0
- package/components/chunks/{MazBtn-BTHDxDz7.mjs → MazBtn-CrNEwd_M.mjs} +8 -8
- package/components/chunks/MazBtn-CyXtFeAh.mjs +151 -0
- package/components/chunks/{MazBtn-CnkBOGKK.mjs → MazBtn-DOtOjQOl.mjs} +11 -11
- package/components/chunks/{MazBtn-IH6bjzah.mjs → MazBtn-DXC8jXNK.mjs} +8 -8
- package/components/chunks/{MazBtn-Bo51KtKY.mjs → MazBtn-De3ZeaJJ.mjs} +8 -8
- package/components/chunks/{MazBtn-CDQAW3fg.mjs → MazBtn-g6VJMuer.mjs} +8 -8
- package/components/chunks/MazBtn-v1mwE1O3.mjs +151 -0
- package/components/chunks/{MazBtn-pLRsSxug.mjs → MazBtn-z9IFp0ZS.mjs} +8 -8
- package/components/chunks/{MazCard-CNE9c3L5.mjs → MazCard-E9Eg2VRn.mjs} +10 -8
- package/components/chunks/{MazCarousel-CMJgMJf1.mjs → MazCarousel-CtSpgIm6.mjs} +1 -1
- package/components/chunks/{MazCheckbox-DBlQwP82.mjs → MazCheckbox-BE7eLIkK.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CXVe5vda.mjs → MazCheckbox-eSSrvpn9.mjs} +1 -1
- package/components/chunks/{MazDialog-BVqOTysP.mjs → MazDialog-CjsC6fGo.mjs} +1 -1
- package/components/chunks/{MazDialogPromise-BjciKAwR.mjs → MazDialogPromise-Blv60XZR.mjs} +2 -2
- package/components/chunks/{MazGallery-BUUq89aM.mjs → MazGallery-DRgvR7K0.mjs} +2 -2
- package/components/chunks/{MazIcon-BTsi1M-S.mjs → MazIcon-C_IIdjqr.mjs} +1 -1
- package/components/chunks/{MazInput-Caas-0Nk.mjs → MazInput-Dn4JzYhe.mjs} +1 -1
- package/components/chunks/{MazInputNumber-CnoCQQzg.mjs → MazInputNumber-Df31nPnc.mjs} +2 -2
- package/components/chunks/{MazInputPrice---5nCUKm.mjs → MazInputPrice-DATyEiwP.mjs} +1 -1
- package/components/chunks/{MazInputTags-CipoVBP2.mjs → MazInputTags-DBzwE87F.mjs} +3 -3
- package/components/chunks/{MazPagination-CXw3yqbu.mjs → MazPagination-BU6fSHr2.mjs} +2 -2
- package/components/chunks/MazPhoneNumberInput-D8hP4ZzW.mjs +1419 -0
- package/components/chunks/{MazPicker-CfhI75aw.mjs → MazPicker-D71j9m8h.mjs} +2 -2
- package/components/chunks/{MazPickerCalendar-DnkNE-Am.mjs → MazPickerCalendar-psuBcTR7.mjs} +3 -3
- package/components/chunks/{MazPickerHeader-Vt86yzXS.mjs → MazPickerHeader-BmqHJE0a.mjs} +1 -1
- package/components/chunks/{MazPickerMonthSwitcher-zfKhsjW1.mjs → MazPickerMonthSwitcher-DgU0pLkF.mjs} +2 -2
- package/components/chunks/{MazPickerShortcuts-DUIKfOO8.mjs → MazPickerShortcuts-D9YXi3Ns.mjs} +2 -2
- package/components/chunks/{MazPickerTime-B2znRxr2.mjs → MazPickerTime-8ZqSEb_N.mjs} +2 -2
- package/components/chunks/{MazPickerYearSwitcher-CB339kof.mjs → MazPickerYearSwitcher-D-zu0tMs.mjs} +3 -3
- package/components/chunks/MazSelect-Cc8JAFML.mjs +731 -0
- package/components/chunks/{MazSpinner-DFseK3o_.mjs → MazSpinner-2-OAJWTi.mjs} +1 -1
- package/components/chunks/MazSpinner-B0xEVmcj.mjs +38 -0
- package/components/chunks/{MazSpinner-2fDI3i5h.mjs → MazSpinner-B3Gt0AEt.mjs} +1 -1
- package/components/chunks/MazSpinner-B6Z6X_KC.mjs +38 -0
- package/components/chunks/{MazSpinner-CORsBFCP.mjs → MazSpinner-BVaJBGw5.mjs} +1 -1
- package/components/chunks/{MazSpinner-CJaSrYbQ.mjs → MazSpinner-BVflp3wp.mjs} +1 -1
- package/components/chunks/MazSpinner-BmqyUsTZ.mjs +38 -0
- package/components/chunks/{MazSpinner-XMLkiLTL.mjs → MazSpinner-Btk7fYzq.mjs} +1 -1
- package/components/chunks/{MazSpinner-BtFWH26r.mjs → MazSpinner-CAQqdZfW.mjs} +1 -1
- package/components/chunks/MazSpinner-COqX5baD.mjs +38 -0
- package/components/chunks/{MazSpinner-CVBVegaS.mjs → MazSpinner-CV3h3CKR.mjs} +1 -1
- package/components/chunks/MazSpinner-Cm5GeVV-.mjs +38 -0
- package/components/chunks/{MazSpinner-CkHAaRhk.mjs → MazSpinner-D9uDPRkX.mjs} +1 -1
- package/components/chunks/MazSpinner-DO1id61e.mjs +38 -0
- package/components/chunks/{MazSpinner-BAhgxOgg.mjs → MazSpinner-K26cuR_A.mjs} +1 -1
- package/components/chunks/MazSpinner-LCpiZGMP.mjs +38 -0
- package/components/chunks/MazTable-vcm_SC7e.mjs +1846 -0
- package/components/chunks/{MazTransitionExpand-BWsQP7UF.mjs → MazTransitionExpand-DXKtquVe.mjs} +1 -1
- package/css/main.css +1 -1
- package/modules/assets/MazBtn.css +1 -1
- package/modules/chunks/{MazBtn-BxYYeNGe.mjs → MazBtn-CNsgLyRm.mjs} +8 -8
- package/modules/chunks/{MazBtn-CHUwa3fu.cjs → MazBtn-DmXrGuUE.cjs} +2 -2
- package/modules/chunks/{MazIcon-CnOCvJTw.mjs → MazIcon-DwRWkhhR.mjs} +1 -1
- package/modules/chunks/{MazIcon-DcbutTbM.cjs → MazIcon-rh9PwwaQ.cjs} +1 -1
- package/modules/chunks/{MazSpinner-TL9_4BOs.cjs → MazSpinner-BzucVZXm.cjs} +1 -1
- package/modules/chunks/{MazSpinner-ClFhZyF_.mjs → MazSpinner-mCJd14Kq.mjs} +1 -1
- package/modules/chunks/{index-DksGhf51.cjs → index-DHsybBwE.cjs} +1 -1
- package/modules/chunks/{index-_xAQ9uTd.mjs → index-DrSSNP9y.mjs} +2 -2
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +5 -5
- package/package.json +6 -6
- package/types/components/MazBtn.vue.d.ts +2 -2
- package/types/components/MazCard.vue.d.ts +2 -0
- package/types/components/MazInputTags.vue.d.ts +4 -4
- package/types/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +8 -4
- package/types/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +2 -2
- package/types/components/MazPhoneNumberInput.vue.d.ts +21 -8
- package/types/components/MazRadio.vue.d.ts +89 -92
- package/types/components/MazRadioButtons.vue.d.ts +84 -62
- package/types/components/MazSelect.vue.d.ts +12 -7
- package/types/components/MazSwitch.vue.d.ts +61 -67
- package/types/components/MazTextarea.vue.d.ts +23 -8
- package/components/chunks/MazBtn-Cpnby6Lb.mjs +0 -151
- package/components/chunks/MazBtn-D-Axz-X0.mjs +0 -151
- package/components/chunks/MazBtn-Koayc6g_.mjs +0 -151
- package/components/chunks/MazPhoneNumberInput-CsX6Kqob.mjs +0 -1423
- package/components/chunks/MazSelect-DZeXglR8.mjs +0 -767
- package/components/chunks/MazSpinner-CdKm_Lcp.mjs +0 -38
- package/components/chunks/MazSpinner-CkdjTE0y.mjs +0 -38
- package/components/chunks/MazSpinner-DECa8Pby.mjs +0 -38
- package/components/chunks/MazSpinner-DMBy6mx3.mjs +0 -38
- package/components/chunks/MazSpinner-Dq4o-_GM.mjs +0 -38
- package/components/chunks/MazSpinner-DqXjnLKa.mjs +0 -38
- package/components/chunks/MazSpinner-DyE_USVF.mjs +0 -38
- package/components/chunks/MazTable-DrFqDO-J.mjs +0 -1882
package/components/MazRadio.mjs
CHANGED
|
@@ -1,59 +1,45 @@
|
|
|
1
1
|
import './assets/MazRadio.css';
|
|
2
|
-
import { getCurrentInstance as
|
|
3
|
-
const
|
|
4
|
-
componentName:
|
|
5
|
-
providedId:
|
|
2
|
+
import { getCurrentInstance as g, computed as r, defineComponent as S, useCssVars as y, openBlock as k, createElementBlock as z, unref as p, normalizeClass as I, normalizeStyle as C, createElementVNode as c, mergeProps as B, createCommentVNode as V, renderSlot as N, createTextVNode as _, toDisplayString as w, pushScopeId as M, popScopeId as x } from "vue";
|
|
3
|
+
const D = ({
|
|
4
|
+
componentName: o,
|
|
5
|
+
providedId: t
|
|
6
6
|
}) => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
},
|
|
7
|
+
const a = g();
|
|
8
|
+
return r(() => t ?? `${o}-${a == null ? void 0 : a.uid}`);
|
|
9
|
+
}, E = (o) => (M("data-v-0b81d1b5"), o = o(), x(), o), R = ["for", "aria-checked"], T = ["id", "value", "disabled", "name", "checked"], $ = /* @__PURE__ */ E(() => /* @__PURE__ */ c(
|
|
10
10
|
"span",
|
|
11
11
|
null,
|
|
12
12
|
[
|
|
13
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ c("span", { class: "round" })
|
|
14
14
|
],
|
|
15
15
|
-1
|
|
16
16
|
/* HOISTED */
|
|
17
|
-
)),
|
|
17
|
+
)), q = /* @__PURE__ */ S({
|
|
18
18
|
__name: "MazRadio",
|
|
19
19
|
props: {
|
|
20
|
-
style: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
modelValue: { type: String, default: void 0 },
|
|
30
|
-
value: { type: String, required: !0 },
|
|
31
|
-
name: { type: String, required: !0 },
|
|
32
|
-
id: { type: String, default: void 0 },
|
|
33
|
-
color: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "primary"
|
|
36
|
-
},
|
|
37
|
-
size: { type: String, default: "md" },
|
|
20
|
+
style: { default: void 0 },
|
|
21
|
+
class: { default: void 0 },
|
|
22
|
+
id: { default: void 0 },
|
|
23
|
+
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
24
|
+
value: { type: [String, Number, Boolean] },
|
|
25
|
+
name: {},
|
|
26
|
+
label: { default: void 0 },
|
|
27
|
+
color: { default: "primary" },
|
|
28
|
+
size: { default: "md" },
|
|
38
29
|
disabled: { type: Boolean, default: !1 }
|
|
39
30
|
},
|
|
40
|
-
emits: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
setup(e, { emit: r }) {
|
|
47
|
-
h((a) => ({
|
|
48
|
-
"2bb5b2cb": p.value,
|
|
49
|
-
ad373404: v.value,
|
|
50
|
-
"0a907a41": y.value
|
|
31
|
+
emits: ["update:model-value", "change"],
|
|
32
|
+
setup(o, { emit: t }) {
|
|
33
|
+
y((e) => ({
|
|
34
|
+
"8d62fd0a": f.value,
|
|
35
|
+
"1b5dc564": v.value,
|
|
36
|
+
"22c54cde": b.value
|
|
51
37
|
}));
|
|
52
|
-
const
|
|
38
|
+
const a = o, n = t, s = D({
|
|
53
39
|
componentName: "MazCheckbox",
|
|
54
|
-
providedId:
|
|
55
|
-
}),
|
|
56
|
-
switch (
|
|
40
|
+
providedId: a.id
|
|
41
|
+
}), i = r(() => a.modelValue === a.value), f = r(() => {
|
|
42
|
+
switch (a.size) {
|
|
57
43
|
case "xl":
|
|
58
44
|
return "2.25rem";
|
|
59
45
|
case "lg":
|
|
@@ -67,54 +53,62 @@ const N = ({
|
|
|
67
53
|
case "mini":
|
|
68
54
|
return "1.2rem";
|
|
69
55
|
}
|
|
70
|
-
}), v =
|
|
71
|
-
() => ["black", "transparent"].includes(
|
|
56
|
+
}), v = r(() => `var(--maz-color-${a.color})`), b = r(
|
|
57
|
+
() => ["black", "transparent"].includes(a.color) ? "var(--maz-color-muted)" : `var(--maz-color-${a.color}-alpha)`
|
|
72
58
|
);
|
|
73
|
-
function
|
|
74
|
-
["Space"].includes(
|
|
59
|
+
function h(e, l) {
|
|
60
|
+
["Space"].includes(e.code) && (e.preventDefault(), u(l));
|
|
75
61
|
}
|
|
76
|
-
function u(
|
|
77
|
-
n("update:model-value",
|
|
62
|
+
function u(e) {
|
|
63
|
+
n("update:model-value", e), n("change", e);
|
|
78
64
|
}
|
|
79
|
-
return (
|
|
80
|
-
for:
|
|
81
|
-
class:
|
|
65
|
+
return (e, l) => (k(), z("label", {
|
|
66
|
+
for: p(s),
|
|
67
|
+
class: I(["m-checkbox", [{ "--disabled": e.disabled, "--selected": i.value }, a.class]]),
|
|
82
68
|
tabindex: "0",
|
|
83
69
|
role: "radio",
|
|
84
|
-
style:
|
|
85
|
-
"aria-checked":
|
|
86
|
-
onKeydown:
|
|
70
|
+
style: C(e.style),
|
|
71
|
+
"aria-checked": i.value,
|
|
72
|
+
onKeydown: l[1] || (l[1] = (d) => h(d, e.value))
|
|
87
73
|
}, [
|
|
88
|
-
|
|
89
|
-
id:
|
|
74
|
+
c("input", B({
|
|
75
|
+
id: p(s),
|
|
90
76
|
value: e.value
|
|
91
|
-
},
|
|
77
|
+
}, e.$attrs, {
|
|
92
78
|
tabindex: "-1",
|
|
93
79
|
disabled: e.disabled,
|
|
94
80
|
name: e.name,
|
|
95
81
|
type: "radio",
|
|
96
|
-
checked:
|
|
97
|
-
onChange:
|
|
82
|
+
checked: i.value,
|
|
83
|
+
onChange: l[0] || (l[0] = (d) => {
|
|
98
84
|
var m;
|
|
99
|
-
return u((m =
|
|
85
|
+
return u((m = d == null ? void 0 : d.target) == null ? void 0 : m.value);
|
|
100
86
|
})
|
|
101
|
-
}), null, 16,
|
|
102
|
-
|
|
103
|
-
V(
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
}), null, 16, T),
|
|
88
|
+
$,
|
|
89
|
+
V(`
|
|
90
|
+
@slot Label of the radio
|
|
91
|
+
@binding {Boolean} is-selected - If the radio is selected
|
|
92
|
+
@binding {string | number | boolean} value - The value of the radio
|
|
93
|
+
`),
|
|
94
|
+
N(e.$slots, "default", {
|
|
95
|
+
isSelected: i.value,
|
|
96
|
+
value: e.value
|
|
97
|
+
}, () => [
|
|
98
|
+
_(
|
|
99
|
+
w(e.label),
|
|
106
100
|
1
|
|
107
101
|
/* TEXT */
|
|
108
102
|
)
|
|
109
103
|
], !0)
|
|
110
|
-
], 46,
|
|
104
|
+
], 46, R));
|
|
111
105
|
}
|
|
112
|
-
}),
|
|
113
|
-
const
|
|
114
|
-
for (const [n, s] of
|
|
115
|
-
|
|
116
|
-
return
|
|
117
|
-
},
|
|
106
|
+
}), H = (o, t) => {
|
|
107
|
+
const a = o.__vccOpts || o;
|
|
108
|
+
for (const [n, s] of t)
|
|
109
|
+
a[n] = s;
|
|
110
|
+
return a;
|
|
111
|
+
}, L = /* @__PURE__ */ H(q, [["__scopeId", "data-v-0b81d1b5"]]);
|
|
118
112
|
export {
|
|
119
|
-
|
|
113
|
+
L as default
|
|
120
114
|
};
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type StyleValue } from 'vue';
|
|
2
2
|
import type { Color } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type ButtonsRadioOption = {
|
|
4
|
+
/** The label of the option */
|
|
4
5
|
label: string;
|
|
5
|
-
value
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
onChange?: ((
|
|
62
|
-
"onUpdate:model-value"?: ((
|
|
6
|
+
/** The value of the option */
|
|
7
|
+
value: string | number | boolean;
|
|
8
|
+
/** The classes to apply to the option */
|
|
9
|
+
classes?: any;
|
|
10
|
+
/** The style to apply to the option */
|
|
11
|
+
style?: StyleValue;
|
|
12
|
+
} & Record<string, unknown>;
|
|
13
|
+
export type Props = {
|
|
14
|
+
/** @model The value of the selected option */
|
|
15
|
+
modelValue?: string | number | boolean;
|
|
16
|
+
/** The options to display */
|
|
17
|
+
options: ButtonsRadioOption[];
|
|
18
|
+
/** The name of the radio group */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** The color of the selected radio buttons */
|
|
21
|
+
color?: Color;
|
|
22
|
+
/** Add elevation to the radio buttons */
|
|
23
|
+
elevation?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The orientation of the radio buttons
|
|
26
|
+
* @values 'row' | 'col'
|
|
27
|
+
*/
|
|
28
|
+
orientation?: 'row' | 'col';
|
|
29
|
+
/** Disable the wrap of the radio buttons */
|
|
30
|
+
noWrap?: boolean;
|
|
31
|
+
/** Make all radio buttons the same size */
|
|
32
|
+
equalSize?: boolean;
|
|
33
|
+
/** Display a selector icon */
|
|
34
|
+
selector?: boolean;
|
|
35
|
+
/** The component will be displayed in full width */
|
|
36
|
+
block?: boolean;
|
|
37
|
+
};
|
|
38
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
39
|
+
modelValue: undefined;
|
|
40
|
+
name: string;
|
|
41
|
+
color: string;
|
|
42
|
+
elevation: boolean;
|
|
43
|
+
orientation: string;
|
|
44
|
+
noWrap: boolean;
|
|
45
|
+
equalSize: boolean;
|
|
46
|
+
selector: boolean;
|
|
47
|
+
block: boolean;
|
|
48
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
49
|
+
"update:model-value": (value: string | number | boolean) => void;
|
|
50
|
+
change: (value: string | number | boolean) => void;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
52
|
+
modelValue: undefined;
|
|
53
|
+
name: string;
|
|
54
|
+
color: string;
|
|
55
|
+
elevation: boolean;
|
|
56
|
+
orientation: string;
|
|
57
|
+
noWrap: boolean;
|
|
58
|
+
equalSize: boolean;
|
|
59
|
+
selector: boolean;
|
|
60
|
+
block: boolean;
|
|
61
|
+
}>>> & {
|
|
62
|
+
onChange?: ((value: string | number | boolean) => any) | undefined;
|
|
63
|
+
"onUpdate:model-value"?: ((value: string | number | boolean) => any) | undefined;
|
|
63
64
|
}, {
|
|
64
65
|
name: string;
|
|
65
66
|
orientation: "col" | "row";
|
|
66
67
|
color: Color;
|
|
67
|
-
|
|
68
|
-
modelValue: string | number;
|
|
68
|
+
block: boolean;
|
|
69
|
+
modelValue: string | number | boolean;
|
|
70
|
+
elevation: boolean;
|
|
71
|
+
noWrap: boolean;
|
|
72
|
+
equalSize: boolean;
|
|
73
|
+
selector: boolean;
|
|
69
74
|
}, {}>, {
|
|
70
75
|
default?(_: {
|
|
71
76
|
option: ButtonsRadioOption;
|
|
@@ -73,8 +78,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
73
78
|
}): any;
|
|
74
79
|
}>;
|
|
75
80
|
export default _default;
|
|
81
|
+
type __VLS_WithDefaults<P, D> = {
|
|
82
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
83
|
+
default: D[K];
|
|
84
|
+
}> : P[K];
|
|
85
|
+
};
|
|
86
|
+
type __VLS_Prettify<T> = {
|
|
87
|
+
[K in keyof T]: T[K];
|
|
88
|
+
} & {};
|
|
76
89
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
77
90
|
new (): {
|
|
78
91
|
$slots: S;
|
|
79
92
|
};
|
|
80
93
|
};
|
|
94
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
95
|
+
type __VLS_TypePropsToOption<T> = {
|
|
96
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
97
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
98
|
+
} : {
|
|
99
|
+
type: import('vue').PropType<T[K]>;
|
|
100
|
+
required: true;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -1,79 +1,131 @@
|
|
|
1
1
|
import './assets/MazRadioButtons.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
2
|
+
import { defineComponent as z, defineAsyncComponent as k, openBlock as r, createElementBlock as s, normalizeClass as c, Fragment as _, renderList as B, normalizeStyle as p, createElementVNode as b, createVNode as h, Transition as S, withCtx as $, withDirectives as C, unref as w, vShow as V, createCommentVNode as y, renderSlot as N, createTextVNode as q, toDisplayString as D } from "vue";
|
|
3
|
+
const I = ["for", "aria-checked", "onKeydown"], M = ["id", "name", "value", "onChange"], R = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "m-radio-buttons__items__checkbox"
|
|
6
|
+
}, T = /* @__PURE__ */ z({
|
|
4
7
|
__name: "MazRadioButtons",
|
|
5
8
|
props: {
|
|
6
|
-
modelValue: { type: [String, Number], default: void 0 },
|
|
7
|
-
options: {
|
|
8
|
-
name: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
noElevation: { type: Boolean, default: !1 },
|
|
17
|
-
orientation: { type: String, default: "row" }
|
|
9
|
+
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
10
|
+
options: {},
|
|
11
|
+
name: { default: "MazButtonsRadio" },
|
|
12
|
+
color: { default: "primary" },
|
|
13
|
+
elevation: { type: Boolean, default: !1 },
|
|
14
|
+
orientation: { default: "row" },
|
|
15
|
+
noWrap: { type: Boolean, default: !1 },
|
|
16
|
+
equalSize: { type: Boolean, default: !1 },
|
|
17
|
+
selector: { type: Boolean, default: !1 },
|
|
18
|
+
block: { type: Boolean, default: !1 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:model-value", "change"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
d("update:model-value",
|
|
21
|
+
setup(l, { emit: u }) {
|
|
22
|
+
const t = k(() => import("./chunks/check-CL-vqe79.mjs")), n = l, d = u;
|
|
23
|
+
function m(e) {
|
|
24
|
+
d("update:model-value", e.value);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
26
|
+
function o(e) {
|
|
27
|
+
return n.modelValue === e;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
["Space"].includes(
|
|
29
|
+
function g(e, f) {
|
|
30
|
+
["Space"].includes(e.code) && (e.preventDefault(), m(f));
|
|
30
31
|
}
|
|
31
|
-
return (
|
|
32
|
+
return (e, f) => (r(), s(
|
|
32
33
|
"div",
|
|
33
34
|
{
|
|
34
|
-
class:
|
|
35
|
+
class: c(["m-radio-buttons", [`--${e.orientation}`, { "--no-wrap": e.noWrap, "--block": e.block }]])
|
|
35
36
|
},
|
|
36
37
|
[
|
|
37
|
-
(
|
|
38
|
-
|
|
38
|
+
(r(!0), s(
|
|
39
|
+
_,
|
|
39
40
|
null,
|
|
40
|
-
|
|
41
|
-
key:
|
|
42
|
-
for:
|
|
43
|
-
class:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
B(e.options, (a, i) => (r(), s("label", {
|
|
42
|
+
key: `option-${i}-${a.value.toString()}`,
|
|
43
|
+
for: `option-${i}-${a.value.toString()}`,
|
|
44
|
+
class: c(["m-radio-buttons__items maz-group", [
|
|
45
|
+
{
|
|
46
|
+
"--is-selected": o(a.value),
|
|
47
|
+
"--elevation": e.elevation,
|
|
48
|
+
"--equal-size": e.equalSize
|
|
49
|
+
},
|
|
50
|
+
a.classes
|
|
51
|
+
]]),
|
|
47
52
|
tabindex: "0",
|
|
48
|
-
style:
|
|
49
|
-
|
|
50
|
-
color: `var(--maz-color-${
|
|
51
|
-
backgroundColor: `var(--maz-color-${
|
|
52
|
-
} :
|
|
53
|
-
|
|
53
|
+
style: p([
|
|
54
|
+
o(a.value) ? {
|
|
55
|
+
color: `var(--maz-color-${e.color}-contrast)`,
|
|
56
|
+
backgroundColor: `var(--maz-color-${e.color})`
|
|
57
|
+
} : {},
|
|
58
|
+
a.style
|
|
59
|
+
]),
|
|
54
60
|
role: "radio",
|
|
55
|
-
"aria-checked":
|
|
56
|
-
onKeydown: (
|
|
61
|
+
"aria-checked": o(a.value),
|
|
62
|
+
onKeydown: (v) => g(v, a)
|
|
57
63
|
}, [
|
|
58
|
-
|
|
59
|
-
id:
|
|
64
|
+
b("input", {
|
|
65
|
+
id: `option-${i}-${a.value.toString()}`,
|
|
60
66
|
type: "radio",
|
|
61
|
-
name:
|
|
62
|
-
value:
|
|
67
|
+
name: e.name,
|
|
68
|
+
value: a.value,
|
|
63
69
|
class: "maz-hidden",
|
|
64
|
-
onChange: (
|
|
65
|
-
}, null, 40,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
onChange: (v) => m(a)
|
|
71
|
+
}, null, 40, M),
|
|
72
|
+
e.selector ? (r(), s("div", R, [
|
|
73
|
+
b(
|
|
74
|
+
"span",
|
|
75
|
+
{
|
|
76
|
+
class: c({
|
|
77
|
+
"--is-selected": o(a.value)
|
|
78
|
+
}),
|
|
79
|
+
style: p([
|
|
80
|
+
o(a.value) ? { backgroundColor: `var(--maz-color-${n.color}-600)` } : {}
|
|
81
|
+
])
|
|
82
|
+
},
|
|
83
|
+
[
|
|
84
|
+
h(
|
|
85
|
+
S,
|
|
86
|
+
{
|
|
87
|
+
name: "maz-radio-buttons-scale",
|
|
88
|
+
persisted: ""
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
default: $(() => [
|
|
92
|
+
C(h(
|
|
93
|
+
w(t),
|
|
94
|
+
{ class: "maz-h-full maz-w-full" },
|
|
95
|
+
null,
|
|
96
|
+
512
|
|
97
|
+
/* NEED_PATCH */
|
|
98
|
+
), [
|
|
99
|
+
[V, o(a.value)]
|
|
100
|
+
])
|
|
101
|
+
]),
|
|
102
|
+
_: 2
|
|
103
|
+
/* DYNAMIC */
|
|
104
|
+
},
|
|
105
|
+
1024
|
|
106
|
+
/* DYNAMIC_SLOTS */
|
|
107
|
+
)
|
|
108
|
+
],
|
|
109
|
+
6
|
|
110
|
+
/* CLASS, STYLE */
|
|
111
|
+
)
|
|
112
|
+
])) : y("v-if", !0),
|
|
113
|
+
y(`
|
|
114
|
+
@slot Label of the radio
|
|
115
|
+
@binding {Boolean} selected - If the option is selected
|
|
116
|
+
@binding {string | number | boolean} option - The value of the option
|
|
117
|
+
`),
|
|
118
|
+
N(e.$slots, "default", {
|
|
119
|
+
option: a,
|
|
120
|
+
selected: o(a.value)
|
|
69
121
|
}, () => [
|
|
70
|
-
|
|
71
|
-
|
|
122
|
+
q(
|
|
123
|
+
D(a.label),
|
|
72
124
|
1
|
|
73
125
|
/* TEXT */
|
|
74
126
|
)
|
|
75
127
|
], !0)
|
|
76
|
-
], 46,
|
|
128
|
+
], 46, I))),
|
|
77
129
|
128
|
|
78
130
|
/* KEYED_FRAGMENT */
|
|
79
131
|
))
|
|
@@ -82,12 +134,12 @@ const x = ["for", "aria-checked", "onKeydown"], B = ["id", "name", "value", "onC
|
|
|
82
134
|
/* CLASS */
|
|
83
135
|
));
|
|
84
136
|
}
|
|
85
|
-
}),
|
|
86
|
-
const
|
|
87
|
-
for (const [
|
|
88
|
-
|
|
89
|
-
return
|
|
90
|
-
},
|
|
137
|
+
}), E = (l, u) => {
|
|
138
|
+
const t = l.__vccOpts || l;
|
|
139
|
+
for (const [n, d] of u)
|
|
140
|
+
t[n] = d;
|
|
141
|
+
return t;
|
|
142
|
+
}, L = /* @__PURE__ */ E(T, [["__scopeId", "data-v-7f9271c8"]]);
|
|
91
143
|
export {
|
|
92
|
-
|
|
144
|
+
L as default
|
|
93
145
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type HTMLAttributes } from 'vue';
|
|
2
2
|
import type { Color, ModelValueSimple, Position, Size } from './types';
|
|
3
3
|
export type NormalizedOption = Record<string, ModelValueSimple>;
|
|
4
4
|
export type MazSelectOptionWithOptGroup = {
|
|
@@ -8,10 +8,10 @@ export type MazSelectOptionWithOptGroup = {
|
|
|
8
8
|
export type MazSelectOption = NormalizedOption | string | number | boolean | MazSelectOptionWithOptGroup;
|
|
9
9
|
export type { Color, Size, ModelValueSimple, Position };
|
|
10
10
|
export type Props = {
|
|
11
|
-
/**
|
|
12
|
-
style?:
|
|
13
|
-
/**
|
|
14
|
-
class?:
|
|
11
|
+
/** Style attribut of the component root element */
|
|
12
|
+
style?: HTMLAttributes['style'];
|
|
13
|
+
/** Class attribut of the component root element */
|
|
14
|
+
class?: HTMLAttributes['class'];
|
|
15
15
|
/** The id of the select */
|
|
16
16
|
id?: string;
|
|
17
17
|
/** The value of the select */
|
|
@@ -51,6 +51,8 @@ export type Props = {
|
|
|
51
51
|
/** The input will be displayed in full width */
|
|
52
52
|
block?: boolean;
|
|
53
53
|
};
|
|
54
|
+
declare function closeList(event?: Event): Promise<void>;
|
|
55
|
+
declare function openList(event?: Event): Promise<void>;
|
|
54
56
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
55
57
|
id: undefined;
|
|
56
58
|
class: undefined;
|
|
@@ -67,7 +69,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
67
69
|
color: string;
|
|
68
70
|
searchPlaceholder: string;
|
|
69
71
|
options: undefined;
|
|
70
|
-
}>, {
|
|
72
|
+
}>, {
|
|
73
|
+
openList: typeof openList;
|
|
74
|
+
closeList: typeof closeList;
|
|
75
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
71
76
|
close: (value?: Event | undefined) => void;
|
|
72
77
|
open: (value?: boolean | undefined) => void;
|
|
73
78
|
blur: (value?: Event | undefined) => void;
|
|
@@ -101,7 +106,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
101
106
|
"onSelected-option"?: ((option: MazSelectOption) => any) | undefined;
|
|
102
107
|
}, {
|
|
103
108
|
size: Size;
|
|
104
|
-
style: string | false | import("vue").CSSProperties | StyleValue[] | null;
|
|
109
|
+
style: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
|
|
105
110
|
id: string;
|
|
106
111
|
options: MazSelectOption[];
|
|
107
112
|
color: Color;
|
package/components/MazSelect.mjs
CHANGED