@aplus-frontend/ui 6.40.0 → 7.0.0-beta.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 (77) 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 +38 -33
  7. package/es/src/ag-grid/interface.d.ts +12 -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/item/index.vue2.mjs +14 -12
  11. package/es/src/ap-action/style/index.d.ts +8 -0
  12. package/es/src/ap-action/style/index.js +61 -0
  13. package/es/src/ap-action/style/index.mjs +74 -0
  14. package/es/src/ap-grid/utils/col.mjs +91 -82
  15. package/es/src/config-provider/config-provider-props.d.ts +7 -0
  16. package/es/src/config-provider/config-provider-props.mjs +6 -0
  17. package/es/src/config-provider/config-provider.d.ts +7 -0
  18. package/es/src/config-provider/config-provider.mjs +11 -10
  19. package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
  20. package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
  21. package/es/src/config-provider/hooks/use-token.d.ts +4 -0
  22. package/es/src/config-provider/hooks/use-token.mjs +6 -0
  23. package/es/src/config-provider/index.d.ts +10 -0
  24. package/es/src/design-token/constants.d.ts +2 -0
  25. package/es/src/design-token/constants.mjs +44 -0
  26. package/es/src/design-token/interface.d.ts +123 -0
  27. package/es/src/style/index.d.ts +3 -0
  28. package/es/src/style/index.js +12 -0
  29. package/es/src/style/index.mjs +13 -0
  30. package/es/src/utils/cssinjs/index.d.ts +8 -0
  31. package/es/src/utils/cssinjs/index.mjs +56 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  35. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  36. package/lib/src/ag-grid/editable/interface.d.ts +1 -0
  37. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  38. package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
  39. package/lib/src/ag-grid/index.vue.js +1 -1
  40. package/lib/src/ag-grid/interface.d.ts +12 -1
  41. package/lib/src/ag-grid/theme.d.ts +2 -1
  42. package/lib/src/ag-grid/theme.js +1 -1
  43. package/lib/src/ap-action/item/index.vue2.js +1 -1
  44. package/lib/src/ap-action/style/index.cjs +61 -0
  45. package/lib/src/ap-action/style/index.d.ts +8 -0
  46. package/lib/src/ap-action/style/index.js +1 -0
  47. package/lib/src/ap-grid/utils/col.js +1 -1
  48. package/lib/src/config-provider/config-provider-props.d.ts +7 -0
  49. package/lib/src/config-provider/config-provider-props.js +1 -1
  50. package/lib/src/config-provider/config-provider.d.ts +7 -0
  51. package/lib/src/config-provider/config-provider.js +1 -1
  52. package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
  53. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  54. package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
  55. package/lib/src/config-provider/hooks/use-token.js +1 -0
  56. package/lib/src/config-provider/index.d.ts +10 -0
  57. package/lib/src/design-token/constants.d.ts +2 -0
  58. package/lib/src/design-token/constants.js +1 -0
  59. package/lib/src/design-token/interface.d.ts +123 -0
  60. package/lib/src/style/index.cjs +12 -0
  61. package/lib/src/style/index.d.ts +3 -0
  62. package/lib/src/style/index.js +1 -0
  63. package/lib/src/utils/cssinjs/index.d.ts +8 -0
  64. package/lib/src/utils/cssinjs/index.js +1 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +3 -1
  68. package/theme/ag-grid/index.css +0 -56
  69. package/theme/ag-grid-modal/index.css +0 -56
  70. package/theme/ap-action/item.css +0 -56
  71. package/theme/ap-action/item.less +1 -58
  72. package/theme/ap-grid/index.css +0 -56
  73. package/theme/ap-table/ap-table.css +0 -56
  74. package/theme/ap-table-modal/index.css +0 -56
  75. package/theme/editable-table/index.css +0 -56
  76. package/theme/index.css +0 -56
  77. package/theme/index.less +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 {
@@ -1,9 +1,9 @@
1
- import { defineComponent as io, useSlots as uo, ref as N, toRef as T, unref as t, computed as n, nextTick as z, watch as M, createElementBlock as W, openBlock as b, normalizeStyle as O, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as G, mergeProps as H, createSlots as co, withCtx as ne, Fragment as mo, renderList as po, createBlock as se, resolveDynamicComponent as fo, renderSlot as ie, withDirectives as go, vShow as wo } from "vue";
1
+ import { defineComponent as io, useSlots as uo, ref as T, toRef as b, unref as t, computed as n, nextTick as z, watch as M, createElementBlock as W, openBlock as F, normalizeStyle as O, normalizeClass as f, createCommentVNode as le, createElementVNode as B, createVNode as G, mergeProps as H, createSlots as co, withCtx as ne, Fragment as mo, renderList as po, createBlock as se, resolveDynamicComponent as fo, renderSlot as ie, withDirectives as go, vShow as wo } from "vue";
2
2
  import { AgGridVue as So } from "ag-grid-vue3";
3
3
  import { ModuleRegistry as yo, AllCommunityModule as ho } from "ag-grid-community";
4
4
  import { mergeProps as Co } from "./utils.mjs";
5
5
  import { Spin as vo, Pagination as Ro } from "@aplus-frontend/antdv";
6
- import { isUndefined as B, isFunction as D } from "lodash-unified";
6
+ import { isUndefined as k, isFunction as D } from "lodash-unified";
7
7
  import "../config-provider/index.mjs";
8
8
  import { ApForm as bo } from "../ap-form/index.mjs";
9
9
  import { recursionApColumns as Fo } from "../ap-table/utils.mjs";
@@ -100,19 +100,24 @@ const vt = /* @__PURE__ */ io({
100
100
  rowClassRules: {},
101
101
  autoHeight: { type: Boolean },
102
102
  onUpdate: {},
103
- customRow: {}
103
+ customRow: {},
104
+ theme: {}
104
105
  },
105
106
  setup(de, { expose: ce }) {
106
107
  yo.registerModules([ho]);
107
- const o = de, L = uo(), { e: k, b: d, be: me } = Go("ag-grid"), h = N(o.size), pe = Eo(h, T(o, "rowHeight")), fe = Mo(T(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Wo(
108
- T(o, "summary")
109
- ), we = Ho("apGrid"), s = N(), [, Se] = Do();
108
+ const o = de, L = uo(), { e: x, b: d, be: me } = Go("ag-grid"), h = T(o.size), pe = Eo(
109
+ h,
110
+ b(o, "rowHeight"),
111
+ b(o, "theme")
112
+ ), fe = Mo(b(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Wo(
113
+ b(o, "summary")
114
+ ), we = Ho("apGrid"), s = T(), [, Se] = Do();
110
115
  let C = !!o.dataSource;
111
- const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge), x = N({});
116
+ const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge), I = T({});
112
117
  xo({
113
- sorter: x,
118
+ sorter: I,
114
119
  setSorter(e) {
115
- x.value = e;
120
+ I.value = e;
116
121
  }
117
122
  });
118
123
  const be = {
@@ -120,7 +125,7 @@ const vt = /* @__PURE__ */ io({
120
125
  desc: "descend"
121
126
  };
122
127
  function Fe() {
123
- const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
128
+ const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(I) || {};
124
129
  let a = e?.[0];
125
130
  const i = Object.keys(r);
126
131
  if (i.length && i.every((c) => r[c] === null)) {
@@ -140,7 +145,7 @@ const vt = /* @__PURE__ */ io({
140
145
  if (e.sorter === !0)
141
146
  return e.field ?? e.dataIndex ?? e.key;
142
147
  }).filter(Boolean)), ke = () => {
143
- x.value = {};
148
+ I.value = {};
144
149
  const e = s.value;
145
150
  if (!e)
146
151
  return;
@@ -160,7 +165,7 @@ const vt = /* @__PURE__ */ io({
160
165
  setDataSource: Te
161
166
  } = Bo({
162
167
  async request(e) {
163
- if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && V(), !B(o.dataSource)) {
168
+ if (C = !1, y.value && !y.value.preserveSelectedRowKeys && k(o.dataSource) && V(), !k(o.dataSource)) {
164
169
  const a = e.pageSize * (e.current - 1);
165
170
  return {
166
171
  data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
@@ -174,8 +179,8 @@ const vt = /* @__PURE__ */ io({
174
179
  };
175
180
  },
176
181
  namespace: "ap-grid",
177
- filterFields: N([]),
178
- params: T(o, "params"),
182
+ filterFields: T([]),
183
+ params: b(o, "params"),
179
184
  defaultData: o.defaultData,
180
185
  manual: t(xe),
181
186
  formatParams: o.beforeSearchSubmit,
@@ -190,7 +195,7 @@ const vt = /* @__PURE__ */ io({
190
195
  ...e
191
196
  };
192
197
  }), De = Oo(o, g), Ee = n(
193
- () => B(o.dataSource) ? S.records : o.dataSource
198
+ () => k(o.dataSource) ? S.records : o.dataSource
194
199
  ), {
195
200
  select: Ke,
196
201
  unSelect: Pe,
@@ -221,7 +226,7 @@ const vt = /* @__PURE__ */ io({
221
226
  function A(e) {
222
227
  return D(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
223
228
  }
224
- const I = ({
229
+ const N = ({
225
230
  api: e = s.value
226
231
  }) => {
227
232
  if (o.onUpdate?.(), !y.value)
@@ -249,7 +254,7 @@ const vt = /* @__PURE__ */ io({
249
254
  };
250
255
  function Ue(e) {
251
256
  ze(e), z(() => {
252
- I({});
257
+ N({});
253
258
  });
254
259
  }
255
260
  const je = n(() => {
@@ -264,12 +269,12 @@ const vt = /* @__PURE__ */ io({
264
269
  });
265
270
  function $e(e) {
266
271
  Me(e), z(() => {
267
- I({});
272
+ N({});
268
273
  });
269
274
  }
270
275
  function qe(e) {
271
276
  We(e), z(() => {
272
- I({});
277
+ N({});
273
278
  });
274
279
  }
275
280
  function X(e = !1) {
@@ -344,7 +349,7 @@ const vt = /* @__PURE__ */ io({
344
349
  resetSearchFormSorterItems: oe
345
350
  });
346
351
  const Je = n(
347
- () => B(o.loading) ? S.loading : o.loading
352
+ () => k(o.loading) ? S.loading : o.loading
348
353
  ), Qe = n(() => [
349
354
  d(),
350
355
  o.card ? null : d("wrapper"),
@@ -430,13 +435,13 @@ const vt = /* @__PURE__ */ io({
430
435
  refreshCells: ao,
431
436
  redrawRows: lo,
432
437
  _internalGridApi: n(() => s.value)
433
- }), (e, r) => (b(), W("div", {
438
+ }), (e, r) => (F(), W("div", {
434
439
  class: f(Qe.value),
435
440
  style: O(e.wrapperStyle)
436
441
  }, [
437
- t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), W("div", {
442
+ t(k)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (F(), W("div", {
438
443
  key: 0,
439
- class: f(e.card ? t(k)("search-wrapper") : null),
444
+ class: f(e.card ? t(x)("search-wrapper") : null),
440
445
  style: O(e.searchFormWrapperStyle)
441
446
  }, [
442
447
  G(t(bo).SearchForm, H(e.searchForm || {}, {
@@ -448,7 +453,7 @@ const vt = /* @__PURE__ */ io({
448
453
  onReset: t(K)
449
454
  }), co({
450
455
  default: ne(() => [
451
- (b(!0), W(mo, null, po(t(j), (a) => (b(), se(fo(a.renderNode), {
456
+ (F(!0), W(mo, null, po(t(j), (a) => (F(), se(fo(a.renderNode), {
452
457
  key: a.dataIndex
453
458
  }))), 128))
454
459
  ]),
@@ -463,11 +468,11 @@ const vt = /* @__PURE__ */ io({
463
468
  } : void 0
464
469
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
465
470
  ], 6)) : le("", !0),
466
- F("div", {
467
- class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
471
+ B("div", {
472
+ class: f([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
468
473
  style: O(e.tableWrapperStyle)
469
474
  }, [
470
- F("div", {
475
+ B("div", {
471
476
  class: f(t(d)("header-wrapper"))
472
477
  }, [
473
478
  ie(e.$slots, "title", {
@@ -477,7 +482,7 @@ const vt = /* @__PURE__ */ io({
477
482
  clearAll: V
478
483
  })
479
484
  ], 2),
480
- F("div", {
485
+ B("div", {
481
486
  ref_key: "gridWrapperRef",
482
487
  ref: Re,
483
488
  class: f(t(d)("grid-wrapper"))
@@ -505,25 +510,25 @@ const vt = /* @__PURE__ */ io({
505
510
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
506
511
  onSortChanged: Fe,
507
512
  onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
508
- onRowDataUpdated: I,
513
+ onRowDataUpdated: N,
509
514
  onRowSelected: He,
510
515
  onFirstDataRendered: Le,
511
516
  onRowClicked: to,
512
517
  onBodyScrollEnd: ro
513
518
  }
514
519
  ), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
515
- go(F("div", {
516
- class: f(t(k)("table-loading-wrapper"))
520
+ go(B("div", {
521
+ class: f(t(x)("table-loading-wrapper"))
517
522
  }, [
518
523
  G(t(vo), { delay: 300 })
519
524
  ], 2), [
520
525
  [wo, Je.value]
521
526
  ])
522
527
  ], 2),
523
- F("div", {
528
+ B("div", {
524
529
  class: f(t(d)("pagination-wrapper"))
525
530
  }, [
526
- e.pagination !== !1 ? (b(), se(t(Ro), H({
531
+ e.pagination !== !1 ? (F(), se(t(Ro), H({
527
532
  key: 0,
528
533
  class: t(d)("pagination")
529
534
  }, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
4
4
  import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
7
- import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
7
+ import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
8
8
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
9
9
  export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
10
10
  children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
@@ -84,6 +84,7 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
84
84
  pinned?: boolean;
85
85
  rowIndex?: number;
86
86
  params?: ICellRendererParams;
87
+ path?: (string | number)[];
87
88
  }) => any;
88
89
  width?: number;
89
90
  minWidth?: number;
@@ -111,6 +112,11 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
111
112
  * 自定表头列类名
112
113
  */
113
114
  headerClass?: ColDef<RecordType>['headerClass'];
115
+ /**
116
+ * 当单元格可编辑时,记录表单项的namePath
117
+ * @private 仅限内部使用,请勿传递
118
+ */
119
+ _path?: (string | number)[];
114
120
  } : null;
115
121
  export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
116
122
  /**
@@ -319,6 +325,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
319
325
  * @since 6.37.0
320
326
  */
321
327
  customRow?: AgGridCustomRowConfig;
328
+ /**
329
+ * 自定义主题
330
+ * @since 6.41.0
331
+ */
332
+ theme?: Partial<ThemeDefaultParams>;
322
333
  };
323
334
  export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
324
335
  /**
@@ -1,3 +1,4 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
+ import { AgGridProps } from './interface';
2
3
  import { Theme, ThemeDefaultParams } from 'ag-grid-community';
3
- export declare const useTheme: (size: Ref<"medium" | "mini" | undefined>, rowHeight: Ref<undefined | number>) => ComputedRef<Theme<ThemeDefaultParams>>;
4
+ export declare const useTheme: (size: Ref<"medium" | "mini" | undefined>, rowHeight: Ref<undefined | number>, customTheme: Ref<AgGridProps["theme"]>) => ComputedRef<Theme<ThemeDefaultParams>>;
@@ -1,16 +1,14 @@
1
- import { useToken as d } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { themeQuartz as n } from "ag-grid-community";
3
- import { computed as c } from "vue";
4
- const h = (o, r) => {
5
- const [, a] = d();
6
- return c(() => {
7
- const t = o.value === "mini", e = a.value;
8
- return n.withParams({
1
+ import { useToken as n } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { themeQuartz as c } from "ag-grid-community";
3
+ import { computed as l } from "vue";
4
+ const h = (o, r, a) => {
5
+ const [, t] = n();
6
+ return l(() => {
7
+ const d = o.value === "mini", e = t.value;
8
+ return c.withParams({
9
9
  headerHeight: "36px",
10
10
  headerFontSize: "12px",
11
11
  dataFontSize: "12px",
12
- rowHeight: r.value,
13
- spacing: t ? "5px" : "6.5px",
14
12
  foregroundColor: e.colorTextBase,
15
13
  wrapperBorder: !1,
16
14
  rowBorder: { color: e.colorBorderSecondary },
@@ -21,7 +19,10 @@ const h = (o, r) => {
21
19
  headerBackgroundColor: "var(--ap-table-header-bg)",
22
20
  headerColumnResizeHandleHeight: "50%",
23
21
  headerColumnResizeHandleWidth: "1px",
24
- wrapperBorderRadius: "4px"
22
+ wrapperBorderRadius: "4px",
23
+ ...a.value || {},
24
+ rowHeight: r.value,
25
+ spacing: d ? "5px" : "6.5px"
25
26
  });
26
27
  });
27
28
  };