UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.44 kB
"use strict"; // 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 MedicalBriefcase { 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 157.136h165.273V80.978c0-11.587 9.485-21.06 21.071-21.06h221.968c11.586 0 21.059 9.473 21.059 21.06v76.158h171.77c10.689 0 19.43 8.764 19.43 19.43v384.063c0 10.678-8.765 19.442-19.43 19.442H19.43C8.764 580.07 0 571.33 0 560.629V176.565c0-10.689 8.74-19.429 19.43-19.429zm207.403 0H406.67V119.86c0-11.587-9.472-21.06-21.059-21.06H247.893c-11.587 0-21.06 9.473-21.06 21.06v37.276zm133.868 86.446v84.32h84.32v81.402h-84.32v84.32h-81.414v-84.32h-84.32v-81.402h84.32v-84.32h81.414z"/>')); } 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 medical-briefcase"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = MedicalBriefcase;