ant-design-x-vue 1.2.7 → 1.2.9

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.
Files changed (42) hide show
  1. package/dist/index.esm.js +8533 -8065
  2. package/dist/index.esm.min.js +6 -0
  3. package/dist/index.umd.js +66 -66
  4. package/es/_util/cssinjs/StyleContext.mjs +48 -42
  5. package/es/bubble/Bubble.mjs +40 -38
  6. package/es/bubble/BubbleList.mjs +123 -87
  7. package/es/bubble/style/list.mjs +18 -5
  8. package/es/index.mjs +79 -45
  9. package/es/sender/Sender.mjs +82 -78
  10. package/es/sender/components/ActionButton/index.mjs +15 -12
  11. package/es/sender/components/ClearButton.mjs +15 -12
  12. package/es/sender/components/LoadingButton.mjs +16 -13
  13. package/es/sender/components/SendButton.mjs +17 -14
  14. package/es/sender/components/SpeechButton/RecordingIcon.mjs +21 -18
  15. package/es/sender/components/SpeechButton/index.mjs +31 -25
  16. package/es/suggestion/Suggestion.mjs +153 -48
  17. package/es/welcome/Welcome.mjs +44 -36
  18. package/lib/_util/cssinjs/StyleContext.js +1 -1
  19. package/lib/bubble/Bubble.js +1 -1
  20. package/lib/bubble/BubbleList.js +1 -1
  21. package/lib/bubble/style/list.js +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/sender/Sender.js +1 -1
  24. package/lib/sender/components/ActionButton/index.js +1 -1
  25. package/lib/sender/components/ClearButton.js +1 -1
  26. package/lib/sender/components/LoadingButton.js +1 -1
  27. package/lib/sender/components/SendButton.js +1 -1
  28. package/lib/sender/components/SpeechButton/RecordingIcon.js +1 -1
  29. package/lib/sender/components/SpeechButton/index.js +1 -1
  30. package/lib/suggestion/Suggestion.js +1 -1
  31. package/lib/welcome/Welcome.js +1 -1
  32. package/package.json +3 -2
  33. package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
  34. package/typings/_util/cssinjs/index.d.ts +3 -3
  35. package/typings/bubble/BubbleList.vue.d.ts +47 -1
  36. package/typings/bubble/hooks/useTypingConfig.d.ts +1 -1
  37. package/typings/bubble/index.d.ts +65 -3
  38. package/typings/bubble/interface.d.ts +2 -2
  39. package/typings/index.d.ts +1 -0
  40. package/typings/sender/interface.d.ts +6 -0
  41. package/typings/sender/useSpeech.d.ts +5 -1
  42. package/typings/welcome/interface.d.ts +4 -4
@@ -1,7 +1,8 @@
1
- import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, watch as x, unref as d, provide as b } from "vue";
2
- import P from "./Cache.mjs";
3
- import { withInstall as v, arrayType as u, booleanType as l, someType as I, stringType as f, objectType as E } from "../type.mjs";
4
- const J = "data-token-hash", h = "data-css-hash", V = "data-cache-path", i = "__cssinjs_instance__";
1
+ import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, h as P, watch as v, unref as d, provide as x } from "vue";
2
+ import b from "./Cache.mjs";
3
+ import { withInstall as I, arrayType as u, booleanType as l, someType as E, stringType as f, objectType as N } from "../type.mjs";
4
+ import { StyleProvider as j } from "ant-design-vue";
5
+ const q = "data-token-hash", h = "data-css-hash", D = "data-cache-path", i = "__cssinjs_instance__";
5
6
  function s() {
6
7
  const e = Math.random().toString(12).slice(2);
7
8
  if (typeof document < "u" && document.head && document.body) {
@@ -11,22 +12,22 @@ function s() {
11
12
  Array.from(o).forEach((t) => {
12
13
  t[i] = t[i] || e, t[i] === e && document.head.insertBefore(t, n);
13
14
  });
14
- const c = {};
15
+ const r = {};
15
16
  Array.from(document.querySelectorAll(`style[${h}]`)).forEach((t) => {
16
- var r;
17
- const a = t.getAttribute(h);
18
- c[a] ? t[i] === e && ((r = t.parentNode) == null || r.removeChild(t)) : c[a] = !0;
17
+ var a;
18
+ const c = t.getAttribute(h);
19
+ r[c] ? t[i] === e && ((a = t.parentNode) == null || a.removeChild(t)) : r[c] = !0;
19
20
  });
20
21
  }
21
- return new P(e);
22
+ return new b(e);
22
23
  }
23
- const p = Symbol("StyleContextKey"), N = () => {
24
- var n, c, t;
24
+ const p = Symbol("StyleContextKey"), w = () => {
25
+ var n, r, t;
25
26
  const e = T();
26
27
  let o;
27
28
  if (e && e.appContext) {
28
- const a = (t = (c = (n = e.appContext) == null ? void 0 : n.config) == null ? void 0 : c.globalProperties) == null ? void 0 : t.__ANTDV_CSSINJS_CACHE__;
29
- a ? o = a : (o = s(), e.appContext.config.globalProperties && (e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
29
+ const c = (t = (r = (n = e.appContext) == null ? void 0 : n.config) == null ? void 0 : r.globalProperties) == null ? void 0 : t.__ANTDV_CSSINJS_CACHE__;
30
+ c ? o = c : (o = s(), e.appContext.config.globalProperties && (e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
30
31
  } else
31
32
  o = s();
32
33
  return o;
@@ -35,32 +36,32 @@ const p = Symbol("StyleContextKey"), N = () => {
35
36
  defaultCache: !0,
36
37
  hashPriority: "low"
37
38
  }, y = () => {
38
- const e = N();
39
+ const e = w();
39
40
  return A(p, C({
40
41
  ...m,
41
42
  cache: e
42
43
  }));
43
- }, _ = (e) => {
44
+ }, S = (e) => {
44
45
  const o = y(), n = C({
45
46
  ...m,
46
47
  cache: s()
47
48
  });
48
- return x([() => d(e), o], () => {
49
- const c = {
49
+ return v([() => d(e), o], () => {
50
+ const r = {
50
51
  ...o.value
51
52
  }, t = d(e);
52
- Object.keys(t).forEach((r) => {
53
- const S = t[r];
54
- t[r] !== void 0 && (c[r] = S);
53
+ Object.keys(t).forEach((a) => {
54
+ const _ = t[a];
55
+ t[a] !== void 0 && (r[a] = _);
55
56
  });
56
57
  const {
57
- cache: a
58
+ cache: c
58
59
  } = t;
59
- c.cache = c.cache || s(), c.defaultCache = !a && o.value.defaultCache, n.value = c;
60
+ r.cache = r.cache || s(), r.defaultCache = !c && o.value.defaultCache, n.value = r;
60
61
  }, {
61
62
  immediate: !0
62
- }), b(p, n), n;
63
- }, j = () => ({
63
+ }), x(p, n), n;
64
+ }, H = () => ({
64
65
  autoClear: l(),
65
66
  /** @private Test only. Not work in production. */
66
67
  mock: f(),
@@ -68,13 +69,13 @@ const p = Symbol("StyleContextKey"), N = () => {
68
69
  * Only set when you need ssr to extract style on you own.
69
70
  * If not provided, it will auto create <style /> on the end of Provider in server side.
70
71
  */
71
- cache: E(),
72
+ cache: N(),
72
73
  /** Tell children that this context is default generated context */
73
74
  defaultCache: l(),
74
75
  /** Use `:where` selector to reduce hashId css selector priority */
75
76
  hashPriority: f(),
76
77
  /** Tell cssinjs where to inject style in */
77
- container: I(),
78
+ container: E(),
78
79
  /** Component wil render inline `<style />` for fallback in SSR. Not recommend. */
79
80
  ssrInline: l(),
80
81
  /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
@@ -85,32 +86,37 @@ const p = Symbol("StyleContextKey"), N = () => {
85
86
  * Please note that `linters` do not support dynamic update.
86
87
  */
87
88
  linters: u()
88
- }), w = v(/* @__PURE__ */ g({
89
- name: "AStyleProvider",
89
+ }), R = I(/* @__PURE__ */ g({
90
+ name: "AXStyleProvider",
90
91
  inheritAttrs: !1,
91
- props: j(),
92
+ props: H(),
92
93
  setup(e, {
93
94
  slots: o
94
95
  }) {
95
- return _(e), () => {
96
- var n;
97
- return (n = o.default) == null ? void 0 : n.call(o);
98
- };
96
+ return S(e), () => P(
97
+ j,
98
+ // @ts-ignore
99
+ e,
100
+ () => {
101
+ var n;
102
+ return (n = o.default) == null ? void 0 : n.call(o);
103
+ }
104
+ );
99
105
  }
100
- })), q = {
106
+ })), M = {
101
107
  useStyleInject: y,
102
- useStyleProvider: _,
103
- StyleProvider: w
108
+ useStyleProvider: S,
109
+ StyleProvider: R
104
110
  };
105
111
  export {
106
- V as ATTR_CACHE_PATH,
112
+ D as ATTR_CACHE_PATH,
107
113
  h as ATTR_MARK,
108
- J as ATTR_TOKEN,
114
+ q as ATTR_TOKEN,
109
115
  i as CSS_IN_JS_INSTANCE,
110
- w as StyleProvider,
116
+ R as StyleProvider,
111
117
  s as createCache,
112
- q as default,
113
- j as styleProviderProps,
118
+ M as default,
119
+ H as styleProviderProps,
114
120
  y as useStyleInject,
115
- _ as useStyleProvider
121
+ S as useStyleProvider
116
122
  };
@@ -1,23 +1,25 @@
1
- import { defineComponent as j, mergeDefaults as D, toRef as h, useSlots as H, ref as d, watch as N, unref as k, watchEffect as q, computed as r, createVNode as l, isVNode as z, Fragment as G, toValue as c, mergeProps as J } from "vue";
2
- import { a as K } from "../attachments/Attachments2.mjs";
3
- import { Avatar as L } from "ant-design-vue";
4
- import M from "../_util/hooks/use-x-component-config.mjs";
1
+ import { defineComponent as H, mergeDefaults as k, toRef as h, useSlots as q, ref as d, watch as N, unref as z, watchEffect as G, computed as r, createVNode as l, isVNode as x, Fragment as J, toValue as i, mergeProps as K } from "vue";
2
+ import { a as L } from "../attachments/Attachments2.mjs";
3
+ import { Avatar as M } from "ant-design-vue";
4
+ import O from "../_util/hooks/use-x-component-config.mjs";
5
5
  import "../x-provider/index.mjs";
6
- import O from "./hooks/useTypedEffect.mjs";
7
- import Q from "./hooks/useTypingConfig.mjs";
8
- import W from "./loading.mjs";
9
- import Y from "./style/index.mjs";
10
- import { useBubbleContextInject as Z } from "./context.mjs";
11
- import U from "../x-provider/hooks/use-x-provider-context.mjs";
12
- const ie = /* @__PURE__ */ j({
6
+ import Q from "./hooks/useTypedEffect.mjs";
7
+ import W from "./hooks/useTypingConfig.mjs";
8
+ import Y from "./loading.mjs";
9
+ import Z from "./style/index.mjs";
10
+ import { useBubbleContextInject as U } from "./context.mjs";
11
+ import p from "../x-provider/hooks/use-x-provider-context.mjs";
12
+ const ue = /* @__PURE__ */ H({
13
13
  name: "AXBubble",
14
14
  __name: "Bubble",
15
- props: D({
15
+ props: k({
16
16
  prefixCls: null,
17
17
  rootClassName: null,
18
18
  styles: null,
19
19
  classNames: null,
20
- avatar: null,
20
+ avatar: {
21
+ type: Function
22
+ },
21
23
  placement: null,
22
24
  loading: {
23
25
  type: Boolean
@@ -44,35 +46,35 @@ const ie = /* @__PURE__ */ j({
44
46
  variant: "filled"
45
47
  }),
46
48
  setup(e, {
47
- expose: x
49
+ expose: $
48
50
  }) {
49
- const $ = K(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
51
+ const b = L(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
50
52
  h(e, "content"), h(e, "prefixCls");
51
- const a = H(), g = d(e.content);
53
+ const a = q(), y = d(e.content);
52
54
  N(() => e.content, () => {
53
- g.value = e.content;
55
+ y.value = e.content;
54
56
  });
55
57
  const {
56
- onUpdate: i
57
- } = k(Z()), y = d(null), {
58
- direction: b,
59
- getPrefixCls: R
60
- } = U(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = Q(() => e.typing), [s, u] = O(g, T, P, S), f = d(!1);
58
+ onUpdate: c
59
+ } = z(U()), g = d(null), {
60
+ direction: R,
61
+ getPrefixCls: T
62
+ } = p(), t = T("bubble", e.prefixCls), n = O("bubble"), [P, S, V, C] = W(() => e.typing), [s, u] = Q(y, P, S, V), f = d(!1);
61
63
  N(s, () => {
62
- i == null || i();
63
- }), q(() => {
64
+ c == null || c();
65
+ }), G(() => {
64
66
  var o;
65
67
  !u.value && !e.loading ? f.value || (f.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : f.value = !1;
66
68
  });
67
- const [V, w, B] = Y(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
68
- [`${t}-rtl`]: b.value === "rtl"
69
+ const [A, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
70
+ [`${t}-rtl`]: R.value === "rtl"
69
71
  }, {
70
72
  [`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !C.value
71
- }]), F = r(() => a.avatar ? a.avatar() : z(e.avatar) ? e.avatar : l(L, e.avatar, null)), I = r(() => a.message ? a.message({
73
+ }]), F = (o) => Array.isArray(o) && o.every(x), I = r(() => a.avatar ? a.avatar() : typeof e.avatar == "function" ? e.avatar() : x(e.avatar) || F(e.avatar) ? e.avatar : l(M, e.avatar, null)), X = r(() => a.message ? a.message({
72
74
  content: s.value
73
- }) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(W, {
75
+ }) : e.messageRender ? e.messageRender(s.value) : s.value), j = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
74
76
  prefixCls: t
75
- }, null) : l(G, null, [I.value, u.value && c(C)])), A = r(() => {
77
+ }, null) : l(J, null, [X.value, u.value && i(C)])), D = r(() => {
76
78
  const o = l("div", {
77
79
  style: {
78
80
  ...n.value.styles.content,
@@ -81,7 +83,7 @@ const ie = /* @__PURE__ */ j({
81
83
  class: [`${t}-content`, `${t}-content-${e.variant}`, {
82
84
  [`${t}-content-${e.shape}`]: e.shape
83
85
  }, n.value.classNames.content, e.classNames.content]
84
- }, [c(X)]), m = a.header ? a.header({
86
+ }, [i(j)]), m = a.header ? a.header({
85
87
  content: s.value
86
88
  }) : typeof e.header == "function" ? e.header(s.value) : e.header, v = a.footer ? a.footer({
87
89
  content: s.value
@@ -102,25 +104,25 @@ const ie = /* @__PURE__ */ j({
102
104
  }
103
105
  }, [v])]) : o;
104
106
  });
105
- return x({
106
- nativeElement: y
107
- }), () => V(l("div", J({
107
+ return $({
108
+ nativeElement: g
109
+ }), () => A(l("div", K({
108
110
  style: {
109
111
  ...n.value.style
110
112
  // ...(style as object),
111
113
  },
112
- class: c(E)
113
- }, $, {
114
- ref: y
114
+ class: i(E)
115
+ }, b, {
116
+ ref: g
115
117
  }), [(a.avatar || e.avatar) && l("div", {
116
118
  style: {
117
119
  ...n.value.styles.avatar,
118
120
  ...e.styles.avatar
119
121
  },
120
122
  class: [`${t}-avatar`, n.value.classNames.avatar, e.classNames.avatar]
121
- }, [c(F)]), c(A)]));
123
+ }, [i(I)]), i(D)]));
122
124
  }
123
125
  });
124
126
  export {
125
- ie as default
127
+ ue as default
126
128
  };
@@ -1,20 +1,20 @@
1
- import { defineComponent as M, mergeDefaults as O, toRef as g, useAttrs as W, mergeProps as h, ref as u, watch as m, watchEffect as j, onWatcherCleanup as q, unref as t, nextTick as F, computed as G, createVNode as x } from "vue";
2
- import { a as J, c as Q } from "../attachments/Attachments2.mjs";
3
- import { useEventCallback as Y } from "../_util/hooks/use-event-callback.mjs";
4
- import Z from "../_util/pick-attrs.mjs";
1
+ import { defineComponent as q, mergeDefaults as F, toRef as p, useAttrs as G, useSlots as J, computed as A, mergeProps as v, ref as d, watch as g, watchEffect as Q, onWatcherCleanup as Y, unref as o, nextTick as Z, createVNode as x } from "vue";
2
+ import { a as k, c as b } from "../attachments/Attachments2.mjs";
3
+ import { useEventCallback as _ } from "../_util/hooks/use-event-callback.mjs";
4
+ import tt from "../_util/pick-attrs.mjs";
5
5
  import "../x-provider/index.mjs";
6
- import _ from "./Bubble.mjs";
7
- import tt from "./hooks/useDisplayData.mjs";
8
- import et from "./hooks/useListData.mjs";
9
- import ot from "./style/index.mjs";
10
- import b from "../_util/hooks/use-state.mjs";
11
- import { BubbleContextProvider as st } from "./context.mjs";
12
- import lt from "../x-provider/hooks/use-x-provider-context.mjs";
13
- const nt = 1, bt = /* @__PURE__ */ M({
6
+ import et from "./Bubble.mjs";
7
+ import ot from "./hooks/useDisplayData.mjs";
8
+ import st from "./hooks/useListData.mjs";
9
+ import at from "./style/index.mjs";
10
+ import S from "../_util/hooks/use-state.mjs";
11
+ import { BubbleContextProvider as lt } from "./context.mjs";
12
+ import rt from "../x-provider/hooks/use-x-provider-context.mjs";
13
+ const nt = 1, Rt = /* @__PURE__ */ q({
14
14
  name: "AXBubbleList",
15
15
  inheritAttrs: !1,
16
16
  __name: "BubbleList",
17
- props: O({
17
+ props: F({
18
18
  prefixCls: null,
19
19
  rootClassName: null,
20
20
  items: null,
@@ -25,111 +25,147 @@ const nt = 1, bt = /* @__PURE__ */ M({
25
25
  }, {
26
26
  autoScroll: !0
27
27
  }),
28
- setup(e, {
29
- expose: D
28
+ setup(s, {
29
+ expose: N
30
30
  }) {
31
- const T = J(e, ["prefixCls", "rootClassName", "items", "autoScroll", "roles"]);
32
- g(e, "roles"), g(e, "items"), g(e, "prefixCls");
33
- const V = W(), A = Z(h(T, V), {
31
+ const w = k(s, ["prefixCls", "rootClassName", "items", "autoScroll", "roles"]);
32
+ p(s, "roles"), p(s, "items"), p(s, "prefixCls");
33
+ const B = G(), a = J(), L = A(() => tt(v(w, B), {
34
34
  attr: !0,
35
35
  aria: !0
36
- }), v = u(e.items), S = u(e.roles);
37
- m(() => e.items, () => {
38
- v.value = e.items;
39
- }), m(() => e.roles, () => {
40
- S.value = e.roles;
36
+ })), R = d(s.items), P = d(s.roles);
37
+ g(() => s.items, () => {
38
+ R.value = s.items;
39
+ }), g(() => s.roles, () => {
40
+ P.value = s.roles;
41
41
  });
42
- const r = u(null), i = u({}), {
43
- getPrefixCls: N
44
- } = lt(), P = N("bubble", e.prefixCls), R = `${P}-list`, [w, B, L] = ot(P), [H, I] = b(!1);
45
- j(() => {
46
- I(!0), q(() => {
47
- I(!1);
42
+ const i = d(null), u = d({}), {
43
+ getPrefixCls: H
44
+ } = rt(), I = H("bubble", s.prefixCls), E = `${I}-list`, [U, $, z] = at(I), [X, D] = S(!1);
45
+ Q(() => {
46
+ D(!0), Y(() => {
47
+ D(!1);
48
48
  });
49
49
  });
50
- const U = et(v, S), [a, $] = tt(U), [E, f] = b(!0), [d, y] = b(0), z = (o) => {
51
- const s = o.target;
52
- f(s.scrollHeight - Math.abs(s.scrollTop) - s.clientHeight <= nt);
50
+ const y = st(R, P), [m, K] = ot(y), [T, C] = S(!0), [h, V] = S(0), M = (t) => {
51
+ const l = t.target;
52
+ C(l.scrollHeight - Math.abs(l.scrollTop) - l.clientHeight <= nt);
53
53
  };
54
- m(d, () => {
55
- e.autoScroll && t(r) && t(E) && F(() => {
56
- t(r).scrollTo({
57
- top: t(r).scrollHeight
54
+ g(h, () => {
55
+ s.autoScroll && o(i) && o(T) && Z(() => {
56
+ o(i).scrollTo({
57
+ top: o(i).scrollHeight
58
58
  });
59
59
  });
60
- }), m(() => t(a).length, () => {
61
- var o;
62
- if (e.autoScroll) {
63
- const s = (o = t(a)[t(a).length - 2]) == null ? void 0 : o.key, l = t(i)[s];
64
- if (l) {
60
+ }), g(() => o(m).length, () => {
61
+ var t;
62
+ if (s.autoScroll) {
63
+ const l = (t = o(m)[o(m).length - 2]) == null ? void 0 : t.key, e = o(u)[l];
64
+ if (e) {
65
65
  const {
66
66
  nativeElement: n
67
- } = l, {
67
+ } = e, {
68
68
  top: c = 0,
69
- bottom: C = 0
69
+ bottom: f = 0
70
70
  } = (n == null ? void 0 : n.getBoundingClientRect()) ?? {}, {
71
- top: p,
72
- bottom: K
73
- } = t(r).getBoundingClientRect();
74
- c < K && C > p && (y(t(d) + 1), f(!0));
71
+ top: r,
72
+ bottom: j
73
+ } = o(i).getBoundingClientRect();
74
+ c < j && f > r && (V(o(h) + 1), C(!0));
75
75
  }
76
76
  }
77
77
  });
78
- const X = Y(() => {
79
- e.autoScroll && y(t(d) + 1);
80
- }), k = G(() => ({
81
- onUpdate: X
78
+ const O = _(() => {
79
+ s.autoScroll && V(o(h) + 1);
80
+ }), W = A(() => ({
81
+ onUpdate: O
82
82
  }));
83
- return D({
84
- nativeElement: r,
83
+ return N({
84
+ nativeElement: i,
85
85
  scrollTo: ({
86
- key: o,
87
- offset: s,
88
- behavior: l = "smooth",
86
+ key: t,
87
+ offset: l,
88
+ behavior: e = "smooth",
89
89
  block: n
90
90
  }) => {
91
- if (typeof s == "number")
92
- t(r).scrollTo({
93
- top: s,
94
- behavior: l
91
+ if (typeof l == "number")
92
+ o(i).scrollTo({
93
+ top: l,
94
+ behavior: e
95
95
  });
96
- else if (o !== void 0) {
97
- const c = t(i)[o];
96
+ else if (t !== void 0) {
97
+ const c = o(u)[t];
98
98
  if (c) {
99
- const C = t(a).findIndex((p) => p.key === o);
100
- f(C === t(a).length - 1), c.nativeElement.scrollIntoView({
101
- behavior: l,
99
+ const f = o(m).findIndex((r) => r.key === t);
100
+ C(f === o(m).length - 1), c.nativeElement.scrollIntoView({
101
+ behavior: e,
102
102
  block: n
103
103
  });
104
104
  }
105
105
  }
106
106
  }
107
- }), () => w(x(st, {
108
- value: k.value
107
+ }), () => U(x(lt, {
108
+ value: W.value
109
109
  }, {
110
- default: () => [x("div", h(A, {
111
- class: Q(R, e.rootClassName, B.value, L, {
112
- [`${R}-reach-end`]: E.value
110
+ default: () => [x("div", v(L.value, {
111
+ class: b(E, s.rootClassName, $.value, z, {
112
+ [`${E}-reach-end`]: T.value
113
113
  }),
114
- ref: r,
115
- onScroll: z
116
- }), [t(a).map(({
117
- key: o,
118
- onTypingComplete: s,
119
- ...l
120
- }) => x(_, h(l, {
121
- key: o,
122
- ref: (n) => {
123
- n ? i.value[o] = n : delete i.value[o];
124
- },
125
- typing: H.value ? l.typing : !1,
126
- onTypingComplete: () => {
127
- s == null || s(), $(o);
128
- }
129
- }), null))])]
114
+ ref: i,
115
+ onScroll: M
116
+ }), [o(m).map(({
117
+ key: t,
118
+ onTypingComplete: l,
119
+ ...e
120
+ }) => {
121
+ var n, c, f;
122
+ return x(et, v(e, {
123
+ avatar: a.avatar ? () => {
124
+ var r;
125
+ return (r = a.avatar) == null ? void 0 : r.call(a, {
126
+ item: {
127
+ key: t,
128
+ ...e
129
+ }
130
+ });
131
+ } : e.avatar,
132
+ header: ((n = a.header) == null ? void 0 : n.call(a, {
133
+ item: {
134
+ key: t,
135
+ ...e
136
+ }
137
+ })) ?? e.header,
138
+ footer: ((c = a.footer) == null ? void 0 : c.call(a, {
139
+ item: {
140
+ key: t,
141
+ ...e
142
+ }
143
+ })) ?? e.footer,
144
+ loadingRender: a.loading ? () => a.loading({
145
+ item: {
146
+ key: t,
147
+ ...e
148
+ }
149
+ }) : e.loadingRender,
150
+ content: ((f = a.message) == null ? void 0 : f.call(a, {
151
+ item: {
152
+ key: t,
153
+ ...e
154
+ }
155
+ })) ?? e.content,
156
+ key: t,
157
+ ref: (r) => {
158
+ r ? u.value[t] = r : delete u.value[t];
159
+ },
160
+ typing: X.value ? e.typing : !1,
161
+ onTypingComplete: () => {
162
+ l == null || l(), K(t);
163
+ }
164
+ }), null);
165
+ })])]
130
166
  }));
131
167
  }
132
168
  });
133
169
  export {
134
- bt as default
170
+ Rt as default
135
171
  };
@@ -1,14 +1,27 @@
1
- const o = (e) => {
2
- const { componentCls: t, padding: l } = e;
1
+ const t = (r) => {
2
+ const { componentCls: o, padding: l } = r;
3
3
  return {
4
- [`${t}-list`]: {
4
+ [`${o}-list`]: {
5
5
  display: "flex",
6
6
  flexDirection: "column",
7
7
  gap: l,
8
- overflowY: "auto"
8
+ overflowY: "auto",
9
+ "&::-webkit-scrollbar": {
10
+ width: 8,
11
+ backgroundColor: "transparent"
12
+ },
13
+ "&::-webkit-scrollbar-thumb": {
14
+ backgroundColor: r.colorTextTertiary,
15
+ borderRadius: r.borderRadiusSM
16
+ },
17
+ // For Firefox
18
+ "&": {
19
+ scrollbarWidth: "thin",
20
+ scrollbarColor: `${r.colorTextTertiary} transparent`
21
+ }
9
22
  }
10
23
  };
11
24
  };
12
25
  export {
13
- o as default
26
+ t as default
14
27
  };