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", "viewBox": "0 0 3190 3190", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" };
class CloseSquare {
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="M195 0h2800c54 0 102 22 138 57 35 35 57 84 57 138v2800c0 54-22 102-57 138-35 35-84 57-138 57H195c-54 0-102-22-138-57-35-35-57-84-57-138V195C0 141 22 93 57 57 92 22 141 0 195 0zm714 1003c0 24 9 48 27 66l523 523 2 2-2 2-523 523c-18 18-27 42-27 66s9 48 27 66 42 27 66 27 48-9 66-27l523-523 2-2 2 2 523 523c18 18 42 27 66 27s48-9 66-27 27-42 27-66-9-48-27-66l-523-523-2-2 2-2 523-523c18-18 27-42 27-66s-9-48-27-66-42-27-66-27-48 9-66 27l-523 523-2 2-2-2-523-523c-18-18-42-27-66-27s-48 9-66 27-27 42-27 66z" 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 close-square";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = CloseSquare;