@volverjs/ui-vue 0.0.10-beta.32 → 0.0.10-beta.33
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/dist/components/VvAccordion/VvAccordion.vue.d.ts +1 -131
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +4 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +5 -5
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +6 -7
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -6
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +4 -8
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +2 -8
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -8
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +0 -22
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +16 -7
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +7 -0
- package/dist/components/VvButtonGroup/index.d.ts +3 -0
- package/dist/components/VvCard/VvCard.es.js +1 -6
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +2 -23
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +6 -24
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +12 -31
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +29 -23
- package/dist/components/VvCombobox/index.d.ts +7 -7
- package/dist/components/VvDialog/VvDialog.es.js +1 -6
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +23 -23
- package/dist/components/VvDropdown/index.d.ts +7 -7
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +0 -5
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -6
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +0 -22
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +11 -3
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvNav/VvNav.es.js +8 -10
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +4 -1
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +3 -3
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +0 -22
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +4 -23
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvTab/VvTab.es.js +7 -9
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/index.es.js +82 -68
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +7 -7
- package/dist/stories/Accordion/Accordion.settings.d.ts +2 -57
- package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +2 -66
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -181
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +370 -11
- package/dist/stories/Alert/Alert.settings.d.ts +2 -109
- package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +2 -85
- package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +2 -38
- package/dist/stories/Badge/Badge.settings.d.ts +2 -26
- package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +2 -18
- package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
- package/dist/stories/Button/Button.settings.d.ts +2 -193
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +2 -40
- package/dist/stories/Card/Card.settings.d.ts +2 -63
- package/dist/stories/Checkbox/Checkbox.settings.d.ts +2 -132
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -141
- package/dist/stories/Combobox/Combobox.settings.d.ts +2 -617
- package/dist/stories/Dialog/Dialog.settings.d.ts +2 -47
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +2 -205
- package/dist/stories/Icon/Icon.settings.d.ts +2 -68
- package/dist/stories/InputFile/InputFile.settings.d.ts +2 -52
- package/dist/stories/InputText/InputText.settings.d.ts +2 -438
- package/dist/stories/Nav/Nav.settings.d.ts +2 -10
- package/dist/stories/Progress/Progress.settings.d.ts +2 -27
- package/dist/stories/Radio/Radio.settings.d.ts +1 -110
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -141
- package/dist/stories/Select/Select.settings.d.ts +2 -246
- package/dist/stories/Textarea/Textarea.settings.d.ts +2 -287
- package/dist/stories/argTypes.d.ts +27 -866
- package/package.json +45 -45
- 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/VvAlert/index.ts +4 -4
- package/src/components/VvAlertGroup/VvAlertGroup.vue +0 -1
- package/src/components/VvBadge/VvBadge.vue +1 -1
- package/src/components/VvButtonGroup/VvButtonGroup.vue +11 -2
- package/src/components/VvButtonGroup/index.ts +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +2 -5
- package/src/components/VvCombobox/VvCombobox.vue +2 -1
- package/src/components/VvInputText/VvInputText.vue +15 -4
- package/src/components/VvNav/VvNav.vue +1 -6
- package/src/components/VvNav/VvNavItem.vue +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -1
- package/src/composables/alert/useAlert.ts +3 -3
- package/src/stories/Accordion/Accordion.settings.ts +3 -2
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +4 -3
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +4 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +2 -6
- package/src/stories/Alert/Alert.settings.ts +8 -7
- package/src/stories/Alert/Alert.test.ts +1 -3
- package/src/stories/AlertGroup/AlertGroup.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +5 -7
- package/src/stories/Avatar/Avatar.test.ts +1 -3
- package/src/stories/Avatar/AvatarModifiers.stories.ts +1 -0
- package/src/stories/AvatarGroup/AvatarGroup.settings.ts +2 -1
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -3
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +1 -0
- package/src/stories/Badge/Badge.settings.ts +2 -1
- package/src/stories/Badge/Badge.stories.ts +2 -2
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +1 -1
- package/src/stories/Button/Button.settings.ts +6 -6
- package/src/stories/Button/Button.stories.ts +1 -1
- package/src/stories/Button/Button.test.ts +1 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +11 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +2 -6
- package/src/stories/Card/Card.settings.ts +2 -1
- package/src/stories/Card/Card.test.ts +1 -3
- package/src/stories/Checkbox/Checkbox.settings.ts +5 -3
- package/src/stories/Checkbox/Checkbox.test.ts +2 -6
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +2 -6
- package/src/stories/Combobox/Combobox.settings.ts +10 -10
- package/src/stories/Combobox/Combobox.test.ts +2 -6
- package/src/stories/Dialog/Dialog.settings.ts +2 -1
- package/src/stories/Dialog/Dialog.test.ts +3 -8
- package/src/stories/Dropdown/Dropdown.settings.ts +2 -1
- package/src/stories/Dropdown/Dropdown.test.ts +2 -6
- package/src/stories/Dropdown/DropdownSlots.stories.ts +1 -1
- package/src/stories/Icon/Icon.settings.ts +2 -1
- package/src/stories/Icon/Icon.stories.ts +0 -1
- package/src/stories/InputFile/InputFile.settings.ts +2 -1
- package/src/stories/InputText/InputText.settings.ts +8 -6
- package/src/stories/InputText/InputText.test.ts +2 -6
- package/src/stories/InputText/InputTextMinMax.stories.ts +1 -1
- package/src/stories/Nav/Nav.settings.ts +2 -2
- package/src/stories/Nav/Nav.stories.ts +1 -1
- package/src/stories/Nav/Nav.test.ts +2 -4
- package/src/stories/Progress/Progress.settings.ts +2 -1
- package/src/stories/Radio/Radio.test.ts +2 -6
- package/src/stories/RadioGroup/RadioGroup.stories.ts +1 -2
- package/src/stories/RadioGroup/RadioGroup.test.ts +2 -6
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +1 -1
- package/src/stories/Select/Select.settings.ts +4 -3
- package/src/stories/Select/Select.test.ts +3 -9
- package/src/stories/Select/SelectIconPosition.stories.ts +2 -2
- package/src/stories/Select/SelectOptions.stories.ts +0 -1
- package/src/stories/Tab/Tab.test.ts +3 -5
- package/src/stories/Textarea/Textarea.settings.ts +5 -3
- package/src/stories/Textarea/Textarea.test.ts +2 -6
- package/src/stories/Tooltip/Tooltip.settings.ts +1 -1
- package/src/stories/Tooltip/Tooltip.test.ts +3 -5
- package/src/stories/argTypes.ts +47 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.uid)}(this,(function(e,t,o){"use strict";const n={prefix:"normal"};var l=(e=>(e.local="local",e.session="session",e))(l||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const s=Symbol.for("volver"),d=Symbol.for("buttonGroup"),c=Symbol.for("dropdownTrigger"),v=Symbol.for("dropdownAction");function f(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const l={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{l[`${t}--${o}`]=e.unref(n.value[o])})),l}))}const m=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},n),setup(o){const n=o,l=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),r=e.ref(!0),i=f(),{modifiers:u}=e.toRefs(n),a=p("vv-icon",u),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const l=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return l?`@${s.value}:${l.prefix}:${e}`:e}));function c(e){const o=function(e){let t;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),l=(null==o?void 0:o.innerHTML.trim())||"";o&&l&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:l,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(r.value=!1,i.fetchIcon(n.src).then((e=>{e&&(c(e),r.value=!0)})).catch((e=>{throw new Error(`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(a)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(l),color:o.color,onLoad:o.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),g={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},h={active:{type:Boolean,default:!1}},k={current:{type:Boolean,default:!1}},B={pressed:{type:Boolean,default:!1}},S={label:{type:[String,Number],default:void 0}},$={modifiers:{type:[String,Array],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},w={unselectable:{type:Boolean,default:!0}},L={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const A={...y,...S,...B,...h,...k,...g,type:{type:String,default:u.button,validator:e=>Object.values(u).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}};l.local;const V=A;const I=e.defineComponent({name:"VvAction",props:V,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,r=n,i=e.getCurrentInstance(),u=f(),s=e.ref(null);o({$el:s});const{reference:d,bus:p,aria:m,expanded:g}=e.inject(c,{});e.watch((()=>s.value),(e=>{d&&(d.value=e)}));const b=e.computed((()=>l.pressed||(null==g?void 0:g.value))),{role:y}=e.inject(v,{}),h=e.computed((()=>{switch(!0){case l.disabled:return a.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?a.nuxtLink:a.routerLink;case void 0!==l.href:return a.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==m?void 0:m.value,ariaPressed:!!b.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(h.value){case a.a:return{...e,href:l.href,target:l.target,rel:l.rel};case a.routerLink:case a.nuxtLink:return{...e,to:l.to,target:l.target};case a.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),B=e=>{var t;l.disabled?e.preventDefault():(null==(t=null==i?void 0:i.vnode.props)?void 0:t.onClick)?r("click",e):null==p||p.emit("click",e)},S=e=>{var t;(null==(t=null==i?void 0:i.vnode.props)?void 0:t.onMouseover)?r("mouseover",e):null==p||p.emit("mouseover",e)},$=e=>{var t;(null==(t=null==i?void 0:i.vnode.props)?void 0:t.onMouseleave)?r("mouseleave",e):null==p||p.emit("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(h)),e.mergeProps(e.unref(k),{ref_key:"element",ref:s,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:S,onMouseleavePassive:$}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const j={...A,...L,...$,...w,...b,...x,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},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};function O(t,o){const{group:n,isInGroup:l,getGroupOrLocalRef:r}=function(t){const o=e.inject(t,void 0),n=e.computed((()=>void 0!==o));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,l){const r=null==o?void 0:o[t];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const i=e.toRef(n,t);return e.computed({get:()=>i.value,set(e){l&&l(`update:${t}`,e)}})}}}(d),{id:i,iconPosition:u,icon:a,label:s,pressed:c}=e.toRefs(t),v=r("modelValue",t,o),f=r("toggle",t),p=r("unselectable",t),m=e.computed((()=>(null==n?void 0:n.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>l.add(e)))),Array.from(l)})),b=e.computed((()=>Boolean(t.disabled||(null==n?void 0:n.disabled.value))));return{group:n,isInGroup:l,modelValue:v,toggle:f,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:c,iconPosition:u,icon:a,label:s}}function P(e,t,o){return o?E(e,o)===E(t,o):C(e,t)}function C(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 l,r,i;if(o&&n){if(r=e.length,r!=t.length)return!1;for(l=r;0!=l--;)if(!C(e[l],t[l]))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,d=t instanceof RegExp;if(s!=d)return!1;if(s&&d)return e.toString()==t.toString();const c=Object.keys(e);if(r=c.length,r!==Object.keys(t).length)return!1;for(l=r;0!=l--;)if(!Object.prototype.hasOwnProperty.call(t,c[l]))return!1;for(l=r;0!=l--;)if(i=c[l],!C(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function E(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,l=o.length;t<l;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function N(e,t){if(null!=e&&t&&t.length)for(const o of t)if(P(e,o))return!0;return!1}const _={key:1,class:"vv-button__label"},D={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",inheritAttrs:!1,props:j,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const u=t,a=e.useAttrs(),s=e.useSlots(),d=l,{id:c,modifiers:v,iconPosition:f,icon:g,label:b,modelValue:y,disabled:h,toggle:k,unselectable:B}=O(u,d),S=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(c),$=e.computed((()=>(null==a?void 0:a.name)||S.value)),x=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=x.value)?void 0:e.$el}))});const w=e.computed((()=>k.value?Array.isArray(y.value)?N($.value,y.value):P($.value,y.value):u.pressed)),L=p("vv-button",v,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==g?void 0:g.value)&&!(null==b?void 0:b.value)&&!s.default)})))),{hasIcon:A}=function(t,o){const n=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),l=e.computed((()=>(null==o?void 0:o.value)===i.before?n.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===i.after?n.value:void 0)),a=e.computed((()=>(null==o?void 0:o.value)===r.left?n.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===r.right?n.value:void 0)),d=e.computed((()=>(null==o?void 0:o.value)===r.top?n.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===r.bottom?n.value:void 0));return{hasIcon:n,hasIconLeft:a,hasIconRight:s,hasIconTop:d,hasIconBottom:c,hasIconBefore:l,hasIconAfter:u}}(g),V=e.computed((()=>void 0!==u.value?u.value:$.value)),j=e.computed((()=>{if(k.value)return{onClick:C}})),C=()=>{if(k.value){if(Array.isArray(y.value))return N(V.value,y.value)?void(B.value&&(y.value=y.value.filter((e=>e!==V.value)))):void y.value.push(V.value);if(V.value===y.value&&B.value)return void(y.value=u.uncheckedValue);y.value=V.value}};return(t,o)=>(e.openBlock(),e.createBlock(I,e.mergeProps({...e.unref(a),...e.unref(j),disabled:e.unref(h),pressed:e.unref(w),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(S),ref_key:"element",ref:x,class:e.unref(L)}),{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("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(A)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(A),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("span",D,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=o(e.vue,e.vue$1,e.uid)}(this,(function(e,o,t){"use strict";const n={prefix:"normal"};var l=(e=>(e.local="local",e.session="session",e))(l||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const s=Symbol.for("volver"),d=Symbol.for("buttonGroup"),c=Symbol.for("dropdownTrigger"),v=Symbol.for("dropdownAction");function f(){return e.inject(s)}function p(o,t,n){return e.computed((()=>{const l={[o]:!0},r="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{l[`${o}--${t}`]=e.unref(n.value[t])})),l}))}const m=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},n),setup(t){const n=t,l=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),r=e.ref(!0),i=f(),{modifiers:u}=e.toRefs(n),a=p("vv-icon",u),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=n.name??"",t=`@${s.value}:${n.prefix}:${e}`;if(o.iconExists(t))return t;const l=null==i?void 0:i.iconsCollections.find((t=>{const n=`@${s.value}:${t.prefix}:${e}`;return o.iconExists(n)}));return l?`@${s.value}:${l.prefix}:${e}`:e}));function c(e){const t=function(e){let o;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");o=(new e).window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),l=(null==t?void 0:t.innerHTML.trim())||"";t&&l&&o.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:l,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&n.src&&!o.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(r.value=!1,i.fetchIcon(n.src).then((e=>{e&&(c(e),r.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&c(n.svg),(t,n)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(a)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(l),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),g={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},h={active:{type:Boolean,default:!1}},B={current:{type:Boolean,default:!1}},k={pressed:{type:Boolean,default:!1}},S={label:{type:[String,Number],default:void 0}},$={modifiers:{type:[String,Array],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},w={unselectable:{type:Boolean,default:!0}},L={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const A={...y,...S,...k,...h,...B,...g,type:{type:String,default:u.button,validator:e=>Object.values(u).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}};l.local;const V=A;const I=e.defineComponent({name:"VvAction",props:V,emits:["click","mouseover","mouseleave"],setup(o,{expose:t,emit:n}){const l=o,r=n,i=e.getCurrentInstance(),u=f(),s=e.ref(null);t({$el:s});const{reference:d,bus:p,aria:m,expanded:g}=e.inject(c,{});e.watch((()=>s.value),(e=>{d&&(d.value=e)}));const b=e.computed((()=>l.pressed||(null==g?void 0:g.value))),{role:y}=e.inject(v,{}),h=e.computed((()=>{switch(!0){case l.disabled:return a.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?a.nuxtLink:a.routerLink;case void 0!==l.href:return a.a;default:return l.defaultTag}})),B=e.computed((()=>{const e={...null==m?void 0:m.value,ariaPressed:!!b.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(h.value){case a.a:return{...e,href:l.href,target:l.target,rel:l.rel};case a.routerLink:case a.nuxtLink:return{...e,to:l.to,target:l.target};case a.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),k=e=>{var o;l.disabled?e.preventDefault():(null==(o=null==i?void 0:i.vnode.props)?void 0:o.onClick)?r("click",e):null==p||p.emit("click",e)},S=e=>{var o;(null==(o=null==i?void 0:i.vnode.props)?void 0:o.onMouseover)?r("mouseover",e):null==p||p.emit("mouseover",e)},$=e=>{var o;(null==(o=null==i?void 0:i.vnode.props)?void 0:o.onMouseleave)?r("mouseleave",e):null==p||p.emit("mouseleave",e)};return(o,t)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(h)),e.mergeProps(e.unref(B),{ref_key:"element",ref:s,class:{active:o.active,pressed:e.unref(b),disabled:o.disabled,current:o.current},onClickPassive:k,onMouseoverPassive:S,onMouseleavePassive:$}),{default:e.withCtx((()=>[e.renderSlot(o.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]))])),_:3},16,["class"]))}});const j={...A,...L,...$,...w,...b,...x,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},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};function P(o,t){const{group:n,isInGroup:l,getGroupOrLocalRef:r}=function(o){const t=e.inject(o,void 0),n=e.computed((()=>void 0!==t));return{group:t,isInGroup:n,getGroupOrLocalRef:function(o,n,l){const r=null==t?void 0:t[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const i=e.toRef(n,o);return e.computed({get:()=>i.value,set(e){l&&l(`update:${o}`,e)}})}}}(d),{id:i,iconPosition:u,icon:a,label:s,pressed:c}=e.toRefs(o),v=r("modelValue",o,t),f=r("toggle",o),p=r("unselectable",o),m=e.computed((()=>(null==n?void 0:n.multiple.value)??!1)),g=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>l.add(e)))),Array.from(l)})),b=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value))));return{group:n,isInGroup:l,modelValue:v,toggle:f,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:c,iconPosition:u,icon:a,label:s}}function C(e,o,t){return O(e,o)}function O(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){const t=Array.isArray(e),n=Array.isArray(o);let l,r,i;if(t&&n){if(r=e.length,r!=o.length)return!1;for(l=r;0!=l--;)if(!O(e[l],o[l]))return!1;return!0}if(t!=n)return!1;const u=e instanceof Date,a=o instanceof Date;if(u!=a)return!1;if(u&&a)return e.getTime()==o.getTime();const s=e instanceof RegExp,d=o instanceof RegExp;if(s!=d)return!1;if(s&&d)return e.toString()==o.toString();const c=Object.keys(e);if(r=c.length,r!==Object.keys(o).length)return!1;for(l=r;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,c[l]))return!1;for(l=r;0!=l--;)if(i=c[l],!O(e[i],o[i]))return!1;return!0}return e!=e&&o!=o}function E(e,o){if(null!=e&&o&&o.length)for(const t of o)if(C(e,t))return!0;return!1}const N={key:1,class:"vv-button__label"},_={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",inheritAttrs:!1,props:j,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const u=o,a=e.useAttrs(),s=e.useSlots(),d=l,{id:c,modifiers:v,iconPosition:f,icon:g,label:b,modelValue:y,disabled:h,toggle:B,unselectable:k}=P(u,d),S=(o=>e.computed((()=>String((null==o?void 0:o.value)||t.uid()))))(c),$=e.computed((()=>(null==a?void 0:a.name)||S.value)),x=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=x.value)?void 0:e.$el}))});const w=e.computed((()=>B.value?Array.isArray(y.value)?E($.value,y.value):C($.value,y.value):u.pressed)),L=p("vv-button",v,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==g?void 0:g.value)&&!(null==b?void 0:b.value)&&!s.default)})))),{hasIcon:A}=function(o,t){const n=e.computed((()=>"string"==typeof(null==o?void 0:o.value)?{name:null==o?void 0:o.value}:null==o?void 0:o.value)),l=e.computed((()=>(null==t?void 0:t.value)===i.before?n.value:void 0)),u=e.computed((()=>(null==t?void 0:t.value)===i.after?n.value:void 0)),a=e.computed((()=>(null==t?void 0:t.value)===r.left?n.value:void 0)),s=e.computed((()=>(null==t?void 0:t.value)===r.right?n.value:void 0)),d=e.computed((()=>(null==t?void 0:t.value)===r.top?n.value:void 0)),c=e.computed((()=>(null==t?void 0:t.value)===r.bottom?n.value:void 0));return{hasIcon:n,hasIconLeft:a,hasIconRight:s,hasIconTop:d,hasIconBottom:c,hasIconBefore:l,hasIconAfter:u}}(g),V=e.computed((()=>void 0!==u.value?u.value:$.value)),j=e.computed((()=>{if(B.value)return{onClick:O}})),O=()=>{if(B.value){if(Array.isArray(y.value))return E(V.value,y.value)?void(k.value&&(y.value=y.value.filter((e=>e!==V.value)))):void y.value.push(V.value);if(V.value===y.value&&k.value)return void(y.value=u.uncheckedValue);y.value=V.value}};return(o,t)=>(e.openBlock(),e.createBlock(I,e.mergeProps({...e.unref(a),...e.unref(j),disabled:e.unref(h),pressed:e.unref(w),active:o.active,type:o.type,to:o.to,href:o.href,target:o.target,rel:o.rel,ariaLabel:o.ariaLabel},{id:e.unref(S),ref_key:"element",ref:x,class:e.unref(L)}),{default:e.withCtx((()=>[e.renderSlot(o.$slots,"default",{},(()=>[o.loading?e.renderSlot(o.$slots,"loading",{key:0},(()=>[o.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:o.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),o.loadingLabel?(e.openBlock(),e.createElementBlock("span",N,e.toDisplayString(o.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(o.$slots,"before"),e.unref(A)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(A),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("span",_,[e.renderSlot(o.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(o.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { provide, computed,
|
|
1
|
+
import { provide, computed, defineComponent, toRefs, watchEffect, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
3
3
|
StorageType2["local"] = "local";
|
|
4
4
|
StorageType2["session"] = "session";
|
|
@@ -286,6 +286,7 @@ const VvButtonGroupProps = {
|
|
|
286
286
|
...ModifiersProps,
|
|
287
287
|
...DisabledProps,
|
|
288
288
|
...UnselectableProps,
|
|
289
|
+
legendLabel: { type: String },
|
|
289
290
|
/**
|
|
290
291
|
* String or String[] of css classes (modifiers) that will be provided to each button'
|
|
291
292
|
*/
|
|
@@ -319,14 +320,13 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
319
320
|
});
|
|
320
321
|
}
|
|
321
322
|
}
|
|
322
|
-
if (others) {
|
|
323
|
-
Object.keys(others.value).forEach((key) => {
|
|
324
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
323
|
return toReturn;
|
|
328
324
|
});
|
|
329
325
|
}
|
|
326
|
+
const _hoisted_1 = {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "vv-button-group__legend"
|
|
329
|
+
};
|
|
330
330
|
const __default__ = {
|
|
331
331
|
name: "VvButtonGroup"
|
|
332
332
|
};
|
|
@@ -377,12 +377,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
377
377
|
const bemCssClasses = useModifiers("vv-button-group", modifiers);
|
|
378
378
|
return (_ctx, _cache) => {
|
|
379
379
|
return openBlock(), createElementBlock(
|
|
380
|
-
"
|
|
380
|
+
"fieldset",
|
|
381
381
|
{
|
|
382
382
|
class: normalizeClass(unref(bemCssClasses)),
|
|
383
383
|
role: "group"
|
|
384
384
|
},
|
|
385
385
|
[
|
|
386
|
+
_ctx.$slots.legend || _ctx.legendLabel ? (openBlock(), createElementBlock("legend", _hoisted_1, [
|
|
387
|
+
renderSlot(_ctx.$slots, "legend", {}, () => [
|
|
388
|
+
createTextVNode(
|
|
389
|
+
toDisplayString(_ctx.legendLabel),
|
|
390
|
+
1
|
|
391
|
+
/* TEXT */
|
|
392
|
+
)
|
|
393
|
+
])
|
|
394
|
+
])) : createCommentVNode("v-if", true),
|
|
386
395
|
renderSlot(_ctx.$slots, "default")
|
|
387
396
|
],
|
|
388
397
|
2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const r=Symbol.for("buttonGroup"),u={disabled:{type:Boolean,default:!1}},i=(Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});l.before;const s={unselectable:{type:Boolean,default:!0}};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,a.button,o.local;const d={...i,...u,...s,legendLabel:{type:String},itemModifiers:{type:[String,Array],default:""},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array],default:void 0}};const f={key:0,class:"vv-button-group__legend"};return e.defineComponent({name:"VvButtonGroup",props:d,emits:["update:modelValue"],setup(o,{emit:t}){const l=t,n=o,{disabled:a,toggle:u,modifiers:i,multiple:s,unselectable:d,itemModifiers:p}=e.toRefs(n);e.watchEffect((()=>{"string"==typeof n.modelValue&&s.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const m=e.computed({get:()=>s.value?n.modelValue:Array.isArray(n.modelValue)?n.modelValue[0]:n.modelValue,set:e=>void 0===e||!Array.isArray(n.modelValue)&&!s.value||Array.isArray(e)?l("update:modelValue",e):l("update:modelValue",[e])});var c,b;c=r,b={modelValue:m,disabled:a,toggle:u,multiple:s,unselectable:d,modifiers:p},e.provide(c,b);const g=function(o,t,l){return e.computed((()=>{const e={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((t=>{t&&(e[`${o}--${t}`]=!0)})),e}))}("vv-button-group",i);return(o,t)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(g)),role:"group"},[o.$slots.legend||o.legendLabel?(e.openBlock(),e.createElementBlock("legend",f,[e.renderSlot(o.$slots,"legend",{},(()=>[e.createTextVNode(e.toDisplayString(o.legendLabel),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(o.$slots,"default")],2))}})}));
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
legendLabel: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
};
|
|
2
5
|
itemModifiers: {
|
|
3
6
|
type: globalThis.PropType<string | string[]>;
|
|
4
7
|
default: string;
|
|
@@ -30,6 +33,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
30
33
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
34
|
[x: string]: (...args: any[]) => void;
|
|
32
35
|
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
36
|
+
legendLabel: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
};
|
|
33
39
|
itemModifiers: {
|
|
34
40
|
type: globalThis.PropType<string | string[]>;
|
|
35
41
|
default: string;
|
|
@@ -67,6 +73,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
67
73
|
unselectable: boolean;
|
|
68
74
|
multiple: boolean;
|
|
69
75
|
}, {}>, {
|
|
76
|
+
legend?(_: {}): any;
|
|
70
77
|
default?(_: {}): any;
|
|
71
78
|
}>;
|
|
72
79
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed,
|
|
1
|
+
import { computed, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
3
3
|
StorageType2["local"] = "local";
|
|
4
4
|
StorageType2["session"] = "session";
|
|
@@ -292,11 +292,6 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
if (others) {
|
|
296
|
-
Object.keys(others.value).forEach((key) => {
|
|
297
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
295
|
return toReturn;
|
|
301
296
|
});
|
|
302
297
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});Boolean,Boolean,Boolean,Boolean;const a={modifiers:{type:[String,Array],default:void 0}};n.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button,l.button,o.local;const s={...a,title:String};const i={key:0,class:"vv-card__header"},c={key:1,class:"vv-card__content"},u={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:s,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});Boolean,Boolean,Boolean,Boolean;const a={modifiers:{type:[String,Array],default:void 0}};n.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button,l.button,o.local;const s={...a,title:String};const i={key:0,class:"vv-card__header"},c={key:1,class:"vv-card__content"},u={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:s,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const e={[o]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((t=>{t&&(e[`${o}--${t}`]=!0)})),e}))}("vv-card",n);return(o,t)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(r))},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",i,[e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(o.$slots,"default"),o.$slots.content?(e.openBlock(),e.createElementBlock("div",c,[e.renderSlot(o.$slots,"content")])):e.createCommentVNode("v-if",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",u,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("v-if",!0)],2))}})}));
|
|
@@ -457,9 +457,6 @@ function useGroupProps(props, emit) {
|
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
function equals(obj1, obj2, field) {
|
|
460
|
-
if (field) {
|
|
461
|
-
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
462
|
-
}
|
|
463
460
|
return deepEquals(obj1, obj2);
|
|
464
461
|
}
|
|
465
462
|
function deepEquals(a, b) {
|
|
@@ -506,25 +503,6 @@ function deepEquals(a, b) {
|
|
|
506
503
|
}
|
|
507
504
|
return a !== a && b !== b;
|
|
508
505
|
}
|
|
509
|
-
function resolveFieldData(data, field) {
|
|
510
|
-
if (data && Object.keys(data).length && field) {
|
|
511
|
-
if (field.indexOf(".") === -1) {
|
|
512
|
-
return data[field];
|
|
513
|
-
} else {
|
|
514
|
-
const fields = field.split(".");
|
|
515
|
-
let value = data;
|
|
516
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
517
|
-
if (data == null) {
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
value = value[fields[i]];
|
|
521
|
-
}
|
|
522
|
-
return value;
|
|
523
|
-
}
|
|
524
|
-
} else {
|
|
525
|
-
return null;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
506
|
function contains(value, list) {
|
|
529
507
|
if (value != null && list && list.length) {
|
|
530
508
|
for (const val of list) {
|
|
@@ -811,8 +789,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
811
789
|
if (isBinary.value) {
|
|
812
790
|
modelValue.value = newValue ? props.value : props.uncheckedValue;
|
|
813
791
|
} else if (Array.isArray(modelValue.value) || isInGroup.value) {
|
|
792
|
+
const currentValue = modelValue.value ?? [];
|
|
814
793
|
const toReturn = new Set(
|
|
815
|
-
Array.isArray(
|
|
794
|
+
Array.isArray(currentValue) ? currentValue : [currentValue]
|
|
816
795
|
);
|
|
817
796
|
if (newValue) {
|
|
818
797
|
toReturn.add(props.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.local="local",e.session="session",e))(l||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.local="local",e.session="session",e))(l||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup"),d={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},s={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},v={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},c={disabled:{type:Boolean,default:!1}},f=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),p={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}};o.before;const m={tabindex:{type:[String,Number],default:0}},y={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...y,name:{type:String,required:!0}},...m,...d,...s,...h,...c,...p,...b,...f,...v,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};n.button,i.button,l.local;const S={...g,...b,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function L(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){o&&o(`update:${t}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(t),s=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:d,group:a,isInGroup:o,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}function k(e,t,l){return B(e,t)}function B(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!B(e[o],t[o]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(n=v.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,v[o]))return!1;for(o=n;0!=o--;)if(i=v[o],!B(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function V(t,l,a){const o=e.inject(r),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}const x=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:S,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=a,i=e.useSlots(),r=V("VvCheckbox",S,o),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=L(o,n),m=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),y=e.computed((()=>`${m.value}-hint`)),g=e.computed((()=>w.value?-1:o.tabindex)),B=e.ref(),$=e.computed((()=>void 0!==o.uncheckedValue&&!h.value)),w=e.computed((()=>d.value||s.value)),j=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>$.value?p.value===o.value:Array.isArray(p.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(k(e,l))return!0;return!1}(o.value,p.value):k(o.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!$.value||o.uncheckedValue===p.value))),N=e.computed((()=>{if(!$.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),I=e.computed({get:()=>R.value,set(e){if($.value)p.value=e?o.value:o.uncheckedValue;else if(Array.isArray(p.value)||h.value){const t=p.value??[],l=new Set(Array.isArray(t)?t:[t]);e?l.add(o.value):l.delete(o.value),p.value=[...l]}else p.value=e?o.value:void 0;n("change",e)}}),{modifiers:P}=e.toRefs(o),E=function(t,l,a){return e.computed((()=>{const o={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{$.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{B.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(B.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>O(a.value.invalidLabel))),n=e.computed((()=>O(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:B,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(w),value:e.unref(N),tabindex:e.unref(g),"aria-invalid":e.unref(j),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,A),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(t.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,x))}})}));
|
|
@@ -53,9 +53,6 @@ const INJECTION_KEY_CHECK_GROUP = Symbol.for(
|
|
|
53
53
|
"checkGroup"
|
|
54
54
|
);
|
|
55
55
|
function equals(obj1, obj2, field) {
|
|
56
|
-
if (field) {
|
|
57
|
-
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
58
|
-
}
|
|
59
56
|
return deepEquals(obj1, obj2);
|
|
60
57
|
}
|
|
61
58
|
function deepEquals(a, b) {
|
|
@@ -102,25 +99,6 @@ function deepEquals(a, b) {
|
|
|
102
99
|
}
|
|
103
100
|
return a !== a && b !== b;
|
|
104
101
|
}
|
|
105
|
-
function resolveFieldData(data, field) {
|
|
106
|
-
if (data && Object.keys(data).length && field) {
|
|
107
|
-
if (field.indexOf(".") === -1) {
|
|
108
|
-
return data[field];
|
|
109
|
-
} else {
|
|
110
|
-
const fields = field.split(".");
|
|
111
|
-
let value = data;
|
|
112
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
113
|
-
if (data == null) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
value = value[fields[i]];
|
|
117
|
-
}
|
|
118
|
-
return value;
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
102
|
function contains(value, list) {
|
|
125
103
|
if (value != null && list && list.length) {
|
|
126
104
|
for (const val of list) {
|
|
@@ -863,8 +841,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
863
841
|
if (isBinary.value) {
|
|
864
842
|
modelValue.value = newValue ? props.value : props.uncheckedValue;
|
|
865
843
|
} else if (Array.isArray(modelValue.value) || isInGroup.value) {
|
|
844
|
+
const currentValue = modelValue.value ?? [];
|
|
866
845
|
const toReturn = new Set(
|
|
867
|
-
Array.isArray(
|
|
846
|
+
Array.isArray(currentValue) ? currentValue : [currentValue]
|
|
868
847
|
);
|
|
869
848
|
if (newValue) {
|
|
870
849
|
toReturn.add(props.value);
|
|
@@ -1091,7 +1070,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1091
1070
|
renderList(_ctx.options, (option, index) => {
|
|
1092
1071
|
return openBlock(), createBlock(
|
|
1093
1072
|
_sfc_main$1,
|
|
1094
|
-
mergeProps({
|
|
1073
|
+
mergeProps({
|
|
1074
|
+
key: index,
|
|
1075
|
+
ref_for: true
|
|
1076
|
+
}, getOptionProps(option, index)),
|
|
1095
1077
|
null,
|
|
1096
1078
|
16
|
|
1097
1079
|
/* FULL_PROPS */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{});const d=Symbol.for("volver"),s=Symbol.for("checkGroup");function v(e,t,l){return l?f(e,l)===f(t,l):c(e,t)}function c(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!c(e[o],t[o]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(n=v.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,v[o]))return!1;for(o=n;0!=o--;)if(i=v[o],!c(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,o=l.length;t<o;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function b(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>p(a.value.invalidLabel))),n=e.computed((()=>p(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:b}}const m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},h={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),k={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},B={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"}};i.before;const x={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...O,name:{type:String,required:!0}},...x,...m,...h,...B,...g,...k,...L,...S,...y,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},A={...m,...h,...V,...B,...g,...k,...L,...S,...y,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,o.local;const C={...$,...L,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function w(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){o&&o(`update:${t}`,e)}})}}}(s),{id:i,switch:r,indeterminate:u}=e.toRefs(t),d=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:u,group:a,isInGroup:o,modelValue:d,valid:v,invalid:c,readonly:f,disabled:p}}function j(t,l,a){const o=e.inject(d),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function P(t,l,a){return e.computed((()=>{const o={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const R=["for"],N=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],_=e.defineComponent({name:"VvCheckbox",props:C,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=a,i=e.useSlots(),r=j("VvCheckbox",C,o),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:p,modelValue:m,indeterminate:h,isInGroup:y}=w(o,n),g=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),S=e.computed((()=>`${g.value}-hint`)),k=e.computed((()=>V.value?-1:o.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==o.uncheckedValue&&!y.value)),V=e.computed((()=>d.value||s.value)),x=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),O=e.computed((()=>B.value?m.value===o.value:Array.isArray(m.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(o.value,m.value):v(o.value,m.value))),$=e.computed((()=>!!h.value||!(O.value||!B.value||o.uncheckedValue===m.value))),A=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),_=e.computed({get:()=>O.value,set(e){if(B.value)m.value=e?o.value:o.uncheckedValue;else if(Array.isArray(m.value)||y.value){const t=new Set(Array.isArray(m.value)?m.value:void 0!==m.value?[m.value]:[]);e?t.add(o.value):t.delete(o.value),m.value=[...t]}else m.value=e?o.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(o),E=P("vv-checkbox",z,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:d.value,readonly:s.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>$.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{$.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=b(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(g)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(g),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(_)?_.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(V),value:e.unref(A),tabindex:e.unref(k),"aria-invalid":e.unref(x),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,N),[[e.vModelCheckbox,e.unref(_)]]),e.renderSlot(t.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,R))}}),z=A;const E=["textContent"],G={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:z,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=o,r=e.useSlots(),u=j("VvCheckboxGroup",z,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:c,vertical:f,valid:p,invalid:m,modifiers:h}=e.toRefs(n);var y,g;y=s,g={modelValue:d,disabled:v,readonly:c,valid:p,invalid:m},e.provide(y,g);const{getOptionLabel:S,getOptionValue:k}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),L=P("vv-checkbox-group",h,e.computed((()=>({disabled:v.value,readonly:c.value,horizontal:!f.value,valid:p.value,invalid:m.value})))),{HintSlot:B,hintSlotScope:V}=b(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(L))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,E)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",G,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:k(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(B),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{});const d=Symbol.for("volver"),s=Symbol.for("checkGroup");function v(e,t,l){return c(e,t)}function c(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!c(e[o],t[o]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(n=v.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,v[o]))return!1;for(o=n;0!=o--;)if(i=v[o],!c(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function p(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>f(a.value.invalidLabel))),n=e.computed((()=>f(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:b}}const b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},m={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},h={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},g=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},k={modifiers:{type:[String,Array],default:void 0}},L={hintLabel:{type:String,default:""}},B={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};i.before;const V={tabindex:{type:[String,Number],default:0}},x={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const O={...{...x,name:{type:String,required:!0}},...V,...b,...m,...L,...y,...S,...k,...g,...h,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},$={...b,...m,...B,...L,...y,...S,...k,...g,...h,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,o.local;const A={...O,...k,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function C(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){o&&o(`update:${t}`,e)}})}}}(s),{id:i,switch:r,indeterminate:u}=e.toRefs(t),d=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:u,group:a,isInGroup:o,modelValue:d,valid:v,invalid:c,readonly:f,disabled:p}}function w(t,l,a){const o=e.inject(d),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function P(t,l,a){return e.computed((()=>{const o={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const R=["for"],j=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvCheckbox",props:A,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=a,i=e.useSlots(),r=w("VvCheckbox",A,o),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:b,modelValue:m,indeterminate:h,isInGroup:y}=C(o,n),g=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),S=e.computed((()=>`${g.value}-hint`)),k=e.computed((()=>V.value?-1:o.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==o.uncheckedValue&&!y.value)),V=e.computed((()=>d.value||s.value)),x=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),O=e.computed((()=>B.value?m.value===o.value:Array.isArray(m.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(o.value,m.value):v(o.value,m.value))),$=e.computed((()=>!!h.value||!(O.value||!B.value||o.uncheckedValue===m.value))),N=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),_=e.computed({get:()=>O.value,set(e){if(B.value)m.value=e?o.value:o.uncheckedValue;else if(Array.isArray(m.value)||y.value){const t=m.value??[],l=new Set(Array.isArray(t)?t:[t]);e?l.add(o.value):l.delete(o.value),m.value=[...l]}else m.value=e?o.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(o),E=P("vv-checkbox",z,e.computed((()=>({switch:b.value,valid:c.value,invalid:f.value,disabled:d.value,readonly:s.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>$.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{$.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(g)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(g),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(_)?_.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(V),value:e.unref(N),tabindex:e.unref(k),"aria-invalid":e.unref(x),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,j),[[e.vModelCheckbox,e.unref(_)]]),e.renderSlot(t.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,R))}}),_=$;const z=["textContent"],E={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:_,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=o,r=e.useSlots(),u=w("VvCheckboxGroup",_,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:c,vertical:f,valid:b,invalid:m,modifiers:h}=e.toRefs(n);var y,g;y=s,g={modelValue:d,disabled:v,readonly:c,valid:b,invalid:m},e.provide(y,g);const{getOptionLabel:S,getOptionValue:k}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),L=P("vv-checkbox-group",h,e.computed((()=>({disabled:v.value,readonly:c.value,horizontal:!f.value,valid:b.value,invalid:m.value})))),{HintSlot:B,hintSlotScope:V}=p(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(L))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(N,e.mergeProps({key:l,ref_for:!0},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:k(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(B),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
@@ -1405,9 +1405,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1405
1405
|
}
|
|
1406
1406
|
});
|
|
1407
1407
|
function equals(obj1, obj2, field) {
|
|
1408
|
-
if (field) {
|
|
1409
|
-
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
1410
|
-
}
|
|
1411
1408
|
return deepEquals(obj1, obj2);
|
|
1412
1409
|
}
|
|
1413
1410
|
function deepEquals(a, b) {
|
|
@@ -1454,25 +1451,6 @@ function deepEquals(a, b) {
|
|
|
1454
1451
|
}
|
|
1455
1452
|
return a !== a && b !== b;
|
|
1456
1453
|
}
|
|
1457
|
-
function resolveFieldData(data, field) {
|
|
1458
|
-
if (data && Object.keys(data).length && field) {
|
|
1459
|
-
if (field.indexOf(".") === -1) {
|
|
1460
|
-
return data[field];
|
|
1461
|
-
} else {
|
|
1462
|
-
const fields = field.split(".");
|
|
1463
|
-
let value = data;
|
|
1464
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
1465
|
-
if (data == null) {
|
|
1466
|
-
return null;
|
|
1467
|
-
}
|
|
1468
|
-
value = value[fields[i]];
|
|
1469
|
-
}
|
|
1470
|
-
return value;
|
|
1471
|
-
}
|
|
1472
|
-
} else {
|
|
1473
|
-
return null;
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
1454
|
function findIndexInList(value, list) {
|
|
1477
1455
|
let index = -1;
|
|
1478
1456
|
if (list) {
|
|
@@ -2089,8 +2067,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2089
2067
|
return openBlock(), createElementBlock(
|
|
2090
2068
|
"span",
|
|
2091
2069
|
{
|
|
2092
|
-
class: normalizeClass(unref(bemCssClasses))
|
|
2093
|
-
role: "status"
|
|
2070
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
2094
2071
|
},
|
|
2095
2072
|
[
|
|
2096
2073
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -2543,7 +2520,7 @@ const _hoisted_4 = {
|
|
|
2543
2520
|
class: "vv-select__input-before"
|
|
2544
2521
|
};
|
|
2545
2522
|
const _hoisted_5 = { class: "vv-select__inner" };
|
|
2546
|
-
const _hoisted_6 = ["aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2523
|
+
const _hoisted_6 = ["aria-controls", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2547
2524
|
const _hoisted_7 = {
|
|
2548
2525
|
key: 0,
|
|
2549
2526
|
class: "vv-select__value"
|
|
@@ -2881,6 +2858,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2881
2858
|
}, aria, {
|
|
2882
2859
|
class: "vv-select__input",
|
|
2883
2860
|
role: "combobox",
|
|
2861
|
+
"aria-controls": unref(hasDropdownId),
|
|
2884
2862
|
"aria-expanded": unref(expanded),
|
|
2885
2863
|
"aria-labelledby": unref(hasLabelId),
|
|
2886
2864
|
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
@@ -2984,7 +2962,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2984
2962
|
renderList(unref(getOptionGrouped)(
|
|
2985
2963
|
option
|
|
2986
2964
|
), (item, i) => {
|
|
2987
|
-
return openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
2965
|
+
return openBlock(), createBlock(_sfc_main$6, mergeProps({ ref_for: true }, {
|
|
2988
2966
|
selected: isOptionSelected(item),
|
|
2989
2967
|
disabled: unref(isOptionDisabled)(item),
|
|
2990
2968
|
unselectable: _ctx.unselectable,
|
|
@@ -2998,12 +2976,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2998
2976
|
onClickPassive: ($event) => onInput(item)
|
|
2999
2977
|
}), {
|
|
3000
2978
|
default: withCtx(() => [
|
|
3001
|
-
renderSlot(_ctx.$slots, "option",
|
|
2979
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3002
2980
|
option,
|
|
3003
2981
|
selectedOptions: unref(selectedOptions),
|
|
3004
2982
|
selected: isOptionSelected(item),
|
|
3005
2983
|
disabled: unref(isOptionDisabled)(item)
|
|
3006
|
-
})
|
|
2984
|
+
}), () => [
|
|
3007
2985
|
createTextVNode(
|
|
3008
2986
|
toDisplayString(unref(getOptionLabel)(item)),
|
|
3009
2987
|
1
|
|
@@ -3021,7 +2999,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3021
2999
|
],
|
|
3022
3000
|
64
|
|
3023
3001
|
/* STABLE_FRAGMENT */
|
|
3024
|
-
)) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
3002
|
+
)) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
3003
|
+
key: 1,
|
|
3004
|
+
ref_for: true
|
|
3005
|
+
}, {
|
|
3025
3006
|
selected: isOptionSelected(option),
|
|
3026
3007
|
disabled: unref(isOptionDisabled)(option),
|
|
3027
3008
|
unselectable: _ctx.unselectable,
|
|
@@ -3034,12 +3015,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3034
3015
|
onClickPassive: ($event) => onInput(option)
|
|
3035
3016
|
}), {
|
|
3036
3017
|
default: withCtx(() => [
|
|
3037
|
-
renderSlot(_ctx.$slots, "option",
|
|
3018
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3038
3019
|
option,
|
|
3039
3020
|
selectedOptions: unref(selectedOptions),
|
|
3040
3021
|
selected: isOptionSelected(option),
|
|
3041
3022
|
disabled: unref(isOptionDisabled)(option)
|
|
3042
|
-
})
|
|
3023
|
+
}), () => [
|
|
3043
3024
|
createTextVNode(
|
|
3044
3025
|
toDisplayString(unref(getOptionLabel)(option)),
|
|
3045
3026
|
1
|