ant-design-x-vue 1.2.1 → 1.2.3
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.md +7 -1
- package/dist/index.umd.js +9 -43
- package/es/attachments/Attachments2.mjs +60 -62
- 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/theme/useToken.mjs +54 -310
- package/es/x-provider/hooks/use-x-provider-context.mjs +11 -16
- 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/theme/useToken.js +1 -35
- package/lib/x-provider/hooks/use-x-provider-context.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
|
@@ -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 f, useTemplateRef as F, watch as X, createVNode as i, Fragment as B } from "vue";
|
|
2
|
+
import M from "../_util/hooks/use-x-component-config.mjs";
|
|
3
|
+
import k 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 z 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 G from "./SilentUploader.mjs";
|
|
9
|
+
import { _ as H } from "./FileList/FileList2.mjs";
|
|
10
|
+
import { AttachmentContextProvider as J } from "./context.mjs";
|
|
11
|
+
import K from "./style/index.mjs";
|
|
12
|
+
import Q from "../_util/hooks/use-state.mjs";
|
|
13
|
+
function W(e, m) {
|
|
14
14
|
const s = /* @__PURE__ */ Object.create(null);
|
|
15
15
|
for (const r in e)
|
|
16
16
|
m.includes(r) || Object.defineProperty(s, r, { enumerable: !0, get: () => e[r] });
|
|
17
17
|
return s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Y(e) {
|
|
20
20
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
21
21
|
}
|
|
22
22
|
var x = { exports: {} };
|
|
@@ -26,14 +26,14 @@ var x = { exports: {} };
|
|
|
26
26
|
http://jedwatson.github.io/classnames
|
|
27
27
|
*/
|
|
28
28
|
var j;
|
|
29
|
-
function
|
|
29
|
+
function Z() {
|
|
30
30
|
return j || (j = 1, function(e) {
|
|
31
31
|
(function() {
|
|
32
32
|
var m = {}.hasOwnProperty;
|
|
33
33
|
function s() {
|
|
34
34
|
for (var l = "", t = 0; t < arguments.length; t++) {
|
|
35
35
|
var o = arguments[t];
|
|
36
|
-
o && (l =
|
|
36
|
+
o && (l = d(l, r(o)));
|
|
37
37
|
}
|
|
38
38
|
return l;
|
|
39
39
|
}
|
|
@@ -48,21 +48,21 @@ function Y() {
|
|
|
48
48
|
return l.toString();
|
|
49
49
|
var t = "";
|
|
50
50
|
for (var o in l)
|
|
51
|
-
m.call(l, o) && l[o] && (t =
|
|
51
|
+
m.call(l, o) && l[o] && (t = d(t, o));
|
|
52
52
|
return t;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function d(l, t) {
|
|
55
55
|
return t ? l ? l + " " + t : l + t : l;
|
|
56
56
|
}
|
|
57
57
|
e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
|
|
58
58
|
})();
|
|
59
59
|
}(x)), x.exports;
|
|
60
60
|
}
|
|
61
|
-
var
|
|
62
|
-
const c = /* @__PURE__ */
|
|
61
|
+
var _ = Z();
|
|
62
|
+
const c = /* @__PURE__ */ Y(_), fe = /* @__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,
|
|
@@ -132,38 +132,38 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
132
132
|
setup(e, {
|
|
133
133
|
expose: m
|
|
134
134
|
}) {
|
|
135
|
-
const s =
|
|
136
|
-
|
|
137
|
-
const r =
|
|
138
|
-
getPrefixCls:
|
|
135
|
+
const s = W(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
|
+
getPrefixCls: d,
|
|
139
139
|
direction: l
|
|
140
|
-
} =
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
} = k(), t = d("attachment", e.prefixCls), o = M("attachments"), C = f(() => o.value.classNames), y = f(() => o.value.styles), w = F("attachments-container"), O = F("placeholder-uploader"), [I, A, E] = K(t), p = f(() => c(A.value, E)), [v, R] = Q(e.items);
|
|
141
|
+
X(() => e.items, () => {
|
|
142
|
+
R(e.items);
|
|
143
143
|
});
|
|
144
|
-
const
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
}, g =
|
|
144
|
+
const S = (n) => {
|
|
145
|
+
var a;
|
|
146
|
+
R(n.fileList), (a = e.onChange) == null || a.call(e, n);
|
|
147
|
+
}, g = f(() => ({
|
|
148
148
|
...s,
|
|
149
|
-
fileList:
|
|
150
|
-
onChange:
|
|
151
|
-
})),
|
|
152
|
-
if (
|
|
149
|
+
fileList: v.value,
|
|
150
|
+
onChange: S
|
|
151
|
+
})), U = (n) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(n) : e.onRemove).then((a) => {
|
|
152
|
+
if (a === !1)
|
|
153
153
|
return;
|
|
154
|
-
const
|
|
155
|
-
|
|
154
|
+
const u = v.value.filter((h) => h.uid !== n.uid);
|
|
155
|
+
S({
|
|
156
156
|
file: {
|
|
157
|
-
...
|
|
157
|
+
...n,
|
|
158
158
|
status: "removed"
|
|
159
159
|
},
|
|
160
|
-
fileList:
|
|
160
|
+
fileList: u
|
|
161
161
|
});
|
|
162
|
-
}), N = (
|
|
162
|
+
}), N = (n, a) => {
|
|
163
163
|
const u = r.placeholder ? r.placeholder({
|
|
164
|
-
type:
|
|
165
|
-
}) : typeof e.placeholder == "function" ? e.placeholder(
|
|
166
|
-
return i(
|
|
164
|
+
type: n
|
|
165
|
+
}) : typeof e.placeholder == "function" ? e.placeholder(n) : e.placeholder;
|
|
166
|
+
return i(z, {
|
|
167
167
|
placeholder: u,
|
|
168
168
|
upload: g.value,
|
|
169
169
|
prefixCls: t,
|
|
@@ -171,31 +171,29 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
171
171
|
style: {
|
|
172
172
|
...y.value.placeholder,
|
|
173
173
|
...e.styles.placeholder,
|
|
174
|
-
...
|
|
175
|
-
}
|
|
174
|
+
...a == null ? void 0 : a.style
|
|
175
|
+
},
|
|
176
|
+
ref: n === "inline" ? "placeholder-uploader" : void 0
|
|
176
177
|
}, null);
|
|
177
|
-
},
|
|
178
|
+
}, P = f(() => v.value.length > 0);
|
|
178
179
|
return m({
|
|
179
180
|
nativeElement: w.value,
|
|
180
|
-
upload: (
|
|
181
|
-
var
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
(u = (f = R.value) == null ? void 0 : f.nativeElement) == null ? void 0 : u.querySelector('input[type="file"]')
|
|
185
|
-
);
|
|
186
|
-
if (n) {
|
|
181
|
+
upload: (n) => {
|
|
182
|
+
var u, h, b;
|
|
183
|
+
const a = (b = (u = O.value) == null ? void 0 : (h = u.nativeElement).querySelector) == null ? void 0 : b.call(h, 'input[type="file"]');
|
|
184
|
+
if (a) {
|
|
187
185
|
const D = new DataTransfer();
|
|
188
|
-
D.items.add(
|
|
186
|
+
D.items.add(n), a.files = D.files, a.dispatchEvent(new Event("change", {
|
|
189
187
|
bubbles: !0
|
|
190
188
|
}));
|
|
191
189
|
}
|
|
192
190
|
}
|
|
193
|
-
}), () =>
|
|
191
|
+
}), () => I(i(J, {
|
|
194
192
|
value: {
|
|
195
193
|
disabled: e.disabled
|
|
196
194
|
}
|
|
197
195
|
}, {
|
|
198
|
-
default: () => [e.children ? i(
|
|
196
|
+
default: () => [e.children ? i(B, null, [i(G, {
|
|
199
197
|
upload: g.value,
|
|
200
198
|
rootClassName: e.rootClassName,
|
|
201
199
|
ref: "attachments-upload",
|
|
@@ -215,17 +213,17 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
215
213
|
},
|
|
216
214
|
dir: l.value || "ltr",
|
|
217
215
|
ref: "attachments-container"
|
|
218
|
-
}, [i(
|
|
216
|
+
}, [i(H, {
|
|
219
217
|
prefixCls: t,
|
|
220
|
-
items:
|
|
221
|
-
onRemove:
|
|
218
|
+
items: v.value,
|
|
219
|
+
onRemove: U,
|
|
222
220
|
overflow: e.overflow,
|
|
223
221
|
upload: g.value,
|
|
224
222
|
listClassName: c(C.value.list, e.classNames.list),
|
|
225
223
|
listStyle: {
|
|
226
224
|
...y.value.list,
|
|
227
225
|
...e.styles.list,
|
|
228
|
-
...!
|
|
226
|
+
...!P.value && {
|
|
229
227
|
display: "none"
|
|
230
228
|
}
|
|
231
229
|
},
|
|
@@ -235,11 +233,11 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
235
233
|
...e.styles.item
|
|
236
234
|
},
|
|
237
235
|
imageProps: e.imageProps
|
|
238
|
-
}, null), N("inline",
|
|
236
|
+
}, null), N("inline", P.value ? {
|
|
239
237
|
style: {
|
|
240
238
|
display: "none"
|
|
241
239
|
}
|
|
242
|
-
} : {}
|
|
240
|
+
} : {}), i(L, {
|
|
243
241
|
getDropContainer: e.getDropContainer || (() => w.value),
|
|
244
242
|
prefixCls: t,
|
|
245
243
|
className: p.value,
|
|
@@ -249,7 +247,7 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
|
|
|
249
247
|
}
|
|
250
248
|
});
|
|
251
249
|
export {
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
fe as _,
|
|
251
|
+
W as a,
|
|
254
252
|
c
|
|
255
253
|
};
|