maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.47 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 TrashCan {
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="M47.103 50.174H246.57V19.583C246.57 8.81 255.37 0 266.153 0h110.116c10.783 0 19.583 8.811 19.583 19.583v30.59h197.034c6.732 0 12.224 5.505 12.224 12.237v59.966H34.88V62.41c0-6.732 5.491-12.236 12.224-12.236zm33.036 104.02h483.963c10.086 0 19.252 8.328 18.342 18.355l-40.96 449.108c-.91 10.028-8.28 18.343-18.355 18.343H120.533c-10.075 0-17.457-8.291-18.355-18.343L61.784 172.55c-.898-10.063 8.256-18.354 18.355-18.354zm314.508 69.758h51.39v340.173h-51.39V223.952zm-203.14 0h51.39v340.173h-51.39V223.952zm101.564 0h51.402v340.173H293.07V223.952z"/>'));
}
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 trash-can";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = TrashCan;