@aplus-frontend/ui 0.5.29 → 0.5.31

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 (57) hide show
  1. package/es/index.mjs +50 -48
  2. package/es/src/ap-field/interface.d.ts +3 -0
  3. package/es/src/ap-grid/editable/form-item.vue.mjs +45 -36
  4. package/es/src/ap-grid/editable/index.vue.mjs +21 -12
  5. package/es/src/ap-grid/index.vue.mjs +106 -102
  6. package/es/src/ap-grid/interface.d.ts +5 -0
  7. package/es/src/ap-grid/utils/col.mjs +88 -77
  8. package/es/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
  9. package/es/src/business/ap-product-info/ApProductInfo.mjs +59 -0
  10. package/es/src/business/ap-product-info/constans.d.ts +11 -14
  11. package/es/src/business/ap-product-info/constans.mjs +21 -0
  12. package/es/src/business/ap-product-info/index.d.ts +86 -0
  13. package/es/src/business/ap-product-info/index.mjs +7 -0
  14. package/es/src/business/ap-product-info/interface.d.ts +9 -7
  15. package/es/src/business/ap-product-info/interface.mjs +1 -0
  16. package/es/src/business/ap-product-info/style/css.d.ts +0 -0
  17. package/es/src/business/ap-product-info/style/css.js +1 -0
  18. package/es/src/business/ap-product-info/style/index.d.ts +0 -0
  19. package/es/src/business/ap-product-info/style/index.js +1 -0
  20. package/es/src/business/index.d.ts +1 -0
  21. package/es/src/business/index.mjs +21 -19
  22. package/es/src/components.d.ts +1 -0
  23. package/es/src/editable-table/form-item.vue.mjs +15 -7
  24. package/es/src/editable-table/index.vue.mjs +36 -28
  25. package/es/src/index.mjs +36 -34
  26. package/es/src/path-map.mjs +1 -0
  27. package/lib/index.js +1 -1
  28. package/lib/src/ap-field/interface.d.ts +3 -0
  29. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  30. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  31. package/lib/src/ap-grid/index.vue.js +1 -1
  32. package/lib/src/ap-grid/interface.d.ts +5 -0
  33. package/lib/src/ap-grid/utils/col.js +1 -1
  34. package/lib/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
  35. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -0
  36. package/lib/src/business/ap-product-info/constans.d.ts +11 -14
  37. package/lib/src/business/ap-product-info/constans.js +1 -0
  38. package/lib/src/business/ap-product-info/index.d.ts +86 -0
  39. package/lib/src/business/ap-product-info/index.js +1 -0
  40. package/lib/src/business/ap-product-info/interface.d.ts +9 -7
  41. package/lib/src/business/ap-product-info/interface.js +1 -0
  42. package/lib/src/business/ap-product-info/style/css.cjs +1 -0
  43. package/lib/src/business/ap-product-info/style/css.d.ts +0 -0
  44. package/lib/src/business/ap-product-info/style/index.cjs +1 -0
  45. package/lib/src/business/ap-product-info/style/index.d.ts +0 -0
  46. package/lib/src/business/index.d.ts +1 -0
  47. package/lib/src/business/index.js +1 -1
  48. package/lib/src/components.d.ts +1 -0
  49. package/lib/src/editable-table/form-item.vue.js +1 -1
  50. package/lib/src/editable-table/index.vue.js +1 -1
  51. package/lib/src/index.js +1 -1
  52. package/lib/src/path-map.js +1 -1
  53. package/package.json +1 -1
  54. package/theme/ap-product-info/ap-product-info.css +87 -0
  55. package/theme/ap-product-info/ap-product-info.less +100 -0
  56. package/theme/index.css +87 -0
  57. package/theme/index.less +1 -0
@@ -1,9 +1,9 @@
1
- import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as F, createElementBlock as B, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as b, createElementVNode as I, createVNode as U, mergeProps as g, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as p, resolveDynamicComponent as _, renderSlot as V, normalizeProps as J, guardReactiveProps as Pe } from "vue";
1
+ import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as F, createElementBlock as B, openBlock as s, normalizeStyle as z, normalizeClass as g, createCommentVNode as S, createElementVNode as I, createVNode as U, mergeProps as h, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as p, resolveDynamicComponent as _, renderSlot as V, normalizeProps as J, guardReactiveProps as Pe } from "vue";
2
2
  import { VxeTable as Ee, VxeColumn as Q } from "vxe-table";
3
3
  import "vxe-table/es/style.css";
4
4
  import "vxe-pc-ui/es/style.css";
5
5
  import { VxeUI as Y } from "vxe-pc-ui";
6
- import { isUndefined as w, omit as Ne } from "lodash-unified";
6
+ import { isUndefined as b, omit as Ne } from "lodash-unified";
7
7
  import { ApForm as Te } from "../ap-form/index.mjs";
8
8
  import "../config-provider/index.mjs";
9
9
  import { noRenderAsFormItemValueList as ze } from "../ap-table/constants.mjs";
@@ -93,6 +93,7 @@ const ko = /* @__PURE__ */ Fe({
93
93
  defaultData: {},
94
94
  dataSource: {},
95
95
  onLoadingChange: {},
96
+ onShownColumnsChange: {},
96
97
  searchForm: { type: [Boolean, Object], default: void 0 },
97
98
  beforeSearchSubmit: {},
98
99
  pagination: { type: [Boolean, Object], default: void 0 },
@@ -111,35 +112,35 @@ const ko = /* @__PURE__ */ Fe({
111
112
  },
112
113
  setup(ae, { expose: re }) {
113
114
  var q;
114
- const L = Be(), a = ae, S = (q = Ie()) == null ? void 0 : q.appContext.app;
115
- S && !S.__VXE_PC_UI_INSTALLED__ && (S.use(Y), S.__VXE_PC_UI_INSTALLED__ = !0);
116
- const { e: P, b: d, be: te } = Xe("ap-grid"), le = Je("valueTypeMap"), i = k([]), D = k([]), m = k(), h = k(a.size), [, c] = Ge(), { t: ne } = Qe();
115
+ const L = Be(), a = ae, w = (q = Ie()) == null ? void 0 : q.appContext.app;
116
+ w && !w.__VXE_PC_UI_INSTALLED__ && (w.use(Y), w.__VXE_PC_UI_INSTALLED__ = !0);
117
+ const { e: P, b: i, be: te } = Xe("ap-grid"), le = Je("valueTypeMap"), d = k([]), D = k([]), m = k(), C = k(a.size), [, c] = Ge(), { t: ne } = Qe();
117
118
  Y.setConfig({
118
- i18n: (e, l) => ne(`ap.${e}`, l)
119
+ i18n: (e, r) => ne(`ap.${e}`, r)
119
120
  });
120
- const { renderConfig: se, updateSignal: ie } = Ue(i);
121
+ const { renderConfig: se, updateSignal: de } = Ue(d);
121
122
  let O = 0;
122
- const de = n(() => {
123
+ const ie = n(() => {
123
124
  if (m.value)
124
125
  return m.value.$el.querySelector(
125
126
  ".vxe-table--header-inner-wrapper"
126
127
  );
127
128
  }), K = n(() => {
128
- var e, l, t;
129
- return O++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
130
- (r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !ze.includes(r.valueType)
131
- )) == null ? void 0 : l.sort((r, u) => {
132
- let y = Z(r.order);
129
+ var e, r, l;
130
+ return O++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
131
+ (t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !ze.includes(t.valueType)
132
+ )) == null ? void 0 : r.sort((t, u) => {
133
+ let y = Z(t.order);
133
134
  return Z(u.order) - y;
134
- })) == null ? void 0 : t.map((r) => {
135
+ })) == null ? void 0 : l.map((t) => {
135
136
  const u = Ae(
136
- r,
137
- _e(r.fieldProps, {})
137
+ t,
138
+ _e(t.fieldProps, {})
138
139
  ), y = {
139
- ...r,
140
+ ...t,
140
141
  fieldProps: {
141
- label: r.title,
142
- name: r.dataIndex,
142
+ label: t.title,
143
+ name: t.dataIndex,
143
144
  ...u || {},
144
145
  _signal: O
145
146
  },
@@ -151,14 +152,14 @@ const ko = /* @__PURE__ */ Fe({
151
152
  ), y;
152
153
  })) || [];
153
154
  }), ce = n(() => [
154
- d(),
155
- a.card ? null : d("wrapper"),
156
- a.adaptive ? d("adaptive") : null,
157
- a.sticky ? d("sticky") : null
158
- ].filter(Boolean)), $ = n(() => ee(o(i), (e) => {
155
+ i(),
156
+ a.card ? null : i("wrapper"),
157
+ a.adaptive ? i("adaptive") : null,
158
+ a.sticky ? i("sticky") : null
159
+ ].filter(Boolean)), $ = n(() => ee(o(d), (e) => {
159
160
  if (e.sorter === !0)
160
161
  return e.key || e.dataIndex;
161
- }).filter(Boolean)), H = n(() => ee(o(i), (e) => {
162
+ }).filter(Boolean)), H = n(() => ee(o(d), (e) => {
162
163
  if (e.filters && !e.onFilter)
163
164
  return e.key || e.dataIndex;
164
165
  }).filter(Boolean)), {
@@ -166,24 +167,24 @@ const ko = /* @__PURE__ */ Fe({
166
167
  submit: j,
167
168
  reset: W,
168
169
  refresh: ue,
169
- data: C,
170
+ data: f,
170
171
  tableProps: M,
171
172
  setDataSource: pe,
172
173
  handleTableChange: me
173
174
  } = Le({
174
175
  async request(e) {
175
- var t;
176
- if (!R.value.preserveSelectedRowKeys && w(a.dataSource) && T(), !w(a.dataSource)) {
177
- const r = e.pageSize * (e.current - 1);
176
+ var l;
177
+ if (!R.value.preserveSelectedRowKeys && b(a.dataSource) && T(), !b(a.dataSource)) {
178
+ const t = e.pageSize * (e.current - 1);
178
179
  return {
179
- data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(r, r + e.pageSize)) || [],
180
+ data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(t, t + e.pageSize)) || [],
180
181
  total: a.dataSource.length || 0
181
182
  };
182
183
  }
183
- const l = await ((t = a.request) == null ? void 0 : t.call(a, e));
184
+ const r = await ((l = a.request) == null ? void 0 : l.call(a, e));
184
185
  return {
185
- data: (l == null ? void 0 : l.data) || [],
186
- total: (l == null ? void 0 : l.total) || 0
186
+ data: (r == null ? void 0 : r.data) || [],
187
+ total: (r == null ? void 0 : r.total) || 0
187
188
  };
188
189
  },
189
190
  namespace: "ap-grid",
@@ -194,31 +195,33 @@ const ko = /* @__PURE__ */ Fe({
194
195
  manual: a.manual,
195
196
  formatParams: a.beforeSearchSubmit,
196
197
  pagination: a.pagination
197
- }), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent: ve } = Oe(me);
198
+ }), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent: he } = Oe(me);
198
199
  We({
199
- columns: n(() => i.value),
200
+ columns: n(() => d.value),
200
201
  columnsBackup: n(() => D.value),
201
- size: n(() => h.value ? qe[h.value] : "middle"),
202
+ size: n(() => C.value ? qe[C.value] : "middle"),
202
203
  updateColumns(e) {
203
- i.value = e;
204
+ var r;
205
+ d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e);
204
206
  },
205
207
  updateSize(e) {
206
- h.value = Me[e];
208
+ C.value = Me[e];
207
209
  },
208
210
  renderConfig: n(() => ({
209
211
  className: te("table-header", "title"),
210
212
  color: c.value.colorPrimary
211
- }))
213
+ })),
214
+ dataSource: n(() => o(f).records)
212
215
  });
213
- const he = n(
214
- () => i.value.some(
216
+ const ve = n(
217
+ () => d.value.some(
215
218
  (e) => e.fixed === "left" || e.fixed === !0
216
219
  ) ? "left" : void 0
217
220
  ), Ce = n(
218
- () => w(a.loading) ? C.loading : a.loading
221
+ () => b(a.loading) ? f.loading : a.loading
219
222
  ), ye = n(
220
- () => w(a.dataSource) ? C.records : a.dataSource
221
- ), { selectedRows: x, rowSelection: R, ...be } = je({
223
+ () => b(a.dataSource) ? f.records : a.dataSource
224
+ ), { selectedRows: x, rowSelection: R, ...Se } = je({
222
225
  ...a.rowSelection === !0 ? {} : a.rowSelection,
223
226
  dataSource: ye,
224
227
  rowKey: a.rowKey
@@ -228,39 +231,40 @@ const ko = /* @__PURE__ */ Fe({
228
231
  ...e.getCheckboxReserveRecords(),
229
232
  ...e.getCheckboxRecords()
230
233
  ]);
231
- }, we = () => {
234
+ }, be = () => {
232
235
  const e = m.value;
233
236
  e && (x.value = [e.getRadioRecord()]);
234
237
  };
235
- function Se() {
238
+ function we() {
236
239
  var e;
237
- return ((e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInTable)) || [];
240
+ return ((e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInTable)) || [];
238
241
  }
239
242
  function xe(e) {
240
- var l, t, r;
241
- (r = (t = (l = E.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
243
+ var r, l, t;
244
+ (t = (l = (r = E.value) == null ? void 0 : r.apForm) == null ? void 0 : l.setFieldsValue) == null || t.call(l, e);
242
245
  }
243
246
  function Re(e = !1) {
244
- var t, r, u;
245
- const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
246
- return (u = (r = (t = E.value) == null ? void 0 : t.apForm) == null ? void 0 : r[l]) == null ? void 0 : u.call(r, !0);
247
+ var l, t, u;
248
+ const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
249
+ return (u = (t = (l = E.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : u.call(t, !0);
247
250
  }
248
251
  function T() {
249
- be.clearAll();
252
+ Se.clearAll();
250
253
  const e = m.value;
251
254
  e && (R.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
252
255
  }
253
- async function ke(e, l) {
254
- var r;
255
- const t = C.records[e];
256
- if (t)
257
- return (r = m.value) == null ? void 0 : r.scrollToRow(t, l);
256
+ async function ke(e, r) {
257
+ var t;
258
+ const l = f.records[e];
259
+ if (l)
260
+ return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
258
261
  }
259
262
  return F(
260
263
  () => [a.columnResizable, a.columns],
261
264
  () => {
262
- const e = Se();
263
- i.value = e, D.value = e;
265
+ var r;
266
+ const e = we();
267
+ d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e), D.value = e;
264
268
  },
265
269
  {
266
270
  deep: !0,
@@ -273,15 +277,15 @@ const ko = /* @__PURE__ */ Fe({
273
277
  },
274
278
  { immediate: !0, deep: !0 }
275
279
  ), F(
276
- () => o(C).loading,
280
+ () => o(f).loading,
277
281
  (e) => {
278
- var l;
279
- (l = a.onLoadingChange) == null || l.call(a, e);
282
+ var r;
283
+ (r = a.onLoadingChange) == null || r.call(a, e);
280
284
  }
281
285
  ), F(
282
286
  () => a.size,
283
287
  (e) => {
284
- h.value = e;
288
+ C.value = e;
285
289
  }
286
290
  ), re({
287
291
  submit: j,
@@ -289,22 +293,22 @@ const ko = /* @__PURE__ */ Fe({
289
293
  refresh: ue,
290
294
  setSearchFormValues: xe,
291
295
  getSearchFormValues: Re,
292
- getShowColumns: () => o(i),
296
+ getShowColumns: () => o(d),
293
297
  rowSelection: {
294
298
  selectedRows: n(() => x.value),
295
299
  clearAll: T
296
300
  },
297
301
  scrollToRow: ke
298
- }), (e, l) => (s(), B("div", {
299
- class: f(ce.value),
302
+ }), (e, r) => (s(), B("div", {
303
+ class: g(ce.value),
300
304
  style: z(e.wrapperStyle)
301
305
  }, [
302
- o(w)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), B("div", {
306
+ o(b)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), B("div", {
303
307
  key: 0,
304
- class: f(e.card ? o(P)("search-wrapper") : null),
308
+ class: g(e.card ? o(P)("search-wrapper") : null),
305
309
  style: z(e.searchFormWrapperStyle)
306
310
  }, [
307
- U(o(Te).SearchForm, g(e.searchForm || {}, {
311
+ U(o(Te).SearchForm, h(e.searchForm || {}, {
308
312
  ref_key: "formRef",
309
313
  ref: E,
310
314
  "custom-reset": "",
@@ -313,13 +317,13 @@ const ko = /* @__PURE__ */ Fe({
313
317
  onReset: o(W)
314
318
  }), G({
315
319
  default: v(() => [
316
- (s(!0), B(X, null, A(K.value, (t) => (s(), p(_(t.renderNode.Comp), g({
317
- key: t.dataIndex,
318
- item: t,
320
+ (s(!0), B(X, null, A(K.value, (l) => (s(), p(_(l.renderNode.Comp), h({
321
+ key: l.dataIndex,
322
+ item: l,
319
323
  ref_for: !0
320
- }, t.fieldProps || {}, {
321
- span: t.span,
322
- "custom-render": t.renderNode.render
324
+ }, l.fieldProps || {}, {
325
+ span: l.span,
326
+ "custom-render": l.renderNode.render
323
327
  }), null, 16, ["item", "span", "custom-render"]))), 128))
324
328
  ]),
325
329
  _: 2
@@ -332,29 +336,29 @@ const ko = /* @__PURE__ */ Fe({
332
336
  key: "0"
333
337
  } : void 0
334
338
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
335
- ], 6)) : b("", !0),
339
+ ], 6)) : S("", !0),
336
340
  I("div", {
337
- class: f([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
341
+ class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
338
342
  style: z(e.tableWrapperStyle)
339
343
  }, [
340
344
  I("div", {
341
- class: f(o(d)("header-wrapper"))
345
+ class: g(o(i)("header-wrapper"))
342
346
  }, [
343
347
  V(e.$slots, "title", {
344
348
  selectedRows: o(x),
345
349
  selectedRowKeys: o(R).selectedRowKeys,
346
- shownColumns: i.value,
350
+ shownColumns: d.value,
347
351
  clearAll: T
348
352
  })
349
353
  ], 2),
350
354
  I("div", {
351
- class: f(o(d)("vxe-wrapper"))
355
+ class: g(o(i)("vxe-wrapper"))
352
356
  }, [
353
- (s(), p(o(Ee), g(o(Ke)(a), {
357
+ (s(), p(o(Ee), h(o(Ke)(a), {
354
358
  ref_key: "tableRef",
355
359
  ref: m,
356
- key: o(ie),
357
- data: o(C).records,
360
+ key: o(de),
361
+ data: o(f).records,
358
362
  "sort-config": { remote: $.value.length > 0 },
359
363
  "filter-config": { remote: H.value.length > 0 },
360
364
  loading: Ce.value,
@@ -374,13 +378,13 @@ const ko = /* @__PURE__ */ Fe({
374
378
  "--vxe-ui-font-color": o(c).colorTextBase,
375
379
  "--vxe-ui-table-border-color": o(c).colorBorderSecondary
376
380
  },
377
- size: h.value,
381
+ size: C.value,
378
382
  onSortChange: o(fe),
379
383
  onFilterChange: o(ge),
380
384
  onCheckboxChange: N,
381
385
  onCheckboxRangeChange: N,
382
386
  onCheckboxAll: N,
383
- onRadioChange: we
387
+ onRadioChange: be
384
388
  }), G({
385
389
  empty: v(() => [
386
390
  U(o(oe), {
@@ -388,39 +392,39 @@ const ko = /* @__PURE__ */ Fe({
388
392
  }, null, 8, ["image"])
389
393
  ]),
390
394
  default: v(() => [
391
- a.expandable ? (s(), p(o(Q), g({ key: 0 }, o($e)(e.expandable), { fixed: he.value }), {
392
- content: v((t) => [
393
- (s(), p(_(a.expandable.renderContent(t))))
395
+ a.expandable ? (s(), p(o(Q), h({ key: 0 }, o($e)(e.expandable), { fixed: ve.value }), {
396
+ content: v((l) => [
397
+ (s(), p(_(a.expandable.renderContent(l))))
394
398
  ]),
395
399
  _: 1
396
- }, 16, ["fixed"])) : b("", !0),
397
- a.rowSelection ? (s(), p(o(Q), J(g({ key: 1 }, o(He)(o(R), i.value))), null, 16)) : b("", !0),
398
- (s(!0), B(X, null, A(o(se), (t) => (s(), p(_(t), {
399
- key: t.props.colId
400
+ }, 16, ["fixed"])) : S("", !0),
401
+ a.rowSelection ? (s(), p(o(Q), J(h({ key: 1 }, o(He)(o(R), d.value))), null, 16)) : S("", !0),
402
+ (s(!0), B(X, null, A(o(se), (l) => (s(), p(_(l), {
403
+ key: l.props.colId
400
404
  }))), 128))
401
405
  ]),
402
406
  _: 2
403
407
  }, [
404
- A(o(Ne)(L, ["searchFormExtra"]), (t, r) => ({
405
- name: r,
408
+ A(o(Ne)(L, ["searchFormExtra"]), (l, t) => ({
409
+ name: t,
406
410
  fn: v((u) => [
407
- V(e.$slots, r, J(Pe(u || {})))
411
+ V(e.$slots, t, J(Pe(u || {})))
408
412
  ])
409
413
  }))
410
414
  ]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
411
415
  ], 2),
412
416
  I("div", {
413
- class: f(o(d)("pagination-wrapper"))
417
+ class: g(o(i)("pagination-wrapper"))
414
418
  }, [
415
419
  e.sticky ? (s(), p(o(Ye), {
416
420
  key: 0,
417
421
  direction: "horizontal",
418
- "scroll-container": de.value
419
- }, null, 8, ["scroll-container"])) : b("", !0),
420
- e.pagination !== !1 ? (s(), p(o(De), g({
422
+ "scroll-container": ie.value
423
+ }, null, 8, ["scroll-container"])) : S("", !0),
424
+ e.pagination !== !1 ? (s(), p(o(De), h({
421
425
  key: 1,
422
- class: o(d)("pagination")
423
- }, o(M).pagination, { onChange: o(ve) }), null, 16, ["class", "onChange"])) : b("", !0)
426
+ class: o(i)("pagination")
427
+ }, o(M).pagination, { onChange: o(he) }), null, 16, ["class", "onChange"])) : S("", !0)
424
428
  ], 2)
425
429
  ], 6)
426
430
  ], 6));
@@ -162,6 +162,11 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
162
162
  * @returns
163
163
  */
164
164
  onLoadingChange?: (loading: boolean) => void;
165
+ /**
166
+ * 当可显示列变更后触发
167
+ * @returns
168
+ */
169
+ onShownColumnsChange?: (columns: ApGridColumnType<RecordType>[]) => void;
165
170
  /**
166
171
  * 查询表单配置,设置为false表示不渲染查询表单
167
172
  */
@@ -1,19 +1,19 @@
1
- import { createVNode as v, Fragment as S } from "vue";
2
- import { isUndefined as $, isArray as M, isString as x, isBoolean as A, isNumber as V, pick as R } from "lodash-unified";
3
- import { valueEnumToArray as j, objectToString as B, getTableTitle as c, getTableRenderType as N, getTableRenderProps as W, getTableCellRenderNode as _ } from "../../ap-table/utils.mjs";
4
- import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
1
+ import { createVNode as h, Fragment as x } from "vue";
2
+ import { isUndefined as j, isArray as B, isString as b, isBoolean as c, isNumber as N, pick as w } from "lodash-unified";
3
+ import { valueEnumToArray as W, objectToString as _, getTableTitle as E, getTableRenderType as k, getTableRenderProps as z, getTableCellRenderNode as G } from "../../ap-table/utils.mjs";
4
+ import { noRenderAsFormItemValueList as I } from "../../ap-table/constants.mjs";
5
5
  import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
6
- import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
- function b(e) {
8
- if (!$(e))
9
- return M(e) ? e.reduce((r, i) => x(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
6
+ import L from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
+ function O(e) {
8
+ if (!j(e))
9
+ return B(e) ? e.reduce((r, i) => b(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
10
10
  }
11
- function w(e) {
11
+ function S(e) {
12
12
  if (e)
13
13
  return e === !0 ? "left" : e;
14
14
  }
15
- function G(e) {
16
- return A(e) ? {
15
+ function U(e) {
16
+ return c(e) ? {
17
17
  sortable: e
18
18
  } : e ? {
19
19
  sortable: !0,
@@ -23,19 +23,19 @@ function G(e) {
23
23
  sortable: !1
24
24
  };
25
25
  }
26
- function I(e) {
26
+ function q(e) {
27
27
  let r;
28
- return A(e.filters) && e.valueEnum ? r = j(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
29
- label: x(i.text) ? i.text : "",
28
+ return c(e.filters) && e.valueEnum ? r = W(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
29
+ label: b(i.text) ? i.text : "",
30
30
  value: i.value
31
31
  }));
32
32
  }
33
- function L(e) {
33
+ function D(e) {
34
34
  if (e)
35
35
  return (r) => e(r.value, r.row);
36
36
  }
37
- function U(e, r) {
38
- return e ? V(e) ? {
37
+ function H(e, r) {
38
+ return e ? N(e) ? {
39
39
  tooltip: r,
40
40
  rows: e
41
41
  } : e === !0 || e === "tooltip" ? {
@@ -47,91 +47,102 @@ function U(e, r) {
47
47
  htmlTitle: e === "title" ? r : ""
48
48
  } : !1;
49
49
  }
50
- function q(e, r, i) {
51
- if (k.includes(e.valueType))
50
+ function A(e, r, i) {
51
+ if (I.includes(e.valueType))
52
52
  return i;
53
53
  if (e.copyable || e.ellipsis) {
54
- const l = U(e.ellipsis, r), t = B(r);
55
- return v(z, {
54
+ const n = H(e.ellipsis, r), t = _(r);
55
+ return h(L, {
56
56
  rawValue: t,
57
57
  copyable: e.copyable,
58
- ellipsis: l,
58
+ ellipsis: n,
59
59
  content: i
60
60
  }, null);
61
61
  }
62
62
  return i;
63
63
  }
64
- function y(e, r, i) {
65
- const l = R(e, ["width", "minWidth", "align"]);
66
- return l.field = b(e.dataIndex), l.fixed = w(e.fixed), l.slots = {
67
- header: () => c(e, i, void 0, r)
68
- }, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
64
+ function R(e, r, i) {
65
+ const n = w(e, ["width", "minWidth", "align"]);
66
+ return n.field = O(e.dataIndex), n.fixed = S(e.fixed), n.slots = {
67
+ header: () => E(e, i, void 0, r)
68
+ }, n.headerAlign = e.align, n.showOverflow = !1, n.showFooterOverflow = !1, n;
69
69
  }
70
- function F(e, r, i, l) {
71
- const t = R(e, ["width", "minWidth", "align", "resizable"]);
72
- t.field = b(e.dataIndex), t.fixed = w(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, G(e.sorter)), t.filters = I(e), t.filterMultiple = e.filterMultiple, t.filterMethod = L(e.onFilter);
73
- const a = ({
74
- value: d,
75
- ...n
70
+ function v(e, r, i, n) {
71
+ const t = w(e, ["width", "minWidth", "align", "resizable"]);
72
+ t.field = O(e.dataIndex), t.fixed = S(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, U(e.sorter)), t.filters = q(e), t.filterMultiple = e.filterMultiple, t.filterMethod = D(e.onFilter);
73
+ const u = ({
74
+ value: l,
75
+ _columnIndex: s,
76
+ footer: f,
77
+ ...d
76
78
  }) => {
77
- var o, T;
78
- const f = N(e), u = W({
79
+ var y, F;
80
+ if (f && s === 0)
81
+ return A(e, l, h(x, null, [l]));
82
+ const o = k(e), $ = z({
79
83
  ...e,
80
- valueType: f
84
+ valueType: o
81
85
  }, {
82
- value: d,
83
- ...n
84
- }), E = _(f, u, n.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
85
- value: d,
86
- ...n
87
- })) || d, O = e.renderText ? v(S, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
88
- value: d,
89
- ...n
90
- })]) : E;
91
- let p = q(e, h, O);
86
+ value: l,
87
+ ...d
88
+ }), M = G(o, $, d.record, n), T = ((y = e.renderText) == null ? void 0 : y.call(e, {
89
+ value: l,
90
+ ...d
91
+ })) || l, V = e.renderText ? h(x, null, [(F = e.renderText) == null ? void 0 : F.call(e, {
92
+ value: l,
93
+ ...d
94
+ })]) : M;
95
+ let p = A(e, T, V);
92
96
  return e.customRender && (p = e.customRender({
93
- value: d,
94
- ...n,
97
+ value: l,
98
+ ...d,
95
99
  column: e,
96
100
  originalNode: p,
97
- originalText: h
101
+ originalText: T
98
102
  })), p;
99
- }, s = ({
100
- row: d,
101
- rowIndex: n
102
- }) => a({
103
- value: d[t.field],
104
- text: d[t.field],
105
- record: d,
106
- index: n,
107
- renderIndex: n,
108
- column: e
103
+ }, a = ({
104
+ row: l,
105
+ rowIndex: s,
106
+ _columnIndex: f,
107
+ footer: d
108
+ }) => u({
109
+ value: l[t.field],
110
+ text: l[t.field],
111
+ record: l,
112
+ index: s,
113
+ renderIndex: s,
114
+ column: e,
115
+ _columnIndex: f,
116
+ footer: d
109
117
  });
110
118
  return t.slots = {
111
- header: () => c(e, i, void 0, r),
112
- default: s,
113
- footer: s
119
+ header: () => E(e, i, void 0, r),
120
+ default: a,
121
+ footer: (l) => a({
122
+ ...l,
123
+ footer: !0
124
+ })
114
125
  }, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
115
126
  }
116
- function Y(e, r, i, l) {
117
- var s;
118
- if (!((s = e.children) != null && s.length))
119
- return F(e, r, i, l);
120
- function t(d) {
121
- return d.map((n) => {
127
+ function P(e, r, i, n) {
128
+ var a;
129
+ if (!((a = e.children) != null && a.length))
130
+ return v(e, r, i, n);
131
+ function t(l) {
132
+ return l.map((s) => {
122
133
  var f;
123
- if ((f = n.children) != null && f.length) {
124
- const u = y(n, r, i);
125
- return u.children = t(n.children), u;
134
+ if ((f = s.children) != null && f.length) {
135
+ const d = R(s, r, i);
136
+ return d.children = t(s.children), d;
126
137
  }
127
- return F(n, r, i, l);
138
+ return v(s, r, i, n);
128
139
  });
129
140
  }
130
- const a = y(e, r, i);
131
- return a.children = t(e.children), a;
141
+ const u = R(e, r, i);
142
+ return u.children = t(e.children), u;
132
143
  }
133
144
  export {
134
- Y as transformCol,
135
- y as transformToColGroup,
136
- F as transformToColumn
145
+ P as transformCol,
146
+ R as transformToColGroup,
147
+ v as transformToColumn
137
148
  };