@aplus-frontend/ui 0.6.0-beta.2 → 0.6.0-beta.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/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
- package/es/src/ap-grid/editable/form-item.vue.mjs +94 -83
- package/es/src/ap-grid/editable/index.vue.mjs +89 -78
- package/es/src/ap-grid/index.vue.mjs +47 -43
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +32 -32
- package/es/src/ap-table/ap-table.vue2.mjs +2 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/business/ap-status/interface.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +2 -14
- package/es/src/editable-table/form-item.vue.mjs +84 -76
- package/es/src/editable-table/index.vue.d.ts +2 -16
- package/es/src/editable-table/index.vue.mjs +91 -83
- package/es/src/editable-table/interface.d.ts +7 -0
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/business/ap-status/interface.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -14
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +2 -16
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +7 -0
- package/package.json +4 -4
- package/theme/antd-global-overwrite/admin/index.css +4 -17
- package/theme/antd-global-overwrite/admin/modal.css +4 -17
- package/theme/antd-global-overwrite/admin/modal.less +4 -19
- package/theme/antd-global-overwrite/aplus/index.css +4 -11
- package/theme/antd-global-overwrite/aplus/modal.css +4 -11
- package/theme/antd-global-overwrite/aplus/modal.less +4 -14
- package/theme/ap-form/ap-form-item.css +2 -2
- package/theme/ap-form/ap-form-item.less +2 -2
- package/theme/ap-form/index.css +5 -2
- package/theme/ap-form/search-form.css +5 -2
- package/theme/ap-form/search-form.less +3 -0
- package/theme/ap-grid/index.css +5 -2
- package/theme/ap-table/ap-table.css +8 -5
- package/theme/ap-table/setting/index.css +3 -3
- package/theme/ap-table/setting/modal.css +1 -2
- package/theme/ap-table/setting/modal.less +1 -2
- package/theme/ap-table/setting/select-group.css +2 -1
- package/theme/ap-table/setting/select-group.less +2 -1
- package/theme/ap-table-modal/index.css +8 -5
- package/theme/ap-tag/ap-tag.css +1 -1
- package/theme/ap-tag/ap-tag.less +1 -1
- package/theme/editable-table/index.css +5 -2
- package/theme/index.css +9 -6
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as T, ref as h, unref as e, createBlock as w, openBlock as B, withCtx as t, createVNode as o, createElementVNode as n, normalizeClass as r, toDisplayString as l, createTextVNode as
|
|
2
|
-
import { Popover as
|
|
1
|
+
import { defineComponent as T, ref as h, unref as e, createBlock as w, openBlock as B, withCtx as t, createVNode as o, createElementVNode as n, normalizeClass as r, toDisplayString as l, createTextVNode as y } from "vue";
|
|
2
|
+
import { Popover as S, Tooltip as D, Button as v, Flex as C, Divider as L } from "@aplus-frontend/antdv";
|
|
3
3
|
import { IconApLayoutOutlined as P } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../../../config-provider/index.mjs";
|
|
5
|
-
import
|
|
5
|
+
import V from "vuedraggable";
|
|
6
6
|
import "./sortable-item.vue.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
7
|
+
import { getStringName as j } from "../../../item-group/helper.mjs";
|
|
8
|
+
import { useNamespace as g } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as A } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import I from "./sortable-item.vue2.mjs";
|
|
11
|
+
const J = /* @__PURE__ */ T({
|
|
11
12
|
name: "ApFormSearchFormPopoverSorter",
|
|
12
13
|
__name: "index",
|
|
13
14
|
props: {
|
|
@@ -15,22 +16,25 @@ const G = /* @__PURE__ */ T({
|
|
|
15
16
|
onClickConfirm: { type: Function }
|
|
16
17
|
},
|
|
17
18
|
setup(k) {
|
|
18
|
-
const d = k,
|
|
19
|
-
let
|
|
20
|
-
const { e:
|
|
21
|
-
function F(
|
|
22
|
-
return
|
|
19
|
+
const d = k, p = h(d.children);
|
|
20
|
+
let _ = [...d.children];
|
|
21
|
+
const { e: c } = g("ap-form-search-form"), { b: a } = g("search-form-sorter"), { t: s } = A(), i = h(!1);
|
|
22
|
+
function F(m) {
|
|
23
|
+
return m.closest(".ant-form") || document.body;
|
|
23
24
|
}
|
|
24
25
|
function b() {
|
|
25
|
-
i.value = !1, console.log(e(
|
|
26
|
+
i.value = !1, console.log(e(p)), d.onClickConfirm(e(p));
|
|
26
27
|
}
|
|
27
28
|
function x() {
|
|
28
|
-
|
|
29
|
+
p.value = [..._];
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
function N(m) {
|
|
32
|
+
return j(m.props.name);
|
|
33
|
+
}
|
|
34
|
+
return (m, f) => (B(), w(e(S), {
|
|
31
35
|
open: i.value,
|
|
32
|
-
"onUpdate:open":
|
|
33
|
-
"overlay-class-name": e(
|
|
36
|
+
"onUpdate:open": f[1] || (f[1] = (u) => i.value = u),
|
|
37
|
+
"overlay-class-name": e(c)("popover"),
|
|
34
38
|
trigger: "click",
|
|
35
39
|
placement: "bottom",
|
|
36
40
|
mask: "",
|
|
@@ -44,7 +48,7 @@ const G = /* @__PURE__ */ T({
|
|
|
44
48
|
n("span", {
|
|
45
49
|
class: r(e(a)("header-title"))
|
|
46
50
|
}, l(e(s)("ap.apForm.search.sorterTitle")), 3),
|
|
47
|
-
o(e(
|
|
51
|
+
o(e(C), { justify: "space-between" }, {
|
|
48
52
|
default: t(() => [
|
|
49
53
|
n("span", {
|
|
50
54
|
class: r(e(a)("header-desc"))
|
|
@@ -62,39 +66,40 @@ const G = /* @__PURE__ */ T({
|
|
|
62
66
|
})
|
|
63
67
|
], 2),
|
|
64
68
|
n("div", {
|
|
65
|
-
class: r([e(
|
|
69
|
+
class: r([e(c)("popover-content"), e(a)("content")])
|
|
66
70
|
}, [
|
|
67
|
-
o(e(
|
|
68
|
-
list:
|
|
69
|
-
class: r(e(a)("sorter-wrapper"))
|
|
71
|
+
o(e(V), {
|
|
72
|
+
list: p.value,
|
|
73
|
+
class: r(e(a)("sorter-wrapper")),
|
|
74
|
+
"item-key": N
|
|
70
75
|
}, {
|
|
71
|
-
item: t(({ element:
|
|
72
|
-
o(
|
|
76
|
+
item: t(({ element: u }) => [
|
|
77
|
+
o(I, { item: u }, null, 8, ["item"])
|
|
73
78
|
]),
|
|
74
79
|
_: 1
|
|
75
80
|
}, 8, ["list", "class"])
|
|
76
81
|
], 2),
|
|
77
82
|
o(e(L), { style: { margin: "0" } }),
|
|
78
83
|
n("div", {
|
|
79
|
-
class: r(e(
|
|
84
|
+
class: r(e(c)("popover-footer"))
|
|
80
85
|
}, [
|
|
81
|
-
o(e(
|
|
86
|
+
o(e(C), { justify: "end" }, {
|
|
82
87
|
default: t(() => [
|
|
83
|
-
o(e(
|
|
84
|
-
onClick:
|
|
88
|
+
o(e(v), {
|
|
89
|
+
onClick: f[0] || (f[0] = (u) => i.value = !1)
|
|
85
90
|
}, {
|
|
86
91
|
default: t(() => [
|
|
87
|
-
|
|
92
|
+
y(l(e(s)("ap.common.cancelText")), 1)
|
|
88
93
|
]),
|
|
89
94
|
_: 1
|
|
90
95
|
}),
|
|
91
|
-
o(e(
|
|
92
|
-
class: r(e(
|
|
96
|
+
o(e(v), {
|
|
97
|
+
class: r(e(c)("popover-footer-confirm-btn")),
|
|
93
98
|
type: "primary",
|
|
94
99
|
onClick: b
|
|
95
100
|
}, {
|
|
96
101
|
default: t(() => [
|
|
97
|
-
|
|
102
|
+
y(l(e(s)("ap.apForm.search.sorterConfirmBtn")), 1)
|
|
98
103
|
]),
|
|
99
104
|
_: 1
|
|
100
105
|
}, 8, ["class"])
|
|
@@ -109,7 +114,7 @@ const G = /* @__PURE__ */ T({
|
|
|
109
114
|
placement: "top"
|
|
110
115
|
}, {
|
|
111
116
|
default: t(() => [
|
|
112
|
-
o(e(
|
|
117
|
+
o(e(v), null, {
|
|
113
118
|
icon: t(() => [
|
|
114
119
|
o(e(P))
|
|
115
120
|
]),
|
|
@@ -124,5 +129,5 @@ const G = /* @__PURE__ */ T({
|
|
|
124
129
|
}
|
|
125
130
|
});
|
|
126
131
|
export {
|
|
127
|
-
|
|
132
|
+
J as default
|
|
128
133
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as A, useSlots as H, toRef as W, ref as h, unref as r, watch as G, nextTick as U, createBlock as $, openBlock as q, mergeProps as y, withCtx as g, createVNode as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as I } from "vue";
|
|
2
2
|
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
|
-
import { isArray as
|
|
3
|
+
import { isArray as w, isUndefined as M, isNumber as m, cloneDeep as ee, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { isDef as
|
|
6
|
-
import { useGetEditableColumns as
|
|
5
|
+
import { isDef as b } from "../../utils/index.mjs";
|
|
6
|
+
import { useGetEditableColumns as te } from "../hooks/use-editable-columns.mjs";
|
|
7
7
|
import "../index.vue2.mjs";
|
|
8
|
-
import { useInjectForm as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useGlobalConfig as
|
|
8
|
+
import { useInjectForm as ae } from "../../ap-form/context.mjs";
|
|
9
|
+
import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as fe } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import ne from "../index.vue.mjs";
|
|
12
|
-
const
|
|
12
|
+
const Ce = /* @__PURE__ */ A({
|
|
13
13
|
name: "EditableGrid",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -108,6 +108,9 @@ const ye = /* @__PURE__ */ P({
|
|
|
108
108
|
loadingConfig: {},
|
|
109
109
|
headerCellConfig: {},
|
|
110
110
|
footerCellConfig: {},
|
|
111
|
+
round: {
|
|
112
|
+
type: Boolean
|
|
113
|
+
},
|
|
111
114
|
rowSelection: {
|
|
112
115
|
type: Boolean,
|
|
113
116
|
default: void 0
|
|
@@ -154,126 +157,134 @@ const ye = /* @__PURE__ */ P({
|
|
|
154
157
|
default: () => ({})
|
|
155
158
|
}
|
|
156
159
|
},
|
|
157
|
-
setup(
|
|
158
|
-
expose:
|
|
160
|
+
setup(x, {
|
|
161
|
+
expose: R
|
|
159
162
|
}) {
|
|
160
|
-
const
|
|
161
|
-
b:
|
|
162
|
-
} =
|
|
163
|
-
function
|
|
164
|
-
return
|
|
163
|
+
const B = H(), l = x, {
|
|
164
|
+
b: S
|
|
165
|
+
} = le("editable-grid");
|
|
166
|
+
function F(e, t) {
|
|
167
|
+
return w(t) ? t.reduce((f, a) => f == null ? void 0 : f[a], e) : e == null ? void 0 : e[t];
|
|
165
168
|
}
|
|
166
169
|
const {
|
|
167
|
-
internalInstance:
|
|
168
|
-
model:
|
|
169
|
-
} =
|
|
170
|
-
|
|
171
|
-
var
|
|
172
|
-
await
|
|
170
|
+
internalInstance: o,
|
|
171
|
+
model: v
|
|
172
|
+
} = ae(), p = W(l.name), d = h(F(r(v), p.value) || []), N = C.useWatch(p);
|
|
173
|
+
G(() => N.value, async (e) => {
|
|
174
|
+
var t;
|
|
175
|
+
await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
|
|
173
176
|
}, {
|
|
174
177
|
deep: !0
|
|
175
178
|
});
|
|
176
|
-
const c = h(),
|
|
177
|
-
function
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
179
|
+
const c = h(), D = fe("valueTypeMap"), V = te(l, D);
|
|
180
|
+
function L(e, t) {
|
|
181
|
+
var n;
|
|
182
|
+
const f = ((n = r(d)) == null ? void 0 : n.length) || 0;
|
|
183
|
+
if (b(l.maxLength) && f >= l.maxLength)
|
|
181
184
|
return;
|
|
182
185
|
const a = {
|
|
183
186
|
...e || {}
|
|
184
187
|
};
|
|
185
|
-
|
|
186
|
-
if (!
|
|
187
|
-
|
|
188
|
+
o == null || o.setFieldValue(l.name, a, !0, (s, u) => {
|
|
189
|
+
if (!s[u]) {
|
|
190
|
+
s[u] = [a];
|
|
188
191
|
return;
|
|
189
192
|
}
|
|
190
|
-
|
|
193
|
+
M(t) ? s[u].push(a) : s[u].splice(t, 0, a);
|
|
191
194
|
});
|
|
192
195
|
}
|
|
193
|
-
function
|
|
194
|
-
var
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
196
|
+
function T(e, t = "suffix") {
|
|
197
|
+
var s;
|
|
198
|
+
const f = ((s = r(d)) == null ? void 0 : s.length) || 0, a = m(e) ? e : e.length;
|
|
199
|
+
if (b(l.maxLength) && f + a > l.maxLength)
|
|
197
200
|
return;
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
if (!
|
|
201
|
-
|
|
201
|
+
const n = m(e) ? new Array(e).fill(0).map(() => ({})) : ee(e);
|
|
202
|
+
o == null || o.setFieldValue(l.name, n, !0, (u, i) => {
|
|
203
|
+
if (!u[i]) {
|
|
204
|
+
u[i] = [...n];
|
|
202
205
|
return;
|
|
203
206
|
}
|
|
204
|
-
|
|
207
|
+
t === "suffix" ? u[i].push(...n) : u[i].unshift(...n);
|
|
205
208
|
});
|
|
206
209
|
}
|
|
207
|
-
function
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
function k(e) {
|
|
211
|
+
const t = new Set(m(e) ? [e] : e);
|
|
212
|
+
o == null || o.setFieldValue(l.name, void 0, !0, (f, a) => {
|
|
213
|
+
f[a] = f[a].filter((n, s) => !t.has(s));
|
|
211
214
|
});
|
|
212
215
|
}
|
|
213
|
-
function T() {
|
|
214
|
-
return u(d);
|
|
215
|
-
}
|
|
216
216
|
function _(e) {
|
|
217
|
-
var
|
|
218
|
-
|
|
217
|
+
var f;
|
|
218
|
+
const t = new Set(w(e) ? e : [e]);
|
|
219
|
+
t.size !== 0 && ((f = o == null ? void 0 : o.setFieldValue) == null || f.call(o, l.name, void 0, !0, (a, n) => {
|
|
220
|
+
a[n] = a[n].filter((s) => !t.has(s[l.rowKey]));
|
|
221
|
+
}));
|
|
219
222
|
}
|
|
220
|
-
function j(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
function j() {
|
|
224
|
+
return r(d);
|
|
225
|
+
}
|
|
226
|
+
function E(e) {
|
|
227
|
+
var t;
|
|
228
|
+
return (t = r(d)) == null ? void 0 : t[e];
|
|
229
|
+
}
|
|
230
|
+
function O(e, t, f = !0) {
|
|
231
|
+
o == null || o.setFieldValue(l.name, void 0, !0, (a, n) => {
|
|
232
|
+
if (!(!a[n] || !a[n][e])) {
|
|
233
|
+
if (!f) {
|
|
234
|
+
const s = Object.keys(a[n][e]);
|
|
235
|
+
for (const u of s)
|
|
236
|
+
u !== l.rowKey && delete a[n][e][u];
|
|
227
237
|
}
|
|
228
|
-
Object.assign(a[
|
|
229
|
-
...
|
|
238
|
+
Object.assign(a[n][e], {
|
|
239
|
+
...t
|
|
230
240
|
});
|
|
231
241
|
}
|
|
232
242
|
});
|
|
233
243
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
244
|
+
function z(e) {
|
|
245
|
+
o == null || o.setFieldValue(l.name, e);
|
|
236
246
|
}
|
|
237
|
-
function
|
|
238
|
-
var
|
|
239
|
-
const
|
|
240
|
-
(
|
|
247
|
+
function K(e) {
|
|
248
|
+
var f;
|
|
249
|
+
const t = e === "end" ? d.value.length - 1 : e;
|
|
250
|
+
(f = c.value) == null || f.scrollToRow(t);
|
|
241
251
|
}
|
|
242
|
-
function
|
|
252
|
+
function P() {
|
|
243
253
|
var e;
|
|
244
|
-
(e =
|
|
254
|
+
(e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
|
|
245
255
|
}
|
|
246
|
-
return
|
|
247
|
-
add:
|
|
248
|
-
remove:
|
|
249
|
-
getRowData:
|
|
250
|
-
getRowsData:
|
|
251
|
-
setRowData:
|
|
252
|
-
addMultiple:
|
|
253
|
-
scrollTo:
|
|
254
|
-
setTableData:
|
|
255
|
-
clear:
|
|
256
|
-
|
|
256
|
+
return R({
|
|
257
|
+
add: L,
|
|
258
|
+
remove: k,
|
|
259
|
+
getRowData: E,
|
|
260
|
+
getRowsData: j,
|
|
261
|
+
setRowData: O,
|
|
262
|
+
addMultiple: T,
|
|
263
|
+
scrollTo: K,
|
|
264
|
+
setTableData: z,
|
|
265
|
+
clear: P,
|
|
266
|
+
removeByKey: _
|
|
267
|
+
}), (e, t) => (q(), $(r(C).FormItem, y(e.formItem, {
|
|
257
268
|
name: e.name,
|
|
258
269
|
label: e.label
|
|
259
270
|
}), {
|
|
260
|
-
default:
|
|
271
|
+
default: g(() => [J(ne, y(r(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
261
272
|
ref_key: "tableRef",
|
|
262
273
|
ref: c,
|
|
263
|
-
class:
|
|
264
|
-
columns:
|
|
274
|
+
class: r(S)(),
|
|
275
|
+
columns: r(V),
|
|
265
276
|
"data-source": d.value,
|
|
266
277
|
"search-form": !1
|
|
267
|
-
}),
|
|
278
|
+
}), Q({
|
|
268
279
|
_: 2
|
|
269
|
-
}, [
|
|
280
|
+
}, [X(B, (f, a) => ({
|
|
270
281
|
name: a,
|
|
271
|
-
fn:
|
|
282
|
+
fn: g((n) => [Y(e.$slots, a, Z(I(n || {})))])
|
|
272
283
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
273
284
|
_: 3
|
|
274
285
|
}, 16, ["name", "label"]));
|
|
275
286
|
}
|
|
276
287
|
});
|
|
277
288
|
export {
|
|
278
|
-
|
|
289
|
+
Ce as default
|
|
279
290
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, useSlots as q, ref as v, watch as x, unref as u, createBlock as J, openBlock as Q, withCtx as h, createVNode as b, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
|
|
2
2
|
import { ApForm as y } from "../../ap-form/index.mjs";
|
|
3
|
-
import { isEqual as ae, isArray as
|
|
3
|
+
import { isEqual as ae, isArray as g, isUndefined as oe, isNumber as C, cloneDeep as le, omit as ne } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import { isDef as R } from "../../utils/index.mjs";
|
|
7
|
-
import { useGetEditableColumns as
|
|
7
|
+
import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import fe from "../index.vue.mjs";
|
|
13
|
+
const Re = /* @__PURE__ */ $({
|
|
14
14
|
name: "EditableGrid",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -109,6 +109,9 @@ const be = /* @__PURE__ */ U({
|
|
|
109
109
|
loadingConfig: {},
|
|
110
110
|
headerCellConfig: {},
|
|
111
111
|
footerCellConfig: {},
|
|
112
|
+
round: {
|
|
113
|
+
type: Boolean
|
|
114
|
+
},
|
|
112
115
|
rowSelection: {
|
|
113
116
|
type: Boolean,
|
|
114
117
|
default: void 0
|
|
@@ -158,147 +161,155 @@ const be = /* @__PURE__ */ U({
|
|
|
158
161
|
expose: S,
|
|
159
162
|
emit: F
|
|
160
163
|
}) {
|
|
161
|
-
const N =
|
|
164
|
+
const N = q(), o = B, {
|
|
162
165
|
b: V
|
|
163
|
-
} =
|
|
166
|
+
} = re("editable-grid"), _ = F, w = v(), {
|
|
164
167
|
value: m,
|
|
165
|
-
updateValue:
|
|
166
|
-
} =
|
|
168
|
+
updateValue: L
|
|
169
|
+
} = ue(o, _), i = v(), k = ie("valueTypeMap"), c = y.useWatch(o.name, i);
|
|
167
170
|
x(() => c.value, (e) => {
|
|
168
|
-
var
|
|
169
|
-
|
|
171
|
+
var t;
|
|
172
|
+
L(e), (t = o.onChange) == null || t.call(o, e);
|
|
170
173
|
}, {
|
|
171
174
|
deep: !0,
|
|
172
175
|
flush: "post"
|
|
173
176
|
}), x(m, (e) => {
|
|
174
|
-
var
|
|
175
|
-
e !== u(c) && (ae(e, u(c)) || (
|
|
177
|
+
var t;
|
|
178
|
+
e !== u(c) && (ae(e, u(c)) || (t = i.value) == null || t.setFieldValue(o.name, e));
|
|
176
179
|
}, {
|
|
177
180
|
deep: !0
|
|
178
181
|
});
|
|
179
|
-
const
|
|
180
|
-
function
|
|
182
|
+
const D = se(o, k);
|
|
183
|
+
function E() {
|
|
181
184
|
var e;
|
|
182
|
-
(e =
|
|
185
|
+
(e = i.value) == null || e.resetFields();
|
|
183
186
|
}
|
|
184
187
|
function T(e) {
|
|
185
|
-
return e ? (
|
|
188
|
+
return e ? (g(e) ? e : [e]).map((a) => g(a) ? [o.name, ...a] : [o.name, a]) : void 0;
|
|
186
189
|
}
|
|
187
|
-
async function j(e,
|
|
190
|
+
async function j(e, t) {
|
|
188
191
|
var l;
|
|
189
|
-
const
|
|
190
|
-
return
|
|
192
|
+
const a = await ((l = i.value) == null ? void 0 : l.validateFields(T(e), t));
|
|
193
|
+
return a == null ? void 0 : a[o.name];
|
|
191
194
|
}
|
|
192
|
-
function O(e,
|
|
195
|
+
function O(e, t) {
|
|
193
196
|
var s, n, r;
|
|
194
|
-
const
|
|
195
|
-
if (R(
|
|
197
|
+
const a = ((s = u(m)) == null ? void 0 : s.length) || 0;
|
|
198
|
+
if (R(o.maxLength) && a >= o.maxLength)
|
|
196
199
|
return;
|
|
197
200
|
const l = {
|
|
198
201
|
...e || {}
|
|
199
202
|
};
|
|
200
|
-
(r = (n =
|
|
201
|
-
if (!d[
|
|
202
|
-
d[
|
|
203
|
+
(r = (n = i.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, o.name, l, !0, (d, f) => {
|
|
204
|
+
if (!d[f]) {
|
|
205
|
+
d[f] = [l];
|
|
203
206
|
return;
|
|
204
207
|
}
|
|
205
|
-
|
|
208
|
+
oe(t) ? d[f].push(l) : d[f].splice(t, 0, l);
|
|
206
209
|
});
|
|
207
210
|
}
|
|
208
|
-
function
|
|
211
|
+
function z(e, t = "suffix") {
|
|
209
212
|
var n, r, d;
|
|
210
|
-
const
|
|
211
|
-
if (R(
|
|
213
|
+
const a = ((n = u(m)) == null ? void 0 : n.length) || 0, l = C(e) ? e : e.length;
|
|
214
|
+
if (R(o.maxLength) && a + l > o.maxLength)
|
|
212
215
|
return;
|
|
213
|
-
const s =
|
|
214
|
-
(d = (r =
|
|
215
|
-
if (!
|
|
216
|
-
|
|
216
|
+
const s = C(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
|
|
217
|
+
(d = (r = i.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, o.name, s, !0, (f, p) => {
|
|
218
|
+
if (!f[p]) {
|
|
219
|
+
f[p] = [...s];
|
|
217
220
|
return;
|
|
218
221
|
}
|
|
219
|
-
|
|
222
|
+
t === "suffix" ? f[p].push(...s) : f[p].unshift(...s);
|
|
220
223
|
});
|
|
221
224
|
}
|
|
222
|
-
function
|
|
223
|
-
var
|
|
224
|
-
const
|
|
225
|
-
(l = (
|
|
226
|
-
s[n] = s[n].filter((r, d) => !
|
|
225
|
+
function A(e) {
|
|
226
|
+
var a, l;
|
|
227
|
+
const t = new Set(C(e) ? [e] : e);
|
|
228
|
+
(l = (a = i.value) == null ? void 0 : a.setFieldValue) == null || l.call(a, o.name, void 0, !0, (s, n) => {
|
|
229
|
+
s[n] = s[n].filter((r, d) => !t.has(d));
|
|
227
230
|
});
|
|
228
231
|
}
|
|
232
|
+
function K(e) {
|
|
233
|
+
var a, l;
|
|
234
|
+
const t = new Set(g(e) ? e : [e]);
|
|
235
|
+
t.size !== 0 && ((l = (a = i.value) == null ? void 0 : a.setFieldValue) == null || l.call(a, o.name, void 0, !0, (s, n) => {
|
|
236
|
+
s[n] = s[n].filter((r) => !t.has(r[o.rowKey]));
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
229
239
|
function I() {
|
|
230
240
|
return u(m);
|
|
231
241
|
}
|
|
232
242
|
function P(e) {
|
|
233
|
-
var
|
|
234
|
-
(
|
|
243
|
+
var t;
|
|
244
|
+
(t = i.value) == null || t.setFieldValue(o.name, e);
|
|
235
245
|
}
|
|
236
246
|
function H(e) {
|
|
237
|
-
var
|
|
238
|
-
return (
|
|
247
|
+
var t;
|
|
248
|
+
return (t = u(m)) == null ? void 0 : t[e];
|
|
239
249
|
}
|
|
240
|
-
function
|
|
250
|
+
function W(e, t, a = !0) {
|
|
241
251
|
var l, s;
|
|
242
|
-
(s = (l =
|
|
252
|
+
(s = (l = i.value) == null ? void 0 : l.setFieldValue) == null || s.call(l, o.name, void 0, !0, (n, r) => {
|
|
243
253
|
if (!(!n[r] || !n[r][e])) {
|
|
244
|
-
if (!
|
|
254
|
+
if (!a) {
|
|
245
255
|
const d = Object.keys(n[r][e]);
|
|
246
|
-
for (const
|
|
247
|
-
|
|
256
|
+
for (const f of d)
|
|
257
|
+
f !== o.rowKey && delete n[r][e][f];
|
|
248
258
|
}
|
|
249
259
|
Object.assign(n[r][e], {
|
|
250
|
-
...
|
|
260
|
+
...t
|
|
251
261
|
});
|
|
252
262
|
}
|
|
253
263
|
});
|
|
254
264
|
}
|
|
255
|
-
function
|
|
256
|
-
var
|
|
257
|
-
const
|
|
258
|
-
(
|
|
265
|
+
function G(e) {
|
|
266
|
+
var a;
|
|
267
|
+
const t = e === "end" ? m.value.length - 1 : e;
|
|
268
|
+
(a = w.value) == null || a.scrollToRow(t);
|
|
259
269
|
}
|
|
260
|
-
function
|
|
261
|
-
var e,
|
|
262
|
-
(
|
|
270
|
+
function U() {
|
|
271
|
+
var e, t;
|
|
272
|
+
(t = (e = i.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, o.name, []);
|
|
263
273
|
}
|
|
264
274
|
return S({
|
|
265
|
-
resetFields:
|
|
275
|
+
resetFields: E,
|
|
266
276
|
validateFields: j,
|
|
267
277
|
add: O,
|
|
268
|
-
remove:
|
|
278
|
+
remove: A,
|
|
269
279
|
getRowData: H,
|
|
270
280
|
getRowsData: I,
|
|
271
|
-
setRowData:
|
|
272
|
-
addMultiple:
|
|
273
|
-
scrollTo:
|
|
274
|
-
clear:
|
|
275
|
-
setTableData: P
|
|
276
|
-
|
|
281
|
+
setRowData: W,
|
|
282
|
+
addMultiple: z,
|
|
283
|
+
scrollTo: G,
|
|
284
|
+
clear: U,
|
|
285
|
+
setTableData: P,
|
|
286
|
+
removeByKey: K
|
|
287
|
+
}), (e, t) => (Q(), J(u(y), {
|
|
277
288
|
ref_key: "formRef",
|
|
278
|
-
ref:
|
|
289
|
+
ref: i,
|
|
279
290
|
"initial-values": {
|
|
280
|
-
[
|
|
291
|
+
[o.name]: u(m)
|
|
281
292
|
},
|
|
282
293
|
style: {
|
|
283
294
|
height: "100%"
|
|
284
295
|
}
|
|
285
296
|
}, {
|
|
286
|
-
default: h(() => [
|
|
297
|
+
default: h(() => [b(u(y).FormItem, {
|
|
287
298
|
name: e.name,
|
|
288
299
|
"no-style": ""
|
|
289
300
|
}, {
|
|
290
|
-
default: h(() => [
|
|
301
|
+
default: h(() => [b(fe, X(u(ne)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
291
302
|
ref_key: "tableRef",
|
|
292
|
-
ref:
|
|
303
|
+
ref: w,
|
|
293
304
|
class: u(V)(),
|
|
294
|
-
columns: u(
|
|
305
|
+
columns: u(D),
|
|
295
306
|
"data-source": u(m),
|
|
296
307
|
"search-form": !1
|
|
297
|
-
}),
|
|
308
|
+
}), Y({
|
|
298
309
|
_: 2
|
|
299
|
-
}, [
|
|
310
|
+
}, [Z(N, (a, l) => ({
|
|
300
311
|
name: l,
|
|
301
|
-
fn: h((s) => [
|
|
312
|
+
fn: h((s) => [M(e.$slots, l, ee(te(s || {})))])
|
|
302
313
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
303
314
|
_: 3
|
|
304
315
|
}, 8, ["name"])]),
|
|
@@ -307,5 +318,5 @@ const be = /* @__PURE__ */ U({
|
|
|
307
318
|
}
|
|
308
319
|
});
|
|
309
320
|
export {
|
|
310
|
-
|
|
321
|
+
Re as default
|
|
311
322
|
};
|