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