@aplus-frontend/ui 0.6.0-beta.2 → 0.6.0-beta.4

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 (52) hide show
  1. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
  2. package/es/src/ap-grid/editable/form-item.vue.mjs +94 -83
  3. package/es/src/ap-grid/editable/index.vue.mjs +89 -78
  4. package/es/src/ap-grid/index.vue.mjs +47 -43
  5. package/es/src/ap-grid/interface.d.ts +1 -1
  6. package/es/src/ap-grid/utils/table.mjs +32 -32
  7. package/es/src/ap-table/ap-table.vue2.mjs +2 -0
  8. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
  9. package/es/src/business/ap-status/interface.d.ts +1 -1
  10. package/es/src/editable-table/form-item.vue.d.ts +2 -14
  11. package/es/src/editable-table/form-item.vue.mjs +84 -76
  12. package/es/src/editable-table/index.vue.d.ts +2 -16
  13. package/es/src/editable-table/index.vue.mjs +91 -83
  14. package/es/src/editable-table/interface.d.ts +7 -0
  15. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  16. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  17. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  18. package/lib/src/ap-grid/index.vue.js +1 -1
  19. package/lib/src/ap-grid/interface.d.ts +1 -1
  20. package/lib/src/ap-grid/utils/table.js +1 -1
  21. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  22. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  23. package/lib/src/business/ap-status/interface.d.ts +1 -1
  24. package/lib/src/editable-table/form-item.vue.d.ts +2 -14
  25. package/lib/src/editable-table/form-item.vue.js +1 -1
  26. package/lib/src/editable-table/index.vue.d.ts +2 -16
  27. package/lib/src/editable-table/index.vue.js +1 -1
  28. package/lib/src/editable-table/interface.d.ts +7 -0
  29. package/package.json +4 -4
  30. package/theme/antd-global-overwrite/admin/index.css +4 -17
  31. package/theme/antd-global-overwrite/admin/modal.css +4 -17
  32. package/theme/antd-global-overwrite/admin/modal.less +4 -19
  33. package/theme/antd-global-overwrite/aplus/index.css +4 -11
  34. package/theme/antd-global-overwrite/aplus/modal.css +4 -11
  35. package/theme/antd-global-overwrite/aplus/modal.less +4 -14
  36. package/theme/ap-form/ap-form-item.css +2 -2
  37. package/theme/ap-form/ap-form-item.less +2 -2
  38. package/theme/ap-form/index.css +5 -2
  39. package/theme/ap-form/search-form.css +5 -2
  40. package/theme/ap-form/search-form.less +3 -0
  41. package/theme/ap-grid/index.css +5 -2
  42. package/theme/ap-table/ap-table.css +8 -5
  43. package/theme/ap-table/setting/index.css +3 -3
  44. package/theme/ap-table/setting/modal.css +1 -2
  45. package/theme/ap-table/setting/modal.less +1 -2
  46. package/theme/ap-table/setting/select-group.css +2 -1
  47. package/theme/ap-table/setting/select-group.less +2 -1
  48. package/theme/ap-table-modal/index.css +8 -5
  49. package/theme/ap-tag/ap-tag.css +1 -1
  50. package/theme/ap-tag/ap-tag.less +1 -1
  51. package/theme/editable-table/index.css +5 -2
  52. package/theme/index.css +9 -6
@@ -1,4 +1,4 @@
1
- import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as F, computed as n, unref as o, watch as B, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as b, createElementVNode as E, createVNode as X, mergeProps as h, createSlots as J, withCtx as v, Fragment as Q, renderList as L, createBlock as p, resolveDynamicComponent as D, renderSlot as O, normalizeProps as Ee, guardReactiveProps as Pe } from "vue";
1
+ import { defineComponent as Be, useSlots as Fe, getCurrentInstance as Ie, ref as B, computed as n, unref as o, watch as F, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as S, createElementVNode as E, createVNode as X, mergeProps as h, createSlots as J, withCtx as v, Fragment as Q, renderList as L, createBlock as p, resolveDynamicComponent as D, renderSlot as O, normalizeProps as Ee, guardReactiveProps as Pe } from "vue";
2
2
  import { VxeTable as Ne, VxeColumn as Y } from "vxe-table";
3
3
  import "vxe-table/es/style.css";
4
4
  import "vxe-pc-ui/es/style.css";
@@ -24,7 +24,7 @@ import { useNamespace as Ze } from "../config-provider/hooks/use-namespace.mjs";
24
24
  import { useGlobalConfig as eo } from "../config-provider/hooks/use-global-config.mjs";
25
25
  import { useLocale as oo } from "../config-provider/hooks/use-locale.mjs";
26
26
  import ao from "../scroll-bar/index.vue.mjs";
27
- const No = /* @__PURE__ */ Fe({
27
+ const No = /* @__PURE__ */ Be({
28
28
  name: "ApGrid",
29
29
  __name: "index",
30
30
  props: {
@@ -87,6 +87,7 @@ const No = /* @__PURE__ */ Fe({
87
87
  loadingConfig: {},
88
88
  headerCellConfig: {},
89
89
  footerCellConfig: {},
90
+ round: { type: Boolean, default: void 0 },
90
91
  columns: {},
91
92
  rowSelection: { type: Boolean },
92
93
  card: { type: Boolean, default: !1 },
@@ -114,15 +115,15 @@ const No = /* @__PURE__ */ Fe({
114
115
  },
115
116
  setup(re, { expose: te }) {
116
117
  var G;
117
- const C = Be(), a = re, x = (G = Ie()) == null ? void 0 : G.appContext.app;
118
+ const C = Fe(), a = re, x = (G = Ie()) == null ? void 0 : G.appContext.app;
118
119
  x && !x.__VXE_PC_UI_INSTALLED__ && (x.use(Z), x.__VXE_PC_UI_INSTALLED__ = !0);
119
- const { e: P, b: c, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"), i = F([]), $ = F([]), m = F(), y = F(a.size), [, d] = Je(), { t: se } = oo();
120
+ const { e: P, b: u, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"), i = B([]), $ = B([]), m = B(), y = B(a.size), [, d] = Je(), { t: se } = oo();
120
121
  Z.setConfig({
121
122
  i18n: (e, r) => se(`ap.${e}`, r)
122
123
  });
123
124
  const { renderConfig: ie, updateSignal: de } = Xe(i);
124
125
  let K = 0;
125
- const ce = n(() => {
126
+ const ue = n(() => {
126
127
  if (m.value)
127
128
  return m.value.$el.querySelector(
128
129
  ".vxe-table--header-inner-wrapper"
@@ -131,39 +132,41 @@ const No = /* @__PURE__ */ Fe({
131
132
  var e, r, l;
132
133
  return K++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
133
134
  (t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !_e.includes(t.valueType)
134
- )) == null ? void 0 : r.sort((t, u) => {
135
- let S = ee(t.order);
136
- return ee(u.order) - S;
135
+ )) == null ? void 0 : r.sort((t, c) => {
136
+ let b = ee(t.order);
137
+ return ee(c.order) - b;
137
138
  })) == null ? void 0 : l.map((t) => {
138
- const u = Ae(
139
+ const c = Ae(
139
140
  t,
140
141
  Ve(t.fieldProps, {})
141
- ), S = {
142
+ ), b = {
142
143
  ...t,
143
144
  fieldProps: {
144
145
  label: t.title,
145
146
  name: t.dataIndex,
146
- ...u || {},
147
+ // tips: 在表格中的查询表单项默认是带边框的
148
+ bordered: !0,
149
+ ...c || {},
147
150
  _signal: K
148
151
  },
149
152
  renderNode: void 0
150
153
  };
151
- return S.renderNode = Le(
152
- S,
154
+ return b.renderNode = Le(
155
+ b,
153
156
  o(ne)
154
- ), S;
157
+ ), b;
155
158
  })) || [];
156
- }), ue = n(() => {
159
+ }), ce = n(() => {
157
160
  var r;
158
161
  return Qe(a.manual) ? a.manual : Ye(((r = C.searchFormExtra) == null ? void 0 : r.call(C)) || []).some((l) => {
159
162
  var t;
160
163
  return ((t = l.type) == null ? void 0 : t.name) === "ApView";
161
164
  });
162
165
  }), pe = n(() => [
163
- c(),
164
- a.card ? null : c("wrapper"),
165
- a.adaptive ? c("adaptive") : null,
166
- a.sticky ? c("sticky") : null
166
+ u(),
167
+ a.card ? null : u("wrapper"),
168
+ a.adaptive ? u("adaptive") : null,
169
+ a.sticky ? u("sticky") : null
167
170
  ].filter(Boolean)), j = n(() => oe(o(i), (e) => {
168
171
  if (e.sorter === !0)
169
172
  return e.key || e.dataIndex;
@@ -200,7 +203,7 @@ const No = /* @__PURE__ */ Fe({
200
203
  sortFields: j,
201
204
  defaultParams: a.params,
202
205
  defaultData: a.defaultData,
203
- manual: o(ue),
206
+ manual: o(ce),
204
207
  formatParams: a.beforeSearchSubmit,
205
208
  pagination: a.pagination
206
209
  }), { sortChangeEvent: he, filterChangeEvent: ve, paginationChangeEvent: Ce } = $e(ge);
@@ -229,13 +232,13 @@ const No = /* @__PURE__ */ Fe({
229
232
  () => i.value.some(
230
233
  (e) => e.fixed === "left" || e.fixed === !0
231
234
  ) ? "left" : void 0
232
- ), Se = n(
233
- () => w(a.loading) ? f.loading : a.loading
234
235
  ), be = n(
236
+ () => w(a.loading) ? f.loading : a.loading
237
+ ), Se = n(
235
238
  () => w(a.dataSource) ? f.records : a.dataSource
236
239
  ), { selectedRows: R, rowSelection: k, ...we } = He({
237
240
  ...a.rowSelection === !0 ? {} : a.rowSelection,
238
- dataSource: be,
241
+ dataSource: Se,
239
242
  rowKey: a.rowKey
240
243
  }), _ = () => {
241
244
  const e = m.value;
@@ -256,9 +259,9 @@ const No = /* @__PURE__ */ Fe({
256
259
  (t = (l = (r = N.value) == null ? void 0 : r.apForm) == null ? void 0 : l.setFieldsValue) == null || t.call(l, e);
257
260
  }
258
261
  function U(e = !1) {
259
- var l, t, u;
262
+ var l, t, c;
260
263
  const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
261
- return (u = (t = (l = N.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : u.call(t, !0);
264
+ return (c = (t = (l = N.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : c.call(t, !0);
262
265
  }
263
266
  function A() {
264
267
  we.clearAll();
@@ -271,7 +274,7 @@ const No = /* @__PURE__ */ Fe({
271
274
  if (l)
272
275
  return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
273
276
  }
274
- return B(
277
+ return F(
275
278
  () => [a.columnResizable, a.columns],
276
279
  () => {
277
280
  var r;
@@ -282,19 +285,19 @@ const No = /* @__PURE__ */ Fe({
282
285
  deep: !0,
283
286
  immediate: !0
284
287
  }
285
- ), B(
288
+ ), F(
286
289
  () => a.dataSource,
287
290
  (e) => {
288
291
  fe(e);
289
292
  },
290
293
  { immediate: !0, deep: !0 }
291
- ), B(
294
+ ), F(
292
295
  () => o(f).loading,
293
296
  (e) => {
294
297
  var r;
295
298
  (r = a.onLoadingChange) == null || r.call(a, e);
296
299
  }
297
- ), B(
300
+ ), F(
298
301
  () => a.size,
299
302
  (e) => {
300
303
  y.value = e;
@@ -349,13 +352,13 @@ const No = /* @__PURE__ */ Fe({
349
352
  key: "0"
350
353
  } : void 0
351
354
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
352
- ], 6)) : b("", !0),
355
+ ], 6)) : S("", !0),
353
356
  E("div", {
354
357
  class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
355
358
  style: V(e.tableWrapperStyle)
356
359
  }, [
357
360
  E("div", {
358
- class: g(o(c)("header-wrapper"))
361
+ class: g(o(u)("header-wrapper"))
359
362
  }, [
360
363
  O(e.$slots, "title", {
361
364
  selectedRows: o(R),
@@ -365,7 +368,7 @@ const No = /* @__PURE__ */ Fe({
365
368
  })
366
369
  ], 2),
367
370
  E("div", {
368
- class: g(o(c)("vxe-wrapper"))
371
+ class: g(o(u)("vxe-wrapper"))
369
372
  }, [
370
373
  (s(), p(o(Ne), h(o(Ke)(a), {
371
374
  ref_key: "tableRef",
@@ -374,7 +377,7 @@ const No = /* @__PURE__ */ Fe({
374
377
  data: o(f).records,
375
378
  "sort-config": { remote: j.value.length > 0 },
376
379
  "filter-config": { remote: H.value.length > 0 },
377
- loading: Se.value,
380
+ loading: be.value,
378
381
  style: {
379
382
  "--vxe-ui-table-row-checkbox-checked-background-color": o(d).controlItemBgActive,
380
383
  "--vxe-ui-table-row-hover-checkbox-checked-background-color": o(d).controlItemBgActiveHover,
@@ -387,7 +390,8 @@ const No = /* @__PURE__ */ Fe({
387
390
  "--vxe-ui-font-color": o(d).colorTextBase,
388
391
  "--vxe-ui-table-border-color": o(d).colorBorderSecondary,
389
392
  "--vxe-ui-table-header-font-color": o(d).colorTextBase,
390
- "--vxe-ui-table-cell-padding-mini": "8px"
393
+ "--vxe-ui-table-cell-padding-mini": "8px",
394
+ "--vxe-ui-table-row-line-height": "18px"
391
395
  },
392
396
  size: y.value,
393
397
  onSortChange: o(he),
@@ -408,8 +412,8 @@ const No = /* @__PURE__ */ Fe({
408
412
  (s(), p(D(a.expandable.renderContent(l))))
409
413
  ]),
410
414
  _: 1
411
- }, 16, ["fixed"])) : b("", !0),
412
- a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), i.value), { field: o(Ge) }), null, 16, ["field"])) : b("", !0),
415
+ }, 16, ["fixed"])) : S("", !0),
416
+ a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), i.value), { field: o(Ge) }), null, 16, ["field"])) : S("", !0),
413
417
  (s(!0), I(Q, null, L(o(ie), (l) => (s(), p(D(l), {
414
418
  key: l.props.colId
415
419
  }))), 128))
@@ -418,25 +422,25 @@ const No = /* @__PURE__ */ Fe({
418
422
  }, [
419
423
  L(o(Te)(C, ["searchFormExtra"]), (l, t) => ({
420
424
  name: t,
421
- fn: v((u) => [
422
- O(e.$slots, t, Ee(Pe(u || {})))
425
+ fn: v((c) => [
426
+ O(e.$slots, t, Ee(Pe(c || {})))
423
427
  ])
424
428
  }))
425
429
  ]), 1040, ["data", "sort-config", "filter-config", "loading", "style", "size", "onSortChange", "onFilterChange"]))
426
430
  ], 2),
427
431
  E("div", {
428
- class: g(o(c)("pagination-wrapper"))
432
+ class: g(o(u)("pagination-wrapper"))
429
433
  }, [
430
434
  e.sticky ? (s(), p(o(ao), {
431
435
  key: 0,
432
436
  direction: "horizontal",
433
- "scroll-container": ce.value,
437
+ "scroll-container": ue.value,
434
438
  "extra-size": -4.2
435
- }, null, 8, ["scroll-container"])) : b("", !0),
439
+ }, null, 8, ["scroll-container"])) : S("", !0),
436
440
  e.pagination !== !1 ? (s(), p(o(Oe), h({
437
441
  key: 1,
438
- class: o(c)("pagination")
439
- }, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) : b("", !0)
442
+ class: o(u)("pagination")
443
+ }, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) : S("", !0)
440
444
  ], 2)
441
445
  ], 6)
442
446
  ], 6));
@@ -119,7 +119,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
119
119
  */
120
120
  range?: boolean;
121
121
  };
122
- export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
122
+ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig' | 'round'> & {
123
123
  /**
124
124
  * 列配置
125
125
  */
@@ -1,20 +1,23 @@
1
- import { omit as l, isUndefined as u, isFunction as h, isNumber as w } from "lodash-unified";
2
- const b = 20, y = 50;
3
- function R(e) {
1
+ import { omit as u, isUndefined as l, isFunction as h, isNumber as m } from "lodash-unified";
2
+ import { isDef as w } from "../../utils/index.mjs";
3
+ const y = 20, C = 50, b = (e) => e.some((t) => !!t.html);
4
+ function v(e) {
4
5
  var i;
5
6
  const t = {
6
- ...l(e, [
7
+ ...u(e, [
7
8
  "columns",
8
9
  "request",
9
10
  "searchForm",
10
11
  "dataSource",
11
12
  "rowKey",
12
- "value"
13
+ "value",
14
+ "round"
13
15
  ])
14
16
  };
15
- if (e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig ? t.columnConfig.resizable = !0 : t.columnConfig = {
16
- resizable: !0
17
- }), e.rowSelection) {
17
+ if (t.rowConfig = {
18
+ isHover: !0,
19
+ keyField: e.rowKey
20
+ }, t.columnConfig = {}, b(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
18
21
  const o = e.rowSelection === !0 ? {} : e.rowSelection;
19
22
  o.type === "radio" ? t.radioConfig = {
20
23
  highlight: !0,
@@ -25,7 +28,7 @@ function R(e) {
25
28
  return o.shown ? o.shown(r) : !0;
26
29
  },
27
30
  checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
28
- reserve: u(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
31
+ reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
29
32
  } : t.checkboxConfig = {
30
33
  highlight: !0,
31
34
  checkMethod({ row: r }) {
@@ -35,11 +38,11 @@ function R(e) {
35
38
  return o.shown ? o.shown(r) : !0;
36
39
  },
37
40
  checkRowKeys: o.defaultSelectedRowKeys,
38
- reserve: u(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
41
+ reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
39
42
  range: o.range || !1
40
43
  };
41
44
  }
42
- return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = l(e.expandable, [
45
+ return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
43
46
  "renderContent",
44
47
  "width",
45
48
  "title"
@@ -47,34 +50,31 @@ function R(e) {
47
50
  enabled: !1
48
51
  }, t.virtualYConfig = {
49
52
  enabled: !1
50
- }) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.rowConfig = {
51
- isHover: !0,
52
- keyField: e.rowKey
53
- }, t.round = !0, t;
53
+ }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
54
54
  }
55
- function a(e, t, i) {
56
- const o = t === "X", r = o ? "x" : "y", n = o ? "virtualXConfig" : "virtualYConfig", d = i == null ? void 0 : i[r], f = d !== !1, s = o ? b : y, c = w(d) && d >= 0 ? d : s;
57
- e[n] = {
58
- enabled: f,
55
+ function f(e, t, n) {
56
+ const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], a = d !== !1, s = i ? y : C, c = m(d) && d >= 0 ? d : s;
57
+ e[r] = {
58
+ enabled: a,
59
59
  gt: c,
60
- oSize: (i == null ? void 0 : i.oSize) || 0
60
+ oSize: (n == null ? void 0 : n.oSize) || 0
61
61
  };
62
62
  }
63
63
  function x(e) {
64
64
  return e === !0 ? "left" : e;
65
65
  }
66
- function m(e, t) {
67
- const i = e === !0 || !e.type ? "checkbox" : e.type, o = e === !0 ? 60 : e.columnWidth || 60;
68
- let r = e === !0 ? void 0 : x(e.fixed);
69
- return r || (r === !1 ? r = void 0 : r = t.some(
70
- (n) => n.fixed === "left" || n.fixed === !0
66
+ function K(e, t) {
67
+ const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
68
+ let o = e === !0 ? void 0 : x(e.fixed);
69
+ return o || (o === !1 ? o = void 0 : o = t.some(
70
+ (r) => r.fixed === "left" || r.fixed === !0
71
71
  ) ? "left" : void 0), {
72
- type: i,
73
- width: o,
74
- fixed: r
72
+ type: n,
73
+ width: i,
74
+ fixed: o
75
75
  };
76
76
  }
77
- function g(e) {
77
+ function k(e) {
78
78
  const t = (e == null ? void 0 : e.width) || "auto";
79
79
  return {
80
80
  type: "expand",
@@ -83,7 +83,7 @@ function g(e) {
83
83
  };
84
84
  }
85
85
  export {
86
- g as getRowExpandProps,
87
- m as getRowSelectionProps,
88
- R as toVxeProps
86
+ k as getRowExpandProps,
87
+ K as getRowSelectionProps,
88
+ v as toVxeProps
89
89
  };
@@ -190,6 +190,8 @@ const Or = /* @__PURE__ */ Le({
190
190
  fieldProps: {
191
191
  label: t.title,
192
192
  name: t.dataIndex,
193
+ // tips: 在表格中的查询表单项默认是带边框的
194
+ bordered: !0,
193
195
  ...d || {},
194
196
  _signal: O
195
197
  },
@@ -30,7 +30,7 @@ const q = /* @__PURE__ */ x({
30
30
  }
31
31
  return (r, e) => (c(), i("div", null, [
32
32
  s(o(N), {
33
- gutter: [24, 16],
33
+ gutter: [24, 12],
34
34
  align: "middle"
35
35
  }, {
36
36
  default: d(() => [
@@ -10,7 +10,7 @@ type ApStatusGroupItemUnion = Pick<ApStatusProps, 'text' | 'color'> & {
10
10
  };
11
11
  export type ApStatusGroupItemProps = Required<ApStatusGroupItemUnion>;
12
12
  export type ApStatusGroupProps = {
13
- padding: number;
13
+ padding?: number;
14
14
  currentValue: number | string;
15
15
  statusList: ApStatusGroupItemProps[] | null;
16
16
  style?: object;
@@ -1,20 +1,8 @@
1
- import { EditableColumnType, EditableTableFormItemProps } from './interface';
2
- import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
1
+ import { EditableColumnType, EditableTableFormItemExpose, EditableTableFormItemProps } from './interface';
3
2
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
- import { UnwrapRefSimple } from '@vue/reactivity';
5
3
  declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableTableFormItemProps<RecordType> & Partial<{}>> & PublicProps;
7
- expose(exposed: ShallowUnwrapRef<{
8
- add: (defaultValue?: any, insertIndex?: number) => void;
9
- remove: (index: number | number[]) => void;
10
- getRowData: (index: number) => RecordType | UnwrapRefSimple<RecordType>;
11
- getRowsData: () => RecordType[] | UnwrapRefSimple<RecordType>[];
12
- setRowData: (index: number, payload: any, merge?: boolean) => void;
13
- addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
14
- scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
15
- setTableData: (nextTableData: RecordType[]) => void;
16
- clear: () => void;
17
- }>): void;
5
+ expose(exposed: ShallowUnwrapRef<EditableTableFormItemExpose>): void;
18
6
  attrs: any;
19
7
  slots: Readonly<{
20
8
  default: any;
@@ -1,15 +1,15 @@
1
- import { defineComponent as O, ref as c, unref as s, useSlots as K, toRef as G, watch as H, nextTick as U, createBlock as W, openBlock as $, mergeProps as h, withCtx as x, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
- import { Table as I } from "@aplus-frontend/antdv";
3
- import { ApForm as g } from "../ap-form/index.mjs";
4
- import { isArray as M, isUndefined as ee, isNumber as m, cloneDeep as oe, omit as w } from "lodash-unified";
1
+ import { defineComponent as G, ref as c, unref as s, useSlots as H, toRef as U, watch as W, nextTick as $, createBlock as q, openBlock as J, mergeProps as h, withCtx as w, createVNode as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as I, guardReactiveProps as M } from "vue";
2
+ import { Table as ee } from "@aplus-frontend/antdv";
3
+ import { ApForm as x } from "../ap-form/index.mjs";
4
+ import { isArray as g, isUndefined as oe, isNumber as m, cloneDeep as te, omit as y } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as te } from "../ap-form/context.mjs";
6
+ import { useInjectForm as ae } from "../ap-form/context.mjs";
7
7
  import { isDef as b } from "../utils/index.mjs";
8
- import ae from "./hooks/use-get-columns.mjs";
9
- import { scrollToRowIndex as le } from "./utils.mjs";
8
+ import le from "./hooks/use-get-columns.mjs";
9
+ import { scrollToRowIndex as ue } from "./utils.mjs";
10
10
  import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as ue } from "../config-provider/hooks/use-global-config.mjs";
12
- const we = /* @__PURE__ */ O({
11
+ import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
12
+ const ye = /* @__PURE__ */ G({
13
13
  name: "EditableTableInner",
14
14
  __name: "form-item",
15
15
  props: {
@@ -109,119 +109,127 @@ const we = /* @__PURE__ */ O({
109
109
  default: () => ({})
110
110
  }
111
111
  },
112
- setup(y, {
113
- expose: C
112
+ setup(C, {
113
+ expose: R
114
114
  }) {
115
- const l = y;
116
- function R(e, t) {
117
- return M(t) ? t.reduce((n, o) => n == null ? void 0 : n[o], e) : e == null ? void 0 : e[t];
115
+ const l = C;
116
+ function B(e, a) {
117
+ return g(a) ? a.reduce((u, t) => u == null ? void 0 : u[t], e) : e == null ? void 0 : e[a];
118
118
  }
119
119
  const {
120
- internalInstance: a,
121
- model: B
122
- } = te(), d = c(R(s(B), l.name) || []), F = K(), T = G(l, "name"), D = g.useWatch(T);
123
- H(() => D.value, async (e) => {
124
- var t;
125
- await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
120
+ internalInstance: o,
121
+ model: F
122
+ } = ae(), d = c(B(s(F), l.name) || []), T = H(), D = U(l, "name"), V = x.useWatch(D);
123
+ W(() => V.value, async (e) => {
124
+ var a;
125
+ await $(), d.value = e, (a = l.onChange) == null || a.call(l, e);
126
126
  }, {
127
127
  deep: !0
128
128
  });
129
129
  const {
130
130
  b: L
131
- } = ne("editable-table"), p = c(), V = ue("valueTypeMap"), N = ae(l, V);
132
- function S(e, t) {
133
- var u;
134
- const n = ((u = s(d)) == null ? void 0 : u.length) || 0;
135
- if (b(l.maxLength) && n >= l.maxLength)
131
+ } = ne("editable-table"), p = c(), S = fe("valueTypeMap"), v = le(l, S);
132
+ function N(e, a) {
133
+ var n;
134
+ const u = ((n = s(d)) == null ? void 0 : n.length) || 0;
135
+ if (b(l.maxLength) && u >= l.maxLength)
136
136
  return;
137
- const o = {
137
+ const t = {
138
138
  ...e || {}
139
139
  };
140
- a == null || a.setFieldValue(l.name, o, !0, (r, f) => {
141
- if (!r[f]) {
142
- r[f] = [o];
140
+ o == null || o.setFieldValue(l.name, t, !0, (f, r) => {
141
+ if (!f[r]) {
142
+ f[r] = [t];
143
143
  return;
144
144
  }
145
- ee(t) ? r[f].push(o) : r[f].splice(t, 0, o);
145
+ oe(a) ? f[r].push(t) : f[r].splice(a, 0, t);
146
146
  });
147
147
  }
148
- function k(e, t = "suffix") {
149
- var r;
150
- const n = ((r = s(d)) == null ? void 0 : r.length) || 0, o = m(e) ? e : e.length;
151
- if (b(l.maxLength) && n + o > l.maxLength)
148
+ function E(e, a = "suffix") {
149
+ var f;
150
+ const u = ((f = s(d)) == null ? void 0 : f.length) || 0, t = m(e) ? e : e.length;
151
+ if (b(l.maxLength) && u + t > l.maxLength)
152
152
  return;
153
- const u = m(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
154
- a == null || a.setFieldValue(l.name, u, !0, (f, i) => {
155
- if (!f[i]) {
156
- f[i] = [...u];
153
+ const n = m(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
154
+ o == null || o.setFieldValue(l.name, n, !0, (r, i) => {
155
+ if (!r[i]) {
156
+ r[i] = [...n];
157
157
  return;
158
158
  }
159
- t === "suffix" ? f[i].push(...u) : f[i].unshift(...u);
159
+ a === "suffix" ? r[i].push(...n) : r[i].unshift(...n);
160
160
  });
161
161
  }
162
- function v(e) {
163
- const t = new Set(m(e) ? [e] : e);
164
- a == null || a.setFieldValue(l.name, void 0, !0, (n, o) => {
165
- n[o] = n[o].filter((u, r) => !t.has(r));
162
+ function _(e) {
163
+ const a = new Set(m(e) ? [e] : e);
164
+ o == null || o.setFieldValue(l.name, void 0, !0, (u, t) => {
165
+ u[t] = u[t].filter((n, f) => !a.has(f));
166
166
  });
167
167
  }
168
- function E() {
168
+ function k(e) {
169
+ var u;
170
+ const a = new Set(g(e) ? e : [e]);
171
+ a.size !== 0 && ((u = o == null ? void 0 : o.setFieldValue) == null || u.call(o, l.name, void 0, !0, (t, n) => {
172
+ t[n] = t[n].filter((f) => !a.has(f[l.rowKey]));
173
+ }));
174
+ }
175
+ function j() {
169
176
  return s(d);
170
177
  }
171
- function _(e) {
172
- var t;
173
- return (t = s(d)) == null ? void 0 : t[e];
178
+ function z(e) {
179
+ var a;
180
+ return (a = s(d)) == null ? void 0 : a[e];
174
181
  }
175
- function j(e, t, n = !0) {
176
- a == null || a.setFieldValue(l.name, void 0, !0, (o, u) => {
177
- !o[u] || !o[u][e] || (o[u][e] = {
178
- ...n ? o[u][e] : {},
179
- ...t
182
+ function K(e, a, u = !0) {
183
+ o == null || o.setFieldValue(l.name, void 0, !0, (t, n) => {
184
+ !t[n] || !t[n][e] || (t[n][e] = {
185
+ ...u ? t[n][e] : {},
186
+ ...a
180
187
  });
181
188
  });
182
189
  }
183
190
  function P(e) {
184
- a == null || a.setFieldValue(l.name, e);
191
+ o == null || o.setFieldValue(l.name, e);
185
192
  }
186
- function z(e, t) {
187
- var o;
188
- const n = e === "end" ? d.value.length - 1 : e;
189
- le(n, (o = p.value) == null ? void 0 : o.$el, t);
193
+ function A(e, a) {
194
+ var t;
195
+ const u = e === "end" ? d.value.length - 1 : e;
196
+ ue(u, (t = p.value) == null ? void 0 : t.$el, a);
190
197
  }
191
- function A() {
198
+ function O() {
192
199
  var e;
193
- (e = a == null ? void 0 : a.setFieldValue) == null || e.call(a, l.name, []);
200
+ (e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
194
201
  }
195
- return C({
196
- add: S,
197
- remove: v,
198
- getRowData: _,
199
- getRowsData: E,
200
- setRowData: j,
201
- addMultiple: k,
202
- scrollTo: z,
202
+ return R({
203
+ add: N,
204
+ remove: _,
205
+ getRowData: z,
206
+ getRowsData: j,
207
+ setRowData: K,
208
+ addMultiple: E,
209
+ scrollTo: A,
203
210
  setTableData: P,
204
- clear: A
205
- }), (e, t) => ($(), W(s(g).FormItem, h(e.formItem, {
211
+ clear: O,
212
+ removeByKey: k
213
+ }), (e, a) => (J(), q(s(x).FormItem, h(e.formItem, {
206
214
  name: e.name,
207
215
  label: e.label
208
216
  }), {
209
- default: x(() => [q(s(I), h(s(w)(l, ["name", "maxLength", "onChange"]), {
217
+ default: w(() => [Q(s(ee), h(s(y)(l, ["name", "maxLength", "onChange"]), {
210
218
  ref_key: "tableRef",
211
219
  ref: p,
212
220
  class: s(L)(),
213
- columns: s(N),
221
+ columns: s(v),
214
222
  "data-source": d.value
215
- }), J({
223
+ }), X({
216
224
  _: 2
217
- }, [Q(s(w)(F, ["headerCell"]), (n, o) => ({
218
- name: o,
219
- fn: x((u) => [X(e.$slots, o, Y(Z(u || {})))])
225
+ }, [Y(s(y)(T, ["headerCell"]), (u, t) => ({
226
+ name: t,
227
+ fn: w((n) => [Z(e.$slots, t, I(M(n || {})))])
220
228
  }))]), 1040, ["class", "columns", "data-source"])]),
221
229
  _: 3
222
230
  }, 16, ["name", "label"]));
223
231
  }
224
232
  });
225
233
  export {
226
- we as default
234
+ ye as default
227
235
  };