@aplus-frontend/ui 7.20.1 → 7.20.3

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 (33) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +72 -70
  2. package/es/src/ag-grid/editable/index.vue.mjs +59 -57
  3. package/es/src/ag-grid/editable/interface.d.ts +7 -0
  4. package/es/src/ag-grid/hooks/use-columns.mjs +18 -18
  5. package/es/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
  6. package/es/src/ag-grid/hooks/use-editable-api.mjs +107 -88
  7. package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +1 -0
  8. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +105 -86
  9. package/es/src/ag-grid/index.vue.mjs +169 -166
  10. package/es/src/ap-action/item-popconfirm/index.vue.mjs +14 -14
  11. package/es/src/ap-field/select/index.vue.mjs +125 -122
  12. package/es/src/ap-list/hooks/use-offline-list.mjs +31 -18
  13. package/es/src/check-card/index.vue.d.ts +0 -1
  14. package/es/src/check-card/index.vue2.mjs +3 -5
  15. package/es/src/version.d.ts +1 -1
  16. package/es/src/version.mjs +1 -1
  17. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  18. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  19. package/lib/src/ag-grid/editable/interface.d.ts +7 -0
  20. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  21. package/lib/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
  22. package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
  23. package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +1 -0
  24. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  25. package/lib/src/ag-grid/index.vue.js +1 -1
  26. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
  27. package/lib/src/ap-field/select/index.vue.js +1 -1
  28. package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
  29. package/lib/src/check-card/index.vue.d.ts +0 -1
  30. package/lib/src/check-card/index.vue2.js +1 -1
  31. package/lib/src/version.d.ts +1 -1
  32. package/lib/src/version.js +1 -1
  33. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
- import { defineComponent as Q, useSlots as X, ref as w, watch as y, unref as l, createElementBlock as Y, openBlock as Z, Fragment as ee, createVNode as c, mergeProps as g, withCtx as h, createSlots as oe, renderList as te, renderSlot as ae, normalizeProps as ne, guardReactiveProps as le } from "vue";
2
- import { isEqual as C, cloneDeep as re, omit as se } from "lodash-unified";
1
+ import { defineComponent as X, useSlots as Y, ref as y, watch as w, unref as l, createElementBlock as Z, openBlock as ee, Fragment as oe, createVNode as c, mergeProps as g, withCtx as h, createSlots as te, renderList as ae, renderSlot as ne, normalizeProps as le, guardReactiveProps as re } from "vue";
2
+ import { isEqual as C, cloneDeep as se, omit as ie } from "lodash-unified";
3
3
  import { ApForm as b } from "../../ap-form/index.mjs";
4
- import { useInjectForm as ie } from "../../ap-form/context.mjs";
4
+ import { useInjectForm as me } from "../../ap-form/context.mjs";
5
5
  import { useWatch as R } from "../../ap-form/hooks/use-watch.mjs";
6
- import { getModelValue as me } from "../../ap-form/utils/get.mjs";
7
- import { transformValues as ue } from "../../ap-form/utils/transform.mjs";
6
+ import { getModelValue as ue } from "../../ap-form/utils/get.mjs";
7
+ import { transformValues as de } from "../../ap-form/utils/transform.mjs";
8
8
  import "../../config-provider/index.mjs";
9
- import { useGetEditableColumns as de } from "../hooks/use-editable-columns.mjs";
10
- import { useEditableFormItemApi as pe } from "../hooks/use-editable-form-item-api.mjs";
9
+ import { useGetEditableColumns as pe } from "../hooks/use-editable-columns.mjs";
10
+ import { useEditableFormItemApi as ce } from "../hooks/use-editable-form-item-api.mjs";
11
11
  import "../index.vue2.mjs";
12
- import ce from "../style/editable.mjs";
13
- import { getShadowName as fe } from "../utils.mjs";
14
- import { getColumnTransformOptions as we, arrayToObject as ye, getRowKey as ge } from "./utils.mjs";
15
- import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
16
- import { useGlobalConfig as Ce } from "../../config-provider/hooks/use-global-config.mjs";
17
- import be from "../index.vue.mjs";
18
- const ze = /* @__PURE__ */ Q({
12
+ import fe from "../style/editable.mjs";
13
+ import { getShadowName as ye } from "../utils.mjs";
14
+ import { getColumnTransformOptions as we, arrayToObject as ge, getRowKey as he } from "./utils.mjs";
15
+ import { useNamespace as Ce } from "../../config-provider/hooks/use-namespace.mjs";
16
+ import { useGlobalConfig as be } from "../../config-provider/hooks/use-global-config.mjs";
17
+ import Re from "../index.vue.mjs";
18
+ const Oe = /* @__PURE__ */ X({
19
19
  name: "EditableGrid",
20
20
  __name: "form-item",
21
21
  props: {
@@ -143,33 +143,33 @@ const ze = /* @__PURE__ */ Q({
143
143
  name: {},
144
144
  formItem: {}
145
145
  },
146
- setup(v, {
147
- expose: B
146
+ setup(B, {
147
+ expose: v
148
148
  }) {
149
- const x = X(), a = v, {
149
+ const x = Y(), a = B, {
150
150
  b: T
151
- } = he("editable-aggrid"), S = ce("editable-aggrid"), r = w(), {
151
+ } = Ce("editable-aggrid"), S = fe("editable-aggrid"), r = y(), {
152
152
  internalInstance: s
153
- } = ie();
153
+ } = me();
154
154
  function I(e) {
155
155
  const o = we(a.columns || []);
156
156
  if (!Object.keys(o).length || !e?.length)
157
157
  return e;
158
158
  let t = [];
159
159
  for (const m of e)
160
- t.push(ue(m, o));
160
+ t.push(de(m, o));
161
161
  return t;
162
162
  }
163
- const i = fe(a.name);
163
+ const i = ye(a.name);
164
164
  function F() {
165
- return a.formItem?.initialValue ?? me(s?.getInitialValues() ?? {}, a.name) ?? [];
165
+ return a.formItem?.initialValue ?? ue(s?.getInitialValues() ?? {}, a.name) ?? [];
166
166
  }
167
167
  let V = F();
168
- const n = w([]), E = R(a.name), D = R(i);
169
- y(() => E.value, (e) => {
168
+ const n = y([]), E = R(a.name), D = R(i);
169
+ w(() => E.value, (e) => {
170
170
  if (C(e, n.value))
171
171
  return;
172
- const o = e ?? re(V);
172
+ const o = e ?? se(V);
173
173
  n.value = [...o];
174
174
  }, {
175
175
  deep: !0,
@@ -177,8 +177,8 @@ const ze = /* @__PURE__ */ Q({
177
177
  immediate: !0
178
178
  });
179
179
  let u;
180
- y(n, (e) => {
181
- const o = ye(e, a.rowKey);
180
+ w(n, (e) => {
181
+ const o = ge(e, a.rowKey);
182
182
  C(o, l(D)) || (u = () => {
183
183
  s?.setFieldValue(a.name, [...e]), s?.setFieldValue(i, o);
184
184
  });
@@ -186,20 +186,21 @@ const ze = /* @__PURE__ */ Q({
186
186
  deep: !0,
187
187
  immediate: !0
188
188
  });
189
- const N = Ce("valueTypeMap"), A = de(a, N, i), {
190
- add: K,
191
- addMultiple: j,
192
- remove: _,
193
- removeByKey: k,
194
- getRowData: z,
195
- getRowsData: O,
196
- getRowDataByKey: U,
197
- setRowData: H,
198
- setRowDataByKey: L,
199
- clear: P,
189
+ const K = be("valueTypeMap"), N = pe(a, K, i), {
190
+ add: A,
191
+ addByKey: j,
192
+ addMultiple: _,
193
+ remove: k,
194
+ removeByKey: z,
195
+ getRowData: O,
196
+ getRowsData: U,
197
+ getRowDataByKey: H,
198
+ setRowData: L,
199
+ setRowDataByKey: P,
200
+ clear: G,
200
201
  refreshRowIds: d
201
- } = pe(a, s, n, i);
202
- function G() {
202
+ } = ce(a, s, n, i);
203
+ function M() {
203
204
  if (a.onUpdate?.(), u && (u(), u = void 0), a.supressForceRowUpdate)
204
205
  return;
205
206
  const e = r.value?._internalGridApi;
@@ -211,51 +212,52 @@ const ze = /* @__PURE__ */ Q({
211
212
  force: !0
212
213
  }), d.value = [];
213
214
  }
214
- function M(e) {
215
+ function W(e) {
215
216
  n.value = [...e];
216
217
  }
217
218
  function f(e, o) {
218
219
  const t = e === "end" ? n.value.length - 1 : e;
219
220
  r.value?.scrollToRow(t, o);
220
221
  }
221
- function W(e, o) {
222
+ function $(e, o) {
222
223
  r.value?.scrollToColumn(e, o);
223
224
  }
224
- function $(e, o) {
225
+ function q(e, o) {
225
226
  const t = [i, String(e), o].flat();
226
227
  return s?.validateFields([t]);
227
228
  }
228
- function q(e) {
229
- const t = l(n).map((m, p) => [i, String(ge(m, p, a.rowKey)), e].flat());
229
+ function J(e) {
230
+ const t = l(n).map((m, p) => [i, String(he(m, p, a.rowKey)), e].flat());
230
231
  return s?.validateFields(t);
231
232
  }
232
- function J(e, o = !0) {
233
+ function Q(e, o = !0) {
233
234
  const t = Array.isArray(e) ? e : [e];
234
235
  r.value?._internalGridApi?.refreshCells({
235
236
  columns: t,
236
237
  force: o
237
238
  });
238
239
  }
239
- return B({
240
- add: K,
241
- addMultiple: j,
242
- remove: _,
243
- removeByKey: k,
244
- getRowData: z,
245
- getRowsData: O,
246
- getRowDataByKey: U,
247
- setRowData: H,
248
- clear: P,
249
- setTableData: M,
240
+ return v({
241
+ add: A,
242
+ addByKey: j,
243
+ addMultiple: _,
244
+ remove: k,
245
+ removeByKey: z,
246
+ getRowData: O,
247
+ getRowsData: U,
248
+ getRowDataByKey: H,
249
+ setRowData: L,
250
+ clear: G,
251
+ setTableData: W,
250
252
  scrollTo: f,
251
253
  scrollToRow: f,
252
- scrollToColumn: W,
253
- validateCell: $,
254
- validateColumn: q,
255
- setRowDataByKey: L,
254
+ scrollToColumn: $,
255
+ validateCell: q,
256
+ validateColumn: J,
257
+ setRowDataByKey: P,
256
258
  table: r,
257
- refreshColumns: J
258
- }), (e, o) => (Z(), Y(ee, null, [c(l(b).FormItem, {
259
+ refreshColumns: Q
260
+ }), (e, o) => (ee(), Z(oe, null, [c(l(b).FormItem, {
259
261
  hidden: "",
260
262
  name: e.name,
261
263
  "initial-value": e.formItem?.initialValue,
@@ -263,25 +265,25 @@ const ze = /* @__PURE__ */ Q({
263
265
  }, null, 8, ["name", "initial-value"]), c(l(b).FormItem, g({
264
266
  label: e.label
265
267
  }, e.formItem), {
266
- default: h(() => [c(be, g(l(se)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem", "onUpdate"]), {
268
+ default: h(() => [c(Re, g(l(ie)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem", "onUpdate"]), {
267
269
  ref_key: "tableRef",
268
270
  ref: r,
269
271
  class: [l(T)(), l(S)],
270
272
  size: "mini",
271
- columns: l(A),
273
+ columns: l(N),
272
274
  "data-source": n.value,
273
275
  "search-form": !1,
274
- onUpdate: G
275
- }), oe({
276
+ onUpdate: M
277
+ }), te({
276
278
  _: 2
277
- }, [te(x, (t, m) => ({
279
+ }, [ae(x, (t, m) => ({
278
280
  name: m,
279
- fn: h((p) => [ae(e.$slots, m, ne(le(p || {})))])
281
+ fn: h((p) => [ne(e.$slots, m, le(re(p || {})))])
280
282
  }))]), 1040, ["class", "columns", "data-source"])]),
281
283
  _: 3
282
284
  }, 16, ["label"])], 64));
283
285
  }
284
286
  });
285
287
  export {
286
- ze as default
288
+ Oe as default
287
289
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as Q, useSlots as X, ref as h, watch as Y, unref as r, createBlock as Z, openBlock as ee, withCtx as c, createVNode as C, mergeProps as oe, createSlots as ae, renderList as te, renderSlot as ne, normalizeProps as re, guardReactiveProps as le } from "vue";
2
- import { isEqual as se, isArray as b, omit as ie } from "lodash-unified";
1
+ import { defineComponent as X, useSlots as Y, ref as h, watch as Z, unref as r, createBlock as ee, openBlock as oe, withCtx as c, createVNode as C, mergeProps as ae, createSlots as te, renderList as ne, renderSlot as re, normalizeProps as le, guardReactiveProps as se } from "vue";
2
+ import { isEqual as ie, isArray as b, omit as de } from "lodash-unified";
3
3
  import { ApForm as f } from "../../ap-form/index.mjs";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { useEditableApi as de } from "../hooks/use-editable-api.mjs";
7
- import { useGetEditableColumns as ue } from "../hooks/use-editable-columns.mjs";
6
+ import { useEditableApi as ue } from "../hooks/use-editable-api.mjs";
7
+ import { useGetEditableColumns as pe } from "../hooks/use-editable-columns.mjs";
8
8
  import "../index.vue2.mjs";
9
- import pe from "../style/editable.mjs";
10
- import { arrayToObject as v, getRowKey as me } from "./utils.mjs";
11
- import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
12
- import { useControllableValue as fe } from "../../hooks/useControllableValue.mjs";
13
- import { useGlobalConfig as ye } from "../../config-provider/hooks/use-global-config.mjs";
14
- import we from "../index.vue.mjs";
15
- const Ke = /* @__PURE__ */ Q({
9
+ import me from "../style/editable.mjs";
10
+ import { arrayToObject as v, getRowKey as ce } from "./utils.mjs";
11
+ import { useNamespace as fe } from "../../config-provider/hooks/use-namespace.mjs";
12
+ import { useControllableValue as ye } from "../../hooks/useControllableValue.mjs";
13
+ import { useGlobalConfig as we } from "../../config-provider/hooks/use-global-config.mjs";
14
+ import ge from "../index.vue.mjs";
15
+ const ke = /* @__PURE__ */ X({
16
16
  name: "EditableGrid",
17
17
  __name: "index",
18
18
  props: {
@@ -147,35 +147,36 @@ const Ke = /* @__PURE__ */ Q({
147
147
  expose: B,
148
148
  emit: S
149
149
  }) {
150
- const T = X(), t = x, {
150
+ const T = Y(), t = x, {
151
151
  b: F
152
- } = ce("editable-aggrid"), _ = pe("editable-aggrid"), A = S, s = h(), {
152
+ } = fe("editable-aggrid"), _ = me("editable-aggrid"), A = S, s = h(), {
153
153
  value: i,
154
154
  updateValue: y
155
- } = fe(t, A), l = h(), E = f.useWatch(t.name, l);
155
+ } = ye(t, A), l = h(), E = f.useWatch(t.name, l);
156
156
  let d;
157
- Y(i, (e) => {
157
+ Z(i, (e) => {
158
158
  const o = v(e, t.rowKey);
159
- se(o, r(E)) || (d = () => {
159
+ ie(o, r(E)) || (d = () => {
160
160
  l.value?.setFieldValue(t.name, o);
161
161
  });
162
162
  }, {
163
163
  deep: !0
164
164
  });
165
- const K = ye("valueTypeMap"), k = ue(t, K), {
165
+ const K = we("valueTypeMap"), k = pe(t, K), {
166
166
  add: D,
167
- addMultiple: N,
168
- remove: U,
169
- removeByKey: I,
170
- getRowData: j,
171
- getRowsData: z,
172
- getRowDataByKey: V,
173
- setRowData: H,
174
- setRowDataByKey: O,
175
- clear: G,
167
+ addByKey: N,
168
+ addMultiple: U,
169
+ remove: I,
170
+ removeByKey: j,
171
+ getRowData: z,
172
+ getRowsData: V,
173
+ getRowDataByKey: H,
174
+ setRowData: O,
175
+ setRowDataByKey: G,
176
+ clear: L,
176
177
  refreshRowIds: u
177
- } = de(t, l, i, y);
178
- function L() {
178
+ } = ue(t, l, i, y);
179
+ function P() {
179
180
  if (t.onUpdate?.(), d && (d(), d = void 0), t.supressForceRowUpdate)
180
181
  return;
181
182
  const e = s.value?._internalGridApi;
@@ -187,7 +188,7 @@ const Ke = /* @__PURE__ */ Q({
187
188
  force: !0
188
189
  }), u.value = [];
189
190
  }
190
- function P() {
191
+ function M() {
191
192
  l.value?.resetFields();
192
193
  }
193
194
  function w(e) {
@@ -195,31 +196,31 @@ const Ke = /* @__PURE__ */ Q({
195
196
  }
196
197
  function g(e) {
197
198
  try {
198
- const o = Object.keys(e), a = i.value.map((n) => me(n, void 0, t.rowKey));
199
+ const o = Object.keys(e), a = i.value.map((n) => ce(n, void 0, t.rowKey));
199
200
  return o.sort((n, p) => a.findIndex((m) => String(m) === n) - a.findIndex((m) => String(m) === p)), o.map((n) => e[n]);
200
201
  } catch {
201
202
  return e;
202
203
  }
203
204
  }
204
- async function M(e, o) {
205
+ async function W(e, o) {
205
206
  const n = (await l.value?.validateFields(w(e), o))?.[t.name];
206
207
  return g(n);
207
208
  }
208
- async function W(e, o) {
209
+ async function $(e, o) {
209
210
  const n = (await l.value?.validateFieldsReturnTransformed(w(e), o))?.[t.name];
210
211
  return g(n);
211
212
  }
212
- function $(e) {
213
+ function q(e) {
213
214
  y(e);
214
215
  }
215
216
  function R(e, o) {
216
217
  const a = e === "end" ? i.value.length - 1 : e;
217
218
  s.value?.scrollToRow(a, o);
218
219
  }
219
- function q(e, o) {
220
+ function J(e, o) {
220
221
  s.value?.scrollToColumn(e, o);
221
222
  }
222
- function J(e, o = !0) {
223
+ function Q(e, o = !0) {
223
224
  const a = Array.isArray(e) ? e : [e];
224
225
  s.value?._internalGridApi?.refreshCells({
225
226
  columns: a,
@@ -227,26 +228,27 @@ const Ke = /* @__PURE__ */ Q({
227
228
  });
228
229
  }
229
230
  return B({
230
- resetFields: P,
231
- validateFields: M,
232
- validateFieldsReturnTransformed: W,
231
+ resetFields: M,
232
+ validateFields: W,
233
+ validateFieldsReturnTransformed: $,
233
234
  add: D,
234
- addMultiple: N,
235
- remove: U,
236
- removeByKey: I,
237
- getRowData: j,
238
- getRowsData: z,
239
- setRowData: H,
240
- clear: G,
241
- setTableData: $,
235
+ addByKey: N,
236
+ addMultiple: U,
237
+ remove: I,
238
+ removeByKey: j,
239
+ getRowData: z,
240
+ getRowsData: V,
241
+ setRowData: O,
242
+ clear: L,
243
+ setTableData: q,
242
244
  scrollTo: R,
243
245
  scrollToRow: R,
244
- scrollToColumn: q,
246
+ scrollToColumn: J,
245
247
  table: s,
246
- getRowDataByKey: V,
247
- setRowDataByKey: O,
248
- refreshColumns: J
249
- }), (e, o) => (ee(), Z(r(f), {
248
+ getRowDataByKey: H,
249
+ setRowDataByKey: G,
250
+ refreshColumns: Q
251
+ }), (e, o) => (oe(), ee(r(f), {
250
252
  ref_key: "formRef",
251
253
  ref: l,
252
254
  "initial-values": {
@@ -260,7 +262,7 @@ const Ke = /* @__PURE__ */ Q({
260
262
  name: e.name,
261
263
  "no-style": ""
262
264
  }, {
263
- default: c(() => [C(we, oe(r(ie)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "onUpdate"]), {
265
+ default: c(() => [C(ge, ae(r(de)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "onUpdate"]), {
264
266
  ref_key: "tableRef",
265
267
  ref: s,
266
268
  class: [r(F)(), r(_)],
@@ -268,12 +270,12 @@ const Ke = /* @__PURE__ */ Q({
268
270
  columns: r(k),
269
271
  "data-source": r(i),
270
272
  "search-form": !1,
271
- onUpdate: L
272
- }), ae({
273
+ onUpdate: P
274
+ }), te({
273
275
  _: 2
274
- }, [te(T, (a, n) => ({
276
+ }, [ne(T, (a, n) => ({
275
277
  name: n,
276
- fn: c((p) => [ne(e.$slots, n, re(le(p || {})))])
278
+ fn: c((p) => [re(e.$slots, n, le(se(p || {})))])
277
279
  }))]), 1040, ["class", "columns", "data-source"])]),
278
280
  _: 3
279
281
  }, 8, ["name"])]),
@@ -282,5 +284,5 @@ const Ke = /* @__PURE__ */ Q({
282
284
  }
283
285
  });
284
286
  export {
285
- Ke as default
287
+ ke as default
286
288
  };
@@ -111,6 +111,13 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
111
111
  * @returns
112
112
  */
113
113
  refreshColumns: (columnKey: string | string[], force?: boolean) => void;
114
+ /**
115
+ * 添加一条数据(通过行key)
116
+ * @param defaultValue
117
+ * @param key
118
+ * @returns
119
+ */
120
+ addByKey: (defaultValue?: Partial<RecordType> | undefined, key?: number) => void;
114
121
  };
115
122
  export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
116
123
  /**
@@ -1,11 +1,11 @@
1
- import { ref as s, computed as c, watch as y } from "vue";
1
+ import { ref as c, computed as s, watch as y } from "vue";
2
2
  import { getStringKey as a, runPipelineHooks as C } from "../utils.mjs";
3
- const w = (o) => {
4
- const r = s([]), u = s([]);
5
- function l(n = []) {
3
+ const w = (r) => {
4
+ const o = c([]), l = c([]);
5
+ function u(n = []) {
6
6
  return n.filter((e) => !e.hideInTable).map((e) => {
7
7
  if (e.children?.length) {
8
- const t = l(e.children);
8
+ const t = u(e.children);
9
9
  return t?.length ? {
10
10
  ...e,
11
11
  children: t
@@ -14,25 +14,25 @@ const w = (o) => {
14
14
  return e;
15
15
  }).filter(Boolean);
16
16
  }
17
- function f(n) {
18
- return r.value.find((e) => a(e.key) === n);
17
+ function m(n) {
18
+ return o.value.find((e) => a(e.key) === n);
19
19
  }
20
- const m = c(
21
- () => r.value.map((n) => a(n.key)).filter(Boolean)
20
+ const f = s(
21
+ () => o.value.map((n) => a(n.key)).filter(Boolean)
22
22
  );
23
23
  async function d(n, e) {
24
24
  return await C(
25
- o.plugins,
25
+ r.plugins,
26
26
  n,
27
27
  (t) => t.beforeColumnsChange?.bind(t),
28
28
  e
29
29
  );
30
30
  }
31
31
  y(
32
- () => o.columns,
32
+ () => r.columns,
33
33
  async () => {
34
- const n = l(o.columns), e = await d(n, r.value);
35
- r.value = e, u.value = e, o.onShownColumnsChange?.(e);
34
+ const n = u(r.columns), e = await d(n, o.value);
35
+ o.value = e, l.value = e, r.onShownColumnsChange?.(e);
36
36
  },
37
37
  {
38
38
  deep: !0,
@@ -54,12 +54,12 @@ const w = (o) => {
54
54
  };
55
55
  }
56
56
  }
57
- const h = c(() => i(r.value));
57
+ const h = s(() => i(u(r.columns)));
58
58
  return {
59
- columns: r,
60
- shownColumns: u,
61
- columnKeys: m,
62
- getTargetColumnByKey: f,
59
+ columns: o,
60
+ shownColumns: l,
61
+ columnKeys: f,
62
+ getTargetColumnByKey: m,
63
63
  defaultSortOrder: h
64
64
  };
65
65
  };
@@ -4,6 +4,7 @@ import { ApFormInternalInstance, ApFormExpose } from '../../ap-form';
4
4
  import { EditableAgGridProps } from '../editable/interface';
5
5
  export declare const useEditableApi: <RecordType>(props: EditableAgGridProps<RecordType>, formApi: Ref<ApFormExpose | undefined> | ApFormInternalInstance | undefined, tableData: Ref<RecordType[]>, updateTableData?: (newData: RecordType[]) => void) => {
6
6
  add: (defaultValue?: Partial<RecordType>, insertIndex?: number) => void;
7
+ addByKey: (defaultValue?: Partial<RecordType>, key?: number) => void;
7
8
  addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
8
9
  remove: (data: RecordType | RecordType[]) => void;
9
10
  removeByKey: (key: Key | Key[]) => void;