@volverjs/ui-vue 0.0.3 → 0.0.5-beta.1
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/LICENSE +1 -1
- package/README.md +54 -15
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +23 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +180 -74
- 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 +280 -122
- 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 +338 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +251 -22
- 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 +280 -62
- 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 +720 -261
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +54 -54
- package/dist/components/VvButton/index.d.ts +30 -75
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +296 -49
- 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 +60 -28
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +630 -172
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckbox/index.d.ts +6 -6
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +736 -228
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +9 -9
- package/dist/components/VvCheckboxGroup/index.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +1673 -768
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +159 -61
- package/dist/components/VvCombobox/index.d.ts +54 -23
- package/dist/components/VvDialog/VvDialog.es.js +426 -115
- 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 +504 -190
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +114 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +35 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +454 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +48 -18
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +361 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +116 -52
- 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 +1054 -376
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +107 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +67 -3
- package/dist/components/VvProgress/VvProgress.es.js +254 -23
- 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 +568 -137
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadio/index.d.ts +6 -6
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +674 -193
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +9 -9
- package/dist/components/VvRadioGroup/index.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +703 -251
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -17
- package/dist/components/VvSelect/index.d.ts +8 -8
- package/dist/components/VvTextarea/VvTextarea.es.js +747 -272
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -14
- package/dist/components/VvTextarea/index.d.ts +7 -7
- package/dist/components/VvTooltip/VvTooltip.es.js +252 -24
- 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 +3676 -2007
- 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/constants.d.ts +30 -0
- package/dist/directives/index.es.js +288 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +285 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +38 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +115 -3269
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +215 -23
- package/dist/resolvers/unplugin.d.ts +14 -8
- package/dist/resolvers/unplugin.es.js +94 -33
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +1 -1
- package/package.json +167 -63
- package/src/Volver.ts +60 -26
- 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 +144 -0
- package/src/components/VvAction/index.ts +5 -0
- 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 +41 -124
- package/src/components/VvButton/index.ts +16 -88
- 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 +85 -57
- package/src/components/VvCombobox/index.ts +12 -10
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +6 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +46 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +72 -0
- package/src/components/VvDropdown/index.ts +6 -11
- 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 +128 -35
- 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 +3 -5
- package/src/components/VvTextarea/VvTextarea.vue +4 -4
- 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 +9 -11
- 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 +8 -9
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/constants.ts +36 -0
- package/src/directives/index.ts +1 -1
- package/src/directives/v-tooltip.ts +2 -2
- package/src/index.ts +0 -2
- package/src/props/index.ts +111 -19
- package/src/resolvers/unplugin.ts +96 -49
- 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 +3 -2
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +42 -1
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
- package/src/stories/argTypes.ts +2 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={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 r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),v=Symbol.for("dropdownAction");function f(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.ref(!0),l=f(),{modifiers:i}=e.toRefs(n),u=p("vv-icon",i),a=e.computed((()=>n.provider||(null==l?void 0:l.iconsProvider))),s=e.computed((()=>{const e=n.name??"",o=`@${a.value}:${n.prefix}:${n.name}`;return t.iconExists(e)?e:t.iconExists(o)?o:(null==l?void 0:l.iconsCollections.find((o=>{const n=`@${a.value}:${o.prefix}:${e}`;if(t.iconExists(n))return n})))||e}));function c(e){const o=function(e){let t=null;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${a.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return l&&(n.src&&!t.iconExists(`@${a.value}:${n.prefix}:${n.name}`)?(r.value=!1,l.fetchIcon(n.src).then((e=>{e&&(c(e),r.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&c(n.svg)),(o,n)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(t.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)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(a).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},k={pressed:Boolean},S={label:[String,Number]},B={modifiers:[String,Array]};l.before;const x={unselectable:{type:Boolean,default:!0}},$={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...S,...k,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)}},A=w;const j=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=f(),i=e.ref(null);o({$el:i});const{reference:a,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{a&&(a.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(v,{}),b=e.computed((()=>{switch(!0){case r.disabled:return u.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?u.nuxtLink:u.routerLink;case void 0!==r.href:return u.a;default:return u.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,"aria-pressed":!!m.value||void 0,role:g};switch(b.value){case u.a:return{...e,href:r.href,target:r.target,rel:r.rel};case u.routerLink:case u.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},k=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},S=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:k,onMouseleavePassive:S}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function _(e,t,o){return o?V(e,o)===V(t,o):O(e,t)}function O(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!O(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const u=e instanceof Date,a=t instanceof Date;if(u!=a)return!1;if(u&&a)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!O(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function V(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function L(e,t){if(null!=e&&t&&t.length)for(const o of t)if(_(e,o))return!0;return!1}function P(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const C={...w,...$,...B,...x,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},modelValue:String};const D={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:C,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,u=e.useAttrs(),a=e.useSlots(),{id:s,modifiers:d,iconPosition:v,icon:f,label:g,modelValue:b,disabled:y,toggle:h,unselectable:k}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=P(c),{id:i,iconPosition:u,icon:a,label:s,pressed:d,modifiers:v}=e.toRefs(t),f=l("modelValue",t,o),p=l("toggle",t),m=l("unselectable",t),g=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),b=e.computed((()=>{var e;return[...(null==v?void 0:v.value)?Array.isArray(v.value)?v.value:v.value.split(" "):[],...(null==(e=null==n?void 0:n.value.itemModifiers)?void 0:e.value)?Array.isArray(n.value.itemModifiers.value)?n.value.itemModifiers.value:n.value.itemModifiers.value.split(" "):[]]})),y=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:p,unselectable:m,multiple:g,modifiers:b,disabled:y,id:i,pressed:d,iconPosition:u,icon:a,label:s}}(i,l),S=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==u?void 0:u.name)||S.value)),x=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=x.value)?void 0:e.$el}))});const $=e.computed((()=>h.value?Array.isArray(b.value)?L(B.value,b.value):_(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(v.value),column:[r.top,r.bottom].includes(v.value),"icon-only":Boolean((null==f?void 0:f.value)&&!(null==g?void 0:g.value)&&!a.default)})))),A=e.computed((()=>"string"==typeof(null==f?void 0:f.value)?{name:null==f?void 0:f.value}:null==f?void 0:f.value)),O=()=>{if(h.value){if(Array.isArray(b.value))return L(B.value,b.value)?void(k.value&&(b.value=b.value.filter((e=>e!==B.value)))):void b.value.push(B.value);if(_(B.value,b.value)&&k.value)return void(b.value=void 0);b.value=B.value}};return(t,o)=>(e.openBlock(),e.createBlock(j,e.mergeProps({disabled:e.unref(y),pressed:e.unref($),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel},{id:e.unref(S),ref_key:"element",ref:x,class:e.unref(w),onClick:O}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",D,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(f)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { Side } from '
|
|
1
|
+
import { Side } from '../../constants';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
3
|
icon: (StringConstructor | ObjectConstructor)[];
|
|
4
4
|
iconPosition: {
|
|
5
|
-
type:
|
|
5
|
+
type: globalThis.PropType<"left" | "right" | "top" | "bottom">;
|
|
6
6
|
default: Side;
|
|
7
7
|
validator: (value: Side) => boolean;
|
|
8
8
|
};
|
|
9
|
-
label: (StringConstructor | NumberConstructor)[];
|
|
10
|
-
loading: BooleanConstructor;
|
|
11
9
|
loadingIcon: {
|
|
12
10
|
type: StringConstructor;
|
|
13
11
|
default: string;
|
|
14
12
|
};
|
|
13
|
+
toggle: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
modelValue: StringConstructor;
|
|
18
|
+
loading: BooleanConstructor;
|
|
15
19
|
loadingLabel: {
|
|
16
20
|
type: StringConstructor;
|
|
17
21
|
default: string;
|
|
18
22
|
};
|
|
23
|
+
unselectable: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
28
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
29
|
+
type: {
|
|
30
|
+
type: globalThis.PropType<"button" | "submit" | "reset">;
|
|
31
|
+
default: import("../../constants").ButtonType;
|
|
32
|
+
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
33
|
+
};
|
|
19
34
|
to: {
|
|
20
35
|
type: (StringConstructor | ObjectConstructor)[];
|
|
21
36
|
};
|
|
22
37
|
href: StringConstructor;
|
|
23
38
|
target: {
|
|
24
|
-
type:
|
|
25
|
-
validator: (value: import("
|
|
39
|
+
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
40
|
+
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
26
41
|
};
|
|
27
|
-
active: BooleanConstructor;
|
|
28
|
-
pressed: BooleanConstructor;
|
|
29
42
|
rel: {
|
|
30
43
|
type: StringConstructor;
|
|
31
44
|
default: string;
|
|
32
45
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
validator: (value: import("@/components/VvButton").ButtonType) => boolean;
|
|
37
|
-
};
|
|
38
|
-
toggle: {
|
|
39
|
-
type: BooleanConstructor;
|
|
40
|
-
default: boolean;
|
|
41
|
-
};
|
|
42
|
-
modelValue: StringConstructor;
|
|
43
|
-
unselectable: {
|
|
44
|
-
type: BooleanConstructor;
|
|
45
|
-
default: boolean;
|
|
46
|
-
};
|
|
46
|
+
active: BooleanConstructor;
|
|
47
|
+
pressed: BooleanConstructor;
|
|
48
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
47
49
|
disabled: BooleanConstructor;
|
|
48
|
-
modifiers: import("vue").PropType<string | string[]>;
|
|
49
|
-
id: (StringConstructor | NumberConstructor)[];
|
|
50
50
|
}, {
|
|
51
|
-
$el:
|
|
51
|
+
$el: globalThis.ComputedRef<HTMLElement | undefined>;
|
|
52
52
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
53
|
icon: (StringConstructor | ObjectConstructor)[];
|
|
54
54
|
iconPosition: {
|
|
55
|
-
type:
|
|
55
|
+
type: globalThis.PropType<"left" | "right" | "top" | "bottom">;
|
|
56
56
|
default: Side;
|
|
57
57
|
validator: (value: Side) => boolean;
|
|
58
58
|
};
|
|
59
|
-
label: (StringConstructor | NumberConstructor)[];
|
|
60
|
-
loading: BooleanConstructor;
|
|
61
59
|
loadingIcon: {
|
|
62
60
|
type: StringConstructor;
|
|
63
61
|
default: string;
|
|
64
62
|
};
|
|
63
|
+
toggle: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
modelValue: StringConstructor;
|
|
68
|
+
loading: BooleanConstructor;
|
|
65
69
|
loadingLabel: {
|
|
66
70
|
type: StringConstructor;
|
|
67
71
|
default: string;
|
|
68
72
|
};
|
|
73
|
+
unselectable: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
78
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
79
|
+
type: {
|
|
80
|
+
type: globalThis.PropType<"button" | "submit" | "reset">;
|
|
81
|
+
default: import("../../constants").ButtonType;
|
|
82
|
+
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
83
|
+
};
|
|
69
84
|
to: {
|
|
70
85
|
type: (StringConstructor | ObjectConstructor)[];
|
|
71
86
|
};
|
|
72
87
|
href: StringConstructor;
|
|
73
88
|
target: {
|
|
74
|
-
type:
|
|
75
|
-
validator: (value: import("
|
|
89
|
+
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
90
|
+
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
76
91
|
};
|
|
77
|
-
active: BooleanConstructor;
|
|
78
|
-
pressed: BooleanConstructor;
|
|
79
92
|
rel: {
|
|
80
93
|
type: StringConstructor;
|
|
81
94
|
default: string;
|
|
82
95
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
validator: (value: import("@/components/VvButton").ButtonType) => boolean;
|
|
87
|
-
};
|
|
88
|
-
toggle: {
|
|
89
|
-
type: BooleanConstructor;
|
|
90
|
-
default: boolean;
|
|
91
|
-
};
|
|
92
|
-
modelValue: StringConstructor;
|
|
93
|
-
unselectable: {
|
|
94
|
-
type: BooleanConstructor;
|
|
95
|
-
default: boolean;
|
|
96
|
-
};
|
|
96
|
+
active: BooleanConstructor;
|
|
97
|
+
pressed: BooleanConstructor;
|
|
98
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
97
99
|
disabled: BooleanConstructor;
|
|
98
|
-
modifiers: import("vue").PropType<string | string[]>;
|
|
99
|
-
id: (StringConstructor | NumberConstructor)[];
|
|
100
100
|
}>> & {
|
|
101
101
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
102
102
|
}, {
|
|
103
103
|
disabled: boolean;
|
|
104
|
-
type:
|
|
105
|
-
|
|
106
|
-
loading: boolean;
|
|
107
|
-
loadingIcon: string;
|
|
108
|
-
loadingLabel: string;
|
|
104
|
+
type: "button" | "submit" | "reset";
|
|
105
|
+
rel: string;
|
|
109
106
|
active: boolean;
|
|
110
107
|
pressed: boolean;
|
|
111
|
-
|
|
108
|
+
iconPosition: "left" | "right" | "top" | "bottom";
|
|
109
|
+
loadingIcon: string;
|
|
112
110
|
toggle: boolean;
|
|
111
|
+
loading: boolean;
|
|
112
|
+
loadingLabel: string;
|
|
113
113
|
unselectable: boolean;
|
|
114
114
|
}>, {
|
|
115
115
|
default: (_: {}) => any;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import type { Ref, PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { ButtonGroupState } from '
|
|
3
|
-
import { Side } from '
|
|
4
|
-
export declare enum ButtonType {
|
|
5
|
-
button = "button",
|
|
6
|
-
submit = "submit",
|
|
7
|
-
reset = "reset"
|
|
8
|
-
}
|
|
9
|
-
export declare enum ButtonTag {
|
|
10
|
-
nuxtLink = "nuxt-link",
|
|
11
|
-
routerLink = "router-link",
|
|
12
|
-
a = "a",
|
|
13
|
-
button = "button"
|
|
14
|
-
}
|
|
15
|
-
export declare enum ButtonTarget {
|
|
16
|
-
_blank = "_blank",
|
|
17
|
-
_self = "_self",
|
|
18
|
-
_parent = "_parent",
|
|
19
|
-
_top = "_top"
|
|
20
|
-
}
|
|
2
|
+
import type { ButtonGroupState } from '../../types/group';
|
|
3
|
+
import { Side } from '../../constants';
|
|
21
4
|
export declare const VvButtonEvents: string[];
|
|
22
5
|
export declare const VvButtonProps: {
|
|
23
6
|
/**
|
|
@@ -28,18 +11,10 @@ export declare const VvButtonProps: {
|
|
|
28
11
|
* Button icon position
|
|
29
12
|
*/
|
|
30
13
|
iconPosition: {
|
|
31
|
-
type: PropType<
|
|
14
|
+
type: PropType<"left" | "right" | "top" | "bottom">;
|
|
32
15
|
default: Side;
|
|
33
16
|
validator: (value: Side) => boolean;
|
|
34
17
|
};
|
|
35
|
-
/**
|
|
36
|
-
* Button label
|
|
37
|
-
*/
|
|
38
|
-
label: (StringConstructor | NumberConstructor)[];
|
|
39
|
-
/**
|
|
40
|
-
* Loading status
|
|
41
|
-
*/
|
|
42
|
-
loading: BooleanConstructor;
|
|
43
18
|
/**
|
|
44
19
|
* Loading icon
|
|
45
20
|
*/
|
|
@@ -47,63 +22,43 @@ export declare const VvButtonProps: {
|
|
|
47
22
|
type: StringConstructor;
|
|
48
23
|
default: string;
|
|
49
24
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
25
|
+
toggle: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
modelValue: StringConstructor;
|
|
30
|
+
loading: BooleanConstructor;
|
|
53
31
|
loadingLabel: {
|
|
54
32
|
type: StringConstructor;
|
|
55
33
|
default: string;
|
|
56
34
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
35
|
+
unselectable: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
modifiers: PropType<string | string[]>;
|
|
40
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
41
|
+
type: {
|
|
42
|
+
type: PropType<"button" | "submit" | "reset">;
|
|
43
|
+
default: import("../../constants").ButtonType;
|
|
44
|
+
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
45
|
+
};
|
|
61
46
|
to: {
|
|
62
47
|
type: (StringConstructor | ObjectConstructor)[];
|
|
63
48
|
};
|
|
64
|
-
/**
|
|
65
|
-
* Link href
|
|
66
|
-
*/
|
|
67
49
|
href: StringConstructor;
|
|
68
|
-
/**
|
|
69
|
-
* Link target
|
|
70
|
-
*/
|
|
71
50
|
target: {
|
|
72
|
-
type: PropType<
|
|
73
|
-
validator: (value:
|
|
51
|
+
type: PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
52
|
+
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
74
53
|
};
|
|
75
|
-
active: BooleanConstructor;
|
|
76
|
-
/**
|
|
77
|
-
* Button pressed mode
|
|
78
|
-
*/
|
|
79
|
-
pressed: BooleanConstructor;
|
|
80
|
-
/**
|
|
81
|
-
* Link rel
|
|
82
|
-
*/
|
|
83
54
|
rel: {
|
|
84
55
|
type: StringConstructor;
|
|
85
56
|
default: string;
|
|
86
57
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
type: {
|
|
91
|
-
type: StringConstructor;
|
|
92
|
-
default: ButtonType;
|
|
93
|
-
validator: (value: ButtonType) => boolean;
|
|
94
|
-
};
|
|
95
|
-
toggle: {
|
|
96
|
-
type: BooleanConstructor;
|
|
97
|
-
default: boolean;
|
|
98
|
-
};
|
|
99
|
-
modelValue: StringConstructor;
|
|
100
|
-
unselectable: {
|
|
101
|
-
type: BooleanConstructor;
|
|
102
|
-
default: boolean;
|
|
103
|
-
};
|
|
58
|
+
active: BooleanConstructor;
|
|
59
|
+
pressed: BooleanConstructor;
|
|
60
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
104
61
|
disabled: BooleanConstructor;
|
|
105
|
-
modifiers: PropType<string | string[]>;
|
|
106
|
-
id: (StringConstructor | NumberConstructor)[];
|
|
107
62
|
};
|
|
108
63
|
export type VvButtonPropsTypes = ExtractPropTypes<typeof VvButtonProps>;
|
|
109
64
|
/**
|
|
@@ -111,16 +66,16 @@ export type VvButtonPropsTypes = ExtractPropTypes<typeof VvButtonProps>;
|
|
|
111
66
|
*/
|
|
112
67
|
export declare function useGroupProps(props: VvButtonPropsTypes, emit: (event: (typeof VvButtonEvents)[number], value: unknown) => void): {
|
|
113
68
|
group: Ref<ButtonGroupState> | undefined;
|
|
114
|
-
isInGroup:
|
|
69
|
+
isInGroup: globalThis.ComputedRef<boolean>;
|
|
115
70
|
modelValue: Ref<string | string[] | undefined>;
|
|
116
|
-
disabled: Ref<boolean>;
|
|
117
71
|
toggle: Ref<boolean>;
|
|
118
72
|
unselectable: Ref<boolean>;
|
|
119
|
-
multiple:
|
|
73
|
+
multiple: globalThis.ComputedRef<boolean>;
|
|
74
|
+
modifiers: globalThis.ComputedRef<string[]>;
|
|
75
|
+
disabled: globalThis.ComputedRef<boolean>;
|
|
120
76
|
id: Ref<string | number | undefined> | undefined;
|
|
121
|
-
modifiers: import("vue").ComputedRef<string[]>;
|
|
122
77
|
pressed: Ref<boolean>;
|
|
123
|
-
iconPosition: Ref<
|
|
78
|
+
iconPosition: Ref<"left" | "right" | "top" | "bottom">;
|
|
124
79
|
icon: Ref<string | Record<string, any> | undefined> | undefined;
|
|
125
80
|
label: Ref<string | number | undefined> | undefined;
|
|
126
81
|
};
|