ant-design-x-vue 1.2.4 → 1.2.6

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,4 +1,4 @@
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 i, mergeProps as J } from "vue";
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
2
  import { a as K } from "../attachments/Attachments2.mjs";
3
3
  import { Avatar as L } from "ant-design-vue";
4
4
  import M from "../_util/hooks/use-x-component-config.mjs";
@@ -9,7 +9,7 @@ import W from "./hooks/useTypingConfig.mjs";
9
9
  import Y from "./loading.mjs";
10
10
  import Z from "./style/index.mjs";
11
11
  import { useBubbleContextInject as U } from "./context.mjs";
12
- const ce = /* @__PURE__ */ j({
12
+ const ie = /* @__PURE__ */ j({
13
13
  name: "AXBubble",
14
14
  __name: "Bubble",
15
15
  props: D({
@@ -34,9 +34,7 @@ const ce = /* @__PURE__ */ j({
34
34
  shape: null,
35
35
  onTypingComplete: null,
36
36
  header: null,
37
- footer: {
38
- type: Function
39
- }
37
+ footer: null
40
38
  }, {
41
39
  classNames: () => ({}),
42
40
  styles: () => ({}),
@@ -55,16 +53,16 @@ const ce = /* @__PURE__ */ j({
55
53
  g.value = e.content;
56
54
  });
57
55
  const {
58
- onUpdate: c
56
+ onUpdate: i
59
57
  } = k(U()), y = d(null), {
60
58
  direction: b,
61
59
  getPrefixCls: R
62
- } = O(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = W(() => e.typing), [s, u] = Q(g, T, P, S), m = d(!1);
60
+ } = O(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = W(() => e.typing), [s, u] = Q(g, T, P, S), f = d(!1);
63
61
  N(s, () => {
64
- c == null || c();
62
+ i == null || i();
65
63
  }), q(() => {
66
64
  var o;
67
- !u.value && !e.loading ? m.value || (m.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : m.value = !1;
65
+ !u.value && !e.loading ? f.value || (f.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : f.value = !1;
68
66
  });
69
67
  const [V, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
70
68
  [`${t}-rtl`]: b.value === "rtl"
@@ -74,7 +72,7 @@ const ce = /* @__PURE__ */ j({
74
72
  content: s.value
75
73
  }) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
76
74
  prefixCls: t
77
- }, null) : l(G, null, [I.value, u.value && i(C)])), A = r(() => {
75
+ }, null) : l(G, null, [I.value, u.value && c(C)])), A = r(() => {
78
76
  const o = l("div", {
79
77
  style: {
80
78
  ...n.value.styles.content,
@@ -83,18 +81,20 @@ const ce = /* @__PURE__ */ j({
83
81
  class: [`${t}-content`, `${t}-content-${e.variant}`, {
84
82
  [`${t}-content-${e.shape}`]: e.shape
85
83
  }, n.value.classNames.content, e.classNames.content]
86
- }, [i(X)]), f = a.header ? a.header() : e.header, v = a.footer ? a.footer({
84
+ }, [c(X)]), m = a.header ? a.header({
85
+ content: s.value
86
+ }) : typeof e.header == "function" ? e.header(s.value) : e.header, v = a.footer ? a.footer({
87
87
  content: s.value
88
88
  }) : typeof e.footer == "function" ? e.footer(s.value) : e.footer;
89
- return f || v ? l("div", {
89
+ return m || v ? l("div", {
90
90
  class: `${t}-content-wrapper`
91
- }, [f && l("div", {
91
+ }, [m && l("div", {
92
92
  class: [`${t}-header`, n.value.classNames.header, e.classNames.header],
93
93
  style: {
94
94
  ...n.value.styles.header,
95
95
  ...e.styles.header
96
96
  }
97
- }, [f]), o, v && l("div", {
97
+ }, [m]), o, v && l("div", {
98
98
  class: [`${t}-footer`, n.value.classNames.footer, e.classNames.footer],
99
99
  style: {
100
100
  ...n.value.styles.footer,
@@ -109,7 +109,7 @@ const ce = /* @__PURE__ */ j({
109
109
  ...n.value.style
110
110
  // ...(style as object),
111
111
  },
112
- class: i(E)
112
+ class: c(E)
113
113
  }, $, {
114
114
  ref: y
115
115
  }), [(a.avatar || e.avatar) && l("div", {
@@ -118,9 +118,9 @@ const ce = /* @__PURE__ */ j({
118
118
  ...e.styles.avatar
119
119
  },
120
120
  class: [`${t}-avatar`, n.value.classNames.avatar, e.classNames.avatar]
121
- }, [i(F)]), i(A)]));
121
+ }, [c(F)]), c(A)]));
122
122
  }
123
123
  });
124
124
  export {
125
- ce as default
125
+ ie as default
126
126
  };
@@ -1,8 +1,8 @@
1
1
  import { computed as s, unref as e, watch as f } from "vue";
2
2
  import { useEventCallback as c } from "../../_util/hooks/use-event-callback.mjs";
3
3
  import d from "../../_util/hooks/use-state.mjs";
4
- function h(a) {
5
- const [r, o] = d(a.value.length), t = s(() => a.value.slice(0, e(r))), i = s(() => {
4
+ function v(a) {
5
+ const [o, u] = d(a.value.length), t = s(() => a.value.slice(0, e(o))), i = s(() => {
6
6
  const l = e(t)[e(t).length - 1];
7
7
  return l ? l.key : null;
8
8
  });
@@ -10,16 +10,16 @@ function h(a) {
10
10
  a,
11
11
  () => {
12
12
  var l;
13
- if (!(e(t).length && e(t).every((n, y) => {
14
- var u;
15
- return n.key === ((u = a.value[y]) == null ? void 0 : u.key);
13
+ if (u(a.value.length), !(e(t).length && e(t).every((n, y) => {
14
+ var r;
15
+ return n.key === ((r = a.value[y]) == null ? void 0 : r.key);
16
16
  }))) {
17
17
  if (e(t).length === 0)
18
- o(1);
18
+ u(1);
19
19
  else
20
20
  for (let n = 0; n < e(t).length; n += 1)
21
21
  if (e(t)[n].key !== ((l = a.value[n]) == null ? void 0 : l.key)) {
22
- o(n);
22
+ u(n);
23
23
  break;
24
24
  }
25
25
  }
@@ -27,10 +27,10 @@ function h(a) {
27
27
  { immediate: !0, deep: !0 }
28
28
  );
29
29
  const p = c((l) => {
30
- l === e(i) && o(e(r) + 1);
30
+ l === e(i) && u(e(o) + 1);
31
31
  });
32
32
  return [t, p];
33
33
  }
34
34
  export {
35
- h as default
35
+ v as default
36
36
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as y, toRef as P, computed as l, createVNode as t, mergeProps as h } from "vue";
1
+ import { defineComponent as p, toRef as y, computed as i, createVNode as t, mergeProps as h } from "vue";
2
2
  import { a as $, c as O } from "../attachments/Attachments2.mjs";
3
3
  import T from "../_util/pick-attrs.mjs";
4
- import { Tooltip as E, Typography as M, Dropdown as p, Menu as w } from "ant-design-vue";
5
- import c from "../_util/hooks/use-state.mjs";
6
- import { E as I } from "../attachments/FileList/FileList2.mjs";
7
- const L = /* @__PURE__ */ y({
4
+ import { Tooltip as E, Typography as M, Dropdown as w, Menu as I } from "ant-design-vue";
5
+ import s from "../_util/hooks/use-state.mjs";
6
+ import { E as N } from "../attachments/FileList/FileList2.mjs";
7
+ const S = /* @__PURE__ */ p({
8
8
  name: "AXConversationsItem",
9
9
  __name: "ConversationsItem",
10
10
  props: {
@@ -20,34 +20,37 @@ const L = /* @__PURE__ */ y({
20
20
  }
21
21
  },
22
22
  setup(e) {
23
- const s = $(e, ["prefixCls", "info", "class", "direction", "onClick", "active", "menu"]);
24
- P(e, "class");
25
- const u = l(() => T(s, {
23
+ const u = $(e, ["prefixCls", "info", "class", "direction", "onClick", "active", "menu"]);
24
+ y(e, "class");
25
+ const f = i(() => T(u, {
26
26
  aria: !0,
27
27
  data: !0,
28
28
  attr: !0
29
- })), f = (n) => {
29
+ })), m = (n) => {
30
30
  n.stopPropagation();
31
- }, i = l(() => e.info.disabled), [m, d] = c(!1), [g, r] = c(!1), v = l(() => O(e.class, `${e.prefixCls}-item`, {
32
- [`${e.prefixCls}-item-active`]: e.active && !i.value
31
+ }, l = i(() => e.info.disabled), [d, g] = s(!1), [C, r] = s(!1), v = i(() => O(e.class, `${e.prefixCls}-item`, {
32
+ [`${e.prefixCls}-item-active`]: e.active && !l.value
33
33
  }, {
34
- [`${e.prefixCls}-item-disabled`]: i.value
35
- })), C = () => {
36
- !i.value && e.onClick && e.onClick(e.info);
37
- }, x = (n) => {
34
+ [`${e.prefixCls}-item-disabled`]: l.value
35
+ })), x = () => {
36
+ !l.value && e.onClick && e.onClick(e.info);
37
+ }, P = (n) => {
38
38
  n && r(!n);
39
- }, o = l(() => {
39
+ }, o = i(() => {
40
40
  var n;
41
41
  return (n = e.menu) == null ? void 0 : n.trigger;
42
- }), b = l(() => {
42
+ }), c = i(() => {
43
43
  const {
44
44
  trigger: n,
45
45
  ...a
46
46
  } = e.menu || {};
47
47
  return a;
48
+ }), b = i(() => {
49
+ var n;
50
+ return (n = c.value) == null ? void 0 : n.getPopupContainer;
48
51
  }), k = (n) => {
49
- const a = t(I, {
50
- onClick: f,
52
+ const a = t(N, {
53
+ onClick: m,
51
54
  class: `${e.prefixCls}-menu-icon`
52
55
  }, null);
53
56
  return o.value ? typeof o.value == "function" ? o.value(n, {
@@ -56,34 +59,35 @@ const L = /* @__PURE__ */ y({
56
59
  };
57
60
  return () => t(E, {
58
61
  title: e.info.label,
59
- open: m.value && g.value,
62
+ open: d.value && C.value,
60
63
  onOpenChange: r,
61
64
  placement: e.direction === "rtl" ? "left" : "right"
62
65
  }, {
63
- default: () => [t("li", h(u.value, {
66
+ default: () => [t("li", h(f.value, {
64
67
  class: v.value,
65
- onClick: C
68
+ onClick: x
66
69
  }), [e.info.icon && t("div", {
67
70
  class: `${e.prefixCls}-icon`
68
71
  }, [e.info.icon]), t(M.Text, {
69
72
  class: `${e.prefixCls}-label`,
70
73
  ellipsis: {
71
- onEllipsis: d
74
+ onEllipsis: g
72
75
  }
73
76
  }, {
74
77
  default: () => [e.info.label]
75
- }), !i.value && e.menu && t(p, {
78
+ }), !l.value && e.menu && t(w, {
76
79
  placement: e.direction === "rtl" ? "bottomLeft" : "bottomRight",
77
80
  trigger: ["click"],
78
- disabled: i.value,
79
- onOpenChange: x
81
+ disabled: l.value,
82
+ onOpenChange: P,
83
+ getPopupContainer: b.value
80
84
  }, {
81
85
  default: () => k(e.info),
82
- overlay: () => t(w, b.value, null)
86
+ overlay: () => t(I, c.value, null)
83
87
  })])]
84
88
  });
85
89
  }
86
90
  });
87
91
  export {
88
- L as default
92
+ S as default
89
93
  };
@@ -12,8 +12,8 @@ import D from "./components/LoadingButton.mjs";
12
12
  import K from "./components/SendButton.mjs";
13
13
  import R from "./components/SpeechButton/index.mjs";
14
14
  import ve from "./style/index.mjs";
15
- import Ce from "./useSpeech.mjs";
16
- import ye from "../_util/getValue.mjs";
15
+ import ye from "./useSpeech.mjs";
16
+ import Ce from "../_util/getValue.mjs";
17
17
  const Ae = /* @__PURE__ */ ee({
18
18
  name: "AXSender",
19
19
  __name: "Sender",
@@ -77,7 +77,7 @@ const Ae = /* @__PURE__ */ ee({
77
77
  const V = le(e, ["prefixCls", "styles", "classNames", "className", "rootClassName", "style", "defaultValue", "value", "placeholder", "readOnly", "submitType", "onSubmit", "loading", "components", "onCancel", "onChange", "actions", "onKeyPress", "onKeyDown", "disabled", "allowSpeech", "prefix", "footer", "header", "onPaste", "onPasteFile", "autoSize"]);
78
78
  te(e, "prefixCls");
79
79
  function A(t, n, r) {
80
- return ye(t, n) || r;
80
+ return Ce(t, n) || r;
81
81
  }
82
82
  const m = {
83
83
  SendButton: K,
@@ -96,14 +96,14 @@ const Ae = /* @__PURE__ */ ee({
96
96
  ae(() => e.value, () => {
97
97
  x(e.value);
98
98
  });
99
- const C = (t, n) => {
99
+ const y = (t, n) => {
100
100
  x(t), E("update:value", t), e.onChange && e.onChange(t, n);
101
101
  }, {
102
102
  speechPermission: j,
103
103
  triggerSpeech: b,
104
104
  recording: q
105
- } = Ce((t) => {
106
- C(`${u.value} ${t}`);
105
+ } = ye((t) => {
106
+ y(`${u.value} ${t}`);
107
107
  }, () => e.allowSpeech), H = A(e.components, ["input"], se.TextArea), G = a(() => ue(V, {
108
108
  attr: !0,
109
109
  aria: !0,
@@ -111,10 +111,10 @@ const Ae = /* @__PURE__ */ ee({
111
111
  })), J = a(() => ({
112
112
  ...G.value,
113
113
  ref: f
114
- })), y = () => {
114
+ })), C = () => {
115
115
  u.value && e.onSubmit && !e.loading && e.onSubmit(u.value);
116
116
  }, Q = () => {
117
- C("");
117
+ y("");
118
118
  }, h = d(!1), U = () => {
119
119
  h.value = !0;
120
120
  }, W = () => {
@@ -123,10 +123,10 @@ const Ae = /* @__PURE__ */ ee({
123
123
  const n = t.key === "Enter" && !h.value;
124
124
  switch (e.submitType) {
125
125
  case "enter":
126
- n && !t.shiftKey && (t.preventDefault(), y());
126
+ n && !t.shiftKey && (t.preventDefault(), C());
127
127
  break;
128
128
  case "shiftEnter":
129
- n && t.shiftKey && (t.preventDefault(), y());
129
+ n && t.shiftKey && (t.preventDefault(), C());
130
130
  break;
131
131
  }
132
132
  e.onKeyPress && e.onKeyPress(t);
@@ -152,7 +152,7 @@ const Ae = /* @__PURE__ */ ee({
152
152
  }) : typeof e.actions == "function" ? t = e.actions(t, n) : (e.actions || e.actions === !1) && (t = e.actions), t;
153
153
  }), _ = a(() => ({
154
154
  prefixCls: M.value,
155
- onSend: y,
155
+ onSend: C,
156
156
  onSendDisabled: !u.value,
157
157
  onClear: Q,
158
158
  onClearDisabled: !u.value,
@@ -172,7 +172,7 @@ const Ae = /* @__PURE__ */ ee({
172
172
  }) : typeof e.footer == "function" ? t = e.footer({
173
173
  components: m
174
174
  }) : e.footer && (t = e.footer), t;
175
- }), $ = a(() => i.header ? i.header() : e.header), w = a(() => i.prefix ? i.prefix() : e.prefix);
175
+ }), $ = a(() => i.header ? i.header() : typeof e.header == "function" ? e.header() : e.header), w = a(() => i.prefix ? i.prefix() : typeof e.prefix == "function" ? e.prefix() : e.prefix);
176
176
  return I({
177
177
  nativeElement: v.value,
178
178
  // @ts-expect-error
@@ -220,7 +220,7 @@ const Ae = /* @__PURE__ */ ee({
220
220
  autoSize: e.autoSize,
221
221
  value: u.value,
222
222
  onChange: (t) => {
223
- C(t.target.value, t), b(!0);
223
+ y(t.target.value, t), b(!0);
224
224
  },
225
225
  onPressEnter: Y,
226
226
  onCompositionstart: U,
@@ -1,15 +1,15 @@
1
- import { defineComponent as S, mergeDefaults as L, computed as e, useId as A, createVNode as a, mergeProps as F, withDirectives as O, vShow as w } from "vue";
2
- import { a as D, c as n } from "../attachments/Attachments2.mjs";
3
- import H from "../_util/pick-attrs.mjs";
4
- import { useThoughtChainNodeContextInject as I } from "./context.mjs";
5
- import { Avatar as K, Typography as g } from "ant-design-vue";
1
+ import { defineComponent as D, mergeDefaults as H, computed as e, useId as I, createVNode as l, mergeProps as K, withDirectives as V, vShow as j } from "vue";
2
+ import { a as X, c as i } from "../attachments/Attachments2.mjs";
3
+ import q from "../_util/pick-attrs.mjs";
4
+ import { useThoughtChainNodeContextInject as z } from "./context.mjs";
5
+ import { Avatar as B, Typography as P, Tooltip as S } from "ant-design-vue";
6
6
  import "../transition-collapse/index.mjs";
7
- import { L as V, R as j } from "../attachments/FileList/FileList2.mjs";
8
- import X from "../transition-collapse/TransitionCollapse.mjs";
9
- const U = /* @__PURE__ */ S({
7
+ import { L as E, R as G } from "../attachments/FileList/FileList2.mjs";
8
+ import J from "../transition-collapse/TransitionCollapse.mjs";
9
+ const te = /* @__PURE__ */ D({
10
10
  name: "AXThoughtChainNode",
11
11
  __name: "item",
12
- props: L({
12
+ props: H({
13
13
  info: null,
14
14
  nextStatus: null,
15
15
  onClick: {
@@ -19,78 +19,91 @@ const U = /* @__PURE__ */ S({
19
19
  info: () => ({})
20
20
  }),
21
21
  setup(t) {
22
- const i = D(t, ["info", "nextStatus", "onClick"]), k = e(() => H(i, {
22
+ const c = X(t, ["info", "nextStatus", "onClick"]), R = e(() => q(c, {
23
23
  attr: !0,
24
24
  aria: !0,
25
25
  data: !0
26
- })), o = I(), h = e(() => o.value.prefixCls), c = e(() => o.value.enableCollapse), N = e(() => o.value.expandedKeys), v = e(() => o.value.direction), r = e(() => o.value.classNames), d = e(() => o.value.styles), b = A(), x = e(() => t.info.key ?? b), T = e(() => t.info.icon), C = e(() => t.info.title), $ = e(() => t.info.extra), u = e(() => t.info.content), y = e(() => t.info.footer), p = e(() => t.info.status), m = e(() => t.info.description), l = e(() => `${h.value}-item`), P = () => {
27
- var s;
28
- return (s = t.onClick) == null ? void 0 : s.call(t, x.value);
29
- }, f = e(() => {
30
- var s;
31
- return (s = N.value) == null ? void 0 : s.includes(x.value);
32
- }), R = e(() => c.value ? f.value : !0);
33
- return () => a("div", F(k.value, {
34
- class: n(l.value, {
35
- [`${l.value}-${p.value}${t.nextStatus ? `-${t.nextStatus}` : ""}`]: p.value
36
- }, i.class),
37
- style: i.style
38
- }), [a("div", {
39
- class: n(`${l.value}-header`, r.value.itemHeader),
40
- style: d.value.itemHeader,
41
- onClick: P
42
- }, [a(K, {
43
- icon: T.value,
44
- class: `${l.value}-icon`
45
- }, null), a("div", {
46
- class: n(`${l.value}-header-box`, {
47
- [`${l.value}-collapsible`]: c.value && u.value
26
+ })), n = z(), C = e(() => n.value.prefixCls), v = e(() => n.value.enableCollapse), A = e(() => n.value.expandedKeys), g = e(() => n.value.direction), r = e(() => n.value.classNames), f = e(() => n.value.styles), F = I(), h = e(() => t.info.key ?? F), L = e(() => t.info.icon), d = e(() => t.info.title), x = e(() => t.info.extra), s = e(() => t.info.content), y = e(() => t.info.footer), $ = e(() => t.info.status), u = e(() => t.info.description), p = e(() => {
27
+ const a = t.info.tooltip ?? !0, T = g.value === "rtl" ? "topRight" : "topLeft", b = {
28
+ title: d.value,
29
+ placement: T
30
+ }, N = {
31
+ title: u.value,
32
+ placement: T
33
+ };
34
+ return typeof a == "boolean" ? {
35
+ titleConfig: b,
36
+ descriptionConfig: N
37
+ } : {
38
+ titleConfig: {
39
+ ...b,
40
+ ...a.titleConfig ? a.titleConfig : {}
41
+ },
42
+ descriptionConfig: {
43
+ ...N,
44
+ ...a.descriptionConfig ? a.descriptionConfig : {}
45
+ }
46
+ };
47
+ }), k = e(() => !t.info.tooltip), o = e(() => `${C.value}-item`), O = () => {
48
+ var a;
49
+ return (a = t.onClick) == null ? void 0 : a.call(t, h.value);
50
+ }, m = e(() => {
51
+ var a;
52
+ return (a = A.value) == null ? void 0 : a.includes(h.value);
53
+ }), w = e(() => v.value ? m.value : !0);
54
+ return () => l("div", K(R.value, {
55
+ class: i(o.value, {
56
+ [`${o.value}-${$.value}${t.nextStatus ? `-${t.nextStatus}` : ""}`]: $.value
57
+ }, c.class),
58
+ style: c.style
59
+ }), [l("div", {
60
+ class: i(`${o.value}-header`, r.value.itemHeader),
61
+ style: f.value.itemHeader,
62
+ onClick: O
63
+ }, [l(B, {
64
+ icon: L.value,
65
+ class: `${o.value}-icon`
66
+ }, null), l("div", {
67
+ class: i(`${o.value}-header-box`, {
68
+ [`${o.value}-collapsible`]: v.value && s.value
48
69
  })
49
- }, [a(g.Text, {
70
+ }, [l(P.Text, {
50
71
  strong: !0,
51
- ellipsis: {
52
- tooltip: {
53
- placement: v.value === "rtl" ? "topRight" : "topLeft",
54
- title: C.value
55
- }
56
- },
57
- class: `${l.value}-title`
72
+ class: `${o.value}-title`
58
73
  }, {
59
- default: () => [c.value && u.value && (v.value === "rtl" ? a(V, {
60
- class: `${l.value}-collapse-icon`,
61
- rotate: f.value ? -90 : 0
62
- }, null) : a(j, {
63
- class: `${l.value}-collapse-icon`,
64
- rotate: f.value ? 90 : 0
65
- }, null)), C.value]
66
- }), m.value && a(g.Text, {
67
- class: `${l.value}-desc`,
68
- ellipsis: {
69
- tooltip: {
70
- placement: v.value === "rtl" ? "topRight" : "topLeft",
71
- title: m.value
72
- }
73
- },
74
+ default: () => [v.value && s.value && (g.value === "rtl" ? l(E, {
75
+ class: `${o.value}-collapse-icon`,
76
+ rotate: m.value ? -90 : 0
77
+ }, null) : l(G, {
78
+ class: `${o.value}-collapse-icon`,
79
+ rotate: m.value ? 90 : 0
80
+ }, null)), k.value ? d.value : l(S, p.value.titleConfig, {
81
+ default: () => [d.value]
82
+ })]
83
+ }), u.value && l(P.Text, {
84
+ class: `${o.value}-desc`,
74
85
  type: "secondary"
75
86
  }, {
76
- default: () => [m.value]
77
- })]), $.value && a("div", {
78
- class: `${l.value}-extra`
79
- }, [$.value])]), a(X, {
80
- prefixCls: h.value
87
+ default: () => [k.value ? u.value : l(S, p.value.descriptionConfig, {
88
+ default: () => [u.value]
89
+ })]
90
+ })]), x.value && l("div", {
91
+ class: `${o.value}-extra`
92
+ }, [x.value])]), l(J, {
93
+ prefixCls: C.value
81
94
  }, {
82
- default: () => [u.value && O(a("div", {
83
- class: n(`${l.value}-content`)
84
- }, [a("div", {
85
- class: n(`${l.value}-content-box`, r.value.itemContent),
86
- style: d.value.itemContent
87
- }, [u.value])]), [[w, R.value]])]
88
- }), y.value && a("div", {
89
- class: n(`${l.value}-footer`, r.value.itemFooter),
90
- style: d.value.itemFooter
95
+ default: () => [s.value && V(l("div", {
96
+ class: i(`${o.value}-content`)
97
+ }, [l("div", {
98
+ class: i(`${o.value}-content-box`, r.value.itemContent),
99
+ style: f.value.itemContent
100
+ }, [s.value])]), [[j, w.value]])]
101
+ }), y.value && l("div", {
102
+ class: i(`${o.value}-footer`, r.value.itemFooter),
103
+ style: f.value.itemFooter
91
104
  }, [y.value])]);
92
105
  }
93
106
  });
94
107
  export {
95
- U as default
108
+ te as default
96
109
  };
@@ -1,28 +1,28 @@
1
1
  import "../../_util/cssinjs/StyleContext.mjs";
2
2
  import "vue";
3
- import { unit as S } from "../../_util/cssinjs/util.mjs";
3
+ import { unit as d } from "../../_util/cssinjs/util.mjs";
4
4
  import "../../_util/cssinjs/theme/ThemeCache.mjs";
5
5
  import "../../_util/warning.mjs";
6
6
  import "../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";
7
7
  import { merge as h } from "../../_util/cssinjs-utils/util/statistic.mjs";
8
8
  import { genStyleHooks as g } from "../../theme/genStyleUtils.mjs";
9
9
  import "../../transition-collapse/index.mjs";
10
- import { THOUGHT_CHAIN_ITEM_STATUS as a } from "../interface.mjs";
10
+ import { THOUGHT_CHAIN_ITEM_STATUS as m } from "../interface.mjs";
11
11
  import { genTransitionCollapseStyle as u } from "../../transition-collapse/style/index.mjs";
12
12
  const f = (e) => {
13
13
  const { componentCls: t } = e, i = `${t}-item`, o = {
14
- [a.PENDING]: e.colorPrimaryText,
15
- [a.SUCCESS]: e.colorSuccessText,
16
- [a.ERROR]: e.colorErrorText
14
+ [m.PENDING]: e.colorPrimaryText,
15
+ [m.SUCCESS]: e.colorSuccessText,
16
+ [m.ERROR]: e.colorErrorText
17
17
  }, l = Object.keys(o);
18
18
  return l.reduce((c, r) => {
19
19
  const s = o[r];
20
- return l.forEach((m) => {
21
- const d = `& ${i}-${r}-${m}`, p = r === m ? {} : {
20
+ return l.forEach((a) => {
21
+ const S = `& ${i}-${r}-${a}`, p = r === a ? {} : {
22
22
  backgroundColor: "none !important",
23
- backgroundImage: `linear-gradient(${s}, ${o[m]})`
23
+ backgroundImage: `linear-gradient(${s}, ${o[a]})`
24
24
  };
25
- c[d] = {
25
+ c[S] = {
26
26
  [`& ${i}-icon, & > *::before`]: {
27
27
  backgroundColor: `${s} !important`
28
28
  },
@@ -112,15 +112,21 @@ const f = (e) => {
112
112
  overflow: "hidden",
113
113
  [`& ${i}-title`]: {
114
114
  height: e.itemSize,
115
- lineHeight: `${S(e.itemSize)}`,
115
+ lineHeight: `${d(e.itemSize)}`,
116
116
  maxHeight: e.itemSize,
117
117
  fontSize: e.itemFontSize,
118
+ overflow: "hidden",
119
+ textOverflow: "ellipsis",
120
+ whiteSpace: "nowrap",
118
121
  [`& ${i}-collapse-icon`]: {
119
122
  marginInlineEnd: e.marginXS
120
123
  }
121
124
  },
122
125
  [`& ${i}-desc`]: {
123
- fontSize: e.itemFontSize
126
+ fontSize: e.itemFontSize,
127
+ overflow: "hidden",
128
+ textOverflow: "ellipsis",
129
+ whiteSpace: "nowrap"
124
130
  }
125
131
  }
126
132
  },
@@ -134,7 +140,7 @@ const f = (e) => {
134
140
  maxWidth: `calc(100% - ${e.itemSize})`,
135
141
  borderRadius: e.borderRadiusLG,
136
142
  backgroundColor: e.colorBgContainer,
137
- border: `${S(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`
143
+ border: `${d(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`
138
144
  }
139
145
  },
140
146
  [`& ${i}-footer`]: {
@@ -190,7 +196,7 @@ const f = (e) => {
190
196
  }
191
197
  }
192
198
  };
193
- }, E = g("ThoughtChain", (e) => {
199
+ }, L = g("ThoughtChain", (e) => {
194
200
  const t = h(e, {
195
201
  // small size tokens
196
202
  itemFontSizeSM: e.fontSizeSM,
@@ -211,5 +217,5 @@ const f = (e) => {
211
217
  ];
212
218
  });
213
219
  export {
214
- E as default
220
+ L as default
215
221
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("../attachments/Attachments2.js"),B=require("ant-design-vue"),E=require("../_util/hooks/use-x-component-config.js"),F=require("../x-provider/hooks/use-x-provider-context.js");require("../x-provider/context.js");const A=require("./hooks/useTypedEffect.js"),I=require("./hooks/useTypingConfig.js"),X=require("./loading.js"),j=require("./style/index.js"),D=require("./context.js"),M=t.defineComponent({name:"AXBubble",__name:"Bubble",props:t.mergeDefaults({prefixCls:null,rootClassName:null,styles:null,classNames:null,avatar:null,placement:null,loading:{type:Boolean},typing:null,content:null,messageRender:{type:Function},loadingRender:{type:Function},variant:null,shape:null,onTypingComplete:null,header:null,footer:{type:Function}},{classNames:()=>({}),styles:()=>({}),placement:"start",loading:!1,content:"",variant:"filled"}),setup(e,{expose:g}){const y=k.createPropsRestProxy(e,["prefixCls","rootClassName","classNames","styles","avatar","placement","loading","loadingRender","typing","content","messageRender","variant","shape","onTypingComplete","header","footer"]);t.toRef(e,"content"),t.toRef(e,"prefixCls");const n=t.useSlots(),f=t.ref(e.content);t.watch(()=>e.content,()=>{f.value=e.content});const{onUpdate:u}=t.unref(D.useBubbleContextInject()),v=t.ref(null),{direction:b,getPrefixCls:h}=F.default(),a=h("bubble",e.prefixCls),l=E.default("bubble"),[C,N,V,m]=I.default(()=>e.typing),[s,r]=A.default(f,C,N,V),c=t.ref(!1);t.watch(s,()=>{u==null||u()}),t.watchEffect(()=>{var o;!r.value&&!e.loading?c.value||(c.value=!0,(o=e.onTypingComplete)==null||o.call(e)):c.value=!1});const[x,R,$]=j.default(()=>a),q=t.computed(()=>[a,e.rootClassName,l.value.className,R.value,$,`${a}-${e.placement}`,{[`${a}-rtl`]:b.value==="rtl"},{[`${a}-typing`]:r.value&&!e.loading&&!e.messageRender&&!n.message&&!m.value}]),P=t.computed(()=>n.avatar?n.avatar():t.isVNode(e.avatar)?e.avatar:t.createVNode(B.Avatar,e.avatar,null)),T=t.computed(()=>n.message?n.message({content:s.value}):e.messageRender?e.messageRender(s.value):s.value),S=t.computed(()=>e.loading?n.loading?n.loading():e.loadingRender?e.loadingRender():t.createVNode(X.default,{prefixCls:a},null):t.createVNode(t.Fragment,null,[T.value,r.value&&t.toValue(m)])),w=t.computed(()=>{const o=t.createVNode("div",{style:{...l.value.styles.content,...e.styles.content},class:[`${a}-content`,`${a}-content-${e.variant}`,{[`${a}-content-${e.shape}`]:e.shape},l.value.classNames.content,e.classNames.content]},[t.toValue(S)]),i=n.header?n.header():e.header,d=n.footer?n.footer({content:s.value}):typeof e.footer=="function"?e.footer(s.value):e.footer;return i||d?t.createVNode("div",{class:`${a}-content-wrapper`},[i&&t.createVNode("div",{class:[`${a}-header`,l.value.classNames.header,e.classNames.header],style:{...l.value.styles.header,...e.styles.header}},[i]),o,d&&t.createVNode("div",{class:[`${a}-footer`,l.value.classNames.footer,e.classNames.footer],style:{...l.value.styles.footer,...e.styles.footer}},[d])]):o});return g({nativeElement:v}),()=>x(t.createVNode("div",t.mergeProps({style:{...l.value.style},class:t.toValue(q)},y,{ref:v}),[(n.avatar||e.avatar)&&t.createVNode("div",{style:{...l.value.styles.avatar,...e.styles.avatar},class:[`${a}-avatar`,l.value.classNames.avatar,e.classNames.avatar]},[t.toValue(P)]),t.toValue(w)]))}});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("../attachments/Attachments2.js"),B=require("ant-design-vue"),E=require("../_util/hooks/use-x-component-config.js"),A=require("../x-provider/hooks/use-x-provider-context.js");require("../x-provider/context.js");const F=require("./hooks/useTypedEffect.js"),I=require("./hooks/useTypingConfig.js"),X=require("./loading.js"),j=require("./style/index.js"),D=require("./context.js"),M=t.defineComponent({name:"AXBubble",__name:"Bubble",props:t.mergeDefaults({prefixCls:null,rootClassName:null,styles:null,classNames:null,avatar:null,placement:null,loading:{type:Boolean},typing:null,content:null,messageRender:{type:Function},loadingRender:{type:Function},variant:null,shape:null,onTypingComplete:null,header:null,footer:null},{classNames:()=>({}),styles:()=>({}),placement:"start",loading:!1,content:"",variant:"filled"}),setup(e,{expose:g}){const y=k.createPropsRestProxy(e,["prefixCls","rootClassName","classNames","styles","avatar","placement","loading","loadingRender","typing","content","messageRender","variant","shape","onTypingComplete","header","footer"]);t.toRef(e,"content"),t.toRef(e,"prefixCls");const n=t.useSlots(),f=t.ref(e.content);t.watch(()=>e.content,()=>{f.value=e.content});const{onUpdate:u}=t.unref(D.useBubbleContextInject()),v=t.ref(null),{direction:b,getPrefixCls:h}=A.default(),a=h("bubble",e.prefixCls),l=E.default("bubble"),[C,N,V,m]=I.default(()=>e.typing),[s,r]=F.default(f,C,N,V),c=t.ref(!1);t.watch(s,()=>{u==null||u()}),t.watchEffect(()=>{var o;!r.value&&!e.loading?c.value||(c.value=!0,(o=e.onTypingComplete)==null||o.call(e)):c.value=!1});const[x,R,$]=j.default(()=>a),q=t.computed(()=>[a,e.rootClassName,l.value.className,R.value,$,`${a}-${e.placement}`,{[`${a}-rtl`]:b.value==="rtl"},{[`${a}-typing`]:r.value&&!e.loading&&!e.messageRender&&!n.message&&!m.value}]),P=t.computed(()=>n.avatar?n.avatar():t.isVNode(e.avatar)?e.avatar:t.createVNode(B.Avatar,e.avatar,null)),T=t.computed(()=>n.message?n.message({content:s.value}):e.messageRender?e.messageRender(s.value):s.value),S=t.computed(()=>e.loading?n.loading?n.loading():e.loadingRender?e.loadingRender():t.createVNode(X.default,{prefixCls:a},null):t.createVNode(t.Fragment,null,[T.value,r.value&&t.toValue(m)])),w=t.computed(()=>{const o=t.createVNode("div",{style:{...l.value.styles.content,...e.styles.content},class:[`${a}-content`,`${a}-content-${e.variant}`,{[`${a}-content-${e.shape}`]:e.shape},l.value.classNames.content,e.classNames.content]},[t.toValue(S)]),i=n.header?n.header({content:s.value}):typeof e.header=="function"?e.header(s.value):e.header,d=n.footer?n.footer({content:s.value}):typeof e.footer=="function"?e.footer(s.value):e.footer;return i||d?t.createVNode("div",{class:`${a}-content-wrapper`},[i&&t.createVNode("div",{class:[`${a}-header`,l.value.classNames.header,e.classNames.header],style:{...l.value.styles.header,...e.styles.header}},[i]),o,d&&t.createVNode("div",{class:[`${a}-footer`,l.value.classNames.footer,e.classNames.footer],style:{...l.value.styles.footer,...e.styles.footer}},[d])]):o});return g({nativeElement:v}),()=>x(t.createVNode("div",t.mergeProps({style:{...l.value.style},class:t.toValue(q)},y,{ref:v}),[(n.avatar||e.avatar)&&t.createVNode("div",{style:{...l.value.styles.avatar,...e.styles.avatar},class:[`${a}-avatar`,l.value.classNames.avatar,e.classNames.avatar]},[t.toValue(P)]),t.toValue(w)]))}});exports.default=M;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../_util/hooks/use-event-callback.js"),y=require("../../_util/hooks/use-state.js");function d(l){const[s,r]=y.default(l.value.length),t=e.computed(()=>l.value.slice(0,e.unref(s))),o=e.computed(()=>{const u=e.unref(t)[e.unref(t).length-1];return u?u.key:null});e.watch(l,()=>{var u;if(!(e.unref(t).length&&e.unref(t).every((n,f)=>{var a;return n.key===((a=l.value[f])==null?void 0:a.key)}))){if(e.unref(t).length===0)r(1);else for(let n=0;n<e.unref(t).length;n+=1)if(e.unref(t)[n].key!==((u=l.value[n])==null?void 0:u.key)){r(n);break}}},{immediate:!0,deep:!0});const i=c.useEventCallback(u=>{u===e.unref(o)&&r(e.unref(s)+1)});return[t,i]}exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../_util/hooks/use-event-callback.js"),y=require("../../_util/hooks/use-state.js");function d(l){const[a,r]=y.default(l.value.length),t=e.computed(()=>l.value.slice(0,e.unref(a))),o=e.computed(()=>{const u=e.unref(t)[e.unref(t).length-1];return u?u.key:null});e.watch(l,()=>{var u;if(r(l.value.length),!(e.unref(t).length&&e.unref(t).every((n,f)=>{var s;return n.key===((s=l.value[f])==null?void 0:s.key)}))){if(e.unref(t).length===0)r(1);else for(let n=0;n<e.unref(t).length;n+=1)if(e.unref(t)[n].key!==((u=l.value[n])==null?void 0:u.key)){r(n);break}}},{immediate:!0,deep:!0});const i=c.useEventCallback(u=>{u===e.unref(o)&&r(e.unref(a)+1)});return[t,i]}exports.default=d;