@aplus-frontend/ui 0.2.13 → 0.2.15
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 +145 -143
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +4 -5
- package/es/src/ap-descriptions/help-message/index.vue.d.ts +3 -15
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +35 -20
- package/es/src/ap-form/item-group/index.vue.mjs +1 -1
- package/es/src/ap-table/ap-table.vue2.mjs +13 -12
- package/es/src/ap-table/hooks/use-table-paging.mjs +38 -36
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +42 -33
- package/es/src/business/batch-input-group/index.d.ts +2 -0
- package/es/src/business/batch-input-group/index.mjs +1 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +50 -0
- package/es/src/business/batch-input-group/index.vue.mjs +171 -0
- package/es/src/business/batch-input-group/index.vue2.mjs +4 -0
- package/es/src/business/batch-input-group/interface.d.ts +34 -0
- package/es/src/business/batch-input-group/popover-input/index.vue.d.ts +17 -0
- package/es/src/business/batch-input-group/popover-input/index.vue.mjs +4 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +74 -0
- package/es/src/business/batch-input-group/popover-input/style/css.d.ts +0 -0
- package/es/src/business/batch-input-group/popover-input/style/css.js +1 -0
- package/es/src/business/batch-input-group/popover-input/style/index.d.ts +0 -0
- package/es/src/business/batch-input-group/popover-input/style/index.js +1 -0
- package/es/src/business/batch-input-group/style/css.d.ts +0 -0
- package/es/src/business/batch-input-group/style/css.js +1 -0
- package/es/src/business/batch-input-group/style/index.d.ts +0 -0
- package/es/src/business/batch-input-group/style/index.js +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +41 -40
- package/es/src/index.mjs +27 -25
- package/es/src/locale/lang/en.mjs +2 -2
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/es/src/path-map.mjs +2 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/ap-descriptions/help-message/index.vue.d.ts +3 -15
- package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
- package/lib/src/business/batch-input-group/index.d.ts +2 -0
- package/lib/src/business/batch-input-group/index.js +1 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +50 -0
- package/lib/src/business/batch-input-group/index.vue.js +2 -0
- package/lib/src/business/batch-input-group/index.vue2.js +1 -0
- package/lib/src/business/batch-input-group/interface.d.ts +34 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue.d.ts +17 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue.js +1 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -0
- package/lib/src/business/batch-input-group/popover-input/style/css.d.ts +0 -0
- package/lib/src/business/batch-input-group/popover-input/style/css.js +1 -0
- package/lib/src/business/batch-input-group/popover-input/style/index.d.ts +0 -0
- package/lib/src/business/batch-input-group/popover-input/style/index.js +1 -0
- package/lib/src/business/batch-input-group/style/css.d.ts +0 -0
- package/lib/src/business/batch-input-group/style/css.js +1 -0
- package/lib/src/business/batch-input-group/style/index.d.ts +0 -0
- package/lib/src/business/batch-input-group/style/index.js +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.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 +11 -11
|
@@ -11,16 +11,16 @@ const ue = ({
|
|
|
11
11
|
request: N,
|
|
12
12
|
defaultParams: $ = {},
|
|
13
13
|
defaultData: q = [],
|
|
14
|
-
formatParams:
|
|
15
|
-
paramsValueTypeMap:
|
|
14
|
+
formatParams: y,
|
|
15
|
+
paramsValueTypeMap: C,
|
|
16
16
|
resetFieldsIgnores: D,
|
|
17
17
|
filterFields: J,
|
|
18
|
-
sortFields:
|
|
18
|
+
sortFields: K,
|
|
19
19
|
showLessItems: b = !1,
|
|
20
|
-
showTotal:
|
|
20
|
+
showTotal: L = !0
|
|
21
21
|
}) => {
|
|
22
|
-
let z = 0,
|
|
23
|
-
const
|
|
22
|
+
let z = 0, l = {};
|
|
23
|
+
const Q = (e) => y ? y(e) : e, u = x(), c = x(M), p = x(w), {
|
|
24
24
|
t: F
|
|
25
25
|
} = ae(), {
|
|
26
26
|
b: S
|
|
@@ -30,7 +30,7 @@ const ue = ({
|
|
|
30
30
|
loading: !1
|
|
31
31
|
}), O = async (e) => {
|
|
32
32
|
var r;
|
|
33
|
-
const a =
|
|
33
|
+
const a = Q(e), t = Date.now();
|
|
34
34
|
z = t, n.value.loading = !0;
|
|
35
35
|
try {
|
|
36
36
|
const s = await N({
|
|
@@ -46,52 +46,54 @@ const ue = ({
|
|
|
46
46
|
}, R = (e) => {
|
|
47
47
|
const a = {};
|
|
48
48
|
return Object.entries(e).forEach(([t, r]) => {
|
|
49
|
-
if (a[t] = r,
|
|
50
|
-
const s =
|
|
49
|
+
if (a[t] = r, C && r) {
|
|
50
|
+
const s = C[t];
|
|
51
51
|
s && (a[t] = ee(s, r));
|
|
52
52
|
}
|
|
53
53
|
}), a;
|
|
54
|
-
},
|
|
55
|
-
var r, s, g, d, m,
|
|
56
|
-
const a = ((s = (r =
|
|
54
|
+
}, G = async (e) => {
|
|
55
|
+
var r, s, g, d, m, f, h;
|
|
56
|
+
const a = ((s = (r = u.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
57
57
|
Object.entries(a).forEach(([v, i]) => {
|
|
58
58
|
D && D.indexOf(v) > -1 && (t[v] = i);
|
|
59
|
-
}), await ((d = (g =
|
|
59
|
+
}), await ((d = (g = u.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (f = (m = u.value) == null ? void 0 : m.apForm) == null ? void 0 : f.setFieldsValue) == null || h.call(f, t), I(() => {
|
|
60
60
|
e == null || e();
|
|
61
61
|
});
|
|
62
62
|
}, T = (e) => {
|
|
63
|
-
|
|
63
|
+
l = e;
|
|
64
64
|
const a = R(e);
|
|
65
65
|
O(a);
|
|
66
|
-
},
|
|
66
|
+
}, H = (e) => {
|
|
67
67
|
T({
|
|
68
|
-
...
|
|
68
|
+
...l,
|
|
69
69
|
...e
|
|
70
70
|
});
|
|
71
71
|
}, j = () => {
|
|
72
72
|
var a, t;
|
|
73
|
-
const e = ((t = (a =
|
|
74
|
-
|
|
73
|
+
const e = ((t = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
74
|
+
c.value = 1, T({
|
|
75
75
|
...e,
|
|
76
|
+
filter: l.filter,
|
|
77
|
+
sort: l.sort,
|
|
76
78
|
current: 1,
|
|
77
|
-
pageSize:
|
|
79
|
+
pageSize: l.pageSize || w
|
|
78
80
|
});
|
|
79
81
|
}, U = () => {
|
|
80
|
-
|
|
82
|
+
G(j);
|
|
81
83
|
}, W = () => {
|
|
82
|
-
T(
|
|
84
|
+
T(l);
|
|
83
85
|
}, X = (e) => {
|
|
84
|
-
const a = o(n).total - e, t = Math.ceil(a / o(p)), r = o(
|
|
85
|
-
|
|
86
|
+
const a = o(n).total - e, t = Math.ceil(a / o(p)), r = o(c) > t ? t : o(c);
|
|
87
|
+
H({
|
|
86
88
|
current: r > 0 ? r : 1
|
|
87
89
|
});
|
|
88
90
|
}, A = (e, a, t) => {
|
|
89
|
-
var m,
|
|
90
|
-
const r = ((
|
|
91
|
-
|
|
91
|
+
var m, f, h, v;
|
|
92
|
+
const r = ((f = (m = u.value) == null ? void 0 : m.apForm) == null ? void 0 : f.getFieldsValue(!0)) || {};
|
|
93
|
+
c.value = e.current, p.value = e.pageSize;
|
|
92
94
|
const s = B(t) ? [...t] : [t], g = {};
|
|
93
95
|
for (const i of s)
|
|
94
|
-
(h = o(
|
|
96
|
+
(h = o(K)) != null && h.includes(i.columnKey || i.field) && (g[te(i.field)] = i.order);
|
|
95
97
|
const d = {};
|
|
96
98
|
for (const i of Object.keys(a))
|
|
97
99
|
(v = o(J)) != null && v.includes(i) && (d[i] = a[i]);
|
|
@@ -105,31 +107,31 @@ const ue = ({
|
|
|
105
107
|
};
|
|
106
108
|
k(() => {
|
|
107
109
|
var a, t;
|
|
108
|
-
const e = ((t = (a =
|
|
109
|
-
if (
|
|
110
|
-
current: o(
|
|
110
|
+
const e = ((t = (a = u.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
111
|
+
if (l = {
|
|
112
|
+
current: o(c),
|
|
111
113
|
pageSize: o(p),
|
|
112
114
|
...e
|
|
113
115
|
}, !E) {
|
|
114
|
-
const r = R(
|
|
116
|
+
const r = R(l);
|
|
115
117
|
O(r);
|
|
116
118
|
}
|
|
117
119
|
});
|
|
118
|
-
const Y = V(() => o(n).total === 0 ? "-" : `${o(
|
|
120
|
+
const Y = V(() => o(n).total === 0 ? "-" : `${o(c.value)}/${Math.ceil(o(n).total / o(p))}`);
|
|
119
121
|
function Z(e) {
|
|
120
122
|
B(e) && (n.value.records = e, n.value.total = e.length);
|
|
121
123
|
}
|
|
122
124
|
const _ = V(() => ({
|
|
123
125
|
loading: o(n).loading,
|
|
124
126
|
pagination: {
|
|
125
|
-
current: o(
|
|
127
|
+
current: o(c),
|
|
126
128
|
pageSize: o(p),
|
|
127
129
|
total: o(n).total,
|
|
128
130
|
showSizeChanger: !b,
|
|
129
131
|
showQuickJumper: !b,
|
|
130
132
|
showLessItems: b,
|
|
131
133
|
size: "default",
|
|
132
|
-
showTotal:
|
|
134
|
+
showTotal: L ? (e) => P("span", {
|
|
133
135
|
class: S("pagination-total-wrapper")
|
|
134
136
|
}, [F("ap.apTable.pagination.totalLeftPrefix"), " ", P("span", {
|
|
135
137
|
class: S("pagination-count-text")
|
|
@@ -143,13 +145,13 @@ const ue = ({
|
|
|
143
145
|
dataSource: o(n).records
|
|
144
146
|
}));
|
|
145
147
|
return {
|
|
146
|
-
formRef:
|
|
148
|
+
formRef: u,
|
|
147
149
|
submit: j,
|
|
148
150
|
reset: U,
|
|
149
151
|
refresh: W,
|
|
150
152
|
refreshByDelete: X,
|
|
151
153
|
data: n,
|
|
152
|
-
current:
|
|
154
|
+
current: c,
|
|
153
155
|
pageSize: p,
|
|
154
156
|
handleTableChange: A,
|
|
155
157
|
tableProps: _,
|
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { defineComponent as A, useSlots as B, computed as _, ref as S, watch as C, openBlock as f, createElementBlock as h, normalizeClass as d, unref as t, renderSlot as p, createCommentVNode as b, createElementVNode as a, createTextVNode as m, toDisplayString as c, createVNode as k, withCtx as N } from "vue";
|
|
2
|
+
import { Button as g } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
const
|
|
4
|
+
import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
|
|
5
|
+
import { useLocale as V } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
const $ = { class: "selected-desc" }, x = { class: "selected-desc-conut" }, D = { class: "selected-desc-clean" }, H = /* @__PURE__ */ A({
|
|
7
7
|
__name: "ApBatchAction",
|
|
8
8
|
props: {
|
|
9
9
|
selectedRowKeys: {},
|
|
10
10
|
clearAll: { type: Function }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const { b:
|
|
12
|
+
setup(y) {
|
|
13
|
+
const { b: l } = w("ap-batch-action"), { t: r } = V(), n = y, o = B(), v = _(() => {
|
|
14
14
|
var e;
|
|
15
|
-
return ((e =
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
return ((e = n.selectedRowKeys) == null ? void 0 : e.length) || 0;
|
|
16
|
+
}), u = S(!1);
|
|
17
|
+
return C(
|
|
18
|
+
() => o.header,
|
|
19
|
+
() => {
|
|
20
|
+
var s;
|
|
21
|
+
const e = (s = o == null ? void 0 : o.header) == null ? void 0 : s.call(o);
|
|
22
|
+
u.value = Array.isArray(e) && e.filter(Boolean).filter(
|
|
23
|
+
(i) => i.type !== Symbol.for("v-cmt") && i.type !== Symbol.for("v-fgt")
|
|
24
|
+
).length > 0;
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
immediate: !0
|
|
28
|
+
}
|
|
29
|
+
), (e, s) => (f(), h("div", {
|
|
30
|
+
class: d([t(l)()])
|
|
22
31
|
}, [
|
|
23
|
-
|
|
32
|
+
u.value ? (f(), h("div", {
|
|
24
33
|
key: 0,
|
|
25
|
-
class:
|
|
34
|
+
class: d(t(l)("header"))
|
|
26
35
|
}, [
|
|
27
|
-
|
|
28
|
-
], 2)) :
|
|
29
|
-
|
|
30
|
-
class:
|
|
36
|
+
p(e.$slots, "header")
|
|
37
|
+
], 2)) : b("", !0),
|
|
38
|
+
a("div", {
|
|
39
|
+
class: d(t(l)("body"))
|
|
31
40
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
p(e.$slots, "prefix"),
|
|
42
|
+
a("div", $, [
|
|
43
|
+
a("div", x, [
|
|
44
|
+
m(c(t(r)("ap.apBatchAction.selected")) + " ", 1),
|
|
45
|
+
a("span", null, c(v.value), 1),
|
|
46
|
+
m(" " + c(t(r)("ap.apBatchAction.piecesOfData")), 1)
|
|
38
47
|
]),
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
a("div", D, [
|
|
49
|
+
k(t(g), {
|
|
41
50
|
type: "link",
|
|
42
|
-
onClick:
|
|
51
|
+
onClick: s[0] || (s[0] = (i) => n.clearAll && n.clearAll())
|
|
43
52
|
}, {
|
|
44
|
-
default:
|
|
45
|
-
|
|
53
|
+
default: N(() => [
|
|
54
|
+
m(c(t(r)("ap.apBatchAction.empty")), 1)
|
|
46
55
|
]),
|
|
47
56
|
_: 1
|
|
48
57
|
})
|
|
49
58
|
])
|
|
50
59
|
]),
|
|
51
|
-
|
|
60
|
+
p(e.$slots, "suffix")
|
|
52
61
|
], 2)
|
|
53
62
|
], 2));
|
|
54
63
|
}
|
|
55
64
|
});
|
|
56
65
|
export {
|
|
57
|
-
|
|
66
|
+
H as default
|
|
58
67
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.vue2.mjs";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BatchInputGroupProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { FieldMode } from '../../ap-field';
|
|
4
|
+
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<BatchInputGroupProps>, {
|
|
5
|
+
hasAll: boolean;
|
|
6
|
+
emptyText: string;
|
|
7
|
+
mode: string;
|
|
8
|
+
bordered: boolean;
|
|
9
|
+
type: string;
|
|
10
|
+
lazy: boolean;
|
|
11
|
+
allowClear: boolean;
|
|
12
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
13
|
+
"update:value": (...args: any[]) => void;
|
|
14
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<BatchInputGroupProps>, {
|
|
15
|
+
hasAll: boolean;
|
|
16
|
+
emptyText: string;
|
|
17
|
+
mode: string;
|
|
18
|
+
bordered: boolean;
|
|
19
|
+
type: string;
|
|
20
|
+
lazy: boolean;
|
|
21
|
+
allowClear: boolean;
|
|
22
|
+
}>>> & {
|
|
23
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
type: "number" | "reset" | "submit" | "button" | "search" | "time" | "month" | "date" | "week" | "hidden" | "checkbox" | "radio" | "color" | "text" | "range" | "tel" | "url" | "email" | "image" | "datetime-local" | "file" | "password";
|
|
26
|
+
mode: FieldMode;
|
|
27
|
+
bordered: boolean;
|
|
28
|
+
lazy: boolean;
|
|
29
|
+
allowClear: boolean;
|
|
30
|
+
emptyText: string;
|
|
31
|
+
hasAll: boolean;
|
|
32
|
+
}, {}>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
40
|
+
type __VLS_TypePropsToOption<T> = {
|
|
41
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
42
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
43
|
+
} : {
|
|
44
|
+
type: PropType<T[K]>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type __VLS_PrettifyLocal<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineComponent as b, ref as k, computed as i, unref as l, openBlock as f, createElementBlock as I, createVNode as p, withCtx as d, createBlock as E, normalizeStyle as L, createCommentVNode as O, mergeProps as j } from "vue";
|
|
2
|
+
import "../../ap-field/index.mjs";
|
|
3
|
+
import { Space as w } from "@aplus-frontend/antdv";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { omit as R } from "lodash-unified";
|
|
6
|
+
import "./popover-input/index.vue.mjs";
|
|
7
|
+
import "../../hooks/index.mjs";
|
|
8
|
+
import { isDef as z } from "../../utils/index.mjs";
|
|
9
|
+
import { useControllableValue as T } from "../../hooks/useControllableValue.mjs";
|
|
10
|
+
import { useLocale as F } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import K from "../../ap-field/select/index.vue.mjs";
|
|
12
|
+
import { ApFieldText as P } from "../../ap-field/text/index.mjs";
|
|
13
|
+
import G from "./popover-input/index.vue2.mjs";
|
|
14
|
+
const m = "GROUP_SEARCH_ALL", te = /* @__PURE__ */ b({
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
style: { type: [Boolean, null, String, Object, Array] },
|
|
18
|
+
inputStyle: { type: [Boolean, null, String, Object, Array] },
|
|
19
|
+
options: {},
|
|
20
|
+
hasAll: { type: Boolean, default: !0 },
|
|
21
|
+
value: {},
|
|
22
|
+
"onUpdate:value": {},
|
|
23
|
+
mode: { default: "edit" },
|
|
24
|
+
class: {},
|
|
25
|
+
id: {},
|
|
26
|
+
placeholder: {},
|
|
27
|
+
autocomplete: {},
|
|
28
|
+
type: { default: "text" },
|
|
29
|
+
name: {},
|
|
30
|
+
size: {},
|
|
31
|
+
autofocus: { type: Boolean },
|
|
32
|
+
lazy: { type: Boolean, default: !0 },
|
|
33
|
+
maxlength: {},
|
|
34
|
+
loading: { type: Boolean },
|
|
35
|
+
bordered: { type: Boolean, default: !0 },
|
|
36
|
+
showCount: { type: [Boolean, Object] },
|
|
37
|
+
htmlSize: {},
|
|
38
|
+
onPressEnter: {},
|
|
39
|
+
onKeydown: {},
|
|
40
|
+
onKeyup: {},
|
|
41
|
+
onFocus: {},
|
|
42
|
+
onBlur: {},
|
|
43
|
+
onChange: {},
|
|
44
|
+
onInput: {},
|
|
45
|
+
onCompositionstart: {},
|
|
46
|
+
onCompositionend: {},
|
|
47
|
+
valueModifiers: {},
|
|
48
|
+
hidden: { type: Boolean },
|
|
49
|
+
status: {},
|
|
50
|
+
defaultValue: {},
|
|
51
|
+
inputElement: {},
|
|
52
|
+
prefixCls: {},
|
|
53
|
+
disabled: { type: Boolean },
|
|
54
|
+
focused: { type: Boolean },
|
|
55
|
+
triggerFocus: {},
|
|
56
|
+
readonly: { type: Boolean },
|
|
57
|
+
handleReset: {},
|
|
58
|
+
addonBefore: {},
|
|
59
|
+
addonAfter: {},
|
|
60
|
+
prefix: {},
|
|
61
|
+
suffix: {},
|
|
62
|
+
clearIcon: {},
|
|
63
|
+
allowClear: { type: Boolean, default: !0 },
|
|
64
|
+
emptyText: { default: "--" }
|
|
65
|
+
},
|
|
66
|
+
emits: ["update:value"],
|
|
67
|
+
setup(y, { emit: v }) {
|
|
68
|
+
const n = y, h = v, { value: a, updateValue: u } = T(
|
|
69
|
+
n,
|
|
70
|
+
h
|
|
71
|
+
), s = k(), { t: B } = F(), A = i(() => n.options ? n.hasAll ? [
|
|
72
|
+
{ value: m, label: B("ap.apGroupSearch.all") },
|
|
73
|
+
...n.options
|
|
74
|
+
] : n.options : []), _ = i(() => n.options ? n.options.map((e) => e.value) : []), g = i(() => {
|
|
75
|
+
var e, t;
|
|
76
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(",") : "";
|
|
77
|
+
}), C = i(() => {
|
|
78
|
+
var e, t;
|
|
79
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(`
|
|
80
|
+
`) : "";
|
|
81
|
+
});
|
|
82
|
+
function x(e) {
|
|
83
|
+
const t = l(a) || {}, o = e === m ? l(_) : z(e) ? [e] : [];
|
|
84
|
+
u({
|
|
85
|
+
...t,
|
|
86
|
+
key: o
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function S(e) {
|
|
90
|
+
const t = l(a) || {};
|
|
91
|
+
let o = e;
|
|
92
|
+
for (; o.startsWith(","); )
|
|
93
|
+
o = o.slice(1);
|
|
94
|
+
let r = o.replaceAll(",,", ",").split(",");
|
|
95
|
+
r.length === 1 && r[0] === "" && (r = []), u({
|
|
96
|
+
...t,
|
|
97
|
+
value: r
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function V(e) {
|
|
101
|
+
const t = l(a) || {};
|
|
102
|
+
let o = e.split(/,|\n/);
|
|
103
|
+
u({
|
|
104
|
+
...t,
|
|
105
|
+
value: o
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function c() {
|
|
109
|
+
var o;
|
|
110
|
+
const e = l(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
|
|
111
|
+
u({
|
|
112
|
+
...e,
|
|
113
|
+
value: t
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function U(e) {
|
|
117
|
+
var t;
|
|
118
|
+
c(), (t = n.onBlur) == null || t.call(n, e);
|
|
119
|
+
}
|
|
120
|
+
return (e, t) => (f(), I("div", {
|
|
121
|
+
ref_key: "containerRef",
|
|
122
|
+
ref: s,
|
|
123
|
+
style: { position: "relative" }
|
|
124
|
+
}, [
|
|
125
|
+
p(l(w).Compact, { block: "" }, {
|
|
126
|
+
default: d(() => {
|
|
127
|
+
var o, r;
|
|
128
|
+
return [
|
|
129
|
+
(o = e.options) != null && o.length ? (f(), E(l(K), {
|
|
130
|
+
key: 0,
|
|
131
|
+
style: L(e.style),
|
|
132
|
+
options: A.value,
|
|
133
|
+
value: (r = l(a)) == null ? void 0 : r.key,
|
|
134
|
+
"onUpdate:value": x
|
|
135
|
+
}, null, 8, ["style", "options", "value"])) : O("", !0),
|
|
136
|
+
p(l(P), j(
|
|
137
|
+
{ style: e.inputStyle },
|
|
138
|
+
l(R)(n, [
|
|
139
|
+
"style",
|
|
140
|
+
"value",
|
|
141
|
+
"onUpdate:value",
|
|
142
|
+
"inputStyle",
|
|
143
|
+
"hasAll",
|
|
144
|
+
"options"
|
|
145
|
+
]),
|
|
146
|
+
{
|
|
147
|
+
value: g.value,
|
|
148
|
+
"onUpdate:value": S,
|
|
149
|
+
onBlur: U
|
|
150
|
+
}
|
|
151
|
+
), {
|
|
152
|
+
suffix: d(() => [
|
|
153
|
+
p(G, {
|
|
154
|
+
_parent: s.value,
|
|
155
|
+
value: C.value,
|
|
156
|
+
"onUpdate:value": V,
|
|
157
|
+
onClose: c
|
|
158
|
+
}, null, 8, ["_parent", "value"])
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 16, ["style", "value"])
|
|
162
|
+
];
|
|
163
|
+
}),
|
|
164
|
+
_: 1
|
|
165
|
+
})
|
|
166
|
+
], 512));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
export {
|
|
170
|
+
te as default
|
|
171
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApFieldTextAreaProps, ApFieldTextProps } from '../../ap-field';
|
|
2
|
+
import { DefaultOptionType } from '@aplus-frontend/antdv/es/select';
|
|
3
|
+
import { StyleValue } from 'vue';
|
|
4
|
+
export type BatchInputGroupValueType = {
|
|
5
|
+
key: any[];
|
|
6
|
+
value: string[];
|
|
7
|
+
};
|
|
8
|
+
export interface BatchInputGroupProps extends Omit<ApFieldTextProps, 'value' | 'onUpdate:value' | 'style'> {
|
|
9
|
+
/**
|
|
10
|
+
* 下拉框自定义样式
|
|
11
|
+
*/
|
|
12
|
+
style?: StyleValue;
|
|
13
|
+
/**
|
|
14
|
+
* 输入框样式
|
|
15
|
+
*/
|
|
16
|
+
inputStyle?: StyleValue;
|
|
17
|
+
/**
|
|
18
|
+
* 下拉框可选项列表
|
|
19
|
+
*/
|
|
20
|
+
options?: DefaultOptionType[];
|
|
21
|
+
/**
|
|
22
|
+
* 是否为下拉框添加全选选项
|
|
23
|
+
*/
|
|
24
|
+
hasAll?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* v-model
|
|
27
|
+
*/
|
|
28
|
+
value?: BatchInputGroupValueType;
|
|
29
|
+
'onUpdate:value'?: (nextValue: BatchInputGroupValueType) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface BatchInputGroupPopoverInputProps extends Pick<ApFieldTextAreaProps, 'value' | 'onUpdate:value'> {
|
|
32
|
+
_parent?: HTMLElement;
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BatchInputGroupPopoverInputProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<__VLS_TypePropsToOption<BatchInputGroupPopoverInputProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
4
|
+
"update:value": (...args: any[]) => void;
|
|
5
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<BatchInputGroupPopoverInputProps>>> & {
|
|
6
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
type __VLS_TypePropsToOption<T> = {
|
|
11
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
13
|
+
} : {
|
|
14
|
+
type: PropType<T[K]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent as k, ref as y, openBlock as N, createElementBlock as A, normalizeClass as l, unref as e, createVNode as p, withCtx as i, createElementVNode as I } from "vue";
|
|
2
|
+
import { Popover as w, Textarea as L } from "@aplus-frontend/antdv";
|
|
3
|
+
import "../../../config-provider/index.mjs";
|
|
4
|
+
import { IconApAdLineScreen as P } from "@aplus-frontend/icon";
|
|
5
|
+
import "../../../hooks/index.mjs";
|
|
6
|
+
import { useControllableValue as S } from "../../../hooks/useControllableValue.mjs";
|
|
7
|
+
import { useLocale as z } from "../../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as B } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const j = /* @__PURE__ */ k({
|
|
10
|
+
__name: "index",
|
|
11
|
+
props: {
|
|
12
|
+
_parent: {},
|
|
13
|
+
onClose: { type: Function },
|
|
14
|
+
value: {},
|
|
15
|
+
"onUpdate:value": { type: Function }
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:value"],
|
|
18
|
+
setup(m, { emit: f }) {
|
|
19
|
+
const a = m, d = f, { value: v, updateValue: g } = S(a, d), n = y(), h = (t) => a._parent || t, { t: C } = z();
|
|
20
|
+
function _(t) {
|
|
21
|
+
var u;
|
|
22
|
+
const o = t.target.value || "", r = o.replace(/[\n,]+/g, `
|
|
23
|
+
`);
|
|
24
|
+
if (r !== o) {
|
|
25
|
+
const s = ((u = n.value) == null ? void 0 : u.$el) || n.value;
|
|
26
|
+
s && (s.value = r);
|
|
27
|
+
}
|
|
28
|
+
g(r);
|
|
29
|
+
}
|
|
30
|
+
function x(t) {
|
|
31
|
+
var o;
|
|
32
|
+
t || (o = a.onClose) == null || o.call(a);
|
|
33
|
+
}
|
|
34
|
+
const { b: c, e: V, em: b } = B("batch-input-group-popover-input");
|
|
35
|
+
return (t, o) => (N(), A("div", {
|
|
36
|
+
class: l(e(c)())
|
|
37
|
+
}, [
|
|
38
|
+
p(e(w), {
|
|
39
|
+
overlayClassName: e(V)("popover"),
|
|
40
|
+
"get-popup-container": h,
|
|
41
|
+
trigger: "click",
|
|
42
|
+
placement: "bottomLeft",
|
|
43
|
+
onOpenChange: x
|
|
44
|
+
}, {
|
|
45
|
+
content: i(() => [
|
|
46
|
+
I("div", {
|
|
47
|
+
class: l(e(b)("popover", "content"))
|
|
48
|
+
}, [
|
|
49
|
+
p(e(L), {
|
|
50
|
+
placeholder: e(C)("ap.apGroupSearch.tokenSeparatorsPlaceholder"),
|
|
51
|
+
bordered: !1,
|
|
52
|
+
rows: 5,
|
|
53
|
+
value: e(v),
|
|
54
|
+
onInput: _,
|
|
55
|
+
ref_key: "textAreaRef",
|
|
56
|
+
ref: n,
|
|
57
|
+
"allow-clear": !1,
|
|
58
|
+
"auto-size": !1
|
|
59
|
+
}, null, 8, ["placeholder", "value"])
|
|
60
|
+
], 2)
|
|
61
|
+
]),
|
|
62
|
+
default: i(() => [
|
|
63
|
+
p(e(P), {
|
|
64
|
+
class: l(e(c)("trigger-icon"))
|
|
65
|
+
}, null, 8, ["class"])
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}, 8, ["overlayClassName"])
|
|
69
|
+
], 2));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
j as default
|
|
74
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/batch-input-group/popover-input.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/batch-input-group/popover-input.less';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/batch-input-group/index.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/batch-input-group/index.less';
|