@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,70 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as te, inject as s, ref as h, watch as ae, computed as ne, openBlock as _, createElementBlock as x, normalizeClass as oe, unref as a, createElementVNode as i, toDisplayString as A, createCommentVNode as z, normalizeStyle as le, createBlock as se, withModifiers as re, createVNode as ie } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getName as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { fileMatchesAccept as
|
|
6
|
-
import { message as u, Progress as
|
|
7
|
-
import { DeleteOutlined as
|
|
8
|
-
import
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
3
|
+
import { getName as ce, getReturnData as q } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ue, useOssInit as pe } from "../hooks/useOss.mjs";
|
|
5
|
+
import { fileMatchesAccept as ve, getAcceptText as de } from "../utils/accept.mjs";
|
|
6
|
+
import { message as u, Progress as fe } from "ant-design-vue";
|
|
7
|
+
import { DeleteOutlined as me } from "@ant-design/icons-vue";
|
|
8
|
+
import M from "../assets/single-file-icon.png.mjs";
|
|
9
|
+
import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const _e = ["accept"], ke = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "state-un"
|
|
14
|
-
},
|
|
14
|
+
}, ye = ["src"], De = { class: "state-un-title" }, Ce = { class: "state-un-subtitle" }, we = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "state-ing"
|
|
17
|
-
},
|
|
17
|
+
}, Fe = { class: "left" }, Ue = ["src"], Ne = { class: "center" }, Se = { class: "center-progress" }, Ie = /* @__PURE__ */ te({
|
|
18
18
|
__name: "SingleFile",
|
|
19
|
-
setup(
|
|
20
|
-
const { t: r } =
|
|
21
|
-
|
|
22
|
-
() =>
|
|
19
|
+
setup(Ee, { expose: j }) {
|
|
20
|
+
const { t: r } = ge(), { b: k } = he("ap-upload-single-file"), { put: G, client: B } = ue(), y = s("theme"), W = s("dirName"), D = s("accept") || "*", C = s("maxSize") ?? 500, H = s("title") || r("ap.apUpload.clickOrDragUpload"), w = s("subTitle"), n = s("value"), F = s("needName"), p = s("uploadingCount"), b = s("beforeUpload"), O = s("customRequest"), J = s("getOssAccess"), o = h(null);
|
|
21
|
+
ae(
|
|
22
|
+
() => n == null ? void 0 : n.value,
|
|
23
23
|
function(e) {
|
|
24
|
-
|
|
25
|
-
if (n.value === null && e) {
|
|
26
|
-
const t = re(F, e);
|
|
27
|
-
o.value = 3, n.value = new File(
|
|
28
|
-
[e],
|
|
29
|
-
t,
|
|
30
|
-
{}
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
24
|
+
o.value === null && e && P(e);
|
|
34
25
|
},
|
|
35
26
|
{ immediate: !0 }
|
|
36
27
|
);
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
function P(e) {
|
|
29
|
+
e ? setTimeout(() => {
|
|
30
|
+
const t = ce(F, e);
|
|
31
|
+
l.value = 3, o.value = new File([e], t, {}), n.value = e;
|
|
32
|
+
}) : (l.value = 1, o.value = null, n.value = void 0);
|
|
33
|
+
}
|
|
34
|
+
j({ setValue: P });
|
|
35
|
+
const l = h(1), f = h(0), m = h(null), T = ne(() => o.value && (n == null ? void 0 : n.value));
|
|
36
|
+
function K() {
|
|
39
37
|
var e;
|
|
40
|
-
|
|
38
|
+
l.value === 1 && ((e = m.value) == null || e.click());
|
|
41
39
|
}
|
|
42
|
-
function
|
|
40
|
+
function L(e) {
|
|
43
41
|
e.preventDefault(), e.stopPropagation();
|
|
44
42
|
}
|
|
45
|
-
function
|
|
43
|
+
function Q(e) {
|
|
46
44
|
e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
|
|
47
45
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
46
|
+
function X(e) {
|
|
47
|
+
R(e);
|
|
50
48
|
}
|
|
51
|
-
function
|
|
52
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
49
|
+
function Y(e) {
|
|
50
|
+
if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
|
|
53
51
|
return;
|
|
54
|
-
var t = e.dataTransfer, c = [],
|
|
52
|
+
var t = e.dataTransfer, c = [], I = 0, $ = t.files.length;
|
|
55
53
|
function v() {
|
|
56
|
-
|
|
54
|
+
I === $ - 1 && X(c), I++;
|
|
57
55
|
}
|
|
58
56
|
if (t.items !== void 0)
|
|
59
57
|
for (var U = 0; U < t.items.length; U++) {
|
|
60
58
|
var N = t.items[U];
|
|
61
59
|
if (N.kind === "file" && N.webkitGetAsEntry().isFile) {
|
|
62
|
-
var
|
|
63
|
-
c.push(
|
|
60
|
+
var ee = N.getAsFile();
|
|
61
|
+
c.push(ee), v();
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
else
|
|
67
|
-
for (let E = 0; E <
|
|
65
|
+
for (let E = 0; E < $; E++) {
|
|
68
66
|
var g = t.files[E];
|
|
69
67
|
if (g.type)
|
|
70
68
|
c.push(g), v();
|
|
@@ -89,11 +87,11 @@ const ge = ["accept"], he = {
|
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
|
-
function
|
|
90
|
+
function Z(e) {
|
|
93
91
|
const t = e.target;
|
|
94
|
-
|
|
92
|
+
R(t == null ? void 0 : t.files), m.value && (m.value.value = "");
|
|
95
93
|
}
|
|
96
|
-
async function
|
|
94
|
+
async function R(e) {
|
|
97
95
|
if (e != null && e.length) {
|
|
98
96
|
if (typeof b == "function") {
|
|
99
97
|
if (b(e[0]) === !1)
|
|
@@ -107,44 +105,44 @@ const ge = ["accept"], he = {
|
|
|
107
105
|
);
|
|
108
106
|
return;
|
|
109
107
|
}
|
|
110
|
-
if (!
|
|
108
|
+
if (!ve(e[0], D)) {
|
|
111
109
|
u.warning(r("ap.apUpload.fileFormatNotSupported"));
|
|
112
110
|
return;
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
|
-
if (
|
|
113
|
+
if (o.value = e[0], l.value = 2, f.value = 0, p.value++, typeof O == "function") {
|
|
116
114
|
O({
|
|
117
115
|
onProgress: (t) => {
|
|
118
116
|
f.value = t;
|
|
119
117
|
},
|
|
120
118
|
onError: (t) => {
|
|
121
|
-
u.warning(t || r("ap.apUpload.networkAnomaly")),
|
|
119
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
|
|
122
120
|
},
|
|
123
121
|
onSuccess: (t) => {
|
|
124
|
-
|
|
122
|
+
n.value = q(
|
|
125
123
|
F,
|
|
126
124
|
t,
|
|
127
|
-
|
|
128
|
-
),
|
|
125
|
+
o.value.name
|
|
126
|
+
), l.value = 3, p.value--;
|
|
129
127
|
},
|
|
130
128
|
file: e[0]
|
|
131
129
|
});
|
|
132
130
|
return;
|
|
133
131
|
}
|
|
134
132
|
try {
|
|
135
|
-
await
|
|
136
|
-
file:
|
|
137
|
-
dirName:
|
|
133
|
+
await pe(J), G({
|
|
134
|
+
file: o.value,
|
|
135
|
+
dirName: W,
|
|
138
136
|
oss: B,
|
|
139
137
|
successCallBack(t) {
|
|
140
|
-
|
|
138
|
+
n.value = q(
|
|
141
139
|
F,
|
|
142
140
|
t,
|
|
143
|
-
|
|
144
|
-
),
|
|
141
|
+
o.value.name
|
|
142
|
+
), l.value = 3, p.value--;
|
|
145
143
|
},
|
|
146
144
|
errorCallBack(t) {
|
|
147
|
-
u.warning(t || r("ap.apUpload.networkAnomaly")),
|
|
145
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
|
|
148
146
|
},
|
|
149
147
|
progressCallBack(t) {
|
|
150
148
|
f.value = t;
|
|
@@ -153,26 +151,26 @@ const ge = ["accept"], he = {
|
|
|
153
151
|
} catch (t) {
|
|
154
152
|
u.warning(
|
|
155
153
|
typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
156
|
-
),
|
|
154
|
+
), l.value = 1, o.value = null, p.value--;
|
|
157
155
|
}
|
|
158
156
|
}
|
|
159
157
|
}
|
|
160
|
-
function
|
|
161
|
-
|
|
158
|
+
function V() {
|
|
159
|
+
o.value && !(n != null && n.value) && B.pauseUpload(), l.value = 1, o.value = null, n.value = void 0;
|
|
162
160
|
}
|
|
163
161
|
return (e, t) => {
|
|
164
162
|
var c;
|
|
165
|
-
return _(),
|
|
166
|
-
class:
|
|
163
|
+
return _(), x("div", {
|
|
164
|
+
class: oe({
|
|
167
165
|
[a(k)()]: !0,
|
|
168
166
|
[a(k)("admin")]: a(y) === "admin",
|
|
169
|
-
[a(k)("un")]:
|
|
167
|
+
[a(k)("un")]: l.value === 1
|
|
170
168
|
}),
|
|
171
|
-
onClick:
|
|
172
|
-
onDragenter:
|
|
173
|
-
onDragover:
|
|
174
|
-
onDragleave:
|
|
175
|
-
onDrop:
|
|
169
|
+
onClick: K,
|
|
170
|
+
onDragenter: L,
|
|
171
|
+
onDragover: Q,
|
|
172
|
+
onDragleave: L,
|
|
173
|
+
onDrop: Y
|
|
176
174
|
}, [
|
|
177
175
|
i("input", {
|
|
178
176
|
style: { display: "none" },
|
|
@@ -180,33 +178,33 @@ const ge = ["accept"], he = {
|
|
|
180
178
|
ref_key: "fileRef",
|
|
181
179
|
ref: m,
|
|
182
180
|
accept: a(D),
|
|
183
|
-
onChange:
|
|
184
|
-
}, null, 40,
|
|
185
|
-
|
|
181
|
+
onChange: Z
|
|
182
|
+
}, null, 40, _e),
|
|
183
|
+
l.value === 1 ? (_(), x("div", ke, [
|
|
186
184
|
i("img", {
|
|
187
185
|
class: "state-un-icon",
|
|
188
|
-
src: a(
|
|
189
|
-
}, null, 8,
|
|
190
|
-
i("div",
|
|
191
|
-
i("div",
|
|
186
|
+
src: a(M)
|
|
187
|
+
}, null, 8, ye),
|
|
188
|
+
i("div", De, A(a(H)), 1),
|
|
189
|
+
i("div", Ce, A(typeof a(w) == "string" && a(w).length > 0 ? a(w) : `${a(r)("ap.apUpload.supportExtension")}:${a(de)(
|
|
192
190
|
a(D)
|
|
193
191
|
)},${a(r)("ap.apUpload.maxWarnUploadFileSize", {
|
|
194
192
|
maxSize: a(C)
|
|
195
193
|
})}`), 1)
|
|
196
194
|
])) : z("", !0),
|
|
197
|
-
[2, 3].includes(
|
|
198
|
-
i("div", Ce, [
|
|
199
|
-
i("img", { src: a(q) }, null, 8, we)
|
|
200
|
-
]),
|
|
195
|
+
[2, 3].includes(l.value) ? (_(), x("div", we, [
|
|
201
196
|
i("div", Fe, [
|
|
197
|
+
i("img", { src: a(M) }, null, 8, Ue)
|
|
198
|
+
]),
|
|
199
|
+
i("div", Ne, [
|
|
202
200
|
i("div", {
|
|
203
201
|
class: "center-title",
|
|
204
|
-
style:
|
|
205
|
-
color:
|
|
202
|
+
style: le({
|
|
203
|
+
color: T.value ? "#0070FF" : "#182948"
|
|
206
204
|
})
|
|
207
|
-
},
|
|
208
|
-
i("div",
|
|
209
|
-
|
|
205
|
+
}, A((c = o.value) == null ? void 0 : c.name), 5),
|
|
206
|
+
i("div", Se, [
|
|
207
|
+
T.value ? z("", !0) : (_(), se(a(fe), {
|
|
210
208
|
key: 0,
|
|
211
209
|
percent: f.value,
|
|
212
210
|
size: 4,
|
|
@@ -218,9 +216,9 @@ const ge = ["accept"], he = {
|
|
|
218
216
|
]),
|
|
219
217
|
i("div", {
|
|
220
218
|
class: "right",
|
|
221
|
-
onClick:
|
|
219
|
+
onClick: re(V, ["stop"])
|
|
222
220
|
}, [
|
|
223
|
-
|
|
221
|
+
ie(a(me))
|
|
224
222
|
])
|
|
225
223
|
])) : z("", !0)
|
|
226
224
|
], 34);
|
|
@@ -228,5 +226,5 @@ const ge = ["accept"], he = {
|
|
|
228
226
|
}
|
|
229
227
|
});
|
|
230
228
|
export {
|
|
231
|
-
|
|
229
|
+
Ie as default
|
|
232
230
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType, VNode, CSSProperties } from 'vue';
|
|
2
2
|
import { ApLabelGroupItemProps } from './interface';
|
|
3
|
-
import { TooltipPlacement } from 'ant-design-vue/es/Tooltip';
|
|
3
|
+
import { TooltipPlacement } from 'ant-design-vue/es/tooltip/Tooltip';
|
|
4
4
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
5
5
|
import { LiteralUnion } from 'ant-design-vue/es/_util/type';
|
|
6
6
|
export declare const ApLabelGroupProps: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BadgeProps } from 'ant-design-vue';
|
|
2
|
-
import { TooltipPlacement } from 'ant-design-vue/es/Tooltip';
|
|
3
|
-
import { TagProps } from 'ant-design-vue/es/
|
|
2
|
+
import { TooltipPlacement } from 'ant-design-vue/es/tooltip/Tooltip';
|
|
3
|
+
import { TagProps } from 'ant-design-vue/es/tag';
|
|
4
4
|
import { VNode, VNodeChild } from 'vue';
|
|
5
5
|
type Recordable = Record<string, any>;
|
|
6
6
|
export type ApLabelProps = BadgeProps & Partial<{
|
package/es/src/path-map.mjs
CHANGED
|
@@ -41,6 +41,7 @@ const e = {
|
|
|
41
41
|
ApFormItemSwitch: ["ap-form", "item-switch"],
|
|
42
42
|
ApFormItemCheckbox: ["ap-form", "item-checkbox"],
|
|
43
43
|
ApFormItemTextPassword: ["ap-form", "item-text-password"],
|
|
44
|
+
ApFormItemTextGroup: ["ap-form", "item-text-group"],
|
|
44
45
|
ApInfoLayout: ["ap-info-layout"],
|
|
45
46
|
ApList: ["ap-list"],
|
|
46
47
|
ApModal: ["ap-modal"],
|
|
@@ -70,7 +71,8 @@ const e = {
|
|
|
70
71
|
ApStatus: ["business", "ap-status"],
|
|
71
72
|
ApStatusGroup: ["business", "ap-status", "group"],
|
|
72
73
|
ApTableModal: ["business", "ap-table-modal"],
|
|
73
|
-
ApTitle: ["business", "ap-title"]
|
|
74
|
+
ApTitle: ["business", "ap-title"],
|
|
75
|
+
ApSummary: ["business", "ap-summary"]
|
|
74
76
|
};
|
|
75
77
|
export {
|
|
76
78
|
e as default
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/ap-form/item-text.css';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-form/item-text.less';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/ap-form/item-text-group.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-form/item-text-group.less';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SizeType } from 'ant-design-vue/es/config-provider';
|
|
1
2
|
import { ApFieldCheckboxProps, ApFieldDateProps, ApFieldDateRangeProps, ApFieldNumberProps, ApFieldRadioProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTextAreaProps, ApFieldTextPasswordProps, ApFieldTextProps } from '../../ap-field';
|
|
2
3
|
import { ApFormItemProps } from '../interface';
|
|
3
4
|
export type ApFormItemTextProps = ApFormItemProps & {
|
|
@@ -47,3 +48,13 @@ export type ApFormItemCheckboxProps = Omit<ApFormItemProps, 'bordered'> & {
|
|
|
47
48
|
field?: Omit<ApFieldCheckboxProps, 'value' | 'onUpdate:value'>;
|
|
48
49
|
disabled?: boolean;
|
|
49
50
|
};
|
|
51
|
+
export type ApFormItemTextGroupProps = {
|
|
52
|
+
/**
|
|
53
|
+
* ApFormItem 控件所有支持的
|
|
54
|
+
*/
|
|
55
|
+
size?: SizeType;
|
|
56
|
+
/**
|
|
57
|
+
* 是否启用紧凑模式
|
|
58
|
+
*/
|
|
59
|
+
compact?: boolean;
|
|
60
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ApFormItemTextGroupProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
type ApFormItemTextSlots = {
|
|
4
|
+
default: any;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
slots: Readonly<ApFormItemTextSlots> & ApFormItemTextSlots;
|
|
8
|
+
refs: {};
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApFormItemTextGroupProps>, {
|
|
13
|
+
compact: boolean;
|
|
14
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApFormItemTextGroupProps>, {
|
|
15
|
+
compact: boolean;
|
|
16
|
+
}>>>, {
|
|
17
|
+
compact: boolean;
|
|
18
|
+
}, {}>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithDefaults<P, D> = {
|
|
22
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
23
|
+
default: D[K];
|
|
24
|
+
}> : P[K];
|
|
25
|
+
};
|
|
26
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
type __VLS_TypePropsToOption<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type __VLS_PrettifyLocal<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./group.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("ant-design-vue");require("../../../config-provider/index.js");const a=require("../../../config-provider/hooks/use-namespace.js"),n=e.defineComponent({name:"ApFormItemTextGroup",__name:"group",props:{size:{},compact:{type:Boolean,default:!1}},setup(o){const{b:r}=a.useNamespace("ap-form-item-text-group"),s=o;return(t,p)=>(e.openBlock(),e.createBlock(e.unref(u.Input).Group,e.mergeProps({class:t.$props.compact?e.unref(r)("compact"):null},s),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["class"]))}});exports.default=n;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { default as _ApFormItemText } from './index.vue';
|
|
2
2
|
import { default as ApFormItemTextPassword } from './password.vue';
|
|
3
|
+
import { default as ApFormItemTextGroup } from './group.vue';
|
|
3
4
|
type ApFormItemTextType = typeof _ApFormItemText & {
|
|
4
5
|
Password: typeof ApFormItemTextPassword;
|
|
6
|
+
Group: typeof ApFormItemTextGroup;
|
|
5
7
|
};
|
|
6
8
|
declare const ApFormItemText: ApFormItemTextType;
|
|
7
|
-
export { ApFormItemText, ApFormItemTextPassword };
|
|
9
|
+
export { ApFormItemText, ApFormItemTextPassword, ApFormItemTextGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index.vue.js");require("./password.vue2.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index.vue.js");require("./password.vue2.js");require("./group.vue.js");const u=require("./index.vue2.js"),t=require("./password.vue.js"),r=require("./group.vue2.js"),e=u.default;e.Password=t.default;e.Group=r.default;exports.ApFormItemTextPassword=t.default;exports.ApFormItemTextGroup=r.default;exports.ApFormItemText=e;
|
|
@@ -6,6 +6,7 @@ import { ColSize } from 'ant-design-vue/es/grid';
|
|
|
6
6
|
import { FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
7
7
|
import { RuleObject } from 'ant-design-vue/es/form';
|
|
8
8
|
import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
|
|
9
|
+
import { ApFormItemTextGroup } from '../ap-form/items/text';
|
|
9
10
|
import { FocusEventHandler, MouseEventHandler, KeyboardEventHandler, ChangeEventHandler, CompositionEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
10
11
|
import { Dayjs } from 'dayjs';
|
|
11
12
|
import { PickerLocale } from 'ant-design-vue/es/date-picker/generatePicker';
|
|
@@ -5976,6 +5977,7 @@ export declare const apTableFormItemMap: {
|
|
|
5976
5977
|
} & Omit< ApFormItemSlots, "default">;
|
|
5977
5978
|
}) & {
|
|
5978
5979
|
Password: ApFormItemTextPassword;
|
|
5980
|
+
Group: ApFormItemTextGroup;
|
|
5979
5981
|
};
|
|
5980
5982
|
textArea: {
|
|
5981
5983
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
@@ -7,6 +7,7 @@ import { ColSize } from 'ant-design-vue/es/grid';
|
|
|
7
7
|
import { FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
8
8
|
import { RuleObject } from 'ant-design-vue/es/form';
|
|
9
9
|
import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
|
|
10
|
+
import { ApFormItemTextGroup } from '../ap-form/items/text';
|
|
10
11
|
import { ColumnTitleProps } from 'ant-design-vue/es/table/interface';
|
|
11
12
|
import { VueNode } from 'ant-design-vue/es/_util/type';
|
|
12
13
|
export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
|
|
@@ -1824,6 +1825,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
1824
1825
|
} & Omit< ApFormItemSlots, "default">;
|
|
1825
1826
|
}) & {
|
|
1826
1827
|
Password: ApFormItemTextPassword;
|
|
1828
|
+
Group: ApFormItemTextGroup;
|
|
1827
1829
|
}) | ({
|
|
1828
1830
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
1829
1831
|
label: {
|
|
@@ -2,7 +2,16 @@ import { PropType, VNode, DefineComponent, ComputedRef, ComponentOptionsMixin, P
|
|
|
2
2
|
import { FileUploadType, BeforeUpload, CustomRequest } from './apUploadTypes';
|
|
3
3
|
import { GetOssAccess } from './hooks/useOss';
|
|
4
4
|
declare function clear(): void;
|
|
5
|
-
declare
|
|
5
|
+
declare function setValue(val: any): void;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
slots: Partial<Record<string, (_: any) => any>>;
|
|
8
|
+
refs: {
|
|
9
|
+
uploadRef: unknown;
|
|
10
|
+
};
|
|
11
|
+
attrs: Partial<{}>;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: DefineComponent<{
|
|
6
15
|
dirName: {
|
|
7
16
|
type: StringConstructor;
|
|
8
17
|
};
|
|
@@ -47,6 +56,7 @@ declare const _default: DefineComponent<{
|
|
|
47
56
|
}, {
|
|
48
57
|
done: ComputedRef<boolean>;
|
|
49
58
|
clear: typeof clear;
|
|
59
|
+
setValue: typeof setValue;
|
|
50
60
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
51
61
|
"update:value": (...args: any[]) => void;
|
|
52
62
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
@@ -101,4 +111,10 @@ declare const _default: DefineComponent<{
|
|
|
101
111
|
[key: string]: any;
|
|
102
112
|
}>;
|
|
103
113
|
}, {}>;
|
|
114
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
104
115
|
export default _default;
|
|
116
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
117
|
+
new (): {
|
|
118
|
+
$slots: S;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../config-provider/index.js");require("./components/SingleFile.vue.js");require("./components/MultipleFile.vue.js");require("./components/Picture.vue.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../config-provider/index.js");require("./components/SingleFile.vue.js");require("./components/MultipleFile.vue.js");require("./components/Picture.vue.js");const A=require("./utils/accept.js"),U=require("./hooks/useOss.js"),k=require("ant-design-vue"),x=require("../config-provider/hooks/use-locale.js"),T=require("../config-provider/hooks/use-namespace.js"),z=require("./components/SingleFile.vue2.js"),B=require("./components/MultipleFile.vue2.js"),L=require("./components/Picture.vue2.js"),g=require("../config-provider/hooks/use-global-config.js"),M=e.defineComponent({name:"AplusFileUpload",__name:"apUpload",props:{dirName:{type:String},type:{type:String,default:"singleFile"},value:{type:[String,Object,Array],default:void 0},needName:{type:[Boolean,Object]},accept:{type:String},maxSize:{type:Number},title:{type:String,default:""},subTitle:{type:[String,Object],default:""},maxCount:{type:Number},beforeUpload:{type:Function},customRequest:{type:Function},getOssAccess:{type:Function},onChange:Function},emits:["update:value"],setup(_,{expose:f,emit:y}){var p,d,m,v;const{t:i,lang:b}=x.useLocale();A.injectLocaleToAccept(i),U.injectLocaleToOss(i,b);const{b:q}=T.useNamespace("ap-upload"),r=e.ref(null),t=_,C=y,S={singleFile:z.default,multipleFile:B.default,picture:L.default},a=k.Form.useInjectFormItemContext(),F=e.computed({get(){return t.value},set(o){var u;C("update:value",o),a==null||a.onFieldChange(),(u=t.onChange)==null||u.call(t,o)}}),N=g.useGlobalConfig("uiMode"),s=g.useGlobalConfig("apUpload");e.provide("theme",N.value),e.provide("value",F),e.provide("dirName",t.dirName??((p=s.value)==null?void 0:p.dirName)),e.provide("needName",t.needName??((d=s.value)==null?void 0:d.needName)??!1),e.provide("accept",t.accept??((m=s.value)==null?void 0:m.accept)??""),e.provide("maxSize",t.maxSize),e.provide("title",t.title),e.provide("subTitle",t.subTitle),e.provide("maxCount",t.maxCount),e.provide("beforeUpload",t.beforeUpload),e.provide("customRequest",t.customRequest),e.provide("getOssAccess",t.getOssAccess??((v=s.value)==null?void 0:v.getOssAccess));const O=e.computed(()=>l.value===0),l=e.ref(0);e.provide("uploadingCount",l);function j(){c(void 0)}function c(o){var u,n;(n=(u=r==null?void 0:r.value)==null?void 0:u.setValue)==null||n.call(u,o)}return f({done:O,clear:j,setValue:c}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(q)())},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(S[t.type]),e.mergeProps(o.$attrs,{ref_key:"uploadRef",ref:r}),e.createSlots({_:2},[e.renderList(Object.keys(o.$slots),n=>({name:n,fn:e.withCtx(h=>[e.renderSlot(o.$slots,n,e.normalizeProps(e.guardReactiveProps(h||{})))])}))]),1040))],2))}});exports.default=M;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VNode } from 'vue';
|
|
1
|
+
import { ComputedRef, VNode } from 'vue';
|
|
2
2
|
export type FileUploadType = 'picture' | 'singleFile' | 'multipleFile';
|
|
3
3
|
/**
|
|
4
4
|
* 是否需要返回图片名称
|
|
@@ -87,3 +87,8 @@ export type CustomRequest = (cb: {
|
|
|
87
87
|
onSuccess: (saveUrl: string) => void;
|
|
88
88
|
file: File;
|
|
89
89
|
}) => void;
|
|
90
|
+
export interface ApUploadExpose<SetValueType = any> {
|
|
91
|
+
done?: ComputedRef<boolean>;
|
|
92
|
+
clear?: () => void;
|
|
93
|
+
setValue?: (value: SetValueType) => void;
|
|
94
|
+
}
|
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const f=require("../utils/returnData.js"),T=require("../hooks/useOss.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const f=require("../utils/returnData.js"),T=require("../hooks/useOss.js"),u=require("ant-design-vue"),R=require("@ant-design/icons-vue"),U=require("../utils/accept.js"),I=require("../../config-provider/hooks/use-locale.js"),P=require("../../config-provider/hooks/use-namespace.js"),O={class:"multiple-file-context"},z={key:0},M={key:1},V=e.defineComponent({__name:"MultipleFile",setup($,{expose:q}){const{t:o}=I.useLocale(),{b:y}=P.useNamespace("ap-upload-multiple-file"),{put:A}=T.useOss(),B=e.inject("theme"),E=e.inject("dirName"),h=e.inject("accept")||"*",w=e.inject("maxSize")??500,F=e.inject("title")||o("ap.apUpload.uploadFile"),g=e.inject("subTitle"),i=e.inject("maxCount")??10,d=e.inject("uploadingCount"),C=e.inject("beforeUpload"),_=e.inject("customRequest"),S=e.inject("getOssAccess"),a=e.inject("value"),l=[],m=e.inject("needName"),r=e.ref(null);e.watch(()=>a==null?void 0:a.value,function(t){var n,s;!((s=(n=r==null?void 0:r.value)==null?void 0:n.fileList)!=null&&s.length)&&t&&N(t)},{immediate:!0});function N(t){if(!t){p=[],r.value.fileList=[],a.value=void 0,l.splice(0,l.length);return}e.nextTick(()=>{const n=t.map(s=>{const c=f.getPath(m,s),x=f.getName(m,s),k=new File([s],x,{});return k.response=c,k.uid=c,k});if(i&&n.length>i){u.message.warning(o("ap.apUpload.fileInitializationException",{maxCount:i}));return}n.forEach(s=>{p.push(s),l.push({uid:s.uid,path:s.response})}),r.value.fileList=n,a.value=t})}q({setValue:N});let p=[],j;function v(t){setTimeout(()=>{const n=r.value.fileList.findIndex(s=>s.uid===t.uid);n>=0&&r.value.fileList.splice(n,1)})}function b(t){if(i&&i>1&&p.length>=i)return clearTimeout(j),j=setTimeout(()=>{u.message.warning(o("ap.apUpload.maxUploadFiles",{maxCount:i}))}),v(t),!1;if(typeof C=="function"){if(C(t)===!1)return v(t),!1}else{if(t.size>w*1024*1024)return u.message.warning(o("ap.apUpload.maxUploadFileSize",{maxSize:w})),v(t),!1;if(!U.fileMatchesAccept(t,h))return u.message.warning(o("ap.apUpload.fileFormatNotSupported")),v(t),!1}i&&i===1&&(p=[],a.value=void 0),p.push(t)}async function L(t){if(d.value++,typeof _=="function"){_({onProgress:n=>{setTimeout(()=>{t.onProgress({percent:n})})},onError:n=>{u.message.warning(n||o("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:n,message:n})}),d.value--},onSuccess:n=>{setTimeout(()=>{t.onSuccess(n)}),a.value?a.value.push(f.getReturnData(m,n,t.file.name)):a.value=[f.getReturnData(m,n,t.file.name)],l.push({uid:t.file.uid,path:n}),d.value--},file:t.file});return}try{const n=await T.getOssInstance(S);t.file.oss=n,A({file:t.file,dirName:E,oss:n,successCallBack(s){t.onSuccess(s),a.value?a.value.push(f.getReturnData(m,s,t.file.name)):a.value=[f.getReturnData(m,s,t.file.name)],l.push({uid:t.file.uid,path:s}),d.value--},errorCallBack(s){u.message.warning(s||o("ap.apUpload.networkAnomaly")),t.onError({name:s,message:s}),d.value--},progressCallBack(s){t.onProgress({percent:s})}})}catch(n){u.message.warning(typeof(n==null?void 0:n.message)=="string"?n.message:o("ap.apUpload.networkAnomaly")),t.onError({name:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly"),message:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly")}),d.value--}}function D(t){var s;if(t.response){if(Array.isArray(a.value)){const c=l.findIndex(x=>x.uid===t.uid);c>=0&&(a==null||a.value.splice(c,1),l.splice(c,1)),a.value.length===0&&(a.value=void 0)}}else(s=t==null?void 0:t.oss)==null||s.pauseUpload();const n=p.findIndex(c=>c.uid===t.uid);return p.splice(n,1),Promise.resolve(!0)}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(y)()]:!0,[e.unref(y)("admin")]:e.unref(B)==="admin"})},[e.createVNode(e.unref(u.Upload),{ref_key:"uploadRef",ref:r,accept:e.unref(h),multiple:"",maxCount:e.unref(i),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},beforeUpload:b,customRequest:L,onRemove:D},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(u.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(R.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(F)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(g)=="string"?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(e.unref(g)||`${e.unref(o)("ap.apUpload.supportExtension")}:${e.unref(U.getAcceptText)(e.unref(h))}`),1)):e.unref(g)?(e.openBlock(),e.createElementBlock("div",M,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","maxCount"])],2))}});exports.default=V;
|
|
@@ -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;
|