maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.41 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 Binoculars {
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="M85.49 22.205h117.19v85.867h37.44l9.06 177.345h37.5v-57.85c18.461-14.068 40.666-14.068 66.639 0v57.85h37.5l9.06-177.345h37.44V22.205h117.19v85.867h37.442l46.23 452.781c2.054 20.091 6.023 21.886-12.544 30.875-78.403 38.008-156.817 31.7-235.22-1.217-18.318-7.689-14.704-9.07-13.712-28.654l6.106-119.505H257.188l6.106 119.505c.992 19.583 4.606 20.965-13.713 28.654-78.402 32.918-156.817 39.225-235.219 1.217-18.567-8.989-14.598-10.784-12.543-30.875l46.229-452.78h37.441V22.204z"/>'));
}
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 binoculars";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Binoculars;