@aplus-frontend/ui 6.11.0 → 6.13.0
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-descriptions/interface.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +118 -108
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +27 -19
- package/es/src/ap-form/search-form/hooks/use-sorter.mjs +31 -30
- package/es/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/es/src/ap-form/search-form/index.vue.mjs +35 -35
- package/es/src/ap-grid/index.vue.mjs +221 -225
- package/es/src/ap-modal/interface.d.ts +8 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +69 -66
- package/es/src/ap-table/ap-table.vue2.mjs +107 -111
- package/es/src/ap-table/constants.d.ts +7 -7
- package/es/src/ap-table/context.d.ts +1 -0
- package/es/src/ap-table/context.mjs +6 -5
- package/es/src/ap-table/utils.d.ts +5 -3247
- package/es/src/ap-table/utils.mjs +107 -121
- package/es/src/business/ap-card/ApCard.vue2.mjs +17 -17
- package/es/src/business/ap-summary/interface.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +76 -74
- package/es/src/business/ap-view/interface.d.ts +1 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/es/src/business/batch-input-group/index.vue.mjs +56 -52
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +36 -32
- package/es/src/business/batch-input-group/utils.d.ts +8 -0
- package/es/src/business/batch-input-group/utils.mjs +10 -0
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +14 -5
- package/es/src/config-provider/config-provider.mjs +19 -18
- package/es/src/config-provider/constants.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +28 -13
- package/es/src/utils/config-provider-preset.d.ts +6 -6
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-descriptions/interface.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
- package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +8 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +7 -7
- package/lib/src/ap-table/context.d.ts +1 -0
- package/lib/src/ap-table/context.js +1 -1
- package/lib/src/ap-table/utils.d.ts +5 -3247
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
- package/lib/src/business/ap-summary/interface.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +1 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +3 -2
- package/lib/src/business/batch-input-group/utils.d.ts +8 -0
- package/lib/src/business/batch-input-group/utils.js +1 -0
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +14 -5
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +28 -13
- package/lib/src/utils/config-provider-preset.d.ts +6 -6
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-grid/index.less +3 -4
- package/theme/index.css +3 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +0 -15
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +0 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Z, computed as E, ref as K, createVNode as N, watch as U, createBlock as R, openBlock as C, unref as b, mergeProps as S, withCtx as O, createElementVNode as D, normalizeClass as ee } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { ApBatchActionGroup as
|
|
3
|
+
import te from "./icons/line-down.vue.mjs";
|
|
4
|
+
import { ApBatchActionGroup as ie } from "../ap-batch-action-group/index.mjs";
|
|
5
5
|
import "./components/main-button-content.vue.mjs";
|
|
6
6
|
import "./components/menu-list-content.vue.mjs";
|
|
7
|
-
import { useViewProvide as
|
|
8
|
-
import { useInjectApTable as
|
|
7
|
+
import { useViewProvide as le } from "./hooks/use-view-provide.mjs";
|
|
8
|
+
import { useInjectApTable as se } from "../../ap-table/context.mjs";
|
|
9
9
|
import { SYSTEM_VIEW_KEY as V } from "./utils/enum.mjs";
|
|
10
|
-
import { isValid as
|
|
10
|
+
import { isValid as re } from "@aplus-frontend/utils";
|
|
11
11
|
import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const Ie = /* @__PURE__ */
|
|
14
|
+
import fe from "./components/main-button-content.vue2.mjs";
|
|
15
|
+
import ae from "./components/menu-list-content.vue2.mjs";
|
|
16
|
+
const Ie = /* @__PURE__ */ Z({
|
|
17
17
|
name: "ApView",
|
|
18
18
|
__name: "ap-view",
|
|
19
19
|
props: {
|
|
@@ -39,7 +39,7 @@ const Ie = /* @__PURE__ */ X({
|
|
|
39
39
|
setup(k, {
|
|
40
40
|
expose: A
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
42
|
+
const o = k, L = me("viewCacheOption"), {
|
|
43
43
|
b: g
|
|
44
44
|
} = ne("ap-view"), {
|
|
45
45
|
t: P
|
|
@@ -51,19 +51,20 @@ const Ie = /* @__PURE__ */ X({
|
|
|
51
51
|
setSearchFormValues: j,
|
|
52
52
|
submit: G,
|
|
53
53
|
reset: $,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
refresh: Y,
|
|
55
|
+
getSearchFormSorterItems: z,
|
|
56
|
+
setSearchFormSorterItems: M,
|
|
57
|
+
resetSearchFormSorterItems: W
|
|
58
|
+
} = se(), q = K(!1), F = K(!1), d = K("");
|
|
58
59
|
let c = !1, _ = !1;
|
|
59
|
-
const
|
|
60
|
+
const H = {
|
|
60
61
|
dropdownType: "dropdown",
|
|
61
|
-
content: N(
|
|
62
|
-
maxViewNum:
|
|
62
|
+
content: N(fe, {
|
|
63
|
+
maxViewNum: o.maxViewNum
|
|
63
64
|
}, null)
|
|
64
|
-
},
|
|
65
|
+
}, r = K([v.value]), J = E(() => r.value.map((t) => ({
|
|
65
66
|
id: t.viewKey,
|
|
66
|
-
content: N(
|
|
67
|
+
content: N(ae, {
|
|
67
68
|
view: t
|
|
68
69
|
}, null)
|
|
69
70
|
}))), e = {
|
|
@@ -71,29 +72,30 @@ const Ie = /* @__PURE__ */ X({
|
|
|
71
72
|
setSearchFormValues: j,
|
|
72
73
|
submit: G,
|
|
73
74
|
reset: $,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
refresh: Y,
|
|
76
|
+
getSearchFormSorterItems: z,
|
|
77
|
+
setSearchFormSorterItems: M,
|
|
78
|
+
resetSearchFormSorterItems: W,
|
|
79
|
+
...o.saveDataSource
|
|
78
80
|
}, l = {
|
|
79
81
|
...L.value,
|
|
80
|
-
...
|
|
81
|
-
},
|
|
82
|
-
if (
|
|
82
|
+
...o.viewCacheOption
|
|
83
|
+
}, h = () => {
|
|
84
|
+
if (o.isDefaultSystemView)
|
|
83
85
|
return V;
|
|
84
|
-
if ((
|
|
86
|
+
if ((o.isFirstDefaultSystemView || _) && c)
|
|
85
87
|
return V;
|
|
86
|
-
const t =
|
|
88
|
+
const t = r.value.find((i) => i.isDefault);
|
|
87
89
|
return (t == null ? void 0 : t.viewKey) ?? V;
|
|
88
90
|
}, p = (t) => {
|
|
89
91
|
d.value = t;
|
|
90
|
-
const i =
|
|
92
|
+
const i = r.value.find((s) => s.viewKey === d.value);
|
|
91
93
|
i && setTimeout(() => {
|
|
92
|
-
var s,
|
|
93
|
-
i.viewKey === V ? c ?
|
|
94
|
-
...Object.fromEntries(Object.keys(((
|
|
94
|
+
var s, m, n, a, f, u, y, I, x, B;
|
|
95
|
+
i.viewKey === V ? c ? o.manual || (s = e == null ? void 0 : e.refresh) == null || s.call(e) : ((m = e == null ? void 0 : e.resetSearchFormSorterItems) == null || m.call(e), o.manual || (n = e == null ? void 0 : e.reset) == null || n.call(e)) : ((u = e == null ? void 0 : e.setSearchFormValues) == null || u.call(e, {
|
|
96
|
+
...Object.fromEntries(Object.keys(((a = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : a.call(e)) ?? {}).map((X) => [X, void 0])) ?? {},
|
|
95
97
|
...((f = i.viewConfig) == null ? void 0 : f.searchForm) ?? {}
|
|
96
|
-
}), (
|
|
98
|
+
}), (I = e == null ? void 0 : e.setSearchFormSorterItems) == null || I.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), c ? o.manual || (x = e == null ? void 0 : e.refresh) == null || x.call(e) : (B = e == null ? void 0 : e.submit) == null || B.call(e)), c = !1;
|
|
97
99
|
});
|
|
98
100
|
}, w = {
|
|
99
101
|
getViewList: async (t) => {
|
|
@@ -101,12 +103,12 @@ const Ie = /* @__PURE__ */ X({
|
|
|
101
103
|
try {
|
|
102
104
|
const {
|
|
103
105
|
tableKey: s
|
|
104
|
-
} = t,
|
|
106
|
+
} = t, m = await ((i = l == null ? void 0 : l.getViewList) == null ? void 0 : i.call(l, {
|
|
105
107
|
tableKey: s
|
|
106
108
|
}));
|
|
107
|
-
return
|
|
109
|
+
return r.value = [v.value, ...m ?? []], p(h()), r.value;
|
|
108
110
|
} catch {
|
|
109
|
-
return
|
|
111
|
+
return r.value = [v.value], p(V), r.value;
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
114
|
addView: async (t) => {
|
|
@@ -114,72 +116,72 @@ const Ie = /* @__PURE__ */ X({
|
|
|
114
116
|
const {
|
|
115
117
|
tableKey: i,
|
|
116
118
|
viewKey: s,
|
|
117
|
-
viewName:
|
|
118
|
-
isDefault:
|
|
119
|
-
viewConfig:
|
|
119
|
+
viewName: m,
|
|
120
|
+
isDefault: n,
|
|
121
|
+
viewConfig: a
|
|
120
122
|
} = t;
|
|
121
123
|
await ((f = l == null ? void 0 : l.addView) == null ? void 0 : f.call(l, {
|
|
122
124
|
tableKey: i,
|
|
123
125
|
viewKey: s,
|
|
124
|
-
viewName:
|
|
125
|
-
isDefault:
|
|
126
|
-
viewConfig:
|
|
127
|
-
})),
|
|
128
|
-
...
|
|
126
|
+
viewName: m,
|
|
127
|
+
isDefault: n,
|
|
128
|
+
viewConfig: a
|
|
129
|
+
})), n && (r.value = r.value.map((u) => ({
|
|
130
|
+
...u,
|
|
129
131
|
isDefault: !1
|
|
130
|
-
}))),
|
|
132
|
+
}))), r.value = [...r.value, {
|
|
131
133
|
viewKey: s,
|
|
132
|
-
viewName:
|
|
133
|
-
isDefault:
|
|
134
|
-
viewConfig:
|
|
134
|
+
viewName: m,
|
|
135
|
+
isDefault: n,
|
|
136
|
+
viewConfig: a
|
|
135
137
|
}], p(s);
|
|
136
138
|
},
|
|
137
139
|
changeView: async (t) => {
|
|
138
|
-
var
|
|
140
|
+
var u;
|
|
139
141
|
const {
|
|
140
142
|
tableKey: i,
|
|
141
143
|
viewKey: s,
|
|
142
|
-
viewName:
|
|
143
|
-
isDefault:
|
|
144
|
-
viewConfig:
|
|
144
|
+
viewName: m,
|
|
145
|
+
isDefault: n,
|
|
146
|
+
viewConfig: a
|
|
145
147
|
} = t;
|
|
146
|
-
await ((
|
|
148
|
+
await ((u = l == null ? void 0 : l.changeView) == null ? void 0 : u.call(l, {
|
|
147
149
|
tableKey: i,
|
|
148
150
|
viewKey: s,
|
|
149
|
-
viewName:
|
|
150
|
-
isDefault:
|
|
151
|
-
viewConfig:
|
|
152
|
-
})),
|
|
151
|
+
viewName: m,
|
|
152
|
+
isDefault: n,
|
|
153
|
+
viewConfig: a
|
|
154
|
+
})), n && (r.value = r.value.map((y) => ({
|
|
153
155
|
...y,
|
|
154
156
|
isDefault: !1
|
|
155
157
|
})));
|
|
156
|
-
const f =
|
|
157
|
-
f && (f.viewName =
|
|
158
|
+
const f = r.value.find((y) => y.viewKey === s);
|
|
159
|
+
f && (f.viewName = m, f.isDefault = n, f.viewConfig = a), p(s);
|
|
158
160
|
},
|
|
159
161
|
removeView: async (t) => {
|
|
160
|
-
var
|
|
162
|
+
var m;
|
|
161
163
|
const {
|
|
162
164
|
tableKey: i,
|
|
163
165
|
viewKey: s
|
|
164
166
|
} = t;
|
|
165
|
-
await ((
|
|
167
|
+
await ((m = l == null ? void 0 : l.removeView) == null ? void 0 : m.call(l, {
|
|
166
168
|
tableKey: i,
|
|
167
169
|
viewKey: s
|
|
168
|
-
})),
|
|
170
|
+
})), r.value = r.value.filter((n) => n.viewKey !== s), s === d.value && p(h());
|
|
169
171
|
}
|
|
170
|
-
},
|
|
171
|
-
tableKey:
|
|
172
|
+
}, Q = {
|
|
173
|
+
tableKey: o.tableKey,
|
|
172
174
|
currentViewKey: d,
|
|
173
175
|
changeCurrentViewKey: p,
|
|
174
|
-
popoverOpen:
|
|
176
|
+
popoverOpen: q,
|
|
175
177
|
menuOpen: F,
|
|
176
|
-
viewList:
|
|
178
|
+
viewList: r,
|
|
177
179
|
viewListCRUD: w,
|
|
178
180
|
saveDataSource: e
|
|
179
181
|
};
|
|
180
|
-
return
|
|
182
|
+
return le(Q), U(() => o.tableKey, (t) => {
|
|
181
183
|
var i;
|
|
182
|
-
|
|
184
|
+
re(t) && (c = !0, (i = w == null ? void 0 : w.getViewList) == null || i.call(w, {
|
|
183
185
|
tableKey: t
|
|
184
186
|
}));
|
|
185
187
|
}, {
|
|
@@ -188,21 +190,21 @@ const Ie = /* @__PURE__ */ X({
|
|
|
188
190
|
setFirstDefaultSystemView: (t) => {
|
|
189
191
|
_ = t;
|
|
190
192
|
}
|
|
191
|
-
}), (t, i) => (
|
|
193
|
+
}), (t, i) => (C(), R(b(ie), S({
|
|
192
194
|
...t.$attrs
|
|
193
195
|
}, {
|
|
194
196
|
open: F.value,
|
|
195
197
|
"onUpdate:open": i[0] || (i[0] = (s) => F.value = s),
|
|
196
198
|
class: [b(g)()],
|
|
197
|
-
"button-props":
|
|
198
|
-
"menu-list":
|
|
199
|
+
"button-props": H,
|
|
200
|
+
"menu-list": J.value,
|
|
199
201
|
"overlay-class-name": [b(g)("overlay")],
|
|
200
202
|
trigger: "click",
|
|
201
203
|
placement: "bottom"
|
|
202
204
|
}), {
|
|
203
|
-
icon:
|
|
204
|
-
class:
|
|
205
|
-
}, [N(
|
|
205
|
+
icon: O(() => [D("div", {
|
|
206
|
+
class: ee([b(g)("icon")])
|
|
207
|
+
}, [N(te)], 2)]),
|
|
206
208
|
_: 1
|
|
207
209
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
208
210
|
}
|
|
@@ -5,6 +5,7 @@ export interface SaveDataSource {
|
|
|
5
5
|
setSearchFormValues?: (values: Partial<Recordable>) => void;
|
|
6
6
|
submit?: () => void;
|
|
7
7
|
reset?: () => void;
|
|
8
|
+
refresh?: () => void;
|
|
8
9
|
getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
|
|
9
10
|
setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
10
11
|
resetSearchFormSorterItems?: () => void;
|
|
@@ -19,6 +19,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
19
19
|
emptyText: string;
|
|
20
20
|
hasAll: boolean;
|
|
21
21
|
popoverPlacement: "left" | "right" | number;
|
|
22
|
+
maxNum: number;
|
|
22
23
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
23
24
|
containerRef: HTMLDivElement;
|
|
24
25
|
inputRef: ({
|
|
@@ -52,9 +53,9 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
52
53
|
readonly suffix?: any;
|
|
53
54
|
readonly focused?: boolean | undefined;
|
|
54
55
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
55
|
-
readonly placeholder?: string | number | undefined;
|
|
56
56
|
readonly defaultValue?: string | number | undefined;
|
|
57
57
|
readonly id?: string | undefined;
|
|
58
|
+
readonly placeholder?: string | number | undefined;
|
|
58
59
|
readonly autocomplete?: string | undefined;
|
|
59
60
|
readonly maxlength?: number | undefined;
|
|
60
61
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, ref as g, computed as r, unref as l, createElementBlock as $, openBlock as B, normalizeStyle as b, normalizeClass as K, createVNode as c, withCtx as A, createBlock as M, createCommentVNode as D, mergeProps as G } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { Space as q } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -7,13 +7,14 @@ import "./popover-input/index.vue.mjs";
|
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
8
|
import { isDef as J } from "../../utils/index.mjs";
|
|
9
9
|
import { useDefaultPlaceholder as Q } from "../../ap-field/hooks/use-default-placeholder.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import ee from "../../
|
|
14
|
-
import
|
|
15
|
-
import oe from "
|
|
16
|
-
|
|
10
|
+
import { splitValue as W } from "./utils.mjs";
|
|
11
|
+
import { useControllableValue as X } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import te from "../../ap-field/select/index.vue.mjs";
|
|
15
|
+
import { ApFieldText as oe } from "../../ap-field/text/index.mjs";
|
|
16
|
+
import ne from "./popover-input/index.vue2.mjs";
|
|
17
|
+
const m = "GROUP_SEARCH_ALL", be = /* @__PURE__ */ T({
|
|
17
18
|
name: "BatchInputGroup",
|
|
18
19
|
__name: "index",
|
|
19
20
|
props: {
|
|
@@ -24,6 +25,7 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
24
25
|
value: {},
|
|
25
26
|
"onUpdate:value": {},
|
|
26
27
|
popoverPlacement: { default: "left" },
|
|
28
|
+
maxNum: { default: 200 },
|
|
27
29
|
mode: { default: "edit" },
|
|
28
30
|
class: {},
|
|
29
31
|
id: {},
|
|
@@ -72,38 +74,38 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
72
74
|
beforeInput: {}
|
|
73
75
|
},
|
|
74
76
|
emits: ["update:value"],
|
|
75
|
-
setup(V, { emit:
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
), i = g(), f = g(), { t:
|
|
80
|
-
const e =
|
|
77
|
+
setup(V, { emit: x }) {
|
|
78
|
+
const n = V, C = Q("Text", n), S = x, { value: a, updateValue: p } = X(
|
|
79
|
+
n,
|
|
80
|
+
S
|
|
81
|
+
), i = g(), f = g(), { t: I } = Z(), { b: U, cssVar: w } = ee("batch-input-group"), P = r(() => {
|
|
82
|
+
const e = n.popoverPlacement;
|
|
81
83
|
return {
|
|
82
84
|
"popover-left": H(e) ? `${e}px` : e === "left" ? "0px" : "unset",
|
|
83
85
|
"popover-right": e === "right" ? "0px" : "unset"
|
|
84
86
|
};
|
|
85
|
-
}), k =
|
|
86
|
-
{ value:
|
|
87
|
-
...
|
|
88
|
-
] :
|
|
87
|
+
}), k = r(() => n.options ? n.options.length > 1 && n.hasAll ? [
|
|
88
|
+
{ value: m, label: I("ap.common.all") },
|
|
89
|
+
...n.options
|
|
90
|
+
] : n.options : []), R = r(() => n.options ? n.options.map((e) => e.value) : []), N = r(() => {
|
|
89
91
|
var e, t;
|
|
90
|
-
return (t = (e =
|
|
91
|
-
}), j =
|
|
92
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(",") : "";
|
|
93
|
+
}), j = r(() => {
|
|
92
94
|
var e, t;
|
|
93
|
-
return (t = (e =
|
|
95
|
+
return (t = (e = l(a)) == null ? void 0 : e.value) != null && t.length ? l(a).value.join(`
|
|
94
96
|
`) : "";
|
|
95
|
-
}), E =
|
|
97
|
+
}), E = r(() => {
|
|
96
98
|
var t;
|
|
97
|
-
const e = (t =
|
|
99
|
+
const e = (t = l(a)) == null ? void 0 : t.key;
|
|
98
100
|
if (e != null && e.length)
|
|
99
|
-
return e.length === 1 || !
|
|
100
|
-
}), F =
|
|
101
|
+
return e.length === 1 || !n.hasAll ? e[0] : m;
|
|
102
|
+
}), F = r(() => {
|
|
101
103
|
var o;
|
|
102
|
-
const e = (o =
|
|
103
|
-
return !e || (e == null ? void 0 : e.length) <= 1 ?
|
|
104
|
+
const e = (o = l(a)) == null ? void 0 : o.key;
|
|
105
|
+
return !e || (e == null ? void 0 : e.length) <= 1 ? l(C) : (n.options || []).filter((u) => e.includes(u.value)).map((u) => u.label).join("/");
|
|
104
106
|
});
|
|
105
107
|
function L(e) {
|
|
106
|
-
const t =
|
|
108
|
+
const t = l(a) || {}, o = e === m ? l(R) : J(e) ? [e] : [];
|
|
107
109
|
p({
|
|
108
110
|
...t,
|
|
109
111
|
key: o
|
|
@@ -111,52 +113,53 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
111
113
|
}
|
|
112
114
|
function O(e) {
|
|
113
115
|
var v, y;
|
|
114
|
-
const t =
|
|
115
|
-
|
|
116
|
+
const t = l(a) || {}, o = e.target.value || "";
|
|
117
|
+
let u = W(o, ",", ",", n.maxNum);
|
|
118
|
+
if (o !== u) {
|
|
116
119
|
const h = (y = (v = f.value) == null ? void 0 : v.$el) == null ? void 0 : y.querySelector("input");
|
|
117
|
-
h && (h.value =
|
|
120
|
+
h && (h.value = u);
|
|
118
121
|
}
|
|
119
|
-
let s =
|
|
122
|
+
let s = u.split(",");
|
|
120
123
|
s.length === 1 && s[0] === "" && (s = []), p({
|
|
121
124
|
...t,
|
|
122
125
|
value: s
|
|
123
126
|
});
|
|
124
127
|
}
|
|
125
|
-
function
|
|
126
|
-
const t =
|
|
128
|
+
function _(e) {
|
|
129
|
+
const t = l(a) || {};
|
|
127
130
|
let o = e.split(/,|\n/);
|
|
128
131
|
p({
|
|
129
132
|
...t,
|
|
130
133
|
value: o
|
|
131
134
|
});
|
|
132
135
|
}
|
|
133
|
-
function
|
|
136
|
+
function d() {
|
|
134
137
|
var o;
|
|
135
|
-
const e =
|
|
138
|
+
const e = l(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
|
|
136
139
|
p({
|
|
137
140
|
...e,
|
|
138
141
|
value: t
|
|
139
142
|
});
|
|
140
143
|
}
|
|
141
|
-
function
|
|
144
|
+
function z(e) {
|
|
142
145
|
var t;
|
|
143
|
-
|
|
146
|
+
d(), (t = n.onBlur) == null || t.call(n, e);
|
|
144
147
|
}
|
|
145
148
|
return (e, t) => (B(), $("div", {
|
|
146
149
|
ref_key: "containerRef",
|
|
147
150
|
ref: i,
|
|
148
|
-
class: K(
|
|
149
|
-
style: b(
|
|
151
|
+
class: K(l(U)()),
|
|
152
|
+
style: b(l(w)(P.value)),
|
|
150
153
|
onFocus: t[0] || (t[0] = //@ts-ignore
|
|
151
154
|
(...o) => e.onFocus && e.onFocus(...o)),
|
|
152
155
|
onBlur: t[1] || (t[1] = //@ts-ignore
|
|
153
156
|
(...o) => e.onBlur && e.onBlur(...o))
|
|
154
157
|
}, [
|
|
155
|
-
c(
|
|
158
|
+
c(l(q).Compact, { block: "" }, {
|
|
156
159
|
default: A(() => {
|
|
157
160
|
var o;
|
|
158
161
|
return [
|
|
159
|
-
(o = e.options) != null && o.length ? (B(), M(
|
|
162
|
+
(o = e.options) != null && o.length ? (B(), M(l(te), {
|
|
160
163
|
key: 0,
|
|
161
164
|
style: b(e.style),
|
|
162
165
|
options: k.value,
|
|
@@ -167,8 +170,8 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
167
170
|
"get-popup-container": () => i.value,
|
|
168
171
|
"onUpdate:value": L
|
|
169
172
|
}, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : D("", !0),
|
|
170
|
-
c(
|
|
171
|
-
|
|
173
|
+
c(l(oe), G(
|
|
174
|
+
l(Y)(n, [
|
|
172
175
|
"style",
|
|
173
176
|
"value",
|
|
174
177
|
"onUpdate:value",
|
|
@@ -181,21 +184,22 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
181
184
|
ref_key: "inputRef",
|
|
182
185
|
ref: f,
|
|
183
186
|
style: e.inputStyle,
|
|
184
|
-
value:
|
|
187
|
+
value: N.value,
|
|
185
188
|
placeholder: F.value,
|
|
186
189
|
onInput: O,
|
|
187
|
-
onBlur:
|
|
190
|
+
onBlur: z
|
|
188
191
|
}
|
|
189
192
|
), {
|
|
190
193
|
suffix: A(() => [
|
|
191
|
-
c(
|
|
194
|
+
c(ne, {
|
|
192
195
|
_parent: i.value,
|
|
193
196
|
value: j.value,
|
|
194
197
|
disabled: e.disabled,
|
|
195
|
-
placement:
|
|
196
|
-
"
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
placement: n.popoverPlacement,
|
|
199
|
+
"max-num": e.maxNum,
|
|
200
|
+
"onUpdate:value": _,
|
|
201
|
+
onClose: d
|
|
202
|
+
}, null, 8, ["_parent", "value", "disabled", "placement", "max-num"])
|
|
199
203
|
]),
|
|
200
204
|
_: 1
|
|
201
205
|
}, 16, ["style", "value", "placeholder"])
|
|
@@ -207,5 +211,5 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
207
211
|
}
|
|
208
212
|
});
|
|
209
213
|
export {
|
|
210
|
-
|
|
214
|
+
be as default
|
|
211
215
|
};
|
|
@@ -32,11 +32,16 @@ export interface BatchInputGroupProps extends Omit<ApFieldTextProps, 'value' | '
|
|
|
32
32
|
* 设置弹出层弹出的位置,默认为`left`
|
|
33
33
|
*/
|
|
34
34
|
popoverPlacement?: 'left' | 'right' | number;
|
|
35
|
+
/**
|
|
36
|
+
* 最大输入条数,默认为200
|
|
37
|
+
*/
|
|
38
|
+
maxNum?: number;
|
|
35
39
|
}
|
|
36
40
|
export interface BatchInputGroupPopoverInputProps extends Pick<ApFieldTextAreaProps, 'value' | 'onUpdate:value'> {
|
|
37
41
|
_parent?: HTMLElement;
|
|
38
42
|
onClose?: () => void;
|
|
39
43
|
disabled?: boolean;
|
|
44
|
+
maxNum?: number;
|
|
40
45
|
}
|
|
41
46
|
export type ApFormItemBatchInputProps = ApFormItemProps & {
|
|
42
47
|
field?: Omit<BatchInputGroupProps, 'value' | 'onUpdate:value'>;
|
|
@@ -1,71 +1,75 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
1
|
+
import { defineComponent as k, ref as m, createElementBlock as A, openBlock as w, normalizeClass as p, unref as e, createVNode as u, withCtx as f, createElementVNode as B } from "vue";
|
|
2
|
+
import { Popover as L, Textarea as P } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
4
|
import { IconApAdLineScreen as z } from "@aplus-frontend/icon";
|
|
5
5
|
import "../../../hooks/index.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
6
|
+
import { splitValue as E } from "../utils.mjs";
|
|
7
|
+
import { useControllableValue as F } from "../../../hooks/useControllableValue.mjs";
|
|
8
|
+
import { useLocale as O } from "../../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useNamespace as R } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const J = /* @__PURE__ */ k({
|
|
10
11
|
__name: "index",
|
|
11
12
|
props: {
|
|
12
13
|
_parent: {},
|
|
13
14
|
onClose: { type: Function },
|
|
14
15
|
disabled: { type: Boolean },
|
|
16
|
+
maxNum: {},
|
|
15
17
|
value: {},
|
|
16
18
|
"onUpdate:value": { type: Function }
|
|
17
19
|
},
|
|
18
20
|
emits: ["update:value"],
|
|
19
|
-
setup(
|
|
20
|
-
const o =
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
const a = t.target.value || ""
|
|
24
|
-
`
|
|
21
|
+
setup(d, { emit: v }) {
|
|
22
|
+
const o = d, g = v, { value: b, updateValue: h } = F(o, g), n = m(!1), l = m(), x = (t) => o._parent || t, { t: C } = O();
|
|
23
|
+
function _(t) {
|
|
24
|
+
var c;
|
|
25
|
+
const a = t.target.value || "";
|
|
26
|
+
let r = E(a, `
|
|
27
|
+
,`, `
|
|
28
|
+
`, o.maxNum);
|
|
25
29
|
if (r !== a) {
|
|
26
|
-
const i = ((
|
|
30
|
+
const i = ((c = l.value) == null ? void 0 : c.$el) || l.value;
|
|
27
31
|
i && (i.value = r);
|
|
28
32
|
}
|
|
29
33
|
h(r);
|
|
30
34
|
}
|
|
31
|
-
function
|
|
35
|
+
function V(t) {
|
|
32
36
|
var a;
|
|
33
37
|
o.disabled ? n.value = !1 : n.value = t, !t && ((a = o.onClose) == null || a.call(o));
|
|
34
38
|
}
|
|
35
|
-
const { b:
|
|
36
|
-
return (t, a) => (
|
|
37
|
-
class: p(e(
|
|
39
|
+
const { b: s, e: y, em: I, bm: N } = R("batch-input-group-popover-input");
|
|
40
|
+
return (t, a) => (w(), A("div", {
|
|
41
|
+
class: p(e(s)())
|
|
38
42
|
}, [
|
|
39
|
-
|
|
40
|
-
"overlay-class-name": e(
|
|
41
|
-
"get-popup-container":
|
|
43
|
+
u(e(L), {
|
|
44
|
+
"overlay-class-name": e(y)("popover"),
|
|
45
|
+
"get-popup-container": x,
|
|
42
46
|
trigger: "click",
|
|
43
47
|
placement: "bottomLeft",
|
|
44
48
|
open: n.value,
|
|
45
|
-
onOpenChange:
|
|
49
|
+
onOpenChange: V
|
|
46
50
|
}, {
|
|
47
|
-
content:
|
|
48
|
-
|
|
49
|
-
class: p(e(
|
|
51
|
+
content: f(() => [
|
|
52
|
+
B("div", {
|
|
53
|
+
class: p(e(I)("popover", "content"))
|
|
50
54
|
}, [
|
|
51
|
-
|
|
55
|
+
u(e(P), {
|
|
52
56
|
ref_key: "textAreaRef",
|
|
53
57
|
ref: l,
|
|
54
|
-
placeholder: e(
|
|
58
|
+
placeholder: e(C)("ap.batchInputGroup.popoverInputPlaceholder"),
|
|
55
59
|
bordered: !1,
|
|
56
60
|
rows: 10,
|
|
57
61
|
value: e(b),
|
|
58
62
|
"allow-clear": !1,
|
|
59
63
|
"auto-size": !1,
|
|
60
|
-
onInput:
|
|
64
|
+
onInput: _
|
|
61
65
|
}, null, 8, ["placeholder", "value"])
|
|
62
66
|
], 2)
|
|
63
67
|
]),
|
|
64
|
-
default:
|
|
65
|
-
|
|
68
|
+
default: f(() => [
|
|
69
|
+
u(e(z), {
|
|
66
70
|
class: p([
|
|
67
|
-
e(
|
|
68
|
-
t.disabled ? e(
|
|
71
|
+
e(s)("trigger-icon"),
|
|
72
|
+
t.disabled ? e(N)("trigger-icon", "disabled") : null
|
|
69
73
|
])
|
|
70
74
|
}, null, 8, ["class"])
|
|
71
75
|
]),
|
|
@@ -75,5 +79,5 @@ const D = /* @__PURE__ */ A({
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
J as default
|
|
79
83
|
};
|