@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2
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/README.md +2 -2
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +19 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +276 -98
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
- package/dist/components/VvAction/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +213 -44
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +646 -360
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
- package/dist/components/VvButton/index.d.ts +13 -13
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +57 -38
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +5 -5
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
- package/dist/components/VvCombobox/index.d.ts +41 -10
- package/dist/components/VvDialog/VvDialog.es.js +387 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +40 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +113 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +986 -462
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +66 -13
- package/dist/components/VvProgress/VvProgress.es.js +216 -45
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +499 -238
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +631 -324
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +3 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
- package/dist/components/VvTextarea/index.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3522 -2231
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.es.js +264 -55
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.d.ts +3 -0
- package/dist/directives/v-contextmenu.es.js +42 -0
- package/dist/directives/v-contextmenu.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +222 -53
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.es.js +40 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +112 -3607
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +50 -18
- package/dist/resolvers/unplugin.d.ts +7 -1
- package/dist/resolvers/unplugin.es.js +77 -37
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +13 -1
- package/package.json +126 -40
- package/src/Volver.ts +49 -22
- 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/VvAccordion/VvAccordion.vue +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +7 -7
- package/src/components/VvAction/index.ts +1 -1
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +11 -11
- package/src/components/VvButton/index.ts +10 -9
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +44 -26
- package/src/components/VvCombobox/index.ts +1 -1
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +7 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
- package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
- package/src/components/VvDropdown/index.ts +3 -3
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +130 -37
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -6
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +4 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/directives/index.ts +3 -1
- package/src/directives/v-contextmenu.ts +40 -0
- package/src/directives/v-tooltip.ts +2 -2
- package/src/icons.ts +1 -1
- package/src/index.ts +0 -2
- package/src/props/index.ts +20 -10
- package/src/resolvers/unplugin.ts +15 -1
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +40 -0
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
- package/src/stories/argTypes.ts +12 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("vue"),require("@vueuse/core"),require("@iconify/vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core","@iconify/vue","nanoid"],v):(e=typeof globalThis<"u"?globalThis:e||self,e.VvInputText=v(e.vue,e.core,e.vue$1,e.nanoid))})(this,function(e,v,B,re){"use strict";function W(t,n){if(t&&Object.keys(t).length&&n){if(n.indexOf(".")===-1)return t[n];{const o=n.split(".");let r=t;for(let l=0,d=o.length;l<d;++l){if(t==null)return null;r=r[o[l]]}return r}}else return null}function P(t){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(t))}function ae(t){return typeof t=="string"||t instanceof String}function k(t){return Array.isArray(t)?t.filter(n=>ae(n)).join(" "):t}function le(t,n){const{invalid:o,valid:r,hint:l,loading:d}=n,{hintLabel:u,modelValue:_,valid:g,validLabel:m,invalid:s,invalidLabel:i,...b}=e.toRefs(t),p=W(b,"loading"),h=W(b,"loadingLabel"),y=e.computed(()=>s.value?!!(s.value&&o||i!=null&&i.value&&Array.isArray(i.value)&&i.value.length>0||i!=null&&i.value&&!P(i)):!1),O=e.computed(()=>!!(u&&u.value||l)),S=e.computed(()=>!!(m&&m.value||r)),C=e.computed(()=>!!(p!=null&&p.value&&d||p!=null&&p.value&&(h!=null&&h.value))),H=e.computed(()=>O.value||S.value||y.value||C.value);return{hasInvalid:y,hasHint:O,hasValid:S,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(T){const N=e.computed(()=>{const A=v.toReactive({hintLabel:u,modelValue:_,valid:g,validLabel:m,invalid:s,invalidLabel:i,loading:p,loadingLabel:h,...T.params});return s!=null&&s.value?(o==null?void 0:o(A))||k(i==null?void 0:i.value)||(u==null?void 0:u.value):g!=null&&g.value?(r==null?void 0:r(A))||k(m==null?void 0:m.value)||(u==null?void 0:u.value):p!=null&&p.value?(d==null?void 0:d(A))||k(h==null?void 0:h.value)||(u==null?void 0:u.value):(l==null?void 0:l(A))||k(u==null?void 0:u.value)||(u==null?void 0:u.value)});return{isVisible:H,hasInvalid:y,hasValid:S,hintContent:N}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const se={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var I=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(I||{}),F=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(F||{}),D=(t=>(t.before="before",t.after="after",t))(D||{}),R=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(R||{}),q=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(q||{});const ie=Symbol.for("volver");function ce(){return e.inject(ie)}function z(t,n,o){return e.computed(()=>{const r={[t]:!0},l=typeof(n==null?void 0:n.value)=="string"?n.value.split(" "):n==null?void 0:n.value;return l&&Array.isArray(l)&&l.forEach(d=>{r[`${t}--${d}`]=!0}),o&&Object.keys(o.value).forEach(d=>{r[`${t}--${d}`]=e.unref(o.value[d])}),r})}const ue={name:"VvIcon"},w=e.defineComponent({...ue,props:se,setup(t){const n=t,o=e.ref(!0),r=ce(),{modifiers:l}=e.toRefs(n),d=z("vv-icon",l),u=e.computed(()=>n.provider||(r==null?void 0:r.provider)),_=e.computed(()=>{const s=n.name??"",i=`@${u.value}:${n.prefix}:${n.name}`;return B.iconExists(s)?s:B.iconExists(i)?i:(r==null?void 0:r.iconsCollections.find(b=>{const p=`@${u.value}:${b.prefix}:${s}`;if(B.iconExists(p))return p}))||s});function g(s){let i=null;if(typeof window>"u"){const{JSDOM:y}=require("jsdom");i=new y().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(s,"text/html").querySelector("svg")}function m(s){const i=g(s),b=(i==null?void 0:i.innerHTML.trim())||"";i&&b&&B.addIcon(`@${u.value}:${n.prefix}:${n.name}`,{body:b,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return r&&(n.src&&!B.iconExists(`@${u.value}:${n.prefix}:${n.name}`)?(o.value=!1,r.fetchIcon(n.src).then(s=>{s&&(m(s),o.value=!0)}).catch(s=>{throw new Error(`During fetch icon: ${s==null?void 0:s.message}`)})):n.svg&&m(n.svg)),(s,i)=>e.unref(o)?(e.openBlock(),e.createBlock(e.unref(B.Icon),e.mergeProps({key:0,class:e.unref(d)},{inline:s.inline,width:s.width,height:s.height,horizontalFlip:s.horizontalFlip,verticalFlip:s.verticalFlip,flip:s.flip,rotate:s.rotate,color:s.color,onLoad:s.onLoad,icon:e.unref(_)}),null,16,["class"])):e.createCommentVNode("",!0)}}),de={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(q).includes(t)},rel:{type:String,default:"noopener noreferrer"}},pe={valid:Boolean,validLabel:[String,Array]},fe={invalid:Boolean,invalidLabel:[String,Array]},me={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},K={disabled:Boolean},he={active:Boolean},be={pressed:Boolean},X={label:[String,Number]},Se={readonly:Boolean},ge={modifiers:[String,Array]},ye={hintLabel:{type:String,default:""}},we={count:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"limit","countdown"].includes(t)}},Ee={debounce:[Number,String]},ve={icon:{type:[String,Object]},iconPosition:{type:String,default:D.before,validation:t=>Object.values(D).includes(t)}},Ie={tabindex:{type:[String,Number],default:0}},_e={floating:Boolean},Ae={id:[String,Number]};I.bottom;const Be={...{...Ae,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...Ie,...K,...Se,...pe,...fe,...ye,...me,...ge,...we,...Ee,...ve,..._e,...X,minlength:Number,maxlength:Number,placeholder:String,required:Boolean};({...K,...X,...be,...he,...de,type:R.button});const a={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},E={PASSWORD_SHOW:"eye-on",PASSWORD_HIDE:"eye-off",DATE:"calendar",TIME:"time",COLOR:"color",SEARCH:"close"},Ce=["update:modelValue","focus","blur","keyup"],Pe={...Be,modelValue:[String,Number],type:{type:String,default:a.TEXT,validator:t=>Object.values(a).includes(t)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:E.PASSWORD_SHOW},iconHidePassword:{type:String,default:E.PASSWORD_HIDE},iconClear:{type:String,default:E.SEARCH},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"}},Y=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:E.PASSWORD_SHOW},iconHide:{type:String,default:E.PASSWORD_HIDE}},emits:["toggle-password"],setup(t,{emit:n}){const o=e.ref(!1),r=e.computed(()=>o.value?t.iconHide:t.iconShow);function l(d){d==null||d.stopPropagation(),t.disabled||(o.value=!o.value,n("toggle-password",o.value))}return{active:o,activeIcon:r,onClick:l}},render(){const t=e.h(w,{name:this.activeIcon,class:"vv-input-text__action-icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),V=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:t=>["up","down"].includes(t),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:n}){const o=e.computed(()=>t.mode==="up");return{isUp:o,onClick:l=>{l==null||l.stopPropagation(),t.disabled||n(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,onClick:this.onClick})}}),J=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup(t,{emit:n}){function o(r){r==null||r.stopPropagation(),t.disabled||n("clear")}return{onClick:o}},render(){const t=e.h(w,{name:this.icon,class:"vv-input-text__action-icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function x(t,n){return{name:"VvInputTextActions",components:{VvIcon:w,VvInputPasswordAction:Y,VvInputStepAction:V,VvInputClearAction:J},setup(){return{isDisabled:e.computed(()=>n.disabled||n.readonly),labelStepUp:n.labelStepUp,labelStepDown:n.labelStepDown,labelShowPassword:n.labelShowPassword,labelHidePassword:n.labelHidePassword,labelClear:n.labelClear,iconShowPassword:n.iconShowPassword,iconHidePassword:n.iconHidePassword}},render(){let o=null;switch(t){case a.SEARCH:{const{onClear:r}=this.$attrs;o=[e.h(J,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:r})];break}case a.PASSWORD:{const{onTogglePassword:r}=this.$attrs;o=[e.h(Y,{disabled:this.isDisabled,onTogglePassword:r,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case a.NUMBER:{const{onStepUp:r,onStepDown:l}=this.$attrs;o=[e.h(V,{mode:"up",disabled:this.isDisabled||n.max!==void 0&&n.modelValue===n.max,label:this.labelStepUp,onStepUp:r,onStepDown:l}),e.h(V,{mode:"down",disabled:this.isDisabled||n.min!==void 0&&n.modelValue===n.min,label:this.labelStepDown,onStepUp:r,onStepDown:l})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const De=t=>e.computed(()=>String((t==null?void 0:t.value)||re.nanoid()));function Te(t,n,o=0){let r;return typeof o=="string"&&(o=parseInt(o)),e.computed({get:()=>t==null?void 0:t.value,set:l=>{r&&clearTimeout(r),r=setTimeout(()=>{n("update:modelValue",l)},o)}})}function ke(t,n){const{focused:o}=v.useFocus(t);return e.watch(o,r=>{n(r?"focus":"blur",e.unref(t))}),{focused:o}}function Oe(t,n){const o=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===D.before)),r=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===D.after)),l=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.left)),d=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.right)),u=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.top)),_=e.computed(()=>Boolean((t==null?void 0:t.value)&&n.value===I.bottom));return{hasIcon:e.computed(()=>typeof(t==null?void 0:t.value)=="string"?{name:t==null?void 0:t.value}:t==null?void 0:t.value),hasIconLeft:l,hasIconRight:d,hasIconTop:u,hasIconBottom:_,hasIconBefore:o,hasIconAfter:r}}function Ne(t,n){const o=e.computed(()=>(e.unref(t)??"").length),r=e.computed(()=>(n==null?void 0:n.lowerLimit)!==void 0&&o.value<(n==null?void 0:n.lowerLimit)?o.value-n.lowerLimit:(n==null?void 0:n.upperLimit)!==void 0&&o.value<(n==null?void 0:n.upperLimit)?n.upperLimit-o.value:0),l=e.computed(()=>(n==null?void 0:n.mode)===!1?"":(n==null?void 0:n.mode)==="limit"&&(n!=null&&n.upperLimit)?`${o.value} / ${n.lowerLimit?`${n.lowerLimit}-`:""}${n.upperLimit}`:(n==null?void 0:n.mode)==="countdown"?r.value===0?void 0:r:o.value);return{length:o,gap:r,formatted:l}}const Re=["for"],Ve={class:"vv-input-text__wrapper"},xe={key:0,class:"vv-input-text__input-before"},He={class:"vv-input-text__inner"},Le=["id"],Me={key:1,class:"vv-input-text__input-after"},$e={key:2,class:"vv-input-text__limit"},je={name:"VvInputText"};return e.defineComponent({...je,props:Pe,emits:Ce,setup(t,{emit:n}){const o=t,r=e.useSlots(),l=e.ref(),{id:d,icon:u,iconPosition:_,label:g,modelValue:m,count:s,valid:i,invalid:b,loading:p}=e.toRefs(o),h=De(d),y=e.computed(()=>`${h.value}-hint`),O=e.computed(()=>o.floating&&P(o.placeholder)?" ":o.placeholder),S=Te(m,n,o.debounce),{focused:C}=ke(l,n),H=v.useElementVisibility(l);e.watch(H,c=>{c&&o.autofocus&&(C.value=!0)});const T=e.ref(!1),N=e.computed(()=>o.type===a.PASSWORD),A=()=>{T.value=!T.value},Ue=e.computed(()=>o.type===a.TIME||o.type===a.DATETIME_LOCAL||o.type===a.DATE||o.type===a.WEEK||o.type===a.MONTH),We=e.computed(()=>o.type===a.NUMBER),G=()=>{$.value&&(l.value.stepUp(),S.value=e.unref(l).value)},Q=()=>{$.value&&(l.value.stepDown(),S.value=e.unref(l).value)},Fe=e.computed(()=>o.type===a.SEARCH),Z=()=>{S.value=void 0},{hasIcon:ee,hasIconBefore:te,hasIconAfter:L}=Oe(u,_),M=e.computed(()=>{switch(o.type){case a.COLOR:return{name:E.COLOR};case a.DATE:case a.DATETIME_LOCAL:case a.WEEK:case a.MONTH:return{name:E.DATE};case a.TIME:return{name:E.TIME};default:return""}}),{formatted:qe}=Ne(S,{mode:o.count,upperLimit:o.maxlength,lowerLimit:o.minlength}),$=e.computed(()=>!o.disabled&&!o.readonly),ze=e.computed(()=>$.value?o.tabindex:-1),ne=e.computed(()=>!P(m)),Ke=e.computed(()=>{if(b.value===!0)return!0;if(i.value===!0)return!1}),{modifiers:Xe}=e.toRefs(o),Ye=z("vv-input-text",Xe,e.computed(()=>({valid:i.value,invalid:b.value,loading:p.value,disabled:o.disabled,readonly:o.readonly,"icon-before":te.value,"icon-after":L.value||!P(M),floating:o.floating&&!P(o.label),dirty:ne.value,focus:C.value}))),Je=e.computed(()=>{const c=(()=>N.value&&T.value||Ue.value&&!ne.value&&!C.value?a.TEXT:o.type)(),f={type:c,name:o.name,tabindex:ze.value,disabled:o.disabled,readonly:o.readonly,required:o.required,autocomplete:o.autocomplete,"aria-invalid":Ke.value,"aria-describedby":!oe.value&&Qe.value?y.value:void 0,"aria-errormessage":oe.value?y.value:void 0};return(c===a.DATE||c===a.MONTH||c===a.WEEK||c===a.TIME||c===a.DATETIME_LOCAL||c===a.NUMBER)&&(f.step=o.step,f.max=String(o.max),f.min=String(o.min)),(c===a.TEXT||c===a.SEARCH||c===a.URL||c===a.TEL||c===a.EMAIL||c===a.PASSWORD||c===a.NUMBER)&&(f.placeholder=O.value),(c===a.TEXT||c===a.SEARCH||c===a.URL||c===a.TEL||c===a.EMAIL||c===a.PASSWORD)&&(f.minlength=o.minlength,f.maxlength=o.maxlength,f.pattern=o.pattern),c===a.EMAIL&&(f.multiple=o.multiple),f}),j=e.computed(()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue,togglePassword:A,stepUp:G,stepDown:Q,clear:Z})),{HintSlot:Ge,hasHint:Qe,hasInvalid:oe}=le(o,r),Ze=x(a.PASSWORD,o),et=x(a.NUMBER,o),tt=x(a.SEARCH,o);return(c,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ye))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(h),class:"vv-input-text__label"},e.toDisplayString(e.unref(g)),9,Re)):e.createCommentVNode("",!0),e.createElementVNode("div",Ve,[c.$slots.before?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(c.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.unref(te)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(ee)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(h),ref_key:"input",ref:l,"onUpdate:modelValue":f[0]||(f[0]=U=>e.isRef(S)?S.value=U:null)},e.unref(Je),{onKeyup:f[1]||(f[1]=U=>n("keyup",U))}),null,16,Le),[[e.vModelDynamic,e.unref(S)]]),e.unref(L)||e.unref(M)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(L)?e.unref(ee):e.unref(M)),null,16)):e.unref(N)?(e.openBlock(),e.createBlock(e.unref(Ze),{key:2,onTogglePassword:A})):e.unref(We)?(e.openBlock(),e.createBlock(e.unref(et),{key:3,onStepUp:G,onStepDown:Q})):e.unref(Fe)?(e.openBlock(),e.createBlock(e.unref(tt),{key:4,onClear:Z})):e.createCommentVNode("",!0)]),c.$slots.after?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(c.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.unref(s)?(e.openBlock(),e.createElementBlock("span",$e,[e.renderSlot(c.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(j))),()=>[e.createTextVNode(e.toDisplayString(e.unref(qe)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Ge),{id:e.unref(y),class:"vv-input-text__hint"},null,8,["id"])],2))}})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("maska"),require("@vueuse/core"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","maska","@vueuse/core","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.maska,e.core,e.vue$1,e.nanoid)}(this,(function(e,t,o,n,l){"use strict";function a(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,l=o.length;t<l;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function i(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 r(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const u={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var d=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(d||{}),s=(e=>(e.before="before",e.after="after",e))(s||{}),c=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(c||{});const p=Symbol.for("volver");function v(t,o,n){return e.computed((()=>{const l={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{l[`${t}--${o}`]=e.unref(n.value[o])})),l}))}const m=e.defineComponent({name:"VvIcon",props:u,setup(t){const o=t,l=e.ref(!0),a=e.inject(p),{modifiers:i}=e.toRefs(o),r=v("vv-icon",i),u=e.computed((()=>o.provider||(null==a?void 0:a.iconsProvider))),d=e.computed((()=>{const e=o.name??"",t=`@${u.value}:${o.prefix}:${o.name}`;return n.iconExists(e)?e:n.iconExists(t)?t:(null==a?void 0:a.iconsCollections.find((t=>{const o=`@${u.value}:${t.prefix}:${e}`;if(n.iconExists(o))return o})))||e}));function s(e){const t=function(e){let t=null;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&&n.addIcon(`@${u.value}:${o.prefix}:${o.name}`,{body:l,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return a&&(o.src&&!n.iconExists(`@${u.value}:${o.prefix}:${o.name}`)?(l.value=!1,a.fetchIcon(o.src).then((e=>{e&&(s(e),l.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):o.svg&&s(o.svg)),(t,o)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(n.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:t.rotate,color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}}),f={valid:Boolean,validLabel:[String,Array]},h={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),S={readonly:Boolean},w={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},B={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},E={debounce:[Number,String]},x={icon:{type:[String,Object]},iconPosition:{type:String,default:s.before,validation:e=>Object.values(s).includes(e)}},T={tabindex:{type:[String,Number],default:0}},L={floating:Boolean},A={id:[String,Number]};d.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const C={...{...A,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...T,...g,...S,...f,...h,...k,...b,...w,...B,...E,...x,...L,...y,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};c.button;const P={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},I="eye-on",V="eye-off",_="calendar",D="time",N="color",R="close",$={...C,modelValue:[String,Number],type:{type:String,default:P.TEXT,validator:e=>Object.values(P).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:I},iconHidePassword:{type:String,default:V},iconClear:{type:String,default:R},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},mask:{type:String,default:void 0},maskEager:{type:Boolean,default:!1},maskReversed:{type:Boolean,default:!1},maskTokens:{type:Object,default:void 0},maskTokensReplace:{type:Boolean,default:!1},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String}},H=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:I},iconHide:{type:String,default:V}},emits:["toggle-password"],setup(t,{emit:o}){const n=e.ref(!1),l=e.computed((()=>n.value?t.iconHide:t.iconShow));return{active:n,activeIcon:l,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(n.value=!n.value,o("toggle-password",n.value))}}},render(){const t=e.h(m,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),M=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:o}){const n=e.computed((()=>"up"===t.mode));return{isUp:n,onClick:e=>{null==e||e.stopPropagation(),t.disabled||o(n.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),O=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(o){null==o||o.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(m,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function U(t,o){return{name:"VvInputTextActions",components:{VvIcon:m,VvInputPasswordAction:H,VvInputStepAction:M,VvInputClearAction:O},setup:()=>({isDisabled:e.computed((()=>o.disabled||o.readonly)),labelStepUp:o.labelStepUp,labelStepDown:o.labelStepDown,labelShowPassword:o.labelShowPassword,labelHidePassword:o.labelHidePassword,labelClear:o.labelClear,iconShowPassword:o.iconShowPassword,iconHidePassword:o.iconHidePassword}),render(){let n=null;switch(t){case P.SEARCH:{const{onClear:t}=this.$attrs;n=[e.h(O,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case P.PASSWORD:{const{onTogglePassword:t}=this.$attrs;n=[e.h(H,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case P.NUMBER:{const{onStepUp:t,onStepDown:l}=this.$attrs;n=[e.h(M,{mode:"up",disabled:this.isDisabled||void 0!==o.max&&o.modelValue===o.max,label:this.labelStepUp,onStepUp:t,onStepDown:l}),e.h(M,{mode:"down",disabled:this.isDisabled||void 0!==o.min&&o.modelValue===o.min,label:this.labelStepDown,onStepUp:t,onStepDown:l})];break}}return Array.isArray(n)?e.h("div",{class:"vv-input-text__actions-group"},n):n}}}const j=["for"],W={class:"vv-input-text__wrapper"},q={key:0,class:"vv-input-text__input-before"},F=["onClick"],z=["id"],X={key:1,class:"vv-input-text__unit"},K={key:5,class:"vv-input-text__input-after"},J={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:$,emits:["update:modelValue","focus","blur","keyup"],setup(n,{expose:u,emit:c}){const p=n,f=e.useSlots(),h=e.ref(),b=e.ref();u({$inner:b});const{id:g,icon:y,iconPosition:S,label:w,modelValue:k,count:B,valid:E,invalid:x,loading:T}=e.toRefs(p),L=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(g),A=e.computed((()=>`${L.value}-hint`)),C=e.computed((()=>p.floating&&i(p.placeholder)?" ":p.placeholder)),I=function(t,o,n=0,{getter:l=(e=>e),setter:a=(e=>e)}={}){let i;return"string"==typeof n&&(n=parseInt(n)),e.computed({get:()=>l(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{o("update:modelValue",a(e))}),n)}})}(k,c,p.debounce,{getter:e=>we.value?we.value.masked(e??""):e,setter:e=>(we.value&&(e=we.value.unmasked(e)),p.type===P.NUMBER?Number(e):e)}),{focused:V}=function(t,n){const{focused:l}=o.useFocus(t);return e.watch(l,(o=>{n(o?"focus":"blur",e.unref(t))})),{focused:l}}(h,c),R=e.computed((()=>V.value&&!p.disabled&&!p.readonly)),$=o.useElementVisibility(h);e.watch($,(e=>{e&&p.autofocus&&!p.disabled&&!p.readonly&&(V.value=!0)}));const H=e.ref(!1),M=e.computed((()=>p.type===P.PASSWORD)),O=()=>{H.value=!H.value},G=e.computed((()=>p.type===P.TIME||p.type===P.DATETIME_LOCAL||p.type===P.DATE||p.type===P.WEEK||p.type===P.MONTH)),Q=e.computed((()=>p.type===P.NUMBER)),Y=()=>{re.value&&(h.value.stepUp(),I.value=e.unref(h).value)},Z=()=>{re.value&&(h.value.stepDown(),I.value=e.unref(h).value)},ee=e.computed((()=>p.type===P.SEARCH)),te=()=>{I.value=void 0},{hasIcon:oe,hasIconBefore:ne,hasIconAfter:le}=function(t,o){const n=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.before))),l=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.after))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===d.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===d.right))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===d.top))),u=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===d.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:a,hasIconRight:i,hasIconTop:r,hasIconBottom:u,hasIconBefore:n,hasIconAfter:l}}(y,S),ae=e.computed((()=>{switch(p.type){case P.COLOR:return{name:N};case P.DATE:case P.DATETIME_LOCAL:case P.WEEK:case P.MONTH:return{name:_};case P.TIME:return{name:D};default:return""}})),{formatted:ie}=function(t,o){const n=e.computed((()=>(e.unref(t)??"").length)),l=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&n.value<(null==o?void 0:o.lowerLimit)?n.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&n.value<(null==o?void 0:o.upperLimit)?o.upperLimit-n.value:0)),a=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`${n.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===l.value)return;return l}return n.value}));return{length:n,gap:l,formatted:a}}(I,{mode:p.count,upperLimit:Number(p.maxlength),lowerLimit:Number(p.minlength)}),re=e.computed((()=>!p.disabled&&!p.readonly)),ue=e.computed((()=>re.value?p.tabindex:-1)),de=e.computed((()=>!i(k))),se=e.computed((()=>!0===x.value||!0!==E.value&&void 0)),{modifiers:ce}=e.toRefs(p),pe=v("vv-input-text",ce,e.computed((()=>({valid:E.value,invalid:x.value,loading:T.value,disabled:p.disabled,readonly:p.readonly,"icon-before":ne.value,"icon-after":le.value||!i(ae),floating:p.floating&&!i(p.label),dirty:de.value,focus:R.value,"auto-width":p.autoWidth})))),ve=e.computed((()=>{const e=M.value&&H.value?P.TEXT:!G.value||de.value||V.value?p.type:P.TEXT,t={type:e,name:p.name,tabindex:ue.value,disabled:p.disabled,readonly:p.readonly,required:p.required,autocomplete:p.autocomplete,"aria-invalid":se.value,"aria-describedby":!be.value&&he.value?A.value:void 0,"aria-errormessage":be.value?A.value:void 0};return e!==P.DATE&&e!==P.MONTH&&e!==P.WEEK&&e!==P.TIME&&e!==P.DATETIME_LOCAL&&e!==P.NUMBER||(t.step=p.step,t.max=void 0!==p.max?String(p.max):void 0,t.min=void 0!==p.min?String(p.min):void 0),e!==P.TEXT&&e!==P.SEARCH&&e!==P.URL&&e!==P.TEL&&e!==P.EMAIL&&e!==P.PASSWORD&&e!==P.NUMBER||(t.placeholder=C.value),e!==P.TEXT&&e!==P.SEARCH&&e!==P.URL&&e!==P.TEL&&e!==P.EMAIL&&e!==P.PASSWORD||(t.minlength=p.minlength,t.maxlength=p.maxlength,t.pattern=p.pattern),e===P.EMAIL&&(t.multiple=p.multiple),t})),me=e.computed((()=>({valid:p.valid,invalid:p.invalid,modelValue:p.modelValue,togglePassword:O,stepUp:Y,stepDown:Z,clear:te}))),{HintSlot:fe,hasHint:he,hasInvalid:be}=function(t,n){const{invalid:l,valid:u,hint:d,loading:s}=n,{hintLabel:c,modelValue:p,valid:v,validLabel:m,invalid:f,invalidLabel:h,...b}=e.toRefs(t),g=a(b,"loading"),y=a(b,"loadingLabel"),S=e.computed((()=>!(!f.value||(!f.value||!l)&&!((null==h?void 0:h.value)&&Array.isArray(h.value)&&h.value.length>0)&&(!(null==h?void 0:h.value)||i(h))))),w=e.computed((()=>!!(c&&c.value||d))),k=e.computed((()=>!!(m&&m.value||u))),B=e.computed((()=>!!((null==g?void 0:g.value)&&s||(null==g?void 0:g.value)&&(null==y?void 0:y.value)))),E=e.computed((()=>w.value||k.value||S.value||B.value));return{hasInvalid:S,hasHint:w,hasValid:k,hasLoading:B,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(t){const n=e.computed((()=>{const e=o.toReactive({hintLabel:c,modelValue:p,valid:v,validLabel:m,invalid:f,invalidLabel:h,loading:g,loadingLabel:y,...t.params});return(null==f?void 0:f.value)?(null==l?void 0:l(e))||r(null==h?void 0:h.value)||(null==c?void 0:c.value):(null==v?void 0:v.value)?(null==u?void 0:u(e))||r(null==m?void 0:m.value)||(null==c?void 0:c.value):(null==g?void 0:g.value)?(null==s?void 0:s(e))||r(null==y?void 0:y.value)||(null==c?void 0:c.value):(null==d?void 0:d(e))||r(null==c?void 0:c.value)||(null==c?void 0:c.value)}));return{isVisible:E,hasInvalid:S,hasValid:k,hintContent:n}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(p,f),ge=U(P.PASSWORD,p),ye=U(P.NUMBER,p),Se=U(P.SEARCH,p),we=e.ref();e.watch([()=>p.mask,()=>p.type,()=>p.maskEager,()=>p.maskReversed,()=>p.maskTokens,()=>p.maskTokensReplace],(([e,o,n,l,a,i])=>{e&&o===P.TEXT?we.value=new t.Mask({mask:e,eager:n,reversed:l,tokens:a,tokensReplace:i}):we.value=void 0}),{immediate:!0});const ke=()=>{re.value&&(V.value=!0)},Be=e.computed((()=>{if(p.autoWidth)return{width:void 0!==I.value?`${String(I.value).length+1}ch`:void 0}}));return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(pe))},[e.unref(w)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(L),class:"vv-input-text__label"},e.toDisplayString(e.unref(w)),9,j)):e.createCommentVNode("",!0),e.createElementVNode("div",W,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(me))))])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:b,class:"vv-input-text__inner",onClick:e.withModifiers(ke,["stop"])},[e.unref(ne)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(oe)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(L),ref_key:"inputEl",ref:h,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(I)?I.value=t:null)},e.unref(ve),{style:e.unref(Be),onKeyup:o[1]||(o[1]=e=>c("keyup",e))}),null,16,z),[[e.vModelDynamic,e.unref(I)]]),(t.unit||t.$slots.unit)&&e.unref(de)?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(me))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("",!0)],8,F),e.unref(le)||e.unref(ae)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(le)?e.unref(oe):e.unref(ae)),null,16)):e.unref(M)&&!t.hideActions&&e.unref(re)?(e.openBlock(),e.createBlock(e.unref(ge),{key:2,onTogglePassword:O})):e.unref(Q)&&!t.hideActions&&e.unref(re)?(e.openBlock(),e.createBlock(e.unref(ye),{key:3,onStepUp:Y,onStepDown:Z})):e.unref(ee)&&!t.hideActions&&e.unref(re)?(e.openBlock(),e.createBlock(e.unref(Se),{key:4,onClear:te})):e.createCommentVNode("",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(me))))])):e.createCommentVNode("",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("span",J,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(me))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ie)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(fe),{id:e.unref(A),class:"vv-input-text__hint"},null,8,["id"])],2))}})}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
modelValue: (StringConstructor | NumberConstructor)[];
|
|
3
3
|
type: {
|
|
4
|
-
type:
|
|
4
|
+
type: globalThis.PropType<import("../VvInputText").InputType>;
|
|
5
5
|
default: "text";
|
|
6
|
-
validator: (value: import("
|
|
6
|
+
validator: (value: import("../VvInputText").InputType) => boolean;
|
|
7
7
|
};
|
|
8
8
|
min: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
9
9
|
max: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
@@ -45,8 +45,39 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
45
|
type: StringConstructor;
|
|
46
46
|
default: string;
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
mask: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
maskEager: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
maskReversed: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
maskTokens: {
|
|
61
|
+
type: globalThis.PropType<import("maska").MaskTokens>;
|
|
62
|
+
default: undefined;
|
|
63
|
+
};
|
|
64
|
+
maskTokensReplace: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
autoWidth: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
72
|
+
hideActions: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: boolean;
|
|
75
|
+
};
|
|
76
|
+
unit: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
};
|
|
79
|
+
minlength: (StringConstructor | NumberConstructor)[];
|
|
80
|
+
maxlength: (StringConstructor | NumberConstructor)[];
|
|
50
81
|
placeholder: StringConstructor;
|
|
51
82
|
required: BooleanConstructor;
|
|
52
83
|
label: (StringConstructor | NumberConstructor)[];
|
|
@@ -55,9 +86,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
55
86
|
type: (StringConstructor | ObjectConstructor)[];
|
|
56
87
|
};
|
|
57
88
|
iconPosition: {
|
|
58
|
-
type:
|
|
59
|
-
default: import("../../constants
|
|
60
|
-
validation: (value: import("../../constants
|
|
89
|
+
type: globalThis.PropType<"before" | "after">;
|
|
90
|
+
default: import("../../constants").Position;
|
|
91
|
+
validation: (value: import("../../constants").Position) => boolean;
|
|
61
92
|
};
|
|
62
93
|
debounce: (StringConstructor | NumberConstructor)[];
|
|
63
94
|
count: {
|
|
@@ -65,7 +96,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
65
96
|
default: boolean;
|
|
66
97
|
validator: (value: string) => boolean;
|
|
67
98
|
};
|
|
68
|
-
modifiers:
|
|
99
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
69
100
|
loading: BooleanConstructor;
|
|
70
101
|
loadingLabel: {
|
|
71
102
|
type: StringConstructor;
|
|
@@ -95,12 +126,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
95
126
|
required: boolean;
|
|
96
127
|
};
|
|
97
128
|
id: (StringConstructor | NumberConstructor)[];
|
|
98
|
-
}, {
|
|
129
|
+
}, {
|
|
130
|
+
$inner: globalThis.Ref<any>;
|
|
131
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
99
132
|
modelValue: (StringConstructor | NumberConstructor)[];
|
|
100
133
|
type: {
|
|
101
|
-
type:
|
|
134
|
+
type: globalThis.PropType<import("../VvInputText").InputType>;
|
|
102
135
|
default: "text";
|
|
103
|
-
validator: (value: import("
|
|
136
|
+
validator: (value: import("../VvInputText").InputType) => boolean;
|
|
104
137
|
};
|
|
105
138
|
min: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
106
139
|
max: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
@@ -142,8 +175,39 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
142
175
|
type: StringConstructor;
|
|
143
176
|
default: string;
|
|
144
177
|
};
|
|
145
|
-
|
|
146
|
-
|
|
178
|
+
mask: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
default: undefined;
|
|
181
|
+
};
|
|
182
|
+
maskEager: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
default: boolean;
|
|
185
|
+
};
|
|
186
|
+
maskReversed: {
|
|
187
|
+
type: BooleanConstructor;
|
|
188
|
+
default: boolean;
|
|
189
|
+
};
|
|
190
|
+
maskTokens: {
|
|
191
|
+
type: globalThis.PropType<import("maska").MaskTokens>;
|
|
192
|
+
default: undefined;
|
|
193
|
+
};
|
|
194
|
+
maskTokensReplace: {
|
|
195
|
+
type: BooleanConstructor;
|
|
196
|
+
default: boolean;
|
|
197
|
+
};
|
|
198
|
+
autoWidth: {
|
|
199
|
+
type: BooleanConstructor;
|
|
200
|
+
default: boolean;
|
|
201
|
+
};
|
|
202
|
+
hideActions: {
|
|
203
|
+
type: BooleanConstructor;
|
|
204
|
+
default: boolean;
|
|
205
|
+
};
|
|
206
|
+
unit: {
|
|
207
|
+
type: StringConstructor;
|
|
208
|
+
};
|
|
209
|
+
minlength: (StringConstructor | NumberConstructor)[];
|
|
210
|
+
maxlength: (StringConstructor | NumberConstructor)[];
|
|
147
211
|
placeholder: StringConstructor;
|
|
148
212
|
required: BooleanConstructor;
|
|
149
213
|
label: (StringConstructor | NumberConstructor)[];
|
|
@@ -152,9 +216,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
152
216
|
type: (StringConstructor | ObjectConstructor)[];
|
|
153
217
|
};
|
|
154
218
|
iconPosition: {
|
|
155
|
-
type:
|
|
156
|
-
default: import("../../constants
|
|
157
|
-
validation: (value: import("../../constants
|
|
219
|
+
type: globalThis.PropType<"before" | "after">;
|
|
220
|
+
default: import("../../constants").Position;
|
|
221
|
+
validation: (value: import("../../constants").Position) => boolean;
|
|
158
222
|
};
|
|
159
223
|
debounce: (StringConstructor | NumberConstructor)[];
|
|
160
224
|
count: {
|
|
@@ -162,7 +226,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
162
226
|
default: boolean;
|
|
163
227
|
validator: (value: string) => boolean;
|
|
164
228
|
};
|
|
165
|
-
modifiers:
|
|
229
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
166
230
|
loading: BooleanConstructor;
|
|
167
231
|
loadingLabel: {
|
|
168
232
|
type: StringConstructor;
|
|
@@ -196,9 +260,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
196
260
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
197
261
|
}, {
|
|
198
262
|
disabled: boolean;
|
|
199
|
-
type: import("
|
|
263
|
+
type: import("../VvInputText").InputType;
|
|
264
|
+
mask: string;
|
|
265
|
+
floating: boolean;
|
|
200
266
|
required: boolean;
|
|
201
|
-
iconPosition:
|
|
267
|
+
iconPosition: "before" | "after";
|
|
202
268
|
loading: boolean;
|
|
203
269
|
loadingLabel: string;
|
|
204
270
|
multiple: boolean;
|
|
@@ -207,7 +273,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
207
273
|
invalid: boolean;
|
|
208
274
|
valid: boolean;
|
|
209
275
|
tabindex: string | number;
|
|
210
|
-
floating: boolean;
|
|
211
276
|
autocomplete: string;
|
|
212
277
|
autofocus: boolean;
|
|
213
278
|
step: string | number;
|
|
@@ -219,6 +284,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
219
284
|
labelShowPassword: string;
|
|
220
285
|
labelHidePassword: string;
|
|
221
286
|
labelClear: string;
|
|
287
|
+
maskEager: boolean;
|
|
288
|
+
maskReversed: boolean;
|
|
289
|
+
maskTokens: import("maska").MaskTokens;
|
|
290
|
+
maskTokensReplace: boolean;
|
|
291
|
+
autoWidth: boolean;
|
|
292
|
+
hideActions: boolean;
|
|
222
293
|
count: string | boolean;
|
|
223
294
|
}>, {
|
|
224
295
|
before: (_: {
|
|
@@ -230,6 +301,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
230
301
|
stepDown: () => void;
|
|
231
302
|
clear: () => void;
|
|
232
303
|
}) => any;
|
|
304
|
+
default: (_: {
|
|
305
|
+
valid: boolean;
|
|
306
|
+
invalid: boolean;
|
|
307
|
+
modelValue: string | number | undefined;
|
|
308
|
+
togglePassword: () => void;
|
|
309
|
+
stepUp: () => void;
|
|
310
|
+
stepDown: () => void;
|
|
311
|
+
clear: () => void;
|
|
312
|
+
}) => any;
|
|
233
313
|
after: (_: {
|
|
234
314
|
valid: boolean;
|
|
235
315
|
invalid: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import { type VvInputTextPropsTypes } from '
|
|
2
|
+
import { type VvInputTextPropsTypes } from '.';
|
|
3
3
|
export default function VvInputTextActionsFactory(type: string, parentProps: VvInputTextPropsTypes): Component;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { MaskTokens } from 'maska';
|
|
2
3
|
export declare const INPUT_TYPES: {
|
|
3
4
|
readonly TEXT: "text";
|
|
4
5
|
readonly PASSWORD: "password";
|
|
@@ -131,21 +132,77 @@ export declare const VvInputTextProps: {
|
|
|
131
132
|
type: StringConstructor;
|
|
132
133
|
default: string;
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Input mask, only for text type
|
|
137
|
+
* @see https://beholdr.github.io/maska/
|
|
138
|
+
*/
|
|
139
|
+
mask: {
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
default: undefined;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Show mask before typing
|
|
145
|
+
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
146
|
+
*/
|
|
147
|
+
maskEager: {
|
|
148
|
+
type: BooleanConstructor;
|
|
149
|
+
default: boolean;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Write values reverse (ex. for numbers)
|
|
153
|
+
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
154
|
+
*/
|
|
155
|
+
maskReversed: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Add mask custom tokens
|
|
161
|
+
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
162
|
+
*/
|
|
163
|
+
maskTokens: {
|
|
164
|
+
type: PropType<MaskTokens>;
|
|
165
|
+
default: undefined;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Replace default tokens
|
|
169
|
+
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
170
|
+
*/
|
|
171
|
+
maskTokensReplace: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
default: boolean;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Adjust input width to content
|
|
177
|
+
*/
|
|
178
|
+
autoWidth: {
|
|
179
|
+
type: BooleanConstructor;
|
|
180
|
+
default: boolean;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Hide type number, password and search actions
|
|
184
|
+
*/
|
|
185
|
+
hideActions: {
|
|
186
|
+
type: BooleanConstructor;
|
|
187
|
+
default: boolean;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Add unit label to input
|
|
191
|
+
*/
|
|
192
|
+
unit: {
|
|
193
|
+
type: StringConstructor;
|
|
194
|
+
};
|
|
195
|
+
minlength: (StringConstructor | NumberConstructor)[];
|
|
196
|
+
maxlength: (StringConstructor | NumberConstructor)[];
|
|
136
197
|
placeholder: StringConstructor;
|
|
137
198
|
required: BooleanConstructor;
|
|
138
|
-
label: (StringConstructor | NumberConstructor)[];
|
|
139
|
-
* Pattern the value must match to be valid
|
|
140
|
-
* Available for input types: text, search, url, tel, email and password
|
|
141
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
142
|
-
*/
|
|
199
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
143
200
|
floating: BooleanConstructor;
|
|
144
201
|
icon: {
|
|
145
202
|
type: (StringConstructor | ObjectConstructor)[];
|
|
146
203
|
};
|
|
147
204
|
iconPosition: {
|
|
148
|
-
type: PropType<
|
|
205
|
+
type: PropType<"before" | "after">;
|
|
149
206
|
default: import("../../constants").Position;
|
|
150
207
|
validation: (value: import("../../constants").Position) => boolean;
|
|
151
208
|
};
|
|
@@ -159,11 +216,7 @@ export declare const VvInputTextProps: {
|
|
|
159
216
|
loading: BooleanConstructor;
|
|
160
217
|
loadingLabel: {
|
|
161
218
|
type: StringConstructor;
|
|
162
|
-
default: string;
|
|
163
|
-
* Maximum value
|
|
164
|
-
* Available for input types: date, month, week, time, datetime-local, number, range.
|
|
165
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
166
|
-
*/
|
|
219
|
+
default: string;
|
|
167
220
|
};
|
|
168
221
|
hintLabel: {
|
|
169
222
|
type: StringConstructor;
|