@volverjs/ui-vue 0.0.13-beta.5 → 0.0.13-beta.7
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/dist/components/VvAlert/VvAlert.es.js +83 -80
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -51
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +107 -104
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +353 -350
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +31 -28
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +70 -67
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +64 -61
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +45 -42
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +67 -64
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +215 -212
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/package.json +16 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject as N, computed as
|
|
1
|
+
import { inject as N, computed as l, useId as z, unref as v, watch as q, ref as F, defineComponent as O, mergeDefaults as G, toRefs as J, createBlock as B, createCommentVNode as p, openBlock as b, mergeProps as M, createElementBlock as y, normalizeProps as V, guardReactiveProps as L, renderSlot as g, createTextVNode as C, toDisplayString as w, withModifiers as K, createElementVNode as U } from "vue";
|
|
2
2
|
import { iconLoaded as S, Icon as Y, addIcon as H } from "@iconify/vue";
|
|
3
|
-
var
|
|
3
|
+
var P = /* @__PURE__ */ ((e) => (e.local = "local", e.session = "session", e))(P || {}), $ = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))($ || {}), I = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(I || {}), T = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(T || {}), D = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(D || {}), A = /* @__PURE__ */ ((e) => (e.alert = "alert", e.alertdialog = "alertdialog", e))(A || {});
|
|
4
4
|
const Q = /* @__PURE__ */ Symbol.for("volver"), W = /* @__PURE__ */ Symbol.for(
|
|
5
5
|
"alertGroup"
|
|
6
6
|
), X = {
|
|
@@ -30,41 +30,41 @@ const Q = /* @__PURE__ */ Symbol.for("volver"), W = /* @__PURE__ */ Symbol.for(
|
|
|
30
30
|
*/
|
|
31
31
|
id: [String, Number]
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
$.bottom;
|
|
34
34
|
T.button, D.button;
|
|
35
|
-
|
|
35
|
+
P.local;
|
|
36
36
|
function x() {
|
|
37
37
|
return N(W, {});
|
|
38
38
|
}
|
|
39
39
|
function ee(e) {
|
|
40
|
-
return
|
|
40
|
+
return l(() => String(e?.value || z()));
|
|
41
41
|
}
|
|
42
42
|
function te(e, o) {
|
|
43
|
-
const n =
|
|
43
|
+
const n = l(() => typeof e?.value == "string" ? { name: e?.value } : e?.value), a = l(
|
|
44
44
|
() => o?.value === I.before ? n.value : void 0
|
|
45
|
-
), i =
|
|
45
|
+
), i = l(
|
|
46
46
|
() => o?.value === I.after ? n.value : void 0
|
|
47
|
-
), r =
|
|
48
|
-
() => o?.value ===
|
|
49
|
-
),
|
|
50
|
-
() => o?.value ===
|
|
51
|
-
), u =
|
|
52
|
-
() => o?.value ===
|
|
53
|
-
),
|
|
54
|
-
() => o?.value ===
|
|
47
|
+
), r = l(
|
|
48
|
+
() => o?.value === $.left ? n.value : void 0
|
|
49
|
+
), m = l(
|
|
50
|
+
() => o?.value === $.right ? n.value : void 0
|
|
51
|
+
), u = l(
|
|
52
|
+
() => o?.value === $.top ? n.value : void 0
|
|
53
|
+
), d = l(
|
|
54
|
+
() => o?.value === $.bottom ? n.value : void 0
|
|
55
55
|
);
|
|
56
56
|
return {
|
|
57
57
|
hasIcon: n,
|
|
58
58
|
hasIconLeft: r,
|
|
59
|
-
hasIconRight:
|
|
59
|
+
hasIconRight: m,
|
|
60
60
|
hasIconTop: u,
|
|
61
|
-
hasIconBottom:
|
|
61
|
+
hasIconBottom: d,
|
|
62
62
|
hasIconBefore: a,
|
|
63
63
|
hasIconAfter: i
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function R(e, o, n) {
|
|
67
|
-
return
|
|
67
|
+
return l(() => {
|
|
68
68
|
const a = {
|
|
69
69
|
[e]: !0
|
|
70
70
|
}, i = typeof o?.value == "string" ? o.value.split(" ") : o?.value;
|
|
@@ -152,17 +152,17 @@ const oe = {
|
|
|
152
152
|
default: A.alert
|
|
153
153
|
}
|
|
154
154
|
}, re = ["close"];
|
|
155
|
-
function
|
|
156
|
-
const { bus: n } = x(), a = ee(
|
|
155
|
+
function le(e, o) {
|
|
156
|
+
const { bus: n } = x(), a = ee(l(() => e.id)), i = l(() => `${a.value}-title`);
|
|
157
157
|
let r;
|
|
158
|
-
const
|
|
158
|
+
const m = () => {
|
|
159
159
|
r && clearTimeout(r), o("close", a.value), n?.emit("close", a.value);
|
|
160
160
|
};
|
|
161
161
|
q(
|
|
162
162
|
() => e.autoClose,
|
|
163
|
-
(
|
|
164
|
-
if (
|
|
165
|
-
r = setTimeout(
|
|
163
|
+
(f) => {
|
|
164
|
+
if (f > 0) {
|
|
165
|
+
r = setTimeout(m, f);
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
r && clearTimeout(r);
|
|
@@ -171,36 +171,36 @@ function se(e, o) {
|
|
|
171
171
|
immediate: !0
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
|
-
const u = F(!1),
|
|
174
|
+
const u = F(!1), d = () => {
|
|
175
175
|
u.value = !0, r && clearTimeout(r);
|
|
176
176
|
}, t = () => {
|
|
177
|
-
u.value = !1, e.autoClose > 0 && (r = setTimeout(
|
|
178
|
-
}, { hasIcon:
|
|
177
|
+
u.value = !1, e.autoClose > 0 && (r = setTimeout(m, e.autoClose));
|
|
178
|
+
}, { hasIcon: h } = te(l(() => e.icon)), s = R(
|
|
179
179
|
"vv-alert",
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
l(() => e.modifiers),
|
|
181
|
+
l(() => ({
|
|
182
182
|
dismissable: e.autoClose > 0 || e.dismissable,
|
|
183
183
|
"auto-close": e.autoClose > 0,
|
|
184
184
|
hover: u.value
|
|
185
185
|
}))
|
|
186
|
-
), c =
|
|
186
|
+
), c = l(() => ({
|
|
187
187
|
"--alert-duration": `${e.autoClose}ms`
|
|
188
188
|
}));
|
|
189
189
|
return {
|
|
190
|
-
close:
|
|
191
|
-
hasIcon:
|
|
190
|
+
close: m,
|
|
191
|
+
hasIcon: h,
|
|
192
192
|
hasTitleId: i,
|
|
193
|
-
hasProps:
|
|
194
|
-
onMouseover:
|
|
193
|
+
hasProps: l(() => ({
|
|
194
|
+
onMouseover: d,
|
|
195
195
|
onMouseleave: t,
|
|
196
|
-
class:
|
|
196
|
+
class: s.value,
|
|
197
197
|
style: c.value,
|
|
198
198
|
role: e.role,
|
|
199
199
|
"aria-labelledby": i.value
|
|
200
200
|
}))
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function se() {
|
|
204
204
|
return N(Q, void 0);
|
|
205
205
|
}
|
|
206
206
|
const ne = {
|
|
@@ -226,42 +226,45 @@ const ne = {
|
|
|
226
226
|
modifiers: {}
|
|
227
227
|
}, X),
|
|
228
228
|
setup(e) {
|
|
229
|
-
const o = e, n =
|
|
230
|
-
const
|
|
229
|
+
const o = e, n = l(() => typeof o.rotate == "string" ? Number.parseFloat(o.rotate) : o.rotate), a = F(!0), i = se(), { modifiers: r } = J(o), m = R("vv-icon", r), u = l(() => o.provider || i?.iconsProvider), d = l(() => {
|
|
230
|
+
const s = o.name ?? "", c = `@${u.value}:${o.prefix}:${s}`;
|
|
231
231
|
if (S(c))
|
|
232
232
|
return c;
|
|
233
|
-
const
|
|
233
|
+
const f = i?.iconsCollections.find(
|
|
234
234
|
(k) => {
|
|
235
|
-
const E = `@${u.value}:${k.prefix}:${
|
|
235
|
+
const E = `@${u.value}:${k.prefix}:${s}`;
|
|
236
236
|
return S(E);
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
|
-
return
|
|
239
|
+
return f ? `@${u.value}:${f.prefix}:${s}` : s;
|
|
240
240
|
});
|
|
241
|
-
function t(
|
|
241
|
+
function t(s) {
|
|
242
242
|
let c;
|
|
243
|
-
if (typeof window > "u")
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
if (typeof window > "u")
|
|
244
|
+
try {
|
|
245
|
+
const { JSDOM: j } = require("jsdom");
|
|
246
|
+
c = new j().window;
|
|
247
|
+
} catch {
|
|
248
|
+
}
|
|
249
|
+
const f = c ? new c.DOMParser() : typeof window < "u" ? new window.DOMParser() : null;
|
|
250
|
+
return f ? f.parseFromString(s, "text/html").querySelector("svg") : void 0;
|
|
248
251
|
}
|
|
249
|
-
function
|
|
250
|
-
const c = t(
|
|
251
|
-
c &&
|
|
252
|
-
body:
|
|
252
|
+
function h(s) {
|
|
253
|
+
const c = t(s), f = c?.innerHTML.trim() || "";
|
|
254
|
+
c && f && H(`@${u.value}:${o.prefix}:${o.name}`, {
|
|
255
|
+
body: f,
|
|
253
256
|
// Set height and width from svg content
|
|
254
257
|
height: c.viewBox.baseVal.height,
|
|
255
258
|
width: c.viewBox.baseVal.width
|
|
256
259
|
});
|
|
257
260
|
}
|
|
258
|
-
return i && o.src && !S(`@${u.value}:${o.prefix}:${o.name}`) && (a.value = !1, i.fetchIcon(o.src).then((
|
|
259
|
-
|
|
260
|
-
}).catch((
|
|
261
|
-
throw new Error(`Error during fetch icon: ${
|
|
262
|
-
})), o.svg &&
|
|
261
|
+
return i && o.src && !S(`@${u.value}:${o.prefix}:${o.name}`) && (a.value = !1, i.fetchIcon(o.src).then((s) => {
|
|
262
|
+
s && h(s), a.value = !0;
|
|
263
|
+
}).catch((s) => {
|
|
264
|
+
throw a.value = !0, new Error(`Error during fetch icon: ${s?.message}`);
|
|
265
|
+
})), o.svg && h(o.svg), (s, c) => v(a) ? (b(), B(v(Y), M({
|
|
263
266
|
key: 0,
|
|
264
|
-
class: v(
|
|
267
|
+
class: v(m)
|
|
265
268
|
}, {
|
|
266
269
|
inline: e.inline,
|
|
267
270
|
width: e.width,
|
|
@@ -271,8 +274,8 @@ const ne = {
|
|
|
271
274
|
flip: e.flip,
|
|
272
275
|
rotate: v(n),
|
|
273
276
|
color: e.color,
|
|
274
|
-
icon: v(
|
|
275
|
-
}, { onLoad: e.onLoad }), null, 16, ["class", "onLoad"])) :
|
|
277
|
+
icon: v(d)
|
|
278
|
+
}, { onLoad: e.onLoad }), null, 16, ["class", "onLoad"])) : p("v-if", !0);
|
|
276
279
|
}
|
|
277
280
|
}), ie = {
|
|
278
281
|
key: 0,
|
|
@@ -290,27 +293,27 @@ const ne = {
|
|
|
290
293
|
props: oe,
|
|
291
294
|
emits: re,
|
|
292
295
|
setup(e, { expose: o, emit: n }) {
|
|
293
|
-
const a = e, i = n, { hasProps: r, hasTitleId:
|
|
296
|
+
const a = e, i = n, { hasProps: r, hasTitleId: m, hasIcon: u, close: d } = le(a, i);
|
|
294
297
|
return o({
|
|
295
298
|
/** Close the alert */
|
|
296
|
-
close:
|
|
297
|
-
}), (t,
|
|
299
|
+
close: d
|
|
300
|
+
}), (t, h) => (b(), y(
|
|
298
301
|
"div",
|
|
299
302
|
V(L(v(r))),
|
|
300
303
|
[
|
|
301
|
-
t.$slots.header || t.$slots.title || t.$slots.close || t.$slots["title::before"] || t.$slots["title::after"] || t.title || v(u) || t.dismissable || t.autoClose ? (b(),
|
|
302
|
-
v(u) ? (b(),
|
|
304
|
+
t.$slots.header || t.$slots.title || t.$slots.close || t.$slots["title::before"] || t.$slots["title::after"] || t.title || v(u) || t.dismissable || t.autoClose ? (b(), y("div", ie, [
|
|
305
|
+
v(u) ? (b(), B(
|
|
303
306
|
ae,
|
|
304
|
-
|
|
307
|
+
M({ key: 0 }, v(u), { class: "vv-alert__icon" }),
|
|
305
308
|
null,
|
|
306
309
|
16
|
|
307
310
|
/* FULL_PROPS */
|
|
308
|
-
)) :
|
|
311
|
+
)) : p("v-if", !0),
|
|
309
312
|
g(t.$slots, "header", {}, () => [
|
|
310
313
|
g(t.$slots, "title::before"),
|
|
311
|
-
t.$slots.title || t.title ? (b(),
|
|
314
|
+
t.$slots.title || t.title ? (b(), y("strong", {
|
|
312
315
|
key: 0,
|
|
313
|
-
id: v(
|
|
316
|
+
id: v(m),
|
|
314
317
|
class: "vv-alert__title"
|
|
315
318
|
}, [
|
|
316
319
|
g(t.$slots, "title", {}, () => [
|
|
@@ -320,21 +323,21 @@ const ne = {
|
|
|
320
323
|
/* TEXT */
|
|
321
324
|
)
|
|
322
325
|
])
|
|
323
|
-
], 8, ue)) :
|
|
326
|
+
], 8, ue)) : p("v-if", !0),
|
|
324
327
|
g(t.$slots, "title::after")
|
|
325
328
|
]),
|
|
326
|
-
g(t.$slots, "close", V(L({ close: v(
|
|
327
|
-
t.dismissable || t.autoClose ? (b(),
|
|
329
|
+
g(t.$slots, "close", V(L({ close: v(d) })), () => [
|
|
330
|
+
t.dismissable || t.autoClose ? (b(), y("button", {
|
|
328
331
|
key: 0,
|
|
329
332
|
class: "vv-alert__close",
|
|
330
333
|
type: "button",
|
|
331
334
|
"aria-label": t.closeLabel,
|
|
332
|
-
onClick:
|
|
335
|
+
onClick: h[0] || (h[0] = K(
|
|
333
336
|
//@ts-ignore
|
|
334
|
-
(...
|
|
337
|
+
(...s) => v(d) && v(d)(...s),
|
|
335
338
|
["stop"]
|
|
336
339
|
))
|
|
337
|
-
}, [...
|
|
340
|
+
}, [...h[1] || (h[1] = [
|
|
338
341
|
U(
|
|
339
342
|
"div",
|
|
340
343
|
{ class: "vv-alert__close-mask" },
|
|
@@ -342,10 +345,10 @@ const ne = {
|
|
|
342
345
|
-1
|
|
343
346
|
/* CACHED */
|
|
344
347
|
)
|
|
345
|
-
])], 8, ce)) :
|
|
348
|
+
])], 8, ce)) : p("v-if", !0)
|
|
346
349
|
])
|
|
347
|
-
])) :
|
|
348
|
-
t.$slots.default || t.content ? (b(),
|
|
350
|
+
])) : p("v-if", !0),
|
|
351
|
+
t.$slots.default || t.content ? (b(), y("div", ve, [
|
|
349
352
|
g(t.$slots, "default", {}, () => [
|
|
350
353
|
C(
|
|
351
354
|
w(t.content),
|
|
@@ -353,8 +356,8 @@ const ne = {
|
|
|
353
356
|
/* TEXT */
|
|
354
357
|
)
|
|
355
358
|
])
|
|
356
|
-
])) :
|
|
357
|
-
t.$slots.footer || t.footer ? (b(),
|
|
359
|
+
])) : p("v-if", !0),
|
|
360
|
+
t.$slots.footer || t.footer ? (b(), y("div", fe, [
|
|
358
361
|
g(t.$slots, "footer", {}, () => [
|
|
359
362
|
C(
|
|
360
363
|
w(t.footer),
|
|
@@ -362,7 +365,7 @@ const ne = {
|
|
|
362
365
|
/* TEXT */
|
|
363
366
|
)
|
|
364
367
|
])
|
|
365
|
-
])) :
|
|
368
|
+
])) : p("v-if", !0)
|
|
366
369
|
],
|
|
367
370
|
16
|
|
368
371
|
/* FULL_PROPS */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],m):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAlert=m(e.vue,e.vue$1))})(this,(function(e,m){"use strict";var b=(t=>(t.local="local",t.session="session",t))(b||{}),g=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(g||{}),y=(t=>(t.before="before",t.after="after",t))(y||{}),v=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(v||{}),$=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))($||{}),C=(t=>(t.alert="alert",t.alertdialog="alertdialog",t))(C||{});const w=Symbol.for("volver"),V=Symbol.for("alertGroup"),B={prefix:"normal"},E={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:y.before,validation:t=>Object.values(y).includes(t)}},N={id:[String,Number]};g.bottom,v.button,$.button,b.local;function L(){return e.inject(V,{})}function T(t){return e.computed(()=>String(t?.value||e.useId()))}function P(t,n){const s=e.computed(()=>typeof t?.value=="string"?{name:t?.value}:t?.value),a=e.computed(()=>n?.value===y.before?s.value:void 0),i=e.computed(()=>n?.value===y.after?s.value:void 0),r=e.computed(()=>n?.value===g.left?s.value:void 0),p=e.computed(()=>n?.value===g.right?s.value:void 0),c=e.computed(()=>n?.value===g.top?s.value:void 0),u=e.computed(()=>n?.value===g.bottom?s.value:void 0);return{hasIcon:s,hasIconLeft:r,hasIconRight:p,hasIconTop:c,hasIconBottom:u,hasIconBefore:a,hasIconAfter:i}}function k(t,n,s){return e.computed(()=>{const a={[t]:!0},i=typeof n?.value=="string"?n.value.split(" "):n?.value;return i&&Array.isArray(i)&&i.forEach(r=>{r&&(a[`${t}--${r}`]=!0)}),s&&Object.keys(s.value).forEach(r=>{a[`${t}--${r}`]=e.unref(s.value[r])}),a})}const D={...N,...E,modifiers:{type:[String,Array],default:void 0},dismissable:{type:Boolean,default:!1},autoClose:{type:Number,default:0},closeLabel:{type:String,default:"Close"},title:{type:String,default:void 0},content:{type:String,default:void 0},footer:{type:String,default:void 0},role:{type:String,default:C.alert}},F=["close"];function O(t,n){const{bus:s}=L(),a=T(e.computed(()=>t.id)),i=e.computed(()=>`${a.value}-title`);let r;const p=()=>{r&&clearTimeout(r),n("close",a.value),s?.emit("close",a.value)};e.watch(()=>t.autoClose,f=>{if(f>0){r=setTimeout(p,f);return}r&&clearTimeout(r)},{immediate:!0});const c=e.ref(!1),u=()=>{c.value=!0,r&&clearTimeout(r)},o=()=>{c.value=!1,t.autoClose>0&&(r=setTimeout(p,t.autoClose))},{hasIcon:h}=P(e.computed(()=>t.icon)),l=k("vv-alert",e.computed(()=>t.modifiers),e.computed(()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:c.value}))),d=e.computed(()=>({"--alert-duration":`${t.autoClose}ms`}));return{close:p,hasIcon:h,hasTitleId:i,hasProps:e.computed(()=>({onMouseover:u,onMouseleave:o,class:l.value,style:d.value,role:t.role,"aria-labelledby":i.value}))}}function M(){return e.inject(w,void 0)}const j={name:"VvIcon"},A=e.defineComponent({...j,props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},B),setup(t){const n=t,s=e.computed(()=>typeof n.rotate=="string"?Number.parseFloat(n.rotate):n.rotate),a=e.ref(!0),i=M(),{modifiers:r}=e.toRefs(n),p=k("vv-icon",r),c=e.computed(()=>n.provider||i?.iconsProvider),u=e.computed(()=>{const l=n.name??"",d=`@${c.value}:${n.prefix}:${l}`;if(m.iconLoaded(d))return d;const f=i?.iconsCollections.find(I=>{const S=`@${c.value}:${I.prefix}:${l}`;return m.iconLoaded(S)});return f?`@${c.value}:${f.prefix}:${l}`:l});function o(l){let d;if(typeof window>"u")try{const{JSDOM:U}=require("jsdom");d=new U().window}catch{}const f=d?new d.DOMParser:typeof window<"u"?new window.DOMParser:null;return f?f.parseFromString(l,"text/html").querySelector("svg"):void 0}function h(l){const d=o(l),f=d?.innerHTML.trim()||"";d&&f&&m.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:f,height:d.viewBox.baseVal.height,width:d.viewBox.baseVal.width})}return i&&n.src&&!m.iconLoaded(`@${c.value}:${n.prefix}:${n.name}`)&&(a.value=!1,i.fetchIcon(n.src).then(l=>{l&&h(l),a.value=!0}).catch(l=>{throw a.value=!0,new Error(`Error during fetch icon: ${l?.message}`)})),n.svg&&h(n.svg),(l,d)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(m.Icon),e.mergeProps({key:0,class:e.unref(p)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(s),color:t.color,icon:e.unref(u)},{onLoad:t.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}}),R={key:0,class:"vv-alert__header"},q=["id"],z=["aria-label"],G={key:1,class:"vv-alert__content"},J={key:2,class:"vv-alert__footer"},K={name:"VvAlert"};return e.defineComponent({...K,props:D,emits:F,setup(t,{expose:n,emit:s}){const a=t,i=s,{hasProps:r,hasTitleId:p,hasIcon:c,close:u}=O(a,i);return n({close:u}),(o,h)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(r))),[o.$slots.header||o.$slots.title||o.$slots.close||o.$slots["title::before"]||o.$slots["title::after"]||o.title||e.unref(c)||o.dismissable||o.autoClose?(e.openBlock(),e.createElementBlock("div",R,[e.unref(c)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:0},e.unref(c),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.renderSlot(o.$slots,"header",{},()=>[e.renderSlot(o.$slots,"title::before"),o.$slots.title||o.title?(e.openBlock(),e.createElementBlock("strong",{key:0,id:e.unref(p),class:"vv-alert__title"},[e.renderSlot(o.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],8,q)):e.createCommentVNode("v-if",!0),e.renderSlot(o.$slots,"title::after")]),e.renderSlot(o.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(u)})),()=>[o.dismissable||o.autoClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vv-alert__close",type:"button","aria-label":o.closeLabel,onClick:h[0]||(h[0]=e.withModifiers((...l)=>e.unref(u)&&e.unref(u)(...l),["stop"]))},[...h[1]||(h[1]=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)])],8,z)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),o.$slots.default||o.content?(e.openBlock(),e.createElementBlock("div",G,[e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.content),1)])])):e.createCommentVNode("v-if",!0),o.$slots.footer||o.footer?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(o.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(o.footer),1)])])):e.createCommentVNode("v-if",!0)],16))}})}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { provide as j, computed as l, unref as c, inject as B, useId as q, watch as z, ref as F, defineComponent as L, mergeDefaults as H, toRefs as J, createBlock as A, createCommentVNode as $, openBlock as
|
|
1
|
+
import { provide as j, computed as l, unref as c, inject as B, useId as q, watch as z, ref as F, defineComponent as L, mergeDefaults as H, toRefs as J, createBlock as A, createCommentVNode as $, openBlock as b, mergeProps as C, createElementBlock as y, normalizeProps as E, guardReactiveProps as V, renderSlot as h, createTextVNode as I, toDisplayString as w, withModifiers as K, createElementVNode as U, createVNode as Y, TransitionGroup as Q, toHandlers as W, withCtx as X, Fragment as Z, renderList as x } from "vue";
|
|
2
2
|
import ee from "mitt";
|
|
3
|
-
import { iconLoaded as
|
|
3
|
+
import { iconLoaded as S, Icon as te, addIcon as oe } from "@iconify/vue";
|
|
4
4
|
const re = {
|
|
5
5
|
prefix: "normal"
|
|
6
6
|
/* normal */
|
|
@@ -253,9 +253,9 @@ function ge(e, t) {
|
|
|
253
253
|
};
|
|
254
254
|
z(
|
|
255
255
|
() => e.autoClose,
|
|
256
|
-
(
|
|
257
|
-
if (
|
|
258
|
-
n = setTimeout(f,
|
|
256
|
+
(m) => {
|
|
257
|
+
if (m > 0) {
|
|
258
|
+
n = setTimeout(f, m);
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
n && clearTimeout(n);
|
|
@@ -268,7 +268,7 @@ function ge(e, t) {
|
|
|
268
268
|
s.value = !0, n && clearTimeout(n);
|
|
269
269
|
}, o = () => {
|
|
270
270
|
s.value = !1, e.autoClose > 0 && (n = setTimeout(f, e.autoClose));
|
|
271
|
-
}, { hasIcon:
|
|
271
|
+
}, { hasIcon: g } = me(l(() => e.icon)), u = P(
|
|
272
272
|
"vv-alert",
|
|
273
273
|
l(() => e.modifiers),
|
|
274
274
|
l(() => ({
|
|
@@ -281,7 +281,7 @@ function ge(e, t) {
|
|
|
281
281
|
}));
|
|
282
282
|
return {
|
|
283
283
|
close: f,
|
|
284
|
-
hasIcon:
|
|
284
|
+
hasIcon: g,
|
|
285
285
|
hasTitleId: i,
|
|
286
286
|
hasProps: l(() => ({
|
|
287
287
|
onMouseover: d,
|
|
@@ -321,38 +321,41 @@ const $e = {
|
|
|
321
321
|
setup(e) {
|
|
322
322
|
const t = e, a = l(() => typeof t.rotate == "string" ? Number.parseFloat(t.rotate) : t.rotate), r = F(!0), i = ye(), { modifiers: n } = J(t), f = P("vv-icon", n), s = l(() => t.provider || i?.iconsProvider), d = l(() => {
|
|
323
323
|
const u = t.name ?? "", v = `@${s.value}:${t.prefix}:${u}`;
|
|
324
|
-
if (
|
|
324
|
+
if (S(v))
|
|
325
325
|
return v;
|
|
326
|
-
const
|
|
326
|
+
const m = i?.iconsCollections.find(
|
|
327
327
|
(T) => {
|
|
328
328
|
const N = `@${s.value}:${T.prefix}:${u}`;
|
|
329
|
-
return
|
|
329
|
+
return S(N);
|
|
330
330
|
}
|
|
331
331
|
);
|
|
332
|
-
return
|
|
332
|
+
return m ? `@${s.value}:${m.prefix}:${u}` : u;
|
|
333
333
|
});
|
|
334
334
|
function o(u) {
|
|
335
335
|
let v;
|
|
336
|
-
if (typeof window > "u")
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
if (typeof window > "u")
|
|
337
|
+
try {
|
|
338
|
+
const { JSDOM: _ } = require("jsdom");
|
|
339
|
+
v = new _().window;
|
|
340
|
+
} catch {
|
|
341
|
+
}
|
|
342
|
+
const m = v ? new v.DOMParser() : typeof window < "u" ? new window.DOMParser() : null;
|
|
343
|
+
return m ? m.parseFromString(u, "text/html").querySelector("svg") : void 0;
|
|
341
344
|
}
|
|
342
|
-
function
|
|
343
|
-
const v = o(u),
|
|
344
|
-
v &&
|
|
345
|
-
body:
|
|
345
|
+
function g(u) {
|
|
346
|
+
const v = o(u), m = v?.innerHTML.trim() || "";
|
|
347
|
+
v && m && oe(`@${s.value}:${t.prefix}:${t.name}`, {
|
|
348
|
+
body: m,
|
|
346
349
|
// Set height and width from svg content
|
|
347
350
|
height: v.viewBox.baseVal.height,
|
|
348
351
|
width: v.viewBox.baseVal.width
|
|
349
352
|
});
|
|
350
353
|
}
|
|
351
|
-
return i && t.src && !
|
|
352
|
-
u && (
|
|
354
|
+
return i && t.src && !S(`@${s.value}:${t.prefix}:${t.name}`) && (r.value = !1, i.fetchIcon(t.src).then((u) => {
|
|
355
|
+
u && g(u), r.value = !0;
|
|
353
356
|
}).catch((u) => {
|
|
354
|
-
throw new Error(`Error during fetch icon: ${u?.message}`);
|
|
355
|
-
})), t.svg &&
|
|
357
|
+
throw r.value = !0, new Error(`Error during fetch icon: ${u?.message}`);
|
|
358
|
+
})), t.svg && g(t.svg), (u, v) => c(r) ? (b(), A(c(te), C({
|
|
356
359
|
key: 0,
|
|
357
360
|
class: c(f)
|
|
358
361
|
}, {
|
|
@@ -370,10 +373,10 @@ const $e = {
|
|
|
370
373
|
}), ke = {
|
|
371
374
|
key: 0,
|
|
372
375
|
class: "vv-alert__header"
|
|
373
|
-
}, Ce = ["id"], Ie = ["aria-label"],
|
|
376
|
+
}, Ce = ["id"], Ie = ["aria-label"], we = {
|
|
374
377
|
key: 1,
|
|
375
378
|
class: "vv-alert__content"
|
|
376
|
-
},
|
|
379
|
+
}, Se = {
|
|
377
380
|
key: 2,
|
|
378
381
|
class: "vv-alert__footer"
|
|
379
382
|
}, Ee = {
|
|
@@ -387,47 +390,47 @@ const $e = {
|
|
|
387
390
|
return t({
|
|
388
391
|
/** Close the alert */
|
|
389
392
|
close: d
|
|
390
|
-
}), (o,
|
|
393
|
+
}), (o, g) => (b(), y(
|
|
391
394
|
"div",
|
|
392
395
|
E(V(c(n))),
|
|
393
396
|
[
|
|
394
|
-
o.$slots.header || o.$slots.title || o.$slots.close || o.$slots["title::before"] || o.$slots["title::after"] || o.title || c(s) || o.dismissable || o.autoClose ? (
|
|
395
|
-
c(s) ? (
|
|
397
|
+
o.$slots.header || o.$slots.title || o.$slots.close || o.$slots["title::before"] || o.$slots["title::after"] || o.title || c(s) || o.dismissable || o.autoClose ? (b(), y("div", ke, [
|
|
398
|
+
c(s) ? (b(), A(
|
|
396
399
|
pe,
|
|
397
400
|
C({ key: 0 }, c(s), { class: "vv-alert__icon" }),
|
|
398
401
|
null,
|
|
399
402
|
16
|
|
400
403
|
/* FULL_PROPS */
|
|
401
404
|
)) : $("v-if", !0),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
o.$slots.title || o.title ? (
|
|
405
|
+
h(o.$slots, "header", {}, () => [
|
|
406
|
+
h(o.$slots, "title::before"),
|
|
407
|
+
o.$slots.title || o.title ? (b(), y("strong", {
|
|
405
408
|
key: 0,
|
|
406
409
|
id: c(f),
|
|
407
410
|
class: "vv-alert__title"
|
|
408
411
|
}, [
|
|
409
|
-
|
|
412
|
+
h(o.$slots, "title", {}, () => [
|
|
410
413
|
I(
|
|
411
|
-
|
|
414
|
+
w(o.title),
|
|
412
415
|
1
|
|
413
416
|
/* TEXT */
|
|
414
417
|
)
|
|
415
418
|
])
|
|
416
419
|
], 8, Ce)) : $("v-if", !0),
|
|
417
|
-
|
|
420
|
+
h(o.$slots, "title::after")
|
|
418
421
|
]),
|
|
419
|
-
|
|
420
|
-
o.dismissable || o.autoClose ? (
|
|
422
|
+
h(o.$slots, "close", E(V({ close: c(d) })), () => [
|
|
423
|
+
o.dismissable || o.autoClose ? (b(), y("button", {
|
|
421
424
|
key: 0,
|
|
422
425
|
class: "vv-alert__close",
|
|
423
426
|
type: "button",
|
|
424
427
|
"aria-label": o.closeLabel,
|
|
425
|
-
onClick:
|
|
428
|
+
onClick: g[0] || (g[0] = K(
|
|
426
429
|
//@ts-ignore
|
|
427
430
|
(...u) => c(d) && c(d)(...u),
|
|
428
431
|
["stop"]
|
|
429
432
|
))
|
|
430
|
-
}, [...
|
|
433
|
+
}, [...g[1] || (g[1] = [
|
|
431
434
|
U(
|
|
432
435
|
"div",
|
|
433
436
|
{ class: "vv-alert__close-mask" },
|
|
@@ -438,19 +441,19 @@ const $e = {
|
|
|
438
441
|
])], 8, Ie)) : $("v-if", !0)
|
|
439
442
|
])
|
|
440
443
|
])) : $("v-if", !0),
|
|
441
|
-
o.$slots.default || o.content ? (
|
|
442
|
-
|
|
444
|
+
o.$slots.default || o.content ? (b(), y("div", we, [
|
|
445
|
+
h(o.$slots, "default", {}, () => [
|
|
443
446
|
I(
|
|
444
|
-
|
|
447
|
+
w(o.content),
|
|
445
448
|
1
|
|
446
449
|
/* TEXT */
|
|
447
450
|
)
|
|
448
451
|
])
|
|
449
452
|
])) : $("v-if", !0),
|
|
450
|
-
o.$slots.footer || o.footer ? (
|
|
451
|
-
|
|
453
|
+
o.$slots.footer || o.footer ? (b(), y("div", Se, [
|
|
454
|
+
h(o.$slots, "footer", {}, () => [
|
|
452
455
|
I(
|
|
453
|
-
|
|
456
|
+
w(o.footer),
|
|
454
457
|
1
|
|
455
458
|
/* TEXT */
|
|
456
459
|
)
|
|
@@ -494,11 +497,11 @@ const $e = {
|
|
|
494
497
|
r("leaveCancelled");
|
|
495
498
|
}
|
|
496
499
|
};
|
|
497
|
-
return (s, d) => (
|
|
500
|
+
return (s, d) => (b(), y(
|
|
498
501
|
"div",
|
|
499
502
|
E(V(c(i))),
|
|
500
503
|
[
|
|
501
|
-
|
|
504
|
+
h(s.$slots, "before"),
|
|
502
505
|
Y(Q, C({
|
|
503
506
|
tag: "div",
|
|
504
507
|
role: "group",
|
|
@@ -506,11 +509,11 @@ const $e = {
|
|
|
506
509
|
class: "vv-alert-group__list"
|
|
507
510
|
}, W(f)), {
|
|
508
511
|
default: X(() => [
|
|
509
|
-
|
|
510
|
-
(
|
|
512
|
+
h(s.$slots, "default", {}, () => [
|
|
513
|
+
(b(!0), y(
|
|
511
514
|
Z,
|
|
512
515
|
null,
|
|
513
|
-
x(s.items, (o) => (
|
|
516
|
+
x(s.items, (o) => (b(), A(
|
|
514
517
|
Ve,
|
|
515
518
|
C({ ref_for: !0 }, o, {
|
|
516
519
|
key: o.id
|
|
@@ -527,7 +530,7 @@ const $e = {
|
|
|
527
530
|
_: 3
|
|
528
531
|
/* FORWARDED */
|
|
529
532
|
}, 16, ["name"]),
|
|
530
|
-
|
|
533
|
+
h(s.$slots, "after")
|
|
531
534
|
],
|
|
532
535
|
16
|
|
533
536
|
/* FULL_PROPS */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("vue"),require("mitt"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","mitt","@iconify/vue"],b):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAlertGroup=b(e.vue,e.mitt,e.vue$1))})(this,(function(e,b,v){"use strict";const I={prefix:"normal"};var k=(t=>(t.local="local",t.session="session",t))(k||{}),h=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(h||{}),g=(t=>(t.before="before",t.after="after",t))(g||{}),$=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))($||{}),C=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(C||{}),S=(t=>(t.alert="alert",t.alertdialog="alertdialog",t))(S||{});const w=Symbol.for("volver"),B=Symbol.for("alertGroup"),P={modifiers:{type:[String,Array],default:void 0}},L={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:g.before,validation:t=>Object.values(g).includes(t)}},N={id:[String,Number]};h.bottom,$.button,C.button,k.local;function T({name:t}){const o=b();return e.provide(B,{name:t,bus:o}),o}function y(t,o,a){return e.computed(()=>{const n={[t]:!0},i=typeof o?.value=="string"?o.value.split(" "):o?.value;return i&&Array.isArray(i)&&i.forEach(l=>{l&&(n[`${t}--${l}`]=!0)}),a&&Object.keys(a.value).forEach(l=>{n[`${t}--${l}`]=e.unref(a.value[l])}),n})}const A={...P,name:{type:String,required:!0},items:{type:Array,default:()=>[]},stack:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},inline:{type:String,default:void 0},block:{type:String,default:void 0},position:{type:String,default:void 0},transition:{type:String,default:void 0}},G=["close","beforeEnter","afterLeave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"];function F(t,o){const a=T({name:e.computed(()=>t.name)});(t.block&&!t.inline||!t.block&&t.inline)&&console.warn("[VvAlertGroup]: block and inline props must coexist at the same time.");const n=e.computed(()=>{const l=[y("vv-alert-group",e.computed(()=>t.modifiers),e.computed(()=>({stack:t.stack,reverse:t.reverse,absolute:t.position==="absolute",fixed:t.position==="fixed"}))).value];return t.inline&&t.block&&l.push(`vv-alert-group--${t.block}-${t.inline}`),l}),i=e.computed(()=>t.transition?t.transition:t.position?t.inline==="start"?"vv-alert--fade-inline-start":t.inline==="end"?"vv-alert--fade-inline-end":t.block==="top"?"vv-alert--fade-block-top":t.block==="bottom"?"vv-alert--fade-block-bottom":"vv-alert--fade":"vv-alert--fade");return a.on("close",l=>{o("close",l)}),{hasTransition:i,hasProps:e.computed(()=>({class:n.value}))}}function D(){return e.inject(B,{})}function M(t){return e.computed(()=>String(t?.value||e.useId()))}function O(t,o){const a=e.computed(()=>typeof t?.value=="string"?{name:t?.value}:t?.value),n=e.computed(()=>o?.value===g.before?a.value:void 0),i=e.computed(()=>o?.value===g.after?a.value:void 0),l=e.computed(()=>o?.value===h.left?a.value:void 0),f=e.computed(()=>o?.value===h.right?a.value:void 0),s=e.computed(()=>o?.value===h.top?a.value:void 0),u=e.computed(()=>o?.value===h.bottom?a.value:void 0);return{hasIcon:a,hasIconLeft:l,hasIconRight:f,hasIconTop:s,hasIconBottom:u,hasIconBefore:n,hasIconAfter:i}}const R={...N,...L,modifiers:{type:[String,Array],default:void 0},dismissable:{type:Boolean,default:!1},autoClose:{type:Number,default:0},closeLabel:{type:String,default:"Close"},title:{type:String,default:void 0},content:{type:String,default:void 0},footer:{type:String,default:void 0},role:{type:String,default:S.alert}},j=["close"];function _(t,o){const{bus:a}=D(),n=M(e.computed(()=>t.id)),i=e.computed(()=>`${n.value}-title`);let l;const f=()=>{l&&clearTimeout(l),o("close",n.value),a?.emit("close",n.value)};e.watch(()=>t.autoClose,
|
|
1
|
+
(function(e,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("vue"),require("mitt"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","mitt","@iconify/vue"],b):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAlertGroup=b(e.vue,e.mitt,e.vue$1))})(this,(function(e,b,v){"use strict";const I={prefix:"normal"};var k=(t=>(t.local="local",t.session="session",t))(k||{}),h=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(h||{}),g=(t=>(t.before="before",t.after="after",t))(g||{}),$=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))($||{}),C=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(C||{}),S=(t=>(t.alert="alert",t.alertdialog="alertdialog",t))(S||{});const w=Symbol.for("volver"),B=Symbol.for("alertGroup"),P={modifiers:{type:[String,Array],default:void 0}},L={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:g.before,validation:t=>Object.values(g).includes(t)}},N={id:[String,Number]};h.bottom,$.button,C.button,k.local;function T({name:t}){const o=b();return e.provide(B,{name:t,bus:o}),o}function y(t,o,a){return e.computed(()=>{const n={[t]:!0},i=typeof o?.value=="string"?o.value.split(" "):o?.value;return i&&Array.isArray(i)&&i.forEach(l=>{l&&(n[`${t}--${l}`]=!0)}),a&&Object.keys(a.value).forEach(l=>{n[`${t}--${l}`]=e.unref(a.value[l])}),n})}const A={...P,name:{type:String,required:!0},items:{type:Array,default:()=>[]},stack:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},inline:{type:String,default:void 0},block:{type:String,default:void 0},position:{type:String,default:void 0},transition:{type:String,default:void 0}},G=["close","beforeEnter","afterLeave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"];function F(t,o){const a=T({name:e.computed(()=>t.name)});(t.block&&!t.inline||!t.block&&t.inline)&&console.warn("[VvAlertGroup]: block and inline props must coexist at the same time.");const n=e.computed(()=>{const l=[y("vv-alert-group",e.computed(()=>t.modifiers),e.computed(()=>({stack:t.stack,reverse:t.reverse,absolute:t.position==="absolute",fixed:t.position==="fixed"}))).value];return t.inline&&t.block&&l.push(`vv-alert-group--${t.block}-${t.inline}`),l}),i=e.computed(()=>t.transition?t.transition:t.position?t.inline==="start"?"vv-alert--fade-inline-start":t.inline==="end"?"vv-alert--fade-inline-end":t.block==="top"?"vv-alert--fade-block-top":t.block==="bottom"?"vv-alert--fade-block-bottom":"vv-alert--fade":"vv-alert--fade");return a.on("close",l=>{o("close",l)}),{hasTransition:i,hasProps:e.computed(()=>({class:n.value}))}}function D(){return e.inject(B,{})}function M(t){return e.computed(()=>String(t?.value||e.useId()))}function O(t,o){const a=e.computed(()=>typeof t?.value=="string"?{name:t?.value}:t?.value),n=e.computed(()=>o?.value===g.before?a.value:void 0),i=e.computed(()=>o?.value===g.after?a.value:void 0),l=e.computed(()=>o?.value===h.left?a.value:void 0),f=e.computed(()=>o?.value===h.right?a.value:void 0),s=e.computed(()=>o?.value===h.top?a.value:void 0),u=e.computed(()=>o?.value===h.bottom?a.value:void 0);return{hasIcon:a,hasIconLeft:l,hasIconRight:f,hasIconTop:s,hasIconBottom:u,hasIconBefore:n,hasIconAfter:i}}const R={...N,...L,modifiers:{type:[String,Array],default:void 0},dismissable:{type:Boolean,default:!1},autoClose:{type:Number,default:0},closeLabel:{type:String,default:"Close"},title:{type:String,default:void 0},content:{type:String,default:void 0},footer:{type:String,default:void 0},role:{type:String,default:S.alert}},j=["close"];function _(t,o){const{bus:a}=D(),n=M(e.computed(()=>t.id)),i=e.computed(()=>`${n.value}-title`);let l;const f=()=>{l&&clearTimeout(l),o("close",n.value),a?.emit("close",n.value)};e.watch(()=>t.autoClose,m=>{if(m>0){l=setTimeout(f,m);return}l&&clearTimeout(l)},{immediate:!0});const s=e.ref(!1),u=()=>{s.value=!0,l&&clearTimeout(l)},r=()=>{s.value=!1,t.autoClose>0&&(l=setTimeout(f,t.autoClose))},{hasIcon:p}=O(e.computed(()=>t.icon)),c=y("vv-alert",e.computed(()=>t.modifiers),e.computed(()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:s.value}))),d=e.computed(()=>({"--alert-duration":`${t.autoClose}ms`}));return{close:f,hasIcon:p,hasTitleId:i,hasProps:e.computed(()=>({onMouseover:u,onMouseleave:r,class:c.value,style:d.value,role:t.role,"aria-labelledby":i.value}))}}function q(){return e.inject(w,void 0)}const z={name:"VvIcon"},H=e.defineComponent({...z,props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},I),setup(t){const o=t,a=e.computed(()=>typeof o.rotate=="string"?Number.parseFloat(o.rotate):o.rotate),n=e.ref(!0),i=q(),{modifiers:l}=e.toRefs(o),f=y("vv-icon",l),s=e.computed(()=>o.provider||i?.iconsProvider),u=e.computed(()=>{const c=o.name??"",d=`@${s.value}:${o.prefix}:${c}`;if(v.iconLoaded(d))return d;const m=i?.iconsCollections.find(V=>{const E=`@${s.value}:${V.prefix}:${c}`;return v.iconLoaded(E)});return m?`@${s.value}:${m.prefix}:${c}`:c});function r(c){let d;if(typeof window>"u")try{const{JSDOM:x}=require("jsdom");d=new x().window}catch{}const m=d?new d.DOMParser:typeof window<"u"?new window.DOMParser:null;return m?m.parseFromString(c,"text/html").querySelector("svg"):void 0}function p(c){const d=r(c),m=d?.innerHTML.trim()||"";d&&m&&v.addIcon(`@${s.value}:${o.prefix}:${o.name}`,{body:m,height:d.viewBox.baseVal.height,width:d.viewBox.baseVal.width})}return i&&o.src&&!v.iconLoaded(`@${s.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then(c=>{c&&p(c),n.value=!0}).catch(c=>{throw n.value=!0,new Error(`Error during fetch icon: ${c?.message}`)})),o.svg&&p(o.svg),(c,d)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(v.Icon),e.mergeProps({key:0,class:e.unref(f)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,icon:e.unref(u)},{onLoad:t.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}}),J={key:0,class:"vv-alert__header"},K=["id"],U=["aria-label"],Y={key:1,class:"vv-alert__content"},Q={key:2,class:"vv-alert__footer"},W={name:"VvAlert"},X=e.defineComponent({...W,props:R,emits:j,setup(t,{expose:o,emit:a}){const n=t,i=a,{hasProps:l,hasTitleId:f,hasIcon:s,close:u}=_(n,i);return o({close:u}),(r,p)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(l))),[r.$slots.header||r.$slots.title||r.$slots.close||r.$slots["title::before"]||r.$slots["title::after"]||r.title||e.unref(s)||r.dismissable||r.autoClose?(e.openBlock(),e.createElementBlock("div",J,[e.unref(s)?(e.openBlock(),e.createBlock(H,e.mergeProps({key:0},e.unref(s),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.renderSlot(r.$slots,"header",{},()=>[e.renderSlot(r.$slots,"title::before"),r.$slots.title||r.title?(e.openBlock(),e.createElementBlock("strong",{key:0,id:e.unref(f),class:"vv-alert__title"},[e.renderSlot(r.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(r.title),1)])],8,K)):e.createCommentVNode("v-if",!0),e.renderSlot(r.$slots,"title::after")]),e.renderSlot(r.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(u)})),()=>[r.dismissable||r.autoClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vv-alert__close",type:"button","aria-label":r.closeLabel,onClick:p[0]||(p[0]=e.withModifiers((...c)=>e.unref(u)&&e.unref(u)(...c),["stop"]))},[...p[1]||(p[1]=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)])],8,U)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),r.$slots.default||r.content?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.content),1)])])):e.createCommentVNode("v-if",!0),r.$slots.footer||r.footer?(e.openBlock(),e.createElementBlock("div",Q,[e.renderSlot(r.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(r.footer),1)])])):e.createCommentVNode("v-if",!0)],16))}}),Z={name:"VvAlertGroup"};return e.defineComponent({...Z,props:A,emits:G,setup(t,{emit:o}){const a=t,n=o,{hasProps:i,hasTransition:l}=F(a,n),f={"before-enter":()=>{n("beforeEnter")},"after-leave":()=>{n("afterLeave")},enter:()=>{n("enter")},"after-enter":()=>{n("afterEnter")},"enter-cancelled":()=>{n("enterCancelled")},"before-leave":()=>{n("beforeLeave")},leave:()=>{n("leave")},"leave-cancelled":()=>{n("leaveCancelled")}};return(s,u)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(i))),[e.renderSlot(s.$slots,"before"),e.createVNode(e.TransitionGroup,e.mergeProps({tag:"div",role:"group",name:e.unref(l),class:"vv-alert-group__list"},e.toHandlers(f)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,r=>(e.openBlock(),e.createBlock(X,e.mergeProps({ref_for:!0},r,{key:r.id}),null,16))),128))])]),_:3},16,["name"]),e.renderSlot(s.$slots,"after")],16))}})}));
|