@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.
@@ -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
  /**
@@ -1,29 +1,29 @@
1
- import { defineComponent as B, inject as N, createBlock as p, openBlock as t, unref as a, ref as O, normalizeClass as D, withCtx as b, createElementVNode as n, createElementBlock as l, createCommentVNode as c, mergeProps as u, normalizeProps as x, guardReactiveProps as v, toDisplayString as m, Fragment as g, renderList as j, renderSlot as S, createVNode as V } from "vue";
2
- import { a as A } from "../utils/date.util.es.js";
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 T } from "../icon/index.es.js";
5
- import { _ as F } from "../username/index.es.js";
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 H = ["onClick"], L = { class: "flex justify-between items-center" }, z = {
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
- }, E = ["innerHTML", "onClick"], M = {
10
+ }, M = ["innerHTML", "onClick"], I = {
11
11
  key: 1,
12
12
  class: "flex flex-col gap-1",
13
13
  "data-wv-section": "itemdetail"
14
- }, I = {
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
- }, K = { class: "font-semibold whitespace-nowrap" }, R = {
17
+ }, R = { class: "font-semibold whitespace-nowrap" }, U = {
18
18
  key: 0,
19
19
  class: "text-xs"
20
- }, U = {
20
+ }, q = {
21
21
  key: 0,
22
22
  class: "grid grid-cols-[max-content,max-content,auto] gap-1 items-start"
23
- }, q = {
23
+ }, G = {
24
24
  key: 1,
25
25
  class: "grid grid-rows-[max-content,auto] gap-1"
26
- }, G = { class: "font-semibold whitespace-nowrap" }, te = /* @__PURE__ */ B({
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(J) {
35
- const i = N("preset", {}).timeline, C = (s) => {
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
- }, $ = (s) => s.replace(/`([^`]*)`/g, "<b>$1</b>");
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: O(s.value).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
- V(T, u((_ = a(i)) == null ? void 0 : _.markerArrow(e), { icon: "arrow-down" }), null, 16),
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, H)
52
+ ], 16, L)
53
53
  ];
54
54
  }),
55
55
  content: b(({ item: e }) => {
56
56
  var f, _, y;
57
57
  return [
58
- n("div", L, [
59
- n("div", z, [
58
+ n("div", z, [
59
+ n("div", E, [
60
60
  n("h3", u({
61
- innerHTML: $(e.action)
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, E),
65
- e.user || e.username ? (t(), p(F, {
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)), m(s.noFormatDate ? e.createdAt : a(A)(e.createdAt)), 17)
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", M, [
79
- s.$props.alignDetail ? (t(), l("div", I, [
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", K, m(r), 1),
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", R, m(o), 1)) : "type" in o ? (t(), p(h, {
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]) => S(s.$slots, "detail", u({
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", U, [
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", q, [
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", G, m(r) + ": ", 1),
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
- te as _
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
+ };
@@ -0,0 +1,7 @@
1
+ import "vue";
2
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
3
+ const e = () => {
4
+ };
5
+ export {
6
+ e as n
7
+ };