maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.42 kB
JavaScript
;
// THIS FILE WAS AUTO-GENERATED FOR PACKAGING, DO NOT MODIFY
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../../../types");
// tslint:disable-next-line
const SVG_PROPS = { "xmlns": "http://www.w3.org/2000/svg", "width": "64", "height": "64", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd", "viewBox": "0 0 640 640" };
class EdgeLogo {
constructor() {
this.defaults = {
height: "1em",
width: "1em",
fill: "black",
};
}
view(vnode) {
return m("svg", Object.assign({}, this.genAttrs(vnode)),
// tslint:disable-next-line
m.trust('<path d="M24.863 284.035C43.63 136.065 144.605 1.866 325.563-.012 434.783 2.102 524.642 51.615 578.147 145.95c26.882 49.217 35.232 100.974 36.98 158.069v67.123l-401.532-.012c1.866 165.593 243.712 159.947 347.803 86.977v134.86c-60.993 36.627-199.325 69.344-306.417 27.225C163.775 585.963 98.777 490.47 99.143 398.603c-2.988-119.092 59.222-197.955 155.837-242.838-20.492 25.359-36.095 53.363-44.22 101.871H437.45s13.252-135.498-128.317-135.498c-133.49 4.642-229.715 82.23-284.177 161.848l-.094.047z"/>'));
}
genAttrs(vnode) {
const overrides = Object.values(types_1.GeneralIconAttrName)
.reduce((acc, name) => {
if (!name) {
return acc;
}
if (vnode && vnode && vnode.attrs[name]) {
acc[name] = vnode.attrs[name];
return acc;
}
if (name in this.defaults) {
acc[name] = this.defaults[name];
}
return acc;
}, {});
const attrs = Object.assign({}, SVG_PROPS, overrides);
if (!("style" in attrs) || !attrs.style) {
attrs.style = {};
}
if (attrs.style && typeof attrs.style !== "object") {
throw new Error("attr.style must be an object for icons");
}
attrs.style["vertical-align"] = "middle";
attrs.style["min-width"] = "1.25em";
const additionalClasses = "maille maille-uxwing-icon edge-logo";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = EdgeLogo;