maille
Version:
Component library for MithrilJS
50 lines (49 loc) • 2.74 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 PadlockOpen {
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="M13.465 294.204h271.799v-82.442h.047c.012-48.792 19.937-93.12 52.016-125.222 32.103-32.103 76.454-52.04 125.27-52.04v-.047H462.678v.047c48.792.012 93.12 19.937 125.222 52.028 32.103 32.103 52.04 76.454 52.04 125.27h.06V307.467h-76.136v-96.663h.06c-.012-27.768-11.434-53.067-29.8-71.434-18.378-18.39-43.69-29.8-71.481-29.811v.047H462.56v-.047c-27.78.012-53.08 11.41-71.458 29.776l.024.023c-18.378 18.379-29.8 43.69-29.8 71.47h.048v83.375h72.85c7.407 0 13.466 6.059 13.466 13.465v284.437c0 7.405-6.06 13.452-13.465 13.452H13.465C6.048 605.558 0 599.511 0 592.106V307.669c0-7.406 6.048-13.465 13.465-13.465zm215.483 155.624l21.342 98.481-58.5.237 17.173-99.805c-15.98-5.114-27.579-20.09-27.579-37.772 0-21.886 17.764-39.65 39.662-39.65 21.886 0 39.65 17.764 39.65 39.65 0 19.182-13.642 35.186-31.748 38.859z"/>'));
}
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 padlock-open";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = PadlockOpen;