@aplus-frontend/ui 0.3.11 → 0.3.13
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/index.mjs +173 -169
- package/es/src/ap-field/radio/style/index.js +1 -0
- package/es/src/ap-form/ap-form.vue.d.ts +12 -31
- package/es/src/ap-form/ap-form.vue2.mjs +135 -118
- package/es/src/ap-form/drawer-form/index.vue.d.ts +22 -40
- package/es/src/ap-form/drawer-form/index.vue.mjs +3 -3
- package/es/src/ap-form/index.d.ts +3 -1
- package/es/src/ap-form/index.mjs +26 -22
- package/es/src/ap-form/interface.d.ts +3 -1
- package/es/src/ap-form/modal-form/index.vue.d.ts +23 -41
- package/es/src/ap-form/modal-form/index.vue.mjs +60 -59
- package/es/src/ap-form/provider/context.d.ts +3 -0
- package/es/src/ap-form/provider/context.mjs +17 -0
- package/es/src/ap-form/provider/index.vue.d.ts +19 -0
- package/es/src/ap-form/provider/index.vue.mjs +39 -0
- package/es/src/ap-form/provider/index.vue2.mjs +4 -0
- package/es/src/ap-form/provider/interface.d.ts +22 -0
- package/es/src/ap-form/search-form/index.vue.d.ts +22 -40
- package/es/src/business/ap-ladder/style/index.js +1 -0
- package/es/src/business/ap-table-modal/interface.d.ts +2 -0
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +50 -48
- package/es/src/business/batch-input-group/form-item.vue.d.ts +6 -0
- package/es/src/business/batch-input-group/form-item.vue.mjs +101 -0
- package/es/src/business/batch-input-group/form-item.vue2.mjs +4 -0
- package/es/src/business/batch-input-group/index.d.ts +2 -1
- package/es/src/business/batch-input-group/index.mjs +1 -0
- package/es/src/business/batch-input-group/index.vue.mjs +46 -44
- package/es/src/business/batch-input-group/interface.d.ts +8 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +43 -38
- package/es/src/config-provider/config-provider.d.ts +1 -0
- package/es/src/config-provider/css-var.d.ts +1 -0
- package/es/src/config-provider/css-var.mjs +14 -12
- package/es/src/config-provider/index.d.ts +5 -0
- package/es/src/index.mjs +154 -150
- package/es/src/utils/slot.mjs +6 -8
- package/lib/index.js +1 -1
- package/lib/src/ap-field/radio/style/index.js +1 -0
- package/lib/src/ap-form/ap-form.vue.d.ts +12 -31
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +22 -40
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/index.d.ts +3 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +3 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +23 -41
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/provider/context.d.ts +3 -0
- package/lib/src/ap-form/provider/context.js +1 -0
- package/lib/src/ap-form/provider/index.vue.d.ts +19 -0
- package/lib/src/ap-form/provider/index.vue.js +1 -0
- package/lib/src/ap-form/provider/index.vue2.js +1 -0
- package/lib/src/ap-form/provider/interface.d.ts +22 -0
- package/lib/src/ap-form/render/style/index.d.ts +1 -0
- package/lib/src/ap-form/render/style/index.js +1 -0
- package/lib/src/ap-form/search-form/index.vue.d.ts +22 -40
- package/lib/src/business/ap-ladder/style/index.js +1 -0
- package/lib/src/business/ap-table-modal/interface.d.ts +2 -0
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.d.ts +6 -0
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -0
- package/lib/src/business/batch-input-group/form-item.vue2.js +1 -0
- package/lib/src/business/batch-input-group/index.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.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 +8 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
- package/lib/src/config-provider/config-provider.d.ts +1 -0
- package/lib/src/config-provider/css-var.d.ts +1 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +5 -0
- package/lib/src/index.js +1 -1
- package/lib/src/utils/slot.js +1 -1
- package/package.json +2 -2
- /package/es/src/ap-field/radio/style/{style.d.ts → index.d.ts} +0 -0
- /package/es/src/ap-form/render/style/{style.d.ts → index.d.ts} +0 -0
- /package/{lib/src/ap-form/render/style/style.d.ts → es/src/ap-form/render/style/index.js} +0 -0
- /package/es/src/business/ap-ladder/style/{style.d.ts → index.d.ts} +0 -0
- /package/lib/src/ap-field/radio/style/{style.d.ts → index.d.ts} +0 -0
- /package/lib/src/business/ap-ladder/style/{style.d.ts → index.d.ts} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
1
|
+
import { defineComponent as U, ref as m, unref as s, computed as q, h as V, openBlock as k, createBlock as T, mergeProps as y, withCtx as h, resolveDynamicComponent as $, createCommentVNode as z, createVNode as S } from "vue";
|
|
2
|
+
import { message as B, Modal as W } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../index.mjs";
|
|
4
|
-
import { cloneDeep as
|
|
5
|
-
import { transformTableParams as
|
|
4
|
+
import { cloneDeep as Y, omit as R } from "lodash-unified";
|
|
5
|
+
import { transformTableParams as J } from "@aplus-frontend/utils";
|
|
6
6
|
import "./modal-title.vue.mjs";
|
|
7
|
-
import { AsyncOpenResultError as
|
|
7
|
+
import { AsyncOpenResultError as b } from "./interface.mjs";
|
|
8
8
|
import "./table-layout/index.vue.mjs";
|
|
9
|
-
import { useGlobalConfig as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { ApTable as
|
|
14
|
-
const
|
|
9
|
+
import { useGlobalConfig as Q } from "../../config-provider/hooks/use-global-config.mjs";
|
|
10
|
+
import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import Z from "./modal-title.vue2.mjs";
|
|
12
|
+
import j from "./table-layout/index.vue2.mjs";
|
|
13
|
+
import { ApTable as ee } from "../../ap-table/index.mjs";
|
|
14
|
+
const pe = /* @__PURE__ */ U({
|
|
15
15
|
__name: "table-modal",
|
|
16
16
|
props: {
|
|
17
17
|
columns: {},
|
|
@@ -24,6 +24,7 @@ const fe = /* @__PURE__ */ F({
|
|
|
24
24
|
disabledCheckbox: { type: [Boolean, Function] },
|
|
25
25
|
rowSelection: {},
|
|
26
26
|
tableLayoutConfig: {},
|
|
27
|
+
renderHeader: {},
|
|
27
28
|
prefixCls: {},
|
|
28
29
|
confirmLoading: { type: Boolean, default: void 0 },
|
|
29
30
|
title: {},
|
|
@@ -61,12 +62,12 @@ const fe = /* @__PURE__ */ F({
|
|
|
61
62
|
mousePosition: {}
|
|
62
63
|
},
|
|
63
64
|
emits: ["finish"],
|
|
64
|
-
setup(
|
|
65
|
-
const e =
|
|
65
|
+
setup(M, { expose: P, emit: K }) {
|
|
66
|
+
const e = M, _ = K, i = m(!1), x = m({}), d = m(null), a = m([]), C = m();
|
|
66
67
|
let c = null, n = null;
|
|
67
|
-
const
|
|
68
|
+
const I = Q("uiMode", "admin"), { t: g } = X(), D = async (o = [], t = {}) => {
|
|
68
69
|
var l, r, u;
|
|
69
|
-
switch (a.value = [...o], i.value = !0,
|
|
70
|
+
switch (a.value = [...o], i.value = !0, x.value = t == null ? void 0 : t.extraParams, C.value = t.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), t.refreshMode || "reset") {
|
|
70
71
|
case "reset":
|
|
71
72
|
(r = d.value) == null || r.reset();
|
|
72
73
|
break;
|
|
@@ -80,31 +81,31 @@ const fe = /* @__PURE__ */ F({
|
|
|
80
81
|
c = p, n = f;
|
|
81
82
|
});
|
|
82
83
|
}, w = () => {
|
|
83
|
-
i.value = !1, c = null, n == null || n(
|
|
84
|
-
},
|
|
85
|
-
o =
|
|
84
|
+
i.value = !1, c = null, n == null || n(b.ModalCancel), n = null;
|
|
85
|
+
}, L = async (o) => {
|
|
86
|
+
o = J({
|
|
86
87
|
...o,
|
|
87
|
-
...
|
|
88
|
+
...x.value
|
|
88
89
|
});
|
|
89
90
|
const t = e.api, { records: l, total: r } = await t(o);
|
|
90
91
|
return {
|
|
91
92
|
data: l,
|
|
92
93
|
total: r
|
|
93
94
|
};
|
|
94
|
-
},
|
|
95
|
+
}, N = () => {
|
|
95
96
|
if (a.value.length > e.maxCount) {
|
|
96
|
-
n == null || n(
|
|
97
|
+
n == null || n(b.ExceedMaxCount);
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
if (e.getRowKey) {
|
|
100
|
-
const o =
|
|
101
|
-
|
|
101
|
+
const o = Y(s(a)), t = o.map(e.getRowKey);
|
|
102
|
+
_("finish", t, o), c == null || c({ keys: t, rows: o });
|
|
102
103
|
} else {
|
|
103
|
-
n == null || n(
|
|
104
|
+
n == null || n(b.NotFineGetRowKey);
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
107
|
i.value = !1;
|
|
107
|
-
}, A =
|
|
108
|
+
}, A = q(() => {
|
|
108
109
|
if (!e.getRowKey) return;
|
|
109
110
|
const o = e.getRowKey;
|
|
110
111
|
return {
|
|
@@ -115,14 +116,14 @@ const fe = /* @__PURE__ */ F({
|
|
|
115
116
|
onSelectAll(t, l) {
|
|
116
117
|
var u, p;
|
|
117
118
|
if (l.length > e.maxCount) {
|
|
118
|
-
|
|
119
|
+
B.warning(
|
|
119
120
|
g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
|
|
120
121
|
);
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
124
|
const r = (u = d.value) == null ? void 0 : u.dataSource;
|
|
124
125
|
if (t) {
|
|
125
|
-
const f = s(r).filter((v) => !a.value.some((
|
|
126
|
+
const f = s(r).filter((v) => !a.value.some((F) => o(F) === o(v)));
|
|
126
127
|
a.value = a.value.concat(f);
|
|
127
128
|
} else
|
|
128
129
|
a.value = (p = a.value) == null ? void 0 : p.filter((f) => !r.some((v) => o(v) === o(f)));
|
|
@@ -130,7 +131,7 @@ const fe = /* @__PURE__ */ F({
|
|
|
130
131
|
onSelect(t, l) {
|
|
131
132
|
if (l) {
|
|
132
133
|
if (a.value.length >= e.maxCount) {
|
|
133
|
-
|
|
134
|
+
B.warning(
|
|
134
135
|
g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
|
|
135
136
|
);
|
|
136
137
|
return;
|
|
@@ -149,8 +150,8 @@ const fe = /* @__PURE__ */ F({
|
|
|
149
150
|
}),
|
|
150
151
|
...e.rowSelection || {}
|
|
151
152
|
};
|
|
152
|
-
}),
|
|
153
|
-
|
|
153
|
+
}), O = () => e.isRenderModalTitleSuffix ? V(
|
|
154
|
+
Z,
|
|
154
155
|
{
|
|
155
156
|
title: e.title,
|
|
156
157
|
count: a.value.length || 0,
|
|
@@ -159,9 +160,9 @@ const fe = /* @__PURE__ */ F({
|
|
|
159
160
|
{
|
|
160
161
|
default: e.renderModalTitleSuffix ?? void 0
|
|
161
162
|
}
|
|
162
|
-
) : e.title,
|
|
163
|
+
) : e.title, G = () => d.value, H = () => {
|
|
163
164
|
a.value = [];
|
|
164
|
-
},
|
|
165
|
+
}, E = (o) => {
|
|
165
166
|
const t = e.getRowKey;
|
|
166
167
|
if (!t) return;
|
|
167
168
|
const l = a.value.findIndex(
|
|
@@ -169,16 +170,16 @@ const fe = /* @__PURE__ */ F({
|
|
|
169
170
|
);
|
|
170
171
|
a.value.splice(l, 1);
|
|
171
172
|
};
|
|
172
|
-
return
|
|
173
|
-
open:
|
|
173
|
+
return P({
|
|
174
|
+
open: D,
|
|
174
175
|
close: w,
|
|
175
|
-
getApTableInstance:
|
|
176
|
-
}), (o, t) => (
|
|
176
|
+
getApTableInstance: G
|
|
177
|
+
}), (o, t) => (k(), T(s(W), y(
|
|
177
178
|
{
|
|
178
179
|
open: i.value,
|
|
179
180
|
"onUpdate:open": t[0] || (t[0] = (l) => i.value = l)
|
|
180
181
|
},
|
|
181
|
-
s(
|
|
182
|
+
s(R)(e, [
|
|
182
183
|
"api",
|
|
183
184
|
"getRowKey",
|
|
184
185
|
"centered",
|
|
@@ -193,30 +194,31 @@ const fe = /* @__PURE__ */ F({
|
|
|
193
194
|
"tableLayoutConfig"
|
|
194
195
|
]),
|
|
195
196
|
{
|
|
196
|
-
title:
|
|
197
|
+
title: O(),
|
|
197
198
|
"body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
|
|
198
199
|
centered: e.centered ?? !0,
|
|
199
|
-
onOk:
|
|
200
|
+
onOk: N,
|
|
200
201
|
onCancel: w
|
|
201
202
|
}
|
|
202
203
|
), {
|
|
203
|
-
default:
|
|
204
|
-
|
|
204
|
+
default: h(() => [
|
|
205
|
+
e.renderHeader ? (k(), T($(e.renderHeader), { key: 0 })) : z("", !0),
|
|
206
|
+
S(j, y(e.tableLayoutConfig || {}, {
|
|
205
207
|
"selected-list": a.value,
|
|
206
|
-
onClear:
|
|
207
|
-
onDeleteItem:
|
|
208
|
+
onClear: H,
|
|
209
|
+
onDeleteItem: E
|
|
208
210
|
}), {
|
|
209
|
-
default:
|
|
210
|
-
|
|
211
|
+
default: h(() => [
|
|
212
|
+
S(s(ee), y(s(R)(e.apTableProps, "dataSource"), {
|
|
211
213
|
ref_key: "apTableRef",
|
|
212
214
|
ref: d,
|
|
213
215
|
scroll: { y: "100%" },
|
|
214
216
|
style: { padding: "0px" },
|
|
215
217
|
columns: o.columns,
|
|
216
|
-
request:
|
|
218
|
+
request: L,
|
|
217
219
|
"row-key": o.getRowKey,
|
|
218
220
|
"row-selection": A.value,
|
|
219
|
-
bordered: s(
|
|
221
|
+
bordered: s(I) === "admin",
|
|
220
222
|
"data-source": C.value
|
|
221
223
|
}), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
|
|
222
224
|
]),
|
|
@@ -228,5 +230,5 @@ const fe = /* @__PURE__ */ F({
|
|
|
228
230
|
}
|
|
229
231
|
});
|
|
230
232
|
export {
|
|
231
|
-
|
|
233
|
+
pe as default
|
|
232
234
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApFormItemBatchInputProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormItemBatchInputProps> & Readonly<{}>, {
|
|
4
|
+
trim: boolean;
|
|
5
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent as B, computed as n, openBlock as b, createBlock as _, mergeProps as u, unref as f, withCtx as g, createVNode as x } from "vue";
|
|
2
|
+
import "./index.vue2.mjs";
|
|
3
|
+
import "../../ap-form/item/index.vue2.mjs";
|
|
4
|
+
import { isValid as d } from "@aplus-frontend/utils";
|
|
5
|
+
import { omit as p } from "lodash-unified";
|
|
6
|
+
import V from "../../ap-form/item/index.vue.mjs";
|
|
7
|
+
import k from "./index.vue.mjs";
|
|
8
|
+
const A = /* @__PURE__ */ B({
|
|
9
|
+
__name: "form-item",
|
|
10
|
+
props: {
|
|
11
|
+
htmlFor: {},
|
|
12
|
+
prefixCls: {},
|
|
13
|
+
label: {},
|
|
14
|
+
help: {},
|
|
15
|
+
extra: {},
|
|
16
|
+
labelCol: {},
|
|
17
|
+
wrapperCol: {},
|
|
18
|
+
hasFeedback: { type: Boolean },
|
|
19
|
+
colon: { type: Boolean },
|
|
20
|
+
labelAlign: {},
|
|
21
|
+
prop: {},
|
|
22
|
+
name: {},
|
|
23
|
+
rules: {},
|
|
24
|
+
autoLink: { type: Boolean },
|
|
25
|
+
required: { type: Boolean },
|
|
26
|
+
validateFirst: { type: Boolean },
|
|
27
|
+
validateStatus: {},
|
|
28
|
+
validateTrigger: {},
|
|
29
|
+
messageVariables: {},
|
|
30
|
+
hidden: { type: Boolean },
|
|
31
|
+
noStyle: { type: Boolean },
|
|
32
|
+
tooltip: {},
|
|
33
|
+
span: {},
|
|
34
|
+
order: {},
|
|
35
|
+
offset: {},
|
|
36
|
+
push: {},
|
|
37
|
+
pull: {},
|
|
38
|
+
xs: {},
|
|
39
|
+
sm: {},
|
|
40
|
+
md: {},
|
|
41
|
+
lg: {},
|
|
42
|
+
xl: {},
|
|
43
|
+
xxl: {},
|
|
44
|
+
flex: {},
|
|
45
|
+
bordered: { type: Boolean },
|
|
46
|
+
valuePropName: {},
|
|
47
|
+
initialValue: {},
|
|
48
|
+
_signal: {},
|
|
49
|
+
transform: {},
|
|
50
|
+
field: {},
|
|
51
|
+
disabled: { type: Boolean },
|
|
52
|
+
placeholer: {},
|
|
53
|
+
trim: { type: Boolean, default: !0 }
|
|
54
|
+
},
|
|
55
|
+
setup(c) {
|
|
56
|
+
const l = c, y = n(() => (l == null ? void 0 : l.transform) || {
|
|
57
|
+
flat: !1,
|
|
58
|
+
transformer: (e) => {
|
|
59
|
+
var o, a, i, r, m, s;
|
|
60
|
+
if (e)
|
|
61
|
+
return !(e != null && e.value) || ((o = e == null ? void 0 : e.value) == null ? void 0 : o.length) < 1 ? void 0 : (a = l == null ? void 0 : l.field) != null && a.options ? {
|
|
62
|
+
...e,
|
|
63
|
+
value: (r = (i = e == null ? void 0 : e.value) == null ? void 0 : i.filter((t) => d(t == null ? void 0 : t.trim()))) == null ? void 0 : r.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
|
|
64
|
+
} : (s = (m = e == null ? void 0 : e.value) == null ? void 0 : m.filter((t) => d(t == null ? void 0 : t.trim()))) == null ? void 0 : s.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
|
|
65
|
+
}
|
|
66
|
+
}), v = n(() => {
|
|
67
|
+
var e;
|
|
68
|
+
return ((e = l.field) == null ? void 0 : e.style) || "width:auto";
|
|
69
|
+
}), h = n(() => {
|
|
70
|
+
var e, o;
|
|
71
|
+
return (l == null ? void 0 : l.initialValue) || {
|
|
72
|
+
key: (o = (e = l == null ? void 0 : l.field) == null ? void 0 : e.options) == null ? void 0 : o.map((a) => a.value)
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
return (e, o) => (b(), _(V, u(
|
|
76
|
+
f(p)(l, [
|
|
77
|
+
"field",
|
|
78
|
+
"initialValue",
|
|
79
|
+
"transform",
|
|
80
|
+
"placeholder",
|
|
81
|
+
"disabled"
|
|
82
|
+
]),
|
|
83
|
+
{
|
|
84
|
+
"initial-value": h.value,
|
|
85
|
+
transform: y.value
|
|
86
|
+
}
|
|
87
|
+
), {
|
|
88
|
+
default: g(() => [
|
|
89
|
+
x(k, u(f(p)(l.field, ["style"]), {
|
|
90
|
+
style: v.value,
|
|
91
|
+
disabled: e.disabled,
|
|
92
|
+
placeholer: e.placeholer
|
|
93
|
+
}), null, 16, ["style", "disabled", "placeholer"])
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 16, ["initial-value", "transform"]));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
A as default
|
|
101
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, ref as B, computed as r, unref as
|
|
1
|
+
import { defineComponent as O, ref as B, computed as r, unref as l, openBlock as g, createElementBlock as P, createVNode as p, withCtx as A, createBlock as T, normalizeStyle as z, createCommentVNode as K, mergeProps as M } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { Space as $ } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -12,7 +12,7 @@ import { useLocale as H } from "../../config-provider/hooks/use-locale.mjs";
|
|
|
12
12
|
import Y from "../../ap-field/select/index.vue.mjs";
|
|
13
13
|
import { ApFieldText as J } from "../../ap-field/text/index.mjs";
|
|
14
14
|
import Q from "./popover-input/index.vue2.mjs";
|
|
15
|
-
const
|
|
15
|
+
const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
style: { type: [Boolean, null, String, Object, Array] },
|
|
@@ -68,69 +68,69 @@ const c = "GROUP_SEARCH_ALL", ce = /* @__PURE__ */ O({
|
|
|
68
68
|
emptyText: { default: "--" }
|
|
69
69
|
},
|
|
70
70
|
emits: ["update:value"],
|
|
71
|
-
setup(
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
), f = B(),
|
|
76
|
-
{ value:
|
|
77
|
-
...
|
|
78
|
-
] :
|
|
71
|
+
setup(b, { emit: V }) {
|
|
72
|
+
const n = b, C = N("Text", n), S = V, { value: a, updateValue: i } = q(
|
|
73
|
+
n,
|
|
74
|
+
S
|
|
75
|
+
), f = B(), c = B(), { t: I } = H(), U = r(() => n.options ? n.options.length > 1 && n.hasAll ? [
|
|
76
|
+
{ value: d, label: I("ap.apGroupSearch.all") },
|
|
77
|
+
...n.options
|
|
78
|
+
] : n.options : []), w = r(() => n.options ? n.options.map((e) => e.value) : []), k = r(() => {
|
|
79
79
|
var e, t;
|
|
80
|
-
return (t = (e =
|
|
81
|
-
}),
|
|
80
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(",") : "";
|
|
81
|
+
}), x = r(() => {
|
|
82
82
|
var e, t;
|
|
83
|
-
return (t = (e =
|
|
83
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(`
|
|
84
84
|
`) : "";
|
|
85
|
-
}),
|
|
85
|
+
}), R = r(() => {
|
|
86
86
|
var t;
|
|
87
|
-
const e = (t =
|
|
87
|
+
const e = (t = l(a)) == null ? void 0 : t.key;
|
|
88
88
|
if (e != null && e.length)
|
|
89
|
-
return e.length === 1 ? e[0] :
|
|
90
|
-
}),
|
|
89
|
+
return e.length === 1 ? e[0] : d;
|
|
90
|
+
}), _ = r(() => {
|
|
91
91
|
var o;
|
|
92
|
-
const e = (o =
|
|
93
|
-
return !e || (e == null ? void 0 : e.length) <= 1 ?
|
|
92
|
+
const e = (o = l(a)) == null ? void 0 : o.key;
|
|
93
|
+
return !e || (e == null ? void 0 : e.length) <= 1 ? l(C) : (n.options || []).filter((u) => e.includes(u.value)).map((u) => u.label).join("/");
|
|
94
94
|
});
|
|
95
95
|
function j(e) {
|
|
96
|
-
const t =
|
|
97
|
-
|
|
96
|
+
const t = l(a) || {}, o = e === d ? l(w) : G(e) ? [e] : [];
|
|
97
|
+
i({
|
|
98
98
|
...t,
|
|
99
99
|
key: o
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
function E(e) {
|
|
103
103
|
var v, y;
|
|
104
|
-
const t =
|
|
104
|
+
const t = l(a) || {}, o = e.target.value || "", u = o.replace(/[,]+/g, ",");
|
|
105
105
|
if (o !== u) {
|
|
106
|
-
const h = (y = (v =
|
|
106
|
+
const h = (y = (v = c.value) == null ? void 0 : v.$el) == null ? void 0 : y.querySelector("input");
|
|
107
107
|
h && (h.value = u);
|
|
108
108
|
}
|
|
109
|
-
let
|
|
110
|
-
|
|
109
|
+
let s = u.split(",");
|
|
110
|
+
s.length === 1 && s[0] === "" && (s = []), i({
|
|
111
111
|
...t,
|
|
112
|
-
value:
|
|
112
|
+
value: s
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
function F(e) {
|
|
116
|
-
const t =
|
|
116
|
+
const t = l(a) || {};
|
|
117
117
|
let o = e.split(/,|\n/);
|
|
118
|
-
|
|
118
|
+
i({
|
|
119
119
|
...t,
|
|
120
120
|
value: o
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
function m() {
|
|
124
124
|
var o;
|
|
125
|
-
const e =
|
|
126
|
-
|
|
125
|
+
const e = l(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
|
|
126
|
+
i({
|
|
127
127
|
...e,
|
|
128
128
|
value: t
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
function L(e) {
|
|
132
132
|
var t;
|
|
133
|
-
m(), (t =
|
|
133
|
+
m(), (t = n.onBlur) == null || t.call(n, e);
|
|
134
134
|
}
|
|
135
135
|
return (e, t) => (g(), P("div", {
|
|
136
136
|
ref_key: "containerRef",
|
|
@@ -141,21 +141,22 @@ const c = "GROUP_SEARCH_ALL", ce = /* @__PURE__ */ O({
|
|
|
141
141
|
onBlur: t[1] || (t[1] = //@ts-ignore
|
|
142
142
|
(...o) => e.onBlur && e.onBlur(...o))
|
|
143
143
|
}, [
|
|
144
|
-
|
|
144
|
+
p(l($).Compact, { block: "" }, {
|
|
145
145
|
default: A(() => {
|
|
146
146
|
var o;
|
|
147
147
|
return [
|
|
148
|
-
(o = e.options) != null && o.length ? (g(), T(
|
|
148
|
+
(o = e.options) != null && o.length ? (g(), T(l(Y), {
|
|
149
149
|
key: 0,
|
|
150
150
|
style: z(e.style),
|
|
151
151
|
options: U.value,
|
|
152
|
-
value:
|
|
152
|
+
value: R.value,
|
|
153
153
|
"allow-clear": !1,
|
|
154
154
|
"dropdown-match-select-width": !1,
|
|
155
|
+
disabled: e.disabled,
|
|
155
156
|
"onUpdate:value": j
|
|
156
|
-
}, null, 8, ["style", "options", "value"])) : K("", !0),
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
}, null, 8, ["style", "options", "value", "disabled"])) : K("", !0),
|
|
158
|
+
p(l(J), M(
|
|
159
|
+
l(D)(n, [
|
|
159
160
|
"style",
|
|
160
161
|
"value",
|
|
161
162
|
"onUpdate:value",
|
|
@@ -165,21 +166,22 @@ const c = "GROUP_SEARCH_ALL", ce = /* @__PURE__ */ O({
|
|
|
165
166
|
]),
|
|
166
167
|
{
|
|
167
168
|
ref_key: "inputRef",
|
|
168
|
-
ref:
|
|
169
|
+
ref: c,
|
|
169
170
|
style: e.inputStyle,
|
|
170
|
-
value:
|
|
171
|
-
placeholder:
|
|
171
|
+
value: k.value,
|
|
172
|
+
placeholder: _.value,
|
|
172
173
|
onInput: E,
|
|
173
174
|
onBlur: L
|
|
174
175
|
}
|
|
175
176
|
), {
|
|
176
177
|
suffix: A(() => [
|
|
177
|
-
|
|
178
|
+
p(Q, {
|
|
178
179
|
_parent: f.value,
|
|
179
|
-
value:
|
|
180
|
+
value: x.value,
|
|
181
|
+
disabled: e.disabled,
|
|
180
182
|
"onUpdate:value": F,
|
|
181
183
|
onClose: m
|
|
182
|
-
}, null, 8, ["_parent", "value"])
|
|
184
|
+
}, null, 8, ["_parent", "value", "disabled"])
|
|
183
185
|
]),
|
|
184
186
|
_: 1
|
|
185
187
|
}, 16, ["style", "value", "placeholder"])
|
|
@@ -191,5 +193,5 @@ const c = "GROUP_SEARCH_ALL", ce = /* @__PURE__ */ O({
|
|
|
191
193
|
}
|
|
192
194
|
});
|
|
193
195
|
export {
|
|
194
|
-
|
|
196
|
+
de as default
|
|
195
197
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApFieldTextAreaProps, ApFieldTextProps } from '../../ap-field';
|
|
2
|
+
import { ApFormItemProps } from '../../ap-form';
|
|
2
3
|
import { DefaultOptionType } from '@aplus-frontend/antdv/es/select';
|
|
3
4
|
import { StyleValue } from 'vue';
|
|
4
5
|
export type BatchInputGroupValueType = {
|
|
@@ -31,4 +32,11 @@ export interface BatchInputGroupProps extends Omit<ApFieldTextProps, 'value' | '
|
|
|
31
32
|
export interface BatchInputGroupPopoverInputProps extends Pick<ApFieldTextAreaProps, 'value' | 'onUpdate:value'> {
|
|
32
33
|
_parent?: HTMLElement;
|
|
33
34
|
onClose?: () => void;
|
|
35
|
+
disabled?: boolean;
|
|
34
36
|
}
|
|
37
|
+
export type ApFormItemBatchInputProps = ApFormItemProps & {
|
|
38
|
+
field?: Omit<BatchInputGroupProps, 'value' | 'onUpdate:value'>;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
placeholer?: string;
|
|
41
|
+
trim?: boolean;
|
|
42
|
+
};
|
|
@@ -1,74 +1,79 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
1
|
+
import { defineComponent as A, ref as m, openBlock as w, createElementBlock as B, normalizeClass as p, unref as e, createVNode as c, withCtx as d, createElementVNode as L } from "vue";
|
|
2
|
+
import { Popover as N, Textarea as P } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
|
-
import { IconApAdLineScreen as
|
|
4
|
+
import { IconApAdLineScreen as z } from "@aplus-frontend/icon";
|
|
5
5
|
import "../../../hooks/index.mjs";
|
|
6
|
-
import { useControllableValue as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
6
|
+
import { useControllableValue as E } from "../../../hooks/useControllableValue.mjs";
|
|
7
|
+
import { useLocale as F } from "../../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as O } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const D = /* @__PURE__ */ A({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
_parent: {},
|
|
13
13
|
onClose: { type: Function },
|
|
14
|
+
disabled: { type: Boolean },
|
|
14
15
|
value: {},
|
|
15
16
|
"onUpdate:value": { type: Function }
|
|
16
17
|
},
|
|
17
18
|
emits: ["update:value"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
const
|
|
19
|
+
setup(f, { emit: v }) {
|
|
20
|
+
const o = f, g = v, { value: b, updateValue: h } = E(o, g), n = m(!1), l = m(), C = (t) => o._parent || t, { t: _ } = F();
|
|
21
|
+
function x(t) {
|
|
22
|
+
var s;
|
|
23
|
+
const a = t.target.value || "", r = a.replace(/[\n,]+/g, `
|
|
23
24
|
`);
|
|
24
|
-
if (r !==
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
if (r !== a) {
|
|
26
|
+
const i = ((s = l.value) == null ? void 0 : s.$el) || l.value;
|
|
27
|
+
i && (i.value = r);
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
h(r);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
t
|
|
31
|
+
function y(t) {
|
|
32
|
+
var a;
|
|
33
|
+
o.disabled ? n.value = !1 : n.value = t, !t && ((a = o.onClose) == null || a.call(o));
|
|
33
34
|
}
|
|
34
|
-
const { b:
|
|
35
|
-
return (t,
|
|
36
|
-
class:
|
|
35
|
+
const { b: u, e: I, em: V, bm: k } = O("batch-input-group-popover-input");
|
|
36
|
+
return (t, a) => (w(), B("div", {
|
|
37
|
+
class: p(e(u)())
|
|
37
38
|
}, [
|
|
38
|
-
|
|
39
|
-
"overlay-class-name": e(
|
|
40
|
-
"get-popup-container":
|
|
39
|
+
c(e(N), {
|
|
40
|
+
"overlay-class-name": e(I)("popover"),
|
|
41
|
+
"get-popup-container": C,
|
|
41
42
|
trigger: "click",
|
|
42
43
|
placement: "bottomLeft",
|
|
43
|
-
|
|
44
|
+
open: n.value,
|
|
45
|
+
onOpenChange: y
|
|
44
46
|
}, {
|
|
45
|
-
content:
|
|
46
|
-
|
|
47
|
-
class:
|
|
47
|
+
content: d(() => [
|
|
48
|
+
L("div", {
|
|
49
|
+
class: p(e(V)("popover", "content"))
|
|
48
50
|
}, [
|
|
49
|
-
|
|
51
|
+
c(e(P), {
|
|
50
52
|
ref_key: "textAreaRef",
|
|
51
|
-
ref:
|
|
53
|
+
ref: l,
|
|
52
54
|
placeholder: e(_)("ap.batchInputGroup.popoverInputPlaceholder"),
|
|
53
55
|
bordered: !1,
|
|
54
56
|
rows: 10,
|
|
55
|
-
value: e(
|
|
57
|
+
value: e(b),
|
|
56
58
|
"allow-clear": !1,
|
|
57
59
|
"auto-size": !1,
|
|
58
|
-
onInput:
|
|
60
|
+
onInput: x
|
|
59
61
|
}, null, 8, ["placeholder", "value"])
|
|
60
62
|
], 2)
|
|
61
63
|
]),
|
|
62
|
-
default:
|
|
63
|
-
|
|
64
|
-
class:
|
|
64
|
+
default: d(() => [
|
|
65
|
+
c(e(z), {
|
|
66
|
+
class: p([
|
|
67
|
+
e(u)("trigger-icon"),
|
|
68
|
+
t.disabled ? e(k)("trigger-icon", "disabled") : null
|
|
69
|
+
])
|
|
65
70
|
}, null, 8, ["class"])
|
|
66
71
|
]),
|
|
67
72
|
_: 1
|
|
68
|
-
}, 8, ["overlay-class-name"])
|
|
73
|
+
}, 8, ["overlay-class-name", "open"])
|
|
69
74
|
], 2));
|
|
70
75
|
}
|
|
71
76
|
});
|
|
72
77
|
export {
|
|
73
|
-
|
|
78
|
+
D as default
|
|
74
79
|
};
|