maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.88 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 Gamepad {
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="M121.62 487.955c21.036-21.39 45.922-43.146 64.442-71.233h267.877c18.531 28.087 43.418 49.843 64.453 71.233 161.222 164.152 150.344-220.396 36.438-335.933h-8.776c-14.315-23.93-42.272-40.146-74.41-40.146-32.115 0-60.072 16.216-74.399 40.146H242.767c-14.327-23.93-42.296-40.146-74.422-40.146-32.138 0-60.072 16.216-74.41 40.146H85.17C-28.724 267.559-39.602 652.107 121.62 487.955zm33.874-309.205h57.875v46.075h46.087v57.887H213.37v46.099h-57.875v-46.1h-46.11v-57.886h46.11V178.75zm277.633 125.317c14.008 0 25.37 11.35 25.37 25.359 0 14.031-11.362 25.394-25.37 25.394-14.008 0-25.37-11.363-25.37-25.394 0-14.008 11.362-25.359 25.37-25.359zm13.867-112.962c20.303 0 36.768 16.441 36.768 36.745 0 20.291-16.465 36.732-36.768 36.732-20.292 0-36.733-16.44-36.733-36.732 0-20.304 16.441-36.745 36.733-36.745zm94.89 56.776c14.009 0 25.36 11.363 25.36 25.37 0 14.009-11.351 25.36-25.36 25.36-14.02 0-25.393-11.351-25.393-25.36 0-14.007 11.374-25.37 25.394-25.37z"/>'));
}
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 gamepad";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Gamepad;