UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 4.11 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 ShoppingBag { 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 fill-rule="nonzero" d="M161.931 257.838v-24.709a35.042 35.042 0 0 0-5.93 19.547c0 19.43 15.757 35.198 35.198 35.198 19.441 0 35.197-15.768 35.197-35.198 0-13.535-7.641-25.275-18.85-31.17v36.332c0 4.43-3.59 8.032-8.02 8.032h-29.575c-4.43 0-8.02-3.603-8.02-8.032zm0-91.383V153.049c0-.425.024-.838.094-1.252.06-8.02.756-15.862 2.008-23.48.85-5.22 1.996-10.406 3.414-15.532a152.919 152.919 0 0 1 4.937-14.953c7.783-19.973 19.677-37.95 34.618-52.89 2.788-2.788 5.823-5.575 9.071-8.35a156.285 156.285 0 0 1 12.65-9.71c4.3-2.952 8.847-5.74 13.607-8.326A151.808 151.808 0 0 1 313.67.095c.4-.071.826-.095 1.251-.095h.19c.436 0 .85.036 1.263.095 8.02.07 15.862.756 23.48 2.008 5.21.85 10.406 1.996 15.532 3.413a150.302 150.302 0 0 1 14.93 4.937l.023.012v-.012c19.973 7.784 37.961 19.678 52.89 34.619a154.168 154.168 0 0 1 8.351 9.07c3.532 4.158 6.78 8.375 9.709 12.65a151.85 151.85 0 0 1 8.327 13.607 151.818 151.818 0 0 1 18.46 71.351c.071.402.107.815.107 1.24v13.465h69.568c4.677 0 8.126 3.85 8.48 8.48l35.74 456.584c.355 4.619-3.862 8.48-8.492 8.48H66.52c-4.63 0-8.858-3.814-8.492-8.48l35.74-456.584c.367-4.665 3.804-8.48 8.481-8.48h59.682zm306.252 63.213v28.17c0 4.43-3.602 8.032-8.032 8.032h-29.563a8.032 8.032 0 0 1-8.032-8.032v-34.796c-9.744 6.26-16.193 17.186-16.193 29.634 0 19.43 15.756 35.198 35.186 35.198 19.441 0 35.197-15.768 35.197-35.198 0-8.799-3.236-16.842-8.563-23.008zm-45.627-63.213V152.99c0-.401.024-.78.083-1.157a106.004 106.004 0 0 0-.756-11.304l-.023-.212a107.289 107.289 0 0 0-1.914-11.079 106.515 106.515 0 0 0-3.106-10.878v-.012l-.024.012c-5.397-15.626-14.327-29.682-25.83-41.198a4.15 4.15 0 0 1-.39-.401 108.512 108.512 0 0 0-26.245-19.146c-5.008-2.61-10.158-4.819-15.39-6.567a108.467 108.467 0 0 0-7.949-2.315 107.033 107.033 0 0 0-24.732-3.2c-.378.058-.768.082-1.17.082h-.201c-.401 0-.78-.024-1.157-.083-3.697.047-7.465.307-11.28.756l-.224.024c-3.78.449-7.477 1.098-11.079 1.925-3.614.827-7.24 1.878-10.866 3.13-.213.07-.426.13-.638.189-15.378 5.41-29.22 14.268-40.595 25.642a108.464 108.464 0 0 0-19.524 26.622 107.397 107.397 0 0 0-6.567 15.39 108.467 108.467 0 0 0-2.315 7.95 106.849 106.849 0 0 0-3.2 24.72c.058.39.082.78.082 1.17v13.405h215.01z"/>')); } 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 shopping-bag"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = ShoppingBag;