@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,w){typeof exports=="object"&&typeof module<"u"?module.exports=w(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],w):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=w(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,w,_,b){"use strict";function T(n,r){if(n&&Object.keys(n).length&&r){if(r.indexOf(".")===-1)return n[r];{const t=r.split(".");let s=n;for(let l=0,u=t.length;l<u;++l){if(n==null)return null;s=s[t[l]]}return s}}else return null}function x(n){return(r=>r==null||r===""||Array.isArray(r)&&r.length===0||!(r instanceof Date)&&typeof r=="object"&&Object.keys(r).length===0)(e.unref(n))}function O(n){return typeof n=="string"||n instanceof String}function E(n){var r,t;if(n)return(t=(r=n.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:r.join("-"))==null?void 0:t.toLowerCase()}function B(n){return Array.isArray(n)?n.filter(r=>O(r)).join(" "):n}function j(n,r){const{invalid:t,valid:s,hint:l,loading:u}=r,{hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,...p}=e.toRefs(n),c=T(p,"loading"),f=T(p,"loadingLabel"),y=e.computed(()=>o.value?!!(o.value&&t||i!=null&&i.value&&Array.isArray(i.value)&&i.value.length>0||i!=null&&i.value&&!x(i)):!1),h=e.computed(()=>!!(a&&a.value||l)),S=e.computed(()=>!!(d&&d.value||s)),I=e.computed(()=>!!(c!=null&&c.value&&u||c!=null&&c.value&&(f!=null&&f.value))),V=e.computed(()=>h.value||S.value||y.value||I.value);return{hasInvalid:y,hasHint:h,hasValid:S,hasLoading:I,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(k){const N=e.computed(()=>{const P=_.toReactive({hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,loading:c,loadingLabel:f,...k.params});return o!=null&&o.value?(t==null?void 0:t(P))||B(i==null?void 0:i.value)||(a==null?void 0:a.value):m!=null&&m.value?(s==null?void 0:s(P))||B(d==null?void 0:d.value)||(a==null?void 0:a.value):c!=null&&c.value?(u==null?void 0:u(P))||B(f==null?void 0:f.value)||(a==null?void 0:a.value):(l==null?void 0:l(P))||B(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:V,hasInvalid:y,hasValid:S,hintContent:N}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}function z(n,r,t){const s=e.computed(()=>!!(n!=null&&n.value&&r.value==="left"||t!=null&&t.iconLeft)),l=e.computed(()=>!!(n!=null&&n.value&&r.value==="right"||t!=null&&t.iconRight)),u=e.computed(()=>!!(n!=null&&n.value&&r.value==="top"||t!=null&&t.iconTop)),a=e.computed(()=>!!(n!=null&&n.value&&r.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(n==null?void 0:n.value)=="string"?{name:n==null?void 0:n.value}:n==null?void 0:n.value),hasIconLeft:s,hasIconRight:l,hasIconTop:u,hasIconBottom:a}}function q(n,r){const{focused:t}=_.useFocus(n);return e.watch(t,s=>{r(s?"focus":"blur",e.unref(n))}),{focused:t}}function H(n,r,t=0){let s;return typeof t=="string"&&(t=parseInt(t)),e.computed({get:()=>n==null?void 0:n.value,set:l=>{s&&clearTimeout(s),s=setTimeout(()=>{r("update:modelValue",l)},t)}})}function M(n,r){const t=e.computed(()=>(e.unref(n)??"").length),s=e.computed(()=>(r==null?void 0:r.lowerLimit)!==void 0&&t.value<(r==null?void 0:r.lowerLimit)?t.value-r.lowerLimit:(r==null?void 0:r.upperLimit)!==void 0&&t.value<(r==null?void 0:r.upperLimit)?r.upperLimit-t.value:0),l=e.computed(()=>(r==null?void 0:r.mode)===!1?"":(r==null?void 0:r.mode)==="limit"&&(r!=null&&r.upperLimit)?`${t.value} / ${r.lowerLimit?`${r.lowerLimit}-`:""}${r.upperLimit}`:(r==null?void 0:r.mode)==="countdown"?s.value===0?void 0:s:t.value);return{length:t,gap:s,formatted:l}}function F(n,r){const t={[`${n}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((l,u)=>{const a=e.unref(r[u])||!1;if(!a)return l;if(u==="modifiers"){const g=Array.isArray(a)?a:a.split(" ");return{...l,...g.reduce((m,d)=>({...m,[`${n}--${E(d)}`]:!0}),{})}}else return{...l,[`${n}--${E(u)}`]:a}},t)||{})}}const Z="ds",G={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]}},K={name:"VvIcon"},L=e.defineComponent({...K,props:G,setup(n){const r=n,t=e.ref(!0),{modifiers:s}=e.toRefs(r),l=e.inject(Z),{bemCssClasses:u}=F("vv-icon",{modifiers:s}),a=e.computed(()=>r.provider||(l==null?void 0:l.provider)),g=e.computed(()=>{const o=r.name??"",i=`@${a.value}:${r.prefix}:${r.name}`;return b.iconExists(o)?o:b.iconExists(i)?i:(l==null?void 0:l.iconsCollections.find(p=>{const c=`@${a.value}:${p.prefix}:${o}`;if(b.iconExists(c))return c}))||o});function m(o){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(o,"text/html").querySelector("svg")}function d(o){const i=m(o),p=(i==null?void 0:i.innerHTML.trim())||"";i&&p&&b.addIcon(`@${a.value}:${r.prefix}:${r.name}`,{body:p,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return l&&(r.src&&!b.iconExists(`@${a.value}:${r.prefix}:${r.name}`)?(t.value=!1,l.fetchIcon(r.src).then(o=>{o&&(d(o),t.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):r.svg&&d(r.svg)),(o,i)=>t.value?(e.openBlock(),e.createBlock(e.unref(b.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(g)}),null,16,["class"])):e.createCommentVNode("",!0)}}),J={valid:Boolean,validLabel:[String,Array]},U={invalid:Boolean,invalidLabel:[String,Array]},W={loading:Boolean,loadingLabel:String},X={disabled:Boolean},Q={readonly:Boolean},Y={modifiers:[String,Array]},ee={hintLabel:{type:String,default:""}},te={count:{type:[Boolean,String],default:!1,validator:n=>[!0,!1,"limit","countdown"].includes(n)}},re={debounce:[Number,String]},R={LEFT:"left",RIGHT:"right"},ne={icon:{type:[String,Object]},iconPosition:{type:String,validation:n=>Object.values(R).includes(n),default:R.RIGHT}},oe={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...X,...Q,...J,...U,...ee,...W,...Y,...te,...re,...ne,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},ae={hard:"hard",soft:"soft"},le={true:!0,false:!1,default:"default"},ie=["update:modelValue","focus","blur","keyup"],se={...oe,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:ae.soft},spellcheck:{type:[Boolean,String],default:le.default},resizable:Boolean},ce=["for"],ue={class:"vv-textarea__wrapper"},de=["id"],fe={key:0,class:"vv-textarea__limit"},me={name:"VvTextarea"};return e.defineComponent({...me,props:se,emits:ie,setup(n,{emit:r}){const t=n,s=e.useSlots(),l=e.ref(),{icon:u,iconPosition:a,label:g,modelValue:m,count:d,valid:o,invalid:i,loading:p}=e.toRefs(t),c=e.computed(()=>String(t.id||w.nanoid())),f=e.computed(()=>`${c.value}-hint`),y=e.computed(()=>t.floating&&x(t.placeholder)?" ":t.placeholder),h=H(m,r,t.debounce),{hasIcon:S,hasIconLeft:I,hasIconRight:V}=z(u,a),{focused:k}=q(l,r),N=_.useElementVisibility(l);e.watch(N,C=>{C&&t.autofocus&&(k.value=!0)});const{formatted:P}=M(h,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),pe=e.computed(()=>!t.disabled&&!t.readonly),ge=e.computed(()=>pe.value?t.tabindex:-1),he=e.computed(()=>!x(m)),ye=e.computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:be,hasHint:Se,hasInvalid:D}=j(t,s),{bemCssClasses:Pe}=F("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:i,loading:p,disabled:t.disabled,readonly:t.readonly,iconLeft:I,iconRight:V,floating:t.floating&&!x(t.label),dirty:he,focused:k,resizable:t.resizable}),we=e.computed(()=>({name:t.name,placeholder:y.value,tabindex:ge.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,minlength:t.minlength,maxlength:t.maxlength,cols:t.cols,rows:t.rows,wrap:t.wrap,spellcheck:t.spellcheck,"aria-invalid":ye.value,"aria-describedby":!D.value&&Se.value?f.value:void 0,"aria-errormessage":D.value?f.value:void 0})),$=e.computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:Ie})),Ie=()=>{h.value=void 0};return(C,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Pe))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(c),class:"vv-textarea__label"},e.toDisplayString(e.unref(g)),9,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",ue,[e.renderSlot(C.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(I)?(e.openBlock(),e.createBlock(L,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(S)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(c),ref_key:"textarea",ref:l,"onUpdate:modelValue":v[0]||(v[0]=A=>e.isRef(h)?h.value=A:null)},e.unref(we),{onKeyup:v[1]||(v[1]=A=>r("keyup",A))}),null,16,de),[[e.vModelText,e.unref(h)]]),e.renderSlot(C.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(V)?(e.openBlock(),e.createBlock(L,e.normalizeProps(e.mergeProps({key:0},e.unref(S))),null,16)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(C.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.createTextVNode(e.toDisplayString(e.unref(P)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(be),{id:e.unref(f),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
|
|
1
|
+
(function(e,V){typeof exports=="object"&&typeof module<"u"?module.exports=V(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],V):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=V(e.vue,e.nanoid,e.vue$1))})(this,function(e,V,S){"use strict";function w(l){return Array.isArray(l)?l.filter(i=>isString(i)).join(" "):l}function R(l,i){const{invalid:t,valid:f,hint:a,loading:m}=i,{hintLabel:r,modelValue:v,valid:p,validLabel:d,invalid:o,invalidLabel:n,...u}=toRefs(l),s=resolveFieldData(u,"loading"),c=resolveFieldData(u,"loadingLabel"),y=computed(()=>o.value?!!(o.value&&t||n!=null&&n.value&&Array.isArray(n.value)&&n.value.length>0||n!=null&&n.value&&!isEmpty(n)):!1),g=computed(()=>!!(r&&r.value||a)),P=computed(()=>!!(d&&d.value||f)),x=computed(()=>!!(s!=null&&s.value&&m||s!=null&&s.value&&(c!=null&&c.value))),I=computed(()=>g.value||P.value||y.value||x.value);return{hasInvalid:y,hasHint:g,hasValid:P,hasLoading:x,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(C){const N=computed(()=>{const b=toReactive({hintLabel:r,modelValue:v,valid:p,validLabel:d,invalid:o,invalidLabel:n,loading:s,loadingLabel:c,...C.params});return o!=null&&o.value?(t==null?void 0:t(b))||w(n==null?void 0:n.value)||(r==null?void 0:r.value):p!=null&&p.value?(f==null?void 0:f(b))||w(d==null?void 0:d.value)||(r==null?void 0:r.value):s!=null&&s.value?(m==null?void 0:m(b))||w(c==null?void 0:c.value)||(r==null?void 0:r.value):(a==null?void 0:a(b))||w(r==null?void 0:r.value)||(r==null?void 0:r.value)});return{isVisible:I,hasInvalid:y,hasValid:P,hintContent:N}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const $="ds",A={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"},F=e.defineComponent({...z,props:A,setup(l){const i=l,t=ref(!0),{modifiers:f}=toRefs(i),a=inject($),{bemCssClasses:m}=useBemModifiers("vv-icon",{modifiers:f}),r=computed(()=>i.provider||(a==null?void 0:a.provider)),v=computed(()=>{const o=i.name??"",n=`@${r.value}:${i.prefix}:${i.name}`;return S.iconExists(o)?o:S.iconExists(n)?n:(a==null?void 0:a.iconsCollections.find(u=>{const s=`@${r.value}:${u.prefix}:${o}`;if(S.iconExists(s))return s}))||o});function p(o){let n=null;if(typeof window>"u"){const{JSDOM:y}=require("jsdom");n=new y().window}return(n?new n.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function d(o){const n=p(o),u=(n==null?void 0:n.innerHTML.trim())||"";n&&u&&S.addIcon(`@${r.value}:${i.prefix}:${i.name}`,{body:u,height:n.viewBox.baseVal.height,width:n.viewBox.baseVal.width})}return a&&(i.src&&!S.iconExists(`@${r.value}:${i.prefix}:${i.name}`)?(t.value=!1,a.fetchIcon(i.src).then(o=>{o&&(d(o),t.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):i.svg&&d(i.svg)),(o,n)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(S.Icon),e.mergeProps({key:0,class:e.unref(m)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}}),H={valid:Boolean,validLabel:[String,Array]},q={invalid:Boolean,invalidLabel:[String,Array]},O={loading:Boolean,loadingLabel:String},M={disabled:Boolean},j={readonly:Boolean},L={modifiers:[String,Array]},G={hintLabel:{type:String,default:""}},K={count:{type:[Boolean,String],default:!1,validator:l=>[!0,!1,"limit","countdown"].includes(l)}},J={debounce:[Number,String]},T={LEFT:"left",RIGHT:"right"},U={icon:{type:[String,Object]},iconPosition:{type:String,validation:l=>Object.values(T).includes(l),default:T.RIGHT}},W={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...M,...j,...H,...q,...G,...O,...L,...K,...J,...U,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},X={hard:"hard",soft:"soft"},Q={true:!0,false:!1,default:"default"},Y=["update:modelValue","focus","blur","keyup"],Z={...W,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:X.soft},spellcheck:{type:[Boolean,String],default:Q.default},resizable:Boolean},ee=["for"],te={class:"vv-textarea__wrapper"},oe=["id"],ne={key:0,class:"vv-textarea__limit"},re={name:"VvTextarea"};return e.defineComponent({...re,props:Z,emits:Y,setup(l,{emit:i}){const t=l,f=useSlots(),a=ref(),{icon:m,iconPosition:r,label:v,modelValue:p,count:d,valid:o,invalid:n,loading:u}=toRefs(t),s=computed(()=>String(t.id||V.nanoid())),c=computed(()=>`${s.value}-hint`),y=computed(()=>t.floating&&isEmpty(t.placeholder)?" ":t.placeholder),g=useDebouncedInput(p,i,t.debounce),{hasIcon:P,hasIconLeft:x,hasIconRight:I}=useComponentIcon(m,r),{focused:C}=useComponentFocus(a,i),N=useElementVisibility(a);watch(N,B=>{B&&t.autofocus&&(C.value=!0)});const{formatted:b}=useTextCount(g,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),ie=computed(()=>!t.disabled&&!t.readonly),se=computed(()=>ie.value?t.tabindex:-1),ae=computed(()=>!isEmpty(p)),le=computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:ce,hasHint:de,hasInvalid:D}=R(t,f),{bemCssClasses:ue}=useBemModifiers("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:n,loading:u,disabled:t.disabled,readonly:t.readonly,iconLeft:x,iconRight:I,floating:t.floating&&!isEmpty(t.label),dirty:ae,focused:C,resizable:t.resizable}),pe=computed(()=>({name:t.name,placeholder:y.value,tabindex:se.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,minlength:t.minlength,maxlength:t.maxlength,cols:t.cols,rows:t.rows,wrap:t.wrap,spellcheck:t.spellcheck,"aria-invalid":le.value,"aria-describedby":!D.value&&de.value?c.value:void 0,"aria-errormessage":D.value?c.value:void 0})),_=computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:fe})),fe=()=>{g.value=void 0};return(B,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ue))},[e.unref(v)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(s),class:"vv-textarea__label"},e.toDisplayString(e.unref(v)),9,ee)):e.createCommentVNode("",!0),e.createElementVNode("div",te,[e.renderSlot(B.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(x)?(e.openBlock(),e.createBlock(F,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(P)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(s),ref_key:"textarea",ref:a,"onUpdate:modelValue":k[0]||(k[0]=E=>e.isRef(g)?g.value=E:null)},e.unref(pe),{onKeyup:k[1]||(k[1]=E=>i("keyup",E))}),null,16,oe),[[e.vModelText,e.unref(g)]]),e.renderSlot(B.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.unref(I)?(e.openBlock(),e.createBlock(F,e.normalizeProps(e.mergeProps({key:0},e.unref(P))),null,16)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("span",ne,[e.renderSlot(B.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(_))),()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(ce),{id:e.unref(c),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
|
|
@@ -24,7 +24,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
24
24
|
label: StringConstructor;
|
|
25
25
|
floating: BooleanConstructor;
|
|
26
26
|
icon: {
|
|
27
|
-
type: (
|
|
27
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
28
28
|
};
|
|
29
29
|
iconPosition: {
|
|
30
30
|
type: import("vue").PropType<import("../../props/index.js").IconPosition>;
|
|
@@ -45,9 +45,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
45
|
default: string;
|
|
46
46
|
};
|
|
47
47
|
invalid: BooleanConstructor;
|
|
48
|
-
invalidLabel: (
|
|
48
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
49
49
|
valid: BooleanConstructor;
|
|
50
|
-
validLabel: (
|
|
50
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
51
51
|
readonly: BooleanConstructor;
|
|
52
52
|
disabled: BooleanConstructor;
|
|
53
53
|
tabindex: {
|
|
@@ -90,7 +90,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
90
90
|
label: StringConstructor;
|
|
91
91
|
floating: BooleanConstructor;
|
|
92
92
|
icon: {
|
|
93
|
-
type: (
|
|
93
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
94
94
|
};
|
|
95
95
|
iconPosition: {
|
|
96
96
|
type: import("vue").PropType<import("../../props/index.js").IconPosition>;
|
|
@@ -111,9 +111,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
111
111
|
default: string;
|
|
112
112
|
};
|
|
113
113
|
invalid: BooleanConstructor;
|
|
114
|
-
invalidLabel: (
|
|
114
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
115
115
|
valid: BooleanConstructor;
|
|
116
|
-
validLabel: (
|
|
116
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
117
117
|
readonly: BooleanConstructor;
|
|
118
118
|
disabled: BooleanConstructor;
|
|
119
119
|
tabindex: {
|
|
@@ -58,7 +58,7 @@ export declare const VvTextareaProps: {
|
|
|
58
58
|
label: StringConstructor;
|
|
59
59
|
floating: BooleanConstructor;
|
|
60
60
|
icon: {
|
|
61
|
-
type: (
|
|
61
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
62
62
|
};
|
|
63
63
|
iconPosition: {
|
|
64
64
|
type: import("vue").PropType<import("@/props").IconPosition>;
|
|
@@ -79,9 +79,9 @@ export declare const VvTextareaProps: {
|
|
|
79
79
|
default: string;
|
|
80
80
|
};
|
|
81
81
|
invalid: BooleanConstructor;
|
|
82
|
-
invalidLabel: (
|
|
82
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
83
83
|
valid: BooleanConstructor;
|
|
84
|
-
validLabel: (
|
|
84
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
85
85
|
readonly: BooleanConstructor;
|
|
86
86
|
disabled: BooleanConstructor;
|
|
87
87
|
tabindex: {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as i, openBlock as n, createElementBlock as p, normalizeClass as l, unref as a, renderSlot as c } from "vue";
|
|
2
|
+
const f = {
|
|
3
|
+
modifiers: [String, Array]
|
|
4
|
+
}, m = {
|
|
5
|
+
...f,
|
|
6
|
+
position: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "bottom"
|
|
9
|
+
}
|
|
10
|
+
}, v = /* @__PURE__ */ i({
|
|
11
|
+
__name: "VvTooltip",
|
|
12
|
+
props: m,
|
|
13
|
+
setup(t) {
|
|
14
|
+
const o = t, { modifiers: s } = toRefs(o), { bemCssClasses: e } = useBemModifiers("vv-tooltip", {
|
|
15
|
+
modifiers: s
|
|
16
|
+
});
|
|
17
|
+
return (r, d) => (n(), p("span", {
|
|
18
|
+
class: l([a(e), `vv-tooltip--${o.position}`]),
|
|
19
|
+
role: "tooltip",
|
|
20
|
+
inert: ""
|
|
21
|
+
}, [
|
|
22
|
+
c(r.$slots, "default")
|
|
23
|
+
], 2));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
v as default
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?module.exports=e(require("vue")):typeof define=="function"&&define.amd?define(["vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,o.VvTooltip=e(o.vue))})(this,function(o){"use strict";const s={...{modifiers:[String,Array]},position:{type:String,default:"bottom"}};return o.defineComponent({__name:"VvTooltip",props:s,setup(i){const t=i,{modifiers:n}=toRefs(t),{bemCssClasses:r}=useBemModifiers("vv-tooltip",{modifiers:n});return(p,l)=>(o.openBlock(),o.createElementBlock("span",{class:o.normalizeClass([o.unref(r),`vv-tooltip--${t.position}`]),role:"tooltip",inert:""},[o.renderSlot(p.$slots,"default")],2))}})});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
position: {
|
|
3
|
+
type: import("vue").PropType<import("@/components/VvTooltip").TooltipPosition>;
|
|
4
|
+
default: import("@/components/VvTooltip").TooltipPosition;
|
|
5
|
+
};
|
|
6
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
position: {
|
|
9
|
+
type: import("vue").PropType<import("@/components/VvTooltip").TooltipPosition>;
|
|
10
|
+
default: import("@/components/VvTooltip").TooltipPosition;
|
|
11
|
+
};
|
|
12
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
13
|
+
}>>, {
|
|
14
|
+
position: import("@/components/VvTooltip").TooltipPosition;
|
|
15
|
+
}>, {
|
|
16
|
+
default: (_: {}) => any;
|
|
17
|
+
}>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
export declare enum TooltipPosition {
|
|
3
|
+
left = "left",
|
|
4
|
+
right = "right",
|
|
5
|
+
top = "top",
|
|
6
|
+
bottom = "bottom"
|
|
7
|
+
}
|
|
8
|
+
export declare const VvTooltipProps: {
|
|
9
|
+
/**
|
|
10
|
+
* Define the tooltip position
|
|
11
|
+
* @default TooltipPosition.bottom
|
|
12
|
+
*/
|
|
13
|
+
position: {
|
|
14
|
+
type: PropType<TooltipPosition>;
|
|
15
|
+
default: TooltipPosition;
|
|
16
|
+
};
|
|
17
|
+
modifiers: PropType<string | string[]>;
|
|
18
|
+
};
|