@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.
- package/es/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/tooltip/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/tooltip/index.vue2.mjs +29 -0
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +94 -87
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +28 -22
- package/es/src/ag-grid/index.vue.mjs +164 -161
- package/es/src/ag-grid/interface.d.ts +5 -1
- package/es/src/ap-download/ap-download.vue.mjs +31 -25
- package/es/src/ap-form/ap-form.vue.d.ts +2 -6
- package/es/src/ap-form/ap-form.vue2.mjs +71 -69
- package/es/src/ap-grid/editable/form-item.vue.mjs +74 -71
- package/es/src/ap-grid/editable/index.vue.mjs +94 -91
- package/es/src/ap-grid/index.vue.mjs +74 -69
- package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue2.mjs +72 -69
- package/es/src/ap-tag/ap-tag-group.vue.mjs +33 -30
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +103 -103
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
- package/es/src/business/ap-attachment/ApAttachment.mjs +16 -15
- package/es/src/business/ap-copy/ApCopy.mjs +5 -6
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +176 -175
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +4 -4
- package/es/src/business/ap-label/ApLabel.d.ts +1 -1
- package/es/src/business/ap-label/index.d.ts +3 -3
- package/es/src/business/hooks/usePageListApTable.mjs +10 -9
- package/es/src/editable-table/form-item.vue.mjs +75 -72
- package/es/src/editable-table/hooks/use-get-columns.mjs +35 -34
- package/es/src/editable-table/index.vue.mjs +68 -65
- package/es/src/utils/warning.d.ts +25 -0
- package/es/src/utils/warning.mjs +74 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/tooltip/index.vue.js +1 -0
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +5 -1
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -6
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
- package/lib/src/business/ap-label/index.d.ts +3 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/utils/warning.d.ts +25 -0
- package/lib/src/utils/warning.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +5 -1
- package/theme/ag-grid/index.less +5 -1
- 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,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
|
|
2
|
-
import { rendererMap as
|
|
3
|
-
import { isNumber as
|
|
4
|
-
import {
|
|
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
|
|
9
|
-
import { isDef as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
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:
|
|
26
|
+
column: l,
|
|
25
27
|
text: r.value
|
|
26
28
|
});
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
30
|
-
{ ...
|
|
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
|
|
42
|
+
return d(p);
|
|
41
43
|
}
|
|
42
44
|
return P(r.value);
|
|
43
45
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
|
86
|
-
field:
|
|
87
|
-
colId:
|
|
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:
|
|
103
|
-
const
|
|
112
|
+
cellClass: n((s) => {
|
|
113
|
+
const x = e.cellClass || "", D = y(x) ? x(s.data, s.node) : x;
|
|
104
114
|
return [
|
|
105
|
-
`${
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
117
|
-
...
|
|
122
|
+
...b(e),
|
|
123
|
+
...h(e)
|
|
118
124
|
};
|
|
119
125
|
return e.children?.length ? {
|
|
120
|
-
...
|
|
121
|
-
headerGroupComponent:
|
|
126
|
+
...o,
|
|
127
|
+
headerGroupComponent: v,
|
|
122
128
|
headerGroupComponentParams: {
|
|
123
129
|
column: e
|
|
124
130
|
},
|
|
125
|
-
children:
|
|
126
|
-
} :
|
|
131
|
+
children: i(e.children)
|
|
132
|
+
} : o;
|
|
127
133
|
});
|
|
128
134
|
}
|
|
129
|
-
return
|
|
130
|
-
}),
|
|
135
|
+
return i(t);
|
|
136
|
+
}), w = T(
|
|
131
137
|
() => ({
|
|
132
|
-
headerComponent:
|
|
133
|
-
resizable:
|
|
138
|
+
headerComponent: v,
|
|
139
|
+
resizable: l.columnResizable,
|
|
134
140
|
suppressMovable: !0,
|
|
135
141
|
cellDataType: !1
|
|
136
142
|
})
|
|
137
143
|
);
|
|
138
144
|
return {
|
|
139
|
-
columnDefs:
|
|
140
|
-
defaultColDef:
|
|
145
|
+
columnDefs: g,
|
|
146
|
+
defaultColDef: w,
|
|
147
|
+
gridWrapperRef: u
|
|
141
148
|
};
|
|
142
149
|
};
|
|
143
150
|
export {
|
|
144
|
-
|
|
151
|
+
X as useColumnsDef
|
|
145
152
|
};
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { isFunction as
|
|
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
|
|
7
|
-
return
|
|
6
|
+
function p(t) {
|
|
7
|
+
return t?.bottom?.length || t?.top?.length;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
9
|
+
const v = (t, c) => s(() => {
|
|
10
|
+
if (!t.rowSelection)
|
|
11
11
|
return;
|
|
12
|
-
const
|
|
12
|
+
const o = t.rowSelection === !0 ? {} : t.rowSelection, i = {
|
|
13
13
|
sortable: !1,
|
|
14
14
|
resizable: !1,
|
|
15
|
-
width: a(
|
|
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
|
|
18
|
-
if (
|
|
19
|
-
(
|
|
20
|
-
) ? "left" : void 0),
|
|
21
|
-
const { cellClassName:
|
|
22
|
-
|
|
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:
|
|
25
|
-
colDef:
|
|
26
|
-
rowIndex:
|
|
30
|
+
data: n,
|
|
31
|
+
colDef: f,
|
|
32
|
+
rowIndex: u
|
|
27
33
|
}) => {
|
|
28
|
-
if (!(!r.rowPinned || !
|
|
29
|
-
return
|
|
30
|
-
},
|
|
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
|
|
38
|
+
return i;
|
|
33
39
|
});
|
|
34
40
|
export {
|
|
35
|
-
|
|
41
|
+
v as default
|
|
36
42
|
};
|