@aplus-frontend/ui 6.33.0 → 6.35.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 (70) hide show
  1. package/es/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
  2. package/es/src/ag-grid/components/tooltip/index.vue.mjs +4 -0
  3. package/es/src/ag-grid/components/tooltip/index.vue2.mjs +29 -0
  4. package/es/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
  5. package/es/src/ag-grid/hooks/use-columns-def.mjs +94 -87
  6. package/es/src/ag-grid/hooks/use-selection-col-def.mjs +28 -22
  7. package/es/src/ag-grid/index.vue.mjs +164 -161
  8. package/es/src/ag-grid/interface.d.ts +5 -1
  9. package/es/src/ap-download/ap-download.vue.mjs +31 -25
  10. package/es/src/ap-form/ap-form.vue.d.ts +2 -6
  11. package/es/src/ap-form/ap-form.vue2.mjs +71 -69
  12. package/es/src/ap-grid/editable/form-item.vue.mjs +74 -71
  13. package/es/src/ap-grid/editable/index.vue.mjs +94 -91
  14. package/es/src/ap-grid/index.vue.mjs +74 -69
  15. package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
  16. package/es/src/ap-table/ap-table.vue2.mjs +72 -69
  17. package/es/src/ap-tag/ap-tag-group.vue.mjs +33 -30
  18. package/es/src/ap-upload/components/SingleFile.vue2.mjs +103 -103
  19. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
  20. package/es/src/business/ap-attachment/ApAttachment.mjs +16 -15
  21. package/es/src/business/ap-copy/ApCopy.mjs +5 -6
  22. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +176 -175
  23. package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +4 -4
  24. package/es/src/business/ap-label/ApLabel.d.ts +1 -1
  25. package/es/src/business/ap-label/index.d.ts +3 -3
  26. package/es/src/business/hooks/usePageListApTable.mjs +10 -9
  27. package/es/src/editable-table/form-item.vue.mjs +75 -72
  28. package/es/src/editable-table/hooks/use-get-columns.mjs +35 -34
  29. package/es/src/editable-table/index.vue.mjs +68 -65
  30. package/es/src/utils/warning.d.ts +25 -0
  31. package/es/src/utils/warning.mjs +74 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
  35. package/lib/src/ag-grid/components/tooltip/index.vue.js +1 -0
  36. package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -0
  37. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
  38. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  39. package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -1
  40. package/lib/src/ag-grid/index.vue.js +1 -1
  41. package/lib/src/ag-grid/interface.d.ts +5 -1
  42. package/lib/src/ap-download/ap-download.vue.js +1 -1
  43. package/lib/src/ap-form/ap-form.vue.d.ts +2 -6
  44. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  45. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  46. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  47. package/lib/src/ap-grid/index.vue.js +1 -1
  48. package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
  49. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  50. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  51. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  52. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  53. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  54. package/lib/src/business/ap-copy/ApCopy.js +1 -1
  55. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  56. package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -1
  57. package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
  58. package/lib/src/business/ap-label/index.d.ts +3 -3
  59. package/lib/src/business/hooks/usePageListApTable.js +1 -1
  60. package/lib/src/editable-table/form-item.vue.js +1 -1
  61. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  62. package/lib/src/editable-table/index.vue.js +1 -1
  63. package/lib/src/utils/warning.d.ts +25 -0
  64. package/lib/src/utils/warning.js +1 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +1 -1
  68. package/theme/ag-grid/index.css +5 -1
  69. package/theme/ag-grid/index.less +5 -1
  70. package/theme/index.css +5 -1
@@ -0,0 +1,6 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ params: any;
4
+ };
5
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as p, ref as m, onMounted as u, createElementBlock as d, createCommentVNode as f, openBlock as g, normalizeClass as v, unref as C, toDisplayString as _ } from "vue";
2
+ import "../../../config-provider/index.mjs";
3
+ import { useNamespace as x } from "../../../config-provider/hooks/use-namespace.mjs";
4
+ const w = /* @__PURE__ */ p({
5
+ __name: "index",
6
+ props: {
7
+ params: {}
8
+ },
9
+ setup(l) {
10
+ const n = l, e = m(!1), { e: s } = x("ag-grid");
11
+ return u(() => {
12
+ const { rowIndex: o, column: t, gridWrapperRef: c, lineClamp: i } = n.params, r = c.value?.querySelector(
13
+ `div.ag-row[row-index="${o}"] .ag-cell[col-id="${t.colId}"] span.ag-cell-value`
14
+ );
15
+ if (!r) {
16
+ e.value = !0;
17
+ return;
18
+ }
19
+ const a = i === 1 ? "Width" : "Height";
20
+ e.value = r[`scroll${a}`] > r[`client${a}`];
21
+ }), (o, t) => e.value ? (g(), d("div", {
22
+ key: 0,
23
+ class: v(C(s)("tooltip"))
24
+ }, _(o.params.value), 3)) : f("", !0);
25
+ }
26
+ });
27
+ export {
28
+ w as default
29
+ };
@@ -10,4 +10,5 @@ import { Ref, ComputedRef } from 'vue';
10
10
  export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc) => {
11
11
  columnDefs: ComputedRef<(ColDef<any, any> | ColGroupDef<any>)[]>;
12
12
  defaultColDef: ComputedRef<ColDef<any, any>>;
13
+ gridWrapperRef: Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
13
14
  };
@@ -1,33 +1,35 @@
1
- import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
2
- import { rendererMap as h } from "../renderer/index.mjs";
3
- import { isNumber as p, isFunction as b } from "lodash-unified";
4
- import { computed as v, unref as T } from "vue";
1
+ import { getTableRenderProps as m, objectToString as P } from "../../ap-table/utils.mjs";
2
+ import { rendererMap as c } from "../renderer/index.mjs";
3
+ import { isNumber as f, isFunction as y } from "lodash-unified";
4
+ import { ref as R, unref as C, computed as T } from "vue";
5
5
  import "../components/body-cell/index.vue.mjs";
6
6
  import "../components/header-cell/index.vue.mjs";
7
+ import "../components/tooltip/index.vue.mjs";
7
8
  import "../../config-provider/index.mjs";
8
- import { dataIndexToField as R } from "../../ap-grid/utils/col.mjs";
9
- import { isDef as D } from "../../utils/index.mjs";
10
- import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
11
- import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
12
- import G from "../components/body-cell/index.vue2.mjs";
13
- import C from "../components/header-cell/index.vue2.mjs";
14
- function _(r) {
15
- return p(r) && r > 1;
9
+ import { dataIndexToField as I } from "../../ap-grid/utils/col.mjs";
10
+ import { isDef as S } from "../../utils/index.mjs";
11
+ import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
12
+ import { useNamespace as G } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import W from "../components/body-cell/index.vue2.mjs";
14
+ import z from "../components/tooltip/index.vue2.mjs";
15
+ import v from "../components/header-cell/index.vue2.mjs";
16
+ function F(r) {
17
+ return f(r) && r > 1;
16
18
  }
17
- function z(r, i) {
18
- if (i.bodyCellTooltip)
19
- return b(i.bodyCellTooltip) ? i.bodyCellTooltip(r.value, r.data) : i.bodyCellTooltip;
20
- if (i.renderText)
21
- return i.renderText({
19
+ function M(r, l) {
20
+ if (l.bodyCellTooltip)
21
+ return y(l.bodyCellTooltip) ? l.bodyCellTooltip(r.value, r.data) : l.bodyCellTooltip;
22
+ if (l.renderText)
23
+ return l.renderText({
22
24
  value: r.value,
23
25
  record: r.data,
24
- column: i,
26
+ column: l,
25
27
  text: r.value
26
28
  });
27
- const s = i.valueType || "text", n = h[s];
28
- if (n) {
29
- const u = y(
30
- { ...i, valueType: s },
29
+ const n = l.valueType || "text", d = c[n];
30
+ if (d) {
31
+ const p = m(
32
+ { ...l, valueType: n },
31
33
  {
32
34
  value: r.value,
33
35
  text: r.value,
@@ -37,54 +39,62 @@ function z(r, i) {
37
39
  pinned: r.node?.rowPinned
38
40
  }
39
41
  );
40
- return n(u);
42
+ return d(p);
41
43
  }
42
44
  return P(r.value);
43
45
  }
44
- const J = (r, i, s) => {
45
- const n = I("valueTypeMap"), { em: f } = S("ag-grid"), u = v(() => {
46
- const g = T(r), m = (a) => {
47
- const e = {
48
- cellRenderer: G,
49
- cellRendererParams: {
50
- column: a,
51
- extraValueType: T(n)
52
- }
53
- };
54
- if (a.customRender)
55
- return e;
56
- if (a.renderText)
57
- return {
58
- valueFormatter: (t) => a.renderText({
59
- value: t.value,
60
- record: t.data,
61
- column: a,
62
- text: t.value
63
- })
64
- };
65
- const d = a.valueType || "text", l = h[d];
66
- return l ? {
67
- valueFormatter: (t) => {
68
- const o = y(
69
- { ...a, valueType: d },
70
- {
71
- value: t.value,
72
- text: t.value,
73
- record: t.data,
74
- column: t.column,
75
- rowIndex: t.node?.rowIndex,
76
- pinned: t.node?.rowPinned
77
- }
78
- );
79
- return l(o);
80
- }
81
- } : e;
46
+ const X = (r, l, n) => {
47
+ const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), h = (t) => {
48
+ const i = {
49
+ cellRenderer: W,
50
+ cellRendererParams: {
51
+ column: t,
52
+ extraValueType: C(d)
53
+ }
82
54
  };
83
- function x(a) {
55
+ if (t.customRender)
56
+ return i;
57
+ if (t.renderText)
58
+ return {
59
+ valueFormatter: (o) => t.renderText({
60
+ value: o.value,
61
+ record: o.data,
62
+ column: t,
63
+ text: o.value
64
+ })
65
+ };
66
+ const a = t.valueType || "text", e = c[a];
67
+ return e ? {
68
+ valueFormatter: (o) => {
69
+ const s = m(
70
+ { ...t, valueType: a },
71
+ {
72
+ value: o.value,
73
+ text: o.value,
74
+ record: o.data,
75
+ column: o.column,
76
+ rowIndex: o.node?.rowIndex,
77
+ pinned: o.node?.rowPinned
78
+ }
79
+ );
80
+ return e(s);
81
+ }
82
+ } : i;
83
+ }, b = (t) => {
84
+ const i = {}, a = t.bodyCellTooltip || !t.customRender && (t.ellipsis === !0 || t.ellipsis === "tooltip" || f(t.ellipsis)), e = f(t.ellipsis) && t.ellipsis > 1, o = f(t.ellipsis) ? t.ellipsis : 1;
85
+ return i.tooltipValueGetter = a ? (s) => M(s, t) : void 0, i.wrapText = !t.ellipsis || e, i.cellStyle = {
86
+ "--ag-grid-line-clamp": o
87
+ }, i.tooltipComponent = z, i.tooltipComponentParams = {
88
+ lineClamp: o,
89
+ gridWrapperRef: u
90
+ }, i;
91
+ }, g = T(() => {
92
+ const t = C(r);
93
+ function i(a) {
84
94
  return a.map((e) => {
85
- const d = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || p(e.ellipsis)), l = {
86
- field: R(e.dataIndex),
87
- colId: D(e.key) ? String(e.key) : void 0,
95
+ const o = {
96
+ field: I(e.dataIndex),
97
+ colId: S(e.key) ? String(e.key) : void 0,
88
98
  sortable: !!e.sorter,
89
99
  comparator: e.sorter === !0 ? () => 0 : e.sorter,
90
100
  headerComponentParams: {
@@ -99,47 +109,44 @@ const J = (r, i, s) => {
99
109
  pinned: e.fixed || null,
100
110
  // undefined to null
101
111
  colSpan: e.colSpan,
102
- cellClass: s((t) => {
103
- const o = e.cellClass || "", w = b(o) ? o(t.data, t.node) : o;
112
+ cellClass: n((s) => {
113
+ const x = e.cellClass || "", D = y(x) ? x(s.data, s.node) : x;
104
114
  return [
105
- `${f("cell", e.align || "left")}`,
106
- _(e.ellipsis) ? f("cell", "multiline") : null,
107
- w
115
+ `${p("cell", e.align || "left")}`,
116
+ F(e.ellipsis) ? p("cell", "multiline") : null,
117
+ D
108
118
  ].flat().filter(Boolean);
109
119
  }),
110
- cellStyle: {
111
- "--ag-grid-line-clamp": p(e.ellipsis) ? e.ellipsis : 1
112
- },
113
- wrapText: !e.ellipsis || p(e.ellipsis) && e.ellipsis > 1,
114
120
  autoHeight: !0,
115
121
  // 设置自动计算高度以自适应多行换行的场景
116
- tooltipValueGetter: d ? (t) => z(t, e) : void 0,
117
- ...m(e)
122
+ ...b(e),
123
+ ...h(e)
118
124
  };
119
125
  return e.children?.length ? {
120
- ...l,
121
- headerGroupComponent: C,
126
+ ...o,
127
+ headerGroupComponent: v,
122
128
  headerGroupComponentParams: {
123
129
  column: e
124
130
  },
125
- children: x(e.children)
126
- } : l;
131
+ children: i(e.children)
132
+ } : o;
127
133
  });
128
134
  }
129
- return x(g);
130
- }), c = v(
135
+ return i(t);
136
+ }), w = T(
131
137
  () => ({
132
- headerComponent: C,
133
- resizable: i.columnResizable,
138
+ headerComponent: v,
139
+ resizable: l.columnResizable,
134
140
  suppressMovable: !0,
135
141
  cellDataType: !1
136
142
  })
137
143
  );
138
144
  return {
139
- columnDefs: u,
140
- defaultColDef: c
145
+ columnDefs: g,
146
+ defaultColDef: w,
147
+ gridWrapperRef: u
141
148
  };
142
149
  };
143
150
  export {
144
- J as useColumnsDef
151
+ X as useColumnsDef
145
152
  };
@@ -1,36 +1,42 @@
1
- import { computed as u } from "vue";
2
- import { isFunction as s } from "lodash-unified";
1
+ import { computed as s } from "vue";
2
+ import { isFunction as m } from "lodash-unified";
3
3
  import "../../ap-grid/index.mjs";
4
4
  import { pxToNumber as a } from "../utils.mjs";
5
5
  import { ROW_SELECTION_FIELD as d } from "../../ap-grid/constants.mjs";
6
- function w(e) {
7
- return e?.bottom?.length || e?.top?.length;
6
+ function p(t) {
7
+ return t?.bottom?.length || t?.top?.length;
8
8
  }
9
- const D = (e, l) => u(() => {
10
- if (!e.rowSelection)
9
+ const v = (t, c) => s(() => {
10
+ if (!t.rowSelection)
11
11
  return;
12
- const n = e.rowSelection === !0 ? {} : e.rowSelection, o = {
12
+ const o = t.rowSelection === !0 ? {} : t.rowSelection, i = {
13
13
  sortable: !1,
14
14
  resizable: !1,
15
- width: a(n.columnWidth, 60)
15
+ width: a(o.columnWidth, 60),
16
+ tooltipValueGetter: o.tooltip ? ({ node: e }) => {
17
+ if (typeof o.tooltip == "string")
18
+ return o.tooltip;
19
+ const r = !e?.selectable, n = !!e?.isSelected();
20
+ return o.tooltip(n, r, e);
21
+ } : void 0
16
22
  };
17
- let i = n.fixed;
18
- if (i === void 0 && (i = l.value.some(
19
- (t) => t.fixed === "left" || t.fixed === !0
20
- ) ? "left" : void 0), o.pinned = i, w(e.summary)) {
21
- const { cellClassName: t } = e.summary;
22
- o.cellClass = ({
23
+ let l = o.fixed;
24
+ if (l === void 0 && (l = c.value.some(
25
+ (e) => e.fixed === "left" || e.fixed === !0
26
+ ) ? "left" : void 0), i.pinned = l, p(t.summary)) {
27
+ const { cellClassName: e } = t.summary;
28
+ i.cellClass = ({
23
29
  node: r,
24
- data: f,
25
- colDef: c,
26
- rowIndex: m
30
+ data: n,
31
+ colDef: f,
32
+ rowIndex: u
27
33
  }) => {
28
- if (!(!r.rowPinned || !t))
29
- return s(t) ? t(f, c, r.rowPinned, m) : t;
30
- }, o.cellRenderer = ({ data: r }) => r?.[d];
34
+ if (!(!r.rowPinned || !e))
35
+ return m(e) ? e(n, f, r.rowPinned, u) : e;
36
+ }, i.cellRenderer = ({ data: r }) => r?.[d];
31
37
  }
32
- return o;
38
+ return i;
33
39
  });
34
40
  export {
35
- D as default
41
+ v as default
36
42
  };