@aplus-frontend/ui 6.22.0-beta.0 → 6.22.1

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