maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.45 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", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd", "viewBox": "0 0 640 640" };
class Briefcase {
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="M19.43 121.513h165.273V45.355c0-11.587 9.485-21.06 21.06-21.06h221.99c11.587 0 21.06 9.473 21.06 21.06v76.158h171.77c10.69 0 19.43 8.74 19.43 19.43v455.32c0 10.701-8.74 19.442-19.43 19.442H19.43c-10.69 0-19.441-8.74-19.441-19.442v-455.32c0-10.69 8.752-19.43 19.441-19.43zm207.403 0h179.85V84.249c0-11.587-9.473-21.06-21.06-21.06h-137.73c-11.587 0-21.06 9.473-21.06 21.06v37.264zm26.883 315.134h132.569v64.69h-132.57v-64.69zm70.772-99.544l213.014-166.16 82.49.094L323.482 401 40.713 170.021l82.217.094 201.558 166.986z"/>'));
}
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 briefcase";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Briefcase;