maz-ui 3.19.2 → 3.20.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/MazCheckbox.d.ts +22 -2
- package/components/MazCheckbox.mjs +144 -32
- package/components/MazFullscreenLoader.d.ts +3 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazSelect.d.ts +12 -4
- package/components/MazSelect.mjs +1 -1
- package/components/assets/MazCheckbox.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/chunks/{MazBtn-16ab35fe.mjs → MazBtn-090f5ced.mjs} +2 -2
- package/components/chunks/{MazBtn-0d8e3249.mjs → MazBtn-e578aab0.mjs} +2 -2
- package/components/chunks/MazCheckbox-12a37b71.mjs +144 -0
- package/components/chunks/MazCheckbox-aeada499.mjs +144 -0
- package/components/chunks/MazPhoneNumberInput-94d7c29b.mjs +1482 -0
- package/components/chunks/{MazSelect-1f4d1193.mjs → MazSelect-5c3b7a30.mjs} +128 -70
- package/components/chunks/{MazSpinner-5fdafc97.mjs → MazSpinner-5be69292.mjs} +1 -1
- package/components/chunks/{MazSpinner-6025406b.mjs → MazSpinner-f1454eeb.mjs} +1 -1
- package/components/chunks/check-77afbaee.mjs +32 -0
- package/css/main.css +1 -1
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +9 -5
- package/package.json +15 -15
- package/types/components/MazCheckbox.vue.d.ts +22 -2
- package/types/components/MazFullscreenLoader.vue.d.ts +3 -0
- package/types/components/MazSelect.vue.d.ts +12 -4
- package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +3 -0
- package/types/tailwindcss/tailwind.config.d.ts +1 -2
- package/components/chunks/MazInput-15f3e149.mjs +0 -344
- package/components/chunks/MazPhoneNumberInput-901c4fa6.mjs +0 -651
- package/components/chunks/MazSelect-c5c3f874.mjs +0 -444
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import "../assets/MazCheckbox.css";
|
|
2
|
+
import { defineComponent, useCssVars, getCurrentInstance, computed, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, createVNode, Transition, withCtx, withDirectives, vShow, renderSlot } from "vue";
|
|
3
|
+
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazSelect-5c3b7a30.mjs";
|
|
4
|
+
import CheckIcon from "./check-77afbaee.mjs";
|
|
5
|
+
const _hoisted_1 = ["for"];
|
|
6
|
+
const _hoisted_2 = ["id", "checked", "disabled", "name"];
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "MazCheckbox",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: { type: Boolean, required: true },
|
|
11
|
+
id: { type: String, default: void 0 },
|
|
12
|
+
color: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "primary"
|
|
15
|
+
},
|
|
16
|
+
name: { type: String, default: "m-checkbox" },
|
|
17
|
+
size: { type: String, default: "md" },
|
|
18
|
+
disabled: { type: Boolean, default: false }
|
|
19
|
+
},
|
|
20
|
+
emits: [
|
|
21
|
+
/* emitted when value change */
|
|
22
|
+
"update:model-value",
|
|
23
|
+
/* emited when value change */
|
|
24
|
+
"change"
|
|
25
|
+
],
|
|
26
|
+
setup(__props, { emit: __emit }) {
|
|
27
|
+
useCssVars((_ctx) => ({
|
|
28
|
+
"848d9fe6": checkIconColor.value,
|
|
29
|
+
"fb0e9a22": checkboxSize.value,
|
|
30
|
+
"cf55634c": checkboxSelectedColor.value,
|
|
31
|
+
"99c81ec6": checkboxBoxShadow.value
|
|
32
|
+
}));
|
|
33
|
+
const instance = getCurrentInstance();
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emits = __emit;
|
|
36
|
+
const instanceId = useInstanceUniqId({
|
|
37
|
+
componentName: "MazCheckbox",
|
|
38
|
+
instance,
|
|
39
|
+
providedId: props.id
|
|
40
|
+
});
|
|
41
|
+
const checkboxSize = computed(() => {
|
|
42
|
+
switch (props.size) {
|
|
43
|
+
case "xl": {
|
|
44
|
+
return "2.25rem";
|
|
45
|
+
}
|
|
46
|
+
case "lg": {
|
|
47
|
+
return "2rem";
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
50
|
+
return "1.625rem";
|
|
51
|
+
}
|
|
52
|
+
case "sm": {
|
|
53
|
+
return "1.425rem";
|
|
54
|
+
}
|
|
55
|
+
case "xs": {
|
|
56
|
+
return "1.325rem";
|
|
57
|
+
}
|
|
58
|
+
case "mini": {
|
|
59
|
+
return "1.2rem";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const checkIconSize = computed(() => {
|
|
64
|
+
switch (props.size) {
|
|
65
|
+
case "xl": {
|
|
66
|
+
return "maz-text-2xl";
|
|
67
|
+
}
|
|
68
|
+
case "lg": {
|
|
69
|
+
return "maz-text-xl";
|
|
70
|
+
}
|
|
71
|
+
default: {
|
|
72
|
+
return "maz-text-lg";
|
|
73
|
+
}
|
|
74
|
+
case "sm": {
|
|
75
|
+
return "maz-text-base";
|
|
76
|
+
}
|
|
77
|
+
case "xs": {
|
|
78
|
+
return "maz-text-sm";
|
|
79
|
+
}
|
|
80
|
+
case "mini": {
|
|
81
|
+
return "maz-text-xs";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const checkIconColor = computed(() => `var(--maz-color-${props.color}-contrast)`);
|
|
86
|
+
const checkboxSelectedColor = computed(() => `var(--maz-color-${props.color})`);
|
|
87
|
+
const checkboxBoxShadow = computed(
|
|
88
|
+
() => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
|
|
89
|
+
);
|
|
90
|
+
function keyboardHandler(event) {
|
|
91
|
+
if (["Enter", "Space"].includes(event.code)) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
emitValue(!props.modelValue);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function emitValue(value) {
|
|
97
|
+
emits("update:model-value", value);
|
|
98
|
+
emits("change", value);
|
|
99
|
+
}
|
|
100
|
+
return (_ctx, _cache) => {
|
|
101
|
+
return openBlock(), createElementBlock("label", {
|
|
102
|
+
for: unref(instanceId),
|
|
103
|
+
class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled }]),
|
|
104
|
+
tabindex: "1",
|
|
105
|
+
onKeydown: keyboardHandler
|
|
106
|
+
}, [
|
|
107
|
+
createElementVNode("input", mergeProps({
|
|
108
|
+
id: unref(instanceId),
|
|
109
|
+
checked: __props.modelValue
|
|
110
|
+
}, _ctx.$attrs, {
|
|
111
|
+
disabled: __props.disabled,
|
|
112
|
+
name: __props.name,
|
|
113
|
+
type: "checkbox",
|
|
114
|
+
onChange: _cache[0] || (_cache[0] = ($event) => {
|
|
115
|
+
var _a;
|
|
116
|
+
return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked);
|
|
117
|
+
})
|
|
118
|
+
}), null, 16, _hoisted_2),
|
|
119
|
+
createElementVNode("span", null, [
|
|
120
|
+
createVNode(Transition, {
|
|
121
|
+
name: "maz-scale",
|
|
122
|
+
persisted: ""
|
|
123
|
+
}, {
|
|
124
|
+
default: withCtx(() => [
|
|
125
|
+
withDirectives(createVNode(unref(CheckIcon), {
|
|
126
|
+
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
127
|
+
}, null, 8, ["class"]), [
|
|
128
|
+
[vShow, __props.modelValue]
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
/* STABLE */
|
|
133
|
+
})
|
|
134
|
+
]),
|
|
135
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
136
|
+
], 42, _hoisted_1);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const MazCheckbox_vue_vue_type_style_index_0_scoped_5b54604c_lang = "";
|
|
141
|
+
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5b54604c"]]);
|
|
142
|
+
export {
|
|
143
|
+
MazCheckbox as default
|
|
144
|
+
};
|