maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.49 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 CarApproaching {
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="M614.299 270.039V588.893h-74.528V539.63H100.217v49.264H25.688V270.04H-.001v-49.028h62.683l34.96-108.745c10.3-32.02 27.52-61.158 61.159-61.158h335.366c33.638 0 53.044 28.535 61.158 61.158l27.036 108.745h57.627v49.028h-25.69zM208.373 441.254h220.148v51.91H208.373v-51.91zM50.647 320.343c56.103 1.76 90.415 25.276 99.237 74.245H50.647v-74.245zm531.644 0c-56.091 1.76-90.415 25.276-99.226 74.245h99.226v-74.245zM89.482 221.011h461.037l-19.76-91.182c-5.421-25.004-20.977-46.595-46.607-46.595H165.309c-25.618 0-38.764 22.181-46.595 46.595L89.48 221.01z"/>'));
}
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 car-approaching";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = CarApproaching;