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