vue-circle-flags
Version:
A vue component with a collection of 400+ circular SVG country flags. Wrapper of HatScripts/circle-flags
51 lines (50 loc) • 1.66 kB
JavaScript
import { defineComponent as n, computed as o, openBlock as d, createElementBlock as c, createElementVNode as t, toDisplayString as a, createCommentVNode as f, normalizeStyle as _ } from "vue";
const h = ["viewBox"], m = /* @__PURE__ */ t("mask", { id: "addf2c5d-525d-4d37-89e0-1c9fde6b7f3d" }, [
/* @__PURE__ */ t("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), u = { mask: "url(#addf2c5d-525d-4d37-89e0-1c9fde6b7f3d)" }, k = { key: 0 }, v = /* @__PURE__ */ t("path", {
fill: "#a2001d",
d: "M0 0h512v189.2l-38.5 70 38.5 63.6V512H0V322.8l39.4-63L0 189.1z"
}, null, -1), p = /* @__PURE__ */ t("path", {
fill: "#eee",
d: "M0 189.2h512v133.6H0z"
}, null, -1), g = { fill: "none" }, x = ["r"], B = /* @__PURE__ */ n({
__name: "lv",
props: {
flagName: {},
strokeColor: { default: "#000" },
strokeWidth: { default: 0 }
},
setup(i) {
const e = i, l = o(() => 512 + 2 * e.strokeWidth), s = o(() => -e.strokeWidth), r = o(() => 256 + e.strokeWidth / 2);
return (w, y) => (d(), c("svg", {
xmlns: "http://www.w3.org/2000/svg",
class: "svg-circle-flags",
viewBox: `${s.value} ${s.value} ${l.value} ${l.value}`
}, [
m,
t("g", u, [
e.flagName ? (d(), c("title", k, a(e.flagName), 1)) : f("", !0),
v,
p
]),
t("g", g, [
t("circle", {
cx: "256",
cy: "256",
r: r.value,
fill: "none",
style: _({ stroke: e.strokeColor, strokeWidth: e.strokeWidth })
}, null, 12, x)
])
], 8, h));
}
});
export {
B as default
};
//# sourceMappingURL=lv-b1cce0ab.js.map