@volverjs/ui-vue 0.0.10-beta.16 → 0.0.10-beta.18
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/auto-imports.d.ts +3 -2
- package/bin/icons.js +1 -1
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +2 -1
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +4 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +2 -2
- package/dist/components/VvAction/VvAction.es.js +2 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +3 -2
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
- package/dist/components/VvAlert/index.d.ts +2 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +5 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +2 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +5 -3
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +7 -7
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +2 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +2 -1
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +7 -7
- package/dist/components/VvCheckbox/index.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +4 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +11 -6
- 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 +60 -54
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +2 -1
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +2 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -103
- package/dist/components/VvInputFile/VvInputFile.es.js +87 -57
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
- package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +48 -42
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +3 -3
- package/dist/components/VvInputText/index.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +7 -6
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +2 -1
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +2 -1
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +5 -5
- package/dist/components/VvRadio/index.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +4 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +3 -2
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
- package/dist/components/VvSelect/index.d.ts +1 -1
- package/dist/components/VvTab/VvTab.es.js +9 -7
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
- package/dist/components/VvTextarea/VvTextarea.es.js +3 -2
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +5 -5
- package/dist/components/VvTextarea/index.d.ts +2 -2
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +1 -1
- package/dist/components/index.es.js +266 -210
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.es.js +14 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.d.ts +3 -3
- package/dist/directives/index.es.js +3 -3
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +6 -6
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +62 -0
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +5 -5
- package/dist/resolvers/unplugin.es.js +59 -6
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +59 -117
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +519 -661
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/package.json +53 -53
- package/src/Volver.ts +9 -4
- 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/VvInputFile/VvInputFile.vue +33 -10
- package/src/directives/index.ts +3 -3
- package/src/resolvers/unplugin.ts +3 -13
- package/src/utils/ObjectUtilities.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("volver"),d=Symbol.for("radioGroup");function s(e,t,l){return l?f(e,l)===f(t,l):v(e,t)}function v(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!v(e[a],t[a]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,f[a]))return!1;for(a=n;0!=a--;)if(i=f[a],!v(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function p(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>c(o.value.invalidLabel))),n=e.computed((()=>c(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},y={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},h=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},O={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...V,name:{type:String,required:!0}},...B,...m,...y,...k,...g,...S,...L,...h,...b,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},R={...m,...y,...O,...k,...g,...S,...L,...h,...b,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};function j(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}i.button,r.button;const x=$;function A(t,l,o){const a=e.inject(u),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function P(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const C=["for"],N=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],w=e.defineComponent({name:"VvRadio",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=e.useSlots(),i=A("VvRadio",x,a),{id:r,disabled:u,readonly:v,modelValue:f,valid:c,invalid:m}=function(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=j(d),r=i("modelValue",t,l),u=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:s,readonly:v,disabled:f}}(a,o),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(r),b=e.computed((()=>`${y.value}-hint`)),g=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>u.value||v.value)),L=e.computed((()=>!0===m.value||!0!==c.value&&void 0)),k=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(s(e,l))return!0;return!1}(a.value,f.value):s(a.value,f.value))),O=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),B=e.computed({get:()=>k.value?O.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,o("change",e)}}),{modifiers:V}=e.toRefs(a),$=P("vv-radio",V,e.computed((()=>({valid:c.value,invalid:m.value,disabled:u.value,readonly:v.value})))),{HintSlot:R,hasHintLabelOrSlot:w,hasInvalidLabelOrSlot:_,hintSlotScope:z}=p(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(B)?B.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(O),tabindex:e.unref(g),"aria-invalid":e.unref(L),"aria-describedby":e.unref(w)?e.unref(b):void 0,"aria-errormessage":e.unref(_)?e.unref(b):void 0},null,8,N),[[e.vModelRadio,e.unref(B)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(R),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,C))}}),_=R;const z=["textContent"],E={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:_,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=e.useSlots(),r=A("VvRadioGroup",_,n),u=l.useVModel(n,"modelValue",a),{disabled:s,readonly:v,vertical:f,valid:c,invalid:m,modifiers:y}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:d,modelValue:u,disabled:s,readonly:v,valid:c,invalid:m});const{getOptionLabel:b,getOptionValue:g}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),h=P("vv-radio-group",y,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!f.value,valid:c.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:L}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(h))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:b(e),value:g(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("volver"),d=Symbol.for("radioGroup");function s(e,t,l){return l?f(e,l)===f(t,l):v(e,t)}function v(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!v(e[a],t[a]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,f[a]))return!1;for(a=n;0!=a--;)if(i=f[a],!v(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function p(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>c(o.value.invalidLabel))),n=e.computed((()=>c(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},y={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},h=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},O={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...V,name:{type:String,required:!0}},...B,...m,...y,...k,...g,...S,...L,...h,...b,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},R={...m,...y,...O,...k,...g,...S,...L,...h,...b,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};function j(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}i.button,r.button;const x=$;function A(t,l,o){const a=e.inject(u),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function P(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const C=["for"],N=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],w=e.defineComponent({name:"VvRadio",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=o,i=e.useSlots(),r=A("VvRadio",x,a),{id:u,disabled:v,readonly:f,modelValue:c,valid:m,invalid:y}=function(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=j(d),r=i("modelValue",t,l),u=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:s,readonly:v,disabled:f}}(a,n),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),g=e.computed((()=>`${b.value}-hint`)),h=e.computed((()=>L.value?-1:a.tabindex)),S=e.ref(),L=e.computed((()=>v.value||f.value)),k=e.computed((()=>!0===y.value||!0!==m.value&&void 0)),O=e.computed((()=>Array.isArray(c.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(s(e,l))return!0;return!1}(a.value,c.value):s(a.value,c.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),V=e.computed({get:()=>O.value?B.value:null,set(e){Array.isArray(c.value)?c.value=[a.value]:c.value=a.value,n("change",e)}}),{modifiers:$}=e.toRefs(a),R=P("vv-radio",$,e.computed((()=>({valid:m.value,invalid:y.value,disabled:v.value,readonly:f.value})))),{HintSlot:w,hasHintLabelOrSlot:_,hasInvalidLabelOrSlot:z,hintSlotScope:E}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(R)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:S,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(V)?V.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(L),value:e.unref(B),tabindex:e.unref(h),"aria-invalid":e.unref(k),"aria-describedby":e.unref(_)?e.unref(g):void 0,"aria-errormessage":e.unref(z)?e.unref(g):void 0},null,8,N),[[e.vModelRadio,e.unref(V)]]),e.renderSlot(t.$slots,"default",{value:e.unref(c)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(w),{id:e.unref(g),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(E))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(E))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(E))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(E))))])),key:"3"}:void 0]),1032,["id"])],10,C))}}),_=R;const z=["textContent"],E={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:_,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=A("VvRadioGroup",_,n),s=l.useVModel(n,"modelValue",i),{disabled:v,readonly:f,vertical:c,valid:m,invalid:y,modifiers:b}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:d,modelValue:s,disabled:v,readonly:f,valid:m,invalid:y});const{getOptionLabel:g,getOptionValue:h}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),S=P("vv-radio-group",b,e.computed((()=>({disabled:v.value,readonly:f.value,horizontal:!c.value,valid:m.value,invalid:y.value})))),{HintSlot:L,hintSlotScope:k}=p(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(S))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:g(e),value:h(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(L),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Option } from '../../types/generic';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
4
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
5
5
|
default: undefined;
|
|
6
6
|
};
|
|
7
7
|
name: {
|
|
@@ -74,9 +74,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
74
74
|
};
|
|
75
75
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
76
|
[x: string]: (...args: any[]) => void;
|
|
77
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
77
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
78
78
|
modelValue: {
|
|
79
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
79
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
80
80
|
default: undefined;
|
|
81
81
|
};
|
|
82
82
|
name: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const VvRadioGroupProps: {
|
|
2
2
|
modelValue: {
|
|
3
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
3
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: undefined;
|
|
5
5
|
};
|
|
6
6
|
name: {
|
|
@@ -87,7 +87,7 @@ const __default__$1 = {
|
|
|
87
87
|
};
|
|
88
88
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
89
89
|
...__default__$1,
|
|
90
|
-
props: mergeDefaults({
|
|
90
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
91
91
|
name: {},
|
|
92
92
|
color: {},
|
|
93
93
|
width: {},
|
|
@@ -872,8 +872,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
872
872
|
...__default__,
|
|
873
873
|
props: VvSelectProps,
|
|
874
874
|
emits: VvSelectEmits,
|
|
875
|
-
setup(__props, { emit }) {
|
|
875
|
+
setup(__props, { emit: __emit }) {
|
|
876
876
|
const props = __props;
|
|
877
|
+
const emit = __emit;
|
|
877
878
|
const slots = useSlots();
|
|
878
879
|
const propsDefaults = useDefaults(
|
|
879
880
|
"VvSelect",
|
|
@@ -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,t,o,a){"use strict";var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),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 d=Symbol.for("volver");function s(){return e.inject(d)}function c(l,t,o){return e.computed((()=>{const a={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((t=>{a[`${l}--${t}`]=e.unref(o.value[t])})),a}))}const v=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:{}},{prefix:"normal"}),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(o),u=c("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function f(e){const t=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),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(f(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&f(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,onLoad:t.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}});function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const p={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},m={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},g=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),y={readonly:{type:Boolean,default:!1}},S={modifiers:{type:[String,Array],default:void 0}},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],default:void 0},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:{type:Boolean,default:!1}},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...w,name:{type:String,required:!0}},E={autofocus:{type:Boolean,default:!1}},P={autocomplete:{type:String,default:"off"}};r.button,u.button;const I={...x,...E,...P,...$,...p,...m,...B,...b,...h,...y,...S,...k,...L,...V,...O,...g,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const N=["for"],_={class:"vv-select__wrapper"},j={key:0,class:"vv-select__input-before"},A={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],D=["disabled","label"],R=["disabled","value"],q={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I,emits:["update:modelValue","focus","blur"],setup(l,{emit:r}){const u=l,d=e.useSlots(),p=function(l,t,o){const a=s(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[l]))return a.defaults.value[l]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,l=t,a=o;return Object.keys(l).reduce(((t,o)=>{const n=a[o];if(t[o]=n,o in e){if(Array.isArray(l[o])){const a=l[o];a.length&&a[0]===n&&(t[o]=e[o])}if("function"==typeof l[o]&&(0,l[o])()===n&&(t[o]=e[o]),"object"==typeof l[o]){let a=l[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(t[o]=e[o]):a===n&&(t[o]=e[o])}}return t}),{})}))}("VvSelect",I,u),m=e.ref(),{HintSlot:b,hasHintLabelOrSlot:h,hasInvalidLabelOrSlot:g,hintSlotScope:y}=function(l,t){const o=e.computed((()=>e.isRef(l)?l.value:l)),a=e.computed((()=>f(o.value.invalidLabel))),n=e.computed((()=>f(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(t.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(t.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,t,o,a,n,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:p,HintSlot:m}}(p,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:x,floating:E,multiple:P}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,t){const{focused:a}=o.useFocus(l);return e.watch(a,(o=>{t(o?"focus":"blur",e.unref(l))})),{focused:a}}(m,r),T=o.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIconBefore:J,hasIconAfter:G}=function(l,t){const o=e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),a=e.computed((()=>(null==t?void 0:t.value)===i.before?o.value:void 0)),r=e.computed((()=>(null==t?void 0:t.value)===i.after?o.value:void 0)),u=e.computed((()=>(null==t?void 0:t.value)===n.left?o.value:void 0)),d=e.computed((()=>(null==t?void 0:t.value)===n.right?o.value:void 0)),s=e.computed((()=>(null==t?void 0:t.value)===n.top?o.value:void 0)),c=e.computed((()=>(null==t?void 0:t.value)===n.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:r}}(V,O),U=e.computed((()=>{return l=u.modelValue,!(null==(t=e.unref(l))||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"==typeof t&&0===Object.keys(t).length);var l,t})),Q=e.computed((()=>u.disabled||u.readonly)),W=e.computed((()=>Q.value?-1:u.tabindex)),X=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Y=c("vv-select",B,e.computed((()=>({valid:x.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":void 0!==J.value,"icon-after":void 0!==G.value,dirty:U.value,focus:M.value,floating:E.value,multiple:P.value})))),Z=e.computed((()=>({name:u.name,tabindex:W.value,disabled:Q.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":X.value,"aria-describedby":h.value?K.value:void 0,"aria-errormessage":g.value?K.value:void 0}))),ee=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:le,getOptionValue:te,isOptionDisabled:oe,getOptionGrouped:ae}=function(l){const{options:t,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ne=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),r("update:modelValue",e)}}),ie=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Y))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,N)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",_,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",A,[e.unref(J)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0},e.unref(J),{class:"vv-select__icon"}),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":t[0]||(t[0]=l=>e.isRef(ne)?ne.value=l:null)},e.unref(Z)),[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,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[ie(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${t}`,disabled:e.unref(oe)(l),label:e.unref(le)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${t}-item-${o}`,disabled:e.unref(oe)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(le)(l)),9,R)))),128))],8,D)):(e.openBlock(),e.createElementBlock("option",{key:t,disabled:e.unref(oe)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(le)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ne)]]),e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1},e.unref(G),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(b),{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,t,o,a){"use strict";const n={prefix:"normal"};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||{}),d=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(d||{});const s=Symbol.for("volver");function c(){return e.inject(s)}function v(l,t,o){return e.computed((()=>{const a={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((t=>{a[`${l}--${t}`]=e.unref(o.value[t])})),a}))}const f=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:{}},n),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=c(),{modifiers:r}=e.toRefs(o),u=v("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function f(e){const t=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),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(f(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&f(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,onLoad:t.onLoad,icon:e.unref(s)}),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 m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},b={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},h={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},y=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},B={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},$={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},V={tabindex:{type:[String,Number],default:0}},O={floating:{type:Boolean,default:!1}},w={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...x,name:{type:String,required:!0}},P={autofocus:{type:Boolean,default:!1}},I={autocomplete:{type:String,default:"off"}};u.button,d.button;const N={...E,...P,...I,...V,...m,...b,...k,...h,...g,...S,...B,...L,...$,...O,...w,...y,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const _=["for"],j={class:"vv-select__wrapper"},A={key:0,class:"vv-select__input-before"},C={class:"vv-select__inner"},F=["id"],z=["disabled","hidden"],D=["disabled","value"],R=["disabled","label"],q=["disabled","value"],H={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:n}){const u=l,d=n,s=e.useSlots(),m=function(l,t,o){const a=c(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[l]))return a.defaults.value[l]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,l=t,a=o;return Object.keys(l).reduce(((t,o)=>{const n=a[o];if(t[o]=n,o in e){if(Array.isArray(l[o])){const a=l[o];a.length&&a[0]===n&&(t[o]=e[o])}if("function"==typeof l[o]&&(0,l[o])()===n&&(t[o]=e[o]),"object"==typeof l[o]){let a=l[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(t[o]=e[o]):a===n&&(t[o]=e[o])}}return t}),{})}))}("VvSelect",N,u),b=e.ref(),{HintSlot:h,hasHintLabelOrSlot:g,hasInvalidLabelOrSlot:y,hintSlotScope:S}=function(l,t){const o=e.computed((()=>e.isRef(l)?l.value:l)),a=e.computed((()=>p(o.value.invalidLabel))),n=e.computed((()=>p(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(t.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(t.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,t,o,a,n,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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}}(m,s),{id:B,modifiers:k,disabled:L,readonly:$,loading:V,icon:O,iconPosition:w,invalid:x,valid:E,floating:P,multiple:I}=e.toRefs(u),K=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(B),M=e.computed((()=>`${K.value}-hint`)),{focused:T}=function(l,t){const{focused:a}=o.useFocus(l);return e.watch(a,(o=>{t(o?"focus":"blur",e.unref(l))})),{focused:a}}(b,d),J=o.useElementVisibility(b);e.watch(J,(e=>{e&&u.autofocus&&(T.value=!0)}));const{hasIconBefore:G,hasIconAfter:U}=function(l,t){const o=e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),a=e.computed((()=>(null==t?void 0:t.value)===r.before?o.value:void 0)),n=e.computed((()=>(null==t?void 0:t.value)===r.after?o.value:void 0)),u=e.computed((()=>(null==t?void 0:t.value)===i.left?o.value:void 0)),d=e.computed((()=>(null==t?void 0:t.value)===i.right?o.value:void 0)),s=e.computed((()=>(null==t?void 0:t.value)===i.top?o.value:void 0)),c=e.computed((()=>(null==t?void 0:t.value)===i.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:n}}(O,w),Q=e.computed((()=>{return l=u.modelValue,!(null==(t=e.unref(l))||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"==typeof t&&0===Object.keys(t).length);var l,t})),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=v("vv-select",k,e.computed((()=>({valid:E.value,invalid:x.value,loading:V.value,disabled:L.value,readonly:$.value,"icon-before":void 0!==G.value,"icon-after":void 0!==U.value,dirty:Q.value,focus:T.value,floating:P.value,multiple:I.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":g.value?M.value:void 0,"aria-errormessage":y.value?M.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:te,getOptionValue:oe,isOptionDisabled:ae,getOptionGrouped:ne}=function(l){const{options:t,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.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))),d("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(K)},e.toDisplayString(l.label),9,_)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",j,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",C,[e.unref(G)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0},e.unref(G),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(K),ref_key:"select",ref:b,"onUpdate:modelValue":t[0]||(t[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,z)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${t}`,disabled:e.unref(ae)(l),label:e.unref(te)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ne)(l),((l,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${t}-item-${o}`,disabled:e.unref(ae)(l),value:e.unref(oe)(l)},e.toDisplayString(e.unref(te)(l)),9,q)))),128))],8,R)):(e.openBlock(),e.createElementBlock("option",{key:t,disabled:e.unref(ae)(l),value:e.unref(oe)(l)},e.toDisplayString(e.unref(te)(l)),9,D))],64)))),256))],16,F),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:1},e.unref(U),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(h),{id:e.unref(M),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(S))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -4,7 +4,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
4
4
|
required: BooleanConstructor;
|
|
5
5
|
size: (StringConstructor | NumberConstructor)[];
|
|
6
6
|
modelValue: {
|
|
7
|
-
type: (ObjectConstructor | ArrayConstructor |
|
|
7
|
+
type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
8
8
|
default: undefined;
|
|
9
9
|
};
|
|
10
10
|
placeholder: StringConstructor;
|
|
@@ -104,12 +104,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
104
104
|
id: (StringConstructor | NumberConstructor)[];
|
|
105
105
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
106
106
|
[x: string]: (...args: any[]) => void;
|
|
107
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
107
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
108
108
|
multiple: BooleanConstructor;
|
|
109
109
|
required: BooleanConstructor;
|
|
110
110
|
size: (StringConstructor | NumberConstructor)[];
|
|
111
111
|
modelValue: {
|
|
112
|
-
type: (ObjectConstructor | ArrayConstructor |
|
|
112
|
+
type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
113
113
|
default: undefined;
|
|
114
114
|
};
|
|
115
115
|
placeholder: StringConstructor;
|
|
@@ -22,7 +22,7 @@ export declare const VvSelectProps: {
|
|
|
22
22
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
23
23
|
*/
|
|
24
24
|
modelValue: {
|
|
25
|
-
type: (ObjectConstructor | ArrayConstructor |
|
|
25
|
+
type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -322,8 +322,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
322
322
|
...__default__$1,
|
|
323
323
|
props: VvActionProps,
|
|
324
324
|
emits: VvActionEvents,
|
|
325
|
-
setup(__props, { expose: __expose, emit }) {
|
|
325
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
326
326
|
const props = __props;
|
|
327
|
+
const emit = __emit;
|
|
327
328
|
const volver = useVolver();
|
|
328
329
|
const element = ref(null);
|
|
329
330
|
__expose({ $el: element });
|
|
@@ -434,7 +435,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
434
435
|
};
|
|
435
436
|
}
|
|
436
437
|
});
|
|
437
|
-
const _hoisted_1
|
|
438
|
+
const _hoisted_1 = {
|
|
438
439
|
class: "vv-nav__item",
|
|
439
440
|
role: "presentation"
|
|
440
441
|
};
|
|
@@ -446,7 +447,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
446
447
|
...__default__,
|
|
447
448
|
setup(__props) {
|
|
448
449
|
return (_ctx, _cache) => {
|
|
449
|
-
return openBlock(), createElementBlock("li", _hoisted_1
|
|
450
|
+
return openBlock(), createElementBlock("li", _hoisted_1, [
|
|
450
451
|
createVNode(
|
|
451
452
|
_sfc_main$3,
|
|
452
453
|
mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
|
|
@@ -487,14 +488,14 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
487
488
|
return toReturn;
|
|
488
489
|
});
|
|
489
490
|
}
|
|
490
|
-
const _hoisted_1 = ["onClick"];
|
|
491
491
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
492
492
|
__name: "VvNav",
|
|
493
493
|
props: VvNavProps,
|
|
494
494
|
emits: VvNavEvents,
|
|
495
|
-
setup(__props, { emit }) {
|
|
495
|
+
setup(__props, { emit: __emit }) {
|
|
496
496
|
const props = __props;
|
|
497
497
|
const { modifiers } = toRefs(props);
|
|
498
|
+
const emit = __emit;
|
|
498
499
|
const onClick = (event) => {
|
|
499
500
|
var _a;
|
|
500
501
|
const target = event.target;
|
|
@@ -541,7 +542,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
541
542
|
/* KEYED_FRAGMENT */
|
|
542
543
|
))
|
|
543
544
|
])
|
|
544
|
-
]
|
|
545
|
+
])
|
|
545
546
|
],
|
|
546
547
|
2
|
|
547
548
|
/* CLASS */
|
|
@@ -553,8 +554,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
553
554
|
__name: "VvTab",
|
|
554
555
|
props: VvTabProps,
|
|
555
556
|
emits: VvTabEvents,
|
|
556
|
-
setup(__props, { emit }) {
|
|
557
|
+
setup(__props, { emit: __emit }) {
|
|
557
558
|
const props = __props;
|
|
559
|
+
const emit = __emit;
|
|
558
560
|
const { modifiers, items } = toRefs(props);
|
|
559
561
|
const tabKeys = computed(() => {
|
|
560
562
|
return items.value.reduce((acc, item) => {
|
|
@@ -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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},m={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},f={modifiers:{type:[String,Array],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...m,...c,...v,...u,type:{type:String,default:a.button,validator:e=>Object.values(a).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}},y={items:{type:Array,default:()=>[]}},k={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},g={...f,...y},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:a}){const n=t,u=e.inject(l),
|
|
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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},m={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},f={modifiers:{type:[String,Array],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...m,...c,...v,...u,type:{type:String,default:a.button,validator:e=>Object.values(a).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}},y={items:{type:Array,default:()=>[]}},k={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},g={...f,...y},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:a}){const n=t,u=a,d=e.inject(l),c=e.ref(null);o({$el:c});const{reference:v,bus:m,aria:p,expanded:f}=e.inject(i,{});e.watch((()=>c.value),(e=>{v&&(v.value=e)}));const b=e.computed((()=>n.pressed||(null==f?void 0:f.value))),{role:y}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return r.button;case void 0!==n.to:return(null==d?void 0:d.nuxt)?r.nuxtLink:r.routerLink;case void 0!==n.href:return r.a;default:return n.defaultTag}})),g=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!b.value||void 0,ariaLabel:n.ariaLabel,role:null==y?void 0:y.value};switch(k.value){case r.a:return{...e,href:n.href,target:n.target,rel:n.rel};case r.routerLink:case r.nuxtLink:return{...e,to:n.to,target:n.target};case r.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),B=e=>{n.disabled?e.preventDefault():(null==m||m.emit("click",e),u("click",e))},_=e=>{null==m||m.emit("mouseover",e),u("mouseover",e)},h=e=>{null==m||m.emit("mouseleave",e),u("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(g),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:_,onMouseleavePassive:h}),{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"},x=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 S(t,o,a){return e.computed((()=>{const r={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((o=>{r[`${t}--${o}`]=e.unref(a.value[o])})),r}))}const C=e.defineComponent({__name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const a=t,{modifiers:r}=e.toRefs(a),n=o,l=e=>{var t;const o=e.target;if(null==o?void 0:o.dataset.index){const e=parseInt(o.dataset.index),r=null==(t=a.items)?void 0:t[e];if(!r||(null==r?void 0:r.disabled))return;n("click",r)}},i=S("vv-nav",r);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[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:o={},data:a,...r},n)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:n,"data-index":n},r,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:r,data:a,index:n})))])),_:2},1040,["data-index"])))),128))]))])],2))}});return e.defineComponent({__name:"VvTab",props:k,emits:["update:modelValue"],setup(t,{emit:o}){const a=t,r=o,{modifiers:n,items:l}=e.toRefs(a),i=e.computed((()=>l.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),s=e.ref(),u=e.computed({get:()=>{var e;return a.modelValue||s.value||(null==(e=i.value)?void 0:e[0])},set:e=>{s.value=e,r("update:modelValue",e)}}),d=e.computed((()=>{var e;return["tabs",...Array.isArray(a.navModifiers)?a.navModifiers:(null==(e=a.navModifiers)?void 0:e.split(" "))??[]]})),c=e=>{e.tab&&(u.value=e.tab)},v=e.computed((()=>a.items.map((e=>({current:e.tab===u.value,...e}))))),m=S("vv-tab",n);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(C,e.mergeProps({items:e.unref(v),modifiers:e.unref(d)},{onClick:c}),{item:e.withCtx((({item:o,data:a,index:r})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,data:a,index:r})))])),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),((o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(u)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64)))),128))],2))}})}));
|
|
@@ -17,7 +17,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
17
17
|
};
|
|
18
18
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
[x: string]: (...args: any[]) => void;
|
|
20
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
20
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
21
21
|
navModifiers: {
|
|
22
22
|
type: globalThis.PropType<string | string[]>;
|
|
23
23
|
};
|
|
@@ -37,7 +37,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
37
37
|
modelValue: string;
|
|
38
38
|
modifiers: string | string[];
|
|
39
39
|
items: NavItemTab[];
|
|
40
|
-
}, {}>, Partial<Record
|
|
40
|
+
}, {}>, Partial<Record<`panel::${string}`, (_: {}) => any>> & {
|
|
41
41
|
"nav-item"?(_: {
|
|
42
42
|
item: {
|
|
43
43
|
label: string;
|
|
@@ -210,7 +210,7 @@ const __default__$1 = {
|
|
|
210
210
|
};
|
|
211
211
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
212
212
|
...__default__$1,
|
|
213
|
-
props: mergeDefaults({
|
|
213
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
214
214
|
name: {},
|
|
215
215
|
color: {},
|
|
216
216
|
width: {},
|
|
@@ -930,8 +930,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
930
930
|
...__default__,
|
|
931
931
|
props: VvTextareaProps,
|
|
932
932
|
emits: VvTextareaEvents,
|
|
933
|
-
setup(__props, { emit }) {
|
|
933
|
+
setup(__props, { emit: __emit }) {
|
|
934
934
|
const props = __props;
|
|
935
|
+
const emit = __emit;
|
|
935
936
|
const slots = useSlots();
|
|
936
937
|
const propsDefaults = useDefaults(
|
|
937
938
|
"VvTextarea",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o){"use strict";function a(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),d=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(d||{});const s=Symbol.for("volver");function v(){return e.inject(s)}function c(t,l,o){return e.computed((()=>{const a={[t]:!0},i="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return i&&Array.isArray(i)&&i.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const f=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:{}},{prefix:"normal"}),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),i=e.ref(!0),n=v(),{modifiers:r}=e.toRefs(o),u=c("vv-icon",r),d=e.computed((()=>o.provider||(null==n?void 0:n.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==n?void 0:n.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function f(e){const l=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),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return n&&o.src&&!t.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(i.value=!1,n.fetchIcon(o.src).then((e=>{e&&(f(e),i.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&f(o.svg),(l,o)=>e.unref(i)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),p={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},m={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},h={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},b=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),y={readonly:{type:Boolean,default:!1}},S={modifiers:{type:[String,Array],default:void 0}},L={hintLabel:{type:String,default:""}},B={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},x={debounce:{type:[Number,String],default:void 0}},$={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},k={tabindex:{type:[String,Number],default:0}},w={floating:{type:Boolean,default:!1}},V={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const O={...{...V,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...k,...g,...y,...p,...m,...L,...h,...S,...B,...x,...$,...w,...b,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},required:{type:Boolean,default:!1}};u.button,d.button;const N={...O,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const P=["for"],_={class:"vv-textarea__wrapper"},I={key:0,class:"vv-textarea__input-before"},C={class:"vv-textarea__inner"},E=["id"],z={key:1,class:"vv-textarea__input-after"},A={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:N,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:u}){const d=t,s=e.useSlots(),p=function(t,l,o){const a=v(),i=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===i.value)return o;const e=i.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const i=a[o];if(l[o]=i,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===i&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===i&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(i)&&(l[o]=e[o]):a===i&&(l[o]=e[o])}}return l}),{})}))}("VvTextarea",N,d),m=e.ref(),{id:h,icon:g,iconPosition:b,label:y,modelValue:S,count:L,valid:B,invalid:x,loading:$,modifiers:k,debounce:w,minlength:V,maxlength:O}=e.toRefs(d),j=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.uid()))))(h),R=e.computed((()=>`${j.value}-hint`)),T=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),q=function(t,l,o=0,{getter:a=(e=>e),setter:i=(e=>e)}={}){let n;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{n&&clearTimeout(n),n=setTimeout((()=>{l("update:modelValue",i(e))}),o)}})}(S,u,null==w?void 0:w.value),{hasIconBefore:F,hasIconAfter:D}=function(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===r.before?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===r.after?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===n.left?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===n.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===n.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===n.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:v,hasIconBefore:a,hasIconAfter:i}}(g,b),{focused:H}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}(m,u),M=o.useElementVisibility(m);e.watch(M,(e=>{e&&d.autofocus&&(H.value=!0)}));const{formatted:J}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),i=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:i}}(q,{mode:null==L?void 0:L.value,upperLimit:Number(null==O?void 0:O.value),lowerLimit:Number(null==V?void 0:V.value)}),K=e.computed((()=>!d.disabled&&!d.readonly)),U=e.computed((()=>K.value?d.tabindex:-1)),G=e.computed((()=>!a(S))),Q=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:W,hasHintLabelOrSlot:X,hasInvalidLabelOrSlot:Y,hintSlotScope:Z}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),u=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||u.value))),f=e.computed((()=>s.value||v.value||d.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,i,n,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(i=this.$slots).valid)?void 0:n.call(i))??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:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:m}}(p,s),ee=c("vv-textarea",k,e.computed((()=>({valid:B.value,invalid:x.value,loading:$.value,disabled:d.disabled,readonly:d.readonly,"icon-before":void 0!==F.value,"icon-after":void 0!==D.value,floating:d.floating&&!a(d.label),dirty:G.value,focus:H.value,resizable:d.resizable})))),te=e.computed((()=>({name:d.name,placeholder:T.value,tabindex:U.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":Q.value,"aria-describedby":X.value?R.value:void 0,"aria-errormessage":Y.value?R.value:void 0}))),le=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:oe}))),oe=()=>{q.value=void 0};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ee))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(j),class:"vv-textarea__label"},e.toDisplayString(e.unref(y)),9,P)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",_,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",C,[e.unref(F)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0},e.unref(F),{class:"vv-textarea__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(j),ref_key:"textarea",ref:m,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(q)?q.value=t:null)},e.unref(te),{onKeyup:l[1]||(l[1]=e=>u("keyup",e))}),null,16,E),[[e.vModelText,e.unref(q)]]),e.unref(D)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:1},e.unref(D),{class:"vv-textarea__icon vv-textarea__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0),e.unref(L)?(e.openBlock(),e.createElementBlock("span",A,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(le))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(J)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(W),{id:e.unref(R),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o){"use strict";function a(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const n={prefix:"normal"};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{});const v=Symbol.for("volver");function c(){return e.inject(v)}function f(t,l,o){return e.computed((()=>{const a={[t]:!0},i="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return i&&Array.isArray(i)&&i.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const p=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:{}},n),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),i=e.ref(!0),n=c(),{modifiers:r}=e.toRefs(o),u=f("vv-icon",r),d=e.computed((()=>o.provider||(null==n?void 0:n.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==n?void 0:n.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function v(e){const l=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),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return n&&o.src&&!t.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(i.value=!1,n.fetchIcon(o.src).then((e=>{e&&(v(e),i.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&v(o.svg),(l,o)=>e.unref(i)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},h={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},g={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},b={disabled:{type:Boolean,default:!1}},y=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},B={hintLabel:{type:String,default:""}},x={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},$={debounce:{type:[Number,String],default:void 0}},k={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:u.before,validation:e=>Object.values(u).includes(e)}},w={tabindex:{type:[String,Number],default:0}},V={floating:{type:Boolean,default:!1}},O={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...{...O,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...w,...b,...S,...m,...h,...B,...g,...L,...x,...$,...k,...V,...y,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},required:{type:Boolean,default:!1}};d.button,s.button;const P={...N,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const _=["for"],I={class:"vv-textarea__wrapper"},C={key:0,class:"vv-textarea__input-before"},E={class:"vv-textarea__inner"},z=["id"],A={key:1,class:"vv-textarea__input-after"},j={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:P,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:n}){const d=t,s=n,v=e.useSlots(),m=function(t,l,o){const a=c(),i=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===i.value)return o;const e=i.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const i=a[o];if(l[o]=i,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===i&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===i&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(i)&&(l[o]=e[o]):a===i&&(l[o]=e[o])}}return l}),{})}))}("VvTextarea",P,d),h=e.ref(),{id:g,icon:b,iconPosition:y,label:S,modelValue:L,count:B,valid:x,invalid:$,loading:k,modifiers:w,debounce:V,minlength:O,maxlength:N}=e.toRefs(d),R=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.uid()))))(g),T=e.computed((()=>`${R.value}-hint`)),q=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),F=function(t,l,o=0,{getter:a=(e=>e),setter:i=(e=>e)}={}){let n;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{n&&clearTimeout(n),n=setTimeout((()=>{l("update:modelValue",i(e))}),o)}})}(L,s,null==V?void 0:V.value),{hasIconBefore:D,hasIconAfter:H}=function(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===u.before?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===u.after?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===r.left?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===r.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===r.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===r.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:n,hasIconRight:d,hasIconTop:s,hasIconBottom:v,hasIconBefore:a,hasIconAfter:i}}(b,y),{focused:M}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}(h,s),J=o.useElementVisibility(h);e.watch(J,(e=>{e&&d.autofocus&&(M.value=!0)}));const{formatted:K}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),i=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:i}}(F,{mode:null==B?void 0:B.value,upperLimit:Number(null==N?void 0:N.value),lowerLimit:Number(null==O?void 0:O.value)}),U=e.computed((()=>!d.disabled&&!d.readonly)),G=e.computed((()=>U.value?d.tabindex:-1)),Q=e.computed((()=>!a(L))),W=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:X,hasHintLabelOrSlot:Y,hasInvalidLabelOrSlot:Z,hintSlotScope:ee}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),u=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||u.value))),f=e.computed((()=>s.value||v.value||d.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,i,n,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(i=this.$slots).valid)?void 0:n.call(i))??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:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:m}}(m,v),te=f("vv-textarea",w,e.computed((()=>({valid:x.value,invalid:$.value,loading:k.value,disabled:d.disabled,readonly:d.readonly,"icon-before":void 0!==D.value,"icon-after":void 0!==H.value,floating:d.floating&&!a(d.label),dirty:Q.value,focus:M.value,resizable:d.resizable})))),le=e.computed((()=>({name:d.name,placeholder:q.value,tabindex:G.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":W.value,"aria-describedby":Y.value?T.value:void 0,"aria-errormessage":Z.value?T.value:void 0}))),oe=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:ae}))),ae=()=>{F.value=void 0};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[e.unref(S)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(R),class:"vv-textarea__label"},e.toDisplayString(e.unref(S)),9,_)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",I,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[e.unref(D)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0},e.unref(D),{class:"vv-textarea__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(R),ref_key:"textarea",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(F)?F.value=t:null)},e.unref(le),{onKeyup:l[1]||(l[1]=e=>s("keyup",e))}),null,16,z),[[e.vModelText,e.unref(F)]]),e.unref(H)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1},e.unref(H),{class:"vv-textarea__icon vv-textarea__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("span",j,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(oe))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(K)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(X),{id:e.unref(T),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -13,7 +13,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
13
13
|
default: string;
|
|
14
14
|
};
|
|
15
15
|
spellcheck: {
|
|
16
|
-
type: (
|
|
16
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
17
17
|
default: string;
|
|
18
18
|
};
|
|
19
19
|
resizable: BooleanConstructor;
|
|
@@ -55,7 +55,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
55
55
|
default: undefined;
|
|
56
56
|
};
|
|
57
57
|
count: {
|
|
58
|
-
type: (
|
|
58
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
59
59
|
default: boolean;
|
|
60
60
|
validator: (value: string) => boolean;
|
|
61
61
|
};
|
|
@@ -118,7 +118,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
118
118
|
id: (StringConstructor | NumberConstructor)[];
|
|
119
119
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
120
120
|
[x: string]: (...args: any[]) => void;
|
|
121
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
121
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
122
122
|
modelValue: StringConstructor;
|
|
123
123
|
cols: {
|
|
124
124
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -133,7 +133,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
133
133
|
default: string;
|
|
134
134
|
};
|
|
135
135
|
spellcheck: {
|
|
136
|
-
type: (
|
|
136
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
137
137
|
default: string;
|
|
138
138
|
};
|
|
139
139
|
resizable: BooleanConstructor;
|
|
@@ -175,7 +175,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
175
175
|
default: undefined;
|
|
176
176
|
};
|
|
177
177
|
count: {
|
|
178
|
-
type: (
|
|
178
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
179
179
|
default: boolean;
|
|
180
180
|
validator: (value: string) => boolean;
|
|
181
181
|
};
|
|
@@ -44,7 +44,7 @@ export declare const VvTextareaProps: {
|
|
|
44
44
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#wrap
|
|
45
45
|
*/
|
|
46
46
|
spellcheck: {
|
|
47
|
-
type: (
|
|
47
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
48
48
|
default: string;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
@@ -89,7 +89,7 @@ export declare const VvTextareaProps: {
|
|
|
89
89
|
default: undefined;
|
|
90
90
|
};
|
|
91
91
|
count: {
|
|
92
|
-
type: (
|
|
92
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
93
93
|
default: boolean;
|
|
94
94
|
validator: (value: string) => boolean;
|
|
95
95
|
};
|
|
@@ -10,7 +10,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
10
10
|
type: globalThis.PropType<string | string[]>;
|
|
11
11
|
default: undefined;
|
|
12
12
|
};
|
|
13
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
13
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
14
14
|
position: {
|
|
15
15
|
type: globalThis.PropType<"left" | "right" | "top" | "bottom">;
|
|
16
16
|
default: import("../../constants").Side;
|