maz-ui 3.21.5 → 3.22.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 +14 -4
- package/components/MazCheckbox.mjs +36 -29
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazRadio.d.ts +82 -0
- package/components/MazRadio.mjs +133 -0
- package/components/MazSelect.mjs +1 -1
- package/components/assets/MazCheckbox.css +1 -1
- package/components/assets/MazRadio.css +1 -0
- package/components/chunks/{MazBtn-704bd37b.mjs → MazBtn-001d4174.mjs} +2 -2
- package/components/chunks/{MazBtn-2a8cee98.mjs → MazBtn-97d9e521.mjs} +2 -2
- package/components/chunks/{MazCheckbox-b445b9b2.mjs → MazCheckbox-0595c207.mjs} +37 -30
- package/components/chunks/{MazCheckbox-b8974a89.mjs → MazCheckbox-90f20e7f.mjs} +37 -30
- package/components/chunks/{MazPhoneNumberInput-d90953ab.mjs → MazPhoneNumberInput-4cec4ade.mjs} +2 -2
- package/components/chunks/{MazSelect-4de4d975.mjs → MazSelect-757bffd7.mjs} +2 -2
- package/components/chunks/{MazSpinner-8700b7eb.mjs → MazSpinner-7bd9b831.mjs} +1 -1
- package/components/chunks/{MazSpinner-76e79a34.mjs → MazSpinner-ac429216.mjs} +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.mjs +1 -0
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazCheckbox.vue.d.ts +14 -4
- package/types/components/MazRadio.vue.d.ts +82 -0
- package/types/components/index.d.ts +1 -0
|
@@ -3,8 +3,8 @@ import type { Color, Size } from './types';
|
|
|
3
3
|
export type { Color, Size };
|
|
4
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type:
|
|
7
|
-
|
|
6
|
+
type: PropType<boolean | (string | number)[]>;
|
|
7
|
+
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
id: {
|
|
10
10
|
type: StringConstructor;
|
|
@@ -14,6 +14,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
type: PropType<Color>;
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
|
+
value: {
|
|
18
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
17
21
|
name: {
|
|
18
22
|
type: StringConstructor;
|
|
19
23
|
default: string;
|
|
@@ -31,8 +35,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
31
35
|
"update:model-value": (...args: any[]) => void;
|
|
32
36
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
|
|
38
|
+
type: PropType<boolean | (string | number)[]>;
|
|
39
|
+
default: undefined;
|
|
36
40
|
};
|
|
37
41
|
id: {
|
|
38
42
|
type: StringConstructor;
|
|
@@ -42,6 +46,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
42
46
|
type: PropType<Color>;
|
|
43
47
|
default: string;
|
|
44
48
|
};
|
|
49
|
+
value: {
|
|
50
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
45
53
|
name: {
|
|
46
54
|
type: StringConstructor;
|
|
47
55
|
default: string;
|
|
@@ -62,7 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
62
70
|
color: Color;
|
|
63
71
|
disabled: boolean;
|
|
64
72
|
name: string;
|
|
73
|
+
value: string | number | boolean;
|
|
65
74
|
id: string;
|
|
75
|
+
modelValue: boolean | (string | number)[];
|
|
66
76
|
}, {}>, {
|
|
67
77
|
default?(_: {}): any;
|
|
68
78
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./assets/MazCheckbox.css";
|
|
2
|
-
import { computed, openBlock, createElementBlock, createElementVNode, defineComponent, useCssVars, getCurrentInstance, unref, normalizeClass, mergeProps, createVNode,
|
|
2
|
+
import { computed, openBlock, createElementBlock, createElementVNode, defineComponent, useCssVars, getCurrentInstance, unref, normalizeClass, mergeProps, createVNode, renderSlot } from "vue";
|
|
3
3
|
const useInstanceUniqId = ({
|
|
4
4
|
componentName,
|
|
5
5
|
instance,
|
|
@@ -39,12 +39,16 @@ const _hoisted_2 = ["id", "checked", "disabled", "name"];
|
|
|
39
39
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
40
40
|
__name: "MazCheckbox",
|
|
41
41
|
props: {
|
|
42
|
-
modelValue: {
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: [Boolean, Array],
|
|
44
|
+
default: void 0
|
|
45
|
+
},
|
|
43
46
|
id: { type: String, default: void 0 },
|
|
44
47
|
color: {
|
|
45
48
|
type: String,
|
|
46
49
|
default: "primary"
|
|
47
50
|
},
|
|
51
|
+
value: { type: [String, Number, Boolean], default: void 0 },
|
|
48
52
|
name: { type: String, default: "m-checkbox" },
|
|
49
53
|
size: { type: String, default: "md" },
|
|
50
54
|
disabled: { type: Boolean, default: false }
|
|
@@ -57,10 +61,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
61
|
],
|
|
58
62
|
setup(__props, { emit: __emit }) {
|
|
59
63
|
useCssVars((_ctx) => ({
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
+
"40cdf8ce": checkIconColor.value,
|
|
65
|
+
"25e00d0a": checkboxSize.value,
|
|
66
|
+
"5692b564": checkboxSelectedColor.value,
|
|
67
|
+
"9df23cde": checkboxBoxShadow.value
|
|
64
68
|
}));
|
|
65
69
|
const instance = getCurrentInstance();
|
|
66
70
|
const props = __props;
|
|
@@ -70,6 +74,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70
74
|
instance,
|
|
71
75
|
providedId: props.id
|
|
72
76
|
});
|
|
77
|
+
const isChecked = computed(
|
|
78
|
+
() => typeof props.value !== "boolean" && Array.isArray(props.modelValue) ? props.modelValue.includes(props.value) : typeof props.modelValue === "boolean" ? props.modelValue : false
|
|
79
|
+
);
|
|
73
80
|
const checkboxSize = computed(() => {
|
|
74
81
|
switch (props.size) {
|
|
75
82
|
case "xl": {
|
|
@@ -120,14 +127,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
127
|
() => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
|
|
121
128
|
);
|
|
122
129
|
function keyboardHandler(event) {
|
|
123
|
-
if (["
|
|
130
|
+
if (["Space"].includes(event.code)) {
|
|
124
131
|
event.preventDefault();
|
|
125
|
-
emitValue(!props.modelValue);
|
|
132
|
+
emitValue(props.value ?? !props.modelValue);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function getNewValue(value) {
|
|
136
|
+
if (typeof value === "boolean" && (typeof props.modelValue === "boolean" || props.modelValue === void 0 || props.modelValue === null)) {
|
|
137
|
+
return props.modelValue ? false : true;
|
|
138
|
+
} else if (Array.isArray(props.modelValue) && typeof value !== "boolean") {
|
|
139
|
+
return props.modelValue.includes(value) ? props.modelValue.filter((v) => v !== value) : [...props.modelValue, value];
|
|
140
|
+
} else {
|
|
141
|
+
return [value];
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
144
|
function emitValue(value) {
|
|
129
|
-
|
|
130
|
-
emits("
|
|
145
|
+
const newValue = getNewValue(value);
|
|
146
|
+
emits("update:model-value", newValue);
|
|
147
|
+
emits("change", newValue);
|
|
131
148
|
}
|
|
132
149
|
return (_ctx, _cache) => {
|
|
133
150
|
return openBlock(), createElementBlock("label", {
|
|
@@ -135,43 +152,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
135
152
|
class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled }]),
|
|
136
153
|
tabindex: "0",
|
|
137
154
|
role: "checkbox",
|
|
138
|
-
"aria-checked":
|
|
155
|
+
"aria-checked": isChecked.value,
|
|
139
156
|
onKeydown: keyboardHandler
|
|
140
157
|
}, [
|
|
141
158
|
createElementVNode("input", mergeProps({
|
|
142
159
|
id: unref(instanceId),
|
|
143
|
-
checked:
|
|
160
|
+
checked: isChecked.value
|
|
144
161
|
}, _ctx.$attrs, {
|
|
162
|
+
tabindex: "-1",
|
|
145
163
|
disabled: __props.disabled,
|
|
146
164
|
name: __props.name,
|
|
147
165
|
type: "checkbox",
|
|
148
166
|
onChange: _cache[0] || (_cache[0] = ($event) => {
|
|
149
167
|
var _a;
|
|
150
|
-
return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked);
|
|
168
|
+
return emitValue(__props.value ?? ((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked));
|
|
151
169
|
})
|
|
152
170
|
}), null, 16, _hoisted_2),
|
|
153
171
|
createElementVNode("span", null, [
|
|
154
|
-
createVNode(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}, {
|
|
158
|
-
default: withCtx(() => [
|
|
159
|
-
withDirectives(createVNode(unref(CheckIcon), {
|
|
160
|
-
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
161
|
-
}, null, 8, ["class"]), [
|
|
162
|
-
[vShow, __props.modelValue]
|
|
163
|
-
])
|
|
164
|
-
]),
|
|
165
|
-
_: 1
|
|
166
|
-
/* STABLE */
|
|
167
|
-
})
|
|
172
|
+
createVNode(unref(CheckIcon), {
|
|
173
|
+
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
174
|
+
}, null, 8, ["class"])
|
|
168
175
|
]),
|
|
169
176
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
170
177
|
], 42, _hoisted_1);
|
|
171
178
|
};
|
|
172
179
|
}
|
|
173
180
|
});
|
|
174
|
-
const
|
|
181
|
+
const MazCheckbox_vue_vue_type_style_index_0_scoped_141a5e53_lang = "";
|
|
175
182
|
const _export_sfc = (sfc, props) => {
|
|
176
183
|
const target = sfc.__vccOpts || sfc;
|
|
177
184
|
for (const [key, val] of props) {
|
|
@@ -179,7 +186,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
179
186
|
}
|
|
180
187
|
return target;
|
|
181
188
|
};
|
|
182
|
-
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
189
|
+
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-141a5e53"]]);
|
|
183
190
|
export {
|
|
184
191
|
MazCheckbox as default
|
|
185
192
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { Color, Size } from './types';
|
|
3
|
+
export type { Color, Size };
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
value: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
name: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
id: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
color: {
|
|
22
|
+
type: PropType<Color>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
type: PropType<Size>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
change: (...args: any[]) => void;
|
|
35
|
+
"update:model-value": (...args: any[]) => void;
|
|
36
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
value: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
name: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
id: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
color: {
|
|
54
|
+
type: PropType<Color>;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
type: PropType<Size>;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
disabled: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
size: Size;
|
|
70
|
+
color: Color;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
id: string;
|
|
73
|
+
modelValue: string;
|
|
74
|
+
}, {}>, {
|
|
75
|
+
default?(_: {}): any;
|
|
76
|
+
}>;
|
|
77
|
+
export default _default;
|
|
78
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$slots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import "./assets/MazRadio.css";
|
|
2
|
+
import { computed, defineComponent, useCssVars, getCurrentInstance, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, renderSlot, pushScopeId, popScopeId } from "vue";
|
|
3
|
+
const useInstanceUniqId = ({
|
|
4
|
+
componentName,
|
|
5
|
+
instance,
|
|
6
|
+
providedId
|
|
7
|
+
}) => {
|
|
8
|
+
return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
|
|
9
|
+
};
|
|
10
|
+
const _withScopeId = (n) => (pushScopeId("data-v-f47afb8e"), n = n(), popScopeId(), n);
|
|
11
|
+
const _hoisted_1 = ["for", "aria-checked"];
|
|
12
|
+
const _hoisted_2 = ["id", "value", "disabled", "name", "checked"];
|
|
13
|
+
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
14
|
+
"span",
|
|
15
|
+
null,
|
|
16
|
+
[
|
|
17
|
+
/* @__PURE__ */ createElementVNode("span", { class: "round" })
|
|
18
|
+
],
|
|
19
|
+
-1
|
|
20
|
+
/* HOISTED */
|
|
21
|
+
));
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "MazRadio",
|
|
24
|
+
props: {
|
|
25
|
+
modelValue: { type: String, default: void 0 },
|
|
26
|
+
value: { type: String, required: true },
|
|
27
|
+
name: { type: String, required: true },
|
|
28
|
+
id: { type: String, default: void 0 },
|
|
29
|
+
color: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "primary"
|
|
32
|
+
},
|
|
33
|
+
size: { type: String, default: "md" },
|
|
34
|
+
disabled: { type: Boolean, default: false }
|
|
35
|
+
},
|
|
36
|
+
emits: [
|
|
37
|
+
/* emitted when value change */
|
|
38
|
+
"update:model-value",
|
|
39
|
+
/* emited when value change */
|
|
40
|
+
"change"
|
|
41
|
+
],
|
|
42
|
+
setup(__props, { emit: __emit }) {
|
|
43
|
+
useCssVars((_ctx) => ({
|
|
44
|
+
"2a231cf6": radioSize.value,
|
|
45
|
+
"ef04cef8": radioSelectedColor.value,
|
|
46
|
+
"f6f84072": radioBoxShadow.value
|
|
47
|
+
}));
|
|
48
|
+
const instance = getCurrentInstance();
|
|
49
|
+
const props = __props;
|
|
50
|
+
const emits = __emit;
|
|
51
|
+
const instanceId = useInstanceUniqId({
|
|
52
|
+
componentName: "MazCheckbox",
|
|
53
|
+
instance,
|
|
54
|
+
providedId: props.id
|
|
55
|
+
});
|
|
56
|
+
const isSelected = computed(() => props.modelValue === props.value);
|
|
57
|
+
const radioSize = computed(() => {
|
|
58
|
+
switch (props.size) {
|
|
59
|
+
case "xl": {
|
|
60
|
+
return "2.25rem";
|
|
61
|
+
}
|
|
62
|
+
case "lg": {
|
|
63
|
+
return "2rem";
|
|
64
|
+
}
|
|
65
|
+
default: {
|
|
66
|
+
return "1.625rem";
|
|
67
|
+
}
|
|
68
|
+
case "sm": {
|
|
69
|
+
return "1.425rem";
|
|
70
|
+
}
|
|
71
|
+
case "xs": {
|
|
72
|
+
return "1.325rem";
|
|
73
|
+
}
|
|
74
|
+
case "mini": {
|
|
75
|
+
return "1.2rem";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const radioSelectedColor = computed(() => `var(--maz-color-${props.color})`);
|
|
80
|
+
const radioBoxShadow = computed(
|
|
81
|
+
() => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
|
|
82
|
+
);
|
|
83
|
+
function keyboardHandler(event, value) {
|
|
84
|
+
if (["Space"].includes(event.code)) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
emitValue(value);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function emitValue(value) {
|
|
90
|
+
emits("update:model-value", value);
|
|
91
|
+
emits("change", value);
|
|
92
|
+
}
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return openBlock(), createElementBlock("label", {
|
|
95
|
+
for: unref(instanceId),
|
|
96
|
+
class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled, "--selected": isSelected.value }]),
|
|
97
|
+
tabindex: "0",
|
|
98
|
+
role: "radio",
|
|
99
|
+
"aria-checked": isSelected.value,
|
|
100
|
+
onKeydown: _cache[1] || (_cache[1] = ($event) => keyboardHandler($event, __props.value))
|
|
101
|
+
}, [
|
|
102
|
+
createElementVNode("input", mergeProps({
|
|
103
|
+
id: unref(instanceId),
|
|
104
|
+
value: __props.value
|
|
105
|
+
}, _ctx.$attrs, {
|
|
106
|
+
tabindex: "-1",
|
|
107
|
+
disabled: __props.disabled,
|
|
108
|
+
name: __props.name,
|
|
109
|
+
type: "radio",
|
|
110
|
+
checked: isSelected.value,
|
|
111
|
+
onChange: _cache[0] || (_cache[0] = ($event) => {
|
|
112
|
+
var _a;
|
|
113
|
+
return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.value);
|
|
114
|
+
})
|
|
115
|
+
}), null, 16, _hoisted_2),
|
|
116
|
+
_hoisted_3,
|
|
117
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
118
|
+
], 42, _hoisted_1);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const MazRadio_vue_vue_type_style_index_0_scoped_f47afb8e_lang = "";
|
|
123
|
+
const _export_sfc = (sfc, props) => {
|
|
124
|
+
const target = sfc.__vccOpts || sfc;
|
|
125
|
+
for (const [key, val] of props) {
|
|
126
|
+
target[key] = val;
|
|
127
|
+
}
|
|
128
|
+
return target;
|
|
129
|
+
};
|
|
130
|
+
const MazRadio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f47afb8e"]]);
|
|
131
|
+
export {
|
|
132
|
+
MazRadio as default
|
|
133
|
+
};
|
package/components/MazSelect.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.m-checkbox[data-v-
|
|
1
|
+
.m-checkbox[data-v-141a5e53]{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.5rem;outline:2px solid transparent;outline-offset:2px}.m-checkbox .check-icon[data-v-141a5e53]{color:var(--40cdf8ce);--tw-scale-x: 0;--tw-scale-y: 0;-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-checkbox .check-icon[data-v-141a5e53] path{stroke-width:2.5}.m-checkbox>span[data-v-141a5e53]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:var(--maz-border-radius);border-width:var(--maz-border-width);--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity));-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}[data-v-141a5e53]:is([class~=dark] .m-checkbox>span){border-color:var(--maz-color-bg-lighter)}.m-checkbox>span[data-v-141a5e53]{width:var(--25e00d0a);height:var(--25e00d0a)}.m-checkbox input[data-v-141a5e53]{display:none}.m-checkbox input:not(:checked)~span[data-v-141a5e53]{background-color:var(--maz-color-bg)}[data-v-141a5e53]:is([class~=dark] .m-checkbox input:not(:checked)~span){background-color:var(--maz-color-bg-light)}.m-checkbox input:checked~span[data-v-141a5e53]{border-color:var(--5692b564);background-color:var(--5692b564)}.m-checkbox input:checked~span .check-icon[data-v-141a5e53]{--tw-scale-x: 1;--tw-scale-y: 1;-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.m-checkbox input:disabled~span[data-v-141a5e53]{background-color:var(--maz-color-bg-light)}[data-v-141a5e53]:is([class~=dark] .m-checkbox input:disabled~span){background-color:var(--maz-color-bg-lighter)}.m-checkbox.--disabled[data-v-141a5e53]{cursor:not-allowed;color:var(--maz-color-muted)}.m-checkbox.--disabled input:checked~span[data-v-141a5e53]{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}[data-v-141a5e53]:is([class~=dark] .m-checkbox.--disabled input:checked~span){border-color:var(--maz-color-bg-lighter)}.m-checkbox.--disabled input:checked~span .check-icon[data-v-141a5e53]{color:var(--maz-color-muted)}.m-checkbox[data-v-141a5e53]:not(.--disabled){cursor:pointer}.m-checkbox:not(.--disabled):hover>span[data-v-141a5e53],.m-checkbox:not(.--disabled):focus>span[data-v-141a5e53]{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-box-shadow:0 0 0 .125rem var(--9df23cde);box-shadow:0 0 0 .125rem var(--9df23cde)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.m-checkbox[data-v-f47afb8e]{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.5rem;outline:2px solid transparent;outline-offset:2px}.m-checkbox>span[data-v-f47afb8e]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:9999px;border-width:var(--maz-border-width);--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity));-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}[data-v-f47afb8e]:is([class~=dark] .m-checkbox>span){border-color:var(--maz-color-bg-lighter)}.m-checkbox>span[data-v-f47afb8e]{width:var(--2a231cf6);height:var(--2a231cf6)}.m-checkbox>span .round[data-v-f47afb8e]{height:50%;width:50%;--tw-scale-x: 0;--tw-scale-y: 0;-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);background-color:var(--ef04cef8)}.m-checkbox:not(.--selected)>span[data-v-f47afb8e]{background-color:var(--maz-color-bg)}[data-v-f47afb8e]:is([class~=dark] .m-checkbox:not(.--selected)>span){background-color:var(--maz-color-bg-light)}.m-checkbox.--selected>span[data-v-f47afb8e]{border-color:var(--ef04cef8)}.m-checkbox.--selected>span .round[data-v-f47afb8e]{--tw-scale-x: 1;--tw-scale-y: 1;-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.m-checkbox input[data-v-f47afb8e]{display:none}.m-checkbox.--disabled[data-v-f47afb8e]{cursor:not-allowed;color:var(--maz-color-muted)}.m-checkbox.--disabled>span[data-v-f47afb8e]{background-color:var(--maz-color-bg-light)}[data-v-f47afb8e]:is([class~=dark] .m-checkbox.--disabled>span){background-color:var(--maz-color-bg-lighter)}.m-checkbox.--disabled.--selected>span[data-v-f47afb8e]{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}[data-v-f47afb8e]:is([class~=dark] .m-checkbox.--disabled.--selected>span){border-color:var(--maz-color-bg-lighter)}.m-checkbox.--disabled.--selected>span .round[data-v-f47afb8e]{background-color:var(--maz-color-muted)}.m-checkbox[data-v-f47afb8e]:not(.--disabled){cursor:pointer}.m-checkbox:not(.--disabled):hover>span[data-v-f47afb8e],.m-checkbox:not(.--disabled):focus>span[data-v-f47afb8e]{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-box-shadow:0 0 0 .125rem var(--f6f84072);box-shadow:0 0 0 .125rem var(--f6f84072)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/MazBtn.css";
|
|
2
2
|
import { defineComponent, defineAsyncComponent, useAttrs, useSlots, onBeforeMount, computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementBlock, normalizeClass, renderSlot, unref, createCommentVNode, createElementVNode } from "vue";
|
|
3
|
-
import { _ as _export_sfc } from "./MazSelect-
|
|
3
|
+
import { _ as _export_sfc } from "./MazSelect-757bffd7.mjs";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "MazBtn",
|
|
6
6
|
props: {
|
|
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
46
|
noElevation: { type: Boolean, default: false }
|
|
47
47
|
},
|
|
48
48
|
setup(__props) {
|
|
49
|
-
const MazSpinner = defineAsyncComponent(() => import("./MazSpinner-
|
|
49
|
+
const MazSpinner = defineAsyncComponent(() => import("./MazSpinner-7bd9b831.mjs"));
|
|
50
50
|
const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
|
|
51
51
|
const { href, to } = useAttrs();
|
|
52
52
|
const slots = useSlots();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/MazBtn.css";
|
|
2
2
|
import { defineComponent, defineAsyncComponent, useAttrs, useSlots, onBeforeMount, computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementBlock, normalizeClass, renderSlot, unref, createCommentVNode, createElementVNode } from "vue";
|
|
3
|
-
import { _ as _export_sfc } from "./MazPhoneNumberInput-
|
|
3
|
+
import { _ as _export_sfc } from "./MazPhoneNumberInput-4cec4ade.mjs";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "MazBtn",
|
|
6
6
|
props: {
|
|
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
46
|
noElevation: { type: Boolean, default: false }
|
|
47
47
|
},
|
|
48
48
|
setup(__props) {
|
|
49
|
-
const MazSpinner = defineAsyncComponent(() => import("./MazSpinner-
|
|
49
|
+
const MazSpinner = defineAsyncComponent(() => import("./MazSpinner-ac429216.mjs"));
|
|
50
50
|
const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
|
|
51
51
|
const { href, to } = useAttrs();
|
|
52
52
|
const slots = useSlots();
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import "../assets/MazCheckbox.css";
|
|
2
|
-
import { defineComponent, useCssVars, getCurrentInstance, computed, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, createVNode,
|
|
3
|
-
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-
|
|
2
|
+
import { defineComponent, useCssVars, getCurrentInstance, computed, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, createVNode, renderSlot } from "vue";
|
|
3
|
+
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-4cec4ade.mjs";
|
|
4
4
|
import CheckIcon from "./check-8da249b1.mjs";
|
|
5
5
|
const _hoisted_1 = ["for", "aria-checked"];
|
|
6
6
|
const _hoisted_2 = ["id", "checked", "disabled", "name"];
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "MazCheckbox",
|
|
9
9
|
props: {
|
|
10
|
-
modelValue: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [Boolean, Array],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
11
14
|
id: { type: String, default: void 0 },
|
|
12
15
|
color: {
|
|
13
16
|
type: String,
|
|
14
17
|
default: "primary"
|
|
15
18
|
},
|
|
19
|
+
value: { type: [String, Number, Boolean], default: void 0 },
|
|
16
20
|
name: { type: String, default: "m-checkbox" },
|
|
17
21
|
size: { type: String, default: "md" },
|
|
18
22
|
disabled: { type: Boolean, default: false }
|
|
@@ -25,10 +29,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
29
|
],
|
|
26
30
|
setup(__props, { emit: __emit }) {
|
|
27
31
|
useCssVars((_ctx) => ({
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
+
"40cdf8ce": checkIconColor.value,
|
|
33
|
+
"25e00d0a": checkboxSize.value,
|
|
34
|
+
"5692b564": checkboxSelectedColor.value,
|
|
35
|
+
"9df23cde": checkboxBoxShadow.value
|
|
32
36
|
}));
|
|
33
37
|
const instance = getCurrentInstance();
|
|
34
38
|
const props = __props;
|
|
@@ -38,6 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
42
|
instance,
|
|
39
43
|
providedId: props.id
|
|
40
44
|
});
|
|
45
|
+
const isChecked = computed(
|
|
46
|
+
() => typeof props.value !== "boolean" && Array.isArray(props.modelValue) ? props.modelValue.includes(props.value) : typeof props.modelValue === "boolean" ? props.modelValue : false
|
|
47
|
+
);
|
|
41
48
|
const checkboxSize = computed(() => {
|
|
42
49
|
switch (props.size) {
|
|
43
50
|
case "xl": {
|
|
@@ -88,14 +95,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
95
|
() => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
|
|
89
96
|
);
|
|
90
97
|
function keyboardHandler(event) {
|
|
91
|
-
if (["
|
|
98
|
+
if (["Space"].includes(event.code)) {
|
|
92
99
|
event.preventDefault();
|
|
93
|
-
emitValue(!props.modelValue);
|
|
100
|
+
emitValue(props.value ?? !props.modelValue);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function getNewValue(value) {
|
|
104
|
+
if (typeof value === "boolean" && (typeof props.modelValue === "boolean" || props.modelValue === void 0 || props.modelValue === null)) {
|
|
105
|
+
return props.modelValue ? false : true;
|
|
106
|
+
} else if (Array.isArray(props.modelValue) && typeof value !== "boolean") {
|
|
107
|
+
return props.modelValue.includes(value) ? props.modelValue.filter((v) => v !== value) : [...props.modelValue, value];
|
|
108
|
+
} else {
|
|
109
|
+
return [value];
|
|
94
110
|
}
|
|
95
111
|
}
|
|
96
112
|
function emitValue(value) {
|
|
97
|
-
|
|
98
|
-
emits("
|
|
113
|
+
const newValue = getNewValue(value);
|
|
114
|
+
emits("update:model-value", newValue);
|
|
115
|
+
emits("change", newValue);
|
|
99
116
|
}
|
|
100
117
|
return (_ctx, _cache) => {
|
|
101
118
|
return openBlock(), createElementBlock("label", {
|
|
@@ -103,44 +120,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
120
|
class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled }]),
|
|
104
121
|
tabindex: "0",
|
|
105
122
|
role: "checkbox",
|
|
106
|
-
"aria-checked":
|
|
123
|
+
"aria-checked": isChecked.value,
|
|
107
124
|
onKeydown: keyboardHandler
|
|
108
125
|
}, [
|
|
109
126
|
createElementVNode("input", mergeProps({
|
|
110
127
|
id: unref(instanceId),
|
|
111
|
-
checked:
|
|
128
|
+
checked: isChecked.value
|
|
112
129
|
}, _ctx.$attrs, {
|
|
130
|
+
tabindex: "-1",
|
|
113
131
|
disabled: __props.disabled,
|
|
114
132
|
name: __props.name,
|
|
115
133
|
type: "checkbox",
|
|
116
134
|
onChange: _cache[0] || (_cache[0] = ($event) => {
|
|
117
135
|
var _a;
|
|
118
|
-
return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked);
|
|
136
|
+
return emitValue(__props.value ?? ((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked));
|
|
119
137
|
})
|
|
120
138
|
}), null, 16, _hoisted_2),
|
|
121
139
|
createElementVNode("span", null, [
|
|
122
|
-
createVNode(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, {
|
|
126
|
-
default: withCtx(() => [
|
|
127
|
-
withDirectives(createVNode(unref(CheckIcon), {
|
|
128
|
-
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
129
|
-
}, null, 8, ["class"]), [
|
|
130
|
-
[vShow, __props.modelValue]
|
|
131
|
-
])
|
|
132
|
-
]),
|
|
133
|
-
_: 1
|
|
134
|
-
/* STABLE */
|
|
135
|
-
})
|
|
140
|
+
createVNode(unref(CheckIcon), {
|
|
141
|
+
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
142
|
+
}, null, 8, ["class"])
|
|
136
143
|
]),
|
|
137
144
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
138
145
|
], 42, _hoisted_1);
|
|
139
146
|
};
|
|
140
147
|
}
|
|
141
148
|
});
|
|
142
|
-
const
|
|
143
|
-
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
149
|
+
const MazCheckbox_vue_vue_type_style_index_0_scoped_141a5e53_lang = "";
|
|
150
|
+
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-141a5e53"]]);
|
|
144
151
|
export {
|
|
145
152
|
MazCheckbox as default
|
|
146
153
|
};
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import "../assets/MazCheckbox.css";
|
|
2
|
-
import { defineComponent, useCssVars, getCurrentInstance, computed, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, createVNode,
|
|
3
|
-
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazSelect-
|
|
2
|
+
import { defineComponent, useCssVars, getCurrentInstance, computed, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, createVNode, renderSlot } from "vue";
|
|
3
|
+
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazSelect-757bffd7.mjs";
|
|
4
4
|
import CheckIcon from "./check-8da249b1.mjs";
|
|
5
5
|
const _hoisted_1 = ["for", "aria-checked"];
|
|
6
6
|
const _hoisted_2 = ["id", "checked", "disabled", "name"];
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "MazCheckbox",
|
|
9
9
|
props: {
|
|
10
|
-
modelValue: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [Boolean, Array],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
11
14
|
id: { type: String, default: void 0 },
|
|
12
15
|
color: {
|
|
13
16
|
type: String,
|
|
14
17
|
default: "primary"
|
|
15
18
|
},
|
|
19
|
+
value: { type: [String, Number, Boolean], default: void 0 },
|
|
16
20
|
name: { type: String, default: "m-checkbox" },
|
|
17
21
|
size: { type: String, default: "md" },
|
|
18
22
|
disabled: { type: Boolean, default: false }
|
|
@@ -25,10 +29,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
29
|
],
|
|
26
30
|
setup(__props, { emit: __emit }) {
|
|
27
31
|
useCssVars((_ctx) => ({
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
+
"40cdf8ce": checkIconColor.value,
|
|
33
|
+
"25e00d0a": checkboxSize.value,
|
|
34
|
+
"5692b564": checkboxSelectedColor.value,
|
|
35
|
+
"9df23cde": checkboxBoxShadow.value
|
|
32
36
|
}));
|
|
33
37
|
const instance = getCurrentInstance();
|
|
34
38
|
const props = __props;
|
|
@@ -38,6 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
42
|
instance,
|
|
39
43
|
providedId: props.id
|
|
40
44
|
});
|
|
45
|
+
const isChecked = computed(
|
|
46
|
+
() => typeof props.value !== "boolean" && Array.isArray(props.modelValue) ? props.modelValue.includes(props.value) : typeof props.modelValue === "boolean" ? props.modelValue : false
|
|
47
|
+
);
|
|
41
48
|
const checkboxSize = computed(() => {
|
|
42
49
|
switch (props.size) {
|
|
43
50
|
case "xl": {
|
|
@@ -88,14 +95,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
95
|
() => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
|
|
89
96
|
);
|
|
90
97
|
function keyboardHandler(event) {
|
|
91
|
-
if (["
|
|
98
|
+
if (["Space"].includes(event.code)) {
|
|
92
99
|
event.preventDefault();
|
|
93
|
-
emitValue(!props.modelValue);
|
|
100
|
+
emitValue(props.value ?? !props.modelValue);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function getNewValue(value) {
|
|
104
|
+
if (typeof value === "boolean" && (typeof props.modelValue === "boolean" || props.modelValue === void 0 || props.modelValue === null)) {
|
|
105
|
+
return props.modelValue ? false : true;
|
|
106
|
+
} else if (Array.isArray(props.modelValue) && typeof value !== "boolean") {
|
|
107
|
+
return props.modelValue.includes(value) ? props.modelValue.filter((v) => v !== value) : [...props.modelValue, value];
|
|
108
|
+
} else {
|
|
109
|
+
return [value];
|
|
94
110
|
}
|
|
95
111
|
}
|
|
96
112
|
function emitValue(value) {
|
|
97
|
-
|
|
98
|
-
emits("
|
|
113
|
+
const newValue = getNewValue(value);
|
|
114
|
+
emits("update:model-value", newValue);
|
|
115
|
+
emits("change", newValue);
|
|
99
116
|
}
|
|
100
117
|
return (_ctx, _cache) => {
|
|
101
118
|
return openBlock(), createElementBlock("label", {
|
|
@@ -103,44 +120,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
120
|
class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled }]),
|
|
104
121
|
tabindex: "0",
|
|
105
122
|
role: "checkbox",
|
|
106
|
-
"aria-checked":
|
|
123
|
+
"aria-checked": isChecked.value,
|
|
107
124
|
onKeydown: keyboardHandler
|
|
108
125
|
}, [
|
|
109
126
|
createElementVNode("input", mergeProps({
|
|
110
127
|
id: unref(instanceId),
|
|
111
|
-
checked:
|
|
128
|
+
checked: isChecked.value
|
|
112
129
|
}, _ctx.$attrs, {
|
|
130
|
+
tabindex: "-1",
|
|
113
131
|
disabled: __props.disabled,
|
|
114
132
|
name: __props.name,
|
|
115
133
|
type: "checkbox",
|
|
116
134
|
onChange: _cache[0] || (_cache[0] = ($event) => {
|
|
117
135
|
var _a;
|
|
118
|
-
return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked);
|
|
136
|
+
return emitValue(__props.value ?? ((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked));
|
|
119
137
|
})
|
|
120
138
|
}), null, 16, _hoisted_2),
|
|
121
139
|
createElementVNode("span", null, [
|
|
122
|
-
createVNode(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, {
|
|
126
|
-
default: withCtx(() => [
|
|
127
|
-
withDirectives(createVNode(unref(CheckIcon), {
|
|
128
|
-
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
129
|
-
}, null, 8, ["class"]), [
|
|
130
|
-
[vShow, __props.modelValue]
|
|
131
|
-
])
|
|
132
|
-
]),
|
|
133
|
-
_: 1
|
|
134
|
-
/* STABLE */
|
|
135
|
-
})
|
|
140
|
+
createVNode(unref(CheckIcon), {
|
|
141
|
+
class: normalizeClass(["check-icon", checkIconSize.value])
|
|
142
|
+
}, null, 8, ["class"])
|
|
136
143
|
]),
|
|
137
144
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
138
145
|
], 42, _hoisted_1);
|
|
139
146
|
};
|
|
140
147
|
}
|
|
141
148
|
});
|
|
142
|
-
const
|
|
143
|
-
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
149
|
+
const MazCheckbox_vue_vue_type_style_index_0_scoped_141a5e53_lang = "";
|
|
150
|
+
const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-141a5e53"]]);
|
|
144
151
|
export {
|
|
145
152
|
MazCheckbox as default
|
|
146
153
|
};
|
package/components/chunks/{MazPhoneNumberInput-d90953ab.mjs → MazPhoneNumberInput-4cec4ade.mjs}
RENAMED
|
@@ -190,7 +190,7 @@ function debounce(fn, delay) {
|
|
|
190
190
|
}, delay);
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
const MazBtn = defineAsyncComponent(() => import("./MazBtn-
|
|
193
|
+
const MazBtn = defineAsyncComponent(() => import("./MazBtn-97d9e521.mjs"));
|
|
194
194
|
const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
|
|
195
195
|
const EyeOffIcon = defineAsyncComponent(() => import("./eye-slash-342420ff.mjs"));
|
|
196
196
|
const EyeIcon = defineAsyncComponent(() => import("./eye-fbb13657.mjs"));
|
|
@@ -611,7 +611,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
611
611
|
"c012bde4": selectedTextColor.value,
|
|
612
612
|
"46d74214": selectedBgColor.value
|
|
613
613
|
}));
|
|
614
|
-
const MazCheckbox = defineAsyncComponent(() => import("./MazCheckbox-
|
|
614
|
+
const MazCheckbox = defineAsyncComponent(() => import("./MazCheckbox-0595c207.mjs"));
|
|
615
615
|
const SearchIcon = defineAsyncComponent(() => import("./magnifying-glass-5dffa35e.mjs"));
|
|
616
616
|
const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-a78b9604.mjs"));
|
|
617
617
|
const NoSymbolIcon = defineAsyncComponent(() => import("./no-symbol-975ce547.mjs"));
|
|
@@ -16,7 +16,7 @@ const useInstanceUniqId = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
|
|
18
18
|
};
|
|
19
|
-
const MazBtn = defineAsyncComponent(() => import("./MazBtn-
|
|
19
|
+
const MazBtn = defineAsyncComponent(() => import("./MazBtn-001d4174.mjs"));
|
|
20
20
|
const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
|
|
21
21
|
const EyeOffIcon = defineAsyncComponent(() => import("./eye-slash-342420ff.mjs"));
|
|
22
22
|
const EyeIcon = defineAsyncComponent(() => import("./eye-fbb13657.mjs"));
|
|
@@ -437,7 +437,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
437
437
|
"c012bde4": selectedTextColor.value,
|
|
438
438
|
"46d74214": selectedBgColor.value
|
|
439
439
|
}));
|
|
440
|
-
const MazCheckbox = defineAsyncComponent(() => import("./MazCheckbox-
|
|
440
|
+
const MazCheckbox = defineAsyncComponent(() => import("./MazCheckbox-90f20e7f.mjs"));
|
|
441
441
|
const SearchIcon = defineAsyncComponent(() => import("./magnifying-glass-5dffa35e.mjs"));
|
|
442
442
|
const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-a78b9604.mjs"));
|
|
443
443
|
const NoSymbolIcon = defineAsyncComponent(() => import("./no-symbol-975ce547.mjs"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/MazSpinner.css";
|
|
2
2
|
import { defineComponent, openBlock, createElementBlock, normalizeClass, pushScopeId, popScopeId, createElementVNode } from "vue";
|
|
3
|
-
import { _ as _export_sfc } from "./MazSelect-
|
|
3
|
+
import { _ as _export_sfc } from "./MazSelect-757bffd7.mjs";
|
|
4
4
|
const _withScopeId = (n) => (pushScopeId("data-v-c67298ec"), n = n(), popScopeId(), n);
|
|
5
5
|
const _hoisted_1 = ["width", "height"];
|
|
6
6
|
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/MazSpinner.css";
|
|
2
2
|
import { defineComponent, openBlock, createElementBlock, normalizeClass, pushScopeId, popScopeId, createElementVNode } from "vue";
|
|
3
|
-
import { _ as _export_sfc } from "./MazPhoneNumberInput-
|
|
3
|
+
import { _ as _export_sfc } from "./MazPhoneNumberInput-4cec4ade.mjs";
|
|
4
4
|
const _withScopeId = (n) => (pushScopeId("data-v-c67298ec"), n = n(), popScopeId(), n);
|
|
5
5
|
const _hoisted_1 = ["width", "height"];
|
|
6
6
|
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
package/components/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { default as MazInputTags } from './MazInputTags.js';
|
|
|
22
22
|
export { default as MazLazyImg } from './MazLazyImg.js';
|
|
23
23
|
export { default as MazPhoneNumberInput } from './MazPhoneNumberInput.js';
|
|
24
24
|
export { default as MazPicker } from './MazPicker.js';
|
|
25
|
+
export { default as MazRadio } from './MazRadio.js';
|
|
25
26
|
export { default as MazRadioButtons } from './MazRadioButtons.js';
|
|
26
27
|
export { default as MazSelect } from './MazSelect.js';
|
|
27
28
|
export { default as MazSlider } from './MazSlider.js';
|
package/components/index.mjs
CHANGED
|
@@ -24,6 +24,7 @@ export { default as MazInputTags } from './MazInputTags.mjs'
|
|
|
24
24
|
export { default as MazLazyImg } from './MazLazyImg.mjs'
|
|
25
25
|
export { default as MazPhoneNumberInput } from './MazPhoneNumberInput.mjs'
|
|
26
26
|
export { default as MazPicker } from './MazPicker.mjs'
|
|
27
|
+
export { default as MazRadio } from './MazRadio.mjs'
|
|
27
28
|
export { default as MazRadioButtons } from './MazRadioButtons.mjs'
|
|
28
29
|
export { default as MazSelect } from './MazSelect.mjs'
|
|
29
30
|
export { default as MazSlider } from './MazSlider.mjs'
|
package/nuxt/index.json
CHANGED
package/package.json
CHANGED
|
@@ -3,8 +3,8 @@ import type { Color, Size } from './types';
|
|
|
3
3
|
export type { Color, Size };
|
|
4
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type:
|
|
7
|
-
|
|
6
|
+
type: PropType<boolean | (string | number)[]>;
|
|
7
|
+
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
id: {
|
|
10
10
|
type: StringConstructor;
|
|
@@ -14,6 +14,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
type: PropType<Color>;
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
|
+
value: {
|
|
18
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
17
21
|
name: {
|
|
18
22
|
type: StringConstructor;
|
|
19
23
|
default: string;
|
|
@@ -31,8 +35,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
31
35
|
"update:model-value": (...args: any[]) => void;
|
|
32
36
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
|
|
38
|
+
type: PropType<boolean | (string | number)[]>;
|
|
39
|
+
default: undefined;
|
|
36
40
|
};
|
|
37
41
|
id: {
|
|
38
42
|
type: StringConstructor;
|
|
@@ -42,6 +46,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
42
46
|
type: PropType<Color>;
|
|
43
47
|
default: string;
|
|
44
48
|
};
|
|
49
|
+
value: {
|
|
50
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
45
53
|
name: {
|
|
46
54
|
type: StringConstructor;
|
|
47
55
|
default: string;
|
|
@@ -62,7 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
62
70
|
color: Color;
|
|
63
71
|
disabled: boolean;
|
|
64
72
|
name: string;
|
|
73
|
+
value: string | number | boolean;
|
|
65
74
|
id: string;
|
|
75
|
+
modelValue: boolean | (string | number)[];
|
|
66
76
|
}, {}>, {
|
|
67
77
|
default?(_: {}): any;
|
|
68
78
|
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { Color, Size } from './types';
|
|
3
|
+
export type { Color, Size };
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
value: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
name: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
id: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
color: {
|
|
22
|
+
type: PropType<Color>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
type: PropType<Size>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
change: (...args: any[]) => void;
|
|
35
|
+
"update:model-value": (...args: any[]) => void;
|
|
36
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
value: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
name: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
id: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
color: {
|
|
54
|
+
type: PropType<Color>;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
type: PropType<Size>;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
disabled: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
size: Size;
|
|
70
|
+
color: Color;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
id: string;
|
|
73
|
+
modelValue: string;
|
|
74
|
+
}, {}>, {
|
|
75
|
+
default?(_: {}): any;
|
|
76
|
+
}>;
|
|
77
|
+
export default _default;
|
|
78
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$slots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -22,6 +22,7 @@ export { default as MazInputTags } from './MazInputTags.vue';
|
|
|
22
22
|
export { default as MazLazyImg } from './MazLazyImg.vue';
|
|
23
23
|
export { default as MazPhoneNumberInput } from './MazPhoneNumberInput.vue';
|
|
24
24
|
export { default as MazPicker } from './MazPicker.vue';
|
|
25
|
+
export { default as MazRadio } from './MazRadio.vue';
|
|
25
26
|
export { default as MazRadioButtons } from './MazRadioButtons.vue';
|
|
26
27
|
export { default as MazSelect } from './MazSelect.vue';
|
|
27
28
|
export { default as MazSlider } from './MazSlider.vue';
|