maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.66 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", "viewBox": "0 0 3294 3781", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" };
class PagePlus {
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="M970 2675c-54 0-97-44-97-98s44-98 97-98h631c54 0 97 44 97 98s-44 98-97 98H970zm0-1375c-54 0-97-43-97-97s43-97 97-97h1280c54 0 97 43 97 97s-43 97-97 97H970zm779 2286c54 0 97 43 97 97s-43 97-97 97H225c-62 0-119-25-159-66-41-41-66-97-66-159V226c0-62 25-119 66-159 41-41 97-66 159-66h2770c62 0 119 25 159 66 41 41 66 97 66 159v2008c0 54-43 97-97 97s-97-43-97-97V226c0-9-4-17-9-22-6-6-14-9-22-9H225c-9 0-17 4-22 9-6 6-9 14-9 22v3329c0 9 4 17 9 22 6 6 14 9 22 9h1524zm815-1011c0-53 43-97 97-97 53 0 97 43 97 97l-1 442 441 1c53 0 97 43 97 97 0 53-43 97-97 97l-442-1-1 441c0 53-43 97-97 97-53 0-97-43-97-97l1-442-441-1c-53 0-97-43-97-97 0-53 43-97 97-97l442 1 1-441zM970 1987c-54 0-97-43-97-97s43-97 97-97h1280c54 0 97 43 97 97s-43 97-97 97H970z" fill-rule="nonzero"/>'));
}
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 page-plus";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = PagePlus;