@aplus-frontend/ui 6.39.2 → 6.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ag-grid/editable/form-item.vue.mjs +1 -0
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/editable/interface.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
- package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
- package/es/src/ag-grid/index.vue.mjs +162 -153
- package/es/src/ag-grid/interface.d.ts +19 -1
- package/es/src/ag-grid/theme.d.ts +2 -1
- package/es/src/ag-grid/theme.mjs +12 -11
- package/es/src/ap-action/interface.d.ts +5 -1
- package/es/src/ap-action/item/index.vue2.mjs +17 -16
- package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
- package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
- package/es/src/ap-grid/utils/col.mjs +91 -82
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
- package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +19 -1
- package/lib/src/ag-grid/theme.d.ts +2 -1
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-action/interface.d.ts +5 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getTableRenderProps as
|
|
2
|
-
import { rendererMap as
|
|
1
|
+
import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
|
|
2
|
+
import { rendererMap as h } from "../renderer/index.mjs";
|
|
3
3
|
import { isNumber as f, isFunction as m } from "lodash-unified";
|
|
4
4
|
import { ref as R, unref as x, computed as T } from "vue";
|
|
5
5
|
import "../components/body-cell/index.vue.mjs";
|
|
@@ -16,20 +16,20 @@ import v from "../components/header-cell/index.vue2.mjs";
|
|
|
16
16
|
function F(t) {
|
|
17
17
|
return f(t) && t > 1;
|
|
18
18
|
}
|
|
19
|
-
function M(t,
|
|
20
|
-
if (
|
|
21
|
-
return m(
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
19
|
+
function M(t, o) {
|
|
20
|
+
if (o.bodyCellTooltip)
|
|
21
|
+
return m(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
|
|
22
|
+
if (o.renderText)
|
|
23
|
+
return o.renderText({
|
|
24
24
|
value: t.value,
|
|
25
25
|
record: t.data,
|
|
26
|
-
column:
|
|
26
|
+
column: o,
|
|
27
27
|
text: t.value
|
|
28
28
|
});
|
|
29
|
-
const n =
|
|
29
|
+
const n = o.valueType || "text", d = h[n];
|
|
30
30
|
if (d) {
|
|
31
|
-
const p =
|
|
32
|
-
{ ...
|
|
31
|
+
const p = y(
|
|
32
|
+
{ ...o, valueType: n },
|
|
33
33
|
{
|
|
34
34
|
value: t.value,
|
|
35
35
|
text: t.value,
|
|
@@ -43,17 +43,18 @@ function M(t, a) {
|
|
|
43
43
|
}
|
|
44
44
|
return P(t.value);
|
|
45
45
|
}
|
|
46
|
-
const X = (t,
|
|
46
|
+
const X = (t, o, n) => {
|
|
47
47
|
const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
|
|
48
|
-
const
|
|
48
|
+
const a = {
|
|
49
49
|
cellRenderer: W,
|
|
50
50
|
cellRendererParams: {
|
|
51
51
|
column: r,
|
|
52
|
-
extraValueType: x(d)
|
|
52
|
+
extraValueType: x(d),
|
|
53
|
+
rowKey: o.rowKey
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
if (r.customRender)
|
|
56
|
-
return
|
|
57
|
+
return a;
|
|
57
58
|
if (r.renderText)
|
|
58
59
|
return {
|
|
59
60
|
valueFormatter: (i) => r.renderText({
|
|
@@ -63,10 +64,10 @@ const X = (t, a, n) => {
|
|
|
63
64
|
text: i.value
|
|
64
65
|
})
|
|
65
66
|
};
|
|
66
|
-
const l = r.valueType || "text", e =
|
|
67
|
+
const l = r.valueType || "text", e = h[l];
|
|
67
68
|
return e ? {
|
|
68
69
|
valueFormatter: (i) => {
|
|
69
|
-
const s =
|
|
70
|
+
const s = y(
|
|
70
71
|
{ ...r, valueType: l },
|
|
71
72
|
{
|
|
72
73
|
value: i.value,
|
|
@@ -79,18 +80,18 @@ const X = (t, a, n) => {
|
|
|
79
80
|
);
|
|
80
81
|
return e(s);
|
|
81
82
|
}
|
|
82
|
-
} :
|
|
83
|
+
} : a;
|
|
83
84
|
}, b = (r) => {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
85
|
+
const a = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
|
|
86
|
+
return a.tooltipValueGetter = l ? (s) => M(s, r) : void 0, a.wrapText = !r.ellipsis || e, a.cellStyle = {
|
|
86
87
|
"--ag-grid-line-clamp": i
|
|
87
|
-
},
|
|
88
|
+
}, a.tooltipComponent = z, a.tooltipComponentParams = {
|
|
88
89
|
lineClamp: i,
|
|
89
90
|
gridWrapperRef: u
|
|
90
|
-
},
|
|
91
|
+
}, a;
|
|
91
92
|
}, g = T(() => {
|
|
92
93
|
const r = x(t);
|
|
93
|
-
function
|
|
94
|
+
function a(l) {
|
|
94
95
|
return l.map((e) => {
|
|
95
96
|
const i = {
|
|
96
97
|
field: S(e.dataIndex),
|
|
@@ -130,15 +131,15 @@ const X = (t, a, n) => {
|
|
|
130
131
|
headerGroupComponentParams: {
|
|
131
132
|
column: e
|
|
132
133
|
},
|
|
133
|
-
children:
|
|
134
|
+
children: a(e.children)
|
|
134
135
|
} : i;
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
|
-
return
|
|
138
|
+
return a(r);
|
|
138
139
|
}), w = T(
|
|
139
140
|
() => ({
|
|
140
141
|
headerComponent: v,
|
|
141
|
-
resizable:
|
|
142
|
+
resizable: o.columnResizable,
|
|
142
143
|
suppressMovable: !0,
|
|
143
144
|
cellDataType: !1
|
|
144
145
|
})
|
|
@@ -1,93 +1,99 @@
|
|
|
1
|
-
import { unref as
|
|
2
|
-
import {
|
|
3
|
-
import { mergeClass as
|
|
1
|
+
import { unref as k, computed as w } from "vue";
|
|
2
|
+
import { isArray as m, isFunction as E } from "lodash-unified";
|
|
3
|
+
import { mergeClass as F, getColumnIsRequired as v } from "../../editable-table/utils.mjs";
|
|
4
4
|
import { updateFormProps as y, getFieldProps as q } from "../../ap-table/utils.mjs";
|
|
5
5
|
import { getFinalEditableNode as A } from "../../ap-grid/utils/editable.mjs";
|
|
6
6
|
import { isDef as K } from "../../utils/index.mjs";
|
|
7
7
|
import { getRowKey as M } from "../editable/utils.mjs";
|
|
8
|
-
function
|
|
9
|
-
t.__skipNextRefresh ? t.__skipNextRefresh[
|
|
8
|
+
function b(t, i, r) {
|
|
9
|
+
t.__skipNextRefresh ? t.__skipNextRefresh[i] = r : t.__skipNextRefresh = { [i]: r };
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
t.__prevEditable ? t.__prevEditable[
|
|
11
|
+
function S(t, i, r) {
|
|
12
|
+
t.__prevEditable ? t.__prevEditable[i] = r : t.__prevEditable = { [i]: r };
|
|
13
13
|
}
|
|
14
|
-
const J = (t,
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const J = (t, i, r) => {
|
|
15
|
+
function I(e) {
|
|
16
|
+
const s = e.editable, o = r ? [r] : m(t.name) ? t.name : [t.name];
|
|
17
|
+
return !s || e.children?.length ? {
|
|
18
|
+
_path: [...o]
|
|
19
|
+
} : {
|
|
20
|
+
customRender({ value: d, originalNode: C, params: a, ...n }) {
|
|
21
|
+
const c = E(e.editable) ? e.editable(
|
|
22
|
+
n.text,
|
|
23
|
+
n.record,
|
|
24
|
+
n.rowIndex
|
|
22
25
|
) : !!e.editable;
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
let u = C;
|
|
27
|
+
const R = m(e.dataIndex) ? e.dataIndex : [e.dataIndex], x = M(
|
|
28
|
+
n.record,
|
|
29
|
+
n.rowIndex,
|
|
30
|
+
t.rowKey
|
|
31
|
+
);
|
|
32
|
+
if (c) {
|
|
33
|
+
const _ = y(
|
|
26
34
|
e,
|
|
27
35
|
q(e.fieldProps, {
|
|
28
|
-
value:
|
|
29
|
-
...
|
|
36
|
+
value: d,
|
|
37
|
+
...n
|
|
30
38
|
})
|
|
31
|
-
),
|
|
32
|
-
t.onFieldChange && (
|
|
33
|
-
|
|
39
|
+
), h = {};
|
|
40
|
+
t.onFieldChange && (h[`onUpdate:${_.valuePropName || "value"}`] = (N) => t.onFieldChange?.(
|
|
41
|
+
n.rowIndex,
|
|
34
42
|
e.dataIndex,
|
|
35
|
-
|
|
43
|
+
N
|
|
36
44
|
));
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
t.rowKey
|
|
41
|
-
), N = {
|
|
42
|
-
name: [...C, String(R), ...I],
|
|
43
|
-
...u || {},
|
|
45
|
+
const p = {
|
|
46
|
+
name: [...o, String(x), ...R],
|
|
47
|
+
..._ || {},
|
|
44
48
|
field: {
|
|
45
49
|
style: "width: 100%",
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
class:
|
|
50
|
+
..._?.field || {},
|
|
51
|
+
...h,
|
|
52
|
+
class: F("is-editable", _.class)
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
|
-
|
|
55
|
+
u = A(
|
|
52
56
|
e,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
p,
|
|
58
|
+
n.record,
|
|
59
|
+
k(i)
|
|
56
60
|
);
|
|
57
61
|
}
|
|
58
|
-
e.customRender && (
|
|
59
|
-
value:
|
|
60
|
-
...
|
|
61
|
-
editable:
|
|
62
|
-
originalNode:
|
|
63
|
-
index:
|
|
64
|
-
renderIndex:
|
|
62
|
+
e.customRender && (u = e.customRender({
|
|
63
|
+
value: d,
|
|
64
|
+
...n,
|
|
65
|
+
editable: c,
|
|
66
|
+
originalNode: u,
|
|
67
|
+
index: n.rowIndex,
|
|
68
|
+
renderIndex: n.rowIndex,
|
|
69
|
+
path: [...o, String(x)]
|
|
65
70
|
}));
|
|
66
|
-
const
|
|
67
|
-
return !
|
|
68
|
-
|
|
69
|
-
rowNodes: [
|
|
70
|
-
columns: [
|
|
71
|
+
const l = a.node, f = a.column.getColId(), g = l.__prevEditable?.[f];
|
|
72
|
+
return !l.__skipNextRefresh?.[f] && K(g) && g !== c && (b(l, f, !0), setTimeout(() => {
|
|
73
|
+
a?.api.refreshCells({
|
|
74
|
+
rowNodes: [a.node],
|
|
75
|
+
columns: [a.column.getColId()],
|
|
71
76
|
force: !0
|
|
72
|
-
}),
|
|
73
|
-
}, 0)),
|
|
74
|
-
}
|
|
77
|
+
}), b(l, f, !1);
|
|
78
|
+
}, 0)), S(l, f, c), u;
|
|
79
|
+
},
|
|
80
|
+
_path: [...o]
|
|
75
81
|
};
|
|
76
82
|
}
|
|
77
|
-
return
|
|
83
|
+
return w(() => {
|
|
78
84
|
const e = t.columns;
|
|
79
85
|
if (!e)
|
|
80
86
|
return [];
|
|
81
|
-
function
|
|
82
|
-
return
|
|
87
|
+
function s(o) {
|
|
88
|
+
return o.map((d) => ({
|
|
83
89
|
...d,
|
|
84
90
|
_requireMark: v(d),
|
|
85
|
-
children:
|
|
91
|
+
children: s(d.children || []),
|
|
86
92
|
// 处理可编辑/不可编辑下的单元格渲染
|
|
87
|
-
...
|
|
93
|
+
...I(d)
|
|
88
94
|
}));
|
|
89
95
|
}
|
|
90
|
-
return
|
|
96
|
+
return s(e);
|
|
91
97
|
});
|
|
92
98
|
};
|
|
93
99
|
export {
|