@aplus-frontend/ui 0.6.5 → 0.6.7

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 (69) hide show
  1. package/es/index.mjs +28 -26
  2. package/es/src/ap-form/list/index.vue.d.ts +2 -1
  3. package/es/src/ap-form/list/index.vue.mjs +31 -27
  4. package/es/src/ap-form/search-form/hooks/use-sorter.mjs +4 -1
  5. package/es/src/ap-grid/editable/form-item.vue.mjs +25 -24
  6. package/es/src/ap-grid/editable/index.vue.mjs +1 -0
  7. package/es/src/ap-grid/index.d.ts +1 -0
  8. package/es/src/ap-grid/index.mjs +4 -2
  9. package/es/src/ap-grid/index.vue.mjs +2 -1
  10. package/es/src/ap-grid/interface.d.ts +12 -0
  11. package/es/src/ap-grid/utils/col.mjs +44 -44
  12. package/es/src/ap-grid/utils/renderer.mjs +9 -9
  13. package/es/src/ap-grid/utils/table.mjs +15 -9
  14. package/es/src/ap-grid/utils/to-tree-array.d.ts +13 -0
  15. package/es/src/ap-grid/utils/to-tree-array.mjs +19 -0
  16. package/es/src/business/ap-copy/ApCopy.mjs +27 -25
  17. package/es/src/business/ap-label/ApLabel.d.ts +4 -3
  18. package/es/src/business/ap-label/ApLabel.mjs +18 -17
  19. package/es/src/business/ap-label/constans.d.ts +2 -2
  20. package/es/src/business/ap-label/constans.mjs +1 -1
  21. package/es/src/business/ap-label/index.d.ts +7 -7
  22. package/es/src/business/ap-label/interface.d.ts +1 -1
  23. package/es/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
  24. package/es/src/business/ap-product-info/ApProductInfo.mjs +55 -40
  25. package/es/src/business/ap-product-info/interface.d.ts +2 -0
  26. package/es/src/business/ap-view/ap-view.vue2.mjs +1 -1
  27. package/es/src/index.mjs +24 -22
  28. package/es/src/version.d.ts +1 -1
  29. package/es/src/version.mjs +1 -1
  30. package/lib/index.js +1 -1
  31. package/lib/src/ap-form/list/index.vue.d.ts +2 -1
  32. package/lib/src/ap-form/list/index.vue.js +1 -1
  33. package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
  34. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  35. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  36. package/lib/src/ap-grid/index.d.ts +1 -0
  37. package/lib/src/ap-grid/index.js +1 -1
  38. package/lib/src/ap-grid/index.vue.js +1 -1
  39. package/lib/src/ap-grid/interface.d.ts +12 -0
  40. package/lib/src/ap-grid/utils/col.js +1 -1
  41. package/lib/src/ap-grid/utils/renderer.js +1 -1
  42. package/lib/src/ap-grid/utils/table.js +1 -1
  43. package/lib/src/ap-grid/utils/to-tree-array.d.ts +13 -0
  44. package/lib/src/ap-grid/utils/to-tree-array.js +1 -0
  45. package/lib/src/business/ap-copy/ApCopy.js +1 -1
  46. package/lib/src/business/ap-label/ApLabel.d.ts +4 -3
  47. package/lib/src/business/ap-label/ApLabel.js +1 -1
  48. package/lib/src/business/ap-label/constans.d.ts +2 -2
  49. package/lib/src/business/ap-label/constans.js +1 -1
  50. package/lib/src/business/ap-label/index.d.ts +7 -7
  51. package/lib/src/business/ap-label/interface.d.ts +1 -1
  52. package/lib/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
  53. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  54. package/lib/src/business/ap-product-info/interface.d.ts +2 -0
  55. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  56. package/lib/src/index.js +1 -1
  57. package/lib/src/version.d.ts +1 -1
  58. package/lib/src/version.js +1 -1
  59. package/package.json +1 -1
  60. package/theme/ap-grid/index.css +12 -0
  61. package/theme/ap-grid/index.less +16 -0
  62. package/theme/ap-label/ap-label.css +4 -0
  63. package/theme/ap-label/ap-label.less +5 -1
  64. package/theme/ap-product-info/ap-product-info.less +0 -1
  65. package/theme/font/aplusuiiconfont.otf +0 -0
  66. package/theme/font/font.css +5 -0
  67. package/theme/font/font.less +6 -0
  68. package/theme/index.css +21 -0
  69. package/theme/index.less +1 -0
package/es/index.mjs CHANGED
@@ -128,19 +128,20 @@ import { default as dp } from "./src/portal/index.vue.mjs";
128
128
  import { default as up } from "./src/full-screen/index.vue.mjs";
129
129
  import { default as ip } from "./src/resize-observer/index.vue.mjs";
130
130
  import { ROW_SELECTION_FIELD as cp } from "./src/ap-grid/constants.mjs";
131
- import { default as Ip } from "./src/ap-grid/index.vue.mjs";
132
- import { default as Sp } from "./src/ap-grid/editable/index.vue.mjs";
133
- import { default as Cp } from "./src/ap-grid/editable/form-item.vue.mjs";
134
- import { default as Dp } from "./src/text/index.vue.mjs";
135
- import { default as Gp } from "./src/text/group.vue.mjs";
136
- import { default as Ep } from "./src/mask/index.vue.mjs";
137
- import { Splitter as Lp } from "./src/splitter/index.mjs";
138
- import { useMessage as vp } from "./src/hooks/useMessage.mjs";
139
- import { useControllableValue as yp } from "./src/hooks/useControllableValue.mjs";
140
- import { useManualRef as kp } from "./src/hooks/useManualRef.mjs";
141
- import { useThrottleRef as Kp } from "./src/hooks/useThrottleRef.mjs";
142
- import { useFullScreen as Up } from "./src/hooks/useFullScreen.mjs";
143
- import { useResize as _p } from "./src/hooks/useResize.mjs";
131
+ import { toTreeArray as Ip } from "./src/ap-grid/utils/to-tree-array.mjs";
132
+ import { default as Sp } from "./src/ap-grid/index.vue.mjs";
133
+ import { default as Cp } from "./src/ap-grid/editable/index.vue.mjs";
134
+ import { default as Dp } from "./src/ap-grid/editable/form-item.vue.mjs";
135
+ import { default as Gp } from "./src/text/index.vue.mjs";
136
+ import { default as Ep } from "./src/text/group.vue.mjs";
137
+ import { default as Lp } from "./src/mask/index.vue.mjs";
138
+ import { Splitter as vp } from "./src/splitter/index.mjs";
139
+ import { useMessage as yp } from "./src/hooks/useMessage.mjs";
140
+ import { useControllableValue as kp } from "./src/hooks/useControllableValue.mjs";
141
+ import { useManualRef as Kp } from "./src/hooks/useManualRef.mjs";
142
+ import { useThrottleRef as Up } from "./src/hooks/useThrottleRef.mjs";
143
+ import { useFullScreen as _p } from "./src/hooks/useFullScreen.mjs";
144
+ import { useResize as Wp } from "./src/hooks/useResize.mjs";
144
145
  const a = console.log;
145
146
  a(`APlus-UI version ${p}`);
146
147
  const l = {
@@ -215,7 +216,7 @@ export {
215
216
  Re as ApFormProvider,
216
217
  ne as ApFormSearchForm,
217
218
  be as ApFormSet,
218
- Ip as ApGrid,
219
+ Sp as ApGrid,
219
220
  ct as ApGroupSearch,
220
221
  vr as ApImage,
221
222
  vo as ApInfoLayout,
@@ -240,8 +241,8 @@ export {
240
241
  fr as ApTableModal,
241
242
  Eo as ApTag,
242
243
  Lo as ApTagGroup,
243
- Dp as ApText,
244
- Gp as ApTextGroup,
244
+ Gp as ApText,
245
+ Ep as ApTextGroup,
245
246
  qr as ApTitle,
246
247
  pr as ApTransformDataHelper,
247
248
  ko as ApUpload,
@@ -254,21 +255,21 @@ export {
254
255
  n as DEFAULT_NAMESPACE,
255
256
  c as DEFAULT_UIMODE,
256
257
  bo as DictCode,
257
- Sp as EditableGrid,
258
- Cp as EditableGridFormItem,
258
+ Cp as EditableGrid,
259
+ Dp as EditableGridFormItem,
259
260
  Qt as EditableTable,
260
261
  Yt as EditableTableFormItem,
261
262
  up as FullScreen,
262
263
  fp as InternalScrollBar,
263
264
  Ut as LruCacher,
264
- Ep as Mask,
265
+ Lp as Mask,
265
266
  yo as NeedNameKeyDefault,
266
267
  dp as Portal,
267
268
  cp as ROW_SELECTION_FIELD,
268
269
  ip as ResizeObserver,
269
270
  pp as ScrollBar,
270
271
  lp as ScrollView,
271
- Lp as Splitter,
272
+ vp as Splitter,
272
273
  Go as WorkOrderModal,
273
274
  mo as adminToken,
274
275
  lo as aplusToken,
@@ -296,23 +297,24 @@ export {
296
297
  L as namespaceContextKey,
297
298
  s as pathMap,
298
299
  S as provideGlobalConfig,
300
+ Ip as toTreeArray,
299
301
  G as translate,
300
302
  _t as useApKeepAliveInject,
301
- yp as useControllableValue,
302
- Up as useFullScreen,
303
+ kp as useControllableValue,
304
+ _p as useFullScreen,
303
305
  M as useGetDerivedNamespace,
304
306
  b as useGlobalConfig,
305
307
  rt as useGridRefresh,
306
308
  P as useLocale,
307
- kp as useManualRef,
308
- vp as useMessage,
309
+ Kp as useManualRef,
310
+ yp as useMessage,
309
311
  v as useNamespace,
310
312
  et as usePageListApGrid,
311
313
  Qr as usePageListApTable,
312
- _p as useResize,
314
+ Wp as useResize,
313
315
  lr as useTableModal,
314
316
  jt as useTablePaging,
315
317
  Yr as useTableRefresh,
316
318
  dr as useTableSelectModal,
317
- Kp as useThrottleRef
319
+ Up as useThrottleRef
318
320
  };
@@ -7,8 +7,9 @@ type FormListField = {
7
7
  fieldName: number;
8
8
  };
9
9
  type FormListActions = {
10
- add: (defaultValue?: any) => void;
10
+ add: (defaultValue?: any) => number;
11
11
  remove: (name: number) => void;
12
+ getFieldKeys: () => number[];
12
13
  };
13
14
  type ApFormListSlots = {
14
15
  default(props: {
@@ -1,7 +1,7 @@
1
- import { defineComponent as V, onMounted as k, computed as f, unref as s, renderSlot as v } from "vue";
2
- import { useInjectForm as h } from "../context.mjs";
3
- import { isArray as j } from "lodash-unified";
4
- const g = /* @__PURE__ */ V({
1
+ import { defineComponent as v, onMounted as V, computed as p, unref as i, renderSlot as K } from "vue";
2
+ import { useInjectForm as g } from "../context.mjs";
3
+ import { isArray as h } from "lodash-unified";
4
+ const b = /* @__PURE__ */ v({
5
5
  name: "ApFormList",
6
6
  __name: "index",
7
7
  props: {
@@ -9,43 +9,47 @@ const g = /* @__PURE__ */ V({
9
9
  initialValue: {},
10
10
  transform: { type: [Function, Object] }
11
11
  },
12
- setup(p) {
13
- let o = 1;
14
- const a = [], t = p, { model: i, updateModel: r, internalInstance: c } = h();
15
- k(() => {
12
+ setup(y) {
13
+ let s = 1;
14
+ const a = [], t = y, { model: u, updateModel: o, internalInstance: c } = g();
15
+ V(() => {
16
16
  c == null || c.registerField({
17
17
  name: t.name,
18
18
  initialValue: t.initialValue,
19
19
  transform: t.transform
20
20
  });
21
21
  });
22
- const u = f(() => t.name ? j(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e[n], s(i)) : i == null ? void 0 : i.value[t.name] : null);
23
- function y(e = void 0) {
24
- const n = s(u) ? [...s(u), e] : [e];
25
- a.push(o), o += 1, r == null || r(t.name, n);
22
+ const m = p(() => t.name ? h(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e[n], i(u)) : u == null ? void 0 : u.value[t.name] : null);
23
+ function d(e = void 0) {
24
+ const n = i(m) ? [...i(m), e] : [e], r = s;
25
+ return a.push(r), s += 1, o == null || o(t.name, n), r;
26
26
  }
27
- function d(e) {
28
- let n = s(u) || [];
29
- n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1), r == null || r(t.name, n);
27
+ function F(e) {
28
+ let n = i(m) || [];
29
+ n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1), o == null || o(t.name, n);
30
30
  }
31
- const _ = {
32
- add: y,
33
- remove: d
34
- }, F = f(() => (s(u) || []).map((n, m) => {
35
- let l = a[m];
36
- return typeof l > "u" && (a[m] = o, l = o, o += 1), {
31
+ function _() {
32
+ return f.value.map((e) => e.key);
33
+ }
34
+ const k = {
35
+ add: d,
36
+ remove: F,
37
+ getFieldKeys: _
38
+ }, f = p(() => (i(m) || []).map((n, r) => {
39
+ let l = a[r];
40
+ return typeof l > "u" && (a[r] = s, l = s, s += 1), {
37
41
  key: l,
38
- fieldName: m,
39
- name: [t.name, m].flat(),
42
+ fieldName: r,
43
+ name: [t.name, r].flat(),
40
44
  value: n
41
45
  };
42
46
  }));
43
- return (e, n) => v(e.$slots, "default", {
44
- fields: F.value,
45
- actions: _
47
+ return (e, n) => K(e.$slots, "default", {
48
+ fields: f.value,
49
+ actions: k
46
50
  });
47
51
  }
48
52
  });
49
53
  export {
50
- g as default
54
+ b as default
51
55
  };
@@ -28,7 +28,10 @@ const w = (s) => {
28
28
  };
29
29
  }));
30
30
  function i(a) {
31
- const n = l(a, s.value);
31
+ const n = l(
32
+ a || [],
33
+ s.value || []
34
+ );
32
35
  r.value = !0, s.value = n;
33
36
  }
34
37
  return {
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as r, 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 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";
2
2
  import { ApForm as C } from "../../ap-form/index.mjs";
3
3
  import { isArray as w, isUndefined as M, isNumber as m, cloneDeep as ee, omit as oe } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
@@ -148,6 +148,7 @@ const Ce = /* @__PURE__ */ P({
148
148
  rowHighlightable: {
149
149
  type: [Boolean, Function]
150
150
  },
151
+ treeConfig: {},
151
152
  columns: {},
152
153
  defaultValue: {},
153
154
  "onUpdate:value": {},
@@ -172,7 +173,7 @@ const Ce = /* @__PURE__ */ P({
172
173
  const {
173
174
  internalInstance: o,
174
175
  model: v
175
- } = ae(), p = W(l.name), d = h(F(r(v), p.value) || []), N = C.useWatch(p);
176
+ } = ae(), p = W(l.name), d = h(F(u(v), p.value) || []), N = C.useWatch(p);
176
177
  G(() => N.value, async (e) => {
177
178
  var t;
178
179
  await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
@@ -182,61 +183,61 @@ const Ce = /* @__PURE__ */ P({
182
183
  const c = h(), D = ne("valueTypeMap"), V = te(l, D);
183
184
  function L(e, t) {
184
185
  var f;
185
- const n = ((f = r(d)) == null ? void 0 : f.length) || 0;
186
+ const n = ((f = u(d)) == null ? void 0 : f.length) || 0;
186
187
  if (b(l.maxLength) && n >= l.maxLength)
187
188
  return;
188
189
  const a = {
189
190
  ...e || {}
190
191
  };
191
- o == null || o.setFieldValue(l.name, a, !0, (s, u) => {
192
- if (!s[u]) {
193
- s[u] = [a];
192
+ o == null || o.setFieldValue(l.name, a, !0, (r, s) => {
193
+ if (!r[s]) {
194
+ r[s] = [a];
194
195
  return;
195
196
  }
196
- M(t) ? s[u].push(a) : s[u].splice(t, 0, a);
197
+ M(t) ? r[s].push(a) : r[s].splice(t, 0, a);
197
198
  });
198
199
  }
199
200
  function T(e, t = "suffix") {
200
- var s;
201
- const n = ((s = r(d)) == null ? void 0 : s.length) || 0, a = m(e) ? e : e.length;
201
+ var r;
202
+ const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
202
203
  if (b(l.maxLength) && n + a > l.maxLength)
203
204
  return;
204
205
  const f = m(e) ? new Array(e).fill(0).map(() => ({})) : ee(e);
205
- o == null || o.setFieldValue(l.name, f, !0, (u, i) => {
206
- if (!u[i]) {
207
- u[i] = [...f];
206
+ o == null || o.setFieldValue(l.name, f, !0, (s, i) => {
207
+ if (!s[i]) {
208
+ s[i] = [...f];
208
209
  return;
209
210
  }
210
- t === "suffix" ? u[i].push(...f) : u[i].unshift(...f);
211
+ t === "suffix" ? s[i].push(...f) : s[i].unshift(...f);
211
212
  });
212
213
  }
213
214
  function k(e) {
214
215
  const t = new Set(m(e) ? [e] : e);
215
216
  o == null || o.setFieldValue(l.name, void 0, !0, (n, a) => {
216
- n[a] = n[a].filter((f, s) => !t.has(s));
217
+ n[a] = n[a].filter((f, r) => !t.has(r));
217
218
  });
218
219
  }
219
220
  function _(e) {
220
221
  var n;
221
222
  const t = new Set(w(e) ? e : [e]);
222
223
  t.size !== 0 && ((n = o == null ? void 0 : o.setFieldValue) == null || n.call(o, l.name, void 0, !0, (a, f) => {
223
- a[f] = a[f].filter((s) => !t.has(s[l.rowKey]));
224
+ a[f] = a[f].filter((r) => !t.has(r[l.rowKey]));
224
225
  }));
225
226
  }
226
227
  function j() {
227
- return r(d);
228
+ return u(d);
228
229
  }
229
230
  function E(e) {
230
231
  var t;
231
- return (t = r(d)) == null ? void 0 : t[e];
232
+ return (t = u(d)) == null ? void 0 : t[e];
232
233
  }
233
234
  function O(e, t, n = !0) {
234
235
  o == null || o.setFieldValue(l.name, void 0, !0, (a, f) => {
235
236
  if (!(!a[f] || !a[f][e])) {
236
237
  if (!n) {
237
- const s = Object.keys(a[f][e]);
238
- for (const u of s)
239
- u !== l.rowKey && delete a[f][e][u];
238
+ const r = Object.keys(a[f][e]);
239
+ for (const s of r)
240
+ s !== l.rowKey && delete a[f][e][s];
240
241
  }
241
242
  Object.assign(a[f][e], {
242
243
  ...t
@@ -267,15 +268,15 @@ const Ce = /* @__PURE__ */ P({
267
268
  setTableData: z,
268
269
  clear: H,
269
270
  removeByKey: _
270
- }), (e, t) => (q(), $(r(C).FormItem, y(e.formItem, {
271
+ }), (e, t) => (q(), $(u(C).FormItem, y(e.formItem, {
271
272
  name: e.name,
272
273
  label: e.label
273
274
  }), {
274
- default: g(() => [J(fe, y(r(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
275
+ default: g(() => [J(fe, y(u(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
275
276
  ref_key: "tableRef",
276
277
  ref: c,
277
- class: r(S)(),
278
- columns: r(V),
278
+ class: u(S)(),
279
+ columns: u(V),
279
280
  "data-source": d.value,
280
281
  "search-form": !1
281
282
  }), Q({
@@ -149,6 +149,7 @@ const Re = /* @__PURE__ */ $({
149
149
  rowHighlightable: {
150
150
  type: [Boolean, Function]
151
151
  },
152
+ treeConfig: {},
152
153
  columns: {},
153
154
  defaultValue: {},
154
155
  "onUpdate:value": {},
@@ -5,3 +5,4 @@ export { ApGrid, EditableGrid, EditableGridFormItem };
5
5
  export * from './interface';
6
6
  export * from './editable/interface';
7
7
  export { ROW_SELECTION_FIELD } from './constants';
8
+ export { toTreeArray } from './utils/to-tree-array';
@@ -3,7 +3,9 @@ import "./editable/index.vue2.mjs";
3
3
  import "./editable/form-item.vue2.mjs";
4
4
  import "./interface.mjs";
5
5
  import "./editable/interface.mjs";
6
- import { ROW_SELECTION_FIELD as I } from "./constants.mjs";
6
+ import { ROW_SELECTION_FIELD as E } from "./constants.mjs";
7
+ import { toTreeArray as x } from "./utils/to-tree-array.mjs";
7
8
  export {
8
- I as ROW_SELECTION_FIELD
9
+ E as ROW_SELECTION_FIELD,
10
+ x as toTreeArray
9
11
  };
@@ -111,7 +111,8 @@ const Go = /* @__PURE__ */ Oe({
111
111
  virtual: { type: [Boolean, Object], default: void 0 },
112
112
  expandable: {},
113
113
  value: {},
114
- rowHighlightable: { type: [Boolean, Function], default: !1 }
114
+ rowHighlightable: { type: [Boolean, Function], default: !1 },
115
+ treeConfig: {}
115
116
  },
116
117
  setup(se, { expose: ie }) {
117
118
  var Y;
@@ -65,6 +65,14 @@ export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
65
65
  * 指定渲染内容是否为html
66
66
  */
67
67
  html?: boolean;
68
+ /**
69
+ * 指定当前列是否是VxeTable内置的序号列
70
+ */
71
+ seq?: boolean;
72
+ /**
73
+ * 指定当前列为树节点
74
+ */
75
+ treeNode?: boolean;
68
76
  /**
69
77
  * 值类型额外配置的参数(用于查询表单渲染)
70
78
  */
@@ -244,6 +252,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
244
252
  * 行是否可以被高亮(传入函数可以获取当前被选中的行)
245
253
  */
246
254
  rowHighlightable?: boolean | ((current: RecordType) => void);
255
+ /**
256
+ * 树形表格设置(部分vxe-table.treeConfig配置)
257
+ */
258
+ treeConfig?: Omit<VxeTablePropTypes.TreeConfig<RecordType>, 'transform' | 'iconOpen' | 'iconClose' | 'iconLoaded'>;
247
259
  };
248
260
  export type ApGridVirtualConfig = {
249
261
  x?: false | number;
@@ -1,19 +1,19 @@
1
1
  import { createVNode as v, Fragment as O } from "vue";
2
- import { isUndefined as S, isArray as $, isString as x, isBoolean as c, isNumber as M, pick as A } from "lodash-unified";
3
- import { valueEnumToArray as V, objectToString as j, getTableTitle as R, getTableRenderType as B, getTableRenderProps as W, getTableCellRenderNode as _ } from "../../ap-table/utils.mjs";
4
- import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
2
+ import { isUndefined as S, isArray as $, isString as x, isBoolean as A, isNumber as M, pick as R } from "lodash-unified";
3
+ import { valueEnumToArray as V, objectToString as j, getTableTitle as c, getTableRenderType as q, getTableRenderProps as B, getTableCellRenderNode as W } from "../../ap-table/utils.mjs";
4
+ import { noRenderAsFormItemValueList as _ } from "../../ap-table/constants.mjs";
5
5
  import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
6
- import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
- function b(e) {
6
+ import k from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
+ function N(e) {
8
8
  if (!S(e))
9
9
  return $(e) ? e.reduce((r, i) => x(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
10
10
  }
11
- function w(e) {
11
+ function b(e) {
12
12
  if (e)
13
13
  return e === !0 ? "left" : e;
14
14
  }
15
- function G(e) {
16
- return c(e) ? {
15
+ function z(e) {
16
+ return A(e) ? {
17
17
  sortable: e
18
18
  } : e ? {
19
19
  sortable: !0,
@@ -23,18 +23,18 @@ function G(e) {
23
23
  sortable: !1
24
24
  };
25
25
  }
26
- function I(e) {
26
+ function G(e) {
27
27
  let r;
28
- return c(e.filters) && e.valueEnum ? r = V(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
28
+ return A(e.filters) && e.valueEnum ? r = V(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
29
29
  label: x(i.text) ? i.text : "",
30
30
  value: i.value
31
31
  }));
32
32
  }
33
- function L(e) {
33
+ function I(e) {
34
34
  if (e)
35
35
  return (r) => e(r.value, r.row);
36
36
  }
37
- function U(e, r) {
37
+ function L(e, r) {
38
38
  return e ? M(e) ? {
39
39
  tooltip: r,
40
40
  rows: e
@@ -47,12 +47,12 @@ function U(e, r) {
47
47
  htmlTitle: e === "title" ? r : ""
48
48
  } : !1;
49
49
  }
50
- function q(e, r, i) {
51
- if (k.includes(e.valueType))
50
+ function U(e, r, i) {
51
+ if (_.includes(e.valueType))
52
52
  return i;
53
53
  if (e.copyable || e.ellipsis) {
54
- const l = U(e.ellipsis, r), t = j(r);
55
- return v(z, {
54
+ const l = L(e.ellipsis, r), t = j(r);
55
+ return v(k, {
56
56
  rawValue: t,
57
57
  copyable: e.copyable,
58
58
  ellipsis: l,
@@ -62,63 +62,63 @@ function q(e, r, i) {
62
62
  return i;
63
63
  }
64
64
  function y(e, r, i) {
65
- const l = A(e, ["width", "minWidth", "align"]);
66
- return l.field = b(e.dataIndex), l.fixed = w(e.fixed), l.slots = {
67
- header: () => R(e, i, void 0, r)
65
+ const l = R(e, ["width", "minWidth", "align"]);
66
+ return l.field = N(e.dataIndex), l.fixed = b(e.fixed), l.slots = {
67
+ header: () => c(e, i, void 0, r)
68
68
  }, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
69
69
  }
70
70
  function F(e, r, i, l) {
71
- const t = A(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName"]);
72
- t.field = b(e.dataIndex), t.fixed = w(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, G(e.sorter)), t.filters = I(e), t.filterMultiple = e.filterMultiple, t.filterMethod = L(e.onFilter);
71
+ const t = R(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
72
+ t.field = N(e.dataIndex), t.fixed = b(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, z(e.sorter)), t.filters = G(e), t.filterMultiple = e.filterMultiple, t.filterMethod = I(e.onFilter);
73
73
  const f = ({
74
- value: n,
74
+ value: d,
75
75
  ...s
76
76
  }) => {
77
77
  var o, T;
78
- const a = B(e), u = W({
78
+ const a = q(e), u = B({
79
79
  ...e,
80
80
  valueType: a
81
81
  }, {
82
- value: n,
82
+ value: d,
83
83
  ...s
84
- }), E = _(a, u, s.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
85
- value: n,
84
+ }), w = W(a, u, s.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
85
+ value: d,
86
86
  ...s
87
- })) || n, N = e.renderText ? v(O, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
88
- value: n,
87
+ })) || d, E = e.renderText ? v(O, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
88
+ value: d,
89
89
  ...s
90
- })]) : E;
91
- let p = q(e, h, N);
90
+ })]) : w;
91
+ let p = U(e, h, E);
92
92
  return e.customRender && (p = e.customRender({
93
- value: n,
93
+ value: d,
94
94
  ...s,
95
95
  column: e,
96
96
  originalNode: p,
97
97
  originalText: h
98
98
  })), p;
99
- }, d = ({
100
- row: n,
99
+ }, n = ({
100
+ row: d,
101
101
  rowIndex: s
102
102
  }) => f({
103
- value: n[t.field],
104
- text: n[t.field],
105
- record: n,
103
+ value: d[t.field],
104
+ text: d[t.field],
105
+ record: d,
106
106
  index: s,
107
107
  renderIndex: s,
108
108
  column: e
109
109
  });
110
110
  return t.slots = {
111
- header: () => R(e, i, void 0, r),
112
- default: d,
113
- footer: d
114
- }, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
111
+ header: () => c(e, i, void 0, r),
112
+ default: n,
113
+ footer: n
114
+ }, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), e.seq && (t.type = "seq", t.slots = {}), t;
115
115
  }
116
116
  function Y(e, r, i, l) {
117
- var d;
118
- if (!((d = e.children) != null && d.length))
117
+ var n;
118
+ if (!((n = e.children) != null && n.length))
119
119
  return F(e, r, i, l);
120
- function t(n) {
121
- return n.map((s) => {
120
+ function t(d) {
121
+ return d.map((s) => {
122
122
  var a;
123
123
  if ((a = s.children) != null && a.length) {
124
124
  const u = y(s, r, i);
@@ -1,20 +1,20 @@
1
- import { createVNode as m } from "vue";
1
+ import { createVNode as l } from "vue";
2
2
  import { VxeColumn as u, VxeColgroup as p } from "vxe-table";
3
- import { transformCol as d } from "./col.mjs";
3
+ import { transformCol as s } from "./col.mjs";
4
4
  function n(r) {
5
5
  var e;
6
- return (e = r.children) != null && e.length ? m(p, r, {
6
+ return (e = r.children) != null && e.length ? l(p, r, {
7
7
  ...r.slots || {},
8
8
  default: () => {
9
- var t;
10
- return (t = r.children) == null ? void 0 : t.map((o) => n(o));
9
+ var o;
10
+ return (o = r.children) == null ? void 0 : o.map((t) => n(t));
11
11
  }
12
- }) : m(u, r, {
12
+ }) : (console.log("config", r), l(u, r, {
13
13
  ...r.slots || {}
14
- });
14
+ }));
15
15
  }
16
- function C(r, e, t, o) {
17
- return r.map((l) => n(d(l, e, t, o)));
16
+ function C(r, e, o, t) {
17
+ return r.map((m) => n(s(m, e, o, t)));
18
18
  }
19
19
  export {
20
20
  C as renderWithColumns
@@ -1,10 +1,10 @@
1
- import { omit as u, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
1
+ import { omit as d, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
2
2
  import { isDef as m } from "../../utils/index.mjs";
3
- const w = 20, b = 50, g = (e) => e.some((t) => !!t.html);
3
+ const g = 20, w = 50, b = (e) => e.some((t) => !!t.html);
4
4
  function R(e) {
5
5
  var n;
6
6
  const t = {
7
- ...u(e, [
7
+ ...d(e, [
8
8
  "columns",
9
9
  "request",
10
10
  "searchForm",
@@ -18,7 +18,7 @@ function R(e) {
18
18
  isHover: !0,
19
19
  keyField: e.rowKey,
20
20
  isCurrent: !!e.rowHighlightable
21
- }, t.columnConfig = {}, g(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
21
+ }, t.columnConfig = {}, b(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
22
22
  const o = e.rowSelection === !0 ? {} : e.rowSelection;
23
23
  o.type === "radio" ? t.radioConfig = {
24
24
  highlight: !0,
@@ -42,7 +42,7 @@ function R(e) {
42
42
  range: o.range || !1
43
43
  };
44
44
  }
45
- return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
45
+ return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = d(e.expandable, [
46
46
  "renderContent",
47
47
  "width",
48
48
  "title"
@@ -50,15 +50,21 @@ function R(e) {
50
50
  enabled: !1
51
51
  }, t.virtualYConfig = {
52
52
  enabled: !1
53
- }) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, e.virtual !== !1 && (t.headerCellConfig = {
53
+ }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, e.virtual !== !1 && (t.headerCellConfig = {
54
54
  height: 36,
55
55
  ...t.headerCellConfig || {}
56
+ }), t.treeConfig && (t.treeConfig = {
57
+ ...t.treeConfig || {},
58
+ /**
59
+ * 使用非树层级列表,配合transform
60
+ */
61
+ transform: !0
56
62
  }), t;
57
63
  }
58
- function a(e, t, i) {
59
- const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], f = l !== !1, d = n ? w : b, h = C(l) && l >= 0 ? l : d;
64
+ function f(e, t, i) {
65
+ const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, u = n ? g : w, h = C(l) && l >= 0 ? l : u;
60
66
  e[r] = {
61
- enabled: f,
67
+ enabled: a,
62
68
  gt: h,
63
69
  oSize: (i == null ? void 0 : i.oSize) || 0
64
70
  };