@aplus-frontend/ui 6.26.3 → 6.26.5

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