@aplus-frontend/ui 6.28.1 → 6.28.3

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 (36) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.mjs +72 -64
  2. package/es/src/ag-grid/index.vue.mjs +254 -244
  3. package/es/src/ag-grid/renderer/select.d.ts +4 -1
  4. package/es/src/ag-grid/renderer/select.mjs +11 -7
  5. package/es/src/ap-field/tree-select/index.vue.d.ts +20 -0
  6. package/es/src/ap-field/tree-select/index.vue.mjs +15 -14
  7. package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
  8. package/es/src/ap-form/items/tree-select/index.vue.d.ts +22 -0
  9. package/es/src/ap-table/constants.d.ts +11 -0
  10. package/es/src/ap-table/utils.mjs +51 -42
  11. package/es/src/version.d.ts +1 -1
  12. package/es/src/version.mjs +1 -1
  13. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  14. package/lib/src/ag-grid/index.vue.js +1 -1
  15. package/lib/src/ag-grid/renderer/select.d.ts +4 -1
  16. package/lib/src/ag-grid/renderer/select.js +1 -1
  17. package/lib/src/ap-field/tree-select/index.vue.d.ts +20 -0
  18. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  19. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  20. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +22 -0
  21. package/lib/src/ap-table/constants.d.ts +11 -0
  22. package/lib/src/ap-table/utils.js +1 -1
  23. package/lib/src/version.d.ts +1 -1
  24. package/lib/src/version.js +1 -1
  25. package/package.json +3 -3
  26. package/theme/ag-grid/index.css +10 -6
  27. package/theme/ag-grid/index.less +9 -6
  28. package/theme/ap-form/ap-form-item.css +3 -0
  29. package/theme/ap-form/ap-form-item.less +3 -0
  30. package/theme/ap-form/index.css +3 -0
  31. package/theme/ap-form/search-form.css +3 -0
  32. package/theme/ap-grid/index.css +3 -0
  33. package/theme/ap-table/ap-table.css +3 -0
  34. package/theme/ap-table-modal/index.css +3 -0
  35. package/theme/editable-table/index.css +3 -0
  36. package/theme/index.css +10 -6
@@ -1,6 +1,6 @@
1
- import { getTableRenderProps as C, objectToString as m } from "../../ap-table/utils.mjs";
2
- import { rendererMap as y } from "../renderer/index.mjs";
3
- import { isFunction as b, isNumber as f } from "lodash-unified";
1
+ import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
2
+ import { rendererMap as h } from "../renderer/index.mjs";
3
+ import { isNumber as p, isFunction as b } from "lodash-unified";
4
4
  import { computed as v, unref as T } from "vue";
5
5
  import "../components/body-cell/index.vue.mjs";
6
6
  import "../components/header-cell/index.vue.mjs";
@@ -8,78 +8,81 @@ import "../../config-provider/index.mjs";
8
8
  import { dataIndexToField as R } from "../../ap-grid/utils/col.mjs";
9
9
  import { isDef as D } from "../../utils/index.mjs";
10
10
  import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
11
- import { useNamespace as P } from "../../config-provider/hooks/use-namespace.mjs";
12
- import S from "../components/body-cell/index.vue2.mjs";
13
- import _ from "../components/header-cell/index.vue2.mjs";
14
- function z(t, a) {
15
- if (a.bodyCellTooltip)
16
- return b(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
17
- if (a.renderText)
18
- return a.renderText({
19
- value: t.value,
20
- record: t.data,
21
- column: a,
22
- text: t.value
11
+ import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
12
+ import G from "../components/body-cell/index.vue2.mjs";
13
+ import C from "../components/header-cell/index.vue2.mjs";
14
+ function _(r) {
15
+ return p(r) && r > 1;
16
+ }
17
+ function z(r, i) {
18
+ if (i.bodyCellTooltip)
19
+ return b(i.bodyCellTooltip) ? i.bodyCellTooltip(r.value, r.data) : i.bodyCellTooltip;
20
+ if (i.renderText)
21
+ return i.renderText({
22
+ value: r.value,
23
+ record: r.data,
24
+ column: i,
25
+ text: r.value
23
26
  });
24
- const s = a.valueType || "text", d = y[s];
25
- if (d) {
26
- const p = C(
27
- { ...a, valueType: s },
27
+ const s = i.valueType || "text", n = h[s];
28
+ if (n) {
29
+ const u = y(
30
+ { ...i, valueType: s },
28
31
  {
29
- value: t.value,
30
- text: t.value,
31
- record: t.data,
32
- column: t.column,
33
- rowIndex: t.node?.rowIndex,
34
- pinned: t.node?.rowPinned
32
+ value: r.value,
33
+ text: r.value,
34
+ record: r.data,
35
+ column: r.column,
36
+ rowIndex: r.node?.rowIndex,
37
+ pinned: r.node?.rowPinned
35
38
  }
36
39
  );
37
- return d(p);
40
+ return n(u);
38
41
  }
39
- return m(t.value);
42
+ return P(r.value);
40
43
  }
41
- const J = (t, a, s) => {
42
- const d = I("valueTypeMap"), { em: u } = P("ag-grid"), p = v(() => {
43
- const h = T(t), g = (i) => {
44
+ const J = (r, i, s) => {
45
+ const n = I("valueTypeMap"), { em: f } = S("ag-grid"), u = v(() => {
46
+ const g = T(r), m = (a) => {
44
47
  const e = {
45
- cellRenderer: S,
48
+ cellRenderer: G,
46
49
  cellRendererParams: {
47
- column: i,
48
- extraValueType: T(d)
50
+ column: a,
51
+ extraValueType: T(n)
49
52
  }
50
53
  };
51
- if (i.customRender)
54
+ if (a.customRender)
52
55
  return e;
53
- if (i.renderText)
56
+ if (a.renderText)
54
57
  return {
55
- valueFormatter: (r) => i.renderText({
56
- value: r.value,
57
- record: r.data,
58
- column: i,
59
- text: r.value
58
+ valueFormatter: (t) => a.renderText({
59
+ value: t.value,
60
+ record: t.data,
61
+ column: a,
62
+ text: t.value
60
63
  })
61
64
  };
62
- const n = i.valueType || "text", l = y[n];
65
+ const d = a.valueType || "text", l = h[d];
63
66
  return l ? {
64
- valueFormatter: (r) => {
65
- const o = C(
66
- { ...i, valueType: n },
67
+ valueFormatter: (t) => {
68
+ const o = y(
69
+ { ...a, valueType: d },
67
70
  {
68
- value: r.value,
69
- text: r.value,
70
- record: r.data,
71
- column: r.column,
72
- rowIndex: r.node?.rowIndex,
73
- pinned: r.node?.rowPinned
71
+ value: t.value,
72
+ text: t.value,
73
+ record: t.data,
74
+ column: t.column,
75
+ rowIndex: t.node?.rowIndex,
76
+ pinned: t.node?.rowPinned
74
77
  }
75
78
  );
76
79
  return l(o);
77
80
  }
78
81
  } : e;
79
82
  };
80
- function x(i) {
81
- return i.map((e) => {
82
- const n = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || f(e.ellipsis)), l = {
83
+ function x(a) {
84
+ return a.map((e) => {
85
+ const d = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || p(e.ellipsis)), l = {
83
86
  field: R(e.dataIndex),
84
87
  colId: D(e.key) ? String(e.key) : void 0,
85
88
  sortable: !!e.sorter,
@@ -96,39 +99,44 @@ const J = (t, a, s) => {
96
99
  pinned: e.fixed || null,
97
100
  // undefined to null
98
101
  colSpan: e.colSpan,
99
- cellClass: s((r) => {
100
- const o = e.cellClass || "", w = b(o) ? o(r.data, r.node) : o;
102
+ cellClass: s((t) => {
103
+ const o = e.cellClass || "", w = b(o) ? o(t.data, t.node) : o;
101
104
  return [
102
- `${u("cell", e.align || "left")}`,
105
+ `${f("cell", e.align || "left")}`,
106
+ _(e.ellipsis) ? f("cell", "multiline") : null,
103
107
  w
104
108
  ].flat().filter(Boolean);
105
109
  }),
106
110
  cellStyle: {
107
- "--ag-grid-line-clamp": f(e.ellipsis) ? e.ellipsis : 1
111
+ "--ag-grid-line-clamp": p(e.ellipsis) ? e.ellipsis : 1
108
112
  },
109
- wrapText: !e.ellipsis || f(e.ellipsis) && e.ellipsis >= 2,
113
+ wrapText: !e.ellipsis || p(e.ellipsis) && e.ellipsis > 1,
110
114
  autoHeight: !0,
111
115
  // 设置自动计算高度以自适应多行换行的场景
112
- tooltipValueGetter: n ? (r) => z(r, e) : void 0,
113
- ...g(e)
116
+ tooltipValueGetter: d ? (t) => z(t, e) : void 0,
117
+ ...m(e)
114
118
  };
115
119
  return e.children?.length ? {
116
120
  ...l,
121
+ headerGroupComponent: C,
122
+ headerGroupComponentParams: {
123
+ column: e
124
+ },
117
125
  children: x(e.children)
118
126
  } : l;
119
127
  });
120
128
  }
121
- return x(h);
129
+ return x(g);
122
130
  }), c = v(
123
131
  () => ({
124
- headerComponent: _,
125
- resizable: a.columnResizable,
132
+ headerComponent: C,
133
+ resizable: i.columnResizable,
126
134
  suppressMovable: !0,
127
135
  cellDataType: !1
128
136
  })
129
137
  );
130
138
  return {
131
- columnDefs: p,
139
+ columnDefs: u,
132
140
  defaultColDef: c
133
141
  };
134
142
  };