@volverjs/ui-vue 0.0.10-beta.44 → 0.0.10-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -6
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +2 -7
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -6
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -6
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +0 -22
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -6
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +1 -6
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +0 -22
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +0 -22
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +24 -32
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +18 -18
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +8 -8
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +0 -5
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -6
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +0 -22
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +19 -4
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +3 -3
- package/dist/components/VvNav/VvNav.es.js +0 -5
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +0 -22
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +0 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +0 -5
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +43 -36
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +46 -46
- package/dist/composables/index.es.js +4 -4
- package/dist/composables/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +217 -33
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -1
- package/dist/stories/Radio/Radio.settings.d.ts +1 -1
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -1
- package/package.json +39 -39
- 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/VvCombobox/VvCombobox.vue +25 -12
- package/src/components/VvIcon/VvIcon.vue +1 -1
- package/src/components/VvInputText/VvInputText.vue +21 -7
|
@@ -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.local="local",e.session="session",e))(a||{}),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"),s=Symbol.for("radioGroup");function v(e,t,l){return l?c(e,l)===c(t,l):f(e,t)}function f(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(!f(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 v=Object.keys(e);if(n=v.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,v[a]))return!1;for(a=n;0!=a--;)if(i=v[a],!f(e[i],t[i]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function c(e,t){if(e&&Object.keys(e).length&&t){if(t.includes(".")){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 e[t]}return null}function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function m(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),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&&(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)),c=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:c,HintSlot:m}}const b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},g={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),L={readonly:{type:Boolean,default:!1}},B={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"}};i.before;const V={tabindex:{type:[String,Number],default:0}},$={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const R={...{...$,name:{type:String,required:!0}},...V,...b,...g,...k,...h,...L,...B,...S,...y,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},x={...b,...g,...O,...k,...h,...L,...B,...S,...y,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,a.local;const N=R;function A(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>void 0!==l));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(o,t);return e.computed({get:()=>i.value,set(e){a&&a(`update:${t}`,e)}})}}}(s),r=i("modelValue",t,l),u=i("valid",t),d=i("invalid",t),v=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),f=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:d,readonly:v,disabled:f}}function P(t,l,o){const a=e.inject(d),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 j(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"],_=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],w=e.defineComponent({name:"VvRadio",props:N,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=o,i=e.useSlots(),r=P("VvRadio",N,a),{id:u,disabled:d,readonly:s,modelValue:f,valid:c,invalid:p}=A(a,n),b=function(l){return e.computed((()=>String((null==l?void 0:l.value)||t.uid())))}(u),g=e.computed((()=>`${b.value}-hint`)),y=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>d.value||s.value)),L=e.computed((()=>!0===p.value||!0!==c.value&&void 0)),B=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(a.value,f.value):v(a.value,f.value))),k=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),O=e.computed({get:()=>B.value?k.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,n("change",e)}}),{modifiers:V}=e.toRefs(a),$=j("vv-radio",V,e.computed((()=>({valid:c.value,invalid:p.value,disabled:d.value,readonly:s.value})))),{HintSlot:R,hasHintLabelOrSlot:x,hasInvalidLabelOrSlot:w,hintSlotScope:z}=m(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(O)?O.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(k),tabindex:e.unref(y),"aria-invalid":e.unref(L),"aria-describedby":e.unref(x)?e.unref(g):void 0,"aria-errormessage":e.unref(w)?e.unref(g):void 0},null,8,_),[[e.vModelRadio,e.unref(O)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(R),{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(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))}}),z=x;const E=["textContent"],G={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:z,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=P("VvRadioGroup",z,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:f,vertical:c,valid:p,invalid:b,modifiers:g}=e.toRefs(n);var y,h;y=s,h={modelValue:d,disabled:v,readonly:f,valid:p,invalid:b},e.provide(y,h);const{getOptionLabel:S,getOptionValue:L}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):String(a.value?o.get(e,a.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof n.value?n.value(e):n.value?o.get(e,n.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof i.value?i.value(e):!!i.value&&o.get(e,i.value)),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}(n),B=j("vv-radio-group",g,e.computed((()=>({disabled:v.value,readonly:f.value,horizontal:!c.value,valid:p.value,invalid:b.value}))));const{HintSlot:k,hintSlotScope:O}=m(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(B))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,E)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",G,[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,ref_for:!0},function(e,t){return{id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:L(e)}}(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(k),{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(O))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),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.local="local",e.session="session",e))(a||{}),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"),s=Symbol.for("radioGroup");function v(e,t,l){return f(e,t)}function f(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(!f(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 v=Object.keys(e);if(n=v.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,v[a]))return!1;for(a=n;0!=a--;)if(i=v[a],!f(e[i],t[i]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function c(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),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&&(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)),c=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:c,HintSlot:m}}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}},g={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={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}},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"}};i.before;const O={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...V,name:{type:String,required:!0}},...O,...m,...b,...B,...y,...S,...L,...h,...g,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},R={...m,...b,...k,...B,...y,...S,...L,...h,...g,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,a.local;const x=$;function N(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>void 0!==l));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(o,t);return e.computed({get:()=>i.value,set(e){a&&a(`update:${t}`,e)}})}}}(s),r=i("modelValue",t,l),u=i("valid",t),d=i("invalid",t),v=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),f=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:d,readonly:v,disabled:f}}function A(t,l,o){const a=e.inject(d),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"],j=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],_=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:d,readonly:s,modelValue:f,valid:p,invalid:m}=N(a,n),b=function(l){return e.computed((()=>String((null==l?void 0:l.value)||t.uid())))}(u),g=e.computed((()=>`${b.value}-hint`)),y=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>d.value||s.value)),L=e.computed((()=>!0===m.value||!0!==p.value&&void 0)),B=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(a.value,f.value):v(a.value,f.value))),k=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),O=e.computed({get:()=>B.value?k.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,n("change",e)}}),{modifiers:V}=e.toRefs(a),$=P("vv-radio",V,e.computed((()=>({valid:p.value,invalid:m.value,disabled:d.value,readonly:s.value})))),{HintSlot:R,hasHintLabelOrSlot:_,hasInvalidLabelOrSlot:w,hintSlotScope:z}=c(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(O)?O.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(k),tabindex:e.unref(y),"aria-invalid":e.unref(L),"aria-describedby":e.unref(_)?e.unref(g):void 0,"aria-errormessage":e.unref(w)?e.unref(g):void 0},null,8,j),[[e.vModelRadio,e.unref(O)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(R),{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(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))}}),w=R;const z=["textContent"],E={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:w,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=A("VvRadioGroup",w,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:f,vertical:p,valid:m,invalid:b,modifiers:g}=e.toRefs(n);var y,h;y=s,h={modelValue:d,disabled:v,readonly:f,valid:m,invalid:b},e.provide(y,h);const{getOptionLabel:S,getOptionValue:L}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):String(a.value?o.get(e,a.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof n.value?n.value(e):n.value?o.get(e,n.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof i.value?i.value(e):!!i.value&&o.get(e,i.value)),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}(n),B=P("vv-radio-group",g,e.computed((()=>({disabled:v.value,readonly:f.value,horizontal:!p.value,valid:m.value,invalid:b.value}))));const{HintSlot:k,hintSlotScope:O}=c(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(B))},[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(_,e.mergeProps({key:l,ref_for:!0},function(e,t){return{id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:L(e)}}(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(k),{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(O))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(O))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Option } from '../../types/generic';
|
|
2
|
-
declare const _default: <T extends string | Option>(__VLS_props: Awaited<typeof __VLS_setup
|
|
2
|
+
declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
3
|
props: __VLS_Prettify<Pick<Partial<{
|
|
4
4
|
floating: boolean;
|
|
5
5
|
label: string | number;
|
|
@@ -172,7 +172,7 @@ declare const _default: <T extends string | Option>(__VLS_props: Awaited<typeof
|
|
|
172
172
|
onFocus?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
|
|
173
173
|
onBlur?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
|
|
174
174
|
"onUpdate:modelValue"?: ((args_0: any) => any) | undefined;
|
|
175
|
-
}, "floating" | "label" | "disabled" | "modelValue" | "modifiers" | "readonly" | "required" | "icon" | "iconPosition" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "hintLabel" | "valid" | "validLabel" | "invalid" | "invalidLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "autocomplete" | "autofocus">, "size" | "name" | "id" | "onFocus" | "onBlur" | "onUpdate:modelValue" | "placeholder" | ("floating" | "label" | "disabled" | "modelValue" | "modifiers" | "readonly" | "required" | "icon" | "iconPosition" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "hintLabel" | "valid" | "validLabel" | "invalid" | "invalidLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "autocomplete" | "autofocus")> & {}> &
|
|
175
|
+
}, "floating" | "label" | "disabled" | "modelValue" | "modifiers" | "readonly" | "required" | "icon" | "iconPosition" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "hintLabel" | "valid" | "validLabel" | "invalid" | "invalidLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "autocomplete" | "autofocus">, "size" | "name" | "id" | "onFocus" | "onBlur" | "onUpdate:modelValue" | "placeholder" | ("floating" | "label" | "disabled" | "modelValue" | "modifiers" | "readonly" | "required" | "icon" | "iconPosition" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "hintLabel" | "valid" | "validLabel" | "invalid" | "invalidLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "autocomplete" | "autofocus")> & {}> & import("vue").PublicProps;
|
|
176
176
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
177
177
|
attrs: any;
|
|
178
178
|
slots: ReturnType<() => {
|
|
@@ -498,11 +498,6 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
if (others) {
|
|
502
|
-
Object.keys(others.value).forEach((key) => {
|
|
503
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
501
|
return toReturn;
|
|
507
502
|
});
|
|
508
503
|
}
|
|
@@ -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.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),
|
|
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.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:String,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}},f={label:{type:[String,Number],default:void 0}},p={modifiers:{type:[String,Array],default:void 0}};n.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...f,...m,...c,...v,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:l.button}},y={items:{type:Array,default:()=>[]}};t.local;const g={...p,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},k=b;const B=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,u=n,d=e.getCurrentInstance(),c=e.inject(a),v=e.ref(null);o({$el:v});const{reference:m,bus:f,aria:p,expanded:b}=e.inject(i,{});e.watch((()=>v.value),(e=>{m&&(m.value=e)}));const y=e.computed((()=>r.pressed||(null==b?void 0:b.value))),{role:g}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case r.disabled:return l.button;case void 0!==r.to:return(null==c?void 0:c.nuxt)?l.nuxtLink:l.routerLink;case void 0!==r.href:return l.a;default:return r.defaultTag}})),B=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!y.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(k.value){case l.a:return{...e,href:r.href,target:r.target,rel:r.rel};case l.routerLink:case l.nuxtLink:return{...e,to:r.to,target:r.target};case l.button:return{...e,type:r.type,disabled:r.disabled};default:return e}}));function x(e){var t;r.disabled?e.preventDefault():(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onClick)?u("click",e):null==f||f.emit("click",e)}function S(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseover)?u("mouseover",e):null==f||f.emit("mouseover",e)}function h(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseleave)?u("mouseleave",e):null==f||f.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(B),{ref_key:"element",ref:v,class:{active:t.active,pressed:e.unref(y),disabled:t.disabled,current:t.current},onClickPassive:x,onMouseoverPassive:S,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),x={class:"vv-nav__item",role:"presentation"},S=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",x,[e.createVNode(B,e.mergeProps(t.$attrs,{class:"vv-nav__item-label",role:"menuitem"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))}),h={...p,...y};function C(t,o,n){return e.computed((()=>{const e={[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((o=>{o&&(e[`${t}--${o}`]=!0)})),e}))}const _=e.defineComponent({name:"VvNav",props:h,emits:["click"],setup(t,{emit:o}){const n=t,r=o,{modifiers:l}=e.toRefs(n);function a(e){var t;const o=e.target;if(null==o?void 0:o.dataset.index){const e=Number.parseInt(o.dataset.index),l=null==(t=n.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;r("click",l)}}const i=C("vv-nav",l);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu",onClick:e.withModifiers(a,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:n,...r},l)=>(e.openBlock(),e.createBlock(S,e.mergeProps({key:l,"data-index":l,ref_for:!0},r,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.mergeProps({ref_for:!0},{item:r,data:n,index:l}))])),_:2},1040,["data-index"])))),128))]))])],2))}});return e.defineComponent({name:"VvTab",props:g,emits:["update:modelValue"],setup(t,{emit:o}){const n=t,r=o,{modifiers:l,items:a}=e.toRefs(n),i=e.computed((()=>a.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),s=e.ref(),u=e.computed({get:()=>{var e;return n.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(n.navModifiers)?n.navModifiers:(null==(e=n.navModifiers)?void 0:e.split(" "))??[]]}));function c(e){e.tab&&(u.value=e.tab)}const v=e.computed((()=>n.items.map((e=>({current:e.tab===u.value,...e}))))),m=C("vv-tab",l);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(_,e.mergeProps({items:e.unref(v),modifiers:e.unref(d)},{onClick:c}),{item:e.withCtx((({item:o,data:n,index:r})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,data:n,index:r})))])),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),((o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[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))}})}));
|
|
@@ -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}const n={prefix:"normal"};var r=(e=>(e.local="local",e.session="session",e))(r||{}),u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),v=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(v||{});const c=Symbol.for("volver");function f(){return e.inject(c)}function p(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 m=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?Number.parseFloat(o.rotate):o.rotate)),i=e.ref(!0),n=f(),{modifiers:r}=e.toRefs(o),u=p("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)}}),h={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},g={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),L={readonly:{type:Boolean,default:!1}},B={modifiers:{type:[String,Array],default:void 0}},x={hintLabel:{type:String,default:""}},$={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},k={debounce:{type:[Number,String],default:void 0}},w={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},V={tabindex:{type:[String,Number],default:0}},N={floating:{type:Boolean,default:!1}},O={id:[String,Number]};u.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const P={...{...O,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...V,...y,...L,...h,...g,...x,...b,...B,...$,...k,...w,...N,...S,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}};s.button,v.button,r.local;const _={...P,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 I=["for"],C={class:"vv-textarea__wrapper"},E={key:0,class:"vv-textarea__input-before"},z={class:"vv-textarea__inner"},A=["id"],j={key:1,class:"vv-textarea__input-after"},R={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:_,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:n}){const r=t,s=n,v=e.useSlots(),c=function(t,l,o){const a=f(),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",_,r),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:N,maxlength:O}=e.toRefs(r),P=function(t){return e.computed((()=>String((null==t?void 0:t.value)||l.uid())))}(g),T=e.computed((()=>`${P.value}-hint`)),q=e.computed((()=>r.floating&&a(r.placeholder)?" ":r.placeholder)),F=function(t,l,o=0,{getter:a=(e=>e),setter:i=(e=>e)}={}){let n;return"string"==typeof o&&(o=Number.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)===d.before?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===d.after?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===u.left?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===u.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===u.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===u.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:n,hasIconRight:r,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&&r.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==O?void 0:O.value),lowerLimit:Number(null==N?void 0:N.value)}),U=e.computed((()=>!r.disabled&&!r.readonly)),G=e.computed((()=>U.value?r.tabindex:-1)),Q=e.computed((()=>!a(L))),W=e.computed((()=>!0===r.invalid||!0!==r.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}}(c,v),te=p("vv-textarea",w,e.computed((()=>({valid:x.value,invalid:$.value,loading:k.value,disabled:r.disabled,readonly:r.readonly,"icon-before":void 0!==D.value,"icon-after":void 0!==H.value,floating:r.floating&&!a(r.label),dirty:Q.value,focus:M.value,resizable:r.resizable})))),le=e.computed((()=>({name:r.name,placeholder:q.value,tabindex:G.value,disabled:r.disabled,readonly:r.readonly,required:r.required,autocomplete:r.autocomplete,minlength:r.minlength,maxlength:r.maxlength,cols:r.cols,rows:r.rows,wrap:r.wrap,spellcheck:r.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:r.valid,invalid:r.invalid,modelValue:r.modelValue,hintLabel:r.hintLabel,maxlength:r.maxlength,minlength:r.minlength,clear:ae})));function 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(P),class:"vv-textarea__label"},e.toDisplayString(e.unref(S)),9,I)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",C,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",E,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[e.unref(D)?(e.openBlock(),e.createBlock(m,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(P),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,A),[[e.vModelText,e.unref(F)]]),e.unref(H)?(e.openBlock(),e.createBlock(m,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",j,[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",R,[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))}})}));
|
|
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.local="local",e.session="session",e))(r||{}),u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),v=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(v||{});const c=Symbol.for("volver");function f(){return e.inject(c)}function p(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 m=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?Number.parseFloat(o.rotate):o.rotate)),i=e.ref(!0),n=f(),{modifiers:r}=e.toRefs(o),u=p("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)}}),h={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},g={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),L={readonly:{type:Boolean,default:!1}},B={modifiers:{type:[String,Array],default:void 0}},x={hintLabel:{type:String,default:""}},$={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},k={debounce:{type:[Number,String],default:void 0}},w={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},V={tabindex:{type:[String,Number],default:0}},N={floating:{type:Boolean,default:!1}},O={id:[String,Number]};u.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const P={...{...O,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...V,...y,...L,...h,...g,...x,...b,...B,...$,...k,...w,...N,...S,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}};s.button,v.button,r.local;const _={...P,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 I=["for"],C={class:"vv-textarea__wrapper"},E={key:0,class:"vv-textarea__input-before"},z={class:"vv-textarea__inner"},A=["id"],j={key:1,class:"vv-textarea__input-after"},R={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:_,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:n}){const r=t,s=n,v=e.useSlots(),c=function(t,l,o){const a=f(),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",_,r),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:N,maxlength:O}=e.toRefs(r),P=function(t){return e.computed((()=>String((null==t?void 0:t.value)||l.uid())))}(g),T=e.computed((()=>`${P.value}-hint`)),q=e.computed((()=>r.floating&&a(r.placeholder)?" ":r.placeholder)),F=function(t,l,o=0,{getter:a=e=>e,setter:i=e=>e}={}){let n;return"string"==typeof o&&(o=Number.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)===d.before?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===d.after?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===u.left?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===u.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===u.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===u.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:n,hasIconRight:r,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&&r.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==O?void 0:O.value),lowerLimit:Number(null==N?void 0:N.value)}),U=e.computed((()=>!r.disabled&&!r.readonly)),G=e.computed((()=>U.value?r.tabindex:-1)),Q=e.computed((()=>!a(L))),W=e.computed((()=>!0===r.invalid||!0!==r.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}}(c,v),te=p("vv-textarea",w,e.computed((()=>({valid:x.value,invalid:$.value,loading:k.value,disabled:r.disabled,readonly:r.readonly,"icon-before":void 0!==D.value,"icon-after":void 0!==H.value,floating:r.floating&&!a(r.label),dirty:Q.value,focus:M.value,resizable:r.resizable})))),le=e.computed((()=>({name:r.name,placeholder:q.value,tabindex:G.value,disabled:r.disabled,readonly:r.readonly,required:r.required,autocomplete:r.autocomplete,minlength:r.minlength,maxlength:r.maxlength,cols:r.cols,rows:r.rows,wrap:r.wrap,spellcheck:r.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:r.valid,invalid:r.invalid,modelValue:r.modelValue,hintLabel:r.hintLabel,maxlength:r.maxlength,minlength:r.minlength,clear:ae})));function 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(P),class:"vv-textarea__label"},e.toDisplayString(e.unref(S)),9,I)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",C,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",E,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[e.unref(D)?(e.openBlock(),e.createBlock(m,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(P),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,A),[[e.vModelText,e.unref(F)]]),e.unref(H)?(e.openBlock(),e.createBlock(m,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",j,[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",R,[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))}})}));
|
|
@@ -2338,9 +2338,6 @@ function useGroupProps$2(props, emit) {
|
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
2340
|
function equals(obj1, obj2, field) {
|
|
2341
|
-
if (field) {
|
|
2342
|
-
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
2343
|
-
}
|
|
2344
2341
|
return deepEquals(obj1, obj2);
|
|
2345
2342
|
}
|
|
2346
2343
|
function deepEquals(a, b) {
|
|
@@ -2391,25 +2388,6 @@ function deepEquals(a, b) {
|
|
|
2391
2388
|
}
|
|
2392
2389
|
return Number.isNaN(a) && Number.isNaN(b);
|
|
2393
2390
|
}
|
|
2394
|
-
function resolveFieldData(data, field) {
|
|
2395
|
-
if (data && Object.keys(data).length && field) {
|
|
2396
|
-
if (!field.includes(".")) {
|
|
2397
|
-
return data[field];
|
|
2398
|
-
} else {
|
|
2399
|
-
const fields = field.split(".");
|
|
2400
|
-
let value = data;
|
|
2401
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
2402
|
-
if (data == null) {
|
|
2403
|
-
return null;
|
|
2404
|
-
}
|
|
2405
|
-
value = value[fields[i]];
|
|
2406
|
-
}
|
|
2407
|
-
return value;
|
|
2408
|
-
}
|
|
2409
|
-
} else {
|
|
2410
|
-
return null;
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
2391
|
function contains(value, list) {
|
|
2414
2392
|
if (value != null && list && list.length) {
|
|
2415
2393
|
for (const val of list) {
|
|
@@ -4668,15 +4646,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4668
4646
|
const localModelValue = computed({
|
|
4669
4647
|
get: () => {
|
|
4670
4648
|
if (Array.isArray(props.modelValue)) {
|
|
4671
|
-
return
|
|
4649
|
+
return props.modelValue;
|
|
4672
4650
|
}
|
|
4673
|
-
return props.modelValue !== void 0 && props.modelValue !== null ?
|
|
4651
|
+
return props.modelValue !== void 0 && props.modelValue !== null ? [props.modelValue] : [];
|
|
4674
4652
|
},
|
|
4675
4653
|
set: (value) => {
|
|
4676
|
-
emit("update:modelValue", props.multiple || Array.isArray(props.modelValue) ?
|
|
4654
|
+
emit("update:modelValue", props.multiple || Array.isArray(props.modelValue) ? value : value.pop());
|
|
4677
4655
|
}
|
|
4678
4656
|
});
|
|
4679
|
-
const sizeOfModelValue = computed(() => localModelValue.value.
|
|
4657
|
+
const sizeOfModelValue = computed(() => localModelValue.value.length);
|
|
4680
4658
|
const isDirty = computed(() => sizeOfModelValue.value > 0);
|
|
4681
4659
|
const hasMaxValues = computed(() => {
|
|
4682
4660
|
if (!props.multiple) {
|
|
@@ -4694,7 +4672,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4694
4672
|
if (!props.unselectable) {
|
|
4695
4673
|
return false;
|
|
4696
4674
|
}
|
|
4697
|
-
return sizeOfModelValue.value > Number(props.minValues);
|
|
4675
|
+
return Number(props.minValues) === 0 || sizeOfModelValue.value > Number(props.minValues);
|
|
4698
4676
|
});
|
|
4699
4677
|
const isSelectable = computed(() => {
|
|
4700
4678
|
if (isDisabledOrReadonly.value) {
|
|
@@ -4752,7 +4730,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4752
4730
|
});
|
|
4753
4731
|
});
|
|
4754
4732
|
function isOptionSelected(option) {
|
|
4755
|
-
|
|
4733
|
+
const optionValue = getOptionValue(option);
|
|
4734
|
+
if (typeof optionValue === "object") {
|
|
4735
|
+
return localModelValue.value.some((item) => {
|
|
4736
|
+
if (typeof item === "object") {
|
|
4737
|
+
return JSON.stringify(item) === JSON.stringify(optionValue);
|
|
4738
|
+
}
|
|
4739
|
+
return false;
|
|
4740
|
+
});
|
|
4741
|
+
}
|
|
4742
|
+
return localModelValue.value.includes(optionValue);
|
|
4756
4743
|
}
|
|
4757
4744
|
const selectedOptions = computed(() => {
|
|
4758
4745
|
const options = props.options.reduce(
|
|
@@ -4776,15 +4763,20 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4776
4763
|
}
|
|
4777
4764
|
function onInput(option) {
|
|
4778
4765
|
const isSelected = isOptionSelected(option);
|
|
4766
|
+
const optionValue = getOptionValue(option);
|
|
4779
4767
|
if (isSelected && isUnselectable.value) {
|
|
4780
|
-
localModelValue.value.
|
|
4768
|
+
localModelValue.value = localModelValue.value.filter((item) => {
|
|
4769
|
+
if (typeof optionValue === "object" && typeof item === "object") {
|
|
4770
|
+
return JSON.stringify(item) !== JSON.stringify(optionValue);
|
|
4771
|
+
}
|
|
4772
|
+
return item !== optionValue;
|
|
4773
|
+
});
|
|
4781
4774
|
} else if (!isSelected && isSelectable.value) {
|
|
4782
4775
|
if (!props.multiple) {
|
|
4783
|
-
localModelValue.value
|
|
4776
|
+
localModelValue.value = [];
|
|
4784
4777
|
}
|
|
4785
|
-
localModelValue.value.
|
|
4778
|
+
localModelValue.value = [...localModelValue.value, optionValue];
|
|
4786
4779
|
}
|
|
4787
|
-
localModelValue.value = new Set(localModelValue.value);
|
|
4788
4780
|
if (!props.multiple && !props.keepOpen) {
|
|
4789
4781
|
collapse();
|
|
4790
4782
|
}
|
|
@@ -6026,8 +6018,23 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6026
6018
|
const maskReady = ref(false);
|
|
6027
6019
|
const { el, mask, typed, masked, unmasked } = useIMask(
|
|
6028
6020
|
computed(
|
|
6029
|
-
() =>
|
|
6030
|
-
|
|
6021
|
+
() => {
|
|
6022
|
+
if (!props.iMask) {
|
|
6023
|
+
return {
|
|
6024
|
+
mask: /./
|
|
6025
|
+
};
|
|
6026
|
+
}
|
|
6027
|
+
if (props.iMask.mask === Number) {
|
|
6028
|
+
const toReturn = { ...props.iMask };
|
|
6029
|
+
if (props.min) {
|
|
6030
|
+
toReturn.min = Number(props.min);
|
|
6031
|
+
}
|
|
6032
|
+
if (props.max) {
|
|
6033
|
+
toReturn.max = Number(props.max);
|
|
6034
|
+
}
|
|
6035
|
+
return toReturn;
|
|
6036
|
+
}
|
|
6037
|
+
return props.iMask;
|
|
6031
6038
|
}
|
|
6032
6039
|
),
|
|
6033
6040
|
{
|
|
@@ -6188,7 +6195,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6188
6195
|
function onStepUp() {
|
|
6189
6196
|
if (isClickable.value) {
|
|
6190
6197
|
if (props.iMask) {
|
|
6191
|
-
typed.value = typed.value + Number((step == null ? void 0 : step.value) ?? 1);
|
|
6198
|
+
typed.value = Number(typed.value) + Number((step == null ? void 0 : step.value) ?? 1);
|
|
6192
6199
|
return;
|
|
6193
6200
|
}
|
|
6194
6201
|
inputEl.value.stepUp();
|
|
@@ -6198,7 +6205,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6198
6205
|
function onStepDown() {
|
|
6199
6206
|
if (isClickable.value) {
|
|
6200
6207
|
if (props.iMask) {
|
|
6201
|
-
typed.value = typed.value - Number((step == null ? void 0 : step.value) ?? 1);
|
|
6208
|
+
typed.value = Number(typed.value) - Number((step == null ? void 0 : step.value) ?? 1);
|
|
6202
6209
|
return;
|
|
6203
6210
|
}
|
|
6204
6211
|
inputEl.value.stepDown();
|