@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,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue","@vueuse/core","nanoid"],m):(e=typeof globalThis<"u"?globalThis:e||self,e.VvSelect=m(e.vue,e.vue$1,e.core,e.nanoid))})(this,function(e,m,C,W){"use strict";const Y={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 h=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(h||{}),$=(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))($||{}),B=(t=>(t.before="before",t.after="after",t))(B||{}),w=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(w||{}),D=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(D||{});const x=Symbol.for("volver");function G(){return e.inject(x)}function F(t,o,r){return e.computed(()=>{const l={[t]:!0},u=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return u&&Array.isArray(u)&&u.forEach(c=>{l[`${t}--${c}`]=!0}),r&&Object.keys(r.value).forEach(c=>{l[`${t}--${c}`]=e.unref(r.value[c])}),l})}const Q={name:"VvIcon"},q=e.defineComponent({...Q,props:Y,setup(t){const o=t,r=e.ref(!0),l=G(),{modifiers:u}=e.toRefs(o),c=F("vv-icon",u),a=e.computed(()=>o.provider||(l==null?void 0:l.provider)),b=e.computed(()=>{const n=o.name??"",s=`@${a.value}:${o.prefix}:${o.name}`;return m.iconExists(n)?n:m.iconExists(s)?s:(l==null?void 0:l.iconsCollections.find(y=>{const f=`@${a.value}:${y.prefix}:${n}`;if(m.iconExists(f))return f}))||n});function i(n){let s=null;if(typeof window>"u"){const{JSDOM:v}=require("jsdom");s=new v().window}return(s?new s.DOMParser:new window.DOMParser).parseFromString(n,"text/html").querySelector("svg")}function p(n){const s=i(n),y=(s==null?void 0:s.innerHTML.trim())||"";s&&y&&m.addIcon(`@${a.value}:${o.prefix}:${o.name}`,{body:y,height:s.viewBox.baseVal.height,width:s.viewBox.baseVal.width})}return l&&(o.src&&!m.iconExists(`@${a.value}:${o.prefix}:${o.name}`)?(r.value=!1,l.fetchIcon(o.src).then(n=>{n&&(p(n),r.value=!0)}).catch(n=>{throw new Error(`During fetch icon: ${n==null?void 0:n.message}`)})):o.svg&&p(o.svg)),(n,s)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(m.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:n.inline,width:n.width,height:n.height,horizontalFlip:n.horizontalFlip,verticalFlip:n.verticalFlip,flip:n.flip,rotate:n.rotate,color:n.color,onLoad:n.onLoad,icon:e.unref(b)}),null,16,["class"])):e.createCommentVNode("",!0)}});function R(t,o){if(t&&Object.keys(t).length&&o){if(o.indexOf(".")===-1)return t[o];{const r=o.split(".");let l=t;for(let u=0,c=r.length;u<c;++u){if(t==null)return null;l=l[r[u]]}return l}}else return null}function z(t){return(o=>o==null||o===""||Array.isArray(o)&&o.length===0||!(o instanceof Date)&&typeof o=="object"&&Object.keys(o).length===0)(e.unref(t))}function X(t){return typeof t=="string"||t instanceof String}function I(t){return Array.isArray(t)?t.filter(o=>X(o)).join(" "):t}function Z(t,o){const{invalid:r,valid:l,hint:u,loading:c}=o,{hintLabel:a,modelValue:b,valid:i,validLabel:p,invalid:n,invalidLabel:s,...y}=e.toRefs(t),f=R(y,"loading"),g=R(y,"loadingLabel"),v=e.computed(()=>n.value?!!(n.value&&r||s!=null&&s.value&&Array.isArray(s.value)&&s.value.length>0||s!=null&&s.value&&!z(s)):!1),E=e.computed(()=>!!(a&&a.value||u)),_=e.computed(()=>!!(p&&p.value||l)),P=e.computed(()=>!!(f!=null&&f.value&&c||f!=null&&f.value&&(g!=null&&g.value))),V=e.computed(()=>E.value||_.value||v.value||P.value);return{hasInvalid:v,hasHint:E,hasValid:_,hasLoading:P,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(k){const j=e.computed(()=>{const S=C.toReactive({hintLabel:a,modelValue:b,valid:i,validLabel:p,invalid:n,invalidLabel:s,loading:f,loadingLabel:g,...k.params});return n!=null&&n.value?(r==null?void 0:r(S))||I(s==null?void 0:s.value)||(a==null?void 0:a.value):i!=null&&i.value?(l==null?void 0:l(S))||I(p==null?void 0:p.value)||(a==null?void 0:a.value):f!=null&&f.value?(c==null?void 0:c(S))||I(g==null?void 0:g.value)||(a==null?void 0:a.value):(u==null?void 0:u(S))||I(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:V,hasInvalid:v,hasValid:_,hintContent:j}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const ee={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(D).includes(t)},rel:{type:String,default:"noopener noreferrer"}},te={valid:Boolean,validLabel:[String,Array]},oe={invalid:Boolean,invalidLabel:[String,Array]},re={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},H={disabled:Boolean},ne={active:Boolean},le={pressed:Boolean},M={label:[String,Number]},se={readonly:Boolean},ae={modifiers:[String,Array]},ie={hintLabel:{type:String,default:""}},ue={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},ce={icon:{type:[String,Object]},iconPosition:{type:String,default:B.before,validation:t=>Object.values(B).includes(t)}},de={tabindex:{type:[String,Number],default:0}},fe={floating:Boolean},pe={unselectable:{type:Boolean,default:!0}},me={id:[String,Number]};h.bottom;const ye={...me,name:{type:String,required:!0}},ge={autofocus:Boolean},be={autocomplete:{type:String,default:"off"}};({...H,...M,...le,...ne,...ee,type:w.button});const he={...ye,...ge,...be,...de,...te,...oe,...ie,...re,...H,...se,...ae,...ue,...ce,...fe,...pe,...M,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String},ve=["update:modelValue","focus","blur"],Se=t=>e.computed(()=>String((t==null?void 0:t.value)||W.nanoid()));function Be(t,o){const{focused:r}=C.useFocus(t);return e.watch(r,l=>{o(l?"focus":"blur",e.unref(t))}),{focused:r}}function _e(t,o){const r=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===B.before)),l=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===B.after)),u=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===h.left)),c=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===h.right)),a=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===h.top)),b=e.computed(()=>Boolean((t==null?void 0:t.value)&&o.value===h.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:u,hasIconRight:c,hasIconTop:a,hasIconBottom:b,hasIconBefore:r,hasIconAfter:l}}function Ve(t){const{options:o,labelKey:r,valueKey:l,disabledKey:u}=e.toRefs(t);return{options:o,getOptionLabel:i=>typeof i!="object"&&i!==null?i:typeof r.value=="function"?r.value(i):i[r.value],getOptionValue:i=>typeof i!="object"&&i!==null?i:typeof l.value=="function"?l.value(i):i[l.value],getOptionDisabled:i=>typeof i!="object"&&i!==null?!1:typeof u.value=="function"?u.value(i):i[u.value]}}const ke=["for"],Oe={class:"vv-select__wrapper"},Ie={key:0,class:"vv-select__input-before"},Ee={class:"vv-select__inner"},Pe=["id"],je=["disabled","hidden"],Ne=["disabled","value"],Ce={key:1,class:"vv-select__input-after"},we={name:"VvSelect"};return e.defineComponent({...we,props:he,emits:ve,setup(t,{emit:o}){const r=t,l=e.useSlots(),u=e.ref(),{HintSlot:c,hasHint:a,hasInvalid:b}=Z(r,l),{id:i,modifiers:p,disabled:n,readonly:s,loading:y,icon:f,iconPosition:g,invalid:v,valid:E,floating:_,multiple:P}=e.toRefs(r),V=Se(i),k=e.computed(()=>`${V.value}-hint`),{focused:j}=Be(u,o),S=C.useElementVisibility(u);e.watch(S,d=>{d&&r.autofocus&&(j.value=!0)});const{hasIcon:K,hasIconBefore:L,hasIconAfter:U}=_e(f,g),Ae=e.computed(()=>!z(r.modelValue)),J=e.computed(()=>r.disabled||r.readonly),$e=e.computed(()=>J.value?-1:r.tabindex),De=e.computed(()=>{if(r.invalid===!0)return!0;if(r.valid===!0)return!1}),Fe=F("vv-select",p,e.computed(()=>({valid:E.value,invalid:v.value,loading:y.value,disabled:n.value,readonly:s.value,"icon-before":L.value,"icon-after":U.value,dirty:Ae.value,focus:j.value,floating:_.value,multiple:P.value}))),qe=e.computed(()=>({name:r.name,tabindex:$e.value,disabled:J.value,required:r.required,size:r.size,autocomplete:r.autocomplete,multiple:r.multiple,"aria-invalid":De.value,"aria-describedby":!b.value&&a.value?k.value:void 0,"aria-errormessage":b.value?k.value:void 0})),T=e.computed(()=>({valid:r.valid,invalid:r.invalid,modelValue:r.modelValue})),{getOptionLabel:Re,getOptionValue:ze,getOptionDisabled:He}=Ve(r),A=e.computed({get:()=>r.modelValue,set:d=>{Array.isArray(d)&&(d=d.filter(N=>N!==void 0)),o("update:modelValue",d)}});return(d,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Fe))},[d.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(V)},e.toDisplayString(d.label),9,ke)):e.createCommentVNode("",!0),e.createElementVNode("div",Oe,[d.$slots.before?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(d.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(T))))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ee,[e.unref(L)?(e.openBlock(),e.createBlock(q,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(K)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(V),ref_key:"select",ref:u,"onUpdate:modelValue":N[0]||(N[0]=O=>e.isRef(A)?A.value=O:null)},e.unref(qe)),[d.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!d.unselectable,hidden:!d.unselectable},e.toDisplayString(d.placeholder),9,je)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,(O,Me)=>(e.openBlock(),e.createElementBlock("option",{key:Me,disabled:e.unref(He)(O),value:e.unref(ze)(O)},e.toDisplayString(e.unref(Re)(O)),9,Ne))),128))],16,Pe),[[e.vModelSelect,e.unref(A)]]),e.unref(U)?(e.openBlock(),e.createBlock(q,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(K)),null,16)):e.createCommentVNode("",!0)]),d.$slots.after?(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(d.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(T))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(c),{id:e.unref(k),class:"vv-select__hint"},null,8,["id"])],2))}})});
|
|
1
|
+
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.core,e.nanoid)}(this,(function(e,l,o,n){"use strict";const t={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 a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const r=Symbol.for("volver");function d(l,o,n){return e.computed((()=>{const t={[l]:!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&&(t[`${l}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{t[`${l}--${o}`]=e.unref(n.value[o])})),t}))}const c=e.defineComponent({name:"VvIcon",props:t,setup(o){const n=o,t=e.ref(!0),a=e.inject(r),{modifiers:i}=e.toRefs(n),u=d("vv-icon",i),c=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),s=e.computed((()=>{const e=n.name??"",o=`@${c.value}:${n.prefix}:${n.name}`;return l.iconExists(e)?e:l.iconExists(o)?o:(null==a?void 0:a.iconsCollections.find((o=>{const n=`@${c.value}:${o.prefix}:${e}`;if(l.iconExists(n))return n})))||e}));function v(e){const o=function(e){let l=null;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),t=(null==o?void 0:o.innerHTML.trim())||"";o&&t&&l.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:t,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&(n.src&&!l.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then((e=>{e&&(v(e),t.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&v(n.svg)),(o,n)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(l.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(s)}),null,16,["class"])):e.createCommentVNode("",!0)}});function s(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const o=l.split(".");let n=e;for(let l=0,t=o.length;l<t;++l){if(null==e)return null;n=n[o[l]]}return n}}return null}function v(l){return null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},B={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},V={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},k={icon:{type:[String,Object]},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},$={tabindex:{type:[String,Number],default:0}},w={floating:Boolean},L={unselectable:{type:Boolean,default:!0}},N={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...N,name:{type:String,required:!0}},A={autofocus:Boolean},E={autocomplete:{type:String,default:"off"}};u.button;const I={...x,...A,...E,...$,...p,...m,...S,...b,...g,...h,...B,...V,...k,...w,...L,...y,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const O=["for"],_={class:"vv-select__wrapper"},j={key:0,class:"vv-select__input-before"},C={class:"vv-select__inner"},F=["id"],P=["disabled","hidden"],q=["disabled","value"],D={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I,emits:["update:modelValue","focus","blur"],setup(l,{emit:t}){const u=l,r=e.useSlots(),p=e.ref(),{HintSlot:m,hasHint:b,hasInvalid:g}=function(l,n){const{invalid:t,valid:a,hint:i,loading:u}=n,{hintLabel:r,modelValue:d,valid:c,validLabel:p,invalid:m,invalidLabel:b,...g}=e.toRefs(l),y=s(g,"loading"),h=s(g,"loadingLabel"),B=e.computed((()=>!(!m.value||(!m.value||!t)&&!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)&&(!(null==b?void 0:b.value)||v(b))))),S=e.computed((()=>!!(r&&r.value||i))),V=e.computed((()=>!!(p&&p.value||a))),k=e.computed((()=>!!((null==y?void 0:y.value)&&u||(null==y?void 0:y.value)&&(null==h?void 0:h.value)))),$=e.computed((()=>S.value||V.value||B.value||k.value));return{hasInvalid:B,hasHint:S,hasValid:V,hasLoading:k,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(l){const n=e.computed((()=>{const e=o.toReactive({hintLabel:r,modelValue:d,valid:c,validLabel:p,invalid:m,invalidLabel:b,loading:y,loadingLabel:h,...l.params});return(null==m?void 0:m.value)?(null==t?void 0:t(e))||f(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==c?void 0:c.value)?(null==a?void 0:a(e))||f(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==y?void 0:y.value)?(null==u?void 0:u(e))||f(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==i?void 0:i(e))||f(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:$,hasInvalid:B,hasValid:V,hintContent:n}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(u,r),{id:y,modifiers:h,disabled:B,readonly:S,loading:V,icon:k,iconPosition:$,invalid:w,valid:L,floating:N,multiple:x}=e.toRefs(u),A=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(y),E=e.computed((()=>`${A.value}-hint`)),{focused:I}=function(l,n){const{focused:t}=o.useFocus(l);return e.watch(t,(o=>{n(o?"focus":"blur",e.unref(l))})),{focused:t}}(p,t),z=o.useElementVisibility(p);e.watch(z,(e=>{e&&u.autofocus&&(I.value=!0)}));const{hasIcon:R,hasIconBefore:H,hasIconAfter:K}=function(l,o){const n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.before))),t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.after))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.left))),r=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.top))),c=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:u,hasIconRight:r,hasIconTop:d,hasIconBottom:c,hasIconBefore:n,hasIconAfter:t}}(k,$),M=e.computed((()=>!v(u.modelValue))),T=e.computed((()=>u.disabled||u.readonly)),J=e.computed((()=>T.value?-1:u.tabindex)),U=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),G=d("vv-select",h,e.computed((()=>({valid:L.value,invalid:w.value,loading:V.value,disabled:B.value,readonly:S.value,"icon-before":H.value,"icon-after":K.value,dirty:M.value,focus:I.value,floating:N.value,multiple:x.value})))),Q=e.computed((()=>({name:u.name,tabindex:J.value,disabled:T.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":U.value,"aria-describedby":!g.value&&b.value?E.value:void 0,"aria-errormessage":g.value?E.value:void 0}))),W=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:X,getOptionValue:Y,getOptionDisabled:Z}=function(l){const{options:o,labelKey:n,valueKey:t,disabledKey:a}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):e[n.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value])}}(u),ee=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),t("update:modelValue",e)}});return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(G))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(A)},e.toDisplayString(l.label),9,O)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(W))))])):e.createCommentVNode("",!0),e.createElementVNode("div",C,[e.unref(H)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(R)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(A),ref_key:"select",ref:p,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ee)?ee.value=l:null)},e.unref(Q)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,P)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(Z)(l),value:e.unref(Y)(l)},e.toDisplayString(e.unref(X)(l)),9,q)))),128))],16,F),[[e.vModelSelect,e.unref(ee)]]),e.unref(K)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(R)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(W))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(m),{id:e.unref(E),class:"vv-select__hint"},null,8,["id"])],2))}})}));
|
|
@@ -17,12 +17,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
17
17
|
type: (StringConstructor | ObjectConstructor)[];
|
|
18
18
|
};
|
|
19
19
|
iconPosition: {
|
|
20
|
-
type:
|
|
21
|
-
default: import("../../constants
|
|
22
|
-
validation: (value: import("../../constants
|
|
20
|
+
type: globalThis.PropType<"before" | "after">;
|
|
21
|
+
default: import("../../constants").Position;
|
|
22
|
+
validation: (value: import("../../constants").Position) => boolean;
|
|
23
23
|
};
|
|
24
24
|
options: {
|
|
25
|
-
type:
|
|
25
|
+
type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
|
|
26
26
|
default: () => never[];
|
|
27
27
|
};
|
|
28
28
|
labelKey: {
|
|
@@ -37,7 +37,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
37
37
|
type: (StringConstructor | FunctionConstructor)[];
|
|
38
38
|
default: string;
|
|
39
39
|
};
|
|
40
|
-
modifiers:
|
|
40
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
41
41
|
readonly: BooleanConstructor;
|
|
42
42
|
disabled: BooleanConstructor;
|
|
43
43
|
loading: BooleanConstructor;
|
|
@@ -86,12 +86,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
86
86
|
type: (StringConstructor | ObjectConstructor)[];
|
|
87
87
|
};
|
|
88
88
|
iconPosition: {
|
|
89
|
-
type:
|
|
90
|
-
default: import("../../constants
|
|
91
|
-
validation: (value: import("../../constants
|
|
89
|
+
type: globalThis.PropType<"before" | "after">;
|
|
90
|
+
default: import("../../constants").Position;
|
|
91
|
+
validation: (value: import("../../constants").Position) => boolean;
|
|
92
92
|
};
|
|
93
93
|
options: {
|
|
94
|
-
type:
|
|
94
|
+
type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
|
|
95
95
|
default: () => never[];
|
|
96
96
|
};
|
|
97
97
|
labelKey: {
|
|
@@ -106,7 +106,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
106
106
|
type: (StringConstructor | FunctionConstructor)[];
|
|
107
107
|
default: string;
|
|
108
108
|
};
|
|
109
|
-
modifiers:
|
|
109
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
110
110
|
readonly: BooleanConstructor;
|
|
111
111
|
disabled: BooleanConstructor;
|
|
112
112
|
loading: BooleanConstructor;
|
|
@@ -141,9 +141,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
141
141
|
}, {
|
|
142
142
|
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
143
143
|
disabled: boolean;
|
|
144
|
-
options: (string | import("../../types/generic
|
|
144
|
+
options: (string | import("../../types/generic").Option)[];
|
|
145
|
+
floating: boolean;
|
|
145
146
|
required: boolean;
|
|
146
|
-
iconPosition:
|
|
147
|
+
iconPosition: "before" | "after";
|
|
147
148
|
loading: boolean;
|
|
148
149
|
loadingLabel: string;
|
|
149
150
|
unselectable: boolean;
|
|
@@ -156,7 +157,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
156
157
|
labelKey: string | Function;
|
|
157
158
|
valueKey: string | Function;
|
|
158
159
|
disabledKey: string | Function;
|
|
159
|
-
floating: boolean;
|
|
160
160
|
autocomplete: string;
|
|
161
161
|
autofocus: boolean;
|
|
162
162
|
}>, {
|
|
@@ -39,12 +39,12 @@ export declare const VvSelectProps: {
|
|
|
39
39
|
type: (StringConstructor | ObjectConstructor)[];
|
|
40
40
|
};
|
|
41
41
|
iconPosition: {
|
|
42
|
-
type:
|
|
42
|
+
type: globalThis.PropType<"before" | "after">;
|
|
43
43
|
default: import("../../constants").Position;
|
|
44
44
|
validation: (value: import("../../constants").Position) => boolean;
|
|
45
45
|
};
|
|
46
46
|
options: {
|
|
47
|
-
type:
|
|
47
|
+
type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
|
|
48
48
|
default: () => never[];
|
|
49
49
|
};
|
|
50
50
|
labelKey: {
|
|
@@ -59,7 +59,7 @@ export declare const VvSelectProps: {
|
|
|
59
59
|
type: (StringConstructor | FunctionConstructor)[];
|
|
60
60
|
default: string;
|
|
61
61
|
};
|
|
62
|
-
modifiers:
|
|
62
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
63
63
|
readonly: BooleanConstructor;
|
|
64
64
|
disabled: BooleanConstructor;
|
|
65
65
|
loading: BooleanConstructor;
|