maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.58 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 ComputerMonitor {
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="M17.386 54.615h605.228C632.181 54.615 640 62.445 640 72v400.954c0 9.567-7.819 17.386-17.386 17.386H17.386C7.831 490.34 0 482.52 0 472.955V72c0-9.555 7.83-17.386 17.386-17.386zm223.715 459.762H398.91c.425 27.319 11.646 51.745 42.13 71.009H198.97c24.367-17.705 42.225-39.178 42.13-71.01zM320 431.734c12.33 0 22.346 10.004 22.346 22.347 0 12.33-10.016 22.335-22.346 22.335-12.331 0-22.347-10.004-22.347-22.335 0-12.343 10.016-22.347 22.347-22.347zM52.323 87.38h535.353c8.468 0 15.39 6.921 15.39 15.378V402.36c0 8.457-6.934 15.378-15.39 15.378H52.323c-8.457 0-15.379-6.921-15.379-15.378V102.757c0-8.468 6.922-15.378 15.379-15.378z"/>'));
}
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 computer-monitor";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = ComputerMonitor;