UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

132 lines (131 loc) 5.49 kB
import { useCssVars as h, computed as r, ref as f, createElementBlock as n, openBlock as u, unref as M, createCommentVNode as a, createElementVNode as t, normalizeStyle as l } from "vue"; import { u as m } from "./useNestedProp-ByBiJC9_.js"; import { u as y, X as L } from "./index-CHWA6Lnw.js"; import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const b = ["xmlns", "viewBox"], x = { key: 0 }, $ = ["stroke"], w = ["stroke"], A = ["stroke"], N = { key: 1 }, O = ["stroke"], S = { key: 2 }, F = ["stroke"], I = { __name: "vue-ui-mini-loader", props: { config: { type: Object, default() { return {}; } } }, setup(c) { h((_) => ({ "4430a3e6": v.value, "056a6732": C.value, "7f3540a4": g.value })); const { vue_ui_mini_loader: d } = y(), p = c, e = r(() => m({ userConfig: p.config, defaultConfig: d })), k = f({ onion: "-10 -10 84 84", line: "-10 -10 112 84", bar: "-10 -10 106 84" }), i = r(() => ({ gutter: `stroke:${e.value.line.gutterColor};opacity:${e.value.line.gutterOpacity};`, gutterBlur: `filter:blur(${e.value.line.gutterBlur}px);` })), s = r(() => ({ gutter: `stroke:${e.value.bar.gutterColor};opacity:${e.value.bar.gutterOpacity};`, gutterBlur: `filter:blur(${e.value.bar.gutterBlur}px);` })), o = r(() => ({ gutter: `stroke:${e.value.onion.gutterColor};opacity:${e.value.onion.gutterOpacity};`, gutterBlur: `filter:blur(${e.value.onion.gutterBlur}px);` })), v = r(() => `blur(${e.value.onion.trackBlur}px) hue-rotate(${e.value.onion.trackHueRotate}deg)`), C = r(() => `blur(${e.value.line.trackBlur}px) hue-rotate(${e.value.line.trackHueRotate}deg)`), g = r(() => `blur(${e.value.bar.trackBlur}px) hue-rotate(${e.value.bar.trackHueRotate}deg)`); return (_, E) => (u(), n("svg", { class: "vue-ui-mini-loader", xmlns: M(L), viewBox: k.value[e.value.type], style: { background: "transparent" }, width: "100%" }, [ e.value.type === "onion" ? (u(), n("g", x, [ t("path", { d: "M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3", "stroke-width": "4", fill: "none", "stroke-linecap": "round", style: l(o.value.gutter + o.value.gutterBlur) }, null, 4), t("path", { d: "M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13", "stroke-width": "4", fill: "none", "stroke-linecap": "round", style: l(o.value.gutter + o.value.gutterBlur) }, null, 4), t("path", { d: "M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25", "stroke-width": "4", fill: "none", "stroke-linecap": "round", style: l(o.value.gutter + o.value.gutterBlur) }, null, 4), t("path", { d: "M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3", stroke: e.value.onion.trackColor, "stroke-width": "4", fill: "none", "stroke-linecap": "round", class: "onion-animated" }, null, 8, $), t("path", { d: "M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13", stroke: e.value.onion.trackColor, "stroke-width": "4", fill: "none", "stroke-linecap": "round", class: "onion-animated" }, null, 8, w), t("path", { d: "M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25", stroke: e.value.onion.trackColor, "stroke-width": "4", fill: "none", "stroke-linecap": "round", class: "onion-animated" }, null, 8, A) ])) : a("", !0), e.value.type === "line" ? (u(), n("g", N, [ t("path", { d: "M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5", "stroke-width": "4", fill: "none", "stroke-linecap": "round", style: l(i.value.gutter + i.value.gutterBlur) }, null, 4), t("path", { d: "M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5", stroke: e.value.line.trackColor, "stroke-width": "4", fill: "none", "stroke-linecap": "round", class: "line-animated" }, null, 8, O) ])) : a("", !0), e.value.type === "bar" ? (u(), n("g", S, [ t("path", { d: "M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5", "stroke-width": "4", fill: "none", "stroke-linecap": "round", style: l(s.value.gutter + s.value.gutterBlur) }, null, 4), t("path", { d: "M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5", stroke: e.value.bar.trackColor, "stroke-width": "4", fill: "none", "stroke-linecap": "round", class: "bar-animated" }, null, 8, F) ])) : a("", !0) ], 8, b)); } }, U = /* @__PURE__ */ B(I, [["__scopeId", "data-v-3b670831"]]); export { U as default };