@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3
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/auto-imports.d.ts +289 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +16 -50
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +170 -306
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +26 -60
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
- package/dist/components/VvCheckbox/index.d.ts +10 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
- 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 +330 -487
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
- package/dist/components/VvCombobox/index.d.ts +4 -4
- package/dist/components/VvDialog/VvDialog.es.js +66 -102
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +304 -407
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvProgress/VvProgress.es.js +17 -51
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +110 -249
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
- package/dist/components/VvRadio/index.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
- 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 +200 -292
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
- package/dist/components/VvTooltip/index.d.ts +18 -0
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1179 -1371
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcons.d.ts +1 -1
- package/dist/composables/useDebouncedInput.d.ts +1 -1
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useTextCount.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1211 -1404
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +27 -20
- 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 +0 -3
- package/src/components/VvAccordion/index.ts +1 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
- package/src/components/VvBadge/VvBadge.vue +0 -1
- package/src/components/VvButton/VvButton.vue +0 -3
- package/src/components/VvButton/index.ts +2 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
- package/src/components/VvCard/VvCard.vue +0 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
- package/src/components/VvCheckbox/index.ts +1 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
- package/src/components/VvCombobox/VvCombobox.vue +0 -7
- package/src/components/VvDialog/VvDialog.vue +1 -2
- package/src/components/VvDropdown/VvDropdown.vue +0 -4
- package/src/components/VvIcon/VvIcon.vue +0 -2
- package/src/components/VvInputText/VvInputClearAction.ts +0 -1
- package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
- package/src/components/VvInputText/VvInputStepAction.ts +0 -1
- package/src/components/VvInputText/VvInputText.vue +1 -16
- package/src/components/VvInputText/VvInputTextActions.ts +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -2
- package/src/components/VvRadio/VvRadio.vue +0 -3
- package/src/components/VvRadio/index.ts +0 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
- package/src/components/VvSelect/VvSelect.vue +1 -14
- package/src/components/VvTextarea/VvTextarea.vue +1 -15
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/components/common/HintSlot.ts +1 -11
- package/src/composables/group/types/IAccordionGroupState.ts +0 -1
- package/src/composables/group/types/IButtonGroupState.ts +0 -1
- package/src/composables/group/types/IInputGroup.ts +0 -1
- package/src/composables/group/useInjectedGroupState.ts +1 -2
- package/src/composables/group/useProvideGroupState.ts +0 -1
- package/src/composables/useComponentFocus.ts +1 -2
- package/src/composables/useComponentIcons.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useModifiers.ts +1 -2
- package/src/composables/useOptions.ts +0 -1
- package/src/composables/useTextCount.ts +1 -1
- package/src/stories/Accordion/Accordion.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Badge/Badge.stories.mdx +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.stories.mdx +1 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
- package/src/stories/Card/Card.stories.mdx +1 -1
- package/src/stories/Card/CardSlots.stories.mdx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.stories.mdx +1 -1
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/InputText/InputText.stories.mdx +1 -1
- package/src/stories/Progress/Progress.stories.mdx +1 -1
- package/src/stories/Radio/Radio.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Select/Select.stories.mdx +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,I){typeof exports=="object"&&typeof module<"u"?module.exports=I(require("vue"),require("@vueuse/core"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core","nanoid","@iconify/vue"],I):(e=typeof globalThis<"u"?globalThis:e||self,e.VvInputText=I(e.vue,e.core,e.nanoid,e.vue$1))})(this,function(e,I,Q,C){"use strict";function $(r,n){if(r&&Object.keys(r).length&&n){if(n.indexOf(".")===-1)return r[n];{const t=n.split(".");let i=r;for(let a=0,u=t.length;a<u;++a){if(r==null)return null;i=i[t[a]]}return i}}else return null}function D(r){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(r))}function ee(r){return typeof r=="string"||r instanceof String}function U(r){var n,t;if(r)return(t=(n=r.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:n.join("-"))==null?void 0:t.toLowerCase()}function R(r){return Array.isArray(r)?r.filter(n=>ee(n)).join(" "):r}function te(r,n){const{invalid:t,valid:i,hint:a,loading:u}=n,{hintLabel:s,modelValue:y,valid:S,validLabel:m,invalid:l,invalidLabel:c,...g}=e.toRefs(r),p=$(g,"loading"),h=$(g,"loadingLabel"),P=e.computed(()=>l.value?!!(l.value&&t||c!=null&&c.value&&Array.isArray(c.value)&&c.value.length>0||c!=null&&c.value&&!D(c)):!1),b=e.computed(()=>!!(s&&s.value||a)),A=e.computed(()=>!!(m&&m.value||i)),k=e.computed(()=>!!(p!=null&&p.value&&u||p!=null&&p.value&&(h!=null&&h.value))),_=e.computed(()=>b.value||A.value||P.value||k.value);return{hasInvalid:P,hasHint:b,hasValid:A,hasLoading:k,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(O){const B=e.computed(()=>{const T=I.toReactive({hintLabel:s,modelValue:y,valid:S,validLabel:m,invalid:l,invalidLabel:c,loading:p,loadingLabel:h,...O.params});return l!=null&&l.value?(t==null?void 0:t(T))||R(c==null?void 0:c.value)||(s==null?void 0:s.value):S!=null&&S.value?(i==null?void 0:i(T))||R(m==null?void 0:m.value)||(s==null?void 0:s.value):p!=null&&p.value?(u==null?void 0:u(T))||R(h==null?void 0:h.value)||(s==null?void 0:s.value):(a==null?void 0:a(T))||R(s==null?void 0:s.value)||(s==null?void 0:s.value)});return{isVisible:_,hasInvalid:P,hasValid:A,hintContent:B}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}function ne(r,n,t){const i=e.computed(()=>!!(r!=null&&r.value&&n.value==="left"||t!=null&&t.iconLeft)),a=e.computed(()=>!!(r!=null&&r.value&&n.value==="right"||t!=null&&t.iconRight)),u=e.computed(()=>!!(r!=null&&r.value&&n.value==="top"||t!=null&&t.iconTop)),s=e.computed(()=>!!(r!=null&&r.value&&n.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(r==null?void 0:r.value)=="string"?{name:r==null?void 0:r.value}:r==null?void 0:r.value),hasIconLeft:i,hasIconRight:a,hasIconTop:u,hasIconBottom:s}}function re(r,n){const{focused:t}=I.useFocus(r);return e.watch(t,i=>{n(i?"focus":"blur",e.unref(r))}),{focused:t}}function oe(r,n,t=0){let i;return typeof t=="string"&&(t=parseInt(t)),e.computed({get:()=>r==null?void 0:r.value,set:a=>{i&&clearTimeout(i),i=setTimeout(()=>{n("update:modelValue",a)},t)}})}function ae(r,n){const t=e.computed(()=>(e.unref(r)??"").length),i=e.computed(()=>(n==null?void 0:n.lowerLimit)!==void 0&&t.value<(n==null?void 0:n.lowerLimit)?t.value-n.lowerLimit:(n==null?void 0:n.upperLimit)!==void 0&&t.value<(n==null?void 0:n.upperLimit)?n.upperLimit-t.value:0),a=e.computed(()=>(n==null?void 0:n.mode)===!1?"":(n==null?void 0:n.mode)==="limit"&&(n!=null&&n.upperLimit)?`${t.value} / ${n.lowerLimit?`${n.lowerLimit}-`:""}${n.upperLimit}`:(n==null?void 0:n.mode)==="countdown"?i.value===0?void 0:i:t.value);return{length:t,gap:i,formatted:a}}function F(r,n){const t={[`${r}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(n).reduce((a,u)=>{const s=e.unref(n[u])||!1;if(!s)return a;if(u==="modifiers"){const y=Array.isArray(s)?s:s.split(" ");return{...a,...y.reduce((S,m)=>({...S,[`${r}--${U(m)}`]:!0}),{})}}else return{...a,[`${r}--${U(u)}`]:s}},t)||{})}}const ie="ds",le={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]}},se={name:"VvIcon"},w=e.defineComponent({...se,props:le,setup(r){const n=r,t=e.ref(!0),{modifiers:i}=e.toRefs(n),a=e.inject(ie),{bemCssClasses:u}=F("vv-icon",{modifiers:i}),s=e.computed(()=>n.provider||(a==null?void 0:a.provider)),y=e.computed(()=>{const l=n.name??"",c=`@${s.value}:${n.prefix}:${n.name}`;return C.iconExists(l)?l:C.iconExists(c)?c:(a==null?void 0:a.iconsCollections.find(g=>{const p=`@${s.value}:${g.prefix}:${l}`;if(C.iconExists(p))return p}))||l});function S(l){let c=null;if(typeof window>"u"){const{JSDOM:P}=require("jsdom");c=new P().window}return(c?new c.DOMParser:new window.DOMParser).parseFromString(l,"text/html").querySelector("svg")}function m(l){const c=S(l),g=(c==null?void 0:c.innerHTML.trim())||"";c&&g&&C.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:g,height:c.viewBox.baseVal.height,width:c.viewBox.baseVal.width})}return a&&(n.src&&!C.iconExists(`@${s.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then(l=>{l&&(m(l),t.value=!0)}).catch(l=>{throw new Error(`During fetch icon: ${l==null?void 0:l.message}`)})):n.svg&&m(n.svg)),(l,c)=>t.value?(e.openBlock(),e.createBlock(e.unref(C.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:l.rotate,color:l.color,onLoad:l.onLoad,icon:e.unref(y)}),null,16,["class"])):e.createCommentVNode("",!0)}}),ce={valid:Boolean,validLabel:[String,Array]},de={invalid:Boolean,invalidLabel:[String,Array]},ue={loading:Boolean,loadingLabel:String},pe={disabled:Boolean},fe={readonly:Boolean},me={modifiers:[String,Array]},he={hintLabel:{type:String,default:""}},Se={count:{type:[Boolean,String],default:!1,validator:r=>[!0,!1,"limit","countdown"].includes(r)}},ge={debounce:[Number,String]},W={LEFT:"left",RIGHT:"right"},be={icon:{type:[String,Object]},iconPosition:{type:String,validation:r=>Object.values(W).includes(r),default:W.RIGHT}},ye={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...pe,...fe,...ce,...de,...he,...ue,...me,...Se,...ge,...be,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},o={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"},we=["update:modelValue","focus","blur","keyup"],Ee={...ye,modelValue:[String,Number],type:{type:String,default:o.TEXT,validator:r=>Object.values(o).includes(r)},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"}},j=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(r,{emit:n}){const t=e.ref(!1),i=e.computed(()=>t.value?r.iconHide:r.iconShow);function a(u){u==null||u.stopPropagation(),r.disabled||(t.value=!t.value,n("toggle-password",t.value))}return{active:t,activeIcon:i,onClick:a}},render(){const r=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},r)}}),v=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:r=>["up","down"].includes(r),default:"up"}},emits:["step-up","step-down"],setup(r,{emit:n}){const t=e.computed(()=>r.mode==="up");return{isUp:t,onClick:a=>{a==null||a.stopPropagation(),r.disabled||n(t.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})}}),q=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup(r,{emit:n}){function t(i){i==null||i.stopPropagation(),r.disabled||n("clear")}return{onClick:t}},render(){const r=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},r)}});function H(r,n){return{name:"VvInputTextActions",components:{VvIcon:w,VvInputPasswordAction:j,VvInputStepAction:v,VvInputClearAction:q},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 t=null;switch(r){case o.SEARCH:{const{onClear:i}=this.$attrs;t=[e.h(q,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:i})];break}case o.PASSWORD:{const{onTogglePassword:i}=this.$attrs;t=[e.h(j,{disabled:this.isDisabled,onTogglePassword:i,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case o.NUMBER:{const{onStepUp:i,onStepDown:a}=this.$attrs;t=[e.h(v,{mode:"up",disabled:this.isDisabled||n.max!==void 0&&n.modelValue===n.max,label:this.labelStepUp,onStepUp:i,onStepDown:a}),e.h(v,{mode:"down",disabled:this.isDisabled||n.min!==void 0&&n.modelValue===n.min,label:this.labelStepDown,onStepUp:i,onStepDown:a})];break}}return Array.isArray(t)?e.h("div",{class:"vv-input-text__actions-group"},t):t}}}const Ie=["for"],Pe={class:"vv-input-text__wrapper"},Ae=["id"],Ce={key:0,class:"vv-input-text__limit"},Te={name:"VvInputText"};return e.defineComponent({...Te,props:Ee,emits:we,setup(r,{emit:n}){const t=r,i=e.useSlots(),a=e.ref(),{icon:u,iconPosition:s,label:y,modelValue:S,count:m,valid:l,invalid:c,loading:g}=e.toRefs(t),p=e.computed(()=>String(t.id||Q.nanoid())),h=e.computed(()=>`${p.value}-hint`),P=e.computed(()=>t.floating&&D(t.placeholder)?" ":t.placeholder),b=oe(S,n,t.debounce),{focused:A}=re(a,n),k=I.useElementVisibility(a);e.watch(k,d=>{d&&t.autofocus&&(A.value=!0)});const _=e.ref(!1),O=e.computed(()=>t.type===o.PASSWORD),B=()=>{_.value=!_.value},T=e.computed(()=>t.type===o.TIME||t.type===o.DATETIME_LOCAL||t.type===o.DATE||t.type===o.WEEK||t.type===o.MONTH),De=e.computed(()=>t.type===o.NUMBER),z=()=>{N.value&&(a.value.stepUp(),b.value=e.unref(a).value)},X=()=>{N.value&&(a.value.stepDown(),b.value=e.unref(a).value)},_e=e.computed(()=>t.type===o.SEARCH),K=()=>{b.value=void 0},{hasIconLeft:Z,hasIconRight:x,hasIcon:G}=ne(u,s),V=e.computed(()=>{switch(t.type){case o.COLOR:return{name:E.COLOR};case o.DATE:case o.DATETIME_LOCAL:case o.WEEK:case o.MONTH:return{name:E.DATE};case o.TIME:return{name:E.TIME};default:return""}}),{formatted:Re}=ae(b,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),N=e.computed(()=>!t.disabled&&!t.readonly),ke=e.computed(()=>N.value?t.tabindex:-1),Y=e.computed(()=>!D(S)),Oe=e.computed(()=>{if(c.value===!0)return!0;if(l.value===!0)return!1}),{bemCssClasses:Be}=F("vv-input-text",{modifiers:t.modifiers,valid:l,invalid:c,loading:g,disabled:t.disabled,readonly:t.readonly,iconLeft:Z,iconRight:x.value||!D(V),floating:t.floating&&!D(t.label),dirty:Y,focus:A}),ve=e.computed(()=>{const d=(()=>O.value&&_.value||T.value&&!Y.value&&!A.value?o.TEXT:t.type)(),f={type:d,name:t.name,tabindex:ke.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,"aria-invalid":Oe.value,"aria-describedby":!J.value&&xe.value?h.value:void 0,"aria-errormessage":J.value?h.value:void 0};return(d===o.DATE||d===o.MONTH||d===o.WEEK||d===o.TIME||d===o.DATETIME_LOCAL||d===o.NUMBER)&&(f.step=t.step,f.max=String(t.max),f.min=String(t.min)),(d===o.TEXT||d===o.SEARCH||d===o.URL||d===o.TEL||d===o.EMAIL||d===o.PASSWORD||d===o.NUMBER)&&(f.placeholder=P.value),(d===o.TEXT||d===o.SEARCH||d===o.URL||d===o.TEL||d===o.EMAIL||d===o.PASSWORD)&&(f.minlength=t.minlength,f.maxlength=t.maxlength,f.pattern=t.pattern),d===o.EMAIL&&(f.multiple=t.multiple),f}),L=e.computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,togglePassword:B,stepUp:z,stepDown:X,clear:K})),{HintSlot:He,hasHint:xe,hasInvalid:J}=te(t,i),Ve=H(o.PASSWORD,t),Ne=H(o.NUMBER,t),Le=H(o.SEARCH,t);return(d,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Be))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(p),class:"vv-input-text__label"},e.toDisplayString(e.unref(y)),9,Ie)):e.createCommentVNode("",!0),e.createElementVNode("div",Pe,[e.renderSlot(d.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(L))),()=>[e.unref(Z)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0,class:"vv-input-text__icon-left"},e.unref(G)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(p),ref_key:"input",ref:a,"onUpdate:modelValue":f[0]||(f[0]=M=>e.isRef(b)?b.value=M:null)},e.unref(ve),{onKeyup:f[1]||(f[1]=M=>n("keyup",M))}),null,16,Ae),[[e.vModelDynamic,e.unref(b)]]),e.renderSlot(d.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(L))),()=>[e.unref(x)||e.unref(V)?(e.openBlock(),e.createBlock(w,e.normalizeProps(e.mergeProps({key:0},e.unref(x)?e.unref(G):e.unref(V))),null,16)):e.unref(O)?(e.openBlock(),e.createBlock(e.unref(Ve),{key:1,onTogglePassword:B})):e.unref(De)?(e.openBlock(),e.createBlock(e.unref(Ne),{key:2,onStepUp:z,onStepDown:X})):e.unref(_e)?(e.openBlock(),e.createBlock(e.unref(Le),{key:3,onClear:K})):e.createCommentVNode("",!0)]),e.unref(m)?(e.openBlock(),e.createElementBlock("span",Ce,[e.renderSlot(d.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(L))),()=>[e.createTextVNode(e.toDisplayString(e.unref(Re)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(He),{id:e.unref(h),class:"vv-input-text__hint"},null,8,["id"])],2))}})});
|
|
1
|
+
(function(e,C){typeof exports=="object"&&typeof module<"u"?module.exports=C(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],C):(e=typeof globalThis<"u"?globalThis:e||self,e.VvInputText=C(e.vue,e.nanoid,e.vue$1))})(this,function(e,C,I){"use strict";function R(s){return Array.isArray(s)?s.filter(n=>isString(n)).join(" "):s}function Y(s,n){const{invalid:t,valid:d,hint:r,loading:f}=n,{hintLabel:c,modelValue:T,valid:y,validLabel:S,invalid:i,invalidLabel:a,...g}=toRefs(s),u=resolveFieldData(g,"loading"),m=resolveFieldData(g,"loadingLabel"),E=computed(()=>i.value?!!(i.value&&t||a!=null&&a.value&&Array.isArray(a.value)&&a.value.length>0||a!=null&&a.value&&!isEmpty(a)):!1),b=computed(()=>!!(c&&c.value||r)),P=computed(()=>!!(S&&S.value||d)),_=computed(()=>!!(u!=null&&u.value&&f||u!=null&&u.value&&(m!=null&&m.value))),D=computed(()=>b.value||P.value||E.value||_.value);return{hasInvalid:E,hasHint:b,hasValid:P,hasLoading:_,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(B){const V=computed(()=>{const A=toReactive({hintLabel:c,modelValue:T,valid:y,validLabel:S,invalid:i,invalidLabel:a,loading:u,loadingLabel:m,...B.params});return i!=null&&i.value?(t==null?void 0:t(A))||R(a==null?void 0:a.value)||(c==null?void 0:c.value):y!=null&&y.value?(d==null?void 0:d(A))||R(S==null?void 0:S.value)||(c==null?void 0:c.value):u!=null&&u.value?(f==null?void 0:f(A))||R(m==null?void 0:m.value)||(c==null?void 0:c.value):(r==null?void 0:r(A))||R(c==null?void 0:c.value)||(c==null?void 0:c.value)});return{isVisible:D,hasInvalid:E,hasValid:P,hintContent:V}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const J="ds",Q={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]}},Z={name:"VvIcon"},v=e.defineComponent({...Z,props:Q,setup(s){const n=s,t=ref(!0),{modifiers:d}=toRefs(n),r=inject(J),{bemCssClasses:f}=useBemModifiers("vv-icon",{modifiers:d}),c=computed(()=>n.provider||(r==null?void 0:r.provider)),T=computed(()=>{const i=n.name??"",a=`@${c.value}:${n.prefix}:${n.name}`;return I.iconExists(i)?i:I.iconExists(a)?a:(r==null?void 0:r.iconsCollections.find(g=>{const u=`@${c.value}:${g.prefix}:${i}`;if(I.iconExists(u))return u}))||i});function y(i){let a=null;if(typeof window>"u"){const{JSDOM:E}=require("jsdom");a=new E().window}return(a?new a.DOMParser:new window.DOMParser).parseFromString(i,"text/html").querySelector("svg")}function S(i){const a=y(i),g=(a==null?void 0:a.innerHTML.trim())||"";a&&g&&I.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:g,height:a.viewBox.baseVal.height,width:a.viewBox.baseVal.width})}return r&&(n.src&&!I.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(t.value=!1,r.fetchIcon(n.src).then(i=>{i&&(S(i),t.value=!0)}).catch(i=>{throw new Error(`During fetch icon: ${i==null?void 0:i.message}`)})):n.svg&&S(n.svg)),(i,a)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(I.Icon),e.mergeProps({key:0,class:e.unref(f)},{inline:i.inline,width:i.width,height:i.height,horizontalFlip:i.horizontalFlip,verticalFlip:i.verticalFlip,flip:i.flip,rotate:i.rotate,color:i.color,onLoad:i.onLoad,icon:e.unref(T)}),null,16,["class"])):e.createCommentVNode("",!0)}}),ee={valid:Boolean,validLabel:[String,Array]},te={invalid:Boolean,invalidLabel:[String,Array]},oe={loading:Boolean,loadingLabel:String},ne={disabled:Boolean},ie={readonly:Boolean},se={modifiers:[String,Array]},ae={hintLabel:{type:String,default:""}},re={count:{type:[Boolean,String],default:!1,validator:s=>[!0,!1,"limit","countdown"].includes(s)}},le={debounce:[Number,String]},U={LEFT:"left",RIGHT:"right"},ce={icon:{type:[String,Object]},iconPosition:{type:String,validation:s=>Object.values(U).includes(s),default:U.RIGHT}},de={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...ne,...ie,...ee,...te,...ae,...oe,...se,...re,...le,...ce,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},o={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"},w={PASSWORD_SHOW:"eye-on",PASSWORD_HIDE:"eye-off",DATE:"calendar",TIME:"time",COLOR:"color",SEARCH:"close"},ue=["update:modelValue","focus","blur","keyup"],pe={...de,modelValue:[String,Number],type:{type:String,default:o.TEXT,validator:s=>Object.values(o).includes(s)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:w.PASSWORD_SHOW},iconHidePassword:{type:String,default:w.PASSWORD_HIDE},iconClear:{type:String,default:w.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"}},F=defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:w.PASSWORD_SHOW},iconHide:{type:String,default:w.PASSWORD_HIDE}},emits:["toggle-password"],setup(s,{emit:n}){const t=ref(!1),d=computed(()=>t.value?s.iconHide:s.iconShow);function r(f){f==null||f.stopPropagation(),s.disabled||(t.value=!t.value,n("toggle-password",t.value))}return{active:t,activeIcon:d,onClick:r}},render(){const s=h(v,{name:this.activeIcon,class:"vv-input-text__action-icon"});return h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},s)}}),k=defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:s=>["up","down"].includes(s),default:"up"}},emits:["step-up","step-down"],setup(s,{emit:n}){const t=computed(()=>s.mode==="up");return{isUp:t,onClick:r=>{r==null||r.stopPropagation(),s.disabled||n(t.value?"step-up":"step-down")}}},render(){return 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})}}),W=defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup(s,{emit:n}){function t(d){d==null||d.stopPropagation(),s.disabled||n("clear")}return{onClick:t}},render(){const s=h(v,{name:this.icon,class:"vv-input-text__action-icon"});return h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},s)}});function H(s,n){return{name:"VvInputTextActions",components:{VvIcon:v,VvInputPasswordAction:F,VvInputStepAction:k,VvInputClearAction:W},setup(){return{isDisabled: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 t=null;switch(s){case o.SEARCH:{const{onClear:d}=this.$attrs;t=[h(W,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:d})];break}case o.PASSWORD:{const{onTogglePassword:d}=this.$attrs;t=[h(F,{disabled:this.isDisabled,onTogglePassword:d,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case o.NUMBER:{const{onStepUp:d,onStepDown:r}=this.$attrs;t=[h(k,{mode:"up",disabled:this.isDisabled||n.max!==void 0&&n.modelValue===n.max,label:this.labelStepUp,onStepUp:d,onStepDown:r}),h(k,{mode:"down",disabled:this.isDisabled||n.min!==void 0&&n.modelValue===n.min,label:this.labelStepDown,onStepUp:d,onStepDown:r})];break}}return Array.isArray(t)?h("div",{class:"vv-input-text__actions-group"},t):t}}}const fe=["for"],me={class:"vv-input-text__wrapper"},Se=["id"],he={key:0,class:"vv-input-text__limit"},ge={name:"VvInputText"};return e.defineComponent({...ge,props:pe,emits:ue,setup(s,{emit:n}){const t=s,d=useSlots(),r=ref(),{icon:f,iconPosition:c,label:T,modelValue:y,count:S,valid:i,invalid:a,loading:g}=toRefs(t),u=computed(()=>String(t.id||C.nanoid())),m=computed(()=>`${u.value}-hint`),E=computed(()=>t.floating&&isEmpty(t.placeholder)?" ":t.placeholder),b=useDebouncedInput(y,n,t.debounce),{focused:P}=useComponentFocus(r,n),_=useElementVisibility(r);watch(_,l=>{l&&t.autofocus&&(P.value=!0)});const D=ref(!1),B=computed(()=>t.type===o.PASSWORD),V=()=>{D.value=!D.value},A=computed(()=>t.type===o.TIME||t.type===o.DATETIME_LOCAL||t.type===o.DATE||t.type===o.WEEK||t.type===o.MONTH),be=computed(()=>t.type===o.NUMBER),$=()=>{N.value&&(r.value.stepUp(),b.value=unref(r).value)},q=()=>{N.value&&(r.value.stepDown(),b.value=unref(r).value)},ye=computed(()=>t.type===o.SEARCH),j=()=>{b.value=void 0},{hasIconLeft:z,hasIconRight:x,hasIcon:X}=useComponentIcon(f,c),O=computed(()=>{switch(t.type){case o.COLOR:return{name:w.COLOR};case o.DATE:case o.DATETIME_LOCAL:case o.WEEK:case o.MONTH:return{name:w.DATE};case o.TIME:return{name:w.TIME};default:return""}}),{formatted:ve}=useTextCount(b,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),N=computed(()=>!t.disabled&&!t.readonly),we=computed(()=>N.value?t.tabindex:-1),K=computed(()=>!isEmpty(y)),Ee=computed(()=>{if(a.value===!0)return!0;if(i.value===!0)return!1}),{bemCssClasses:Pe}=useBemModifiers("vv-input-text",{modifiers:t.modifiers,valid:i,invalid:a,loading:g,disabled:t.disabled,readonly:t.readonly,iconLeft:z,iconRight:x.value||!isEmpty(O),floating:t.floating&&!isEmpty(t.label),dirty:K,focus:P}),Ie=computed(()=>{const l=(()=>B.value&&D.value||A.value&&!K.value&&!P.value?o.TEXT:t.type)(),p={type:l,name:t.name,tabindex:we.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,"aria-invalid":Ee.value,"aria-describedby":!G.value&&Ae.value?m.value:void 0,"aria-errormessage":G.value?m.value:void 0};return(l===o.DATE||l===o.MONTH||l===o.WEEK||l===o.TIME||l===o.DATETIME_LOCAL||l===o.NUMBER)&&(p.step=t.step,p.max=String(t.max),p.min=String(t.min)),(l===o.TEXT||l===o.SEARCH||l===o.URL||l===o.TEL||l===o.EMAIL||l===o.PASSWORD||l===o.NUMBER)&&(p.placeholder=E.value),(l===o.TEXT||l===o.SEARCH||l===o.URL||l===o.TEL||l===o.EMAIL||l===o.PASSWORD)&&(p.minlength=t.minlength,p.maxlength=t.maxlength,p.pattern=t.pattern),l===o.EMAIL&&(p.multiple=t.multiple),p}),M=computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,togglePassword:V,stepUp:$,stepDown:q,clear:j})),{HintSlot:Te,hasHint:Ae,hasInvalid:G}=Y(t,d),Ce=H(o.PASSWORD,t),De=H(o.NUMBER,t),Re=H(o.SEARCH,t);return(l,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Pe))},[e.unref(T)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(u),class:"vv-input-text__label"},e.toDisplayString(e.unref(T)),9,fe)):e.createCommentVNode("",!0),e.createElementVNode("div",me,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(M))),()=>[e.unref(z)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-input-text__icon-left"},e.unref(X)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(u),ref_key:"input",ref:r,"onUpdate:modelValue":p[0]||(p[0]=L=>e.isRef(b)?b.value=L:null)},e.unref(Ie),{onKeyup:p[1]||(p[1]=L=>n("keyup",L))}),null,16,Se),[[e.vModelDynamic,e.unref(b)]]),e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(M))),()=>[e.unref(x)||e.unref(O)?(e.openBlock(),e.createBlock(v,e.normalizeProps(e.mergeProps({key:0},e.unref(x)?e.unref(X):e.unref(O))),null,16)):e.unref(B)?(e.openBlock(),e.createBlock(e.unref(Ce),{key:1,onTogglePassword:V})):e.unref(be)?(e.openBlock(),e.createBlock(e.unref(De),{key:2,onStepUp:$,onStepDown:q})):e.unref(ye)?(e.openBlock(),e.createBlock(e.unref(Re),{key:3,onClear:j})):e.createCommentVNode("",!0)]),e.unref(S)?(e.openBlock(),e.createElementBlock("span",he,[e.renderSlot(l.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(M))),()=>[e.createTextVNode(e.toDisplayString(e.unref(ve)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Te),{id:e.unref(m),class:"vv-input-text__hint"},null,8,["id"])],2))}})});
|
|
@@ -5,8 +5,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
5
5
|
default: "text";
|
|
6
6
|
validator: (value: import("@/components/VvInputText").InputType) => boolean;
|
|
7
7
|
};
|
|
8
|
-
min: (
|
|
9
|
-
max: (
|
|
8
|
+
min: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
9
|
+
max: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
10
10
|
step: {
|
|
11
11
|
type: (StringConstructor | NumberConstructor)[];
|
|
12
12
|
default: number;
|
|
@@ -52,7 +52,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
52
52
|
label: StringConstructor;
|
|
53
53
|
floating: BooleanConstructor;
|
|
54
54
|
icon: {
|
|
55
|
-
type: (
|
|
55
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
56
56
|
};
|
|
57
57
|
iconPosition: {
|
|
58
58
|
type: import("vue").PropType<import("../../props/index.js").IconPosition>;
|
|
@@ -73,9 +73,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
73
73
|
default: string;
|
|
74
74
|
};
|
|
75
75
|
invalid: BooleanConstructor;
|
|
76
|
-
invalidLabel: (
|
|
76
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
77
77
|
valid: BooleanConstructor;
|
|
78
|
-
validLabel: (
|
|
78
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
79
79
|
readonly: BooleanConstructor;
|
|
80
80
|
disabled: BooleanConstructor;
|
|
81
81
|
tabindex: {
|
|
@@ -99,8 +99,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
99
99
|
default: "text";
|
|
100
100
|
validator: (value: import("@/components/VvInputText").InputType) => boolean;
|
|
101
101
|
};
|
|
102
|
-
min: (
|
|
103
|
-
max: (
|
|
102
|
+
min: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
103
|
+
max: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
104
104
|
step: {
|
|
105
105
|
type: (StringConstructor | NumberConstructor)[];
|
|
106
106
|
default: number;
|
|
@@ -146,7 +146,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
146
146
|
label: StringConstructor;
|
|
147
147
|
floating: BooleanConstructor;
|
|
148
148
|
icon: {
|
|
149
|
-
type: (
|
|
149
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
150
150
|
};
|
|
151
151
|
iconPosition: {
|
|
152
152
|
type: import("vue").PropType<import("../../props/index.js").IconPosition>;
|
|
@@ -167,9 +167,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
167
167
|
default: string;
|
|
168
168
|
};
|
|
169
169
|
invalid: BooleanConstructor;
|
|
170
|
-
invalidLabel: (
|
|
170
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
171
171
|
valid: BooleanConstructor;
|
|
172
|
-
validLabel: (
|
|
172
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
173
173
|
readonly: BooleanConstructor;
|
|
174
174
|
disabled: BooleanConstructor;
|
|
175
175
|
tabindex: {
|
|
@@ -44,13 +44,13 @@ export declare const VvInputTextProps: {
|
|
|
44
44
|
* Available for input types: date, month, week, time, datetime-local, number, range.
|
|
45
45
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
46
46
|
*/
|
|
47
|
-
min: (
|
|
47
|
+
min: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
48
48
|
/**
|
|
49
49
|
* Maximum value
|
|
50
50
|
* Available for input types: date, month, week, time, datetime-local, number, range.
|
|
51
51
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
52
52
|
*/
|
|
53
|
-
max: (
|
|
53
|
+
max: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
54
54
|
/**
|
|
55
55
|
* Incremental values that are valid
|
|
56
56
|
* Available for input types: date, month, week, time, datetime-local and number
|
|
@@ -138,7 +138,7 @@ export declare const VvInputTextProps: {
|
|
|
138
138
|
label: StringConstructor;
|
|
139
139
|
floating: BooleanConstructor;
|
|
140
140
|
icon: {
|
|
141
|
-
type: (
|
|
141
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
142
142
|
};
|
|
143
143
|
iconPosition: {
|
|
144
144
|
type: PropType<import("@/props").IconPosition>;
|
|
@@ -159,9 +159,9 @@ export declare const VvInputTextProps: {
|
|
|
159
159
|
default: string;
|
|
160
160
|
};
|
|
161
161
|
invalid: BooleanConstructor;
|
|
162
|
-
invalidLabel: (
|
|
162
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
163
163
|
valid: BooleanConstructor;
|
|
164
|
-
validLabel: (
|
|
164
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
165
165
|
readonly: BooleanConstructor;
|
|
166
166
|
disabled: BooleanConstructor;
|
|
167
167
|
tabindex: {
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var e, t;
|
|
4
|
-
if (r)
|
|
5
|
-
return (t = (e = r.match(
|
|
6
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
7
|
-
)) == null ? void 0 : e.join("-")) == null ? void 0 : t.toLowerCase();
|
|
8
|
-
}
|
|
9
|
-
function _(r, e) {
|
|
10
|
-
const t = { [`${r}`]: !0 };
|
|
11
|
-
return {
|
|
12
|
-
bemCssClasses: m(() => Object.keys(e).reduce((o, n) => {
|
|
13
|
-
const s = a(e[n]) || !1;
|
|
14
|
-
if (!s)
|
|
15
|
-
return o;
|
|
16
|
-
if (n === "modifiers") {
|
|
17
|
-
const u = Array.isArray(s) ? s : s.split(" ");
|
|
18
|
-
return {
|
|
19
|
-
...o,
|
|
20
|
-
...u.reduce(
|
|
21
|
-
(l, d) => ({
|
|
22
|
-
...l,
|
|
23
|
-
[`${r}--${c(d)}`]: !0
|
|
24
|
-
}),
|
|
25
|
-
{}
|
|
26
|
-
)
|
|
27
|
-
};
|
|
28
|
-
} else
|
|
29
|
-
return {
|
|
30
|
-
...o,
|
|
31
|
-
[`${r}--${c(n)}`]: s
|
|
32
|
-
};
|
|
33
|
-
}, t) || {})
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const v = {
|
|
1
|
+
import { defineComponent as l, openBlock as m, createElementBlock as p, mergeProps as u, unref as e } from "vue";
|
|
2
|
+
const c = {
|
|
37
3
|
modifiers: [String, Array]
|
|
38
|
-
},
|
|
39
|
-
...
|
|
4
|
+
}, d = {
|
|
5
|
+
...c,
|
|
40
6
|
value: {
|
|
41
7
|
type: [Number, String],
|
|
42
8
|
default: void 0
|
|
@@ -48,24 +14,24 @@ const v = {
|
|
|
48
14
|
type: String,
|
|
49
15
|
required: !0
|
|
50
16
|
}
|
|
51
|
-
},
|
|
17
|
+
}, f = {
|
|
52
18
|
name: "VvProgress"
|
|
53
|
-
},
|
|
54
|
-
...
|
|
55
|
-
props:
|
|
56
|
-
setup(
|
|
57
|
-
const
|
|
58
|
-
modifiers:
|
|
19
|
+
}, _ = /* @__PURE__ */ l({
|
|
20
|
+
...f,
|
|
21
|
+
props: d,
|
|
22
|
+
setup(s) {
|
|
23
|
+
const r = s, { value: o, max: t, label: a } = toRefs(r), n = computed(() => r.value === void 0), { bemCssClasses: i } = useBemModifiers("vv-progress", {
|
|
24
|
+
modifiers: r.modifiers,
|
|
59
25
|
indeterminate: n
|
|
60
26
|
});
|
|
61
|
-
return (
|
|
62
|
-
class:
|
|
63
|
-
ariaLabel: a
|
|
64
|
-
max:
|
|
65
|
-
value:
|
|
27
|
+
return (g, v) => (m(), p("progress", u({ role: "progressbar" }, {
|
|
28
|
+
class: e(i),
|
|
29
|
+
ariaLabel: e(a),
|
|
30
|
+
max: e(t),
|
|
31
|
+
value: e(o)
|
|
66
32
|
}), null, 16));
|
|
67
33
|
}
|
|
68
34
|
});
|
|
69
35
|
export {
|
|
70
|
-
|
|
36
|
+
_ as default
|
|
71
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.VvProgress=r(e.vue))})(this,function(e){"use strict";const o={...{modifiers:[String,Array]},value:{type:[Number,String],default:void 0},max:{type:[Number,String]},label:{type:String,required:!0}},n={name:"VvProgress"};return e.defineComponent({...n,props:o,setup(t){const s=t,{value:i,max:a,label:f}=toRefs(s),u=computed(()=>s.value===void 0),{bemCssClasses:d}=useBemModifiers("vv-progress",{modifiers:s.modifiers,indeterminate:u});return(l,c)=>(e.openBlock(),e.createElementBlock("progress",e.mergeProps({role:"progressbar"},{class:e.unref(d),ariaLabel:e.unref(f),max:e.unref(a),value:e.unref(i)}),null,16))}})});
|