oeos-components 0.2.24 → 0.2.26

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.
@@ -1,50 +0,0 @@
1
- import { defineComponent as m, useAttrs as p, computed as l, resolveComponent as d, createElementBlock as T, openBlock as v, normalizeStyle as x, createVNode as D, unref as i, mergeProps as h } from "vue";
2
- import { p as f, _ as Y, w as y } from "./index-Bc1JbUHT.js";
3
- import M from "./index-CZE57h1w.js";
4
- const S = m({ name: "ODateRange" }), z = y(Y(m({ ...S, props: { title: { type: String, default: "" }, width: { type: [String, Number], default: "300px" } }, setup(u) {
5
- const r = p(), s = u, n = 864e5, w = l(() => o.value.type === "daterange" || o.value.type === "datetimerange" ? [{ text: "今天", value: () => {
6
- const e = new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime();
7
- return [new Date(e), new Date(e + n - 1)];
8
- } }, { text: "昨天", value: () => [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - n), new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 1)] }, { text: "最近7天", value: () => {
9
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
10
- return t.setTime(t.getTime() - 5184e5), [t, e];
11
- } }, { text: "本周", value: () => {
12
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date(), a = t.getDay() || 7;
13
- return t.setTime(t.getTime() - 864e5 * (a - 1)), [t, e];
14
- } }, { text: "上周", value: () => {
15
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date(), a = t.getDay() || 7;
16
- return console.log("63 nows", a), t.setTime(t.getTime() - 864e5 * (a - 1 + 7)), e.setTime(e.getTime() - 864e5 * a), [t, e];
17
- } }, { text: "本月", value: () => {
18
- (/* @__PURE__ */ new Date()).getTime(), (/* @__PURE__ */ new Date()).getDate();
19
- const e = /* @__PURE__ */ new Date();
20
- return [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).setDate(1)), e];
21
- } }, { text: "上月", value: () => {
22
- const e = /* @__PURE__ */ new Date(), t = new Date(e);
23
- return t.setMonth(e.getMonth()), e.setMonth(e.getMonth() - 1), t.setDate(0), e.setDate(1), [e, t];
24
- } }, { text: "最近30天", value: () => {
25
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
26
- return t.setTime(t.getTime() - 2592e6), [t, e];
27
- } }, { text: "最近90天", value: () => {
28
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
29
- return t.setTime(t.getTime() - 7776e6), [t, e];
30
- } }, { text: "最近1年", value: () => {
31
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
32
- return t.setTime(t.getTime() - 31536e6), [t, e];
33
- } }, { text: "一月以前30天", value: () => [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 60 * n), new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 30 * n)] }] : [{ text: "今天", value: /* @__PURE__ */ new Date() }, { text: "昨天", value: () => {
34
- const e = /* @__PURE__ */ new Date();
35
- return e.setTime(e.getTime() - 864e5), e;
36
- } }, { text: "一周前", value: () => {
37
- const e = /* @__PURE__ */ new Date();
38
- return e.setTime(e.getTime() - 6048e5), e;
39
- } }]), c = () => s.width ? { width: f(s.width, !0) } : {}, o = l(() => {
40
- const e = { "value-format": "YYYY-MM-DD HH:mm:ss", format: r.type !== "datetime" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss", type: "daterange", placeholder: "请选择日期", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "range-separator": "-", ...Object.entries(r).reduce((t, [a, g]) => (a !== "class" && a !== "style" && (t[a] = g), t), {}) };
41
- return console.log("66 merged", e), e;
42
- });
43
- return (e, t) => {
44
- const a = d("el-date-picker");
45
- return v(), T("span", { class: "o-date-range", style: x({ ...c() }) }, [D(i(M), { title: s.title, size: i(r).size, titleAttrs: e.$attrs.titleAttrs ?? {} }, null, 8, ["title", "size", "titleAttrs"]), D(a, h({ shortcuts: w.value }, o.value, { class: "o-date-range__picker" }), null, 16, ["shortcuts"])], 4);
46
- };
47
- } }), [["__scopeId", "data-v-f01c46a3"]]));
48
- export {
49
- z as default
50
- };
@@ -1,35 +0,0 @@
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-Bc1JbUHT.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
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as u, useSlots as m, ref as p, onMounted as d, h as v, resolveComponent as C, createBlock as g, openBlock as h, mergeProps as y, withModifiers as x, withCtx as b, renderSlot as P } from "vue";
2
- import { q as i, w as k } from "./index-Bc1JbUHT.js";
3
- const w = u({ name: "OText" }), $ = k(u({ ...w, props: { lineClamp: { type: [String, Number] }, tippyProps: { type: Object, default: () => ({}) } }, setup(a) {
4
- const s = a, o = m(), n = p(), l = p(), r = () => ({ content: v(o.content || o.default), ...s.tippyProps });
5
- function c(e) {
6
- var t;
7
- t = e.target, (s.lineClamp ? t.scrollHeight > t.clientHeight : t.scrollWidth > t.clientWidth) ? (l.value.setProps(r()), l.value.enable()) : l.value.disable();
8
- }
9
- return d(() => {
10
- var e;
11
- console.log("89 useTippy", i), l.value = i((e = n.value) == null ? void 0 : e.$el, r());
12
- }), (e, t) => {
13
- const f = C("el-text");
14
- return h(), g(f, y({ truncated: !a.lineClamp, lineClamp: a.lineClamp, ...e.$attrs }, { ref_key: "textRef", ref: n, onMouseover: x(c, ["self"]) }), { default: b(() => [P(e.$slots, "default")]), _: 3 }, 16);
15
- };
16
- } }));
17
- export {
18
- $ as default
19
- };