@aplus-frontend/ui 0.5.0 → 0.5.2
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/ap-grid/hooks/use-load-vxe.d.ts +1 -0
- package/es/src/ap-grid/hooks/use-load-vxe.mjs +32 -0
- package/es/src/ap-grid/index.vue.mjs +141 -137
- package/es/src/ap-grid/interface.d.ts +2 -2
- package/es/src/ap-grid/utils/col.mjs +95 -65
- package/es/src/ap-table/ap-table.vue2.mjs +148 -144
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +1 -0
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +33 -26
- package/lib/src/ap-grid/hooks/use-load-vxe.d.ts +1 -0
- package/lib/src/ap-grid/hooks/use-load-vxe.js +1 -0
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +2 -2
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +1 -0
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue2.js +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { isUndefined as S, isArray as
|
|
3
|
-
import { valueEnumToArray as
|
|
1
|
+
import { createVNode as F, Fragment as M } from "vue";
|
|
2
|
+
import { isUndefined as S, isArray as c, isString as v, isBoolean as A, isNumber as B, pick as R } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as N, getTableTitle as E, getTableRenderType as W, getTableRenderProps as _, getTableCellRenderNode as j } from "../../ap-table/utils.mjs";
|
|
4
|
+
import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
|
|
5
|
+
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
|
+
import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
4
7
|
function O(e) {
|
|
5
8
|
if (!S(e))
|
|
6
|
-
return
|
|
9
|
+
return c(e) ? e.reduce((r, t) => v(t) ? `${r}.${t}` : `${r}[${t}]`, "") : String(e);
|
|
7
10
|
}
|
|
8
|
-
function
|
|
11
|
+
function b(e) {
|
|
9
12
|
if (e)
|
|
10
13
|
return e === !0 ? "left" : e;
|
|
11
14
|
}
|
|
12
15
|
function G(e) {
|
|
13
|
-
return
|
|
16
|
+
return A(e) ? {
|
|
14
17
|
sortable: e
|
|
15
18
|
} : e ? {
|
|
16
19
|
sortable: !0,
|
|
@@ -20,87 +23,114 @@ function G(e) {
|
|
|
20
23
|
sortable: !1
|
|
21
24
|
};
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function I(e) {
|
|
24
27
|
let r;
|
|
25
|
-
return
|
|
26
|
-
label: v(
|
|
27
|
-
value:
|
|
28
|
+
return A(e.filters) && e.valueEnum ? r = N(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((t) => ({
|
|
29
|
+
label: v(t.text) ? t.text : "",
|
|
30
|
+
value: t.value
|
|
28
31
|
}));
|
|
29
32
|
}
|
|
30
|
-
function
|
|
33
|
+
function L(e) {
|
|
31
34
|
if (e)
|
|
32
35
|
return (r) => e(r.value, r.row);
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
37
|
+
function U(e, r, t) {
|
|
38
|
+
return e ? B(e) ? {
|
|
39
|
+
tooltip: t,
|
|
40
|
+
rows: e
|
|
41
|
+
} : e === !0 || e === "tooltip" ? {
|
|
42
|
+
tooltip: t,
|
|
43
|
+
rows: 1
|
|
44
|
+
} : {
|
|
45
|
+
tooltip: null,
|
|
46
|
+
rows: 1,
|
|
47
|
+
htmlTitle: e === "title" ? r : ""
|
|
48
|
+
} : !1;
|
|
49
|
+
}
|
|
50
|
+
function V(e, r, t) {
|
|
51
|
+
if (k.includes(e.valueType))
|
|
52
|
+
return t;
|
|
53
|
+
if (e.copyable || e.ellipsis) {
|
|
54
|
+
const l = U(e.ellipsis, r, t);
|
|
55
|
+
return F(z, {
|
|
56
|
+
copyable: e.copyable,
|
|
57
|
+
ellipsis: l,
|
|
58
|
+
content: t
|
|
59
|
+
}, null);
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
39
62
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
function x(e, r, t) {
|
|
64
|
+
const l = R(e, ["width", "minWidth", "align"]);
|
|
65
|
+
return l.field = O(e.dataIndex), l.fixed = b(e.fixed), l.title = e.title, l.slots = {
|
|
66
|
+
header: () => E(e, t, void 0, r)
|
|
67
|
+
}, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
|
|
68
|
+
}
|
|
69
|
+
function o(e, r, t, l) {
|
|
70
|
+
const i = R(e, ["width", "minWidth", "align", "resizable"]);
|
|
71
|
+
i.field = O(e.dataIndex), i.fixed = b(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, G(e.sorter)), i.filters = I(e), i.filterMultiple = e.filterMultiple, i.filterMethod = L(e.onFilter), i.title = e.title;
|
|
72
|
+
const a = ({
|
|
73
|
+
value: d,
|
|
45
74
|
...n
|
|
46
75
|
}) => {
|
|
47
|
-
var
|
|
48
|
-
const
|
|
76
|
+
var T, y;
|
|
77
|
+
const f = W(e), p = _({
|
|
49
78
|
...e,
|
|
50
|
-
valueType:
|
|
79
|
+
valueType: f
|
|
51
80
|
}, {
|
|
52
|
-
value:
|
|
81
|
+
value: d,
|
|
53
82
|
...n
|
|
54
|
-
}),
|
|
55
|
-
value:
|
|
83
|
+
}), $ = j(f, p, n.record, l), h = ((T = e.renderText) == null ? void 0 : T.call(e, {
|
|
84
|
+
value: d,
|
|
56
85
|
...n
|
|
57
|
-
})) ||
|
|
58
|
-
|
|
59
|
-
value: s,
|
|
86
|
+
})) || d, w = e.renderText ? F(M, null, [(y = e.renderText) == null ? void 0 : y.call(e, {
|
|
87
|
+
value: d,
|
|
60
88
|
...n
|
|
61
|
-
})]) :
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
})]) : $;
|
|
90
|
+
let u = V(e, h, w);
|
|
91
|
+
return e.customRender && (u = e.customRender({
|
|
92
|
+
value: d,
|
|
64
93
|
...n,
|
|
65
94
|
column: e,
|
|
66
|
-
originalNode:
|
|
67
|
-
originalText:
|
|
68
|
-
})),
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
originalNode: u,
|
|
96
|
+
originalText: h
|
|
97
|
+
})), u;
|
|
98
|
+
}, s = ({
|
|
99
|
+
row: d,
|
|
100
|
+
rowIndex: n
|
|
101
|
+
}) => a({
|
|
102
|
+
value: d[i.field],
|
|
103
|
+
text: d[i.field],
|
|
104
|
+
record: d,
|
|
105
|
+
index: n,
|
|
106
|
+
renderIndex: n,
|
|
107
|
+
column: e
|
|
108
|
+
});
|
|
109
|
+
return i.slots = {
|
|
110
|
+
header: () => E(e, t, void 0, r),
|
|
111
|
+
default: s,
|
|
112
|
+
footer: s
|
|
113
|
+
}, i;
|
|
84
114
|
}
|
|
85
|
-
function
|
|
115
|
+
function X(e, r, t, l) {
|
|
86
116
|
var s;
|
|
87
117
|
if (!((s = e.children) != null && s.length))
|
|
88
|
-
return
|
|
89
|
-
function
|
|
90
|
-
return
|
|
91
|
-
var
|
|
92
|
-
if ((
|
|
93
|
-
const
|
|
94
|
-
return
|
|
118
|
+
return o(e, r, t, l);
|
|
119
|
+
function i(d) {
|
|
120
|
+
return d.map((n) => {
|
|
121
|
+
var f;
|
|
122
|
+
if ((f = n.children) != null && f.length) {
|
|
123
|
+
const p = x(n, r, t);
|
|
124
|
+
return p.children = i(n.children), p;
|
|
95
125
|
}
|
|
96
|
-
return
|
|
126
|
+
return o(n, r, t, l);
|
|
97
127
|
});
|
|
98
128
|
}
|
|
99
|
-
const
|
|
100
|
-
return
|
|
129
|
+
const a = x(e, r, t);
|
|
130
|
+
return a.children = i(e.children), a;
|
|
101
131
|
}
|
|
102
132
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
133
|
+
X as transformCol,
|
|
134
|
+
x as transformToColGroup,
|
|
135
|
+
o as transformToColumn
|
|
106
136
|
};
|