ant-design-x-vue 1.2.0 → 1.2.2
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/README.en.md +6 -0
- package/README.md +11 -0
- package/dist/index.umd.js +9 -43
- package/es/attachments/Attachments2.mjs +50 -51
- package/es/attachments/FileList/FileList2.mjs +712 -932
- package/es/attachments/PlaceholderUploader.mjs +30 -27
- package/es/attachments/SilentUploader.mjs +12 -9
- package/es/bubble/Bubble.mjs +36 -36
- package/es/sender/components/LoadingButton.mjs +5 -5
- package/es/theme/useToken.mjs +54 -310
- package/es/thought-chain/hooks/useCollapsible.mjs +25 -17
- package/es/use-x-agent/use-x-agent.mjs +41 -34
- package/es/use-x-chat/use-x-chat.mjs +98 -69
- package/es/x-provider/hooks/use-x-provider-context.mjs +11 -16
- package/es/x-request/x-request.mjs +55 -53
- package/lib/attachments/Attachments2.js +2 -2
- package/lib/attachments/FileList/FileList2.js +4 -4
- package/lib/attachments/PlaceholderUploader.js +1 -1
- package/lib/attachments/SilentUploader.js +1 -1
- package/lib/bubble/Bubble.js +1 -1
- package/lib/sender/components/LoadingButton.js +1 -1
- package/lib/theme/useToken.js +1 -35
- package/lib/thought-chain/hooks/useCollapsible.js +1 -1
- package/lib/use-x-agent/use-x-agent.js +1 -1
- package/lib/use-x-chat/use-x-chat.js +1 -1
- package/lib/x-provider/hooks/use-x-provider-context.js +1 -1
- package/lib/x-request/x-request.js +1 -1
- package/package.json +1 -1
- package/typings/attachments/PlaceholderUploader.vue.d.ts +1 -446
- package/typings/attachments/SilentUploader.vue.d.ts +1 -446
- package/typings/bubble/Bubble.vue.d.ts +2 -2
- package/typings/bubble/index.d.ts +4 -4
- package/typings/use-x-agent/use-x-agent.d.ts +3 -1
- package/typings/use-x-chat/use-x-chat.d.ts +15 -1
- package/typings/x-request/x-request.d.ts +4 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, mergeDefaults as x, computed as o, useTemplateRef as $, isVNode as c, createVNode as t, mergeProps as C } from "vue";
|
|
2
2
|
import { c as T } from "./Attachments2.mjs";
|
|
3
|
-
import { useAttachmentContextInject as
|
|
4
|
-
import
|
|
5
|
-
import { Flex as
|
|
6
|
-
const
|
|
3
|
+
import { useAttachmentContextInject as A } from "./context.mjs";
|
|
4
|
+
import b from "../_util/hooks/use-state.mjs";
|
|
5
|
+
import { Flex as N, Typography as s, Upload as U } from "ant-design-vue";
|
|
6
|
+
const L = /* @__PURE__ */ D({
|
|
7
7
|
name: "AXAttachmentsPlaceholderUploader",
|
|
8
8
|
__name: "PlaceholderUploader",
|
|
9
|
-
props:
|
|
9
|
+
props: x({
|
|
10
10
|
prefixCls: null,
|
|
11
11
|
placeholder: null,
|
|
12
12
|
upload: null,
|
|
@@ -18,49 +18,52 @@ const E = /* @__PURE__ */ y({
|
|
|
18
18
|
setup(e, {
|
|
19
19
|
expose: i
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
21
|
+
const l = `${e.prefixCls}-placeholder`, r = o(() => e.placeholder || {}), u = $("upload-dragger"), d = A(), [p, n] = b(!1), f = () => {
|
|
22
22
|
n(!0);
|
|
23
|
-
}, m = (
|
|
24
|
-
|
|
23
|
+
}, m = (a) => {
|
|
24
|
+
a.currentTarget.contains(a.relatedTarget) || n(!1);
|
|
25
25
|
}, g = () => {
|
|
26
26
|
n(!1);
|
|
27
|
-
}
|
|
27
|
+
}, h = o(() => {
|
|
28
|
+
var a;
|
|
29
|
+
return (a = u.value) == null ? void 0 : a.$el;
|
|
30
|
+
});
|
|
28
31
|
i({
|
|
29
|
-
nativeElement:
|
|
32
|
+
nativeElement: h
|
|
30
33
|
});
|
|
31
|
-
const
|
|
34
|
+
const v = (a) => Array.isArray(a) && a.every(c), y = o(() => c(e.placeholder) || v(e.placeholder) ? e.placeholder : t(N, {
|
|
32
35
|
align: "center",
|
|
33
36
|
justify: "center",
|
|
34
37
|
vertical: !0,
|
|
35
|
-
class: `${
|
|
38
|
+
class: `${l}-inner`
|
|
36
39
|
}, {
|
|
37
|
-
default: () => [
|
|
38
|
-
class: `${
|
|
40
|
+
default: () => [t(s.Text, {
|
|
41
|
+
class: `${l}-icon`
|
|
39
42
|
}, {
|
|
40
43
|
default: () => [r.value.icon]
|
|
41
|
-
}),
|
|
42
|
-
class: `${
|
|
44
|
+
}), t(s.Title, {
|
|
45
|
+
class: `${l}-title`,
|
|
43
46
|
level: 5
|
|
44
47
|
}, {
|
|
45
48
|
default: () => [r.value.title]
|
|
46
|
-
}),
|
|
47
|
-
class: `${
|
|
49
|
+
}), t(s.Text, {
|
|
50
|
+
class: `${l}-description`,
|
|
48
51
|
type: "secondary"
|
|
49
52
|
}, {
|
|
50
53
|
default: () => [r.value.description]
|
|
51
54
|
})]
|
|
52
55
|
}));
|
|
53
|
-
return () =>
|
|
54
|
-
class: T(
|
|
55
|
-
[`${
|
|
56
|
-
[`${
|
|
56
|
+
return () => t("div", {
|
|
57
|
+
class: T(l, {
|
|
58
|
+
[`${l}-drag-in`]: p.value,
|
|
59
|
+
[`${l}-disabled`]: d.value.disabled
|
|
57
60
|
}, e.className),
|
|
58
61
|
onDragenter: f,
|
|
59
62
|
onDragleave: m,
|
|
60
63
|
onDrop: g,
|
|
61
|
-
"aria-hidden":
|
|
64
|
+
"aria-hidden": d.value.disabled,
|
|
62
65
|
style: e.style
|
|
63
|
-
}, [
|
|
66
|
+
}, [t(U.Dragger, C({
|
|
64
67
|
showUploadList: !1
|
|
65
68
|
}, e.upload, {
|
|
66
69
|
ref: "upload-dragger",
|
|
@@ -70,10 +73,10 @@ const E = /* @__PURE__ */ y({
|
|
|
70
73
|
background: "transparent"
|
|
71
74
|
}
|
|
72
75
|
}), {
|
|
73
|
-
default: () => [
|
|
76
|
+
default: () => [y.value]
|
|
74
77
|
})]);
|
|
75
78
|
}
|
|
76
79
|
});
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
L as default
|
|
79
82
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Upload as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as n, useTemplateRef as p, computed as r, createVNode as d, mergeProps as u } from "vue";
|
|
2
|
+
import { Upload as s } from "ant-design-vue";
|
|
3
|
+
const i = /* @__PURE__ */ n({
|
|
4
4
|
name: "AXAttachmentsSilentUploader",
|
|
5
5
|
__name: "SilentUploader",
|
|
6
6
|
props: {
|
|
@@ -9,12 +9,15 @@ const u = /* @__PURE__ */ a({
|
|
|
9
9
|
rootClassName: null
|
|
10
10
|
},
|
|
11
11
|
setup(e, {
|
|
12
|
-
expose:
|
|
12
|
+
expose: o
|
|
13
13
|
}) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
14
|
+
const t = p("upload"), a = r(() => {
|
|
15
|
+
var l;
|
|
16
|
+
return (l = t.value) == null ? void 0 : l.$el;
|
|
17
|
+
});
|
|
18
|
+
return o({
|
|
19
|
+
nativeElement: a
|
|
20
|
+
}), () => d(s, u(e.upload, {
|
|
18
21
|
showUploadList: !1,
|
|
19
22
|
ref: "upload"
|
|
20
23
|
}), {
|
|
@@ -23,5 +26,5 @@ const u = /* @__PURE__ */ a({
|
|
|
23
26
|
}
|
|
24
27
|
});
|
|
25
28
|
export {
|
|
26
|
-
|
|
29
|
+
i as default
|
|
27
30
|
};
|
package/es/bubble/Bubble.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as j, mergeDefaults as D, toRef as
|
|
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";
|
|
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";
|
|
@@ -46,36 +46,36 @@ const ce = /* @__PURE__ */ j({
|
|
|
46
46
|
variant: "filled"
|
|
47
47
|
}),
|
|
48
48
|
setup(e, {
|
|
49
|
-
expose:
|
|
49
|
+
expose: x
|
|
50
50
|
}) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const a = H(),
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const $ = K(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
|
|
52
|
+
h(e, "content"), h(e, "prefixCls");
|
|
53
|
+
const a = H(), g = d(e.content);
|
|
54
|
+
N(() => e.content, () => {
|
|
55
|
+
g.value = e.content;
|
|
56
56
|
});
|
|
57
57
|
const {
|
|
58
58
|
onUpdate: c
|
|
59
|
-
} = k(U()),
|
|
60
|
-
direction:
|
|
61
|
-
getPrefixCls:
|
|
62
|
-
} = O(), t =
|
|
63
|
-
|
|
59
|
+
} = k(U()), y = d(null), {
|
|
60
|
+
direction: b,
|
|
61
|
+
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);
|
|
63
|
+
N(s, () => {
|
|
64
64
|
c == null || c();
|
|
65
65
|
}), q(() => {
|
|
66
|
-
var
|
|
67
|
-
!u.value && !e.loading ? m.value || (m.value = !0, (
|
|
66
|
+
var o;
|
|
67
|
+
!u.value && !e.loading ? m.value || (m.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : m.value = !1;
|
|
68
68
|
});
|
|
69
|
-
const [w, B
|
|
70
|
-
[`${t}-rtl`]:
|
|
69
|
+
const [V, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
|
|
70
|
+
[`${t}-rtl`]: b.value === "rtl"
|
|
71
71
|
}, {
|
|
72
|
-
[`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !
|
|
73
|
-
}]),
|
|
74
|
-
content:
|
|
75
|
-
}) : e.messageRender ? e.messageRender(
|
|
72
|
+
[`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !C.value
|
|
73
|
+
}]), F = r(() => a.avatar ? a.avatar() : z(e.avatar) ? e.avatar : l(L, e.avatar, null)), I = r(() => a.message ? a.message({
|
|
74
|
+
content: s.value
|
|
75
|
+
}) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
|
|
76
76
|
prefixCls: t
|
|
77
|
-
}, null) : l(G, null, [
|
|
78
|
-
const
|
|
77
|
+
}, null) : l(G, null, [I.value, u.value && i(C)])), A = r(() => {
|
|
78
|
+
const o = l("div", {
|
|
79
79
|
style: {
|
|
80
80
|
...n.value.styles.content,
|
|
81
81
|
...e.styles.content
|
|
@@ -83,42 +83,42 @@ const ce = /* @__PURE__ */ j({
|
|
|
83
83
|
class: [`${t}-content`, `${t}-content-${e.variant}`, {
|
|
84
84
|
[`${t}-content-${e.shape}`]: e.shape
|
|
85
85
|
}, n.value.classNames.content, e.classNames.content]
|
|
86
|
-
}, [
|
|
87
|
-
content:
|
|
88
|
-
}) : typeof e.footer == "function" ? e.footer(
|
|
89
|
-
return
|
|
86
|
+
}, [i(X)]), f = a.header ? a.header() : e.header, v = a.footer ? a.footer({
|
|
87
|
+
content: s.value
|
|
88
|
+
}) : typeof e.footer == "function" ? e.footer(s.value) : e.footer;
|
|
89
|
+
return f || v ? l("div", {
|
|
90
90
|
class: `${t}-content-wrapper`
|
|
91
|
-
}, [
|
|
91
|
+
}, [f && 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
|
-
}, [
|
|
97
|
+
}, [f]), 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,
|
|
101
101
|
...e.styles.footer
|
|
102
102
|
}
|
|
103
|
-
}, [
|
|
103
|
+
}, [v])]) : o;
|
|
104
104
|
});
|
|
105
|
-
return
|
|
106
|
-
nativeElement:
|
|
107
|
-
}), () =>
|
|
105
|
+
return x({
|
|
106
|
+
nativeElement: y
|
|
107
|
+
}), () => V(l("div", J({
|
|
108
108
|
style: {
|
|
109
109
|
...n.value.style
|
|
110
110
|
// ...(style as object),
|
|
111
111
|
},
|
|
112
|
-
class:
|
|
113
|
-
},
|
|
114
|
-
ref:
|
|
112
|
+
class: i(E)
|
|
113
|
+
}, $, {
|
|
114
|
+
ref: y
|
|
115
115
|
}), [(a.avatar || e.avatar) && l("div", {
|
|
116
116
|
style: {
|
|
117
117
|
...n.value.styles.avatar,
|
|
118
118
|
...e.styles.avatar
|
|
119
119
|
},
|
|
120
120
|
class: [`${t}-avatar`, n.value.classNames.avatar, e.classNames.avatar]
|
|
121
|
-
}, [
|
|
121
|
+
}, [i(F)]), i(A)]));
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as a, mergeDefaults as r, createVNode as l, mergeProps as s } from "vue";
|
|
2
2
|
import { a as i, c as u } from "../../attachments/Attachments2.mjs";
|
|
3
3
|
import c from "./ActionButton/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { useActionButtonContextInject as
|
|
4
|
+
import d from "../StopLoading.mjs";
|
|
5
|
+
import { useActionButtonContextInject as m } from "./ActionButton/context.mjs";
|
|
6
6
|
import { theme as p } from "ant-design-vue";
|
|
7
7
|
const x = /* @__PURE__ */ a({
|
|
8
8
|
name: "AXSenderLoadingButton",
|
|
@@ -27,11 +27,11 @@ const x = /* @__PURE__ */ a({
|
|
|
27
27
|
}, {
|
|
28
28
|
type: "primary",
|
|
29
29
|
shape: "circle",
|
|
30
|
-
icon:
|
|
30
|
+
icon: void 0,
|
|
31
31
|
disabled: void 0
|
|
32
32
|
}),
|
|
33
33
|
setup(e) {
|
|
34
|
-
const o = i(e, ["type", "shape", "icon", "disabled"]), n =
|
|
34
|
+
const o = i(e, ["type", "shape", "icon", "disabled"]), n = m(), {
|
|
35
35
|
token: t
|
|
36
36
|
} = p.useToken();
|
|
37
37
|
return () => l(c, s({
|
|
@@ -47,7 +47,7 @@ const x = /* @__PURE__ */ a({
|
|
|
47
47
|
class: u(`${n.value.prefixCls}-loading-button`),
|
|
48
48
|
action: "onCancel"
|
|
49
49
|
}), {
|
|
50
|
-
default: () => [l(
|
|
50
|
+
default: () => [l(d, {
|
|
51
51
|
className: `${n.value.prefixCls}-loading-icon`
|
|
52
52
|
}, null)]
|
|
53
53
|
});
|