@volverjs/ui-vue 0.0.10-beta.69 → 0.0.10-beta.70

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.
@@ -793,7 +793,7 @@ const _hoisted_7 = ["disabled", "value"];
793
793
  const _hoisted_8 = ["disabled", "label"];
794
794
  const _hoisted_9 = ["disabled", "value"];
795
795
  const _hoisted_10 = {
796
- key: 1,
796
+ key: 2,
797
797
  class: "vv-select__input-after"
798
798
  };
799
799
  const __default__ = {
@@ -1028,21 +1028,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1028
1028
  ], 16, _hoisted_5), [
1029
1029
  [vModelSelect, unref(localModelValue)]
1030
1030
  ]),
1031
- unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
1032
- key: 1,
1033
- "input-type": "select",
1034
- label: _ctx.labelClear,
1035
- icon: _ctx.iconClear,
1036
- onClear
1037
- }, null, 8, ["label", "icon"])) : createCommentVNode("v-if", true),
1038
1031
  unref(hasIconAfter) ? (openBlock(), createBlock(
1039
1032
  _sfc_main$1,
1040
- mergeProps({ key: 2 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
1033
+ mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
1041
1034
  null,
1042
1035
  16
1043
1036
  /* FULL_PROPS */
1044
1037
  )) : createCommentVNode("v-if", true)
1045
1038
  ]),
1039
+ unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
1040
+ key: 1,
1041
+ "input-type": "select",
1042
+ label: _ctx.labelClear,
1043
+ icon: _ctx.iconClear,
1044
+ disabled: !unref(isDirty),
1045
+ onClear
1046
+ }, null, 8, ["label", "icon", "disabled"])) : createCommentVNode("v-if", true),
1046
1047
  _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
1047
1048
  renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
1048
1049
  ])) : createCommentVNode("v-if", true)
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=t(e.vue,e.vue$1,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={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},c={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},v={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},p={disabled:{type:Boolean,default:!1}},f={label:{type:[String,Number],default:void 0}},m={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}},y={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},g={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},S={tabindex:{type:[String,Number],default:0}},k={floating:{type:Boolean,default:!1}},B={unselectable:{type:Boolean,default:!0}},L={id:[String,Number]};n.bottom;const $={...L,name:{type:String,required:!0}},V={autofocus:{type:Boolean,default:!1}},O={autocomplete:{type:String,default:"off"}};r.button,u.button,a.local;const C={prefix:"normal"},w={...$,...V,...O,...S,...s,...c,...h,...v,...p,...m,...b,...y,...g,...k,...B,...f,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},autoselectFirst:{type:Boolean,default:!1},placeholder:String,iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}};function I(){return{...w,options:{...w.options,type:Array,default:()=>[]}}}function P(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).join(" "):e}function x(){return e.inject(d,void 0)}function _(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 A=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:{}},C),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=x(),{modifiers:r}=e.toRefs(o),u=_("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconLoaded(l))return l;const a=null==i?void 0:i.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconLoaded(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(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 i&&o.src&&!t.iconLoaded(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(l,o)=>e.unref(n)?(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,icon:e.unref(s)},{onLoad:l.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function E(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)===i.before?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===i.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)),c=e.computed((()=>(null==l?void 0:l.value)===n.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:r}}const N=e.defineComponent({components:{VvIcon:A},props:{inputType:{type:String,default:"input-text"},disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:l}){const{hasIcon:o}=E(e.computed((()=>t.icon)));return{hasIcon:o,onClick:function(e){null==e||e.stopPropagation(),t.disabled||l("clear")}}},render(){const t=this.hasIcon?e.h(A,{...this.hasIcon,class:`vv-${this.inputType}__icon`}):void 0;return e.h("button",{disabled:this.disabled,class:`vv-${this.inputType}__action`,ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});const F=["for"],j={class:"vv-select__wrapper"},z={key:0,class:"vv-select__input-before"},D={class:"vv-select__inner"},R=["id"],q=["disabled","hidden"],H=["disabled","value"],T=["disabled","label"],K=["disabled","value"],M={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=function(t,l,o){const a=x(),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];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(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(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvSelect",I(),n),d=e.ref(),{HintSlot:s,hasHintLabelOrSlot:c,hasInvalidLabelOrSlot:v,hintSlotScope:p}=function(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)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.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}))),f=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 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:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:f}}(u,r),{focused:f}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(d,i);function m(e){var t;return"string"!=typeof e&&(null==(t=e.options)?void 0:t.length)}const{id:b,modifiers:h,disabled:y,readonly:g,loading:S,icon:k,iconPosition:B,invalid:L,valid:$,floating:V,multiple:O}=e.toRefs(n),C=function(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}(b),w=e.computed((()=>`${C.value}-hint`)),J=e.computed((()=>n.disabled||n.readonly)),G=e.computed((()=>J.value?-1:n.tabindex)),U=e.computed({get:()=>n.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter((e=>void 0!==e))).length&&!n.unselectable&&d.value?d.value.value=String(n.modelValue):i("update:modelValue",e)}}),Q=e.computed((()=>Array.isArray(U.value)?U.value.length>0:void 0!==U.value&&null!==U.value)),W=e.computed((()=>!J.value&&n.unselectable)),X=l.useElementVisibility(d);e.watch(X,(e=>{e&&n.autofocus&&(f.value=!0)}));const{hasIconBefore:Y,hasIconAfter:Z}=E(k,B),ee=e.computed((()=>!0===n.invalid||!0!==n.valid&&void 0)),te=_("vv-select",h,e.computed((()=>({valid:$.value,invalid:L.value,loading:S.value,disabled:y.value,readonly:g.value,"icon-before":void 0!==Y.value,"icon-after":void 0!==Z.value,dirty:Q.value,focus:f.value&&!J.value,floating:V.value,multiple:O.value})))),{getOptionLabel:le,getOptionValue:oe,isOptionDisabled:ae,getOptionGrouped:ne}=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);function ie(){Array.isArray(U.value)?U.value=[]:U.value=void 0,i("clear")}e.watch((()=>n.options),(e=>{if((null==e?void 0:e.length)&&n.autoselectFirst&&!Q.value){const t=oe(e[0]);U.value=n.multiple?[t]:t}}),{immediate:!0});const re=e.computed((()=>({name:n.name,tabindex:G.value,disabled:J.value,required:n.required,size:n.size,autocomplete:n.autocomplete,multiple:n.multiple,"aria-invalid":ee.value,"aria-describedby":c.value?w.value:void 0,"aria-errormessage":v.value?w.value:void 0}))),ue=e.computed((()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue})));return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(C)},e.toDisplayString(t.label),9,F)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",j,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",D,[e.unref(Y)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:0},e.unref(Y),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(C),ref_key:"selectEl",ref:d},e.unref(re),{"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(U)?U.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(W),hidden:!e.unref(W)},e.toDisplayString(t.placeholder),9,q)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,((t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(ae)(t),label:e.unref(le)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ne)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,K)))),128))],8,T)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,H))],64)))),256))],16,R),[[e.vModelSelect,e.unref(U)]]),e.unref(W)?(e.openBlock(),e.createBlock(e.unref(N),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,onClear:ie},null,8,["label","icon"])):e.createCommentVNode("v-if",!0),e.unref(Z)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:2},e.unref(Z),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(w),class:"vv-select__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),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("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=t(e.vue,e.vue$1,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={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},c={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},v={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},p={disabled:{type:Boolean,default:!1}},f={label:{type:[String,Number],default:void 0}},m={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}},y={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},g={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},S={tabindex:{type:[String,Number],default:0}},k={floating:{type:Boolean,default:!1}},B={unselectable:{type:Boolean,default:!0}},L={id:[String,Number]};n.bottom;const $={...L,name:{type:String,required:!0}},V={autofocus:{type:Boolean,default:!1}},O={autocomplete:{type:String,default:"off"}};r.button,u.button,a.local;const C={prefix:"normal"},w={...$,...V,...O,...S,...s,...c,...h,...v,...p,...m,...b,...y,...g,...k,...B,...f,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},autoselectFirst:{type:Boolean,default:!1},placeholder:String,iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}};function I(){return{...w,options:{...w.options,type:Array,default:()=>[]}}}function P(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).join(" "):e}function x(){return e.inject(d,void 0)}function _(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 A=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:{}},C),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=x(),{modifiers:r}=e.toRefs(o),u=_("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconLoaded(l))return l;const a=null==i?void 0:i.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconLoaded(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(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 i&&o.src&&!t.iconLoaded(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(l,o)=>e.unref(n)?(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,icon:e.unref(s)},{onLoad:l.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function E(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)===i.before?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===i.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)),c=e.computed((()=>(null==l?void 0:l.value)===n.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:r}}const N=e.defineComponent({components:{VvIcon:A},props:{inputType:{type:String,default:"input-text"},disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:l}){const{hasIcon:o}=E(e.computed((()=>t.icon)));return{hasIcon:o,onClick:function(e){null==e||e.stopPropagation(),t.disabled||l("clear")}}},render(){const t=this.hasIcon?e.h(A,{...this.hasIcon,class:`vv-${this.inputType}__icon`}):void 0;return e.h("button",{disabled:this.disabled,class:`vv-${this.inputType}__action`,ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});const F=["for"],j={class:"vv-select__wrapper"},z={key:0,class:"vv-select__input-before"},D={class:"vv-select__inner"},R=["id"],q=["disabled","hidden"],H=["disabled","value"],T=["disabled","label"],K=["disabled","value"],M={key:2,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=function(t,l,o){const a=x(),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];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(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(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvSelect",I(),n),d=e.ref(),{HintSlot:s,hasHintLabelOrSlot:c,hasInvalidLabelOrSlot:v,hintSlotScope:p}=function(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)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.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}))),f=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 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:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:f}}(u,r),{focused:f}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(d,i);function m(e){var t;return"string"!=typeof e&&(null==(t=e.options)?void 0:t.length)}const{id:b,modifiers:h,disabled:y,readonly:g,loading:S,icon:k,iconPosition:B,invalid:L,valid:$,floating:V,multiple:O}=e.toRefs(n),C=function(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}(b),w=e.computed((()=>`${C.value}-hint`)),J=e.computed((()=>n.disabled||n.readonly)),G=e.computed((()=>J.value?-1:n.tabindex)),U=e.computed({get:()=>n.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter((e=>void 0!==e))).length&&!n.unselectable&&d.value?d.value.value=String(n.modelValue):i("update:modelValue",e)}}),Q=e.computed((()=>Array.isArray(U.value)?U.value.length>0:void 0!==U.value&&null!==U.value)),W=e.computed((()=>!J.value&&n.unselectable)),X=l.useElementVisibility(d);e.watch(X,(e=>{e&&n.autofocus&&(f.value=!0)}));const{hasIconBefore:Y,hasIconAfter:Z}=E(k,B),ee=e.computed((()=>!0===n.invalid||!0!==n.valid&&void 0)),te=_("vv-select",h,e.computed((()=>({valid:$.value,invalid:L.value,loading:S.value,disabled:y.value,readonly:g.value,"icon-before":void 0!==Y.value,"icon-after":void 0!==Z.value,dirty:Q.value,focus:f.value&&!J.value,floating:V.value,multiple:O.value})))),{getOptionLabel:le,getOptionValue:oe,isOptionDisabled:ae,getOptionGrouped:ne}=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);function ie(){Array.isArray(U.value)?U.value=[]:U.value=void 0,i("clear")}e.watch((()=>n.options),(e=>{if((null==e?void 0:e.length)&&n.autoselectFirst&&!Q.value){const t=oe(e[0]);U.value=n.multiple?[t]:t}}),{immediate:!0});const re=e.computed((()=>({name:n.name,tabindex:G.value,disabled:J.value,required:n.required,size:n.size,autocomplete:n.autocomplete,multiple:n.multiple,"aria-invalid":ee.value,"aria-describedby":c.value?w.value:void 0,"aria-errormessage":v.value?w.value:void 0}))),ue=e.computed((()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue})));return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(C)},e.toDisplayString(t.label),9,F)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",j,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",D,[e.unref(Y)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:0},e.unref(Y),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(C),ref_key:"selectEl",ref:d},e.unref(re),{"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(U)?U.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(W),hidden:!e.unref(W)},e.toDisplayString(t.placeholder),9,q)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,((t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(ae)(t),label:e.unref(le)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ne)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,K)))),128))],8,T)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,H))],64)))),256))],16,R),[[e.vModelSelect,e.unref(U)]]),e.unref(Z)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:1},e.unref(Z),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(W)?(e.openBlock(),e.createBlock(e.unref(N),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(Q),onClear:ie},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(w),class:"vv-select__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -4329,7 +4329,7 @@ const _hoisted_7$4 = ["disabled", "value"];
4329
4329
  const _hoisted_8$4 = ["disabled", "label"];
4330
4330
  const _hoisted_9$2 = ["disabled", "value"];
4331
4331
  const _hoisted_10$1 = {
4332
- key: 1,
4332
+ key: 2,
4333
4333
  class: "vv-select__input-after"
4334
4334
  };
4335
4335
  const __default__$c = {
@@ -4564,21 +4564,22 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4564
4564
  ], 16, _hoisted_5$4), [
4565
4565
  [vModelSelect, unref(localModelValue)]
4566
4566
  ]),
4567
- unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
4568
- key: 1,
4569
- "input-type": "select",
4570
- label: _ctx.labelClear,
4571
- icon: _ctx.iconClear,
4572
- onClear
4573
- }, null, 8, ["label", "icon"])) : createCommentVNode("v-if", true),
4574
4567
  unref(hasIconAfter) ? (openBlock(), createBlock(
4575
4568
  _sfc_main$u,
4576
- mergeProps({ key: 2 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
4569
+ mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
4577
4570
  null,
4578
4571
  16
4579
4572
  /* FULL_PROPS */
4580
4573
  )) : createCommentVNode("v-if", true)
4581
4574
  ]),
4575
+ unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
4576
+ key: 1,
4577
+ "input-type": "select",
4578
+ label: _ctx.labelClear,
4579
+ icon: _ctx.iconClear,
4580
+ disabled: !unref(isDirty),
4581
+ onClear
4582
+ }, null, 8, ["label", "icon", "disabled"])) : createCommentVNode("v-if", true),
4582
4583
  _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
4583
4584
  renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
4584
4585
  ])) : createCommentVNode("v-if", true)
@@ -4641,7 +4642,7 @@ const _hoisted_7$3 = {
4641
4642
  };
4642
4643
  const _hoisted_8$3 = ["aria-label", "onClick"];
4643
4644
  const _hoisted_9$1 = {
4644
- key: 1,
4645
+ key: 2,
4645
4646
  class: "vv-select__input-after"
4646
4647
  };
4647
4648
  const __default__$b = {
@@ -5094,21 +5095,22 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
5094
5095
  ))
5095
5096
  ])
5096
5097
  ], 16, _hoisted_6$3),
5097
- unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
5098
- key: 1,
5099
- "input-type": "select",
5100
- label: _ctx.labelClear,
5101
- icon: _ctx.iconClear,
5102
- onClear
5103
- }, null, 8, ["label", "icon"])) : createCommentVNode("v-if", true),
5104
5098
  unref(hasIconAfter) ? (openBlock(), createBlock(
5105
5099
  _sfc_main$u,
5106
- mergeProps({ key: 2 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
5100
+ mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
5107
5101
  null,
5108
5102
  16
5109
5103
  /* FULL_PROPS */
5110
5104
  )) : createCommentVNode("v-if", true)
5111
5105
  ]),
5106
+ unref(isUnselectable) ? (openBlock(), createBlock(unref(VvInputClearAction), {
5107
+ key: 1,
5108
+ "input-type": "select",
5109
+ label: _ctx.labelClear,
5110
+ icon: _ctx.iconClear,
5111
+ disabled: !unref(isDirty),
5112
+ onClear
5113
+ }, null, 8, ["label", "icon", "disabled"])) : createCommentVNode("v-if", true),
5112
5114
  _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
5113
5115
  renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
5114
5116
  ])) : createCommentVNode("v-if", true)
@@ -5143,11 +5145,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
5143
5145
  unselectable: unref(isUnselectable),
5144
5146
  deselectHintLabel: unref(propsDefaults).deselectHintLabel,
5145
5147
  selectHintLabel: unref(propsDefaults).selectHintLabel,
5146
- selectedHintLabel: unref(propsDefaults).selectedHintLabel
5148
+ selectedHintLabel: unref(propsDefaults).selectedHintLabel,
5149
+ focusOnHover: _ctx.focusOnHover
5147
5150
  }, {
5148
5151
  key: i,
5149
5152
  class: "vv-dropdown-option",
5150
- "focus-on-hover": _ctx.focusOnHover,
5151
5153
  onClickPassive: ($event) => onInput(item)
5152
5154
  }), {
5153
5155
  default: withCtx(() => [
@@ -5166,7 +5168,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
5166
5168
  ]),
5167
5169
  _: 2
5168
5170
  /* DYNAMIC */
5169
- }, 1040, ["focus-on-hover", "onClickPassive"]);
5171
+ }, 1040, ["onClickPassive"]);
5170
5172
  }),
5171
5173
  128
5172
5174
  /* KEYED_FRAGMENT */
@@ -5183,10 +5185,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
5183
5185
  unselectable: unref(isUnselectable),
5184
5186
  deselectHintLabel: unref(propsDefaults).deselectHintLabel,
5185
5187
  selectHintLabel: unref(propsDefaults).selectHintLabel,
5186
- selectedHintLabel: unref(propsDefaults).selectedHintLabel
5188
+ selectedHintLabel: unref(propsDefaults).selectedHintLabel,
5189
+ focusOnHover: _ctx.focusOnHover
5187
5190
  }, {
5188
5191
  class: "vv-dropdown-option",
5189
- "focus-on-hover": _ctx.focusOnHover,
5190
5192
  onClickPassive: ($event) => onInput(option)
5191
5193
  }), {
5192
5194
  default: withCtx(() => [
@@ -5205,7 +5207,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
5205
5207
  ]),
5206
5208
  _: 2
5207
5209
  /* DYNAMIC */
5208
- }, 1040, ["focus-on-hover", "onClickPassive"]))
5210
+ }, 1040, ["onClickPassive"]))
5209
5211
  ],
5210
5212
  64
5211
5213
  /* STABLE_FRAGMENT */
@@ -6589,7 +6591,7 @@ const VvInputStepAction = defineComponent({
6589
6591
  });
6590
6592
  }
6591
6593
  });
6592
- function VvInputTextActionsFactory(type, parentProps) {
6594
+ function VvInputTextActionsFactory(type, parentProps, isDirty) {
6593
6595
  return {
6594
6596
  name: "VvInputTextActions",
6595
6597
  components: {
@@ -6603,6 +6605,7 @@ function VvInputTextActionsFactory(type, parentProps) {
6603
6605
  return parentProps.disabled || parentProps.readonly;
6604
6606
  });
6605
6607
  return {
6608
+ isDirty,
6606
6609
  isDisabled,
6607
6610
  labelStepUp: parentProps.labelStepUp,
6608
6611
  labelStepDown: parentProps.labelStepDown,
@@ -6620,7 +6623,7 @@ function VvInputTextActionsFactory(type, parentProps) {
6620
6623
  const { onClear } = this.$attrs;
6621
6624
  actions = [
6622
6625
  h(VvInputClearAction, {
6623
- disabled: this.isDisabled,
6626
+ disabled: this.isDisabled || !this.isDirty,
6624
6627
  label: this.labelClear,
6625
6628
  onClear
6626
6629
  })
@@ -7172,15 +7175,18 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
7172
7175
  } = HintSlotFactory(propsDefaults, slots);
7173
7176
  const PasswordInputActions = VvInputTextActionsFactory(
7174
7177
  INPUT_TYPES.PASSWORD,
7175
- props
7178
+ props,
7179
+ isDirty
7176
7180
  );
7177
7181
  const NumberInputActions = VvInputTextActionsFactory(
7178
7182
  INPUT_TYPES.NUMBER,
7179
- props
7183
+ props,
7184
+ isDirty
7180
7185
  );
7181
7186
  const SearchInputActions = VvInputTextActionsFactory(
7182
7187
  INPUT_TYPES.SEARCH,
7183
- props
7188
+ props,
7189
+ isDirty
7184
7190
  );
7185
7191
  function onClickInner() {
7186
7192
  if (!isDisabledOrReadonly.value) {