UNPKG

@jonywu/icon_test

Version:
2 lines (1 loc) 2.31 kB
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.IconTestLibrary={},i.Vue))})(this,function(i,e){"use strict";const l=["src","width","height","alt"],d={__name:"Icon",props:{name:{type:String},size:{type:String},width:{type:String},height:{type:String},color:{type:String,default:"currentColor"}},setup(n){const t=n,o=e.inject("icons",{}),a=e.computed(()=>o[t.name]||null),c=e.computed(()=>typeof a.value=="string"&&a.value.startsWith("data:image/svg+xml,"));return(m,u)=>c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,width:n.size||n.width,height:n.size||n.height,alt:n.name},null,8,l)):a.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{key:1,width:n.size||n.width,height:n.size||n.height,fill:n.color},null,8,["width","height","fill"])):e.createCommentVNode("",!0)}},r={key:1,class:"ded-button-content"},s=e.defineComponent({__name:"Button",props:{themeColor:{default:"primary"},variant:{},prefix:{},suffix:{},size:{default:"medium"},width:{default:"fit"},borderWidth:{},radius:{},isDisabled:{type:Boolean,default:!1},className:{default:""}},setup(n){const t=n;return(o,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass({"ded-button":!0,[`ded-button-${t.width}`]:t.width,[`ded-text-${t.size}`]:t.size,[`ded-button-${t.variant}`]:t.variant,[`ded-button-${t.variant}-${t.themeColor}`]:t.variant&&t.themeColor,[`ded-button-${t.variant}-disabled`]:t.variant&&t.isDisabled,[`ded-button-border-width-${t.borderWidth}`]:t.borderWidth,[`ded-button-radius-${t.radius}`]:t.radius,[t.className]:!!t.className})},[o.prefix?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`ded-icon-${t.size}`)},[e.createVNode(d,{name:t.prefix},null,8,["name"])],2)):e.createCommentVNode("",!0),o.$slots.default?(e.openBlock(),e.createElementBlock("div",r,[e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0),o.suffix?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(`ded-icon-${t.size}`)},[e.createVNode(d,{name:t.suffix},null,8,["name"])],2)):e.createCommentVNode("",!0)],2))}});i.Button=s,i.Icon=d,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});