@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
3 lines (2 loc) • 2.04 kB
JavaScript
;const s=require("./NeonSwitch.cjs.js"),n=require("vue"),l=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),d=["aria-checked","aria-disabled","role"],a=["tabindex"],r=n.createElementVNode("span",{class:"neon-switch__indicator"},null,-1),c=[r],h=["checked","disabled"],w={key:2,class:"neon-switch__label"};function p(e,i,u,m,k,g){const t=n.resolveComponent("neon-icon");return n.openBlock(),n.createElementBlock("label",{"aria-checked":e.indeterminate?"mixed":e.modelValue,"aria-disabled":e.disabled,class:n.normalizeClass([[`neon-switch--${e.switchStyle}`,`neon-switch--${e.size}`,`neon-switch--${e.color}`,`neon-switch--${e.labelPosition}`,{"neon-switch--disabled":e.disabled,"neon-switch--checked":e.modelValue,"neon-switch--indeterminate":e.indeterminate}],"neon-switch no-style"]),role:e.switchStyle,tabindex:"-1",onClick:i[0]||(i[0]=n.withModifiers((...o)=>e.toggleSwitch&&e.toggleSwitch(...o),["stop","prevent"])),onKeydown:[i[1]||(i[1]=n.withKeys(n.withModifiers((...o)=>e.toggleSwitch&&e.toggleSwitch(...o),["stop","prevent"]),["enter"])),i[2]||(i[2]=n.withKeys(n.withModifiers((...o)=>e.toggleSwitch&&e.toggleSwitch(...o),["stop","prevent"]),["space"]))]},[e.switchStyle==="checkbox"?(n.openBlock(),n.createBlock(t,{key:0,disabled:e.disabled,inverse:!0,name:e.indeterminate?"dash":"check",tabindex:!e.disabled&&e.label?0:void 0,class:"neon-switch__checkbox"},null,8,["disabled","name","tabindex"])):n.createCommentVNode("",!0),e.switchStyle==="switch"?(n.openBlock(),n.createElementBlock("span",{key:1,tabindex:e.disabled?void 0:0,class:"neon-switch__switch"},c,8,a)):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({ref:"checkbox",checked:!e.indeterminate&&e.modelValue,disabled:e.disabled,class:"neon-switch__input",type:"checkbox"},e.sanitizedAttributes),null,16,h),e.label?(n.openBlock(),n.createElementBlock("span",w,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0)],42,d)}const b=l(s,[["render",p]]);module.exports=b;
//# sourceMappingURL=NeonSwitch.vue.cjs.js.map