@fe6/icon-cube-vue
Version:
Water Icon 的支持自定义图标
2 lines (1 loc) • 5.7 kB
JavaScript
var IconsBytedMosaic=function(k,s){"use strict";var f={size:"1em",spin:!1,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{outStrokeColor:"#333",outFillColor:"transparent"},filled:{outStrokeColor:"#333",outFillColor:"#fff"},twoTone:{outStrokeColor:"#333",outFillColor:"#2f88ff"},multiColor:{outStrokeColor:"#333",outFillColor:"#2f88ff",innerStrokeColor:"#fff",innerFillColor:"#43ccf8"}},prefix:"cube"},H=function(i){var t=window.__iconCube__;return i&&t?t[i]:null},m=Object.prototype.hasOwnProperty,w=function(i,t){return m.call(i,t)},L=Object.prototype.toString,b=function(i){return L.call(i)},a=function(i,t,o,l,e){if(!i||!w(i,t))return e;var n=b(i[t])==="[object ".concat(o,"]")?i[t]:e;return t==="content"||t==="canSet"||l?n:e},N=function(i,t,o){var l=[];switch(i){case"outline":l.push(t[0]||o.outline.outStrokeColor),l.push(t[1]||o.outline.outFillColor),l.push(t[0]||o.outline.outStrokeColor),l.push(t[1]||o.outline.outFillColor);break;case"filled":l.push(t[0]||o.filled.outStrokeColor),l.push(t[0]||o.filled.outStrokeColor),l.push(t[1]||o.filled.outFillColor),l.push(t[1]||o.filled.outFillColor);break;case"twoTone":l.push(t[0]||o.twoTone.outStrokeColor),l.push(t[1]||o.twoTone.outFillColor),l.push(t[0]||o.twoTone.outStrokeColor),l.push(t[1]||o.twoTone.outFillColor);break;case"multiColor":l.push(t[0]||o.multiColor.outStrokeColor),l.push(t[1]||o.multiColor.outFillColor),l.push(t[2]||o.multiColor.innerStrokeColor),l.push(t[3]||o.multiColor.innerFillColor);break}return l},T=function(i,t,o){var l=t?.colors||[],e=[],n=H(i),u=a(n,"canSet","Boolean",!1,!0),p=a(n,"theme","String",u,t?.theme||o.theme);switch(p){case"outline":e.push(typeof l[0]=="string"&&!o.colors.outline.outStrokeColor?l[0]:o.colors.outline.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.outline.outFillColor?l[1]:o.colors.outline.outFillColor),e.push(typeof l[0]=="string"&&!o.colors.outline.outStrokeColor?l[0]:o.colors.outline.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.outline.outFillColor?l[1]:o.colors.outline.outFillColor);break;case"filled":e.push(typeof l[0]=="string"&&!o.colors.filled.outStrokeColor?l[0]:o.colors.filled.outStrokeColor),e.push(typeof l[0]=="string"&&!o.colors.filled.outStrokeColor?l[0]:o.colors.filled.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.filled.outFillColor?l[1]:o.colors.filled.outFillColor),e.push(typeof l[1]=="string"&&!o.colors.filled.outFillColor?l[1]:o.colors.filled.outFillColor);break;case"twoTone":e.push(typeof l[0]=="string"&&!o.colors.twoTone.outStrokeColor?l[0]:o.colors.twoTone.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.twoTone.outFillColor?l[1]:o.colors.twoTone.outFillColor),e.push(typeof l[0]=="string"&&!o.colors.twoTone.outStrokeColor?l[0]:o.colors.twoTone.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.twoTone.outFillColor?l[1]:o.colors.twoTone.outFillColor);break;case"multiColor":e.push(typeof l[0]=="string"&&!o.colors.multiColor.outStrokeColor?l[0]:o.colors.multiColor.outStrokeColor),e.push(typeof l[1]=="string"&&!o.colors.multiColor.outFillColor?l[1]:o.colors.multiColor.outFillColor),e.push(typeof l[2]=="string"&&!o.colors.multiColor.innerStrokeColor?l[2]:o.colors.multiColor.innerStrokeColor),e.push(typeof l[3]=="string"&&!o.colors.multiColor.innerFillColor?l[3]:o.colors.multiColor.innerFillColor);break}var C=a(n,"size","String",u,String(t?.size||o.size)),d=a(n,"strokeLinejoin","String",u,t?.strokeLinejoin||o.strokeLinejoin),S=a(n,"strokeLinecap","String",u,t?.strokeLinecap||o.strokeLinecap),V=a(n,"strokeWidth","String",u,t?.strokeWidth||o.strokeWidth),v=a(n,"spin","String",u,t?.spin||o.spin),c=a(n,"colors","Array",u,t?.colors||e).slice();return c=N(p,c,o.colors),{size:C,strokeWidth:V,strokeLinecap:S,strokeLinejoin:d,colors:c,spin:v,id:i}},j=Symbol("cube-icon-context"),M=function(i,t,o){var l=s.defineComponent({name:"icon-"+i,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","colors","spin","id"],setup:function(n){var u=s.inject(j,f)||f;return function(){var p=n.size,C=n.strokeWidth,d=n.strokeLinecap,S=n.strokeLinejoin,V=n.theme,v=n.colors,c=n.spin,F=String(n.id?n.id:i),y=T(F,{size:p,strokeWidth:C,strokeLinecap:d,strokeLinejoin:S,theme:V,colors:v,spin:c,id:F},u),h=["".concat(u.prefix,"-icon")];return h.push("".concat(u.prefix,"-icon-").concat(i)),t&&u.rtl&&h.push("".concat(u.prefix,"-icon-rtl")),c&&String(c)==="true"&&h.push("".concat(u.prefix,"-icon-spin")),i==="cube"?s.createVNode("span",{class:h.join(" "),innerHTML:o(y)},null):s.createVNode("span",{class:h.join(" ")},[o(y)])}}});return l},Z=M("byted-mosaic",!1,function(r){return s.createVNode("svg",{width:r.size,height:r.size,viewBox:"0 0 48 48",fill:"none"},[s.createVNode("path",{d:"M44 36H36V44H44V36Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M28 36H20V44H28V36Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M12 36H4V44H12V36Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M44 20H36V28H44V20Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M28 20H20V28H28V20Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M12 20H4V28H12V20Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M44 4H36V12H44V4Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M28 4H20V12H28V4Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M12 4H4V12H12V4Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M20 12H12V20H20V12Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M20 28H12V36H20V28Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M36 12H28V20H36V12Z",fill:r.colors[0]},null),s.createVNode("path",{d:"M36 28H28V36H36V28Z",fill:r.colors[0]},null)])});return k.default=Z,Object.defineProperty(k,"__esModule",{value:!0}),k}({},Vue);