maille
Version:
Component library for MithrilJS
55 lines (54 loc) • 2.69 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", "viewBox": "0 0 640 640", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" };
class Flag {
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="M123.379 92.41C366.264-75.496 384.406 256.823 622.944 49.336v338.591C395.437 592.507 346.362 261.972 123.379 429.95V92.41zM63.39 0c25.595 0 46.347 20.764 46.347 46.347 0 16.996-9.154 31.843-22.784 39.91h2.185V553.756h-2.185c13.63 8.066 22.784 18.614 22.784 39.909 0 21.284-20.752 46.335-46.347 46.335-25.595 0-46.347-25.051-46.347-46.335 0-21.295 9.154-31.843 22.784-39.91h-2.185V86.256h2.185c-13.63-8.066-22.784-22.913-22.784-39.909C17.043 20.764 37.795 0 63.39 0z"/>'));
}
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 flag";
attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses;
return attrs;
}
}
exports.default = Flag;