@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,14 +1,15 @@
1
- import { defineComponent as Z, reactive as z, ref as x, unref as m, nextTick as ee, toRaw as R, watch as te, onWatcherCleanup as re, computed as ie, createBlock as le, openBlock as ne, mergeProps as oe, withCtx as se, renderSlot as ae } from "vue";
2
- import { Form as ue } from "@aplus-frontend/antdv";
3
- import { useProvideForm as ce } from "./context.mjs";
4
- import { isArray as f, cloneDeep as fe, isEqual as de, isFunction as B, isPlainObject as _, omit as ge } from "lodash-unified";
1
+ import { defineComponent as z, reactive as ee, ref as x, unref as p, nextTick as te, toRaw as R, watch as re, onWatcherCleanup as le, computed as oe, createBlock as ie, openBlock as ne, mergeProps as se, withCtx as ae, renderSlot as ue } from "vue";
2
+ import { Form as ce } from "@aplus-frontend/antdv";
3
+ import { useProvideForm as fe } from "./context.mjs";
4
+ import { isArray as d, cloneDeep as de, isEqual as ge, isFunction as B, isPlainObject as _, omit as me } from "lodash-unified";
5
5
  import { useUrlSearchParams as Fe } from "@vueuse/core";
6
6
  import { INTERNAL_FORM_INSTANCE_MARK as he } from "./constant.mjs";
7
7
  import { getRouteType as pe, isDef as V } from "../utils/index.mjs";
8
- import me from "./utils/set.mjs";
8
+ import ye from "./utils/set.mjs";
9
9
  import { genParams as b, setToParams as C } from "./utils/params.mjs";
10
- import { useInjectFormProvider as ye } from "./provider/context.mjs";
11
- const be = /* @__PURE__ */ Z({
10
+ import { useInjectFormProvider as Te } from "./provider/context.mjs";
11
+ import { getModelValue as N } from "./utils/get.mjs";
12
+ const Ee = /* @__PURE__ */ z({
12
13
  name: "ApForm",
13
14
  __name: "ap-form",
14
15
  props: {
@@ -39,203 +40,205 @@ const be = /* @__PURE__ */ Z({
39
40
  syncToUrl: { type: [Boolean, Function], default: !1 },
40
41
  syncToUrlPriority: { type: Boolean }
41
42
  },
42
- setup(N, { expose: S }) {
43
- function w(e, t) {
44
- return f(t) ? t.reduce((r, i) => r == null ? void 0 : r[i], e) : e == null ? void 0 : e[t];
45
- }
46
- const l = N;
47
- function I(e, t, r = !0, i) {
48
- var o;
49
- if (f(e)) {
50
- let s = n;
51
- for (let d = 0; d < e.length - 1; d++)
52
- e[d] in s || (s[e[d]] = {}), s = s[e[d]];
53
- i ? i(s, e[e.length - 1]) : s[e[e.length - 1]] = t;
43
+ setup(S, { expose: W }) {
44
+ const o = S;
45
+ function v(e, t, r = !0, l) {
46
+ var n;
47
+ if (d(e)) {
48
+ let s = i;
49
+ for (let f = 0; f < e.length - 1; f++)
50
+ e[f] in s || (s[e[f]] = {}), s = s[e[f]];
51
+ l ? l(s, e[e.length - 1]) : s[e[e.length - 1]] = t;
54
52
  } else
55
- i ? i(n, e) : n[e] = t;
56
- let u = f(e) ? e[0] : e;
53
+ l ? l(i, e) : i[e] = t;
54
+ let u = d(e) ? e[0] : e;
57
55
  if (r) {
58
- const s = { [u]: n[u] };
59
- y.triggerFormChange(l.name, s), (o = l.onValuesChange) == null || o.call(l, s, n, e);
56
+ const s = { [u]: i[u] };
57
+ y.triggerFormChange(o.name, s), (n = o.onValuesChange) == null || n.call(o, s, i, e);
60
58
  }
61
59
  T();
62
60
  }
63
- const a = x(), U = Fe(pe()), y = ye(), v = x(
64
- l.syncToUrl ? b(l.syncToUrl, U, "get") : {}
61
+ const a = x(), I = Fe(pe()), y = Te(), U = x(
62
+ o.syncToUrl ? b(o.syncToUrl, I, "get") : {}
65
63
  );
66
- let F = fe(E()), g = {};
67
- const n = z(E());
68
- let h = [];
69
- function E() {
70
- const e = l.initialValues || {};
71
- return l.syncToUrlPriority ? {
64
+ let g = de(w()), m = {};
65
+ const i = ee(w());
66
+ let F = [];
67
+ function w() {
68
+ const e = o.initialValues || {};
69
+ return o.syncToUrlPriority ? {
72
70
  ...e,
73
- ...m(v)
71
+ ...p(U)
74
72
  } : {
75
- ...m(v),
73
+ ...p(U),
76
74
  ...e
77
75
  };
78
76
  }
79
- function W(e) {
77
+ function q(e) {
80
78
  var r;
81
- const t = p(e, g);
82
- y.triggerFormFinish(l.name, e), l.syncToUrl && C(U, b(l.syncToUrl, t, "set")), (r = l.onFinish) == null || r.call(l, t);
79
+ const t = h(e, m);
80
+ y.triggerFormFinish(o.name, e), o.syncToUrl && C(I, b(o.syncToUrl, t, "set")), (r = o.onFinish) == null || r.call(o, t);
83
81
  }
84
- const q = async () => {
82
+ const D = async () => {
85
83
  var e;
86
- (e = a.value) == null || e.resetFields(), await ee(() => {
87
- Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, F), T(), l.syncToUrl && C(
88
- U,
84
+ (e = a.value) == null || e.resetFields(), await te(() => {
85
+ Object.keys(i).forEach((t) => delete i[t]), Object.assign(i, g), T(), o.syncToUrl && C(
86
+ I,
89
87
  b(
90
- l.syncToUrl,
91
- p(F, g),
88
+ o.syncToUrl,
89
+ h(g, m),
92
90
  "set"
93
91
  )
94
92
  );
95
93
  });
96
- }, D = (e) => {
94
+ }, k = (e) => {
97
95
  var t;
98
96
  (t = a.value) == null || t.clearValidate(e);
99
- }, k = (e, t) => {
97
+ }, K = (e, t) => {
100
98
  var r;
101
99
  return (r = a.value) == null ? void 0 : r.validateFields(e, t);
102
- }, K = async (e, t) => {
103
- var i;
104
- const r = await ((i = a.value) == null ? void 0 : i.validateFields(
100
+ }, L = async (e, t) => {
101
+ var l;
102
+ const r = await ((l = a.value) == null ? void 0 : l.validateFields(
105
103
  e,
106
104
  t
107
105
  ));
108
- return p(r, g);
109
- }, O = (e) => {
106
+ return h(r, m);
107
+ }, E = (e) => {
110
108
  var t;
111
- return e === !0 ? R(n) : (t = a.value) == null ? void 0 : t.getFieldsValue(e);
112
- }, L = (e) => {
113
- const t = O(e);
114
- return p(t, g);
115
- }, $ = (e, t) => {
109
+ return e === !0 ? R(i) : (t = a.value) == null ? void 0 : t.getFieldsValue(e);
110
+ }, $ = (e) => {
111
+ const t = E(e);
112
+ return h(t, m);
113
+ }, G = (e, t) => {
116
114
  var r;
117
115
  return (r = a.value) == null ? void 0 : r.validate(e, t);
118
- }, G = (e, t = {}) => {
116
+ }, H = (e, t = {}) => {
119
117
  var r;
120
118
  (r = a.value) == null || r.scrollToField(e, t);
121
- }, H = (e) => {
122
- Object.assign(n, e), T();
123
- }, P = (e, t, r = !0, i) => {
124
- I(e, t, r, i), T();
119
+ }, J = (e) => {
120
+ Object.assign(i, e), T();
121
+ }, P = (e, t, r = !0, l) => {
122
+ v(e, t, r, l), T();
125
123
  };
126
124
  function M(e, t) {
127
- return t || e(R(n)), h.push(e), () => {
128
- h = h.filter((r) => r !== e);
125
+ return t || e(R(i)), F.push(e), () => {
126
+ F = F.filter((r) => r !== e);
129
127
  };
130
128
  }
131
- function J(e, t) {
132
- if (f(e)) {
133
- let r = F;
134
- for (let i = 0; i < e.length - 1; i++)
135
- V(r[e[i]]) || (r[e[i]] = {}), r = r[e[i]];
129
+ function Q(e, t) {
130
+ if (d(e)) {
131
+ let r = g;
132
+ for (let l = 0; l < e.length - 1; l++)
133
+ V(r[e[l]]) || (r[e[l]] = {}), r = r[e[l]];
136
134
  r[e[e.length - 1]] = t;
137
135
  } else
138
- F[e] = t;
136
+ g[e] = t;
139
137
  }
140
- function Q(e, t) {
138
+ function X(e, t) {
141
139
  if (!V(e) || !V(t))
142
140
  return;
143
- const r = w(F, t);
144
- if (de(r, e))
141
+ const r = N(g, t);
142
+ if (ge(r, e))
145
143
  return;
146
- const i = w(m(v), t);
147
- V(i) && l.syncToUrlPriority || (I(t, e, !1), J(t, e));
144
+ const l = N(p(U), t);
145
+ V(l) && o.syncToUrlPriority || (v(t, e, !1), Q(t, e));
148
146
  }
149
- function X(e, t) {
150
- t && (g = me(
151
- g,
147
+ function Y(e, t) {
148
+ t && (m = ye(
149
+ m,
152
150
  [e].flat(1),
153
151
  t,
154
152
  !0
155
153
  ));
156
154
  }
157
- function j({ initialValue: e, name: t, transform: r }) {
158
- Q(e, t), X(t, r);
155
+ function O({ initialValue: e, name: t, transform: r }) {
156
+ X(e, t), Y(t, r);
157
+ }
158
+ function j() {
159
+ return g;
159
160
  }
160
- function Y(e) {
161
+ function Z(e) {
161
162
  if (e !== he) {
162
163
  console.warn("getInternalInstance should only used at internal");
163
164
  return;
164
165
  }
165
166
  return {
166
- registerField: j,
167
+ registerField: O,
167
168
  registerWatch: M,
168
- setFieldValue: P
169
+ setFieldValue: P,
170
+ getInitialValues: j
169
171
  };
170
172
  }
171
173
  function T() {
172
- if (h.length) {
173
- const e = R(n);
174
- h.forEach((t) => {
174
+ if (F.length) {
175
+ const e = R(i);
176
+ F.forEach((t) => {
175
177
  t(e);
176
178
  });
177
179
  }
178
180
  }
179
- function p(e, t) {
181
+ function h(e, t) {
180
182
  if (e == null)
181
183
  return;
182
- let r = f(e) ? [] : {};
183
- return Object.keys(e).forEach((i) => {
184
- const u = e[i], o = t == null ? void 0 : t[i], s = B(o) ? o : o == null ? void 0 : o.transformer, d = B(o) ? !0 : o == null ? void 0 : o.flat;
184
+ let r = d(e) ? [] : {};
185
+ return Object.keys(e).forEach((l) => {
186
+ const u = e[l], n = t == null ? void 0 : t[l], s = B(n) ? n : n == null ? void 0 : n.transformer, f = B(n) ? !0 : n == null ? void 0 : n.flat;
185
187
  if (B(s)) {
186
188
  const c = s(u);
187
- d ? f(c) && f(r) ? r = [...r, ...c] : _(c) && _(r) ? r = {
189
+ f ? d(c) && d(r) ? r = [...r, ...c] : _(c) && _(r) ? r = {
188
190
  ...r,
189
191
  ...c
190
- } : r[i] = c : r[i] = c;
191
- } else if (_(u) || f(u)) {
192
- const c = p(
192
+ } : r[l] = c : r[l] = c;
193
+ } else if (_(u) || d(u)) {
194
+ const c = h(
193
195
  u,
194
- o
196
+ n
195
197
  );
196
- r[i] = c;
198
+ r[l] = c;
197
199
  } else
198
- r[i] = u;
200
+ r[l] = u;
199
201
  }), r;
200
202
  }
201
203
  const A = {
202
- resetFields: q,
203
- clearValidate: D,
204
- validateFields: k,
205
- getFieldsValue: O,
206
- validate: $,
207
- scrollToField: G,
208
- setFieldsValue: H,
204
+ resetFields: D,
205
+ clearValidate: k,
206
+ validateFields: K,
207
+ getFieldsValue: E,
208
+ validate: G,
209
+ scrollToField: H,
210
+ setFieldsValue: J,
209
211
  setFieldValue: P,
210
212
  registerWatch: M,
211
- validateFieldsReturnTransformed: K,
212
- getFieldsValueTransformed: L,
213
- getInternalInstance: Y
213
+ validateFieldsReturnTransformed: L,
214
+ getFieldsValueTransformed: $,
215
+ getInternalInstance: Z
214
216
  };
215
- return te(
216
- () => l.name,
217
+ return re(
218
+ () => o.name,
217
219
  (e) => {
218
- e && (y.registerForm(e, A), re(() => {
219
- y.unregisterForm(l.name);
220
+ e && (y.registerForm(e, A), le(() => {
221
+ y.unregisterForm(o.name);
220
222
  }));
221
223
  },
222
224
  {
223
225
  immediate: !0
224
226
  }
225
- ), ce({
226
- model: ie(() => n),
227
- updateModel: I,
227
+ ), fe({
228
+ model: oe(() => i),
229
+ updateModel: v,
228
230
  internalInstance: {
229
231
  registerWatch: M,
230
- registerField: j,
231
- setFieldValue: P
232
+ registerField: O,
233
+ setFieldValue: P,
234
+ getInitialValues: j
232
235
  }
233
- }), S(A), (e, t) => (ne(), le(m(ue), oe(
236
+ }), W(A), (e, t) => (ne(), ie(p(ce), se(
234
237
  {
235
238
  ref_key: "formRef",
236
239
  ref: a
237
240
  },
238
- m(ge)(l, [
241
+ p(me)(o, [
239
242
  "initialValues",
240
243
  "onValuesChange",
241
244
  "onFinish",
@@ -243,18 +246,18 @@ const be = /* @__PURE__ */ Z({
243
246
  "syncToUrlPriority"
244
247
  ]),
245
248
  {
246
- model: n,
249
+ model: i,
247
250
  "data-form-name": e.name,
248
- onFinish: W
251
+ onFinish: q
249
252
  }
250
253
  ), {
251
- default: se(() => [
252
- ae(e.$slots, "default")
254
+ default: ae(() => [
255
+ ue(e.$slots, "default")
253
256
  ]),
254
257
  _: 3
255
258
  }, 16, ["model", "data-form-name"]));
256
259
  }
257
260
  });
258
261
  export {
259
- be as default
262
+ Ee as default
260
263
  };
@@ -1,43 +1,41 @@
1
- import { defineComponent as m, ref as y, watchEffect as _, unref as d, renderSlot as g } from "vue";
2
- import { useInjectForm as h } from "../context.mjs";
3
- import { isArray as V, isNumber as x, cloneDeep as b } from "lodash-unified";
4
- const F = /* @__PURE__ */ m({
1
+ import { defineComponent as p, ref as i, watchEffect as d, unref as v, renderSlot as _ } from "vue";
2
+ import { useInjectForm as g } from "../context.mjs";
3
+ import { isNumber as h, cloneDeep as y } from "lodash-unified";
4
+ import { getModelValue as V } from "../utils/get.mjs";
5
+ const D = /* @__PURE__ */ p({
5
6
  name: "ApFormDependency",
6
7
  __name: "index",
7
8
  props: {
8
9
  nameList: {}
9
10
  },
10
- setup(c) {
11
- function f(e, n) {
12
- return V(n) ? n.reduce((o, t) => o == null ? void 0 : o[t], e) : e == null ? void 0 : e[n];
13
- }
14
- const a = c, {
15
- model: l
16
- } = h(), u = y({});
17
- function i(e, n, o) {
18
- let t = n;
19
- for (let s = 0; s < e.length; s++) {
20
- const r = e[s];
21
- if (s === e.length - 1)
22
- t[r] = o;
11
+ setup(a) {
12
+ const c = a, {
13
+ model: f
14
+ } = g(), r = i({});
15
+ function u(e, s, l) {
16
+ let t = s;
17
+ for (let o = 0; o < e.length; o++) {
18
+ const n = e[o];
19
+ if (o === e.length - 1)
20
+ t[n] = l;
23
21
  else {
24
- const p = e[s + 1];
25
- (typeof t[r] != "object" || t[r] === null) && (t[r] = x(p) ? [] : {}), t = t[r];
22
+ const m = e[o + 1];
23
+ (typeof t[n] != "object" || t[n] === null) && (t[n] = h(m) ? [] : {}), t = t[n];
26
24
  }
27
25
  }
28
26
  }
29
- return _(() => {
30
- const e = b(u.value);
31
- for (const n of a.nameList) {
32
- const o = [n].flat(1), t = f(d(l), o);
33
- i(o, e, t);
27
+ return d(() => {
28
+ const e = y(r.value);
29
+ for (const s of c.nameList) {
30
+ const l = [s].flat(1), t = V(v(f), l);
31
+ u(l, e, t);
34
32
  }
35
- u.value = e;
36
- }), (e, n) => g(e.$slots, "default", {
37
- values: u.value
33
+ r.value = e;
34
+ }), (e, s) => _(e.$slots, "default", {
35
+ values: r.value
38
36
  });
39
37
  }
40
38
  });
41
39
  export {
42
- F as default
40
+ D as default
43
41
  };
@@ -1,42 +1,39 @@
1
- import { useInjectForm as M } from "../context.mjs";
2
- import { ref as R, watchEffect as d, unref as s, watch as y } from "vue";
3
- import { isArray as E } from "lodash-unified";
4
- import { INTERNAL_FORM_INSTANCE_MARK as _ } from "../constant.mjs";
5
- function N(e, t) {
6
- return E(t) ? t.reduce((n, l) => n == null ? void 0 : n[l], e) : e == null ? void 0 : e[t];
7
- }
8
- function V(e) {
1
+ import { useInjectForm as N } from "../context.mjs";
2
+ import { ref as M, watchEffect as R, unref as f, watch as A } from "vue";
3
+ import { INTERNAL_FORM_INSTANCE_MARK as E } from "../constant.mjs";
4
+ import { getModelValue as w } from "../utils/get.mjs";
5
+ function V(a) {
9
6
  try {
10
- return JSON.stringify(e);
7
+ return JSON.stringify(a);
11
8
  } catch {
12
9
  return Math.random();
13
10
  }
14
11
  }
15
- function W(e, t, n) {
16
- const { internalInstance: l, model: v } = M(), g = (n == null ? void 0 : n.initialValue) || (t == null ? void 0 : t.initialValue) || void 0, r = R(g);
17
- let u = V(g), h = !0;
18
- const i = t && "value" in t ? t : void 0;
19
- return d((f) => {
20
- var w;
21
- const a = ((w = i == null ? void 0 : i.value) == null ? void 0 : w.getInternalInstance(_)) || l;
22
- if (!a) {
23
- h = !1;
12
+ function C(a, e, c) {
13
+ const { internalInstance: I, model: S } = N(), s = (c == null ? void 0 : c.initialValue) || (e == null ? void 0 : e.initialValue) || void 0, u = M(s);
14
+ let n = V(s), v = !0;
15
+ const r = e && "value" in e ? e : void 0;
16
+ return R((i) => {
17
+ var d;
18
+ const t = ((d = r == null ? void 0 : r.value) == null ? void 0 : d.getInternalInstance(E)) || I;
19
+ if (!t) {
20
+ v = !1;
24
21
  return;
25
22
  }
26
- const c = a.registerWatch((A) => {
27
- const I = N(A, s(e)), S = V(I);
28
- S !== u && (r.value = I, u = S);
29
- }, h);
30
- f(c);
31
- }), y(
32
- () => s(e),
33
- (f) => {
34
- const a = N(s(v), f), c = V(a);
35
- c !== u && (r.value = a, u = c);
23
+ const l = t.registerWatch((o) => {
24
+ const g = w(o, f(a)), h = V(g);
25
+ h !== n && (u.value = g, n = h);
26
+ }, v);
27
+ i(l);
28
+ }), A(
29
+ () => f(a),
30
+ (i) => {
31
+ const t = w(f(S), i), l = V(t);
32
+ l !== n && (u.value = t, n = l);
36
33
  }
37
- ), r;
34
+ ), u;
38
35
  }
39
36
  export {
40
- W as default,
41
- W as useWatch
37
+ C as default,
38
+ C as useWatch
42
39
  };
@@ -129,6 +129,11 @@ export type ApFormInternalInstance = {
129
129
  * @returns
130
130
  */
131
131
  setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
132
+ /**
133
+ * 获取表单的初始值(随着表单项组件的注册,initialValues可能会发生改变)
134
+ * @returns
135
+ */
136
+ getInitialValues: () => Recordable;
132
137
  };
133
138
  export type ApFormItemExpose = FormItemExpose & {
134
139
  /**
@@ -1,24 +1,22 @@
1
- import { computed as m } from "vue";
1
+ import { computed as a } from "vue";
2
2
  import { useInjectForm as d } from "../../context.mjs";
3
- import { isArray as a, isObject as g, isFunction as h } from "lodash-unified";
3
+ import { isArray as F, isObject as g, isFunction as h } from "lodash-unified";
4
4
  import "../../../config-provider/index.mjs";
5
- import { useGlobalConfig as y } from "../../../config-provider/hooks/use-global-config.mjs";
6
- function C(t, r) {
7
- return a(r) ? r.reduce((n, i) => n == null ? void 0 : n[i], t) : t == null ? void 0 : t[r];
8
- }
9
- function c(t) {
5
+ import { getModelValue as y } from "../../utils/get.mjs";
6
+ import { useGlobalConfig as C } from "../../../config-provider/hooks/use-global-config.mjs";
7
+ function s(t) {
10
8
  if (t == null)
11
9
  return !1;
12
10
  if (typeof t == "string")
13
11
  return t.trim() !== "";
14
- if (a(t))
15
- return t.some((n) => c(n));
12
+ if (F(t))
13
+ return t.some((e) => s(e));
16
14
  if (g(t)) {
17
- const r = Object.keys(t);
18
- if (r.length === 0)
15
+ const o = Object.keys(t);
16
+ if (o.length === 0)
19
17
  return !1;
20
- for (const n of r)
21
- if (c(t[n]))
18
+ for (const e of o)
19
+ if (s(t[e]))
22
20
  return !0;
23
21
  return !1;
24
22
  }
@@ -27,21 +25,21 @@ function c(t) {
27
25
  function b(t) {
28
26
  return h(t.type) ? t.type() : t;
29
27
  }
30
- const x = (t) => {
31
- const { model: r } = d(), n = y("searchForm");
28
+ const E = (t) => {
29
+ const { model: o } = d(), e = C("searchForm");
32
30
  return {
33
- count: m(() => {
34
- let s = 0;
35
- return t.value.forEach((p) => {
36
- var u;
37
- const o = b(p.node), F = [o.props.name].flat(1), f = C(r == null ? void 0 : r.value, F), l = o.props.customFilled || o.props["custom-filled"], e = (u = n.value) == null ? void 0 : u.customFilled;
38
- !l && e ? e != null && e(o, f) && (s += 1) : (l || c)(f) && (s += 1);
39
- }), s;
31
+ count: a(() => {
32
+ let i = 0;
33
+ return t.value.forEach((m) => {
34
+ var f;
35
+ const r = b(m.node), p = [r.props.name].flat(1), l = y(o == null ? void 0 : o.value, p), c = r.props.customFilled || r.props["custom-filled"], n = (f = e.value) == null ? void 0 : f.customFilled;
36
+ !c && n ? n != null && n(r, l) && (i += 1) : (c || s)(l) && (i += 1);
37
+ }), i;
40
38
  })
41
39
  };
42
40
  };
43
41
  export {
44
- c as defaultFilled,
42
+ s as defaultFilled,
45
43
  b as getTargetNode,
46
- x as useCollapseInputCount
44
+ E as useCollapseInputCount
47
45
  };
@@ -1 +1,3 @@
1
+ import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
1
2
  export default function get(entity: any, path: (string | number | symbol)[] | readonly (string | number | symbol)[]): any;
3
+ export declare function getModelValue(model: any, name: NamePath): any;
@@ -1,12 +1,17 @@
1
- function l(n, r) {
2
- let e = n;
3
- for (let t = 0; t < r.length; t += 1) {
4
- if (e == null)
1
+ import { isArray as n } from "lodash-unified";
2
+ function e(r, u) {
3
+ let t = r;
4
+ for (let i = 0; i < u.length; i += 1) {
5
+ if (t == null)
5
6
  return;
6
- e = e[r[t]];
7
+ t = t[u[i]];
7
8
  }
8
- return e;
9
+ return t;
10
+ }
11
+ function c(r, u) {
12
+ return n(u) ? u.reduce((t, i) => t == null ? void 0 : t[i], r) : r == null ? void 0 : r[u];
9
13
  }
10
14
  export {
11
- l as default
15
+ e as default,
16
+ c as getModelValue
12
17
  };