maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.47 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 ComputerDesktop {
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="M590.204 429.844l28.772 60.048c13.973 28.914 21.036 56.859 21.036 83.836v46.217H-.012v-46.217c0-26.693 7.063-54.639 21.177-83.836l28.772-60.048h540.266zm0-409.789V409.93H49.938V20.055h540.266zM90.06 308.649V121.324c0-27.532 3.319-44.682 10.098-51.461 6.78-6.78 24.213-10.099 52.3-10.099h335.225c28.087 0 45.52 3.32 52.3 10.099 6.78 6.78 10.099 23.93 10.099 51.461v187.325c0 27.26-3.46 44.28-10.382 51.06-6.91 6.78-24.213 10.098-52.017 10.098H152.458c-27.815 0-45.107-3.319-52.028-10.098-6.91-6.78-10.37-23.8-10.37-51.06z"/>'));
}
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-desktop";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = ComputerDesktop;