@aplus-frontend/ui 7.19.1 → 7.19.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.
@@ -1,10 +1,10 @@
1
- import { defineComponent as xo, useSlots as Mo, ref as h, toRef as M, computed as i, unref as r, nextTick as A, watch as H, createElementBlock as U, openBlock as y, normalizeStyle as _, normalizeClass as v, createCommentVNode as fe, createElementVNode as T, createVNode as ko, mergeProps as j, createSlots as Fo, withCtx as ge, Fragment as Bo, renderList as Io, createBlock as $, resolveDynamicComponent as Ao, renderSlot as we } from "vue";
1
+ import { defineComponent as ko, useSlots as xo, ref as h, toRef as x, computed as i, unref as r, nextTick as A, watch as W, createElementBlock as U, openBlock as y, normalizeStyle as _, normalizeClass as R, createCommentVNode as fe, createElementVNode as T, createVNode as Mo, mergeProps as j, createSlots as Fo, withCtx as ge, Fragment as Bo, renderList as Io, createBlock as $, resolveDynamicComponent as Ao, renderSlot as we } from "vue";
2
2
  import { AG_GRID_LOCALE_EN as To, AG_GRID_LOCALE_CN as Eo } from "@ag-grid-community/locale";
3
3
  import { Pagination as No } from "@aplus-frontend/antdv";
4
- import { useToken as Do } from "@aplus-frontend/antdv/es/theme/internal";
5
- import { ModuleRegistry as Po, ValidationModule as zo, ColumnAutoSizeModule as Oo, PinnedRowModule as Vo, RowAutoHeightModule as Ko, RowStyleModule as Go, CellSpanModule as Lo, CellStyleModule as Wo, TooltipModule as Ho, RowSelectionModule as Uo, LocaleModule as _o, ValueCacheModule as jo, GridStateModule as $o, ColumnApiModule as qo, RowApiModule as Jo, CellApiModule as Qo, RenderApiModule as Xo, EventApiModule as Yo, ScrollApiModule as Zo, ClientSideRowModelApiModule as et, ClientSideRowModelModule as ot } from "ag-grid-community";
4
+ import { useToken as zo } from "@aplus-frontend/antdv/es/theme/internal";
5
+ import { ModuleRegistry as Do, ValidationModule as Po, ColumnAutoSizeModule as Oo, PinnedRowModule as Vo, RowAutoHeightModule as Ko, RowStyleModule as Go, CellSpanModule as Lo, CellStyleModule as Ho, TooltipModule as Wo, RowSelectionModule as Uo, LocaleModule as _o, ValueCacheModule as jo, GridStateModule as $o, ColumnApiModule as qo, RowApiModule as Jo, CellApiModule as Qo, RenderApiModule as Xo, EventApiModule as Yo, ScrollApiModule as Zo, ClientSideRowModelApiModule as et, ClientSideRowModelModule as ot } from "ag-grid-community";
6
6
  import { AgGridVue as tt } from "ag-grid-vue3";
7
- import { isUndefined as k, isFunction as E, omit as rt } from "lodash-unified";
7
+ import { isUndefined as M, isFunction as E, omit as rt } from "lodash-unified";
8
8
  import { DEFAULT_ROW_SELECTION_CONFIG as Se, sizeReverseMap as nt, sizeMap as at } from "../ap-grid/constants.mjs";
9
9
  import { useProvideApTable as lt } from "../ap-table/context.mjs";
10
10
  import { useTablePaging as st } from "../ap-table/hooks/use-table-paging-ng.mjs";
@@ -25,17 +25,17 @@ import St from "./hooks/use-row-selection.mjs";
25
25
  import { useSearchForm as Ct } from "./hooks/use-search-form.mjs";
26
26
  import ht from "./hooks/use-selection-col-def.mjs";
27
27
  import yt from "./hooks/use-virtual-config.mjs";
28
- import vt from "./style/index.mjs";
29
- import { useTheme as Rt } from "./theme.mjs";
30
- import { runPipelineHooks as bt, runEffectHooks as q, mergeProps as xt } from "./utils.mjs";
31
- import { useNamespace as Mt } from "../config-provider/hooks/use-namespace.mjs";
32
- import { useLocale as kt } from "../config-provider/hooks/use-locale.mjs";
28
+ import Rt from "./style/index.mjs";
29
+ import { useTheme as vt } from "./theme.mjs";
30
+ import { runPipelineHooks as bt, runEffectHooks as q, mergeProps as kt } from "./utils.mjs";
31
+ import { useNamespace as xt } from "../config-provider/hooks/use-namespace.mjs";
32
+ import { useLocale as Mt } from "../config-provider/hooks/use-locale.mjs";
33
33
  import { useGlobalConfig as Ft } from "../config-provider/hooks/use-global-config.mjs";
34
34
  import { isDef as Bt } from "../utils/is.mjs";
35
35
  import It from "./components/row/index.vue2.mjs";
36
36
  import At from "./components/loading/index.vue2.mjs";
37
37
  import Tt from "./components/empty/index.vue2.mjs";
38
- const gr = /* @__PURE__ */ xo({
38
+ const gr = /* @__PURE__ */ ko({
39
39
  name: "AgGrid",
40
40
  __name: "index",
41
41
  props: {
@@ -121,15 +121,15 @@ const gr = /* @__PURE__ */ xo({
121
121
  "zh-cn": Eo,
122
122
  en: To
123
123
  };
124
- Po.registerModules([
125
- zo,
124
+ Do.registerModules([
125
+ Po,
126
126
  Oo,
127
127
  Vo,
128
128
  Ko,
129
129
  Go,
130
130
  Lo,
131
- Wo,
132
131
  Ho,
132
+ Wo,
133
133
  Uo,
134
134
  _o,
135
135
  jo,
@@ -143,32 +143,32 @@ const gr = /* @__PURE__ */ xo({
143
143
  et,
144
144
  ot
145
145
  ]);
146
- const t = Ce, N = Mo(), { e: D, b: d, be: ve } = Mt("ag-grid"), { lang: J } = kt(), Re = vt("ag-grid"), R = h(t.size), be = Rt(
147
- R,
148
- M(t, "rowHeight"),
149
- M(t, "theme")
150
- ), xe = yt(M(t, "virtual")), { rowPinnedGridConfig: Q, getRowPinnedCellClass: Me } = wt(
151
- M(t, "summary")
152
- ), ke = Ft("apGrid"), s = h(), [, Fe] = Do();
153
- let b = !!t.dataSource;
154
- async function P(e, o = {}) {
146
+ const o = Ce, N = xo(), { e: z, b: c, be: Re } = xt("ag-grid"), { lang: J } = Mt(), ve = Rt("ag-grid"), v = h(o.size), be = vt(
147
+ v,
148
+ x(o, "rowHeight"),
149
+ x(o, "theme")
150
+ ), ke = yt(x(o, "virtual")), { rowPinnedGridConfig: Q, getRowPinnedCellClass: xe } = wt(
151
+ x(o, "summary")
152
+ ), Me = Ft("apGrid"), s = h(), [, Fe] = zo();
153
+ let b = !!o.dataSource;
154
+ async function D(e, t = {}) {
155
155
  const n = await bt(
156
- t.plugins,
156
+ o.plugins,
157
157
  e,
158
158
  (a) => a.beforeApplyColumnState?.bind(a)
159
159
  );
160
- s.value.applyColumnState({ state: n, ...o });
160
+ s.value.applyColumnState({ state: n, ...t });
161
161
  }
162
- const X = Ct(t), {
162
+ const X = Ct(o), {
163
163
  shownColumns: w,
164
164
  columns: Y,
165
165
  columnKeys: Be,
166
166
  getTargetColumnByKey: Ie,
167
167
  defaultSortOrder: F
168
- } = ft(t), { defaultColDef: Ae, columnDefs: Z, gridWrapperRef: Te } = gt(
168
+ } = ft(o), { defaultColDef: Ae, columnDefs: Z, gridWrapperRef: Te } = gt(
169
169
  Y,
170
- t,
171
- Me,
170
+ o,
171
+ xe,
172
172
  N.headerCell
173
173
  ), Ee = {
174
174
  asc: "ascend",
@@ -183,10 +183,10 @@ const gr = /* @__PURE__ */ xo({
183
183
  [e.colKey]: ee[e.order]
184
184
  } : {};
185
185
  }
186
- function De() {
187
- const e = oe.value, o = F.value;
188
- if (o && e.includes(o.field))
189
- return o;
186
+ function ze() {
187
+ const e = oe.value, t = F.value;
188
+ if (t && e.includes(t.field))
189
+ return t;
190
190
  }
191
191
  const B = h(Ne());
192
192
  mt({
@@ -195,13 +195,13 @@ const gr = /* @__PURE__ */ xo({
195
195
  B.value = e;
196
196
  }
197
197
  });
198
- function Pe() {
199
- const e = s.value.getColumns()?.filter((c) => c.getSort() != null), o = r(B) || {};
198
+ function De() {
199
+ const e = s.value.getColumns()?.filter((m) => m.getSort() != null), t = r(B) || {};
200
200
  let n = e?.[0];
201
- const a = Object.keys(o);
202
- if (a.length && a.every((c) => o[c] === null)) {
203
- const c = Object.keys(o)[0];
204
- c && (n = s.value?.getColumn(c));
201
+ const a = Object.keys(t);
202
+ if (a.length && a.every((m) => t[m] === null)) {
203
+ const m = Object.keys(t)[0];
204
+ m && (n = s.value?.getColumn(m));
205
205
  }
206
206
  if (!n)
207
207
  return;
@@ -215,27 +215,27 @@ const gr = /* @__PURE__ */ xo({
215
215
  const oe = i(() => it(r(w), (e) => {
216
216
  if (e.sorter === !0)
217
217
  return e.field ?? e.dataIndex ?? e.key;
218
- }).filter(Boolean)), ze = () => {
218
+ }).filter(Boolean)), Pe = () => {
219
219
  B.value = {};
220
220
  const e = s.value;
221
221
  if (!e)
222
222
  return;
223
- const o = e.getColumnState()?.map((n) => ({ ...n, sort: null }));
224
- P(o);
225
- }, z = h({});
226
- pt({ expandable: z });
223
+ const t = e.getColumnState()?.map((n) => ({ ...n, sort: null }));
224
+ D(t);
225
+ }, P = h({});
226
+ pt({ expandable: P });
227
227
  function Oe(e) {
228
- const o = e.columnGroup;
229
- o && (z.value = {
230
- ...z.value,
231
- [o.getGroupId()]: o.isExpanded()
228
+ const t = e.columnGroup;
229
+ t && (P.value = {
230
+ ...P.value,
231
+ [t.getGroupId()]: t.isExpanded()
232
232
  });
233
233
  }
234
- const O = h(!0), Ve = i(() => Bt(t.manual) ? t.manual : dt(N.searchFormExtra?.() || []).some((o) => o.type?.name === "ApView")), {
234
+ const O = h(!0), Ve = i(() => Bt(o.manual) ? o.manual : dt(N.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
235
235
  formRef: S,
236
236
  submit: V,
237
237
  reset: K,
238
- data: m,
238
+ data: p,
239
239
  tableProps: te,
240
240
  handleTableChangeOptional: re,
241
241
  submitWith: ne,
@@ -243,41 +243,41 @@ const gr = /* @__PURE__ */ xo({
243
243
  getPaging: Ke,
244
244
  setPaging: Ge,
245
245
  setDataSource: Le,
246
- getLastParams: We
246
+ getLastParams: He
247
247
  } = st({
248
248
  async request(e) {
249
- if (b = !1, C.value && !C.value.preserveSelectedRowKeys && k(t.dataSource) && !O.value && W(), O.value && (O.value = !1), !k(t.dataSource)) {
249
+ if (b = !1, C.value && !C.value.preserveSelectedRowKeys && M(o.dataSource) && !O.value && H(), O.value && (O.value = !1), !M(o.dataSource)) {
250
250
  const n = e.pageSize * (e.current - 1);
251
251
  return {
252
- data: (t.pagination === !1 ? t.dataSource : t.dataSource.slice(n, n + e.pageSize)) || [],
253
- total: t.dataSource.length || 0
252
+ data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(n, n + e.pageSize)) || [],
253
+ total: o.dataSource.length || 0
254
254
  };
255
255
  }
256
- const o = await t.request?.(e);
256
+ const t = await o.request?.(e);
257
257
  return {
258
- data: o?.data || [],
259
- total: o?.total || 0
258
+ data: t?.data || [],
259
+ total: t?.total || 0
260
260
  };
261
261
  },
262
262
  namespace: "ap-grid",
263
263
  filterFields: h([]),
264
- params: M(t, "params"),
265
- defaultData: t.defaultData,
264
+ params: x(o, "params"),
265
+ defaultData: o.defaultData,
266
266
  manual: r(Ve),
267
- formatParams: t.beforeSearchSubmit,
268
- pagination: t.pagination,
267
+ formatParams: o.beforeSearchSubmit,
268
+ pagination: o.pagination,
269
269
  sortFields: oe,
270
- onClickReset: ze,
271
- defaultSortOrder: De()
270
+ onClickReset: Pe,
271
+ defaultSortOrder: ze()
272
272
  }), C = i(() => {
273
- const e = t.rowSelection || ke.value?.rowSelection;
273
+ const e = o.rowSelection || Me.value?.rowSelection;
274
274
  if (e)
275
275
  return e === !0 ? Se : {
276
276
  ...Se,
277
277
  ...e
278
278
  };
279
- }), He = ht(t, w), Ue = i(
280
- () => k(t.dataSource) ? m.records : t.dataSource
279
+ }), We = ht(o, w), Ue = i(
280
+ () => M(o.dataSource) ? p.records : o.dataSource
281
281
  ), {
282
282
  select: _e,
283
283
  unSelect: je,
@@ -290,7 +290,7 @@ const gr = /* @__PURE__ */ xo({
290
290
  } = St({
291
291
  ...C.value,
292
292
  dataSource: Ue,
293
- rowKey: t.rowKey
293
+ rowKey: o.rowKey
294
294
  }), Ye = {
295
295
  checkbox: "multiRow",
296
296
  radio: "singleRow"
@@ -298,27 +298,27 @@ const gr = /* @__PURE__ */ xo({
298
298
  const e = C.value;
299
299
  if (!e)
300
300
  return;
301
- const { type: o = "checkbox", disabled: n } = e;
301
+ const { type: t = "checkbox", disabled: n } = e;
302
302
  return {
303
- mode: Ye[o],
303
+ mode: Ye[t],
304
304
  isRowSelectable: (a) => n ? !n(a.data) : !0,
305
305
  hideDisabledCheckboxes: e.hideDisabled ?? !1
306
306
  };
307
307
  });
308
308
  function L(e) {
309
- return E(t.rowKey) ? t.rowKey(e) : e[t.rowKey];
309
+ return E(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
310
310
  }
311
311
  const I = ({
312
312
  api: e = s.value
313
313
  }) => {
314
- if (t.onUpdate?.(), !C.value)
314
+ if (o.onUpdate?.(), !C.value)
315
315
  return;
316
- const o = G.value || [];
316
+ const t = G.value || [];
317
317
  b = !1;
318
318
  const n = [];
319
319
  e.forEachNode((a) => {
320
- const p = a.data, u = L(p), f = a.isSelected();
321
- o.find((g) => L(g) === u) ? !f && n.push(a) : f && a.setSelected(!1);
320
+ const d = a.data, u = L(d), f = a.isSelected();
321
+ t.find((g) => L(g) === u) ? !f && n.push(a) : f && a.setSelected(!1);
322
322
  }), e.setNodesSelected({ nodes: n, newValue: !0 }), setTimeout(() => {
323
323
  b = !0;
324
324
  }, 0);
@@ -334,12 +334,12 @@ const gr = /* @__PURE__ */ xo({
334
334
  const e = s.value;
335
335
  if (!e || !F.value)
336
336
  return;
337
- const o = e.getColumnState(), { colKey: n, order: a } = F.value, p = o.map((u) => ({
337
+ const t = e.getColumnState(), { colKey: n, order: a } = F.value, d = t.map((u) => ({
338
338
  ...u,
339
339
  sort: u.colId === n ? ee[a] : null
340
340
  }));
341
- P(p);
342
- }, W = () => {
341
+ D(d);
342
+ }, H = () => {
343
343
  qe(), s.value?.deselectAll();
344
344
  };
345
345
  function to(e) {
@@ -348,7 +348,7 @@ const gr = /* @__PURE__ */ xo({
348
348
  });
349
349
  }
350
350
  const ro = i(() => {
351
- const e = t.customRow;
351
+ const e = o.customRow;
352
352
  return e ? {
353
353
  isFullWidthRow: e.isCustomRow,
354
354
  fullWidthCellRenderer: It,
@@ -368,8 +368,8 @@ const gr = /* @__PURE__ */ xo({
368
368
  });
369
369
  }
370
370
  function le(e = !1) {
371
- const o = e ? "getFieldsValueTransformed" : "getFieldsValue";
372
- return S.value?.apForm?.[o]?.(!0);
371
+ const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
372
+ return S.value?.apForm?.[t]?.(!0);
373
373
  }
374
374
  function se(e) {
375
375
  S.value?.apForm?.setFieldsValue?.(e);
@@ -387,53 +387,53 @@ const gr = /* @__PURE__ */ xo({
387
387
  return e && String(e);
388
388
  }
389
389
  function lo(e) {
390
- const o = s.value;
391
- if (!o)
390
+ const t = s.value;
391
+ if (!t)
392
392
  return;
393
- const n = o.getColumnState() || [], a = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), p = n.map((l) => {
393
+ const n = t.getColumnState() || [], a = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), d = n.map((l) => {
394
394
  if (!Be.value.includes(l.colId))
395
395
  return l;
396
- const x = !a.includes(l.colId), me = {
396
+ const k = !a.includes(l.colId), me = {
397
397
  ...l,
398
- hide: x
398
+ hide: k
399
399
  }, pe = e.find(
400
400
  (bo) => ce(bo.key) === l.colId
401
401
  );
402
402
  return pe && (me.pinned = pe.fixed || null), me;
403
403
  }), u = new Map(
404
- e.map((l, x) => [ce(l.key), x])
405
- ), f = p.filter((l) => u.has(l.colId)).sort(
406
- (l, x) => u.get(l.colId) - u.get(x.colId)
404
+ e.map((l, k) => [ce(l.key), k])
405
+ ), f = d.filter((l) => u.has(l.colId)).sort(
406
+ (l, k) => u.get(l.colId) - u.get(k.colId)
407
407
  ), g = [];
408
- let c = 0;
409
- for (const l of p)
410
- u.has(l.colId) ? g.push(f[c++]) : g.push(l);
411
- P(g, { applyOrder: !0 });
408
+ let m = 0;
409
+ for (const l of d)
410
+ u.has(l.colId) ? g.push(f[m++]) : g.push(l);
411
+ D(g, { applyOrder: !0 });
412
412
  }
413
413
  lt({
414
414
  columns: i(() => w.value),
415
415
  columnsBackup: i(() => Y.value),
416
- size: i(() => at[R.value]),
416
+ size: i(() => at[v.value]),
417
417
  updateColumns(e) {
418
- w.value = e, t.onShownColumnsChange?.(e), ut(
418
+ w.value = e, o.onShownColumnsChange?.(e), ut(
419
419
  () => s.value?.getColumnState(),
420
420
  () => {
421
421
  lo(e);
422
422
  },
423
423
  {
424
424
  interval: 17,
425
- check: (o) => !!(o && o.length > 0)
425
+ check: (t) => !!(t && t.length > 0)
426
426
  }
427
427
  );
428
428
  },
429
429
  updateSize(e) {
430
- R.value = nt[e];
430
+ v.value = nt[e];
431
431
  },
432
432
  renderConfig: i(() => ({
433
- className: ve("table-header", "title"),
433
+ className: Re("table-header", "title"),
434
434
  color: Fe.value.colorTextTertiary
435
435
  })),
436
- dataSource: i(() => r(m).records),
436
+ dataSource: i(() => r(p).records),
437
437
  getSearchFormValues: le,
438
438
  setSearchFormValues: se,
439
439
  submit: V,
@@ -443,36 +443,36 @@ const gr = /* @__PURE__ */ xo({
443
443
  getSearchFormSorterItems: ie,
444
444
  setSearchFormSorterItems: ue,
445
445
  resetSearchFormSorterItems: de,
446
- getLastParams: We
446
+ getLastParams: He
447
447
  });
448
- const so = i(() => (k(t.loading) ? m.loading : t.loading) || Z.value.length === 0), io = i(() => [
449
- d(),
450
- t.card ? null : d("wrapper"),
451
- d("adaptive"),
452
- d(`size-${R.value}`),
453
- t.autoHeight && m.records.length ? d("auto-height") : null,
454
- Re.value
448
+ const so = i(() => (M(o.loading) ? p.loading : o.loading) || Z.value.length === 0), io = i(() => [
449
+ c(),
450
+ o.card ? null : c("wrapper"),
451
+ c("adaptive"),
452
+ c(`size-${v.value}`),
453
+ o.autoHeight && p.records.length ? c("auto-height") : null,
454
+ ve.value
455
455
  ].filter(Boolean)), uo = i(() => ({
456
456
  height: "100%",
457
- ...t.tableStyle || {}
458
- })), co = (e, o) => {
459
- re({ current: e, pageSize: o });
457
+ ...o.tableStyle || {}
458
+ })), co = (e, t) => {
459
+ re({ current: e, pageSize: t });
460
460
  };
461
461
  function mo(e) {
462
- const o = e.data;
463
- return L(o);
462
+ const t = e.data;
463
+ return L(t);
464
464
  }
465
- function po(e, o) {
466
- (E(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, o);
465
+ function po(e, t) {
466
+ (E(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, t);
467
467
  }
468
- function fo(e, o) {
469
- s.value?.ensureColumnVisible(e, o);
468
+ function fo(e, t) {
469
+ s.value?.ensureColumnVisible(e, t);
470
470
  }
471
471
  function go(e) {
472
- t.onRowClicked?.(e.data, e.event);
472
+ o.onRowClicked?.(e.data, e.event);
473
473
  }
474
474
  function wo(e) {
475
- t.onScrollEnd?.(e.direction);
475
+ o.onScrollEnd?.(e.direction);
476
476
  }
477
477
  function So(e) {
478
478
  return s.value?.refreshCells(e);
@@ -480,49 +480,54 @@ const gr = /* @__PURE__ */ xo({
480
480
  function Co(e) {
481
481
  return s.value?.redrawRows(e);
482
482
  }
483
- function ho({ finished: e, column: o }) {
484
- !e || !o || (q(
485
- t.plugins,
486
- (n) => n.onColumnResized?.bind(n),
487
- o.getColId(),
488
- o.getActualWidth()
489
- ), t.onColumnResized?.(o.getColId(), o.getActualWidth()));
483
+ function ho({
484
+ finished: e,
485
+ columns: t,
486
+ source: n
487
+ }) {
488
+ if (!e || n !== "uiColumnResized")
489
+ return;
490
+ const a = (t || []).map((d) => ({
491
+ key: d.getColId(),
492
+ width: d.getActualWidth()
493
+ }));
494
+ q(o.plugins, (d) => d.onColumnResized?.bind(d), a), o.onColumnResized?.(a);
490
495
  }
491
496
  const yo = (e) => {
492
- const o = [
497
+ const t = [
493
498
  Q.value.getRowClass?.(e)
494
499
  ];
495
500
  if (!e.node.rowPinned) {
496
- const n = E(t.rowClassName) ? t.rowClassName(e.data, e.rowIndex) : t.rowClassName;
497
- o.push(n);
501
+ const n = E(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
502
+ t.push(n);
498
503
  }
499
- return o.flat().filter(Boolean);
500
- }, vo = ({ api: e }) => {
501
- s.value = e, q(t.plugins, (o) => o.init?.bind(o), e);
502
- }, Ro = (e, o, n) => {
504
+ return t.flat().filter(Boolean);
505
+ }, Ro = ({ api: e }) => {
506
+ s.value = e, q(o.plugins, (t) => t.init?.bind(t), e);
507
+ }, vo = (e, t, n) => {
503
508
  q(
504
- t.plugins,
509
+ o.plugins,
505
510
  (a) => a.searchParamsChange?.bind(this),
506
- o
507
- ), t.searchForm && t.searchForm.onValuesChange?.(e, o, n);
511
+ t
512
+ ), o.searchForm && o.searchForm.onValuesChange?.(e, t, n);
508
513
  };
509
- return H(
510
- () => t.dataSource,
514
+ return W(
515
+ () => o.dataSource,
511
516
  (e) => {
512
517
  A(() => {
513
518
  Le(e, !0);
514
519
  });
515
520
  },
516
521
  { immediate: !0, deep: !0 }
517
- ), H(
518
- () => t.size,
522
+ ), W(
523
+ () => o.size,
519
524
  (e) => {
520
- R.value = e;
525
+ v.value = e;
521
526
  }
522
- ), H(
523
- () => r(m).loading,
527
+ ), W(
528
+ () => r(p).loading,
524
529
  (e) => {
525
- t.onLoadingChange?.(e);
530
+ o.onLoadingChange?.(e);
526
531
  }
527
532
  ), he({
528
533
  submit: V,
@@ -536,12 +541,12 @@ const gr = /* @__PURE__ */ xo({
536
541
  selectedRows: i(() => G.value),
537
542
  setSelectedRowKeys: to,
538
543
  setSelectedRows: no,
539
- clearAll: W,
544
+ clearAll: H,
540
545
  unSelectRows: ao
541
546
  },
542
547
  scrollToRow: po,
543
548
  scrollToColumn: fo,
544
- getDataSource: () => r(m.records),
549
+ getDataSource: () => r(p.records),
545
550
  getPaging: Ke,
546
551
  setPaging: Ge,
547
552
  getSearchFormSorterItems: ie,
@@ -550,23 +555,23 @@ const gr = /* @__PURE__ */ xo({
550
555
  refreshCells: So,
551
556
  redrawRows: Co,
552
557
  _internalGridApi: i(() => s.value)
553
- }), (e, o) => (y(), U("div", {
554
- class: v(io.value),
558
+ }), (e, t) => (y(), U("div", {
559
+ class: R(io.value),
555
560
  style: _(e.wrapperStyle)
556
561
  }, [
557
- r(k)(e.dataSource) && e.searchForm !== !1 && r(X).length > 0 ? (y(), U("div", {
562
+ r(M)(e.dataSource) && e.searchForm !== !1 && r(X).length > 0 ? (y(), U("div", {
558
563
  key: 0,
559
- class: v(e.card ? r(D)("search-wrapper") : null),
564
+ class: R(e.card ? r(z)("search-wrapper") : null),
560
565
  style: _(e.searchFormWrapperStyle)
561
566
  }, [
562
- ko(r(ct).SearchForm, j(r(rt)(e.searchForm || {}, ["onValuesChange"]), {
567
+ Mo(r(ct).SearchForm, j(r(rt)(e.searchForm || {}, ["onValuesChange"]), {
563
568
  ref_key: "formRef",
564
569
  ref: S,
565
570
  "custom-reset": "",
566
571
  "submit-loading": r(te).loading,
567
572
  onSubmit: r(V),
568
573
  onReset: r(K),
569
- onValuesChange: Ro
574
+ onValuesChange: vo
570
575
  }), Fo({
571
576
  default: ge(() => [
572
577
  (y(!0), U(Bo, null, Io(r(X), (n) => (y(), $(Ao(n.renderNode), {
@@ -585,39 +590,39 @@ const gr = /* @__PURE__ */ xo({
585
590
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
586
591
  ], 6)) : fe("", !0),
587
592
  T("div", {
588
- class: v([r(D)("table-wrapper"), e.card ? r(D)("table-wrapper-card") : null]),
593
+ class: R([r(z)("table-wrapper"), e.card ? r(z)("table-wrapper-card") : null]),
589
594
  style: _(e.tableWrapperStyle)
590
595
  }, [
591
596
  T("div", {
592
- class: v(r(d)("header-wrapper"))
597
+ class: R(r(c)("header-wrapper"))
593
598
  }, [
594
599
  we(e.$slots, "title", {
595
600
  selectedRows: r(G),
596
601
  selectedRowKeys: r($e),
597
602
  shownColumns: r(w),
598
- clearAll: W
603
+ clearAll: H
599
604
  })
600
605
  ], 2),
601
606
  T("div", {
602
607
  ref_key: "gridWrapperRef",
603
608
  ref: Te,
604
- class: v(r(d)("grid-wrapper"))
609
+ class: R(r(c)("grid-wrapper"))
605
610
  }, [
606
611
  (y(), $(r(tt), j(
607
- r(xt)(r(xe), r(Q), ro.value),
612
+ r(kt)(r(ke), r(Q), ro.value),
608
613
  {
609
614
  key: r(J),
610
615
  "animate-rows": e.animateRows,
611
616
  "get-row-class": yo,
612
617
  style: uo.value,
613
- "row-data": r(m).records,
618
+ "row-data": r(p).records,
614
619
  "column-defs": r(Z),
615
620
  "default-col-def": r(Ae),
616
621
  "suppress-loading-overlay": "",
617
622
  "row-selection": Ze.value,
618
- "selection-column-def": r(He),
623
+ "selection-column-def": r(We),
619
624
  "get-row-id": mo,
620
- "get-row-height": t.getRowHeight,
625
+ "get-row-height": o.getRowHeight,
621
626
  theme: r(be),
622
627
  "tooltip-show-delay": 500,
623
628
  "enable-browser-tooltips": e.browserTooltips,
@@ -632,8 +637,8 @@ const gr = /* @__PURE__ */ xo({
632
637
  "enable-cell-span": "",
633
638
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
634
639
  "locale-text": ye[r(J)],
635
- onSortChanged: Pe,
636
- onGridReady: vo,
640
+ onSortChanged: De,
641
+ onGridReady: Ro,
637
642
  onRowDataUpdated: I,
638
643
  onRowSelected: eo,
639
644
  onFirstDataRendered: oo,
@@ -645,11 +650,11 @@ const gr = /* @__PURE__ */ xo({
645
650
  ), null, 16, ["animate-rows", "style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "no-rows-overlay-component-params", "loading", "dom-layout", "locale-text"]))
646
651
  ], 2),
647
652
  T("div", {
648
- class: v(r(d)("pagination-wrapper"))
653
+ class: R(r(c)("pagination-wrapper"))
649
654
  }, [
650
655
  e.pagination !== !1 ? (y(), $(r(No), j({
651
656
  key: 0,
652
- class: r(d)("pagination")
657
+ class: r(c)("pagination")
653
658
  }, r(te).pagination, { onChange: co }), null, 16, ["class"])) : fe("", !0)
654
659
  ], 2)
655
660
  ], 6)
@@ -364,7 +364,7 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
364
364
  * @param width
365
365
  * @returns
366
366
  */
367
- onColumnResized?: (key: string, width: number) => void;
367
+ onColumnResized?: (changes: AgGridColumnResizedOption[]) => void;
368
368
  /**
369
369
  * 是否允许行动画(默认为true)
370
370
  * @description 详见https://www.ag-grid.com/vue-data-grid/row-animation/
@@ -525,6 +525,10 @@ export type AgGridSlots<RecordType> = {
525
525
  column: Omit<AgColumn, keyof AgGridColumnType> & AgGridColumnType;
526
526
  }) => void;
527
527
  };
528
+ export type AgGridColumnResizedOption = {
529
+ key: string;
530
+ width: number;
531
+ };
528
532
  export interface AgGridPluginType {
529
533
  /**
530
534
  * AgGrid 初始化完成
@@ -553,9 +557,8 @@ export interface AgGridPluginType {
553
557
  searchParamsChange?: (params: Recordable) => void;
554
558
  /**
555
559
  * 列宽拖动变化后
556
- * @param key 列唯一标识
557
- * @param width 当前列宽
560
+ * @param changes 变更,可能是批量的
558
561
  * @returns
559
562
  */
560
- onColumnResized?: (key: string, width: number) => void;
563
+ onColumnResized?: (changes: AgGridColumnResizedOption[]) => void;
561
564
  }