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,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as $, mergeDefaults as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as $, mergeDefaults as q, toRef as T, useSlots as V, computed as d, useTemplateRef as F, ref as X, watch as B, createVNode as i, Fragment as M } from "vue";
|
|
2
|
+
import k from "../_util/hooks/use-x-component-config.mjs";
|
|
3
|
+
import z from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
4
4
|
import "../x-provider/context.mjs";
|
|
5
5
|
import "ant-design-vue";
|
|
6
|
-
import
|
|
6
|
+
import G from "./PlaceholderUploader.mjs";
|
|
7
7
|
import L from "./DropArea.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { _ as
|
|
10
|
-
import { AttachmentContextProvider as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
function
|
|
8
|
+
import H from "./SilentUploader.mjs";
|
|
9
|
+
import { _ as J } from "./FileList/FileList2.mjs";
|
|
10
|
+
import { AttachmentContextProvider as K } from "./context.mjs";
|
|
11
|
+
import Q from "./style/index.mjs";
|
|
12
|
+
import W from "../_util/hooks/use-state.mjs";
|
|
13
|
+
function Y(e, f) {
|
|
14
14
|
const s = /* @__PURE__ */ Object.create(null);
|
|
15
15
|
for (const r in e)
|
|
16
|
-
|
|
16
|
+
f.includes(r) || Object.defineProperty(s, r, { enumerable: !0, get: () => e[r] });
|
|
17
17
|
return s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Z(e) {
|
|
20
20
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
21
21
|
}
|
|
22
22
|
var x = { exports: {} };
|
|
@@ -26,10 +26,10 @@ var x = { exports: {} };
|
|
|
26
26
|
http://jedwatson.github.io/classnames
|
|
27
27
|
*/
|
|
28
28
|
var j;
|
|
29
|
-
function
|
|
29
|
+
function _() {
|
|
30
30
|
return j || (j = 1, function(e) {
|
|
31
31
|
(function() {
|
|
32
|
-
var
|
|
32
|
+
var f = {}.hasOwnProperty;
|
|
33
33
|
function s() {
|
|
34
34
|
for (var l = "", t = 0; t < arguments.length; t++) {
|
|
35
35
|
var o = arguments[t];
|
|
@@ -48,7 +48,7 @@ function Y() {
|
|
|
48
48
|
return l.toString();
|
|
49
49
|
var t = "";
|
|
50
50
|
for (var o in l)
|
|
51
|
-
|
|
51
|
+
f.call(l, o) && l[o] && (t = v(t, o));
|
|
52
52
|
return t;
|
|
53
53
|
}
|
|
54
54
|
function v(l, t) {
|
|
@@ -58,11 +58,11 @@ function Y() {
|
|
|
58
58
|
})();
|
|
59
59
|
}(x)), x.exports;
|
|
60
60
|
}
|
|
61
|
-
var
|
|
62
|
-
const
|
|
61
|
+
var ee = _();
|
|
62
|
+
const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
|
|
63
63
|
name: "AXAttachments",
|
|
64
64
|
__name: "Attachments",
|
|
65
|
-
props:
|
|
65
|
+
props: q({
|
|
66
66
|
capture: null,
|
|
67
67
|
type: null,
|
|
68
68
|
name: null,
|
|
@@ -130,15 +130,15 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
130
130
|
styles: () => ({})
|
|
131
131
|
}),
|
|
132
132
|
setup(e, {
|
|
133
|
-
expose:
|
|
133
|
+
expose: f
|
|
134
134
|
}) {
|
|
135
|
-
const s =
|
|
136
|
-
|
|
137
|
-
const r =
|
|
135
|
+
const s = Y(e, ["prefixCls", "rootClassName", "rootStyle", "className", "style", "items", "children", "getDropContainer", "placeholder", "onChange", "onRemove", "overflow", "imageProps", "disabled", "classNames", "styles"]);
|
|
136
|
+
T(e, "prefixCls");
|
|
137
|
+
const r = V(), {
|
|
138
138
|
getPrefixCls: v,
|
|
139
139
|
direction: l
|
|
140
|
-
} =
|
|
141
|
-
|
|
140
|
+
} = z(), t = v("attachment", e.prefixCls), o = k("attachments"), C = d(() => o.value.classNames), y = d(() => o.value.styles), w = F("attachments-container"), R = X(null), O = F("placeholder-uploader"), [I, A, E] = Q(t), p = d(() => m(A.value, E)), [h, S] = W(e.items);
|
|
141
|
+
B(() => e.items, () => {
|
|
142
142
|
S(e.items);
|
|
143
143
|
});
|
|
144
144
|
const P = (a) => {
|
|
@@ -148,41 +148,40 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
148
148
|
...s,
|
|
149
149
|
fileList: h.value,
|
|
150
150
|
onChange: P
|
|
151
|
-
})),
|
|
151
|
+
})), U = (a) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(a) : e.onRemove).then((n) => {
|
|
152
152
|
if (n === !1)
|
|
153
153
|
return;
|
|
154
|
-
const
|
|
154
|
+
const u = h.value.filter((c) => c.uid !== a.uid);
|
|
155
155
|
P({
|
|
156
156
|
file: {
|
|
157
157
|
...a,
|
|
158
158
|
status: "removed"
|
|
159
159
|
},
|
|
160
|
-
fileList:
|
|
160
|
+
fileList: u
|
|
161
161
|
});
|
|
162
|
-
}), N = (a, n,
|
|
163
|
-
|
|
162
|
+
}), N = (a, n, u) => {
|
|
163
|
+
u && (u.value = O.value);
|
|
164
|
+
const c = r.placeholder ? r.placeholder({
|
|
164
165
|
type: a
|
|
165
166
|
}) : typeof e.placeholder == "function" ? e.placeholder(a) : e.placeholder;
|
|
166
|
-
return i(
|
|
167
|
-
placeholder:
|
|
167
|
+
return i(G, {
|
|
168
|
+
placeholder: c,
|
|
168
169
|
upload: g.value,
|
|
169
170
|
prefixCls: t,
|
|
170
|
-
className:
|
|
171
|
+
className: m(C.value.placeholder, e.classNames.placeholder),
|
|
171
172
|
style: {
|
|
172
173
|
...y.value.placeholder,
|
|
173
174
|
...e.styles.placeholder,
|
|
174
175
|
...n == null ? void 0 : n.style
|
|
175
|
-
}
|
|
176
|
+
},
|
|
177
|
+
ref: "placeholder-uploader"
|
|
176
178
|
}, null);
|
|
177
179
|
}, b = d(() => h.value.length > 0);
|
|
178
|
-
return
|
|
180
|
+
return f({
|
|
179
181
|
nativeElement: w.value,
|
|
180
182
|
upload: (a) => {
|
|
181
|
-
var
|
|
182
|
-
const n = (
|
|
183
|
-
// @ts-expect-error
|
|
184
|
-
(u = (f = R.value) == null ? void 0 : f.nativeElement) == null ? void 0 : u.querySelector('input[type="file"]')
|
|
185
|
-
);
|
|
183
|
+
var u, c;
|
|
184
|
+
const n = (c = (u = R.value.nativeElement).querySelector) == null ? void 0 : c.call(u, 'input[type="file"]');
|
|
186
185
|
if (n) {
|
|
187
186
|
const D = new DataTransfer();
|
|
188
187
|
D.items.add(a), n.files = D.files, n.dispatchEvent(new Event("change", {
|
|
@@ -190,12 +189,12 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
190
189
|
}));
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
|
-
}), () =>
|
|
192
|
+
}), () => I(i(K, {
|
|
194
193
|
value: {
|
|
195
194
|
disabled: e.disabled
|
|
196
195
|
}
|
|
197
196
|
}, {
|
|
198
|
-
default: () => [e.children ? i(
|
|
197
|
+
default: () => [e.children ? i(M, null, [i(H, {
|
|
199
198
|
upload: g.value,
|
|
200
199
|
rootClassName: e.rootClassName,
|
|
201
200
|
ref: "attachments-upload",
|
|
@@ -203,10 +202,10 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
203
202
|
}, null), i(L, {
|
|
204
203
|
getDropContainer: e.getDropContainer,
|
|
205
204
|
prefixCls: t,
|
|
206
|
-
className:
|
|
205
|
+
className: m(p.value, e.rootClassName),
|
|
207
206
|
children: N("drop")
|
|
208
207
|
}, null)]) : i("div", {
|
|
209
|
-
class:
|
|
208
|
+
class: m(t, p.value, {
|
|
210
209
|
[`${t}-rtl`]: l.value === "rtl"
|
|
211
210
|
}, e.className, e.rootClassName),
|
|
212
211
|
style: {
|
|
@@ -215,13 +214,13 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
215
214
|
},
|
|
216
215
|
dir: l.value || "ltr",
|
|
217
216
|
ref: "attachments-container"
|
|
218
|
-
}, [i(
|
|
217
|
+
}, [i(J, {
|
|
219
218
|
prefixCls: t,
|
|
220
219
|
items: h.value,
|
|
221
|
-
onRemove:
|
|
220
|
+
onRemove: U,
|
|
222
221
|
overflow: e.overflow,
|
|
223
222
|
upload: g.value,
|
|
224
|
-
listClassName:
|
|
223
|
+
listClassName: m(C.value.list, e.classNames.list),
|
|
225
224
|
listStyle: {
|
|
226
225
|
...y.value.list,
|
|
227
226
|
...e.styles.list,
|
|
@@ -229,7 +228,7 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
229
228
|
display: "none"
|
|
230
229
|
}
|
|
231
230
|
},
|
|
232
|
-
itemClassName:
|
|
231
|
+
itemClassName: m(C.value.item, e.classNames.item),
|
|
233
232
|
itemStyle: {
|
|
234
233
|
...y.value.item,
|
|
235
234
|
...e.styles.item
|
|
@@ -239,7 +238,7 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
239
238
|
style: {
|
|
240
239
|
display: "none"
|
|
241
240
|
}
|
|
242
|
-
} : {}, R
|
|
241
|
+
} : {}, R), i(L, {
|
|
243
242
|
getDropContainer: e.getDropContainer || (() => w.value),
|
|
244
243
|
prefixCls: t,
|
|
245
244
|
className: p.value,
|
|
@@ -249,7 +248,7 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
249
248
|
}
|
|
250
249
|
});
|
|
251
250
|
export {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
c
|
|
251
|
+
de as _,
|
|
252
|
+
Y as a,
|
|
253
|
+
m as c
|
|
255
254
|
};
|