@aplus-frontend/ui 7.12.3 → 7.12.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/ag-grid/index.vue.mjs +33 -31
- package/es/src/business/ap-upload/apUpload.vue.d.ts +19 -0
- package/es/src/business/ap-upload/apUpload.vue.mjs +38 -30
- package/es/src/business/ap-upload/apUploadTypes.d.ts +9 -0
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +89 -89
- package/es/src/business/batch-input-group/index.vue.mjs +67 -72
- package/es/src/business/batch-input-group/interface.d.ts +3 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +65 -43
- package/es/src/business/batch-input-group/style/index.mjs +9 -9
- package/es/src/check-card/style/index.mjs +1 -1
- package/es/src/config-provider/config-provider.mjs +33 -32
- package/es/src/config-provider/hooks/use-global-config.mjs +40 -37
- package/es/src/utils/cssinjs/utils.d.ts +1 -0
- package/es/src/utils/cssinjs/utils.mjs +9 -9
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +19 -0
- package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-upload/apUploadTypes.d.ts +9 -0
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/batch-input-group/interface.d.ts +3 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +3 -3
- package/lib/src/business/batch-input-group/style/index.js +1 -1
- package/lib/src/check-card/style/index.js +1 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.js +1 -1
- package/lib/src/utils/cssinjs/utils.d.ts +1 -0
- package/lib/src/utils/cssinjs/utils.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { UploadOutlined as
|
|
3
|
-
import { message as p, Upload as
|
|
4
|
-
import { IconApAdLineDownload as
|
|
5
|
-
import { ApFilePreview as
|
|
1
|
+
import { defineComponent as oe, inject as a, ref as te, watch as ae, nextTick as se, createElementBlock as C, openBlock as x, normalizeClass as ne, unref as s, createVNode as y, withCtx as N, createElementVNode as M, createTextVNode as re, toDisplayString as D, withModifiers as ie, createCommentVNode as le, createBlock as ce, resolveDynamicComponent as ue } from "vue";
|
|
2
|
+
import { UploadOutlined as pe } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as p, Upload as de, Button as me } from "@aplus-frontend/antdv";
|
|
4
|
+
import { IconApAdLineDownload as fe } from "@aplus-frontend/icon";
|
|
5
|
+
import { ApFilePreview as ge } from "../../ap-file-preview/index.mjs";
|
|
6
6
|
import "../../../config-provider/index.mjs";
|
|
7
|
-
import { useOss as
|
|
8
|
-
import
|
|
9
|
-
import { fileMatchesAccept as ve, getAcceptText as
|
|
10
|
-
import { getPath as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import { useLocale as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
const
|
|
7
|
+
import { useOss as we, getOssInstance as L } from "../hooks/useOss.mjs";
|
|
8
|
+
import he from "../style/index.mjs";
|
|
9
|
+
import { fileMatchesAccept as ve, getAcceptText as xe } from "../utils/accept.mjs";
|
|
10
|
+
import { getPath as ye, getName as ke, getReturnData as S } from "../utils/returnData.mjs";
|
|
11
|
+
import { useGlobalConfig as be } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useLocale as Ce } from "../../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as Ne } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 }, qe = /* @__PURE__ */ oe({
|
|
15
15
|
__name: "MultipleFile",
|
|
16
|
-
setup(
|
|
17
|
-
const U =
|
|
16
|
+
setup(Ae, { expose: z }) {
|
|
17
|
+
const U = be(
|
|
18
18
|
"downloadCenterTriggerConfig"
|
|
19
|
-
), { t: i } =
|
|
20
|
-
|
|
19
|
+
), { t: i } = Ce(), { b: B } = Ne("ap-upload-multiple-file"), O = he("ap-upload"), { put: V } = we(), q = a("dirName"), j = a("baseDirName"), k = a("accept") || "*", E = a("maxSize") ?? 500, $ = a("title") || i("ap.apUpload.uploadFile"), f = a("subTitle"), l = a("maxCount") ?? 10, d = a("uploadingCount"), F = a("beforeUpload"), A = a("customRequest"), g = a("getOssAccess"), G = a("maxSizeErrorMsg"), W = a("maxCountErrorMsg"), H = a("acceptErrorMsg"), _ = a("onRemove"), b = a("showUploadErrorMsg"), P = a("bucket"), J = a("showDownload") ?? !0, K = a("showPreview") ?? !0, r = a("value"), c = [], w = a("needName"), m = te(null);
|
|
20
|
+
ae(
|
|
21
21
|
() => r?.value,
|
|
22
22
|
function(e) {
|
|
23
|
-
!
|
|
23
|
+
!m?.value?.fileList?.length && e && T(e);
|
|
24
24
|
},
|
|
25
25
|
{ immediate: !0 }
|
|
26
26
|
);
|
|
27
|
-
function
|
|
27
|
+
function T(e) {
|
|
28
28
|
if (!e) {
|
|
29
|
-
u = [],
|
|
29
|
+
u = [], m.value.fileList = [], r.value = void 0, c.splice(0, c.length);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
se(() => {
|
|
33
33
|
const o = e.map((t) => {
|
|
34
|
-
const
|
|
34
|
+
const n = ye(w, t), R = ke(w, t), v = new File(
|
|
35
35
|
[t],
|
|
36
|
-
|
|
36
|
+
R,
|
|
37
37
|
{}
|
|
38
38
|
);
|
|
39
|
-
return
|
|
39
|
+
return v.response = n, v.uid = n, v.status = "done", v;
|
|
40
40
|
});
|
|
41
41
|
if (l && o.length > l) {
|
|
42
42
|
p.warning(
|
|
@@ -51,44 +51,44 @@ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 },
|
|
|
51
51
|
uid: t.uid,
|
|
52
52
|
path: t.response
|
|
53
53
|
});
|
|
54
|
-
}),
|
|
54
|
+
}), m.value.fileList = o, r.value = e;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
z({ setValue:
|
|
58
|
-
let u = [],
|
|
59
|
-
function
|
|
57
|
+
z({ setValue: T });
|
|
58
|
+
let u = [], I;
|
|
59
|
+
function h(e) {
|
|
60
60
|
setTimeout(() => {
|
|
61
|
-
const o =
|
|
61
|
+
const o = m.value.fileList.findIndex(
|
|
62
62
|
(t) => t.uid === e.uid
|
|
63
63
|
);
|
|
64
|
-
o >= 0 &&
|
|
64
|
+
o >= 0 && m.value.fileList.splice(o, 1);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
async function
|
|
67
|
+
async function Q(e) {
|
|
68
68
|
if (l && l > 1 && u.length >= l)
|
|
69
|
-
return clearTimeout(
|
|
69
|
+
return clearTimeout(I), I = setTimeout(() => {
|
|
70
70
|
p.warning(
|
|
71
71
|
W || i("ap.apUpload.maxUploadFiles", {
|
|
72
72
|
maxCount: l
|
|
73
73
|
})
|
|
74
74
|
);
|
|
75
|
-
}),
|
|
75
|
+
}), h(e), !1;
|
|
76
76
|
if (e.size > E * 1024 * 1024)
|
|
77
77
|
return p.warning(
|
|
78
78
|
G || i("ap.apUpload.maxUploadFileSize", {
|
|
79
79
|
maxSize: E
|
|
80
80
|
})
|
|
81
|
-
),
|
|
81
|
+
), h(e), !1;
|
|
82
82
|
if (!ve(e, k))
|
|
83
83
|
return p.warning(
|
|
84
84
|
H || i("ap.apUpload.fileFormatNotSupported")
|
|
85
|
-
),
|
|
85
|
+
), h(e), !1;
|
|
86
86
|
if (typeof F == "function" && await F(e) === !1)
|
|
87
|
-
return
|
|
87
|
+
return h(e), !1;
|
|
88
88
|
l && l === 1 && (u = [], r.value = void 0), u.push(e);
|
|
89
89
|
}
|
|
90
|
-
async function
|
|
91
|
-
if (
|
|
90
|
+
async function X(e) {
|
|
91
|
+
if (d.value++, typeof A == "function") {
|
|
92
92
|
A({
|
|
93
93
|
onProgress: (o) => {
|
|
94
94
|
setTimeout(() => {
|
|
@@ -103,47 +103,47 @@ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 },
|
|
|
103
103
|
name: o,
|
|
104
104
|
message: o
|
|
105
105
|
});
|
|
106
|
-
}),
|
|
106
|
+
}), d.value--;
|
|
107
107
|
},
|
|
108
108
|
onSuccess: (o) => {
|
|
109
109
|
setTimeout(() => {
|
|
110
110
|
e.onSuccess(o);
|
|
111
111
|
}), r.value = [
|
|
112
112
|
...r.value || [],
|
|
113
|
-
|
|
113
|
+
S(w, o, e.file.name)
|
|
114
114
|
], c.push({
|
|
115
115
|
uid: e.file.uid,
|
|
116
116
|
path: o
|
|
117
|
-
}),
|
|
117
|
+
}), d.value--;
|
|
118
118
|
},
|
|
119
119
|
file: e.file
|
|
120
120
|
});
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
try {
|
|
124
|
-
const o = await (
|
|
124
|
+
const o = await (P ? g(P) : g()), t = await L(async () => o);
|
|
125
125
|
e.file.oss = t, V({
|
|
126
126
|
file: e.file,
|
|
127
127
|
dirName: q,
|
|
128
128
|
oss: t,
|
|
129
|
-
successCallBack(
|
|
130
|
-
e.onSuccess(
|
|
129
|
+
successCallBack(n) {
|
|
130
|
+
e.onSuccess(n), r.value = [
|
|
131
131
|
...r.value || [],
|
|
132
|
-
|
|
132
|
+
S(w, n, e.file.name)
|
|
133
133
|
], c.push({
|
|
134
134
|
uid: e.file.uid,
|
|
135
|
-
path:
|
|
136
|
-
}),
|
|
135
|
+
path: n
|
|
136
|
+
}), d.value--;
|
|
137
137
|
},
|
|
138
|
-
errorCallBack(
|
|
139
|
-
b && p.warning(
|
|
140
|
-
name:
|
|
141
|
-
message:
|
|
142
|
-
}),
|
|
138
|
+
errorCallBack(n) {
|
|
139
|
+
b && p.warning(n || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
140
|
+
name: n,
|
|
141
|
+
message: n
|
|
142
|
+
}), d.value--;
|
|
143
143
|
},
|
|
144
|
-
progressCallBack(
|
|
144
|
+
progressCallBack(n) {
|
|
145
145
|
e.onProgress({
|
|
146
|
-
percent:
|
|
146
|
+
percent: n
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
149
|
baseDirName: j,
|
|
@@ -155,13 +155,13 @@ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 },
|
|
|
155
155
|
), e.onError({
|
|
156
156
|
name: o?.message || i("ap.apUpload.networkAnomaly"),
|
|
157
157
|
message: o?.message || i("ap.apUpload.networkAnomaly")
|
|
158
|
-
}),
|
|
158
|
+
}), d.value--;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Y(e) {
|
|
162
162
|
if (_ && _?.(e), e.response) {
|
|
163
163
|
if (Array.isArray(r.value)) {
|
|
164
|
-
const t = c.findIndex((
|
|
164
|
+
const t = c.findIndex((n) => n.uid === e.uid);
|
|
165
165
|
t >= 0 && (r?.value.splice(t, 1), c.splice(t, 1)), r.value.length === 0 && (r.value = void 0);
|
|
166
166
|
}
|
|
167
167
|
} else
|
|
@@ -171,7 +171,7 @@ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 },
|
|
|
171
171
|
);
|
|
172
172
|
return u.splice(o, 1), Promise.resolve(!0);
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const Z = async (e) => {
|
|
175
175
|
if (U.value?.trigger) {
|
|
176
176
|
let o = [e].map((t) => ({
|
|
177
177
|
objectName: t.response,
|
|
@@ -179,78 +179,78 @@ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 },
|
|
|
179
179
|
}));
|
|
180
180
|
U.value?.trigger?.(o);
|
|
181
181
|
} else {
|
|
182
|
-
const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1],
|
|
183
|
-
(await
|
|
182
|
+
const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], n = o?.[2] ?? e.response;
|
|
183
|
+
(await L(
|
|
184
184
|
() => t ? g?.(t) : g?.()
|
|
185
185
|
)).downloadFile([
|
|
186
186
|
{
|
|
187
|
-
path:
|
|
187
|
+
path: n,
|
|
188
188
|
fileName: e.name
|
|
189
189
|
}
|
|
190
190
|
]);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
193
|
-
|
|
192
|
+
}, ee = (e) => {
|
|
193
|
+
ge.createFilePreviewModal({
|
|
194
194
|
src: e.response,
|
|
195
195
|
fileName: e.name
|
|
196
196
|
});
|
|
197
197
|
};
|
|
198
198
|
return (e, o) => (x(), C("div", {
|
|
199
|
-
class:
|
|
200
|
-
[
|
|
201
|
-
[
|
|
199
|
+
class: ne({
|
|
200
|
+
[s(B)()]: !0,
|
|
201
|
+
[s(O) ?? ""]: !0
|
|
202
202
|
})
|
|
203
203
|
}, [
|
|
204
|
-
y(
|
|
204
|
+
y(s(de), {
|
|
205
205
|
ref_key: "uploadRef",
|
|
206
|
-
ref:
|
|
207
|
-
accept:
|
|
206
|
+
ref: m,
|
|
207
|
+
accept: s(k),
|
|
208
208
|
multiple: "",
|
|
209
|
-
"max-count":
|
|
209
|
+
"max-count": s(l),
|
|
210
210
|
progress: {
|
|
211
211
|
strokeWidth: 3,
|
|
212
212
|
showInfo: !1,
|
|
213
213
|
strokeColor: "#0070FF"
|
|
214
214
|
},
|
|
215
|
-
"before-upload":
|
|
216
|
-
"custom-request":
|
|
215
|
+
"before-upload": Q,
|
|
216
|
+
"custom-request": X,
|
|
217
217
|
"show-upload-list": {
|
|
218
|
-
showDownloadIcon:
|
|
218
|
+
showDownloadIcon: s(J),
|
|
219
219
|
showRemoveIcon: !0,
|
|
220
|
-
showPreviewIcon:
|
|
220
|
+
showPreviewIcon: s(K)
|
|
221
221
|
},
|
|
222
|
-
onPreview:
|
|
223
|
-
onRemove:
|
|
224
|
-
onDownload:
|
|
222
|
+
onPreview: ee,
|
|
223
|
+
onRemove: Y,
|
|
224
|
+
onDownload: Z
|
|
225
225
|
}, {
|
|
226
226
|
downloadIcon: N(() => [
|
|
227
|
-
y(
|
|
227
|
+
y(s(fe), { class: "anticon anticon-vertical-align-bottom" })
|
|
228
228
|
]),
|
|
229
229
|
default: N(() => [
|
|
230
|
-
|
|
231
|
-
y(
|
|
230
|
+
M("div", Ue, [
|
|
231
|
+
y(s(me), { class: "file-btn" }, {
|
|
232
232
|
default: N(() => [
|
|
233
|
-
y(
|
|
234
|
-
|
|
233
|
+
y(s(pe)),
|
|
234
|
+
re(" " + D(s($)), 1)
|
|
235
235
|
]),
|
|
236
236
|
_: 1
|
|
237
237
|
}),
|
|
238
|
-
|
|
238
|
+
M("div", {
|
|
239
239
|
class: "sub-title",
|
|
240
|
-
onClick: o[0] || (o[0] =
|
|
240
|
+
onClick: o[0] || (o[0] = ie(() => {
|
|
241
241
|
}, ["stop"]))
|
|
242
242
|
}, [
|
|
243
|
-
typeof
|
|
244
|
-
(x(),
|
|
245
|
-
])) :
|
|
243
|
+
typeof s(f) == "string" ? (x(), C("div", Ee, D(s(f) || `${s(i)("ap.apUpload.supportExtension")}:${s(xe)(s(k))}`), 1)) : s(f) ? (x(), C("div", Fe, [
|
|
244
|
+
(x(), ce(ue(s(f))))
|
|
245
|
+
])) : le("", !0)
|
|
246
246
|
])
|
|
247
247
|
])
|
|
248
248
|
]),
|
|
249
249
|
_: 1
|
|
250
|
-
}, 8, ["accept", "max-count"])
|
|
250
|
+
}, 8, ["accept", "max-count", "show-upload-list"])
|
|
251
251
|
], 2));
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
export {
|
|
255
|
-
|
|
255
|
+
qe as default
|
|
256
256
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as z, ref as g, computed as u, unref as t, createElementBlock as T, openBlock as B, normalizeClass as C, createVNode as d, withCtx as b, createBlock as _, createCommentVNode as K, normalizeStyle as M, mergeProps as $ } from "vue";
|
|
2
|
+
import { Form as D, Space as G } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as q } from "lodash-unified";
|
|
4
4
|
import "../../ap-field/index.mjs";
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
5
|
+
import { useDefaultPlaceholder as H } from "../../ap-field/hooks/use-default-placeholder.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
8
|
import "../../utils/index.mjs";
|
|
9
9
|
import "./popover-input/index.vue.mjs";
|
|
10
|
-
import
|
|
11
|
-
import { splitValue as
|
|
12
|
-
import { useControllableValue as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { useNamespace as
|
|
15
|
-
import { isDef as
|
|
16
|
-
import
|
|
17
|
-
import { ApFieldText as
|
|
18
|
-
import
|
|
19
|
-
const
|
|
10
|
+
import Y from "./style/index.mjs";
|
|
11
|
+
import { splitValue as J } from "./utils.mjs";
|
|
12
|
+
import { useControllableValue as Q } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
import { useLocale as W } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
|
|
15
|
+
import { isDef as Z } from "../../utils/is.mjs";
|
|
16
|
+
import ee from "../../ap-field/select/index.vue.mjs";
|
|
17
|
+
import { ApFieldText as te } from "../../ap-field/text/index.mjs";
|
|
18
|
+
import oe from "./popover-input/index.vue2.mjs";
|
|
19
|
+
const c = "GROUP_SEARCH_ALL", be = /* @__PURE__ */ z({
|
|
20
20
|
name: "BatchInputGroup",
|
|
21
21
|
__name: "index",
|
|
22
22
|
props: {
|
|
@@ -28,6 +28,7 @@ const d = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ $({
|
|
|
28
28
|
"onUpdate:value": {},
|
|
29
29
|
popoverPlacement: { default: "left" },
|
|
30
30
|
maxNum: { default: 200 },
|
|
31
|
+
getPopupContainer: {},
|
|
31
32
|
mode: { default: "edit" },
|
|
32
33
|
class: {},
|
|
33
34
|
variant: {},
|
|
@@ -77,91 +78,84 @@ const d = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ $({
|
|
|
77
78
|
beforeInput: {}
|
|
78
79
|
},
|
|
79
80
|
emits: ["update:value"],
|
|
80
|
-
setup(
|
|
81
|
-
const o =
|
|
81
|
+
setup(A, { emit: I }) {
|
|
82
|
+
const o = A, V = H("Text", o), x = I, { value: a, updateValue: r } = Q(
|
|
82
83
|
o,
|
|
83
|
-
|
|
84
|
-
),
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
"popover-left": Y(e) ? `${e}px` : e === "left" ? "0px" : "unset",
|
|
88
|
-
"popover-right": e === "right" ? "0px" : "unset"
|
|
89
|
-
};
|
|
90
|
-
}), P = r(() => o.options ? o.options.length > 1 && o.hasAll ? [
|
|
91
|
-
{ value: d, label: k("ap.common.all") },
|
|
84
|
+
x
|
|
85
|
+
), s = g(), f = g(), { t: S } = W(), { b: k } = X("batch-input-group"), v = Y("batch-input-group"), p = D.useInjectFormItemContext(), F = u(() => o.options ? o.options.length > 1 && o.hasAll ? [
|
|
86
|
+
{ value: c, label: S("ap.common.all") },
|
|
92
87
|
...o.options
|
|
93
|
-
] : o.options : []),
|
|
94
|
-
`) : ""),
|
|
88
|
+
] : o.options : []), U = u(() => o.options ? o.options.map((e) => e.value) : []), w = u(() => t(a)?.value?.length ? t(a).value.join(",") : ""), P = u(() => t(a)?.value?.length ? t(a).value.join(`
|
|
89
|
+
`) : ""), R = u(() => {
|
|
95
90
|
const e = t(a)?.key;
|
|
96
91
|
if (e?.length)
|
|
97
|
-
return e.length === 1 || !o.hasAll ? e[0] :
|
|
98
|
-
}),
|
|
92
|
+
return e.length === 1 || !o.hasAll ? e[0] : c;
|
|
93
|
+
}), j = u(() => {
|
|
99
94
|
const e = t(a)?.key;
|
|
100
|
-
return !e || e?.length <= 1 || o.hasAll === !1 ? t(
|
|
95
|
+
return !e || e?.length <= 1 || o.hasAll === !1 ? t(V) : (o.options || []).filter((n) => e.includes(n.value)).map((n) => n.label).join("/");
|
|
101
96
|
});
|
|
102
|
-
function
|
|
103
|
-
const l = t(a) || {}, n = e ===
|
|
104
|
-
|
|
97
|
+
function E(e) {
|
|
98
|
+
const l = t(a) || {}, n = e === c ? t(U) : Z(e) ? [e] : [];
|
|
99
|
+
r({
|
|
105
100
|
...l,
|
|
106
101
|
key: n
|
|
107
102
|
}), p.onFieldChange();
|
|
108
103
|
}
|
|
109
|
-
function
|
|
104
|
+
function L(e) {
|
|
110
105
|
const l = t(a) || {}, n = e.target.value || "";
|
|
111
|
-
let
|
|
112
|
-
if (n !==
|
|
106
|
+
let m = J(n, ",", ",", o.maxNum);
|
|
107
|
+
if (n !== m) {
|
|
113
108
|
const h = f.value?.$el?.querySelector("input");
|
|
114
|
-
h && (h.value =
|
|
109
|
+
h && (h.value = m);
|
|
115
110
|
}
|
|
116
|
-
let
|
|
117
|
-
|
|
111
|
+
let i = m.split(",");
|
|
112
|
+
i.length === 1 && i[0] === "" && (i = []), r({
|
|
118
113
|
...l,
|
|
119
|
-
value:
|
|
114
|
+
value: i
|
|
120
115
|
}), p.onFieldChange();
|
|
121
116
|
}
|
|
122
|
-
function
|
|
117
|
+
function N(e) {
|
|
123
118
|
const l = t(a) || {};
|
|
124
119
|
let n = e.split(/,|\n/);
|
|
125
|
-
|
|
120
|
+
r({
|
|
126
121
|
...l,
|
|
127
122
|
value: n
|
|
128
123
|
}), p.onFieldChange();
|
|
129
124
|
}
|
|
130
125
|
function y() {
|
|
131
126
|
const e = t(a) || {}, l = e.value?.filter(Boolean);
|
|
132
|
-
|
|
127
|
+
r({
|
|
133
128
|
...e,
|
|
134
129
|
value: l
|
|
135
130
|
}), p.onFieldChange();
|
|
136
131
|
}
|
|
137
|
-
function
|
|
132
|
+
function O(e) {
|
|
138
133
|
y(), o.onBlur?.(e);
|
|
139
134
|
}
|
|
140
|
-
return (e, l) => (B(),
|
|
135
|
+
return (e, l) => (B(), T("div", {
|
|
141
136
|
ref_key: "containerRef",
|
|
142
|
-
ref:
|
|
143
|
-
class:
|
|
144
|
-
style: C(t(U)(w.value)),
|
|
137
|
+
ref: s,
|
|
138
|
+
class: C([t(k)(), t(v)]),
|
|
145
139
|
onFocus: l[0] || (l[0] = //@ts-ignore
|
|
146
140
|
(...n) => e.onFocus && e.onFocus(...n)),
|
|
147
141
|
onBlur: l[1] || (l[1] = //@ts-ignore
|
|
148
142
|
(...n) => e.onBlur && e.onBlur(...n))
|
|
149
143
|
}, [
|
|
150
|
-
|
|
151
|
-
default:
|
|
152
|
-
e.options?.length ? (B(),
|
|
144
|
+
d(t(G).Compact, { block: "" }, {
|
|
145
|
+
default: b(() => [
|
|
146
|
+
e.options?.length ? (B(), _(t(ee), {
|
|
153
147
|
key: 0,
|
|
154
|
-
style:
|
|
155
|
-
options:
|
|
156
|
-
value:
|
|
148
|
+
style: M(e.style),
|
|
149
|
+
options: F.value,
|
|
150
|
+
value: R.value,
|
|
157
151
|
"allow-clear": !1,
|
|
158
152
|
"dropdown-match-select-width": !1,
|
|
159
153
|
disabled: e.disabled,
|
|
160
|
-
"get-popup-container": () =>
|
|
161
|
-
"onUpdate:value":
|
|
162
|
-
}, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) :
|
|
163
|
-
|
|
164
|
-
t(
|
|
154
|
+
"get-popup-container": () => s.value,
|
|
155
|
+
"onUpdate:value": E
|
|
156
|
+
}, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : K("", !0),
|
|
157
|
+
d(t(te), $(
|
|
158
|
+
t(q)(o, [
|
|
165
159
|
"style",
|
|
166
160
|
"value",
|
|
167
161
|
"onUpdate:value",
|
|
@@ -174,32 +168,33 @@ const d = "GROUP_SEARCH_ALL", Ve = /* @__PURE__ */ $({
|
|
|
174
168
|
ref_key: "inputRef",
|
|
175
169
|
ref: f,
|
|
176
170
|
style: e.inputStyle,
|
|
177
|
-
value:
|
|
178
|
-
placeholder:
|
|
179
|
-
onInput:
|
|
180
|
-
onBlur:
|
|
171
|
+
value: w.value,
|
|
172
|
+
placeholder: j.value,
|
|
173
|
+
onInput: L,
|
|
174
|
+
onBlur: O
|
|
181
175
|
}
|
|
182
176
|
), {
|
|
183
|
-
suffix:
|
|
184
|
-
|
|
185
|
-
_parent:
|
|
186
|
-
value:
|
|
177
|
+
suffix: b(() => [
|
|
178
|
+
d(oe, {
|
|
179
|
+
_parent: s.value,
|
|
180
|
+
value: P.value,
|
|
187
181
|
disabled: e.disabled,
|
|
188
182
|
placement: o.popoverPlacement,
|
|
189
183
|
"max-num": e.maxNum,
|
|
190
|
-
class:
|
|
191
|
-
"
|
|
184
|
+
class: C(t(v)),
|
|
185
|
+
"get-popup-container": e.getPopupContainer,
|
|
186
|
+
"onUpdate:value": N,
|
|
192
187
|
onClose: y
|
|
193
|
-
}, null, 8, ["_parent", "value", "disabled", "placement", "max-num", "class"])
|
|
188
|
+
}, null, 8, ["_parent", "value", "disabled", "placement", "max-num", "class", "get-popup-container"])
|
|
194
189
|
]),
|
|
195
190
|
_: 1
|
|
196
191
|
}, 16, ["style", "value", "placeholder"])
|
|
197
192
|
]),
|
|
198
193
|
_: 1
|
|
199
194
|
})
|
|
200
|
-
],
|
|
195
|
+
], 34));
|
|
201
196
|
}
|
|
202
197
|
});
|
|
203
198
|
export {
|
|
204
|
-
|
|
199
|
+
be as default
|
|
205
200
|
};
|
|
@@ -36,12 +36,15 @@ export interface BatchInputGroupProps extends Omit<ApFieldTextProps, 'value' | '
|
|
|
36
36
|
* 最大输入条数,默认为200
|
|
37
37
|
*/
|
|
38
38
|
maxNum?: number;
|
|
39
|
+
getPopupContainer?: BatchInputGroupPopoverInputProps['getPopupContainer'];
|
|
39
40
|
}
|
|
40
41
|
export interface BatchInputGroupPopoverInputProps extends Pick<ApFieldTextAreaProps, 'value' | 'onUpdate:value'> {
|
|
41
42
|
_parent?: HTMLElement;
|
|
42
43
|
onClose?: () => void;
|
|
43
44
|
disabled?: boolean;
|
|
44
45
|
maxNum?: number;
|
|
46
|
+
getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
|
|
47
|
+
placement?: BatchInputGroupProps['popoverPlacement'];
|
|
45
48
|
}
|
|
46
49
|
export type ApFormItemBatchInputProps = ApFormItemProps & {
|
|
47
50
|
field?: Omit<BatchInputGroupProps, 'value' | 'onUpdate:value'>;
|