@fewangsit/wangsvue-fats 1.0.1-alpha.34 → 1.0.1-alpha.36
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.
- package/image/index.d.ts +11 -6
- package/image/index.es.js +104 -92
- package/package.json +1 -1
- package/stats.html +1 -1
- package/timeline/index.d.ts +5 -0
- package/timeline/index.es.js +38 -32
- package/vendor/@vueuse/core/index.es.js +41 -0
- package/vendor/@vueuse/shared/index.es.js +7 -0
- package/wangsvue-fats.esm.browser.js +2886 -2830
- package/wangsvue-fats.system.js +55 -55
package/timeline/index.d.ts
CHANGED
|
@@ -119,6 +119,11 @@ export type TimelineSlots = {
|
|
|
119
119
|
key: string;
|
|
120
120
|
value: SlotDetailType; // Type DetailAnyRecord only used when using slot since you can use your own object structure
|
|
121
121
|
}): VNode[];
|
|
122
|
+
/**
|
|
123
|
+
* Custom date template.
|
|
124
|
+
*
|
|
125
|
+
*/
|
|
126
|
+
date(slotProps: { date: string }): VNode[];
|
|
122
127
|
};
|
|
123
128
|
|
|
124
129
|
/**
|
package/timeline/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
1
|
+
import { defineComponent as N, inject as V, createBlock as p, openBlock as t, unref as a, ref as A, normalizeClass as D, withCtx as b, createElementVNode as n, createElementBlock as l, createCommentVNode as c, mergeProps as u, normalizeProps as x, guardReactiveProps as v, renderSlot as $, createTextVNode as O, toDisplayString as m, Fragment as g, renderList as j, createVNode as S } from "vue";
|
|
2
|
+
import { a as T } from "../utils/date.util.es.js";
|
|
3
3
|
import { s as P } from "../vendor/primevue/timeline/timeline.esm.es.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
4
|
+
import { _ as F } from "../icon/index.es.js";
|
|
5
|
+
import { _ as H } from "../username/index.es.js";
|
|
6
6
|
import { _ as h } from "../timelinecontentbytype/index.es.js";
|
|
7
|
-
const
|
|
7
|
+
const L = ["onClick"], z = { class: "flex justify-between items-center" }, E = {
|
|
8
8
|
class: "flex gap-1 py-0.5",
|
|
9
9
|
"data-wv-section": "itemheader"
|
|
10
|
-
},
|
|
10
|
+
}, M = ["innerHTML", "onClick"], I = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "flex flex-col gap-1",
|
|
13
13
|
"data-wv-section": "itemdetail"
|
|
14
|
-
},
|
|
14
|
+
}, K = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "grid grid-cols-[max-content,max-content,auto] gap-2 py-1.5 items-start"
|
|
17
|
-
},
|
|
17
|
+
}, R = { class: "font-semibold whitespace-nowrap" }, U = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "text-xs"
|
|
20
|
-
},
|
|
20
|
+
}, q = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "grid grid-cols-[max-content,max-content,auto] gap-1 items-start"
|
|
23
|
-
},
|
|
23
|
+
}, G = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "grid grid-rows-[max-content,auto] gap-1"
|
|
26
|
-
},
|
|
26
|
+
}, J = { class: "font-semibold whitespace-nowrap" }, oe = /* @__PURE__ */ N({
|
|
27
27
|
__name: "Timeline",
|
|
28
28
|
props: {
|
|
29
29
|
value: {},
|
|
@@ -31,14 +31,14 @@ const H = ["onClick"], L = { class: "flex justify-between items-center" }, z = {
|
|
|
31
31
|
noScroll: { type: Boolean },
|
|
32
32
|
noFormatDate: { type: Boolean }
|
|
33
33
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const i =
|
|
34
|
+
setup(Q) {
|
|
35
|
+
const i = V("preset", {}).timeline, C = (s) => {
|
|
36
36
|
const d = s.user ?? s.username;
|
|
37
37
|
return typeof d != "string" ? d : { nickName: d };
|
|
38
|
-
},
|
|
38
|
+
}, B = (s) => s.replace(/`([^`]*)`/g, "<b>$1</b>");
|
|
39
39
|
return (s, d) => (t(), p(a(P), {
|
|
40
40
|
class: D([{ "overflow-auto": !s.noScroll }]),
|
|
41
|
-
value:
|
|
41
|
+
value: A(s.value).value,
|
|
42
42
|
style: { "scrollbar-width": "none" }
|
|
43
43
|
}, {
|
|
44
44
|
marker: b(({ item: e }) => {
|
|
@@ -47,61 +47,67 @@ const H = ["onClick"], L = { class: "flex justify-between items-center" }, z = {
|
|
|
47
47
|
n("div", u({
|
|
48
48
|
onClick: (r) => e.showDetail = !e.showDetail
|
|
49
49
|
}, (f = a(i)) == null ? void 0 : f.marker, { "data-wv-section": "timelinemarker" }), [
|
|
50
|
-
|
|
50
|
+
S(F, u((_ = a(i)) == null ? void 0 : _.markerArrow(e), { icon: "arrow-down" }), null, 16),
|
|
51
51
|
n("div", x(v((y = a(i)) == null ? void 0 : y.markerDot(e))), null, 16)
|
|
52
|
-
], 16,
|
|
52
|
+
], 16, L)
|
|
53
53
|
];
|
|
54
54
|
}),
|
|
55
55
|
content: b(({ item: e }) => {
|
|
56
56
|
var f, _, y;
|
|
57
57
|
return [
|
|
58
|
-
n("div",
|
|
59
|
-
n("div",
|
|
58
|
+
n("div", z, [
|
|
59
|
+
n("div", E, [
|
|
60
60
|
n("h3", u({
|
|
61
|
-
innerHTML:
|
|
61
|
+
innerHTML: B(e.action)
|
|
62
62
|
}, (f = a(i)) == null ? void 0 : f.contentHeader, {
|
|
63
63
|
onClick: (r) => e.showDetail = !e.showDetail
|
|
64
|
-
}), null, 16,
|
|
65
|
-
e.user || e.username ? (t(), p(
|
|
64
|
+
}), null, 16, M),
|
|
65
|
+
e.user || e.username ? (t(), p(H, {
|
|
66
66
|
key: 0,
|
|
67
67
|
user: C(e),
|
|
68
68
|
type: "icon",
|
|
69
69
|
"user-name-field": "nickName"
|
|
70
70
|
}, null, 8, ["user"])) : c("", !0)
|
|
71
71
|
]),
|
|
72
|
-
n("span", x(v((_ = a(i)) == null ? void 0 : _.contentDate)),
|
|
72
|
+
n("span", x(v((_ = a(i)) == null ? void 0 : _.contentDate)), [
|
|
73
|
+
$(s.$slots, "date", {
|
|
74
|
+
date: e.createdAt
|
|
75
|
+
}, () => [
|
|
76
|
+
O(m(s.noFormatDate ? e.createdAt : a(T)(e.createdAt)), 1)
|
|
77
|
+
])
|
|
78
|
+
], 16)
|
|
73
79
|
]),
|
|
74
80
|
e.showDetail && e.detail ? (t(), l(g, { key: 0 }, [
|
|
75
81
|
"type" in e.detail ? (t(), p(h, {
|
|
76
82
|
key: 0,
|
|
77
83
|
detail: e.detail
|
|
78
|
-
}, null, 8, ["detail"])) : (y = Object.keys(e.detail ?? {})) != null && y.length ? (t(), l("div",
|
|
79
|
-
s.$props.alignDetail ? (t(), l("div",
|
|
84
|
+
}, null, 8, ["detail"])) : (y = Object.keys(e.detail ?? {})) != null && y.length ? (t(), l("div", I, [
|
|
85
|
+
s.$props.alignDetail ? (t(), l("div", K, [
|
|
80
86
|
(t(!0), l(g, null, j(Object.entries(e.detail), ([r, o]) => (t(), l(g, { key: r }, [
|
|
81
|
-
n("span",
|
|
87
|
+
n("span", R, m(r), 1),
|
|
82
88
|
d[0] || (d[0] = n("span", { class: "font-semibold whitespace-nowrap" }, " : ", -1)),
|
|
83
|
-
typeof o == "string" ? (t(), l("span",
|
|
89
|
+
typeof o == "string" ? (t(), l("span", U, m(o), 1)) : "type" in o ? (t(), p(h, {
|
|
84
90
|
key: 1,
|
|
85
91
|
detail: o
|
|
86
92
|
}, null, 8, ["detail"])) : c("", !0)
|
|
87
93
|
], 64))), 128))
|
|
88
|
-
])) : (t(!0), l(g, { key: 1 }, j(Object.entries(e.detail), ([r, o]) =>
|
|
94
|
+
])) : (t(!0), l(g, { key: 1 }, j(Object.entries(e.detail), ([r, o]) => $(s.$slots, "detail", u({
|
|
89
95
|
key: r,
|
|
90
96
|
ref_for: !0
|
|
91
97
|
}, { key: r, value: o }), () => {
|
|
92
98
|
var k, w;
|
|
93
99
|
return [
|
|
94
|
-
typeof o == "string" ? (t(), l("div",
|
|
100
|
+
typeof o == "string" ? (t(), l("div", q, [
|
|
95
101
|
n("span", u({ ref_for: !0 }, (k = a(i)) == null ? void 0 : k.contentDetailKey), m(r) + ": ", 17),
|
|
96
102
|
n("span", u({ ref_for: !0 }, (w = a(i)) == null ? void 0 : w.contentDetailValue), m(o), 17)
|
|
97
|
-
])) : "type" in o ? (t(), l("div",
|
|
103
|
+
])) : "type" in o ? (t(), l("div", G, [
|
|
98
104
|
n("span", {
|
|
99
105
|
class: D([
|
|
100
106
|
"flex gap-1",
|
|
101
107
|
{ "flex-col": o.type === "embed" }
|
|
102
108
|
])
|
|
103
109
|
}, [
|
|
104
|
-
n("span",
|
|
110
|
+
n("span", J, m(r) + ": ", 1),
|
|
105
111
|
o.type !== "json" ? (t(), p(h, {
|
|
106
112
|
key: 0,
|
|
107
113
|
detail: o
|
|
@@ -123,5 +129,5 @@ const H = ["onClick"], L = { class: "flex justify-between items-center" }, z = {
|
|
|
123
129
|
}
|
|
124
130
|
});
|
|
125
131
|
export {
|
|
126
|
-
|
|
132
|
+
oe as _
|
|
127
133
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { n as g } from "../shared/index.es.js";
|
|
2
|
+
import { isRef as w, shallowRef as c, ref as A, watchEffect as E, computed as x } from "vue";
|
|
3
|
+
function F(v, n, s) {
|
|
4
|
+
let r;
|
|
5
|
+
w(s) ? r = {
|
|
6
|
+
evaluating: s
|
|
7
|
+
} : r = {};
|
|
8
|
+
const {
|
|
9
|
+
lazy: u = !1,
|
|
10
|
+
flush: h = "pre",
|
|
11
|
+
evaluating: e = void 0,
|
|
12
|
+
shallow: m = !0,
|
|
13
|
+
onError: p = g
|
|
14
|
+
} = r, o = c(!u), l = m ? c(n) : A(n);
|
|
15
|
+
let t = 0;
|
|
16
|
+
return E(async (d) => {
|
|
17
|
+
if (!o.value)
|
|
18
|
+
return;
|
|
19
|
+
t++;
|
|
20
|
+
const f = t;
|
|
21
|
+
let i = !1;
|
|
22
|
+
e && Promise.resolve().then(() => {
|
|
23
|
+
e.value = !0;
|
|
24
|
+
});
|
|
25
|
+
try {
|
|
26
|
+
const a = await v((y) => {
|
|
27
|
+
d(() => {
|
|
28
|
+
e && (e.value = !1), i || y();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
f === t && (l.value = a);
|
|
32
|
+
} catch (a) {
|
|
33
|
+
p(a);
|
|
34
|
+
} finally {
|
|
35
|
+
e && f === t && (e.value = !1), i = !0;
|
|
36
|
+
}
|
|
37
|
+
}, { flush: h }), u ? x(() => (o.value = !0, l.value)) : l;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
F as c
|
|
41
|
+
};
|