@aplus-frontend/ui 7.15.7 → 7.16.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 (49) hide show
  1. package/es/src/ag-grid/components/header-cell/index.vue2.mjs +56 -41
  2. package/es/src/ag-grid/context.d.ts +8 -0
  3. package/es/src/ag-grid/context.mjs +18 -7
  4. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  5. package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
  6. package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
  7. package/es/src/ag-grid/index.vue.mjs +270 -255
  8. package/es/src/ag-grid/interface.d.ts +20 -1
  9. package/es/src/ag-grid/style/custom-header.mjs +22 -13
  10. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
  11. package/es/src/ap-table/style/setting.mjs +30 -27
  12. package/es/src/business/ag-grid-modal/interface.d.ts +3 -1
  13. package/es/src/business/ag-grid-modal/utils.d.ts +3 -1
  14. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +32 -31
  15. package/es/src/business/ap-view/ap-view.vue2.mjs +17 -17
  16. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
  17. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +20 -20
  18. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +38 -38
  19. package/es/src/business/ap-view/hooks/use-view-provide.d.ts +1 -1
  20. package/es/src/locale/lang/en.mjs +1 -0
  21. package/es/src/locale/lang/zh-cn.mjs +1 -0
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
  25. package/lib/src/ag-grid/context.d.ts +8 -0
  26. package/lib/src/ag-grid/context.js +1 -1
  27. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  28. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  29. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  30. package/lib/src/ag-grid/index.vue.js +1 -1
  31. package/lib/src/ag-grid/interface.d.ts +20 -1
  32. package/lib/src/ag-grid/style/custom-header.js +1 -1
  33. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  34. package/lib/src/ap-table/style/setting.js +1 -1
  35. package/lib/src/business/ag-grid-modal/interface.d.ts +3 -1
  36. package/lib/src/business/ag-grid-modal/utils.d.ts +3 -1
  37. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  38. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  39. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
  40. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  41. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  42. package/lib/src/business/ap-view/hooks/use-view-provide.d.ts +1 -1
  43. package/lib/src/locale/lang/en.js +1 -1
  44. package/lib/src/locale/lang/zh-cn.js +1 -1
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +6 -6
  48. package/es/test/setup.d.ts +0 -1
  49. package/lib/test/setup.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  import { TableProps } from '@aplus-frontend/antdv';
2
2
  import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
3
- import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
3
+ import { AgColumn, ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
4
4
  import { ComputedRef, CSSProperties, VNode } from 'vue';
5
5
  import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
6
6
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
@@ -89,6 +89,10 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
89
89
  width?: number;
90
90
  minWidth?: number;
91
91
  maxWidth?: number;
92
+ /**
93
+ * @since 7.16.0
94
+ */
95
+ flex?: number;
92
96
  colSpan?: ColDef<RecordType>['colSpan'];
93
97
  spanRows?: ColDef<RecordType>['spanRows'];
94
98
  /**
@@ -122,6 +126,17 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
122
126
  * @private 仅限内部使用,请勿传递
123
127
  */
124
128
  _path?: (string | number)[];
129
+ /**
130
+ * 作为子列时的显示策略
131
+ * open: 仅展开时显示
132
+ * closed: 仅关闭时显示
133
+ * null,undefined: 总是显示
134
+ */
135
+ columnGroupShow?: 'open' | 'closed';
136
+ /**
137
+ * 是否锁定固定(设置后不可以通过表格设置修改其固定属性)
138
+ */
139
+ lockFixed?: boolean;
125
140
  } : null;
126
141
  export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
127
142
  /**
@@ -500,4 +515,8 @@ export type AgGridSlots<RecordType> = {
500
515
  shownColumns: AgGridColumnType<RecordType>[];
501
516
  clearAll: () => void;
502
517
  }) => any;
518
+ headerCell?: (props: {
519
+ title: any;
520
+ column: Omit<AgColumn, keyof AgGridColumnType> & AgGridColumnType;
521
+ }) => void;
503
522
  };
@@ -1,8 +1,8 @@
1
1
  import { genComponentStyleHook as o } from "../../utils/cssinjs/index.mjs";
2
- const t = (e) => {
3
- const { componentCls: r } = e;
2
+ const n = (r) => {
3
+ const { componentCls: e } = r;
4
4
  return {
5
- [r]: {
5
+ [e]: {
6
6
  display: "flex",
7
7
  flexDirection: "row",
8
8
  flexWrap: "nowrap",
@@ -17,31 +17,40 @@ const t = (e) => {
17
17
  "&.align-right": {
18
18
  justifyContent: "end"
19
19
  },
20
- [`${r}__sort-wrapper`]: {
20
+ [`${e}__sort-wrapper`]: {
21
21
  display: "inline-flex",
22
22
  flexDirection: "column",
23
23
  alignItems: "center",
24
24
  color: "rgba(0, 0, 0, 0.3)",
25
- marginInlineStart: e.spaceXS,
25
+ marginInlineStart: r.spaceXS,
26
26
  "&:hover": {
27
27
  color: "rgba(0, 0, 0, 0.6)"
28
28
  }
29
29
  },
30
- [`${r}__sorter-up.active`]: {
31
- color: e.colorPrimary
30
+ [`${e}__expand-wrapper`]: {
31
+ padding: r.spaceXS,
32
+ cursor: "pointer",
33
+ display: "flex",
34
+ borderRadius: r.borderRadiusXS,
35
+ "&:hover": {
36
+ background: r.colorBg1
37
+ }
38
+ },
39
+ [`${e}__sorter-up.active`]: {
40
+ color: r.colorPrimary
32
41
  },
33
- [`${r}__sorter-down`]: {
42
+ [`${e}__sorter-down`]: {
34
43
  marginTop: "-0.3em",
35
44
  "&.active": {
36
- color: e.colorPrimary
45
+ color: r.colorPrimary
37
46
  }
38
47
  }
39
48
  }
40
49
  };
41
- }, l = o("AgGrid.CustomHeader", (e) => [
42
- t(e)
50
+ }, a = o("AgGrid.CustomHeader", (r) => [
51
+ n(r)
43
52
  ]);
44
53
  export {
45
- l as default,
46
- t as genAgGridCustomHeaderCellStyle
54
+ a as default,
55
+ n as genAgGridCustomHeaderCellStyle
47
56
  };
@@ -1,14 +1,15 @@
1
- import { defineComponent as B, createElementBlock as v, openBlock as n, normalizeClass as t, unref as e, createElementVNode as p, createVNode as s, createCommentVNode as c, createBlock as r, resolveDynamicComponent as E, withCtx as u } from "vue";
2
- import { HolderOutlined as I, VerticalAlignTopOutlined as g, VerticalAlignMiddleOutlined as O, DeleteOutlined as D } from "@ant-design/icons-vue";
3
- import { Space as z, Tooltip as f } from "@aplus-frontend/antdv";
1
+ import { defineComponent as E, computed as O, createElementBlock as k, openBlock as s, normalizeClass as a, unref as e, createElementVNode as f, createVNode as r, createCommentVNode as u, createBlock as d, resolveDynamicComponent as A, withCtx as p } from "vue";
2
+ import { HolderOutlined as D, VerticalAlignTopOutlined as b, VerticalAlignMiddleOutlined as j, DeleteOutlined as z } from "@ant-design/icons-vue";
3
+ import { Space as M, Tooltip as m } from "@aplus-frontend/antdv";
4
+ import { useInjectApTable as S } from "../../../context.mjs";
4
5
  import "../../../../config-provider/index.mjs";
5
- import A from "../images/icon_carst_down.svg.mjs";
6
- import M from "../images/icon_fill_right.svg.mjs";
7
- import { useInjectSorterMethods as S } from "../sorter/context.mjs";
8
- import { getLabelRenderNode as U } from "../utils.mjs";
9
- import { useNamespace as j } from "../../../../config-provider/hooks/use-namespace.mjs";
10
- import { useLocale as H } from "../../../../config-provider/hooks/use-locale.mjs";
11
- const q = ["src"], ee = /* @__PURE__ */ B({
6
+ import U from "../images/icon_carst_down.svg.mjs";
7
+ import H from "../images/icon_fill_right.svg.mjs";
8
+ import { useInjectSorterMethods as q } from "../sorter/context.mjs";
9
+ import { getLabelRenderNode as G } from "../utils.mjs";
10
+ import { useNamespace as J } from "../../../../config-provider/hooks/use-namespace.mjs";
11
+ import { useLocale as K } from "../../../../config-provider/hooks/use-locale.mjs";
12
+ const P = ["src"], ne = /* @__PURE__ */ E({
12
13
  __name: "item",
13
14
  props: {
14
15
  value: {},
@@ -17,107 +18,127 @@ const q = ["src"], ee = /* @__PURE__ */ B({
17
18
  open: { type: Boolean }
18
19
  },
19
20
  emits: ["update:open", "update:value"],
20
- setup(k, { emit: b }) {
21
- const o = k, x = b, { b: a, be: m, is: C } = j("ap-column-setting-sortable-item-meta"), { fixedToLeft: T, fixedToRight: w, unFixed: V } = S(), { t: d } = H();
21
+ setup(g, { emit: x }) {
22
+ const o = g, T = x, { b: t, be: v, is: y } = J("ap-column-setting-sortable-item-meta"), { fixedToLeft: C, fixedToRight: w, unFixed: F } = q(), { columnsBackup: V } = S(), { t: c } = K(), n = O(() => {
23
+ const l = V?.value.find(
24
+ (i) => o.value.key === i.key
25
+ );
26
+ return l ? l.lockFixed ?? !1 : !1;
27
+ });
22
28
  function h(l) {
23
29
  const i = o.value;
24
30
  return i.fixed = l, i.children?.forEach((N) => N.fixed = l), i;
25
31
  }
26
- function y() {
32
+ function _() {
33
+ if (n.value)
34
+ return;
27
35
  const l = h("left");
28
- T(l);
36
+ C(l);
29
37
  }
30
- function _() {
38
+ function L() {
39
+ if (n.value)
40
+ return;
31
41
  const l = h("right");
32
42
  w(l);
33
43
  }
34
44
  function R() {
45
+ if (n.value)
46
+ return;
35
47
  const l = h(void 0);
36
- V(l);
48
+ F(l);
37
49
  }
38
- function F() {
39
- x("update:open", !o.open);
50
+ function B() {
51
+ T("update:open", !o.open);
40
52
  }
41
- function L() {
53
+ function I() {
42
54
  const l = o.value;
43
55
  l.show = !1, l.children?.forEach((i) => i.show = !1);
44
56
  }
45
- return (l, i) => (n(), v("div", {
46
- class: t(e(a)())
57
+ return (l, i) => (s(), k("div", {
58
+ class: a(e(t)())
47
59
  }, [
48
- p("span", {
49
- class: t(e(a)("left"))
60
+ f("span", {
61
+ class: a(e(t)("left"))
50
62
  }, [
51
- s(e(I), {
52
- class: t(e(m)("left", "holder")),
63
+ r(e(D), {
64
+ class: a(e(v)("left", "holder")),
53
65
  style: { "font-size": "16px", color: "#abb7cc" }
54
66
  }, null, 8, ["class"]),
55
- p("span", {
56
- class: t(e(m)("left", "indicator")),
57
- onClick: F
67
+ f("span", {
68
+ class: a(e(v)("left", "indicator")),
69
+ onClick: B
58
70
  }, [
59
- l.value.children?.length ? (n(), v("img", {
71
+ l.value.children?.length ? (s(), k("img", {
60
72
  key: 0,
61
- src: o.open ? e(M) : e(A)
62
- }, null, 8, q)) : c("", !0)
73
+ src: o.open ? e(H) : e(U)
74
+ }, null, 8, P)) : u("", !0)
63
75
  ], 2),
64
- p("span", {
65
- class: t([e(m)("left", "label-wrapper"), e(C)("level2", o.level === 2)])
76
+ f("span", {
77
+ class: a([e(v)("left", "label-wrapper"), e(y)("level2", o.level === 2)])
66
78
  }, [
67
- (n(), r(E(e(U)(l.value.label))))
79
+ (s(), d(A(e(G)(l.value.label))))
68
80
  ], 2)
69
81
  ], 2),
70
- p("span", {
71
- class: t(e(a)("right"))
82
+ f("span", {
83
+ class: a(e(t)("right"))
72
84
  }, [
73
- s(e(z), null, {
74
- default: u(() => [
75
- o.level !== 2 && l.value.fixed !== "left" ? (n(), r(e(f), {
85
+ r(e(M), null, {
86
+ default: p(() => [
87
+ o.level !== 2 && l.value.fixed !== "left" ? (s(), d(e(m), {
76
88
  key: 0,
77
- title: e(d)("ap.apTable.setting.fixToLeft")
89
+ title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.fixToLeft")
78
90
  }, {
79
- default: u(() => [
80
- s(e(g), {
91
+ default: p(() => [
92
+ r(e(b), {
81
93
  rotate: 270,
82
- class: t(e(a)("action-icon")),
83
- onClick: y
94
+ class: a([
95
+ e(t)("action-icon"),
96
+ { [e(t)("action-icon-disabled")]: n.value }
97
+ ]),
98
+ onClick: _
84
99
  }, null, 8, ["class"])
85
100
  ]),
86
101
  _: 1
87
- }, 8, ["title"])) : c("", !0),
88
- o.level !== 2 && l.value.fixed ? (n(), r(e(f), {
102
+ }, 8, ["title"])) : u("", !0),
103
+ o.level !== 2 && l.value.fixed ? (s(), d(e(m), {
89
104
  key: 1,
90
- title: e(d)("ap.apTable.setting.unFixed")
105
+ title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.unFixed")
91
106
  }, {
92
- default: u(() => [
93
- s(e(O), {
94
- class: t(e(a)("action-icon")),
107
+ default: p(() => [
108
+ r(e(j), {
109
+ class: a([
110
+ e(t)("action-icon"),
111
+ { [e(t)("action-icon-disabled")]: n.value }
112
+ ]),
95
113
  onClick: R
96
114
  }, null, 8, ["class"])
97
115
  ]),
98
116
  _: 1
99
- }, 8, ["title"])) : c("", !0),
100
- o.level !== 2 && l.value.fixed !== "right" ? (n(), r(e(f), {
117
+ }, 8, ["title"])) : u("", !0),
118
+ o.level !== 2 && l.value.fixed !== "right" ? (s(), d(e(m), {
101
119
  key: 2,
102
- title: e(d)("ap.apTable.setting.fixToRight")
120
+ title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.fixToRight")
103
121
  }, {
104
- default: u(() => [
105
- s(e(g), {
122
+ default: p(() => [
123
+ r(e(b), {
106
124
  rotate: 90,
107
- class: t(e(a)("action-icon")),
108
- onClick: _
125
+ class: a([
126
+ e(t)("action-icon"),
127
+ { [e(t)("action-icon-disabled")]: n.value }
128
+ ]),
129
+ onClick: L
109
130
  }, null, 8, ["class"])
110
131
  ]),
111
132
  _: 1
112
- }, 8, ["title"])) : c("", !0),
113
- l.value.disabled ? c("", !0) : (n(), r(e(f), {
133
+ }, 8, ["title"])) : u("", !0),
134
+ l.value.disabled ? u("", !0) : (s(), d(e(m), {
114
135
  key: 3,
115
- title: e(d)("ap.apTable.setting.delete")
136
+ title: e(c)("ap.apTable.setting.delete")
116
137
  }, {
117
- default: u(() => [
118
- s(e(D), {
119
- class: t(e(a)("action-icon")),
120
- onClick: L
138
+ default: p(() => [
139
+ r(e(z), {
140
+ class: a(e(t)("action-icon")),
141
+ onClick: I
121
142
  }, null, 8, ["class"])
122
143
  ]),
123
144
  _: 1
@@ -130,5 +151,5 @@ const q = ["src"], ee = /* @__PURE__ */ B({
130
151
  }
131
152
  });
132
153
  export {
133
- ee as default
154
+ ne as default
134
155
  };
@@ -1,7 +1,7 @@
1
- import { singleRow as a, resetComponent as r } from "../../style/index.mjs";
2
- import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs";
3
- import { defaultValue as n } from "./index.mjs";
4
- const o = (e) => {
1
+ import { singleRow as a, resetComponent as t } from "../../style/index.mjs";
2
+ import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
3
+ import { defaultValue as o } from "./index.mjs";
4
+ const p = (e) => {
5
5
  const { componentCls: l, namespace: i } = e;
6
6
  return {
7
7
  [l]: {
@@ -90,7 +90,7 @@ const o = (e) => {
90
90
  }
91
91
  }
92
92
  };
93
- }, p = (e) => {
93
+ }, c = (e) => {
94
94
  const { componentCls: l } = e;
95
95
  return {
96
96
  [l]: {
@@ -107,8 +107,8 @@ const o = (e) => {
107
107
  }
108
108
  }
109
109
  };
110
- }, c = (e) => {
111
- const { componentCls: l } = e, i = `${l}-sortable-item-meta`;
110
+ }, d = (e) => {
111
+ const { componentCls: l } = e, i = `${l}-sortable-item-meta`, r = `${i}-action-icon`;
112
112
  return {
113
113
  [l]: {
114
114
  [i]: {
@@ -158,15 +158,18 @@ const o = (e) => {
158
158
  ".is-level2": {
159
159
  marginInlineStart: e.spaceXL
160
160
  },
161
- "&-action-item": {
162
- "&:hover": {
161
+ [r]: {
162
+ [`&:not(${r}-disabled):hover`]: {
163
163
  color: e.colorPrimary
164
164
  }
165
+ },
166
+ [`${r}-disabled`]: {
167
+ color: e.antdv.colorTextDisabled
165
168
  }
166
169
  }
167
170
  }
168
171
  };
169
- }, d = (e) => {
172
+ }, s = (e) => {
170
173
  const { componentCls: l } = e;
171
174
  return {
172
175
  [l]: {
@@ -177,7 +180,7 @@ const o = (e) => {
177
180
  }
178
181
  }
179
182
  };
180
- }, s = (e) => {
183
+ }, g = (e) => {
181
184
  const { componentCls: l } = e;
182
185
  return {
183
186
  [l]: {
@@ -197,7 +200,7 @@ const o = (e) => {
197
200
  paddingInline: "20px",
198
201
  paddingBlock: e.spaceXL,
199
202
  "&-title": {
200
- ...r(e),
203
+ ...t(e),
201
204
  fontWeight: "bold",
202
205
  color: e.textColor1
203
206
  }
@@ -213,7 +216,7 @@ const o = (e) => {
213
216
  }
214
217
  }
215
218
  };
216
- }, g = (e) => {
219
+ }, m = (e) => {
217
220
  const { componentCls: l } = e;
218
221
  return {
219
222
  [l]: {
@@ -233,7 +236,7 @@ const o = (e) => {
233
236
  }
234
237
  }
235
238
  };
236
- }, m = (e) => {
239
+ }, f = (e) => {
237
240
  const { componentCls: l } = e, i = `${e.componentCls}-template-item`;
238
241
  return {
239
242
  [l]: {
@@ -279,26 +282,26 @@ const o = (e) => {
279
282
  }
280
283
  }
281
284
  };
282
- }, S = t(
285
+ }, S = n(
283
286
  "ApTable.Setting",
284
287
  (e) => [
285
- o(e),
286
288
  p(e),
287
- d(e),
288
289
  c(e),
289
290
  s(e),
290
- m(e),
291
- g(e)
291
+ d(e),
292
+ g(e),
293
+ f(e),
294
+ m(e)
292
295
  ],
293
- n
296
+ o
294
297
  );
295
298
  export {
296
299
  S as default,
297
- p as genTableSettingSelectGroupStyle,
298
- c as genTableSettingSortableItemMetaStyle,
299
- d as genTableSettingSortableItemStyle,
300
- s as genTableSettingSorterStyle,
301
- o as genTableSettingStyle,
302
- m as genTableSettingTemplateItemStyle,
303
- g as genTableSettingTemplateListStyle
300
+ c as genTableSettingSelectGroupStyle,
301
+ d as genTableSettingSortableItemMetaStyle,
302
+ s as genTableSettingSortableItemStyle,
303
+ g as genTableSettingSorterStyle,
304
+ p as genTableSettingStyle,
305
+ f as genTableSettingTemplateItemStyle,
306
+ m as genTableSettingTemplateListStyle
304
307
  };
@@ -127,7 +127,9 @@ export interface ModalLayoutProps {
127
127
  /** modal-layout配置 */
128
128
  export interface ModalLayoutConfig<T = any> extends ModalLayoutProps {
129
129
  /** 右侧标题插槽 */
130
- rightTitle?: (selectedCount: number) => any;
130
+ rightTitle?: (config: {
131
+ count: number;
132
+ }) => any;
131
133
  /** 右侧底部插槽 */
132
134
  rightBottom?: (props: {
133
135
  records: T[];
@@ -27,7 +27,9 @@ export declare function getModalLayoutConfig(props?: ModalLayoutConfig): {
27
27
  deleteCurrent: () => void;
28
28
  };
29
29
  }) => any) | undefined;
30
- rightTitle: ((selectedCount: number) => any) | undefined;
30
+ rightTitle: ((config: {
31
+ count: number;
32
+ }) => any) | undefined;
31
33
  rightBottom: ((props: {
32
34
  records: any[];
33
35
  actions: {