@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.
- package/es/src/ag-grid/hooks/use-columns-def.mjs +72 -64
- package/es/src/ag-grid/index.vue.mjs +254 -244
- package/es/src/ag-grid/renderer/select.d.ts +4 -1
- package/es/src/ag-grid/renderer/select.mjs +11 -7
- package/es/src/ap-field/tree-select/index.vue.d.ts +20 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +15 -14
- package/es/src/ap-field/tree-select/read.vue2.mjs +1 -0
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +22 -0
- package/es/src/ap-table/constants.d.ts +11 -0
- package/es/src/ap-table/utils.mjs +51 -42
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/renderer/select.d.ts +4 -1
- package/lib/src/ag-grid/renderer/select.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +20 -0
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +22 -0
- package/lib/src/ap-table/constants.d.ts +11 -0
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ag-grid/index.css +10 -6
- package/theme/ag-grid/index.less +9 -6
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +10 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getTableRenderProps as
|
|
2
|
-
import { rendererMap as
|
|
3
|
-
import {
|
|
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
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 =
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
{ ...
|
|
27
|
+
const s = i.valueType || "text", n = h[s];
|
|
28
|
+
if (n) {
|
|
29
|
+
const u = y(
|
|
30
|
+
{ ...i, valueType: s },
|
|
28
31
|
{
|
|
29
|
-
value:
|
|
30
|
-
text:
|
|
31
|
-
record:
|
|
32
|
-
column:
|
|
33
|
-
rowIndex:
|
|
34
|
-
pinned:
|
|
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
|
|
40
|
+
return n(u);
|
|
38
41
|
}
|
|
39
|
-
return
|
|
42
|
+
return P(r.value);
|
|
40
43
|
}
|
|
41
|
-
const J = (
|
|
42
|
-
const
|
|
43
|
-
const
|
|
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:
|
|
48
|
+
cellRenderer: G,
|
|
46
49
|
cellRendererParams: {
|
|
47
|
-
column:
|
|
48
|
-
extraValueType: T(
|
|
50
|
+
column: a,
|
|
51
|
+
extraValueType: T(n)
|
|
49
52
|
}
|
|
50
53
|
};
|
|
51
|
-
if (
|
|
54
|
+
if (a.customRender)
|
|
52
55
|
return e;
|
|
53
|
-
if (
|
|
56
|
+
if (a.renderText)
|
|
54
57
|
return {
|
|
55
|
-
valueFormatter: (
|
|
56
|
-
value:
|
|
57
|
-
record:
|
|
58
|
-
column:
|
|
59
|
-
text:
|
|
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
|
|
65
|
+
const d = a.valueType || "text", l = h[d];
|
|
63
66
|
return l ? {
|
|
64
|
-
valueFormatter: (
|
|
65
|
-
const o =
|
|
66
|
-
{ ...
|
|
67
|
+
valueFormatter: (t) => {
|
|
68
|
+
const o = y(
|
|
69
|
+
{ ...a, valueType: d },
|
|
67
70
|
{
|
|
68
|
-
value:
|
|
69
|
-
text:
|
|
70
|
-
record:
|
|
71
|
-
column:
|
|
72
|
-
rowIndex:
|
|
73
|
-
pinned:
|
|
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(
|
|
81
|
-
return
|
|
82
|
-
const
|
|
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((
|
|
100
|
-
const o = e.cellClass || "", w = b(o) ? o(
|
|
102
|
+
cellClass: s((t) => {
|
|
103
|
+
const o = e.cellClass || "", w = b(o) ? o(t.data, t.node) : o;
|
|
101
104
|
return [
|
|
102
|
-
`${
|
|
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":
|
|
111
|
+
"--ag-grid-line-clamp": p(e.ellipsis) ? e.ellipsis : 1
|
|
108
112
|
},
|
|
109
|
-
wrapText: !e.ellipsis ||
|
|
113
|
+
wrapText: !e.ellipsis || p(e.ellipsis) && e.ellipsis > 1,
|
|
110
114
|
autoHeight: !0,
|
|
111
115
|
// 设置自动计算高度以自适应多行换行的场景
|
|
112
|
-
tooltipValueGetter:
|
|
113
|
-
...
|
|
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(
|
|
129
|
+
return x(g);
|
|
122
130
|
}), c = v(
|
|
123
131
|
() => ({
|
|
124
|
-
headerComponent:
|
|
125
|
-
resizable:
|
|
132
|
+
headerComponent: C,
|
|
133
|
+
resizable: i.columnResizable,
|
|
126
134
|
suppressMovable: !0,
|
|
127
135
|
cellDataType: !1
|
|
128
136
|
})
|
|
129
137
|
);
|
|
130
138
|
return {
|
|
131
|
-
columnDefs:
|
|
139
|
+
columnDefs: u,
|
|
132
140
|
defaultColDef: c
|
|
133
141
|
};
|
|
134
142
|
};
|