@aplus-frontend/ui 6.39.2 → 6.40.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 (31) hide show
  1. package/es/src/ag-grid/index.vue.mjs +138 -134
  2. package/es/src/ag-grid/interface.d.ts +7 -0
  3. package/es/src/ap-action/interface.d.ts +5 -1
  4. package/es/src/ap-action/item/index.vue2.mjs +17 -16
  5. package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
  6. package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
  7. package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
  8. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  9. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  10. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
  11. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  12. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
  13. package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
  14. package/es/src/version.d.ts +1 -1
  15. package/es/src/version.mjs +1 -1
  16. package/lib/src/ag-grid/index.vue.js +1 -1
  17. package/lib/src/ag-grid/interface.d.ts +7 -0
  18. package/lib/src/ap-action/interface.d.ts +5 -1
  19. package/lib/src/ap-action/item/index.vue2.js +1 -1
  20. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  21. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  22. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
  23. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
  24. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  25. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  26. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  27. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  28. package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
  29. package/lib/src/version.d.ts +1 -1
  30. package/lib/src/version.js +1 -1
  31. package/package.json +1 -1
@@ -1,34 +1,34 @@
1
- import { defineComponent as so, useSlots as io, ref as D, toRef as N, unref as t, computed as n, nextTick as A, watch as M, createElementBlock as V, openBlock as b, normalizeStyle as W, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as O, mergeProps as G, createSlots as uo, withCtx as ne, Fragment as co, renderList as mo, createBlock as se, resolveDynamicComponent as po, renderSlot as ie, withDirectives as fo, vShow as go } from "vue";
2
- import { AgGridVue as wo } from "ag-grid-vue3";
3
- import { ModuleRegistry as So, AllCommunityModule as yo } from "ag-grid-community";
4
- import { mergeProps as ho } from "./utils.mjs";
5
- import { Spin as Co, Pagination as Ro } from "@aplus-frontend/antdv";
6
- import { isUndefined as B, isFunction as H } from "lodash-unified";
1
+ import { defineComponent as io, useSlots as uo, ref as N, toRef as T, unref as t, computed as n, nextTick as z, watch as M, createElementBlock as W, openBlock as b, normalizeStyle as O, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as G, mergeProps as H, createSlots as co, withCtx as ne, Fragment as mo, renderList as po, createBlock as se, resolveDynamicComponent as fo, renderSlot as ie, withDirectives as go, vShow as wo } from "vue";
2
+ import { AgGridVue as So } from "ag-grid-vue3";
3
+ import { ModuleRegistry as yo, AllCommunityModule as ho } from "ag-grid-community";
4
+ import { mergeProps as Co } from "./utils.mjs";
5
+ import { Spin as vo, Pagination as Ro } from "@aplus-frontend/antdv";
6
+ import { isUndefined as B, isFunction as D } from "lodash-unified";
7
7
  import "../config-provider/index.mjs";
8
- import { ApForm as vo } from "../ap-form/index.mjs";
9
- import { recursionApColumns as bo } from "../ap-table/utils.mjs";
10
- import { useTablePaging as Fo } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
- import Bo from "./hooks/use-row-selection.mjs";
12
- import { useProvideSorter as ko } from "./context.mjs";
13
- import { useProvideApTable as xo } from "../ap-table/context.mjs";
14
- import { DEFAULT_ROW_SELECTION_CONFIG as de, sizeReverseMap as Io, sizeMap as Do } from "../ap-grid/constants.mjs";
15
- import { useToken as No } from "@aplus-frontend/antdv/es/theme/internal";
16
- import { useTheme as To } from "./theme.mjs";
17
- import { useColumns as Eo } from "./hooks/use-columns.mjs";
18
- import { useColumnsDef as Ko } from "./hooks/use-columns-def.mjs";
19
- import { isDef as Po } from "../utils/index.mjs";
20
- import { getValidVNodeList as zo } from "../utils/slot.mjs";
21
- import { useSearchForm as Ao } from "./hooks/use-search-form.mjs";
8
+ import { ApForm as bo } from "../ap-form/index.mjs";
9
+ import { recursionApColumns as Fo } from "../ap-table/utils.mjs";
10
+ import { useTablePaging as Bo } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
+ import ko from "./hooks/use-row-selection.mjs";
12
+ import { useProvideSorter as xo } from "./context.mjs";
13
+ import { useProvideApTable as Io } from "../ap-table/context.mjs";
14
+ import { DEFAULT_ROW_SELECTION_CONFIG as ue, sizeReverseMap as No, sizeMap as To } from "../ap-grid/constants.mjs";
15
+ import { useToken as Do } from "@aplus-frontend/antdv/es/theme/internal";
16
+ import { useTheme as Eo } from "./theme.mjs";
17
+ import { useColumns as Ko } from "./hooks/use-columns.mjs";
18
+ import { useColumnsDef as Po } from "./hooks/use-columns-def.mjs";
19
+ import { isDef as Ao } from "../utils/index.mjs";
20
+ import { getValidVNodeList as Vo } from "../utils/slot.mjs";
21
+ import { useSearchForm as zo } from "./hooks/use-search-form.mjs";
22
22
  import "./components/empty/index.vue.mjs";
23
23
  import Mo from "./hooks/use-virtual-config.mjs";
24
- import { usePinnedRow as Vo } from "./hooks/use-pinned-row.mjs";
25
- import Wo from "./hooks/use-selection-col-def.mjs";
24
+ import { usePinnedRow as Wo } from "./hooks/use-pinned-row.mjs";
25
+ import Oo from "./hooks/use-selection-col-def.mjs";
26
26
  import "./components/row/index.vue.mjs";
27
- import { useNamespace as Oo } from "../config-provider/hooks/use-namespace.mjs";
28
- import { useGlobalConfig as Go } from "../config-provider/hooks/use-global-config.mjs";
29
- import Ho from "./components/row/index.vue2.mjs";
30
- import Lo from "./components/empty/index.vue2.mjs";
31
- const Ct = /* @__PURE__ */ so({
27
+ import { useNamespace as Go } from "../config-provider/hooks/use-namespace.mjs";
28
+ import { useGlobalConfig as Ho } from "../config-provider/hooks/use-global-config.mjs";
29
+ import Lo from "./components/row/index.vue2.mjs";
30
+ import Uo from "./components/empty/index.vue2.mjs";
31
+ const vt = /* @__PURE__ */ io({
32
32
  name: "AgGrid",
33
33
  __name: "index",
34
34
  props: {
@@ -102,14 +102,14 @@ const Ct = /* @__PURE__ */ so({
102
102
  onUpdate: {},
103
103
  customRow: {}
104
104
  },
105
- setup(ue, { expose: ce }) {
106
- So.registerModules([yo]);
107
- const o = ue, L = io(), { e: k, b: u, be: me } = Oo("ag-grid"), h = D(o.size), pe = To(h, N(o, "rowHeight")), fe = Mo(N(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Vo(
108
- N(o, "summary")
109
- ), we = Go("apGrid"), s = D(), [, Se] = No();
105
+ setup(de, { expose: ce }) {
106
+ yo.registerModules([ho]);
107
+ const o = de, L = uo(), { e: k, b: d, be: me } = Go("ag-grid"), h = N(o.size), pe = Eo(h, T(o, "rowHeight")), fe = Mo(T(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Wo(
108
+ T(o, "summary")
109
+ ), we = Ho("apGrid"), s = N(), [, Se] = Do();
110
110
  let C = !!o.dataSource;
111
- const j = Ao(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Eo(o), { defaultColDef: Ce, columnDefs: Re, gridWrapperRef: ve } = Ko($, o, ge), x = D({});
112
- ko({
111
+ const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge), x = N({});
112
+ xo({
113
113
  sorter: x,
114
114
  setSorter(e) {
115
115
  x.value = e;
@@ -129,14 +129,14 @@ const Ct = /* @__PURE__ */ so({
129
129
  }
130
130
  if (!a)
131
131
  return;
132
- const d = a.getColDef(), m = a.getSort(), p = he(d.colId);
132
+ const u = a.getColDef(), m = a.getSort(), p = he(u.colId);
133
133
  _(void 0, void 0, {
134
- column: d,
135
- field: p?.field ?? d.field ?? d.colId,
134
+ column: u,
135
+ field: p?.field ?? u.field ?? u.colId,
136
136
  order: m ? be[m] : null
137
137
  });
138
138
  }
139
- const Be = n(() => bo(t(g), (e) => {
139
+ const Be = n(() => Fo(t(g), (e) => {
140
140
  if (e.sorter === !0)
141
141
  return e.field ?? e.dataIndex ?? e.key;
142
142
  }).filter(Boolean)), ke = () => {
@@ -146,21 +146,21 @@ const Ct = /* @__PURE__ */ so({
146
146
  return;
147
147
  const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
148
148
  e.applyColumnState({ state: r });
149
- }, xe = n(() => Po(o.manual) ? o.manual : zo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
149
+ }, xe = n(() => Ao(o.manual) ? o.manual : Vo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
150
150
  formRef: w,
151
- submit: T,
152
- reset: E,
151
+ submit: E,
152
+ reset: K,
153
153
  data: S,
154
154
  tableProps: q,
155
155
  handleTableChangeOptional: _,
156
156
  submitWith: J,
157
157
  refresh: Q,
158
158
  getPaging: Ie,
159
- setPaging: De,
160
- setDataSource: Ne
161
- } = Fo({
159
+ setPaging: Ne,
160
+ setDataSource: Te
161
+ } = Bo({
162
162
  async request(e) {
163
- if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && z(), !B(o.dataSource)) {
163
+ if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && V(), !B(o.dataSource)) {
164
164
  const a = e.pageSize * (e.current - 1);
165
165
  return {
166
166
  data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
@@ -174,8 +174,8 @@ const Ct = /* @__PURE__ */ so({
174
174
  };
175
175
  },
176
176
  namespace: "ap-grid",
177
- filterFields: D([]),
178
- params: N(o, "params"),
177
+ filterFields: N([]),
178
+ params: T(o, "params"),
179
179
  defaultData: o.defaultData,
180
180
  manual: t(xe),
181
181
  formatParams: o.beforeSearchSubmit,
@@ -185,22 +185,22 @@ const Ct = /* @__PURE__ */ so({
185
185
  }), y = n(() => {
186
186
  const e = o.rowSelection || we.value?.rowSelection;
187
187
  if (e)
188
- return e === !0 ? de : {
189
- ...de,
188
+ return e === !0 ? ue : {
189
+ ...ue,
190
190
  ...e
191
191
  };
192
- }), Te = Wo(o, g), Ee = n(
192
+ }), De = Oo(o, g), Ee = n(
193
193
  () => B(o.dataSource) ? S.records : o.dataSource
194
194
  ), {
195
195
  select: Ke,
196
196
  unSelect: Pe,
197
- selectedRows: K,
198
- selectedRowKeys: ze,
199
- clearAll: Ae,
200
- selectMultiByKeys: Me,
201
- selectMulti: Ve,
197
+ selectedRows: P,
198
+ selectedRowKeys: Ae,
199
+ clearAll: Ve,
200
+ selectMultiByKeys: ze,
201
+ selectMulti: Me,
202
202
  unSelectMulti: We
203
- } = Bo({
203
+ } = ko({
204
204
  ...y.value,
205
205
  dataSource: Ee,
206
206
  rowKey: o.rowKey
@@ -218,25 +218,25 @@ const Ct = /* @__PURE__ */ so({
218
218
  hideDisabledCheckboxes: e.hideDisabled ?? !1
219
219
  };
220
220
  });
221
- function P(e) {
222
- return H(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
221
+ function A(e) {
222
+ return D(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
223
223
  }
224
224
  const I = ({
225
225
  api: e = s.value
226
226
  }) => {
227
227
  if (o.onUpdate?.(), !y.value)
228
228
  return;
229
- const r = K.value || [];
229
+ const r = P.value || [];
230
230
  C = !1;
231
231
  const a = [];
232
232
  e.forEachNode((i) => {
233
- const R = i.data, d = P(R), m = i.isSelected();
234
- r.find((p) => P(p) === d) ? !m && a.push(i) : m && i.setSelected(!1);
233
+ const v = i.data, u = A(v), m = i.isSelected();
234
+ r.find((p) => A(p) === u) ? !m && a.push(i) : m && i.setSelected(!1);
235
235
  }), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
236
236
  C = !0;
237
237
  }, 0);
238
238
  }, He = (e) => {
239
- C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), H(y.value?.tooltip) && e.api.refreshCells({
239
+ C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), D(y.value?.tooltip) && e.api.refreshCells({
240
240
  rowNodes: [e.node],
241
241
  // todo: 取消硬编码
242
242
  columns: ["ag-Grid-SelectionColumn"],
@@ -244,11 +244,11 @@ const Ct = /* @__PURE__ */ so({
244
244
  }));
245
245
  }, Le = () => {
246
246
  C = !0;
247
- }, z = () => {
248
- Ae(), s.value?.deselectAll();
247
+ }, V = () => {
248
+ Ve(), s.value?.deselectAll();
249
249
  };
250
250
  function Ue(e) {
251
- Me(e), A(() => {
251
+ ze(e), z(() => {
252
252
  I({});
253
253
  });
254
254
  }
@@ -256,19 +256,19 @@ const Ct = /* @__PURE__ */ so({
256
256
  const e = o.customRow;
257
257
  return e ? {
258
258
  isFullWidthRow: e.isCustomRow,
259
- fullWidthCellRenderer: Ho,
259
+ fullWidthCellRenderer: Lo,
260
260
  fullWidthCellRendererParams: {
261
261
  render: e.render
262
262
  }
263
263
  } : {};
264
264
  });
265
265
  function $e(e) {
266
- Ve(e), A(() => {
266
+ Me(e), z(() => {
267
267
  I({});
268
268
  });
269
269
  }
270
270
  function qe(e) {
271
- We(e), A(() => {
271
+ We(e), z(() => {
272
272
  I({});
273
273
  });
274
274
  }
@@ -295,38 +295,38 @@ const Ct = /* @__PURE__ */ so({
295
295
  const r = s.value;
296
296
  if (!r)
297
297
  return;
298
- const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), R = a.map((l) => {
298
+ const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), v = a.map((l) => {
299
299
  if (!ye.value.includes(l.colId))
300
300
  return l;
301
- const v = !i.includes(l.colId), re = {
301
+ const R = !i.includes(l.colId), re = {
302
302
  ...l,
303
- hide: v
303
+ hide: R
304
304
  }, ae = e.find(
305
- (no) => te(no.key) === l.colId
305
+ (so) => te(so.key) === l.colId
306
306
  );
307
307
  return ae && (re.pinned = ae.fixed || null), re;
308
- }), d = new Map(
309
- e.map((l, v) => [te(l.key), v])
310
- ), m = R.filter((l) => d.has(l.colId)).sort(
311
- (l, v) => d.get(l.colId) - d.get(v.colId)
308
+ }), u = new Map(
309
+ e.map((l, R) => [te(l.key), R])
310
+ ), m = v.filter((l) => u.has(l.colId)).sort(
311
+ (l, R) => u.get(l.colId) - u.get(R.colId)
312
312
  ), p = [];
313
313
  let c = 0;
314
- for (const l of R)
315
- d.has(l.colId) ? p.push(m[c++]) : p.push(l);
314
+ for (const l of v)
315
+ u.has(l.colId) ? p.push(m[c++]) : p.push(l);
316
316
  r.applyColumnState({
317
317
  state: p,
318
318
  applyOrder: !0
319
319
  });
320
320
  }
321
- xo({
321
+ Io({
322
322
  columns: n(() => g.value),
323
323
  columnsBackup: n(() => $.value),
324
- size: n(() => Do[h.value]),
324
+ size: n(() => To[h.value]),
325
325
  updateColumns(e) {
326
326
  g.value = e, o.onShownColumnsChange?.(e), _e(e);
327
327
  },
328
328
  updateSize(e) {
329
- h.value = Io[e];
329
+ h.value = No[e];
330
330
  },
331
331
  renderConfig: n(() => ({
332
332
  className: me("table-header", "title"),
@@ -335,9 +335,9 @@ const Ct = /* @__PURE__ */ so({
335
335
  dataSource: n(() => t(S).records),
336
336
  getSearchFormValues: X,
337
337
  setSearchFormValues: Y,
338
- submit: T,
338
+ submit: E,
339
339
  submitWith: J,
340
- reset: E,
340
+ reset: K,
341
341
  refresh: Q,
342
342
  getSearchFormSorterItems: Z,
343
343
  setSearchFormSorterItems: ee,
@@ -346,10 +346,10 @@ const Ct = /* @__PURE__ */ so({
346
346
  const Je = n(
347
347
  () => B(o.loading) ? S.loading : o.loading
348
348
  ), Qe = n(() => [
349
- u(),
350
- o.card ? null : u("wrapper"),
351
- u("adaptive"),
352
- u(`size-${h.value}`)
349
+ d(),
350
+ o.card ? null : d("wrapper"),
351
+ d("adaptive"),
352
+ d(`size-${h.value}`)
353
353
  ].filter(Boolean)), Xe = n(() => ({
354
354
  height: "100%",
355
355
  ...o.tableStyle || {}
@@ -358,29 +358,32 @@ const Ct = /* @__PURE__ */ so({
358
358
  };
359
359
  function Ze(e) {
360
360
  const r = e.data;
361
- return P(r);
361
+ return A(r);
362
362
  }
363
363
  function eo(e, r) {
364
- s.value?.ensureIndexVisible(e, r);
364
+ (D(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, r);
365
365
  }
366
- function oo(e) {
367
- o.onRowClicked?.(e.data, e.event);
366
+ function oo(e, r) {
367
+ s.value?.ensureColumnVisible(e, r);
368
368
  }
369
369
  function to(e) {
370
- o.onScrollEnd?.(e.direction);
370
+ o.onRowClicked?.(e.data, e.event);
371
371
  }
372
372
  function ro(e) {
373
- return s.value?.refreshCells(e);
373
+ o.onScrollEnd?.(e.direction);
374
374
  }
375
375
  function ao(e) {
376
+ return s.value?.refreshCells(e);
377
+ }
378
+ function lo(e) {
376
379
  return s.value?.redrawRows(e);
377
380
  }
378
- const lo = (e) => {
381
+ const no = (e) => {
379
382
  const r = [
380
383
  U.value.getRowClass?.(e)
381
384
  ];
382
385
  if (!e.node.rowPinned) {
383
- const a = H(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
386
+ const a = D(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
384
387
  r.push(a);
385
388
  }
386
389
  return r.flat().filter(Boolean);
@@ -388,7 +391,7 @@ const Ct = /* @__PURE__ */ so({
388
391
  return M(
389
392
  () => o.dataSource,
390
393
  (e) => {
391
- Ne(e);
394
+ Te(e);
392
395
  },
393
396
  { immediate: !0, deep: !0 }
394
397
  ), M(
@@ -402,49 +405,50 @@ const Ct = /* @__PURE__ */ so({
402
405
  o.onLoadingChange?.(e);
403
406
  }
404
407
  ), ce({
405
- submit: T,
406
- reset: E,
408
+ submit: E,
409
+ reset: K,
407
410
  refresh: Q,
408
411
  submitWith: J,
409
412
  setSearchFormValues: Y,
410
413
  getSearchFormValues: X,
411
414
  getShowColumns: () => t(g),
412
415
  rowSelection: {
413
- selectedRows: n(() => K.value),
416
+ selectedRows: n(() => P.value),
414
417
  setSelectedRowKeys: Ue,
415
418
  setSelectedRows: $e,
416
- clearAll: z,
419
+ clearAll: V,
417
420
  unSelectRows: qe
418
421
  },
419
422
  scrollToRow: eo,
423
+ scrollToColumn: oo,
420
424
  getDataSource: () => t(S.records),
421
425
  getPaging: Ie,
422
- setPaging: De,
426
+ setPaging: Ne,
423
427
  getSearchFormSorterItems: Z,
424
428
  setSearchFormSorterItems: ee,
425
429
  resetSearchFormSorterItems: oe,
426
- refreshCells: ro,
427
- redrawRows: ao,
430
+ refreshCells: ao,
431
+ redrawRows: lo,
428
432
  _internalGridApi: n(() => s.value)
429
- }), (e, r) => (b(), V("div", {
433
+ }), (e, r) => (b(), W("div", {
430
434
  class: f(Qe.value),
431
- style: W(e.wrapperStyle)
435
+ style: O(e.wrapperStyle)
432
436
  }, [
433
- t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), V("div", {
437
+ t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), W("div", {
434
438
  key: 0,
435
439
  class: f(e.card ? t(k)("search-wrapper") : null),
436
- style: W(e.searchFormWrapperStyle)
440
+ style: O(e.searchFormWrapperStyle)
437
441
  }, [
438
- O(t(vo).SearchForm, G(e.searchForm || {}, {
442
+ G(t(bo).SearchForm, H(e.searchForm || {}, {
439
443
  ref_key: "formRef",
440
444
  ref: w,
441
445
  "custom-reset": "",
442
446
  "submit-loading": t(q).loading,
443
- onSubmit: t(T),
444
- onReset: t(E)
445
- }), uo({
447
+ onSubmit: t(E),
448
+ onReset: t(K)
449
+ }), co({
446
450
  default: ne(() => [
447
- (b(!0), V(co, null, mo(t(j), (a) => (b(), se(po(a.renderNode), {
451
+ (b(!0), W(mo, null, po(t(j), (a) => (b(), se(fo(a.renderNode), {
448
452
  key: a.dataIndex
449
453
  }))), 128))
450
454
  ]),
@@ -461,34 +465,34 @@ const Ct = /* @__PURE__ */ so({
461
465
  ], 6)) : le("", !0),
462
466
  F("div", {
463
467
  class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
464
- style: W(e.tableWrapperStyle)
468
+ style: O(e.tableWrapperStyle)
465
469
  }, [
466
470
  F("div", {
467
- class: f(t(u)("header-wrapper"))
471
+ class: f(t(d)("header-wrapper"))
468
472
  }, [
469
473
  ie(e.$slots, "title", {
470
- selectedRows: t(K),
471
- selectedRowKeys: t(ze),
474
+ selectedRows: t(P),
475
+ selectedRowKeys: t(Ae),
472
476
  shownColumns: t(g),
473
- clearAll: z
477
+ clearAll: V
474
478
  })
475
479
  ], 2),
476
480
  F("div", {
477
481
  ref_key: "gridWrapperRef",
478
- ref: ve,
479
- class: f(t(u)("grid-wrapper"))
482
+ ref: Re,
483
+ class: f(t(d)("grid-wrapper"))
480
484
  }, [
481
- O(t(wo), G(
482
- t(ho)(t(fe), t(U), je.value),
485
+ G(t(So), H(
486
+ t(Co)(t(fe), t(U), je.value),
483
487
  {
484
- "get-row-class": lo,
488
+ "get-row-class": no,
485
489
  style: Xe.value,
486
490
  "row-data": t(S).records,
487
- "column-defs": t(Re),
491
+ "column-defs": t(ve),
488
492
  "default-col-def": t(Ce),
489
493
  "suppress-loading-overlay": "",
490
494
  "row-selection": Ge.value,
491
- "selection-column-def": t(Te),
495
+ "selection-column-def": t(De),
492
496
  "get-row-id": Ze,
493
497
  "get-row-height": o.getRowHeight,
494
498
  theme: t(pe),
@@ -496,7 +500,7 @@ const Ct = /* @__PURE__ */ so({
496
500
  "enable-browser-tooltips": e.browserTooltips,
497
501
  "tooltip-interaction": "",
498
502
  "row-class-rules": e.rowClassRules,
499
- "no-rows-overlay-component": Lo,
503
+ "no-rows-overlay-component": Uo,
500
504
  "suppress-cell-focus": "",
501
505
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
502
506
  onSortChanged: Fe,
@@ -504,24 +508,24 @@ const Ct = /* @__PURE__ */ so({
504
508
  onRowDataUpdated: I,
505
509
  onRowSelected: He,
506
510
  onFirstDataRendered: Le,
507
- onRowClicked: oo,
508
- onBodyScrollEnd: to
511
+ onRowClicked: to,
512
+ onBodyScrollEnd: ro
509
513
  }
510
514
  ), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
511
- fo(F("div", {
515
+ go(F("div", {
512
516
  class: f(t(k)("table-loading-wrapper"))
513
517
  }, [
514
- O(t(Co), { delay: 300 })
518
+ G(t(vo), { delay: 300 })
515
519
  ], 2), [
516
- [go, Je.value]
520
+ [wo, Je.value]
517
521
  ])
518
522
  ], 2),
519
523
  F("div", {
520
- class: f(t(u)("pagination-wrapper"))
524
+ class: f(t(d)("pagination-wrapper"))
521
525
  }, [
522
- e.pagination !== !1 ? (b(), se(t(Ro), G({
526
+ e.pagination !== !1 ? (b(), se(t(Ro), H({
523
527
  key: 0,
524
- class: t(u)("pagination")
528
+ class: t(d)("pagination")
525
529
  }, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
526
530
  ], 2)
527
531
  ], 6)
@@ -529,5 +533,5 @@ const Ct = /* @__PURE__ */ so({
529
533
  }
530
534
  });
531
535
  export {
532
- Ct as default
536
+ vt as default
533
537
  };
@@ -393,6 +393,13 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
393
393
  * @returns
394
394
  */
395
395
  scrollToRow: (index: number, position?: 'top' | 'bottom' | 'middle' | null) => void;
396
+ /**
397
+ * 滚动到某一列
398
+ * @param key 列的唯一标识
399
+ * @param position
400
+ * @returns
401
+ */
402
+ scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
396
403
  /**
397
404
  * 获取当前表格数据
398
405
  * @returns
@@ -1,4 +1,4 @@
1
- import { DropdownProps, ModalFuncProps, PopconfirmProps } from '@aplus-frontend/antdv';
1
+ import { DropdownProps, ModalFuncProps, PopconfirmProps, TooltipProps } from '@aplus-frontend/antdv';
2
2
  import { VNode } from 'vue';
3
3
  export type ActionColor = 'primary' | 'success' | 'error' | 'warn';
4
4
  export type ApActionItemProps = {
@@ -43,6 +43,10 @@ export type ApActionItemProps = {
43
43
  * 是否优先显示图标
44
44
  */
45
45
  iconFirst?: boolean;
46
+ /**
47
+ * 优先显示图标时,对弹出的tooltip进行设置
48
+ */
49
+ tooltip?: Partial<Omit<TooltipProps, 'title'>>;
46
50
  };
47
51
  export type MixedActionTypes = ApActionItemProps | ApActionItemModalProps | ApActionItemPopconfirmProps;
48
52
  export type GroupActionTypes = MixedActionTypes | ApActionItemDropdownProps;
@@ -1,9 +1,9 @@
1
- import { defineComponent as C, useSlots as B, createPropsRestProxy as h, ref as A, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as F, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as g, isVNode as S, toDisplayString as V } from "vue";
1
+ import { defineComponent as B, useSlots as h, createPropsRestProxy as A, ref as F, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as g, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as k, isVNode as S, toDisplayString as V } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
3
  import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
4
  import { Tooltip as w } from "@aplus-frontend/antdv";
5
- import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
6
- const D = { key: 1 }, q = /* @__PURE__ */ C({
5
+ import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const I = { key: 1 }, q = /* @__PURE__ */ B({
7
7
  name: "ApActionItem",
8
8
  __name: "index",
9
9
  props: {
@@ -15,27 +15,28 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
15
15
  onClick: { type: Function },
16
16
  loading: { type: Boolean, default: !1 },
17
17
  icon: {},
18
- iconFirst: { type: Boolean, default: !1 }
18
+ iconFirst: { type: Boolean, default: !1 },
19
+ tooltip: { default: () => ({}) }
19
20
  },
20
21
  setup(o) {
21
- const s = B(), r = h(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: l, e: v } = x("action-item"), c = A(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
22
+ const s = h(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon", "tooltip"]), { b: v, m: l, e: b } = D("action-item"), c = F(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
22
23
  function p(e) {
23
24
  n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
24
25
  }
25
- const i = u(() => o.loading || n(c)), b = u(() => [
26
- k(),
26
+ const i = u(() => o.loading || n(c)), C = u(() => [
27
+ v(),
27
28
  l(o.color),
28
29
  d.value ? l("icon-first") : null,
29
30
  o.disabled ? l("disabled") : null,
30
31
  i.value ? l("loading") : null
31
32
  ].filter(Boolean));
32
- return (e, I) => y(e.$slots, "trigger", {
33
+ return (e, T) => y(e.$slots, "trigger", {
33
34
  loading: i.value,
34
35
  disabled: e.disabled,
35
36
  onClick: p
36
37
  }, () => [
37
- e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
38
- class: b.value,
38
+ e.visible ? (t(), f("span", g({ key: 0 }, e.$attrs, {
39
+ class: C.value,
39
40
  onClick: p
40
41
  }), [
41
42
  i.value ? (t(), m(n($), {
@@ -46,19 +47,19 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
46
47
  })) : a("", !0),
47
48
  e.icon || s.icon ? (t(), f("span", {
48
49
  key: 1,
49
- class: N(n(v)("icon-wrapper"))
50
+ class: N(n(b)("icon-wrapper"))
50
51
  }, [
51
- L(n(w), {
52
+ L(n(w), g({
52
53
  title: d.value ? e.text : null
53
- }, {
54
+ }, e.tooltip), {
54
55
  default: P(() => [
55
- (t(), m(g(e.icon || s.icon)))
56
+ (t(), m(k(e.icon || s.icon)))
56
57
  ]),
57
58
  _: 1
58
- }, 8, ["title"])
59
+ }, 16, ["title"])
59
60
  ], 2)) : a("", !0),
60
61
  d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
61
- S(e.text) ? (t(), m(g(e.text), { key: 0 })) : (t(), f("span", D, V(e.text || ""), 1))
62
+ S(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", I, V(e.text || ""), 1))
62
63
  ])
63
64
  ], 16)) : a("", !0)
64
65
  ]);
@@ -25,7 +25,8 @@ const T = /* @__PURE__ */ _({
25
25
  onClick: {},
26
26
  loading: { type: Boolean, default: !1 },
27
27
  icon: {},
28
- iconFirst: { type: Boolean }
28
+ iconFirst: { type: Boolean },
29
+ tooltip: {}
29
30
  },
30
31
  setup(d) {
31
32
  const f = d, i = v(!1), { e: p } = E("action-item-dropdown"), g = k(() => f.actions.filter((e) => e.visible || V(e.visible)).map((e) => ({