maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.43 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 Book {
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="M140.647 0h430.86c9.473 0 17.22 7.76 17.22 17.233V498.09c-.755 13.429-18.106 13.736-36.85 12.933H134.305c-25.926 0-47.127 21.213-47.127 47.126 0 25.926 21.213 47.127 47.127 47.127h417.572v-50.138h36.85v63.744c0 11.623-9.495 21.119-21.118 21.119H136.09c-46.655 0-84.828-38.174-84.828-84.828V89.399C51.26 40.23 91.478 0 140.647 0zm16.607 69.78h14.905c7.607 0 13.831 5.032 13.831 11.197v351.418c0 6.166-6.224 11.197-13.83 11.197h-14.906c-7.607 0-13.831-5.031-13.831-11.197V80.977c0-6.165 6.224-11.197 13.83-11.197z"/>'));
}
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 book";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Book;