@volverjs/ui-vue 0.0.14 → 0.0.15
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/Volver.d.ts +5 -5
- package/dist/components/VvAction/VvAction.es.js +26 -26
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/index.d.ts +1 -44
- package/dist/components/VvAlert/VvAlert.es.js +43 -44
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -55
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +34 -34
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +186 -187
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +215 -217
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +235 -237
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -78
- package/dist/components/VvCombobox/VvCombobox.es.js +810 -813
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +1 -1
- package/dist/components/VvCombobox/index.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdown.es.js +4 -4
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +50 -50
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -31
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +415 -418
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +595 -588
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +6 -6
- package/dist/components/VvInputText/index.d.ts +3 -3
- package/dist/components/VvNav/VvNav.es.js +63 -63
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +41 -41
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +222 -224
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +234 -236
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -78
- package/dist/components/VvSelect/VvSelect.es.js +200 -203
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +1 -1
- package/dist/components/VvSelect/index.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +35 -35
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +341 -344
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +1965 -1958
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +34 -34
- package/dist/composables/index.umd.js +2 -2
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/directives/index.es.js +22 -22
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +13 -13
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +19 -19
- package/dist/index.umd.js +1 -1
- package/dist/json-render/index.es.js +1877 -1870
- package/dist/json-render/index.umd.js +1 -1
- package/dist/props/index.d.ts +1 -1
- package/dist/resolvers/unplugin.es.js +28 -28
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/types/alert.d.ts +1 -1
- package/dist/types/nav.d.ts +1 -1
- package/dist/utils/ObjectUtilities.d.ts +0 -6
- package/package.json +1 -1
- package/src/Volver.ts +8 -6
- package/src/components/VvAction/index.ts +1 -3
- package/src/components/VvButton/VvButton.vue +1 -1
- package/src/components/VvCheckboxGroup/index.ts +1 -3
- package/src/components/VvCombobox/VvCombobox.vue +3 -3
- package/src/components/VvDropdown/VvDropdown.vue +8 -8
- package/src/components/VvIcon/VvIcon.vue +3 -6
- package/src/components/VvInputFile/VvInputFile.vue +6 -6
- package/src/components/VvInputText/VvInputText.vue +95 -78
- package/src/components/VvRadioGroup/index.ts +1 -3
- package/src/composables/useBlurhash.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useDefaults.ts +55 -44
- package/src/composables/useModifiers.ts +1 -1
- package/src/index.ts +2 -2
- package/src/resolvers/unplugin.ts +6 -6
- package/src/types/alert.ts +1 -1
- package/src/types/nav.ts +1 -1
- package/src/utils/DateUtilities.ts +3 -3
- package/src/utils/DomUtilities.ts +7 -1
- package/src/utils/ObjectUtilities.ts +60 -59
package/dist/Volver.d.ts
CHANGED
|
@@ -101,11 +101,11 @@ export interface VolverInterface {
|
|
|
101
101
|
defaults: Ref<DefaultOptions>;
|
|
102
102
|
}
|
|
103
103
|
export declare class Volver implements VolverInterface {
|
|
104
|
-
private _fetchOptions;
|
|
105
|
-
private _iconsCollections;
|
|
106
|
-
private _iconsProvider;
|
|
107
|
-
private _nuxt;
|
|
108
|
-
private _experimentalFeatures;
|
|
104
|
+
private readonly _fetchOptions;
|
|
105
|
+
private readonly _iconsCollections;
|
|
106
|
+
private readonly _iconsProvider;
|
|
107
|
+
private readonly _nuxt;
|
|
108
|
+
private readonly _experimentalFeatures;
|
|
109
109
|
defaults: Ref<DefaultOptions>;
|
|
110
110
|
constructor({ fetchWithCredentials, fetchOptions, iconsProvider, nuxt, iconsCollections, defaults, experimentalFeatures, }?: VolverOptions);
|
|
111
111
|
get nuxt(): boolean;
|
|
@@ -71,7 +71,7 @@ var X = {
|
|
|
71
71
|
} }, le = { current: {
|
|
72
72
|
type: Boolean,
|
|
73
73
|
default: !1
|
|
74
|
-
} },
|
|
74
|
+
} }, we = {
|
|
75
75
|
showClearAction: {
|
|
76
76
|
type: Boolean,
|
|
77
77
|
default: !1
|
|
@@ -144,7 +144,7 @@ var X = {
|
|
|
144
144
|
} }, fe = { floating: {
|
|
145
145
|
type: Boolean,
|
|
146
146
|
default: !1
|
|
147
|
-
} }, ve = { id: [String, Number] },
|
|
147
|
+
} }, ve = { id: [String, Number] }, Ce = {
|
|
148
148
|
placement: {
|
|
149
149
|
type: String,
|
|
150
150
|
default: B.bottom,
|
|
@@ -211,7 +211,7 @@ var X = {
|
|
|
211
211
|
} }, be = { autocomplete: {
|
|
212
212
|
type: String,
|
|
213
213
|
default: "off"
|
|
214
|
-
} },
|
|
214
|
+
} }, Ne = {
|
|
215
215
|
..._,
|
|
216
216
|
...ce,
|
|
217
217
|
...be,
|
|
@@ -241,7 +241,7 @@ var X = {
|
|
|
241
241
|
default: void 0
|
|
242
242
|
},
|
|
243
243
|
...C
|
|
244
|
-
},
|
|
244
|
+
}, _e = {
|
|
245
245
|
..._,
|
|
246
246
|
...N,
|
|
247
247
|
...v,
|
|
@@ -269,7 +269,7 @@ var X = {
|
|
|
269
269
|
],
|
|
270
270
|
default: void 0
|
|
271
271
|
}
|
|
272
|
-
},
|
|
272
|
+
}, Le = {
|
|
273
273
|
...v,
|
|
274
274
|
...c,
|
|
275
275
|
...ue,
|
|
@@ -318,7 +318,7 @@ var X = {
|
|
|
318
318
|
type: String,
|
|
319
319
|
default: o.button
|
|
320
320
|
}
|
|
321
|
-
},
|
|
321
|
+
}, je = {
|
|
322
322
|
storageType: {
|
|
323
323
|
type: String,
|
|
324
324
|
default: O.local,
|
|
@@ -329,28 +329,28 @@ var X = {
|
|
|
329
329
|
"click",
|
|
330
330
|
"mouseover",
|
|
331
331
|
"mouseleave"
|
|
332
|
-
]
|
|
333
|
-
function
|
|
332
|
+
];
|
|
333
|
+
function me() {
|
|
334
334
|
return f(te, void 0);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Se() {
|
|
337
337
|
return f(re, {});
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function Pe() {
|
|
340
340
|
return f(oe, {});
|
|
341
341
|
}
|
|
342
|
-
var
|
|
343
|
-
...
|
|
344
|
-
props:
|
|
342
|
+
var he = { name: "VvAction" }, Oe = /* @__PURE__ */ F({
|
|
343
|
+
...he,
|
|
344
|
+
props: ye,
|
|
345
345
|
emits: ge,
|
|
346
346
|
setup(e, { expose: L, emit: j }) {
|
|
347
|
-
const r = e, l = j, i = q(), I =
|
|
347
|
+
const r = e, l = j, i = q(), I = me(), u = W(null);
|
|
348
348
|
L({ $el: u });
|
|
349
|
-
const { reference: S, bus: d, aria:
|
|
349
|
+
const { reference: S, bus: d, aria: E, expanded: A } = Se();
|
|
350
350
|
Q(() => u.value, (t) => {
|
|
351
351
|
S && (S.value = t);
|
|
352
352
|
});
|
|
353
|
-
const P = s(() => r.pressed ||
|
|
353
|
+
const P = s(() => r.pressed || A?.value), { role: x } = Pe(), h = s(() => {
|
|
354
354
|
switch (!0) {
|
|
355
355
|
case r.disabled:
|
|
356
356
|
return o.button;
|
|
@@ -363,7 +363,7 @@ var Oe = { name: "VvAction" }, Be = /* @__PURE__ */ F({
|
|
|
363
363
|
}
|
|
364
364
|
}), D = s(() => {
|
|
365
365
|
const t = {
|
|
366
|
-
...
|
|
366
|
+
...E?.value,
|
|
367
367
|
ariaPressed: P.value ? !0 : void 0,
|
|
368
368
|
ariaLabel: r.ariaLabel,
|
|
369
369
|
role: x?.value
|
|
@@ -393,7 +393,7 @@ var Oe = { name: "VvAction" }, Be = /* @__PURE__ */ F({
|
|
|
393
393
|
return t;
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
|
-
function
|
|
396
|
+
function R(t) {
|
|
397
397
|
if (r.disabled) {
|
|
398
398
|
t.preventDefault();
|
|
399
399
|
return;
|
|
@@ -404,21 +404,21 @@ var Oe = { name: "VvAction" }, Be = /* @__PURE__ */ F({
|
|
|
404
404
|
}
|
|
405
405
|
d?.emit("click", t);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function T(t) {
|
|
408
408
|
if (i?.vnode.props?.onMouseover) {
|
|
409
409
|
l("mouseover", t);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
d?.emit("mouseover", t);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function V(t) {
|
|
415
415
|
if (i?.vnode.props?.onMouseleave) {
|
|
416
416
|
l("mouseleave", t);
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
419
|
d?.emit("mouseleave", t);
|
|
420
420
|
}
|
|
421
|
-
return (t,
|
|
421
|
+
return (t, Be) => (J(), K(z(p(h)), G(p(D), {
|
|
422
422
|
ref_key: "rootEl",
|
|
423
423
|
ref: u,
|
|
424
424
|
class: {
|
|
@@ -427,15 +427,15 @@ var Oe = { name: "VvAction" }, Be = /* @__PURE__ */ F({
|
|
|
427
427
|
disabled: t.disabled,
|
|
428
428
|
current: t.current
|
|
429
429
|
},
|
|
430
|
-
onClickPassive:
|
|
431
|
-
onMouseoverPassive:
|
|
432
|
-
onMouseleavePassive:
|
|
430
|
+
onClickPassive: R,
|
|
431
|
+
onMouseoverPassive: T,
|
|
432
|
+
onMouseleavePassive: V
|
|
433
433
|
}), {
|
|
434
434
|
default: U(() => [Y(t.$slots, "default", {}, () => [M(H(t.label), 1)])]),
|
|
435
435
|
_: 3
|
|
436
436
|
}, 16, ["class"]));
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), Ie = Oe;
|
|
439
439
|
export {
|
|
440
|
-
|
|
440
|
+
Ie as default
|
|
441
441
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(t=typeof globalThis<"u"?globalThis:t||self,t.VvAction=n(t.Vue))})(this,function(t){var n={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},m=(function(e){return e.local="local",e.session="session",e})({}),j=(function(e){return e.absolute="absolute",e.fixed="fixed",e})({}),S=(function(e){return e.left="left",e.right="right",e.top="top",e.bottom="bottom",e})({}),_=(function(e){return e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e})({}),P=(function(e){return e.before="before",e.after="after",e})({}),h=(function(e){return e.button="button",e.submit="submit",e.reset="reset",e})({}),a=(function(e){return e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e})({}),L=Symbol.for("volver"),
|
|
1
|
+
(function(t,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(t=typeof globalThis<"u"?globalThis:t||self,t.VvAction=n(t.Vue))})(this,function(t){var n={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},m=(function(e){return e.local="local",e.session="session",e})({}),j=(function(e){return e.absolute="absolute",e.fixed="fixed",e})({}),S=(function(e){return e.left="left",e.right="right",e.top="top",e.bottom="bottom",e})({}),_=(function(e){return e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e})({}),P=(function(e){return e.before="before",e.after="after",e})({}),h=(function(e){return e.button="button",e.submit="submit",e.reset="reset",e})({}),a=(function(e){return e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e})({}),L=Symbol.for("volver"),I=Symbol.for("dropdownTrigger"),A=Symbol.for("dropdownAction"),E={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},u={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},l={disabled:{type:Boolean,default:!1}},O={required:{type:Boolean,default:!1}},x={active:{type:Boolean,default:!1}},D={current:{type:Boolean,default:!1}},ue={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:n.clear},labelClear:{type:String,default:"Clear"}},T={pressed:{type:Boolean,default:!1}},i={label:{type:[String,Number],default:void 0}},f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},c={hintLabel:{type:String,default:""}},V={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},R={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},K={debounce:{type:[Number,String],default:void 0}},M={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:P.before,validation:e=>Object.values(P).includes(e)}},B={tabindex:{type:[String,Number],default:0}},q={floating:{type:Boolean,default:!1}},F={id:[String,Number]},se={placement:{type:String,default:S.bottom,validator:e=>Object.values(S).includes(e)||Object.values(_).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(j).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},k={...F,name:{type:String,required:!0}},G={autofocus:{type:Boolean,default:!1}},J={autocomplete:{type:String,default:"off"}},fe={...k,...G,...J,...B,...l,...f,...d,...u,...c,...s,...p,...R,...K,...M,...q,...i,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...O},pe={...k,...B,...d,...u,...c,...l,...f,...p,...i,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},ce={...d,...u,...V,...c,...l,...f,...p,...i,...s,...O,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},W={...l,...i,...T,...x,...D,...E,type:{type:String,default:h.button,validator:e=>Object.values(h).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},ve={storageType:{type:String,default:m.local,validator:e=>Object.values(m).includes(e)},storageKey:String},Y=["click","mouseover","mouseleave"];function $(){return(0,t.inject)(L,void 0)}function z(){return(0,t.inject)(I,{})}function H(){return(0,t.inject)(A,{})}var Q={name:"VvAction"},U=(0,t.defineComponent)({...Q,props:W,emits:Y,setup(e,{expose:Z,emit:ee}){const o=e,v=ee,b=(0,t.getCurrentInstance)(),te=$(),y=(0,t.ref)(null);Z({$el:y});const{reference:w,bus:g,aria:re,expanded:oe}=z();(0,t.watch)(()=>y.value,r=>{w&&(w.value=r)});const C=(0,t.computed)(()=>o.pressed||oe?.value),{role:ae}=H(),N=(0,t.computed)(()=>{switch(!0){case o.disabled:return a.button;case o.to!==void 0:return te?.nuxt?(0,t.resolveComponent)(a.nuxtLink):a.routerLink;case o.href!==void 0:return a.a;default:return o.defaultTag}}),ne=(0,t.computed)(()=>{const r={...re?.value,ariaPressed:C.value?!0:void 0,ariaLabel:o.ariaLabel,role:ae?.value};switch(N.value){case a.a:return{...r,href:o.href,target:o.target,rel:o.rel};case a.routerLink:case a.nuxtLink:return{...r,to:o.to,target:o.target};case a.button:return{...r,type:o.type,disabled:o.disabled};default:return r}});function le(r){if(o.disabled){r.preventDefault();return}if(b?.vnode.props?.onClick){v("click",r);return}g?.emit("click",r)}function ie(r){if(b?.vnode.props?.onMouseover){v("mouseover",r);return}g?.emit("mouseover",r)}function de(r){if(b?.vnode.props?.onMouseleave){v("mouseleave",r);return}g?.emit("mouseleave",r)}return(r,be)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(N)),(0,t.mergeProps)((0,t.unref)(ne),{ref_key:"rootEl",ref:y,class:{active:r.active,pressed:(0,t.unref)(C),disabled:r.disabled,current:r.current},onClickPassive:le,onMouseoverPassive:ie,onMouseleavePassive:de}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(r.$slots,"default",{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.label),1)])]),_:3},16,["class"]))}}),X=U;return X});
|
|
@@ -1,45 +1,2 @@
|
|
|
1
1
|
export declare const VvActionEvents: string[];
|
|
2
|
-
export
|
|
3
|
-
type: {
|
|
4
|
-
type: PropType<`${import("../../constants").ButtonType}`>;
|
|
5
|
-
default: import("../../constants").ButtonType;
|
|
6
|
-
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
7
|
-
};
|
|
8
|
-
ariaLabel: {
|
|
9
|
-
type: StringConstructor;
|
|
10
|
-
default: undefined;
|
|
11
|
-
};
|
|
12
|
-
defaultTag: {
|
|
13
|
-
type: StringConstructor;
|
|
14
|
-
default: import("../../constants").ActionTag;
|
|
15
|
-
};
|
|
16
|
-
to: {
|
|
17
|
-
type: (ObjectConstructor | StringConstructor)[];
|
|
18
|
-
};
|
|
19
|
-
href: StringConstructor;
|
|
20
|
-
target: StringConstructor;
|
|
21
|
-
rel: {
|
|
22
|
-
type: StringConstructor;
|
|
23
|
-
default: string;
|
|
24
|
-
};
|
|
25
|
-
current: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
default: boolean;
|
|
28
|
-
};
|
|
29
|
-
active: {
|
|
30
|
-
type: BooleanConstructor;
|
|
31
|
-
default: boolean;
|
|
32
|
-
};
|
|
33
|
-
pressed: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
|
-
label: {
|
|
38
|
-
type: (NumberConstructor | StringConstructor)[];
|
|
39
|
-
default: undefined;
|
|
40
|
-
};
|
|
41
|
-
disabled: {
|
|
42
|
-
type: BooleanConstructor;
|
|
43
|
-
default: boolean;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
2
|
+
export { ActionProps as VvActionProps } from '../../props';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed as r, createBlock as _, createCommentVNode as b, createElementBlock as g, createElementVNode as W, createTextVNode as
|
|
1
|
+
import { computed as r, createBlock as _, createCommentVNode as b, createElementBlock as g, createElementVNode as W, createTextVNode as I, defineComponent as R, guardReactiveProps as j, inject as D, mergeDefaults as Q, mergeProps as M, normalizeProps as E, onBeforeUnmount as X, openBlock as p, ref as q, renderSlot as y, toDisplayString as P, toRefs as Z, unref as u, useId as x, watch as ee, withModifiers as te } from "vue";
|
|
2
2
|
import { Icon as oe, addIcon as ae, iconLoaded as w } from "@iconify/vue";
|
|
3
|
-
var
|
|
3
|
+
var T = /* @__PURE__ */ (function(e) {
|
|
4
4
|
return e.local = "local", e.session = "session", e;
|
|
5
5
|
})({}), re = /* @__PURE__ */ (function(e) {
|
|
6
6
|
return e.absolute = "absolute", e.fixed = "fixed", e;
|
|
@@ -10,7 +10,7 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
10
10
|
return e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e;
|
|
11
11
|
})({}), $ = /* @__PURE__ */ (function(e) {
|
|
12
12
|
return e.before = "before", e.after = "after", e;
|
|
13
|
-
})({}),
|
|
13
|
+
})({}), F = /* @__PURE__ */ (function(e) {
|
|
14
14
|
return e.button = "button", e.submit = "submit", e.reset = "reset", e;
|
|
15
15
|
})({}), ne = /* @__PURE__ */ (function(e) {
|
|
16
16
|
return e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e;
|
|
@@ -90,7 +90,7 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
90
90
|
}, ye = { pressed: {
|
|
91
91
|
type: Boolean,
|
|
92
92
|
default: !1
|
|
93
|
-
} },
|
|
93
|
+
} }, B = { label: {
|
|
94
94
|
type: [String, Number],
|
|
95
95
|
default: void 0
|
|
96
96
|
} }, L = { readonly: {
|
|
@@ -230,7 +230,7 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
230
230
|
...me,
|
|
231
231
|
...z,
|
|
232
232
|
...he,
|
|
233
|
-
...
|
|
233
|
+
...B,
|
|
234
234
|
minlength: {
|
|
235
235
|
type: [String, Number],
|
|
236
236
|
default: void 0
|
|
@@ -253,7 +253,7 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
253
253
|
...C,
|
|
254
254
|
...L,
|
|
255
255
|
...V,
|
|
256
|
-
...
|
|
256
|
+
...B,
|
|
257
257
|
...k,
|
|
258
258
|
value: {
|
|
259
259
|
type: [
|
|
@@ -280,7 +280,7 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
280
280
|
...C,
|
|
281
281
|
...L,
|
|
282
282
|
...V,
|
|
283
|
-
...
|
|
283
|
+
...B,
|
|
284
284
|
...k,
|
|
285
285
|
...K,
|
|
286
286
|
modelValue: {
|
|
@@ -303,15 +303,15 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
303
303
|
}
|
|
304
304
|
}, He = {
|
|
305
305
|
...C,
|
|
306
|
-
...
|
|
306
|
+
...B,
|
|
307
307
|
...ye,
|
|
308
308
|
...ce,
|
|
309
309
|
...pe,
|
|
310
310
|
...ve,
|
|
311
311
|
type: {
|
|
312
312
|
type: String,
|
|
313
|
-
default:
|
|
314
|
-
validator: (e) => Object.values(
|
|
313
|
+
default: F.button,
|
|
314
|
+
validator: (e) => Object.values(F).includes(e)
|
|
315
315
|
},
|
|
316
316
|
ariaLabel: {
|
|
317
317
|
type: String,
|
|
@@ -324,18 +324,18 @@ var F = /* @__PURE__ */ (function(e) {
|
|
|
324
324
|
}, Je = {
|
|
325
325
|
storageType: {
|
|
326
326
|
type: String,
|
|
327
|
-
default:
|
|
328
|
-
validator: (e) => Object.values(
|
|
327
|
+
default: T.local,
|
|
328
|
+
validator: (e) => Object.values(T).includes(e)
|
|
329
329
|
},
|
|
330
330
|
storageKey: String
|
|
331
331
|
};
|
|
332
332
|
function Ce() {
|
|
333
333
|
return D(ue, {});
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Be(e) {
|
|
336
336
|
return r(() => String(e?.value || x()));
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Ie(e, o) {
|
|
339
339
|
const l = r(() => typeof e?.value == "string" ? { name: e?.value } : e?.value), n = r(() => o?.value === $.before ? l.value : void 0), s = r(() => o?.value === $.after ? l.value : void 0);
|
|
340
340
|
return {
|
|
341
341
|
hasIcon: l,
|
|
@@ -357,7 +357,7 @@ function J(e, o, l) {
|
|
|
357
357
|
}), n;
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
|
-
var
|
|
360
|
+
var Pe = {
|
|
361
361
|
...U,
|
|
362
362
|
...z,
|
|
363
363
|
modifiers: {
|
|
@@ -394,14 +394,14 @@ var Ie = {
|
|
|
394
394
|
}
|
|
395
395
|
}, we = ["close"];
|
|
396
396
|
function Oe(e, o) {
|
|
397
|
-
const { bus: l } = Ce(), n =
|
|
397
|
+
const { bus: l } = Ce(), n = Be(r(() => e.id)), s = r(() => `${n.value}-title`);
|
|
398
398
|
let a;
|
|
399
|
-
const
|
|
399
|
+
const d = () => {
|
|
400
400
|
a && clearTimeout(a), o("close", n.value), l?.emit("close", n.value);
|
|
401
401
|
};
|
|
402
402
|
ee(() => e.autoClose, (c) => {
|
|
403
403
|
if (c > 0) {
|
|
404
|
-
a = setTimeout(
|
|
404
|
+
a = setTimeout(d, c);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
a && clearTimeout(a);
|
|
@@ -411,21 +411,21 @@ function Oe(e, o) {
|
|
|
411
411
|
const t = q(!1), v = () => {
|
|
412
412
|
t.value = !0, a && clearTimeout(a);
|
|
413
413
|
}, h = () => {
|
|
414
|
-
t.value = !1, e.autoClose > 0 && (a = setTimeout(
|
|
415
|
-
}, { hasIcon: S } =
|
|
414
|
+
t.value = !1, e.autoClose > 0 && (a = setTimeout(d, e.autoClose));
|
|
415
|
+
}, { hasIcon: S } = Ie(r(() => e.icon)), i = J("vv-alert", r(() => e.modifiers), r(() => ({
|
|
416
416
|
dismissable: e.autoClose > 0 || e.dismissable,
|
|
417
417
|
"auto-close": e.autoClose > 0,
|
|
418
418
|
hover: t.value
|
|
419
|
-
}))),
|
|
419
|
+
}))), f = r(() => ({ "--alert-duration": `${e.autoClose}ms` }));
|
|
420
420
|
return {
|
|
421
|
-
close:
|
|
421
|
+
close: d,
|
|
422
422
|
hasIcon: S,
|
|
423
423
|
hasTitleId: s,
|
|
424
424
|
hasProps: r(() => ({
|
|
425
425
|
onMouseover: v,
|
|
426
426
|
onMouseleave: h,
|
|
427
427
|
class: i.value,
|
|
428
|
-
style:
|
|
428
|
+
style: f.value,
|
|
429
429
|
role: e.role,
|
|
430
430
|
"aria-labelledby": s.value
|
|
431
431
|
}))
|
|
@@ -455,31 +455,30 @@ var ke = { name: "VvIcon" }, Le = /* @__PURE__ */ R({
|
|
|
455
455
|
modifiers: {}
|
|
456
456
|
}, fe),
|
|
457
457
|
setup(e) {
|
|
458
|
-
const o = e, l = r(() => typeof o.rotate == "string" ? Number.parseFloat(o.rotate) : o.rotate), n = q(!0), s = Ne(), { modifiers: a } = Z(o),
|
|
459
|
-
const i = o.name ?? "",
|
|
460
|
-
if (w(
|
|
458
|
+
const o = e, l = r(() => typeof o.rotate == "string" ? Number.parseFloat(o.rotate) : o.rotate), n = q(!0), s = Ne(), { modifiers: a } = Z(o), d = J("vv-icon", a), t = r(() => o.provider || s?.iconsProvider), v = r(() => {
|
|
459
|
+
const i = o.name ?? "", f = `@${t.value}:${o.prefix}:${i}`;
|
|
460
|
+
if (w(f)) return f;
|
|
461
461
|
const c = s?.iconsCollections.find((Y) => w(`@${t.value}:${Y.prefix}:${i}`));
|
|
462
462
|
return c ? `@${t.value}:${c.prefix}:${i}` : i;
|
|
463
463
|
});
|
|
464
464
|
function h(i) {
|
|
465
|
-
|
|
466
|
-
return d ? d.parseFromString(i, "text/html").querySelector("svg") : null;
|
|
465
|
+
return globalThis.window === void 0 ? null : new globalThis.DOMParser().parseFromString(i, "text/html").querySelector("svg");
|
|
467
466
|
}
|
|
468
467
|
function S(i) {
|
|
469
|
-
const
|
|
470
|
-
|
|
468
|
+
const f = h(i), c = f?.innerHTML.trim() || "";
|
|
469
|
+
f && c && ae(`@${t.value}:${o.prefix}:${o.name}`, {
|
|
471
470
|
body: c,
|
|
472
|
-
height:
|
|
473
|
-
width:
|
|
471
|
+
height: f.viewBox.baseVal.height,
|
|
472
|
+
width: f.viewBox.baseVal.width
|
|
474
473
|
});
|
|
475
474
|
}
|
|
476
475
|
return s && o.src && !w(`@${t.value}:${o.prefix}:${o.name}`) && (n.value = !1, s.fetchIcon(o.src).then((i) => {
|
|
477
476
|
i && S(i), n.value = !0;
|
|
478
477
|
}).catch((i) => {
|
|
479
478
|
throw n.value = !0, new Error(`Error during fetch icon: ${i?.message}`);
|
|
480
|
-
})), o.svg && S(o.svg), (i,
|
|
479
|
+
})), o.svg && S(o.svg), (i, f) => u(n) ? (p(), _(u(oe), M({
|
|
481
480
|
key: 0,
|
|
482
|
-
class: u(
|
|
481
|
+
class: u(d)
|
|
483
482
|
}, {
|
|
484
483
|
inline: e.inline,
|
|
485
484
|
width: e.width,
|
|
@@ -495,19 +494,19 @@ var ke = { name: "VvIcon" }, Le = /* @__PURE__ */ R({
|
|
|
495
494
|
}), Ve = Le, Ae = {
|
|
496
495
|
key: 0,
|
|
497
496
|
class: "vv-alert__header"
|
|
498
|
-
}, je = ["id"], Ee = ["aria-label"],
|
|
497
|
+
}, je = ["id"], Ee = ["aria-label"], Te = {
|
|
499
498
|
key: 1,
|
|
500
499
|
class: "vv-alert__content"
|
|
501
|
-
},
|
|
500
|
+
}, Fe = {
|
|
502
501
|
key: 2,
|
|
503
502
|
class: "vv-alert__footer"
|
|
504
503
|
}, _e = { name: "VvAlert" }, Re = /* @__PURE__ */ R({
|
|
505
504
|
..._e,
|
|
506
|
-
props:
|
|
505
|
+
props: Pe,
|
|
507
506
|
emits: we,
|
|
508
507
|
setup(e, { expose: o, emit: l }) {
|
|
509
|
-
const { hasProps: n, hasTitleId: s, hasIcon: a, close:
|
|
510
|
-
return o({ close:
|
|
508
|
+
const { hasProps: n, hasTitleId: s, hasIcon: a, close: d } = Oe(e, l);
|
|
509
|
+
return o({ close: d }), (t, v) => (p(), g("div", E(j(u(n))), [
|
|
511
510
|
t.$slots.header || t.$slots.title || t.$slots.close || t.$slots["title::before"] || t.$slots["title::after"] || t.title || u(a) || t.dismissable || t.autoClose ? (p(), g("div", Ae, [
|
|
512
511
|
u(a) ? (p(), _(Ve, M({ key: 0 }, u(a), { class: "vv-alert__icon" }), null, 16)) : b("v-if", !0),
|
|
513
512
|
y(t.$slots, "header", {}, () => [
|
|
@@ -516,19 +515,19 @@ var ke = { name: "VvIcon" }, Le = /* @__PURE__ */ R({
|
|
|
516
515
|
key: 0,
|
|
517
516
|
id: u(s),
|
|
518
517
|
class: "vv-alert__title"
|
|
519
|
-
}, [y(t.$slots, "title", {}, () => [
|
|
518
|
+
}, [y(t.$slots, "title", {}, () => [I(P(t.title), 1)])], 8, je)) : b("v-if", !0),
|
|
520
519
|
y(t.$slots, "title::after")
|
|
521
520
|
]),
|
|
522
|
-
y(t.$slots, "close", E(j({ close: u(
|
|
521
|
+
y(t.$slots, "close", E(j({ close: u(d) })), () => [t.dismissable || t.autoClose ? (p(), g("button", {
|
|
523
522
|
key: 0,
|
|
524
523
|
class: "vv-alert__close",
|
|
525
524
|
type: "button",
|
|
526
525
|
"aria-label": t.closeLabel,
|
|
527
|
-
onClick: v[0] || (v[0] = te((...h) => u(
|
|
526
|
+
onClick: v[0] || (v[0] = te((...h) => u(d) && u(d)(...h), ["stop"]))
|
|
528
527
|
}, [...v[1] || (v[1] = [W("div", { class: "vv-alert__close-mask" }, null, -1)])], 8, Ee)) : b("v-if", !0)])
|
|
529
528
|
])) : b("v-if", !0),
|
|
530
|
-
t.$slots.default || t.content ? (p(), g("div",
|
|
531
|
-
t.$slots.footer || t.footer ? (p(), g("div",
|
|
529
|
+
t.$slots.default || t.content ? (p(), g("div", Te, [y(t.$slots, "default", {}, () => [I(P(t.content), 1)])])) : b("v-if", !0),
|
|
530
|
+
t.$slots.footer || t.footer ? (p(), g("div", Fe, [y(t.$slots, "footer", {}, () => [I(P(t.footer), 1)])])) : b("v-if", !0)
|
|
532
531
|
], 16));
|
|
533
532
|
}
|
|
534
533
|
}), Ye = Re;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,f){typeof exports=="object"&&typeof module<"u"?module.exports=f(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],f):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAlert=f(e.Vue,e.IconifyVue))})(this,function(e,f){var I=(function(t){return t.local="local",t.session="session",t})({}),j=(function(t){return t.absolute="absolute",t.fixed="fixed",t})({}),m=(function(t){return t.left="left",t.right="right",t.top="top",t.bottom="bottom",t})({}),T=(function(t){return t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t})({}),y=(function(t){return t.before="before",t.after="after",t})({}),N=(function(t){return t.button="button",t.submit="submit",t.reset="reset",t})({}),F=(function(t){return t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t})({}),R=(function(t){return t.alert="alert",t.alertdialog="alertdialog",t})({}),D=Symbol.for("volver"),q=Symbol.for("alertGroup"),M={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},z={prefix:"normal"},K={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},S={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},B={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},C={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},V={required:{type:Boolean,default:!1}},_={active:{type:Boolean,default:!1}},G={current:{type:Boolean,default:!1}},ge={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:M.clear},labelClear:{type:String,default:"Clear"}},U={pressed:{type:Boolean,default:!1}},b={label:{type:[String,Number],default:void 0}},P={readonly:{type:Boolean,default:!1}},$={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},H={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},J={count:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"limit","countdown"].includes(t)}},Y={debounce:{type:[Number,String],default:void 0}},w={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:y.before,validation:t=>Object.values(y).includes(t)}},L={tabindex:{type:[String,Number],default:0}},W={floating:{type:Boolean,default:!1}},O={id:[String,Number]},be={placement:{type:String,default:m.bottom,validator:t=>Object.values(m).includes(t)||Object.values(T).includes(t)},strategy:{type:String,default:void 0,validator:t=>Object.values(j).includes(t)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},E={...O,name:{type:String,required:!0}},Q={autofocus:{type:Boolean,default:!1}},X={autocomplete:{type:String,default:"off"}},he={...E,...Q,...X,...L,...g,...P,...S,...B,...k,...C,...$,...J,...Y,...w,...W,...b,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...V},Se={...E,...L,...S,...B,...k,...g,...P,...$,...b,...C,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},Be={...S,...B,...H,...k,...g,...P,...$,...b,...C,...V,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},Ce={...g,...b,...U,..._,...G,...K,type:{type:String,default:N.button,validator:t=>Object.values(N).includes(t)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:F.button}},Pe={storageType:{type:String,default:I.local,validator:t=>Object.values(I).includes(t)},storageKey:String};function Z(){return(0,e.inject)(q,{})}function x(t){return(0,e.computed)(()=>String(t?.value||(0,e.useId)()))}function ee(t,r){const l=(0,e.computed)(()=>typeof t?.value=="string"?{name:t?.value}:t?.value),n=(0,e.computed)(()=>r?.value===y.before?l.value:void 0),s=(0,e.computed)(()=>r?.value===y.after?l.value:void 0);return{hasIcon:l,hasIconLeft:(0,e.computed)(()=>r?.value===m.left?l.value:void 0),hasIconRight:(0,e.computed)(()=>r?.value===m.right?l.value:void 0),hasIconTop:(0,e.computed)(()=>r?.value===m.top?l.value:void 0),hasIconBottom:(0,e.computed)(()=>r?.value===m.bottom?l.value:void 0),hasIconBefore:n,hasIconAfter:s}}function A(t,r,l){return(0,e.computed)(()=>{const n={[t]:!0},s=typeof r?.value=="string"?r.value.split(" "):r?.value;return s&&Array.isArray(s)&&s.forEach(a=>{a&&(n[`${t}--${a}`]=!0)}),l&&Object.keys(l.value).forEach(a=>{n[`${t}--${a}`]=(0,e.unref)(l.value[a])}),n})}var te={...O,...w,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:R.alert}},oe=["close"];function re(t,r){const{bus:l}=Z(),n=x((0,e.computed)(()=>t.id)),s=(0,e.computed)(()=>`${n.value}-title`);let a;const u=()=>{a&&clearTimeout(a),r("close",n.value),l?.emit("close",n.value)};(0,e.watch)(()=>t.autoClose,p=>{if(p>0){a=setTimeout(u,p);return}a&&clearTimeout(a)},{immediate:!0}),(0,e.onBeforeUnmount)(()=>{a&&clearTimeout(a)});const o=(0,e.ref)(!1),c=()=>{o.value=!0,a&&clearTimeout(a)},v=()=>{o.value=!1,t.autoClose>0&&(a=setTimeout(u,t.autoClose))},{hasIcon:h}=ee((0,e.computed)(()=>t.icon)),i=A("vv-alert",(0,e.computed)(()=>t.modifiers),(0,e.computed)(()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:o.value}))),d=(0,e.computed)(()=>({"--alert-duration":`${t.autoClose}ms`}));return{close:u,hasIcon:h,hasTitleId:s,hasProps:(0,e.computed)(()=>({onMouseover:c,onMouseleave:v,class:i.value,style:d.value,role:t.role,"aria-labelledby":s.value}))}}function ae(){return(0,e.inject)(D,void 0)}var le={name:"VvIcon"},ne=(0,e.defineComponent)({...le,props:(0,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:{}},z),setup(t){const r=t,l=(0,e.computed)(()=>typeof r.rotate=="string"?Number.parseFloat(r.rotate):r.rotate),n=(0,e.ref)(!0),s=ae(),{modifiers:a}=(0,e.toRefs)(r),u=A("vv-icon",a),o=(0,e.computed)(()=>r.provider||s?.iconsProvider),c=(0,e.computed)(()=>{const i=r.name??"",d=`@${o.value}:${r.prefix}:${i}`;if((0,f.iconLoaded)(d))return d;const p=s?.iconsCollections.find(ye=>(0,f.iconLoaded)(`@${o.value}:${ye.prefix}:${i}`));return p?`@${o.value}:${p.prefix}:${i}`:i});function v(i){const d=typeof window<"u"?new window.DOMParser:null;return d?d.parseFromString(i,"text/html").querySelector("svg"):null}function h(i){const d=v(i),p=d?.innerHTML.trim()||"";d&&p&&(0,f.addIcon)(`@${o.value}:${r.prefix}:${r.name}`,{body:p,height:d.viewBox.baseVal.height,width:d.viewBox.baseVal.width})}return s&&r.src&&!(0,f.iconLoaded)(`@${o.value}:${r.prefix}:${r.name}`)&&(n.value=!1,s.fetchIcon(r.src).then(i=>{i&&h(i),n.value=!0}).catch(i=>{throw n.value=!0,new Error(`Error during fetch icon: ${i?.message}`)})),r.svg&&h(r.svg),(i,d)=>(0,e.unref)(n)?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(f.Icon),(0,e.mergeProps)({key:0,class:(0,e.unref)(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:(0,e.unref)(l),color:t.color,icon:(0,e.unref)(c)},{onLoad:t.onLoad}),null,16,["class","onLoad"])):(0,e.createCommentVNode)("v-if",!0)}}),ie=ne,se={key:0,class:"vv-alert__header"},de=["id"],ue=["aria-label"],fe={key:1,class:"vv-alert__content"},ce={key:2,class:"vv-alert__footer"},pe={name:"VvAlert"},me=(0,e.defineComponent)({...pe,props:te,emits:oe,setup(t,{expose:r,emit:l}){const{hasProps:n,hasTitleId:s,hasIcon:a,close:u}=re(t,l);return r({close:u}),(o,c)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",(0,e.normalizeProps)((0,e.guardReactiveProps)((0,e.unref)(n))),[o.$slots.header||o.$slots.title||o.$slots.close||o.$slots["title::before"]||o.$slots["title::after"]||o.title||(0,e.unref)(a)||o.dismissable||o.autoClose?((0,e.openBlock)(),(0,e.createElementBlock)("div",se,[(0,e.unref)(a)?((0,e.openBlock)(),(0,e.createBlock)(ie,(0,e.mergeProps)({key:0},(0,e.unref)(a),{class:"vv-alert__icon"}),null,16)):(0,e.createCommentVNode)("v-if",!0),(0,e.renderSlot)(o.$slots,"header",{},()=>[(0,e.renderSlot)(o.$slots,"title::before"),o.$slots.title||o.title?((0,e.openBlock)(),(0,e.createElementBlock)("strong",{key:0,id:(0,e.unref)(s),class:"vv-alert__title"},[(0,e.renderSlot)(o.$slots,"title",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.title),1)])],8,de)):(0,e.createCommentVNode)("v-if",!0),(0,e.renderSlot)(o.$slots,"title::after")]),(0,e.renderSlot)(o.$slots,"close",(0,e.normalizeProps)((0,e.guardReactiveProps)({close:(0,e.unref)(u)})),()=>[o.dismissable||o.autoClose?((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,class:"vv-alert__close",type:"button","aria-label":o.closeLabel,onClick:c[0]||(c[0]=(0,e.withModifiers)((...v)=>(0,e.unref)(u)&&(0,e.unref)(u)(...v),["stop"]))},[...c[1]||(c[1]=[(0,e.createElementVNode)("div",{class:"vv-alert__close-mask"},null,-1)])],8,ue)):(0,e.createCommentVNode)("v-if",!0)])])):(0,e.createCommentVNode)("v-if",!0),o.$slots.default||o.content?((0,e.openBlock)(),(0,e.createElementBlock)("div",fe,[(0,e.renderSlot)(o.$slots,"default",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.content),1)])])):(0,e.createCommentVNode)("v-if",!0),o.$slots.footer||o.footer?((0,e.openBlock)(),(0,e.createElementBlock)("div",ce,[(0,e.renderSlot)(o.$slots,"footer",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.footer),1)])])):(0,e.createCommentVNode)("v-if",!0)],16))}}),ve=me;return ve});
|
|
1
|
+
(function(e,f){typeof exports=="object"&&typeof module<"u"?module.exports=f(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],f):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAlert=f(e.Vue,e.IconifyVue))})(this,function(e,f){var I=(function(t){return t.local="local",t.session="session",t})({}),j=(function(t){return t.absolute="absolute",t.fixed="fixed",t})({}),v=(function(t){return t.left="left",t.right="right",t.top="top",t.bottom="bottom",t})({}),T=(function(t){return t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t})({}),y=(function(t){return t.before="before",t.after="after",t})({}),N=(function(t){return t.button="button",t.submit="submit",t.reset="reset",t})({}),F=(function(t){return t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t})({}),R=(function(t){return t.alert="alert",t.alertdialog="alertdialog",t})({}),D=Symbol.for("volver"),q=Symbol.for("alertGroup"),M={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},z={prefix:"normal"},K={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},S={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},B={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},C={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},V={required:{type:Boolean,default:!1}},_={active:{type:Boolean,default:!1}},G={current:{type:Boolean,default:!1}},ge={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:M.clear},labelClear:{type:String,default:"Clear"}},U={pressed:{type:Boolean,default:!1}},b={label:{type:[String,Number],default:void 0}},P={readonly:{type:Boolean,default:!1}},$={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},H={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},J={count:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"limit","countdown"].includes(t)}},Y={debounce:{type:[Number,String],default:void 0}},w={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:y.before,validation:t=>Object.values(y).includes(t)}},L={tabindex:{type:[String,Number],default:0}},W={floating:{type:Boolean,default:!1}},O={id:[String,Number]},be={placement:{type:String,default:v.bottom,validator:t=>Object.values(v).includes(t)||Object.values(T).includes(t)},strategy:{type:String,default:void 0,validator:t=>Object.values(j).includes(t)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},E={...O,name:{type:String,required:!0}},Q={autofocus:{type:Boolean,default:!1}},X={autocomplete:{type:String,default:"off"}},he={...E,...Q,...X,...L,...g,...P,...S,...B,...k,...C,...$,...J,...Y,...w,...W,...b,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...V},Se={...E,...L,...S,...B,...k,...g,...P,...$,...b,...C,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},Be={...S,...B,...H,...k,...g,...P,...$,...b,...C,...V,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},Ce={...g,...b,...U,..._,...G,...K,type:{type:String,default:N.button,validator:t=>Object.values(N).includes(t)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:F.button}},Pe={storageType:{type:String,default:I.local,validator:t=>Object.values(I).includes(t)},storageKey:String};function Z(){return(0,e.inject)(q,{})}function x(t){return(0,e.computed)(()=>String(t?.value||(0,e.useId)()))}function ee(t,r){const l=(0,e.computed)(()=>typeof t?.value=="string"?{name:t?.value}:t?.value),n=(0,e.computed)(()=>r?.value===y.before?l.value:void 0),s=(0,e.computed)(()=>r?.value===y.after?l.value:void 0);return{hasIcon:l,hasIconLeft:(0,e.computed)(()=>r?.value===v.left?l.value:void 0),hasIconRight:(0,e.computed)(()=>r?.value===v.right?l.value:void 0),hasIconTop:(0,e.computed)(()=>r?.value===v.top?l.value:void 0),hasIconBottom:(0,e.computed)(()=>r?.value===v.bottom?l.value:void 0),hasIconBefore:n,hasIconAfter:s}}function A(t,r,l){return(0,e.computed)(()=>{const n={[t]:!0},s=typeof r?.value=="string"?r.value.split(" "):r?.value;return s&&Array.isArray(s)&&s.forEach(a=>{a&&(n[`${t}--${a}`]=!0)}),l&&Object.keys(l.value).forEach(a=>{n[`${t}--${a}`]=(0,e.unref)(l.value[a])}),n})}var te={...O,...w,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:R.alert}},oe=["close"];function re(t,r){const{bus:l}=Z(),n=x((0,e.computed)(()=>t.id)),s=(0,e.computed)(()=>`${n.value}-title`);let a;const d=()=>{a&&clearTimeout(a),r("close",n.value),l?.emit("close",n.value)};(0,e.watch)(()=>t.autoClose,p=>{if(p>0){a=setTimeout(d,p);return}a&&clearTimeout(a)},{immediate:!0}),(0,e.onBeforeUnmount)(()=>{a&&clearTimeout(a)});const o=(0,e.ref)(!1),c=()=>{o.value=!0,a&&clearTimeout(a)},m=()=>{o.value=!1,t.autoClose>0&&(a=setTimeout(d,t.autoClose))},{hasIcon:h}=ee((0,e.computed)(()=>t.icon)),i=A("vv-alert",(0,e.computed)(()=>t.modifiers),(0,e.computed)(()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:o.value}))),u=(0,e.computed)(()=>({"--alert-duration":`${t.autoClose}ms`}));return{close:d,hasIcon:h,hasTitleId:s,hasProps:(0,e.computed)(()=>({onMouseover:c,onMouseleave:m,class:i.value,style:u.value,role:t.role,"aria-labelledby":s.value}))}}function ae(){return(0,e.inject)(D,void 0)}var le={name:"VvIcon"},ne=(0,e.defineComponent)({...le,props:(0,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:{}},z),setup(t){const r=t,l=(0,e.computed)(()=>typeof r.rotate=="string"?Number.parseFloat(r.rotate):r.rotate),n=(0,e.ref)(!0),s=ae(),{modifiers:a}=(0,e.toRefs)(r),d=A("vv-icon",a),o=(0,e.computed)(()=>r.provider||s?.iconsProvider),c=(0,e.computed)(()=>{const i=r.name??"",u=`@${o.value}:${r.prefix}:${i}`;if((0,f.iconLoaded)(u))return u;const p=s?.iconsCollections.find(ye=>(0,f.iconLoaded)(`@${o.value}:${ye.prefix}:${i}`));return p?`@${o.value}:${p.prefix}:${i}`:i});function m(i){return globalThis.window===void 0?null:new globalThis.DOMParser().parseFromString(i,"text/html").querySelector("svg")}function h(i){const u=m(i),p=u?.innerHTML.trim()||"";u&&p&&(0,f.addIcon)(`@${o.value}:${r.prefix}:${r.name}`,{body:p,height:u.viewBox.baseVal.height,width:u.viewBox.baseVal.width})}return s&&r.src&&!(0,f.iconLoaded)(`@${o.value}:${r.prefix}:${r.name}`)&&(n.value=!1,s.fetchIcon(r.src).then(i=>{i&&h(i),n.value=!0}).catch(i=>{throw n.value=!0,new Error(`Error during fetch icon: ${i?.message}`)})),r.svg&&h(r.svg),(i,u)=>(0,e.unref)(n)?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(f.Icon),(0,e.mergeProps)({key:0,class:(0,e.unref)(d)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:(0,e.unref)(l),color:t.color,icon:(0,e.unref)(c)},{onLoad:t.onLoad}),null,16,["class","onLoad"])):(0,e.createCommentVNode)("v-if",!0)}}),ie=ne,se={key:0,class:"vv-alert__header"},de=["id"],ue=["aria-label"],fe={key:1,class:"vv-alert__content"},ce={key:2,class:"vv-alert__footer"},pe={name:"VvAlert"},ve=(0,e.defineComponent)({...pe,props:te,emits:oe,setup(t,{expose:r,emit:l}){const{hasProps:n,hasTitleId:s,hasIcon:a,close:d}=re(t,l);return r({close:d}),(o,c)=>((0,e.openBlock)(),(0,e.createElementBlock)("div",(0,e.normalizeProps)((0,e.guardReactiveProps)((0,e.unref)(n))),[o.$slots.header||o.$slots.title||o.$slots.close||o.$slots["title::before"]||o.$slots["title::after"]||o.title||(0,e.unref)(a)||o.dismissable||o.autoClose?((0,e.openBlock)(),(0,e.createElementBlock)("div",se,[(0,e.unref)(a)?((0,e.openBlock)(),(0,e.createBlock)(ie,(0,e.mergeProps)({key:0},(0,e.unref)(a),{class:"vv-alert__icon"}),null,16)):(0,e.createCommentVNode)("v-if",!0),(0,e.renderSlot)(o.$slots,"header",{},()=>[(0,e.renderSlot)(o.$slots,"title::before"),o.$slots.title||o.title?((0,e.openBlock)(),(0,e.createElementBlock)("strong",{key:0,id:(0,e.unref)(s),class:"vv-alert__title"},[(0,e.renderSlot)(o.$slots,"title",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.title),1)])],8,de)):(0,e.createCommentVNode)("v-if",!0),(0,e.renderSlot)(o.$slots,"title::after")]),(0,e.renderSlot)(o.$slots,"close",(0,e.normalizeProps)((0,e.guardReactiveProps)({close:(0,e.unref)(d)})),()=>[o.dismissable||o.autoClose?((0,e.openBlock)(),(0,e.createElementBlock)("button",{key:0,class:"vv-alert__close",type:"button","aria-label":o.closeLabel,onClick:c[0]||(c[0]=(0,e.withModifiers)((...m)=>(0,e.unref)(d)&&(0,e.unref)(d)(...m),["stop"]))},[...c[1]||(c[1]=[(0,e.createElementVNode)("div",{class:"vv-alert__close-mask"},null,-1)])],8,ue)):(0,e.createCommentVNode)("v-if",!0)])])):(0,e.createCommentVNode)("v-if",!0),o.$slots.default||o.content?((0,e.openBlock)(),(0,e.createElementBlock)("div",fe,[(0,e.renderSlot)(o.$slots,"default",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.content),1)])])):(0,e.createCommentVNode)("v-if",!0),o.$slots.footer||o.footer?((0,e.openBlock)(),(0,e.createElementBlock)("div",ce,[(0,e.renderSlot)(o.$slots,"footer",{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(o.footer),1)])])):(0,e.createCommentVNode)("v-if",!0)],16))}}),me=ve;return me});
|
|
@@ -94,7 +94,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
94
94
|
icon: string | import("../VvIcon").VvIconProps;
|
|
95
95
|
content: string;
|
|
96
96
|
footer: string;
|
|
97
|
-
modifiers:
|
|
97
|
+
modifiers: import("../..").AlertModifier | import("../..").AlertModifier[];
|
|
98
98
|
dismissable: boolean;
|
|
99
99
|
autoClose: number;
|
|
100
100
|
closeLabel: string;
|