@aplus-frontend/ui 0.0.32 → 0.0.34

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 (91) hide show
  1. package/es/index.mjs +217 -215
  2. package/es/src/ap-field/select/index.vue.mjs +36 -32
  3. package/es/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
  4. package/es/src/ap-form/ap-form-item-group/helper.mjs +30 -25
  5. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +30 -31
  6. package/es/src/ap-form/ap-form.vue2.mjs +11 -11
  7. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -1
  8. package/es/src/ap-form/modal-form/index.vue.mjs +43 -39
  9. package/es/src/ap-form/search-form/index.vue.mjs +79 -78
  10. package/es/src/ap-modal/utils/createModal.mjs +34 -31
  11. package/es/src/ap-table/ap-table.vue.d.ts +54 -11
  12. package/es/src/ap-table/ap-table.vue.mjs +171 -148
  13. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  14. package/es/src/ap-table/hooks/use-table-paging.mjs +47 -46
  15. package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  16. package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
  17. package/es/src/ap-table/interface.d.ts +14 -2
  18. package/es/src/ap-table/style/ap-table.css +2 -0
  19. package/es/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
  20. package/es/src/ap-tag/ap-tag-group.vue.mjs +81 -61
  21. package/es/src/ap-tag/interface.d.ts +24 -0
  22. package/es/src/ap-tag/style/ap-tag-group.css +8 -0
  23. package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
  24. package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
  25. package/es/src/business/ap-select-layout/index.css +117 -0
  26. package/es/src/business/ap-select-layout/index.d.ts +4 -0
  27. package/es/src/business/ap-select-layout/interface.d.ts +9 -0
  28. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  29. package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
  30. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
  31. package/es/src/business/index.d.ts +76 -1
  32. package/es/src/business/index.mjs +9 -6
  33. package/es/src/config-provider/config-provider.d.ts +144 -1
  34. package/es/src/config-provider/config-provider.mjs +35 -29
  35. package/es/src/config-provider/index.mjs +22 -20
  36. package/es/src/design-token/index.mjs +6 -2
  37. package/es/src/editable-table/form-item.vue.d.ts +7 -7
  38. package/es/src/editable-table/form-item.vue.mjs +2 -2
  39. package/es/src/editable-table/index.vue.d.ts +7 -7
  40. package/es/src/editable-table/index.vue.mjs +10 -10
  41. package/es/src/editable-table/interface.d.ts +1 -1
  42. package/es/src/index.mjs +188 -186
  43. package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  44. package/es/src/theme/ap-table/ap-table.css +2 -0
  45. package/es/src/theme/ap-tag/ap-tag-group.css +8 -0
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-field/select/index.vue.js +1 -1
  48. package/lib/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
  49. package/lib/src/ap-form/ap-form-item-group/helper.js +1 -1
  50. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  51. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  52. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -1
  53. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  54. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  55. package/lib/src/ap-modal/utils/createModal.js +1 -1
  56. package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
  57. package/lib/src/ap-table/ap-table.vue.js +1 -1
  58. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  59. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  60. package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  61. package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
  62. package/lib/src/ap-table/interface.d.ts +14 -2
  63. package/lib/src/ap-table/style/ap-table.css +2 -0
  64. package/lib/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
  65. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  66. package/lib/src/ap-tag/interface.d.ts +24 -0
  67. package/lib/src/ap-tag/style/ap-tag-group.css +8 -0
  68. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
  69. package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
  70. package/lib/src/business/ap-select-layout/index.css +117 -0
  71. package/lib/src/business/ap-select-layout/index.d.ts +4 -0
  72. package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
  73. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  74. package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
  75. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
  76. package/lib/src/business/index.d.ts +76 -1
  77. package/lib/src/business/index.js +1 -1
  78. package/lib/src/config-provider/config-provider.d.ts +144 -1
  79. package/lib/src/config-provider/config-provider.js +1 -1
  80. package/lib/src/config-provider/index.js +1 -1
  81. package/lib/src/design-token/index.js +1 -1
  82. package/lib/src/editable-table/form-item.vue.d.ts +7 -7
  83. package/lib/src/editable-table/form-item.vue.js +1 -1
  84. package/lib/src/editable-table/index.vue.d.ts +7 -7
  85. package/lib/src/editable-table/index.vue.js +1 -1
  86. package/lib/src/editable-table/interface.d.ts +1 -1
  87. package/lib/src/index.js +1 -1
  88. package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  89. package/lib/src/theme/ap-table/ap-table.css +2 -0
  90. package/lib/src/theme/ap-tag/ap-tag-group.css +8 -0
  91. package/package.json +2 -2
@@ -1,22 +1,23 @@
1
- import { defineComponent as te, useSlots as oe, computed as s, createVNode as d, mergeProps as f, unref as l, watch as re, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as L, withCtx as p, Fragment as le, renderList as E, createBlock as ne, resolveDynamicComponent as se, renderSlot as w, createCommentVNode as O, createElementVNode as V, toDisplayString as de, normalizeProps as ue, guardReactiveProps as ie } from "vue";
2
- import { Typography as pe, Table as ce, Tooltip as fe } from "ant-design-vue";
3
- import { useToken as me } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as ge } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as ye, noRenderAsFormItemValueList as z, apTableFormItemMap as be } from "./constants.mjs";
1
+ import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as r, watch as de, openBlock as c, createElementBlock as y, normalizeClass as F, normalizeStyle as T, createSlots as V, withCtx as f, Fragment as ue, renderList as z, createBlock as ie, resolveDynamicComponent as pe, renderSlot as x, createCommentVNode as D, createElementVNode as K, toDisplayString as ce, normalizeProps as fe, guardReactiveProps as me } from "vue";
2
+ import { Typography as ge, Table as ye, Tooltip as be } from "ant-design-vue";
3
+ import { useToken as Se } from "ant-design-vue/es/theme/internal";
4
+ import { ApForm as he } from "../ap-form/index.mjs";
5
+ import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as Ce } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as he } from "./hooks/use-table-paging.mjs";
8
- import { omit as N, isUndefined as x, isBoolean as Ce } from "lodash-unified";
7
+ import { useTablePaging as Re } from "./hooks/use-table-paging.mjs";
8
+ import { omit as W, isUndefined as u, isBoolean as Fe } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
- import { QuestionCircleOutlined as Se } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as Fe, getTableRenderType as Re, getTableRenderProps as we, getColumnOrder as D, updateFormProps as xe, getFieldProps as Te, getPlaceholder as Be } from "./utils.mjs";
12
- import Pe from "./hooks/use-table-content-height.mjs";
13
- import { getRawDisplayValue as ve } from "../editable-table/utils.mjs";
14
- import { useLocale as Ie } from "../config-provider/hooks/use-locale.mjs";
15
- import { useNamespace as ke } from "../config-provider/hooks/use-namespace.mjs";
16
- import { useGlobalConfig as Le } from "../config-provider/hooks/use-global-config.mjs";
17
- const Ee = {
10
+ import { QuestionCircleOutlined as Te } from "@ant-design/icons-vue";
11
+ import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps as Be, getColumnOrder as _, updateFormProps as Pe, getFieldProps as Ie, getPlaceholder as ke } from "./utils.mjs";
12
+ import Le from "./hooks/use-table-content-height.mjs";
13
+ import { getRawDisplayValue as Ee } from "../editable-table/utils.mjs";
14
+ import Oe from "./hooks/use-table-row-selection.mjs";
15
+ import { useLocale as Ve } from "../config-provider/hooks/use-locale.mjs";
16
+ import { useNamespace as ze } from "../config-provider/hooks/use-namespace.mjs";
17
+ import { useGlobalConfig as De } from "../config-provider/hooks/use-global-config.mjs";
18
+ const Ke = {
18
19
  key: 0
19
- }, Ue = /* @__PURE__ */ te({
20
+ }, aa = /* @__PURE__ */ ne({
20
21
  name: "ApTable",
21
22
  __name: "ap-table",
22
23
  props: {
@@ -32,7 +33,6 @@ const Ee = {
32
33
  locale: {},
33
34
  onChange: {},
34
35
  onResizeColumn: {},
35
- rowSelection: {},
36
36
  getPopupContainer: {},
37
37
  scroll: {},
38
38
  sortDirections: {
@@ -96,6 +96,9 @@ const Ee = {
96
96
  },
97
97
  transformCellText: {},
98
98
  columns: {},
99
+ rowSelection: {
100
+ type: Boolean
101
+ },
99
102
  card: {
100
103
  type: Boolean,
101
104
  default: !1
@@ -130,206 +133,226 @@ const Ee = {
130
133
  default: !1
131
134
  }
132
135
  },
133
- setup(W, {
134
- expose: _
136
+ setup(j, {
137
+ expose: A
135
138
  }) {
136
- const o = W;
137
- let T = 0;
138
- const B = oe(), [, j] = me(), {
139
- t: A
140
- } = Ie(), {
141
- e: g,
142
- b: u
143
- } = ke("ap-table"), M = Le("uiMode", "aplus"), {
144
- height: q,
145
- contentRef: H
146
- } = Pe(), y = s(() => {
139
+ const a = j;
140
+ let v = 0;
141
+ const B = se(), [, M] = Se(), {
142
+ t: q
143
+ } = Ve(), {
144
+ e: b,
145
+ b: i
146
+ } = ze("ap-table"), H = De("uiMode", "aplus"), {
147
+ height: $,
148
+ contentRef: G
149
+ } = Le(), S = s(() => {
147
150
  var t;
148
- let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
149
- return e = e.map((a) => ({
150
- ...N(Fe(a), ["ellipsis"]),
151
+ let e = ((t = a.columns) == null ? void 0 : t.filter((o) => !o.hideInTable)) || [];
152
+ return e = e.map((o) => ({
153
+ ...W(xe(o), ["ellipsis"]),
151
154
  customRender({
152
- value: r,
155
+ value: l,
153
156
  ...n
154
157
  }) {
155
- const C = Re(a), k = ye[C], ae = we(a, {
156
- value: r,
158
+ const C = ve(o), O = we[C], le = Be(o, {
159
+ value: l,
157
160
  ...n
158
161
  });
159
- let S = Y(a, r, d(k, f(ae, {
162
+ let R = oe(o, l, d(O, p(le, {
160
163
  mode: "read"
161
164
  }), null));
162
- return a.customRender && (S = a.customRender({
163
- value: r,
165
+ return o.customRender && (R = o.customRender({
166
+ value: l,
164
167
  ...n,
165
- column: a,
166
- originalNode: S
167
- })), S;
168
+ column: o,
169
+ originalNode: R
170
+ })), R;
168
171
  }
169
172
  })), e;
170
173
  }), P = s(() => {
171
- var e, t, a;
172
- return T++, ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
173
- let C = D(r.order);
174
- return D(n.order) - C;
175
- })) == null ? void 0 : a.map((r) => {
176
- const n = xe(r, Te(r.fieldProps, {}));
174
+ var e, t, o;
175
+ return v++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !N.includes(l.valueType))) == null ? void 0 : t.sort((l, n) => {
176
+ let C = _(l.order);
177
+ return _(n.order) - C;
178
+ })) == null ? void 0 : o.map((l) => {
179
+ const n = Pe(l, Ie(l.fieldProps, {}));
177
180
  return {
178
- ...r,
181
+ ...l,
179
182
  fieldProps: {
180
- label: r.title,
181
- name: r.dataIndex,
183
+ label: l.title,
184
+ name: l.dataIndex,
182
185
  ...n || {},
183
186
  // 格式化placeholder
184
- placeholder: Be(A, r.valueType, n == null ? void 0 : n.placeholder),
185
- _signal: T
187
+ placeholder: ke(q, l.valueType, n == null ? void 0 : n.placeholder),
188
+ _signal: v
186
189
  }
187
190
  };
188
191
  })) || [];
189
- }), K = s(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), $ = s(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
190
- formRef: b,
191
- submit: v,
192
- reset: I,
193
- tableProps: c,
194
- handleTableChange: G,
195
- data: h
196
- } = he({
192
+ }), Q = s(() => r(S).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => r(S).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), J = s(() => u(a.dataSource) ? g.value.records : a.dataSource), {
193
+ rowSelection: I,
194
+ selectedRows: k,
195
+ ...h
196
+ } = Oe({
197
+ ...a.rowSelection === !0 ? {} : a.rowSelection,
198
+ rowKey: a.rowKey,
199
+ dataSource: J
200
+ }), {
201
+ formRef: w,
202
+ submit: L,
203
+ reset: E,
204
+ tableProps: m,
205
+ handleTableChange: X,
206
+ data: g
207
+ } = Re({
197
208
  async request(e) {
198
- var a, r;
199
- const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
200
- return (r = o.onLoad) == null || r.call(o, (t == null ? void 0 : t.data) || []), {
209
+ var o, l;
210
+ !I.value.preserveSelectedRowKeys && u(a.dataSource) && h.clearAll();
211
+ const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
212
+ return (l = a.onLoad) == null || l.call(a, (t == null ? void 0 : t.data) || []), {
201
213
  data: (t == null ? void 0 : t.data) || [],
202
214
  total: (t == null ? void 0 : t.total) || 0
203
215
  };
204
216
  },
205
- filterFields: l($),
206
- sortFields: l(K),
207
- defaultParams: o.params,
208
- defaultData: o.defaultData,
209
- manual: o.manual,
210
- defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
211
- defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
212
- formatParams: o.beforeSearchSubmit
213
- }), Q = s(() => {
217
+ filterFields: r(U),
218
+ sortFields: r(Q),
219
+ defaultParams: a.params,
220
+ defaultData: a.defaultData,
221
+ manual: a.manual,
222
+ defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
223
+ defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
224
+ formatParams: a.beforeSearchSubmit
225
+ }), Y = s(() => {
214
226
  var e;
215
- return o.scroll ? o.scroll : o.adaptive && (h.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
216
- y: l(q),
227
+ return a.scroll ? a.scroll : a.adaptive && (g.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
228
+ y: r($),
217
229
  x: "100%"
218
230
  } : {
219
231
  x: !0
220
232
  };
221
- }), U = s(() => {
233
+ }), Z = s(() => {
222
234
  var e;
223
- if (o.tableLayout)
224
- return o.tableLayout;
225
- if ((e = o.columns) != null && e.some((t) => t.ellipsis))
235
+ if (a.tableLayout)
236
+ return a.tableLayout;
237
+ if ((e = a.columns) != null && e.some((t) => t.ellipsis))
226
238
  return "fixed";
227
- }), J = s(() => {
228
- const e = l(c), t = x(o.dataSource) ? e : {
239
+ }), ee = s(() => {
240
+ const e = r(m), t = u(a.dataSource) ? e : {
229
241
  ...e,
230
- dataSource: o.dataSource,
231
- onChange: o.onChange
232
- };
242
+ dataSource: a.dataSource,
243
+ onChange: a.onChange
244
+ }, o = r(I);
233
245
  return {
234
- ...o,
246
+ ...a,
235
247
  ...t,
236
- loading: x(o.loading) ? l(c).loading : o.loading,
237
- pagination: o.pagination === !1 ? !1 : l(c).pagination,
238
- scroll: l(Q)
248
+ rowSelection: a.rowSelection ? {
249
+ ...o,
250
+ // tips 如果是前端分页,则默认会走缓存
251
+ preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
252
+ } : void 0,
253
+ loading: u(a.loading) ? r(m).loading : a.loading,
254
+ pagination: a.pagination === !1 ? !1 : r(m).pagination,
255
+ scroll: r(Y)
239
256
  };
240
- }), X = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
241
- function Y(e, t, a) {
242
- return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(pe.Paragraph, {
257
+ }), ae = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
258
+ function oe(e, t, o) {
259
+ return N.includes(e.valueType) ? o : e.copyable || e.ellipsis ? d(ge.Paragraph, {
243
260
  copyable: e.copyable ? {
244
261
  text: t,
245
262
  tooltip: !1
246
263
  } : !1,
247
- ellipsis: e.ellipsis ? Ce(e.ellipsis) ? {
264
+ ellipsis: e.ellipsis ? Fe(e.ellipsis) ? {
248
265
  tooltip: t
249
266
  } : {
250
267
  ...e.ellipsis,
251
268
  tooltip: t
252
269
  } : !1,
253
- content: e.ellipsis ? ve(e, t) : a
254
- }, null) : a;
270
+ content: e.ellipsis ? Ee(e, t) : o
271
+ }, null) : o;
255
272
  }
256
- re(() => l(h).loading, (e) => {
273
+ de(() => r(g).loading, (e) => {
257
274
  var t;
258
- (t = o.onLoadingChange) == null || t.call(o, e);
275
+ (t = a.onLoadingChange) == null || t.call(a, e);
259
276
  });
260
- function Z(e) {
261
- var t, a, r;
262
- (r = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
277
+ function te(e) {
278
+ var t, o, l;
279
+ (l = (o = (t = w.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || l.call(o, e);
263
280
  }
264
- function ee() {
265
- var e, t, a;
266
- return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
281
+ function re() {
282
+ var e, t, o;
283
+ return (o = (t = (e = w.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : o.call(t, !0);
267
284
  }
268
- return _({
269
- submit: () => v(),
270
- reset: () => I(),
271
- setSearchFormValues: Z,
272
- getSearchFormValues: ee,
273
- dataSource: s(() => l(h).records)
274
- }), (e, t) => (i(), m("div", {
275
- class: F(X.value)
276
- }, [l(x)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (i(), m("div", {
285
+ return A({
286
+ submit: () => L(),
287
+ reset: () => E(),
288
+ setSearchFormValues: te,
289
+ getSearchFormValues: re,
290
+ dataSource: s(() => r(g).records),
291
+ rowSelection: {
292
+ selectedRows: s(() => r(k)),
293
+ ...h
294
+ }
295
+ }), (e, t) => (c(), y("div", {
296
+ class: F(ae.value)
297
+ }, [r(u)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (c(), y("div", {
277
298
  key: 0,
278
- class: F(e.card ? l(g)("search-wrapper") : null),
279
- style: R(e.searchFormWrapperStyle)
280
- }, [d(l(ge).SearchForm, f(e.searchForm || {}, {
299
+ class: F(e.card ? r(b)("search-wrapper") : null),
300
+ style: T(e.searchFormWrapperStyle)
301
+ }, [d(r(he).SearchForm, p(e.searchForm || {}, {
281
302
  ref_key: "formRef",
282
- ref: b,
303
+ ref: w,
283
304
  "custom-reset": "",
284
- onSubmit: l(v),
285
- onReset: l(I),
286
- "submit-loading": l(c).loading
287
- }), L({
288
- default: p(() => [(i(!0), m(le, null, E(P.value, (a) => (i(), ne(se(a.customRenderFormItem ? a.customRenderFormItem(a) : l(be)[a.valueType || "text"]), f({
289
- key: a.dataIndex,
305
+ onSubmit: r(L),
306
+ onReset: r(E),
307
+ "submit-loading": r(m).loading
308
+ }), V({
309
+ default: f(() => [(c(!0), y(ue, null, z(P.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) : r(Ce)[o.valueType || "text"]), p({
310
+ key: o.dataIndex,
290
311
  ref_for: !0
291
- }, a.fieldProps || {}, {
292
- span: a.span
312
+ }, o.fieldProps || {}, {
313
+ span: o.span
293
314
  }), null, 16, ["span"]))), 128))]),
294
315
  _: 2
295
316
  }, [B.searchFormExtra ? {
296
317
  name: "extra",
297
- fn: p(() => [w(e.$slots, "searchFormExtra")]),
318
+ fn: f(() => [x(e.$slots, "searchFormExtra")]),
298
319
  key: "0"
299
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), V("div", {
320
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : D("", !0), K("div", {
300
321
  ref_key: "contentRef",
301
- ref: H,
302
- class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
303
- style: R(e.tableWrapperStyle)
304
- }, [w(e.$slots, "title"), d(l(ce), f({
305
- class: l(M) === "admin" ? l(u)("table-admin") : l(u)("table")
306
- }, J.value, {
307
- "table-layout": U.value,
308
- onChange: l(G),
309
- columns: y.value
310
- }), L({
311
- headerCell: p(({
312
- column: a,
313
- title: r
314
- }) => [a.tooltip ? (i(), m("span", Ee, [V("span", null, de(r), 1), d(l(fe), {
315
- title: a.tooltip,
322
+ ref: G,
323
+ class: F([r(b)("table-wrapper"), e.card ? r(b)("table-wrapper-card") : null]),
324
+ style: T(e.tableWrapperStyle)
325
+ }, [x(e.$slots, "title", p({
326
+ selectedRows: r(k)
327
+ }, h)), d(r(ye), p({
328
+ class: r(H) === "admin" ? r(i)("table-admin") : r(i)("table")
329
+ }, ee.value, {
330
+ "table-layout": Z.value,
331
+ onChange: r(X),
332
+ columns: S.value
333
+ }), V({
334
+ headerCell: f(({
335
+ column: o,
336
+ title: l
337
+ }) => [o.tooltip ? (c(), y("span", Ke, [K("span", null, ce(l), 1), d(r(be), {
338
+ title: o.tooltip,
316
339
  placement: "bottom"
317
340
  }, {
318
- default: p(() => [d(l(Se), {
319
- style: R({
341
+ default: f(() => [d(r(Te), {
342
+ style: T({
320
343
  paddingLeft: "4px",
321
- color: l(j).colorPrimary
344
+ color: r(M).colorPrimary
322
345
  })
323
346
  }, null, 8, ["style"])]),
324
347
  _: 2
325
- }, 1032, ["title"])])) : O("", !0)]),
348
+ }, 1032, ["title"])])) : D("", !0)]),
326
349
  _: 2
327
- }, [E(l(N)(B, ["title", "searchFormExtra"]), (a, r) => ({
328
- name: r,
329
- fn: p((n) => [w(e.$slots, r, ue(ie(n || {})))])
350
+ }, [z(r(W)(B, ["title", "searchFormExtra"]), (o, l) => ({
351
+ name: l,
352
+ fn: f((n) => [x(e.$slots, l, fe(me(n || {})))])
330
353
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
331
354
  }
332
355
  });
333
356
  export {
334
- Ue as default
357
+ aa as default
335
358
  };
@@ -79,4 +79,5 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
79
79
  onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
80
80
  dataSource: DataType[];
81
81
  }>;
82
+ dataSource: ComputedRef<DataType[]>;
82
83
  };
@@ -1,4 +1,4 @@
1
- import { ref as v, nextTick as N, unref as r, onMounted as U, computed as $ } from "vue";
1
+ import { ref as v, nextTick as N, unref as o, onMounted as U, computed as S } from "vue";
2
2
  import { parseFieldValue as W, dataIndexToStr as X } from "../utils.mjs";
3
3
  import { isArray as Y } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
@@ -6,23 +6,23 @@ import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
6
6
  const oe = ({
7
7
  manual: j = !1,
8
8
  defaultCurrent: y = 1,
9
- defaultPageSize: S = 10,
9
+ defaultPageSize: T = 10,
10
10
  request: D,
11
11
  defaultParams: R = {},
12
12
  defaultData: A = [],
13
- formatParams: T,
14
- paramsValueTypeMap: z,
15
- resetFieldsIgnores: P,
13
+ formatParams: z,
14
+ paramsValueTypeMap: P,
15
+ resetFieldsIgnores: V,
16
16
  filterFields: B = [],
17
17
  sortFields: E = []
18
18
  }) => {
19
19
  let F = 0, f = {};
20
- const L = (e) => T ? T(e) : e, l = v(), i = v(y), g = v(S), { t: V } = Z(), n = v({
20
+ const L = (e) => z ? z(e) : e, l = v(), i = v(y), g = v(T), { t: b } = Z(), n = v({
21
21
  total: 0,
22
22
  records: A,
23
23
  loading: !1
24
- }), b = async (e) => {
25
- var o;
24
+ }), w = async (e) => {
25
+ var r;
26
26
  const a = L(e), t = Date.now();
27
27
  F = t, n.value.loading = !0;
28
28
  try {
@@ -30,57 +30,57 @@ const oe = ({
30
30
  ...R,
31
31
  ...a
32
32
  });
33
- F === t && (n.value.total = s.total || ((o = s.data) == null ? void 0 : o.length) || 0, n.value.records = [...s.data || []]);
33
+ F === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
34
34
  } catch {
35
35
  F === t && (n.value.records = [], n.value.total = 0);
36
36
  } finally {
37
37
  n.value.loading = !1;
38
38
  }
39
- }, w = (e) => {
39
+ }, C = (e) => {
40
40
  const a = {};
41
- return Object.entries(e).forEach(([t, o]) => {
42
- if (a[t] = o, z && o) {
43
- const s = z[t];
44
- s && (a[t] = W(s, o));
41
+ return Object.entries(e).forEach(([t, r]) => {
42
+ if (a[t] = r, P && r) {
43
+ const s = P[t];
44
+ s && (a[t] = W(s, r));
45
45
  }
46
46
  }), a;
47
47
  }, M = (e) => {
48
- var o, s, d, p, m, u, c;
49
- const a = ((s = (o = l.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
- Object.entries(a).forEach(([O, K]) => {
51
- P && P.indexOf(O) > -1 && (t[O] = K);
48
+ var r, s, d, p, m, u, c;
49
+ const a = ((s = (r = l.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
+ Object.entries(a).forEach(([$, K]) => {
51
+ V && V.indexOf($) > -1 && (t[$] = K);
52
52
  }), (p = (d = l.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), N(() => {
53
53
  e == null || e();
54
54
  });
55
55
  }, h = (e) => {
56
56
  f = e;
57
- const a = w(e);
58
- b(a);
57
+ const a = C(e);
58
+ w(a);
59
59
  }, q = (e) => {
60
60
  h({
61
61
  ...f,
62
62
  ...e
63
63
  });
64
- }, C = () => {
64
+ }, x = () => {
65
65
  var a, t;
66
66
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
67
67
  i.value = 1, h({
68
68
  ...e,
69
69
  current: 1,
70
- pageSize: f.pageSize || S
70
+ pageSize: f.pageSize || T
71
71
  });
72
72
  }, J = () => {
73
- M(C);
73
+ M(x);
74
74
  }, Q = () => {
75
75
  h(f);
76
76
  }, G = (e) => {
77
- const a = r(n).total - e, t = Math.ceil(a / r(g)), o = r(i) > t ? t : r(i);
77
+ const a = o(n).total - e, t = Math.ceil(a / o(g)), r = o(i) > t ? t : o(i);
78
78
  q({
79
- current: o > 0 ? o : 1
79
+ current: r > 0 ? r : 1
80
80
  });
81
- }, x = (e, a, t) => {
81
+ }, O = (e, a, t) => {
82
82
  var m, u;
83
- const o = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
83
+ const r = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
84
84
  i.value = e.current, g.value = e.pageSize;
85
85
  const s = Y(t) ? [...t] : [t], d = {};
86
86
  for (const c of s)
@@ -89,7 +89,7 @@ const oe = ({
89
89
  for (const c of Object.keys(a))
90
90
  B.includes(c) && (p[c] = a[c]);
91
91
  h({
92
- ...o,
92
+ ...r,
93
93
  filter: p,
94
94
  sort: d,
95
95
  current: e.current,
@@ -100,43 +100,44 @@ const oe = ({
100
100
  var a, t;
101
101
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
102
102
  if (f = {
103
- current: r(i),
104
- pageSize: r(g),
103
+ current: o(i),
104
+ pageSize: o(g),
105
105
  ...e
106
106
  }, !j) {
107
- const o = w(f);
108
- b(o);
107
+ const r = C(f);
108
+ w(r);
109
109
  }
110
110
  });
111
- const H = $(() => r(n).total === 0 ? "-" : `${r(i.value)}/${Math.ceil(
112
- r(n).total / r(g)
113
- )}`), I = $(() => ({
114
- loading: r(n).loading,
111
+ const H = S(() => o(n).total === 0 ? "-" : `${o(i.value)}/${Math.ceil(
112
+ o(n).total / o(g)
113
+ )}`), I = S(() => ({
114
+ loading: o(n).loading,
115
115
  pagination: {
116
- current: r(i),
117
- pageSize: r(g),
118
- total: r(n).total,
116
+ current: o(i),
117
+ pageSize: o(g),
118
+ total: o(n).total,
119
119
  showSizeChanger: !0,
120
120
  showQuickJumper: !0,
121
- showTotal: (e) => `${V("ap.apTable.pagination.totalLeft", { total: e })} ${V(
121
+ showTotal: (e) => `${b("ap.apTable.pagination.totalLeft", { total: e })} ${b(
122
122
  "ap.apTable.pagination.totalRight",
123
- { page: r(H) }
123
+ { page: o(H) }
124
124
  )}`
125
125
  },
126
- onChange: x,
127
- dataSource: r(n).records
126
+ onChange: O,
127
+ dataSource: o(n).records
128
128
  }));
129
129
  return {
130
130
  formRef: l,
131
- submit: C,
131
+ submit: x,
132
132
  reset: J,
133
133
  refresh: Q,
134
134
  refreshByDelete: G,
135
135
  data: n,
136
136
  current: i,
137
137
  pageSize: g,
138
- handleTableChange: x,
139
- tableProps: I
138
+ handleTableChange: O,
139
+ tableProps: I,
140
+ dataSource: S(() => o(n).records)
140
141
  };
141
142
  };
142
143
  export {