@aplus-frontend/ui 0.4.26 → 0.4.28

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.
@@ -1,24 +1,24 @@
1
- import { isVNode as le, defineComponent as re, useSlots as se, ref as ie, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ue, createVNode as a, Fragment as _, openBlock as m, createBlock as y, mergeProps as ce, withCtx as S, resolveDynamicComponent as A, createElementBlock as pe, renderList as de } from "vue";
2
- import { Col as F, Flex as M, Space as fe, Button as E, Row as me } from "@aplus-frontend/antdv";
1
+ import { isVNode as se, defineComponent as ie, useSlots as ce, ref as ue, unref as o, shallowRef as M, computed as S, watch as D, cloneVNode as pe, createVNode as a, Fragment as F, openBlock as m, createBlock as C, mergeProps as de, withCtx as E, resolveDynamicComponent as b, createElementBlock as fe, renderList as me } from "vue";
2
+ import { Col as B, Flex as $, Space as he, Button as v, Row as xe } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { genRealChildren as D } from "../item-group/helper.mjs";
7
- import { DoubleRightOutlined as he } from "@ant-design/icons-vue";
6
+ import { genRealChildren as L } from "../item-group/helper.mjs";
7
+ import { DoubleRightOutlined as ye } from "@ant-design/icons-vue";
8
8
  import "../../config-provider/index.mjs";
9
- import { isArray as xe, isBoolean as ye, omit as Ce } from "lodash-unified";
10
- import { isDef as $ } from "../../utils/index.mjs";
11
- import { execFunc as L, diffFormItem as ge } from "./utils.mjs";
12
- import { useControllableValue as _e } from "../../hooks/useControllableValue.mjs";
13
- import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
15
- import { useLocale as Re } from "../../config-provider/hooks/use-locale.mjs";
16
- import U from "../item/index.vue.mjs";
17
- import Se from "../ap-form.vue2.mjs";
18
- function Ae(h) {
19
- return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !le(h);
9
+ import { isArray as Ce, isBoolean as ge, omit as _e } from "lodash-unified";
10
+ import { isDef as U } from "../../utils/index.mjs";
11
+ import { execFunc as W, diffFormItem as Se } from "./utils.mjs";
12
+ import { useControllableValue as Fe } from "../../hooks/useControllableValue.mjs";
13
+ import { useNamespace as Be } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import { useGlobalConfig as Re } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import { useLocale as Ae } from "../../config-provider/hooks/use-locale.mjs";
16
+ import q from "../item/index.vue.mjs";
17
+ import Ee from "../ap-form.vue2.mjs";
18
+ function be(h) {
19
+ return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !se(h);
20
20
  }
21
- const i = 24, qe = /* @__PURE__ */ re({
21
+ const r = 24, ze = /* @__PURE__ */ ie({
22
22
  name: "ApFormSearchForm",
23
23
  __name: "index",
24
24
  props: {
@@ -104,139 +104,146 @@ const i = 24, qe = /* @__PURE__ */ re({
104
104
  },
105
105
  emits: ["update:collapse"],
106
106
  setup(h, {
107
- expose: W,
108
- emit: q
107
+ expose: z,
108
+ emit: H
109
109
  }) {
110
- var N;
111
- const s = se(), n = h, z = q, {
110
+ var I;
111
+ const c = ce(), n = h, G = H, {
112
112
  value: u,
113
- updateValue: H
114
- } = _e(n, z, {
113
+ updateValue: J
114
+ } = Fe(n, G, {
115
115
  valuePropName: "collapse",
116
116
  defaultValuePropName: "defaultCollapse"
117
117
  }), {
118
- b: G
119
- } = Fe("ap-form-search-form"), J = Be("uiMode"), {
120
- t: b
121
- } = Re(), C = ie();
122
- function K() {
123
- H(!o(u));
118
+ b: K
119
+ } = Be("ap-form-search-form"), Q = Re("uiMode"), {
120
+ t: w
121
+ } = Ae(), g = ue();
122
+ function X() {
123
+ J(!o(u));
124
124
  }
125
- function Q() {
125
+ function Y() {
126
126
  var e, t;
127
- (t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then((l) => L(n.onSubmit, l));
127
+ (t = (e = g.value) == null ? void 0 : e.validateFields()) == null || t.then((s) => W(n.onSubmit, s));
128
128
  }
129
- function X() {
129
+ function Z() {
130
130
  var e, t;
131
- n.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), L(n.onReset);
131
+ n.customReset || (t = (e = g.value) == null ? void 0 : e.resetFields) == null || t.call(e), W(n.onReset);
132
132
  }
133
- let v = [];
134
- const B = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / n.countPerRow));
135
- j(() => s.default(), (e) => {
136
- v = B.value, B.value = ge(v, D(e));
137
- }), j(() => {
133
+ let N = [];
134
+ const R = M(L(c.default())), d = M((I = c.extra) == null ? void 0 : I.call(c)), k = S(() => Math.floor(r / n.countPerRow));
135
+ D(() => c.default(), (e) => {
136
+ N = R.value, R.value = Se(N, L(e));
137
+ }), D(() => {
138
138
  var e;
139
- return (e = s.extra) == null ? void 0 : e.call(s);
139
+ return (e = c.extra) == null ? void 0 : e.call(c);
140
140
  }, (e) => {
141
- p.value = e;
141
+ d.value = e;
142
142
  });
143
- const Y = (e) => $(e) ? (xe(e) ? e : [e]).join("") : Date.now(), R = g(() => {
144
- const e = B.value, t = [], l = [], r = o(w);
145
- let d = 0;
146
- e.forEach((c) => {
147
- const f = c.props;
148
- (ye(f.hidden) ? !!f.hidden : $(f.hidden)) ? t.push(c) : (d += f.span || r, l.push(c));
143
+ const ee = (e) => U(e) ? (Ce(e) ? e : [e]).join("") : Date.now(), A = S(() => {
144
+ const e = R.value, t = [], s = [], l = o(k);
145
+ let i = 0;
146
+ e.forEach((p) => {
147
+ const f = p.props;
148
+ if (ge(f.hidden) ? !!f.hidden : U(f.hidden))
149
+ t.push(p);
150
+ else {
151
+ const y = r - i % r, _ = f.span || l;
152
+ y >= _ ? i += _ : i += _ + y, s.push(p);
153
+ }
149
154
  });
150
- const k = i - (d + r) % i, ee = d % i < r, te = k < r ? i : k, I = i - r * (o(p) && !n.extraInAction ? 2 : 1), oe = !n.forceExpand && d > I;
151
- let P = 0, T = 0;
152
- const ae = l.map((c, f) => {
153
- const x = c.props, O = x.span || r;
154
- if (P += O, !n.forceExpand && o(u) && P > I) {
155
- t.push(ue(c, {
155
+ const P = r - i % r;
156
+ P < l && (i += P);
157
+ const T = r - (i + l) % r, oe = i % r < l, ae = T < l ? r : T, O = r - l * (o(d) && !n.extraInAction ? 2 : 1), ne = !n.forceExpand && i > O;
158
+ let V = 0, j = 0;
159
+ const le = s.map((p, f) => {
160
+ const x = p.props, y = x.span || l;
161
+ if (V += y, !n.forceExpand && o(u) && V > O) {
162
+ t.push(pe(p, {
156
163
  class: "ant-form-item-hidden",
157
164
  hidden: !0
158
165
  }));
159
166
  return;
160
167
  }
161
- return T += O, {
162
- node: c,
163
- span: x.span || r,
164
- key: `ApFormSearchFormItem-${f}-${Y(x.name)}-${x._signal}`
168
+ return j += y, {
169
+ node: p,
170
+ span: x.span || l,
171
+ key: `ApFormSearchFormItem-${f}-${ee(x.name)}-${x._signal}`
165
172
  };
166
- }).filter(Boolean), ne = i - T - r;
173
+ }).filter(Boolean), re = r - j - l;
167
174
  return {
168
- hideNode: a(_, null, [t]),
169
- nodes: ae,
170
- defaultExtraSpan: te,
171
- actualExtraSpan: ne,
172
- showCollapse: oe,
173
- lastRowOnlyIncludeActionAndExtra: ee
175
+ hideNode: a(F, null, [t]),
176
+ nodes: le,
177
+ defaultExtraSpan: ae,
178
+ actualExtraSpan: re,
179
+ showCollapse: ne,
180
+ lastRowOnlyIncludeActionAndExtra: oe
174
181
  };
175
- }), Z = g(() => {
182
+ }), te = S(() => {
176
183
  let e;
177
- const t = o(R), l = a(F, {
178
- span: o(w),
184
+ const t = o(A), s = a(B, {
185
+ span: o(k),
179
186
  key: "actionWrapper"
180
187
  }, {
181
- default: () => [a(U, null, {
182
- default: () => [a(M, {
183
- justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) && n.extraInAction) ? "flex-end" : "space-between"
188
+ default: () => [a(q, null, {
189
+ default: () => [a($, {
190
+ justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(d) && n.extraInAction) ? "flex-end" : "space-between"
184
191
  }, {
185
- default: () => [a(fe, null, {
186
- default: () => [a(E, {
192
+ default: () => [a(he, null, {
193
+ default: () => [a(v, {
187
194
  type: "primary",
188
- onClick: Q,
195
+ onClick: Y,
189
196
  loading: n.submitLoading,
190
197
  htmlType: "submit"
191
198
  }, {
192
- default: () => [n.searchText || b("ap.apForm.search.search")]
193
- }), a(E, {
194
- onClick: X
199
+ default: () => [n.searchText || w("ap.apForm.search.search")]
200
+ }), a(v, {
201
+ onClick: Z
195
202
  }, {
196
- default: () => [n.resetText || b("ap.apForm.search.reset")]
197
- }), t.showCollapse ? a(E, {
198
- onClick: K,
199
- icon: a(he, {
200
- style: J.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
203
+ default: () => [n.resetText || w("ap.apForm.search.reset")]
204
+ }), t.showCollapse ? a(v, {
205
+ onClick: X,
206
+ icon: a(ye, {
207
+ style: Q.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
201
208
  rotate: o(u) ? 90 : -90
202
209
  }, null)
203
210
  }, null) : null]
204
- }), n.extraInAction ? o(p) : null]
211
+ }), n.extraInAction ? o(d) : null]
205
212
  })]
206
213
  })]
207
- }), r = !n.extraInAction && o(p) ? a(F, {
214
+ }), l = !n.extraInAction && o(d) ? a(B, {
208
215
  span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
209
216
  key: "extraNode"
210
217
  }, {
211
- default: () => [a(U, null, {
212
- default: () => [a(M, {
213
- justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
214
- }, Ae(e = o(p)) ? e : {
218
+ default: () => [a(q, null, {
219
+ default: () => [a($, {
220
+ justify: !o(u) && (t.defaultExtraSpan === r || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
221
+ }, be(e = o(d)) ? e : {
215
222
  default: () => [e]
216
223
  })]
217
224
  })]
218
- }) : null, d = a(F, {
225
+ }) : null, i = a(B, {
219
226
  span: t.defaultExtraSpan
220
227
  }, null);
221
- return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? a(_, null, [r || d, l]) : a(_, null, [l, r]);
228
+ return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? a(F, null, [l || i, s]) : a(F, null, [s, l]);
222
229
  });
223
- return W({
224
- apForm: g(() => o(C))
225
- }), (e, t) => (m(), y(Se, ce({
230
+ return z({
231
+ apForm: S(() => o(g))
232
+ }), (e, t) => (m(), C(Ee, de({
226
233
  ref_key: "apForm",
227
- ref: C,
228
- class: o(G)()
229
- }, o(Ce)(n, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
230
- default: S(() => [(m(), y(A(R.value.hideNode))), a(o(me), {
234
+ ref: g,
235
+ class: o(K)()
236
+ }, o(_e)(n, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
237
+ default: E(() => [(m(), C(b(A.value.hideNode))), a(o(xe), {
231
238
  gutter: 16
232
239
  }, {
233
- default: S(() => [(m(!0), pe(_, null, de(R.value.nodes, (l) => (m(), y(o(F), {
234
- key: l.key,
235
- span: l.span
240
+ default: E(() => [(m(!0), fe(F, null, me(A.value.nodes, (s) => (m(), C(o(B), {
241
+ key: s.key,
242
+ span: s.span
236
243
  }, {
237
- default: S(() => [(m(), y(A(l.node)))]),
244
+ default: E(() => [(m(), C(b(s.node)))]),
238
245
  _: 2
239
- }, 1032, ["span"]))), 128)), (m(), y(A(Z.value)))]),
246
+ }, 1032, ["span"]))), 128)), (m(), C(b(te.value)))]),
240
247
  _: 1
241
248
  })]),
242
249
  _: 1
@@ -244,5 +251,5 @@ const i = 24, qe = /* @__PURE__ */ re({
244
251
  }
245
252
  });
246
253
  export {
247
- qe as default
254
+ ze as default
248
255
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as n, openBlock as o, createBlock as t, resolveDynamicComponent as r } from "vue";
2
- const s = /* @__PURE__ */ n({
1
+ import { defineComponent as t, openBlock as n, createElementBlock as o, Fragment as r, createBlock as a, resolveDynamicComponent as s, createTextVNode as c, toDisplayString as m } from "vue";
2
+ const u = /* @__PURE__ */ t({
3
3
  name: "ApTableDynamicComponent",
4
4
  inheritAttrs: !1,
5
5
  __name: "index",
@@ -7,9 +7,12 @@ const s = /* @__PURE__ */ n({
7
7
  customRender: { type: Function }
8
8
  },
9
9
  setup(p) {
10
- return (e, a) => (o(), t(r(e.customRender(e.$attrs))));
10
+ return (e, l) => (n(), o(r, null, [
11
+ (n(), a(s(e.customRender(e.$attrs)))),
12
+ c(" " + m(console.log(e.$attrs)), 1)
13
+ ], 64));
11
14
  }
12
15
  });
13
16
  export {
14
- s as default
17
+ u as default
15
18
  };
@@ -1010,7 +1010,10 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
1010
1010
  };
1011
1011
  parser: {
1012
1012
  type: PropType<(displayValue: string) => ValueType>;
1013
- default: (displayValue: string) => ValueType;
1013
+ default: (displayValue: string) => **
1014
+ * 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
1015
+ * 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
1016
+ */).ValueType;
1014
1017
  };
1015
1018
  formatter: {
1016
1019
  type: PropType<(value: ValueType, info: {
@@ -1,6 +1,6 @@
1
1
  import { isVNode as E, createVNode as l, mergeProps as y, cloneVNode as j, Fragment as O } from "vue";
2
2
  import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as m, every as I, isEmpty as v } from "lodash-unified";
3
- import { apTableRenderItemMap as P, apTableFormItemMap as V } from "./constants.mjs";
3
+ import { apTableRenderItemMap as V, apTableFormItemMap as P } from "./constants.mjs";
4
4
  import { isType as _ } from "@fruits-chain/utils";
5
5
  import "../ap-form/index.mjs";
6
6
  import { Tooltip as w } from "@aplus-frontend/antdv";
@@ -12,10 +12,10 @@ function R(t) {
12
12
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
13
13
  }
14
14
  const q = (t, e, n) => {
15
- let o = {};
15
+ let r = {};
16
16
  return a(t) ? Object.keys(t).forEach((i) => {
17
- a(t[i]) ? o[i] = q(t[i], e[i], n) : o[i] = n(t[i], e);
18
- }) : o = n(t, e), o;
17
+ a(t[i]) ? r[i] = q(t[i], e[i], n) : r[i] = n(t[i], e);
18
+ }) : r = n(t, e), r;
19
19
  }, k = (t, e) => {
20
20
  switch (t) {
21
21
  case "dayjs":
@@ -23,8 +23,8 @@ const q = (t, e, n) => {
23
23
  case "dayjsRange":
24
24
  return e.map((n) => n.valueOf());
25
25
  case "dayjsDayRange": {
26
- const [n, o] = e;
27
- return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
26
+ const [n, r] = e;
27
+ return [n.startOf("day").valueOf(), r.endOf("day").valueOf()];
28
28
  }
29
29
  case "multiple":
30
30
  case "multipleNumber":
@@ -46,21 +46,21 @@ function W(t) {
46
46
  }
47
47
  const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})), b = (t) => {
48
48
  const e = [], n = $(t);
49
- return n.forEach((o, i) => {
50
- const r = n.get(i) || n.get(`${i}`);
51
- if (r) {
52
- if (typeof r == "object" && (r != null && r.text)) {
49
+ return n.forEach((r, i) => {
50
+ const o = n.get(i) || n.get(`${i}`);
51
+ if (o) {
52
+ if (typeof o == "object" && (o != null && o.text)) {
53
53
  e.push({
54
- text: r == null ? void 0 : r.text,
54
+ text: o == null ? void 0 : o.text,
55
55
  value: i,
56
- label: r == null ? void 0 : r.text,
57
- disabled: r.disabled
56
+ label: o == null ? void 0 : o.text,
57
+ disabled: o.disabled
58
58
  });
59
59
  return;
60
60
  }
61
61
  e.push({
62
- text: r,
63
- label: r,
62
+ text: o,
63
+ label: o,
64
64
  value: i
65
65
  });
66
66
  }
@@ -73,42 +73,45 @@ function tt(t) {
73
73
  let e = t.valueType || "text";
74
74
  return t.valueEnum && (e = "status"), e;
75
75
  }
76
- function et(t, e, n, o) {
77
- var u;
78
- const i = P[t];
76
+ function et(t, e, n, r) {
77
+ var s;
78
+ const i = V[t];
79
79
  if (i)
80
80
  return l(i, y(e, {
81
81
  mode: "read"
82
82
  }), null);
83
- const r = o == null ? void 0 : o[t];
84
- return ((u = r == null ? void 0 : r.render) == null ? void 0 : u.call(r, e.value, n, e)) || e.value;
83
+ const o = r == null ? void 0 : r[t];
84
+ return ((s = o == null ? void 0 : o.render) == null ? void 0 : s.call(o, e.value, n, e)) || e.value;
85
85
  }
86
86
  function nt(t, e) {
87
87
  if (t.customRenderFormItem)
88
88
  return {
89
89
  Comp: d,
90
- render: function(u) {
91
- const s = u.item.customRenderFormItem(u.item);
92
- return j(s, {
93
- ...u.item.fieldProps,
94
- span: u.item.span,
95
- ...s.props || {}
90
+ render: function(s) {
91
+ const u = s.item.customRenderFormItem(s.item);
92
+ return j(u, {
93
+ ...s.item.fieldProps,
94
+ span: s.item.span,
95
+ ...u.props || {},
96
+ // 需要额外设置的属性(用于显示和隐藏节点)
97
+ hidden: s.hidden,
98
+ class: s.class
96
99
  });
97
100
  }
98
101
  };
99
- const n = V[t.valueType];
102
+ const n = P[t.valueType];
100
103
  if (n)
101
104
  return {
102
105
  Comp: n
103
106
  };
104
- const o = e == null ? void 0 : e[t.valueType];
105
- function i(r) {
106
- var s;
107
- const u = (s = o == null ? void 0 : o.renderFormItem) == null ? void 0 : s.call(o, r.item.fieldProps.field);
108
- return u ? l(A, y(r.item.fieldProps, {
109
- span: r.item.fieldProps
110
- }), R(u) ? u : {
111
- default: () => [u]
107
+ const r = e == null ? void 0 : e[t.valueType];
108
+ function i(o) {
109
+ var u;
110
+ const s = (u = r == null ? void 0 : r.renderFormItem) == null ? void 0 : u.call(r, o.item.fieldProps.field);
111
+ return s ? l(A, y(o.item.fieldProps, {
112
+ span: t.span
113
+ }), R(s) ? s : {
114
+ default: () => [s]
112
115
  }) : null;
113
116
  }
114
117
  return {
@@ -117,14 +120,14 @@ function nt(t, e) {
117
120
  };
118
121
  }
119
122
  function rt(t, e) {
120
- const n = B(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", r = t.valueType === "index", u = i ? {
123
+ const n = B(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", o = t.valueType === "index", s = i ? {
121
124
  checked: e.value
122
125
  } : {
123
- value: r ? e.index + 1 : e.value
126
+ value: o ? e.index + 1 : e.value
124
127
  };
125
- return t.valueEnum && (o.valueEnum = t.valueEnum), {
126
- ...C(o, ["request"]),
127
- ...u
128
+ return t.valueEnum && (r.valueEnum = t.valueEnum), {
129
+ ...C(r, ["request"]),
130
+ ...s
128
131
  };
129
132
  }
130
133
  function ot(t) {
@@ -134,14 +137,14 @@ function ot(t) {
134
137
  return F(t.filters) && t.filters && t.valueEnum && (e.filters = b(t.valueEnum)), e;
135
138
  }
136
139
  function it(t, e) {
137
- var o;
140
+ var r;
138
141
  const n = e || {};
139
- return t.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
142
+ return t.valueEnum && !((r = n.field) != null && r.options) && (n.field = {
140
143
  ...n.field,
141
144
  options: b(t.valueEnum)
142
145
  }), n;
143
146
  }
144
- function ut(t) {
147
+ function st(t) {
145
148
  if (!_("Object")(t))
146
149
  return t;
147
150
  try {
@@ -150,14 +153,14 @@ function ut(t) {
150
153
  return t;
151
154
  }
152
155
  }
153
- function st(t, e, n, o) {
156
+ function ut(t, e, n, r) {
154
157
  const i = n == null ? void 0 : n({
155
158
  title: t.title,
156
159
  column: t
157
- }), r = (i == null ? void 0 : i.filter((h) => h.type !== Symbol.for("v-cmt"))) || [];
158
- if (i && r.length > 0)
160
+ }), o = (i == null ? void 0 : i.filter((h) => h.type !== Symbol.for("v-cmt"))) || [];
161
+ if (i && o.length > 0)
159
162
  return i;
160
- const s = N(t.title) ? l("span", {
163
+ const u = N(t.title) ? l("span", {
161
164
  class: e,
162
165
  title: t.title
163
166
  }, [t.title]) : t.title, f = t.tooltip ? T(t.tooltip) ? t.tooltip(t) : l(O, null, [t.tooltip]) : null;
@@ -167,33 +170,33 @@ function st(t, e, n, o) {
167
170
  alignItems: "center",
168
171
  maxWidth: "100%"
169
172
  }
170
- }, [s, l(w, {
173
+ }, [u, l(w, {
171
174
  title: f,
172
175
  placement: "bottom"
173
176
  }, {
174
177
  default: () => [l(x, {
175
178
  style: {
176
179
  padding: "4px",
177
- color: o,
180
+ color: r,
178
181
  verticalAlign: "middle"
179
182
  }
180
183
  }, null)]
181
- })]) : s;
184
+ })]) : u;
182
185
  }
183
186
  function lt(t, e) {
184
187
  const n = [];
185
- function o(i) {
186
- var r;
187
- for (const u of i)
188
- (r = u.children) != null && r.length ? o(u.children) : n.push(e(u));
188
+ function r(i) {
189
+ var o;
190
+ for (const s of i)
191
+ (o = s.children) != null && o.length ? r(s.children) : n.push(e(s));
189
192
  }
190
- return o(t), n;
193
+ return r(t), n;
191
194
  }
192
195
  function ct(t, e) {
193
196
  if (c(t) && c(e))
194
197
  return S(p(t), p(e));
195
198
  if (m(t) && m(e)) {
196
- const n = (o) => I(o, (i) => i == null) || v(o);
199
+ const n = (r) => I(r, (i) => i == null) || v(r);
197
200
  if (n(t) && n(e))
198
201
  return !0;
199
202
  }
@@ -213,10 +216,10 @@ export {
213
216
  et as getTableCellRenderNode,
214
217
  rt as getTableRenderProps,
215
218
  tt as getTableRenderType,
216
- st as getTableTitle,
219
+ ut as getTableTitle,
217
220
  ct as isEqualCustom,
218
221
  $ as objectToMap,
219
- ut as objectToString,
222
+ st as objectToString,
220
223
  k as parseFieldValue,
221
224
  lt as recursionApColumns,
222
225
  it as updateFormProps,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");require("../../hooks/index.js");const w=require("../item-group/helper.js"),K=require("@ant-design/icons-vue");require("../../config-provider/index.js");const _=require("lodash-unified"),A=require("../../utils/index.js"),g=require("./utils.js"),Q=require("../../hooks/useControllableValue.js"),X=require("../../config-provider/hooks/use-namespace.js"),Y=require("../../config-provider/hooks/use-global-config.js"),Z=require("../../config-provider/hooks/use-locale.js"),q=require("../item/index.vue.js"),ee=require("../ap-form.vue2.js");function te(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!e.isVNode(m)}const s=24,ne=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!1},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean}},emits:["update:collapse"],setup(m,{expose:E,emit:I}){var v;const u=e.useSlots(),o=m,P=I,{value:c,updateValue:T}=Q.useControllableValue(o,P,{valuePropName:"collapse",defaultValuePropName:"defaultCollapse"}),{b:O}=X.useNamespace("ap-form-search-form"),D=Y.useGlobalConfig("uiMode"),{t:B}=Z.useLocale(),x=e.ref();function M(){T(!e.unref(c))}function j(){var t,n;(n=(t=x.value)==null?void 0:t.validateFields())==null||n.then(a=>g.execFunc(o.onSubmit,a))}function L(){var t,n;o.customReset||(n=(t=x.value)==null?void 0:t.resetFields)==null||n.call(t),g.execFunc(o.onReset)}let N=[];const y=e.shallowRef(w.genRealChildren(u.default())),d=e.shallowRef((v=u.extra)==null?void 0:v.call(u)),F=e.computed(()=>Math.floor(s/o.countPerRow));e.watch(()=>u.default(),t=>{N=y.value,y.value=g.diffFormItem(N,w.genRealChildren(t))}),e.watch(()=>{var t;return(t=u.extra)==null?void 0:t.call(u)},t=>{d.value=t});const U=t=>A.isDef(t)?(_.isArray(t)?t:[t]).join(""):Date.now(),C=e.computed(()=>{const t=y.value,n=[],a=[],l=e.unref(F);let p=0;t.forEach(i=>{const f=i.props;(_.isBoolean(f.hidden)?!!f.hidden:A.isDef(f.hidden))?n.push(i):(p+=f.span||l,a.push(i))});const R=s-(p+l)%s,$=p%s<l,z=R<l?s:R,S=s-l*(e.unref(d)&&!o.extraInAction?2:1),G=!o.forceExpand&&p>S;let V=0,k=0;const H=a.map((i,f)=>{const h=i.props,b=h.span||l;if(V+=b,!o.forceExpand&&e.unref(c)&&V>S){n.push(e.cloneVNode(i,{class:"ant-form-item-hidden",hidden:!0}));return}return k+=b,{node:i,span:h.span||l,key:`ApFormSearchFormItem-${f}-${U(h.name)}-${h._signal}`}}).filter(Boolean),J=s-k-l;return{hideNode:e.createVNode(e.Fragment,null,[n]),nodes:H,defaultExtraSpan:z,actualExtraSpan:J,showCollapse:G,lastRowOnlyIncludeActionAndExtra:$}}),W=e.computed(()=>{let t;const n=e.unref(C),a=e.createVNode(r.Col,{span:e.unref(F),key:"actionWrapper"},{default:()=>[e.createVNode(q.default,null,{default:()=>[e.createVNode(r.Flex,{justify:!e.unref(c)&&n.lastRowOnlyIncludeActionAndExtra&&!(e.unref(d)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(r.Space,null,{default:()=>[e.createVNode(r.Button,{type:"primary",onClick:j,loading:o.submitLoading,htmlType:"submit"},{default:()=>[o.searchText||B("ap.apForm.search.search")]}),e.createVNode(r.Button,{onClick:L},{default:()=>[o.resetText||B("ap.apForm.search.reset")]}),n.showCollapse?e.createVNode(r.Button,{onClick:M,icon:e.createVNode(K.DoubleRightOutlined,{style:D.value==="aplus"?"color:#B8C3D1":"color:#BFBFBF",rotate:e.unref(c)?90:-90},null)},null):null]}),o.extraInAction?e.unref(d):null]})]})]}),l=!o.extraInAction&&e.unref(d)?e.createVNode(r.Col,{span:e.unref(c)?n.actualExtraSpan:n.defaultExtraSpan,key:"extraNode"},{default:()=>[e.createVNode(q.default,null,{default:()=>[e.createVNode(r.Flex,{justify:!e.unref(c)&&(n.defaultExtraSpan===s||n.lastRowOnlyIncludeActionAndExtra)?"start":"flex-end"},te(t=e.unref(d))?t:{default:()=>[t]})]})]}):null,p=e.createVNode(r.Col,{span:n.defaultExtraSpan},null);return!e.unref(c)&&n.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[l||p,a]):e.createVNode(e.Fragment,null,[a,l])});return E({apForm:e.computed(()=>e.unref(x))}),(t,n)=>(e.openBlock(),e.createBlock(ee.default,e.mergeProps({ref_key:"apForm",ref:x,class:e.unref(O)()},e.unref(_.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value.hideNode))),e.createVNode(e.unref(r.Row),{gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value.nodes,a=>(e.openBlock(),e.createBlock(e.unref(r.Col),{key:a.key,span:a.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=ne;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");require("../../hooks/index.js");const q=require("../item-group/helper.js"),X=require("@ant-design/icons-vue");require("../../config-provider/index.js");const B=require("lodash-unified"),E=require("../../utils/index.js"),N=require("./utils.js"),Y=require("../../hooks/useControllableValue.js"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-global-config.js"),te=require("../../config-provider/hooks/use-locale.js"),I=require("../item/index.vue.js"),ne=require("../ap-form.vue2.js");function oe(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!e.isVNode(m)}const l=24,ae=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!1},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean}},emits:["update:collapse"],setup(m,{expose:P,emit:T}){var R;const c=e.useSlots(),o=m,O=T,{value:i,updateValue:D}=Y.useControllableValue(o,O,{valuePropName:"collapse",defaultValuePropName:"defaultCollapse"}),{b:M}=Z.useNamespace("ap-form-search-form"),j=ee.useGlobalConfig("uiMode"),{t:F}=te.useLocale(),y=e.ref();function L(){D(!e.unref(i))}function U(){var t,n;(n=(t=y.value)==null?void 0:t.validateFields())==null||n.then(r=>N.execFunc(o.onSubmit,r))}function W(){var t,n;o.customReset||(n=(t=y.value)==null?void 0:t.resetFields)==null||n.call(t),N.execFunc(o.onReset)}let v=[];const _=e.shallowRef(q.genRealChildren(c.default())),p=e.shallowRef((R=c.extra)==null?void 0:R.call(c)),S=e.computed(()=>Math.floor(l/o.countPerRow));e.watch(()=>c.default(),t=>{v=_.value,_.value=N.diffFormItem(v,q.genRealChildren(t))}),e.watch(()=>{var t;return(t=c.extra)==null?void 0:t.call(c)},t=>{p.value=t});const $=t=>E.isDef(t)?(B.isArray(t)?t:[t]).join(""):Date.now(),g=e.computed(()=>{const t=_.value,n=[],r=[],a=e.unref(S);let s=0;t.forEach(d=>{const f=d.props;if(B.isBoolean(f.hidden)?!!f.hidden:E.isDef(f.hidden))n.push(d);else{const x=l-s%l,C=f.span||a;x>=C?s+=C:s+=C+x,r.push(d)}});const V=l-s%l;V<a&&(s+=V);const k=l-(s+a)%l,G=s%l<a,H=k<a?l:k,b=l-a*(e.unref(p)&&!o.extraInAction?2:1),J=!o.forceExpand&&s>b;let w=0,A=0;const K=r.map((d,f)=>{const h=d.props,x=h.span||a;if(w+=x,!o.forceExpand&&e.unref(i)&&w>b){n.push(e.cloneVNode(d,{class:"ant-form-item-hidden",hidden:!0}));return}return A+=x,{node:d,span:h.span||a,key:`ApFormSearchFormItem-${f}-${$(h.name)}-${h._signal}`}}).filter(Boolean),Q=l-A-a;return{hideNode:e.createVNode(e.Fragment,null,[n]),nodes:K,defaultExtraSpan:H,actualExtraSpan:Q,showCollapse:J,lastRowOnlyIncludeActionAndExtra:G}}),z=e.computed(()=>{let t;const n=e.unref(g),r=e.createVNode(u.Col,{span:e.unref(S),key:"actionWrapper"},{default:()=>[e.createVNode(I.default,null,{default:()=>[e.createVNode(u.Flex,{justify:!e.unref(i)&&n.lastRowOnlyIncludeActionAndExtra&&!(e.unref(p)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(u.Space,null,{default:()=>[e.createVNode(u.Button,{type:"primary",onClick:U,loading:o.submitLoading,htmlType:"submit"},{default:()=>[o.searchText||F("ap.apForm.search.search")]}),e.createVNode(u.Button,{onClick:W},{default:()=>[o.resetText||F("ap.apForm.search.reset")]}),n.showCollapse?e.createVNode(u.Button,{onClick:L,icon:e.createVNode(X.DoubleRightOutlined,{style:j.value==="aplus"?"color:#B8C3D1":"color:#BFBFBF",rotate:e.unref(i)?90:-90},null)},null):null]}),o.extraInAction?e.unref(p):null]})]})]}),a=!o.extraInAction&&e.unref(p)?e.createVNode(u.Col,{span:e.unref(i)?n.actualExtraSpan:n.defaultExtraSpan,key:"extraNode"},{default:()=>[e.createVNode(I.default,null,{default:()=>[e.createVNode(u.Flex,{justify:!e.unref(i)&&(n.defaultExtraSpan===l||n.lastRowOnlyIncludeActionAndExtra)?"start":"flex-end"},oe(t=e.unref(p))?t:{default:()=>[t]})]})]}):null,s=e.createVNode(u.Col,{span:n.defaultExtraSpan},null);return!e.unref(i)&&n.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[a||s,r]):e.createVNode(e.Fragment,null,[r,a])});return P({apForm:e.computed(()=>e.unref(y))}),(t,n)=>(e.openBlock(),e.createBlock(ne.default,e.mergeProps({ref_key:"apForm",ref:y,class:e.unref(M)()},e.unref(B.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value.hideNode))),e.createVNode(e.unref(u.Row),{gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.nodes,r=>(e.openBlock(),e.createBlock(e.unref(u.Col),{key:r.key,span:r.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(z.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=ae;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=e.defineComponent({name:"ApTableDynamicComponent",inheritAttrs:!1,__name:"index",props:{customRender:{type:Function}},setup(o){return(n,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.customRender(n.$attrs))))}});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=e.defineComponent({name:"ApTableDynamicComponent",inheritAttrs:!1,__name:"index",props:{customRender:{type:Function}},setup(o){return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customRender(t.$attrs)))),e.createTextVNode(" "+e.toDisplayString(console.log(t.$attrs)),1)],64))}});exports.default=n;
@@ -1010,7 +1010,10 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
1010
1010
  };
1011
1011
  parser: {
1012
1012
  type: PropType<(displayValue: string) => ValueType>;
1013
- default: (displayValue: string) => ValueType;
1013
+ default: (displayValue: string) => **
1014
+ * 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
1015
+ * 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
1016
+ */).ValueType;
1014
1017
  };
1015
1018
  formatter: {
1016
1019
  type: PropType<(value: ValueType, info: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),s=require("lodash-unified"),p=require("./constants.js"),g=require("@fruits-chain/utils");require("../ap-form/index.js");const j=require("@aplus-frontend/antdv"),O=require("@ant-design/icons-vue");require("./components/dynamic-component/index.vue.js");const f=require("./components/dynamic-component/index.vue2.js"),h=require("../ap-form/item/index.vue.js");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const m=(e,t,n)=>{let o={};return s.isObject(e)?Object.keys(e).forEach(i=>{s.isObject(e[i])?o[i]=m(e[i],t[i],n):o[i]=n(e[i],t)}):o=n(e,t),o},N=(e,t)=>{switch(e){case"dayjs":return t.valueOf();case"dayjsRange":return t.map(n=>n.valueOf());case"dayjsDayRange":{const[n,o]=t;return[n.startOf("day").valueOf(),o.endOf("day").valueOf()]}case"multiple":case"multipleNumber":return s.isArray(t)?t:[t];case"boolean":return t;case"object":return t;default:return t}};function C(e){return s.isArray(e)?e.join("."):e}function F(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const y=e=>F(e)==="map"?e:new Map(Object.entries(e||{})),a=e=>{const t=[],n=y(e);return n.forEach((o,i)=>{const r=n.get(i)||n.get(`${i}`);if(r){if(typeof r=="object"&&(r!=null&&r.text)){t.push({text:r==null?void 0:r.text,value:i,label:r==null?void 0:r.text,disabled:r.disabled});return}t.push({text:r,label:r,value:i})}}),t},_=e=>s.isUndefined(e)||e<0?0:e;function T(e,t){return!e||!s.isFunction(e)?e:e(t)}function v(e){let t=e.valueType||"text";return e.valueEnum&&(t="status"),t}function S(e,t,n,o){var u;const i=p.apTableRenderItemMap[e];if(i)return l.createVNode(i,l.mergeProps(t,{mode:"read"}),null);const r=o==null?void 0:o[e];return((u=r==null?void 0:r.render)==null?void 0:u.call(r,t.value,n,t))||t.value}function V(e,t){if(e.customRenderFormItem){let r=function(u){const c=u.item.customRenderFormItem(u.item);return l.cloneVNode(c,{...u.item.fieldProps,span:u.item.span,...c.props||{}})};return{Comp:f.default,render:r}}const n=p.apTableFormItemMap[e.valueType];if(n)return{Comp:n};const o=t==null?void 0:t[e.valueType];function i(r){var c;const u=(c=o==null?void 0:o.renderFormItem)==null?void 0:c.call(o,r.item.fieldProps.field);return u?l.createVNode(h.default,l.mergeProps(r.item.fieldProps,{span:r.item.fieldProps}),E(u)?u:{default:()=>[u]}):null}return{Comp:f.default,render:i}}function q(e,t){const n=T(e.fieldProps,t),o=(n==null?void 0:n.field)||n||{},i=e.valueType==="switch",r=e.valueType==="index",u=i?{checked:t.value}:{value:r?t.index+1:t.value};return e.valueEnum&&(o.valueEnum=e.valueEnum),{...s.omit(o,["request"]),...u}}function P(e){const t={...e};return s.isBoolean(e.filters)&&e.filters&&e.valueEnum&&(t.filters=a(e.valueEnum)),t}function I(e,t){var o;const n=t||{};return e.valueEnum&&!((o=n.field)!=null&&o.options)&&(n.field={...n.field,options:a(e.valueEnum)}),n}function A(e){if(!g.isType("Object")(e))return e;try{return JSON.stringify(e)}catch{return e}}function x(e,t,n,o){const i=n==null?void 0:n({title:e.title,column:e}),r=(i==null?void 0:i.filter(b=>b.type!==Symbol.for("v-cmt")))||[];if(i&&r.length>0)return i;const c=s.isString(e.title)?l.createVNode("span",{class:t,title:e.title},[e.title]):e.title,d=e.tooltip?s.isFunction(e.tooltip)?e.tooltip(e):l.createVNode(l.Fragment,null,[e.tooltip]):null;return d?l.createVNode("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"}},[c,l.createVNode(j.Tooltip,{title:d,placement:"bottom"},{default:()=>[l.createVNode(O.QuestionCircleOutlined,{style:{padding:"4px",color:o,verticalAlign:"middle"}},null)]})]):c}function R(e,t){const n=[];function o(i){var r;for(const u of i)(r=u.children)!=null&&r.length?o(u.children):n.push(t(u))}return o(e),n}function w(e,t){if(s.isArray(e)&&s.isArray(t))return s.isEqual(s.sortBy(e),s.sortBy(t));if(s.isPlainObject(e)&&s.isPlainObject(t)){const n=o=>s.every(o,i=>i==null)||s.isEmpty(o);if(n(e)&&n(t))return!0}}function U(e){if(e!==!1)return e}exports.apColumnToColumn=P;exports.dataIndexToStr=C;exports.falseToUndefined=U;exports.formatParamsValueType=m;exports.getColumnOrder=_;exports.getFieldProps=T;exports.getSearchFormItemRenderNode=V;exports.getTableCellRenderNode=S;exports.getTableRenderProps=q;exports.getTableRenderType=v;exports.getTableTitle=x;exports.isEqualCustom=w;exports.objectToMap=y;exports.objectToString=A;exports.parseFieldValue=N;exports.recursionApColumns=R;exports.updateFormProps=I;exports.valueEnumToArray=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),s=require("lodash-unified"),p=require("./constants.js"),g=require("@fruits-chain/utils");require("../ap-form/index.js");const h=require("@aplus-frontend/antdv"),j=require("@ant-design/icons-vue");require("./components/dynamic-component/index.vue.js");const f=require("./components/dynamic-component/index.vue2.js"),O=require("../ap-form/item/index.vue.js");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const m=(e,t,n)=>{let o={};return s.isObject(e)?Object.keys(e).forEach(i=>{s.isObject(e[i])?o[i]=m(e[i],t[i],n):o[i]=n(e[i],t)}):o=n(e,t),o},N=(e,t)=>{switch(e){case"dayjs":return t.valueOf();case"dayjsRange":return t.map(n=>n.valueOf());case"dayjsDayRange":{const[n,o]=t;return[n.startOf("day").valueOf(),o.endOf("day").valueOf()]}case"multiple":case"multipleNumber":return s.isArray(t)?t:[t];case"boolean":return t;case"object":return t;default:return t}};function C(e){return s.isArray(e)?e.join("."):e}function F(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const y=e=>F(e)==="map"?e:new Map(Object.entries(e||{})),a=e=>{const t=[],n=y(e);return n.forEach((o,i)=>{const r=n.get(i)||n.get(`${i}`);if(r){if(typeof r=="object"&&(r!=null&&r.text)){t.push({text:r==null?void 0:r.text,value:i,label:r==null?void 0:r.text,disabled:r.disabled});return}t.push({text:r,label:r,value:i})}}),t},_=e=>s.isUndefined(e)||e<0?0:e;function T(e,t){return!e||!s.isFunction(e)?e:e(t)}function v(e){let t=e.valueType||"text";return e.valueEnum&&(t="status"),t}function S(e,t,n,o){var u;const i=p.apTableRenderItemMap[e];if(i)return l.createVNode(i,l.mergeProps(t,{mode:"read"}),null);const r=o==null?void 0:o[e];return((u=r==null?void 0:r.render)==null?void 0:u.call(r,t.value,n,t))||t.value}function V(e,t){if(e.customRenderFormItem){let r=function(u){const c=u.item.customRenderFormItem(u.item);return l.cloneVNode(c,{...u.item.fieldProps,span:u.item.span,...c.props||{},hidden:u.hidden,class:u.class})};return{Comp:f.default,render:r}}const n=p.apTableFormItemMap[e.valueType];if(n)return{Comp:n};const o=t==null?void 0:t[e.valueType];function i(r){var c;const u=(c=o==null?void 0:o.renderFormItem)==null?void 0:c.call(o,r.item.fieldProps.field);return u?l.createVNode(O.default,l.mergeProps(r.item.fieldProps,{span:e.span}),E(u)?u:{default:()=>[u]}):null}return{Comp:f.default,render:i}}function q(e,t){const n=T(e.fieldProps,t),o=(n==null?void 0:n.field)||n||{},i=e.valueType==="switch",r=e.valueType==="index",u=i?{checked:t.value}:{value:r?t.index+1:t.value};return e.valueEnum&&(o.valueEnum=e.valueEnum),{...s.omit(o,["request"]),...u}}function P(e){const t={...e};return s.isBoolean(e.filters)&&e.filters&&e.valueEnum&&(t.filters=a(e.valueEnum)),t}function I(e,t){var o;const n=t||{};return e.valueEnum&&!((o=n.field)!=null&&o.options)&&(n.field={...n.field,options:a(e.valueEnum)}),n}function A(e){if(!g.isType("Object")(e))return e;try{return JSON.stringify(e)}catch{return e}}function x(e,t,n,o){const i=n==null?void 0:n({title:e.title,column:e}),r=(i==null?void 0:i.filter(b=>b.type!==Symbol.for("v-cmt")))||[];if(i&&r.length>0)return i;const c=s.isString(e.title)?l.createVNode("span",{class:t,title:e.title},[e.title]):e.title,d=e.tooltip?s.isFunction(e.tooltip)?e.tooltip(e):l.createVNode(l.Fragment,null,[e.tooltip]):null;return d?l.createVNode("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"}},[c,l.createVNode(h.Tooltip,{title:d,placement:"bottom"},{default:()=>[l.createVNode(j.QuestionCircleOutlined,{style:{padding:"4px",color:o,verticalAlign:"middle"}},null)]})]):c}function R(e,t){const n=[];function o(i){var r;for(const u of i)(r=u.children)!=null&&r.length?o(u.children):n.push(t(u))}return o(e),n}function w(e,t){if(s.isArray(e)&&s.isArray(t))return s.isEqual(s.sortBy(e),s.sortBy(t));if(s.isPlainObject(e)&&s.isPlainObject(t)){const n=o=>s.every(o,i=>i==null)||s.isEmpty(o);if(n(e)&&n(t))return!0}}function U(e){if(e!==!1)return e}exports.apColumnToColumn=P;exports.dataIndexToStr=C;exports.falseToUndefined=U;exports.formatParamsValueType=m;exports.getColumnOrder=_;exports.getFieldProps=T;exports.getSearchFormItemRenderNode=V;exports.getTableCellRenderNode=S;exports.getTableRenderProps=q;exports.getTableRenderType=v;exports.getTableTitle=x;exports.isEqualCustom=w;exports.objectToMap=y;exports.objectToString=A;exports.parseFieldValue=N;exports.recursionApColumns=R;exports.updateFormProps=I;exports.valueEnumToArray=a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.4.26",
3
+ "version": "0.4.28",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -65,8 +65,8 @@
65
65
  "sortablejs": "^1.15.2",
66
66
  "vue-virtual-scroller": "2.0.0-beta.8",
67
67
  "vuedraggable": "^4.1.0",
68
- "@aplus-frontend/hooks": "1.0.7",
69
- "@aplus-frontend/utils": "1.0.50"
68
+ "@aplus-frontend/utils": "1.0.51",
69
+ "@aplus-frontend/hooks": "1.0.7"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@aplus-frontend/antdv": "^1.0.12",
@@ -798,7 +798,7 @@ div[class$='-basic-table-form-container ap-table--sticky'] form[class$='-basic-f
798
798
  [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container .'aplus'-scroll-bar {
799
799
  position: sticky;
800
800
  bottom: -1px;
801
- z-index: 99;
801
+ z-index: 90;
802
802
  }
803
803
  [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(ul.ant-pagination) .'aplus'-scroll-bar,
804
804
  [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(ul.ant-pagination) .'aplus'-scroll-bar,
@@ -845,3 +845,23 @@ div[class$='-basic-table-form-container ap-table--sticky'] form[class$='-basic-f
845
845
  padding: 16px 0;
846
846
  background-color: #ffffff;
847
847
  }
848
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
849
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
850
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
851
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
852
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
853
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
854
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
855
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
856
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
857
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
858
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
859
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
860
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
861
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
862
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
863
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
864
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
865
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination {
866
+ padding-top: 8px;
867
+ }
@@ -234,7 +234,7 @@
234
234
  [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container .'aplus'-scroll-bar {
235
235
  position: sticky;
236
236
  bottom: -1px;
237
- z-index: 99;
237
+ z-index: 90;
238
238
  }
239
239
  [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(ul.ant-pagination) .'aplus'-scroll-bar,
240
240
  [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(ul.ant-pagination) .'aplus'-scroll-bar,
@@ -281,3 +281,23 @@
281
281
  padding: 16px 0;
282
282
  background-color: #ffffff;
283
283
  }
284
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
285
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
286
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
287
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
288
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
289
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
290
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
291
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
292
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
293
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
294
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
295
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper:has(.'aplus'-scroll-bar) ul.ant-pagination,
296
+ [class*='-basic-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
297
+ [class*='-ap-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
298
+ [class*='-pro-table'].ap-table--sticky .aplus-ap-table__table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
299
+ [class*='-basic-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
300
+ [class*='-ap-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination,
301
+ [class*='-pro-table'].ap-table--sticky .ant-table-wrapper .ant-spin-container:has(.'aplus'-scroll-bar) ul.ant-pagination {
302
+ padding-top: 8px;
303
+ }
@@ -162,7 +162,7 @@
162
162
  .@{ns}-scroll-bar {
163
163
  position: sticky;
164
164
  bottom: -1px;
165
- z-index: 99;
165
+ z-index: 90;
166
166
  }
167
167
 
168
168
  &:has(ul.ant-pagination) {
@@ -179,6 +179,12 @@
179
179
  padding: 16px 0;
180
180
  background-color: #ffffff;
181
181
  }
182
+
183
+ &:has(.@{ns}-scroll-bar) {
184
+ ul.ant-pagination {
185
+ padding-top: 8px;
186
+ }
187
+ }
182
188
  }
183
189
  }
184
190
  }
@@ -432,6 +432,52 @@
432
432
  font-size: 14px;
433
433
  display: inline-flex;
434
434
  }
435
+ .aplus-scroll-bar {
436
+ position: relative;
437
+ }
438
+ .aplus-scroll-bar--horizontal {
439
+ width: 100%;
440
+ height: var(--aplus-scroll-bar-track-width, 10px);
441
+ }
442
+ .aplus-scroll-bar--vertical {
443
+ width: var(--aplus-scroll-bar-track-width, 10px);
444
+ height: 100%;
445
+ }
446
+ .aplus-scroll-bar__track {
447
+ position: absolute;
448
+ width: 100%;
449
+ height: 100%;
450
+ top: 0;
451
+ inset-inline-start: 0;
452
+ cursor: pointer;
453
+ background-color: var(--aplus-scroll-bar-track-color, rgba(0, 0, 0, 0.05));
454
+ }
455
+ .aplus-scroll-bar__track--disabled {
456
+ pointer-events: none;
457
+ background-color: rgba(0, 0, 0, 0.02);
458
+ }
459
+ .aplus-scroll-bar__track--hidden {
460
+ pointer-events: none;
461
+ background-color: transparent;
462
+ }
463
+ .aplus-scroll-bar__bar {
464
+ position: absolute;
465
+ border-radius: var(--aplus-scroll-bar-bar-width, 8px);
466
+ background-color: var(--aplus-scroll-bar-bar-color, #c7c8cc);
467
+ cursor: pointer;
468
+ }
469
+ .aplus-scroll-bar__bar--disabled {
470
+ pointer-events: none;
471
+ box-shadow: none;
472
+ }
473
+ .aplus-scroll-bar__bar--horizontal {
474
+ height: var(--aplus-scroll-bar-bar-width, 8px);
475
+ top: calc(var(--aplus-scroll-bar-track-width, 10px) / 2 - var(--aplus-scroll-bar-bar-width, 8px) / 2);
476
+ }
477
+ .aplus-scroll-bar__bar--vertical {
478
+ width: var(--aplus-scroll-bar-bar-width, 8px);
479
+ left: calc(var(--aplus-scroll-bar-track-width, 10px) / 2 - var(--aplus-scroll-bar-bar-width, 8px) / 2);
480
+ }
435
481
  .aplus-ap-table-wrapper {
436
482
  padding: 16px;
437
483
  background-color: #fff;
@@ -9,6 +9,7 @@
9
9
  @import '../ap-field/index.less';
10
10
  @import '../ap-action/item.less';
11
11
  @import '../ap-action/item-dropdown.less';
12
+ @import '../scroll-bar/index.less';
12
13
 
13
14
  @sw: ~'--@{ns}-ap-table-scroll-bar-width';
14
15
 
@@ -432,6 +432,52 @@
432
432
  font-size: 14px;
433
433
  display: inline-flex;
434
434
  }
435
+ .aplus-scroll-bar {
436
+ position: relative;
437
+ }
438
+ .aplus-scroll-bar--horizontal {
439
+ width: 100%;
440
+ height: var(--aplus-scroll-bar-track-width, 10px);
441
+ }
442
+ .aplus-scroll-bar--vertical {
443
+ width: var(--aplus-scroll-bar-track-width, 10px);
444
+ height: 100%;
445
+ }
446
+ .aplus-scroll-bar__track {
447
+ position: absolute;
448
+ width: 100%;
449
+ height: 100%;
450
+ top: 0;
451
+ inset-inline-start: 0;
452
+ cursor: pointer;
453
+ background-color: var(--aplus-scroll-bar-track-color, rgba(0, 0, 0, 0.05));
454
+ }
455
+ .aplus-scroll-bar__track--disabled {
456
+ pointer-events: none;
457
+ background-color: rgba(0, 0, 0, 0.02);
458
+ }
459
+ .aplus-scroll-bar__track--hidden {
460
+ pointer-events: none;
461
+ background-color: transparent;
462
+ }
463
+ .aplus-scroll-bar__bar {
464
+ position: absolute;
465
+ border-radius: var(--aplus-scroll-bar-bar-width, 8px);
466
+ background-color: var(--aplus-scroll-bar-bar-color, #c7c8cc);
467
+ cursor: pointer;
468
+ }
469
+ .aplus-scroll-bar__bar--disabled {
470
+ pointer-events: none;
471
+ box-shadow: none;
472
+ }
473
+ .aplus-scroll-bar__bar--horizontal {
474
+ height: var(--aplus-scroll-bar-bar-width, 8px);
475
+ top: calc(var(--aplus-scroll-bar-track-width, 10px) / 2 - var(--aplus-scroll-bar-bar-width, 8px) / 2);
476
+ }
477
+ .aplus-scroll-bar__bar--vertical {
478
+ width: var(--aplus-scroll-bar-bar-width, 8px);
479
+ left: calc(var(--aplus-scroll-bar-track-width, 10px) / 2 - var(--aplus-scroll-bar-bar-width, 8px) / 2);
480
+ }
435
481
  .aplus-ap-table-wrapper {
436
482
  padding: 16px;
437
483
  background-color: #fff;