@aplus-frontend/ui 7.19.6 → 7.19.8
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 +66 -62
- package/es/src/ag-grid/editable/index.vue.mjs +56 -52
- package/es/src/ag-grid/editable/interface.d.ts +9 -0
- package/es/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +117 -99
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +125 -107
- package/es/src/ap-button/ap-button.vue.mjs +23 -23
- package/es/src/ap-button/interface.d.ts +1 -1
- package/es/src/ap-button/utils/index.d.ts +1 -1
- package/es/src/ap-button/utils/index.mjs +7 -7
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +49 -47
- package/es/src/business/ag-grid-modal/interface.d.ts +2 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +24 -22
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- 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 +9 -0
- package/lib/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
- 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 +1 -0
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/interface.d.ts +1 -1
- package/lib/src/ap-button/utils/index.d.ts +1 -1
- package/lib/src/ap-button/utils/index.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 +2 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,157 +1,175 @@
|
|
|
1
|
-
import { isFunction as h, isUndefined as
|
|
2
|
-
import { shallowRef as
|
|
1
|
+
import { isFunction as h, isUndefined as z, isNumber as m, cloneDeep as A, isArray as x, isString as E } from "lodash-unified";
|
|
2
|
+
import { shallowRef as N, computed as U, unref as d, isRef as $ } from "vue";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
|
-
import { arrayToObject as
|
|
4
|
+
import { arrayToObject as q } from "../editable/utils.mjs";
|
|
5
5
|
import { isDef as R } from "../../utils/is.mjs";
|
|
6
|
-
let
|
|
7
|
-
function
|
|
8
|
-
return `_ag_grid${
|
|
6
|
+
let C = 0;
|
|
7
|
+
function F() {
|
|
8
|
+
return `_ag_grid${C++}`;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
const w =
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (R(
|
|
10
|
+
const W = (i, K, f, g) => {
|
|
11
|
+
const w = N([]), y = U(() => $(K) ? d(K) : K);
|
|
12
|
+
function I(n, o) {
|
|
13
|
+
const r = d(f)?.length || 0;
|
|
14
|
+
if (R(i.maxLength) && r >= i.maxLength || !n && h(i.rowKey))
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
...n || { [
|
|
16
|
+
const u = {
|
|
17
|
+
...n || { [i.rowKey]: F() }
|
|
18
18
|
};
|
|
19
19
|
y.value?.setFieldValue?.(
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
i.name,
|
|
21
|
+
u,
|
|
22
22
|
!0,
|
|
23
|
-
(
|
|
24
|
-
const e =
|
|
25
|
-
if (
|
|
26
|
-
|
|
23
|
+
(t, s) => {
|
|
24
|
+
const e = c(u, void 0, i.rowKey);
|
|
25
|
+
if (t[s] ? t[s][e] = u : t[s] = { [e]: u }, !f.value) {
|
|
26
|
+
f.value = [u];
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
(
|
|
31
|
-
).filter(Boolean),
|
|
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
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
function j(n,
|
|
36
|
-
const
|
|
37
|
-
if (R(
|
|
35
|
+
function j(n, o = "suffix") {
|
|
36
|
+
const r = d(f)?.length || 0, u = m(n) ? n : n.length;
|
|
37
|
+
if (R(i.maxLength) && r + u > i.maxLength || m(n) && h(i.rowKey))
|
|
38
38
|
return;
|
|
39
|
-
const
|
|
39
|
+
const t = m(n) ? new Array(n).fill(0).map(() => ({ [i.rowKey]: F() })) : A(n), s = q(t, i.rowKey);
|
|
40
40
|
y.value?.setFieldValue?.(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
i.name,
|
|
42
|
+
t,
|
|
43
43
|
!0,
|
|
44
|
-
(e,
|
|
45
|
-
if (e[
|
|
46
|
-
|
|
44
|
+
(e, l) => {
|
|
45
|
+
if (e[l] ? Object.assign(e[l], s) : e[l] = s, !f.value) {
|
|
46
|
+
f.value = [...t];
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
(v,
|
|
51
|
-
),
|
|
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
52
|
}
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
55
|
+
function O(n) {
|
|
56
|
+
const o = x(n) ? n : [n];
|
|
57
57
|
y.value?.setFieldValue?.(
|
|
58
|
-
|
|
58
|
+
i.name,
|
|
59
59
|
void 0,
|
|
60
60
|
!0,
|
|
61
|
-
(
|
|
62
|
-
for (const e of
|
|
63
|
-
const
|
|
64
|
-
delete
|
|
61
|
+
(r, u) => {
|
|
62
|
+
for (const e of o) {
|
|
63
|
+
const l = c(e, void 0, i.rowKey);
|
|
64
|
+
delete r[u][l];
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
(e) => !
|
|
68
|
-
),
|
|
69
|
-
(e) =>
|
|
66
|
+
const t = f.value.filter(
|
|
67
|
+
(e) => !o.includes(e)
|
|
68
|
+
), s = f.value.findIndex(
|
|
69
|
+
(e) => o.includes(e)
|
|
70
70
|
);
|
|
71
|
-
w.value =
|
|
72
|
-
(e,
|
|
73
|
-
).filter(Boolean), g?.(
|
|
71
|
+
w.value = f.value.map(
|
|
72
|
+
(e, l) => l <= s ? null : c(e, l, i.rowKey)
|
|
73
|
+
).filter(Boolean), g?.(t);
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
77
|
+
function c(n, o, r) {
|
|
78
|
+
if (r)
|
|
79
|
+
return E(r) ? n[r] : r(n, o);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
function k(n) {
|
|
82
|
+
const o = new Set(x(n) ? n : [n]);
|
|
83
|
+
o.size !== 0 && y.value?.setFieldValue?.(
|
|
84
|
+
i.name,
|
|
85
85
|
void 0,
|
|
86
86
|
!0,
|
|
87
|
-
(
|
|
88
|
-
for (const e of
|
|
89
|
-
delete
|
|
90
|
-
const
|
|
91
|
-
(e,
|
|
92
|
-
),
|
|
93
|
-
(e,
|
|
87
|
+
(r, u) => {
|
|
88
|
+
for (const e of o)
|
|
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
94
|
);
|
|
95
|
-
w.value =
|
|
96
|
-
(e,
|
|
97
|
-
).filter(Boolean), g?.(
|
|
95
|
+
w.value = f.value.map(
|
|
96
|
+
(e, l) => l <= s ? null : c(e, l, i.rowKey)
|
|
97
|
+
).filter(Boolean), g?.(t);
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
return d(
|
|
101
|
+
function B(n) {
|
|
102
|
+
return d(f)?.[n];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
-
(
|
|
104
|
+
function V(n) {
|
|
105
|
+
return f.value?.find(
|
|
106
|
+
(o, r) => c(o, r, i.rowKey) === n
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return d(
|
|
109
|
+
function a() {
|
|
110
|
+
return d(f);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function L(n, o, r = !0) {
|
|
113
113
|
y.value?.setFieldValue?.(
|
|
114
|
-
|
|
114
|
+
i.name,
|
|
115
115
|
void 0,
|
|
116
116
|
!0,
|
|
117
|
-
(
|
|
118
|
-
const
|
|
119
|
-
(
|
|
117
|
+
(u, t) => {
|
|
118
|
+
const s = f.value.findIndex(
|
|
119
|
+
(l, v) => n === v
|
|
120
120
|
);
|
|
121
|
-
if (!~
|
|
121
|
+
if (!~s)
|
|
122
122
|
return;
|
|
123
|
-
const e =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
const e = c(
|
|
124
|
+
f.value[s],
|
|
125
|
+
s,
|
|
126
|
+
i.rowKey
|
|
127
127
|
);
|
|
128
|
-
if (e && !(!
|
|
129
|
-
if (!
|
|
130
|
-
const
|
|
131
|
-
for (const v of
|
|
132
|
-
v !==
|
|
128
|
+
if (e && !(!u[t] || !u[t][e])) {
|
|
129
|
+
if (!r) {
|
|
130
|
+
const l = Object.keys(u[t][e]);
|
|
131
|
+
for (const v of l)
|
|
132
|
+
v !== i.rowKey && delete u[t][e][v];
|
|
133
|
+
}
|
|
134
|
+
Object.assign(u[t][e], { ...o });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
function T(n, o, r = !0) {
|
|
140
|
+
y.value?.setFieldValue?.(
|
|
141
|
+
i.name,
|
|
142
|
+
void 0,
|
|
143
|
+
!0,
|
|
144
|
+
(u, t) => {
|
|
145
|
+
if (!(!u[t] || !u[t][n])) {
|
|
146
|
+
if (!r) {
|
|
147
|
+
const s = Object.keys(u[t][n]);
|
|
148
|
+
for (const e of s)
|
|
149
|
+
e !== i.rowKey && delete u[t][e][e];
|
|
133
150
|
}
|
|
134
|
-
Object.assign(
|
|
151
|
+
Object.assign(u[t][n], { ...o });
|
|
135
152
|
}
|
|
136
153
|
}
|
|
137
154
|
);
|
|
138
155
|
}
|
|
139
|
-
function
|
|
140
|
-
y.value?.setFieldValue?.(
|
|
156
|
+
function _() {
|
|
157
|
+
y.value?.setFieldValue?.(i.name, {}), g?.([]);
|
|
141
158
|
}
|
|
142
159
|
return {
|
|
143
|
-
add:
|
|
160
|
+
add: I,
|
|
144
161
|
addMultiple: j,
|
|
145
|
-
remove:
|
|
146
|
-
removeByKey:
|
|
147
|
-
getRowData:
|
|
148
|
-
getRowsData:
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
remove: O,
|
|
163
|
+
removeByKey: k,
|
|
164
|
+
getRowData: B,
|
|
165
|
+
getRowsData: a,
|
|
166
|
+
setRowDataByKey: T,
|
|
167
|
+
setRowData: L,
|
|
168
|
+
clear: _,
|
|
151
169
|
refreshRowIds: w,
|
|
152
|
-
getRowDataByKey:
|
|
170
|
+
getRowDataByKey: V
|
|
153
171
|
};
|
|
154
172
|
};
|
|
155
173
|
export {
|
|
156
|
-
|
|
174
|
+
W as useEditableApi
|
|
157
175
|
};
|
|
@@ -10,6 +10,7 @@ export declare const useEditableFormItemApi: <RecordType>(props: EditableAgGridP
|
|
|
10
10
|
removeByKey: (key: Key | Key[]) => void;
|
|
11
11
|
getRowData: (index: number) => RecordType;
|
|
12
12
|
getRowsData: () => RecordType[];
|
|
13
|
+
setRowDataByKey: (key: any, payload: any, merge?: boolean) => void;
|
|
13
14
|
setRowData: (index: number, payload: any, merge?: boolean) => void;
|
|
14
15
|
clear: () => void;
|
|
15
16
|
refreshRowIds: ShallowRef<string[], string[]>;
|
|
@@ -1,187 +1,205 @@
|
|
|
1
|
-
import { isFunction as V, isUndefined as R, isNumber as F, cloneDeep as
|
|
2
|
-
import { shallowRef as
|
|
1
|
+
import { isFunction as V, isUndefined as R, isNumber as F, cloneDeep as q, isArray as j } from "lodash-unified";
|
|
2
|
+
import { shallowRef as C, unref as h } from "vue";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
|
-
import { getRowKey as y, arrayToObject as
|
|
5
|
-
import { isDef as
|
|
6
|
-
let
|
|
7
|
-
function
|
|
8
|
-
return `_ag_grid${
|
|
4
|
+
import { getRowKey as y, arrayToObject as G } from "../editable/utils.mjs";
|
|
5
|
+
import { isDef as O } from "../../utils/is.mjs";
|
|
6
|
+
let H = 0;
|
|
7
|
+
function B() {
|
|
8
|
+
return `_ag_grid${H++}`;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
const d =
|
|
12
|
-
function
|
|
13
|
-
const v = h(
|
|
14
|
-
if (
|
|
10
|
+
const Y = (l, r, i, w) => {
|
|
11
|
+
const d = C([]);
|
|
12
|
+
function I(u, t) {
|
|
13
|
+
const v = h(i)?.length || 0;
|
|
14
|
+
if (O(l.maxLength) && v >= l.maxLength || !u && V(l.rowKey))
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
...
|
|
16
|
+
const n = {
|
|
17
|
+
...u || { [l.rowKey]: B() }
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
r?.setFieldValue(
|
|
20
20
|
w,
|
|
21
|
-
|
|
21
|
+
n,
|
|
22
22
|
!1,
|
|
23
|
-
(
|
|
24
|
-
const e = y(
|
|
25
|
-
o
|
|
26
|
-
(
|
|
27
|
-
).filter(Boolean),
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
(s, o) => {
|
|
24
|
+
const e = y(n, void 0, l.rowKey);
|
|
25
|
+
s[o] ? s[o][e] = n : s[o] = { [e]: n }, i.value ? R(t) ? i.value.push(n) : (d.value = i.value.map(
|
|
26
|
+
(f, c) => c < t ? null : y(f, c, l.rowKey)
|
|
27
|
+
).filter(Boolean), i.value.splice(t, 0, n)) : i.value = [n], r?.setFieldValue(
|
|
28
|
+
l.name,
|
|
29
|
+
n,
|
|
30
30
|
!0,
|
|
31
|
-
(
|
|
32
|
-
if (!
|
|
33
|
-
|
|
31
|
+
(f, c) => {
|
|
32
|
+
if (!f[c]) {
|
|
33
|
+
f[c] = [n];
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
R(
|
|
36
|
+
R(t) ? f[c].push(n) : f[c].splice(t, 0, n);
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
function x(
|
|
43
|
-
if (!
|
|
42
|
+
function x(u, t = "suffix", v = !1) {
|
|
43
|
+
if (!u)
|
|
44
44
|
return;
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const n = h(i)?.length || 0, s = F(u) ? u : u.length;
|
|
46
|
+
if (O(l.maxLength) && n + s > l.maxLength || F(u) && V(l.rowKey))
|
|
47
47
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const o = F(u) ? new Array(u).fill(0).map(() => ({ [l.rowKey]: B() })) : q(u), e = G(o, l.rowKey);
|
|
49
|
+
r?.setFieldValue(
|
|
50
50
|
w,
|
|
51
51
|
e,
|
|
52
52
|
!1,
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
),
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
(f, c) => {
|
|
54
|
+
f[c] ? Object.assign(f[c], e) : f[c] = e, i.value ? t === "suffix" ? i.value.push(...o) : (d.value = i.value.map(
|
|
55
|
+
(K, g) => y(K, g, l.rowKey)
|
|
56
|
+
), i.value.unshift(...o)) : i.value = [...o], r?.setFieldValue(
|
|
57
|
+
l.name,
|
|
58
|
+
o,
|
|
59
59
|
!0,
|
|
60
|
-
(
|
|
61
|
-
if (!g
|
|
62
|
-
g
|
|
60
|
+
(K, g) => {
|
|
61
|
+
if (!K[g] || v) {
|
|
62
|
+
K[g] = [...o];
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
t === "suffix" ? K[g].push(...o) : K[g].unshift(...o);
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
x(
|
|
71
|
+
function _(u, t = "suffix") {
|
|
72
|
+
x(u, t, !1);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
76
|
-
|
|
74
|
+
function k(u) {
|
|
75
|
+
const t = j(u) ? u : [u];
|
|
76
|
+
r?.setFieldValue(
|
|
77
77
|
w,
|
|
78
78
|
void 0,
|
|
79
79
|
!1,
|
|
80
|
-
(v,
|
|
81
|
-
for (const e of
|
|
82
|
-
const
|
|
83
|
-
delete v[
|
|
80
|
+
(v, n) => {
|
|
81
|
+
for (const e of t) {
|
|
82
|
+
const f = y(e, void 0, l.rowKey);
|
|
83
|
+
delete v[n][f];
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
(e) => !
|
|
87
|
-
),
|
|
88
|
-
(e) =>
|
|
85
|
+
const s = i.value.filter(
|
|
86
|
+
(e) => !t.includes(e)
|
|
87
|
+
), o = i.value.findIndex(
|
|
88
|
+
(e) => t.includes(e)
|
|
89
89
|
);
|
|
90
|
-
d.value =
|
|
91
|
-
(e,
|
|
92
|
-
).filter(Boolean),
|
|
93
|
-
|
|
90
|
+
d.value = i.value.map(
|
|
91
|
+
(e, f) => f <= o ? null : y(e, f, l.rowKey)
|
|
92
|
+
).filter(Boolean), s.length ? i.value = s : i.value.splice(0, i.value.length), r.setFieldValue(
|
|
93
|
+
l.name,
|
|
94
94
|
void 0,
|
|
95
95
|
!0,
|
|
96
|
-
(e,
|
|
97
|
-
e[
|
|
96
|
+
(e, f) => {
|
|
97
|
+
e[f] = [...s];
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
|
|
103
|
+
function L(u) {
|
|
104
|
+
const t = new Set(j(u) ? u : [u]);
|
|
105
|
+
t.size !== 0 && r?.setFieldValue(
|
|
106
106
|
w,
|
|
107
107
|
void 0,
|
|
108
108
|
!1,
|
|
109
|
-
(v,
|
|
110
|
-
for (const e of
|
|
111
|
-
delete v[
|
|
112
|
-
const
|
|
113
|
-
(e,
|
|
114
|
-
),
|
|
115
|
-
(e,
|
|
109
|
+
(v, n) => {
|
|
110
|
+
for (const e of t)
|
|
111
|
+
delete v[n][e];
|
|
112
|
+
const s = i.value.filter(
|
|
113
|
+
(e, f) => !t.has(y(e, f, l.rowKey))
|
|
114
|
+
), o = i.value.findIndex(
|
|
115
|
+
(e, f) => t.has(y(e, f, l.rowKey))
|
|
116
116
|
);
|
|
117
|
-
d.value =
|
|
118
|
-
(e,
|
|
119
|
-
).filter(Boolean),
|
|
120
|
-
|
|
117
|
+
d.value = i.value.map(
|
|
118
|
+
(e, f) => f <= o ? null : y(e, f, l.rowKey)
|
|
119
|
+
).filter(Boolean), s.length ? i.value = s : i.value.splice(0, i.value.length), r.setFieldValue(
|
|
120
|
+
l.name,
|
|
121
121
|
void 0,
|
|
122
122
|
!0,
|
|
123
|
-
(e,
|
|
124
|
-
e[
|
|
123
|
+
(e, f) => {
|
|
124
|
+
e[f] = [...s];
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return h(
|
|
130
|
+
function T(u) {
|
|
131
|
+
return h(i)?.[u];
|
|
132
132
|
}
|
|
133
|
-
function z(
|
|
134
|
-
return
|
|
135
|
-
(
|
|
133
|
+
function z(u) {
|
|
134
|
+
return i.value?.find(
|
|
135
|
+
(t, v) => y(t, v, l.rowKey) === u
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
138
|
function E() {
|
|
139
|
-
return h(
|
|
139
|
+
return h(i);
|
|
140
140
|
}
|
|
141
|
-
function S(
|
|
142
|
-
|
|
141
|
+
function S(u, t, v = !0) {
|
|
142
|
+
r?.setFieldValue?.(
|
|
143
143
|
w,
|
|
144
144
|
void 0,
|
|
145
145
|
!1,
|
|
146
|
-
(
|
|
147
|
-
const
|
|
148
|
-
(
|
|
146
|
+
(n, s) => {
|
|
147
|
+
const o = i.value.findIndex(
|
|
148
|
+
(f, c) => u === c
|
|
149
149
|
);
|
|
150
|
-
if (!~
|
|
150
|
+
if (!~o)
|
|
151
151
|
return;
|
|
152
152
|
const e = y(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
i.value[o],
|
|
154
|
+
o,
|
|
155
|
+
l.rowKey
|
|
156
156
|
);
|
|
157
|
-
if (e && !(!
|
|
157
|
+
if (e && !(!n[s] || !n[s][e])) {
|
|
158
158
|
if (!v) {
|
|
159
|
-
const
|
|
160
|
-
for (const
|
|
161
|
-
|
|
159
|
+
const f = Object.keys(n[s][e]);
|
|
160
|
+
for (const c of f)
|
|
161
|
+
c !== l.rowKey && delete n[s][e][c];
|
|
162
162
|
}
|
|
163
|
-
Object.assign(
|
|
163
|
+
Object.assign(n[s][e], { ...t });
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
|
-
function U() {
|
|
169
|
-
|
|
168
|
+
function U(u, t, v = !0) {
|
|
169
|
+
r?.setFieldValue?.(
|
|
170
|
+
w,
|
|
171
|
+
void 0,
|
|
172
|
+
!1,
|
|
173
|
+
(n, s) => {
|
|
174
|
+
if (!(!n[s] || !n[s][u])) {
|
|
175
|
+
if (!v) {
|
|
176
|
+
const o = Object.keys(n[s][u]);
|
|
177
|
+
for (const e of o)
|
|
178
|
+
e !== l.rowKey && delete n[s][u][e];
|
|
179
|
+
}
|
|
180
|
+
Object.assign(n[s][u], { ...t });
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
function $() {
|
|
186
|
+
r?.setFieldValue(w, {}), r?.setFieldValue(l.name, []);
|
|
170
187
|
}
|
|
171
188
|
return {
|
|
172
|
-
add:
|
|
173
|
-
addMultiple:
|
|
189
|
+
add: I,
|
|
190
|
+
addMultiple: _,
|
|
174
191
|
__addMultiple: x,
|
|
175
|
-
remove:
|
|
176
|
-
removeByKey:
|
|
177
|
-
getRowData:
|
|
192
|
+
remove: k,
|
|
193
|
+
removeByKey: L,
|
|
194
|
+
getRowData: T,
|
|
178
195
|
getRowsData: E,
|
|
196
|
+
setRowDataByKey: U,
|
|
179
197
|
setRowData: S,
|
|
180
|
-
clear:
|
|
198
|
+
clear: $,
|
|
181
199
|
refreshRowIds: d,
|
|
182
200
|
getRowDataByKey: z
|
|
183
201
|
};
|
|
184
202
|
};
|
|
185
203
|
export {
|
|
186
|
-
|
|
204
|
+
Y as useEditableFormItemApi
|
|
187
205
|
};
|