UNPKG

eslink-ui-plus

Version:

vue3 component library, css framework

47 lines (46 loc) 3.51 kB
(function(e,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("vue")):typeof define=="function"&&define.amd?define(["vue"],f):(e=typeof globalThis!="undefined"?globalThis:e||self,e["es-button"]=f(e.Vue))})(this,function(e){"use strict";e.pushScopeId("data-v-2ca3eff0");const f={key:2,class:"button__text"};e.popScopeId();var r=e.defineComponent({props:{styles:{type:Object,default:()=>({})},type:{type:String,default:"default"},text:{type:String,default:""},plain:{type:Boolean,default:!1},iconBefore:{type:String,default:""},iconAfter:{type:String,default:""},fontColor:{type:String,default:""},icon:{type:String,default:""}},emits:["click"],setup(t,{emit:a}){return e.useCssVars(l=>({"2ca3eff0-fontColor":t.fontColor})),(l,n)=>t.type==="icon"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"button__icon es-cursor--pointer",style:e.normalizeStyle(t.styles),onClick:n[0]||(n[0]=o=>a("click"))},[e.createElementVNode("i",{class:e.normalizeClass(t.icon)},null,2)],4)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["button",[t.type,{plain:t.plain}]]),style:e.normalizeStyle(t.styles),onClick:n[1]||(n[1]=o=>a("click"))},[t.iconBefore===""?e.renderSlot(l.$slots,"before",{key:0}):e.createCommentVNode("v-if",!0),t.iconBefore!==""?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["icon",t.iconBefore])},null,2)):e.createCommentVNode("v-if",!0),t.text!==""?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(t.text),1)):e.renderSlot(l.$slots,"default",{key:3}),t.iconAfter!==""?(e.openBlock(),e.createElementBlock("i",{key:4,class:e.normalizeClass(["icon",t.iconAfter])},null,2)):e.createCommentVNode("v-if",!0),t.iconAfter===""?e.renderSlot(l.$slots,"after",{key:5}):e.createCommentVNode("v-if",!0)],6))}});function i(t,a){a===void 0&&(a={});var l=a.insertAt;if(!(!t||typeof document=="undefined")){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",l==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}var c=`.button[data-v-2ca3eff0] { padding: 0 12px; border-radius: 4px; cursor: pointer; box-sizing: border-box; font-size: 14px; height: 30px; line-height: 30px; --button-font-color: var(--2ca3eff0-fontColor); } .button[data-v-2ca3eff0]:disabled { cursor: not-allowed; } .button__icon[data-v-2ca3eff0] { display: inline-block; } .button__text[data-v-2ca3eff0] { display: inline-block; height: 21px; } .button.error[data-v-2ca3eff0] { background-color: #ea4444; color: var(--button-font-color, #ffffff); } .button.pure[data-v-2ca3eff0] { background-color: unset; color: var(--button-font-color, #e4e5ec); } .button.default[data-v-2ca3eff0] { background: #5075e2; color: var(--button-font-color, #ffffff); } .button.default[data-v-2ca3eff0]:disabled { background: #5075e290; } .button.default.plain[data-v-2ca3eff0] { border: 1px solid #a7baf1; background: #ffffff; color: var(--button-font-color, #3e4051); box-shadow: 0px 1px 3px rgba(48, 88, 208, 0.1), 0px 2px 1px rgba(48, 88, 208, 0.06), 0px 1px 1px rgba(48, 88, 208, 0.08); } .button.error.plain[data-v-2ca3eff0] { border: 1px solid #a7baf1; background: #ffffff; color: var(--button-font-color, #da0000); }`;return i(c),r.__scopeId="data-v-2ca3eff0",r.__file="components/button/index.vue",r.install=t=>{t.component("es-button",r)},r});