@aplus-frontend/ui 0.1.15 → 0.1.17

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 (117) hide show
  1. package/es/index.mjs +99 -95
  2. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +26 -24
  3. package/es/src/ap-modal/index.d.ts +2 -2
  4. package/es/src/ap-modal/index.mjs +1 -1
  5. package/es/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  6. package/es/src/ap-modal/utils/createModal.d.ts +1 -1
  7. package/es/src/ap-table/ap-table.vue.mjs +132 -129
  8. package/es/src/ap-table/interface.d.ts +19 -13
  9. package/es/src/ap-table/utils.d.ts +8340 -1
  10. package/es/src/ap-table/utils.mjs +134 -78
  11. package/es/src/business/ap-batch-action/index.css +2 -0
  12. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  13. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.mjs +4 -0
  14. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +110 -0
  15. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  16. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.mjs +4 -0
  17. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +50 -0
  18. package/es/src/business/ap-batch-action-group/interface.d.ts +41 -0
  19. package/es/src/business/ap-batch-action-group/interface.mjs +1 -0
  20. package/es/src/business/ap-image/ApImage.vue.d.ts +65 -0
  21. package/es/src/business/ap-image/ApImage.vue.mjs +4 -0
  22. package/es/src/business/ap-image/ApImage.vue2.mjs +56 -0
  23. package/es/src/business/ap-image/hooks/useOss.d.ts +11 -0
  24. package/es/src/business/ap-image/hooks/useOss.mjs +37 -0
  25. package/es/src/business/ap-image/imgs/admin-fallback.jpg.mjs +4 -0
  26. package/es/src/business/ap-image/imgs/aplus-fallback.jpg.mjs +4 -0
  27. package/es/src/business/index.d.ts +662 -1
  28. package/es/src/business/index.mjs +25 -16
  29. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  30. package/es/src/config-provider/config-provider-props.mjs +4 -0
  31. package/es/src/config-provider/config-provider.d.ts +10 -1
  32. package/es/src/config-provider/config-provider.mjs +18 -17
  33. package/es/src/config-provider/constants.d.ts +6 -2
  34. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  35. package/es/src/config-provider/index.d.ts +20 -1
  36. package/es/src/editable-table/form-item.vue.mjs +85 -71
  37. package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  38. package/es/src/editable-table/hooks/use-get-columns.mjs +32 -32
  39. package/es/src/editable-table/index.vue.mjs +106 -92
  40. package/es/src/editable-table/interface.d.ts +7 -13
  41. package/es/src/editable-table/utils.d.ts +14 -2
  42. package/es/src/editable-table/utils.mjs +67 -57
  43. package/es/src/index.mjs +211 -207
  44. package/es/src/locale/lang/en.mjs +10 -7
  45. package/es/src/locale/lang/zh-cn.mjs +3 -0
  46. package/es/src/pro-form/hooks/use-label-width.d.ts +1 -1
  47. package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
  48. package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
  49. package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  50. package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
  51. package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  52. package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  53. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  54. package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  55. package/es/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  56. package/es/src/utils/ap-trans-data/index.d.ts +9 -10
  57. package/es/src/utils/ap-trans-data/index.mjs +20 -0
  58. package/lib/index.js +1 -1
  59. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  60. package/lib/src/ap-modal/index.d.ts +2 -2
  61. package/lib/src/ap-modal/index.js +1 -1
  62. package/lib/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  63. package/lib/src/ap-modal/utils/createModal.d.ts +1 -1
  64. package/lib/src/ap-table/ap-table.vue.js +1 -1
  65. package/lib/src/ap-table/interface.d.ts +19 -13
  66. package/lib/src/ap-table/utils.d.ts +8340 -1
  67. package/lib/src/ap-table/utils.js +1 -1
  68. package/lib/src/business/ap-batch-action/index.css +2 -0
  69. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  70. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.js +1 -0
  71. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -0
  72. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  73. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.js +1 -0
  74. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -0
  75. package/lib/src/business/ap-batch-action-group/interface.d.ts +41 -0
  76. package/lib/src/business/ap-batch-action-group/interface.js +1 -0
  77. package/lib/src/business/ap-image/ApImage.vue.d.ts +65 -0
  78. package/lib/src/business/ap-image/ApImage.vue.js +1 -0
  79. package/lib/src/business/ap-image/ApImage.vue2.js +1 -0
  80. package/lib/src/business/ap-image/hooks/useOss.d.ts +11 -0
  81. package/lib/src/business/ap-image/hooks/useOss.js +1 -0
  82. package/lib/src/business/ap-image/imgs/admin-fallback.jpg.js +1 -0
  83. package/lib/src/business/ap-image/imgs/aplus-fallback.jpg.js +1 -0
  84. package/lib/src/business/index.d.ts +662 -1
  85. package/lib/src/business/index.js +1 -1
  86. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  87. package/lib/src/config-provider/config-provider-props.js +1 -1
  88. package/lib/src/config-provider/config-provider.d.ts +10 -1
  89. package/lib/src/config-provider/config-provider.js +1 -1
  90. package/lib/src/config-provider/constants.d.ts +6 -2
  91. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  92. package/lib/src/config-provider/index.d.ts +20 -1
  93. package/lib/src/editable-table/form-item.vue.js +1 -1
  94. package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  95. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  96. package/lib/src/editable-table/index.vue.js +1 -1
  97. package/lib/src/editable-table/interface.d.ts +7 -13
  98. package/lib/src/editable-table/utils.d.ts +14 -2
  99. package/lib/src/editable-table/utils.js +1 -1
  100. package/lib/src/index.js +1 -1
  101. package/lib/src/locale/lang/en.js +1 -1
  102. package/lib/src/locale/lang/zh-cn.js +1 -1
  103. package/lib/src/pro-form/hooks/use-label-width.d.ts +1 -1
  104. package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
  105. package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
  106. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  107. package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
  108. package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  109. package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  110. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  111. package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  112. package/lib/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  113. package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
  114. package/lib/src/utils/ap-trans-data/index.js +1 -0
  115. package/package.json +2 -2
  116. /package/es/src/ap-modal/{type.mjs → interface.mjs} +0 -0
  117. /package/lib/src/ap-modal/{type.js → interface.js} +0 -0
@@ -1,22 +1,23 @@
1
- import { defineComponent as ie, useSlots as ce, computed as s, createVNode as d, Fragment as z, mergeProps as i, unref as l, watch as pe, openBlock as c, createElementBlock as S, normalizeClass as F, normalizeStyle as x, createSlots as D, withCtx as p, renderList as j, createBlock as fe, resolveDynamicComponent as me, renderSlot as B, createCommentVNode as W, createElementVNode as _, toDisplayString as ye, normalizeProps as ge, guardReactiveProps as Se } from "vue";
2
- import { Typography as be, Table as he, Tooltip as we } from "ant-design-vue";
1
+ import { defineComponent as ce, useSlots as pe, computed as d, unref as l, createVNode as u, Fragment as D, watch as fe, openBlock as c, createElementBlock as y, normalizeClass as x, normalizeStyle as F, mergeProps as S, createSlots as j, withCtx as p, renderList as W, createBlock as me, resolveDynamicComponent as ge, renderSlot as v, createCommentVNode as _, createElementVNode as A, toDisplayString as ye, normalizeProps as Se, guardReactiveProps as be } from "vue";
2
+ import { Typography as he, Table as we, Tooltip as Ce } from "ant-design-vue";
3
3
  import { useToken as Re } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as Ce } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as Te, noRenderAsFormItemValueList as A, apTableFormItemMap as Fe } from "./constants.mjs";
4
+ import { ApForm as Te } from "../ap-form/index.mjs";
5
+ import { noRenderAsFormItemValueList as q } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as xe } from "./hooks/use-table-paging.mjs";
8
- import { omit as q, isUndefined as u, isBoolean as Be } from "lodash-unified";
8
+ import { omit as H, isUndefined as i, isBoolean as Fe } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
10
  import { QuestionCircleOutlined as ve } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as Pe, getTableRenderType as Ie, getTableRenderProps as ke, getColumnOrder as H, updateFormProps as Le, getFieldProps as Ee, getPlaceholder as Oe } from "./utils.mjs";
11
+ import { apColumnToColumn as Be, getTableRenderType as Pe, getTableRenderProps as ke, getTableCellRenderNode as Ie, getColumnOrder as $, updateFormProps as Ne, getFieldProps as Le, getPlaceholder as Ee, getSearchFormItemRenderNode as Oe, objectToString as Ve } from "./utils.mjs";
12
12
  import Ke from "./hooks/use-table-content-height.mjs";
13
- import { getRawDisplayValue as Ne } from "../editable-table/utils.mjs";
14
- import Ve from "./hooks/use-table-row-selection.mjs";
15
- import { useLocale as ze } from "../config-provider/hooks/use-locale.mjs";
16
- import { useNamespace as De } from "../config-provider/hooks/use-namespace.mjs";
17
- const je = {
13
+ import { getRawDisplayValue as ze } from "../editable-table/utils.mjs";
14
+ import De from "./hooks/use-table-row-selection.mjs";
15
+ import { useLocale as je } from "../config-provider/hooks/use-locale.mjs";
16
+ import { useNamespace as We } from "../config-provider/hooks/use-namespace.mjs";
17
+ import { useGlobalConfig as _e } from "../config-provider/hooks/use-global-config.mjs";
18
+ const Ae = {
18
19
  key: 0
19
- }, oa = /* @__PURE__ */ ie({
20
+ }, na = /* @__PURE__ */ ce({
20
21
  name: "ApTable",
21
22
  __name: "ap-table",
22
23
  props: {
@@ -132,192 +133,194 @@ const je = {
132
133
  default: !1
133
134
  }
134
135
  },
135
- setup($, {
136
+ setup(G, {
136
137
  expose: M
137
138
  }) {
138
- const o = $;
139
- let v = 0;
140
- const P = ce(), [, Q] = Re(), {
139
+ const o = G;
140
+ let B = 0;
141
+ const P = pe(), [, Q] = Re(), {
141
142
  t: U
142
- } = ze(), {
143
+ } = je(), {
143
144
  e: b,
144
145
  b: f
145
- } = De("ap-table"), {
146
- height: G,
147
- contentRef: J
148
- } = Ke(), h = s(() => {
149
- var t;
150
- let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
146
+ } = We("ap-table"), k = _e("valueTypeMap"), {
147
+ height: J,
148
+ contentRef: X
149
+ } = Ke(), h = d(() => {
150
+ var r;
151
+ let e = ((r = o.columns) == null ? void 0 : r.filter((a) => !a.hideInTable)) || [];
151
152
  return e = e.map((a) => ({
152
- ...q(Pe(a), ["ellipsis"]),
153
+ ...H(Be(a), ["ellipsis"]),
153
154
  customRender({
154
- value: r,
155
+ value: t,
155
156
  ...n
156
157
  }) {
157
- var N, V;
158
- const g = Ie(a), O = Te[g], de = ke({
158
+ var K, z;
159
+ const s = Pe(a), O = ke({
159
160
  ...a,
160
- valueType: g
161
+ valueType: s
161
162
  }, {
162
- value: r,
163
+ value: t,
163
164
  ...n
164
- }), K = ((N = a.renderText) == null ? void 0 : N.call(a, {
165
- value: r,
165
+ }), ue = Ie(s, O, n.record, l(k)), V = ((K = a.renderText) == null ? void 0 : K.call(a, {
166
+ value: t,
166
167
  ...n
167
- })) || r, ue = a.renderText ? d(z, null, [(V = a.renderText) == null ? void 0 : V.call(a, {
168
- value: r,
168
+ })) || t, ie = a.renderText ? u(D, null, [(z = a.renderText) == null ? void 0 : z.call(a, {
169
+ value: t,
169
170
  ...n
170
- })]) : d(O, i(de, {
171
- mode: "read"
172
- }), null);
173
- let T = le(a, K, ue);
171
+ })]) : ue;
172
+ let T = ne(a, V, ie);
174
173
  return a.customRender && (T = a.customRender({
175
- value: r,
174
+ value: t,
176
175
  ...n,
177
176
  column: a,
178
177
  originalNode: T,
179
- originalText: K
178
+ originalText: V
180
179
  })), T;
181
180
  }
182
181
  })), e;
183
- }), I = s(() => {
184
- var e, t, a;
185
- return v++, ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !A.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
186
- let g = H(r.order);
187
- return H(n.order) - g;
188
- })) == null ? void 0 : a.map((r) => {
189
- const n = Le(r, Ee(r.fieldProps, {}));
190
- return {
191
- ...r,
182
+ }), I = d(() => {
183
+ var e, r, a;
184
+ return B++, ((a = (r = (e = o.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !q.includes(t.valueType))) == null ? void 0 : r.sort((t, n) => {
185
+ let s = $(t.order);
186
+ return $(n.order) - s;
187
+ })) == null ? void 0 : a.map((t) => {
188
+ const n = Ne(t, Le(t.fieldProps, {})), s = {
189
+ ...t,
192
190
  fieldProps: {
193
- label: r.title,
194
- name: r.dataIndex,
191
+ label: t.title,
192
+ name: t.dataIndex,
195
193
  ...n || {},
196
194
  // 格式化placeholder
197
- placeholder: Oe(U, r.valueType, n == null ? void 0 : n.placeholder),
198
- _signal: v
199
- }
195
+ placeholder: Ee(U, t.valueType, n == null ? void 0 : n.placeholder),
196
+ _signal: B
197
+ },
198
+ renderNode: void 0
200
199
  };
200
+ return s.renderNode = Oe(s, l(k)), s;
201
201
  })) || [];
202
- }), X = s(() => l(h).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), Y = s(() => l(h).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), Z = s(() => u(o.dataSource) ? y.value.records : o.dataSource), {
202
+ }), Y = d(() => l(h).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), Z = d(() => l(h).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ee = d(() => i(o.dataSource) ? g.value.records : o.dataSource), {
203
203
  rowSelection: w,
204
- selectedRows: k,
205
- ...R
206
- } = Ve({
204
+ selectedRows: N,
205
+ ...C
206
+ } = De({
207
207
  ...o.rowSelection === !0 ? {} : o.rowSelection,
208
208
  rowKey: o.rowKey,
209
- dataSource: Z
209
+ dataSource: ee
210
210
  }), {
211
- formRef: C,
211
+ formRef: R,
212
212
  submit: L,
213
213
  reset: E,
214
214
  tableProps: m,
215
- handleTableChange: ee,
216
- data: y
215
+ handleTableChange: ae,
216
+ data: g
217
217
  } = xe({
218
218
  async request(e) {
219
- var a, r;
220
- !w.value.preserveSelectedRowKeys && u(o.dataSource) && R.clearAll();
221
- const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
222
- return (r = o.onLoad) == null || r.call(o, (t == null ? void 0 : t.data) || []), {
223
- data: (t == null ? void 0 : t.data) || [],
224
- total: (t == null ? void 0 : t.total) || 0
219
+ var a, t;
220
+ !w.value.preserveSelectedRowKeys && i(o.dataSource) && C.clearAll();
221
+ const r = await ((a = o.request) == null ? void 0 : a.call(o, e));
222
+ return (t = o.onLoad) == null || t.call(o, (r == null ? void 0 : r.data) || []), {
223
+ data: (r == null ? void 0 : r.data) || [],
224
+ total: (r == null ? void 0 : r.total) || 0
225
225
  };
226
226
  },
227
- filterFields: Y,
228
- sortFields: X,
227
+ filterFields: Z,
228
+ sortFields: Y,
229
229
  defaultParams: o.params,
230
230
  defaultData: o.defaultData,
231
231
  manual: o.manual,
232
232
  defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
233
233
  defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
234
234
  formatParams: o.beforeSearchSubmit
235
- }), ae = s(() => {
235
+ }), oe = d(() => {
236
236
  var e;
237
- return o.scroll ? o.scroll : o.adaptive && (y.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
238
- y: l(G),
237
+ return o.scroll ? o.scroll : o.adaptive && (g.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
238
+ y: l(J),
239
239
  x: "100%"
240
240
  } : {
241
241
  x: !0
242
242
  };
243
- }), oe = s(() => {
243
+ }), te = d(() => {
244
244
  var e;
245
245
  if (o.tableLayout)
246
246
  return o.tableLayout;
247
- if ((e = o.columns) != null && e.some((t) => t.ellipsis))
247
+ if ((e = o.columns) != null && e.some((r) => r.ellipsis))
248
248
  return "fixed";
249
- }), te = s(() => {
250
- var r;
251
- const e = l(m), t = u(o.dataSource) ? e : {
249
+ }), re = d(() => {
250
+ var t;
251
+ const e = l(m), r = i(o.dataSource) ? e : {
252
252
  ...e,
253
253
  dataSource: o.dataSource,
254
254
  onChange: o.onChange
255
255
  }, a = l(w);
256
256
  return {
257
257
  ...o,
258
- ...t,
259
- rowSelection: o.rowSelection === !0 || ((r = o.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
258
+ ...r,
259
+ rowSelection: o.rowSelection === !0 || ((t = o.rowSelection) == null ? void 0 : t.mode) === "internal" ? {
260
260
  ...a,
261
261
  // tips 如果是前端分页,则默认会走缓存
262
- preserveSelectedRowKeys: u(o.dataSource) ? a.preserveSelectedRowKeys : !0
262
+ preserveSelectedRowKeys: i(o.dataSource) ? a.preserveSelectedRowKeys : !0
263
263
  } : o.rowSelection,
264
- loading: u(o.loading) ? l(m).loading : o.loading,
264
+ loading: i(o.loading) ? l(m).loading : o.loading,
265
265
  pagination: o.pagination === !1 ? !1 : l(m).pagination,
266
- scroll: l(ae)
266
+ scroll: l(oe)
267
267
  };
268
- }), re = s(() => [f(), o.card ? null : f("wrapper"), o.adaptive ? f("adaptive") : null].filter(Boolean));
269
- function le(e, t, a) {
270
- return A.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(be.Paragraph, {
268
+ }), le = d(() => [f(), o.card ? null : f("wrapper"), o.adaptive ? f("adaptive") : null].filter(Boolean));
269
+ function ne(e, r, a) {
270
+ if (q.includes(e.valueType))
271
+ return a;
272
+ const t = Ve(r);
273
+ return e.copyable || e.ellipsis ? u(he.Paragraph, {
271
274
  copyable: e.copyable ? {
272
275
  text: t,
273
276
  tooltip: !1
274
277
  } : !1,
275
- ellipsis: e.ellipsis ? Be(e.ellipsis) ? {
278
+ ellipsis: e.ellipsis ? Fe(e.ellipsis) ? {
276
279
  tooltip: t
277
280
  } : {
278
281
  ...e.ellipsis,
279
282
  tooltip: t
280
283
  } : !1,
281
- content: e.ellipsis ? Ne(e, t) : a
284
+ content: e.ellipsis ? ze(e, r) : a
282
285
  }, null) : a;
283
286
  }
284
- pe(() => l(y).loading, (e) => {
285
- var t;
286
- (t = o.onLoadingChange) == null || t.call(o, e);
287
+ fe(() => l(g).loading, (e) => {
288
+ var r;
289
+ (r = o.onLoadingChange) == null || r.call(o, e);
287
290
  });
288
- function ne(e) {
289
- var t, a, r;
290
- (r = (a = (t = C.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
291
+ function de(e) {
292
+ var r, a, t;
293
+ (t = (a = (r = R.value) == null ? void 0 : r.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
291
294
  }
292
295
  function se() {
293
- var e, t, a;
294
- return (a = (t = (e = C.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
296
+ var e, r, a;
297
+ return (a = (r = (e = R.value) == null ? void 0 : e.apForm) == null ? void 0 : r.getFieldsValue) == null ? void 0 : a.call(r, !0);
295
298
  }
296
299
  return M({
297
300
  submit: () => L(),
298
301
  reset: () => E(),
299
- setSearchFormValues: ne,
302
+ setSearchFormValues: de,
300
303
  getSearchFormValues: se,
301
- dataSource: s(() => l(y).records),
304
+ dataSource: d(() => l(g).records),
302
305
  rowSelection: {
303
- selectedRows: s(() => l(k)),
304
- ...R
306
+ selectedRows: d(() => l(N)),
307
+ ...C
305
308
  }
306
- }), (e, t) => (c(), S("div", {
307
- class: F(re.value)
308
- }, [l(u)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (c(), S("div", {
309
+ }), (e, r) => (c(), y("div", {
310
+ class: x(le.value)
311
+ }, [l(i)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (c(), y("div", {
309
312
  key: 0,
310
- class: F(e.card ? l(b)("search-wrapper") : null),
311
- style: x(e.searchFormWrapperStyle)
312
- }, [d(l(Ce).SearchForm, i(e.searchForm || {}, {
313
+ class: x(e.card ? l(b)("search-wrapper") : null),
314
+ style: F(e.searchFormWrapperStyle)
315
+ }, [u(l(Te).SearchForm, S(e.searchForm || {}, {
313
316
  ref_key: "formRef",
314
- ref: C,
317
+ ref: R,
315
318
  "custom-reset": "",
316
319
  onSubmit: l(L),
317
320
  onReset: l(E),
318
321
  "submit-loading": l(m).loading
319
- }), D({
320
- default: p(() => [(c(!0), S(z, null, j(I.value, (a) => (c(), fe(me(a.customRenderFormItem ? a.customRenderFormItem(a) : l(Fe)[a.valueType || "text"]), i({
322
+ }), j({
323
+ default: p(() => [(c(!0), y(D, null, W(I.value, (a) => (c(), me(ge(a.renderNode), S({
321
324
  key: a.dataIndex,
322
325
  ref_for: !0
323
326
  }, a.fieldProps || {}, {
@@ -326,45 +329,45 @@ const je = {
326
329
  _: 2
327
330
  }, [P.searchFormExtra ? {
328
331
  name: "extra",
329
- fn: p(() => [B(e.$slots, "searchFormExtra")]),
332
+ fn: p(() => [v(e.$slots, "searchFormExtra")]),
330
333
  key: "0"
331
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : W("", !0), _("div", {
334
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : _("", !0), A("div", {
332
335
  ref_key: "contentRef",
333
- ref: J,
334
- class: F([l(b)("table-wrapper"), e.card ? l(b)("table-wrapper-card") : null]),
335
- style: x(e.tableWrapperStyle)
336
- }, [B(e.$slots, "title", i({
337
- selectedRows: l(k),
336
+ ref: X,
337
+ class: x([l(b)("table-wrapper"), e.card ? l(b)("table-wrapper-card") : null]),
338
+ style: F(e.tableWrapperStyle)
339
+ }, [v(e.$slots, "title", S({
340
+ selectedRows: l(N),
338
341
  selectedRowKeys: l(w).selectedRowKeys
339
- }, R)), d(l(he), i({
342
+ }, C)), u(l(we), S({
340
343
  class: l(f)("table")
341
- }, te.value, {
342
- "table-layout": oe.value,
343
- onChange: l(ee),
344
+ }, re.value, {
345
+ "table-layout": te.value,
346
+ onChange: l(ae),
344
347
  columns: h.value
345
- }), D({
348
+ }), j({
346
349
  headerCell: p(({
347
350
  column: a,
348
- title: r
349
- }) => [a.tooltip ? (c(), S("span", je, [_("span", null, ye(r), 1), d(l(we), {
351
+ title: t
352
+ }) => [a.tooltip ? (c(), y("span", Ae, [A("span", null, ye(t), 1), u(l(Ce), {
350
353
  title: a.tooltip,
351
354
  placement: "bottom"
352
355
  }, {
353
- default: p(() => [d(l(ve), {
354
- style: x({
356
+ default: p(() => [u(l(ve), {
357
+ style: F({
355
358
  paddingLeft: "4px",
356
359
  color: l(Q).colorPrimary
357
360
  })
358
361
  }, null, 8, ["style"])]),
359
362
  _: 2
360
- }, 1032, ["title"])])) : W("", !0)]),
363
+ }, 1032, ["title"])])) : _("", !0)]),
361
364
  _: 2
362
- }, [j(l(q)(P, ["title", "searchFormExtra"]), (a, r) => ({
363
- name: r,
364
- fn: p((n) => [B(e.$slots, r, ge(Se(n || {})))])
365
+ }, [W(l(H)(P, ["title", "searchFormExtra"]), (a, t) => ({
366
+ name: t,
367
+ fn: p((n) => [v(e.$slots, t, Se(be(n || {})))])
365
368
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
366
369
  }
367
370
  });
368
371
  export {
369
- oa as default
372
+ na as default
370
373
  };
@@ -1,6 +1,6 @@
1
1
  import { ColumnType, TableProps } from 'ant-design-vue/es/table';
2
2
  import { CompareFn, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
3
- import { ApFormSearchFormProps } from '../ap-form';
3
+ import { ApFormItemProps, ApFormSearchFormProps } from '../ap-form';
4
4
  import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps } from '../ap-form/items/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { ComputedRef, CSSProperties, VNode } from 'vue';
@@ -67,8 +67,21 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' |
67
67
  export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'> & {
68
68
  mode: 'internal';
69
69
  };
70
- export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? ExtraProColumnType<RecordType> & {
71
- children?: ApColumnType<RecordType, ValueType>[];
70
+ export type CommonFieldReturnType = ApFormItemProps & {
71
+ field: Recordable;
72
+ placeholder?: string;
73
+ disabled?: boolean;
74
+ };
75
+ export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
76
+ value: any;
77
+ text: any;
78
+ record: RecordType;
79
+ index: number;
80
+ renderIndex: number;
81
+ column: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>;
82
+ }>) => ReturnType);
83
+ export type ApColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? ExtraProColumnType<RecordType> & {
84
+ children?: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
72
85
  /**
73
86
  * 表单项所占据的格子数(1-24格)
74
87
  */
@@ -100,7 +113,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
100
113
  /**
101
114
  * 自定义查询表单渲染
102
115
  */
103
- customRenderFormItem?: (config: ApColumnType<RecordType, ValueType>) => any;
116
+ customRenderFormItem?: (config: ApColumnType<RecordType>) => any;
104
117
  /**
105
118
  * 自定义渲染文本,和customRender相比,其必须返回字符串,并且后续的渲染(例如copy/ellipsis)都将使用这个值
106
119
  */
@@ -115,18 +128,11 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
115
128
  /**
116
129
  * 指定值类型(将会用于默认渲染和查询表单生成)
117
130
  */
118
- valueType?: ValueType;
131
+ valueType?: MergedValueType;
119
132
  /**
120
133
  * 值类型额外配置的参数(用于查询表单渲染)
121
134
  */
122
- fieldProps?: ApTableValueFields[ValueType] | ((opt: Partial<{
123
- value: any;
124
- text: any;
125
- record: RecordType;
126
- index: number;
127
- renderIndex: number;
128
- column: ApColumnType<RecordType, ValueType>;
129
- }>) => ApTableValueFields[ValueType]);
135
+ fieldProps?: FieldPropsType<Extract<MergedValueType, ValueType> extends never ? CommonFieldReturnType : ApTableValueFields[Extract<MergedValueType, ValueType>], RecordType, ExtraValueType, ValueType, MergedValueType>;
130
136
  /**
131
137
  * 用于表单项排序的字段
132
138
  * @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效