maz-ui 3.46.1-beta.0 → 3.46.1-beta.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.
- package/components/MazDropdown.d.ts +29 -3
- package/components/MazDropdown.mjs +214 -219
- package/components/MazSwitch.mjs +46 -49
- package/components/assets/MazSwitch.css +1 -1
- package/components/chunks/MazBtn-qFUqOv5D.mjs +150 -0
- package/components/chunks/MazLink-CJ1canOj.mjs +79 -0
- package/components/chunks/MazSpinner-SgVUnAHk.mjs +37 -0
- package/components/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/nuxt/index.json +1 -1
- package/package.json +1 -1
- package/types/components/MazDropdown.vue.d.ts +29 -3
|
@@ -17,7 +17,13 @@ type LinkItem = ItemBase & MazLinkProps & {
|
|
|
17
17
|
type ActionItem = ItemBase & {
|
|
18
18
|
action?: () => unknown;
|
|
19
19
|
};
|
|
20
|
-
export type MenuItem = (LinkItem
|
|
20
|
+
export type MenuItem = (LinkItem & {
|
|
21
|
+
action?: never;
|
|
22
|
+
}) | (ActionItem & {
|
|
23
|
+
href?: never;
|
|
24
|
+
to?: never;
|
|
25
|
+
target?: never;
|
|
26
|
+
});
|
|
21
27
|
export interface Props {
|
|
22
28
|
style?: HTMLAttributes['style'];
|
|
23
29
|
class?: HTMLAttributes['class'];
|
|
@@ -68,10 +74,30 @@ declare function __VLS_template(): {
|
|
|
68
74
|
item: MenuItem;
|
|
69
75
|
}): any;
|
|
70
76
|
"menuitem-label"?(_: {
|
|
71
|
-
item:
|
|
77
|
+
item: Record<string, unknown> & {
|
|
78
|
+
label: string;
|
|
79
|
+
class?: unknown;
|
|
80
|
+
color?: Color;
|
|
81
|
+
} & MazLinkProps & {
|
|
82
|
+
target?: string;
|
|
83
|
+
href?: string;
|
|
84
|
+
to?: RouteLocationRaw;
|
|
85
|
+
} & {
|
|
86
|
+
action?: never;
|
|
87
|
+
};
|
|
72
88
|
}): any;
|
|
73
89
|
"menuitem-label"?(_: {
|
|
74
|
-
item:
|
|
90
|
+
item: Record<string, unknown> & {
|
|
91
|
+
label: string;
|
|
92
|
+
class?: unknown;
|
|
93
|
+
color?: Color;
|
|
94
|
+
} & {
|
|
95
|
+
action?: () => unknown;
|
|
96
|
+
} & {
|
|
97
|
+
href?: never;
|
|
98
|
+
to?: never;
|
|
99
|
+
target?: never;
|
|
100
|
+
};
|
|
75
101
|
}): any;
|
|
76
102
|
};
|
|
77
103
|
refs: {};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as ee, getCurrentInstance as oe, nextTick as ne, defineComponent as te, defineAsyncComponent as E, ref as L, watch as T, withDirectives as U, openBlock as v, createElementBlock as w, unref as a, normalizeClass as $, normalizeStyle as re, createElementVNode as h, withModifiers as z, renderSlot as f, createTextVNode as M, toDisplayString as A, createCommentVNode as p, createVNode as N, mergeProps as B, withCtx as O, createBlock as S, Transition as le, Fragment as F, renderList as se, vShow as ie } from "vue";
|
|
2
2
|
import './assets/MazDropdown.css';function ae({
|
|
3
3
|
componentName: t,
|
|
4
|
-
providedId:
|
|
4
|
+
providedId: r
|
|
5
5
|
}) {
|
|
6
|
-
return
|
|
6
|
+
return ee(() => {
|
|
7
7
|
var n;
|
|
8
|
-
return
|
|
8
|
+
return r ?? `${t}-${(n = oe()) == null ? void 0 : n.uid}`;
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const g = "__maz-click-outside__";
|
|
12
12
|
function V() {
|
|
13
13
|
return document.ontouchstart === null ? "touchstart" : "click";
|
|
14
14
|
}
|
|
15
|
-
async function
|
|
15
|
+
async function q(t, r) {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
const n =
|
|
17
|
+
H(t);
|
|
18
|
+
const n = r.instance, d = r.value, k = typeof d == "function";
|
|
19
19
|
if (!k)
|
|
20
20
|
throw new Error("[maz-ui](vClickOutside) the callback should be a function");
|
|
21
|
-
await
|
|
22
|
-
if ((!t ||
|
|
23
|
-
return
|
|
21
|
+
await ne(), t[g] = (b) => {
|
|
22
|
+
if ((!t || b.target && !t.contains(b.target)) && d && k)
|
|
23
|
+
return d.call(n, b);
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
document.addEventListener(
|
|
25
|
+
const C = V();
|
|
26
|
+
document.addEventListener(C, t[g], { passive: !0 });
|
|
27
27
|
} catch (n) {
|
|
28
28
|
console.error("[maz-ui](vClickOutside)", n);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function H(t) {
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
34
|
-
document.removeEventListener(
|
|
35
|
-
} catch (
|
|
36
|
-
console.error("[maz-ui](vClickOutside)",
|
|
33
|
+
const r = V();
|
|
34
|
+
document.removeEventListener(r, t[g], !1), delete t[g];
|
|
35
|
+
} catch (r) {
|
|
36
|
+
console.error("[maz-ui](vClickOutside)", r);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function ue(t,
|
|
39
|
+
function ue(t, r) {
|
|
40
40
|
try {
|
|
41
|
-
if (
|
|
41
|
+
if (r.value === r.oldValue)
|
|
42
42
|
return;
|
|
43
|
-
|
|
43
|
+
q(t, r);
|
|
44
44
|
} catch (n) {
|
|
45
45
|
console.error("[maz-ui](vClickOutside)", n);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
const de = {
|
|
49
|
-
mounted:
|
|
49
|
+
mounted: q,
|
|
50
50
|
updated: ue,
|
|
51
|
-
unmounted:
|
|
51
|
+
unmounted: H
|
|
52
52
|
};
|
|
53
|
-
function ce(t,
|
|
53
|
+
function ce(t, r) {
|
|
54
54
|
let n;
|
|
55
|
-
return function(...
|
|
55
|
+
return function(...d) {
|
|
56
56
|
clearTimeout(n), n = setTimeout(() => {
|
|
57
|
-
t.apply(this,
|
|
58
|
-
},
|
|
57
|
+
t.apply(this, d);
|
|
58
|
+
}, r);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const fe = ["id"], pe = ["aria-expanded"], me = ["id"], ve = { class: "button-span" }, be = ["onClick"], ye = /* @__PURE__ */
|
|
61
|
+
const fe = ["id"], pe = ["aria-expanded"], me = ["id"], ve = { class: "button-span" }, be = ["onClick"], ye = /* @__PURE__ */ te({
|
|
62
62
|
inheritAttrs: !1,
|
|
63
63
|
__name: "MazDropdown",
|
|
64
64
|
props: {
|
|
@@ -76,247 +76,242 @@ const fe = ["id"], pe = ["aria-expanded"], me = ["id"], ve = { class: "button-sp
|
|
|
76
76
|
screenReaderDescription: { default: "Open menu dropdown" }
|
|
77
77
|
},
|
|
78
78
|
emits: ["menuitem-clicked", "update:open"],
|
|
79
|
-
setup(t, { emit:
|
|
80
|
-
const n = t,
|
|
79
|
+
setup(t, { emit: r }) {
|
|
80
|
+
const n = t, d = r, k = E(() => import("./chunks/MazBtn-qFUqOv5D.mjs")), C = E(() => import("./chunks/MazLink-CJ1canOj.mjs")), b = E(() => import("./chunks/chevron-down-BkvtON3b.mjs")), y = ae({
|
|
81
81
|
componentName: "MazDropdown",
|
|
82
82
|
providedId: n.id
|
|
83
|
-
}), i = L(n.open), s = L(),
|
|
84
|
-
|
|
83
|
+
}), i = L(n.open), s = L(), c = ce((e) => {
|
|
84
|
+
u(e);
|
|
85
85
|
}, 200);
|
|
86
|
-
function H() {
|
|
87
|
-
i.value && a(!1);
|
|
88
|
-
}
|
|
89
86
|
function R() {
|
|
90
|
-
|
|
87
|
+
i.value && u(!1);
|
|
88
|
+
}
|
|
89
|
+
function _() {
|
|
90
|
+
u(!i.value);
|
|
91
91
|
}
|
|
92
92
|
function j() {
|
|
93
|
-
["click"].includes(n.trigger) &&
|
|
93
|
+
["click"].includes(n.trigger) && _();
|
|
94
94
|
}
|
|
95
95
|
function K() {
|
|
96
|
-
["hover", "both"].includes(n.trigger) &&
|
|
96
|
+
["hover", "both"].includes(n.trigger) && u(!0);
|
|
97
97
|
}
|
|
98
98
|
function P() {
|
|
99
|
-
["hover", "both"].includes(n.trigger) && (i.value === !1 ?
|
|
99
|
+
["hover", "both"].includes(n.trigger) && (i.value === !1 ? u(!0) : c(!0));
|
|
100
100
|
}
|
|
101
101
|
function Q() {
|
|
102
|
-
["hover", "both"].includes(n.trigger) &&
|
|
102
|
+
["hover", "both"].includes(n.trigger) && c(!1);
|
|
103
103
|
}
|
|
104
104
|
function G() {
|
|
105
|
-
|
|
105
|
+
c(!1);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
n.disabled || (i.value = e,
|
|
107
|
+
function u(e) {
|
|
108
|
+
n.disabled || (i.value = e, d("update:open", e));
|
|
109
109
|
}
|
|
110
110
|
function J(e) {
|
|
111
111
|
return "action" in e;
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
c("menuitem-clicked", r), await ((d = e.action) == null ? void 0 : d.call(e)), n.noCloseOnClick || y();
|
|
113
|
+
function W(e) {
|
|
114
|
+
return "href" in e || "to" in e;
|
|
116
115
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
116
|
+
async function X(e, l) {
|
|
117
|
+
var o;
|
|
118
|
+
d("menuitem-clicked", l), await ((o = e.action) == null ? void 0 : o.call(e)), n.noCloseOnClick || D();
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
120
|
+
function D() {
|
|
121
|
+
n.noCloseOnClick === !1 && u(!1);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
123
|
+
function I(e) {
|
|
124
|
+
e.key === "Escape" ? (e.preventDefault(), u(!1)) : ["ArrowDown", "ArrowUp"].includes(e.key) ? Z(e) : e.key === "Enter" && typeof s.value == "number" && (e.preventDefault(), document.querySelectorAll(`#${y.value} .menuitem`)[s.value].click(), D());
|
|
125
125
|
}
|
|
126
126
|
function Y(e) {
|
|
127
|
-
|
|
127
|
+
["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && i.value === !1 && (e.preventDefault(), u(!0));
|
|
128
|
+
}
|
|
129
|
+
function Z(e) {
|
|
130
|
+
var m;
|
|
128
131
|
e.preventDefault();
|
|
129
|
-
const
|
|
130
|
-
i.value ||
|
|
131
|
-
const
|
|
132
|
-
|
|
132
|
+
const l = e.key;
|
|
133
|
+
i.value || u(!0);
|
|
134
|
+
const o = (m = n.items) == null ? void 0 : m.length;
|
|
135
|
+
o && (typeof s.value == "number" ? s.value === o - 1 && l === "ArrowDown" ? s.value = 0 : s.value === 0 && l === "ArrowUp" ? s.value = o - 1 : s.value = l === "ArrowDown" ? s.value + 1 : s.value - 1 : s.value = l === "ArrowDown" ? 0 : o - 1);
|
|
133
136
|
}
|
|
134
137
|
return T(
|
|
135
138
|
() => i.value,
|
|
136
139
|
(e) => {
|
|
137
|
-
e ? document.addEventListener("keydown",
|
|
140
|
+
e ? document.addEventListener("keydown", I) : document.removeEventListener("keydown", I), s.value = void 0;
|
|
138
141
|
}
|
|
139
142
|
), T(
|
|
140
143
|
() => n.open,
|
|
141
|
-
(e) =>
|
|
142
|
-
), (e,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
(e) => u(e)
|
|
145
|
+
), (e, l) => U((v(), w("div", {
|
|
146
|
+
id: a(y),
|
|
147
|
+
class: $(["m-dropdown", [n.class]]),
|
|
148
|
+
style: re(e.style)
|
|
149
|
+
}, [
|
|
150
|
+
h("div", {
|
|
151
|
+
role: "button",
|
|
152
|
+
tabindex: "0",
|
|
153
|
+
class: "m-dropdown__wrapper",
|
|
154
|
+
"aria-expanded": i.value,
|
|
155
|
+
"aria-haspopup": "menu",
|
|
156
|
+
onClick: z(j, ["stop"]),
|
|
157
|
+
onFocus: K,
|
|
158
|
+
onBlur: G,
|
|
159
|
+
onKeydown: Y,
|
|
160
|
+
onMouseenter: P,
|
|
161
|
+
onMouseleave: Q
|
|
148
162
|
}, [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
class: "m-dropdown__wrapper",
|
|
153
|
-
"aria-expanded": i.value,
|
|
154
|
-
"aria-haspopup": "menu",
|
|
155
|
-
onClick: z(j, ["stop"]),
|
|
156
|
-
onFocus: K,
|
|
157
|
-
onBlur: G,
|
|
158
|
-
onKeydown: X,
|
|
159
|
-
onMouseenter: P,
|
|
160
|
-
onMouseleave: Q
|
|
163
|
+
h("span", {
|
|
164
|
+
id: `${a(y)}-labelspan`,
|
|
165
|
+
class: "maz-sr-only"
|
|
161
166
|
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
)
|
|
172
|
-
])
|
|
173
|
-
], 8, me),
|
|
174
|
-
v(`
|
|
167
|
+
f(e.$slots, "screen-reader-description", {}, () => [
|
|
168
|
+
M(
|
|
169
|
+
A(e.screenReaderDescription),
|
|
170
|
+
1
|
|
171
|
+
/* TEXT */
|
|
172
|
+
)
|
|
173
|
+
])
|
|
174
|
+
], 8, me),
|
|
175
|
+
p(`
|
|
175
176
|
@slot Custom Element
|
|
176
177
|
@binding {Boolen} is-open close function
|
|
177
178
|
@default \`<MazBtn />\`
|
|
178
179
|
`),
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
]),
|
|
194
|
-
v(" @slot Menu Label ")
|
|
180
|
+
f(e.$slots, "element", { isOpen: i.value }, () => [
|
|
181
|
+
N(a(k), B({
|
|
182
|
+
color: e.color,
|
|
183
|
+
disabled: e.disabled,
|
|
184
|
+
"aria-labelledby": `${a(y)}-labelspan`
|
|
185
|
+
}, e.$attrs, { tabindex: "-1" }), {
|
|
186
|
+
default: O(() => [
|
|
187
|
+
h("span", ve, [
|
|
188
|
+
p(" @slot Button text "),
|
|
189
|
+
f(e.$slots, "default"),
|
|
190
|
+
e.noChevron ? p("v-if", !0) : (v(), S(a(b), {
|
|
191
|
+
key: 0,
|
|
192
|
+
class: $([{ "maz-rotate-180": i.value }, "chevron-icon"])
|
|
193
|
+
}, null, 8, ["class"]))
|
|
195
194
|
]),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
[
|
|
224
|
-
|
|
195
|
+
p(" @slot Menu Label ")
|
|
196
|
+
]),
|
|
197
|
+
_: 3
|
|
198
|
+
/* FORWARDED */
|
|
199
|
+
}, 16, ["color", "disabled", "aria-labelledby"])
|
|
200
|
+
])
|
|
201
|
+
], 40, pe),
|
|
202
|
+
N(le, {
|
|
203
|
+
name: "maz-scale-fade",
|
|
204
|
+
persisted: ""
|
|
205
|
+
}, {
|
|
206
|
+
default: O(() => [
|
|
207
|
+
U(h(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
role: "menu",
|
|
211
|
+
"aria-label": "Menu",
|
|
212
|
+
class: $(["menu", {
|
|
213
|
+
"--top": e.position.includes("top"),
|
|
214
|
+
"--left": e.position.includes("left"),
|
|
215
|
+
"--right": e.position.includes("right"),
|
|
216
|
+
"--bottom": e.position.includes("bottom")
|
|
217
|
+
}]),
|
|
218
|
+
tabindex: "-1",
|
|
219
|
+
onFocus: l[0] || (l[0] = (o) => a(c)(!0)),
|
|
220
|
+
onBlur: l[1] || (l[1] = (o) => a(c)(!1)),
|
|
221
|
+
onMouseenter: l[2] || (l[2] = (o) => ["hover", "both"].includes(e.trigger) ? a(c)(!0) : void 0),
|
|
222
|
+
onMouseleave: l[3] || (l[3] = (o) => ["hover", "both"].includes(e.trigger) ? a(c)(!1) : void 0)
|
|
223
|
+
},
|
|
224
|
+
[
|
|
225
|
+
p(`
|
|
225
226
|
@slot Custom dropdown panel
|
|
226
227
|
@binding {Array} items - items prop data
|
|
227
228
|
`),
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
f(e.$slots, "dropdown", { items: e.items }, () => [
|
|
230
|
+
(v(!0), w(
|
|
231
|
+
F,
|
|
232
|
+
null,
|
|
233
|
+
se(e.items, (o, m) => (v(), w(
|
|
230
234
|
F,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{ key: $ },
|
|
235
|
-
[
|
|
236
|
-
v(`
|
|
235
|
+
{ key: m },
|
|
236
|
+
[
|
|
237
|
+
p(`
|
|
237
238
|
@slot Custom menu item
|
|
238
239
|
@binding {Object} item - menu item
|
|
239
240
|
`),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}), {
|
|
263
|
-
default: B(() => [
|
|
264
|
-
m(e.$slots, "menuitem-label", { item: o }, () => [
|
|
265
|
-
C(
|
|
266
|
-
g(o.label),
|
|
267
|
-
1
|
|
268
|
-
/* TEXT */
|
|
269
|
-
)
|
|
270
|
-
])
|
|
271
|
-
]),
|
|
272
|
-
_: 2
|
|
273
|
-
/* DYNAMIC */
|
|
274
|
-
}, 1040, ["target", "to", "href", "color", "class"])) : o.action ? (b(), h("button", A({
|
|
275
|
-
key: 1,
|
|
276
|
-
tabindex: "-1",
|
|
277
|
-
type: "button",
|
|
278
|
-
ref_for: !0
|
|
279
|
-
}, o, {
|
|
280
|
-
class: ["menuitem menuitem__button", [
|
|
281
|
-
{
|
|
282
|
-
"--is-keyboard-selected": s.value === $
|
|
283
|
-
},
|
|
284
|
-
o.class,
|
|
285
|
-
`--${o.color ?? "theme"}`
|
|
286
|
-
]],
|
|
287
|
-
onClick: z((Z) => J(o) ? W(o, Z) : y(), ["stop"])
|
|
288
|
-
}), [
|
|
289
|
-
m(e.$slots, "menuitem-label", { item: o }, () => [
|
|
290
|
-
C(
|
|
291
|
-
g(o.label),
|
|
241
|
+
f(e.$slots, "menuitem", { item: o }, () => [
|
|
242
|
+
W(o) ? (v(), S(a(C), B({
|
|
243
|
+
key: 0,
|
|
244
|
+
target: o.href ? o.target ?? "_self" : void 0,
|
|
245
|
+
to: o.to,
|
|
246
|
+
href: o.href,
|
|
247
|
+
color: o.color ?? "theme",
|
|
248
|
+
ref_for: !0
|
|
249
|
+
}, o, {
|
|
250
|
+
class: ["menuitem", [
|
|
251
|
+
{
|
|
252
|
+
"--is-keyboard-selected": s.value === m
|
|
253
|
+
},
|
|
254
|
+
o.class
|
|
255
|
+
]],
|
|
256
|
+
tabindex: "-1",
|
|
257
|
+
onClick: z(D, ["stop"])
|
|
258
|
+
}), {
|
|
259
|
+
default: O(() => [
|
|
260
|
+
f(e.$slots, "menuitem-label", { item: o }, () => [
|
|
261
|
+
M(
|
|
262
|
+
A(o.label),
|
|
292
263
|
1
|
|
293
264
|
/* TEXT */
|
|
294
265
|
)
|
|
295
266
|
])
|
|
296
|
-
]
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
267
|
+
]),
|
|
268
|
+
_: 2
|
|
269
|
+
/* DYNAMIC */
|
|
270
|
+
}, 1040, ["target", "to", "href", "color", "class"])) : J(o) ? (v(), w("button", B({
|
|
271
|
+
key: 1,
|
|
272
|
+
tabindex: "-1",
|
|
273
|
+
type: "button",
|
|
274
|
+
ref_for: !0
|
|
275
|
+
}, o, {
|
|
276
|
+
class: ["menuitem menuitem__button", [
|
|
277
|
+
{
|
|
278
|
+
"--is-keyboard-selected": s.value === m
|
|
279
|
+
},
|
|
280
|
+
o.class,
|
|
281
|
+
`--${o.color ?? "theme"}`
|
|
282
|
+
]],
|
|
283
|
+
onClick: z((x) => X(o, x), ["stop"])
|
|
284
|
+
}), [
|
|
285
|
+
f(e.$slots, "menuitem-label", { item: o }, () => [
|
|
286
|
+
M(
|
|
287
|
+
A(o.label),
|
|
288
|
+
1
|
|
289
|
+
/* TEXT */
|
|
290
|
+
)
|
|
291
|
+
])
|
|
292
|
+
], 16, be)) : p("v-if", !0)
|
|
293
|
+
])
|
|
294
|
+
],
|
|
295
|
+
64
|
|
296
|
+
/* STABLE_FRAGMENT */
|
|
297
|
+
))),
|
|
298
|
+
128
|
|
299
|
+
/* KEYED_FRAGMENT */
|
|
300
|
+
))
|
|
301
|
+
])
|
|
302
|
+
],
|
|
303
|
+
34
|
|
304
|
+
/* CLASS, NEED_HYDRATION */
|
|
305
|
+
), [
|
|
306
|
+
[ie, i.value]
|
|
307
|
+
])
|
|
308
|
+
]),
|
|
309
|
+
_: 3
|
|
310
|
+
/* FORWARDED */
|
|
311
|
+
})
|
|
312
|
+
], 14, fe)), [
|
|
313
|
+
[a(de), R]
|
|
314
|
+
]);
|
|
320
315
|
}
|
|
321
316
|
});
|
|
322
317
|
export {
|
package/components/MazSwitch.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import './assets/MazSwitch.css';function
|
|
3
|
-
componentName:
|
|
4
|
-
providedId:
|
|
1
|
+
import { computed as b, getCurrentInstance as k, defineComponent as V, useCssVars as B, ref as C, openBlock as i, createElementBlock as d, unref as f, normalizeClass as m, normalizeStyle as E, createElementVNode as p, mergeProps as S, createCommentVNode as r, renderSlot as $, createTextVNode as z, toDisplayString as h } from "vue";
|
|
2
|
+
import './assets/MazSwitch.css';function I({
|
|
3
|
+
componentName: o,
|
|
4
|
+
providedId: s
|
|
5
5
|
}) {
|
|
6
|
-
return
|
|
6
|
+
return b(() => {
|
|
7
7
|
var a;
|
|
8
|
-
return
|
|
8
|
+
return s ?? `${o}-${(a = k()) == null ? void 0 : a.uid}`;
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const N = ["for", "aria-checked"], T = ["id", "name", "checked", "aria-label", "disabled"], D = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "m-switch__text"
|
|
14
|
-
},
|
|
14
|
+
}, R = /* @__PURE__ */ V({
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
__name: "MazSwitch",
|
|
17
17
|
props: {
|
|
@@ -29,46 +29,43 @@ const T = ["for", "aria-checked"], D = ["id", "name", "checked", "aria-label", "
|
|
|
29
29
|
hint: {}
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:model-value", "change", "blur", "focus"],
|
|
32
|
-
setup(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"40e17e82": y.value
|
|
32
|
+
setup(o, { emit: s }) {
|
|
33
|
+
B((e) => ({
|
|
34
|
+
"1d7b852e": v.value
|
|
36
35
|
}));
|
|
37
|
-
const a =
|
|
36
|
+
const a = o, n = s, u = I({
|
|
38
37
|
componentName: "MazSwitch",
|
|
39
38
|
providedId: a.id
|
|
40
|
-
}), v =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function m() {
|
|
44
|
-
o("update:model-value", !a.modelValue), o("change", !a.modelValue);
|
|
39
|
+
}), v = b(() => `var(--maz-color-${a.color}-alpha)`);
|
|
40
|
+
function c() {
|
|
41
|
+
n("update:model-value", !a.modelValue), n("change", !a.modelValue);
|
|
45
42
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
["Space"].includes(e.code) && (e.preventDefault(),
|
|
43
|
+
const t = C();
|
|
44
|
+
function y(e) {
|
|
45
|
+
["Space"].includes(e.code) && (e.preventDefault(), c());
|
|
49
46
|
}
|
|
50
|
-
function
|
|
47
|
+
function w(e) {
|
|
51
48
|
var l;
|
|
52
|
-
(l =
|
|
49
|
+
(l = t.value) == null || l.dispatchEvent(new Event("blur")), n("blur", e);
|
|
53
50
|
}
|
|
54
|
-
function
|
|
51
|
+
function g(e) {
|
|
55
52
|
var l;
|
|
56
|
-
(l =
|
|
53
|
+
(l = t.value) == null || l.dispatchEvent(new Event("focus")), n("focus", e);
|
|
57
54
|
}
|
|
58
|
-
return (e, l) => (i(),
|
|
59
|
-
for: f(
|
|
60
|
-
class:
|
|
55
|
+
return (e, l) => (i(), d("label", {
|
|
56
|
+
for: f(u),
|
|
57
|
+
class: m(["m-switch", [{ "--is-disabled": e.disabled }, a.class]]),
|
|
61
58
|
role: "switch",
|
|
62
|
-
style:
|
|
59
|
+
style: E(e.style),
|
|
63
60
|
"aria-checked": e.modelValue,
|
|
64
61
|
tabindex: "0",
|
|
65
|
-
onBlur:
|
|
66
|
-
onFocus:
|
|
67
|
-
onKeydown:
|
|
62
|
+
onBlur: w,
|
|
63
|
+
onFocus: g,
|
|
64
|
+
onKeydown: y
|
|
68
65
|
}, [
|
|
69
|
-
|
|
66
|
+
p("input", S({ id: f(u) }, e.$attrs, {
|
|
70
67
|
ref_key: "inputRef",
|
|
71
|
-
ref:
|
|
68
|
+
ref: t,
|
|
72
69
|
type: "checkbox",
|
|
73
70
|
name: e.name,
|
|
74
71
|
tabindex: "-1",
|
|
@@ -76,45 +73,45 @@ const T = ["for", "aria-checked"], D = ["id", "name", "checked", "aria-label", "
|
|
|
76
73
|
"aria-label": e.label,
|
|
77
74
|
disabled: e.disabled,
|
|
78
75
|
class: "m-switch__input",
|
|
79
|
-
onChange:
|
|
80
|
-
}), null, 16,
|
|
81
|
-
l[0] || (l[0] =
|
|
76
|
+
onChange: c
|
|
77
|
+
}), null, 16, T),
|
|
78
|
+
l[0] || (l[0] = p(
|
|
82
79
|
"span",
|
|
83
80
|
{ class: "m-switch__toggle" },
|
|
84
81
|
null,
|
|
85
82
|
-1
|
|
86
83
|
/* HOISTED */
|
|
87
84
|
)),
|
|
88
|
-
e.$slots.default || e.label || e.hint ? (i(),
|
|
89
|
-
|
|
85
|
+
e.$slots.default || e.label || e.hint ? (i(), d("span", D, [
|
|
86
|
+
r(`
|
|
90
87
|
@slot The label of the switch
|
|
91
88
|
@binding {Boolean} value - The value of the switch
|
|
92
89
|
`),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
$(e.$slots, "default", { value: e.modelValue }, () => [
|
|
91
|
+
z(
|
|
92
|
+
h(e.label),
|
|
96
93
|
1
|
|
97
94
|
/* TEXT */
|
|
98
95
|
)
|
|
99
96
|
]),
|
|
100
|
-
e.hint ? (i(),
|
|
97
|
+
e.hint ? (i(), d(
|
|
101
98
|
"span",
|
|
102
99
|
{
|
|
103
100
|
key: 0,
|
|
104
|
-
class:
|
|
101
|
+
class: m(["m-switch__hint", {
|
|
105
102
|
"--error": e.error,
|
|
106
103
|
"--success": e.success,
|
|
107
104
|
"--warning": e.warning
|
|
108
105
|
}])
|
|
109
106
|
},
|
|
110
|
-
|
|
107
|
+
h(e.hint),
|
|
111
108
|
3
|
|
112
109
|
/* TEXT, CLASS */
|
|
113
|
-
)) :
|
|
114
|
-
])) :
|
|
115
|
-
], 46,
|
|
110
|
+
)) : r("v-if", !0)
|
|
111
|
+
])) : r("v-if", !0)
|
|
112
|
+
], 46, N));
|
|
116
113
|
}
|
|
117
114
|
});
|
|
118
115
|
export {
|
|
119
|
-
|
|
116
|
+
R as default
|
|
120
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.m-switch{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.5rem;vertical-align:top}.m-switch.--is-disabled{cursor:not-allowed}.m-switch__input{position:absolute;left:-9999px}.m-switch__toggle{position:relative;height:1.5rem;width:3rem}.m-switch__toggle:before{content:"";-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;left
|
|
1
|
+
.m-switch{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:.5rem;vertical-align:top}.m-switch.--is-disabled{cursor:not-allowed}.m-switch__input{position:absolute;left:-9999px}.m-switch__toggle{position:relative;height:1.5rem;width:3rem}.m-switch__toggle:before{content:"";-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;left:0;top:.125rem;display:block;height:1.25rem;width:3rem;border-radius:9999px;background-color:var(--maz-color-bg-light)}.m-switch__toggle:is([class~=dark] *):before{background-color:var(--maz-color-bg-lighter)}.m-switch__toggle:after{content:"";position:absolute;left:0;top:0;display:block;height:1.5rem;width:1.5rem;border-radius:9999px;background-color:#fff;-webkit-box-shadow:0 0 4px 0 hsl(0deg 0% 0% / 20%);box-shadow:0 0 4px #0003;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.m-switch__input:checked+.m-switch__toggle:after{--tw-translate-x: 1.5rem;-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-switch__input:checked+.m-switch__toggle:before{background-color:var(--1d7b852e)}.m-switch__input:disabled+.m-switch__toggle:before{background-color:var(--maz-color-bg-lighter)}.m-switch__input:disabled+.m-switch__toggle:is([class~=dark] *):before{background-color:var(--maz-color-bg-light)}.m-switch__input:disabled+.m-switch__toggle:after{background-color:var(--maz-color-bg-light)}.m-switch__input:disabled+.m-switch__toggle:is([class~=dark] *):after{background-color:var(--maz-color-bg-lighter)}.m-switch__input:disabled+.m-switch__toggle:after{-webkit-box-shadow:none;box-shadow:none}.m-switch__text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:0px}.m-switch__hint{font-size:.875rem;line-height:1.25rem;color:var(--maz-color-muted)}.m-switch__hint.--error{color:var(--maz-color-danger-600)}.m-switch__hint.--success{color:var(--maz-color-success-600)}.m-switch__hint.--warning{color:var(--maz-color-warning-600)}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { defineComponent as F, defineAsyncComponent as h, useAttrs as j, useSlots as E, onBeforeMount as O, computed as l, openBlock as n, createBlock as a, resolveDynamicComponent as r, normalizeClass as s, withCtx as R, createElementBlock as u, createCommentVNode as t, renderSlot as d, unref as c } from "vue";
|
|
2
|
+
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
import '../assets/MazBtn.css';const A = /* @__PURE__ */ F({
|
|
4
|
+
__name: "MazBtn",
|
|
5
|
+
props: {
|
|
6
|
+
variant: { default: "button" },
|
|
7
|
+
size: { default: "md" },
|
|
8
|
+
color: { default: "primary" },
|
|
9
|
+
type: { default: "button" },
|
|
10
|
+
rounded: { type: Boolean },
|
|
11
|
+
roundedSize: { default: "lg" },
|
|
12
|
+
noRounded: { type: Boolean },
|
|
13
|
+
outline: { type: Boolean },
|
|
14
|
+
pastel: { type: Boolean },
|
|
15
|
+
block: { type: Boolean },
|
|
16
|
+
noUnderline: { type: Boolean },
|
|
17
|
+
loading: { type: Boolean },
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
fab: { type: Boolean },
|
|
20
|
+
icon: { type: [String, Function, Object], default: void 0 },
|
|
21
|
+
leftIcon: { type: [String, Function, Object], default: void 0 },
|
|
22
|
+
rightIcon: { type: [String, Function, Object], default: void 0 },
|
|
23
|
+
noPadding: { type: Boolean },
|
|
24
|
+
noElevation: { type: Boolean },
|
|
25
|
+
contentClass: { default: void 0 }
|
|
26
|
+
},
|
|
27
|
+
setup(g) {
|
|
28
|
+
const o = g, z = h(() => import("./MazSpinner-SgVUnAHk.mjs")), f = h(() => import("./MazIcon-BDGxCy9M.mjs")), { href: k, to: B } = j(), p = E();
|
|
29
|
+
O(() => {
|
|
30
|
+
o.icon && !o.fab && console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
|
|
31
|
+
});
|
|
32
|
+
const v = l(() => k ? "a" : B ? "router-link" : "button"), I = l(
|
|
33
|
+
() => o.pastel ? `--${o.color}-pastel` : o.outline ? `--${o.color}-outline` : `--${o.color}`
|
|
34
|
+
), b = l(
|
|
35
|
+
() => (o.loading || o.disabled) && v.value === "button"
|
|
36
|
+
), C = l(() => b.value ? "--cursor-default" : "--cursor-pointer"), $ = l(() => `--is-${o.variant}`), i = l(() => o.loading && o.variant === "button"), m = l(() => !!p["left-icon"] || o.leftIcon), y = l(() => !!p["right-icon"] || o.rightIcon), S = l(() => m.value || y.value), M = l(() => o.fab && (o.icon || !!p.icon)), T = l(() => v.value === "button" ? o.type : void 0);
|
|
37
|
+
return (e, D) => (n(), a(r(v.value), {
|
|
38
|
+
disabled: b.value || void 0,
|
|
39
|
+
class: s(["m-btn", [
|
|
40
|
+
`--${e.size}`,
|
|
41
|
+
!e.fab && !e.rounded && e.roundedSize && `--rounded-${e.roundedSize}`,
|
|
42
|
+
I.value,
|
|
43
|
+
C.value,
|
|
44
|
+
$.value,
|
|
45
|
+
{
|
|
46
|
+
"--block": e.block,
|
|
47
|
+
"--no-underline": e.noUnderline,
|
|
48
|
+
"--fab": e.fab,
|
|
49
|
+
"--loading": e.loading,
|
|
50
|
+
"--disabled": b.value,
|
|
51
|
+
"--icon": S.value,
|
|
52
|
+
"--rounded": e.rounded,
|
|
53
|
+
"--no-rounded": e.noRounded,
|
|
54
|
+
"--no-padding": e.noPadding,
|
|
55
|
+
"--no-elevation": e.noElevation
|
|
56
|
+
}
|
|
57
|
+
]]),
|
|
58
|
+
type: T.value
|
|
59
|
+
}, {
|
|
60
|
+
default: R(() => [
|
|
61
|
+
m.value ? (n(), u(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
key: 0,
|
|
65
|
+
class: s(["m-btn__icon-left maz-flex maz-flex-center", { "maz-invisible": i.value }])
|
|
66
|
+
},
|
|
67
|
+
[
|
|
68
|
+
t(`
|
|
69
|
+
@slot left-icon - The icon to display on the left of the button
|
|
70
|
+
`),
|
|
71
|
+
d(e.$slots, "left-icon", {}, () => [
|
|
72
|
+
typeof e.leftIcon == "string" ? (n(), a(c(f), {
|
|
73
|
+
key: 0,
|
|
74
|
+
name: e.leftIcon
|
|
75
|
+
}, null, 8, ["name"])) : e.leftIcon ? (n(), a(r(e.leftIcon), { key: 1 })) : t("v-if", !0)
|
|
76
|
+
], !0)
|
|
77
|
+
],
|
|
78
|
+
2
|
|
79
|
+
/* CLASS */
|
|
80
|
+
)) : t("v-if", !0),
|
|
81
|
+
M.value ? (n(), u(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
key: 1,
|
|
85
|
+
class: s(["m-btn__icon", { "maz-invisible": i.value }])
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
t(`
|
|
89
|
+
@slot icon - The icon to display on the fab button
|
|
90
|
+
`),
|
|
91
|
+
d(e.$slots, "icon", {}, () => [
|
|
92
|
+
typeof e.icon == "string" ? (n(), a(c(f), {
|
|
93
|
+
key: 0,
|
|
94
|
+
name: e.icon
|
|
95
|
+
}, null, 8, ["name"])) : e.icon ? (n(), a(r(e.icon), { key: 1 })) : t("v-if", !0)
|
|
96
|
+
], !0)
|
|
97
|
+
],
|
|
98
|
+
2
|
|
99
|
+
/* CLASS */
|
|
100
|
+
)) : t("v-if", !0),
|
|
101
|
+
e.$slots.default ? (n(), u(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
key: 2,
|
|
105
|
+
class: s([{ "maz-invisible": i.value }, e.contentClass])
|
|
106
|
+
},
|
|
107
|
+
[
|
|
108
|
+
t(`
|
|
109
|
+
@slot default - The content of the button
|
|
110
|
+
`),
|
|
111
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
112
|
+
],
|
|
113
|
+
2
|
|
114
|
+
/* CLASS */
|
|
115
|
+
)) : t("v-if", !0),
|
|
116
|
+
y.value ? (n(), u(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
key: 3,
|
|
120
|
+
class: s(["m-btn__icon-right", { "maz-invisible": i.value }])
|
|
121
|
+
},
|
|
122
|
+
[
|
|
123
|
+
t(`
|
|
124
|
+
@slot right-icon - The icon to display on the right of the button
|
|
125
|
+
`),
|
|
126
|
+
d(e.$slots, "right-icon", {}, () => [
|
|
127
|
+
typeof e.rightIcon == "string" ? (n(), a(c(f), {
|
|
128
|
+
key: 0,
|
|
129
|
+
name: e.rightIcon
|
|
130
|
+
}, null, 8, ["name"])) : e.rightIcon ? (n(), a(r(e.rightIcon), { key: 1 })) : t("v-if", !0)
|
|
131
|
+
], !0)
|
|
132
|
+
],
|
|
133
|
+
2
|
|
134
|
+
/* CLASS */
|
|
135
|
+
)) : t("v-if", !0),
|
|
136
|
+
i.value ? (n(), a(c(z), {
|
|
137
|
+
key: 4,
|
|
138
|
+
class: "m-btn-loader",
|
|
139
|
+
size: "2em",
|
|
140
|
+
color: e.color
|
|
141
|
+
}, null, 8, ["color"])) : t("v-if", !0)
|
|
142
|
+
]),
|
|
143
|
+
_: 3
|
|
144
|
+
/* FORWARDED */
|
|
145
|
+
}, 8, ["disabled", "class", "type"]));
|
|
146
|
+
}
|
|
147
|
+
}), U = /* @__PURE__ */ w(A, [["__scopeId", "data-v-792f66c0"]]);
|
|
148
|
+
export {
|
|
149
|
+
U as default
|
|
150
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineComponent as u, defineAsyncComponent as d, openBlock as o, createBlock as n, resolveDynamicComponent as r, mergeProps as s, withCtx as p, createCommentVNode as t, renderSlot as l, unref as a, createVNode as h } from "vue";
|
|
2
|
+
import { _ as m } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
import '../assets/MazLink.css';const y = /* @__PURE__ */ u({
|
|
4
|
+
__name: "MazLink",
|
|
5
|
+
props: {
|
|
6
|
+
id: { default: void 0 },
|
|
7
|
+
title: { default: void 0 },
|
|
8
|
+
href: { default: "#" },
|
|
9
|
+
to: { default: void 0 },
|
|
10
|
+
color: { default: "primary" },
|
|
11
|
+
target: { default: "_self" },
|
|
12
|
+
download: { default: void 0 },
|
|
13
|
+
rel: { default: void 0 },
|
|
14
|
+
ariaLabel: { default: void 0 },
|
|
15
|
+
underline: { type: Boolean, default: !1 },
|
|
16
|
+
underlineOnlyHover: { type: Boolean, default: !0 },
|
|
17
|
+
autoExternal: { type: Boolean, default: !0 },
|
|
18
|
+
leftIcon: { type: [String, Function, Object], default: void 0 },
|
|
19
|
+
rightIcon: { type: [String, Function, Object], default: void 0 }
|
|
20
|
+
},
|
|
21
|
+
setup(c) {
|
|
22
|
+
const f = d(
|
|
23
|
+
() => import("./arrow-top-right-on-square-jPmYJ34F.mjs")
|
|
24
|
+
), i = d(() => import("./MazIcon-BDGxCy9M.mjs"));
|
|
25
|
+
return (e, g) => (o(), n(r(e.to ? "router-link" : "a"), s({
|
|
26
|
+
id: e.id,
|
|
27
|
+
class: ["m-link", [
|
|
28
|
+
{
|
|
29
|
+
"--underline": e.underline,
|
|
30
|
+
"--underline-only-hover": !e.underline && e.underlineOnlyHover
|
|
31
|
+
},
|
|
32
|
+
`--${e.color}`
|
|
33
|
+
]],
|
|
34
|
+
to: e.to,
|
|
35
|
+
href: e.href,
|
|
36
|
+
title: e.title,
|
|
37
|
+
target: e.target,
|
|
38
|
+
rel: e.rel,
|
|
39
|
+
download: e.download,
|
|
40
|
+
"aria-label": e.ariaLabel
|
|
41
|
+
}, e.$attrs), {
|
|
42
|
+
default: p(() => [
|
|
43
|
+
t(`
|
|
44
|
+
@slot left-icon - The icon to display on the left of the text
|
|
45
|
+
`),
|
|
46
|
+
l(e.$slots, "left-icon", {}, () => [
|
|
47
|
+
typeof e.leftIcon == "string" ? (o(), n(a(i), {
|
|
48
|
+
key: 0,
|
|
49
|
+
name: e.leftIcon
|
|
50
|
+
}, null, 8, ["name"])) : e.leftIcon ? (o(), n(r(e.leftIcon), { key: 1 })) : t("v-if", !0)
|
|
51
|
+
], !0),
|
|
52
|
+
t(`
|
|
53
|
+
@slot Text of the link
|
|
54
|
+
`),
|
|
55
|
+
l(e.$slots, "default", {}, void 0, !0),
|
|
56
|
+
t(`
|
|
57
|
+
@slot right-icon - The icon to display on the left of the text
|
|
58
|
+
`),
|
|
59
|
+
l(e.$slots, "right-icon", {}, () => [
|
|
60
|
+
typeof e.rightIcon == "string" ? (o(), n(a(i), {
|
|
61
|
+
key: 0,
|
|
62
|
+
name: e.rightIcon
|
|
63
|
+
}, null, 8, ["name"])) : e.rightIcon ? (o(), n(r(e.rightIcon), { key: 1 })) : t("v-if", !0)
|
|
64
|
+
], !0),
|
|
65
|
+
t(`
|
|
66
|
+
@slot external-icon - Replace the default external icon
|
|
67
|
+
`),
|
|
68
|
+
e.autoExternal && e.target === "_blank" ? l(e.$slots, "external-icon", { key: 0 }, () => [
|
|
69
|
+
h(a(f))
|
|
70
|
+
], !0) : t("v-if", !0)
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
/* FORWARDED */
|
|
74
|
+
}, 16, ["id", "class", "to", "href", "title", "target", "rel", "download", "aria-label"]));
|
|
75
|
+
}
|
|
76
|
+
}), I = /* @__PURE__ */ m(y, [["__scopeId", "data-v-b1120a61"]]);
|
|
77
|
+
export {
|
|
78
|
+
I as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as r, createElementBlock as o, normalizeClass as s, createElementVNode as a } from "vue";
|
|
2
|
+
import { _ as i } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
import '../assets/MazSpinner.css';const c = ["width", "height"], p = /* @__PURE__ */ n({
|
|
4
|
+
__name: "MazSpinner",
|
|
5
|
+
props: {
|
|
6
|
+
size: { type: String, default: "2em" },
|
|
7
|
+
color: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "primary"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
return (l, t) => (r(), o("svg", {
|
|
14
|
+
width: e.size,
|
|
15
|
+
height: e.size,
|
|
16
|
+
version: "1.1",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
x: "0px",
|
|
19
|
+
y: "0px",
|
|
20
|
+
viewBox: "0 0 50 50",
|
|
21
|
+
"xml:space": "preserve",
|
|
22
|
+
class: s(["m-spinner", `m-spinner--${e.color}`]),
|
|
23
|
+
style: { "enable-background": "new 0 0 50 50" }
|
|
24
|
+
}, t[0] || (t[0] = [
|
|
25
|
+
a(
|
|
26
|
+
"path",
|
|
27
|
+
{ d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" },
|
|
28
|
+
null,
|
|
29
|
+
-1
|
|
30
|
+
/* HOISTED */
|
|
31
|
+
)
|
|
32
|
+
]), 10, c));
|
|
33
|
+
}
|
|
34
|
+
}), h = /* @__PURE__ */ i(p, [["__scopeId", "data-v-c16a57a3"]]);
|
|
35
|
+
export {
|
|
36
|
+
h as default
|
|
37
|
+
};
|
package/nuxt/index.json
CHANGED
package/package.json
CHANGED
|
@@ -17,7 +17,13 @@ type LinkItem = ItemBase & MazLinkProps & {
|
|
|
17
17
|
type ActionItem = ItemBase & {
|
|
18
18
|
action?: () => unknown;
|
|
19
19
|
};
|
|
20
|
-
export type MenuItem = (LinkItem
|
|
20
|
+
export type MenuItem = (LinkItem & {
|
|
21
|
+
action?: never;
|
|
22
|
+
}) | (ActionItem & {
|
|
23
|
+
href?: never;
|
|
24
|
+
to?: never;
|
|
25
|
+
target?: never;
|
|
26
|
+
});
|
|
21
27
|
export interface Props {
|
|
22
28
|
style?: HTMLAttributes['style'];
|
|
23
29
|
class?: HTMLAttributes['class'];
|
|
@@ -68,10 +74,30 @@ declare function __VLS_template(): {
|
|
|
68
74
|
item: MenuItem;
|
|
69
75
|
}): any;
|
|
70
76
|
"menuitem-label"?(_: {
|
|
71
|
-
item:
|
|
77
|
+
item: Record<string, unknown> & {
|
|
78
|
+
label: string;
|
|
79
|
+
class?: unknown;
|
|
80
|
+
color?: Color;
|
|
81
|
+
} & MazLinkProps & {
|
|
82
|
+
target?: string;
|
|
83
|
+
href?: string;
|
|
84
|
+
to?: RouteLocationRaw;
|
|
85
|
+
} & {
|
|
86
|
+
action?: never;
|
|
87
|
+
};
|
|
72
88
|
}): any;
|
|
73
89
|
"menuitem-label"?(_: {
|
|
74
|
-
item:
|
|
90
|
+
item: Record<string, unknown> & {
|
|
91
|
+
label: string;
|
|
92
|
+
class?: unknown;
|
|
93
|
+
color?: Color;
|
|
94
|
+
} & {
|
|
95
|
+
action?: () => unknown;
|
|
96
|
+
} & {
|
|
97
|
+
href?: never;
|
|
98
|
+
to?: never;
|
|
99
|
+
target?: never;
|
|
100
|
+
};
|
|
75
101
|
}): any;
|
|
76
102
|
};
|
|
77
103
|
refs: {};
|