dk-plus
Version:
47 lines (46 loc) • 1.73 kB
JavaScript
import { defineComponent as y, ref as k, openBlock as s, createElementBlock as l, normalizeClass as u, unref as e, normalizeStyle as r, createVNode as v, createElementVNode as a, toDisplayString as _, createCommentVNode as S } from "vue";
import { loadingProps as $ } from "./index3.js";
import { getStyleList as w } from "../../_hooks/public/get-StyleList/index.js";
import { IconRefresh as z } from "../../_icon/index.js";
const b = ["color"], C = ["color"], L = { class: "dk-loading_title" }, E = /* @__PURE__ */ y({
__name: "loading",
props: $,
setup(c) {
const t = c, i = k(), { classes: d, styles: p } = w(t, "loading"), g = d(["loading"], "dk-loading"), h = p(["background", "color", "textSize", "flexDirection"]), o = t.spinnerSize ? t.spinnerSize : "20px", m = t.spinner, f = `
<svg viewBox="0 0 1024 1024" width="${o}" height="${o}">
${m}
</svg>
`;
return i.value && (i.value.innerHTML = f), (n, B) => n.visible ? (s(), l("div", {
key: 0,
class: u(e(g)),
style: r(e(h))
}, [
n.spinner === "" ? (s(), l("div", {
key: 0,
color: n.color,
style: r([`width:${e(o)}; height:${e(o)};`]),
class: "dk-loading_animation"
}, [
v(e(z), {
width: e(o),
height: e(o)
}, null, 8, ["width", "height"])
], 12, b)) : (s(), l("div", {
key: 1,
style: r([`width:${e(o)}; height:${e(o)};`]),
color: n.color,
class: "dk-loading_animation"
}, [
a("span", {
ref_key: "nbSpinner",
ref: i
}, null, 512)
], 12, C)),
a("span", L, _(n.text), 1)
], 6)) : S("", !0);
}
});
export {
E as default
};