maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.4 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", "viewBox": "0 0 640 640", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" };
class BellCancel {
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="M409.694 550.566c-7.347 40.82-43.028 71.776-85.95 71.776-42.922 0-78.615-30.957-85.962-71.776h171.912zM364.847 53.765c49.784 10.04 93.261 37.985 123.403 76.749L115.43 346.552c1.134-27.898.307-57.367.307-88.714 0-101.009 72.934-185.813 168.746-204.369 5.516-47.918 75.19-47.681 80.363.296zm229.609 46.69l35.705 61.63L35.705 506.546 0 444.916l594.456-344.461zm-62.552 150.049c.083 2.433.142 4.89.142 7.334 0 118.466-11.244 207.546 107.954 286.881H24.166l507.739-294.216z"/>'));
}
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 bell-cancel";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = BellCancel;