oeos-components 0.2.21 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ import { defineComponent as n, resolveComponent as d, createBlock as l, openBlock as c, normalizeProps as m, guardReactiveProps as g, withCtx as a, renderSlot as r, createTextVNode as u, toDisplayString as h, createElementVNode as y, normalizeStyle as f, unref as o } from "vue";
2
+ import { p as i, n as S, _ as w, w as v } from "./index-Pgb7joEc.js";
3
+ const N = ["src"], _ = n({ name: "OEmpty" }), C = v(w(n({ ..._, props: { description: { type: String, default: "暂无数据" }, width: { type: [String, Number], default: 60 }, height: { type: [String, Number] }, imgAttrs: { type: Object, default: () => {
4
+ } }, src: { type: String, default: () => S } }, setup(s) {
5
+ const t = s;
6
+ return (e, $) => {
7
+ const p = d("el-empty");
8
+ return c(), l(p, m(g({ ...e.$attrs, ...t })), { image: a(() => [r(e.$slots, "image", {}, () => [y("img", { src: s.src, style: f({ width: o(i)(t.width, !0), height: o(i)(t.height, !0), ...t.imgAttrs }) }, null, 12, N)], !0)]), description: a(() => [r(e.$slots, "description", {}, () => [u(h(s.description), 1)], !0)]), default: a(() => [r(e.$slots, "default", {}, void 0, !0)]), _: 3 }, 16);
9
+ };
10
+ } }), [["__scopeId", "data-v-73fd1aa7"]]));
11
+ export {
12
+ C as default
13
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as l, getCurrentInstance as d, useAttrs as u, computed as i, createElementBlock as h, createCommentVNode as f, openBlock as g, mergeProps as v, toDisplayString as y } from "vue";
2
+ import { _ as A, w as _ } from "./index-Pgb7joEc.js";
3
+ const w = l({ name: "OCompTitle" }), k = _(A(l({ ...w, props: { title: { type: String, default: "" }, titleAttrs: { type: Object, default: () => ({}) } }, setup(o) {
4
+ const { proxy: r } = d(), s = u(), t = o, p = ["small", "large"], n = i(() => {
5
+ var e, a;
6
+ return (e = t.titleAttrs) != null && e.width ? { ...t.titleAttrs, width: r.processWidth((a = t.titleAttrs) == null ? void 0 : a.width, !0) } : t.titleAttrs;
7
+ }), c = i(() => s.size ? `el-input--${s.size}` : "o-comp-title__base-size"), m = i(() => ({ height: !p.includes(s.size) && "32px" }));
8
+ return (e, a) => t.title ? (g(), h("div", v({ key: 0, class: ["o-comp-title", c.value], style: { ...m.value, ...n.value } }, e.$attrs), y(t.title), 17)) : f("", !0);
9
+ } }), [["__scopeId", "data-v-47a44559"]]));
10
+ export {
11
+ k as default
12
+ };
@@ -0,0 +1,35 @@
1
+ import { defineComponent as v, ref as u, computed as y, onMounted as b, onUnmounted as x, resolveComponent as p, createElementBlock as N, openBlock as f, createVNode as k, createBlock as h, createCommentVNode as _, mergeProps as m, withCtx as $, createElementVNode as o, normalizeStyle as C, toDisplayString as S, renderSlot as z } from "vue";
2
+ import { r as B, s as E, _ as q, w as V } from "./index-Pgb7joEc.js";
3
+ const j = { class: "f-st-ct w-100%" }, A = { class: "percentage-value" }, L = { class: "" }, O = v({ name: "OCapacityProgress" }), D = V(q(v({ ...O, props: { total: { type: [String, Number], required: !0 }, used: { type: [String, Number], required: !0 }, iconAttrs: { type: Object, default: () => {
4
+ } } }, setup(l) {
5
+ const t = u(null), i = u(null), c = l;
6
+ function d() {
7
+ return `${s.value}%`;
8
+ }
9
+ const s = y(() => {
10
+ let e = 100 * Number((c.used || 0) / (c.total || 0)) || 0;
11
+ return isNaN(e) ? 0 : Number(e.toFixed(2));
12
+ });
13
+ function g(e) {
14
+ return B(e < 90 ? "--blue" : "--red");
15
+ }
16
+ const a = async () => {
17
+ var e, n;
18
+ if (await E(), t.value && ((n = (e = t.value) == null ? void 0 : e.$el) == null ? void 0 : n.offsetWidth)) {
19
+ let r = t.value.$el.offsetWidth - 16 + "px";
20
+ return i.value.style.width = r, { width: r };
21
+ }
22
+ return { width: "200px" };
23
+ };
24
+ return b(() => {
25
+ window.addEventListener("resize", a);
26
+ }), x(() => {
27
+ window.removeEventListener("resize", a);
28
+ }), (e, n) => {
29
+ const r = p("o-progress"), w = p("o-icon");
30
+ return f(), N("div", j, [k(r, m({ ref_key: "progressBoxRef", ref: t, class: "progress-box", percentage: s.value, type: "line", "stroke-width": 20, "text-inside": "", format: d, color: g }, e.$attrs), { default: $(({ percentage: P }) => [o("div", { ref_key: "percentageRef", ref: i, class: "f-bt-ct", style: C({ ...a() }) }, [o("div", A, S(d()), 1), o("div", L, [z(e.$slots, "default", {}, void 0, !0)])], 4)]), _: 3 }, 16, ["percentage"]), s.value > 100 ? (f(), h(w, m({ key: 0, name: "warning", content: "已用容量远超总容量, 请扩容 ", class: "ml" }, l.iconAttrs), null, 16)) : _("", !0)]);
31
+ };
32
+ } }), [["__scopeId", "data-v-56fcbcdd"]]));
33
+ export {
34
+ D as default
35
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as S, useCssVars as _, ref as v, useAttrs as F, computed as h, watch as $, onMounted as E, onBeforeUnmount as O, resolveComponent as T, createElementBlock as D, openBlock as l, createBlock as i, resolveDynamicComponent as j, mergeProps as d, createSlots as N, withCtx as n, createElementVNode as k, normalizeClass as L, renderSlot as m, toDisplayString as u, createCommentVNode as w, createTextVNode as x } from "vue";
2
+ import { m as M, _ as z, w as I } from "./index-Pgb7joEc.js";
3
+ const P = { class: "o-dialog" }, U = S({ name: "ODialog" }), H = I(z(S({ ...U, props: { type: { type: String, default: "" }, title: { type: String, default: "提示" }, theme: { type: String, default: "" }, cancel: { type: [Function, String], default: "" }, cancelText: { type: String, default: "取消" }, confirmText: { type: String, default: "确认" }, showFooter: { type: Boolean, default: !0 }, showCancel: { type: Boolean, default: !0 }, showConfirm: { type: Boolean, default: !0 }, confirmAttrs: { type: Object, default: () => ({}) }, cancelAttrs: { type: Object, default: () => ({}) }, enableConfirm: { type: Boolean, default: !0 }, confirm: { type: Function } }, emits: ["update:modelValue"], setup(t, { emit: b }) {
4
+ _((o) => ({ "9b0d9700": s.value }));
5
+ const a = F(), f = b, e = t, B = h(() => e.theme === "norm" ? "kd-norm-dialog" : e.theme === "norm16" ? "kd-norm16-dialog" : e.theme === "simple" ? "kd-simple-dialog" : ""), s = v("calc(100vh - 124px)");
6
+ $(() => e.showFooter, (o) => {
7
+ a.fullscreen !== !0 && a.fullscreen !== "" || (e.showFooter === !1 ? s.value = "calc(100vh - 74px)" : s.value = "calc(100vh - 124px)");
8
+ }, { immediate: !0 });
9
+ const r = v(!1);
10
+ async function p() {
11
+ e.confirm && M(e.confirm) === "function" ? (r.value = !0, await e.confirm().finally(() => {
12
+ r.value = !1;
13
+ })) : a.onConfirm ? a.onConfirm() : y();
14
+ }
15
+ function A() {
16
+ a.onCancel ? a.onCancel() : f("update:modelValue", !1);
17
+ }
18
+ function y() {
19
+ f("update:modelValue", !1);
20
+ }
21
+ function C({ code: o }) {
22
+ var c;
23
+ a.modelValue === !0 && o === "Enter" && e.enableConfirm && ((c = e.confirmAttrs) == null ? void 0 : c.loading) !== !0 && p();
24
+ }
25
+ const V = h(() => e.type === "" ? "el-dialog" : e.type === "drawer" ? "el-drawer" : void 0);
26
+ return E(() => {
27
+ document.addEventListener("keypress", C);
28
+ }), O(() => {
29
+ document.removeEventListener("keypress", C);
30
+ }), (o, c) => {
31
+ const g = T("el-button");
32
+ return l(), D("div", P, [(l(), i(j(V.value), d({ "custom-class": B.value }, { width: "640px", closeOnClickModal: !0, destroyOnClose: !0, draggable: !0, ...o.$attrs }, { onClose: y }), N({ header: n(() => [m(o.$slots, "header", {}, () => [k("span", null, u(t.title), 1)], !0)]), default: n(() => [k("div", { class: L(o.$attrs.fullscreen === !0 || o.$attrs.fullscreen === "" ? "dialog_fullscreen " : "dialog_slot_box") }, [m(o.$slots, "default", {}, void 0, !0)], 2)]), _: 2 }, [t.showFooter ? { name: "footer", fn: n(() => [m(o.$slots, "footer", {}, () => [t.showCancel ? (l(), i(g, d({ key: 0, type: t.cancelAttrs.type || "" }, t.cancelAttrs, { onClick: A }), { default: n(() => [x(u(t.cancelText), 1)]), _: 1 }, 16, ["type"])) : w("", !0), t.showConfirm ? (l(), i(g, d({ key: 1, loading: r.value, id: "kdDialogConfirmBtn", type: t.confirmAttrs.type || "primary" }, t.confirmAttrs, { onClick: p }), { default: n(() => [x(u(t.confirmText), 1)]), _: 1 }, 16, ["loading", "type"])) : w("", !0)], !0)]), key: "0" } : void 0]), 1040, ["custom-class"]))]);
33
+ };
34
+ } }), [["__scopeId", "data-v-9272cec5"]]));
35
+ export {
36
+ H as default
37
+ };