@aplus-frontend/ui 6.39.2 → 6.41.0

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 (47) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +1 -0
  2. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  3. package/es/src/ag-grid/editable/interface.d.ts +1 -0
  4. package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
  5. package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
  6. package/es/src/ag-grid/index.vue.mjs +162 -153
  7. package/es/src/ag-grid/interface.d.ts +19 -1
  8. package/es/src/ag-grid/theme.d.ts +2 -1
  9. package/es/src/ag-grid/theme.mjs +12 -11
  10. package/es/src/ap-action/interface.d.ts +5 -1
  11. package/es/src/ap-action/item/index.vue2.mjs +17 -16
  12. package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
  13. package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
  14. package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
  15. package/es/src/ap-grid/utils/col.mjs +91 -82
  16. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  17. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  18. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
  19. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  20. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
  21. package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  25. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  26. package/lib/src/ag-grid/editable/interface.d.ts +1 -0
  27. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  28. package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
  29. package/lib/src/ag-grid/index.vue.js +1 -1
  30. package/lib/src/ag-grid/interface.d.ts +19 -1
  31. package/lib/src/ag-grid/theme.d.ts +2 -1
  32. package/lib/src/ag-grid/theme.js +1 -1
  33. package/lib/src/ap-action/interface.d.ts +5 -1
  34. package/lib/src/ap-action/item/index.vue2.js +1 -1
  35. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  36. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  37. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
  38. package/lib/src/ap-grid/utils/col.js +1 -1
  39. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
  40. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  41. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  42. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  43. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  44. package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +1 -1
@@ -116,6 +116,7 @@ const xe = /* @__PURE__ */ A({
116
116
  },
117
117
  onUpdate: {},
118
118
  customRow: {},
119
+ theme: {},
119
120
  columns: {},
120
121
  defaultValue: {},
121
122
  onChange: {},
@@ -114,6 +114,7 @@ const Re = /* @__PURE__ */ P({
114
114
  },
115
115
  onUpdate: {},
116
116
  customRow: {},
117
+ theme: {},
117
118
  columns: {},
118
119
  value: {},
119
120
  defaultValue: {},
@@ -38,6 +38,7 @@ export type EditableAgGridColumnType<RecordType = any, ExtraValueType = 'text',
38
38
  column: AgGridColumnType<RecordType>;
39
39
  editable?: boolean;
40
40
  originalNode?: VNode;
41
+ path: (string | number)[];
41
42
  }) => any;
42
43
  /**
43
44
  * 是否渲染必填标记(只渲染标记不生成校验规则)
@@ -1,5 +1,5 @@
1
- import { getTableRenderProps as h, objectToString as P } from "../../ap-table/utils.mjs";
2
- import { rendererMap as y } from "../renderer/index.mjs";
1
+ import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
2
+ import { rendererMap as h } from "../renderer/index.mjs";
3
3
  import { isNumber as f, isFunction as m } from "lodash-unified";
4
4
  import { ref as R, unref as x, computed as T } from "vue";
5
5
  import "../components/body-cell/index.vue.mjs";
@@ -16,20 +16,20 @@ import v from "../components/header-cell/index.vue2.mjs";
16
16
  function F(t) {
17
17
  return f(t) && t > 1;
18
18
  }
19
- function M(t, a) {
20
- if (a.bodyCellTooltip)
21
- return m(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
22
- if (a.renderText)
23
- return a.renderText({
19
+ function M(t, o) {
20
+ if (o.bodyCellTooltip)
21
+ return m(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
22
+ if (o.renderText)
23
+ return o.renderText({
24
24
  value: t.value,
25
25
  record: t.data,
26
- column: a,
26
+ column: o,
27
27
  text: t.value
28
28
  });
29
- const n = a.valueType || "text", d = y[n];
29
+ const n = o.valueType || "text", d = h[n];
30
30
  if (d) {
31
- const p = h(
32
- { ...a, valueType: n },
31
+ const p = y(
32
+ { ...o, valueType: n },
33
33
  {
34
34
  value: t.value,
35
35
  text: t.value,
@@ -43,17 +43,18 @@ function M(t, a) {
43
43
  }
44
44
  return P(t.value);
45
45
  }
46
- const X = (t, a, n) => {
46
+ const X = (t, o, n) => {
47
47
  const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
48
- const o = {
48
+ const a = {
49
49
  cellRenderer: W,
50
50
  cellRendererParams: {
51
51
  column: r,
52
- extraValueType: x(d)
52
+ extraValueType: x(d),
53
+ rowKey: o.rowKey
53
54
  }
54
55
  };
55
56
  if (r.customRender)
56
- return o;
57
+ return a;
57
58
  if (r.renderText)
58
59
  return {
59
60
  valueFormatter: (i) => r.renderText({
@@ -63,10 +64,10 @@ const X = (t, a, n) => {
63
64
  text: i.value
64
65
  })
65
66
  };
66
- const l = r.valueType || "text", e = y[l];
67
+ const l = r.valueType || "text", e = h[l];
67
68
  return e ? {
68
69
  valueFormatter: (i) => {
69
- const s = h(
70
+ const s = y(
70
71
  { ...r, valueType: l },
71
72
  {
72
73
  value: i.value,
@@ -79,18 +80,18 @@ const X = (t, a, n) => {
79
80
  );
80
81
  return e(s);
81
82
  }
82
- } : o;
83
+ } : a;
83
84
  }, b = (r) => {
84
- const o = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
85
- return o.tooltipValueGetter = l ? (s) => M(s, r) : void 0, o.wrapText = !r.ellipsis || e, o.cellStyle = {
85
+ const a = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
86
+ return a.tooltipValueGetter = l ? (s) => M(s, r) : void 0, a.wrapText = !r.ellipsis || e, a.cellStyle = {
86
87
  "--ag-grid-line-clamp": i
87
- }, o.tooltipComponent = z, o.tooltipComponentParams = {
88
+ }, a.tooltipComponent = z, a.tooltipComponentParams = {
88
89
  lineClamp: i,
89
90
  gridWrapperRef: u
90
- }, o;
91
+ }, a;
91
92
  }, g = T(() => {
92
93
  const r = x(t);
93
- function o(l) {
94
+ function a(l) {
94
95
  return l.map((e) => {
95
96
  const i = {
96
97
  field: S(e.dataIndex),
@@ -130,15 +131,15 @@ const X = (t, a, n) => {
130
131
  headerGroupComponentParams: {
131
132
  column: e
132
133
  },
133
- children: o(e.children)
134
+ children: a(e.children)
134
135
  } : i;
135
136
  });
136
137
  }
137
- return o(r);
138
+ return a(r);
138
139
  }), w = T(
139
140
  () => ({
140
141
  headerComponent: v,
141
- resizable: a.columnResizable,
142
+ resizable: o.columnResizable,
142
143
  suppressMovable: !0,
143
144
  cellDataType: !1
144
145
  })
@@ -1,93 +1,99 @@
1
- import { unref as w, computed as E } from "vue";
2
- import { isFunction as F, isArray as g } from "lodash-unified";
3
- import { mergeClass as p, getColumnIsRequired as v } from "../../editable-table/utils.mjs";
1
+ import { unref as k, computed as w } from "vue";
2
+ import { isArray as m, isFunction as E } from "lodash-unified";
3
+ import { mergeClass as F, getColumnIsRequired as v } from "../../editable-table/utils.mjs";
4
4
  import { updateFormProps as y, getFieldProps as q } from "../../ap-table/utils.mjs";
5
5
  import { getFinalEditableNode as A } from "../../ap-grid/utils/editable.mjs";
6
6
  import { isDef as K } from "../../utils/index.mjs";
7
7
  import { getRowKey as M } from "../editable/utils.mjs";
8
- function m(t, r, n) {
9
- t.__skipNextRefresh ? t.__skipNextRefresh[r] = n : t.__skipNextRefresh = { [r]: n };
8
+ function b(t, i, r) {
9
+ t.__skipNextRefresh ? t.__skipNextRefresh[i] = r : t.__skipNextRefresh = { [i]: r };
10
10
  }
11
- function D(t, r, n) {
12
- t.__prevEditable ? t.__prevEditable[r] = n : t.__prevEditable = { [r]: n };
11
+ function S(t, i, r) {
12
+ t.__prevEditable ? t.__prevEditable[i] = r : t.__prevEditable = { [i]: r };
13
13
  }
14
- const J = (t, r, n) => {
15
- function h(e) {
16
- return !e.editable || e.children?.length ? {} : {
17
- customRender({ value: f, originalNode: d, params: o, ...i }) {
18
- const s = F(e.editable) ? e.editable(
19
- i.text,
20
- i.record,
21
- i.rowIndex
14
+ const J = (t, i, r) => {
15
+ function I(e) {
16
+ const s = e.editable, o = r ? [r] : m(t.name) ? t.name : [t.name];
17
+ return !s || e.children?.length ? {
18
+ _path: [...o]
19
+ } : {
20
+ customRender({ value: d, originalNode: C, params: a, ...n }) {
21
+ const c = E(e.editable) ? e.editable(
22
+ n.text,
23
+ n.record,
24
+ n.rowIndex
22
25
  ) : !!e.editable;
23
- let c = d;
24
- if (s) {
25
- const u = y(
26
+ let u = C;
27
+ const R = m(e.dataIndex) ? e.dataIndex : [e.dataIndex], x = M(
28
+ n.record,
29
+ n.rowIndex,
30
+ t.rowKey
31
+ );
32
+ if (c) {
33
+ const _ = y(
26
34
  e,
27
35
  q(e.fieldProps, {
28
- value: f,
29
- ...i
36
+ value: d,
37
+ ...n
30
38
  })
31
- ), b = {};
32
- t.onFieldChange && (b[`onUpdate:${u.valuePropName || "value"}`] = (k) => t.onFieldChange?.(
33
- i.rowIndex,
39
+ ), h = {};
40
+ t.onFieldChange && (h[`onUpdate:${_.valuePropName || "value"}`] = (N) => t.onFieldChange?.(
41
+ n.rowIndex,
34
42
  e.dataIndex,
35
- k
43
+ N
36
44
  ));
37
- const I = g(e.dataIndex) ? e.dataIndex : [e.dataIndex], C = n ? [n] : g(t.name) ? t.name : [t.name], R = M(
38
- i.record,
39
- i.rowIndex,
40
- t.rowKey
41
- ), N = {
42
- name: [...C, String(R), ...I],
43
- ...u || {},
45
+ const p = {
46
+ name: [...o, String(x), ...R],
47
+ ..._ || {},
44
48
  field: {
45
49
  style: "width: 100%",
46
- ...u?.field || {},
47
- ...b,
48
- class: p("is-editable", u.class)
50
+ ..._?.field || {},
51
+ ...h,
52
+ class: F("is-editable", _.class)
49
53
  }
50
54
  };
51
- c = A(
55
+ u = A(
52
56
  e,
53
- N,
54
- i.record,
55
- w(r)
57
+ p,
58
+ n.record,
59
+ k(i)
56
60
  );
57
61
  }
58
- e.customRender && (c = e.customRender({
59
- value: f,
60
- ...i,
61
- editable: s,
62
- originalNode: c,
63
- index: i.rowIndex,
64
- renderIndex: i.rowIndex
62
+ e.customRender && (u = e.customRender({
63
+ value: d,
64
+ ...n,
65
+ editable: c,
66
+ originalNode: u,
67
+ index: n.rowIndex,
68
+ renderIndex: n.rowIndex,
69
+ path: [...o, String(x)]
65
70
  }));
66
- const a = o.node, l = o.column.getColId(), _ = a.__prevEditable?.[l];
67
- return !a.__skipNextRefresh?.[l] && K(_) && _ !== s && (m(a, l, !0), setTimeout(() => {
68
- o?.api.refreshCells({
69
- rowNodes: [o.node],
70
- columns: [o.column.getColId()],
71
+ const l = a.node, f = a.column.getColId(), g = l.__prevEditable?.[f];
72
+ return !l.__skipNextRefresh?.[f] && K(g) && g !== c && (b(l, f, !0), setTimeout(() => {
73
+ a?.api.refreshCells({
74
+ rowNodes: [a.node],
75
+ columns: [a.column.getColId()],
71
76
  force: !0
72
- }), m(a, l, !1);
73
- }, 0)), D(a, l, s), c;
74
- }
77
+ }), b(l, f, !1);
78
+ }, 0)), S(l, f, c), u;
79
+ },
80
+ _path: [...o]
75
81
  };
76
82
  }
77
- return E(() => {
83
+ return w(() => {
78
84
  const e = t.columns;
79
85
  if (!e)
80
86
  return [];
81
- function x(f) {
82
- return f.map((d) => ({
87
+ function s(o) {
88
+ return o.map((d) => ({
83
89
  ...d,
84
90
  _requireMark: v(d),
85
- children: x(d.children || []),
91
+ children: s(d.children || []),
86
92
  // 处理可编辑/不可编辑下的单元格渲染
87
- ...h(d)
93
+ ...I(d)
88
94
  }));
89
95
  }
90
- return x(e);
96
+ return s(e);
91
97
  });
92
98
  };
93
99
  export {