@volverjs/ui-vue 0.0.10-beta.74 → 0.0.10-beta.76
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/README.md +8 -8
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +3 -3
- package/dist/components/VvAccordion/VvAccordion.es.js +9 -9
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +14 -15
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +10 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +19 -19
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +19 -19
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -8
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -1
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +12 -18
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +32 -38
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +1 -1
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +10 -12
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +18 -22
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +266 -285
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -14
- package/dist/components/VvCombobox/index.d.ts +22 -0
- package/dist/components/VvDialog/VvDialog.es.js +5 -7
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +10 -15
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +5 -5
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +6829 -72
- package/dist/components/VvInputFile/VvInputFile.umd.js +7 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +54 -66
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +16 -21
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +10 -13
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +1 -1
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +10 -12
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +18 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +27 -30
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
- package/dist/components/VvTab/VvTab.es.js +18 -25
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +47 -57
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +7352 -629
- package/dist/components/index.umd.js +7 -1
- package/dist/composables/index.es.js +1787 -16
- package/dist/composables/index.umd.js +7 -1
- package/dist/directives/index.es.js +1782 -15
- package/dist/directives/index.umd.js +7 -1
- package/dist/directives/v-contextmenu.es.js +1781 -14
- package/dist/directives/v-contextmenu.umd.js +7 -1
- package/dist/directives/v-tooltip.es.js +1 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +9 -12
- package/dist/index.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +1 -1
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
- package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
- package/package.json +35 -32
|
@@ -120,7 +120,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
120
120
|
const toReturn = {
|
|
121
121
|
[prefix]: true
|
|
122
122
|
};
|
|
123
|
-
const modifiersArray = typeof
|
|
123
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
124
124
|
if (modifiersArray) {
|
|
125
125
|
if (Array.isArray(modifiersArray)) {
|
|
126
126
|
modifiersArray.forEach((modifier) => {
|
|
@@ -244,32 +244,32 @@ function useInjectedAlertGroup() {
|
|
|
244
244
|
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
245
245
|
}
|
|
246
246
|
function useUniqueId(id) {
|
|
247
|
-
return computed(() => String(
|
|
247
|
+
return computed(() => String(id?.value || useId()));
|
|
248
248
|
}
|
|
249
249
|
function useComponentIcon(icon, iconPosition) {
|
|
250
250
|
const hasIcon = computed(() => {
|
|
251
|
-
if (typeof
|
|
252
|
-
return { name: icon
|
|
251
|
+
if (typeof icon?.value === "string") {
|
|
252
|
+
return { name: icon?.value };
|
|
253
253
|
}
|
|
254
|
-
return icon
|
|
254
|
+
return icon?.value;
|
|
255
255
|
});
|
|
256
256
|
const hasIconBefore = computed(
|
|
257
|
-
() =>
|
|
257
|
+
() => iconPosition?.value === Position.before ? hasIcon.value : void 0
|
|
258
258
|
);
|
|
259
259
|
const hasIconAfter = computed(
|
|
260
|
-
() =>
|
|
260
|
+
() => iconPosition?.value === Position.after ? hasIcon.value : void 0
|
|
261
261
|
);
|
|
262
262
|
const hasIconLeft = computed(
|
|
263
|
-
() =>
|
|
263
|
+
() => iconPosition?.value === Side.left ? hasIcon.value : void 0
|
|
264
264
|
);
|
|
265
265
|
const hasIconRight = computed(
|
|
266
|
-
() =>
|
|
266
|
+
() => iconPosition?.value === Side.right ? hasIcon.value : void 0
|
|
267
267
|
);
|
|
268
268
|
const hasIconTop = computed(
|
|
269
|
-
() =>
|
|
269
|
+
() => iconPosition?.value === Side.top ? hasIcon.value : void 0
|
|
270
270
|
);
|
|
271
271
|
const hasIconBottom = computed(
|
|
272
|
-
() =>
|
|
272
|
+
() => iconPosition?.value === Side.bottom ? hasIcon.value : void 0
|
|
273
273
|
);
|
|
274
274
|
return {
|
|
275
275
|
hasIcon,
|
|
@@ -369,7 +369,7 @@ function useVvAlert(props, emit) {
|
|
|
369
369
|
clearTimeout(timeout);
|
|
370
370
|
}
|
|
371
371
|
emit("close", hasId.value);
|
|
372
|
-
bus
|
|
372
|
+
bus?.emit("close", hasId.value);
|
|
373
373
|
};
|
|
374
374
|
watch(
|
|
375
375
|
() => props.autoClose,
|
|
@@ -465,7 +465,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
465
465
|
const { modifiers } = toRefs(props);
|
|
466
466
|
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
467
467
|
const provider = computed(() => {
|
|
468
|
-
return props.provider ||
|
|
468
|
+
return props.provider || volver?.iconsProvider;
|
|
469
469
|
});
|
|
470
470
|
const icon = computed(() => {
|
|
471
471
|
const name = props.name ?? "";
|
|
@@ -473,7 +473,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
473
473
|
if (iconLoaded(iconName)) {
|
|
474
474
|
return iconName;
|
|
475
475
|
}
|
|
476
|
-
const iconsCollection = volver
|
|
476
|
+
const iconsCollection = volver?.iconsCollections.find(
|
|
477
477
|
(iconsCollection2) => {
|
|
478
478
|
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
479
479
|
return iconLoaded(icon2);
|
|
@@ -497,7 +497,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
497
497
|
}
|
|
498
498
|
function addIconFromSvg(svg) {
|
|
499
499
|
const svgContentEl = getSvgContent(svg);
|
|
500
|
-
const svgContent =
|
|
500
|
+
const svgContent = svgContentEl?.innerHTML.trim() || "";
|
|
501
501
|
if (svgContentEl && svgContent) {
|
|
502
502
|
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
503
503
|
body: svgContent,
|
|
@@ -516,7 +516,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
516
516
|
show.value = true;
|
|
517
517
|
}
|
|
518
518
|
}).catch((e) => {
|
|
519
|
-
throw new Error(`Error during fetch icon: ${e
|
|
519
|
+
throw new Error(`Error during fetch icon: ${e?.message}`);
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
522
|
}
|
|
@@ -608,15 +608,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
608
608
|
(...args) => unref(close) && unref(close)(...args),
|
|
609
609
|
["stop"]
|
|
610
610
|
))
|
|
611
|
-
}, _cache[1] || (_cache[1] = [
|
|
611
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
612
612
|
createElementVNode(
|
|
613
613
|
"div",
|
|
614
614
|
{ class: "vv-alert__close-mask" },
|
|
615
615
|
null,
|
|
616
616
|
-1
|
|
617
|
-
/*
|
|
617
|
+
/* CACHED */
|
|
618
618
|
)
|
|
619
|
-
]), 8, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
619
|
+
])], 8, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
620
620
|
])
|
|
621
621
|
])) : createCommentVNode("v-if", true),
|
|
622
622
|
_ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue")):"function"==typeof define&&define.amd?define(["vue","mitt","@iconify/vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAlertGroup=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue")):"function"==typeof define&&define.amd?define(["vue","mitt","@iconify/vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAlertGroup=t(e.Vue,e.mitt,e.Iconify)}(this,function(e,t,o){"use strict";const r={prefix:"normal"};var l=(e=>(e.local="local",e.session="session",e))(l||{}),n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{}),c=(e=>(e.alert="alert",e.alertdialog="alertdialog",e))(c||{});const u=Symbol.for("volver"),d=Symbol.for("alertGroup"),v={modifiers:{type:[String,Array],default:void 0}},f={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:a.before,validation:e=>Object.values(a).includes(e)}},p={id:[String,Number]};function m(t,o,r){return e.computed(()=>{const l={[t]:!0},n="string"==typeof o?.value?o.value.split(" "):o?.value;return n&&Array.isArray(n)&&n.forEach(e=>{e&&(l[`${t}--${e}`]=!0)}),r&&Object.keys(r.value).forEach(o=>{l[`${t}--${o}`]=e.unref(r.value[o])}),l})}n.bottom,i.button,s.button,l.local;const b={...v,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}};function h(o,r){const l=function({name:o}){const r=t();return e.provide(d,{name:o,bus:r}),r}({name:e.computed(()=>o.name)});(o.block&&!o.inline||!o.block&&o.inline)&&console.warn("[VvAlertGroup]: block and inline props must coexist at the same time.");const n=e.computed(()=>{const t=[m("vv-alert-group",e.computed(()=>o.modifiers),e.computed(()=>({stack:o.stack,reverse:o.reverse,absolute:"absolute"===o.position,fixed:"fixed"===o.position}))).value];return o.inline&&o.block&&t.push(`vv-alert-group--${o.block}-${o.inline}`),t}),a=e.computed(()=>o.transition?o.transition:o.position?"start"===o.inline?"vv-alert--fade-inline-start":"end"===o.inline?"vv-alert--fade-inline-end":"top"===o.block?"vv-alert--fade-block-top":"bottom"===o.block?"vv-alert--fade-block-bottom":"vv-alert--fade":"vv-alert--fade");return l.on("close",e=>{r("close",e)}),{hasTransition:a,hasProps:e.computed(()=>({class:n.value}))}}const y={...p,...f,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}};function g(t,o){const{bus:r}=e.inject(d,{}),l=(i=e.computed(()=>t.id),e.computed(()=>String(i?.value||e.useId())));var i;const s=e.computed(()=>`${l.value}-title`);let c;const u=()=>{c&&clearTimeout(c),o("close",l.value),r?.emit("close",l.value)};e.watch(()=>t.autoClose,e=>{e>0?c=setTimeout(u,e):c&&clearTimeout(c)},{immediate:!0});const v=e.ref(!1),f=()=>{v.value=!0,c&&clearTimeout(c)},p=()=>{v.value=!1,t.autoClose>0&&(c=setTimeout(u,t.autoClose))},{hasIcon:b}=function(t,o){const r=e.computed(()=>"string"==typeof t?.value?{name:t?.value}:t?.value),l=e.computed(()=>o?.value===a.before?r.value:void 0),i=e.computed(()=>o?.value===a.after?r.value:void 0),s=e.computed(()=>o?.value===n.left?r.value:void 0),c=e.computed(()=>o?.value===n.right?r.value:void 0),u=e.computed(()=>o?.value===n.top?r.value:void 0),d=e.computed(()=>o?.value===n.bottom?r.value:void 0);return{hasIcon:r,hasIconLeft:s,hasIconRight:c,hasIconTop:u,hasIconBottom:d,hasIconBefore:l,hasIconAfter:i}}(e.computed(()=>t.icon)),h=m("vv-alert",e.computed(()=>t.modifiers),e.computed(()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:v.value}))),y=e.computed(()=>({"--alert-duration":`${t.autoClose}ms`}));return{close:u,hasIcon:b,hasTitleId:s,hasProps:e.computed(()=>({onMouseover:f,onMouseleave:p,class:h.value,style:y.value,role:t.role,"aria-labelledby":s.value}))}}const k=e.defineComponent({name:"VvIcon",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:{}},r),setup(t){const r=t,l=e.computed(()=>"string"==typeof r.rotate?Number.parseFloat(r.rotate):r.rotate),n=e.ref(!0),a=e.inject(u,void 0),{modifiers:i}=e.toRefs(r),s=m("vv-icon",i),c=e.computed(()=>r.provider||a?.iconsProvider),d=e.computed(()=>{const e=r.name??"",t=`@${c.value}:${r.prefix}:${e}`;if(o.iconLoaded(t))return t;const l=a?.iconsCollections.find(t=>{const r=`@${c.value}:${t.prefix}:${e}`;return o.iconLoaded(r)});return l?`@${c.value}:${l.prefix}:${e}`:e});function v(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),l=t?.innerHTML.trim()||"";t&&l&&o.addIcon(`@${c.value}:${r.prefix}:${r.name}`,{body:l,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return a&&r.src&&!o.iconLoaded(`@${c.value}:${r.prefix}:${r.name}`)&&(n.value=!1,a.fetchIcon(r.src).then(e=>{e&&(v(e),n.value=!0)}).catch(e=>{throw new Error(`Error during fetch icon: ${e?.message}`)})),r.svg&&v(r.svg),(t,r)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(s)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(l),color:t.color,icon:e.unref(d)},{onLoad:t.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}}),$={key:0,class:"vv-alert__header"},S=["id"],B=["aria-label"],C={key:1,class:"vv-alert__content"},w={key:2,class:"vv-alert__footer"},x=e.defineComponent({name:"VvAlert",props:y,emits:["close"],setup(t,{expose:o,emit:r}){const l=t,n=r,{hasProps:a,hasTitleId:i,hasIcon:s,close:c}=g(l,n);return o({close:c}),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(a))),[t.$slots.header||t.$slots.title||t.$slots.close||t.$slots["title::before"]||t.$slots["title::after"]||t.title||e.unref(s)||t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("div",$,[e.unref(s)?(e.openBlock(),e.createBlock(k,e.mergeProps({key:0},e.unref(s),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"header",{},()=>[e.renderSlot(t.$slots,"title::before"),t.$slots.title||t.title?(e.openBlock(),e.createElementBlock("strong",{key:0,id:e.unref(i),class:"vv-alert__title"},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],8,S)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"title::after")]),e.renderSlot(t.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(c)})),()=>[t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vv-alert__close",type:"button","aria-label":t.closeLabel,onClick:o[0]||(o[0]=e.withModifiers((...t)=>e.unref(c)&&e.unref(c)(...t),["stop"]))},[...o[1]||(o[1]=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)])],8,B)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.$slots.default||t.content?(e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)])])):e.createCommentVNode("v-if",!0),t.$slots.footer||t.footer?(e.openBlock(),e.createElementBlock("div",w,[e.renderSlot(t.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(t.footer),1)])])):e.createCommentVNode("v-if",!0)],16))}});return e.defineComponent({name:"VvAlertGroup",props:b,emits:["close","beforeEnter","afterLeave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"],setup(t,{emit:o}){const r=t,l=o,{hasProps:n,hasTransition:a}=h(r,l),i={"before-enter":()=>{l("beforeEnter")},"after-leave":()=>{l("afterLeave")},enter:()=>{l("enter")},"after-enter":()=>{l("afterEnter")},"enter-cancelled":()=>{l("enterCancelled")},"before-leave":()=>{l("beforeLeave")},leave:()=>{l("leave")},"leave-cancelled":()=>{l("leaveCancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(n))),[e.renderSlot(t.$slots,"before"),e.createVNode(e.TransitionGroup,e.mergeProps({tag:"div",role:"group",name:e.unref(a),class:"vv-alert-group__list"},e.toHandlers(i)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,t=>(e.openBlock(),e.createBlock(x,e.mergeProps({ref_for:!0},t,{key:t.id}),null,16))),128))])]),_:3},16,["name"]),e.renderSlot(t.$slots,"after")],16))}})});
|
|
@@ -85,7 +85,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
85
85
|
const toReturn = {
|
|
86
86
|
[prefix]: true
|
|
87
87
|
};
|
|
88
|
-
const modifiersArray = typeof
|
|
88
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
89
89
|
if (modifiersArray) {
|
|
90
90
|
if (Array.isArray(modifiersArray)) {
|
|
91
91
|
modifiersArray.forEach((modifier) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatar=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatar=t(e.Vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const i={modifiers:{type:[String,Array],default:void 0}};r.before,o.bottom,n.button,a.button,t.local;const l={...i,imgSrc:String};const s=["role","aria-label"],u=["src"];return e.defineComponent({name:"VvAvatar",props:l,setup(t){const o=t,{modifiers:r}=e.toRefs(o),n=function(t,o){return e.computed(()=>{const e={[t]:!0},r="string"==typeof o?.value?o.value.split(" "):o?.value;return r&&Array.isArray(r)&&r.forEach(o=>{o&&(e[`${t}--${o}`]=!0)}),e})}("vv-avatar",r);return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(n)),role:t.imgSrc?void 0:"img","aria-label":t.imgSrc?void 0:"avatar"},[e.renderSlot(t.$slots,"default",{},()=>[t.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imgSrc,alt:"avatar"},null,8,u)):e.createCommentVNode("v-if",!0)])],10,s))}})});
|
|
@@ -85,7 +85,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
85
85
|
const toReturn = {
|
|
86
86
|
[prefix]: true
|
|
87
87
|
};
|
|
88
|
-
const modifiersArray = typeof
|
|
88
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
89
89
|
if (modifiersArray) {
|
|
90
90
|
if (Array.isArray(modifiersArray)) {
|
|
91
91
|
modifiersArray.forEach((modifier) => {
|
|
@@ -161,17 +161,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
161
161
|
const { modifiers, items, toShow, totalItems, avatarModifiers } = toRefs(props);
|
|
162
162
|
const bemCssClasses = useModifiers("vv-avatar-group", modifiers);
|
|
163
163
|
const stringModifiers = computed(() => {
|
|
164
|
-
if (
|
|
164
|
+
if (avatarModifiers?.value && Array.isArray(avatarModifiers?.value)) {
|
|
165
165
|
return avatarModifiers.value.join(" ");
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return avatarModifiers?.value || "";
|
|
168
168
|
});
|
|
169
169
|
const avatarItems = computed(() => {
|
|
170
170
|
return items.value.slice(0, toShow.value).map((item) => {
|
|
171
171
|
let modifiers2 = [];
|
|
172
172
|
let itemModifiers = [];
|
|
173
|
-
if (avatarModifiers
|
|
174
|
-
modifiers2 = Array.isArray(avatarModifiers
|
|
173
|
+
if (avatarModifiers?.value) {
|
|
174
|
+
modifiers2 = Array.isArray(avatarModifiers?.value) ? avatarModifiers?.value : [avatarModifiers?.value];
|
|
175
175
|
}
|
|
176
176
|
if (item.modifiers) {
|
|
177
177
|
itemModifiers = Array.isArray(item.modifiers) ? item.modifiers : [item.modifiers];
|
|
@@ -198,9 +198,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
198
198
|
return openBlock(), createBlock(
|
|
199
199
|
_sfc_main$1,
|
|
200
200
|
mergeProps({
|
|
201
|
-
key: avatarItem.key
|
|
202
|
-
|
|
203
|
-
}, {
|
|
201
|
+
key: avatarItem.key
|
|
202
|
+
}, { ref_for: true }, {
|
|
204
203
|
modifiers: avatarItem.modifiers,
|
|
205
204
|
imgSrc: avatarItem.imgSrc
|
|
206
205
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatarGroup=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatarGroup=t(e.Vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{});const i={modifiers:{type:[String,Array],default:void 0}};o.before,r.bottom,a.button,n.button,t.local;const l={...i,imgSrc:String};function s(t,r,o){return e.computed(()=>{const e={[t]:!0},o="string"==typeof r?.value?r.value.split(" "):r?.value;return o&&Array.isArray(o)&&o.forEach(r=>{r&&(e[`${t}--${r}`]=!0)}),e})}const u=["role","aria-label"],f=["src"],c=e.defineComponent({name:"VvAvatar",props:l,setup(t){const r=t,{modifiers:o}=e.toRefs(r),a=s("vv-avatar",o);return(t,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a)),role:t.imgSrc?void 0:"img","aria-label":t.imgSrc?void 0:"avatar"},[e.renderSlot(t.$slots,"default",{},()=>[t.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imgSrc,alt:"avatar"},null,8,f)):e.createCommentVNode("v-if",!0)])],10,u))}}),m={...i,items:{type:Array,default:()=>[],required:!0},toShow:{type:Number,default:3},totalItems:{type:Number},avatarModifiers:[String,Array]};const d={key:0};return e.defineComponent({name:"VvAvatarGroup",props:m,setup(t){const r=t,{modifiers:o,items:a,toShow:n,totalItems:i,avatarModifiers:l}=e.toRefs(r),u=s("vv-avatar-group",o),f=e.computed(()=>l?.value&&Array.isArray(l?.value)?l.value.join(" "):l?.value||""),m=e.computed(()=>a.value.slice(0,n.value).map(t=>{let r=[],o=[];return l?.value&&(r=Array.isArray(l?.value)?l?.value:[l?.value]),t.modifiers&&(o=Array.isArray(t.modifiers)?t.modifiers:[t.modifiers]),{...t,key:t.key||e.computed(()=>String(e.useId())).value,modifiers:[...r,...o]}}));return(t,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(u))},[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),t=>(e.openBlock(),e.createBlock(c,e.mergeProps({key:t.key},{ref_for:!0},{modifiers:t.modifiers,imgSrc:t.imgSrc}),{default:e.withCtx(()=>[t.text?(e.openBlock(),e.createElementBlock("span",d,e.toDisplayString(t.text),1)):e.createCommentVNode("v-if",!0)]),_:2},1040))),128)),(e.unref(i)||e.unref(a).length)>e.unref(n)?(e.openBlock(),e.createBlock(c,{key:0,modifiers:`${e.unref(f)} surface bordered`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString("+"+((e.unref(i)||e.unref(a).length)-e.unref(n))),1)]),_:1},8,["modifiers"])):e.createCommentVNode("v-if",!0)])],2))}})});
|
|
@@ -82,7 +82,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
82
82
|
const toReturn = {
|
|
83
83
|
[prefix]: true
|
|
84
84
|
};
|
|
85
|
-
const modifiersArray = typeof
|
|
85
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
86
86
|
if (modifiersArray) {
|
|
87
87
|
if (Array.isArray(modifiersArray)) {
|
|
88
88
|
modifiersArray.forEach((modifier) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBadge=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBadge=t(e.Vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{});const i={modifiers:{type:[String,Array],default:void 0}};n.before,o.bottom,r.button,u.button,t.local;const s={...i,value:[String,Number]};return e.defineComponent({name:"VvBadge",props:s,setup(t){const o=t,{modifiers:n}=e.toRefs(o),r=function(t,o){return e.computed(()=>{const e={[t]:!0},n="string"==typeof o?.value?o.value.split(" "):o?.value;return n&&Array.isArray(n)&&n.forEach(o=>{o&&(e[`${t}--${o}`]=!0)}),e})}("vv-badge",n);return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r))},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)])],2))}})});
|
|
@@ -174,7 +174,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
174
174
|
const toReturn = {
|
|
175
175
|
[prefix]: true
|
|
176
176
|
};
|
|
177
|
-
const modifiersArray = typeof
|
|
177
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
178
178
|
if (modifiersArray) {
|
|
179
179
|
if (Array.isArray(modifiersArray)) {
|
|
180
180
|
modifiersArray.forEach((modifier) => {
|
|
@@ -227,7 +227,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
229
|
const pressed = computed(() => {
|
|
230
|
-
return props.pressed ||
|
|
230
|
+
return props.pressed || dropdownExpanded?.value;
|
|
231
231
|
});
|
|
232
232
|
const { role } = useInjectedDropdownAction();
|
|
233
233
|
const hasTag = computed(() => {
|
|
@@ -235,7 +235,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
235
235
|
case props.disabled:
|
|
236
236
|
return ActionTag.button;
|
|
237
237
|
case props.to !== void 0:
|
|
238
|
-
return
|
|
238
|
+
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
239
239
|
case props.href !== void 0:
|
|
240
240
|
return ActionTag.a;
|
|
241
241
|
default:
|
|
@@ -244,10 +244,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
244
244
|
});
|
|
245
245
|
const hasProps = computed(() => {
|
|
246
246
|
const toReturn = {
|
|
247
|
-
...dropdownAria
|
|
247
|
+
...dropdownAria?.value,
|
|
248
248
|
ariaPressed: pressed.value ? true : void 0,
|
|
249
249
|
ariaLabel: props.ariaLabel,
|
|
250
|
-
role: role
|
|
250
|
+
role: role?.value
|
|
251
251
|
};
|
|
252
252
|
switch (hasTag.value) {
|
|
253
253
|
case ActionTag.a:
|
|
@@ -275,32 +275,29 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
277
|
function onClick(e) {
|
|
278
|
-
var _a;
|
|
279
278
|
if (props.disabled) {
|
|
280
279
|
e.preventDefault();
|
|
281
280
|
return;
|
|
282
281
|
}
|
|
283
|
-
if (
|
|
282
|
+
if (instance?.vnode.props?.onClick) {
|
|
284
283
|
emit("click", e);
|
|
285
284
|
return;
|
|
286
285
|
}
|
|
287
|
-
dropdownEventBus
|
|
286
|
+
dropdownEventBus?.emit("click", e);
|
|
288
287
|
}
|
|
289
288
|
function onMouseover(e) {
|
|
290
|
-
|
|
291
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
289
|
+
if (instance?.vnode.props?.onMouseover) {
|
|
292
290
|
emit("mouseover", e);
|
|
293
291
|
return;
|
|
294
292
|
}
|
|
295
|
-
dropdownEventBus
|
|
293
|
+
dropdownEventBus?.emit("mouseover", e);
|
|
296
294
|
}
|
|
297
295
|
function onMouseleave(e) {
|
|
298
|
-
|
|
299
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
296
|
+
if (instance?.vnode.props?.onMouseleave) {
|
|
300
297
|
emit("mouseleave", e);
|
|
301
298
|
return;
|
|
302
299
|
}
|
|
303
|
-
dropdownEventBus
|
|
300
|
+
dropdownEventBus?.emit("mouseleave", e);
|
|
304
301
|
}
|
|
305
302
|
return (_ctx, _cache) => {
|
|
306
303
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
@@ -343,10 +340,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
343
340
|
const props = __props;
|
|
344
341
|
const { modifiers } = toRefs(props);
|
|
345
342
|
const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
|
|
346
|
-
const length = computed(() =>
|
|
347
|
-
var _a;
|
|
348
|
-
return ((_a = props.routes) == null ? void 0 : _a.length) ?? 0;
|
|
349
|
-
});
|
|
343
|
+
const length = computed(() => props.routes?.length ?? 0);
|
|
350
344
|
const isLast = (index) => index === length.value - 1;
|
|
351
345
|
return (_ctx, _cache) => {
|
|
352
346
|
return openBlock(), createElementBlock(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBreadcrumb=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBreadcrumb=t(e.Vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("volver"),s=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},c={disabled:{type:Boolean,default:!1}},d={active:{type:Boolean,default:!1}},p={current:{type:Boolean,default:!1}},m={pressed:{type:Boolean,default:!1}},f={label:{type:[String,Number],default:void 0}},v={modifiers:{type:[String,Array],default:void 0}};o.before,r.bottom;const b={...c,...f,...m,...d,...p,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}};t.local;const g={...v,routes:Array};const y=b;const k=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:r,emit:o}){const n=t,u=o,c=e.getCurrentInstance(),d=e.inject(l,void 0),p=e.ref(null);r({$el:p});const{reference:m,bus:f,aria:v,expanded:b}=e.inject(s,{});e.watch(()=>p.value,e=>{m&&(m.value=e)});const g=e.computed(()=>n.pressed||b?.value),{role:y}=e.inject(i,{}),k=e.computed(()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return d?.nuxt?e.resolveComponent(a.nuxtLink):a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}}),h=e.computed(()=>{const e={...v?.value,ariaPressed:!!g.value||void 0,ariaLabel:n.ariaLabel,role:y?.value};switch(k.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}});function S(e){n.disabled?e.preventDefault():c?.vnode.props?.onClick?u("click",e):f?.emit("click",e)}function _(e){c?.vnode.props?.onMouseover?u("mouseover",e):f?.emit("mouseover",e)}function x(e){c?.vnode.props?.onMouseleave?u("mouseleave",e):f?.emit("mouseleave",e)}return(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(h),{ref_key:"element",ref:p,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:S,onMouseoverPassive:_,onMouseleavePassive:x}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}}),h={class:"vv-breadcrumb__list"},S=["content"];return e.defineComponent({name:"VvBreadcrumb",props:g,setup(t){const r=t,{modifiers:o}=e.toRefs(r),n=function(t,r){return e.computed(()=>{const e={[t]:!0},o="string"==typeof r?.value?r.value.split(" "):r?.value;return o&&Array.isArray(o)&&o.forEach(r=>{r&&(e[`${t}--${r}`]=!0)}),e})}("vv-breadcrumb",o),a=e.computed(()=>r.routes?.length??0),l=e=>e===a.value-1;return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(n)),"aria-label":"breadcrumbs"},[e.createElementVNode("ol",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routes,({label:r,...o},n)=>(e.openBlock(),e.createElementBlock("li",{key:`${r}-${n}`,class:e.normalizeClass(l(n)?"vv-breadcrumb__item-active":"vv-breadcrumb__item"),itemprop:"itemListElement",itemtype:"https://schema.org/ListItem",itemscope:""},[e.createVNode(k,e.mergeProps({ref_for:!0},o,{class:l(n)?"vv-breadcrumb__label":"vv-breadcrumb__link","aria-current":l(n)?"page":void 0,itemprop:"item","default-tag":"span"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"label",e.mergeProps({ref_for:!0},{...o,index:n,label:r,isLast:l(n)}),()=>[e.createTextVNode(e.toDisplayString(r),1)])]),_:2},1040,["class","aria-current"]),e.createElementVNode("meta",{itemprop:"position",content:`${n+1}`},null,8,S)],2))),128))])],2))}})});
|
|
@@ -216,7 +216,7 @@ function useGroupStateInject(groupKey) {
|
|
|
216
216
|
const group = inject(groupKey, void 0);
|
|
217
217
|
const isInGroup = computed(() => group !== void 0);
|
|
218
218
|
function getGroupOrLocalRef(propName, props, emit) {
|
|
219
|
-
const groupPropValue = group
|
|
219
|
+
const groupPropValue = group?.[propName];
|
|
220
220
|
if (groupPropValue) {
|
|
221
221
|
return computed({
|
|
222
222
|
get() {
|
|
@@ -300,10 +300,10 @@ function useGroupProps(props, emit) {
|
|
|
300
300
|
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
301
301
|
const toggle = getGroupOrLocalRef("toggle", props);
|
|
302
302
|
const unselectable = getGroupOrLocalRef("unselectable", props);
|
|
303
|
-
const multiple = computed(() =>
|
|
303
|
+
const multiple = computed(() => group?.multiple.value ?? false);
|
|
304
304
|
const modifiers = computed(() => {
|
|
305
305
|
let localModifiers = props.modifiers;
|
|
306
|
-
let groupModifiers = group
|
|
306
|
+
let groupModifiers = group?.modifiers.value;
|
|
307
307
|
const toReturn = /* @__PURE__ */ new Set();
|
|
308
308
|
if (localModifiers) {
|
|
309
309
|
if (!Array.isArray(localModifiers)) {
|
|
@@ -320,7 +320,7 @@ function useGroupProps(props, emit) {
|
|
|
320
320
|
return Array.from(toReturn);
|
|
321
321
|
});
|
|
322
322
|
const disabled = computed(
|
|
323
|
-
() => Boolean(props.disabled ||
|
|
323
|
+
() => Boolean(props.disabled || group?.disabled.value)
|
|
324
324
|
);
|
|
325
325
|
return {
|
|
326
326
|
// group props
|
|
@@ -380,7 +380,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
382
|
const pressed = computed(() => {
|
|
383
|
-
return props.pressed ||
|
|
383
|
+
return props.pressed || dropdownExpanded?.value;
|
|
384
384
|
});
|
|
385
385
|
const { role } = useInjectedDropdownAction();
|
|
386
386
|
const hasTag = computed(() => {
|
|
@@ -388,7 +388,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
388
388
|
case props.disabled:
|
|
389
389
|
return ActionTag.button;
|
|
390
390
|
case props.to !== void 0:
|
|
391
|
-
return
|
|
391
|
+
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
392
392
|
case props.href !== void 0:
|
|
393
393
|
return ActionTag.a;
|
|
394
394
|
default:
|
|
@@ -397,10 +397,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
397
397
|
});
|
|
398
398
|
const hasProps = computed(() => {
|
|
399
399
|
const toReturn = {
|
|
400
|
-
...dropdownAria
|
|
400
|
+
...dropdownAria?.value,
|
|
401
401
|
ariaPressed: pressed.value ? true : void 0,
|
|
402
402
|
ariaLabel: props.ariaLabel,
|
|
403
|
-
role: role
|
|
403
|
+
role: role?.value
|
|
404
404
|
};
|
|
405
405
|
switch (hasTag.value) {
|
|
406
406
|
case ActionTag.a:
|
|
@@ -428,32 +428,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
430
|
function onClick(e) {
|
|
431
|
-
var _a;
|
|
432
431
|
if (props.disabled) {
|
|
433
432
|
e.preventDefault();
|
|
434
433
|
return;
|
|
435
434
|
}
|
|
436
|
-
if (
|
|
435
|
+
if (instance?.vnode.props?.onClick) {
|
|
437
436
|
emit("click", e);
|
|
438
437
|
return;
|
|
439
438
|
}
|
|
440
|
-
dropdownEventBus
|
|
439
|
+
dropdownEventBus?.emit("click", e);
|
|
441
440
|
}
|
|
442
441
|
function onMouseover(e) {
|
|
443
|
-
|
|
444
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
442
|
+
if (instance?.vnode.props?.onMouseover) {
|
|
445
443
|
emit("mouseover", e);
|
|
446
444
|
return;
|
|
447
445
|
}
|
|
448
|
-
dropdownEventBus
|
|
446
|
+
dropdownEventBus?.emit("mouseover", e);
|
|
449
447
|
}
|
|
450
448
|
function onMouseleave(e) {
|
|
451
|
-
|
|
452
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
449
|
+
if (instance?.vnode.props?.onMouseleave) {
|
|
453
450
|
emit("mouseleave", e);
|
|
454
451
|
return;
|
|
455
452
|
}
|
|
456
|
-
dropdownEventBus
|
|
453
|
+
dropdownEventBus?.emit("mouseleave", e);
|
|
457
454
|
}
|
|
458
455
|
return (_ctx, _cache) => {
|
|
459
456
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
@@ -489,7 +486,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
489
486
|
const toReturn = {
|
|
490
487
|
[prefix]: true
|
|
491
488
|
};
|
|
492
|
-
const modifiersArray = typeof
|
|
489
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
493
490
|
if (modifiersArray) {
|
|
494
491
|
if (Array.isArray(modifiersArray)) {
|
|
495
492
|
modifiersArray.forEach((modifier) => {
|
|
@@ -543,7 +540,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
543
540
|
const { modifiers } = toRefs(props);
|
|
544
541
|
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
545
542
|
const provider = computed(() => {
|
|
546
|
-
return props.provider ||
|
|
543
|
+
return props.provider || volver?.iconsProvider;
|
|
547
544
|
});
|
|
548
545
|
const icon = computed(() => {
|
|
549
546
|
const name = props.name ?? "";
|
|
@@ -551,7 +548,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
551
548
|
if (iconLoaded(iconName)) {
|
|
552
549
|
return iconName;
|
|
553
550
|
}
|
|
554
|
-
const iconsCollection = volver
|
|
551
|
+
const iconsCollection = volver?.iconsCollections.find(
|
|
555
552
|
(iconsCollection2) => {
|
|
556
553
|
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
557
554
|
return iconLoaded(icon2);
|
|
@@ -575,7 +572,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
575
572
|
}
|
|
576
573
|
function addIconFromSvg(svg) {
|
|
577
574
|
const svgContentEl = getSvgContent(svg);
|
|
578
|
-
const svgContent =
|
|
575
|
+
const svgContent = svgContentEl?.innerHTML.trim() || "";
|
|
579
576
|
if (svgContentEl && svgContent) {
|
|
580
577
|
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
581
578
|
body: svgContent,
|
|
@@ -594,7 +591,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
594
591
|
show.value = true;
|
|
595
592
|
}
|
|
596
593
|
}).catch((e) => {
|
|
597
|
-
throw new Error(`Error during fetch icon: ${e
|
|
594
|
+
throw new Error(`Error during fetch icon: ${e?.message}`);
|
|
598
595
|
});
|
|
599
596
|
}
|
|
600
597
|
}
|
|
@@ -620,7 +617,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
620
617
|
}
|
|
621
618
|
});
|
|
622
619
|
function useUniqueId(id) {
|
|
623
|
-
return computed(() => String(
|
|
620
|
+
return computed(() => String(id?.value || useId()));
|
|
624
621
|
}
|
|
625
622
|
function equals(obj1, obj2, field) {
|
|
626
623
|
return deepEquals(obj1, obj2);
|
|
@@ -685,28 +682,28 @@ function contains(value, list) {
|
|
|
685
682
|
}
|
|
686
683
|
function useComponentIcon(icon, iconPosition) {
|
|
687
684
|
const hasIcon = computed(() => {
|
|
688
|
-
if (typeof
|
|
689
|
-
return { name: icon
|
|
685
|
+
if (typeof icon?.value === "string") {
|
|
686
|
+
return { name: icon?.value };
|
|
690
687
|
}
|
|
691
|
-
return icon
|
|
688
|
+
return icon?.value;
|
|
692
689
|
});
|
|
693
690
|
const hasIconBefore = computed(
|
|
694
|
-
() =>
|
|
691
|
+
() => iconPosition?.value === Position.before ? hasIcon.value : void 0
|
|
695
692
|
);
|
|
696
693
|
const hasIconAfter = computed(
|
|
697
|
-
() =>
|
|
694
|
+
() => iconPosition?.value === Position.after ? hasIcon.value : void 0
|
|
698
695
|
);
|
|
699
696
|
const hasIconLeft = computed(
|
|
700
|
-
() =>
|
|
697
|
+
() => iconPosition?.value === Side.left ? hasIcon.value : void 0
|
|
701
698
|
);
|
|
702
699
|
const hasIconRight = computed(
|
|
703
|
-
() =>
|
|
700
|
+
() => iconPosition?.value === Side.right ? hasIcon.value : void 0
|
|
704
701
|
);
|
|
705
702
|
const hasIconTop = computed(
|
|
706
|
-
() =>
|
|
703
|
+
() => iconPosition?.value === Side.top ? hasIcon.value : void 0
|
|
707
704
|
);
|
|
708
705
|
const hasIconBottom = computed(
|
|
709
|
-
() =>
|
|
706
|
+
() => iconPosition?.value === Side.bottom ? hasIcon.value : void 0
|
|
710
707
|
);
|
|
711
708
|
return {
|
|
712
709
|
hasIcon,
|
|
@@ -751,12 +748,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
751
748
|
unselectable
|
|
752
749
|
} = useGroupProps(props, emit);
|
|
753
750
|
const hasId = useUniqueId(id);
|
|
754
|
-
const name = computed(() =>
|
|
751
|
+
const name = computed(() => attrs?.name || hasId.value);
|
|
755
752
|
const element = ref(null);
|
|
756
|
-
const $el = computed(() =>
|
|
757
|
-
var _a;
|
|
758
|
-
return (_a = element.value) == null ? void 0 : _a.$el;
|
|
759
|
-
});
|
|
753
|
+
const $el = computed(() => element.value?.$el);
|
|
760
754
|
__expose({ $el });
|
|
761
755
|
const pressed = computed(() => {
|
|
762
756
|
if (!toggle.value) {
|
|
@@ -778,7 +772,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
778
772
|
iconPosition.value
|
|
779
773
|
),
|
|
780
774
|
"icon-only": Boolean(
|
|
781
|
-
|
|
775
|
+
icon?.value && !label?.value && !slots.default
|
|
782
776
|
)
|
|
783
777
|
}))
|
|
784
778
|
);
|