@volverjs/ui-vue 0.0.3 → 0.0.4
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 +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -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 +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- 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 +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- 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 +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- 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 +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- 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/package.json +60 -34
- package/src/Volver.ts +12 -5
- 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/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- 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.stories.mdx +2 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("vue"),require("@iconify/vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue","nanoid"],b):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButton=b(e.vue,e.vue$1,e.nanoid))})(this,function(e,b,M){"use strict";const F={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 S=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(S||{}),C=(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))(C||{}),j=(t=>(t.before="before",t.after="after",t))(j||{}),I=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(I||{}),k=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(k||{}),E=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(E||{});const T=Symbol.for("volver"),G=Symbol.for("buttonGroup"),q=Symbol.for("dropdownTrigger"),J=Symbol.for("dropdownAction");function N(){return e.inject(T)}function w(t,n,s){return e.computed(()=>{const o={[t]:!0},l=typeof(n==null?void 0:n.value)=="string"?n.value.split(" "):n==null?void 0:n.value;return l&&Array.isArray(l)&&l.forEach(c=>{o[`${t}--${c}`]=!0}),s&&Object.keys(s.value).forEach(c=>{o[`${t}--${c}`]=e.unref(s.value[c])}),o})}const z={name:"VvIcon"},A=e.defineComponent({...z,props:F,setup(t){const n=t,s=e.ref(!0),o=N(),{modifiers:l}=e.toRefs(n),c=w("vv-icon",l),m=e.computed(()=>n.provider||(o==null?void 0:o.provider)),d=e.computed(()=>{const r=n.name??"",i=`@${m.value}:${n.prefix}:${n.name}`;return b.iconExists(r)?r:b.iconExists(i)?i:(o==null?void 0:o.iconsCollections.find(g=>{const h=`@${m.value}:${g.prefix}:${r}`;if(b.iconExists(h))return h}))||r});function p(r){let i=null;if(typeof window>"u"){const{JSDOM:v}=require("jsdom");i=new v().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(r,"text/html").querySelector("svg")}function a(r){const i=p(r),g=(i==null?void 0:i.innerHTML.trim())||"";i&&g&&b.addIcon(`@${m.value}:${n.prefix}:${n.name}`,{body:g,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return o&&(n.src&&!b.iconExists(`@${m.value}:${n.prefix}:${n.name}`)?(s.value=!1,o.fetchIcon(n.src).then(r=>{r&&(a(r),s.value=!0)}).catch(r=>{throw new Error(`During fetch icon: ${r==null?void 0:r.message}`)})):n.svg&&a(n.svg)),(r,i)=>e.unref(s)?(e.openBlock(),e.createBlock(e.unref(b.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:r.inline,width:r.width,height:r.height,horizontalFlip:r.horizontalFlip,verticalFlip:r.verticalFlip,flip:r.flip,rotate:r.rotate,color:r.color,onLoad:r.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}}),K={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(E).includes(t)},rel:{type:String,default:"noopener noreferrer"}},U={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},Y={disabled:Boolean},W={active:Boolean},H={pressed:Boolean},x={label:[String,Number]},Q={modifiers:[String,Array]};j.before;const X={unselectable:{type:Boolean,default:!0}},Z={id:[String,Number]};S.bottom;const D={...Y,...x,...H,...W,...K,type:{type:String,default:I.button,validator:t=>Object.values(I).includes(t)}},ee=["click","mouseover","mouseleave"],te=D;function ne(){return e.inject(q,{})}function re(){return e.inject(J,{})}const oe={name:"VvAction"},se=e.defineComponent({...oe,props:te,emits:ee,setup(t,{expose:n,emit:s}){const o=t,l=N(),c=e.ref(null);n({$el:c});const{reference:m,bus:d,aria:p,expanded:a}=ne();e.watch(()=>c.value,u=>{m&&(m.value=u)});const r=e.computed(()=>o.pressed||(a==null?void 0:a.value)),{role:i}=re(),g=e.computed(()=>{switch(!0){case o.disabled:return k.button;case o.to!==void 0:return l!=null&&l.nuxt?k.nuxtLink:k.routerLink;case o.href!==void 0:return k.a;default:return k.button}}),h=e.computed(()=>{const u={...p==null?void 0:p.value,"aria-pressed":r.value?!0:void 0,role:i};switch(g.value){case k.a:return{...u,href:o.href,target:o.target,rel:o.rel};case k.routerLink:case k.nuxtLink:return{...u,to:o.to,target:o.target};default:return{...u,type:o.type,disabled:o.disabled}}}),O=u=>{if(o.disabled){u.preventDefault();return}d==null||d.emit("click",u),s("click",u)},v=u=>{d==null||d.emit("mouseover",u),s("mouseover",u)},y=u=>{d==null||d.emit("mouseleave",u),s("mouseleave",u)};return(u,B)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(h),{ref_key:"element",ref:c,class:{active:u.active,pressed:e.unref(r),disabled:u.disabled},onClickPassive:O,onMouseoverPassive:v,onMouseleavePassive:y}),{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(u.label),1)])]),_:3},16,["class"]))}});function P(t,n,s){return s?L(t,s)===L(n,s):V(t,n)}function V(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){const s=Array.isArray(t),o=Array.isArray(n);let l,c,m;if(s&&o){if(c=t.length,c!=n.length)return!1;for(l=c;l--!==0;)if(!V(t[l],n[l]))return!1;return!0}if(s!=o)return!1;const d=t instanceof Date,p=n instanceof Date;if(d!=p)return!1;if(d&&p)return t.getTime()==n.getTime();const a=t instanceof RegExp,r=n instanceof RegExp;if(a!=r)return!1;if(a&&r)return t.toString()==n.toString();const i=Object.keys(t);if(c=i.length,c!==Object.keys(n).length)return!1;for(l=c;l--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[l]))return!1;for(l=c;l--!==0;)if(m=i[l],!V(t[m],n[m]))return!1;return!0}return t!==t&&n!==n}function L(t,n){if(t&&Object.keys(t).length&&n){if(n.indexOf(".")===-1)return t[n];{const s=n.split(".");let o=t;for(let l=0,c=s.length;l<c;++l){if(t==null)return null;o=o[s[l]]}return o}}else return null}function R(t,n){if(t!=null&&n&&n.length){for(const s of n)if(P(t,s))return!0}return!1}function le(t){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(t))}function ie(t){const n=e.inject(t,void 0),s=e.computed(()=>!le(n));function o(l,c,m){if(n!=null&&n.value){const p=e.unref(n.value)[l];return e.computed({get(){return p==null?void 0:p.value},set(a){p.value=a}})}const d=e.toRef(c,l);return e.computed({get(){return d.value},set(p){m&&m(`update:${l}`,p)}})}return{group:n,isInGroup:s,getGroupOrLocalRef:o}}const ae=["update:modelValue"],ce={...D,...Z,...Q,...X,...U,icon:[String,Object],iconPosition:{type:String,default:S.left,validator:t=>Object.values(S).includes(t)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},modelValue:String};function ue(t,n){var u;const{group:s,isInGroup:o,getGroupOrLocalRef:l}=ie(G),{id:c,iconPosition:m,icon:d,label:p,pressed:a,modifiers:r}=e.toRefs(t),i=l("modelValue",t,n),g=l("disabled",t),h=l("toggle",t),O=l("unselectable",t),v=((u=s==null?void 0:s.value)==null?void 0:u.multiple)??e.ref(!1),y=e.computed(()=>{var _;const B=r!=null&&r.value?Array.isArray(r.value)?r.value:r.value.split(" "):[],$=(_=s==null?void 0:s.value.itemModifiers)!=null&&_.value?Array.isArray(s.value.itemModifiers.value)?s.value.itemModifiers.value:s.value.itemModifiers.value.split(" "):[];return[...B,...$]});return{group:s,isInGroup:o,modelValue:i,disabled:g,toggle:h,unselectable:O,multiple:v,id:c,modifiers:y,pressed:a,iconPosition:m,icon:d,label:p}}const fe=t=>e.computed(()=>String((t==null?void 0:t.value)||M.nanoid())),de={key:1,class:"vv-button__label"},pe={key:1,class:"vv-button__label"},me={name:"VvButton"};return e.defineComponent({...me,props:ce,emits:ae,setup(t,{expose:n,emit:s}){const o=t,l=e.useAttrs(),c=e.useSlots(),{id:m,modifiers:d,iconPosition:p,icon:a,label:r,modelValue:i,disabled:g,toggle:h,unselectable:O}=ue(o,s),v=fe(m),y=e.computed(()=>(l==null?void 0:l.name)||v.value),u=e.ref(null),B=e.computed(()=>{var f;return(f=u.value)==null?void 0:f.$el});n({$el:B});const $=e.computed(()=>h.value?Array.isArray(i.value)?R(y.value,i.value):P(y.value,i.value):o.pressed),_=w("vv-button",d,e.computed(()=>({reverse:[S.right,S.bottom].includes(p.value),column:[S.top,S.bottom].includes(p.value),"icon-only":Boolean((a==null?void 0:a.value)&&!(r!=null&&r.value)&&!c.default)}))),ge=e.computed(()=>typeof(a==null?void 0:a.value)=="string"?{name:a==null?void 0:a.value}:a==null?void 0:a.value),ye=()=>{if(h.value){if(Array.isArray(i.value)){if(R(y.value,i.value)){O.value&&(i.value=i.value.filter(f=>f!==y.value));return}i.value.push(y.value);return}if(P(y.value,i.value)&&O.value){i.value=void 0;return}i.value=y.value}};return(f,he)=>(e.openBlock(),e.createBlock(se,e.mergeProps({disabled:e.unref(g),pressed:e.unref($),active:f.active,type:f.type,to:f.to,href:f.href,target:f.target,rel:f.rel},{id:e.unref(v),ref_key:"element",ref:u,class:e.unref(_),onClick:ye}),{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default",{},()=>[f.loading?e.renderSlot(f.$slots,"loading",{key:0},()=>[f.loadingIcon?(e.openBlock(),e.createBlock(A,{key:0,class:"vv-button__loading-icon",name:f.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),f.loadingLabel?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(f.loadingLabel),1)):e.createCommentVNode("",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(f.$slots,"before"),e.unref(a)?(e.openBlock(),e.createBlock(A,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(ge)),null,16)):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createElementBlock("span",pe,[e.renderSlot(f.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(r)),1)])])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"after")],64))])]),_:3},16,["id","class"]))}})});
|
|
@@ -6,49 +6,49 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
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: import("vue").PropType<string | string[]>;
|
|
28
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
29
|
+
type: {
|
|
30
|
+
type: StringConstructor;
|
|
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: import("vue").PropType<import("@/
|
|
25
|
-
validator: (value: import("@/
|
|
39
|
+
type: import("vue").PropType<import("@/constants").AnchorTarget>;
|
|
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: import("vue").
|
|
51
|
+
$el: import("vue").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: {
|
|
@@ -56,60 +56,60 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
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: import("vue").PropType<string | string[]>;
|
|
78
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
79
|
+
type: {
|
|
80
|
+
type: StringConstructor;
|
|
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: import("vue").PropType<import("@/
|
|
75
|
-
validator: (value: import("@/
|
|
89
|
+
type: import("vue").PropType<import("@/constants").AnchorTarget>;
|
|
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
104
|
type: string;
|
|
105
|
-
|
|
106
|
-
loading: boolean;
|
|
107
|
-
loadingIcon: string;
|
|
108
|
-
loadingLabel: string;
|
|
105
|
+
rel: string;
|
|
109
106
|
active: boolean;
|
|
110
107
|
pressed: boolean;
|
|
111
|
-
|
|
108
|
+
iconPosition: Side;
|
|
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
2
|
import type { ButtonGroupState } from '@/types/group';
|
|
3
3
|
import { Side } from '@/constants';
|
|
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
|
-
}
|
|
21
4
|
export declare const VvButtonEvents: string[];
|
|
22
5
|
export declare const VvButtonProps: {
|
|
23
6
|
/**
|
|
@@ -32,14 +15,6 @@ export declare const VvButtonProps: {
|
|
|
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: StringConstructor;
|
|
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<import("@/constants").AnchorTarget>;
|
|
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
|
/**
|
|
@@ -1,28 +1,80 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { isRef as O, provide as _, computed as d, unref as f, defineComponent as S, toRefs as j, watchEffect as E, openBlock as V, createElementBlock as A, normalizeClass as h, renderSlot as k } from "vue";
|
|
2
|
+
var u = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(u || {}), c = /* @__PURE__ */ ((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))(c || {}), i = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(i || {}), p = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(p || {}), b = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(b || {});
|
|
3
|
+
const G = Symbol.for("buttonGroup"), C = {
|
|
4
|
+
/**
|
|
5
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
6
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
7
|
+
*/
|
|
8
|
+
to: {
|
|
9
|
+
type: [String, Object]
|
|
10
|
+
},
|
|
11
|
+
/**
|
|
12
|
+
* Anchor href
|
|
13
|
+
*/
|
|
14
|
+
href: String,
|
|
15
|
+
/**
|
|
16
|
+
* Anchor target
|
|
17
|
+
*/
|
|
18
|
+
target: {
|
|
19
|
+
type: String,
|
|
20
|
+
validator: (t) => Object.values(b).includes(t)
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Anchor rel
|
|
24
|
+
*/
|
|
25
|
+
rel: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "noopener noreferrer"
|
|
28
|
+
}
|
|
29
|
+
}, y = {
|
|
4
30
|
/**
|
|
5
31
|
* Whether the form control is disabled
|
|
6
32
|
*/
|
|
7
33
|
disabled: Boolean
|
|
8
|
-
},
|
|
34
|
+
}, N = {
|
|
35
|
+
/**
|
|
36
|
+
* Whether the item is active
|
|
37
|
+
*/
|
|
38
|
+
active: Boolean
|
|
39
|
+
}, P = {
|
|
40
|
+
/**
|
|
41
|
+
* Whether the item is pressed
|
|
42
|
+
*/
|
|
43
|
+
pressed: Boolean
|
|
44
|
+
}, $ = {
|
|
45
|
+
/**
|
|
46
|
+
* The item label
|
|
47
|
+
*/
|
|
48
|
+
label: [String, Number]
|
|
49
|
+
}, M = {
|
|
9
50
|
/**
|
|
10
51
|
* Component BEM modifiers
|
|
11
52
|
*/
|
|
12
53
|
modifiers: [String, Array]
|
|
13
54
|
};
|
|
14
|
-
|
|
15
|
-
const
|
|
55
|
+
i.before;
|
|
56
|
+
const R = {
|
|
16
57
|
/**
|
|
17
58
|
* If true the input will be unselectable
|
|
18
59
|
*/
|
|
19
60
|
unselectable: { type: Boolean, default: !0 }
|
|
20
61
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
...
|
|
62
|
+
u.bottom;
|
|
63
|
+
({
|
|
64
|
+
...y,
|
|
65
|
+
...$,
|
|
66
|
+
...P,
|
|
67
|
+
...N,
|
|
68
|
+
...C,
|
|
69
|
+
/**
|
|
70
|
+
* Button type
|
|
71
|
+
*/
|
|
72
|
+
type: p.button
|
|
73
|
+
});
|
|
74
|
+
const U = {
|
|
75
|
+
...M,
|
|
76
|
+
...y,
|
|
77
|
+
...R,
|
|
26
78
|
/**
|
|
27
79
|
* String or String[] of css classes (modifiers) that will be provided to each button'
|
|
28
80
|
*/
|
|
@@ -30,48 +82,71 @@ const j = {
|
|
|
30
82
|
toggle: { type: Boolean, default: !1 },
|
|
31
83
|
multiple: { type: Boolean, default: !1 },
|
|
32
84
|
modelValue: { type: [String, Array], default: void 0 }
|
|
33
|
-
},
|
|
85
|
+
}, z = ["update:modelValue"];
|
|
86
|
+
function I(t) {
|
|
87
|
+
if (Object.keys(t).some(
|
|
88
|
+
(e) => e !== "key" && !O(t[e])
|
|
89
|
+
))
|
|
90
|
+
throw Error("One or more groupState props aren't ref.");
|
|
91
|
+
_(
|
|
92
|
+
t.key,
|
|
93
|
+
d(() => t)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function L(t, e, o) {
|
|
97
|
+
return d(() => {
|
|
98
|
+
const l = {
|
|
99
|
+
[t]: !0
|
|
100
|
+
}, n = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
|
|
101
|
+
return n && Array.isArray(n) && n.forEach((a) => {
|
|
102
|
+
l[`${t}--${a}`] = !0;
|
|
103
|
+
}), o && Object.keys(o.value).forEach((a) => {
|
|
104
|
+
l[`${t}--${a}`] = f(o.value[a]);
|
|
105
|
+
}), l;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const D = {
|
|
34
109
|
name: "VvButtonGroup"
|
|
35
|
-
},
|
|
36
|
-
...
|
|
37
|
-
props:
|
|
38
|
-
emits:
|
|
39
|
-
setup(t, { emit:
|
|
40
|
-
const
|
|
41
|
-
disabled:
|
|
42
|
-
toggle:
|
|
43
|
-
modifiers:
|
|
44
|
-
multiple:
|
|
45
|
-
unselectable:
|
|
46
|
-
itemModifiers:
|
|
47
|
-
} =
|
|
48
|
-
|
|
49
|
-
typeof
|
|
110
|
+
}, K = /* @__PURE__ */ S({
|
|
111
|
+
...D,
|
|
112
|
+
props: U,
|
|
113
|
+
emits: z,
|
|
114
|
+
setup(t, { emit: e }) {
|
|
115
|
+
const o = t, {
|
|
116
|
+
disabled: l,
|
|
117
|
+
toggle: n,
|
|
118
|
+
modifiers: a,
|
|
119
|
+
multiple: s,
|
|
120
|
+
unselectable: v,
|
|
121
|
+
itemModifiers: m
|
|
122
|
+
} = j(o);
|
|
123
|
+
E(() => {
|
|
124
|
+
typeof o.modelValue == "string" && s.value && console.warn(
|
|
50
125
|
"[VvButtonGroup]: modelValue is a string but multiple is true."
|
|
51
126
|
);
|
|
52
127
|
});
|
|
53
|
-
const
|
|
54
|
-
get: () =>
|
|
55
|
-
set: (
|
|
128
|
+
const g = d({
|
|
129
|
+
get: () => s.value ? o.modelValue : Array.isArray(o.modelValue) ? o.modelValue[0] : o.modelValue,
|
|
130
|
+
set: (r) => (r !== void 0 && (Array.isArray(o.modelValue) || s.value) && !Array.isArray(r) && (r = [r]), e("update:modelValue", r))
|
|
56
131
|
});
|
|
57
|
-
|
|
58
|
-
key:
|
|
59
|
-
modelValue:
|
|
60
|
-
disabled:
|
|
61
|
-
toggle:
|
|
62
|
-
multiple:
|
|
63
|
-
unselectable:
|
|
64
|
-
itemModifiers:
|
|
132
|
+
I({
|
|
133
|
+
key: G,
|
|
134
|
+
modelValue: g,
|
|
135
|
+
disabled: l,
|
|
136
|
+
toggle: n,
|
|
137
|
+
multiple: s,
|
|
138
|
+
unselectable: v,
|
|
139
|
+
itemModifiers: m
|
|
65
140
|
});
|
|
66
|
-
const
|
|
67
|
-
return (
|
|
68
|
-
class:
|
|
141
|
+
const B = L("vv-button-group", a);
|
|
142
|
+
return (r, F) => (V(), A("div", {
|
|
143
|
+
class: h(f(B)),
|
|
69
144
|
role: "group"
|
|
70
145
|
}, [
|
|
71
|
-
|
|
146
|
+
k(r.$slots, "default")
|
|
72
147
|
], 2));
|
|
73
148
|
}
|
|
74
149
|
});
|
|
75
150
|
export {
|
|
76
|
-
|
|
151
|
+
K as default
|
|
77
152
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButtonGroup=n(e.vue))})(this,function(e){"use strict";var n=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(n||{}),f=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(f||{}),p=(t=>(t.before="before",t.after="after",t))(p||{}),d=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(d||{}),c=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(c||{});const y=Symbol.for("buttonGroup"),m={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(c).includes(t)},rel:{type:String,default:"noopener noreferrer"}},b={disabled:Boolean},g={active:Boolean},v={pressed:Boolean},B={label:[String,Number]},_={modifiers:[String,Array]};p.before;const O={unselectable:{type:Boolean,default:!0}};n.bottom,{...b,...B,...v,...g,...m,type:d.button};const S={..._,...b,...O,itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}},j=["update:modelValue"];function h(t){if(Object.keys(t).some(o=>o!=="key"&&!e.isRef(t[o])))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed(()=>t))}function E(t,o,r){return e.computed(()=>{const s={[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(l=>{s[`${t}--${l}`]=!0}),r&&Object.keys(r.value).forEach(l=>{s[`${t}--${l}`]=e.unref(r.value[l])}),s})}const V={name:"VvButtonGroup"};return e.defineComponent({...V,props:S,emits:j,setup(t,{emit:o}){const r=t,{disabled:s,toggle:u,modifiers:l,multiple:i,unselectable:A,itemModifiers:k}=e.toRefs(r);e.watchEffect(()=>{typeof r.modelValue=="string"&&i.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")});const G=e.computed({get:()=>i.value?r.modelValue:Array.isArray(r.modelValue)?r.modelValue[0]:r.modelValue,set:a=>(a!==void 0&&(Array.isArray(r.modelValue)||i.value)&&!Array.isArray(a)&&(a=[a]),o("update:modelValue",a))});h({key:y,modelValue:G,disabled:s,toggle:u,multiple:i,unselectable:A,itemModifiers:k});const C=E("vv-button-group",l);return(a,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(C)),role:"group"},[e.renderSlot(a.$slots,"default")],2))}})});
|
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { computed as v, unref as d, defineComponent as p, toRefs as f, openBlock as n, createElementBlock as l, normalizeClass as _, renderSlot as c, createTextVNode as $, toDisplayString as i, createCommentVNode as u } from "vue";
|
|
2
|
+
const y = {
|
|
3
3
|
title: String,
|
|
4
4
|
modifiers: [String, Array]
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
function h(o, t, s) {
|
|
7
|
+
return v(() => {
|
|
8
|
+
const r = {
|
|
9
|
+
[o]: !0
|
|
10
|
+
}, e = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
|
|
11
|
+
return e && Array.isArray(e) && e.forEach((a) => {
|
|
12
|
+
r[`${o}--${a}`] = !0;
|
|
13
|
+
}), s && Object.keys(s.value).forEach((a) => {
|
|
14
|
+
r[`${o}--${a}`] = d(s.value[a]);
|
|
15
|
+
}), r;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const C = {
|
|
6
19
|
key: 0,
|
|
7
20
|
class: "vv-card__header"
|
|
8
|
-
},
|
|
21
|
+
}, k = {
|
|
9
22
|
key: 1,
|
|
10
23
|
class: "vv-card__content"
|
|
11
|
-
},
|
|
24
|
+
}, m = {
|
|
12
25
|
key: 2,
|
|
13
26
|
class: "vv-card__footer"
|
|
14
|
-
},
|
|
27
|
+
}, g = {
|
|
15
28
|
name: "VvCard"
|
|
16
|
-
},
|
|
17
|
-
...
|
|
18
|
-
props:
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
return (e,
|
|
22
|
-
class:
|
|
29
|
+
}, S = /* @__PURE__ */ p({
|
|
30
|
+
...g,
|
|
31
|
+
props: y,
|
|
32
|
+
setup(o) {
|
|
33
|
+
const t = o, { modifiers: s } = f(t), r = h("vv-card", s);
|
|
34
|
+
return (e, a) => (n(), l("article", {
|
|
35
|
+
class: _(d(r))
|
|
23
36
|
}, [
|
|
24
|
-
e.$slots.header || e.title ? (
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
e.$slots.header || e.title ? (n(), l("header", C, [
|
|
38
|
+
c(e.$slots, "header", {}, () => [
|
|
39
|
+
$(i(e.title), 1)
|
|
27
40
|
])
|
|
28
|
-
])) :
|
|
29
|
-
|
|
30
|
-
e.$slots.content ? (
|
|
31
|
-
|
|
32
|
-
])) :
|
|
33
|
-
e.$slots.footer ? (
|
|
34
|
-
|
|
35
|
-
])) :
|
|
41
|
+
])) : u("", !0),
|
|
42
|
+
c(e.$slots, "default"),
|
|
43
|
+
e.$slots.content ? (n(), l("div", k, [
|
|
44
|
+
c(e.$slots, "content")
|
|
45
|
+
])) : u("", !0),
|
|
46
|
+
e.$slots.footer ? (n(), l("footer", m, [
|
|
47
|
+
c(e.$slots, "footer")
|
|
48
|
+
])) : u("", !0)
|
|
36
49
|
], 2));
|
|
37
50
|
}
|
|
38
51
|
});
|
|
39
52
|
export {
|
|
40
|
-
|
|
53
|
+
S as default
|
|
41
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCard=n(e.vue))})(this,function(e){"use strict";const n={title:String,modifiers:[String,Array]};function c(r,o,s){return e.computed(()=>{const l={[r]:!0},t=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return t&&Array.isArray(t)&&t.forEach(a=>{l[`${r}--${a}`]=!0}),s&&Object.keys(s.value).forEach(a=>{l[`${r}--${a}`]=e.unref(s.value[a])}),l})}const d={key:0,class:"vv-card__header"},f={key:1,class:"vv-card__content"},i={key:2,class:"vv-card__footer"},p={name:"VvCard"};return e.defineComponent({...p,props:n,setup(r){const o=r,{modifiers:s}=e.toRefs(o),l=c("vv-card",s);return(t,a)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(l))},[t.$slots.header||t.title?(e.openBlock(),e.createElementBlock("header",d,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),t.$slots.content?(e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(t.$slots,"content")])):e.createCommentVNode("",!0),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",i,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)],2))}})});
|