@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.
Files changed (52) hide show
  1. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
  2. package/es/src/ap-grid/editable/form-item.vue.mjs +94 -83
  3. package/es/src/ap-grid/editable/index.vue.mjs +89 -78
  4. package/es/src/ap-grid/index.vue.mjs +47 -43
  5. package/es/src/ap-grid/interface.d.ts +1 -1
  6. package/es/src/ap-grid/utils/table.mjs +32 -32
  7. package/es/src/ap-table/ap-table.vue2.mjs +2 -0
  8. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
  9. package/es/src/business/ap-status/interface.d.ts +1 -1
  10. package/es/src/editable-table/form-item.vue.d.ts +2 -14
  11. package/es/src/editable-table/form-item.vue.mjs +84 -76
  12. package/es/src/editable-table/index.vue.d.ts +2 -16
  13. package/es/src/editable-table/index.vue.mjs +91 -83
  14. package/es/src/editable-table/interface.d.ts +7 -0
  15. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  16. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  17. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  18. package/lib/src/ap-grid/index.vue.js +1 -1
  19. package/lib/src/ap-grid/interface.d.ts +1 -1
  20. package/lib/src/ap-grid/utils/table.js +1 -1
  21. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  22. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  23. package/lib/src/business/ap-status/interface.d.ts +1 -1
  24. package/lib/src/editable-table/form-item.vue.d.ts +2 -14
  25. package/lib/src/editable-table/form-item.vue.js +1 -1
  26. package/lib/src/editable-table/index.vue.d.ts +2 -16
  27. package/lib/src/editable-table/index.vue.js +1 -1
  28. package/lib/src/editable-table/interface.d.ts +7 -0
  29. package/package.json +4 -4
  30. package/theme/antd-global-overwrite/admin/index.css +4 -17
  31. package/theme/antd-global-overwrite/admin/modal.css +4 -17
  32. package/theme/antd-global-overwrite/admin/modal.less +4 -19
  33. package/theme/antd-global-overwrite/aplus/index.css +4 -11
  34. package/theme/antd-global-overwrite/aplus/modal.css +4 -11
  35. package/theme/antd-global-overwrite/aplus/modal.less +4 -14
  36. package/theme/ap-form/ap-form-item.css +2 -2
  37. package/theme/ap-form/ap-form-item.less +2 -2
  38. package/theme/ap-form/index.css +5 -2
  39. package/theme/ap-form/search-form.css +5 -2
  40. package/theme/ap-form/search-form.less +3 -0
  41. package/theme/ap-grid/index.css +5 -2
  42. package/theme/ap-table/ap-table.css +8 -5
  43. package/theme/ap-table/setting/index.css +3 -3
  44. package/theme/ap-table/setting/modal.css +1 -2
  45. package/theme/ap-table/setting/modal.less +1 -2
  46. package/theme/ap-table/setting/select-group.css +2 -1
  47. package/theme/ap-table/setting/select-group.less +2 -1
  48. package/theme/ap-table-modal/index.css +8 -5
  49. package/theme/ap-tag/ap-tag.css +1 -1
  50. package/theme/ap-tag/ap-tag.less +1 -1
  51. package/theme/editable-table/index.css +5 -2
  52. 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 C } from "vue";
2
- import { Popover as N, Tooltip as D, Button as u, Flex as y, Divider as L } from "@aplus-frontend/antdv";
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 S from "vuedraggable";
5
+ import V from "vuedraggable";
6
6
  import "./sortable-item.vue.mjs";
7
- import { useNamespace as _ } from "../../../../config-provider/hooks/use-namespace.mjs";
8
- import { useLocale as V } from "../../../../config-provider/hooks/use-locale.mjs";
9
- import j from "./sortable-item.vue2.mjs";
10
- const G = /* @__PURE__ */ T({
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, c = h(d.children);
19
- let g = [...d.children];
20
- const { e: p } = _("ap-form-search-form"), { b: a } = _("search-form-sorter"), { t: s } = V(), i = h(!1);
21
- function F(v) {
22
- return v.closest(".ant-form") || document.body;
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(c)), d.onClickConfirm(e(c));
26
+ i.value = !1, console.log(e(p)), d.onClickConfirm(e(p));
26
27
  }
27
28
  function x() {
28
- c.value = [...g];
29
+ p.value = [..._];
29
30
  }
30
- return (v, m) => (B(), w(e(N), {
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": m[1] || (m[1] = (f) => i.value = f),
33
- "overlay-class-name": e(p)("popover"),
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(y), { justify: "space-between" }, {
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(p)("popover-content"), e(a)("content")])
69
+ class: r([e(c)("popover-content"), e(a)("content")])
66
70
  }, [
67
- o(e(S), {
68
- list: c.value,
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: f }) => [
72
- o(j, { item: f }, null, 8, ["item"])
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(p)("popover-footer"))
84
+ class: r(e(c)("popover-footer"))
80
85
  }, [
81
- o(e(y), { justify: "end" }, {
86
+ o(e(C), { justify: "end" }, {
82
87
  default: t(() => [
83
- o(e(u), {
84
- onClick: m[0] || (m[0] = (f) => i.value = !1)
88
+ o(e(v), {
89
+ onClick: f[0] || (f[0] = (u) => i.value = !1)
85
90
  }, {
86
91
  default: t(() => [
87
- C(l(e(s)("ap.common.cancelText")), 1)
92
+ y(l(e(s)("ap.common.cancelText")), 1)
88
93
  ]),
89
94
  _: 1
90
95
  }),
91
- o(e(u), {
92
- class: r(e(p)("popover-footer-confirm-btn")),
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
- C(l(e(s)("ap.apForm.search.sorterConfirmBtn")), 1)
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(u), null, {
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
- G as default
132
+ J as default
128
133
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as u, watch as K, nextTick as W, createBlock as G, openBlock as U, mergeProps as g, withCtx as y, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
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 Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
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 w } from "../../utils/index.mjs";
6
- import { useGetEditableColumns as oe } from "../hooks/use-editable-columns.mjs";
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 te } from "../../ap-form/context.mjs";
9
- import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
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 ye = /* @__PURE__ */ P({
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(b, {
158
- expose: x
160
+ setup(x, {
161
+ expose: R
159
162
  }) {
160
- const R = A(), l = b, {
161
- b: B
162
- } = ae("editable-grid");
163
- function S(e, o) {
164
- return Z(o) ? o.reduce((n, a) => n == null ? void 0 : n[a], e) : e == null ? void 0 : e[o];
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: t,
168
- model: F
169
- } = te(), p = H(l.name), d = h(S(u(F), p.value) || []), N = C.useWatch(p);
170
- K(() => N.value, async (e) => {
171
- var o;
172
- await W(), d.value = e, (o = l.onChange) == null || o.call(l, e);
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(), v = le("valueTypeMap"), k = oe(l, v);
177
- function D(e, o) {
178
- var s;
179
- const n = ((s = u(d)) == null ? void 0 : s.length) || 0;
180
- if (w(l.maxLength) && n >= l.maxLength)
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
- t == null || t.setFieldValue(l.name, a, !0, (r, f) => {
186
- if (!r[f]) {
187
- r[f] = [a];
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
- I(o) ? r[f].push(a) : r[f].splice(o, 0, a);
193
+ M(t) ? s[u].push(a) : s[u].splice(t, 0, a);
191
194
  });
192
195
  }
193
- function L(e, o = "suffix") {
194
- var r;
195
- const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
196
- if (w(l.maxLength) && n + a > l.maxLength)
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 s = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
199
- t == null || t.setFieldValue(l.name, s, !0, (f, i) => {
200
- if (!f[i]) {
201
- f[i] = [...s];
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
- o === "suffix" ? f[i].push(...s) : f[i].unshift(...s);
207
+ t === "suffix" ? u[i].push(...n) : u[i].unshift(...n);
205
208
  });
206
209
  }
207
- function V(e) {
208
- const o = new Set(m(e) ? [e] : e);
209
- t == null || t.setFieldValue(l.name, void 0, !0, (n, a) => {
210
- n[a] = n[a].filter((s, r) => !o.has(r));
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 o;
218
- return (o = u(d)) == null ? void 0 : o[e];
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(e, o, n = !0) {
221
- t == null || t.setFieldValue(l.name, void 0, !0, (a, s) => {
222
- if (!(!a[s] || !a[s][e])) {
223
- if (!n) {
224
- const r = Object.keys(a[s][e]);
225
- for (const f of r)
226
- f !== l.rowKey && delete a[s][e][f];
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[s][e], {
229
- ...o
238
+ Object.assign(a[n][e], {
239
+ ...t
230
240
  });
231
241
  }
232
242
  });
233
243
  }
234
- function E(e) {
235
- t == null || t.setFieldValue(l.name, e);
244
+ function z(e) {
245
+ o == null || o.setFieldValue(l.name, e);
236
246
  }
237
- function O(e) {
238
- var n;
239
- const o = e === "end" ? d.value.length - 1 : e;
240
- (n = c.value) == null || n.scrollToRow(o);
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 z() {
252
+ function P() {
243
253
  var e;
244
- (e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, l.name, []);
254
+ (e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
245
255
  }
246
- return x({
247
- add: D,
248
- remove: V,
249
- getRowData: _,
250
- getRowsData: T,
251
- setRowData: j,
252
- addMultiple: L,
253
- scrollTo: O,
254
- setTableData: E,
255
- clear: z
256
- }), (e, o) => (U(), G(u(C).FormItem, g(e.formItem, {
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: y(() => [$(ne, g(u(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
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: u(B)(),
264
- columns: u(k),
274
+ class: r(S)(),
275
+ columns: r(V),
265
276
  "data-source": d.value,
266
277
  "search-form": !1
267
- }), q({
278
+ }), Q({
268
279
  _: 2
269
- }, [J(R, (n, a) => ({
280
+ }, [X(B, (f, a) => ({
270
281
  name: a,
271
- fn: y((s) => [Q(e.$slots, a, X(Y(s || {})))])
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
- ye as default
289
+ Ce as default
279
290
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, createBlock as q, openBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
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 b, isUndefined as te, isNumber as g, cloneDeep as oe, omit as le } from "lodash-unified";
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 ne } from "../hooks/use-editable-columns.mjs";
7
+ import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
8
8
  import "../index.vue2.mjs";
9
- import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
11
- import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
12
- import ie from "../index.vue.mjs";
13
- const be = /* @__PURE__ */ U({
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 = $(), t = B, {
164
+ const N = q(), o = B, {
162
165
  b: V
163
- } = se("editable-grid"), _ = F, C = w(), {
166
+ } = re("editable-grid"), _ = F, w = v(), {
164
167
  value: m,
165
- updateValue: k
166
- } = re(t, _), f = w(), L = ue("valueTypeMap"), c = y.useWatch(t.name, f);
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 a;
169
- k(e), (a = t.onChange) == null || a.call(t, e);
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 a;
175
- e !== u(c) && (ae(e, u(c)) || (a = f.value) == null || a.setFieldValue(t.name, e));
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 E = ne(t, L);
180
- function D() {
182
+ const D = se(o, k);
183
+ function E() {
181
184
  var e;
182
- (e = f.value) == null || e.resetFields();
185
+ (e = i.value) == null || e.resetFields();
183
186
  }
184
187
  function T(e) {
185
- return e ? (b(e) ? e : [e]).map((o) => b(o) ? [t.name, ...o] : [t.name, o]) : void 0;
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, a) {
190
+ async function j(e, t) {
188
191
  var l;
189
- const o = await ((l = f.value) == null ? void 0 : l.validateFields(T(e), a));
190
- return o == null ? void 0 : o[t.name];
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, a) {
195
+ function O(e, t) {
193
196
  var s, n, r;
194
- const o = ((s = u(m)) == null ? void 0 : s.length) || 0;
195
- if (R(t.maxLength) && o >= t.maxLength)
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 = f.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, t.name, l, !0, (d, i) => {
201
- if (!d[i]) {
202
- d[i] = [l];
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
- te(a) ? d[i].push(l) : d[i].splice(a, 0, l);
208
+ oe(t) ? d[f].push(l) : d[f].splice(t, 0, l);
206
209
  });
207
210
  }
208
- function A(e, a = "suffix") {
211
+ function z(e, t = "suffix") {
209
212
  var n, r, d;
210
- const o = ((n = u(m)) == null ? void 0 : n.length) || 0, l = g(e) ? e : e.length;
211
- if (R(t.maxLength) && o + l > t.maxLength)
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 = g(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
214
- (d = (r = f.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, s, !0, (i, p) => {
215
- if (!i[p]) {
216
- i[p] = [...s];
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
- a === "suffix" ? i[p].push(...s) : i[p].unshift(...s);
222
+ t === "suffix" ? f[p].push(...s) : f[p].unshift(...s);
220
223
  });
221
224
  }
222
- function z(e) {
223
- var o, l;
224
- const a = new Set(g(e) ? [e] : e);
225
- (l = (o = f.value) == null ? void 0 : o.setFieldValue) == null || l.call(o, t.name, void 0, !0, (s, n) => {
226
- s[n] = s[n].filter((r, d) => !a.has(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 a;
234
- (a = f.value) == null || a.setFieldValue(t.name, e);
243
+ var t;
244
+ (t = i.value) == null || t.setFieldValue(o.name, e);
235
245
  }
236
246
  function H(e) {
237
- var a;
238
- return (a = u(m)) == null ? void 0 : a[e];
247
+ var t;
248
+ return (t = u(m)) == null ? void 0 : t[e];
239
249
  }
240
- function K(e, a, o = !0) {
250
+ function W(e, t, a = !0) {
241
251
  var l, s;
242
- (s = (l = f.value) == null ? void 0 : l.setFieldValue) == null || s.call(l, t.name, void 0, !0, (n, r) => {
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 (!o) {
254
+ if (!a) {
245
255
  const d = Object.keys(n[r][e]);
246
- for (const i of d)
247
- i !== t.rowKey && delete n[r][e][i];
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
- ...a
260
+ ...t
251
261
  });
252
262
  }
253
263
  });
254
264
  }
255
- function W(e) {
256
- var o;
257
- const a = e === "end" ? m.value.length - 1 : e;
258
- (o = C.value) == null || o.scrollToRow(a);
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 G() {
261
- var e, a;
262
- (a = (e = f.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
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: D,
275
+ resetFields: E,
266
276
  validateFields: j,
267
277
  add: O,
268
- remove: z,
278
+ remove: A,
269
279
  getRowData: H,
270
280
  getRowsData: I,
271
- setRowData: K,
272
- addMultiple: A,
273
- scrollTo: W,
274
- clear: G,
275
- setTableData: P
276
- }), (e, a) => (J(), q(u(y), {
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: f,
289
+ ref: i,
279
290
  "initial-values": {
280
- [t.name]: u(m)
291
+ [o.name]: u(m)
281
292
  },
282
293
  style: {
283
294
  height: "100%"
284
295
  }
285
296
  }, {
286
- default: h(() => [v(u(y).FormItem, {
297
+ default: h(() => [b(u(y).FormItem, {
287
298
  name: e.name,
288
299
  "no-style": ""
289
300
  }, {
290
- default: h(() => [v(ie, Q(u(le)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
301
+ default: h(() => [b(fe, X(u(ne)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
291
302
  ref_key: "tableRef",
292
- ref: C,
303
+ ref: w,
293
304
  class: u(V)(),
294
- columns: u(E),
305
+ columns: u(D),
295
306
  "data-source": u(m),
296
307
  "search-form": !1
297
- }), X({
308
+ }), Y({
298
309
  _: 2
299
- }, [Y(N, (o, l) => ({
310
+ }, [Z(N, (a, l) => ({
300
311
  name: l,
301
- fn: h((s) => [Z(e.$slots, l, M(ee(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
- be as default
321
+ Re as default
311
322
  };