@aplus-frontend/ui 6.32.0 → 6.34.0

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