@volverjs/ui-vue 0.0.10-beta.53 → 0.0.10-beta.55
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/VvCheckboxGroup/VvCheckboxGroup.es.js +13 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +9 -0
- package/dist/components/VvCheckboxGroup/index.d.ts +4 -0
- package/dist/components/VvCombobox/VvCombobox.es.js +357 -357
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +17 -3
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +9 -0
- package/dist/components/VvInputFile/index.d.ts +4 -0
- package/dist/components/VvInputText/VvInputText.es.js +18 -20
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +13 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +9 -0
- package/dist/components/VvRadioGroup/index.d.ts +4 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +1296 -397
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +52 -0
- package/dist/components/VvTextarea/index.d.ts +37 -1
- package/dist/components/index.es.js +421 -261
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +8 -1
- package/dist/stories/InputText/InputText.stories.d.ts +2 -0
- package/dist/stories/InputText/InputText.test.d.ts +2 -0
- package/package.json +23 -23
- 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/VvCheckbox/VvCheckbox.vue +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +2 -0
- package/src/components/VvCombobox/VvCombobox.vue +3 -3
- package/src/components/VvInputFile/VvInputFile.vue +12 -8
- package/src/components/VvInputFile/index.ts +2 -0
- package/src/components/VvInputText/VvInputText.vue +20 -22
- package/src/components/VvRadio/VvRadio.vue +2 -2
- package/src/components/VvRadioGroup/VvRadioGroup.vue +2 -0
- package/src/components/VvTextarea/VvTextarea.vue +109 -6
- package/src/components/VvTextarea/index.ts +32 -1
- package/src/props/index.ts +2 -1
- package/src/stories/InputText/InputText.stories.ts +37 -1
- package/src/stories/InputText/InputText.test.ts +18 -0
- package/src/stories/Textarea/Textarea.stories.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.core)}(this,(function(e,t,l){"use strict";function o(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 a(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const i={prefix:"normal"};var n=(e=>(e.local="local",e.session="session",e))(n||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{});const v=Symbol.for("volver");function c(){return e.inject(v)}function f(t,l,o){return e.computed((()=>{const a={[t]:!0},i="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return i&&Array.isArray(i)&&i.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const p=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},i),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),i=e.ref(!0),n=c(),{modifiers:r}=e.toRefs(o),u=f("vv-icon",r),d=e.computed((()=>o.provider||(null==n?void 0:n.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==n?void 0:n.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function v(e){const l=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return n&&o.src&&!t.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(i.value=!1,n.fetchIcon(o.src).then((e=>{e&&(v(e),i.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&v(o.svg),(l,o)=>e.unref(i)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},h={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},g={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},b={disabled:{type:Boolean,default:!1}},y={required:{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:u.before,validation:e=>Object.values(u).includes(e)}},V={tabindex:{type:[String,Number],default:0}},N={floating:{type:Boolean,default:!1}},O={id:[String,Number]};r.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,...b,...L,...m,...h,...x,...g,...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},...y};d.button,s.button,n.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:i}){const n=t,d=i,s=e.useSlots(),v=function(t,l,o){const a=c(),i=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===i.value)return o;const e=i.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const i=a[o];if(l[o]=i,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===i&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===i&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(i)&&(l[o]=e[o]):a===i&&(l[o]=e[o])}}return l}),{})}))}("VvTextarea",_,n),m=e.ref(),{id:h,icon:g,iconPosition:b,label:y,modelValue:S,count:L,valid:B,invalid:x,loading:$,modifiers:k,debounce:w,minlength:V,maxlength:N}=e.toRefs(n),O=function(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}(h),P=e.computed((()=>`${O.value}-hint`)),q=e.computed((()=>n.floating&&o(n.placeholder)?" ":n.placeholder)),T=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)}})}(S,d,null==w?void 0:w.value),{hasIconBefore:F,hasIconAfter:D}=function(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===u.before?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===u.after?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===r.left?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===r.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===r.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===r.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:n,hasIconRight:d,hasIconTop:s,hasIconBottom:v,hasIconBefore:a,hasIconAfter:i}}(g,b),{focused:H}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(m,d),M=l.useElementVisibility(m);e.watch(M,(e=>{e&&n.autofocus&&(H.value=!0)}));const{formatted:J}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),i=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:i}}(T,{mode:null==L?void 0:L.value,upperLimit:Number(null==N?void 0:N.value),lowerLimit:Number(null==V?void 0:V.value)}),K=e.computed((()=>!n.disabled&&!n.readonly)),U=e.computed((()=>K.value?n.tabindex:-1)),G=e.computed((()=>!o(S))),Q=e.computed((()=>!0===n.invalid||!0!==n.valid&&void 0)),{HintSlot:W,hasHintLabelOrSlot:X,hasInvalidLabelOrSlot:Y,hintSlotScope:Z}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),i=e.computed((()=>a(o.value.invalidLabel))),n=e.computed((()=>a(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||i.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:i,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}}(v,s),ee=f("vv-textarea",k,e.computed((()=>({valid:B.value,invalid:x.value,loading:$.value,disabled:n.disabled,readonly:n.readonly,required:n.required,"icon-before":void 0!==F.value,"icon-after":void 0!==D.value,floating:n.floating&&!o(n.label),dirty:G.value,focus:H.value,resizable:n.resizable})))),te=e.computed((()=>({name:n.name,placeholder:q.value,tabindex:U.value,disabled:n.disabled,readonly:n.readonly,required:n.required,autocomplete:n.autocomplete,minlength:n.minlength,maxlength:n.maxlength,cols:n.cols,rows:n.rows,wrap:n.wrap,spellcheck:n.spellcheck,"aria-invalid":Q.value,"aria-describedby":X.value?P.value:void 0,"aria-errormessage":Y.value?P.value:void 0}))),le=e.computed((()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue,hintLabel:n.hintLabel,maxlength:n.maxlength,minlength:n.minlength,clear:oe})));function oe(){T.value=void 0}return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ee))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(O),class:"vv-textarea__label"},e.toDisplayString(e.unref(y)),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(le))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[e.unref(F)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0},e.unref(F),{class:"vv-textarea__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(O),ref_key:"textarea",ref:m,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(T)?T.value=t:null)},e.unref(te),{onKeyup:l[1]||(l[1]=e=>d("keyup",e))}),null,16,A),[[e.vModelText,e.unref(T)]]),e.unref(D)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1},e.unref(D),{class:"vv-textarea__icon vv-textarea__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("v-if",!0),e.unref(L)?(e.openBlock(),e.createElementBlock("span",R,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(le))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(J)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(W),{id:e.unref(P),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Z))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@floating-ui/vue"),require("@vueuse/core"),require("mitt"),require("@iconify/vue")):"function"==typeof define&&define.amd?define(["vue","@floating-ui/vue","@vueuse/core","mitt","@iconify/vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.core,e.mitt,e.vue$2)}(this,(function(e,t,o,l,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),r=(e=>(e.absolute="absolute",e.fixed="fixed",e))(r||{}),i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),u=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",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||{}),c=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(c||{}),v=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(v||{}),f=(e=>(e.listbox="listbox",e.menu="menu",e))(f||{}),p=(e=>(e.option="option",e.presentation="presentation",e))(p||{});const m=Symbol.for("volver"),g=Symbol.for("dropdownTrigger"),b=Symbol.for("dropdownItem"),h=Symbol.for("dropdownAction"),y={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},S={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},x={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},w={disabled:{type:Boolean,default:!1}},k={required:{type:Boolean,default:!1}},B={selected:{type:Boolean,default:!1}},L=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),$={readonly:{type:Boolean,default:!1}},V={modifiers:{type:[String,Array],default:void 0}},E={hintLabel:{type:String,default:""}},O={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},P={debounce:{type:[Number,String],default:void 0}},C={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},N={tabindex:{type:[String,Number],default:0}},_={floating:{type:Boolean,default:!1}},z={unselectable:{type:Boolean,default:!0}},R={id:[String,Number]},j={placement:{type:String,default:i.bottom,validator:e=>Object.values(i).includes(e)||Object.values(u).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(r).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},I={...{...R,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...N,...w,...$,...y,...S,...E,...x,...V,...O,...P,...C,..._,...L,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...k};s.button,c.button;const F={prefix:"normal"},A={...I,...{storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String},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"},iconRemoveSuggestion:{type:[String,Object],default:"trash"},labelRemoveSuggestion:{type:String,default:"Remove suggestion"},maxSuggestions:{type:Number,default:5},selectOnFocus:{type:Boolean,default:!1},resizable:Boolean};function H(t){return null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function D(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const T={...R,...j,...V,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:f.menu,validator:e=>Object.values(f).includes(e)}},q={focusOnHover:{type:Boolean,default:!1}},M={...w,...B,...z,...V,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String},focusOnHover:{type:Boolean,default:!1}};function W(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}function K(t,o,l){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{a[`${t}--${o}`]=e.unref(l.value[o])})),a}))}const J=["id","tabindex","role","aria-labelledby"],U=e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:T,emits:["update:modelValue","beforeEnter","afterLeave","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"],setup(a,{expose:n,emit:u}){const d=a,s=u,{id:c}=e.toRefs(d),v=W(c),m=e.useAttrs(),h=e.ref("auto"),y=e.ref("auto"),S=e.ref(),x=e.ref(),w=e.ref(),k=e.ref(),B=e.computed({get:()=>d.reference??S.value,set:e=>{S.value=e}}),L=e.ref(!1);e.onMounted((()=>{o.useMutationObserver(x.value,(()=>{var e;L.value="true"===(null==(e=window.getComputedStyle(x.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const $=e.computed((()=>{const e=[];if(d.autoPlacement?"boolean"==typeof d.autoPlacement?e.push(t.autoPlacement()):e.push(t.autoPlacement(d.autoPlacement)):d.flip&&("boolean"==typeof d.flip?e.push(t.flip({fallbackStrategy:"initialPlacement"})):e.push(t.flip(d.flip))),d.shift&&("boolean"==typeof d.shift?e.push(t.shift()):e.push(t.shift(d.shift))),d.size){const o=({availableWidth:e,availableHeight:t})=>{h.value=`${e}px`,y.value=`${t}px`};"boolean"==typeof d.size?e.push(t.size({apply:o})):e.push(t.size({...d.size,apply:o}))}return d.offset&&(e.push(t.offset(Number(d.offset))),["string","number"].includes(typeof d.offset)?e.push(t.offset(Number(d.offset))):e.push(t.offset(d.offset))),d.arrow&&e.push(t.arrow({element:w})),e})),{x:V,y:E,middlewareData:O,placement:P,strategy:C}=t.useFloating(B,x,{whileElementsMounted:(...e)=>t.autoUpdate(...e,{animationFrame:d.strategy===r.fixed}),placement:e.computed((()=>d.placement)),strategy:e.computed((()=>d.strategy)),middleware:$}),N=e.computed((()=>{var e;if(L.value)return;const t=d.triggerWidth&&B.value?`${null==(e=B.value)?void 0:e.offsetWidth}px`:void 0;return{position:C.value,top:`${E.value??0}px`,left:`${V.value??0}px`,maxWidth:t?void 0:h.value,maxHeight:y.value,width:t}})),_=e.computed((()=>P.value.split("-")[0])),z=e.computed((()=>{var e,t,o,l,a;if(L.value)return;const n={[i.top]:i.bottom,[i.right]:i.left,[i.bottom]:i.top,[i.left]:i.right}[_.value];return{left:void 0!==(null==(e=O.value.arrow)?void 0:e.x)?`${null==(t=O.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(o=O.value.arrow)?void 0:o.y)?`${null==(l=O.value.arrow)?void 0:l.y}px`:void 0,[n]:-((null==(a=w.value)?void 0:a.offsetWidth)??0)/2+"px"}})),R=o.useVModel(d,"modelValue",s),j=e.ref(!1),I=e.computed({get:()=>R.value??j.value,set:e=>{void 0!==R.value?R.value=e:j.value=e}});function F(){I.value=!0}function A(){I.value=!1}function H(){I.value=!I.value}function D(e){B.value=e}n({toggle:H,show:F,hide:A,init:D,customPosition:L}),e.watch(I,(t=>{t&&d.autofocusFirst&&e.nextTick((()=>{const e=Z(x.value);e.length>0&&e[0].focus({preventScroll:!0})}))})),o.onClickOutside(x,(()=>{!d.keepOpen&&I.value&&(I.value=!1)}),{ignore:[B]});const T=e.computed((()=>{var e,t;return(null==(t=null==(e=B.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),q=e.computed((()=>({"aria-controls":v.value,"aria-haspopup":!0,"aria-expanded":I.value}))),{component:M,bus:U}=function({reference:t,id:o,expanded:a,aria:n}){const r=l(),i=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(g,{reference:t,id:o,expanded:a,aria:n,bus:r})},render(){var t,o;return e.h(e.Fragment,{},null==(o=(t=this.$slots).default)?void 0:o.call(t))}});return{bus:r,component:i}}({reference:B,id:v,expanded:I,aria:q});U.on("click",H);const{role:G,modifiers:Q}=e.toRefs(d),X=K("vv-dropdown",Q,e.computed((()=>({arrow:d.arrow})))),{focused:Y}=o.useFocusWithin(x);function Z(e){return e?[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))):[]}const ee=o.useElementHover(x),{itemRole:te}=function({role:t,...o}){const l=e.computed((()=>t.value===f.listbox?p.option:p.presentation));return e.provide(b,{role:l,...o}),{itemRole:l}}({role:G,expanded:I,focused:Y,hovered:ee});o.onKeyStroke("Escape",(e=>{I.value&&(e.preventDefault(),A())})),o.onKeyStroke("ArrowDown",(t=>{I.value&&Y.value&&(t.preventDefault(),e.nextTick((()=>{if(Y.value){const e=Z(x.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t<e.length-1?e[t+1].focus({preventScroll:!0}):e[0].focus({preventScroll:!0})}})))})),o.onKeyStroke("ArrowUp",(t=>{I.value&&Y.value&&(t.preventDefault(),e.nextTick((()=>{if(Y.value){const e=Z(x.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t>0?e[t-1].focus({preventScroll:!0}):e[e.length-1].focus({preventScroll:!0})}})))})),o.onKeyStroke([" ","Enter"],(e=>{const t=e.target;I.value&&Y.value&&t&&(null==t||t.click())}));const oe={"before-enter":()=>{s(I.value?"beforeExpand":"beforeCollapse"),s("beforeEnter")},"after-leave":()=>{s(I.value?"afterExpand":"afterCollapse"),s("afterLeave")},enter:()=>{s("enter")},"after-enter":()=>{s("afterEnter")},"enter-cancelled":()=>{s("enterCancelled")},"before-leave":()=>{s("beforeLeave")},leave:()=>{s("leave")},"leave-cancelled":()=>{s("leaveCancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:D,show:F,hide:A,toggle:H,expanded:e.unref(I),aria:e.unref(q)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(oe),{persisted:""}),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:x,style:e.normalizeStyle(e.unref(N)),class:e.normalizeClass(e.unref(X))},[d.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:w,style:e.normalizeStyle(e.unref(z)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(I)}))),e.createElementVNode("div",e.mergeProps(e.unref(m),{id:e.unref(v),ref_key:"listEl",ref:k,tabindex:e.unref(I)?void 0:-1,role:e.unref(G),"aria-labelledby":e.unref(T),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(te)})))],16,J),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(I)})))],6),[[e.vShow,e.unref(I)]])])),_:3},16,["name"])],64))}});const G=e.defineComponent({name:"VvDropdownItem",props:q,setup(t){const l=t,{role:a,expanded:n}=e.inject(b,{}),r=e.ref(null);!function({expanded:t}){e.provide(h,{role:e.ref(v.menuitem),expanded:t})}({expanded:n});const i=o.useElementHover(r),{focused:u}=o.useFocus(r),{focused:d}=o.useFocusWithin(r);return e.watch(i,(e=>{e&&l.focusOnHover&&(u.value=!0)})),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(a)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":e.unref(u)||e.unref(d)}]}),[e.renderSlot(t.$slots,"default")],16))}}),Q=["title"],X=e.defineComponent({name:"VvDropdownOption",props:M,setup(t){const o=t,{modifiers:l}=e.toRefs(o),a=K("vv-dropdown-option",l,e.computed((()=>({disabled:o.disabled,selected:o.selected,unselectable:o.unselectable&&o.selected})))),n=e.computed((()=>o.selected?o.unselectable?o.deselectHintLabel:o.selectedHintLabel:o.disabled?"":o.selectHintLabel));return(t,o)=>(e.openBlock(),e.createBlock(G,{class:e.normalizeClass(e.unref(a)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled,"focus-on-hover":t.focusOnHover},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default"),e.createElementVNode("span",{class:"vv-dropdown-option__hint",title:e.unref(n)},[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps({disabled:t.disabled,selected:t.selected,unselectable:t.unselectable})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)),1)]))],8,Q)])),_:3},8,["class","tabindex","aria-selected","aria-disabled","focus-on-hover"]))}});function Y(){return e.inject(m)}const Z=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:{}},F),setup(t){const o=t,l=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),n=e.ref(!0),r=Y(),{modifiers:i}=e.toRefs(o),u=K("vv-icon",i),d=e.computed((()=>o.provider||(null==r?void 0:r.iconsProvider))),s=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(a.iconExists(t))return t;const l=null==r?void 0:r.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return a.iconExists(o)}));return l?`@${d.value}:${l.prefix}:${e}`:e}));function c(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),l=(null==t?void 0:t.innerHTML.trim())||"";t&&l&&a.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:l,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return r&&o.src&&!a.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,r.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),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(a.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(l),color:t.color,onLoad:t.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}});function ee(t,o){const l=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==o?void 0:o.value)===d.before?l.value:void 0)),n=e.computed((()=>(null==o?void 0:o.value)===d.after?l.value:void 0)),r=e.computed((()=>(null==o?void 0:o.value)===i.left?l.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===i.right?l.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===i.top?l.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===i.bottom?l.value:void 0));return{hasIcon:l,hasIconLeft:r,hasIconRight:u,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:n}}const te=["for"],oe={key:0,class:"vv-textarea__input-before"},le={class:"vv-textarea__inner"},ae=["id"],ne={key:1,class:"vv-textarea__input-after"},re={key:2,class:"vv-textarea__limit"},ie={class:"flex-1"},ue=["title","onClick"];return e.defineComponent({name:"VvTextarea",props:A,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:l}){const a=t,r=l,i=e.useSlots(),u=function(t,o,l){const a=Y(),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 l;const e=n.value,t=o,a=l;return Object.keys(t).reduce(((o,l)=>{const n=a[l];if(o[l]=n,l in e){if(Array.isArray(t[l])){const a=t[l];a.length&&a[0]===n&&(o[l]=e[l])}if("function"==typeof t[l]&&(0,t[l])()===n&&(o[l]=e[l]),"object"==typeof t[l]){let a=t[l].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(o[l]=e[l]):a===n&&(o[l]=e[l])}}return o}),{})}))}("VvTextarea",A,a),d=e.ref(),s=e.ref(),c=e.ref(),{id:v,icon:f,iconPosition:p,iconRemoveSuggestion:m,labelRemoveSuggestion:g,label:b,modelValue:h,count:y,valid:S,invalid:x,loading:w,modifiers:k,debounce:B,minlength:L,maxlength:$,storageKey:V,storageType:E}=e.toRefs(a),O=W(v),P=e.computed((()=>`${O.value}-hint`)),C=e.computed((()=>a.floating&&H(a.placeholder)?" ":a.placeholder)),N=function(t,o,l=0,{getter:a=e=>e,setter:n=e=>e}={}){let r;return"string"==typeof l&&(l=Number.parseInt(l)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{r&&clearTimeout(r),r=setTimeout((()=>{o("update:modelValue",n(e))}),l)}})}(h,r,null==B?void 0:B.value),{hasIconBefore:_,hasIconAfter:z}=ee(f,p),{hasIcon:R}=ee(m),{focused:j}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}(d,r),I=e.computed((()=>j.value&&!a.disabled&&!a.readonly));e.watch(I,(e=>{var t,o;if(e&&u.value.selectOnFocus&&d.value&&d.value.select(),e&&(null==(t=Q.value)?void 0:t.size))null==(o=c.value)||o.show();else if(J.value&&Q.value){const e=a.maxSuggestions;Q.value.size>=e&&!Q.value.has(N.value)&&(Q.value=new Set([...Q.value].slice(Q.value.size-e+1))),Q.value.add(N.value)}}));const F=o.useElementVisibility(d);e.watch(F,(e=>{e&&a.autofocus&&(j.value=!0)}));const{formatted:T}=function(t,o){const l=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&l.value<(null==o?void 0:o.lowerLimit)?l.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&l.value<(null==o?void 0:o.upperLimit)?o.upperLimit-l.value:0)),n=e.computed((()=>{if(!1===(null==o?void 0:o.mode))return"";if("limit"===(null==o?void 0:o.mode)&&(null==o?void 0:o.upperLimit))return`${l.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===a.value)return;return a}return l.value}));return{length:l,gap:a,formatted:n}}(N,{mode:null==y?void 0:y.value,upperLimit:Number(null==$?void 0:$.value),lowerLimit:Number(null==L?void 0:L.value)}),q=e.computed((()=>!a.disabled&&!a.readonly)),M=e.computed((()=>q.value?a.tabindex:-1)),J=e.computed((()=>!H(h))),G=e.computed((()=>!0===a.invalid||!0!==a.valid&&void 0)),Q=function(t,l=n.local,a){const r=e.ref();let i;return a&&(r.value=a),t&&e.watch(t,((t,a)=>{const u=e.unref(l)===n.session?sessionStorage:localStorage;a&&a!==t&&u.removeItem(a),i=t?o.useStorage(t,(null==i?void 0:i.value)??r.value,u):void 0}),{immediate:!0}),e.isRef(l)&&e.watch(l,((e,l)=>{if(null==t?void 0:t.value){if(e){const l=e===n.session?sessionStorage:localStorage;i=o.useStorage(t.value,(null==i?void 0:i.value)??r.value,l)}l&&l!==e&&(l===n.session?sessionStorage:localStorage).removeItem(t.value)}})),e.computed({get:()=>(null==i?void 0:i.value)??r.value,set:e=>{i?i.value=e:r.value=e}})}(V,E,new Set),de=e.computed((()=>Q.value?[...Q.value].filter((e=>H(N.value)||`${e}`.toLowerCase().includes(`${N.value}`.toLowerCase())&&e!==N.value)).reverse():[])),se=e.computed((()=>(null==V?void 0:V.value)&&Q.value&&Q.value.size>0));const{HintSlot:ce,hasHintLabelOrSlot:ve,hasInvalidLabelOrSlot:fe,hintSlotScope:pe}=function(t,o){const l=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>D(l.value.invalidLabel))),n=e.computed((()=>D(l.value.validLabel))),r=e.computed((()=>l.value.loadingLabel)),i=e.computed((()=>l.value.hintLabel)),u=e.computed((()=>Boolean(l.value.loading&&(o.loading||r.value)))),d=e.computed((()=>!u.value&&Boolean(l.value.invalid&&(o.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(l.value.valid&&(o.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||i.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:l.value.modelValue,valid:l.value.valid,invalid:l.value.invalid,loading:l.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:i,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,o,l,a,n,r,i,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(t=this.$slots).loading)?void 0:o.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(l=this.$slots).invalid)?void 0:a.call(l))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(r=(n=this.$slots).valid)?void 0:r.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(i=this.$slots).hint)?void 0:u.call(i))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(u,i),me=K("vv-textarea",k,e.computed((()=>({valid:S.value,invalid:x.value,loading:w.value,disabled:a.disabled,readonly:a.readonly,required:a.required,"icon-before":void 0!==_.value,"icon-after":void 0!==z.value,floating:a.floating&&!H(a.label),dirty:J.value,focus:j.value,resizable:a.resizable})))),ge=e.computed((()=>({name:a.name,placeholder:C.value,tabindex:M.value,disabled:a.disabled,readonly:a.readonly,required:a.required,autocomplete:a.autocomplete,minlength:a.minlength,maxlength:a.maxlength,cols:a.cols,rows:a.rows,wrap:a.wrap,spellcheck:a.spellcheck,"aria-invalid":G.value,"aria-describedby":ve.value?P.value:void 0,"aria-errormessage":fe.value?P.value:void 0}))),be=e.computed((()=>({valid:a.valid,invalid:a.invalid,modelValue:a.modelValue,hintLabel:a.hintLabel,maxlength:a.maxlength,minlength:a.minlength,clear:he})));function he(){N.value=void 0}return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(me))},[e.unref(b)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(O),class:"vv-textarea__label"},e.toDisplayString(e.unref(b)),9,te)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperEl",ref:s,class:"vv-textarea__wrapper"},[t.$slots.before?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",le,[e.unref(_)?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0},e.unref(_),{class:"vv-textarea__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(O),ref_key:"textareaEl",ref:d,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(N)?N.value=t:null)},e.unref(ge),{onKeyup:o[1]||(o[1]=e=>r("keyup",e))}),null,16,ae),[[e.vModelText,e.unref(N)]]),e.unref(z)?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:1},e.unref(z),{class:"vv-textarea__icon vv-textarea__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])):e.createCommentVNode("v-if",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("span",re,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(be))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(T)),1)]))])):e.createCommentVNode("v-if",!0)],512),e.createVNode(e.unref(ce),{id:e.unref(P),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(pe))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(pe))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(pe))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(pe))))])),key:"3"}:void 0]),1032,["id"]),e.unref(se)?(e.openBlock(),e.createBlock(U,{key:1,ref_key:"suggestionsDropdownEl",ref:c,reference:e.unref(s),"autofocus-first":!1,"trigger-width":!0},{items:e.withCtx((()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(de),(o=>(e.openBlock(),e.createBlock(X,{key:o,onClick:e.withModifiers((e=>{return t=o,N.value=t,void(null==(l=c.value)||l.hide());var t,l}),["stop"])},{default:e.withCtx((()=>[e.createElementVNode("div",ie,[e.renderSlot(t.$slots,"suggestion",e.mergeProps({ref_for:!0},{value:o}),(()=>[e.createTextVNode(e.toDisplayString(o),1)]))]),e.unref(Q)&&e.unref(R)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",tabindex:"-1",class:"cursor-pointer",title:e.unref(g),onClick:e.withModifiers((e=>{return t=o,void(null==(l=Q.value)||l.delete(t));var t,l}),["stop"])},[e.createVNode(Z,e.mergeProps({ref_for:!0},e.unref(R)),null,16)],8,ue)):e.createCommentVNode("v-if",!0)])),_:2},1032,["onClick"])))),128))])),_:3},8,["reference"])):e.createCommentVNode("v-if",!0)],2))}})}));
|
|
@@ -16,7 +16,29 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<gl
|
|
|
16
16
|
type: (BooleanConstructor | StringConstructor)[];
|
|
17
17
|
default: string;
|
|
18
18
|
};
|
|
19
|
+
iconRemoveSuggestion: {
|
|
20
|
+
type: PropType<string | import("../VvIcon").VvIconProps>;
|
|
21
|
+
default: "trash";
|
|
22
|
+
};
|
|
23
|
+
labelRemoveSuggestion: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
maxSuggestions: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
selectOnFocus: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
19
35
|
resizable: BooleanConstructor;
|
|
36
|
+
storageType: {
|
|
37
|
+
type: PropType<`${import("../../constants").StorageType}`>;
|
|
38
|
+
default: import("../../constants").StorageType;
|
|
39
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
40
|
+
};
|
|
41
|
+
storageKey: StringConstructor;
|
|
20
42
|
required: {
|
|
21
43
|
type: BooleanConstructor;
|
|
22
44
|
default: boolean;
|
|
@@ -134,7 +156,29 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<gl
|
|
|
134
156
|
type: (BooleanConstructor | StringConstructor)[];
|
|
135
157
|
default: string;
|
|
136
158
|
};
|
|
159
|
+
iconRemoveSuggestion: {
|
|
160
|
+
type: PropType<string | import("../VvIcon").VvIconProps>;
|
|
161
|
+
default: "trash";
|
|
162
|
+
};
|
|
163
|
+
labelRemoveSuggestion: {
|
|
164
|
+
type: StringConstructor;
|
|
165
|
+
default: string;
|
|
166
|
+
};
|
|
167
|
+
maxSuggestions: {
|
|
168
|
+
type: NumberConstructor;
|
|
169
|
+
default: number;
|
|
170
|
+
};
|
|
171
|
+
selectOnFocus: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
default: boolean;
|
|
174
|
+
};
|
|
137
175
|
resizable: BooleanConstructor;
|
|
176
|
+
storageType: {
|
|
177
|
+
type: PropType<`${import("../../constants").StorageType}`>;
|
|
178
|
+
default: import("../../constants").StorageType;
|
|
179
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
180
|
+
};
|
|
181
|
+
storageKey: StringConstructor;
|
|
138
182
|
required: {
|
|
139
183
|
type: BooleanConstructor;
|
|
140
184
|
default: boolean;
|
|
@@ -239,6 +283,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<gl
|
|
|
239
283
|
label: string | number;
|
|
240
284
|
disabled: boolean;
|
|
241
285
|
modifiers: string | string[];
|
|
286
|
+
storageType: "local" | "session";
|
|
242
287
|
icon: string | import("../VvIcon").VvIconProps;
|
|
243
288
|
iconPosition: "before" | "after";
|
|
244
289
|
required: boolean;
|
|
@@ -255,6 +300,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<gl
|
|
|
255
300
|
autocomplete: string;
|
|
256
301
|
autofocus: boolean;
|
|
257
302
|
spellcheck: string | boolean;
|
|
303
|
+
iconRemoveSuggestion: string | import("../VvIcon").VvIconProps;
|
|
304
|
+
labelRemoveSuggestion: string;
|
|
305
|
+
selectOnFocus: boolean;
|
|
306
|
+
maxSuggestions: number;
|
|
258
307
|
minlength: string | number;
|
|
259
308
|
maxlength: string | number;
|
|
260
309
|
debounce: string | number;
|
|
@@ -315,6 +364,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<gl
|
|
|
315
364
|
invalid: boolean;
|
|
316
365
|
loading: boolean;
|
|
317
366
|
}): any;
|
|
367
|
+
suggestion?(_: {
|
|
368
|
+
value: string;
|
|
369
|
+
}): any;
|
|
318
370
|
}>;
|
|
319
371
|
export default _default;
|
|
320
372
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { type VvIconProps } from '../VvIcon';
|
|
2
3
|
export declare const WRAP: {
|
|
3
4
|
hard: string;
|
|
4
5
|
soft: string;
|
|
@@ -47,10 +48,45 @@ export declare const VvTextareaProps: {
|
|
|
47
48
|
type: (BooleanConstructor | StringConstructor)[];
|
|
48
49
|
default: string;
|
|
49
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* VvIcon name for remove suggestion button
|
|
53
|
+
* @see VVIcon
|
|
54
|
+
*/
|
|
55
|
+
iconRemoveSuggestion: {
|
|
56
|
+
type: PropType<string | VvIconProps>;
|
|
57
|
+
default: "trash";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Label for remove suggestion button
|
|
61
|
+
*/
|
|
62
|
+
labelRemoveSuggestion: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Maximum number of suggestions
|
|
68
|
+
*/
|
|
69
|
+
maxSuggestions: {
|
|
70
|
+
type: NumberConstructor;
|
|
71
|
+
default: number;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Select input text on focus
|
|
75
|
+
*/
|
|
76
|
+
selectOnFocus: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
50
80
|
/**
|
|
51
81
|
* If true, the textarea will be resizable
|
|
52
82
|
*/
|
|
53
83
|
resizable: BooleanConstructor;
|
|
84
|
+
storageType: {
|
|
85
|
+
type: PropType<`${import("../../constants").StorageType}`>;
|
|
86
|
+
default: import("../../constants").StorageType;
|
|
87
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
88
|
+
};
|
|
89
|
+
storageKey: StringConstructor;
|
|
54
90
|
required: {
|
|
55
91
|
type: BooleanConstructor;
|
|
56
92
|
default: boolean;
|
|
@@ -76,7 +112,7 @@ export declare const VvTextareaProps: {
|
|
|
76
112
|
default: boolean;
|
|
77
113
|
};
|
|
78
114
|
icon: {
|
|
79
|
-
type: PropType<string |
|
|
115
|
+
type: PropType<string | VvIconProps>;
|
|
80
116
|
default: undefined;
|
|
81
117
|
};
|
|
82
118
|
iconPosition: {
|