maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.44 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 3545 3545", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" };
class ChainLinksOutline {
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="M1082 1549c36-36 94-36 130 0s36 94 0 130L191 2700l654 654 1023-1023c36-36 94-36 130 0s36 94 0 130L964 3495c-33 33-76 49-118 49-40 0-80-14-111-43-3-2-5-4-7-7L51 2817c-33-33-49-76-49-119s16-86 49-119l1033-1033zm1143-359c36-36 94-36 130 0s36 94 0 130l-906 906c-36 36-94 36-130 0s-36-94 0-130l906-906zm244 800c-36 36-94 36-130 0s-36-94 0-130L3354 845l-654-654-1013 1013c-36 36-94 36-130 0s-36-94 0-130L2581 49c33-33 76-49 119-49s86 16 119 49l677 677c33 33 49 76 49 118 0 43-16 86-49 119L2470 1989z" 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 chain-links-outline";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = ChainLinksOutline;