@aplus-frontend/ui 6.13.3 → 6.14.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.
Files changed (46) hide show
  1. package/es/src/ap-form/ap-form.vue2.mjs +123 -120
  2. package/es/src/ap-form/dependency/index.vue.mjs +26 -28
  3. package/es/src/ap-form/hooks/use-watch.mjs +28 -31
  4. package/es/src/ap-form/interface.d.ts +5 -0
  5. package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +22 -24
  6. package/es/src/ap-form/utils/get.d.ts +2 -0
  7. package/es/src/ap-form/utils/get.mjs +12 -7
  8. package/es/src/ap-grid/editable/form-item.vue.mjs +84 -87
  9. package/es/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
  10. package/es/src/ap-grid/hooks/use-row-selection.mjs +71 -56
  11. package/es/src/ap-grid/index.vue.mjs +7 -10
  12. package/es/src/business/ap-export-group/convertExportField.d.ts +3 -1
  13. package/es/src/business/batch-input-group/form-item.vue.mjs +34 -28
  14. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +9 -7
  15. package/es/src/editable-table/form-item.vue.mjs +78 -81
  16. package/es/src/locale/lang/en.mjs +1 -1
  17. package/es/src/locale/lang/zh-cn.mjs +1 -1
  18. package/es/src/version.d.ts +1 -1
  19. package/es/src/version.mjs +1 -1
  20. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  21. package/lib/src/ap-form/dependency/index.vue.js +1 -1
  22. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  23. package/lib/src/ap-form/interface.d.ts +5 -0
  24. package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
  25. package/lib/src/ap-form/utils/get.d.ts +2 -0
  26. package/lib/src/ap-form/utils/get.js +1 -1
  27. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  28. package/lib/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
  29. package/lib/src/ap-grid/hooks/use-row-selection.js +1 -1
  30. package/lib/src/ap-grid/index.vue.js +1 -1
  31. package/lib/src/business/ap-export-group/convertExportField.d.ts +3 -1
  32. package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
  33. package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
  34. package/lib/src/editable-table/form-item.vue.js +1 -1
  35. package/lib/src/locale/lang/en.js +1 -1
  36. package/lib/src/locale/lang/zh-cn.js +1 -1
  37. package/lib/src/version.d.ts +1 -1
  38. package/lib/src/version.js +1 -1
  39. package/package.json +1 -1
  40. package/theme/antdv-override.css +0 -24
  41. package/theme/antdv-override.less +0 -33
  42. package/theme/css-var.css +2 -0
  43. package/theme/css-var.less +4 -0
  44. package/theme/index.css +2 -24
  45. package/theme/reset.css +18 -0
  46. package/theme/reset.less +26 -2
@@ -1,15 +1,16 @@
1
- import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as u, watch as G, nextTick as U, createBlock as $, openBlock as q, mergeProps as y, withCtx as g, createVNode as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as I } from "vue";
1
+ import { defineComponent as K, useSlots as H, toRef as P, ref as h, unref as u, watch as A, nextTick as W, createBlock as G, openBlock as U, mergeProps as y, withCtx as g, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
2
  import { ApForm as C } from "../../ap-form/index.mjs";
3
- import { isArray as w, isUndefined as M, isNumber as m, cloneDeep as ee, omit as oe } from "lodash-unified";
3
+ import { isUndefined as Z, isNumber as m, cloneDeep as I, isArray as M, omit as ee } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
- import { isDef as b } from "../../utils/index.mjs";
6
- import { useGetEditableColumns as te } from "../hooks/use-editable-columns.mjs";
5
+ import { isDef as w } from "../../utils/index.mjs";
6
+ import { useGetEditableColumns as oe } from "../hooks/use-editable-columns.mjs";
7
7
  import "../index.vue2.mjs";
8
- import { useInjectForm as ae } from "../../ap-form/context.mjs";
8
+ import { useInjectForm as te } from "../../ap-form/context.mjs";
9
+ import { getModelValue as ae } from "../../ap-form/utils/get.mjs";
9
10
  import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
10
11
  import { useGlobalConfig as ne } from "../../config-provider/hooks/use-global-config.mjs";
11
- import fe from "../index.vue.mjs";
12
- const Ce = /* @__PURE__ */ P({
12
+ import re from "../index.vue.mjs";
13
+ const we = /* @__PURE__ */ K({
13
14
  name: "EditableGridFormItem",
14
15
  __name: "form-item",
15
16
  props: {
@@ -161,134 +162,130 @@ const Ce = /* @__PURE__ */ P({
161
162
  default: () => ({})
162
163
  }
163
164
  },
164
- setup(x, {
165
- expose: R
165
+ setup(b, {
166
+ expose: x
166
167
  }) {
167
- const B = A(), l = x, {
168
- b: S
169
- } = le("editable-grid");
170
- function F(e, t) {
171
- return w(t) ? t.reduce((n, a) => n == null ? void 0 : n[a], e) : e == null ? void 0 : e[t];
172
- }
173
- const {
168
+ const R = H(), l = b, {
169
+ b: B
170
+ } = le("editable-grid"), {
174
171
  internalInstance: o,
175
- model: v
176
- } = ae(), p = W(l.name), d = h(F(u(v), p.value) || []), N = C.useWatch(p);
177
- G(() => N.value, async (e) => {
178
- var t;
179
- await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
172
+ model: S
173
+ } = te(), p = P(l.name), d = h(ae(u(S), p.value) || []), v = C.useWatch(p);
174
+ A(() => v.value, async (e) => {
175
+ var a;
176
+ await W(), d.value = e, (a = l.onChange) == null || a.call(l, e);
180
177
  }, {
181
178
  deep: !0
182
179
  });
183
- const c = h(), D = ne("valueTypeMap"), V = te(l, D);
184
- function L(e, t) {
185
- var f;
186
- const n = ((f = u(d)) == null ? void 0 : f.length) || 0;
187
- if (b(l.maxLength) && n >= l.maxLength)
180
+ const c = h(), F = ne("valueTypeMap"), N = oe(l, F);
181
+ function D(e, a) {
182
+ var n;
183
+ const r = ((n = u(d)) == null ? void 0 : n.length) || 0;
184
+ if (w(l.maxLength) && r >= l.maxLength)
188
185
  return;
189
- const a = {
186
+ const t = {
190
187
  ...e || {}
191
188
  };
192
- o == null || o.setFieldValue(l.name, a, !0, (r, s) => {
193
- if (!r[s]) {
194
- r[s] = [a];
189
+ o == null || o.setFieldValue(l.name, t, !0, (f, s) => {
190
+ if (!f[s]) {
191
+ f[s] = [t];
195
192
  return;
196
193
  }
197
- M(t) ? r[s].push(a) : r[s].splice(t, 0, a);
194
+ Z(a) ? f[s].push(t) : f[s].splice(a, 0, t);
198
195
  });
199
196
  }
200
- function T(e, t = "suffix") {
201
- var r;
202
- const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
203
- if (b(l.maxLength) && n + a > l.maxLength)
197
+ function V(e, a = "suffix") {
198
+ var f;
199
+ const r = ((f = u(d)) == null ? void 0 : f.length) || 0, t = m(e) ? e : e.length;
200
+ if (w(l.maxLength) && r + t > l.maxLength)
204
201
  return;
205
- const f = m(e) ? new Array(e).fill(0).map(() => ({})) : ee(e);
206
- o == null || o.setFieldValue(l.name, f, !0, (s, i) => {
202
+ const n = m(e) ? new Array(e).fill(0).map(() => ({})) : I(e);
203
+ o == null || o.setFieldValue(l.name, n, !0, (s, i) => {
207
204
  if (!s[i]) {
208
- s[i] = [...f];
205
+ s[i] = [...n];
209
206
  return;
210
207
  }
211
- t === "suffix" ? s[i].push(...f) : s[i].unshift(...f);
208
+ a === "suffix" ? s[i].push(...n) : s[i].unshift(...n);
212
209
  });
213
210
  }
214
- function k(e) {
215
- const t = new Set(m(e) ? [e] : e);
216
- o == null || o.setFieldValue(l.name, void 0, !0, (n, a) => {
217
- n[a] = n[a].filter((f, r) => !t.has(r));
211
+ function L(e) {
212
+ const a = new Set(m(e) ? [e] : e);
213
+ o == null || o.setFieldValue(l.name, void 0, !0, (r, t) => {
214
+ r[t] = r[t].filter((n, f) => !a.has(f));
218
215
  });
219
216
  }
220
- function _(e) {
221
- var n;
222
- const t = new Set(w(e) ? e : [e]);
223
- t.size !== 0 && ((n = o == null ? void 0 : o.setFieldValue) == null || n.call(o, l.name, void 0, !0, (a, f) => {
224
- a[f] = a[f].filter((r) => !t.has(r[l.rowKey]));
217
+ function T(e) {
218
+ var r;
219
+ const a = new Set(M(e) ? e : [e]);
220
+ a.size !== 0 && ((r = o == null ? void 0 : o.setFieldValue) == null || r.call(o, l.name, void 0, !0, (t, n) => {
221
+ t[n] = t[n].filter((f) => !a.has(f[l.rowKey]));
225
222
  }));
226
223
  }
227
- function j() {
224
+ function k() {
228
225
  return u(d);
229
226
  }
230
- function E(e) {
231
- var t;
232
- return (t = u(d)) == null ? void 0 : t[e];
227
+ function _(e) {
228
+ var a;
229
+ return (a = u(d)) == null ? void 0 : a[e];
233
230
  }
234
- function O(e, t, n = !0) {
235
- o == null || o.setFieldValue(l.name, void 0, !0, (a, f) => {
236
- if (!(!a[f] || !a[f][e])) {
237
- if (!n) {
238
- const r = Object.keys(a[f][e]);
239
- for (const s of r)
240
- s !== l.rowKey && delete a[f][e][s];
231
+ function j(e, a, r = !0) {
232
+ o == null || o.setFieldValue(l.name, void 0, !0, (t, n) => {
233
+ if (!(!t[n] || !t[n][e])) {
234
+ if (!r) {
235
+ const f = Object.keys(t[n][e]);
236
+ for (const s of f)
237
+ s !== l.rowKey && delete t[n][e][s];
241
238
  }
242
- Object.assign(a[f][e], {
243
- ...t
239
+ Object.assign(t[n][e], {
240
+ ...a
244
241
  });
245
242
  }
246
243
  });
247
244
  }
248
- function z(e) {
245
+ function E(e) {
249
246
  o == null || o.setFieldValue(l.name, e);
250
247
  }
251
- function K(e) {
252
- var n;
253
- const t = e === "end" ? d.value.length - 1 : e;
254
- (n = c.value) == null || n.scrollToRow(t);
248
+ function O(e) {
249
+ var r;
250
+ const a = e === "end" ? d.value.length - 1 : e;
251
+ (r = c.value) == null || r.scrollToRow(a);
255
252
  }
256
- function H() {
253
+ function z() {
257
254
  var e;
258
255
  (e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
259
256
  }
260
- return R({
261
- add: L,
262
- remove: k,
263
- getRowData: E,
264
- getRowsData: j,
265
- setRowData: O,
266
- addMultiple: T,
267
- scrollTo: K,
268
- setTableData: z,
269
- clear: H,
270
- removeByKey: _
271
- }), (e, t) => (q(), $(u(C).FormItem, y(e.formItem, {
257
+ return x({
258
+ add: D,
259
+ remove: L,
260
+ getRowData: _,
261
+ getRowsData: k,
262
+ setRowData: j,
263
+ addMultiple: V,
264
+ scrollTo: O,
265
+ setTableData: E,
266
+ clear: z,
267
+ removeByKey: T
268
+ }), (e, a) => (U(), G(u(C).FormItem, y(e.formItem, {
272
269
  name: e.name,
273
270
  label: e.label
274
271
  }), {
275
- default: g(() => [J(fe, y(u(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
272
+ default: g(() => [$(re, y(u(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
276
273
  ref_key: "tableRef",
277
274
  ref: c,
278
- class: u(S)(),
279
- columns: u(V),
275
+ class: u(B)(),
276
+ columns: u(N),
280
277
  "data-source": d.value,
281
278
  "search-form": !1
282
- }), Q({
279
+ }), q({
283
280
  _: 2
284
- }, [X(B, (n, a) => ({
285
- name: a,
286
- fn: g((f) => [Y(e.$slots, a, Z(I(f || {})))])
281
+ }, [J(R, (r, t) => ({
282
+ name: t,
283
+ fn: g((n) => [Q(e.$slots, t, X(Y(n || {})))])
287
284
  }))]), 1040, ["class", "columns", "data-source"])]),
288
285
  _: 3
289
286
  }, 16, ["name", "label"]));
290
287
  }
291
288
  });
292
289
  export {
293
- Ce as default
290
+ we as default
294
291
  };
@@ -1,7 +1,8 @@
1
1
  import { TableRowSelection } from '@aplus-frontend/antdv/lib/table/interface';
2
2
  import { ComputedRef, Ref } from 'vue';
3
- import { ApTableProps, ApTableRowSelection } from '../../ap-table';
3
+ import { ApTableProps } from '../../ap-table';
4
4
  import { Recordable } from '../../type';
5
+ import { ApGridRowSelection } from '../interface';
5
6
  export interface RowSelectionReturnType<RecordType = any> {
6
7
  rowSelection: ComputedRef<TableRowSelection<RecordType>>;
7
8
  selectedRows: Ref<Partial<RecordType>[]>;
@@ -58,12 +59,12 @@ export interface RowSelectionReturnType<RecordType = any> {
58
59
  unSelectMulti: (items: RecordType[]) => void;
59
60
  /**
60
61
  * VxeTable 表格checkbox-change事件
61
- * @param item
62
62
  * @param select
63
- * @param partRowData
63
+ * @param selectedRows
64
+ * @param reserveSelectedRows
64
65
  * @returns
65
66
  */
66
- selectChange: (item: RecordType, select: boolean, partRowData: RecordType[]) => void;
67
+ selectChange: (select: boolean, selectedRows: RecordType[], reserveSelectedRows: RecordType[]) => void;
67
68
  /**
68
69
  * VxeTable 表格checkbox-all事件
69
70
  * @param item
@@ -86,7 +87,7 @@ export interface RowSelectionReturnType<RecordType = any> {
86
87
  */
87
88
  selectMultiByKeys: (keys: (string | number)[]) => void;
88
89
  }
89
- type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
90
+ type RowSelectionParams<T> = ApGridRowSelection<T> & {
90
91
  /**
91
92
  * 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
92
93
  */
@@ -1,117 +1,132 @@
1
- import { ref as I, computed as v, unref as o } from "vue";
2
- import { isFunction as i, cloneDeep as _ } from "lodash-unified";
3
- function b(a, c) {
4
- return !(c != null && c.length) || i(a) ? [] : c.map((f) => ({ [a]: f }));
1
+ import { ref as F, computed as M, unref as o } from "vue";
2
+ import { isFunction as v, cloneDeep as h } from "lodash-unified";
3
+ function T(a, c) {
4
+ return !(c != null && c.length) || v(a) ? [] : c.map((d) => ({ [a]: d }));
5
5
  }
6
- const F = (a) => {
7
- a.defaultSelectedRowKeys;
8
- const c = I(
9
- b(a.rowKey, a.defaultSelectedRowKeys)
6
+ const m = (a) => {
7
+ const c = F(
8
+ T(a.rowKey, a.defaultSelectedRowKeys)
10
9
  );
11
- function f(e, t) {
10
+ function d(e, t) {
12
11
  c.value = t;
13
12
  }
14
- const l = (e) => i(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = v(() => {
13
+ const u = (e) => v(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = M(() => {
15
14
  const e = /* @__PURE__ */ new Map();
16
15
  return o(c).forEach((t) => {
17
- e.set(l(t), t);
16
+ e.set(u(t), t);
18
17
  }), e;
19
18
  });
20
- function M(e) {
21
- return o(s).has(l(e));
19
+ function w(e) {
20
+ return o(s).has(u(e));
22
21
  }
23
22
  function g(e) {
23
+ if (!f(e))
24
+ return;
24
25
  const t = o(s);
25
- t.set(l(e), e), c.value = [...t.values()];
26
+ t.set(u(e), e), c.value = [...t.values()];
26
27
  }
27
- function h(e) {
28
+ function x(e) {
28
29
  const t = o(s);
29
30
  for (const n of e)
30
- t.set(l(n), n);
31
+ f(n) && t.set(u(n), n);
31
32
  c.value = [...t.values()];
32
33
  }
33
- function w(e) {
34
- if (i(a.rowKey))
34
+ function y(e) {
35
+ if (v(a.rowKey))
35
36
  return;
36
37
  const t = o(s);
37
38
  for (const n of e) {
38
- const u = o(a.dataSource).find(
39
- (r) => l(r) === n
40
- ), S = { [a.rowKey]: n };
41
- t.set(String(n), u || S);
39
+ const l = o(a.dataSource).find(
40
+ (i) => u(i) === n
41
+ ), r = { [a.rowKey]: n };
42
+ f(l || r) && t.set(n, l || r);
42
43
  }
43
44
  c.value = [...t.values()];
44
45
  }
45
- function x(e) {
46
+ function E(e) {
47
+ if (!f(e))
48
+ return;
46
49
  const t = o(s);
47
- t.delete(l(e)), c.value = [...t.values()];
50
+ t.delete(u(e)), c.value = [...t.values()];
48
51
  }
49
- function y(e) {
52
+ function K(e) {
50
53
  const t = o(s);
51
54
  for (const n of e)
52
- t.delete(l(n));
55
+ f(n) && t.delete(u(n));
53
56
  c.value = [...t.values()];
54
57
  }
55
- function d(e, t) {
58
+ function S(e, t) {
56
59
  const n = e;
57
- for (const u of t)
58
- n.set(l(u), u);
60
+ for (const l of t)
61
+ n.set(u(l), l);
59
62
  return n;
60
63
  }
61
- function K(e, t, n) {
62
- const u = o(s);
63
- t ? u.set(l(e), e) : u.delete(l(e)), d(u, n), c.value = [...u.values()];
64
+ function b(e, t, n) {
65
+ const l = o(s);
66
+ e ? S(l, [...n, ...t]) : o(a.dataSource).forEach((r) => {
67
+ const i = u(r);
68
+ t.some((B) => u(B) === i) ? l.set(i, r) : l.delete(i);
69
+ }), c.value = [...l.values()];
64
70
  }
65
71
  function A(e, t) {
66
- c.value = [...t];
72
+ const n = h(o(s));
73
+ e ? S(n, t) : o(a.dataSource).forEach((l) => {
74
+ f(l) && n.delete(u(l));
75
+ }), c.value = [...n.values()];
76
+ }
77
+ function f(e) {
78
+ const t = a.shown, n = a.disabled, l = t ? t(e) : !0, r = n ? n(e) : !1;
79
+ return l && !r;
67
80
  }
68
81
  function C(e, t) {
69
- const n = _(o(s));
70
- o(a.dataSource).forEach((u) => {
71
- e.find((r) => l(r) === l(u)) ? n.set(l(u), u) : n.delete(l(u));
72
- }), d(n, t), c.value = [...n.values()];
82
+ const n = h(o(s));
83
+ o(a.dataSource).forEach((l) => {
84
+ e.find((i) => u(i) === u(l)) ? n.set(u(l), l) : n.delete(u(l));
85
+ }), S(n, t), c.value = [...n.values()];
73
86
  }
74
- function E() {
87
+ function D() {
75
88
  const e = o(s);
76
89
  o(a.dataSource).forEach((t) => {
77
- e.set(l(t), t);
90
+ f(t) && e.set(u(t), t);
78
91
  }), c.value = [...e.values()];
79
92
  }
80
93
  function R(e) {
81
- const t = o(s), n = l(e);
94
+ if (!f(e))
95
+ return;
96
+ const t = o(s), n = u(e);
82
97
  t.has(n) ? t.delete(n) : t.set(n, e), c.value = [...t.values()];
83
98
  }
84
- function D() {
99
+ function I() {
85
100
  const e = o(s);
86
101
  o(a.dataSource).forEach((t) => {
87
- e.delete(l(t));
102
+ f(t) && e.delete(u(t));
88
103
  }), c.value = [...e.values()];
89
104
  }
90
- function m() {
105
+ function k() {
91
106
  c.value = [];
92
107
  }
93
108
  return {
94
109
  select: g,
95
- unSelect: x,
96
- isSelected: M,
97
- selectAll: E,
98
- unSelectAll: D,
99
- clearAll: m,
110
+ unSelect: E,
111
+ isSelected: w,
112
+ selectAll: D,
113
+ unSelectAll: I,
114
+ clearAll: k,
100
115
  toggleSelect: R,
101
116
  selectedRows: c,
102
- selectMulti: h,
103
- unSelectMulti: y,
104
- rowSelection: v(() => ({
117
+ selectMulti: x,
118
+ unSelectMulti: K,
119
+ rowSelection: M(() => ({
105
120
  ...a,
106
- onChange: f,
107
- selectedRowKeys: o(c).map((e) => l(e))
121
+ onChange: d,
122
+ selectedRowKeys: o(c).map((e) => u(e))
108
123
  })),
109
- selectChange: K,
124
+ selectChange: b,
110
125
  selectAllChange: A,
111
126
  selectRangeChange: C,
112
- selectMultiByKeys: w
127
+ selectMultiByKeys: y
113
128
  };
114
129
  };
115
130
  export {
116
- F as default
131
+ m as default
117
132
  };
@@ -252,17 +252,14 @@ const Gt = /* @__PURE__ */ $e({
252
252
  dataSource: Pe,
253
253
  rowKey: o.rowKey
254
254
  }), Te = ({
255
- checked: e,
256
- row: t
255
+ checked: e
257
256
  }) => {
258
- const l = s.value;
259
- if (l && l) {
260
- const r = [
261
- ...l.getCheckboxReserveRecords(),
262
- ...l.getCheckboxRecords()
263
- ];
264
- y.selectChange(t, e, r);
265
- }
257
+ const t = s.value;
258
+ t && t && y.selectChange(
259
+ e,
260
+ t.getCheckboxRecords(),
261
+ t.getCheckboxReserveRecords()
262
+ );
266
263
  }, Ne = ({
267
264
  checked: e
268
265
  }) => {
@@ -1,4 +1,6 @@
1
+ import { ApColumnType } from '../../ap-table/interface';
2
+ import { ApGridColumnType } from './../../ap-grid/interface';
1
3
  import { ColumnType } from '@aplus-frontend/antdv/es/table';
2
- export declare const convertExportField: (columns: ColumnType[], convertField?: {
4
+ export declare const convertExportField: (columns: ColumnType[] | ApGridColumnType[] | ApColumnType[], convertField?: {
3
5
  [key: string]: string[];
4
6
  }) => any[];
@@ -1,11 +1,13 @@
1
- import { defineComponent as b, computed as r, createBlock as B, openBlock as g, mergeProps as f, unref as m, withCtx as _, createVNode as V } from "vue";
1
+ import { defineComponent as B, computed as n, createBlock as g, openBlock as V, mergeProps as m, unref as s, withCtx as _, createVNode as x } from "vue";
2
2
  import "./index.vue2.mjs";
3
3
  import "../../ap-form/item/index.vue2.mjs";
4
- import { isValid as s } from "@aplus-frontend/utils";
5
- import { omit as p } from "lodash-unified";
6
- import x from "../../ap-form/item/index.vue.mjs";
7
- import k from "./index.vue.mjs";
8
- const $ = /* @__PURE__ */ b({
4
+ import { isValid as p } from "@aplus-frontend/utils";
5
+ import { omit as c } from "lodash-unified";
6
+ import { useInjectForm as F } from "../../ap-form/context.mjs";
7
+ import { getModelValue as k } from "../../ap-form/utils/get.mjs";
8
+ import C from "../../ap-form/item/index.vue.mjs";
9
+ import S from "./index.vue.mjs";
10
+ const L = /* @__PURE__ */ B({
9
11
  name: "ApFormItemBatchInputGroup",
10
12
  __name: "form-item",
11
13
  props: {
@@ -56,30 +58,34 @@ const $ = /* @__PURE__ */ b({
56
58
  trim: { type: Boolean, default: !0 },
57
59
  defaultSelectedAllKey: { type: Boolean }
58
60
  },
59
- setup(c) {
60
- const l = c, v = r(() => (l == null ? void 0 : l.transform) || {
61
+ setup(v) {
62
+ const l = v, { internalInstance: r } = F(), y = n(() => (l == null ? void 0 : l.transform) || {
61
63
  flat: !1,
62
64
  transformer: (e) => {
63
- var a, o, i, n, d, u;
65
+ var i, o, a, d, u, f;
64
66
  if (e)
65
- return !(e != null && e.value) || ((a = e == null ? void 0 : e.value) == null ? void 0 : a.length) < 1 ? void 0 : (o = l == null ? void 0 : l.field) != null && o.options ? {
67
+ return !(e != null && e.value) || ((i = e == null ? void 0 : e.value) == null ? void 0 : i.length) < 1 ? void 0 : (o = l == null ? void 0 : l.field) != null && o.options ? {
66
68
  ...e,
67
- value: (n = (i = e == null ? void 0 : e.value) == null ? void 0 : i.filter((t) => s(t == null ? void 0 : t.trim()))) == null ? void 0 : n.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
68
- } : (u = (d = e == null ? void 0 : e.value) == null ? void 0 : d.filter((t) => s(t == null ? void 0 : t.trim()))) == null ? void 0 : u.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
69
+ value: (d = (a = e == null ? void 0 : e.value) == null ? void 0 : a.filter((t) => p(t == null ? void 0 : t.trim()))) == null ? void 0 : d.map((t) => l.trim ? t == null ? void 0 : t.trim() : t)
70
+ } : (f = (u = e == null ? void 0 : e.value) == null ? void 0 : u.filter((t) => p(t == null ? void 0 : t.trim()))) == null ? void 0 : f.map((t) => l.trim ? t == null ? void 0 : t.trim() : t);
69
71
  }
70
- }), y = r(() => {
72
+ }), h = n(() => {
71
73
  var e;
72
74
  return ((e = l.field) == null ? void 0 : e.style) || "width:auto";
73
- }), h = r(() => {
74
- var e, a;
75
- return (l == null ? void 0 : l.initialValue) || {
76
- key: (a = (e = l == null ? void 0 : l.field) == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.value)
77
- };
75
+ }), b = n(() => {
76
+ var i, o;
77
+ if (l.initialValue)
78
+ return l.initialValue;
79
+ const e = r == null ? void 0 : r.getInitialValues();
80
+ if (!k(e, l.name))
81
+ return {
82
+ key: (o = (i = l == null ? void 0 : l.field) == null ? void 0 : i.options) == null ? void 0 : o.map((a) => a.value)
83
+ };
78
84
  });
79
- return (e, a) => {
80
- var o, i;
81
- return g(), B(x, f(
82
- m(p)(l, [
85
+ return (e, i) => {
86
+ var o, a;
87
+ return V(), g(C, m(
88
+ s(c)(l, [
83
89
  "field",
84
90
  "initialValue",
85
91
  "transform",
@@ -87,14 +93,14 @@ const $ = /* @__PURE__ */ b({
87
93
  "disabled"
88
94
  ]),
89
95
  {
90
- "initial-value": h.value,
91
- transform: v.value,
92
- bordered: (i = (o = e.field) == null ? void 0 : o.options) != null && i.length ? !1 : e.bordered
96
+ "initial-value": b.value,
97
+ transform: y.value,
98
+ bordered: (a = (o = e.field) == null ? void 0 : o.options) != null && a.length ? !1 : e.bordered
93
99
  }
94
100
  ), {
95
101
  default: _(() => [
96
- V(k, f(m(p)(l.field, ["style"]), {
97
- style: y.value,
102
+ x(S, m(s(c)(l.field, ["style"]), {
103
+ style: h.value,
98
104
  disabled: e.disabled,
99
105
  placeholer: e.placeholer
100
106
  }), null, 16, ["style", "disabled", "placeholer"])
@@ -105,5 +111,5 @@ const $ = /* @__PURE__ */ b({
105
111
  }
106
112
  });
107
113
  export {
108
- $ as default
114
+ L as default
109
115
  };
@@ -32,30 +32,32 @@ const J = /* @__PURE__ */ k({
32
32
  }
33
33
  h(r);
34
34
  }
35
- function V(t) {
35
+ function N(t) {
36
36
  var a;
37
37
  o.disabled ? n.value = !1 : n.value = t, !t && ((a = o.onClose) == null || a.call(o));
38
38
  }
39
- const { b: s, e: y, em: I, bm: N } = R("batch-input-group-popover-input");
39
+ const { b: s, e: V, em: y, bm: I } = R("batch-input-group-popover-input");
40
40
  return (t, a) => (w(), A("div", {
41
41
  class: p(e(s)())
42
42
  }, [
43
43
  u(e(L), {
44
- "overlay-class-name": e(y)("popover"),
44
+ "overlay-class-name": e(V)("popover"),
45
45
  "get-popup-container": x,
46
46
  trigger: "click",
47
47
  placement: "bottomLeft",
48
48
  open: n.value,
49
- onOpenChange: V
49
+ onOpenChange: N
50
50
  }, {
51
51
  content: f(() => [
52
52
  B("div", {
53
- class: p(e(I)("popover", "content"))
53
+ class: p(e(y)("popover", "content"))
54
54
  }, [
55
55
  u(e(P), {
56
56
  ref_key: "textAreaRef",
57
57
  ref: l,
58
- placeholder: e(C)("ap.batchInputGroup.popoverInputPlaceholder"),
58
+ placeholder: e(C)("ap.batchInputGroup.popoverInputPlaceholder", {
59
+ maxNum: t.maxNum + ""
60
+ }),
59
61
  bordered: !1,
60
62
  rows: 10,
61
63
  value: e(b),
@@ -69,7 +71,7 @@ const J = /* @__PURE__ */ k({
69
71
  u(e(z), {
70
72
  class: p([
71
73
  e(s)("trigger-icon"),
72
- t.disabled ? e(N)("trigger-icon", "disabled") : null
74
+ t.disabled ? e(I)("trigger-icon", "disabled") : null
73
75
  ])
74
76
  }, null, 8, ["class"])
75
77
  ]),