@volverjs/ui-vue 0.0.1-beta.5 → 0.0.1-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +61 -2
  2. package/dist/components/VvButton/vv-button.es.js +56 -58
  3. package/dist/components/VvButton/vv-button.umd.js +1 -1
  4. package/dist/components/VvCheckGroup/vv-check-group.es.js +221 -203
  5. package/dist/components/VvCheckGroup/vv-check-group.umd.js +2 -2
  6. package/dist/components/VvInputText/VvInputText.d.ts +14 -0
  7. package/dist/components/VvInputText/VvInputText.vue.d.ts +36 -1
  8. package/dist/components/VvInputText/VvInputTextActions.d.ts +3 -0
  9. package/dist/components/VvInputText/vv-input-text.es.js +509 -380
  10. package/dist/components/VvInputText/vv-input-text.umd.js +2 -2
  11. package/dist/components/VvNativeSelect/vv-native-select.es.js +180 -161
  12. package/dist/components/VvNativeSelect/vv-native-select.umd.js +2 -2
  13. package/dist/components/VvRadioGroup/vv-radio-group.es.js +211 -193
  14. package/dist/components/VvRadioGroup/vv-radio-group.umd.js +2 -2
  15. package/dist/components/VvSelect/vv-select.es.js +189 -171
  16. package/dist/components/VvSelect/vv-select.umd.js +2 -2
  17. package/dist/components/VvTextarea/VvTextarea.d.ts +43 -22
  18. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +140 -85
  19. package/dist/components/VvTextarea/vv-textarea.es.js +364 -288
  20. package/dist/components/VvTextarea/vv-textarea.umd.js +2 -2
  21. package/dist/composables/debouncedInput/useDebouncedInput.d.ts +2 -0
  22. package/dist/composables/icons/useComponentIcons.d.ts +6 -0
  23. package/dist/composables/textLimit/useTextLimit.d.ts +14 -0
  24. package/dist/composables/useModifiers.d.ts +3 -2
  25. package/dist/icons.es.js +3 -3
  26. package/dist/icons.umd.js +1 -1
  27. package/dist/props/index.d.ts +42 -0
  28. package/dist/stories/utils.d.ts +5 -0
  29. package/dist/ui-vue.es.js +417 -401
  30. package/dist/ui-vue.umd.js +2 -2
  31. package/package.json +3 -1
  32. package/src/assets/icons/detailed.json +1 -1
  33. package/src/assets/icons/normal.json +1 -1
  34. package/src/assets/icons/simple.json +1 -1
  35. package/src/components/VvButton/VvButton.vue +1 -2
  36. package/src/components/VvInputText/VvInputText.ts +19 -2
  37. package/src/components/VvInputText/VvInputText.vue +123 -149
  38. package/src/components/VvInputText/VvInputTextActions.ts +151 -0
  39. package/src/components/VvTextarea/VvTextarea.ts +25 -16
  40. package/src/components/VvTextarea/VvTextarea.vue +89 -93
  41. package/src/components/common/HintSlot.ts +31 -13
  42. package/src/composables/debouncedInput/useDebouncedInput.ts +19 -0
  43. package/src/composables/icons/useComponentIcons.ts +35 -0
  44. package/src/composables/textLimit/useTextLimit.ts +44 -0
  45. package/src/composables/useModifiers.ts +47 -1
  46. package/src/props/index.ts +39 -0
  47. package/src/stories/InputText/InputTextMaxLength.stories.mdx +21 -0
  48. package/src/stories/Textarea/Textarea.stories.mdx +33 -51
  49. package/src/stories/Textarea/TextareaAutoclear.stories.mdx +23 -0
  50. package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +10 -2
  51. package/src/stories/Textarea/TextareaAutofocus.stories.mdx +5 -1
  52. package/src/stories/Textarea/TextareaDebounce.stories.mdx +23 -0
  53. package/src/stories/Textarea/TextareaDisabled.stories.mdx +5 -1
  54. package/src/stories/Textarea/TextareaError.stories.mdx +6 -3
  55. package/src/stories/Textarea/TextareaErrorLabel.stories.mdx +37 -0
  56. package/src/stories/Textarea/TextareaFloating.stories.mdx +7 -2
  57. package/src/stories/Textarea/TextareaHintLabel.stories.mdx +5 -1
  58. package/src/stories/Textarea/TextareaIcon.stories.mdx +5 -1
  59. package/src/stories/Textarea/TextareaIconPosition.stories.mdx +9 -1
  60. package/src/stories/Textarea/TextareaId.stories.mdx +19 -0
  61. package/src/stories/Textarea/TextareaLabel.stories.mdx +5 -1
  62. package/src/stories/Textarea/TextareaLimit.stories.mdx +50 -0
  63. package/src/stories/Textarea/TextareaLoading.stories.mdx +6 -3
  64. package/src/stories/Textarea/TextareaLoadingLabel.stories.mdx +23 -0
  65. package/src/stories/Textarea/TextareaMaxLength.stories.mdx +6 -2
  66. package/src/stories/Textarea/TextareaMinLength.stories.mdx +5 -1
  67. package/src/stories/Textarea/TextareaModifiers.stories.mdx +24 -0
  68. package/src/stories/Textarea/TextareaName.stories.mdx +23 -0
  69. package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +5 -1
  70. package/src/stories/Textarea/TextareaReadonly.stories.mdx +5 -1
  71. package/src/stories/Textarea/TextareaRequired.stories.mdx +22 -0
  72. package/src/stories/Textarea/TextareaResizable.stories.mdx +22 -0
  73. package/src/stories/Textarea/TextareaRowsCols.stories.mdx +9 -1
  74. package/src/stories/Textarea/TextareaValid.stories.mdx +7 -4
  75. package/src/stories/Textarea/TextareaValidLabel.stories.mdx +35 -0
  76. package/src/stories/stories.scss +11 -0
  77. package/src/stories/utils.ts +12 -0
  78. package/src/stories/volver-ui-vue.stories.mdx +7 -1
  79. package/dist/components/VvInputText/useInputNumber.d.ts +0 -16
  80. package/dist/components/VvInputText/useInputPassword.d.ts +0 -16
  81. package/src/components/VvInputText/useInputNumber.ts +0 -40
  82. package/src/components/VvInputText/useInputPassword.ts +0 -38
@@ -1,2 +1,2 @@
1
- (function(r,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core"],v):(r=typeof globalThis<"u"?globalThis:r||self,r.VvCheckGroup=v(r.vue,r.core))})(this,function(r,v){"use strict";const B={valid:Boolean,validLabel:[String,Array]},S={error:Boolean,errorLabel:[String,Array]},P={...B,...S,...{hintLabel:{type:String,default:""}},...{options:{type:Array,default:()=>[]},optionLabel:{type:[String,Function],default:()=>"label"},optionValue:{type:[String,Function],default:()=>"value"}},modelValue:{type:Array},label:{type:String,default:""},name:{type:String,default:"",required:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1}},F=["update:modelValue","change"],j=Symbol("VV_CHECK_GROUP");function R(e){if(Object.keys(e).some(t=>t!=="key"&&!r.isRef(e[t])))throw Error("One or more groupState props aren't ref.");console.log("PRovide - ",e),r.provide(e.key,r.computed(()=>e))}function q(e){const{options:t,optionLabel:n,optionValue:o}=r.toRefs(e);return{options:t,getOptionLabel:l=>typeof l!="object"&&l!==null?l:typeof n.value=="function"?n.value(l):l[n.value],getOptionValue:l=>typeof l!="object"&&l!==null?l:typeof o.value=="function"?o.value(l):l[o.value]}}const y={equals(e,t,n){return n?this.resolveFieldData(e,n)===this.resolveFieldData(t,n):this.deepEquals(e,t)},deepEquals(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){const n=Array.isArray(e),o=Array.isArray(t);let s,a,l;if(n&&o){if(a=e.length,a!=t.length)return!1;for(s=a;s--!==0;)if(!this.deepEquals(e[s],t[s]))return!1;return!0}if(n!=o)return!1;const u=e instanceof Date,f=t instanceof Date;if(u!=f)return!1;if(u&&f)return e.getTime()==t.getTime();const i=e instanceof RegExp,d=t instanceof RegExp;if(i!=d)return!1;if(i&&d)return e.toString()==t.toString();const p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(s=a;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,p[s]))return!1;for(s=a;s--!==0;)if(l=p[s],!this.deepEquals(e[l],t[l]))return!1;return!0}return e!==e&&t!==t},resolveFieldData(e,t){if(e&&Object.keys(e).length&&t){if(t.indexOf(".")===-1)return e[t];{const n=t.split(".");let o=e;for(let s=0,a=n.length;s<a;++s){if(e==null)return null;o=o[n[s]]}return o}}else return null},isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},findIndexInList(e,t){let n=-1;if(t){for(let o=0;o<t.length;o++)if(this.equals(t[o],e)){n=o;break}}return n},contains(e,t){if(e!=null&&t&&t.length){for(const n of t)if(this.equals(e,n))return!0}return!1},isEmpty(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0},isNotEmpty(e){return!this.isEmpty(e)},pickBy(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>t(n)))},removeFromList(e,t){const n=this.findIndexInList(e,t);return n>-1?t.filter((o,s)=>s!==n):t},isString(e){return typeof e=="string"||e instanceof String},propsToObject(e){return Object.keys(e).reduce((t,n)=>{var o,s,a,l,u;return this.isFunction(e[n])?t[n]=e[n]():Array.isArray(e[n])?t[n]=e[n][0]():(o=e[n])!=null&&o.type&&(Array.isArray(e[n].type)?t[n]=((s=e[n])==null?void 0:s.default)||((a=e[n])==null?void 0:a.type[0]()):t[n]=((l=e[n])==null?void 0:l.default)||((u=e[n])==null?void 0:u.type())),t},{})},filterArray(e,t,n){return e.filter(o=>t.some(s=>typeof s=="string"?o[n]==s:this.equals(o[n],s[n])))},kebabCase(e){var t,n;if(e)return(n=(t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:t.join("-"))==null?void 0:n.toLowerCase()}};function b(e,t){const n={[`${e}`]:!0};return{bemCssClasses:r.computed(()=>Object.keys(t).reduce((s,a)=>{const l=r.unref(t[a])||!1;if(!l)return s;if(a==="modifiers"){const u=Array.isArray(l)?l:[l];return{...s,...u.reduce((f,i)=>({...f,[`${e}--${y.kebabCase(i)}`]:!0}),{})}}else return{...s,[`${e}--${y.kebabCase(a)}`]:l}},n)||{})}}const I={...B,...S,value:null,modelValue:null,binary:Boolean,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},switch:Boolean,label:String,disabled:Boolean,readonly:Boolean},G=["click","update:modelValue","change","focus","blur"];function w(e){const t=r.inject(e,void 0);console.log("Inject - ",t);const n=r.computed(()=>y.isNotEmpty(t));function o(s,a,l){if(t!=null&&t.value){const u=r.unref(t.value)[s];return r.computed({get(){return u==null?void 0:u.value},set(f){u.value=f}})}else{const u=r.toRef(a,s);return r.computed({get(){return u.value},set(f){l&&l(`update:${s}`,f)}})}}return{group:t,isInGroup:n,getGroupOrLocalRef:o}}function x(e,t){const{group:n,isInGroup:o,getGroupOrLocalRef:s}=w(j),{valid:a,error:l,switch:u}=r.toRefs(e),f=s("modelValue",e,t),i=s("readonly",e),d=s("disabled",e);return{group:n,isInGroup:o,valid:a,error:l,propsSwitch:u,modelValue:f,readonly:i,disabled:d}}function $(e,t){const{focused:n}=v.useFocus(e);return r.watch(n,o=>{t(o?"focus":"blur",e.value)}),{focused:n}}const D={inheritAttrs:!1},H=r.defineComponent({...D,__name:"VvCheck",props:I,emits:G,setup(e,{emit:t}){const n=e,o=r.useAttrs(),{disabled:s,readonly:a,valid:l,error:u,propsSwitch:f,modelValue:i}=x(n,t),d=r.ref(),{focused:p}=$(d,t),c=r.computed(()=>n.binary?y.equals(i.value,n.trueValue):Array.isArray(i.value)?y.contains(n.value,i.value):y.equals(n.value,i.value)),{bemCssClasses:m}=b("vv-input-checkbox",{switch:f,valid:l,invalid:u}),{bemCssClasses:g}=b("vv-input-check__input",{checked:c,disabled:s,readonly:a}),h=r.computed(()=>({[o.class]:!0,...m.value})),V=r.computed(()=>({...g.value,"focus-visible":p.value})),C=r.computed(()=>{const{id:k,name:A,style:E}=o,M=y.pickBy(o,W=>W.startsWith("data-"));return{for:k||A,style:E,...M}}),O=r.computed(()=>{const{id:k="",name:A=""}=o;return{type:"checkbox",id:k||A,name:A,value:n.value,disabled:s.value,readonly:a.value,checked:c.value,..._.value}}),_=r.computed(()=>{const{name:k}=o,A=y.pickBy(o,E=>E.startsWith("aria-"));return{"aria-label":k,"aria-checked":c.value,...A}});function U(){if(n.binary){i.value=c.value?n.falseValue:n.trueValue;return}if(i.value===null){i.value=[n.value];return}if(Array.isArray(i.value)){i.value=c.value?y.removeFromList(n.value,i.value):[...i.value,n.value];return}console.warn("Cannot change value - VvCheck modelValue is not an array")}function K(k){s.value||(t("click",k),t("change",c.value?n.value:null),p.value=!0)}return(k,A)=>(r.openBlock(),r.createElementBlock("label",r.mergeProps({class:r.unref(h)},r.unref(C),{onClick:K}),[r.createElementVNode("input",r.mergeProps({ref_key:"input",ref:d,class:r.unref(V)},r.unref(O),{onInput:U}),null,16),r.renderSlot(k.$slots,"default",{value:r.unref(i)},()=>[r.createTextVNode(r.toDisplayString(k.label),1)])],16))}});function N(e){return Array.isArray(e)?e.filter(t=>y.isString(t)).reduce((t,n)=>t.length>0?t+`
2
- `+n:n,""):e}function T(e,t){return{name:"HintSlot",setup(){const n=r.toRefs(e),{error:o,valid:s,hint:a,loading:l}=t,{hintLabel:u,modelValue:f,valid:i,validLabel:d,error:p,errorLabel:c}=n,m=y.resolveFieldData(n,"loading"),g=y.resolveFieldData(n,"loadingLabel"),h=r.computed(()=>p.value?!!(p.value&&o||(c==null?void 0:c.value)&&Array.isArray(c.value)&&c.value.length>0||(c==null?void 0:c.value)&&y.isNotEmpty(c.value)):!1),V=r.computed(()=>!!(u&&u.value||a||s||d&&d.value||h.value||(m==null?void 0:m.value)&&l||(m==null?void 0:m.value)&&(g==null?void 0:g.value))),C=r.computed(()=>Array.isArray(c==null?void 0:c.value)?N((c==null?void 0:c.value)||""):c==null?void 0:c.value),O=r.computed(()=>{const _={modelValue:f,error:p,valid:i};return p!=null&&p.value?(o==null?void 0:o(_))||(C==null?void 0:C.value)||(u==null?void 0:u.value):i!=null&&i.value?(s==null?void 0:s(_))||(d==null?void 0:d.value)||(u==null?void 0:u.value):m!=null&&m.value?(l==null?void 0:l(_))||(g==null?void 0:g.value)||(u==null?void 0:u.value):(a==null?void 0:a(_))||(u==null?void 0:u.value)||(u==null?void 0:u.value)});return{hasHint:V,hintContent:O}},render(){if(this.hasHint)return r.h("span",null,this.hintContent)}}}const z=["textContent"],Z={class:"vv-input-checkbox-group__wrapper"};return r.defineComponent({__name:"VvCheckGroup",props:P,emits:F,setup(e,{emit:t}){const n=e,o=r.useSlots(),s=v.useVModel(n,"modelValue",t),{disabled:a,readonly:l,error:u,valid:f}=r.toRefs(n);R({key:j,modelValue:s,disabled:a,readonly:l});const{getOptionLabel:d,getOptionValue:p}=q(n),{bemCssClasses:c}=b("vv-input-checkbox-group",{horizontal:r.computed(()=>!n.vertical),valid:f,invalid:u}),m=(h,V)=>({id:`${n.name}_opt${V}`,name:n.name,label:d(h),value:p(h)}),g=T(n,o);return(h,V)=>(r.openBlock(),r.createElementBlock("fieldset",{class:r.normalizeClass(r.unref(c))},[h.label?(r.openBlock(),r.createElementBlock("legend",{key:0,textContent:r.toDisplayString(h.label)},null,8,z)):r.createCommentVNode("",!0),r.createElementVNode("div",Z,[h.options.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(h.options,(C,O)=>(r.openBlock(),r.createBlock(H,r.mergeProps({key:O},m(C,O)),null,16))),128)):r.renderSlot(h.$slots,"default",{key:1})]),r.createVNode(r.unref(g),{class:"vv-input-checkbox-group__hint"})],2))}})});
1
+ (function(r,C){typeof exports=="object"&&typeof module<"u"?module.exports=C(require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core"],C):(r=typeof globalThis<"u"?globalThis:r||self,r.VvCheckGroup=C(r.vue,r.core))})(this,function(r,C){"use strict";const S={valid:Boolean,validLabel:[String,Array]},j={error:Boolean,errorLabel:[String,Array]},F={...S,...j,...{hintLabel:{type:String,default:""}},...{options:{type:Array,default:()=>[]},optionLabel:{type:[String,Function],default:()=>"label"},optionValue:{type:[String,Function],default:()=>"value"}},modelValue:{type:Array},label:{type:String,default:""},name:{type:String,default:"",required:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1}},R=["update:modelValue","change"],P=Symbol("VV_CHECK_GROUP");function q(e){if(Object.keys(e).some(t=>t!=="key"&&!r.isRef(e[t])))throw Error("One or more groupState props aren't ref.");console.log("PRovide - ",e),r.provide(e.key,r.computed(()=>e))}function I(e){const{options:t,optionLabel:n,optionValue:o}=r.toRefs(e);return{options:t,getOptionLabel:l=>typeof l!="object"&&l!==null?l:typeof n.value=="function"?n.value(l):l[n.value],getOptionValue:l=>typeof l!="object"&&l!==null?l:typeof o.value=="function"?o.value(l):l[o.value]}}const k={equals(e,t,n){return n?this.resolveFieldData(e,n)===this.resolveFieldData(t,n):this.deepEquals(e,t)},deepEquals(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){const n=Array.isArray(e),o=Array.isArray(t);let s,u,l;if(n&&o){if(u=e.length,u!=t.length)return!1;for(s=u;s--!==0;)if(!this.deepEquals(e[s],t[s]))return!1;return!0}if(n!=o)return!1;const c=e instanceof Date,a=t instanceof Date;if(c!=a)return!1;if(c&&a)return e.getTime()==t.getTime();const i=e instanceof RegExp,m=t instanceof RegExp;if(i!=m)return!1;if(i&&m)return e.toString()==t.toString();const d=Object.keys(e);if(u=d.length,u!==Object.keys(t).length)return!1;for(s=u;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,d[s]))return!1;for(s=u;s--!==0;)if(l=d[s],!this.deepEquals(e[l],t[l]))return!1;return!0}return e!==e&&t!==t},resolveFieldData(e,t){if(e&&Object.keys(e).length&&t){if(t.indexOf(".")===-1)return e[t];{const n=t.split(".");let o=e;for(let s=0,u=n.length;s<u;++s){if(e==null)return null;o=o[n[s]]}return o}}else return null},isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},findIndexInList(e,t){let n=-1;if(t){for(let o=0;o<t.length;o++)if(this.equals(t[o],e)){n=o;break}}return n},contains(e,t){if(e!=null&&t&&t.length){for(const n of t)if(this.equals(e,n))return!0}return!1},isEmpty(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0},isNotEmpty(e){return!this.isEmpty(e)},pickBy(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>t(n)))},removeFromList(e,t){const n=this.findIndexInList(e,t);return n>-1?t.filter((o,s)=>s!==n):t},isString(e){return typeof e=="string"||e instanceof String},propsToObject(e){return Object.keys(e).reduce((t,n)=>{var o,s,u,l,c;return this.isFunction(e[n])?t[n]=e[n]():Array.isArray(e[n])?t[n]=e[n][0]():(o=e[n])!=null&&o.type&&(Array.isArray(e[n].type)?t[n]=((s=e[n])==null?void 0:s.default)||((u=e[n])==null?void 0:u.type[0]()):t[n]=((l=e[n])==null?void 0:l.default)||((c=e[n])==null?void 0:c.type())),t},{})},filterArray(e,t,n){return e.filter(o=>t.some(s=>typeof s=="string"?o[n]==s:this.equals(o[n],s[n])))},kebabCase(e){var t,n;if(e)return(n=(t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:t.join("-"))==null?void 0:n.toLowerCase()}};function B(e,t){const n={[`${e}`]:!0};return{bemCssClasses:r.computed(()=>Object.keys(t).reduce((s,u)=>{const l=r.unref(t[u])||!1;if(!l)return s;if(u==="modifiers"){const c=Array.isArray(l)?l:[l];return{...s,...c.reduce((a,i)=>({...a,[`${e}--${k.kebabCase(i)}`]:!0}),{})}}else return{...s,[`${e}--${k.kebabCase(u)}`]:l}},n)||{})}}const w={...S,...j,value:null,modelValue:null,binary:Boolean,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},switch:Boolean,label:String,disabled:Boolean,readonly:Boolean},G=["click","update:modelValue","change","focus","blur"];function x(e){const t=r.inject(e,void 0);console.log("Inject - ",t);const n=r.computed(()=>k.isNotEmpty(t));function o(s,u,l){if(t!=null&&t.value){const c=r.unref(t.value)[s];return r.computed({get(){return c==null?void 0:c.value},set(a){c.value=a}})}else{const c=r.toRef(u,s);return r.computed({get(){return c.value},set(a){l&&l(`update:${s}`,a)}})}}return{group:t,isInGroup:n,getGroupOrLocalRef:o}}function $(e,t){const{group:n,isInGroup:o,getGroupOrLocalRef:s}=x(P),{valid:u,error:l,switch:c}=r.toRefs(e),a=s("modelValue",e,t),i=s("readonly",e),m=s("disabled",e);return{group:n,isInGroup:o,valid:u,error:l,propsSwitch:c,modelValue:a,readonly:i,disabled:m}}function D(e,t){const{focused:n}=C.useFocus(e);return r.watch(n,o=>{t(o?"focus":"blur",e.value)}),{focused:n}}const H={inheritAttrs:!1},N=r.defineComponent({...H,__name:"VvCheck",props:w,emits:G,setup(e,{emit:t}){const n=e,o=r.useAttrs(),{disabled:s,readonly:u,valid:l,error:c,propsSwitch:a,modelValue:i}=$(n,t),m=r.ref(),{focused:d}=D(m,t),y=r.computed(()=>n.binary?k.equals(i.value,n.trueValue):Array.isArray(i.value)?k.contains(n.value,i.value):k.equals(n.value,i.value)),{bemCssClasses:p}=B("vv-input-checkbox",{switch:a,valid:l,invalid:c}),{bemCssClasses:h}=B("vv-input-check__input",{checked:y,disabled:s,readonly:u}),f=r.computed(()=>({[o.class]:!0,...p.value})),v=r.computed(()=>({...h.value,"focus-visible":d.value})),O=r.computed(()=>{const{id:g,name:A,style:E}=o,K=k.pickBy(o,W=>W.startsWith("data-"));return{for:g||A,style:E,...K}}),b=r.computed(()=>{const{id:g="",name:A=""}=o;return{type:"checkbox",id:g||A,name:A,value:n.value,disabled:s.value,readonly:u.value,checked:y.value,...V.value}}),V=r.computed(()=>{const{name:g}=o,A=k.pickBy(o,E=>E.startsWith("aria-"));return{"aria-label":g,"aria-checked":y.value,...A}});function M(){if(n.binary){i.value=y.value?n.falseValue:n.trueValue;return}if(i.value===null){i.value=[n.value];return}if(Array.isArray(i.value)){i.value=y.value?k.removeFromList(n.value,i.value):[...i.value,n.value];return}console.warn("Cannot change value - VvCheck modelValue is not an array")}function U(g){s.value||(t("click",g),t("change",y.value?n.value:null),d.value=!0)}return(g,A)=>(r.openBlock(),r.createElementBlock("label",r.mergeProps({class:r.unref(f)},r.unref(O),{onClick:U}),[r.createElementVNode("input",r.mergeProps({ref_key:"input",ref:m,class:r.unref(v)},r.unref(b),{onInput:M}),null,16),r.renderSlot(g.$slots,"default",{value:r.unref(i)},()=>[r.createTextVNode(r.toDisplayString(g.label),1)])],16))}});function _(e){return Array.isArray(e)?e.filter(t=>k.isString(t)).reduce((t,n)=>t.length>0?t+`
2
+ `+n:n,""):e}function T(e,t){return{name:"HintSlot",props:{params:{type:Object,default:()=>{}}},setup(n){const o=r.toRefs(e),{error:s,valid:u,hint:l,loading:c}=t,{hintLabel:a,modelValue:i,valid:m,validLabel:d,error:y,errorLabel:p}=o,h=k.resolveFieldData(o,"loading"),f=k.resolveFieldData(o,"loadingLabel"),v=r.computed(()=>y.value?!!(y.value&&s||(p==null?void 0:p.value)&&Array.isArray(p.value)&&p.value.length>0||(p==null?void 0:p.value)&&k.isNotEmpty(p.value)):!1),O=r.computed(()=>!!(a&&a.value||l||u||d&&d.value||v.value||(h==null?void 0:h.value)&&c||(h==null?void 0:h.value)&&(f==null?void 0:f.value))),b=r.computed(()=>{const V=C.toReactive({hintLabel:a,modelValue:i,valid:m,validLabel:d,error:y,errorLabel:p,loading:h,loadingLabel:f,...n.params});return y!=null&&y.value?(s==null?void 0:s(V))||_(p==null?void 0:p.value)||(a==null?void 0:a.value):m!=null&&m.value?(u==null?void 0:u(V))||_(d==null?void 0:d.value)||(a==null?void 0:a.value):h!=null&&h.value?(c==null?void 0:c(V))||_(f==null?void 0:f.value)||(a==null?void 0:a.value):(l==null?void 0:l(V))||_(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{hasHint:O,hintContent:b}},render(){if(this.hasHint)return r.h("pre",{style:{"white-space":"pre"}},this.hintContent)}}}const z=["textContent"],Z={class:"vv-input-checkbox-group__wrapper"};return r.defineComponent({__name:"VvCheckGroup",props:F,emits:R,setup(e,{emit:t}){const n=e,o=r.useSlots(),s=C.useVModel(n,"modelValue",t),{disabled:u,readonly:l,error:c,valid:a}=r.toRefs(n);q({key:P,modelValue:s,disabled:u,readonly:l});const{getOptionLabel:m,getOptionValue:d}=I(n),{bemCssClasses:y}=B("vv-input-checkbox-group",{horizontal:r.computed(()=>!n.vertical),valid:a,invalid:c}),p=(f,v)=>({id:`${n.name}_opt${v}`,name:n.name,label:m(f),value:d(f)}),h=T(n,o);return(f,v)=>(r.openBlock(),r.createElementBlock("fieldset",{class:r.normalizeClass(r.unref(y))},[f.label?(r.openBlock(),r.createElementBlock("legend",{key:0,textContent:r.toDisplayString(f.label)},null,8,z)):r.createCommentVNode("",!0),r.createElementVNode("div",Z,[f.options.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(f.options,(O,b)=>(r.openBlock(),r.createBlock(N,r.mergeProps({key:b},p(O,b)),null,16))),128)):r.renderSlot(f.$slots,"default",{key:1})]),r.createVNode(r.unref(h),{class:"vv-input-checkbox-group__hint"})],2))}})});
@@ -1,3 +1,4 @@
1
+ import type { ExtractPropTypes } from 'vue';
1
2
  export declare const VvInputTextEvents: string[];
2
3
  export declare const VvInputTextProps: {
3
4
  modelValue: null;
@@ -46,6 +47,16 @@ export declare const VvInputTextProps: {
46
47
  */
47
48
  floating: BooleanConstructor;
48
49
  debounce: NumberConstructor;
50
+ /**
51
+ * Se true, attiva la possibilità di cancellare il testo nella textarea
52
+ */
53
+ autoclear: BooleanConstructor;
54
+ limit: {
55
+ type: (StringConstructor | BooleanConstructor)[];
56
+ default: boolean;
57
+ validator: (value: string) => boolean;
58
+ };
59
+ modifiers: (StringConstructor | ArrayConstructor)[];
49
60
  loading: BooleanConstructor;
50
61
  loadingLabel: StringConstructor;
51
62
  hintLabel: {
@@ -57,3 +68,6 @@ export declare const VvInputTextProps: {
57
68
  valid: BooleanConstructor;
58
69
  validLabel: (StringConstructor | ArrayConstructor)[];
59
70
  };
71
+ declare type VvInputTextPropsType = typeof VvInputTextProps;
72
+ export declare type VvInputTextPropsTypes = ExtractPropTypes<VvInputTextPropsType>;
73
+ export {};
@@ -15,6 +15,8 @@ declare const _default: {
15
15
  autocomplete: string;
16
16
  autofocus: boolean;
17
17
  floating: boolean;
18
+ autoclear: boolean;
19
+ limit: string | boolean;
18
20
  }> & Omit<Readonly<import("vue").ExtractPropTypes<{
19
21
  modelValue: null;
20
22
  type: {
@@ -52,6 +54,13 @@ declare const _default: {
52
54
  };
53
55
  floating: BooleanConstructor;
54
56
  debounce: NumberConstructor;
57
+ autoclear: BooleanConstructor;
58
+ limit: {
59
+ type: (StringConstructor | BooleanConstructor)[];
60
+ default: boolean;
61
+ validator: (value: string) => boolean;
62
+ };
63
+ modifiers: (StringConstructor | ArrayConstructor)[];
55
64
  loading: BooleanConstructor;
56
65
  loadingLabel: StringConstructor;
57
66
  hintLabel: {
@@ -64,7 +73,7 @@ declare const _default: {
64
73
  validLabel: (StringConstructor | ArrayConstructor)[];
65
74
  }>> & {
66
75
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
67
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "disabled" | "readonly" | "icon" | "iconPosition" | "loading" | "error" | "valid" | "hintLabel" | "autocomplete" | "autofocus" | "floating">;
76
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "disabled" | "readonly" | "icon" | "iconPosition" | "loading" | "error" | "valid" | "hintLabel" | "autocomplete" | "autofocus" | "floating" | "autoclear" | "limit">;
68
77
  $attrs: {
69
78
  [x: string]: unknown;
70
79
  };
@@ -115,6 +124,13 @@ declare const _default: {
115
124
  };
116
125
  floating: BooleanConstructor;
117
126
  debounce: NumberConstructor;
127
+ autoclear: BooleanConstructor;
128
+ limit: {
129
+ type: (StringConstructor | BooleanConstructor)[];
130
+ default: boolean;
131
+ validator: (value: string) => boolean;
132
+ };
133
+ modifiers: (StringConstructor | ArrayConstructor)[];
118
134
  loading: BooleanConstructor;
119
135
  loadingLabel: StringConstructor;
120
136
  hintLabel: {
@@ -140,6 +156,8 @@ declare const _default: {
140
156
  autocomplete: string;
141
157
  autofocus: boolean;
142
158
  floating: boolean;
159
+ autoclear: boolean;
160
+ limit: string | boolean;
143
161
  }, {}, string> & {
144
162
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
145
163
  created?: ((() => void) | (() => void)[]) | undefined;
@@ -197,6 +215,13 @@ declare const _default: {
197
215
  };
198
216
  floating: BooleanConstructor;
199
217
  debounce: NumberConstructor;
218
+ autoclear: BooleanConstructor;
219
+ limit: {
220
+ type: (StringConstructor | BooleanConstructor)[];
221
+ default: boolean;
222
+ validator: (value: string) => boolean;
223
+ };
224
+ modifiers: (StringConstructor | ArrayConstructor)[];
200
225
  loading: BooleanConstructor;
201
226
  loadingLabel: StringConstructor;
202
227
  hintLabel: {
@@ -250,6 +275,13 @@ declare const _default: {
250
275
  };
251
276
  floating: BooleanConstructor;
252
277
  debounce: NumberConstructor;
278
+ autoclear: BooleanConstructor;
279
+ limit: {
280
+ type: (StringConstructor | BooleanConstructor)[];
281
+ default: boolean;
282
+ validator: (value: string) => boolean;
283
+ };
284
+ modifiers: (StringConstructor | ArrayConstructor)[];
253
285
  loading: BooleanConstructor;
254
286
  loadingLabel: StringConstructor;
255
287
  hintLabel: {
@@ -275,6 +307,8 @@ declare const _default: {
275
307
  autocomplete: string;
276
308
  autofocus: boolean;
277
309
  floating: boolean;
310
+ autoclear: boolean;
311
+ limit: string | boolean;
278
312
  }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
279
313
  $slots: {
280
314
  'icon-left': (_: {
@@ -287,6 +321,7 @@ declare const _default: {
287
321
  error: boolean;
288
322
  modelValue: any;
289
323
  }) => any;
324
+ limit: (_: {}) => any;
290
325
  };
291
326
  });
292
327
  export default _default;
@@ -0,0 +1,3 @@
1
+ import type { VvInputTextPropsTypes } from './VvInputText';
2
+ import { type Component } from 'vue';
3
+ export default function VvInputTextActionsFactory(type: string, parentProps: VvInputTextPropsTypes): Component;