UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.42 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 Clock { 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="M319.988 0C496.73 0 640 143.281 640 320c0 176.731-143.269 320-320.012 320C143.269 640 0 496.731 0 320 0 143.281 143.269 0 319.988 0zm-44.386 158.931h39.118c7.158 0 13.028 5.87 13.028 13.04v150.746h137.576c7.17 0 13.04 5.87 13.04 13.039v39.119c0 7.169-5.87 13.04-13.04 13.04H262.562V171.97c0-7.169 5.858-13.04 13.04-13.04zm44.386-86.257c136.608 0 247.349 110.742 247.349 247.338 0 136.608-110.742 247.349-247.349 247.349-136.596 0-247.338-110.742-247.338-247.349 0-136.596 110.742-247.338 247.338-247.338z"/>')); } 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 clock"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = Clock;