@volverjs/ui-vue 0.0.10-beta.7 → 0.0.10-beta.8
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/bin/icons.cjs +1 -1
- package/bin/icons.js +22 -15
- package/dist/Volver.d.ts +0 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +10 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +52 -25
- package/dist/components/VvAction/VvAction.es.js +6 -1
- package/dist/components/VvAlert/VvAlert.es.js +73 -43
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +113 -64
- 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 +56 -26
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +18 -8
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +61 -38
- package/dist/components/VvButton/VvButton.es.js +45 -17
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +3 -3
- package/dist/components/VvButton/index.d.ts +2 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +12 -6
- package/dist/components/VvCard/VvCard.es.js +26 -16
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +9 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +78 -44
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +587 -368
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +3 -3
- package/dist/components/VvCombobox/index.d.ts +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +44 -27
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +64 -44
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +3 -3
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +26 -9
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +19 -8
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +126 -97
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvNav/VvNav.es.js +50 -26
- package/dist/components/VvNav/VvNav.vue.d.ts +3 -3
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +19 -7
- package/dist/components/VvProgress/VvProgress.es.js +12 -6
- package/dist/components/VvRadio/VvRadio.es.js +9 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +78 -44
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +133 -94
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/index.d.ts +1 -1
- package/dist/components/VvTab/VvTab.es.js +98 -44
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +99 -74
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +19 -9
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +3 -3
- package/dist/components/VvTooltip/index.d.ts +1 -1
- package/dist/components/index.es.js +1355 -836
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +39 -23
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +37 -18
- 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.d.ts +3 -1
- package/dist/props/index.d.ts +1 -1
- package/dist/types/generic.d.ts +1 -1
- package/package.json +31 -31
- package/src/Volver.ts +0 -1
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvInputText/VvInputText.vue +2 -2
- package/src/directives/index.ts +1 -4
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/types/generic.ts +2 -1
|
@@ -257,7 +257,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
257
257
|
color: _ctx.color,
|
|
258
258
|
onLoad: _ctx.onLoad,
|
|
259
259
|
icon: unref(icon)
|
|
260
|
-
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
260
|
+
}), null, 16, ["class"])) : createCommentVNode("v-if", true);
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
});
|
|
@@ -1006,101 +1006,140 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1006
1006
|
return option && option.options && option.options.length > 0;
|
|
1007
1007
|
};
|
|
1008
1008
|
return (_ctx, _cache) => {
|
|
1009
|
-
return openBlock(), createElementBlock(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1009
|
+
return openBlock(), createElementBlock(
|
|
1010
|
+
"div",
|
|
1011
|
+
{
|
|
1012
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1013
|
+
},
|
|
1014
|
+
[
|
|
1015
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
1016
|
+
key: 0,
|
|
1017
|
+
for: unref(hasId)
|
|
1018
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
1019
|
+
createElementVNode("div", _hoisted_2, [
|
|
1020
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1021
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1022
|
+
])) : createCommentVNode("v-if", true),
|
|
1023
|
+
createElementVNode("div", _hoisted_4, [
|
|
1024
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
1025
|
+
_sfc_main$1,
|
|
1026
|
+
mergeProps({
|
|
1027
|
+
key: 0,
|
|
1028
|
+
class: "vv-select__icon"
|
|
1029
|
+
}, unref(hasIcon)),
|
|
1030
|
+
null,
|
|
1031
|
+
16
|
|
1032
|
+
/* FULL_PROPS */
|
|
1033
|
+
)) : createCommentVNode("v-if", true),
|
|
1034
|
+
withDirectives(createElementVNode("select", mergeProps({
|
|
1035
|
+
id: unref(hasId),
|
|
1036
|
+
ref_key: "select",
|
|
1037
|
+
ref: select,
|
|
1038
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
1039
|
+
}, unref(hasAttrs)), [
|
|
1040
|
+
_ctx.placeholder ? (openBlock(), createElementBlock("option", {
|
|
1041
|
+
key: 0,
|
|
1042
|
+
value: void 0,
|
|
1043
|
+
disabled: !_ctx.unselectable,
|
|
1044
|
+
hidden: !_ctx.unselectable
|
|
1045
|
+
}, toDisplayString(_ctx.placeholder), 9, _hoisted_6)) : createCommentVNode("v-if", true),
|
|
1046
|
+
(openBlock(true), createElementBlock(
|
|
1047
|
+
Fragment,
|
|
1048
|
+
null,
|
|
1049
|
+
renderList(_ctx.options, (option, index) => {
|
|
1050
|
+
return openBlock(), createElementBlock(
|
|
1051
|
+
Fragment,
|
|
1052
|
+
null,
|
|
1053
|
+
[
|
|
1054
|
+
!isGroup(option) ? (openBlock(), createElementBlock("option", {
|
|
1055
|
+
key: index,
|
|
1056
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1057
|
+
value: unref(getOptionValue)(option)
|
|
1058
|
+
}, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7)) : (openBlock(), createElementBlock("optgroup", {
|
|
1059
|
+
key: `group-${index}`,
|
|
1060
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1061
|
+
label: unref(getOptionLabel)(option)
|
|
1062
|
+
}, [
|
|
1063
|
+
(openBlock(true), createElementBlock(
|
|
1064
|
+
Fragment,
|
|
1065
|
+
null,
|
|
1066
|
+
renderList(unref(getOptionGrouped)(option), (item, i) => {
|
|
1067
|
+
return openBlock(), createElementBlock("option", {
|
|
1068
|
+
key: `group-${index}-item-${i}`,
|
|
1069
|
+
disabled: unref(isOptionDisabled)(item),
|
|
1070
|
+
value: unref(getOptionValue)(item)
|
|
1071
|
+
}, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9);
|
|
1072
|
+
}),
|
|
1073
|
+
128
|
|
1074
|
+
/* KEYED_FRAGMENT */
|
|
1075
|
+
))
|
|
1076
|
+
], 8, _hoisted_8))
|
|
1077
|
+
],
|
|
1078
|
+
64
|
|
1079
|
+
/* STABLE_FRAGMENT */
|
|
1080
|
+
);
|
|
1081
|
+
}),
|
|
1082
|
+
256
|
|
1083
|
+
/* UNKEYED_FRAGMENT */
|
|
1084
|
+
))
|
|
1085
|
+
], 16, _hoisted_5), [
|
|
1086
|
+
[vModelSelect, unref(localModelValue)]
|
|
1087
|
+
]),
|
|
1088
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
1089
|
+
_sfc_main$1,
|
|
1090
|
+
mergeProps({
|
|
1091
|
+
key: 1,
|
|
1092
|
+
class: "vv-select__icon vv-select__icon-after"
|
|
1093
|
+
}, unref(hasIcon)),
|
|
1094
|
+
null,
|
|
1095
|
+
16
|
|
1096
|
+
/* FULL_PROPS */
|
|
1097
|
+
)) : createCommentVNode("v-if", true)
|
|
1060
1098
|
]),
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
1099
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
1100
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1101
|
+
])) : createCommentVNode("v-if", true)
|
|
1065
1102
|
]),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
]
|
|
1103
|
-
|
|
1103
|
+
createVNode(unref(HintSlot), {
|
|
1104
|
+
id: unref(hasHintId),
|
|
1105
|
+
class: "vv-select__hint"
|
|
1106
|
+
}, createSlots({
|
|
1107
|
+
_: 2
|
|
1108
|
+
/* DYNAMIC */
|
|
1109
|
+
}, [
|
|
1110
|
+
_ctx.$slots.hint ? {
|
|
1111
|
+
name: "hint",
|
|
1112
|
+
fn: withCtx(() => [
|
|
1113
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1114
|
+
]),
|
|
1115
|
+
key: "0"
|
|
1116
|
+
} : void 0,
|
|
1117
|
+
_ctx.$slots.loading ? {
|
|
1118
|
+
name: "loading",
|
|
1119
|
+
fn: withCtx(() => [
|
|
1120
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1121
|
+
]),
|
|
1122
|
+
key: "1"
|
|
1123
|
+
} : void 0,
|
|
1124
|
+
_ctx.$slots.valid ? {
|
|
1125
|
+
name: "valid",
|
|
1126
|
+
fn: withCtx(() => [
|
|
1127
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1128
|
+
]),
|
|
1129
|
+
key: "2"
|
|
1130
|
+
} : void 0,
|
|
1131
|
+
_ctx.$slots.invalid ? {
|
|
1132
|
+
name: "invalid",
|
|
1133
|
+
fn: withCtx(() => [
|
|
1134
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1135
|
+
]),
|
|
1136
|
+
key: "3"
|
|
1137
|
+
} : void 0
|
|
1138
|
+
]), 1032, ["id"])
|
|
1139
|
+
],
|
|
1140
|
+
2
|
|
1141
|
+
/* CLASS */
|
|
1142
|
+
);
|
|
1104
1143
|
};
|
|
1105
1144
|
}
|
|
1106
1145
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.uid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const v=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${d.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${d.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${d.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${d.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},h=(Boolean,Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),f=function(l,o,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,l=o,n=t;return Object.keys(l).reduce(((o,t)=>{const a=n[t];if(o[t]=a,t in e){if(Array.isArray(l[t])){const n=l[t];n.length&&n[0]===a&&(o[t]=e[t])}if("function"==typeof l[t]&&(0,l[t])()===a&&(o[t]=e[t]),"object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[t]=e[t]):n===a&&(o[t]=e[t])}}return o}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(l,o){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>p(t.value.invalidLabel))),a=e.computed((()=>p(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(o.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(o.valid||a.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,o,t,n,a,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.uid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return l=u.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:oe,getOptionValue:te,isOptionDisabled:ne,getOptionGrouped:ae}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",A,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ie)?ie.value=l:null)},e.unref(ee)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ne)(l),label:e.unref(oe)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.uid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const v=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${d.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${d.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${d.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${d.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}});function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},h=(Boolean,Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),f=function(l,o,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,l=o,n=t;return Object.keys(l).reduce(((o,t)=>{const a=n[t];if(o[t]=a,t in e){if(Array.isArray(l[t])){const n=l[t];n.length&&n[0]===a&&(o[t]=e[t])}if("function"==typeof l[t]&&(0,l[t])()===a&&(o[t]=e[t]),"object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[t]=e[t]):n===a&&(o[t]=e[t])}}return o}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(l,o){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>p(t.value.invalidLabel))),a=e.computed((()=>p(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(o.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(o.valid||a.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,o,t,n,a,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.uid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return l=u.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:oe,getOptionValue:te,isOptionDisabled:ne,getOptionGrouped:ae}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",A,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ie)?ie.value=l:null)},e.unref(ee)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ne)(l),label:e.unref(oe)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),null,16)):e.createCommentVNode("v-if",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -44,7 +44,7 @@ export declare const VvSelectProps: {
|
|
|
44
44
|
validation: (value: import("../../constants").Position) => boolean;
|
|
45
45
|
};
|
|
46
46
|
options: {
|
|
47
|
-
type: globalThis.PropType<(string | import("
|
|
47
|
+
type: globalThis.PropType<(string | import("../..").Option)[]>;
|
|
48
48
|
default: () => never[];
|
|
49
49
|
};
|
|
50
50
|
labelKey: {
|
|
@@ -388,10 +388,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
388
388
|
}), {
|
|
389
389
|
default: withCtx(() => [
|
|
390
390
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
391
|
-
createTextVNode(
|
|
391
|
+
createTextVNode(
|
|
392
|
+
toDisplayString(_ctx.label),
|
|
393
|
+
1
|
|
394
|
+
/* TEXT */
|
|
395
|
+
)
|
|
392
396
|
])
|
|
393
397
|
]),
|
|
394
398
|
_: 3
|
|
399
|
+
/* FORWARDED */
|
|
395
400
|
}, 16, ["class"]);
|
|
396
401
|
};
|
|
397
402
|
}
|
|
@@ -409,12 +414,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
409
414
|
setup(__props) {
|
|
410
415
|
return (_ctx, _cache) => {
|
|
411
416
|
return openBlock(), createElementBlock("li", _hoisted_1$1, [
|
|
412
|
-
createVNode(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
createVNode(
|
|
418
|
+
_sfc_main$3,
|
|
419
|
+
mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
|
|
420
|
+
{
|
|
421
|
+
default: withCtx(() => [
|
|
422
|
+
renderSlot(_ctx.$slots, "default")
|
|
423
|
+
]),
|
|
424
|
+
_: 3
|
|
425
|
+
/* FORWARDED */
|
|
426
|
+
},
|
|
427
|
+
16
|
|
428
|
+
/* FULL_PROPS */
|
|
429
|
+
)
|
|
418
430
|
]);
|
|
419
431
|
};
|
|
420
432
|
}
|
|
@@ -464,25 +476,37 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
464
476
|
};
|
|
465
477
|
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
466
478
|
return (_ctx, _cache) => {
|
|
467
|
-
return openBlock(), createElementBlock(
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
"
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
479
|
+
return openBlock(), createElementBlock(
|
|
480
|
+
"nav",
|
|
481
|
+
{
|
|
482
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
483
|
+
},
|
|
484
|
+
[
|
|
485
|
+
createElementVNode("ul", {
|
|
486
|
+
class: "vv-nav__menu",
|
|
487
|
+
role: "menu",
|
|
488
|
+
"aria-busy": "true",
|
|
489
|
+
onClick: withModifiers(onClick, ["stop"])
|
|
490
|
+
}, [
|
|
491
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
492
|
+
(openBlock(true), createElementBlock(
|
|
493
|
+
Fragment,
|
|
494
|
+
null,
|
|
495
|
+
renderList(_ctx.items, ({ on = {}, ...item }, index) => {
|
|
496
|
+
return openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
497
|
+
key: index,
|
|
498
|
+
"data-index": index
|
|
499
|
+
}, item, toHandlers(on)), null, 16, ["data-index"]);
|
|
500
|
+
}),
|
|
501
|
+
128
|
|
502
|
+
/* KEYED_FRAGMENT */
|
|
503
|
+
))
|
|
504
|
+
])
|
|
505
|
+
], 8, _hoisted_1)
|
|
506
|
+
],
|
|
507
|
+
2
|
|
508
|
+
/* CLASS */
|
|
509
|
+
);
|
|
486
510
|
};
|
|
487
511
|
}
|
|
488
512
|
});
|
|
@@ -532,24 +556,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
532
556
|
);
|
|
533
557
|
const bemCssClasses = useModifiers("vv-tab", modifiers);
|
|
534
558
|
return (_ctx, _cache) => {
|
|
535
|
-
return openBlock(), createElementBlock(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
559
|
+
return openBlock(), createElementBlock(
|
|
560
|
+
"div",
|
|
561
|
+
{
|
|
562
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
563
|
+
},
|
|
564
|
+
[
|
|
565
|
+
createVNode(
|
|
566
|
+
_sfc_main$1,
|
|
567
|
+
mergeProps({
|
|
568
|
+
items: unref(navItems),
|
|
569
|
+
modifiers: unref(hasNavModifiers)
|
|
570
|
+
}, { onClick: onNavClick }),
|
|
571
|
+
null,
|
|
572
|
+
16
|
|
573
|
+
/* FULL_PROPS */
|
|
574
|
+
),
|
|
575
|
+
(openBlock(true), createElementBlock(
|
|
576
|
+
Fragment,
|
|
577
|
+
null,
|
|
578
|
+
renderList(unref(items), (item, index) => {
|
|
579
|
+
return openBlock(), createElementBlock(
|
|
580
|
+
Fragment,
|
|
581
|
+
{ key: index },
|
|
582
|
+
[
|
|
583
|
+
item.tab ? (openBlock(), createElementBlock(
|
|
584
|
+
"article",
|
|
585
|
+
{
|
|
586
|
+
key: 0,
|
|
587
|
+
class: normalizeClass([{ target: unref(activeTabKey) === item.tab }, "vv-tab__panel"])
|
|
588
|
+
},
|
|
589
|
+
[
|
|
590
|
+
renderSlot(_ctx.$slots, `panel::${item.tab}`)
|
|
591
|
+
],
|
|
592
|
+
2
|
|
593
|
+
/* CLASS */
|
|
594
|
+
)) : createCommentVNode("v-if", true)
|
|
595
|
+
],
|
|
596
|
+
64
|
|
597
|
+
/* STABLE_FRAGMENT */
|
|
598
|
+
);
|
|
599
|
+
}),
|
|
600
|
+
128
|
|
601
|
+
/* KEYED_FRAGMENT */
|
|
602
|
+
))
|
|
603
|
+
],
|
|
604
|
+
2
|
|
605
|
+
/* CLASS */
|
|
606
|
+
);
|
|
553
607
|
};
|
|
554
608
|
}
|
|
555
609
|
});
|
|
@@ -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).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={current:Boolean},m={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...m,...c,...v,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0}},k={items:{type:Array,default:()=>[]}},y={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},g={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:m,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==m?void 0:m.value,ariaPressed:!!f.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),g=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),r("click",e))},B=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(f),disabled:t.disabled,current:t.current},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},S=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function x(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),l=e=>{var t;const n=e.target;if(null==n?void 0:n.dataset.index){const e=parseInt(n.dataset.index),l=null==(t=r.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;o("click",l)}},a=x("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:t={},...o},r)=>(e.openBlock(),e.createBlock(S,e.mergeProps({key:r,"data-index":r},o,e.toHandlers(t)),null,16,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:y,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.computed((()=>l.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=a.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),v=x("vv-tab",n);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(v))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),null,16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),((o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(s)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("",!0)],64)))),128))],2))}})}));
|
|
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).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={current:Boolean},m={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...m,...c,...v,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0}},k={items:{type:Array,default:()=>[]}},y={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},g={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:m,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==m?void 0:m.value,ariaPressed:!!f.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),g=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),r("click",e))},B=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(f),disabled:t.disabled,current:t.current},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},S=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function x(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),l=e=>{var t;const n=e.target;if(null==n?void 0:n.dataset.index){const e=parseInt(n.dataset.index),l=null==(t=r.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;o("click",l)}},a=x("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:t={},...o},r)=>(e.openBlock(),e.createBlock(S,e.mergeProps({key:r,"data-index":r},o,e.toHandlers(t)),null,16,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:y,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.computed((()=>l.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=a.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),v=x("vv-tab",n);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(v))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),null,16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),((o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(s)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64)))),128))],2))}})}));
|