@aplus-frontend/ui 7.20.2 → 7.20.4
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/index.mjs +73 -71
- package/es/src/ag-grid/editable/form-item.vue.mjs +72 -70
- package/es/src/ag-grid/editable/index.vue.mjs +59 -57
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-columns.mjs +18 -18
- package/es/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +107 -88
- 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 +105 -86
- package/es/src/ag-grid/index.vue.mjs +230 -227
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +14 -14
- package/es/src/ap-list/hooks/use-offline-list.mjs +31 -18
- package/es/src/business/ag-grid-container/index.d.ts +3 -0
- package/es/src/business/ag-grid-container/index.mjs +2 -0
- package/es/src/business/ag-grid-container/index.vue.d.ts +33 -0
- package/es/src/business/ag-grid-container/index.vue.mjs +64 -0
- package/es/src/business/ag-grid-container/index.vue2.mjs +4 -0
- package/es/src/business/ag-grid-container/interface.d.ts +4 -0
- package/es/src/business/ag-grid-container/interface.mjs +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/check-card/index.vue.d.ts +0 -1
- package/es/src/check-card/index.vue2.mjs +3 -5
- package/es/src/config-provider/config-provider-props.d.ts +1 -1
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/config-provider.mjs +1 -1
- package/es/src/config-provider/hooks/use-global-config.d.ts +2 -0
- package/es/src/config-provider/index.d.ts +4 -0
- package/es/src/highlight/index.vue.mjs +9 -9
- package/es/src/index.mjs +82 -80
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.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.js +1 -1
- 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/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
- package/lib/src/business/ag-grid-container/index.d.ts +3 -0
- package/lib/src/business/ag-grid-container/index.js +1 -0
- package/lib/src/business/ag-grid-container/index.vue.d.ts +33 -0
- package/lib/src/business/ag-grid-container/index.vue.js +1 -0
- package/lib/src/business/ag-grid-container/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-container/interface.d.ts +4 -0
- package/lib/src/business/ag-grid-container/interface.js +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/check-card/index.vue.d.ts +0 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +2 -0
- package/lib/src/config-provider/index.d.ts +4 -0
- package/lib/src/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +4 -4
|
@@ -1,140 +1,159 @@
|
|
|
1
|
-
import { isFunction as
|
|
2
|
-
import { shallowRef as
|
|
1
|
+
import { isFunction as y, isUndefined as d, isNumber as h, cloneDeep as G, isArray as F } from "lodash-unified";
|
|
2
|
+
import { shallowRef as S, unref as w } from "vue";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
|
-
import { useDevWarning as
|
|
5
|
-
import { getRowKey as
|
|
6
|
-
import { isDef as
|
|
7
|
-
let
|
|
8
|
-
function
|
|
9
|
-
return `_ag_grid${
|
|
4
|
+
import { useDevWarning as W } from "../../utils/warning.mjs";
|
|
5
|
+
import { getRowKey as t } from "../editable/utils.mjs";
|
|
6
|
+
import { isDef as m } from "../../utils/is.mjs";
|
|
7
|
+
let $ = 0;
|
|
8
|
+
function K() {
|
|
9
|
+
return `_ag_grid${$++}`;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
11
|
+
const Q = (u, R, e, x) => {
|
|
12
|
+
const v = S([]), I = W("EditableAgGridFormItem");
|
|
13
|
+
function B(n, r) {
|
|
14
|
+
const s = w(e)?.length || 0;
|
|
15
|
+
if (m(u.maxLength) && s >= u.maxLength || !n && y(u.rowKey))
|
|
16
16
|
return;
|
|
17
|
-
const
|
|
18
|
-
...n || { [
|
|
17
|
+
const o = {
|
|
18
|
+
...n || { [u.rowKey]: K() }
|
|
19
19
|
};
|
|
20
|
-
e.value ?
|
|
21
|
-
(i, f) => f <
|
|
22
|
-
).filter(Boolean), e.value.splice(
|
|
20
|
+
e.value ? d(r) ? e.value.push(o) : (v.value = e.value.map(
|
|
21
|
+
(i, f) => f < r ? null : t(i, f, u.rowKey)
|
|
22
|
+
).filter(Boolean), e.value.splice(r, 0, o)) : e.value = [o];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function L(n, r) {
|
|
25
|
+
const s = w(e)?.length || 0;
|
|
26
|
+
if (m(u.maxLength) && s >= u.maxLength || !n && y(u.rowKey))
|
|
27
|
+
return;
|
|
28
|
+
const o = {
|
|
29
|
+
...n || { [u.rowKey]: K() }
|
|
30
|
+
};
|
|
31
|
+
if (!e.value) {
|
|
32
|
+
e.value = [o];
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const i = e.value.findIndex(
|
|
36
|
+
(l, c) => t(l, c, u.rowKey) === r
|
|
37
|
+
), f = d(r) || i === -1 || i === e.value?.length - 1 ? void 0 : i + 1;
|
|
38
|
+
d(f) ? e.value.push(o) : (v.value = e.value.map(
|
|
39
|
+
(l, c) => c < f ? null : t(l, c, u.rowKey)
|
|
40
|
+
).filter(Boolean), e.value.splice(f, 0, o));
|
|
41
|
+
}
|
|
42
|
+
function A(n, r = "suffix") {
|
|
25
43
|
if (!n)
|
|
26
44
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
45
|
+
const s = w(e)?.length || 0, o = h(n) ? n : n.length;
|
|
46
|
+
if (m(u.maxLength) && s + o > u.maxLength || h(n) && y(u.rowKey))
|
|
29
47
|
return;
|
|
30
|
-
const i =
|
|
31
|
-
e.value ?
|
|
32
|
-
(f,
|
|
48
|
+
const i = h(n) ? new Array(n).fill(0).map(() => ({ [u.rowKey]: K() })) : G(n);
|
|
49
|
+
e.value ? r === "suffix" ? e.value.push(...i) : (v.value = e.value.map(
|
|
50
|
+
(f, l) => t(f, l, u.rowKey)
|
|
33
51
|
), e.value.unshift(...i)) : e.value = [...i];
|
|
34
52
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
(i) => !
|
|
38
|
-
),
|
|
39
|
-
(i) =>
|
|
53
|
+
function U(n) {
|
|
54
|
+
const r = F(n) ? n : [n], s = e.value.filter(
|
|
55
|
+
(i) => !r.includes(i)
|
|
56
|
+
), o = e.value.findIndex(
|
|
57
|
+
(i) => r.includes(i)
|
|
40
58
|
);
|
|
41
|
-
|
|
42
|
-
(i, f) => f <=
|
|
43
|
-
).filter(Boolean),
|
|
59
|
+
v.value = e.value.map(
|
|
60
|
+
(i, f) => f <= o ? null : t(i, f, u.rowKey)
|
|
61
|
+
).filter(Boolean), s.length ? e.value = s : e.value.splice(0, e.value.length);
|
|
44
62
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
63
|
+
function j(n) {
|
|
64
|
+
const r = new Set(F(n) ? n : [n]);
|
|
65
|
+
if (r.size === 0)
|
|
48
66
|
return;
|
|
49
|
-
const
|
|
50
|
-
(i, f) => !
|
|
51
|
-
),
|
|
52
|
-
(i, f) =>
|
|
67
|
+
const s = e.value.filter(
|
|
68
|
+
(i, f) => !r.has(t(i, f, u.rowKey))
|
|
69
|
+
), o = e.value.findIndex(
|
|
70
|
+
(i, f) => r.has(t(i, f, u.rowKey))
|
|
53
71
|
);
|
|
54
|
-
|
|
55
|
-
(i, f) => f <=
|
|
56
|
-
).filter(Boolean),
|
|
72
|
+
v.value = e.value.map(
|
|
73
|
+
(i, f) => f <= o ? null : t(i, f, u.rowKey)
|
|
74
|
+
).filter(Boolean), s.length ? e.value = s : e.value.splice(0, e.value.length);
|
|
57
75
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
60
|
-
!
|
|
76
|
+
function O(n) {
|
|
77
|
+
return I(
|
|
78
|
+
!u.supressForceRowUpdate,
|
|
61
79
|
"usage",
|
|
62
80
|
'Avoid using getRowData/setRowData methods while suppressForceRowUpdate is enabled."'
|
|
63
81
|
), w(e)?.[n];
|
|
64
82
|
}
|
|
65
|
-
function
|
|
83
|
+
function T(n) {
|
|
66
84
|
return e.value?.find(
|
|
67
|
-
(
|
|
85
|
+
(r, s) => t(r, s, u.rowKey) === n
|
|
68
86
|
);
|
|
69
87
|
}
|
|
70
|
-
function
|
|
88
|
+
function _() {
|
|
71
89
|
return w(e);
|
|
72
90
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
!
|
|
91
|
+
function k(n, r, s = !0) {
|
|
92
|
+
I(
|
|
93
|
+
!u.supressForceRowUpdate,
|
|
76
94
|
"usage",
|
|
77
95
|
'Avoid using getRowData/setRowData methods while suppressForceRowUpdate is enabled."'
|
|
78
|
-
),
|
|
79
|
-
|
|
96
|
+
), R?.setFieldValue?.(
|
|
97
|
+
x,
|
|
80
98
|
void 0,
|
|
81
99
|
!1,
|
|
82
|
-
(
|
|
100
|
+
(o, i) => {
|
|
83
101
|
const f = e.value.findIndex(
|
|
84
|
-
(
|
|
102
|
+
(c, g) => n === g
|
|
85
103
|
);
|
|
86
104
|
if (!~f)
|
|
87
105
|
return;
|
|
88
|
-
const
|
|
106
|
+
const l = t(
|
|
89
107
|
e.value[f],
|
|
90
108
|
f,
|
|
91
|
-
|
|
109
|
+
u.rowKey
|
|
92
110
|
);
|
|
93
|
-
if (
|
|
94
|
-
if (!
|
|
95
|
-
const
|
|
96
|
-
for (const
|
|
97
|
-
|
|
111
|
+
if (l && !(!o[i] || !o[i][l])) {
|
|
112
|
+
if (!s) {
|
|
113
|
+
const c = Object.keys(o[i][l]);
|
|
114
|
+
for (const g of c)
|
|
115
|
+
g !== u.rowKey && delete o[i][l][g];
|
|
98
116
|
}
|
|
99
|
-
Object.assign(
|
|
117
|
+
Object.assign(o[i][l], { ...r });
|
|
100
118
|
}
|
|
101
119
|
}
|
|
102
120
|
);
|
|
103
121
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
function E(n, r, s = !0) {
|
|
123
|
+
R?.setFieldValue?.(
|
|
124
|
+
x,
|
|
107
125
|
void 0,
|
|
108
126
|
!1,
|
|
109
|
-
(
|
|
110
|
-
if (!(!
|
|
111
|
-
if (!
|
|
112
|
-
const f = Object.keys(
|
|
113
|
-
for (const
|
|
114
|
-
|
|
127
|
+
(o, i) => {
|
|
128
|
+
if (!(!o[i] || !o[i][n])) {
|
|
129
|
+
if (!s) {
|
|
130
|
+
const f = Object.keys(o[i][n]);
|
|
131
|
+
for (const l of f)
|
|
132
|
+
l !== u.rowKey && delete o[i][n][l];
|
|
115
133
|
}
|
|
116
|
-
Object.assign(
|
|
134
|
+
Object.assign(o[i][n], { ...r });
|
|
117
135
|
}
|
|
118
136
|
}
|
|
119
137
|
);
|
|
120
138
|
}
|
|
121
|
-
function
|
|
139
|
+
function z() {
|
|
122
140
|
e.value = [];
|
|
123
141
|
}
|
|
124
142
|
return {
|
|
125
|
-
add:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
143
|
+
add: B,
|
|
144
|
+
addByKey: L,
|
|
145
|
+
addMultiple: A,
|
|
146
|
+
remove: U,
|
|
147
|
+
removeByKey: j,
|
|
148
|
+
getRowData: O,
|
|
149
|
+
getRowsData: _,
|
|
150
|
+
setRowDataByKey: E,
|
|
151
|
+
setRowData: k,
|
|
152
|
+
clear: z,
|
|
153
|
+
refreshRowIds: v,
|
|
154
|
+
getRowDataByKey: T
|
|
136
155
|
};
|
|
137
156
|
};
|
|
138
157
|
export {
|
|
139
|
-
|
|
158
|
+
Q as useEditableFormItemApi
|
|
140
159
|
};
|