@aplus-frontend/ui 0.2.0-beta.3 → 0.2.0-beta.4
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/es/src/ap-form/item-text/style/css.d.ts +0 -1
- package/es/src/ap-form/item-text/style/css.js +1 -1
- package/es/src/ap-form/item-text/style/index.d.ts +0 -1
- package/es/src/ap-form/item-text/style/index.js +1 -1
- package/es/src/ap-form/item-text-group/style/css.d.ts +0 -0
- package/es/src/ap-form/item-text-group/style/css.js +1 -0
- package/es/src/ap-form/item-text-group/style/index.d.ts +0 -0
- package/es/src/ap-form/item-text-group/style/index.js +1 -0
- package/es/src/ap-form/items/interface.d.ts +11 -0
- package/es/src/ap-form/items/text/group.vue.d.ts +42 -0
- package/es/src/ap-form/items/text/group.vue.mjs +4 -0
- package/es/src/ap-form/items/text/group.vue2.mjs +26 -0
- package/es/src/ap-form/items/text/index.d.ts +3 -1
- package/es/src/ap-form/items/text/index.mjs +10 -6
- package/es/src/ap-table/constants.d.ts +2 -0
- package/es/src/ap-table/utils.d.ts +2 -0
- package/es/src/ap-upload/apUpload.vue.d.ts +17 -1
- package/es/src/ap-upload/apUpload.vue.mjs +54 -42
- package/es/src/ap-upload/apUploadTypes.d.ts +6 -1
- package/es/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +98 -90
- package/es/src/ap-upload/components/Picture.vue.d.ts +4 -1
- package/es/src/ap-upload/components/Picture.vue2.mjs +146 -138
- package/es/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +84 -86
- package/es/src/business/ap-label/constans.d.ts +1 -1
- package/es/src/business/ap-label/interface.d.ts +2 -2
- package/es/src/path-map.mjs +3 -1
- package/lib/src/ap-form/item-text/style/css.d.ts +0 -1
- package/lib/src/ap-form/item-text/style/css.js +1 -1
- package/lib/src/ap-form/item-text/style/index.d.ts +0 -1
- package/lib/src/ap-form/item-text/style/index.js +1 -1
- package/lib/src/ap-form/item-text-group/style/css.d.ts +0 -0
- package/lib/src/ap-form/item-text-group/style/css.js +1 -0
- package/lib/src/ap-form/item-text-group/style/index.d.ts +0 -0
- package/lib/src/ap-form/item-text-group/style/index.js +1 -0
- package/lib/src/ap-form/items/interface.d.ts +11 -0
- package/lib/src/ap-form/items/text/group.vue.d.ts +42 -0
- package/lib/src/ap-form/items/text/group.vue.js +1 -0
- package/lib/src/ap-form/items/text/group.vue2.js +1 -0
- package/lib/src/ap-form/items/text/index.d.ts +3 -1
- package/lib/src/ap-form/items/text/index.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2 -0
- package/lib/src/ap-table/utils.d.ts +2 -0
- package/lib/src/ap-upload/apUpload.vue.d.ts +17 -1
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/apUploadTypes.d.ts +6 -1
- package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue.d.ts +4 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-label/constans.d.ts +1 -1
- package/lib/src/business/ap-label/interface.d.ts +2 -2
- package/lib/src/path-map.js +1 -1
- package/package.json +2 -2
|
@@ -1,82 +1,90 @@
|
|
|
1
|
-
import { defineComponent as $, inject as n, ref as j, watch as
|
|
1
|
+
import { defineComponent as $, inject as n, ref as j, watch as V, nextTick as W, openBlock as v, createElementBlock as C, normalizeClass as G, unref as s, createVNode as _, withCtx as L, createElementVNode as b, createTextVNode as H, toDisplayString as S, withModifiers as J, createBlock as K, resolveDynamicComponent as Q, createCommentVNode as X } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as Y, getName as Z, getReturnData as
|
|
3
|
+
import { getPath as Y, getName as Z, getReturnData as x } from "../utils/returnData.mjs";
|
|
4
4
|
import { useOss as ee, getOssInstance as te } from "../hooks/useOss.mjs";
|
|
5
|
-
import { message as
|
|
5
|
+
import { message as m, Upload as oe, Button as ae } from "ant-design-vue";
|
|
6
6
|
import { UploadOutlined as se } from "@ant-design/icons-vue";
|
|
7
7
|
import { fileMatchesAccept as ne, getAcceptText as ie } from "../utils/accept.mjs";
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import { useNamespace as
|
|
8
|
+
import { useLocale as le } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 }, Ce = /* @__PURE__ */ $({
|
|
11
11
|
__name: "MultipleFile",
|
|
12
|
-
setup(me) {
|
|
13
|
-
const { t: i } =
|
|
14
|
-
|
|
12
|
+
setup(me, { expose: B }) {
|
|
13
|
+
const { t: i } = le(), { b: U } = re("ap-upload-multiple-file"), { put: I } = ee(), P = n("theme"), z = n("dirName"), y = n("accept") || "*", A = n("maxSize") ?? 500, R = n("title") || i("ap.apUpload.uploadFile"), g = n("subTitle"), l = n("maxCount") ?? 10, d = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), O = n("getOssAccess"), a = n("value"), p = [], f = n("needName"), r = j(null);
|
|
14
|
+
V(
|
|
15
15
|
() => a == null ? void 0 : a.value,
|
|
16
16
|
function(e) {
|
|
17
17
|
var t, o;
|
|
18
|
-
!((o = (t =
|
|
19
|
-
const l = e.map((u) => {
|
|
20
|
-
const E = Y(d, u), M = Z(d, u), k = new File(
|
|
21
|
-
[u],
|
|
22
|
-
M,
|
|
23
|
-
{}
|
|
24
|
-
);
|
|
25
|
-
return k.response = E, k.uid = E, k;
|
|
26
|
-
});
|
|
27
|
-
if (r && l.length > r) {
|
|
28
|
-
c.warning(
|
|
29
|
-
i("ap.apUpload.fileInitializationException", {
|
|
30
|
-
maxCount: r
|
|
31
|
-
})
|
|
32
|
-
);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
l.forEach((u) => {
|
|
36
|
-
f.push(u), g.push({
|
|
37
|
-
uid: u.uid,
|
|
38
|
-
path: u.response
|
|
39
|
-
});
|
|
40
|
-
}), p.value.fileList = l;
|
|
41
|
-
});
|
|
18
|
+
!((o = (t = r == null ? void 0 : r.value) == null ? void 0 : t.fileList) != null && o.length) && e && T(e);
|
|
42
19
|
},
|
|
43
20
|
{ immediate: !0 }
|
|
44
21
|
);
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
function T(e) {
|
|
23
|
+
if (!e) {
|
|
24
|
+
c = [], r.value.fileList = [], a.value = void 0, p.splice(0, p.length);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
W(() => {
|
|
28
|
+
const t = e.map((o) => {
|
|
29
|
+
const u = Y(f, o), w = Z(f, o), k = new File(
|
|
30
|
+
[o],
|
|
31
|
+
w,
|
|
32
|
+
{}
|
|
33
|
+
);
|
|
34
|
+
return k.response = u, k.uid = u, k;
|
|
35
|
+
});
|
|
36
|
+
if (l && t.length > l) {
|
|
37
|
+
m.warning(
|
|
38
|
+
i("ap.apUpload.fileInitializationException", {
|
|
39
|
+
maxCount: l
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
t.forEach((o) => {
|
|
45
|
+
c.push(o), p.push({
|
|
46
|
+
uid: o.uid,
|
|
47
|
+
path: o.response
|
|
48
|
+
});
|
|
49
|
+
}), r.value.fileList = t, a.value = e;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
B({ setValue: T });
|
|
53
|
+
let c = [], E;
|
|
54
|
+
function h(e) {
|
|
47
55
|
setTimeout(() => {
|
|
48
|
-
const t =
|
|
56
|
+
const t = r.value.fileList.findIndex(
|
|
49
57
|
(o) => o.uid === e.uid
|
|
50
58
|
);
|
|
51
|
-
t >= 0 &&
|
|
59
|
+
t >= 0 && r.value.fileList.splice(t, 1);
|
|
52
60
|
});
|
|
53
61
|
}
|
|
54
|
-
function
|
|
55
|
-
if (
|
|
56
|
-
return clearTimeout(
|
|
57
|
-
|
|
62
|
+
function q(e) {
|
|
63
|
+
if (l && l > 1 && c.length >= l)
|
|
64
|
+
return clearTimeout(E), E = setTimeout(() => {
|
|
65
|
+
m.warning(
|
|
58
66
|
i("ap.apUpload.maxUploadFiles", {
|
|
59
|
-
maxCount:
|
|
67
|
+
maxCount: l
|
|
60
68
|
})
|
|
61
69
|
);
|
|
62
|
-
}),
|
|
70
|
+
}), h(e), !1;
|
|
63
71
|
if (typeof F == "function") {
|
|
64
72
|
if (F(e) === !1)
|
|
65
|
-
return
|
|
73
|
+
return h(e), !1;
|
|
66
74
|
} else {
|
|
67
75
|
if (e.size > A * 1024 * 1024)
|
|
68
|
-
return
|
|
76
|
+
return m.warning(
|
|
69
77
|
i("ap.apUpload.maxUploadFileSize", {
|
|
70
78
|
maxSize: A
|
|
71
79
|
})
|
|
72
|
-
),
|
|
73
|
-
if (!ne(e,
|
|
74
|
-
return
|
|
80
|
+
), h(e), !1;
|
|
81
|
+
if (!ne(e, y))
|
|
82
|
+
return m.warning(i("ap.apUpload.fileFormatNotSupported")), h(e), !1;
|
|
75
83
|
}
|
|
76
|
-
|
|
84
|
+
l && l === 1 && (c = [], a.value = void 0), c.push(e);
|
|
77
85
|
}
|
|
78
|
-
async function
|
|
79
|
-
if (
|
|
86
|
+
async function D(e) {
|
|
87
|
+
if (d.value++, typeof N == "function") {
|
|
80
88
|
N({
|
|
81
89
|
onProgress: (t) => {
|
|
82
90
|
setTimeout(() => {
|
|
@@ -86,50 +94,50 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
|
|
|
86
94
|
});
|
|
87
95
|
},
|
|
88
96
|
onError: (t) => {
|
|
89
|
-
|
|
97
|
+
m.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
90
98
|
e.onError({
|
|
91
99
|
name: t,
|
|
92
100
|
message: t
|
|
93
101
|
});
|
|
94
|
-
}),
|
|
102
|
+
}), d.value--;
|
|
95
103
|
},
|
|
96
104
|
onSuccess: (t) => {
|
|
97
105
|
setTimeout(() => {
|
|
98
106
|
e.onSuccess(t);
|
|
99
107
|
}), a.value ? a.value.push(
|
|
100
|
-
|
|
108
|
+
x(f, t, e.file.name)
|
|
101
109
|
) : a.value = [
|
|
102
|
-
|
|
103
|
-
],
|
|
110
|
+
x(f, t, e.file.name)
|
|
111
|
+
], p.push({
|
|
104
112
|
uid: e.file.uid,
|
|
105
113
|
path: t
|
|
106
|
-
}),
|
|
114
|
+
}), d.value--;
|
|
107
115
|
},
|
|
108
116
|
file: e.file
|
|
109
117
|
});
|
|
110
118
|
return;
|
|
111
119
|
}
|
|
112
120
|
try {
|
|
113
|
-
const t = await te(
|
|
114
|
-
e.file.oss = t,
|
|
121
|
+
const t = await te(O);
|
|
122
|
+
e.file.oss = t, I({
|
|
115
123
|
file: e.file,
|
|
116
|
-
dirName:
|
|
124
|
+
dirName: z,
|
|
117
125
|
oss: t,
|
|
118
126
|
successCallBack(o) {
|
|
119
127
|
e.onSuccess(o), a.value ? a.value.push(
|
|
120
|
-
|
|
128
|
+
x(f, o, e.file.name)
|
|
121
129
|
) : a.value = [
|
|
122
|
-
|
|
123
|
-
],
|
|
130
|
+
x(f, o, e.file.name)
|
|
131
|
+
], p.push({
|
|
124
132
|
uid: e.file.uid,
|
|
125
133
|
path: o
|
|
126
|
-
}),
|
|
134
|
+
}), d.value--;
|
|
127
135
|
},
|
|
128
136
|
errorCallBack(o) {
|
|
129
|
-
|
|
137
|
+
m.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
130
138
|
name: o,
|
|
131
139
|
message: o
|
|
132
|
-
}),
|
|
140
|
+
}), d.value--;
|
|
133
141
|
},
|
|
134
142
|
progressCallBack(o) {
|
|
135
143
|
e.onProgress({
|
|
@@ -138,65 +146,65 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
|
|
|
138
146
|
}
|
|
139
147
|
});
|
|
140
148
|
} catch (t) {
|
|
141
|
-
|
|
149
|
+
m.warning(
|
|
142
150
|
typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
|
|
143
151
|
), e.onError({
|
|
144
152
|
name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
|
|
145
153
|
message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
|
|
146
|
-
}),
|
|
154
|
+
}), d.value--;
|
|
147
155
|
}
|
|
148
156
|
}
|
|
149
|
-
function
|
|
157
|
+
function M(e) {
|
|
150
158
|
var o;
|
|
151
159
|
if (e.response) {
|
|
152
160
|
if (Array.isArray(a.value)) {
|
|
153
|
-
const
|
|
154
|
-
|
|
161
|
+
const u = p.findIndex((w) => w.uid === e.uid);
|
|
162
|
+
u >= 0 && (a == null || a.value.splice(u, 1), p.splice(u, 1)), a.value.length === 0 && (a.value = void 0);
|
|
155
163
|
}
|
|
156
164
|
} else
|
|
157
165
|
(o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
|
|
158
|
-
const t =
|
|
159
|
-
(
|
|
166
|
+
const t = c.findIndex(
|
|
167
|
+
(u) => u.uid === e.uid
|
|
160
168
|
);
|
|
161
|
-
return
|
|
169
|
+
return c.splice(t, 1), Promise.resolve(!0);
|
|
162
170
|
}
|
|
163
|
-
return (e, t) => (
|
|
164
|
-
class:
|
|
171
|
+
return (e, t) => (v(), C("div", {
|
|
172
|
+
class: G({
|
|
165
173
|
[s(U)()]: !0,
|
|
166
|
-
[s(U)("admin")]: s(
|
|
174
|
+
[s(U)("admin")]: s(P) === "admin"
|
|
167
175
|
})
|
|
168
176
|
}, [
|
|
169
177
|
_(s(oe), {
|
|
170
178
|
ref_key: "uploadRef",
|
|
171
|
-
ref:
|
|
172
|
-
accept: s(
|
|
179
|
+
ref: r,
|
|
180
|
+
accept: s(y),
|
|
173
181
|
multiple: "",
|
|
174
|
-
maxCount: s(
|
|
182
|
+
maxCount: s(l),
|
|
175
183
|
progress: {
|
|
176
184
|
strokeWidth: 3,
|
|
177
185
|
showInfo: !1,
|
|
178
186
|
strokeColor: "#0070FF"
|
|
179
187
|
},
|
|
180
|
-
beforeUpload:
|
|
181
|
-
customRequest:
|
|
182
|
-
onRemove:
|
|
188
|
+
beforeUpload: q,
|
|
189
|
+
customRequest: D,
|
|
190
|
+
onRemove: M
|
|
183
191
|
}, {
|
|
184
|
-
default:
|
|
185
|
-
|
|
192
|
+
default: L(() => [
|
|
193
|
+
b("div", ue, [
|
|
186
194
|
_(s(ae), { class: "file-btn" }, {
|
|
187
|
-
default:
|
|
195
|
+
default: L(() => [
|
|
188
196
|
_(s(se)),
|
|
189
|
-
|
|
197
|
+
H(" " + S(s(R)), 1)
|
|
190
198
|
]),
|
|
191
199
|
_: 1
|
|
192
200
|
}),
|
|
193
|
-
|
|
201
|
+
b("div", {
|
|
194
202
|
class: "sub-title",
|
|
195
|
-
onClick: t[0] || (t[0] =
|
|
203
|
+
onClick: t[0] || (t[0] = J(() => {
|
|
196
204
|
}, ["stop"]))
|
|
197
205
|
}, [
|
|
198
|
-
typeof s(
|
|
199
|
-
(
|
|
206
|
+
typeof s(g) == "string" ? (v(), C("div", pe, S(s(g) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(y))}`), 1)) : s(g) ? (v(), C("div", ce, [
|
|
207
|
+
(v(), K(Q(s(g))))
|
|
200
208
|
])) : X("", !0)
|
|
201
209
|
])
|
|
202
210
|
])
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
|
|
2
|
-
declare
|
|
2
|
+
declare function setValue(val?: (string | Record<string, any>)[]): void;
|
|
3
|
+
declare const _default: DefineComponent<{}, {
|
|
4
|
+
setValue: typeof setValue;
|
|
5
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
|
|
3
6
|
export default _default;
|