@aplus-frontend/ui 7.19.8 → 7.20.1
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/components/tooltip/index.vue2.mjs +9 -9
- package/es/src/ag-grid/editable/form-item.vue.mjs +113 -93
- package/es/src/ag-grid/editable/index.vue.mjs +91 -79
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +74 -65
- package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
- package/es/src/ag-grid/index.vue.mjs +124 -120
- package/es/src/ag-grid/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/es/src/business/ag-grid-modal/constants.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +47 -37
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +30 -29
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +46 -45
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -4
- package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/es/src/business/ag-grid-modal/utils.mjs +34 -30
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +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 +7 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/constants.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- 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.js +1 -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 +4 -4
- package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- 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 { isNumber as u, isFunction as
|
|
2
|
-
import { ref as D, unref as
|
|
1
|
+
import { isNumber as u, isFunction as C } from "lodash-unified";
|
|
2
|
+
import { ref as D, unref as h, computed as c } from "vue";
|
|
3
3
|
import { dataIndexToField as P } from "../../ap-grid/utils/col.mjs";
|
|
4
4
|
import { getTableRenderProps as m, objectToString as G } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
@@ -7,30 +7,36 @@ import "../../utils/index.mjs";
|
|
|
7
7
|
import "../components/body-cell/index.vue.mjs";
|
|
8
8
|
import "../components/header-cell/index.vue.mjs";
|
|
9
9
|
import "../components/tooltip/index.vue.mjs";
|
|
10
|
-
import { rendererMap as
|
|
10
|
+
import { rendererMap as x } from "../renderer/index.mjs";
|
|
11
11
|
import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import W from "../components/body-cell/index.vue2.mjs";
|
|
14
14
|
import z from "../components/tooltip/index.vue2.mjs";
|
|
15
15
|
import { isDef as F } from "../../utils/is.mjs";
|
|
16
|
-
import
|
|
16
|
+
import b from "../components/header-cell/index.vue2.mjs";
|
|
17
17
|
function M(t) {
|
|
18
18
|
return u(t) && t > 1;
|
|
19
19
|
}
|
|
20
|
-
function V(t,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
function V(t, o) {
|
|
21
|
+
return (a) => ({
|
|
22
|
+
...C(o) ? o(a) : o ?? {},
|
|
23
|
+
...t
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function j(t, o) {
|
|
27
|
+
if (o.bodyCellTooltip)
|
|
28
|
+
return C(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
|
|
29
|
+
if (o.renderText)
|
|
30
|
+
return o.renderText({
|
|
25
31
|
value: t.value,
|
|
26
32
|
record: t.data,
|
|
27
|
-
column:
|
|
33
|
+
column: o,
|
|
28
34
|
text: t.value
|
|
29
35
|
});
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
36
|
+
const a = o.valueType || "text", s = x[a];
|
|
37
|
+
if (s) {
|
|
32
38
|
const f = m(
|
|
33
|
-
{ ...
|
|
39
|
+
{ ...o, valueType: a },
|
|
34
40
|
{
|
|
35
41
|
value: t.value,
|
|
36
42
|
text: t.value,
|
|
@@ -40,68 +46,71 @@ function V(t, i) {
|
|
|
40
46
|
pinned: t.node?.rowPinned
|
|
41
47
|
}
|
|
42
48
|
);
|
|
43
|
-
return
|
|
49
|
+
return s(f);
|
|
44
50
|
}
|
|
45
51
|
return G(t.value);
|
|
46
52
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
53
|
+
const ee = (t, o, a, s) => {
|
|
54
|
+
const T = I("valueTypeMap"), f = D(), { em: v } = _("ag-grid"), w = (r) => {
|
|
55
|
+
const i = {
|
|
50
56
|
cellRenderer: W,
|
|
51
57
|
cellRendererParams: {
|
|
52
58
|
column: r,
|
|
53
|
-
extraValueType:
|
|
54
|
-
rowKey:
|
|
59
|
+
extraValueType: h(T),
|
|
60
|
+
rowKey: o.rowKey
|
|
55
61
|
}
|
|
56
62
|
};
|
|
57
63
|
if (r.customRender)
|
|
58
|
-
return
|
|
64
|
+
return i;
|
|
59
65
|
if (r.renderText)
|
|
60
66
|
return {
|
|
61
|
-
valueFormatter: (
|
|
62
|
-
value:
|
|
63
|
-
record:
|
|
67
|
+
valueFormatter: (l) => r.renderText({
|
|
68
|
+
value: l.value,
|
|
69
|
+
record: l.data,
|
|
64
70
|
column: r,
|
|
65
|
-
text:
|
|
71
|
+
text: l.value
|
|
66
72
|
})
|
|
67
73
|
};
|
|
68
|
-
const
|
|
74
|
+
const n = r.valueType || "text", e = x[n];
|
|
69
75
|
return e ? {
|
|
70
|
-
valueFormatter: (
|
|
71
|
-
const
|
|
72
|
-
{ ...r, valueType:
|
|
76
|
+
valueFormatter: (l) => {
|
|
77
|
+
const d = m(
|
|
78
|
+
{ ...r, valueType: n },
|
|
73
79
|
{
|
|
74
|
-
value:
|
|
75
|
-
text:
|
|
76
|
-
record:
|
|
77
|
-
column:
|
|
78
|
-
rowIndex:
|
|
79
|
-
pinned:
|
|
80
|
+
value: l.value,
|
|
81
|
+
text: l.value,
|
|
82
|
+
record: l.data,
|
|
83
|
+
column: l.column,
|
|
84
|
+
rowIndex: l.node?.rowIndex,
|
|
85
|
+
pinned: l.node?.rowPinned
|
|
80
86
|
}
|
|
81
87
|
);
|
|
82
|
-
return e(
|
|
88
|
+
return e(d);
|
|
83
89
|
}
|
|
84
|
-
} :
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
return e.tooltipValueGetter =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
} : i;
|
|
91
|
+
}, S = (r) => {
|
|
92
|
+
const i = r.valueType || "text", n = x[i], e = {}, l = r.bodyCellTooltip || !r.customRender && n && (r.ellipsis === !0 || r.ellipsis === "tooltip" || u(r.ellipsis)), d = u(r.ellipsis) && r.ellipsis > 1, p = u(r.ellipsis) ? r.ellipsis : 1;
|
|
93
|
+
return e.tooltipValueGetter = l ? (y) => j(y, r) : void 0, e.wrapText = !r.ellipsis || d, e.cellStyle = V(
|
|
94
|
+
{
|
|
95
|
+
"--ag-grid-line-clamp": p
|
|
96
|
+
},
|
|
97
|
+
r.cellStyle
|
|
98
|
+
), e.tooltipComponent = z, e.tooltipComponentParams = {
|
|
99
|
+
lineClamp: p,
|
|
91
100
|
gridWrapperRef: f
|
|
92
101
|
}, e;
|
|
93
|
-
},
|
|
94
|
-
const r =
|
|
95
|
-
function
|
|
96
|
-
return
|
|
97
|
-
const
|
|
102
|
+
}, g = c(() => {
|
|
103
|
+
const r = h(t);
|
|
104
|
+
function i(n) {
|
|
105
|
+
return n.map((e) => {
|
|
106
|
+
const l = {
|
|
98
107
|
field: P(e.dataIndex),
|
|
99
108
|
colId: F(e.key) ? String(e.key) : void 0,
|
|
100
109
|
sortable: !!e.sorter,
|
|
101
110
|
comparator: e.sorter === !0 ? () => 0 : e.sorter,
|
|
102
111
|
headerComponentParams: {
|
|
103
112
|
column: e,
|
|
104
|
-
headerCell:
|
|
113
|
+
headerCell: s
|
|
105
114
|
},
|
|
106
115
|
resizable: e.resizable,
|
|
107
116
|
width: e.width,
|
|
@@ -115,12 +124,12 @@ const Z = (t, i, p, d) => {
|
|
|
115
124
|
// undefined to null
|
|
116
125
|
colSpan: e.colSpan,
|
|
117
126
|
spanRows: e.spanRows,
|
|
118
|
-
cellClass:
|
|
119
|
-
const
|
|
127
|
+
cellClass: a((d) => {
|
|
128
|
+
const p = e.cellClass || "", y = C(p) ? p(d.data, d.node) : p;
|
|
120
129
|
return [
|
|
121
|
-
`${
|
|
122
|
-
M(e.ellipsis) ?
|
|
123
|
-
|
|
130
|
+
`${v("cell", e.align || "left")}`,
|
|
131
|
+
M(e.ellipsis) ? v("cell", "multiline") : null,
|
|
132
|
+
y
|
|
124
133
|
].flat().filter(Boolean);
|
|
125
134
|
}),
|
|
126
135
|
cellStyle: e.cellStyle,
|
|
@@ -129,35 +138,35 @@ const Z = (t, i, p, d) => {
|
|
|
129
138
|
columnGroupShow: e.columnGroupShow,
|
|
130
139
|
autoHeight: !0,
|
|
131
140
|
// 设置自动计算高度以自适应多行换行的场景
|
|
132
|
-
...
|
|
141
|
+
...S(e),
|
|
133
142
|
...w(e)
|
|
134
143
|
};
|
|
135
144
|
return e.children?.length ? {
|
|
136
|
-
...
|
|
137
|
-
headerGroupComponent:
|
|
145
|
+
...l,
|
|
146
|
+
headerGroupComponent: b,
|
|
138
147
|
headerGroupComponentParams: {
|
|
139
148
|
column: e,
|
|
140
|
-
headerCell:
|
|
149
|
+
headerCell: s
|
|
141
150
|
},
|
|
142
|
-
children:
|
|
143
|
-
} :
|
|
151
|
+
children: i(e.children)
|
|
152
|
+
} : l;
|
|
144
153
|
});
|
|
145
154
|
}
|
|
146
|
-
return
|
|
147
|
-
}), R =
|
|
155
|
+
return i(r);
|
|
156
|
+
}), R = c(
|
|
148
157
|
() => ({
|
|
149
|
-
headerComponent:
|
|
150
|
-
resizable:
|
|
158
|
+
headerComponent: b,
|
|
159
|
+
resizable: o.columnResizable,
|
|
151
160
|
suppressMovable: !0,
|
|
152
161
|
cellDataType: !1
|
|
153
162
|
})
|
|
154
163
|
);
|
|
155
164
|
return {
|
|
156
|
-
columnDefs:
|
|
165
|
+
columnDefs: g,
|
|
157
166
|
defaultColDef: R,
|
|
158
167
|
gridWrapperRef: f
|
|
159
168
|
};
|
|
160
169
|
};
|
|
161
170
|
export {
|
|
162
|
-
|
|
171
|
+
ee as useColumnsDef
|
|
163
172
|
};
|
|
@@ -1,175 +1,149 @@
|
|
|
1
|
-
import { isFunction as
|
|
2
|
-
import { shallowRef as
|
|
1
|
+
import { isFunction as K, isUndefined as S, isNumber as d, cloneDeep as T, isArray as x, isString as z } from "lodash-unified";
|
|
2
|
+
import { shallowRef as G, computed as N, unref as w, isRef as V } from "vue";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { isDef as
|
|
6
|
-
let
|
|
4
|
+
import { useDevWarning as W } from "../../utils/warning.mjs";
|
|
5
|
+
import { isDef as I } from "../../utils/is.mjs";
|
|
6
|
+
let $ = 0;
|
|
7
7
|
function F() {
|
|
8
|
-
return `_ag_grid${
|
|
8
|
+
return `_ag_grid${$++}`;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const r =
|
|
14
|
-
if (
|
|
10
|
+
const Q = (u, g, i, y) => {
|
|
11
|
+
const h = W("EditableAgGrid"), l = G([]), m = N(() => V(g) ? w(g) : g);
|
|
12
|
+
function a(e, o) {
|
|
13
|
+
const r = w(i)?.length || 0;
|
|
14
|
+
if (I(u.maxLength) && r >= u.maxLength || !e && K(u.rowKey))
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
...
|
|
16
|
+
const t = {
|
|
17
|
+
...e || { [u.rowKey]: F() }
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
i.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
f.value = [u];
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
z(o) ? f.value.push(u) : (w.value = f.value.map(
|
|
30
|
-
(l, v) => v < o ? null : c(l, v, i.rowKey)
|
|
31
|
-
).filter(Boolean), f.value.splice(o, 0, u));
|
|
32
|
-
}
|
|
33
|
-
);
|
|
19
|
+
if (!i.value) {
|
|
20
|
+
i.value = [t];
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
S(o) ? i.value.push(t) : (l.value = i.value.map(
|
|
24
|
+
(n, f) => f < o ? null : c(n, f, u.rowKey)
|
|
25
|
+
).filter(Boolean), i.value.splice(o, 0, t));
|
|
34
26
|
}
|
|
35
|
-
function
|
|
36
|
-
const r =
|
|
37
|
-
if (
|
|
27
|
+
function B(e, o = "suffix") {
|
|
28
|
+
const r = w(i)?.length || 0, t = d(e) ? e : e.length;
|
|
29
|
+
if (I(u.maxLength) && r + t > u.maxLength || d(e) && K(u.rowKey))
|
|
38
30
|
return;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
i.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
o === "suffix" ? f.value.push(...t) : (w.value = f.value.map(
|
|
50
|
-
(v, S) => c(v, S, i.rowKey)
|
|
51
|
-
), f.value.unshift(...t));
|
|
52
|
-
}
|
|
53
|
-
);
|
|
31
|
+
const n = d(e) ? new Array(e).fill(0).map(() => ({ [u.rowKey]: F() })) : T(e);
|
|
32
|
+
if (!i.value) {
|
|
33
|
+
i.value = [...n];
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
o === "suffix" ? i.value.push(...n) : (l.value = i.value.map(
|
|
37
|
+
(f, s) => c(f, s, u.rowKey)
|
|
38
|
+
), i.value.unshift(...n));
|
|
54
39
|
}
|
|
55
|
-
function
|
|
56
|
-
const o = x(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
!0,
|
|
61
|
-
(r, u) => {
|
|
62
|
-
for (const e of o) {
|
|
63
|
-
const l = c(e, void 0, i.rowKey);
|
|
64
|
-
delete r[u][l];
|
|
65
|
-
}
|
|
66
|
-
const t = f.value.filter(
|
|
67
|
-
(e) => !o.includes(e)
|
|
68
|
-
), s = f.value.findIndex(
|
|
69
|
-
(e) => o.includes(e)
|
|
70
|
-
);
|
|
71
|
-
w.value = f.value.map(
|
|
72
|
-
(e, l) => l <= s ? null : c(e, l, i.rowKey)
|
|
73
|
-
).filter(Boolean), g?.(t);
|
|
74
|
-
}
|
|
40
|
+
function L(e) {
|
|
41
|
+
const o = x(e) ? e : [e], r = i.value.filter(
|
|
42
|
+
(n) => !o.includes(n)
|
|
43
|
+
), t = i.value.findIndex(
|
|
44
|
+
(n) => o.includes(n)
|
|
75
45
|
);
|
|
46
|
+
l.value = i.value.map(
|
|
47
|
+
(n, f) => f <= t ? null : c(n, f, u.rowKey)
|
|
48
|
+
).filter(Boolean), y?.(r);
|
|
76
49
|
}
|
|
77
|
-
function c(
|
|
50
|
+
function c(e, o, r) {
|
|
78
51
|
if (r)
|
|
79
|
-
return
|
|
52
|
+
return z(r) ? e[r] : r(e, o);
|
|
80
53
|
}
|
|
81
|
-
function
|
|
82
|
-
const o = new Set(x(
|
|
83
|
-
o.size
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
!
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
delete r[u][e];
|
|
90
|
-
const t = f.value.filter(
|
|
91
|
-
(e, l) => !o.has(c(e, l, i.rowKey))
|
|
92
|
-
), s = f.value.findIndex(
|
|
93
|
-
(e, l) => o.has(c(e, l, i.rowKey))
|
|
94
|
-
);
|
|
95
|
-
w.value = f.value.map(
|
|
96
|
-
(e, l) => l <= s ? null : c(e, l, i.rowKey)
|
|
97
|
-
).filter(Boolean), g?.(t);
|
|
98
|
-
}
|
|
54
|
+
function U(e) {
|
|
55
|
+
const o = new Set(x(e) ? e : [e]);
|
|
56
|
+
if (o.size === 0)
|
|
57
|
+
return;
|
|
58
|
+
const r = i.value.filter(
|
|
59
|
+
(n, f) => !o.has(c(n, f, u.rowKey))
|
|
60
|
+
), t = i.value.findIndex(
|
|
61
|
+
(n, f) => o.has(c(n, f, u.rowKey))
|
|
99
62
|
);
|
|
63
|
+
l.value = i.value.map(
|
|
64
|
+
(n, f) => f <= t ? null : c(n, f, u.rowKey)
|
|
65
|
+
).filter(Boolean), y?.(r);
|
|
100
66
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
67
|
+
function j(e) {
|
|
68
|
+
return h(
|
|
69
|
+
!u.supressForceRowUpdate,
|
|
70
|
+
"usage",
|
|
71
|
+
'Avoid using getRowData/setRowData methods while suppressForceRowUpdate is enabled."'
|
|
72
|
+
), w(i)?.[e];
|
|
103
73
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
-
(o, r) => c(o, r,
|
|
74
|
+
function k(e) {
|
|
75
|
+
return i.value?.find(
|
|
76
|
+
(o, r) => c(o, r, u.rowKey) === e
|
|
107
77
|
);
|
|
108
78
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
79
|
+
function A() {
|
|
80
|
+
return w(i);
|
|
111
81
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
82
|
+
function O(e, o, r = !0) {
|
|
83
|
+
h(
|
|
84
|
+
!u.supressForceRowUpdate,
|
|
85
|
+
"usage",
|
|
86
|
+
'Avoid using getRowData/setRowData methods while suppressForceRowUpdate is enabled."'
|
|
87
|
+
), m.value?.setFieldValue?.(
|
|
88
|
+
u.name,
|
|
115
89
|
void 0,
|
|
116
90
|
!0,
|
|
117
|
-
(
|
|
118
|
-
const
|
|
119
|
-
(
|
|
91
|
+
(t, n) => {
|
|
92
|
+
const f = i.value.findIndex(
|
|
93
|
+
(R, v) => e === v
|
|
120
94
|
);
|
|
121
|
-
if (!~
|
|
95
|
+
if (!~f)
|
|
122
96
|
return;
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
97
|
+
const s = c(
|
|
98
|
+
i.value[f],
|
|
99
|
+
f,
|
|
100
|
+
u.rowKey
|
|
127
101
|
);
|
|
128
|
-
if (
|
|
102
|
+
if (s && !(!t[n] || !t[n][s])) {
|
|
129
103
|
if (!r) {
|
|
130
|
-
const
|
|
131
|
-
for (const v of
|
|
132
|
-
v !==
|
|
104
|
+
const R = Object.keys(t[n][s]);
|
|
105
|
+
for (const v of R)
|
|
106
|
+
v !== u.rowKey && delete t[n][s][v];
|
|
133
107
|
}
|
|
134
|
-
Object.assign(
|
|
108
|
+
Object.assign(t[n][s], { ...o });
|
|
135
109
|
}
|
|
136
110
|
}
|
|
137
111
|
);
|
|
138
112
|
}
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
|
|
113
|
+
function _(e, o, r = !0) {
|
|
114
|
+
m.value?.setFieldValue?.(
|
|
115
|
+
u.name,
|
|
142
116
|
void 0,
|
|
143
117
|
!0,
|
|
144
|
-
(
|
|
145
|
-
if (!(!
|
|
118
|
+
(t, n) => {
|
|
119
|
+
if (!(!t[n] || !t[n][e])) {
|
|
146
120
|
if (!r) {
|
|
147
|
-
const
|
|
148
|
-
for (const
|
|
149
|
-
|
|
121
|
+
const f = Object.keys(t[n][e]);
|
|
122
|
+
for (const s of f)
|
|
123
|
+
s !== u.rowKey && delete t[n][s][s];
|
|
150
124
|
}
|
|
151
|
-
Object.assign(
|
|
125
|
+
Object.assign(t[n][e], { ...o });
|
|
152
126
|
}
|
|
153
127
|
}
|
|
154
128
|
);
|
|
155
129
|
}
|
|
156
|
-
function
|
|
157
|
-
y
|
|
130
|
+
function E() {
|
|
131
|
+
y?.([]);
|
|
158
132
|
}
|
|
159
133
|
return {
|
|
160
|
-
add:
|
|
161
|
-
addMultiple:
|
|
162
|
-
remove:
|
|
163
|
-
removeByKey:
|
|
164
|
-
getRowData:
|
|
165
|
-
getRowsData:
|
|
166
|
-
setRowDataByKey:
|
|
167
|
-
setRowData:
|
|
168
|
-
clear:
|
|
169
|
-
refreshRowIds:
|
|
170
|
-
getRowDataByKey:
|
|
134
|
+
add: a,
|
|
135
|
+
addMultiple: B,
|
|
136
|
+
remove: L,
|
|
137
|
+
removeByKey: U,
|
|
138
|
+
getRowData: j,
|
|
139
|
+
getRowsData: A,
|
|
140
|
+
setRowDataByKey: _,
|
|
141
|
+
setRowData: O,
|
|
142
|
+
clear: E,
|
|
143
|
+
refreshRowIds: l,
|
|
144
|
+
getRowDataByKey: k
|
|
171
145
|
};
|
|
172
146
|
};
|
|
173
147
|
export {
|
|
174
|
-
|
|
148
|
+
Q as useEditableApi
|
|
175
149
|
};
|
|
@@ -5,7 +5,6 @@ import { EditableAgGridProps } from '../editable/interface';
|
|
|
5
5
|
export declare const useEditableFormItemApi: <RecordType>(props: EditableAgGridProps<RecordType>, formApi: ApFormInternalInstance | undefined, tableData: Ref<RecordType[]>, shadowName: string) => {
|
|
6
6
|
add: (defaultValue?: Partial<RecordType>, insertIndex?: number) => void;
|
|
7
7
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
|
|
8
|
-
__addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix", overwriting?: boolean) => void;
|
|
9
8
|
remove: (data: RecordType | RecordType[]) => void;
|
|
10
9
|
removeByKey: (key: Key | Key[]) => void;
|
|
11
10
|
getRowData: (index: number) => RecordType;
|