@aplus-frontend/ui 6.26.5 → 6.28.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 (60) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  2. package/es/src/ag-grid/hooks/use-columns-def.mjs +29 -29
  3. package/es/src/ag-grid/hooks/use-columns.d.ts +3 -2
  4. package/es/src/ag-grid/hooks/use-columns.mjs +16 -12
  5. package/es/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  6. package/es/src/ag-grid/hooks/use-pinned-row.mjs +32 -0
  7. package/es/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
  8. package/es/src/ag-grid/hooks/use-selection-col-def.mjs +34 -0
  9. package/es/src/ag-grid/index.vue.mjs +240 -227
  10. package/es/src/ag-grid/interface.d.ts +10 -7
  11. package/es/src/ag-grid/theme.mjs +6 -5
  12. package/es/src/ap-form/ap-form.vue.d.ts +2 -8
  13. package/es/src/ap-form/ap-form.vue2.mjs +3 -3
  14. package/es/src/ap-form/hooks/use-watch.mjs +25 -28
  15. package/es/src/ap-form/interface.d.ts +1 -1
  16. package/es/src/ap-grid/interface.d.ts +1 -1
  17. package/es/src/ap-modal/utils/createModal.mjs +14 -14
  18. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  19. package/es/src/ap-upload/apUpload.vue.mjs +38 -34
  20. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
  21. package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
  22. package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
  23. package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
  24. package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  25. package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
  26. package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
  27. package/es/src/version.d.ts +1 -1
  28. package/es/src/version.mjs +1 -1
  29. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  30. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  31. package/lib/src/ag-grid/hooks/use-columns.d.ts +3 -2
  32. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  33. package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  34. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
  35. package/lib/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
  36. package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -0
  37. package/lib/src/ag-grid/index.vue.js +1 -1
  38. package/lib/src/ag-grid/interface.d.ts +10 -7
  39. package/lib/src/ag-grid/theme.js +1 -1
  40. package/lib/src/ap-form/ap-form.vue.d.ts +2 -8
  41. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  42. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  43. package/lib/src/ap-form/interface.d.ts +1 -1
  44. package/lib/src/ap-grid/interface.d.ts +1 -1
  45. package/lib/src/ap-modal/utils/createModal.js +1 -1
  46. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  47. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  48. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  49. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  50. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  51. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  52. package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  53. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  54. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  55. package/lib/src/version.d.ts +1 -1
  56. package/lib/src/version.js +1 -1
  57. package/package.json +1 -1
  58. package/theme/ap-value-select-card/index.css +3 -4
  59. package/theme/ap-value-select-card/index.less +3 -4
  60. package/theme/index.css +3 -4
@@ -1,28 +1,30 @@
1
- import { defineComponent as Ae, useSlots as Ie, ref as b, toRef as D, unref as t, computed as n, nextTick as Pe, watch as z, createElementBlock as K, openBlock as w, normalizeStyle as E, normalizeClass as i, createCommentVNode as Q, createElementVNode as g, createVNode as V, mergeProps as N, createSlots as Me, withCtx as X, Fragment as Oe, renderList as We, createBlock as Y, resolveDynamicComponent as je, renderSlot as Z, createTextVNode as Le, toDisplayString as Ue, withDirectives as Ge, vShow as He } from "vue";
2
- import { AgGridVue as $e } from "ag-grid-vue3";
3
- import { ModuleRegistry as qe, AllCommunityModule as Je } from "ag-grid-community";
4
- import { Spin as Qe, Pagination as Xe } from "@aplus-frontend/antdv";
5
- import { isUndefined as y, isFunction as Ye } from "lodash-unified";
1
+ import { defineComponent as We, useSlots as je, ref as b, toRef as B, unref as t, computed as l, nextTick as Le, watch as P, createElementBlock as z, openBlock as h, normalizeStyle as E, normalizeClass as u, createCommentVNode as Q, createElementVNode as v, createVNode as I, mergeProps as V, createSlots as Ge, withCtx as X, Fragment as He, renderList as Ue, createBlock as Y, resolveDynamicComponent as $e, renderSlot as Z, withDirectives as qe, vShow as Je } from "vue";
2
+ import { AgGridVue as Qe } from "ag-grid-vue3";
3
+ import { ModuleRegistry as Xe, AllCommunityModule as Ye } from "ag-grid-community";
4
+ import { Spin as Ze, Pagination as _e } from "@aplus-frontend/antdv";
5
+ import { isUndefined as C, isFunction as eo } from "lodash-unified";
6
6
  import "../config-provider/index.mjs";
7
- import { ApForm as Ze } from "../ap-form/index.mjs";
8
- import { recursionApColumns as _e } from "../ap-table/utils.mjs";
9
- import { useTablePaging as eo } from "../ap-table/hooks/use-table-paging-ng.mjs";
10
- import oo from "./hooks/use-row-selection.mjs";
11
- import { useProvideSorter as to } from "./context.mjs";
12
- import { useProvideApTable as ro } from "../ap-table/context.mjs";
13
- import { sizeReverseMap as ao, sizeMap as no } from "../ap-grid/constants.mjs";
14
- import { useToken as lo } from "@aplus-frontend/antdv/es/theme/internal";
15
- import { useTheme as so } from "./theme.mjs";
16
- import { useColumns as io } from "./hooks/use-columns.mjs";
17
- import { useColumnsDef as co } from "./hooks/use-columns-def.mjs";
18
- import { isDef as uo } from "../utils/index.mjs";
19
- import { getValidVNodeList as mo } from "../utils/slot.mjs";
20
- import { useSearchForm as po } from "./hooks/use-search-form.mjs";
7
+ import { ApForm as oo } from "../ap-form/index.mjs";
8
+ import { recursionApColumns as to } from "../ap-table/utils.mjs";
9
+ import { useTablePaging as ro } from "../ap-table/hooks/use-table-paging-ng.mjs";
10
+ import ao from "./hooks/use-row-selection.mjs";
11
+ import { useProvideSorter as no } from "./context.mjs";
12
+ import { useProvideApTable as lo } from "../ap-table/context.mjs";
13
+ import { sizeReverseMap as so, sizeMap as io } from "../ap-grid/constants.mjs";
14
+ import { useToken as co } from "@aplus-frontend/antdv/es/theme/internal";
15
+ import { useTheme as uo } from "./theme.mjs";
16
+ import { useColumns as mo } from "./hooks/use-columns.mjs";
17
+ import { useColumnsDef as po } from "./hooks/use-columns-def.mjs";
18
+ import { isDef as fo } from "../utils/index.mjs";
19
+ import { getValidVNodeList as So } from "../utils/slot.mjs";
20
+ import { useSearchForm as go } from "./hooks/use-search-form.mjs";
21
21
  import "./components/empty/index.vue.mjs";
22
- import fo from "./hooks/use-virtual-config.mjs";
23
- import { useNamespace as So } from "../config-provider/hooks/use-namespace.mjs";
24
- import wo from "./components/empty/index.vue2.mjs";
25
- const jo = /* @__PURE__ */ Ae({
22
+ import wo from "./hooks/use-virtual-config.mjs";
23
+ import { usePinnedRow as yo } from "./hooks/use-pinned-row.mjs";
24
+ import ho from "./hooks/use-selection-col-def.mjs";
25
+ import { useNamespace as vo } from "../config-provider/hooks/use-namespace.mjs";
26
+ import Co from "./components/empty/index.vue2.mjs";
27
+ const Jo = /* @__PURE__ */ We({
26
28
  name: "AgGrid",
27
29
  __name: "index",
28
30
  props: {
@@ -92,58 +94,65 @@ const jo = /* @__PURE__ */ Ae({
92
94
  onScrollEnd: {}
93
95
  },
94
96
  setup(_, { expose: ee }) {
95
- qe.registerModules([Je]);
96
- const o = _, A = Ie(), { e: h, b: l, be: oe } = So("ag-grid"), f = b(o.size), te = so(f, D(o, "rowHeight")), I = fo(D(o, "virtual")), d = b(), [, re] = lo();
97
- let c = !!o.dataSource;
98
- const P = po(o), { shownColumns: s, shownColumnsBackup: ae } = io(o), { defaultColDef: ne, columnDefs: le } = co(
99
- s,
100
- o
101
- ), R = b({});
102
- to({
103
- sorter: R,
97
+ Xe.registerModules([Ye]);
98
+ const o = _, A = je();
99
+ function oe(...e) {
100
+ return e.reduce((r, a) => ({ ...r, ...a }), {});
101
+ }
102
+ const { e: R, b: i, be: te } = vo("ag-grid"), y = b(o.size), re = uo(y, B(o, "rowHeight")), ae = wo(B(o, "virtual")), { rowPinnedGridConfig: ne, getRowPinnedCellClass: le } = yo(
103
+ B(o, "summary")
104
+ ), d = b(), [, se] = co();
105
+ let m = !!o.dataSource;
106
+ const N = go(o), { shownColumns: p, columns: M, columnKeys: ie } = mo(o), { defaultColDef: de, columnDefs: ce } = po(
107
+ M,
108
+ o,
109
+ le
110
+ ), F = b({});
111
+ no({
112
+ sorter: F,
104
113
  setSorter(e) {
105
- R.value = e;
114
+ F.value = e;
106
115
  }
107
116
  });
108
- const se = {
117
+ const ue = {
109
118
  asc: "ascend",
110
119
  desc: "descend"
111
120
  };
112
- function ie() {
113
- const e = d.value.getColumns()?.filter((p) => p.getSort() !== void 0), r = t(R) || {};
121
+ function me() {
122
+ const e = d.value.getColumns()?.filter((s) => s.getSort() !== void 0), r = t(F) || {};
114
123
  let a = e?.[0];
115
- const S = Object.keys(r);
116
- if (S.length && S.every((p) => r[p] === null)) {
117
- const p = Object.keys(r)[0];
118
- p && (a = d.value?.getColumn(p));
124
+ const c = Object.keys(r);
125
+ if (c.length && c.every((s) => r[s] === null)) {
126
+ const s = Object.keys(r)[0];
127
+ s && (a = d.value?.getColumn(s));
119
128
  }
120
129
  if (!a)
121
130
  return;
122
- const v = a.getColDef(), C = a.getSort();
123
- O(void 0, void 0, {
124
- column: v,
125
- field: v.field,
126
- order: C ? se[C] : null
131
+ const w = a.getColDef(), n = a.getSort();
132
+ W(void 0, void 0, {
133
+ column: w,
134
+ field: w.field,
135
+ order: n ? ue[n] : null
127
136
  });
128
137
  }
129
- const de = n(() => _e(t(s), (e) => {
138
+ const pe = l(() => to(t(p), (e) => {
130
139
  if (e.sorter === !0)
131
140
  return e.key || e.dataIndex;
132
- }).filter(Boolean)), ce = n(() => uo(o.manual) ? o.manual : mo(A.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
133
- formRef: u,
134
- submit: B,
135
- reset: F,
136
- data: m,
137
- tableProps: M,
138
- handleTableChangeOptional: O,
139
- submitWith: W,
140
- refresh: j,
141
- getPaging: ue,
142
- setPaging: me,
143
- setDataSource: pe
144
- } = eo({
141
+ }).filter(Boolean)), fe = l(() => fo(o.manual) ? o.manual : So(A.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
142
+ formRef: f,
143
+ submit: k,
144
+ reset: x,
145
+ data: S,
146
+ tableProps: O,
147
+ handleTableChangeOptional: W,
148
+ submitWith: j,
149
+ refresh: L,
150
+ getPaging: Se,
151
+ setPaging: ge,
152
+ setDataSource: we
153
+ } = ro({
145
154
  async request(e) {
146
- if (c = !1, !Se.value && y(o.dataSource) && T(), !y(o.dataSource)) {
155
+ if (m = !1, !ve.value && C(o.dataSource) && K(), !C(o.dataSource)) {
147
156
  const a = e.pageSize * (e.current - 1);
148
157
  return {
149
158
  data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
@@ -158,210 +167,217 @@ const jo = /* @__PURE__ */ Ae({
158
167
  },
159
168
  namespace: "ap-grid",
160
169
  filterFields: b([]),
161
- params: D(o, "params"),
170
+ params: B(o, "params"),
162
171
  defaultData: o.defaultData,
163
- manual: t(ce),
172
+ manual: t(fe),
164
173
  formatParams: o.beforeSearchSubmit,
165
174
  pagination: o.pagination,
166
- sortFields: de
167
- }), fe = n(
168
- () => y(o.dataSource) ? m.records : o.dataSource
169
- ), Se = n(() => {
175
+ sortFields: pe
176
+ }), ye = ho(o, p), he = l(
177
+ () => C(o.dataSource) ? S.records : o.dataSource
178
+ ), ve = l(() => {
170
179
  const e = o.rowSelection === !0 ? {} : o.rowSelection;
171
180
  return e ? e.preserveSelectedRowKeys !== !1 : !1;
172
181
  }), {
173
- select: we,
174
- unSelect: ge,
175
- selectedRows: x,
176
- selectedRowKeys: ye,
177
- clearAll: he,
178
- selectMultiByKeys: ve
179
- } = oo({
182
+ select: Ce,
183
+ unSelect: Re,
184
+ selectedRows: T,
185
+ selectedRowKeys: be,
186
+ clearAll: Be,
187
+ selectMultiByKeys: Fe
188
+ } = ao({
180
189
  ...o.rowSelection === !0 ? {} : o.rowSelection,
181
- dataSource: fe,
190
+ dataSource: he,
182
191
  rowKey: o.rowKey
183
- }), Ce = {
192
+ }), ke = {
184
193
  checkbox: "multiRow",
185
194
  radio: "singleRow"
186
- }, be = n(() => {
195
+ }, xe = l(() => {
187
196
  if (!o.rowSelection)
188
197
  return;
189
198
  const { type: e = "checkbox", disabled: r } = o.rowSelection === !0 ? {} : o.rowSelection;
190
199
  return {
191
- mode: Ce[e],
200
+ mode: ke[e],
192
201
  isRowSelectable: (a) => r ? !r(a.data) : !0
193
202
  };
194
- }), Re = n(() => {
195
- if (!o.rowSelection)
196
- return;
197
- const e = o.rowSelection === !0 ? {} : o.rowSelection;
198
- let r = e.fixed;
199
- return r === void 0 && (r = s.value.some(
200
- (a) => a.fixed === "left" || a.fixed === !0
201
- ) ? "left" : void 0), {
202
- sortable: !1,
203
- resizable: !1,
204
- width: e.columnWidth || 60,
205
- pinned: r
206
- };
207
203
  });
208
- function k(e) {
209
- return Ye(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
204
+ function D(e) {
205
+ return eo(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
210
206
  }
211
- const L = ({
207
+ const G = ({
212
208
  api: e = d.value
213
209
  }) => {
214
210
  if (!o.rowSelection)
215
211
  return;
216
- const r = x.value;
212
+ const r = T.value;
217
213
  if (!r.length) {
218
214
  setTimeout(() => {
219
- c = !0;
215
+ m = !0;
220
216
  }, 0);
221
217
  return;
222
218
  }
223
- c = !1;
219
+ m = !1;
224
220
  const a = [];
225
- e.forEachNode((S) => {
226
- const J = S.data, v = k(J);
227
- r.find((C) => k(C) === v) && a.push(S);
221
+ e.forEachNode((c) => {
222
+ const g = c.data, w = D(g);
223
+ r.find((n) => D(n) === w) && a.push(c);
228
224
  }), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
229
- c = !0;
225
+ m = !0;
230
226
  }, 0);
231
- }, Be = (e) => {
232
- c && (e.node.isSelected() ? we(e.data) : ge(e.data));
233
- }, Fe = () => {
234
- c = !0;
235
- }, T = () => {
236
- he(), d.value?.deselectAll();
227
+ }, Te = (e) => {
228
+ m && (e.node.isSelected() ? Ce(e.data) : Re(e.data));
229
+ }, De = () => {
230
+ m = !0;
231
+ }, K = () => {
232
+ Be(), d.value?.deselectAll();
237
233
  };
238
- function xe(e) {
239
- ve(e), Pe(() => {
240
- L({});
234
+ function Ke(e) {
235
+ Fe(e), Le(() => {
236
+ G({});
241
237
  });
242
238
  }
243
- function U(e = !1) {
239
+ function H(e = !1) {
244
240
  const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
245
- return u.value?.apForm?.[r]?.(!0);
241
+ return f.value?.apForm?.[r]?.(!0);
246
242
  }
247
- function G(e) {
248
- u.value?.apForm?.setFieldsValue?.(e);
243
+ function U(e) {
244
+ f.value?.apForm?.setFieldsValue?.(e);
249
245
  }
250
- function H() {
251
- return u.value?.getSorterItems() || [];
246
+ function $() {
247
+ return f.value?.getSorterItems() || [];
252
248
  }
253
- function $(e) {
254
- u.value?.setSorterItems(e);
249
+ function q(e) {
250
+ f.value?.setSorterItems(e);
255
251
  }
256
- function q() {
257
- u.value?.resetSorterItems();
252
+ function J() {
253
+ f.value?.resetSorterItems();
258
254
  }
259
- ro({
260
- columns: n(() => s.value),
261
- columnsBackup: n(() => ae.value),
262
- size: n(() => no[f.value]),
255
+ function Pe(e) {
256
+ const r = d.value;
257
+ if (!r)
258
+ return;
259
+ const a = r.getColumnState() || [], c = e.map((n) => n.key ? String(n.key) : n.key).filter(Boolean);
260
+ let g = !1;
261
+ const w = a.map((n) => {
262
+ if (!ie.value.includes(n.colId))
263
+ return n;
264
+ const s = !c.includes(n.colId);
265
+ return !g && s !== n.hide && (g = !0), {
266
+ ...n,
267
+ hide: s
268
+ };
269
+ });
270
+ g && r.applyColumnState({
271
+ state: w,
272
+ applyOrder: !0
273
+ });
274
+ }
275
+ lo({
276
+ columns: l(() => p.value),
277
+ columnsBackup: l(() => M.value),
278
+ size: l(() => io[y.value]),
263
279
  updateColumns(e) {
264
- s.value = e, o.onShownColumnsChange?.(e);
280
+ p.value = e, o.onShownColumnsChange?.(e), Pe(e);
265
281
  },
266
282
  updateSize(e) {
267
- f.value = ao[e];
283
+ y.value = so[e];
268
284
  },
269
- renderConfig: n(() => ({
270
- className: oe("table-header", "title"),
271
- color: re.value.colorTextTertiary
285
+ renderConfig: l(() => ({
286
+ className: te("table-header", "title"),
287
+ color: se.value.colorTextTertiary
272
288
  })),
273
- dataSource: n(() => t(m).records),
274
- getSearchFormValues: U,
275
- setSearchFormValues: G,
276
- submit: B,
277
- submitWith: W,
278
- reset: F,
279
- refresh: j,
280
- getSearchFormSorterItems: H,
281
- setSearchFormSorterItems: $,
282
- resetSearchFormSorterItems: q
289
+ dataSource: l(() => t(S).records),
290
+ getSearchFormValues: H,
291
+ setSearchFormValues: U,
292
+ submit: k,
293
+ submitWith: j,
294
+ reset: x,
295
+ refresh: L,
296
+ getSearchFormSorterItems: $,
297
+ setSearchFormSorterItems: q,
298
+ resetSearchFormSorterItems: J
283
299
  });
284
- const ke = n(
285
- () => y(o.loading) ? m.loading : o.loading
286
- ), Te = n(() => [
287
- l(),
288
- o.card ? null : l("wrapper"),
289
- l("adaptive"),
290
- l(`size-${f.value}`)
291
- ].filter(Boolean)), De = n(() => ({
300
+ const ze = l(
301
+ () => C(o.loading) ? S.loading : o.loading
302
+ ), Ee = l(() => [
303
+ i(),
304
+ o.card ? null : i("wrapper"),
305
+ i("adaptive"),
306
+ i(`size-${y.value}`)
307
+ ].filter(Boolean)), Ie = l(() => ({
292
308
  height: "100%",
293
309
  ...o.tableStyle || {}
294
- })), ze = (e, r) => {
295
- O({ current: e, pageSize: r });
310
+ })), Ve = (e, r) => {
311
+ W({ current: e, pageSize: r });
296
312
  };
297
- function Ke(e) {
313
+ function Ae(e) {
298
314
  const r = e.data;
299
- return k(r);
315
+ return D(r);
300
316
  }
301
- function Ee(e, r) {
317
+ function Ne(e, r) {
302
318
  d.value?.ensureIndexVisible(e, r);
303
319
  }
304
- function Ve(e) {
320
+ function Me(e) {
305
321
  o.onRowClicked?.(e.data);
306
322
  }
307
- function Ne(e) {
323
+ function Oe(e) {
308
324
  o.onScrollEnd?.(e.direction);
309
325
  }
310
- return z(
326
+ return P(
311
327
  () => o.dataSource,
312
328
  (e) => {
313
- pe(e);
329
+ we(e);
314
330
  },
315
331
  { immediate: !0, deep: !0 }
316
- ), z(
332
+ ), P(
317
333
  () => o.size,
318
334
  (e) => {
319
- f.value = e;
335
+ y.value = e;
320
336
  }
321
- ), z(
322
- () => t(m).loading,
337
+ ), P(
338
+ () => t(S).loading,
323
339
  (e) => {
324
340
  o.onLoadingChange?.(e);
325
341
  }
326
342
  ), ee({
327
- submit: B,
328
- reset: F,
329
- refresh: j,
330
- submitWith: W,
331
- setSearchFormValues: G,
332
- getSearchFormValues: U,
333
- getShowColumns: () => t(s),
343
+ submit: k,
344
+ reset: x,
345
+ refresh: L,
346
+ submitWith: j,
347
+ setSearchFormValues: U,
348
+ getSearchFormValues: H,
349
+ getShowColumns: () => t(p),
334
350
  rowSelection: {
335
- selectedRows: n(() => x.value),
336
- setSelectedRowKeys: xe,
337
- clearAll: T
351
+ selectedRows: l(() => T.value),
352
+ setSelectedRowKeys: Ke,
353
+ clearAll: K
338
354
  },
339
- scrollToRow: Ee,
340
- getDataSource: () => t(m.records),
341
- getPaging: ue,
342
- setPaging: me,
343
- getSearchFormSorterItems: H,
344
- setSearchFormSorterItems: $,
345
- resetSearchFormSorterItems: q
346
- }), (e, r) => (w(), K("div", {
347
- class: i(Te.value),
355
+ scrollToRow: Ne,
356
+ getDataSource: () => t(S.records),
357
+ getPaging: Se,
358
+ setPaging: ge,
359
+ getSearchFormSorterItems: $,
360
+ setSearchFormSorterItems: q,
361
+ resetSearchFormSorterItems: J
362
+ }), (e, r) => (h(), z("div", {
363
+ class: u(Ee.value),
348
364
  style: E(e.wrapperStyle)
349
365
  }, [
350
- t(y)(e.dataSource) && e.searchForm !== !1 && t(P).length > 0 ? (w(), K("div", {
366
+ t(C)(e.dataSource) && e.searchForm !== !1 && t(N).length > 0 ? (h(), z("div", {
351
367
  key: 0,
352
- class: i(e.card ? t(h)("search-wrapper") : null),
368
+ class: u(e.card ? t(R)("search-wrapper") : null),
353
369
  style: E(e.searchFormWrapperStyle)
354
370
  }, [
355
- V(t(Ze).SearchForm, N(e.searchForm || {}, {
371
+ I(t(oo).SearchForm, V(e.searchForm || {}, {
356
372
  ref_key: "formRef",
357
- ref: u,
373
+ ref: f,
358
374
  "custom-reset": "",
359
- "submit-loading": t(M).loading,
360
- onSubmit: t(B),
361
- onReset: t(F)
362
- }), Me({
375
+ "submit-loading": t(O).loading,
376
+ onSubmit: t(k),
377
+ onReset: t(x)
378
+ }), Ge({
363
379
  default: X(() => [
364
- (w(!0), K(Oe, null, We(t(P), (a) => (w(), Y(je(a.renderNode), {
380
+ (h(!0), z(He, null, Ue(t(N), (a) => (h(), Y($e(a.renderNode), {
365
381
  key: a.dataIndex
366
382
  }))), 128))
367
383
  ]),
@@ -376,68 +392,65 @@ const jo = /* @__PURE__ */ Ae({
376
392
  } : void 0
377
393
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
378
394
  ], 6)) : Q("", !0),
379
- g("div", {
380
- class: i([t(h)("table-wrapper"), e.card ? t(h)("table-wrapper-card") : null]),
395
+ v("div", {
396
+ class: u([t(R)("table-wrapper"), e.card ? t(R)("table-wrapper-card") : null]),
381
397
  style: E(e.tableWrapperStyle)
382
398
  }, [
383
- g("div", {
384
- class: i(t(l)("header-wrapper"))
399
+ v("div", {
400
+ class: u(t(i)("header-wrapper"))
385
401
  }, [
386
402
  Z(e.$slots, "title", {
387
- selectedRows: t(x),
388
- selectedRowKeys: t(ye),
389
- shownColumns: t(s),
390
- clearAll: T
403
+ selectedRows: t(T),
404
+ selectedRowKeys: t(be),
405
+ shownColumns: t(p),
406
+ clearAll: K
391
407
  })
392
408
  ], 2),
393
- Le(" " + Ue(console.log(t(I))) + " ", 1),
394
- g("div", {
395
- class: i(t(l)("grid-wrapper"))
409
+ v("div", {
410
+ class: u(t(i)("grid-wrapper"))
396
411
  }, [
397
- V(t($e), N(t(I), {
398
- style: De.value,
399
- "row-data": t(m).records,
400
- "column-defs": t(le),
401
- "default-col-def": t(ne),
412
+ I(t(Qe), V(oe(t(ae), t(ne)), {
413
+ style: Ie.value,
414
+ "row-data": t(S).records,
415
+ "column-defs": t(ce),
416
+ "default-col-def": t(de),
402
417
  "suppress-loading-overlay": "",
403
- "row-selection": be.value,
404
- "selection-column-def": Re.value,
405
- "get-row-id": Ke,
406
- "pinned-top-row-data": e.summary?.top,
407
- "pinned-bottom-row-data": e.summary?.bottom,
408
- theme: t(te),
418
+ "row-selection": xe.value,
419
+ "selection-column-def": t(ye),
420
+ "get-row-id": Ae,
421
+ theme: t(re),
409
422
  "tooltip-show-delay": 500,
410
423
  "enable-browser-tooltips": e.browserTooltips,
411
424
  "tooltip-interaction": "",
412
- "no-rows-overlay-component": wo,
413
- onSortChanged: ie,
425
+ "no-rows-overlay-component": Co,
426
+ onSortChanged: me,
414
427
  onGridReady: r[0] || (r[0] = (a) => d.value = a.api),
415
- onRowDataUpdated: L,
416
- onRowSelected: Be,
417
- onFirstDataRendered: Fe,
418
- onRowClicked: Ve,
419
- onBodyScrollEnd: Ne
420
- }), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "pinned-top-row-data", "pinned-bottom-row-data", "theme", "enable-browser-tooltips"]),
421
- Ge(g("div", {
422
- class: i(t(h)("table-loading-wrapper"))
428
+ onRowDataUpdated: G,
429
+ onRowSelected: Te,
430
+ onFirstDataRendered: De,
431
+ onRowClicked: Me,
432
+ onBodyScrollEnd: Oe
433
+ }), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips"]),
434
+ qe(v("div", {
435
+ class: u(t(R)("table-loading-wrapper"))
423
436
  }, [
424
- V(t(Qe), { delay: 300 })
437
+ I(t(Ze), { delay: 300 })
425
438
  ], 2), [
426
- [He, ke.value]
439
+ [Je, ze.value]
427
440
  ])
428
441
  ], 2),
429
- g("div", {
430
- class: i(t(l)("pagination-wrapper"))
442
+ v("div", {
443
+ class: u(t(i)("pagination-wrapper"))
431
444
  }, [
432
- e.pagination !== !1 ? (w(), Y(t(Xe), N({
445
+ e.pagination !== !1 ? (h(), Y(t(_e), V({
433
446
  key: 0,
434
- class: t(l)("pagination")
435
- }, t(M).pagination, { onChange: ze }), null, 16, ["class"])) : Q("", !0)
447
+ class: t(i)("pagination")
448
+ }, t(O).pagination, { onChange: Ve }), null, 16, ["class"])) : Q("", !0)
436
449
  ], 2)
437
450
  ], 6)
438
451
  ], 6));
439
452
  }
440
453
  });
441
454
  export {
442
- jo as default
455
+ Jo as default
443
456
  };
@@ -4,10 +4,10 @@ import { TableProps } from '@aplus-frontend/antdv';
4
4
  import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
7
- import { ColDef, IRowNode, ScrollDirection } from 'ag-grid-community';
7
+ import { ColDef, IRowNode, RowPinnedType, ScrollDirection } from 'ag-grid-community';
8
8
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
9
9
  export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
10
- children?: AgGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
10
+ children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
11
11
  /**
12
12
  * 表单项所占据的格子数(1-24格)
13
13
  */
@@ -111,6 +111,12 @@ export type AgGridVirtualConfig = {
111
111
  col?: boolean;
112
112
  rowBuffer?: number;
113
113
  };
114
+ export type AgGridSummaryType<RecordType = any> = {
115
+ top?: RecordType[];
116
+ bottom?: RecordType[];
117
+ cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType) => string | string[]);
118
+ rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
119
+ };
114
120
  export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
115
121
  /**
116
122
  * 列配置
@@ -208,12 +214,9 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
208
214
  columnResizable?: boolean;
209
215
  loading?: boolean;
210
216
  /**
211
- * 设置总结栏
217
+ * 总结栏配置项
212
218
  */
213
- summary?: {
214
- top?: RecordType[];
215
- bottom?: RecordType[];
216
- };
219
+ summary?: AgGridSummaryType<RecordType>;
217
220
  /**
218
221
  * 指定每一行占据的高度(大量数据展示时的性能优化)
219
222
  */