@aplus-frontend/ui 6.22.0-beta.0 → 6.22.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 (90) hide show
  1. package/es/index.mjs +164 -161
  2. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +42 -36
  3. package/es/src/ag-grid/context.d.ts +18 -0
  4. package/es/src/ag-grid/context.mjs +17 -0
  5. package/es/src/ag-grid/index.vue.d.ts +4 -2
  6. package/es/src/ag-grid/index.vue.mjs +340 -205
  7. package/es/src/ag-grid/interface.d.ts +105 -3
  8. package/es/src/ag-grid/theme.d.ts +3 -0
  9. package/es/src/ag-grid/theme.mjs +25 -0
  10. package/es/src/ap-field/number/index.vue.mjs +25 -25
  11. package/es/src/ap-grid/utils/col.d.ts +1 -1
  12. package/es/src/ap-grid/utils/col.mjs +29 -29
  13. package/es/src/ap-pro-card/components/card/index.vue2.mjs +108 -98
  14. package/es/src/ap-pro-card/components/divider/index.vue.d.ts +13 -0
  15. package/es/src/ap-pro-card/components/divider/index.vue.mjs +4 -0
  16. package/es/src/ap-pro-card/components/divider/index.vue2.mjs +29 -0
  17. package/es/src/ap-pro-card/components/operation/index.vue.d.ts +18 -0
  18. package/es/src/ap-pro-card/components/operation/index.vue.mjs +4 -0
  19. package/es/src/ap-pro-card/components/operation/index.vue2.mjs +20 -0
  20. package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +51 -0
  21. package/es/src/ap-pro-card/components/statistic/index.vue.mjs +4 -0
  22. package/es/src/ap-pro-card/components/statistic/index.vue2.mjs +134 -0
  23. package/es/src/ap-pro-card/components/statistic-card/index.vue.d.ts +25 -0
  24. package/es/src/ap-pro-card/components/statistic-card/index.vue.mjs +4 -0
  25. package/es/src/ap-pro-card/components/statistic-card/index.vue2.mjs +116 -0
  26. package/es/src/ap-pro-card/components/title/index.vue.d.ts +23 -0
  27. package/es/src/ap-pro-card/components/title/index.vue.mjs +4 -0
  28. package/es/src/ap-pro-card/components/title/index.vue2.mjs +28 -0
  29. package/es/src/ap-pro-card/index.d.ts +20 -42
  30. package/es/src/ap-pro-card/index.mjs +22 -4
  31. package/es/src/ap-pro-card/interface.d.ts +66 -2
  32. package/es/src/ap-tag/ap-tag-group.vue.mjs +42 -42
  33. package/es/src/business/ap-label/group/ApLabelGroup.mjs +17 -15
  34. package/es/src/business/hooks/index.d.ts +1 -0
  35. package/es/src/business/hooks/index.mjs +8 -6
  36. package/es/src/business/hooks/usePageListAgGrid.d.ts +37 -0
  37. package/es/src/business/hooks/usePageListAgGrid.mjs +88 -0
  38. package/es/src/index.mjs +277 -274
  39. package/es/src/version.d.ts +1 -1
  40. package/es/src/version.mjs +1 -1
  41. package/lib/index.js +1 -1
  42. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  43. package/lib/src/ag-grid/context.d.ts +18 -0
  44. package/lib/src/ag-grid/context.js +1 -0
  45. package/lib/src/ag-grid/index.vue.d.ts +4 -2
  46. package/lib/src/ag-grid/index.vue.js +1 -1
  47. package/lib/src/ag-grid/interface.d.ts +105 -3
  48. package/lib/src/ag-grid/theme.d.ts +3 -0
  49. package/lib/src/ag-grid/theme.js +1 -0
  50. package/lib/src/ap-field/number/index.vue.js +1 -1
  51. package/lib/src/ap-grid/utils/col.d.ts +1 -1
  52. package/lib/src/ap-grid/utils/col.js +1 -1
  53. package/lib/src/ap-pro-card/components/card/index.vue2.js +1 -1
  54. package/lib/src/ap-pro-card/components/divider/index.vue.d.ts +13 -0
  55. package/lib/src/ap-pro-card/components/divider/index.vue.js +1 -0
  56. package/lib/src/ap-pro-card/components/divider/index.vue2.js +1 -0
  57. package/lib/src/ap-pro-card/components/operation/index.vue.d.ts +18 -0
  58. package/lib/src/ap-pro-card/components/operation/index.vue.js +1 -0
  59. package/lib/src/ap-pro-card/components/operation/index.vue2.js +1 -0
  60. package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +51 -0
  61. package/lib/src/ap-pro-card/components/statistic/index.vue.js +1 -0
  62. package/lib/src/ap-pro-card/components/statistic/index.vue2.js +1 -0
  63. package/lib/src/ap-pro-card/components/statistic-card/index.vue.d.ts +25 -0
  64. package/lib/src/ap-pro-card/components/statistic-card/index.vue.js +1 -0
  65. package/lib/src/ap-pro-card/components/statistic-card/index.vue2.js +1 -0
  66. package/lib/src/ap-pro-card/components/title/index.vue.d.ts +23 -0
  67. package/lib/src/ap-pro-card/components/title/index.vue.js +1 -0
  68. package/lib/src/ap-pro-card/components/title/index.vue2.js +1 -0
  69. package/lib/src/ap-pro-card/index.d.ts +20 -42
  70. package/lib/src/ap-pro-card/index.js +1 -1
  71. package/lib/src/ap-pro-card/interface.d.ts +66 -2
  72. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  73. package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
  74. package/lib/src/business/hooks/index.d.ts +1 -0
  75. package/lib/src/business/hooks/index.js +1 -1
  76. package/lib/src/business/hooks/usePageListAgGrid.d.ts +37 -0
  77. package/lib/src/business/hooks/usePageListAgGrid.js +1 -0
  78. package/lib/src/index.js +1 -1
  79. package/lib/src/version.d.ts +1 -1
  80. package/lib/src/version.js +1 -1
  81. package/package.json +1 -1
  82. package/theme/ag-grid/index.css +468 -0
  83. package/theme/ag-grid/index.less +25 -0
  84. package/theme/ap-button/ap-button.css +1 -1
  85. package/theme/ap-button/ap-button.less +1 -1
  86. package/theme/ap-pro-card/index.css +199 -0
  87. package/theme/ap-pro-card/index.less +203 -0
  88. package/theme/ap-tag/ap-tag.css +1 -1
  89. package/theme/ap-tag/ap-tag.less +1 -1
  90. package/theme/index.css +218 -2
@@ -1,23 +1,28 @@
1
- import { defineComponent as ce, useSlots as ue, ref as h, computed as d, unref as a, watch as pe, toRef as me, createElementBlock as C, openBlock as p, normalizeStyle as b, normalizeClass as c, createCommentVNode as z, createElementVNode as m, createVNode as R, mergeProps as N, createSlots as fe, withCtx as E, Fragment as we, renderList as ge, createBlock as W, resolveDynamicComponent as he, renderSlot as A, withDirectives as ye, vShow as Se } from "vue";
2
- import { AgGridVue as Ce } from "ag-grid-vue3";
3
- import { ModuleRegistry as be, AllCommunityModule as Re } from "ag-grid-community";
4
- import { Spin as ve, Pagination as xe } from "@aplus-frontend/antdv";
5
- import { isFunction as v, isUndefined as x } from "lodash-unified";
1
+ import { defineComponent as Ne, useSlots as Ve, ref as u, computed as s, unref as n, watch as k, toRef as We, nextTick as Ee, createElementBlock as z, openBlock as y, normalizeStyle as b, normalizeClass as m, createCommentVNode as J, createElementVNode as v, createVNode as P, mergeProps as Q, createSlots as Me, withCtx as X, Fragment as Oe, renderList as Le, createBlock as Y, resolveDynamicComponent as $e, renderSlot as Z, withDirectives as Ge, vShow as je } from "vue";
2
+ import { AgGridVue as qe } from "ag-grid-vue3";
3
+ import { ModuleRegistry as He, AllCommunityModule as Ue } from "ag-grid-community";
4
+ import { Spin as Je, Pagination as Qe } from "@aplus-frontend/antdv";
5
+ import { isFunction as _, isUndefined as R } from "lodash-unified";
6
6
  import "../config-provider/index.mjs";
7
- import { ApForm as Be } from "../ap-form/index.mjs";
8
- import { noRenderAsFormItemValueList as Fe } from "../ap-table/constants.mjs";
9
- import { getColumnOrder as O, updateFormProps as Ie, getFieldProps as Te, getSearchFormItemRenderNode as ke, recursionApColumns as Ke } from "../ap-table/utils.mjs";
10
- import { useTablePaging as Pe } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
- import { dataIndexToField as De } from "../ap-grid/utils/col.mjs";
12
- import { isDef as ze } from "../utils/index.mjs";
7
+ import { ApForm as Xe } from "../ap-form/index.mjs";
8
+ import { noRenderAsFormItemValueList as Ye } from "../ap-table/constants.mjs";
9
+ import { getColumnOrder as ee, updateFormProps as Ze, getFieldProps as _e, getSearchFormItemRenderNode as et, recursionApColumns as tt } from "../ap-table/utils.mjs";
10
+ import { useTablePaging as ot } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
+ import { dataIndexToField as rt } from "../ap-grid/utils/col.mjs";
12
+ import { isDef as at } from "../utils/index.mjs";
13
13
  import "./components/header-cell/index.vue.mjs";
14
14
  import "./components/body-cell/index.vue.mjs";
15
- import Ne from "./hooks/use-row-selection.mjs";
16
- import { useNamespace as Ee } from "../config-provider/hooks/use-namespace.mjs";
17
- import { useGlobalConfig as We } from "../config-provider/hooks/use-global-config.mjs";
18
- import Ae from "./components/body-cell/index.vue2.mjs";
19
- import Oe from "./components/header-cell/index.vue2.mjs";
20
- const no = /* @__PURE__ */ ce({
15
+ import nt from "./hooks/use-row-selection.mjs";
16
+ import { useProvideSorter as lt } from "./context.mjs";
17
+ import { useProvideApTable as st } from "../ap-table/context.mjs";
18
+ import { sizeReverseMap as it, sizeMap as dt } from "../ap-grid/constants.mjs";
19
+ import { useToken as ct } from "@aplus-frontend/antdv/es/theme/internal";
20
+ import { useTheme as ut } from "./theme.mjs";
21
+ import { useNamespace as mt } from "../config-provider/hooks/use-namespace.mjs";
22
+ import { useGlobalConfig as pt } from "../config-provider/hooks/use-global-config.mjs";
23
+ import ft from "./components/body-cell/index.vue2.mjs";
24
+ import gt from "./components/header-cell/index.vue2.mjs";
25
+ const Lt = /* @__PURE__ */ Ne({
21
26
  name: "AgGrid",
22
27
  __name: "index",
23
28
  props: {
@@ -72,6 +77,7 @@ const no = /* @__PURE__ */ ce({
72
77
  searchFormWrapperStyle: {},
73
78
  tableWrapperStyle: {},
74
79
  wrapperStyle: {},
80
+ tableStyle: {},
75
81
  manual: { type: Boolean, default: void 0 },
76
82
  size: { default: "mini" },
77
83
  adaptive: { type: Boolean },
@@ -79,169 +85,196 @@ const no = /* @__PURE__ */ ce({
79
85
  loading: { type: Boolean, default: void 0 },
80
86
  summary: {}
81
87
  },
82
- setup(M) {
83
- be.registerModules([Re]);
84
- const t = M, V = ue(), { e: f, b: i, em: G } = Ee("ag-grid"), B = h();
85
- let w = !1, F = 0;
86
- const I = We("valueTypeMap"), T = d(() => {
87
- var e, r, n;
88
- return F++, ((n = (r = (e = t.columns) == null ? void 0 : e.filter(
89
- (o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !Fe.includes(o.valueType)
90
- )) == null ? void 0 : r.sort((o, l) => {
91
- let s = O(o.order);
92
- return O(l.order) - s;
93
- })) == null ? void 0 : n.map((o) => {
94
- const l = Ie(
95
- o,
96
- Te(o.fieldProps, {})
97
- ), s = {
98
- ...o,
88
+ setup(te, { expose: oe }) {
89
+ He.registerModules([Ue]);
90
+ const r = te, re = Ve(), { e: C, b: d, em: ae, be: ne } = mt("ag-grid"), g = u(r.size), le = ut(g), S = u(), [, se] = ct();
91
+ let w = !!r.dataSource, D = 0;
92
+ const A = pt("valueTypeMap"), K = s(() => {
93
+ var e, o, a;
94
+ return D++, ((a = (o = (e = r.columns) == null ? void 0 : e.filter(
95
+ (t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !Ye.includes(t.valueType)
96
+ )) == null ? void 0 : o.sort((t, l) => {
97
+ let i = ee(t.order);
98
+ return ee(l.order) - i;
99
+ })) == null ? void 0 : a.map((t) => {
100
+ const l = Ze(
101
+ t,
102
+ _e(t.fieldProps, {})
103
+ ), i = {
104
+ ...t,
99
105
  fieldProps: {
100
- label: o.title,
101
- name: o.dataIndex,
106
+ label: t.title,
107
+ name: t.dataIndex,
102
108
  // tips: 在表格中的查询表单项默认是带边框的
103
109
  bordered: !0,
104
110
  ...l || {},
105
- _signal: F
111
+ _signal: D
106
112
  },
107
113
  renderNode: void 0
108
114
  };
109
- return s.renderNode = ke(
110
- s,
111
- a(I)
112
- ), s;
115
+ return i.renderNode = et(
116
+ i,
117
+ n(A)
118
+ ), i;
113
119
  })) || [];
114
- }), g = h([]);
115
- function L() {
120
+ }), c = u([]), N = u([]);
121
+ function ie() {
116
122
  var e;
117
- return ((e = t.columns) == null ? void 0 : e.filter((r) => !r.hideInTable)) || [];
123
+ return ((e = r.columns) == null ? void 0 : e.filter((o) => !o.hideInTable)) || [];
118
124
  }
119
- pe(
120
- () => t.columns,
125
+ k(
126
+ () => r.columns,
121
127
  () => {
122
- var r;
123
- const e = L();
124
- g.value = e, (r = t.onShownColumnsChange) == null || r.call(t, e);
128
+ var o;
129
+ const e = ie();
130
+ c.value = e, N.value = e, (o = r.onShownColumnsChange) == null || o.call(r, e);
125
131
  },
126
132
  {
127
133
  deep: !0,
128
134
  immediate: !0
129
135
  }
130
136
  );
131
- const $ = d(() => {
132
- const e = a(g);
133
- function r(n) {
134
- return n.map((o) => {
135
- var s;
137
+ const de = s(() => {
138
+ const e = n(c);
139
+ function o(a) {
140
+ return a.map((t) => {
141
+ var i;
136
142
  const l = {
137
- field: De(o.dataIndex),
138
- colId: ze(o.key) ? String(o.key) : void 0,
139
- sortable: !!o.sorter,
140
- comparator: o.sorter === !0 ? () => 0 : o.sorter,
143
+ field: rt(t.dataIndex),
144
+ colId: at(t.key) ? String(t.key) : void 0,
145
+ sortable: !!t.sorter,
146
+ comparator: t.sorter === !0 ? () => 0 : t.sorter,
141
147
  headerComponentParams: {
142
- column: o
148
+ column: t
143
149
  },
144
150
  cellRendererParams: {
145
- column: o,
146
- extraValueType: a(I)
151
+ column: t,
152
+ extraValueType: n(A)
147
153
  },
148
- resizable: o.resizable,
149
- width: o.width,
150
- minWidth: o.minWidth,
151
- maxWidth: o.maxWidth,
152
- flex: o.width ? void 0 : 1,
154
+ resizable: t.resizable,
155
+ width: t.width,
156
+ minWidth: t.minWidth,
157
+ maxWidth: t.maxWidth,
158
+ flex: t.width ? void 0 : 1,
153
159
  // 如果没有设置确切的宽度,则设置为可自由伸缩列
154
- pinned: o.fixed,
155
- cellClass: (u) => {
156
- const S = o.cellClass || "", ie = v(S) ? S(u.data, u.node) : S;
160
+ pinned: t.fixed || null,
161
+ // undefined to null
162
+ colSpan: t.colSpan,
163
+ cellClass: (h) => {
164
+ const I = t.cellClass || "", Ke = _(I) ? I(h.data, h.node) : I;
157
165
  return [
158
- `${G("cell", o.align || "left")}`,
159
- ie
166
+ `${ae("cell", t.align || "left")}`,
167
+ Ke
160
168
  ].flat().filter(Boolean);
161
- }
169
+ },
170
+ wrapText: !t.ellipsis,
171
+ autoHeight: !t.ellipsis
162
172
  };
163
- return (s = o.children) != null && s.length ? {
173
+ return (i = t.children) != null && i.length ? {
164
174
  ...l,
165
- children: r(o.children)
175
+ children: o(t.children)
166
176
  } : l;
167
177
  });
168
178
  }
169
- return r(e);
170
- }), j = h({
171
- headerComponent: Oe,
172
- cellRenderer: Ae,
173
- resizable: t.columnResizable,
179
+ return o(e);
180
+ }), ce = u({
181
+ headerComponent: gt,
182
+ cellRenderer: ft,
183
+ resizable: r.columnResizable,
174
184
  suppressMovable: !0,
175
- cellDataType: !1
176
- }), q = {
185
+ cellDataType: !1,
186
+ cellStyle: {
187
+ whiteSpace: "pre-line"
188
+ }
189
+ }), V = u({});
190
+ lt({
191
+ sorter: V,
192
+ setSorter(e) {
193
+ V.value = e;
194
+ }
195
+ });
196
+ const ue = {
177
197
  asc: "ascend",
178
198
  desc: "descend"
179
199
  };
180
- function U() {
181
- var r;
182
- const e = (r = B.value.getColumns()) == null ? void 0 : r.filter((n) => n.getSort() !== void 0);
183
- if (e && e.length > 0) {
184
- const n = e[0], o = n.getColDef(), l = n.getSort();
185
- K(void 0, void 0, {
186
- column: o,
187
- field: o.field,
188
- order: l ? q[l] : null
189
- });
190
- }
200
+ function me() {
201
+ var l;
202
+ const e = (l = S.value.getColumns()) == null ? void 0 : l.filter((i) => i.getSort() !== void 0);
203
+ if (!(e != null && e.length))
204
+ return;
205
+ const o = e[0], a = o.getColDef(), t = o.getSort();
206
+ E(void 0, void 0, {
207
+ column: a,
208
+ field: a.field,
209
+ order: t ? ue[t] : null
210
+ });
191
211
  }
192
- const H = d(() => Ke(a(g), (e) => {
212
+ const pe = s(() => tt(n(c), (e) => {
193
213
  if (e.sorter === !0)
194
214
  return e.key || e.dataIndex;
195
215
  }).filter(Boolean)), {
196
- formRef: J,
197
- submit: Q,
198
- reset: X,
199
- data: y,
200
- tableProps: k,
201
- handleTableChangeOptional: K
202
- } = Pe({
216
+ formRef: p,
217
+ submit: x,
218
+ reset: F,
219
+ data: f,
220
+ tableProps: W,
221
+ handleTableChangeOptional: E,
222
+ submitWith: M,
223
+ refresh: O,
224
+ getPaging: fe,
225
+ setPaging: ge
226
+ } = ot({
203
227
  async request(e) {
204
- var n;
205
- if (w = !1, !x(t.dataSource)) {
206
- const o = e.pageSize * (e.current - 1);
228
+ var a;
229
+ if (w = !1, !R(r.dataSource)) {
230
+ const t = e.pageSize * (e.current - 1);
207
231
  return {
208
- data: (t.pagination === !1 ? t.dataSource : t.dataSource.slice(o, o + e.pageSize)) || [],
209
- total: t.dataSource.length || 0
232
+ data: (r.pagination === !1 ? r.dataSource : r.dataSource.slice(t, t + e.pageSize)) || [],
233
+ total: r.dataSource.length || 0
210
234
  };
211
235
  }
212
- const r = await ((n = t.request) == null ? void 0 : n.call(t, e));
236
+ const o = await ((a = r.request) == null ? void 0 : a.call(r, e));
213
237
  return {
214
- data: (r == null ? void 0 : r.data) || [],
215
- total: (r == null ? void 0 : r.total) || 0
238
+ data: (o == null ? void 0 : o.data) || [],
239
+ total: (o == null ? void 0 : o.total) || 0
216
240
  };
217
241
  },
218
242
  namespace: "ap-grid",
219
- filterFields: h([]),
220
- params: me(t, "params"),
221
- defaultData: t.defaultData,
222
- manual: t.manual,
223
- formatParams: t.beforeSearchSubmit,
224
- pagination: t.pagination,
225
- sortFields: H
226
- }), { select: Y, unSelect: Z, selectedRows: P, selectedRowKeys: _ } = Ne({
227
- ...t.rowSelection === !0 ? {} : t.rowSelection,
228
- dataSource: d(() => y.records),
229
- rowKey: t.rowKey
230
- }), ee = {
243
+ filterFields: u([]),
244
+ params: We(r, "params"),
245
+ defaultData: r.defaultData,
246
+ manual: r.manual,
247
+ formatParams: r.beforeSearchSubmit,
248
+ pagination: r.pagination,
249
+ sortFields: pe
250
+ }), Se = s(
251
+ () => R(r.dataSource) ? f.records : r.dataSource
252
+ ), {
253
+ select: we,
254
+ unSelect: he,
255
+ selectedRows: T,
256
+ selectedRowKeys: ye,
257
+ clearAll: ve,
258
+ selectMultiByKeys: Ce
259
+ } = nt({
260
+ ...r.rowSelection === !0 ? {} : r.rowSelection,
261
+ dataSource: Se,
262
+ rowKey: r.rowKey
263
+ }), be = {
231
264
  checkbox: "multiRow",
232
265
  radio: "singleRow"
233
- }, oe = d(() => {
234
- if (!t.rowSelection)
266
+ }, Re = s(() => {
267
+ if (!r.rowSelection)
235
268
  return;
236
- const { type: e = "checkbox", disabled: r } = t.rowSelection === !0 ? {} : t.rowSelection;
269
+ const { type: e = "checkbox", disabled: o } = r.rowSelection === !0 ? {} : r.rowSelection;
237
270
  return {
238
- mode: ee[e],
239
- isRowSelectable: (n) => r ? !r(n.data) : !0
271
+ mode: be[e],
272
+ isRowSelectable: (a) => o ? !o(a.data) : !0
240
273
  };
241
- }), te = d(() => {
242
- if (!t.rowSelection)
274
+ }), xe = s(() => {
275
+ if (!r.rowSelection)
243
276
  return;
244
- const e = t.rowSelection === !0 ? {} : t.rowSelection;
277
+ const e = r.rowSelection === !0 ? {} : r.rowSelection;
245
278
  return {
246
279
  sortable: !1,
247
280
  resizable: !1,
@@ -249,123 +282,225 @@ const no = /* @__PURE__ */ ce({
249
282
  pinned: e.fixed
250
283
  };
251
284
  });
252
- function D(e) {
253
- return v(t.rowKey) ? t.rowKey(e) : e[t.rowKey];
285
+ function B(e) {
286
+ return _(r.rowKey) ? r.rowKey(e) : e[r.rowKey];
254
287
  }
255
- const re = ({ api: e }) => {
256
- if (!t.rowSelection)
288
+ const L = ({
289
+ api: e = S.value
290
+ }) => {
291
+ if (!r.rowSelection)
257
292
  return;
258
- const r = P.value;
259
- if (console.log("run restore", r), !r.length)
293
+ const o = T.value;
294
+ if (!o.length)
260
295
  return;
261
296
  w = !1;
262
- const n = [];
263
- e.forEachNode((o) => {
264
- const l = o.data, s = D(l);
265
- r.find((u) => D(u) === s) && n.push(o);
266
- }), e.setNodesSelected({ nodes: n, newValue: !0 }), setTimeout(() => {
297
+ const a = [];
298
+ e.forEachNode((t) => {
299
+ const l = t.data, i = B(l);
300
+ o.find((h) => B(h) === i) && a.push(t);
301
+ }), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
267
302
  w = !0;
268
303
  }, 0);
269
- }, ae = (e) => {
270
- w && (e.node.isSelected() ? Y(e.data) : Z(e.data));
271
- }, ne = d(
272
- () => x(t.loading) ? y.loading : t.loading
273
- ), le = d(() => [
274
- i(),
275
- t.card ? null : i("wrapper"),
276
- t.adaptive ? i("adaptive") : null
277
- ].filter(Boolean)), se = (e, r) => {
278
- K({ current: e, pageSize: r });
304
+ }, Fe = (e) => {
305
+ w && (e.node.isSelected() ? we(e.data) : he(e.data));
306
+ }, Te = () => {
307
+ w = !0;
308
+ }, $ = () => {
309
+ var e;
310
+ ve(), (e = S.value) == null || e.deselectAll();
311
+ };
312
+ function Be(e) {
313
+ Ce(e), Ee(() => {
314
+ L({});
315
+ });
316
+ }
317
+ function G(e = !1) {
318
+ var a, t, l;
319
+ const o = e ? "getFieldsValueTransformed" : "getFieldsValue";
320
+ return (l = (t = (a = p.value) == null ? void 0 : a.apForm) == null ? void 0 : t[o]) == null ? void 0 : l.call(t, !0);
321
+ }
322
+ function j(e) {
323
+ var o, a, t;
324
+ (t = (a = (o = p.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
325
+ }
326
+ function q() {
327
+ var e;
328
+ return ((e = p.value) == null ? void 0 : e.getSorterItems()) || [];
329
+ }
330
+ function H(e) {
331
+ var o;
332
+ (o = p.value) == null || o.setSorterItems(e);
333
+ }
334
+ function U() {
335
+ var e;
336
+ (e = p.value) == null || e.resetSorterItems();
337
+ }
338
+ st({
339
+ columns: s(() => c.value),
340
+ columnsBackup: s(() => N.value),
341
+ size: s(() => dt[g.value]),
342
+ updateColumns(e) {
343
+ var o;
344
+ console.log(e), c.value = e, (o = r.onShownColumnsChange) == null || o.call(r, e);
345
+ },
346
+ updateSize(e) {
347
+ g.value = it[e];
348
+ },
349
+ renderConfig: s(() => ({
350
+ className: ne("table-header", "title"),
351
+ color: se.value.colorTextTertiary
352
+ })),
353
+ dataSource: s(() => n(f).records),
354
+ getSearchFormValues: G,
355
+ setSearchFormValues: j,
356
+ submit: x,
357
+ submitWith: M,
358
+ reset: F,
359
+ refresh: O,
360
+ getSearchFormSorterItems: q,
361
+ setSearchFormSorterItems: H,
362
+ resetSearchFormSorterItems: U
363
+ });
364
+ const Ie = s(
365
+ () => R(r.loading) ? f.loading : r.loading
366
+ ), ke = s(() => [
367
+ d(),
368
+ r.card ? null : d("wrapper"),
369
+ d("adaptive"),
370
+ d(`size-${g.value}`)
371
+ ].filter(Boolean)), ze = s(() => ({
372
+ height: "100%",
373
+ ...r.tableStyle || {}
374
+ })), Pe = (e, o) => {
375
+ E({ current: e, pageSize: o });
279
376
  };
280
- function de(e) {
281
- const r = e.data;
282
- return v(t.rowKey) ? t.rowKey(r) : r[t.rowKey];
377
+ function De(e) {
378
+ const o = e.data;
379
+ return B(o);
380
+ }
381
+ function Ae(e, o) {
382
+ var a;
383
+ (a = S.value) == null || a.ensureIndexVisible(e, o);
283
384
  }
284
- return (e, r) => {
285
- var n, o;
286
- return p(), C("div", {
287
- class: c(le.value),
385
+ return k(
386
+ () => r.size,
387
+ (e) => {
388
+ g.value = e;
389
+ }
390
+ ), k(
391
+ () => n(f).loading,
392
+ (e) => {
393
+ var o;
394
+ (o = r.onLoadingChange) == null || o.call(r, e);
395
+ }
396
+ ), oe({
397
+ submit: x,
398
+ reset: F,
399
+ refresh: O,
400
+ submitWith: M,
401
+ setSearchFormValues: j,
402
+ getSearchFormValues: G,
403
+ getShowColumns: () => n(c),
404
+ rowSelection: {
405
+ selectedRows: s(() => T.value),
406
+ setSelectedRowKeys: Be,
407
+ clearAll: $
408
+ },
409
+ scrollToRow: Ae,
410
+ getDataSource: () => n(f.records),
411
+ getPaging: fe,
412
+ setPaging: ge,
413
+ getSearchFormSorterItems: q,
414
+ setSearchFormSorterItems: H,
415
+ resetSearchFormSorterItems: U
416
+ }), (e, o) => {
417
+ var a, t;
418
+ return y(), z("div", {
419
+ class: m(ke.value),
288
420
  style: b(e.wrapperStyle)
289
421
  }, [
290
- a(x)(e.dataSource) && e.searchForm !== !1 && T.value.length > 0 ? (p(), C("div", {
422
+ n(R)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (y(), z("div", {
291
423
  key: 0,
292
- class: c(e.card ? a(f)("search-wrapper") : null),
424
+ class: m(e.card ? n(C)("search-wrapper") : null),
293
425
  style: b(e.searchFormWrapperStyle)
294
426
  }, [
295
- R(a(Be).SearchForm, N(e.searchForm || {}, {
427
+ P(n(Xe).SearchForm, Q(e.searchForm || {}, {
296
428
  ref_key: "formRef",
297
- ref: J,
429
+ ref: p,
298
430
  "custom-reset": "",
299
- "submit-loading": a(k).loading,
300
- onSubmit: a(Q),
301
- onReset: a(X)
302
- }), fe({
303
- default: E(() => [
304
- (p(!0), C(we, null, ge(T.value, (l) => (p(), W(he(l.renderNode), {
431
+ "submit-loading": n(W).loading,
432
+ onSubmit: n(x),
433
+ onReset: n(F)
434
+ }), Me({
435
+ default: X(() => [
436
+ (y(!0), z(Oe, null, Le(K.value, (l) => (y(), Y($e(l.renderNode), {
305
437
  key: l.dataIndex
306
438
  }))), 128))
307
439
  ]),
308
440
  _: 2
309
441
  }, [
310
- V.searchFormExtra ? {
442
+ re.searchFormExtra ? {
311
443
  name: "extra",
312
- fn: E(() => [
313
- A(e.$slots, "searchFormExtra")
444
+ fn: X(() => [
445
+ Z(e.$slots, "searchFormExtra")
314
446
  ]),
315
447
  key: "0"
316
448
  } : void 0
317
449
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
318
- ], 6)) : z("", !0),
319
- m("div", {
320
- class: c([a(f)("table-wrapper"), e.card ? a(f)("table-wrapper-card") : null]),
450
+ ], 6)) : J("", !0),
451
+ v("div", {
452
+ class: m([n(C)("table-wrapper"), e.card ? n(C)("table-wrapper-card") : null]),
321
453
  style: b(e.tableWrapperStyle)
322
454
  }, [
323
- m("div", {
324
- class: c(a(i)("header-wrapper"))
455
+ v("div", {
456
+ class: m(n(d)("header-wrapper"))
325
457
  }, [
326
- A(e.$slots, "title", {
327
- selectedRows: a(P),
328
- selectedRowKeys: a(_),
329
- shownColumns: g.value
458
+ Z(e.$slots, "title", {
459
+ selectedRows: n(T),
460
+ selectedRowKeys: n(ye),
461
+ shownColumns: c.value,
462
+ clearAll: $
330
463
  })
331
464
  ], 2),
332
- m("div", {
333
- class: c(a(i)("grid-wrapper"))
465
+ v("div", {
466
+ class: m(n(d)("grid-wrapper"))
334
467
  }, [
335
- R(a(Ce), {
336
- style: { height: "100%" },
337
- "row-data": a(y).records,
338
- "column-defs": $.value,
339
- "default-col-def": j.value,
468
+ P(n(qe), {
469
+ style: b(ze.value),
470
+ "row-data": n(f).records,
471
+ "column-defs": de.value,
472
+ "default-col-def": ce.value,
340
473
  "locale-text": {
341
474
  noRowsToShow: ""
342
475
  // 为了隐藏默认的无数据提示,因为外部已经自行实现了loading
343
476
  },
344
- "row-selection": oe.value,
345
- "selection-column-def": te.value,
346
- "get-row-id": de,
347
- "pinned-top-row-data": (n = e.summary) == null ? void 0 : n.top,
348
- "pinned-bottom-row-data": (o = e.summary) == null ? void 0 : o.bottom,
349
- onSortChanged: U,
350
- onGridReady: r[0] || (r[0] = (l) => B.value = l.api),
351
- onRowDataUpdated: re,
352
- onRowSelected: ae
353
- }, null, 8, ["row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "pinned-top-row-data", "pinned-bottom-row-data"]),
354
- ye(m("div", {
355
- class: c(a(f)("table-loading-wrapper"))
477
+ "row-selection": Re.value,
478
+ "selection-column-def": xe.value,
479
+ "get-row-id": De,
480
+ "pinned-top-row-data": (a = e.summary) == null ? void 0 : a.top,
481
+ "pinned-bottom-row-data": (t = e.summary) == null ? void 0 : t.bottom,
482
+ theme: n(le),
483
+ onSortChanged: me,
484
+ onGridReady: o[0] || (o[0] = (l) => S.value = l.api),
485
+ onRowDataUpdated: L,
486
+ onRowSelected: Fe,
487
+ onFirstDataRendered: Te
488
+ }, null, 8, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "pinned-top-row-data", "pinned-bottom-row-data", "theme"]),
489
+ Ge(v("div", {
490
+ class: m(n(C)("table-loading-wrapper"))
356
491
  }, [
357
- R(a(ve), { delay: 300 })
492
+ P(n(Je), { delay: 300 })
358
493
  ], 2), [
359
- [Se, ne.value]
494
+ [je, Ie.value]
360
495
  ])
361
496
  ], 2),
362
- m("div", {
363
- class: c(a(i)("pagination-wrapper"))
497
+ v("div", {
498
+ class: m(n(d)("pagination-wrapper"))
364
499
  }, [
365
- e.pagination !== !1 ? (p(), W(a(xe), N({
500
+ e.pagination !== !1 ? (y(), Y(n(Qe), Q({
366
501
  key: 0,
367
- class: a(i)("pagination")
368
- }, a(k).pagination, { onChange: se }), null, 16, ["class"])) : z("", !0)
502
+ class: n(d)("pagination")
503
+ }, n(W).pagination, { onChange: Pe }), null, 16, ["class"])) : J("", !0)
369
504
  ], 2)
370
505
  ], 6)
371
506
  ], 6);
@@ -373,5 +508,5 @@ const no = /* @__PURE__ */ ce({
373
508
  }
374
509
  });
375
510
  export {
376
- no as default
511
+ Lt as default
377
512
  };