maille
Version:
Component library for MithrilJS
55 lines (54 loc) • 2.97 kB
JavaScript
;
// This file was built automatically via the convert-ux-wing-svg.js script (v0.0.1)
// This icon was obtained from UXWing.com
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const mithril_1 = __importDefault(require("mithril")); // +standalone
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 Camera {
constructor() {
this.defaults = {
height: "1em",
width: "1em",
fill: "black",
};
}
view(vnode) {
return mithril_1.default("svg", Object.assign({}, this.genAttrs(vnode)),
// tslint:disable-next-line
mithril_1.default.trust('<path d="M244.054 83.86h227.223l51.793 92.197h106.643c5.669 0 10.287 4.772 10.287 10.3v359.768c0 5.515-4.76 10.287-10.287 10.287H10.3c-5.528 0-10.3-4.63-10.3-10.287V186.357c0-5.67 4.63-10.3 10.3-10.3h47.953v-33.083h59.256v33.083h64.36c13.393-26.433 26.787-52.878 40.181-79.3 8.138-16.122 3.662-12.898 22.004-12.898zM573.302 221.6c16.96 0 30.72 13.76 30.72 30.721s-13.76 30.721-30.72 30.721-30.72-13.76-30.72-30.72c0-16.962 13.76-30.722 30.72-30.722zm-226.196 35.824c51.426 0 93.131 41.705 93.131 93.119s-41.705 93.12-93.131 93.12-93.131-41.706-93.131-93.12 41.705-93.12 93.131-93.12zm0-60.674c84.934 0 153.805 68.87 153.805 153.793 0 84.922-68.87 153.805-153.805 153.805-84.922 0-153.793-68.883-153.793-153.805 0-84.923 68.87-153.793 153.793-153.793z"/>'));
}
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 camera";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Camera;